Previous 199869 Revisions Next

r17989 Tuesday 18th September, 2012 at 08:43:04 UTC by Miodrag Milanović
changed most of screen.machine() to machine() (no whatsnew)
[src/mame/drivers]1945kiii.c ace.c acefruit.c acommand.c adp.c albazc.c amaticmg.c aristmk4.c aristmk6.c astinvad.c astrocorp.c astrof.c atarisy4.c avt.c backfire.c berzerk.c bestleag.c bfcobra.c bingor.c blackt96.c blitz68k.c bmcbowl.c bmcpokr.c bnstars.c boxer.c buster.c cabaret.c calorie.c cardline.c carrera.c cb2001.c cball.c cham24.c champbas.c champbwl.c chanbara.c chihiro.c chinsan.c cmmb.c cntsteer.c cobra.c coinmvga.c coolridr.c cps3.c crystal.c cshooter.c cubeqst.c dacholer.c dblewing.c ddayjlc.c ddealer.c ddenlovr.c dec8.c deco156.c deco_ld.c destroyr.c discoboy.c diverboy.c dlair.c dmndrby.c dominob.c dreamwld.c drtomy.c dunhuang.c dwarfd.c egghunt.c esh.c expro02.c famibox.c fcrash.c feversoc.c firefox.c flipjack.c flyball.c fortecar.c funkball.c gal3.c galaxi.c galgame.c galpani3.c galpanic.c gamecstl.c go2000.c gpworld.c gstream.c guab.c halleys.c highvdeo.c hitme.c hitpoker.c hornet.c hotblock.c hvyunit.c igs009.c igs011.c igs017.c igs_m027.c igspoker.c intrscti.c istellar.c itgambl2.c itgambl3.c itgamble.c jackie.c jackpool.c jalmah.c jangou.c jantotsu.c jchan.c jclub2.c jollyjgr.c jpmsys5.c kingdrby.c laserbat.c lastfght.c lgp.c limenko.c looping.c luckgrln.c m63.c magicard.c majorpkr.c marinedt.c mastboy.c maygayv1.c mazerbla.c mediagx.c meritm.c mgolf.c midas.c mirage.c mirax.c missb2.c mjsister.c mlanding.c monzagp.c mpoker.c mpu4dealem.c mpu4vid.c multfish.c multigam.c murogem.c murogmbl.c mwarr.c namcos23.c neoprint.c nightgal.c nmg5.c norautp.c nwk-tr.c olibochu.c panicr.c pcxt.c photon.c pinkiri8.c poker72.c poo.c popobear.c powerbal.c progolf.c pturn.c pzletime.c quizpun2.c r2dx_v33.c rabbit.c raiden2.c rbmk.c rgum.c sandscrp.c sbrkout.c segac2.c segald.c seta.c sfbonus.c shanghai.c sigmab52.c sigmab98.c silvmil.c skyarmy.c snowbros.c speglsht.c spoker.c srmp5.c srmp6.c statriv2.c sub.c subsino2.c summit.c supdrapo.c superwng.c suprgolf.c taitotz.c taitowlf.c tasman.c tmaster.c tmmjprd.c trvmadns.c ttchamp.c tugboat.c twins.c umipoker.c vega.c viper.c vmetal.c vpoker.c vroulet.c witch.c zr107.c
[src/mame/machine]slikshot.c
[src/mame/video]1942.c 1943.c 20pacgal.c 40love.c 8080bw.c actfancr.c aeroboto.c aerofgt.c ajax.c aliens.c alpha68k.c ambush.c amiga.c amigaaga.c amspdwy.c angelkds.c appoooh.c aquarium.c arabian.c arcadecl.c argus.c arkanoid.c armedf.c asterix.c asuka.c atarifb.c atarig42.c atarigx2.c atarisy2.c bagman.c balsente.c baraduke.c batman.c battlane.c battlera.c battlex.c battlnts.c bbusters.c bigevglf.c bigstrkb.c bionicc.c bishi.c bking.c bladestl.c blktiger.c blmbycar.c blockhl.c bloodbro.c blueprnt.c bogeyman.c bombjack.c boogwing.c bosco.c brkthru.c bsktball.c btime.c bublbobl.c buggychl.c bwing.c cabal.c canyon.c capbowl.c carjmbre.c carpolo.c cave.c cbasebal.c cbuster.c ccastles.c cclimber.c centiped.c chaknpop.c champbas.c changela.c cheekyms.c cinemat.c circus.c circusc.c citycon.c cloak.c cloud9.c clshroad.c cninja.c combatsc.c commando.c compgolf.c contra.c cop01.c copsnrob.c cosmic.c cps1.c crbaloon.c crgolf.c crospang.c crshrace.c cvs.c darkmist.c darkseal.c dassault.c dbz.c dc.c dcon.c dday.c ddragon.c ddragon3.c ddribble.c deadang.c dec0.c dec8.c deco32.c deco_mlc.c decocass.c deniam.c dietgo.c digdug.c djmain.c dkong.c docastle.c dogfgt.c dooyong.c drgnmst.c dribling.c drmicro.c dynax.c dynduke.c epos.c eprom.c equites.c esd16.c espial.c exedexes.c exerion.c exidy.c exidy440.c exprraid.c exzisus.c f1gp.c fantland.c fastfred.c fastlane.c fcombat.c fgoal.c finalizr.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c foodf.c freekick.c funkybee.c funkyjet.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaelco3d.c gaiden.c galaga.c galastrm.c galaxia.c galaxian.c galaxold.c galivan.c galpani2.c galpanic.c galspnbl.c gaplus.c gberet.c gcpinbal.c gijoe.c ginganin.c gladiatr.c glass.c gng.c goal92.c goindol.c goldstar.c gomoku.c gotcha.c gottlieb.c gotya.c gradius3.c grchamp.c gridlee.c groundfx.c gstriker.c gsword.c gunbustr.c gunsmoke.c gyruss.c hcastle.c higemaru.c himesiki.c hnayayoi.c hng64.c holeland.c homedata.c homerun.c hyperspt.c hyprduel.c ikki.c inufuku.c irobot.c ironhors.c itech8.c jack.c jackal.c jailbrek.c jedi.c kan_panb.c kaneko16.c karnov.c kchamp.c kickgoal.c kingobox.c kncljoe.c konamigx.c ksayakyu.c kyugo.c labyrunr.c ladybug.c ladyfrog.c lasso.c lastduel.c lazercmd.c legionna.c leland.c lemmings.c lethal.c liberate.c lkage.c lockon.c lordgun.c lsasquad.c lwings.c m10.c m107.c m52.c m57.c m58.c m62.c m72.c m90.c m92.c macrossp.c madalien.c madmotor.c magmax.c mainevt.c mainsnk.c malzak.c mappy.c marineb.c mario.c markham.c matmania.c mcatadv.c mcr.c mcr3.c mcr68.c meadows.c megasys1.c megazone.c mermaid.c metlclsh.c metro.c mexico86.c midzeus.c midzeus2.c mikie.c mitchell.c mjkjidai.c model1.c model2.c model3.c momoko.c moo.c mouser.c mrdo.c mrflea.c mrjong.c ms32.c msisaac.c mugsmash.c munchmo.c mustache.c mystston.c mystwarr.c n64.c n8080.c namcofl.c namcona1.c namconb1.c namcos1.c namcos21.c namcos22.c namcos86.c naughtyb.c nbmj8891.c nbmj8900.c nbmj8991.c nbmj9195.c nemesis.c neogeo.c ninjakd2.c ninjaw.c nitedrvr.c niyanpai.c nmk16.c nova2001.c nycaptor.c ohmygod.c ojankohs.c oneshot.c opwolf.c orbit.c othldrby.c othunder.c overdriv.c pacland.c pacman.c pandoras.c paradise.c parodius.c pbaction.c pcktgal.c pgm.c pingpong.c pirates.c pitnrun.c pktgaldx.c playch10.c playmark.c plygonet.c pokechmp.c polepos.c polyplay.c poolshrk.c pooyan.c popeye.c popper.c portrait.c powerins.c prehisle.c psikyo.c psikyo4.c psikyosh.c psychic5.c punchout.c pushman.c qdrmfgp.c quasar.c quizdna.c raiden.c rainbow.c rallyx.c rampart.c rastan.c realbrk.c redalert.c redclash.c relief.c renegade.c retofinv.c rockrage.c rocnrope.c rohga.c rollerg.c rollrace.c route16.c rpunch.c runaway.c rungun.c sauro.c sbasketb.c scotrsht.c sderby.c segag80r.c segag80v.c segas18.c segas24.c segas32.c seibuspi.c seicross.c senjyo.c seta.c seta2.c sf.c shadfrce.c shangkid.c shaolins.c shisen.c shootout.c sidearms.c sidepckt.c silkroad.c simpl156.c simpsons.c skydiver.c skyfox.c skykid.c skyraid.c slapfght.c slapshot.c snes.c snk.c snk68.c solomon.c sonson.c spacefb.c spbactn.c spcforce.c spdodgeb.c speedatk.c speedbal.c speedspn.c splash.c sprcros2.c sprint2.c sprint4.c sprint8.c spy.c srmp2.c srumbler.c sshangha.c sslam.c ssozumo.c sspeedr.c ssrj.c ssv.c st0016.c stactics.c stadhero.c starcrus.c starshp1.c stfight.c stlforce.c strnskil.c stvvdp2.c subs.c suna16.c suna8.c supbtime.c superchs.c superqix.c suprloco.c suprnova.c suprridr.c suprslam.c surpratk.c system16.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_o.c taito_z.c taitoair.c taitojc.c taitosj.c tank8.c tankbatt.c tankbust.c taotaido.c targeth.c tatsumi.c taxidriv.c tbowl.c tceptor.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c terracre.c tetrisp2.c thedeep.c thepit.c thief.c thoop2.c thunderj.c thunderx.c tiamc1.c tigeroad.c timelimt.c timeplt.c tmnt.c tnzs.c toaplan1.c toaplan2.c toki.c toobin.c topspeed.c toypop.c tp84.c trackfld.c travrusa.c triplhnt.c tryout.c tsamurai.c tubep.c tumbleb.c tumblep.c tunhunt.c turbo.c tutankhm.c twin16.c twincobr.c tx1.c ultratnk.c undrfire.c unico.c vaportra.c vastar.c vball.c vectrex.c vendetta.c vicdual.c victory.c videopin.c vigilant.c volfied.c vulgus.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c williams.c wiping.c wiz.c wolfpack.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c xexex.c xmen.c xorworld.c xxmissio.c yiear.c yunsun16.c yunsung8.c zac2650.c zaccaria.c zaxxon.c
[src/mess/drivers]apexc.c bml3.c c65.c cybiko.c einstein.c fp6000.c interact.c ipds.c itt3030.c jr200.c m20.c mbc200.c multi16.c multi8.c myb3k.c mz2000.c mz2500.c paso1600.c pasogo.c pasopia7.c pc100.c pc6001.c pc8801.c pc88va.c pk8000.c pv1000.c rainbow.c sm1800.c smc777.c ssem.c supracan.c svision.c ti99_2.c tk80bs.c vboy.c vii.c vt100.c x1.c z100.c
[src/mess/machine]amstrad.c lisa.c sms.c
[src/mess/video]ac1.c apple1.c apple2.c apple3.c b2m.c bbc.c cgenie.c dai.c fmtowns.c galeb.c hec2video.c hp48.c intv.c kramermc.c mac.c mz700.c nascom1.c nc.c nes.c ondra.c oric.c orion.c p2000m.c pcw.c pcw16.c pdp1.c pet.c pk8020.c pp01.c primo.c radio86.c spectrum.c ssystem3.c super80.c timex.c tx0.c ut88.c vector06.c vtech2.c x68k.c

trunk/src/mame/machine/slikshot.c
r17988r17989
593593      if (temp >=  0x90) temp =  0x90;
594594      m_curx = temp;
595595
596      compute_sensors(screen.machine());
596      compute_sensors(machine());
597597//      popmessage("V=%02x,%02x  X=%02x", m_curvx, m_curvy, m_curx);
598598      m_crosshair_vis = 0;
599599   }
trunk/src/mame/video/targeth.c
r17988r17989
139139
140140   m_pant[1]->draw(bitmap, cliprect, 0,0);
141141   m_pant[0]->draw(bitmap, cliprect, 0,0);
142   draw_sprites(screen.machine(), bitmap,cliprect);
142   draw_sprites(machine(), bitmap,cliprect);
143143
144144   return 0;
145145}
trunk/src/mame/video/nycaptor.c
r17988r17989
241241{
242242
243243#if NYCAPTOR_DEBUG
244   nycaptor_setmask(screen.machine());
244   nycaptor_setmask(machine());
245245   if (m_mask & 0x1000)
246246   {
247247      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3, 0);
r17988r17989
252252      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 0);
253253      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 0);
254254      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 0);
255      draw_sprites(screen.machine(), bitmap, cliprect, 0);
256      draw_sprites(screen.machine(), bitmap, cliprect, 1);
257      draw_sprites(screen.machine(), bitmap, cliprect, 2);
258      draw_sprites(screen.machine(), bitmap, cliprect, 3);
259      draw_sprites(screen.machine(), bitmap, cliprect, 4);
260      draw_sprites(screen.machine(), bitmap, cliprect, 5);
261      draw_sprites(screen.machine(), bitmap, cliprect, 6);
262      draw_sprites(screen.machine(), bitmap, cliprect, 7);
255      draw_sprites(machine(), bitmap, cliprect, 0);
256      draw_sprites(machine(), bitmap, cliprect, 1);
257      draw_sprites(machine(), bitmap, cliprect, 2);
258      draw_sprites(machine(), bitmap, cliprect, 3);
259      draw_sprites(machine(), bitmap, cliprect, 4);
260      draw_sprites(machine(), bitmap, cliprect, 5);
261      draw_sprites(machine(), bitmap, cliprect, 6);
262      draw_sprites(machine(), bitmap, cliprect, 7);
263263   }
264264   else
265265#endif
266   switch (nycaptor_spot(screen.machine()) & 3)
266   switch (nycaptor_spot(machine()) & 3)
267267   {
268268   case 0:
269269      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3, 0);
270      draw_sprites(screen.machine(), bitmap, cliprect, 6);
270      draw_sprites(machine(), bitmap, cliprect, 6);
271271      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 3, 0);
272272      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 2, 0);
273273      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 2, 0);
274274      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1, 0);
275      draw_sprites(screen.machine(), bitmap, cliprect, 3);
275      draw_sprites(machine(), bitmap, cliprect, 3);
276276      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 0);
277      draw_sprites(screen.machine(), bitmap, cliprect, 0);
278      draw_sprites(screen.machine(), bitmap, cliprect, 2);
277      draw_sprites(machine(), bitmap, cliprect, 0);
278      draw_sprites(machine(), bitmap, cliprect, 2);
279279      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 0);
280      draw_sprites(screen.machine(), bitmap, cliprect, 1);
280      draw_sprites(machine(), bitmap, cliprect, 1);
281281      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 0);
282282      break;
283283
284284   case 1:
285285      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3, 0);
286      draw_sprites(screen.machine(), bitmap, cliprect, 3);
286      draw_sprites(machine(), bitmap, cliprect, 3);
287287      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 3, 0);
288      draw_sprites(screen.machine(), bitmap, cliprect, 2);
288      draw_sprites(machine(), bitmap, cliprect, 2);
289289      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 2, 0);
290290      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1, 0);
291      draw_sprites(screen.machine(), bitmap, cliprect, 1);
291      draw_sprites(machine(), bitmap, cliprect, 1);
292292      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 0);
293293      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 2, 0);
294      draw_sprites(screen.machine(), bitmap, cliprect, 0);
294      draw_sprites(machine(), bitmap, cliprect, 0);
295295      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 0);
296296      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 0);
297297      break;
r17988r17989
300300      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3, 0);
301301      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 3, 0);
302302      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1, 0);
303      draw_sprites(screen.machine(), bitmap, cliprect, 1);
303      draw_sprites(machine(), bitmap, cliprect, 1);
304304      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 0);
305305      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 2, 0);
306306      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 2, 0);
307      draw_sprites(screen.machine(), bitmap, cliprect, 0);
307      draw_sprites(machine(), bitmap, cliprect, 0);
308308      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 0);
309309      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 0);
310310      break;
311311
312312   case 3:
313313      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1, 0);
314      draw_sprites(screen.machine(), bitmap, cliprect, 1);
314      draw_sprites(machine(), bitmap, cliprect, 1);
315315      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 0);
316      draw_sprites(screen.machine(), bitmap, cliprect, 0);
316      draw_sprites(machine(), bitmap, cliprect, 0);
317317      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 0);
318318      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 0);
319319      break;
trunk/src/mame/video/rainbow.c
r17988r17989
4949   layer[0] = 0;
5050   layer[1] = 1;
5151
52   screen.machine().priority_bitmap.fill(0, cliprect);
52   machine().priority_bitmap.fill(0, cliprect);
5353
5454   pc080sn_tilemap_draw(m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
5555   pc080sn_tilemap_draw(m_pc080sn, bitmap, cliprect, layer[1], 0, 2);
r17988r17989
9797   layer[0] = 0;
9898   layer[1] = 1;
9999
100   screen.machine().priority_bitmap.fill(0, cliprect);
100   machine().priority_bitmap.fill(0, cliprect);
101101
102102   pc080sn_tilemap_draw(m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
103103
r17988r17989
105105   for (offs = m_spriteram.bytes() / 2 - 8; offs >= 0; offs -= 8)
106106   {
107107      int tile = spriteram[offs];
108      if (tile < screen.machine().gfx[1]->elements())
108      if (tile < machine().gfx[1]->elements())
109109      {
110110         int sx,sy,color,data1;
111111
r17988r17989
117117         data1 = spriteram[offs + 3];
118118         color = (spriteram[offs + 4] & 0x0f) | sprite_colbank;
119119
120         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
120         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
121121               tile,
122122               color,
123123               data1 & 0x40, data1 & 0x80,
trunk/src/mame/video/mitchell.c
r17988r17989
315315
316316   bitmap.fill(0, cliprect);
317317   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
318   draw_sprites(screen.machine(), bitmap, cliprect);
318   draw_sprites(machine(), bitmap, cliprect);
319319   return 0;
320320}
trunk/src/mame/video/xevious.c
r17988r17989
499499{
500500
501501   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
502   draw_sprites(screen.machine(), bitmap,cliprect);
502   draw_sprites(machine(), bitmap,cliprect);
503503   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
504504   return 0;
505505}
trunk/src/mame/video/galspnbl.c
r17988r17989
105105{
106106   int offs;
107107
108   draw_background(screen.machine(), bitmap, cliprect);
108   draw_background(machine(), bitmap, cliprect);
109109
110   draw_sprites(screen.machine(), bitmap, cliprect, 0);
110   draw_sprites(machine(), bitmap, cliprect, 0);
111111
112112   for (offs = 0; offs < 0x1000 / 2; offs++)
113113   {
r17988r17989
122122      /* What is this? A priority/half transparency marker? */
123123      if (!(attr & 0x0008))
124124      {
125         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
125         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
126126               code,
127127               color,
128128               0,0,
r17988r17989
131131      }
132132   }
133133
134   draw_sprites(screen.machine(), bitmap, cliprect, 1);
134   draw_sprites(machine(), bitmap, cliprect, 1);
135135   return 0;
136136}
trunk/src/mame/video/blktiger.c
r17988r17989
227227      (m_screen_layout ? m_bg_tilemap8x4 : m_bg_tilemap4x8)->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
228228
229229   if (m_objon)
230      draw_sprites(screen.machine(), bitmap, cliprect);
230      draw_sprites(machine(), bitmap, cliprect);
231231
232232   if (m_bgon)
233233      (m_screen_layout ? m_bg_tilemap8x4 : m_bg_tilemap4x8)->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
trunk/src/mame/video/dynduke.c
r17988r17989
228228   m_tx_layer->enable(m_txt_enable);
229229
230230
231   draw_background(screen.machine(), bitmap, cliprect,0x00);
232   draw_sprites(screen.machine(),bitmap,cliprect,0); // Untested: does anything use it? Could be behind background
233   draw_sprites(screen.machine(),bitmap,cliprect,1);
234   draw_background(screen.machine(), bitmap, cliprect,0x20);
231   draw_background(machine(), bitmap, cliprect,0x00);
232   draw_sprites(machine(),bitmap,cliprect,0); // Untested: does anything use it? Could be behind background
233   draw_sprites(machine(),bitmap,cliprect,1);
234   draw_background(machine(), bitmap, cliprect,0x20);
235235
236   draw_sprites(screen.machine(),bitmap,cliprect,2);
236   draw_sprites(machine(),bitmap,cliprect,2);
237237   m_fg_layer->draw(bitmap, cliprect, 0,0);
238   draw_sprites(screen.machine(),bitmap,cliprect,3);
238   draw_sprites(machine(),bitmap,cliprect,3);
239239   m_tx_layer->draw(bitmap, cliprect, 0,0);
240240
241241   return 0;
trunk/src/mame/video/deco_mlc.c
r17988r17989
510510UINT32 deco_mlc_state::screen_update_mlc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
511511{
512512//  temp_bitmap->fill(0, cliprect);
513   bitmap.fill(screen.machine().pens[0], cliprect); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
514   draw_sprites(screen.machine(),bitmap,cliprect);
513   bitmap.fill(machine().pens[0], cliprect); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
514   draw_sprites(machine(),bitmap,cliprect);
515515   return 0;
516516}
trunk/src/mame/video/tunhunt.c
r17988r17989
376376
377377UINT32 tunhunt_state::screen_update_tunhunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
378378{
379   set_pens(screen.machine());
379   set_pens(machine());
380380
381   draw_box(screen.machine(), bitmap, cliprect);
381   draw_box(machine(), bitmap, cliprect);
382382
383   draw_motion_object(screen.machine(), bitmap, cliprect);
383   draw_motion_object(machine(), bitmap, cliprect);
384384
385   draw_shell(screen.machine(), bitmap, cliprect,
385   draw_shell(machine(), bitmap, cliprect,
386386      m_workram[SHL0PC],   /* picture code */
387387      m_workram[SHEL0H],   /* hposition */
388388      m_workram[SHL0V],   /* vstart */
r17988r17989
390390      m_workram[SHL0ST],   /* vstretch */
391391      m_control&0x08 ); /* hstretch */
392392
393   draw_shell(screen.machine(), bitmap, cliprect,
393   draw_shell(machine(), bitmap, cliprect,
394394      m_workram[SHL1PC],   /* picture code */
395395      m_workram[SHEL1H],   /* hposition */
396396      m_workram[SHL1V],   /* vstart */
trunk/src/mame/video/tryout.c
r17988r17989
247247   if(!(m_gfx_control[0] & 0x8)) // screen disable
248248   {
249249      /* TODO: Color might be different, needs a video from an original pcb. */
250      bitmap.fill(screen.machine().pens[0x10], cliprect);
250      bitmap.fill(machine().pens[0x10], cliprect);
251251   }
252252   else
253253   {
254254      m_bg_tilemap->draw(bitmap, cliprect, 0,0);
255255      m_fg_tilemap->draw(bitmap, cliprect, 0,0);
256      draw_sprites(screen.machine(), bitmap,cliprect);
256      draw_sprites(machine(), bitmap,cliprect);
257257   }
258258
259259//  popmessage("%02x %02x %02x %02x",m_gfx_control[0],m_gfx_control[1],m_gfx_control[2],scrollx);
trunk/src/mame/video/rungun.c
r17988r17989
100100UINT32 rungun_state::screen_update_rng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
101101{
102102
103   bitmap.fill(get_black_pen(screen.machine()), cliprect);
104   screen.machine().priority_bitmap.fill(0, cliprect);
103   bitmap.fill(get_black_pen(machine()), cliprect);
104   machine().priority_bitmap.fill(0, cliprect);
105105
106106   k053936_zoom_draw(m_k053936, bitmap, cliprect, m_936_tilemap, 0, 0, 1);
107107
trunk/src/mame/video/eprom.c
r17988r17989
237237
238238   if (m_video_disable)
239239   {
240      bitmap.fill(get_black_pen(screen.machine()), cliprect);
240      bitmap.fill(get_black_pen(machine()), cliprect);
241241      return 0;
242242   }
243243
244   update_palette(screen.machine());
244   update_palette(machine());
245245
246246   /* draw the playfield */
247247   m_playfield_tilemap->draw(bitmap, cliprect, 0, 0);
r17988r17989
391391
392392   if (m_video_disable)
393393   {
394      bitmap.fill(get_black_pen(screen.machine()), cliprect);
394      bitmap.fill(get_black_pen(machine()), cliprect);
395395      return 0;
396396   }
397397
398   update_palette(screen.machine());
398   update_palette(machine());
399399
400400   /* draw the playfield */
401401   m_playfield_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/madmotor.c
r17988r17989
2424
2525UINT32 madmotor_state::screen_update_madmotor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
2626{
27   flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
27   flip_screen_set(machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
2828
29//  screen.machine().tilemap().set_flip_all(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
29//  machine().tilemap().set_flip_all(machine().device<deco_bac06_device>("tilegen1")->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
3030
31   screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
32   screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
33   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f);
34   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
31   machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
32   machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
33   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f);
34   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
3535   return 0;
3636}
trunk/src/mame/video/skyfox.c
r17988r17989
283283UINT32 skyfox_state::screen_update_skyfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
284284{
285285   bitmap.fill(255, cliprect);   // the bg is black
286   draw_background(screen.machine(), bitmap, cliprect);
287   draw_sprites(screen.machine(), bitmap, cliprect);
286   draw_background(machine(), bitmap, cliprect);
287   draw_sprites(machine(), bitmap, cliprect);
288288   return 0;
289289}
trunk/src/mame/video/bublbobl.c
r17988r17989
8080               flipy = !flipy;
8181            }
8282
83            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
83            drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
8484                  code,
8585                  color,
8686                  flipx,flipy,
trunk/src/mame/video/aerofgt.c
r17988r17989
821821      m_bg1_tilemap->set_scrollx((i + scrolly) & 0xff, m_rasterram[i]);
822822   m_bg1_tilemap->set_scrolly(0, scrolly);
823823
824   screen.machine().priority_bitmap.fill(0, cliprect);
824   machine().priority_bitmap.fill(0, cliprect);
825825
826826   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
827   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1);
828   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0);
827   turbofrc_draw_sprites(machine(), bitmap, cliprect, 0, -1);
828   turbofrc_draw_sprites(machine(), bitmap, cliprect, 0, 0);
829829   return 0;
830830}
831831
r17988r17989
840840   m_bg1_tilemap->set_scrolly(0, scrolly);
841841
842842   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
843   pspikesb_draw_sprites(screen.machine(), bitmap, cliprect);
843   pspikesb_draw_sprites(machine(), bitmap, cliprect);
844844   return 0;
845845}
846846
r17988r17989
849849   int i, scrolly;
850850   int y, x;
851851   int count;
852   gfx_element *gfx = screen.machine().gfx[0];
852   gfx_element *gfx = machine().gfx[0];
853853
854854   m_bg1_tilemap->set_scroll_rows(256);
855855   scrolly = m_bg1scrolly;
r17988r17989
859859   m_bg1_tilemap->set_scrolly(0, scrolly);
860860
861861   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
862   spikes91_draw_sprites(screen.machine(), bitmap, cliprect);
862   spikes91_draw_sprites(machine(), bitmap, cliprect);
863863
864864   /* we could use a tilemap, but it's easier to just do it here */
865865   count = 0;
r17988r17989
891891   m_bg2_tilemap->set_scrollx(0, m_bg2scrollx - 4);
892892   m_bg2_tilemap->set_scrolly(0, m_bg2scrolly);
893893
894   screen.machine().priority_bitmap.fill(0, cliprect);
894   machine().priority_bitmap.fill(0, cliprect);
895895
896896   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
897897   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
898898
899899   /* we use the priority buffer so sprites are drawn front to back */
900   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 1, -1);
901   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0);
902   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1);
903   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0);
900   turbofrc_draw_sprites(machine(), bitmap, cliprect, 1, -1);
901   turbofrc_draw_sprites(machine(), bitmap, cliprect, 1, 0);
902   turbofrc_draw_sprites(machine(), bitmap, cliprect, 0, -1);
903   turbofrc_draw_sprites(machine(), bitmap, cliprect, 0, 0);
904904   return 0;
905905}
906906
r17988r17989
916916   m_bg2_tilemap->set_scrollx(0, m_bg2scrollx - 4);
917917//  m_bg2_tilemap->set_scrolly(0, m_bg2scrolly);
918918
919   screen.machine().priority_bitmap.fill(0, cliprect);
919   machine().priority_bitmap.fill(0, cliprect);
920920
921921   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
922922   m_bg2_tilemap->draw(bitmap, cliprect, 0, 1);
923923
924924   /* we use the priority buffer so sprites are drawn front to back */
925   spinlbrk_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0);
926   spinlbrk_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1);
927   spinlbrk_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0);
928   spinlbrk_draw_sprites(screen.machine(), bitmap, cliprect, 1, -1);
925   spinlbrk_draw_sprites(machine(), bitmap, cliprect, 0, 0);
926   spinlbrk_draw_sprites(machine(), bitmap, cliprect, 0, -1);
927   spinlbrk_draw_sprites(machine(), bitmap, cliprect, 1, 0);
928   spinlbrk_draw_sprites(machine(), bitmap, cliprect, 1, -1);
929929   return 0;
930930}
931931
r17988r17989
942942   m_bg2_tilemap->set_scrollx(0, m_bg2scrollx - 7);
943943   m_bg2_tilemap->set_scrolly(0, m_bg2scrolly + 2);
944944
945   screen.machine().priority_bitmap.fill(0, cliprect);
945   machine().priority_bitmap.fill(0, cliprect);
946946
947947   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
948948   m_bg2_tilemap->draw(bitmap, cliprect, 0, 1);
949949
950950   /* we use the priority buffer so sprites are drawn front to back */
951   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 1, -1); //ship
952   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0); //intro
953   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); //enemy
954   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); //enemy
951   turbofrc_draw_sprites(machine(), bitmap, cliprect, 1, -1); //ship
952   turbofrc_draw_sprites(machine(), bitmap, cliprect, 1, 0); //intro
953   turbofrc_draw_sprites(machine(), bitmap, cliprect, 0, -1); //enemy
954   turbofrc_draw_sprites(machine(), bitmap, cliprect, 0, 0); //enemy
955955   return 0;
956956}
957957
r17988r17989
962962   m_bg2_tilemap->set_scrollx(0, m_rasterram[0x0200] - 20);
963963   m_bg2_tilemap->set_scrolly(0, m_bg2scrolly);
964964
965   screen.machine().priority_bitmap.fill(0, cliprect);
965   machine().priority_bitmap.fill(0, cliprect);
966966
967967   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
968968
969   aerofgt_draw_sprites(screen.machine(), bitmap, cliprect, 0);
970   aerofgt_draw_sprites(screen.machine(), bitmap, cliprect, 1);
969   aerofgt_draw_sprites(machine(), bitmap, cliprect, 0);
970   aerofgt_draw_sprites(machine(), bitmap, cliprect, 1);
971971
972972   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
973973
974   aerofgt_draw_sprites(screen.machine(), bitmap, cliprect, 2);
975   aerofgt_draw_sprites(screen.machine(), bitmap, cliprect, 3);
974   aerofgt_draw_sprites(machine(), bitmap, cliprect, 2);
975   aerofgt_draw_sprites(machine(), bitmap, cliprect, 3);
976976   return 0;
977977}
978978
r17988r17989
989989   m_bg2_tilemap->set_scrollx(0, m_bg2scrollx + 172);
990990   m_bg2_tilemap->set_scrolly(0, m_bg2scrolly + 2);
991991
992   screen.machine().priority_bitmap.fill(0, cliprect);
992   machine().priority_bitmap.fill(0, cliprect);
993993
994994   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
995995   m_bg2_tilemap->draw(bitmap, cliprect, 0, 1);
996996
997997   /* we use the priority buffer so sprites are drawn front to back */
998   aerfboot_draw_sprites(screen.machine(), bitmap, cliprect);
998   aerfboot_draw_sprites(machine(), bitmap, cliprect);
999999   return 0;
10001000}
10011001
r17988r17989
10121012   m_bg2_tilemap->set_scrollx(0, m_bg2scrollx - 7);
10131013   m_bg2_tilemap->set_scrolly(0, m_bg2scrolly + 2);
10141014
1015   screen.machine().priority_bitmap.fill(0, cliprect);
1015   machine().priority_bitmap.fill(0, cliprect);
10161016
10171017   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
10181018   m_bg2_tilemap->draw(bitmap, cliprect, 0, 1);
10191019
10201020   /* we use the priority buffer so sprites are drawn front to back */
1021   aerfboo2_draw_sprites(screen.machine(), bitmap, cliprect, 1, -1); //ship
1022   aerfboo2_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0); //intro
1023   aerfboo2_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); //enemy
1024   aerfboo2_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); //enemy
1021   aerfboo2_draw_sprites(machine(), bitmap, cliprect, 1, -1); //ship
1022   aerfboo2_draw_sprites(machine(), bitmap, cliprect, 1, 0); //intro
1023   aerfboo2_draw_sprites(machine(), bitmap, cliprect, 0, -1); //enemy
1024   aerfboo2_draw_sprites(machine(), bitmap, cliprect, 0, 0); //enemy
10251025   return 0;
10261026}
10271027
r17988r17989
10351035      m_bg1_tilemap->set_scrollx((i + scrolly) & 0xff, m_rasterram[i]);
10361036   m_bg1_tilemap->set_scrolly(0, scrolly);
10371037
1038   screen.machine().priority_bitmap.fill(0, cliprect);
1038   machine().priority_bitmap.fill(0, cliprect);
10391039
10401040   if (m_wbbc97_bitmap_enable)
10411041   {
1042      wbbc97_draw_bitmap(screen.machine(), bitmap);
1042      wbbc97_draw_bitmap(machine(), bitmap);
10431043      m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
10441044   }
10451045   else
r17988r17989
10471047      m_bg1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
10481048   }
10491049
1050   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1);
1051   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0);
1050   turbofrc_draw_sprites(machine(), bitmap, cliprect, 0, -1);
1051   turbofrc_draw_sprites(machine(), bitmap, cliprect, 0, 0);
10521052   return 0;
10531053}
trunk/src/mame/video/rocnrope.c
r17988r17989
142142UINT32 rocnrope_state::screen_update_rocnrope(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
143143{
144144   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
145   draw_sprites(screen.machine(), bitmap, cliprect);
145   draw_sprites(machine(), bitmap, cliprect);
146146   return 0;
147147}
trunk/src/mame/video/fgoal.c
r17988r17989
4646
4747   /* draw color overlay foreground and background */
4848
49   if (m_fgoal_player == 1 && (screen.machine().root_device().ioport("IN1")->read() & 0x40))
49   if (m_fgoal_player == 1 && (machine().root_device().ioport("IN1")->read() & 0x40))
5050   {
51      drawgfxzoom_opaque(m_fgbitmap, cliprect, screen.machine().gfx[0],
51      drawgfxzoom_opaque(m_fgbitmap, cliprect, machine().gfx[0],
5252         0, (m_fgoal_player << 2) | m_current_color,
5353         1, 1,
5454         0, 16,
5555         0x40000,
5656         0x40000);
5757
58      drawgfxzoom_opaque(m_bgbitmap, cliprect, screen.machine().gfx[1],
58      drawgfxzoom_opaque(m_bgbitmap, cliprect, machine().gfx[1],
5959         0, 0,
6060         1, 1,
6161         0, 16,
r17988r17989
6464   }
6565   else
6666   {
67      drawgfxzoom_opaque(m_fgbitmap, cliprect, screen.machine().gfx[0],
67      drawgfxzoom_opaque(m_fgbitmap, cliprect, machine().gfx[0],
6868         0, (m_fgoal_player << 2) | m_current_color,
6969         0, 0,
7070         0, 0,
7171         0x40000,
7272         0x40000);
7373
74      drawgfxzoom_opaque(m_bgbitmap, cliprect, screen.machine().gfx[1],
74      drawgfxzoom_opaque(m_bgbitmap, cliprect, machine().gfx[1],
7575         0, 0,
7676         0, 0,
7777         0, 0,
trunk/src/mame/video/docastle.c
r17988r17989
222222{
223223
224224   m_do_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
225   draw_sprites(screen.machine(), bitmap, cliprect);
225   draw_sprites(machine(), bitmap, cliprect);
226226   m_do_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
227227   return 0;
228228}
trunk/src/mame/video/mainsnk.c
r17988r17989
167167{
168168
169169   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
170   draw_sprites(screen.machine(), bitmap, cliprect, 0, 0);
170   draw_sprites(machine(), bitmap, cliprect, 0, 0);
171171   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
172172
173173   return 0;
trunk/src/mame/video/mystston.c
r17988r17989
252252UINT32 mystston_state::screen_update_mystston(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
253253{
254254
255   int flip = (*m_video_control & 0x80) ^ ((screen.machine().root_device().ioport("DSW1")->read() & 0x20) << 2);
255   int flip = (*m_video_control & 0x80) ^ ((machine().root_device().ioport("DSW1")->read() & 0x20) << 2);
256256
257   set_palette(screen.machine(), this);
257   set_palette(machine(), this);
258258
259   screen.machine().tilemap().mark_all_dirty();
259   machine().tilemap().mark_all_dirty();
260260   m_bg_tilemap->set_scrolly(0, *m_scroll);
261   screen.machine().tilemap().set_flip_all(flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
261   machine().tilemap().set_flip_all(flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
262262
263263   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
264   draw_sprites(bitmap, cliprect, screen.machine().gfx[2], flip);
264   draw_sprites(bitmap, cliprect, machine().gfx[2], flip);
265265   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
266266
267267   return 0;
trunk/src/mame/video/rampart.c
r17988r17989
7979   int x, y, r;
8080
8181   /* draw the playfield */
82   rampart_bitmap_render(screen.machine(), bitmap, cliprect);
82   rampart_bitmap_render(machine(), bitmap, cliprect);
8383
8484   /* draw and merge the MO */
8585   mobitmap = atarimo_render(0, cliprect, &rectlist);
trunk/src/mame/video/senjyo.c
r17988r17989
282282
283283
284284   /* two colors for the radar dots (verified on the real board) */
285   palette_set_color(screen.machine(),512,MAKE_RGB(0xff,0x00,0x00));   /* red for enemies */
286   palette_set_color(screen.machine(),513,MAKE_RGB(0xff,0xff,0x00));   /* yellow for player */
285   palette_set_color(machine(),512,MAKE_RGB(0xff,0x00,0x00));   /* red for enemies */
286   palette_set_color(machine(),513,MAKE_RGB(0xff,0xff,0x00));   /* yellow for player */
287287
288288   {
289289      int flip = flip_screen();
r17988r17989
319319      m_bg3_tilemap->set_scrolly(0, scrolly);
320320   }
321321
322   draw_bgbitmap(screen.machine(), bitmap, cliprect);
323   draw_sprites(screen.machine(), bitmap, cliprect, 0);
322   draw_bgbitmap(machine(), bitmap, cliprect);
323   draw_sprites(machine(), bitmap, cliprect, 0);
324324   m_bg3_tilemap->draw(bitmap, cliprect, 0, 0);
325   draw_sprites(screen.machine(), bitmap, cliprect, 1);
325   draw_sprites(machine(), bitmap, cliprect, 1);
326326   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
327   draw_sprites(screen.machine(), bitmap, cliprect, 2);
327   draw_sprites(machine(), bitmap, cliprect, 2);
328328   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
329   draw_sprites(screen.machine(), bitmap, cliprect, 3);
329   draw_sprites(machine(), bitmap, cliprect, 3);
330330   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
331   draw_radar(screen.machine(), bitmap, cliprect);
331   draw_radar(machine(), bitmap, cliprect);
332332
333333#if 0
334334{
trunk/src/mame/video/yiear.c
r17988r17989
142142{
143143
144144   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
145   draw_sprites(screen.machine(), bitmap, cliprect);
145   draw_sprites(machine(), bitmap, cliprect);
146146   return 0;
147147}
trunk/src/mame/video/nbmj9195.c
r17988r17989
454454      for (y = 0; y < height; y++)
455455         for (x = 0; x < width; x++)
456456         {
457            update_pixel(screen.machine(), 0, x, y);
457            update_pixel(machine(), 0, x, y);
458458
459459            if (m_gfxdraw_mode)
460               update_pixel(screen.machine(), 1, x, y);
460               update_pixel(machine(), 1, x, y);
461461         }
462462   }
463463
trunk/src/mame/video/sonson.c
r17988r17989
174174UINT32 sonson_state::screen_update_sonson(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
175175{
176176   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
177   draw_sprites(screen.machine(), bitmap, cliprect);
177   draw_sprites(machine(), bitmap, cliprect);
178178   return 0;
179179}
trunk/src/mame/video/sslam.c
r17988r17989
186186
187187   if (!(m_regs[6] & 1))
188188   {
189      bitmap.fill(get_black_pen(screen.machine()), cliprect);
189      bitmap.fill(get_black_pen(machine()), cliprect);
190190      return 0;
191191   }
192192
r17988r17989
215215      m_md_tilemap->draw(bitmap, cliprect, 0,0);
216216   }
217217
218   draw_sprites(screen.machine(), bitmap,cliprect);
218   draw_sprites(machine(), bitmap,cliprect);
219219   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
220220   return 0;
221221}
r17988r17989
225225
226226   if (!(m_regs[6] & 1))
227227   {
228      bitmap.fill(get_black_pen(screen.machine()), cliprect);
228      bitmap.fill(get_black_pen(machine()), cliprect);
229229      return 0;
230230   }
231231
r17988r17989
233233   m_bg_tilemap->set_scrolly(0, m_regs[1]-240);
234234
235235   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
236   draw_sprites(screen.machine(), bitmap,cliprect);
236   draw_sprites(machine(), bitmap,cliprect);
237237   return 0;
238238}
trunk/src/mame/video/simpl156.c
r17988r17989
2828UINT32 simpl156_state::screen_update_simpl156(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
2929{
3030
31   screen.machine().priority_bitmap.fill(0);
31   machine().priority_bitmap.fill(0);
3232
3333   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
3434
r17988r17989
4040   //FIXME: flip_screen_x should not be written!
4141   flip_screen_set_no_update(1);
4242
43   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more)
43   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more)
4444   return 0;
4545}
trunk/src/mame/video/deadang.c
r17988r17989
149149   m_pf2_layer->enable(!(m_scroll_ram[0x34]&4));
150150   flip_screen_set(m_scroll_ram[0x34]&0x40 );
151151
152   bitmap.fill(get_black_pen(screen.machine()), cliprect);
153   screen.machine().priority_bitmap.fill(0, cliprect);
152   bitmap.fill(get_black_pen(machine()), cliprect);
153   machine().priority_bitmap.fill(0, cliprect);
154154   m_pf3_layer->draw(bitmap, cliprect, 0,1);
155155   m_pf1_layer->draw(bitmap, cliprect, 0,2);
156156   m_pf2_layer->draw(bitmap, cliprect, 0,4);
157   if (!(m_scroll_ram[0x34]&0x10)) draw_sprites(screen.machine(),bitmap,cliprect);
157   if (!(m_scroll_ram[0x34]&0x10)) draw_sprites(machine(),bitmap,cliprect);
158158   m_text_layer->draw(bitmap, cliprect, 0,0);
159159   return 0;
160160}
trunk/src/mame/video/hcastle.c
r17988r17989
217217
218218UINT32 hcastle_state::screen_update_hcastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
219219{
220   address_space &space = screen.machine().driver_data()->generic_space();
220   address_space &space = machine().driver_data()->generic_space();
221221
222222   UINT8 ctrl_1_0 = k007121_ctrlram_r(m_k007121_1, space, 0);
223223   UINT8 ctrl_1_1 = k007121_ctrlram_r(m_k007121_1, space, 1);
r17988r17989
228228   UINT8 ctrl_2_2 = k007121_ctrlram_r(m_k007121_2, space, 2);
229229   UINT8 ctrl_2_3 = k007121_ctrlram_r(m_k007121_2, space, 3);
230230
231   set_pens(screen.machine());
231   set_pens(machine());
232232
233233   m_pf1_bankbase = 0x0000;
234234   m_pf2_bankbase = 0x4000 * ((m_gfx_bank & 2) >> 1);
r17988r17989
257257   if ((m_gfx_bank & 0x04) == 0)
258258   {
259259      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
260      draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram->buffer(), 0);
261      draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram2->buffer(), 1);
260      draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0);
261      draw_sprites(machine(), bitmap, cliprect, m_spriteram2->buffer(), 1);
262262      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
263263   }
264264   else
265265   {
266266      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
267267      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
268      draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram->buffer(), 0);
269      draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram2->buffer(), 1);
268      draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0);
269      draw_sprites(machine(), bitmap, cliprect, m_spriteram2->buffer(), 1);
270270   }
271271   return 0;
272272}
trunk/src/mame/video/copsnrob.c
r17988r17989
2121      sx = 31 - (offs % 32);
2222      sy = offs / 32;
2323
24      drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
24      drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
2525            m_videoram[offs] & 0x3f,0,
2626            0,0,
2727            8*sx,8*sy);
r17988r17989
3030
3131   /* Draw the cars. Positioning was based on a screen shot */
3232   if (m_cary[0])
33      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
33      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
3434            m_carimage[0],0,
3535            1,0,
3636            0xe4,256 - m_cary[0],0);
3737
3838   if (m_cary[1])
39      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
39      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
4040            m_carimage[1],0,
4141            1,0,
4242            0xc4,256 - m_cary[1],0);
4343
4444   if (m_cary[2])
45      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
45      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
4646            m_carimage[2],0,
4747            0,0,
4848            0x24,256 - m_cary[2],0);
4949
5050   if (m_cary[3])
51      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
51      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
5252            m_carimage[3],0,
5353            0,0,
5454            0x04,256 - m_cary[3],0);
r17988r17989
7777         {
7878            /* We've hit a truck's back end, so draw the truck.  The front
7979                   end may be off the top of the screen, but we don't care. */
80            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
80            drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
8181                  0,0,
8282                  0,0,
8383                  0x80,256 - (y + 31),0);
r17988r17989
8989         {
9090            /* We missed a truck's back end (it was off the bottom of the
9191                   screen) but have hit its front end, so draw the truck. */
92            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
92            drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
9393                  0,0,
9494                  0,0,
9595                  0x80,256 - y,0);
trunk/src/mame/video/twincobr.c
r17988r17989
495495
496496UINT32 twincobr_state::screen_update_toaplan0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
497497{
498   twincobr_log_vram(screen.machine());
498   twincobr_log_vram(machine());
499499
500   if (m_wardner_sprite_hack) wardner_sprite_priority_hack(screen.machine());
500   if (m_wardner_sprite_hack) wardner_sprite_priority_hack(machine());
501501
502502   bitmap.fill(0, cliprect);
503503
504504   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
505   draw_sprites(screen.machine(), bitmap,cliprect,0x0400);
505   draw_sprites(machine(), bitmap,cliprect,0x0400);
506506   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
507   draw_sprites(screen.machine(), bitmap,cliprect,0x0800);
507   draw_sprites(machine(), bitmap,cliprect,0x0800);
508508   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
509   draw_sprites(screen.machine(), bitmap,cliprect,0x0c00);
509   draw_sprites(machine(), bitmap,cliprect,0x0c00);
510510   return 0;
511511}
512512
trunk/src/mame/video/bking.c
r17988r17989
239239   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
240240
241241   /* draw the balls */
242   drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2],
242   drawgfx_transpen(bitmap, cliprect, machine().gfx[2],
243243      m_ball1_pic,
244244      m_palette_bank,
245245      0, 0,
246246      m_xld1, m_yld1, 0);
247247
248   drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[3],
248   drawgfx_transpen(bitmap, cliprect, machine().gfx[3],
249249      m_ball2_pic,
250250      m_palette_bank,
251251      0, 0,
252252      m_xld2, m_yld2, 0);
253253
254254   /* draw the crow */
255   drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
255   drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
256256      m_crow_pic,
257257      m_palette_bank,
258258      m_crow_flip, m_crow_flip,
r17988r17989
278278         xld = m_xld1;
279279         yld = m_yld1;
280280
281         drawgfx_opaque(m_tmp_bitmap2, rect, screen.machine().gfx[2],
281         drawgfx_opaque(m_tmp_bitmap2, rect, machine().gfx[2],
282282            m_ball1_pic,
283283            0,
284284            0, 0,
r17988r17989
292292         xld = m_xld2;
293293         yld = m_yld2;
294294
295         drawgfx_opaque(m_tmp_bitmap2, rect, screen.machine().gfx[3],
295         drawgfx_opaque(m_tmp_bitmap2, rect, machine().gfx[3],
296296            m_ball2_pic,
297297            0,
298298            0, 0,
r17988r17989
311311
312312      if (latch != 0)
313313      {
314         const UINT8* MASK = screen.machine().root_device().memregion("user1")->base() + 8 * m_hit;
314         const UINT8* MASK = machine().root_device().memregion("user1")->base() + 8 * m_hit;
315315
316316         int x;
317317         int y;
trunk/src/mame/video/battlnts.c
r17988r17989
4848   k007342_tilemap_update(m_k007342);
4949
5050   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE ,0);
51   k007420_sprites_draw(m_k007420, bitmap, cliprect, screen.machine().gfx[1]);
51   k007420_sprites_draw(m_k007420, bitmap, cliprect, machine().gfx[1]);
5252   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE ,0);
5353   return 0;
5454}
trunk/src/mame/video/galpani2.c
r17988r17989
142142   int layers_ctrl = -1;
143143
144144#ifdef MAME_DEBUG
145if (screen.machine().input().code_pressed(KEYCODE_Z))
145if (machine().input().code_pressed(KEYCODE_Z))
146146{
147147   int msk = 0;
148   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
149   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
150   if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 4;
151   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
148   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
149   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
150   if (machine().input().code_pressed(KEYCODE_E))   msk |= 4;
151   if (machine().input().code_pressed(KEYCODE_A))   msk |= 8;
152152   if (msk != 0) layers_ctrl &= msk;
153153}
154154#endif
155155
156156   bitmap.fill(0, cliprect);
157   screen.machine().priority_bitmap.fill(0, cliprect);
157   machine().priority_bitmap.fill(0, cliprect);
158158
159159   if (layers_ctrl & 0x1)
160160   {
r17988r17989
189189                        cliprect,0x4000 + 0);
190190   }
191191
192   if (layers_ctrl & 0x8) m_kaneko_spr->kaneko16_render_sprites(screen.machine(), bitmap, cliprect, m_spriteram, m_spriteram.bytes());
192   if (layers_ctrl & 0x8) m_kaneko_spr->kaneko16_render_sprites(machine(), bitmap, cliprect, m_spriteram, m_spriteram.bytes());
193193   return 0;
194194}
trunk/src/mame/video/arabian.c
r17988r17989
367367
368368UINT32 arabian_state::screen_update_arabian(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
369369{
370   const pen_t *pens = &screen.machine().pens[(m_video_control >> 3) << 8];
370   const pen_t *pens = &machine().pens[(m_video_control >> 3) << 8];
371371   int y;
372372
373373   /* render the screen from the bitmap */
trunk/src/mame/video/labyrunr.c
r17988r17989
178178
179179UINT32 labyrunr_state::screen_update_labyrunr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
180180{
181   address_space &space = screen.machine().driver_data()->generic_space();
181   address_space &space = machine().driver_data()->generic_space();
182182   UINT8 ctrl_0 = k007121_ctrlram_r(m_k007121, space, 0);
183183   rectangle finalclip0, finalclip1;
184184
185   set_pens(screen.machine());
185   set_pens(machine());
186186
187   screen.machine().priority_bitmap.fill(0, cliprect);
188   bitmap.fill(get_black_pen(screen.machine()), cliprect);
187   machine().priority_bitmap.fill(0, cliprect);
188   bitmap.fill(get_black_pen(machine()), cliprect);
189189
190190   if (~k007121_ctrlram_r(m_k007121, space, 3) & 0x20)
191191   {
r17988r17989
210210      }
211211
212212      m_layer0->draw(bitmap, finalclip0, TILEMAP_DRAW_OPAQUE, 0);
213      k007121_sprites_draw(m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, m_spriteram,(k007121_ctrlram_r(m_k007121, space, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(m_k007121, space, 3) & 0x40) >> 5);
213      k007121_sprites_draw(m_k007121, bitmap, cliprect, machine().gfx[0], machine().colortable, m_spriteram,(k007121_ctrlram_r(m_k007121, space, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(m_k007121, space, 3) & 0x40) >> 5);
214214      /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */
215215      m_layer1->draw(bitmap, finalclip1, TILEMAP_DRAW_OPAQUE, 0);
216216   }
r17988r17989
280280      if(use_clip3[1])
281281         m_layer1->draw(bitmap, finalclip3, 0, 1);
282282
283      k007121_sprites_draw(m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, m_spriteram, (k007121_ctrlram_r(m_k007121, space, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(m_k007121, space, 3) & 0x40) >> 5);
283      k007121_sprites_draw(m_k007121, bitmap, cliprect, machine().gfx[0], machine().colortable, m_spriteram, (k007121_ctrlram_r(m_k007121, space, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(m_k007121, space, 3) & 0x40) >> 5);
284284   }
285285   return 0;
286286}
trunk/src/mame/video/taito_o.c
r17988r17989
148148
149149   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
150150
151   parentj_draw_sprites(screen.machine(), bitmap, cliprect, 0);
152   parentj_draw_sprites(screen.machine(), bitmap, cliprect, 1);
151   parentj_draw_sprites(machine(), bitmap, cliprect, 0);
152   parentj_draw_sprites(machine(), bitmap, cliprect, 1);
153153
154154   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0);
155155   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 2, 0, 0);
trunk/src/mame/video/thief.c
r17988r17989
105105   int flipscreen = m_video_control&1;
106106   const UINT8 *source = videoram;
107107
108   if (tms9927_screen_reset(screen.machine().device("tms")))
108   if (tms9927_screen_reset(machine().device("tms")))
109109   {
110      bitmap.fill(get_black_pen(screen.machine()), cliprect);
110      bitmap.fill(get_black_pen(machine()), cliprect);
111111      return 0;
112112   }
113113
trunk/src/mame/video/ccastles.c
r17988r17989
261261{
262262   UINT8 *spriteaddr = &m_spriteram[m_video_control[7] * 0x100];   /* BUF1/BUF2 */
263263   int flip = m_video_control[4] ? 0xff : 0x00;   /* PLAYER2 */
264   pen_t black = get_black_pen(screen.machine());
264   pen_t black = get_black_pen(machine());
265265   int x, y, offs;
266266
267267   /* draw the sprites */
r17988r17989
273273      int which = spriteaddr[offs];
274274      int color = spriteaddr[offs + 2] >> 7;
275275
276      drawgfx_transpen(m_spritebitmap, cliprect, screen.machine().gfx[0], which, color, flip, flip, x, y, 7);
276      drawgfx_transpen(m_spritebitmap, cliprect, machine().gfx[0], which, color, flip, flip, x, y, 7);
277277   }
278278
279279   /* draw the bitmap to the screen, looping over Y */
trunk/src/mame/video/sprint2.c
r17988r17989
125125
126126   for (i = 0; i < 4; i++)
127127   {
128      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
128      drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
129129         get_sprite_code(video_ram, i),
130130         i,
131131         0, 0,
r17988r17989
144144      UINT8 *video_ram = m_video_ram;
145145      int i;
146146      int j;
147      const rectangle &visarea = screen.machine().primary_screen->visible_area();
147      const rectangle &visarea = machine().primary_screen->visible_area();
148148
149149      /*
150150         * Collisions are detected for both player cars:
r17988r17989
160160
161161         rect.min_x = get_sprite_x(video_ram, i);
162162         rect.min_y = get_sprite_y(video_ram, i);
163         rect.max_x = get_sprite_x(video_ram, i) + screen.machine().gfx[1]->width() - 1;
164         rect.max_y = get_sprite_y(video_ram, i) + screen.machine().gfx[1]->height() - 1;
163         rect.max_x = get_sprite_x(video_ram, i) + machine().gfx[1]->width() - 1;
164         rect.max_y = get_sprite_y(video_ram, i) + machine().gfx[1]->height() - 1;
165165
166166         rect &= visarea;
167167
r17988r17989
169169
170170         m_bg_tilemap->draw(m_helper, rect, 0, 0);
171171
172         drawgfx_transpen(m_helper, rect, screen.machine().gfx[1],
172         drawgfx_transpen(m_helper, rect, machine().gfx[1],
173173            get_sprite_code(video_ram, i),
174174            0,
175175            0, 0,
176176            get_sprite_x(video_ram, i),
177177            get_sprite_y(video_ram, i), 1);
178178
179         m_collision[i] |= collision_check(this, screen.machine().colortable, rect);
179         m_collision[i] |= collision_check(this, machine().colortable, rect);
180180
181181         /* check for sprite-sprite collisions */
182182
183183         for (j = 0; j < 4; j++)
184184            if (j != i)
185185            {
186               drawgfx_transpen(m_helper, rect, screen.machine().gfx[1],
186               drawgfx_transpen(m_helper, rect, machine().gfx[1],
187187                  get_sprite_code(video_ram, j),
188188                  1,
189189                  0, 0,
r17988r17989
191191                  get_sprite_y(video_ram, j), 0);
192192            }
193193
194         drawgfx_transpen(m_helper, rect, screen.machine().gfx[1],
194         drawgfx_transpen(m_helper, rect, machine().gfx[1],
195195            get_sprite_code(video_ram, i),
196196            0,
197197            0, 0,
198198            get_sprite_x(video_ram, i),
199199            get_sprite_y(video_ram, i), 1);
200200
201         m_collision[i] |= collision_check(this, screen.machine().colortable, rect);
201         m_collision[i] |= collision_check(this, machine().colortable, rect);
202202      }
203203   }
204204}
trunk/src/mame/video/ddragon3.c
r17988r17989
167167   {
168168      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
169169      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
170      draw_sprites(screen.machine(), bitmap, cliprect);
170      draw_sprites(machine(), bitmap, cliprect);
171171   }
172172   else if ((m_vreg & 0x60) == 0x60)
173173   {
174174      m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
175175      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
176      draw_sprites(screen.machine(), bitmap, cliprect);
176      draw_sprites(machine(), bitmap, cliprect);
177177   }
178178   else
179179   {
180180      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
181      draw_sprites(screen.machine(), bitmap, cliprect);
181      draw_sprites(machine(), bitmap, cliprect);
182182      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
183183   }
184184   return 0;
r17988r17989
195195   if(m_vreg & 8)
196196   {
197197      m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
198      draw_sprites(screen.machine(), bitmap, cliprect);
198      draw_sprites(machine(), bitmap, cliprect);
199199      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
200200   }
201201   else
202202   {
203203      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
204204      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
205      draw_sprites(screen.machine(), bitmap, cliprect);
205      draw_sprites(machine(), bitmap, cliprect);
206206   }
207207   return 0;
208208}
trunk/src/mame/video/ambush.c
r17988r17989
9595   bitmap.fill(0, cliprect);
9696
9797   /* Draw the characters */
98   draw_chars(screen.machine(), bitmap, cliprect, 0x00);
98   draw_chars(machine(), bitmap, cliprect, 0x00);
9999
100100   /* Draw the sprites. */
101101   for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
r17988r17989
146146         flipy = !flipy;
147147      }
148148
149      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[gfx],
149      drawgfx_transpen(bitmap,cliprect,machine().gfx[gfx],
150150            code, col | ((*m_colorbank & 0x03) << 4),
151151            flipx, flipy,
152152            sx,sy,0);
153153   }
154154
155155   /* Draw the foreground priority characters over the sprites */
156   draw_chars(screen.machine(), bitmap, cliprect, 0x10);
156   draw_chars(machine(), bitmap, cliprect, 0x10);
157157   return 0;
158158}
trunk/src/mame/video/orbit.c
r17988r17989
7979UINT32 orbit_state::screen_update_orbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8080{
8181
82   m_flip_screen = screen.machine().root_device().ioport("DSW2")->read() & 8;
82   m_flip_screen = machine().root_device().ioport("DSW2")->read() & 8;
8383
8484   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
8585
86   draw_sprites(screen.machine(), bitmap, cliprect);
86   draw_sprites(machine(), bitmap, cliprect);
8787   return 0;
8888}
trunk/src/mame/video/seibuspi.c
r17988r17989
608608      bitmap.fill(0, cliprect);
609609
610610   if (!(m_layer_enable & 0x1))
611      combine_tilemap(screen.machine(), bitmap, cliprect, m_back_layer, m_spi_scrollram[0] & 0xffff, (m_spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll);
611      combine_tilemap(machine(), bitmap, cliprect, m_back_layer, m_spi_scrollram[0] & 0xffff, (m_spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll);
612612
613   draw_sprites(screen.machine(), bitmap, cliprect, 0);
613   draw_sprites(machine(), bitmap, cliprect, 0);
614614
615615   // if fore layer is enabled, draw priority 1 sprites behind mid layer
616616   if (!(m_layer_enable & 0x4))
617      draw_sprites(screen.machine(), bitmap, cliprect, 1);
617      draw_sprites(machine(), bitmap, cliprect, 1);
618618
619619   if (!(m_layer_enable & 0x2))
620      combine_tilemap(screen.machine(), bitmap, cliprect, m_mid_layer, m_spi_scrollram[1] & 0xffff, (m_spi_scrollram[1] >> 16) & 0xffff, 0, mid_rowscroll);
620      combine_tilemap(machine(), bitmap, cliprect, m_mid_layer, m_spi_scrollram[1] & 0xffff, (m_spi_scrollram[1] >> 16) & 0xffff, 0, mid_rowscroll);
621621
622622   // if fore layer is disabled, draw priority 1 sprites above mid layer
623623   if ((m_layer_enable & 0x4))
624      draw_sprites(screen.machine(), bitmap, cliprect, 1);
624      draw_sprites(machine(), bitmap, cliprect, 1);
625625
626   draw_sprites(screen.machine(), bitmap, cliprect, 2);
626   draw_sprites(machine(), bitmap, cliprect, 2);
627627
628628   if (!(m_layer_enable & 0x4))
629      combine_tilemap(screen.machine(), bitmap, cliprect, m_fore_layer, m_spi_scrollram[2] & 0xffff, (m_spi_scrollram[2] >> 16) & 0xffff, 0, fore_rowscroll);
629      combine_tilemap(machine(), bitmap, cliprect, m_fore_layer, m_spi_scrollram[2] & 0xffff, (m_spi_scrollram[2] >> 16) & 0xffff, 0, fore_rowscroll);
630630
631   draw_sprites(screen.machine(), bitmap, cliprect, 3);
631   draw_sprites(machine(), bitmap, cliprect, 3);
632632
633   combine_tilemap(screen.machine(), bitmap, cliprect, m_text_layer, 0, 0, 0, NULL);
633   combine_tilemap(machine(), bitmap, cliprect, m_text_layer, 0, 0, 0, NULL);
634634   return 0;
635635}
636636
r17988r17989
655655UINT32 seibuspi_state::screen_update_sys386f2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
656656{
657657   bitmap.fill(0, cliprect);
658   draw_sprites(screen.machine(), bitmap, cliprect, 0);
659   draw_sprites(screen.machine(), bitmap, cliprect, 1);
660   draw_sprites(screen.machine(), bitmap, cliprect, 2);
661   draw_sprites(screen.machine(), bitmap, cliprect, 3);
658   draw_sprites(machine(), bitmap, cliprect, 0);
659   draw_sprites(machine(), bitmap, cliprect, 1);
660   draw_sprites(machine(), bitmap, cliprect, 2);
661   draw_sprites(machine(), bitmap, cliprect, 3);
662662   return 0;
663663}
trunk/src/mame/video/sauro.c
r17988r17989
149149
150150   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
151151   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
152   sauro_draw_sprites(screen.machine(), bitmap, cliprect);
152   sauro_draw_sprites(machine(), bitmap, cliprect);
153153   return 0;
154154}
155155
r17988r17989
221221UINT32 sauro_state::screen_update_trckydoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
222222{
223223   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
224   trckydoc_draw_sprites(screen.machine(), bitmap, cliprect);
224   trckydoc_draw_sprites(machine(), bitmap, cliprect);
225225   return 0;
226226}
trunk/src/mame/video/gaplus.c
r17988r17989
310310
311311   bitmap.fill(0, cliprect);
312312
313   starfield_render(screen.machine(), bitmap);
313   starfield_render(machine(), bitmap);
314314
315315   /* draw the low priority characters */
316316   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
317317
318   draw_sprites(screen.machine(), bitmap, cliprect);
318   draw_sprites(machine(), bitmap, cliprect);
319319
320320   /* draw the high priority characters */
321321   /* (I don't know if this feature is used by Gaplus, but it's shown in the schematics) */
r17988r17989
332332      struct star *stars = m_stars;
333333      int i;
334334
335      int width = screen.machine().primary_screen->width();
336      int height = screen.machine().primary_screen->height();
335      int width = machine().primary_screen->width();
336      int height = machine().primary_screen->height();
337337
338338      /* check if we're running */
339339      if ( ( m_starfield_control[0] & 1 ) == 0 )
trunk/src/mame/video/carpolo.c
r17988r17989
231231   bitmap.plot_box(0,TOP_BORDER,RIGHT_BORDER+1,BOTTOM_BORDER-TOP_BORDER+1,FIELD_PEN);
232232
233233   /* car 1 */
234   draw_sprite(screen.machine(), bitmap, cliprect,
234   draw_sprite(machine(), bitmap, cliprect,
235235            m_spriteram[0x00], m_spriteram[0x01],
236236            0, m_spriteram[0x0c] & 0x0f, CAR1_COLOR);
237237
r17988r17989
242242   bitmap.plot_box(RIGHT_BORDER,TOP_BORDER,1,BOTTOM_BORDER-TOP_BORDER+1,LINE_PEN);
243243
244244   /* car 4 */
245   draw_sprite(screen.machine(), bitmap, cliprect,
245   draw_sprite(machine(), bitmap, cliprect,
246246            m_spriteram[0x06], m_spriteram[0x07],
247247            0, m_spriteram[0x0d] >> 4, CAR4_COLOR);
248248
249249   /* car 3 */
250   draw_sprite(screen.machine(), bitmap, cliprect,
250   draw_sprite(machine(), bitmap, cliprect,
251251            m_spriteram[0x04], m_spriteram[0x05],
252252            0, m_spriteram[0x0d] & 0x0f, CAR3_COLOR);
253253
254254   /* car 2 */
255   draw_sprite(screen.machine(), bitmap, cliprect,
255   draw_sprite(machine(), bitmap, cliprect,
256256            m_spriteram[0x02], m_spriteram[0x03],
257257            0, m_spriteram[0x0c] >> 4, CAR2_COLOR);
258258
259259   /* ball */
260   draw_sprite(screen.machine(), bitmap, cliprect,
260   draw_sprite(machine(), bitmap, cliprect,
261261            m_spriteram[0x08], m_spriteram[0x09],
262262            1, m_spriteram[0x0e] & 0x0f, BALL_COLOR);
263263
264264   /* left goal - position determined by bit 6 of the
265265       horizontal and vertical timing PROMs */
266   drawgfxzoom_transpen(bitmap,cliprect,screen.machine().gfx[1],
266   drawgfxzoom_transpen(bitmap,cliprect,machine().gfx[1],
267267            0,0,
268268            0,0,
269269            LEFT_GOAL_X,GOAL_Y,
270270            0x20000,0x20000,0);
271271
272272   /* right goal */
273   drawgfxzoom_transpen(bitmap,cliprect,screen.machine().gfx[1],
273   drawgfxzoom_transpen(bitmap,cliprect,machine().gfx[1],
274274            0,1,
275275            1,0,
276276            RIGHT_GOAL_X,GOAL_Y,
r17988r17989
282282      popmessage("WIDE!\n");
283283
284284   if (m_spriteram[0x0f] & 0x01)
285      draw_sprite(screen.machine(), bitmap, cliprect,
285      draw_sprite(machine(), bitmap, cliprect,
286286               m_spriteram[0x0a], m_spriteram[0x0b],
287287               1, m_spriteram[0x0e] >> 4, SPECIAL_CHAR_COLOR);
288288
r17988r17989
293293       and bit 3 of the vertical timing PROM controls in
294294       which quadrant the line will actually appear */
295295
296   draw_alpha_line(screen.machine(), bitmap, cliprect, 0, (0*4+0)*2  );
297   draw_alpha_line(screen.machine(), bitmap, cliprect, 1, (0*4+0)*2+1);
298   draw_alpha_line(screen.machine(), bitmap, cliprect, 2, (3*4+1)*2  );
299   draw_alpha_line(screen.machine(), bitmap, cliprect, 3, (3*4+1)*2+1);
300   draw_alpha_line(screen.machine(), bitmap, cliprect, 4, (1*4+2)*2  );
301   draw_alpha_line(screen.machine(), bitmap, cliprect, 5, (1*4+2)*2+1);
302   draw_alpha_line(screen.machine(), bitmap, cliprect, 6, (0*4+3)*2  );
303   draw_alpha_line(screen.machine(), bitmap, cliprect, 7, (0*4+3)*2+1);
296   draw_alpha_line(machine(), bitmap, cliprect, 0, (0*4+0)*2  );
297   draw_alpha_line(machine(), bitmap, cliprect, 1, (0*4+0)*2+1);
298   draw_alpha_line(machine(), bitmap, cliprect, 2, (3*4+1)*2  );
299   draw_alpha_line(machine(), bitmap, cliprect, 3, (3*4+1)*2+1);
300   draw_alpha_line(machine(), bitmap, cliprect, 4, (1*4+2)*2  );
301   draw_alpha_line(machine(), bitmap, cliprect, 5, (1*4+2)*2+1);
302   draw_alpha_line(machine(), bitmap, cliprect, 6, (0*4+3)*2  );
303   draw_alpha_line(machine(), bitmap, cliprect, 7, (0*4+3)*2+1);
304304
305305   return 0;
306306}
r17988r17989
563563
564564      car1_x = m_spriteram[0x00];
565565      car1_y = m_spriteram[0x01];
566      remap_sprite_code(screen.machine(), 0, m_spriteram[0x0c] & 0x0f, &car1_code, &car1_flipy);
566      remap_sprite_code(machine(), 0, m_spriteram[0x0c] & 0x0f, &car1_code, &car1_flipy);
567567
568568      car2_x = m_spriteram[0x02];
569569      car2_y = m_spriteram[0x03];
570      remap_sprite_code(screen.machine(), 0, m_spriteram[0x0c] >> 4,   &car2_code, &car2_flipy);
570      remap_sprite_code(machine(), 0, m_spriteram[0x0c] >> 4,   &car2_code, &car2_flipy);
571571
572572      car3_x = m_spriteram[0x04];
573573      car3_y = m_spriteram[0x05];
574      remap_sprite_code(screen.machine(), 0, m_spriteram[0x0d] & 0x0f, &car3_code, &car3_flipy);
574      remap_sprite_code(machine(), 0, m_spriteram[0x0d] & 0x0f, &car3_code, &car3_flipy);
575575
576576      car4_x = m_spriteram[0x06];
577577      car4_y = m_spriteram[0x07];
578      remap_sprite_code(screen.machine(), 0, m_spriteram[0x0d] >> 4,   &car4_code, &car4_flipy);
578      remap_sprite_code(machine(), 0, m_spriteram[0x0d] >> 4,   &car4_code, &car4_flipy);
579579
580580      ball_x = m_spriteram[0x08];
581581      ball_y = m_spriteram[0x09];
582      remap_sprite_code(screen.machine(), 1, m_spriteram[0x0e] & 0x0f, &ball_code, &ball_flipy);
582      remap_sprite_code(machine(), 1, m_spriteram[0x0e] & 0x0f, &ball_code, &ball_flipy);
583583
584584
585585      /* cars 1 and 2 */
586      if (check_sprite_sprite_collision(screen.machine(),
586      if (check_sprite_sprite_collision(machine(),
587587                                car1_x, car1_y, car1_code, car1_flipy,
588588                                car2_x, car2_y, car2_code, car2_flipy,
589589                                &col_x, &col_y))
590         carpolo_generate_car_car_interrupt(screen.machine(), 0, 1);
590         carpolo_generate_car_car_interrupt(machine(), 0, 1);
591591
592592      /* cars 1 and 3 */
593      else if (check_sprite_sprite_collision(screen.machine(),
593      else if (check_sprite_sprite_collision(machine(),
594594                                    car1_x, car1_y, car1_code, car1_flipy,
595595                                    car3_x, car3_y, car3_code, car3_flipy,
596596                                    &col_x, &col_y))
597         carpolo_generate_car_car_interrupt(screen.machine(), 0, 2);
597         carpolo_generate_car_car_interrupt(machine(), 0, 2);
598598
599599      /* cars 1 and 4 */
600      else if (check_sprite_sprite_collision(screen.machine(),
600      else if (check_sprite_sprite_collision(machine(),
601601                                    car1_x, car1_y, car1_code, car1_flipy,
602602                                    car4_x, car4_y, car4_code, car4_flipy,
603603                                    &col_x, &col_y))
604         carpolo_generate_car_car_interrupt(screen.machine(), 0, 3);
604         carpolo_generate_car_car_interrupt(machine(), 0, 3);
605605
606606      /* cars 2 and 3 */
607      else if (check_sprite_sprite_collision(screen.machine(),
607      else if (check_sprite_sprite_collision(machine(),
608608                                    car2_x, car2_y, car2_code, car2_flipy,
609609                                    car3_x, car3_y, car3_code, car3_flipy,
610610                                    &col_x, &col_y))
611         carpolo_generate_car_car_interrupt(screen.machine(), 1, 2);
611         carpolo_generate_car_car_interrupt(machine(), 1, 2);
612612
613613      /* cars 2 and 4 */
614      else if (check_sprite_sprite_collision(screen.machine(),
614      else if (check_sprite_sprite_collision(machine(),
615615                                    car2_x, car2_y, car2_code, car2_flipy,
616616                                    car4_x, car4_y, car4_code, car4_flipy,
617617                                    &col_x, &col_y))
618         carpolo_generate_car_car_interrupt(screen.machine(), 1, 3);
618         carpolo_generate_car_car_interrupt(machine(), 1, 3);
619619
620620      /* cars 3 and 4 */
621      else if (check_sprite_sprite_collision(screen.machine(),
621      else if (check_sprite_sprite_collision(machine(),
622622                                    car3_x, car3_y, car3_code, car3_flipy,
623623                                    car4_x, car4_y, car4_code, car4_flipy,
624624                                    &col_x, &col_y))
625         carpolo_generate_car_car_interrupt(screen.machine(), 2, 3);
625         carpolo_generate_car_car_interrupt(machine(), 2, 3);
626626
627627
628628
629629      /* check car-ball collision */
630      if (check_sprite_sprite_collision(screen.machine(),
630      if (check_sprite_sprite_collision(machine(),
631631                                car1_x, car1_y, car1_code, car1_flipy,
632632                                ball_x, ball_y, ball_code, ball_flipy,
633633                                &col_x, &col_y))
634         carpolo_generate_car_ball_interrupt(screen.machine(), 0, col_x, col_y);
634         carpolo_generate_car_ball_interrupt(machine(), 0, col_x, col_y);
635635
636      else if (check_sprite_sprite_collision(screen.machine(),
636      else if (check_sprite_sprite_collision(machine(),
637637                                    car2_x, car2_y, car2_code, car2_flipy,
638638                                    ball_x, ball_y, ball_code, ball_flipy,
639639                                    &col_x, &col_y))
640         carpolo_generate_car_ball_interrupt(screen.machine(), 1, col_x, col_y);
640         carpolo_generate_car_ball_interrupt(machine(), 1, col_x, col_y);
641641
642      else if (check_sprite_sprite_collision(screen.machine(),
642      else if (check_sprite_sprite_collision(machine(),
643643                                    car3_x, car3_y, car3_code, car3_flipy,
644644                                    ball_x, ball_y, ball_code, ball_flipy,
645645                                    &col_x, &col_y))
646         carpolo_generate_car_ball_interrupt(screen.machine(), 2, col_x, col_y);
646         carpolo_generate_car_ball_interrupt(machine(), 2, col_x, col_y);
647647
648      else if (check_sprite_sprite_collision(screen.machine(),
648      else if (check_sprite_sprite_collision(machine(),
649649                                    car4_x, car4_y, car4_code, car4_flipy,
650650                                    ball_x, ball_y, ball_code, ball_flipy,
651651                                    &col_x, &col_y))
652         carpolo_generate_car_ball_interrupt(screen.machine(), 3, col_x, col_y);
652         carpolo_generate_car_ball_interrupt(machine(), 3, col_x, col_y);
653653
654654
655655      /* check car-goal collision */
656      if (check_sprite_left_goal_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy, 1))
657         carpolo_generate_car_goal_interrupt(screen.machine(), 0, 0);
656      if (check_sprite_left_goal_collision(machine(), car1_x, car1_y, car1_code, car1_flipy, 1))
657         carpolo_generate_car_goal_interrupt(machine(), 0, 0);
658658
659      else if (check_sprite_right_goal_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy, 1))
660         carpolo_generate_car_goal_interrupt(screen.machine(), 0, 1);
659      else if (check_sprite_right_goal_collision(machine(), car1_x, car1_y, car1_code, car1_flipy, 1))
660         carpolo_generate_car_goal_interrupt(machine(), 0, 1);
661661
662      else if (check_sprite_left_goal_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy, 1))
663         carpolo_generate_car_goal_interrupt(screen.machine(), 1, 0);
662      else if (check_sprite_left_goal_collision(machine(), car2_x, car2_y, car2_code, car2_flipy, 1))
663         carpolo_generate_car_goal_interrupt(machine(), 1, 0);
664664
665      else if (check_sprite_right_goal_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy, 1))
666         carpolo_generate_car_goal_interrupt(screen.machine(), 1, 1);
665      else if (check_sprite_right_goal_collision(machine(), car2_x, car2_y, car2_code, car2_flipy, 1))
666         carpolo_generate_car_goal_interrupt(machine(), 1, 1);
667667
668      else if (check_sprite_left_goal_collision(screen.machine(), car3_x, car3_y, car3_code, car3_flipy, 1))
669         carpolo_generate_car_goal_interrupt(screen.machine(), 2, 0);
668      else if (check_sprite_left_goal_collision(machine(), car3_x, car3_y, car3_code, car3_flipy, 1))
669         carpolo_generate_car_goal_interrupt(machine(), 2, 0);
670670
671      else if (check_sprite_right_goal_collision(screen.machine(), car3_x, car3_y, car3_code, car3_flipy, 1))
672         carpolo_generate_car_goal_interrupt(screen.machine(), 2, 1);
671      else if (check_sprite_right_goal_collision(machine(), car3_x, car3_y, car3_code, car3_flipy, 1))
672         carpolo_generate_car_goal_interrupt(machine(), 2, 1);
673673
674      else if (check_sprite_left_goal_collision(screen.machine(), car4_x, car4_y, car4_code, car4_flipy, 1))
675         carpolo_generate_car_goal_interrupt(screen.machine(), 3, 0);
674      else if (check_sprite_left_goal_collision(machine(), car4_x, car4_y, car4_code, car4_flipy, 1))
675         carpolo_generate_car_goal_interrupt(machine(), 3, 0);
676676
677      else if (check_sprite_right_goal_collision(screen.machine(), car4_x, car4_y, car4_code, car4_flipy, 1))
678         carpolo_generate_car_goal_interrupt(screen.machine(), 3, 1);
677      else if (check_sprite_right_goal_collision(machine(), car4_x, car4_y, car4_code, car4_flipy, 1))
678         carpolo_generate_car_goal_interrupt(machine(), 3, 1);
679679
680680
681681      /* check ball collision with static screen elements */
682682      {
683683         int col;
684684
685         col = check_sprite_left_goal_collision(screen.machine(), ball_x, ball_y, ball_code, ball_flipy, 0);
685         col = check_sprite_left_goal_collision(machine(), ball_x, ball_y, ball_code, ball_flipy, 0);
686686
687         if (col == 1)  carpolo_generate_ball_screen_interrupt(screen.machine(), 0x05);
688         if (col == 2)  carpolo_generate_ball_screen_interrupt(screen.machine(), 0x03);
687         if (col == 1)  carpolo_generate_ball_screen_interrupt(machine(), 0x05);
688         if (col == 2)  carpolo_generate_ball_screen_interrupt(machine(), 0x03);
689689
690690
691         col = check_sprite_right_goal_collision(screen.machine(), ball_x, ball_y, ball_code, ball_flipy, 0);
691         col = check_sprite_right_goal_collision(machine(), ball_x, ball_y, ball_code, ball_flipy, 0);
692692
693         if (col == 1)  carpolo_generate_ball_screen_interrupt(screen.machine(), 0x05 | 0x08);
694         if (col == 2)  carpolo_generate_ball_screen_interrupt(screen.machine(), 0x03 | 0x08);
693         if (col == 1)  carpolo_generate_ball_screen_interrupt(machine(), 0x05 | 0x08);
694         if (col == 2)  carpolo_generate_ball_screen_interrupt(machine(), 0x03 | 0x08);
695695
696696
697         if (check_sprite_border_collision(screen.machine(), ball_x, ball_y, ball_code, ball_flipy))
698            carpolo_generate_ball_screen_interrupt(screen.machine(), 0x06);
697         if (check_sprite_border_collision(machine(), ball_x, ball_y, ball_code, ball_flipy))
698            carpolo_generate_ball_screen_interrupt(machine(), 0x06);
699699      }
700700
701701
r17988r17989
703703      {
704704         int col;
705705
706         col = check_sprite_border_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy);
706         col = check_sprite_border_collision(machine(), car1_x, car1_y, car1_code, car1_flipy);
707707
708708         if (col)
709            carpolo_generate_car_border_interrupt(screen.machine(), 0, (col == 2));
709            carpolo_generate_car_border_interrupt(machine(), 0, (col == 2));
710710         else
711711         {
712            col = check_sprite_border_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy);
712            col = check_sprite_border_collision(machine(), car2_x, car2_y, car2_code, car2_flipy);
713713
714714            if (col)
715               carpolo_generate_car_border_interrupt(screen.machine(), 1, (col == 2));
715               carpolo_generate_car_border_interrupt(machine(), 1, (col == 2));
716716            else
717717            {
718               col = check_sprite_border_collision(screen.machine(), car3_x, car3_y, car3_code, car3_flipy);
718               col = check_sprite_border_collision(machine(), car3_x, car3_y, car3_code, car3_flipy);
719719
720720               if (col)
721                  carpolo_generate_car_border_interrupt(screen.machine(), 2, (col == 2));
721                  carpolo_generate_car_border_interrupt(machine(), 2, (col == 2));
722722               else
723723               {
724                  col = check_sprite_border_collision(screen.machine(), car4_x, car4_y, car4_code, car4_flipy);
724                  col = check_sprite_border_collision(machine(), car4_x, car4_y, car4_code, car4_flipy);
725725
726726                  if (col)
727                     carpolo_generate_car_border_interrupt(screen.machine(), 3, (col == 2));
727                     carpolo_generate_car_border_interrupt(machine(), 3, (col == 2));
728728               }
729729            }
730730         }
trunk/src/mame/video/drmicro.c
r17988r17989
146146         else
147147            x = (240 - x) & 0xff;
148148
149         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[3-g],
149         drawgfx_transpen(bitmap,cliprect,machine().gfx[3-g],
150150               chr,
151151               col,
152152               fx,fy,
r17988r17989
154154
155155         if (x > 240)
156156         {
157            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[3-g],
157            drawgfx_transpen(bitmap,cliprect,machine().gfx[3-g],
158158                  chr,
159159                  col,
160160                  fx,fy,
trunk/src/mame/video/speedatk.c
r17988r17989
106106         color = m_colorram[count] & 0x1f;
107107         region = (m_colorram[count] & 0x10) >> 4;
108108
109         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[region],tile,color,m_flip_scr,m_flip_scr,x*8,y*8);
109         drawgfx_opaque(bitmap,cliprect,machine().gfx[region],tile,color,m_flip_scr,m_flip_scr,x*8,y*8);
110110
111111         count = (m_flip_scr) ? count-1 : count+1;
112112         count&=0x3ff;
trunk/src/mame/video/powerins.c
r17988r17989
339339   m_tilemap_1->set_scrolly(0,  0x00);
340340
341341#ifdef MAME_DEBUG
342if (screen.machine().input().code_pressed(KEYCODE_Z))
342if (machine().input().code_pressed(KEYCODE_Z))
343343{
344344   int msk = 0;
345345
346   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
347   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
348//  if (screen.machine().input().code_pressed(KEYCODE_E))    msk |= 4;
349   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
346   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
347   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
348//  if (machine().input().code_pressed(KEYCODE_E))    msk |= 4;
349   if (machine().input().code_pressed(KEYCODE_A))   msk |= 8;
350350   if (msk != 0) layers_ctrl &= msk;
351351}
352352#endif
353353
354354   if (layers_ctrl&1)      m_tilemap_0->draw(bitmap, cliprect, 0, 0);
355355   else               bitmap.fill(0, cliprect);
356   if (layers_ctrl&8)      draw_sprites(screen.machine(),bitmap,cliprect);
356   if (layers_ctrl&8)      draw_sprites(machine(),bitmap,cliprect);
357357   if (layers_ctrl&2)      m_tilemap_1->draw(bitmap, cliprect, 0, 0);
358358   return 0;
359359}
trunk/src/mame/video/niyanpai.c
r17988r17989
398398      for (y = 0; y < height; y++)
399399         for (x = 0; x < width; x++)
400400         {
401            update_pixel(screen.machine(), 0, x, y);
402            update_pixel(screen.machine(), 1, x, y);
403            update_pixel(screen.machine(), 2, x, y);
401            update_pixel(machine(), 0, x, y);
402            update_pixel(machine(), 1, x, y);
403            update_pixel(machine(), 2, x, y);
404404         }
405405   }
406406
trunk/src/mame/video/stvvdp2.c
r17988r17989
66386638
66396639UINT32 saturn_state::screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
66406640{
6641   saturn_state *state = screen.machine().driver_data<saturn_state>();
6641   saturn_state *state = machine().driver_data<saturn_state>();
66426642
6643   stv_vdp2_fade_effects(screen.machine());
6643   stv_vdp2_fade_effects(machine());
66446644
6645   stv_vdp2_draw_back(screen.machine(), m_tmpbitmap,cliprect);
6645   stv_vdp2_draw_back(machine(), m_tmpbitmap,cliprect);
66466646
66476647   #if DEBUG_MODE
6648   if(screen.machine().input().code_pressed_once(KEYCODE_T))
6648   if(machine().input().code_pressed_once(KEYCODE_T))
66496649   {
66506650      vdpdebug.l_en^=1;
66516651      popmessage("NBG3 %sabled",vdpdebug.l_en & 1 ? "en" : "dis");
66526652   }
6653   if(screen.machine().input().code_pressed_once(KEYCODE_Y))
6653   if(machine().input().code_pressed_once(KEYCODE_Y))
66546654   {
66556655      vdpdebug.l_en^=2;
66566656      popmessage("NBG2 %sabled",vdpdebug.l_en & 2 ? "en" : "dis");
66576657   }
6658   if(screen.machine().input().code_pressed_once(KEYCODE_U))
6658   if(machine().input().code_pressed_once(KEYCODE_U))
66596659   {
66606660      vdpdebug.l_en^=4;
66616661      popmessage("NBG1 %sabled",vdpdebug.l_en & 4 ? "en" : "dis");
66626662   }
6663   if(screen.machine().input().code_pressed_once(KEYCODE_I))
6663   if(machine().input().code_pressed_once(KEYCODE_I))
66646664   {
66656665      vdpdebug.l_en^=8;
66666666      popmessage("NBG0 %sabled",vdpdebug.l_en & 8 ? "en" : "dis");
66676667   }
6668   if(screen.machine().input().code_pressed_once(KEYCODE_K))
6668   if(machine().input().code_pressed_once(KEYCODE_K))
66696669   {
66706670      vdpdebug.l_en^=0x10;
66716671      popmessage("RBG0 %sabled",vdpdebug.l_en & 0x10 ? "en" : "dis");
66726672   }
6673   if(screen.machine().input().code_pressed_once(KEYCODE_O))
6673   if(machine().input().code_pressed_once(KEYCODE_O))
66746674   {
66756675      vdpdebug.l_en^=0x20;
66766676      popmessage("SPRITE %sabled",vdpdebug.l_en & 0x20 ? "en" : "dis");
r17988r17989
66886688      /*If a plane has a priority value of zero it isn't shown at all.*/
66896689      for(pri=1;pri<8;pri++)
66906690      {
6691         if (vdpdebug.l_en & 1)    { if(pri==STV_VDP2_N3PRIN) stv_vdp2_draw_NBG3(screen.machine(), m_tmpbitmap,cliprect); }
6692         if (vdpdebug.l_en & 2)    { if(pri==STV_VDP2_N2PRIN) stv_vdp2_draw_NBG2(screen.machine(), m_tmpbitmap,cliprect); }
6693         if (vdpdebug.l_en & 4)    { if(pri==STV_VDP2_N1PRIN) stv_vdp2_draw_NBG1(screen.machine(), m_tmpbitmap,cliprect); }
6694         if (vdpdebug.l_en & 8)    { if(pri==STV_VDP2_N0PRIN) stv_vdp2_draw_NBG0(screen.machine(), m_tmpbitmap,cliprect); }
6695         if (vdpdebug.l_en & 0x10) { if(pri==STV_VDP2_R0PRIN) stv_vdp2_draw_RBG0(screen.machine(), m_tmpbitmap,cliprect); }
6696         if (vdpdebug.l_en & 0x20) { draw_sprites(screen.machine(),m_tmpbitmap,cliprect,pri); }
6691         if (vdpdebug.l_en & 1)    { if(pri==STV_VDP2_N3PRIN) stv_vdp2_draw_NBG3(machine(), m_tmpbitmap,cliprect); }
6692         if (vdpdebug.l_en & 2)    { if(pri==STV_VDP2_N2PRIN) stv_vdp2_draw_NBG2(machine(), m_tmpbitmap,cliprect); }
6693         if (vdpdebug.l_en & 4)    { if(pri==STV_VDP2_N1PRIN) stv_vdp2_draw_NBG1(machine(), m_tmpbitmap,cliprect); }
6694         if (vdpdebug.l_en & 8)    { if(pri==STV_VDP2_N0PRIN) stv_vdp2_draw_NBG0(machine(), m_tmpbitmap,cliprect); }
6695         if (vdpdebug.l_en & 0x10) { if(pri==STV_VDP2_R0PRIN) stv_vdp2_draw_RBG0(machine(), m_tmpbitmap,cliprect); }
6696         if (vdpdebug.l_en & 0x20) { draw_sprites(machine(),m_tmpbitmap,cliprect,pri); }
66976697      }
66986698   }
66996699
r17988r17989
67046704    ,STV_VDP2_N1ZMXI,STV_VDP2_N1ZMXD
67056705    ,STV_VDP2_N1ZMYI,STV_VDP2_N1ZMYD);*/
67066706
6707   if ( screen.machine().input().code_pressed_once(KEYCODE_W) )
6707   if ( machine().input().code_pressed_once(KEYCODE_W) )
67086708   {
67096709      int tilecode;
67106710
67116711      for (tilecode = 0;tilecode<0x8000;tilecode++)
67126712      {
6713         screen.machine().gfx[0]->mark_dirty(tilecode);
6713         machine().gfx[0]->mark_dirty(tilecode);
67146714      }
67156715
67166716      for (tilecode = 0;tilecode<0x2000;tilecode++)
67176717      {
6718         screen.machine().gfx[1]->mark_dirty(tilecode);
6718         machine().gfx[1]->mark_dirty(tilecode);
67196719      }
67206720
67216721      for (tilecode = 0;tilecode<0x4000;tilecode++)
67226722      {
6723         screen.machine().gfx[2]->mark_dirty(tilecode);
6723         machine().gfx[2]->mark_dirty(tilecode);
67246724      }
67256725
67266726      for (tilecode = 0;tilecode<0x1000;tilecode++)
67276727      {
6728         screen.machine().gfx[3]->mark_dirty(tilecode);
6728         machine().gfx[3]->mark_dirty(tilecode);
67296729      }
67306730
67316731      /* vdp 1 ... doesn't have to be tile based */
67326732
67336733      for (tilecode = 0;tilecode<0x8000;tilecode++)
67346734      {
6735         screen.machine().gfx[4]->mark_dirty(tilecode);
6735         machine().gfx[4]->mark_dirty(tilecode);
67366736      }
67376737      for (tilecode = 0;tilecode<0x2000;tilecode++)
67386738      {
6739         screen.machine().gfx[5]->mark_dirty(tilecode);
6739         machine().gfx[5]->mark_dirty(tilecode);
67406740      }
67416741      for (tilecode = 0;tilecode<0x4000;tilecode++)
67426742      {
6743         screen.machine().gfx[6]->mark_dirty(tilecode);
6743         machine().gfx[6]->mark_dirty(tilecode);
67446744      }
67456745      for (tilecode = 0;tilecode<0x1000;tilecode++)
67466746      {
6747         screen.machine().gfx[7]->mark_dirty(tilecode);
6747         machine().gfx[7]->mark_dirty(tilecode);
67486748      }
67496749   }
67506750
6751   if ( screen.machine().input().code_pressed_once(KEYCODE_N) )
6751   if ( machine().input().code_pressed_once(KEYCODE_N) )
67526752   {
67536753      FILE *fp;
67546754
r17988r17989
67606760      }
67616761   }
67626762
6763   if ( screen.machine().input().code_pressed_once(KEYCODE_M) )
6763   if ( machine().input().code_pressed_once(KEYCODE_M) )
67646764   {
67656765      FILE *fp;
67666766
r17988r17989
71907190
71917191UINT32 saturn_state::screen_update_saturn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
71927192{
7193   saturn_state *state = screen.machine().driver_data<saturn_state>();
7193   saturn_state *state = machine().driver_data<saturn_state>();
71947194   static UINT8 disclaimer;
71957195
7196   vdp2_draw_back(screen.machine(),bitmap,cliprect);
7196   vdp2_draw_back(machine(),bitmap,cliprect);
71977197
71987198   if(STV_VDP2_DISP)
71997199   {
7200      copy_plane(screen.machine(),3);
7200      copy_plane(machine(),3);
72017201
7202      draw_normal_screen(screen.machine(),bitmap,cliprect,3);
7202      draw_normal_screen(machine(),bitmap,cliprect,3);
72037203   }
72047204
72057205   if(disclaimer == 0)
trunk/src/mame/video/exedexes.c
r17988r17989
222222   else
223223      bitmap.fill(0, cliprect);
224224
225   draw_sprites(screen.machine(), bitmap, cliprect, 1);
225   draw_sprites(machine(), bitmap, cliprect, 1);
226226
227227   if (m_sc1on)
228228   {
r17988r17989
231231      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
232232   }
233233
234   draw_sprites(screen.machine(), bitmap, cliprect, 0);
234   draw_sprites(machine(), bitmap, cliprect, 0);
235235
236236   if (m_chon)
237237      m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/jedi.c
r17988r17989
334334   {
335335      /* draw the background/text layers, followed by the sprites
336336           - it needs to be done in this order*/
337      draw_background_and_text(screen.machine(), this, bitmap, cliprect);
338      draw_sprites(screen.machine(), this, bitmap, cliprect);
337      draw_background_and_text(machine(), this, bitmap, cliprect);
338      draw_sprites(machine(), this, bitmap, cliprect);
339339      do_pen_lookup(this, bitmap, cliprect);
340340   }
341341
trunk/src/mame/video/suprnova.c
r17988r17989
447447UINT32 skns_state::screen_update_skns(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
448448{
449449
450   palette_update(screen.machine());
450   palette_update(machine());
451451
452   bitmap.fill(get_black_pen(screen.machine()), cliprect);
452   bitmap.fill(get_black_pen(machine()), cliprect);
453453   m_tilemap_bitmap_lower.fill(0);
454454   m_tilemap_bitmapflags_lower.fill(0);
455455   m_tilemap_bitmap_higher.fill(0);
r17988r17989
466466      //popmessage("pri %d %d\n", supernova_pri_a, supernova_pri_b);
467467
468468      /*if (!supernova_pri_b) { */
469      supernova_draw_b(screen.machine(), m_tilemap_bitmap_lower, m_tilemap_bitmapflags_lower, cliprect,tran);// tran = 1;
470      supernova_draw_a(screen.machine(), m_tilemap_bitmap_higher,m_tilemap_bitmapflags_higher,cliprect,tran);// tran = 1;
469      supernova_draw_b(machine(), m_tilemap_bitmap_lower, m_tilemap_bitmapflags_lower, cliprect,tran);// tran = 1;
470      supernova_draw_a(machine(), m_tilemap_bitmap_higher,m_tilemap_bitmapflags_higher,cliprect,tran);// tran = 1;
471471
472472      {
473473         int x,y;
r17988r17989
476476         UINT32* dst;
477477         UINT16 pri, pri2, pri3;
478478         UINT16 bgpri;
479         const pen_t *clut = &screen.machine().pens[0];
479         const pen_t *clut = &machine().pens[0];
480480//          int drawpri;
481481
482482
r17988r17989
621621   m_sprite_bitmap.fill(0x0000, cliprect);
622622
623623   if (m_alt_enable_sprites)
624      m_spritegen->skns_draw_sprites(screen.machine(), m_sprite_bitmap, cliprect, m_spriteram, m_spriteram.bytes(), screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), m_spc_regs );
624      m_spritegen->skns_draw_sprites(machine(), m_sprite_bitmap, cliprect, m_spriteram, m_spriteram.bytes(), machine().root_device().memregion("gfx1")->base(), machine().root_device().memregion ("gfx1")->bytes(), m_spc_regs );
625625
626626
627627   return 0;
trunk/src/mame/video/seta2.c
r17988r17989
479479{
480480
481481   // Black or pen 0?
482   bitmap.fill(screen.machine().pens[0], cliprect);
482   bitmap.fill(machine().pens[0], cliprect);
483483
484484   if ( (m_vregs[0x30/2] & 1) == 0 )   // 1 = BLANK SCREEN
485      draw_sprites(screen.machine(), bitmap, cliprect);
485      draw_sprites(machine(), bitmap, cliprect);
486486
487487   return 0;
488488}
trunk/src/mame/video/namcofl.c
r17988r17989
8484{
8585   int pri;
8686
87   namcofl_install_palette(screen.machine());
87   namcofl_install_palette(machine());
8888
89   bitmap.fill(get_black_pen(screen.machine()), cliprect );
89   bitmap.fill(get_black_pen(machine()), cliprect );
9090
9191   for( pri=0; pri<16; pri++ )
9292   {
trunk/src/mame/video/flkatck.c
r17988r17989
132132   rectangle clip[2];
133133   const rectangle &visarea = screen.visible_area();
134134
135   address_space &space = screen.machine().driver_data()->generic_space();
135   address_space &space = machine().driver_data()->generic_space();
136136   if (m_flipscreen)
137137   {
138138      clip[0] = visarea;
r17988r17989
165165
166166   /* draw the graphics */
167167   m_k007121_tilemap[0]->draw(bitmap, clip[0], 0, 0);
168   k007121_sprites_draw(m_k007121, bitmap, cliprect, screen.machine().gfx[0], NULL, &m_k007121_ram[0x1000], 0, 40, 0, (UINT32)-1);
168   k007121_sprites_draw(m_k007121, bitmap, cliprect, machine().gfx[0], NULL, &m_k007121_ram[0x1000], 0, 40, 0, (UINT32)-1);
169169   m_k007121_tilemap[1]->draw(bitmap, clip[1], 0, 0);
170170   return 0;
171171}
trunk/src/mame/video/dynax.c
r17988r17989
12431243   int layers_ctrl = ~m_layer_enable;
12441244   int lay[4];
12451245
1246   if (debug_viewer(screen.machine(), bitmap, cliprect))
1246   if (debug_viewer(machine(), bitmap, cliprect))
12471247      return 0;
12481248
1249   layers_ctrl &= debug_mask(screen.machine());
1249   layers_ctrl &= debug_mask(machine());
12501250
12511251   bitmap.fill((m_blit_backpen & 0xff) + (m_blit_palbank & 1) * 256, cliprect);
12521252
r17988r17989
12651265      case 0x15:   lay[0] = 0; lay[1] = 2; lay[2] = 3; lay[3] = 1; break;
12661266   }
12671267
1268   if (BIT(layers_ctrl, lay[0]))   hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[0]);
1269   if (BIT(layers_ctrl, lay[1]))   hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[1]);
1270   if (BIT(layers_ctrl, lay[2]))   hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[2]);
1271   if (BIT(layers_ctrl, lay[3]))   hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[3]);
1268   if (BIT(layers_ctrl, lay[0]))   hanamai_copylayer(machine(), bitmap, cliprect, lay[0]);
1269   if (BIT(layers_ctrl, lay[1]))   hanamai_copylayer(machine(), bitmap, cliprect, lay[1]);
1270   if (BIT(layers_ctrl, lay[2]))   hanamai_copylayer(machine(), bitmap, cliprect, lay[2]);
1271   if (BIT(layers_ctrl, lay[3]))   hanamai_copylayer(machine(), bitmap, cliprect, lay[3]);
12721272   return 0;
12731273}
12741274
r17988r17989
12791279   int lay[4];
12801280   int pri;
12811281
1282   if (debug_viewer(screen.machine(), bitmap, cliprect))
1282   if (debug_viewer(machine(), bitmap, cliprect))
12831283      return 0;
12841284
1285   layers_ctrl &= debug_mask(screen.machine());
1285   layers_ctrl &= debug_mask(machine());
12861286
12871287   bitmap.fill((m_blit_backpen & 0xff) + (m_blit_palbank & 0x0f) * 256, cliprect);
12881288
r17988r17989
13001300   lay[2] = (pri >>  4) & 3;
13011301   lay[3] = (pri >>  0) & 3;
13021302
1303   if (BIT(layers_ctrl, lay[0]))   hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[0]);
1304   if (BIT(layers_ctrl, lay[1]))   hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[1]);
1305   if (BIT(layers_ctrl, lay[2]))   hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[2]);
1306   if (BIT(layers_ctrl, lay[3]))   hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[3]);
1303   if (BIT(layers_ctrl, lay[0]))   hanamai_copylayer(machine(), bitmap, cliprect, lay[0]);
1304   if (BIT(layers_ctrl, lay[1]))   hanamai_copylayer(machine(), bitmap, cliprect, lay[1]);
1305   if (BIT(layers_ctrl, lay[2]))   hanamai_copylayer(machine(), bitmap, cliprect, lay[2]);
1306   if (BIT(layers_ctrl, lay[3]))   hanamai_copylayer(machine(), bitmap, cliprect, lay[3]);
13071307
13081308   return 0;
13091309}
r17988r17989
13131313{
13141314   int layers_ctrl = ~m_layer_enable;
13151315
1316   if (debug_viewer(screen.machine(),bitmap,cliprect))
1316   if (debug_viewer(machine(),bitmap,cliprect))
13171317      return 0;
13181318
1319   layers_ctrl &= debug_mask(screen.machine());
1319   layers_ctrl &= debug_mask(machine());
13201320
13211321   bitmap.fill((m_blit_backpen & 0xff) + (m_blit_palbank & 1) * 256, cliprect);
13221322
1323   if (BIT(layers_ctrl, 0))   hanamai_copylayer(screen.machine(), bitmap, cliprect, 0);
1324   if (BIT(layers_ctrl, 1))   hanamai_copylayer(screen.machine(), bitmap, cliprect, 1);
1325   if (BIT(layers_ctrl, 2))   hanamai_copylayer(screen.machine(), bitmap, cliprect, 2);
1323   if (BIT(layers_ctrl, 0))   hanamai_copylayer(machine(), bitmap, cliprect, 0);
1324   if (BIT(layers_ctrl, 1))   hanamai_copylayer(machine(), bitmap, cliprect, 1);
1325   if (BIT(layers_ctrl, 2))   hanamai_copylayer(machine(), bitmap, cliprect, 2);
13261326   return 0;
13271327}
13281328
r17988r17989
13301330{
13311331   int layers_ctrl = m_layer_enable;
13321332
1333   if (debug_viewer(screen.machine(), bitmap, cliprect))
1333   if (debug_viewer(machine(), bitmap, cliprect))
13341334      return 0;
13351335
1336   layers_ctrl &= debug_mask(screen.machine());
1336   layers_ctrl &= debug_mask(machine());
13371337
13381338   bitmap.fill((m_blit_backpen & 0xff) + (m_blit_palbank & 1) * 256, cliprect);
13391339
1340//  if (BIT(layers_ctrl, 0))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 3, 0);
1341   if (BIT(layers_ctrl, 1))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 2, 0);
1342   if (BIT(layers_ctrl, 2))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 1, 0);
1343   if (BIT(layers_ctrl, 3))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 0, 0);
1340//  if (BIT(layers_ctrl, 0))   jantouki_copylayer(machine(), bitmap, cliprect, 3, 0);
1341   if (BIT(layers_ctrl, 1))   jantouki_copylayer(machine(), bitmap, cliprect, 2, 0);
1342   if (BIT(layers_ctrl, 2))   jantouki_copylayer(machine(), bitmap, cliprect, 1, 0);
1343   if (BIT(layers_ctrl, 3))   jantouki_copylayer(machine(), bitmap, cliprect, 0, 0);
13441344   return 0;
13451345}
13461346
r17988r17989
13481348{
13491349   int layers_ctrl = m_layer_enable;
13501350
1351   if (debug_viewer(screen.machine(), bitmap, cliprect))
1351   if (debug_viewer(machine(), bitmap, cliprect))
13521352      return 0;
13531353
1354   layers_ctrl &= debug_mask(screen.machine());
1354   layers_ctrl &= debug_mask(machine());
13551355
13561356   bitmap.fill((m_blit_backpen & 0xff) + (m_blit_palbank & 1) * 256, cliprect);
13571357
1358   if (BIT(layers_ctrl, 0))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 3, 0);
1359   if (BIT(layers_ctrl, 4))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 7, 0);
1360   if (BIT(layers_ctrl, 5))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 6, 0);
1361   if (BIT(layers_ctrl, 6))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 5, 0);
1362   if (BIT(layers_ctrl, 7))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 4, 0);
1358   if (BIT(layers_ctrl, 0))   jantouki_copylayer(machine(), bitmap, cliprect, 3, 0);
1359   if (BIT(layers_ctrl, 4))   jantouki_copylayer(machine(), bitmap, cliprect, 7, 0);
1360   if (BIT(layers_ctrl, 5))   jantouki_copylayer(machine(), bitmap, cliprect, 6, 0);
1361   if (BIT(layers_ctrl, 6))   jantouki_copylayer(machine(), bitmap, cliprect, 5, 0);
1362   if (BIT(layers_ctrl, 7))   jantouki_copylayer(machine(), bitmap, cliprect, 4, 0);
13631363   return 0;
13641364}
13651365
r17988r17989
13681368{
13691369   int layers_ctrl = ~m_layer_enable;
13701370
1371   if (debug_viewer(screen.machine(), bitmap, cliprect))
1371   if (debug_viewer(machine(), bitmap, cliprect))
13721372      return 0;
13731373
1374   layers_ctrl &= debug_mask(screen.machine());
1374   layers_ctrl &= debug_mask(machine());
13751375
13761376   bitmap.fill((m_blit_backpen & 0xff) + (m_blit_palbank & 1) * 256, cliprect);
13771377
1378   if (BIT(layers_ctrl, 0))   mjdialq2_copylayer(screen.machine(), bitmap, cliprect, 0);
1379   if (BIT(layers_ctrl, 1))   mjdialq2_copylayer(screen.machine(), bitmap, cliprect, 1);
1378   if (BIT(layers_ctrl, 0))   mjdialq2_copylayer(machine(), bitmap, cliprect, 0);
1379   if (BIT(layers_ctrl, 1))   mjdialq2_copylayer(machine(), bitmap, cliprect, 1);
13801380   return 0;
13811381}
13821382
r17988r17989
13971397   for (layer = 0; layer < 4; layer++)
13981398   {
13991399      bitmap.fill(0, cliprect);
1400      hanamai_copylayer(screen.machine(), bitmap, cliprect, layer);
1400      hanamai_copylayer(machine(), bitmap, cliprect, layer);
14011401
14021402      for (y = 0; y < 256; y++)
14031403         for (x = 0; x < 512; x++)
trunk/src/mame/video/shootout.c
r17988r17989
170170UINT32 shootout_state::screen_update_shootout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
171171{
172172
173   screen.machine().priority_bitmap.fill(0, cliprect);
173   machine().priority_bitmap.fill(0, cliprect);
174174
175175   m_background->draw(bitmap, cliprect, 0,0);
176176   m_foreground->draw(bitmap, cliprect, 0,1);
177   draw_sprites(screen.machine(), bitmap,cliprect,3/*bank bits */);
177   draw_sprites(machine(), bitmap,cliprect,3/*bank bits */);
178178   return 0;
179179}
180180
181181UINT32 shootout_state::screen_update_shootouj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
182182{
183183
184   screen.machine().priority_bitmap.fill(0, cliprect);
184   machine().priority_bitmap.fill(0, cliprect);
185185
186186   m_background->draw(bitmap, cliprect, 0,0);
187187   m_foreground->draw(bitmap, cliprect, 0,1);
188   draw_sprites(screen.machine(), bitmap,cliprect,2/*bank bits*/);
188   draw_sprites(machine(), bitmap,cliprect,2/*bank bits*/);
189189   return 0;
190190}
trunk/src/mame/video/contra.c
r17988r17989
308308
309309UINT32 contra_state::screen_update_contra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
310310{
311   address_space &space = screen.machine().driver_data()->generic_space();
311   address_space &space = machine().driver_data()->generic_space();
312312   UINT8 ctrl_1_0 = k007121_ctrlram_r(m_k007121_1, space, 0);
313313   UINT8 ctrl_1_2 = k007121_ctrlram_r(m_k007121_1, space, 2);
314314   UINT8 ctrl_2_0 = k007121_ctrlram_r(m_k007121_2, space, 0);
r17988r17989
321321   fg_finalclip &= cliprect;
322322   tx_finalclip &= cliprect;
323323
324   set_pens(screen.machine());
324   set_pens(machine());
325325
326326   m_fg_tilemap->set_scrollx(0, ctrl_1_0 - 40);
327327   m_fg_tilemap->set_scrolly(0, ctrl_1_2);
r17988r17989
330330
331331   m_bg_tilemap->draw(bitmap, bg_finalclip, 0 ,0);
332332   m_fg_tilemap->draw(bitmap, fg_finalclip, 0 ,0);
333   draw_sprites(screen.machine(),bitmap,cliprect, 0);
334   draw_sprites(screen.machine(),bitmap,cliprect, 1);
333   draw_sprites(machine(),bitmap,cliprect, 0);
334   draw_sprites(machine(),bitmap,cliprect, 1);
335335   m_tx_tilemap->draw(bitmap, tx_finalclip, 0 ,0);
336336   return 0;
337337}
trunk/src/mame/video/paradise.c
r17988r17989
235235   int layers_ctrl = -1;
236236
237237#ifdef MAME_DEBUG
238if (screen.machine().input().code_pressed(KEYCODE_Z))
238if (machine().input().code_pressed(KEYCODE_Z))
239239{
240240   int mask = 0;
241   if (screen.machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
242   if (screen.machine().input().code_pressed(KEYCODE_W))   mask |= 2;
243   if (screen.machine().input().code_pressed(KEYCODE_E))   mask |= 4;
244   if (screen.machine().input().code_pressed(KEYCODE_R))   mask |= 8;
245   if (screen.machine().input().code_pressed(KEYCODE_A))   mask |= 16;
241   if (machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
242   if (machine().input().code_pressed(KEYCODE_W))   mask |= 2;
243   if (machine().input().code_pressed(KEYCODE_E))   mask |= 4;
244   if (machine().input().code_pressed(KEYCODE_R))   mask |= 8;
245   if (machine().input().code_pressed(KEYCODE_A))   mask |= 16;
246246   if (mask != 0) layers_ctrl &= mask;
247247}
248248#endif
249249
250   bitmap.fill(get_black_pen(screen.machine()), cliprect);
250   bitmap.fill(get_black_pen(machine()), cliprect);
251251
252252   if (!(m_priority & 4))   /* Screen blanking */
253253      return 0;
r17988r17989
283283UINT32 paradise_state::screen_update_torus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
284284{
285285
286   bitmap.fill(get_black_pen(screen.machine()), cliprect);
286   bitmap.fill(get_black_pen(machine()), cliprect);
287287
288288   if (!(m_priority & 2))   /* Screen blanking */
289289      return 0;
290290
291291   if (m_priority & 1)
292      draw_sprites(screen.machine(), bitmap, cliprect);
292      draw_sprites(machine(), bitmap, cliprect);
293293
294294   m_tilemap_1->draw(bitmap, cliprect, 0,0);
295295
296296   if (m_priority & 4)
297297   {
298298      if (!(m_priority & 1))
299         draw_sprites(screen.machine(), bitmap, cliprect);
299         draw_sprites(machine(), bitmap, cliprect);
300300
301301      m_tilemap_2->draw(bitmap, cliprect, 0, 0);
302302   }
r17988r17989
305305      m_tilemap_2->draw(bitmap, cliprect, 0, 0);
306306
307307      if (!(m_priority & 1))
308         draw_sprites(screen.machine(), bitmap,cliprect);
308         draw_sprites(machine(), bitmap,cliprect);
309309   }
310310   return 0;
311311}
r17988r17989
314314UINT32 paradise_state::screen_update_madball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
315315{
316316
317   bitmap.fill(get_black_pen(screen.machine()), cliprect);
317   bitmap.fill(get_black_pen(machine()), cliprect);
318318   m_tilemap_0->draw(bitmap, cliprect, 0, 0);
319319   m_tilemap_1->draw(bitmap, cliprect, 0, 0);
320320   m_tilemap_2->draw(bitmap, cliprect, 0, 0);
321   draw_sprites(screen.machine(), bitmap, cliprect);
321   draw_sprites(machine(), bitmap, cliprect);
322322   return 0;
323323}
trunk/src/mame/video/volfied.c
r17988r17989
125125UINT32 volfied_state::screen_update_volfied(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
126126{
127127
128   screen.machine().priority_bitmap.fill(0, cliprect);
129   refresh_pixel_layer(screen.machine(), bitmap);
128   machine().priority_bitmap.fill(0, cliprect);
129   refresh_pixel_layer(machine(), bitmap);
130130   pc090oj_draw_sprites(m_pc090oj, bitmap, cliprect, 0);
131131   return 0;
132132}
trunk/src/mame/video/dribling.c
r17988r17989
5959
6060UINT32 dribling_state::screen_update_dribling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6161{
62   UINT8 *prombase = screen.machine().root_device().memregion("proms")->base();
62   UINT8 *prombase = machine().root_device().memregion("proms")->base();
6363   UINT8 *gfxbase = memregion("gfx1")->base();
6464   int x, y;
6565
trunk/src/mame/video/balsente.c
r17988r17989
208208
209209UINT32 balsente_state::screen_update_balsente(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
210210{
211   const pen_t *pens = &screen.machine().pens[m_palettebank_vis * 256];
211   const pen_t *pens = &machine().pens[m_palettebank_vis * 256];
212212   int y, i;
213213
214214   /* draw scanlines from the VRAM directly */
r17988r17989
217217
218218   /* draw the sprite images */
219219   for (i = 0; i < 40; i++)
220      draw_one_sprite(screen.machine(), bitmap, cliprect, &m_spriteram[(0xe0 + i * 4) & 0xff]);
220      draw_one_sprite(machine(), bitmap, cliprect, &m_spriteram[(0xe0 + i * 4) & 0xff]);
221221
222222   return 0;
223223}
trunk/src/mame/video/mexico86.c
r17988r17989
8686            x = (sx + xc * 8) & 0xff;
8787            y = (sy + yc * 8) & 0xff;
8888
89            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
89            drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
9090                  code,
9191                  color,
9292                  flipx,flipy,
r17988r17989
106106   int goffs, code, color, y;
107107   int tx, ty;
108108
109   bitmap.fill(get_black_pen(screen.machine()), cliprect);
109   bitmap.fill(get_black_pen(machine()), cliprect);
110110   sx = 0;
111111   for (offs = 0; offs < m_objectram.bytes(); offs += 4)
112112   {
r17988r17989
144144         color = (m_videoram[goffs + 1] & 0xe0) >> 5;
145145         goffs += 0x40;
146146
147         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
147         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
148148               code,
149149               color,
150150               0,0,
r17988r17989
153153         code = m_videoram[goffs] + ((m_videoram[goffs + 1] & 0x1f) << 8);
154154         color = (m_videoram[goffs + 1] & 0xe0) >> 5;
155155
156         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
156         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
157157               code,
158158               color,
159159               0,0,
trunk/src/mame/video/chaknpop.c
r17988r17989
257257{
258258
259259   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
260   draw_sprites(screen.machine(), bitmap, cliprect);
261   draw_bitmap(screen.machine(), bitmap, cliprect);
260   draw_sprites(machine(), bitmap, cliprect);
261   draw_bitmap(machine(), bitmap, cliprect);
262262   return 0;
263263}
trunk/src/mame/video/fitfight.c
r17988r17989
118118   vblank = (m_fof_700000[0] & 0x8000);
119119
120120   if (vblank > 0)
121      bitmap.fill(get_black_pen(screen.machine()), cliprect);
121      bitmap.fill(get_black_pen(machine()), cliprect);
122122   else {
123//      if (screen.machine().input().code_pressed(KEYCODE_Q))
123//      if (machine().input().code_pressed(KEYCODE_Q))
124124//          scrollbak = ((m_fof_a00000[0] & 0xff00) >> 5) - ((m_fof_700000[0] & 0x0038) >> 3);
125//      else if (screen.machine().input().code_pressed(KEYCODE_W))
125//      else if (machine().input().code_pressed(KEYCODE_W))
126126//          scrollbak = ((m_fof_a00000[0] & 0xff00) >> 5) + ((m_fof_700000[0] & 0x01c0) >> 6);
127//      else if (screen.machine().input().code_pressed(KEYCODE_E))
127//      else if (machine().input().code_pressed(KEYCODE_E))
128128//          scrollbak = ((m_fof_a00000[0] & 0xff00) >> 5) - ((m_fof_700000[0] & 0x01c0) >> 6);
129//      else if (screen.machine().input().code_pressed(KEYCODE_R))
129//      else if (machine().input().code_pressed(KEYCODE_R))
130130//          scrollbak = ((m_fof_a00000[0] & 0xff00) >> 5) + ((m_fof_700000[0] & 0x0038) >> 3);
131131//      else
132132      scrollbak = ((m_fof_a00000[0] & 0xffe0) >> 5);
r17988r17989
134134      m_fof_bak_tilemap->set_scrolly(0, m_fof_a00000[0] & 0xff);
135135      m_fof_bak_tilemap->draw(bitmap, cliprect, 0, 0);
136136
137      draw_sprites(screen.machine(), bitmap, cliprect, 0);
137      draw_sprites(machine(), bitmap, cliprect, 0);
138138
139//      if (screen.machine().input().code_pressed(KEYCODE_A))
139//      if (machine().input().code_pressed(KEYCODE_A))
140140//          scrollmid = ((m_fof_900000[0] & 0xff00) >> 5) - ((m_fof_700000[0] & 0x01c0) >> 6);
141//      else if (screen.machine().input().code_pressed(KEYCODE_S))
141//      else if (machine().input().code_pressed(KEYCODE_S))
142142//          scrollmid = ((m_fof_900000[0] & 0xff00) >> 5) + ((m_fof_700000[0] & 0x0038) >> 3);
143//      else if (screen.machine().input().code_pressed(KEYCODE_D))
143//      else if (machine().input().code_pressed(KEYCODE_D))
144144//          scrollmid = ((m_fof_900000[0] & 0xff00) >> 5) - ((m_fof_700000[0] & 0x0038) >> 3);
145//      else if (screen.machine().input().code_pressed(KEYCODE_F))
145//      else if (machine().input().code_pressed(KEYCODE_F))
146146//          scrollmid = ((m_fof_900000[0] & 0xff00) >> 5) + ((m_fof_700000[0] & 0x01c0) >> 6);
147147//      else
148148      scrollmid = ((m_fof_900000[0] & 0xffe0) >> 5);
149149      m_fof_mid_tilemap->set_scrollx(0, scrollmid );
150150      m_fof_mid_tilemap->set_scrolly(0, m_fof_900000[0] & 0xff);
151//      if (!screen.machine().input().code_pressed(KEYCODE_F))
151//      if (!machine().input().code_pressed(KEYCODE_F))
152152      m_fof_mid_tilemap->draw(bitmap, cliprect, 0, 0);
153153
154      draw_sprites(screen.machine(), bitmap, cliprect, 1);
154      draw_sprites(machine(), bitmap, cliprect, 1);
155155
156156      m_fof_txt_tilemap->draw(bitmap, cliprect, 0, 0);
157157   }
trunk/src/mame/video/sspeedr.c
r17988r17989
247247
248248UINT32 sspeedr_state::screen_update_sspeedr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
249249{
250   draw_track(screen.machine(), bitmap);
251   draw_drones(screen.machine(), bitmap, cliprect);
252   draw_driver(screen.machine(), bitmap, cliprect);
250   draw_track(machine(), bitmap);
251   draw_drones(machine(), bitmap, cliprect);
252   draw_driver(machine(), bitmap, cliprect);
253253   return 0;
254254}
255255
trunk/src/mame/video/ddribble.c
r17988r17989
246246
247247UINT32 ddribble_state::screen_update_ddribble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
248248{
249   set_pens(screen.machine());
249   set_pens(machine());
250250
251251   m_fg_tilemap->set_flip((m_vregs[0][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
252252   m_bg_tilemap->set_flip((m_vregs[1][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
r17988r17989
258258   m_bg_tilemap->set_scrolly(0, m_vregs[1][0]);
259259
260260   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
261   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram_1, 0x07d, 2, m_vregs[0][4] & 0x08);
262   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram_2, 0x140, 3, m_vregs[1][4] & 0x08);
261   draw_sprites(machine(), bitmap, cliprect, m_spriteram_1, 0x07d, 2, m_vregs[0][4] & 0x08);
262   draw_sprites(machine(), bitmap, cliprect, m_spriteram_2, 0x140, 3, m_vregs[1][4] & 0x08);
263263   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
264264   return 0;
265265}
trunk/src/mame/video/terracre.c
r17988r17989
197197UINT32 terracre_state::screen_update_amazon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
198198{
199199   if( m_xscroll&0x2000 )
200      bitmap.fill(get_black_pen(screen.machine()), cliprect );
200      bitmap.fill(get_black_pen(machine()), cliprect );
201201   else
202202      m_background->draw(bitmap, cliprect, 0, 0 );
203203
204   draw_sprites(screen.machine(), bitmap,cliprect );
204   draw_sprites(machine(), bitmap,cliprect );
205205   m_foreground->draw(bitmap, cliprect, 0, 0 );
206206   return 0;
207207}
trunk/src/mame/video/mouser.c
r17988r17989
9090      /* Note: this is _not_ dependant on flipping */
9191      color_offs = offs % 32 + ((256 + 8 * (offs / 32) - spriteram[offs % 32] )% 256) / 8 * 32;
9292
93      drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
93      drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
9494            m_videoram[offs] | (m_colorram[color_offs] >> 5) * 256 | ((m_colorram[color_offs] >> 4) & 1) * 512,
9595            m_colorram[color_offs]%16,
9696            flip_screen_x(),flip_screen_y(),
r17988r17989
121121      }
122122
123123      if (BIT(spriteram[offs + 1], 4))
124         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1+((spriteram[offs+1]&0x20)>>5)],
124         drawgfx_transpen(bitmap,cliprect,machine().gfx[1+((spriteram[offs+1]&0x20)>>5)],
125125               spriteram[offs]&0x3f,
126126               spriteram[offs+1]%16,
127127               flipx,flipy,
r17988r17989
150150      }
151151
152152      if (BIT(spriteram[offs + 1], 4))
153         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1+((spriteram[offs+1]&0x20)>>5)],
153         drawgfx_transpen(bitmap,cliprect,machine().gfx[1+((spriteram[offs+1]&0x20)>>5)],
154154               spriteram[offs]&0x3f,
155155               spriteram[offs+1]%16,
156156               flipx,flipy,
trunk/src/mame/video/undrfire.c
r17988r17989
348348
349349UINT32 undrfire_state::screen_update_undrfire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
350350{
351   device_t *tc0100scn = screen.machine().device("tc0100scn");
352   device_t *tc0480scp = screen.machine().device("tc0480scp");
353   address_space &space = screen.machine().driver_data()->generic_space();
351   device_t *tc0100scn = machine().device("tc0100scn");
352   device_t *tc0480scp = machine().device("tc0480scp");
353   address_space &space = machine().driver_data()->generic_space();
354354   UINT8 layer[5];
355355   UINT8 pivlayer[3];
356356   UINT16 priority;
357357
358358#ifdef MAME_DEBUG
359   if (screen.machine().input().code_pressed_once (KEYCODE_X))
359   if (machine().input().code_pressed_once (KEYCODE_X))
360360   {
361361      m_dislayer[5] ^= 1;
362362      popmessage("piv text: %01x",m_dislayer[5]);
363363   }
364   if (screen.machine().input().code_pressed_once (KEYCODE_C))
364   if (machine().input().code_pressed_once (KEYCODE_C))
365365   {
366366      m_dislayer[0] ^= 1;
367367      popmessage("bg0: %01x",m_dislayer[0]);
368368   }
369369
370   if (screen.machine().input().code_pressed_once (KEYCODE_V))
370   if (machine().input().code_pressed_once (KEYCODE_V))
371371   {
372372      m_dislayer[1] ^= 1;
373373      popmessage("bg1: %01x",m_dislayer[1]);
374374   }
375375
376   if (screen.machine().input().code_pressed_once (KEYCODE_B))
376   if (machine().input().code_pressed_once (KEYCODE_B))
377377   {
378378      m_dislayer[2] ^= 1;
379379      popmessage("bg2: %01x",m_dislayer[2]);
380380   }
381381
382   if (screen.machine().input().code_pressed_once (KEYCODE_N))
382   if (machine().input().code_pressed_once (KEYCODE_N))
383383   {
384384      m_dislayer[3] ^= 1;
385385      popmessage("bg3: %01x",m_dislayer[3]);
386386   }
387387
388   if (screen.machine().input().code_pressed_once (KEYCODE_M))
388   if (machine().input().code_pressed_once (KEYCODE_M))
389389   {
390390      m_dislayer[4] ^= 1;
391391      popmessage("sprites: %01x",m_dislayer[4]);
r17988r17989
407407   pivlayer[1] = pivlayer[0] ^ 1;
408408   pivlayer[2] = 2;
409409
410   screen.machine().priority_bitmap.fill(0, cliprect);
410   machine().priority_bitmap.fill(0, cliprect);
411411   bitmap.fill(0, cliprect);   /* wrong color? */
412412
413413
r17988r17989
448448      if ((tc0480scp_pri_reg_r(tc0480scp, space, 0) & 0x3) == 3)   /* on road levels kludge sprites up 1 priority */
449449      {
450450         static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
451         draw_sprites(screen.machine(), bitmap, cliprect, primasks, 44, -574);
451         draw_sprites(machine(), bitmap, cliprect, primasks, 44, -574);
452452      }
453453      else
454454      {
455455         static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
456         draw_sprites(screen.machine(), bitmap, cliprect, primasks, 44, -574);
456         draw_sprites(machine(), bitmap, cliprect, primasks, 44, -574);
457457      }
458458   }
459459
r17988r17989
467467   /* See if we should draw artificial gun targets */
468468   /* (not yet implemented...) */
469469
470   if (screen.machine().root_device().ioport("FAKE")->read() & 0x1)   /* Fake DSW */
470   if (machine().root_device().ioport("FAKE")->read() & 0x1)   /* Fake DSW */
471471   {
472472      popmessage("Gunsights on");
473473   }
r17988r17989
491491
492492UINT32 undrfire_state::screen_update_cbombers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
493493{
494   device_t *tc0100scn = screen.machine().device("tc0100scn");
495   device_t *tc0480scp = screen.machine().device("tc0480scp");
496   address_space &space = screen.machine().driver_data()->generic_space();
494   device_t *tc0100scn = machine().device("tc0100scn");
495   device_t *tc0480scp = machine().device("tc0480scp");
496   address_space &space = machine().driver_data()->generic_space();
497497   UINT8 layer[5];
498498   UINT8 pivlayer[3];
499499   UINT16 priority;
500500
501501#ifdef MAME_DEBUG
502   if (screen.machine().input().code_pressed_once (KEYCODE_X))
502   if (machine().input().code_pressed_once (KEYCODE_X))
503503   {
504504      m_dislayer[5] ^= 1;
505505      popmessage("piv text: %01x",m_dislayer[5]);
506506   }
507   if (screen.machine().input().code_pressed_once (KEYCODE_C))
507   if (machine().input().code_pressed_once (KEYCODE_C))
508508   {
509509      m_dislayer[0] ^= 1;
510510      popmessage("bg0: %01x",m_dislayer[0]);
511511   }
512512
513   if (screen.machine().input().code_pressed_once (KEYCODE_V))
513   if (machine().input().code_pressed_once (KEYCODE_V))
514514   {
515515      m_dislayer[1] ^= 1;
516516      popmessage("bg1: %01x",m_dislayer[1]);
517517   }
518518
519   if (screen.machine().input().code_pressed_once (KEYCODE_B))
519   if (machine().input().code_pressed_once (KEYCODE_B))
520520   {
521521      m_dislayer[2] ^= 1;
522522      popmessage("bg2: %01x",m_dislayer[2]);
523523   }
524524
525   if (screen.machine().input().code_pressed_once (KEYCODE_N))
525   if (machine().input().code_pressed_once (KEYCODE_N))
526526   {
527527      m_dislayer[3] ^= 1;
528528      popmessage("bg3: %01x",m_dislayer[3]);
529529   }
530530
531   if (screen.machine().input().code_pressed_once (KEYCODE_M))
531   if (machine().input().code_pressed_once (KEYCODE_M))
532532   {
533533      m_dislayer[4] ^= 1;
534534      popmessage("sprites: %01x",m_dislayer[4]);
r17988r17989
550550   pivlayer[1] = pivlayer[0] ^ 1;
551551   pivlayer[2] = 2;
552552
553   screen.machine().priority_bitmap.fill(0, cliprect);
553   machine().priority_bitmap.fill(0, cliprect);
554554   bitmap.fill(0, cliprect);   /* wrong color? */
555555
556556
r17988r17989
591591      if ((tc0480scp_pri_reg_r(tc0480scp, space, 0) & 0x3) == 3)   /* on road levels kludge sprites up 1 priority */
592592      {
593593         static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
594         draw_sprites_cbombers(screen.machine(), bitmap, cliprect, primasks, 80, -208);
594         draw_sprites_cbombers(machine(), bitmap, cliprect, primasks, 80, -208);
595595      }
596596      else
597597      {
598598         static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
599         draw_sprites_cbombers(screen.machine(), bitmap, cliprect, primasks, 80, -208);
599         draw_sprites_cbombers(machine(), bitmap, cliprect, primasks, 80, -208);
600600      }
601601   }
602602
trunk/src/mame/video/amiga.c
r17988r17989
10051005
10061006   /* render each scanline in the visible region */
10071007   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
1008      amiga_render_scanline(screen.machine(), bitmap, y);
1008      amiga_render_scanline(machine(), bitmap, y);
10091009
10101010   return 0;
10111011}
trunk/src/mame/video/deco32.c
r17988r17989
573573
574574UINT32 deco32_state::screen_update_captaven(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
575575{
576   m_deco_tilegen1 = screen.machine().device("tilegen1");
577   m_deco_tilegen2 = screen.machine().device("tilegen2");
576   m_deco_tilegen1 = machine().device("tilegen1");
577   m_deco_tilegen2 = machine().device("tilegen2");
578578
579   screen.machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
579   machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
580580
581   screen.machine().priority_bitmap.fill(0, cliprect);
582   bitmap.fill(screen.machine().pens[0x000], cliprect); // Palette index not confirmed
581   machine().priority_bitmap.fill(0, cliprect);
582   bitmap.fill(machine().pens[0x000], cliprect); // Palette index not confirmed
583583
584584   deco16ic_set_pf1_8bpp_mode(m_deco_tilegen2, 1);
585585
r17988r17989
601601
602602   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
603603
604   screen.machine().device<decospr_device>("spritegen")->set_alt_format(true);
605   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x400);
604   machine().device<decospr_device>("spritegen")->set_alt_format(true);
605   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x400);
606606
607607   return 0;
608608}
609609
610610UINT32 dragngun_state::screen_update_dragngun(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
611611{
612   m_deco_tilegen1 = screen.machine().device("tilegen1");
613   m_deco_tilegen2 = screen.machine().device("tilegen2");
612   m_deco_tilegen1 = machine().device("tilegen1");
613   m_deco_tilegen2 = machine().device("tilegen2");
614614
615   bitmap.fill(get_black_pen(screen.machine()), cliprect);
615   bitmap.fill(get_black_pen(machine()), cliprect);
616616
617617   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
618618   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
r17988r17989
637637   {
638638      rectangle clip(cliprect.min_x, cliprect.max_x, 8, 247);
639639
640      dragngun_draw_sprites(screen.machine(),bitmap,clip,m_spriteram->buffer());
640      dragngun_draw_sprites(machine(),bitmap,clip,m_spriteram->buffer());
641641      deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, clip, 0, 0);
642642
643643   }
r17988r17989
648648
649649UINT32 deco32_state::screen_update_fghthist(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
650650{
651   m_deco_tilegen1 = screen.machine().device("tilegen1");
652   m_deco_tilegen2 = screen.machine().device("tilegen2");
651   m_deco_tilegen1 = machine().device("tilegen1");
652   m_deco_tilegen2 = machine().device("tilegen2");
653653
654   screen.machine().priority_bitmap.fill(0, cliprect);
655   bitmap.fill(screen.machine().pens[0x000], cliprect); // Palette index not confirmed
654   machine().priority_bitmap.fill(0, cliprect);
655   bitmap.fill(machine().pens[0x000], cliprect); // Palette index not confirmed
656656
657657   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
658658   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
659659
660   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800, true);
660   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800, true);
661661
662662   /* Draw screen */
663663   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1);
r17988r17989
665665   if(m_pri&1)
666666   {
667667      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
668      screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
668      machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
669669      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
670670   }
671671   else
672672   {
673673      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
674      screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
674      machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
675675      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
676676   }
677677
678   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff);
678   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff);
679679
680680   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
681681   return 0;
r17988r17989
825825UINT32 deco32_state::screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
826826{
827827   int alphaTilemap=0;
828   m_deco_tilegen1 = screen.machine().device("tilegen1");
829   m_deco_tilegen2 = screen.machine().device("tilegen2");
828   m_deco_tilegen1 = machine().device("tilegen1");
829   m_deco_tilegen2 = machine().device("tilegen2");
830830
831831   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
832832   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
r17988r17989
836836      alphaTilemap=1;
837837
838838   if (m_ace_ram_dirty)
839      updateAceRam(screen.machine());
839      updateAceRam(machine());
840840
841   screen.machine().priority_bitmap.fill(0, cliprect);
841   machine().priority_bitmap.fill(0, cliprect);
842842
843   bitmap.fill(screen.machine().pens[0x200], cliprect);
843   bitmap.fill(machine().pens[0x200], cliprect);
844844
845845   /* Draw sprites to temporary bitmaps, saving alpha & priority info for later mixing */
846   screen.machine().device<decospr_device>("spritegen1")->set_pix_raw_shift(8);
847   screen.machine().device<decospr_device>("spritegen2")->set_pix_raw_shift(8);
846   machine().device<decospr_device>("spritegen1")->set_pix_raw_shift(8);
847   machine().device<decospr_device>("spritegen2")->set_pix_raw_shift(8);
848848
849   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800, true);
850   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram16_2_buffered, 0x800, true);
849   machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800, true);
850   machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram16_2_buffered, 0x800, true);
851851
852852
853853   /* Render alpha-blended tilemap to separate buffer for proper mixing */
r17988r17989
880880      }
881881   }
882882
883   mixDualAlphaSprites(bitmap, cliprect, screen.machine().gfx[3], screen.machine().gfx[4], alphaTilemap);
883   mixDualAlphaSprites(bitmap, cliprect, machine().gfx[3], machine().gfx[4], alphaTilemap);
884884
885885   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
886886   return 0;
trunk/src/mame/video/malzak.c
r17988r17989
3939         if (sx < -15*2)
4040            sx += 256*2;
4141
42         drawgfxzoom_transpen(bitmap,cliprect, screen.machine().gfx[0], m_playfield_code[x * 16 + y], 2, 0, 0, sx, sy, 0x20000, 0x20000, 0);
42         drawgfxzoom_transpen(bitmap,cliprect, machine().gfx[0], m_playfield_code[x * 16 + y], 2, 0, 0, sx, sy, 0x20000, 0x20000, 0);
4343      }
4444
4545   /* update the S2636 chips */
trunk/src/mame/video/midzeus.c
r17988r17989
336336   poly_wait(poly, "VIDEO_UPDATE");
337337
338338   /* normal update case */
339   if (!screen.machine().input().code_pressed(KEYCODE_W))
339   if (!machine().input().code_pressed(KEYCODE_W))
340340   {
341341      const void *base = waveram1_ptr_from_expanded_addr(m_zeusbase[0xcc]);
342342      int xoffs = screen.visible_area().min_x;
r17988r17989
353353   {
354354      const void *base;
355355
356      if (screen.machine().input().code_pressed(KEYCODE_DOWN)) yoffs += screen.machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
357      if (screen.machine().input().code_pressed(KEYCODE_UP)) yoffs -= screen.machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
358      if (screen.machine().input().code_pressed(KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (screen.machine().input().code_pressed(KEYCODE_LEFT)) ; }
359      if (screen.machine().input().code_pressed(KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (screen.machine().input().code_pressed(KEYCODE_RIGHT)) ; }
356      if (machine().input().code_pressed(KEYCODE_DOWN)) yoffs += machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
357      if (machine().input().code_pressed(KEYCODE_UP)) yoffs -= machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
358      if (machine().input().code_pressed(KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (machine().input().code_pressed(KEYCODE_LEFT)) ; }
359      if (machine().input().code_pressed(KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (machine().input().code_pressed(KEYCODE_RIGHT)) ; }
360360
361361      if (yoffs < 0) yoffs = 0;
362362      base = waveram0_ptr_from_block_addr(yoffs << 12);
trunk/src/mame/video/grchamp.c
r17988r17989
357357      MAKE_RGB(RGB_MAX,RGB_MAX,RGB_MAX)
358358   };
359359
360   const UINT8 *amedata = screen.machine().root_device().memregion("gfx5")->base();
361   const UINT8 *headdata = screen.machine().root_device().memregion("gfx6")->base();
360   const UINT8 *amedata = machine().root_device().memregion("gfx5")->base();
361   const UINT8 *headdata = machine().root_device().memregion("gfx6")->base();
362362   const UINT8 *pldata = memregion("gfx7")->base();
363363   bitmap_ind16 &lpixmap = m_left_tilemap->pixmap();
364364   bitmap_ind16 &rpixmap = m_right_tilemap->pixmap();
r17988r17989
399399      UINT8 objdata[256];
400400
401401      /* draw the objects for this scanline */
402      draw_objects(screen.machine(), this, y, objdata);
402      draw_objects(machine(), this, y, objdata);
403403
404404      /* iterate over columns */
405405      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
trunk/src/mame/video/argus.c
r17988r17989
11561156
11571157UINT32 argus_state::screen_update_argus(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
11581158{
1159   bg_setting(screen.machine());
1159   bg_setting(machine());
11601160
11611161   /* scroll BG0 and render tile at proper position */
1162   argus_bg0_scroll_handle(screen.machine());
1162   argus_bg0_scroll_handle(machine());
11631163
11641164   m_bg0_tilemap->draw(bitmap, cliprect, 0, 0);
1165   argus_draw_sprites(screen.machine(), bitmap, cliprect, 0);
1165   argus_draw_sprites(machine(), bitmap, cliprect, 0);
11661166   if (m_bg_status & 1)   /* Backgound enable */
11671167      m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
1168   argus_draw_sprites(screen.machine(), bitmap, cliprect, 1);
1168   argus_draw_sprites(machine(), bitmap, cliprect, 1);
11691169   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
11701170   return 0;
11711171}
11721172
11731173UINT32 argus_state::screen_update_valtric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
11741174{
1175   bg_setting(screen.machine());
1175   bg_setting(machine());
11761176
11771177   if (m_bg_status & 1)   /* Backgound enable */
11781178      valtric_draw_mosaic(screen, bitmap, cliprect);
11791179   else
1180      bitmap.fill(get_black_pen(screen.machine()), cliprect);
1181   valtric_draw_sprites(screen.machine(), bitmap, cliprect);
1180      bitmap.fill(get_black_pen(machine()), cliprect);
1181   valtric_draw_sprites(machine(), bitmap, cliprect);
11821182   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
11831183   return 0;
11841184}
11851185
11861186UINT32 argus_state::screen_update_butasan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
11871187{
1188   bg_setting(screen.machine());
1188   bg_setting(machine());
11891189
11901190   if (m_bg_status & 1)   /* Backgound enable */
11911191      m_bg0_tilemap->draw(bitmap, cliprect, 0, 0);
11921192   else
1193      bitmap.fill(get_black_pen(screen.machine()), cliprect);
1193      bitmap.fill(get_black_pen(machine()), cliprect);
11941194   if (m_butasan_bg1_status & 1) m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
1195   butasan_draw_sprites(screen.machine(), bitmap, cliprect);
1195   butasan_draw_sprites(machine(), bitmap, cliprect);
11961196   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
11971197
1198   butasan_log_vram(screen.machine());
1198   butasan_log_vram(machine());
11991199   return 0;
12001200}
trunk/src/mame/video/lkage.c
r17988r17989
209209   m_bg_tilemap->set_scrollx(0, m_scroll[4]);
210210   m_bg_tilemap->set_scrolly(0, m_scroll[5]);
211211
212   screen.machine().priority_bitmap.fill(0, cliprect);
212   machine().priority_bitmap.fill(0, cliprect);
213213   if ((m_vreg[2] & 0xf0) == 0xf0)
214214   {
215215      m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
216216      m_fg_tilemap->draw(bitmap, cliprect, 0, (m_vreg[1] & 2) ? 2 : 4);
217217      m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
218      draw_sprites(screen.machine(), bitmap, cliprect);
218      draw_sprites(machine(), bitmap, cliprect);
219219   }
220220   else
221221   {
trunk/src/mame/video/zaxxon.c
r17988r17989
463463UINT32 zaxxon_state::screen_update_zaxxon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
464464{
465465
466   draw_background(screen.machine(), bitmap, cliprect, TRUE);
467   draw_sprites(screen.machine(), bitmap, cliprect, 0x140, 0x180);
466   draw_background(machine(), bitmap, cliprect, TRUE);
467   draw_sprites(machine(), bitmap, cliprect, 0x140, 0x180);
468468   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
469469   return 0;
470470}
r17988r17989
473473UINT32 zaxxon_state::screen_update_futspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
474474{
475475
476   draw_background(screen.machine(), bitmap, cliprect, TRUE);
477   draw_sprites(screen.machine(), bitmap, cliprect, 0x180, 0x180);
476   draw_background(machine(), bitmap, cliprect, TRUE);
477   draw_sprites(machine(), bitmap, cliprect, 0x180, 0x180);
478478   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
479479   return 0;
480480}
r17988r17989
483483UINT32 zaxxon_state::screen_update_razmataz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
484484{
485485
486   draw_background(screen.machine(), bitmap, cliprect, FALSE);
487   draw_sprites(screen.machine(), bitmap, cliprect, 0x140, 0x180);
486   draw_background(machine(), bitmap, cliprect, FALSE);
487   draw_sprites(machine(), bitmap, cliprect, 0x140, 0x180);
488488   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
489489   return 0;
490490}
r17988r17989
493493UINT32 zaxxon_state::screen_update_congo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
494494{
495495
496   draw_background(screen.machine(), bitmap, cliprect, TRUE);
497   draw_sprites(screen.machine(), bitmap, cliprect, 0x280, 0x180);
496   draw_background(machine(), bitmap, cliprect, TRUE);
497   draw_sprites(machine(), bitmap, cliprect, 0x280, 0x180);
498498   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
499499   return 0;
500500}
trunk/src/mame/video/gaiden.c
r17988r17989
643643
644644UINT32 gaiden_state::screen_update_gaiden(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
645645{
646   screen.machine().priority_bitmap.fill(0, cliprect);
646   machine().priority_bitmap.fill(0, cliprect);
647647
648648   m_tile_bitmap_bg.fill(0x200, cliprect);
649649   m_tile_bitmap_fg.fill(0, cliprect);
r17988r17989
658658   m_text_layer->draw(m_tile_bitmap_fg, cliprect, 0, 4);
659659
660660   /* draw sprites into a 16-bit bitmap */
661   gaiden_draw_sprites(screen.machine(), m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, cliprect);
661   gaiden_draw_sprites(machine(), m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, cliprect);
662662
663663   /* mix & blend the tilemaps and sprites into a 32-bit bitmap */
664   blendbitmaps(screen.machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, 0, 0, cliprect);
664   blendbitmaps(machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, 0, 0, cliprect);
665665   return 0;
666666
667667}
668668
669669UINT32 gaiden_state::screen_update_raiga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
670670{
671   screen.machine().priority_bitmap.fill(0, cliprect);
671   machine().priority_bitmap.fill(0, cliprect);
672672
673673   m_tile_bitmap_bg.fill(0x200, cliprect);
674674   m_tile_bitmap_fg.fill(0, cliprect);
r17988r17989
683683   m_text_layer->draw(m_tile_bitmap_fg, cliprect, 0, 4);
684684
685685   /* draw sprites into a 16-bit bitmap */
686   raiga_draw_sprites(screen.machine(), m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, cliprect);
686   raiga_draw_sprites(machine(), m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, cliprect);
687687
688688   /* mix & blend the tilemaps and sprites into a 32-bit bitmap */
689   blendbitmaps(screen.machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, 0, 0, cliprect);
689   blendbitmaps(machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, 0, 0, cliprect);
690690   return 0;
691691}
692692
693693UINT32 gaiden_state::screen_update_drgnbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
694694{
695   screen.machine().priority_bitmap.fill(0, cliprect);
695   machine().priority_bitmap.fill(0, cliprect);
696696
697697   m_background->draw(bitmap, cliprect, 0, 1);
698698   m_foreground->draw(bitmap, cliprect, 0, 2);
699699   m_text_layer->draw(bitmap, cliprect, 0, 4);
700   drgnbowl_draw_sprites(screen.machine(), bitmap, cliprect);
700   drgnbowl_draw_sprites(machine(), bitmap, cliprect);
701701   return 0;
702702}
trunk/src/mame/video/shangkid.c
r17988r17989
190190   m_background->set_scrolly(0,m_videoreg[2]+0x10 );
191191
192192   m_background->draw(bitmap, cliprect, 0,0 );
193   shangkid_draw_sprites(screen.machine(), bitmap,cliprect );
193   shangkid_draw_sprites(machine(), bitmap,cliprect );
194194   m_background->draw(bitmap, cliprect, 1,0 ); /* high priority tiles */
195195   return 0;
196196}
r17988r17989
320320
321321UINT32 shangkid_state::screen_update_dynamski(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
322322{
323   dynamski_draw_background(screen.machine(), bitmap,cliprect, 0 );
324   dynamski_draw_sprites(screen.machine(), bitmap,cliprect );
325   dynamski_draw_background(screen.machine(), bitmap,cliprect, 1 );
323   dynamski_draw_background(machine(), bitmap,cliprect, 0 );
324   dynamski_draw_sprites(machine(), bitmap,cliprect );
325   dynamski_draw_background(machine(), bitmap,cliprect, 1 );
326326   return 0;
327327}
trunk/src/mame/video/trackfld.c
r17988r17989
255255   }
256256
257257   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
258   draw_sprites(screen.machine(), bitmap, cliprect);
258   draw_sprites(machine(), bitmap, cliprect);
259259   return 0;
260260}
261261
trunk/src/mame/video/fastfred.c
r17988r17989
299299{
300300   bitmap.fill(*m_background_color, cliprect);
301301   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
302   draw_sprites(screen.machine(), bitmap, cliprect);
302   draw_sprites(machine(), bitmap, cliprect);
303303
304304   return 0;
305305}
r17988r17989
364364UINT32 fastfred_state::screen_update_imago(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
365365{
366366   m_web_tilemap->draw(bitmap, cliprect, 0,0);
367   galaxold_draw_stars(screen.machine(), bitmap, cliprect);
367   galaxold_draw_stars(machine(), bitmap, cliprect);
368368   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
369   draw_sprites(screen.machine(), bitmap, cliprect);
369   draw_sprites(machine(), bitmap, cliprect);
370370   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
371371
372372   return 0;
trunk/src/mame/video/karnov.c
r17988r17989
126126
127127UINT32 karnov_state::screen_update_karnov(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
128128{
129   draw_background(screen.machine(), bitmap, cliprect);
130   screen.machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram->buffer(), 0x800, 0);
129   draw_background(machine(), bitmap, cliprect);
130   machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0x800, 0);
131131   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
132132   return 0;
133133}
trunk/src/mame/video/lwings.c
r17988r17989
261261{
262262
263263   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
264   lwings_draw_sprites(screen.machine(), bitmap, cliprect);
264   lwings_draw_sprites(machine(), bitmap, cliprect);
265265   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
266266   return 0;
267267}
r17988r17989
271271
272272   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
273273   m_bg1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
274   trojan_draw_sprites(screen.machine(), bitmap, cliprect);
274   trojan_draw_sprites(machine(), bitmap, cliprect);
275275   m_bg1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
276276   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
277277   return 0;
trunk/src/mame/video/punchout.c
r17988r17989
354354UINT32 punchout_state::screen_update_punchout_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
355355{
356356
357   punchout_copy_top_palette(screen.machine(), BIT(*m_palettebank,1));
357   punchout_copy_top_palette(machine(), BIT(*m_palettebank,1));
358358
359359   m_bg_top_tilemap->draw(bitmap, cliprect, 0, 0);
360360
361361   if (m_spr1_ctrlram[7] & 1)   /* display in top monitor */
362      draw_big_sprite(screen.machine(), bitmap, cliprect, 0);
362      draw_big_sprite(machine(), bitmap, cliprect, 0);
363363
364364   return 0;
365365}
r17988r17989
368368{
369369   int offs;
370370
371   punchout_copy_bot_palette(screen.machine(), BIT(*m_palettebank,0));
371   punchout_copy_bot_palette(machine(), BIT(*m_palettebank,0));
372372
373373   /* copy the character mapped graphics */
374374   for (offs = 0;offs < 32;offs++)
r17988r17989
377377   m_bg_bot_tilemap->draw(bitmap, cliprect, 0, 0);
378378
379379   if (m_spr1_ctrlram[7] & 2)   /* display in bottom monitor */
380      draw_big_sprite(screen.machine(), bitmap, cliprect, 1);
381   drawbs2(screen.machine(), bitmap, cliprect);
380      draw_big_sprite(machine(), bitmap, cliprect, 1);
381   drawbs2(machine(), bitmap, cliprect);
382382
383383   return 0;
384384}
r17988r17989
387387UINT32 punchout_state::screen_update_armwrest_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
388388{
389389
390   punchout_copy_top_palette(screen.machine(), BIT(*m_palettebank,1));
390   punchout_copy_top_palette(machine(), BIT(*m_palettebank,1));
391391
392392   m_bg_top_tilemap->draw(bitmap, cliprect, 0, 0);
393393
394394   if (m_spr1_ctrlram[7] & 1)   /* display in top monitor */
395      armwrest_draw_big_sprite(screen.machine(), bitmap, cliprect, 0);
395      armwrest_draw_big_sprite(machine(), bitmap, cliprect, 0);
396396
397397   return 0;
398398}
r17988r17989
400400UINT32 punchout_state::screen_update_armwrest_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
401401{
402402
403   punchout_copy_bot_palette(screen.machine(), BIT(*m_palettebank,0));
403   punchout_copy_bot_palette(machine(), BIT(*m_palettebank,0));
404404
405405   m_bg_bot_tilemap->draw(bitmap, cliprect, 0, 0);
406406
407407   if (m_spr1_ctrlram[7] & 2)   /* display in bottom monitor */
408      armwrest_draw_big_sprite(screen.machine(), bitmap, cliprect, 1);
409   drawbs2(screen.machine(), bitmap, cliprect);
408      armwrest_draw_big_sprite(machine(), bitmap, cliprect, 1);
409   drawbs2(machine(), bitmap, cliprect);
410410
411411   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
412412
trunk/src/mame/video/tecmo.c
r17988r17989
239239
240240UINT32 tecmo_state::screen_update_tecmo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
241241{
242   screen.machine().priority_bitmap.fill(0, cliprect);
242   machine().priority_bitmap.fill(0, cliprect);
243243   bitmap.fill(0x100, cliprect);
244244   m_bg_tilemap->draw(bitmap, cliprect, 0,1);
245245   m_fg_tilemap->draw(bitmap, cliprect, 0,2);
246246   m_tx_tilemap->draw(bitmap, cliprect, 0,4);
247247
248   draw_sprites(screen.machine(), bitmap,cliprect);
248   draw_sprites(machine(), bitmap,cliprect);
249249   return 0;
250250}
trunk/src/mame/video/finalizr.c
r17988r17989
9494
9595   /* Draw the sprites. */
9696   {
97      gfx_element *gfx1 = screen.machine().gfx[1];
98      gfx_element *gfx2 = screen.machine().gfx[2];
97      gfx_element *gfx1 = machine().gfx[1];
98      gfx_element *gfx2 = machine().gfx[2];
9999
100100      UINT8 *sr = m_spriterambank ? m_spriteram_2 : m_spriteram;
101101
trunk/src/mame/video/galpanic.c
r17988r17989
102102
103103UINT32 galpanic_state::screen_update_galpanic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
104104{
105   device_t *pandora = screen.machine().device("pandora");
105   device_t *pandora = machine().device("pandora");
106106
107107   /* copy the temporary bitmap to the screen */
108108   copybitmap(bitmap,m_bitmap,0,0,0,0,cliprect);
109109
110   draw_fgbitmap(screen.machine(), bitmap, cliprect);
110   draw_fgbitmap(machine(), bitmap, cliprect);
111111
112112   pandora_update(pandora, bitmap, cliprect);
113113
r17988r17989
119119   /* copy the temporary bitmap to the screen */
120120   copybitmap(bitmap,m_bitmap,0,0,0,0,cliprect);
121121
122   draw_fgbitmap(screen.machine(), bitmap, cliprect);
122   draw_fgbitmap(machine(), bitmap, cliprect);
123123
124124
125125//  if(galpanic_clear_sprites)
126126   {
127127      m_sprites_bitmap.fill(0, cliprect);
128      comad_draw_sprites(screen.machine(),bitmap,cliprect);
128      comad_draw_sprites(machine(),bitmap,cliprect);
129129   }
130130//  else
131131//  {
132132//      /* keep sprites on the bitmap without clearing them */
133//      comad_draw_sprites(screen.machine(),m_sprites_bitmap,0);
133//      comad_draw_sprites(machine(),m_sprites_bitmap,0);
134134//      copybitmap_trans(bitmap,m_sprites_bitmap,0,0,0,0,cliprect,0);
135135//  }
136136   return 0;
trunk/src/mame/video/cclimber.c
r17988r17989
658658UINT32 cclimber_state::screen_update_cclimber(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
659659{
660660   bitmap.fill(CCLIMBER_BG_PEN, cliprect);
661   draw_playfield(screen.machine(), bitmap, cliprect);
661   draw_playfield(machine(), bitmap, cliprect);
662662
663663   /* draw the "big sprite" under the regular sprites */
664664   if ((m_bigsprite_control[0] & 0x01))
665665   {
666      cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect);
667      cclimber_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]);
666      cclimber_draw_bigsprite(machine(), bitmap, cliprect);
667      cclimber_draw_sprites(bitmap, cliprect, machine().gfx[1]);
668668   }
669669
670670   /* draw the "big sprite" over the regular sprites */
671671   else
672672   {
673      cclimber_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]);
674      cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect);
673      cclimber_draw_sprites(bitmap, cliprect, machine().gfx[1]);
674      cclimber_draw_bigsprite(machine(), bitmap, cliprect);
675675   }
676676
677677   return 0;
r17988r17989
680680
681681UINT32 cclimber_state::screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
682682{
683   cclimber_state *state = screen.machine().driver_data<cclimber_state>();
683   cclimber_state *state = machine().driver_data<cclimber_state>();
684684   int i;
685685   UINT8 *sky_rom = memregion("user1")->base() + 0x1200;
686686
r17988r17989
693693         bitmap.pix16(j, (i - 8) & 0xff) = pen;
694694   }
695695
696   draw_playfield(screen.machine(), bitmap, cliprect);
696   draw_playfield(machine(), bitmap, cliprect);
697697
698698   /* draw the "big sprite" under the regular sprites */
699699   if ((m_bigsprite_control[0] & 0x01))
700700   {
701      cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect);
702      toprollr_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]);
701      cclimber_draw_bigsprite(machine(), bitmap, cliprect);
702      toprollr_draw_sprites(bitmap, cliprect, machine().gfx[1]);
703703   }
704704
705705   /* draw the "big sprite" over the regular sprites */
706706   else
707707   {
708      toprollr_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]);
709      cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect);
708      toprollr_draw_sprites(bitmap, cliprect, machine().gfx[1]);
709      cclimber_draw_bigsprite(machine(), bitmap, cliprect);
710710   }
711711
712712   return 0;
r17988r17989
715715
716716UINT32 cclimber_state::screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
717717{
718   cclimber_state *state = screen.machine().driver_data<cclimber_state>();
719   swimmer_set_background_pen(screen.machine());
718   cclimber_state *state = machine().driver_data<cclimber_state>();
719   swimmer_set_background_pen(machine());
720720
721721   if (*m_swimmer_side_background_enabled & 0x01)
722722   {
r17988r17989
746746   else
747747      bitmap.fill(CCLIMBER_BG_PEN, cliprect);
748748
749   draw_playfield(screen.machine(), bitmap, cliprect);
749   draw_playfield(machine(), bitmap, cliprect);
750750
751751   /* draw the "big sprite" under the regular sprites */
752752   if ((m_bigsprite_control[0] & 0x01))
753753   {
754      cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect);
755      swimmer_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]);
754      cclimber_draw_bigsprite(machine(), bitmap, cliprect);
755      swimmer_draw_sprites(bitmap, cliprect, machine().gfx[1]);
756756   }
757757
758758   /* draw the "big sprite" over the regular sprites */
759759   else
760760   {
761      swimmer_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]);
762      cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect);
761      swimmer_draw_sprites(bitmap, cliprect, machine().gfx[1]);
762      cclimber_draw_bigsprite(machine(), bitmap, cliprect);
763763   }
764764
765765   return 0;
r17988r17989
768768
769769UINT32 cclimber_state::screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
770770{
771   cclimber_state *state = screen.machine().driver_data<cclimber_state>();
771   cclimber_state *state = machine().driver_data<cclimber_state>();
772772   rectangle scroll_area_clip = cliprect;
773773   scroll_area_clip.min_x = 4*8;
774774   scroll_area_clip.max_x = 29*8-1;
r17988r17989
784784   /* draw the "big sprite" over the regular sprites */
785785   if ((m_bigsprite_control[1] & 0x20))
786786   {
787      toprollr_draw_sprites(bitmap, scroll_area_clip, screen.machine().gfx[1]);
788      toprollr_draw_bigsprite(screen.machine(), bitmap, scroll_area_clip);
787      toprollr_draw_sprites(bitmap, scroll_area_clip, machine().gfx[1]);
788      toprollr_draw_bigsprite(machine(), bitmap, scroll_area_clip);
789789   }
790790
791791   /* draw the "big sprite" under the regular sprites */
792792   else
793793   {
794      toprollr_draw_bigsprite(screen.machine(), bitmap, scroll_area_clip);
795      toprollr_draw_sprites(bitmap, scroll_area_clip, screen.machine().gfx[1]);
794      toprollr_draw_bigsprite(machine(), bitmap, scroll_area_clip);
795      toprollr_draw_sprites(bitmap, scroll_area_clip, machine().gfx[1]);
796796   }
797797
798798   m_pf_tilemap->mark_all_dirty();
trunk/src/mame/video/xorworld.c
r17988r17989
114114UINT32 xorworld_state::screen_update_xorworld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
115115{
116116   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
117   draw_sprites(screen.machine(), bitmap, cliprect);
117   draw_sprites(machine(), bitmap, cliprect);
118118   return 0;
119119}
trunk/src/mame/video/speedspn.c
r17988r17989
9090{
9191   if (m_display_disable)
9292   {
93      bitmap.fill(get_black_pen(screen.machine()), cliprect);
93      bitmap.fill(get_black_pen(machine()), cliprect);
9494      return 0;
9595   }
9696
r17988r17989
104104#endif
105105   m_tilemap->set_scrollx(0, 0x100); // verify
106106   m_tilemap->draw(bitmap, cliprect, 0,0);
107   draw_sprites(screen.machine(), bitmap,cliprect);
107   draw_sprites(machine(), bitmap,cliprect);
108108   return 0;
109109}
trunk/src/mame/video/amigaaga.c
r17988r17989
865865
866866   /* render each scanline in the visible region */
867867   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
868      amiga_aga_render_scanline(screen.machine(), bitmap, y);
868      amiga_aga_render_scanline(machine(), bitmap, y);
869869
870870   return 0;
871871}
trunk/src/mame/video/cloak.c
r17988r17989
224224
225225UINT32 cloak_state::screen_update_cloak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
226226{
227   set_pens(screen.machine());
227   set_pens(machine());
228228   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
229   draw_bitmap(screen.machine(), bitmap, cliprect);
230   draw_sprites(screen.machine(), bitmap, cliprect);
229   draw_bitmap(machine(), bitmap, cliprect);
230   draw_sprites(machine(), bitmap, cliprect);
231231   return 0;
232232}
trunk/src/mame/video/namcona1.c
r17988r17989
644644         /* palette updates are delayed when graphics are disabled */
645645         for( which=0; which<0x1000; which++ )
646646         {
647            UpdatePalette(screen.machine(), which );
647            UpdatePalette(machine(), which );
648648         }
649649         m_palette_is_dirty = 0;
650650      }
651      UpdateGfx(screen.machine());
651      UpdateGfx(machine());
652652      for( which=0; which<NAMCONA1_NUM_TILEMAPS; which++ )
653653      {
654654         int tilemap_color = m_vreg[0xb0/2+(which&3)]&0xf;
r17988r17989
668668         }
669669      }
670670
671      screen.machine().priority_bitmap.fill(0, cliprect );
671      machine().priority_bitmap.fill(0, cliprect );
672672
673673      bitmap.fill(0xff, cliprect ); /* background color? */
674674
r17988r17989
687687            }
688688            if( pri == priority )
689689            {
690               draw_background(screen.machine(),bitmap,cliprect,which,priority);
690               draw_background(machine(),bitmap,cliprect,which,priority);
691691            }
692692         } /* next tilemap */
693693      } /* next priority level */
694694
695      draw_sprites(screen.machine(),bitmap,cliprect);
695      draw_sprites(machine(),bitmap,cliprect);
696696   } /* gfx enabled */
697697   return 0;
698698}
trunk/src/mame/video/foodf.c
r17988r17989
114114UINT32 foodf_state::screen_update_foodf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
115115{
116116   int offs;
117   gfx_element *gfx = screen.machine().gfx[1];
118   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
117   gfx_element *gfx = machine().gfx[1];
118   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
119119   UINT16 *spriteram16 = m_spriteram;
120120
121121   /* first draw the playfield opaquely */
trunk/src/mame/video/bsktball.c
r17988r17989
5454{
5555
5656   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
57   draw_sprites(screen.machine(), bitmap, cliprect);
57   draw_sprites(machine(), bitmap, cliprect);
5858   return 0;
5959}
trunk/src/mame/video/armedf.c
r17988r17989
398398   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
399399
400400   if (sprite_enable)
401      draw_sprites(screen.machine(), bitmap, cliprect, 2);
401      draw_sprites(machine(), bitmap, cliprect, 2);
402402
403403   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
404404
405405   if (sprite_enable)
406      draw_sprites(screen.machine(), bitmap, cliprect, 1);
406      draw_sprites(machine(), bitmap, cliprect, 1);
407407
408408   if (sprite_enable)
409      draw_sprites(screen.machine(), bitmap, cliprect, 0);
409      draw_sprites(machine(), bitmap, cliprect, 0);
410410
411411   m_tx_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_CATEGORY(0), 0);
412412
trunk/src/mame/video/dkong.c
r17988r17989
955955UINT32 dkong_state::screen_update_dkong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
956956{
957957
958   screen.machine().tilemap().set_flip_all(m_flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
958   machine().tilemap().set_flip_all(m_flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
959959   m_bg_tilemap->set_scrollx(0, m_flip ?  0 : 0);
960960   m_bg_tilemap->set_scrolly(0, m_flip ? -8 : 0);
961961
r17988r17989
963963   {
964964      case HARDWARE_TKG02:
965965      case HARDWARE_TKG04:
966         check_palette(screen.machine());
966         check_palette(machine());
967967         m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
968         draw_sprites(screen.machine(), bitmap, cliprect, 0x40, 1);
968         draw_sprites(machine(), bitmap, cliprect, 0x40, 1);
969969         break;
970970      case HARDWARE_TRS01:
971971      case HARDWARE_TRS02:
972972         m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
973         draw_sprites(screen.machine(), bitmap, cliprect, 0x40, 1);
974         radarscp_draw_background(screen.machine(), this, bitmap, cliprect);
973         draw_sprites(machine(), bitmap, cliprect, 0x40, 1);
974         radarscp_draw_background(machine(), this, bitmap, cliprect);
975975         break;
976976      default:
977977         fatalerror("Invalid hardware type in dkong_video_update\n");
r17988r17989
990990   {
991991      if (m_sprite_ram[offs])
992992      {
993         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
993         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
994994               m_sprite_ram[offs + 2],
995995               (m_sprite_ram[offs + 1] & 0x0f) + 16 * m_palette_bank,
996996               m_sprite_ram[offs + 1] & 0x80,m_sprite_ram[offs + 1] & 0x40,
r17988r17989
10061006   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
10071007
10081008   /* it uses sprite_ram[offs + 2] & 0x10 for sprite bank */
1009   draw_sprites(screen.machine(), bitmap, cliprect, 0x10, 3);
1009   draw_sprites(machine(), bitmap, cliprect, 0x10, 3);
10101010   return 0;
10111011}
trunk/src/mame/video/sprint4.c
r17988r17989
7474      if (i & 1)
7575         bank = 32;
7676
77      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
77      drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
7878         (code >> 3) | bank,
7979         (attr & 0x80) ? 4 : i,
8080         0, 0,
r17988r17989
9595
9696      /* check for sprite-playfield collisions */
9797
98      device_t *discrete = screen.machine().device("discrete");
98      device_t *discrete = machine().device("discrete");
9999
100100      for (i = 0; i < 4; i++)
101101      {
r17988r17989
112112
113113         rect.min_x = horz - 15;
114114         rect.min_y = vert - 15;
115         rect.max_x = horz - 15 + screen.machine().gfx[1]->width() - 1;
116         rect.max_y = vert - 15 + screen.machine().gfx[1]->height() - 1;
115         rect.max_x = horz - 15 + machine().gfx[1]->width() - 1;
116         rect.max_y = vert - 15 + machine().gfx[1]->height() - 1;
117117
118         rect &= screen.machine().primary_screen->visible_area();
118         rect &= machine().primary_screen->visible_area();
119119
120120         m_playfield->draw(m_helper, rect, 0, 0);
121121
122122         if (i & 1)
123123            bank = 32;
124124
125         drawgfx_transpen(m_helper, rect, screen.machine().gfx[1],
125         drawgfx_transpen(m_helper, rect, machine().gfx[1],
126126            (code >> 3) | bank,
127127            4,
128128            0, 0,
r17988r17989
131131
132132         for (y = rect.min_y; y <= rect.max_y; y++)
133133            for (x = rect.min_x; x <= rect.max_x; x++)
134               if (colortable_entry_get_value(screen.machine().colortable, m_helper.pix16(y, x)) != 0)
134               if (colortable_entry_get_value(machine().colortable, m_helper.pix16(y, x)) != 0)
135135                  m_collision[i] = 1;
136136      }
137137
138138      /* update sound status */
139139
140      address_space &space = screen.machine().driver_data()->generic_space();
140      address_space &space = machine().driver_data()->generic_space();
141141      discrete_sound_w(discrete, space, SPRINT4_MOTOR_DATA_1, videoram[0x391] & 15);
142142      discrete_sound_w(discrete, space, SPRINT4_MOTOR_DATA_2, videoram[0x393] & 15);
143143      discrete_sound_w(discrete, space, SPRINT4_MOTOR_DATA_3, videoram[0x395] & 15);
trunk/src/mame/video/appoooh.c
r17988r17989
276276   if (m_priority == 1)
277277   {
278278      /* sprite set #1 */
279      appoooh_draw_sprites(bitmap, cliprect, screen.machine().gfx[2], m_spriteram);
279      appoooh_draw_sprites(bitmap, cliprect, machine().gfx[2], m_spriteram);
280280      /* sprite set #2 */
281      appoooh_draw_sprites(bitmap, cliprect, screen.machine().gfx[3], m_spriteram_2);
281      appoooh_draw_sprites(bitmap, cliprect, machine().gfx[3], m_spriteram_2);
282282   }
283283   else
284284   {
285285      /* sprite set #2 */
286      appoooh_draw_sprites(bitmap, cliprect, screen.machine().gfx[3], m_spriteram_2);
286      appoooh_draw_sprites(bitmap, cliprect, machine().gfx[3], m_spriteram_2);
287287      /* sprite set #1 */
288      appoooh_draw_sprites(bitmap, cliprect, screen.machine().gfx[2], m_spriteram);
288      appoooh_draw_sprites(bitmap, cliprect, machine().gfx[2], m_spriteram);
289289   }
290290
291291   if (m_priority != 0)   /* fg in front of sprites */
r17988r17989
305305   if (m_priority == 1)
306306   {
307307      /* sprite set #1 */
308      robowres_draw_sprites(bitmap, cliprect, screen.machine().gfx[2], m_spriteram);
308      robowres_draw_sprites(bitmap, cliprect, machine().gfx[2], m_spriteram);
309309      /* sprite set #2 */
310      robowres_draw_sprites(bitmap, cliprect, screen.machine().gfx[3], m_spriteram_2);
310      robowres_draw_sprites(bitmap, cliprect, machine().gfx[3], m_spriteram_2);
311311   }
312312   else
313313   {
314314      /* sprite set #2 */
315      robowres_draw_sprites(bitmap, cliprect, screen.machine().gfx[3], m_spriteram_2);
315      robowres_draw_sprites(bitmap, cliprect, machine().gfx[3], m_spriteram_2);
316316      /* sprite set #1 */
317      robowres_draw_sprites(bitmap, cliprect, screen.machine().gfx[2], m_spriteram);
317      robowres_draw_sprites(bitmap, cliprect, machine().gfx[2], m_spriteram);
318318   }
319319
320320   if (m_priority != 0)   /* fg in front of sprites */
trunk/src/mame/video/skyraid.c
r17988r17989
140140   rectangle helper_clip = cliprect;
141141   helper_clip &= m_helper.cliprect();
142142
143   draw_terrain(screen.machine(), m_helper, helper_clip);
144   draw_sprites(screen.machine(), m_helper, helper_clip);
145   draw_missiles(screen.machine(), m_helper, helper_clip);
146   draw_trapezoid(screen.machine(), bitmap, m_helper);
147   draw_text(screen.machine(), bitmap, cliprect);
143   draw_terrain(machine(), m_helper, helper_clip);
144   draw_sprites(machine(), m_helper, helper_clip);
145   draw_missiles(machine(), m_helper, helper_clip);
146   draw_trapezoid(machine(), bitmap, m_helper);
147   draw_text(machine(), bitmap, cliprect);
148148   return 0;
149149}
trunk/src/mame/video/travrusa.c
r17988r17989
332332UINT32 travrusa_state::screen_update_travrusa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
333333{
334334   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
335   draw_sprites(screen.machine(), bitmap,cliprect);
335   draw_sprites(machine(), bitmap,cliprect);
336336   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
337337   return 0;
338338}
trunk/src/mame/video/metlclsh.c
r17988r17989
249249      m_bg_tilemap->set_scrollx(0, m_scrollx[1] + ((m_scrollx[0] & 0x02) << 7) );
250250      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
251251   }
252   draw_sprites(screen.machine(), bitmap, cliprect);         // sprites
252   draw_sprites(machine(), bitmap, cliprect);         // sprites
253253   m_fg_tilemap->draw(bitmap, cliprect, 2, 0);   // high priority tiles of foreground
254254
255255//  popmessage("%02X", m_scrollx[0]);
trunk/src/mame/video/aliens.c
r17988r17989
7777
7878   k052109_tilemap_update(m_k052109);
7979
80   screen.machine().priority_bitmap.fill(0, cliprect);
80   machine().priority_bitmap.fill(0, cliprect);
8181   bitmap.fill(m_layer_colorbase[1] * 16, cliprect);
8282
8383   k052109_tilemap_draw(m_k052109, bitmap, cliprect, 1, 0, 1);
trunk/src/mame/video/dbz.c
r17988r17989
129129
130130   konami_sortlayers5(layer, m_layerpri);
131131
132   screen.machine().priority_bitmap.fill(0, cliprect);
132   machine().priority_bitmap.fill(0, cliprect);
133133
134134   for (plane = 0; plane < 5; plane++)
135135   {
trunk/src/mame/video/goldstar.c
r17988r17989
366366{
367367   int i;
368368
369   bitmap.fill(get_black_pen(screen.machine()), cliprect);
369   bitmap.fill(get_black_pen(machine()), cliprect);
370370
371371   if (!(m_cm_enable_reg &0x01))
372372      return 0;
r17988r17989
393393
394394   if (m_cm_enable_reg &0x04)
395395   {
396      if (screen.machine().root_device().memregion("user1")->base())
396      if (machine().root_device().memregion("user1")->base())
397397      {
398         gfx_element *gfx = screen.machine().gfx[2];
398         gfx_element *gfx = machine().gfx[2];
399399         int girlyscroll = (INT8)((m_cm_girl_scroll & 0xf0));
400400         int girlxscroll = (INT8)((m_cm_girl_scroll & 0x0f)<<4);
401401
r17988r17989
416416{
417417   int i;
418418
419   bitmap.fill(get_black_pen(screen.machine()), cliprect);
419   bitmap.fill(get_black_pen(machine()), cliprect);
420420
421421   if (!(m_cm_enable_reg &0x01))
422422      return 0;
r17988r17989
435435
436436   if (m_cm_enable_reg &0x04)
437437   {
438      if (screen.machine().root_device().memregion("user1")->base())
438      if (machine().root_device().memregion("user1")->base())
439439      {
440         gfx_element *gfx = screen.machine().gfx[2];
440         gfx_element *gfx = machine().gfx[2];
441441         int girlyscroll = (INT8)((m_cm_girl_scroll & 0xf0));
442442         int girlxscroll = (INT8)((m_cm_girl_scroll & 0x0f)<<4);
443443
r17988r17989
458458{
459459   int i;
460460
461   bitmap.fill(get_black_pen(screen.machine()), cliprect);
461   bitmap.fill(get_black_pen(machine()), cliprect);
462462
463463   if (!(m_cm_enable_reg &0x01))
464464      return 0;
r17988r17989
516516{
517517   int i;
518518
519   bitmap.fill(get_black_pen(screen.machine()), cliprect);
519   bitmap.fill(get_black_pen(machine()), cliprect);
520520
521521   if (!(m_cm_enable_reg &0x01))
522522      return 0;
r17988r17989
569569{
570570   int i;
571571
572   bitmap.fill(get_black_pen(screen.machine()), cliprect);
572   bitmap.fill(get_black_pen(machine()), cliprect);
573573
574574   if (!(m_cm_enable_reg &0x01))
575575      return 0;
r17988r17989
604604{
605605   int i;
606606
607   bitmap.fill(get_black_pen(screen.machine()), cliprect);
607   bitmap.fill(get_black_pen(machine()), cliprect);
608608
609609   if (!(m_cm_enable_reg &0x01))
610610      return 0;
trunk/src/mame/video/kaneko16.c
r17988r17989
4848{
4949   int i;
5050
51   screen.machine().priority_bitmap.fill(0, cliprect);
51   machine().priority_bitmap.fill(0, cliprect);
5252
5353   if (m_view2_0) m_view2_0->kaneko16_prepare(bitmap, cliprect);
5454   if (m_view2_1) m_view2_1->kaneko16_prepare(bitmap, cliprect);
r17988r17989
6868
6969UINT32 kaneko16_state::screen_update_kaneko16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7070{
71   kaneko16_fill_bitmap(screen.machine(),bitmap,cliprect);
71   kaneko16_fill_bitmap(machine(),bitmap,cliprect);
7272
7373   // if the display is disabled, do nothing?
7474   if (!m_disp_enable) return 0;
7575
7676   SCREEN_UPDATE16_CALL_MEMBER(common);
77   m_kaneko_spr->kaneko16_render_sprites(screen.machine(),bitmap,cliprect, m_spriteram, m_spriteram.bytes());
77   m_kaneko_spr->kaneko16_render_sprites(machine(),bitmap,cliprect, m_spriteram, m_spriteram.bytes());
7878   return 0;
7979}
8080
r17988r17989
192192UINT32 kaneko16_berlwall_state::screen_update_berlwall(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
193193{
194194   // berlwall uses a 15bpp bitmap as a bg, not a solid fill
195   kaneko16_render_15bpp_bitmap(screen.machine(),bitmap,cliprect);
195   kaneko16_render_15bpp_bitmap(machine(),bitmap,cliprect);
196196
197197   // if the display is disabled, do nothing?
198198   if (!m_disp_enable) return 0;
199199
200200   SCREEN_UPDATE16_CALL_MEMBER(common);
201   m_kaneko_spr->kaneko16_render_sprites(screen.machine(),bitmap,cliprect, m_spriteram, m_spriteram.bytes());
201   m_kaneko_spr->kaneko16_render_sprites(machine(),bitmap,cliprect, m_spriteram, m_spriteram.bytes());
202202   return 0;
203203}
trunk/src/mame/video/wc90.c
r17988r17989
344344   m_tx_tilemap->set_scrollx(0,m_scroll0xlo[0] + 256 * m_scroll0xhi[0]);
345345   m_tx_tilemap->set_scrolly(0,m_scroll0ylo[0] + 256 * m_scroll0yhi[0]);
346346
347//  draw_sprites(screen.machine(), bitmap,cliprect, 3 );
347//  draw_sprites(machine(), bitmap,cliprect, 3 );
348348   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
349   draw_sprites(screen.machine(), bitmap,cliprect, 2 );
349   draw_sprites(machine(), bitmap,cliprect, 2 );
350350   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
351   draw_sprites(screen.machine(), bitmap,cliprect, 1 );
351   draw_sprites(machine(), bitmap,cliprect, 1 );
352352   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
353   draw_sprites(screen.machine(), bitmap,cliprect, 0 );
353   draw_sprites(machine(), bitmap,cliprect, 0 );
354354   return 0;
355355}
trunk/src/mame/video/ms32.c
r17988r17989
366366   int i;
367367
368368   for (i = 0;i < 0x10000;i++)   // colors 0x3000-0x3fff are not used
369      update_color(screen.machine(), i);
369      update_color(machine(), i);
370370
371371   scrollx = m_tx_scroll[0x00/4] + m_tx_scroll[0x08/4] + 0x18;
372372   scrolly = m_tx_scroll[0x0c/4] + m_tx_scroll[0x14/4];
r17988r17989
381381   m_bg_tilemap_alt->set_scrolly(0, scrolly);
382382
383383
384   screen.machine().priority_bitmap.fill(0, cliprect);
384   machine().priority_bitmap.fill(0, cliprect);
385385
386386
387387
r17988r17989
393393   m_temp_bitmap_sprites.fill(0, cliprect);
394394   m_temp_bitmap_sprites_pri.fill(0, cliprect);
395395
396   draw_sprites(screen.machine(), m_temp_bitmap_sprites, m_temp_bitmap_sprites_pri, cliprect, m_sprram_16, 0x20000, 0, m_reverse_sprite_order);
396   draw_sprites(machine(), m_temp_bitmap_sprites, m_temp_bitmap_sprites_pri, cliprect, m_sprram_16, 0x20000, 0, m_reverse_sprite_order);
397397
398398
399399
r17988r17989
416416      rot_pri++;
417417
418418   if (rot_pri == 0)
419      draw_roz(screen.machine(), m_temp_bitmap_tilemaps, cliprect, 1 << 1);
419      draw_roz(machine(), m_temp_bitmap_tilemaps, cliprect, 1 << 1);
420420   else if (scr_pri == 0)
421421      if (m_tilemaplayoutcontrol&1)
422422      {
r17988r17989
430430      m_tx_tilemap->draw(m_temp_bitmap_tilemaps, cliprect, 0, 1 << 2);
431431
432432   if (rot_pri == 1)
433      draw_roz(screen.machine(), m_temp_bitmap_tilemaps, cliprect, 1 << 1);
433      draw_roz(machine(), m_temp_bitmap_tilemaps, cliprect, 1 << 1);
434434   else if (scr_pri == 1)
435435      if (m_tilemaplayoutcontrol&1)
436436      {
r17988r17989
444444      m_tx_tilemap->draw(m_temp_bitmap_tilemaps, cliprect, 0, 1 << 2);
445445
446446   if (rot_pri == 2)
447      draw_roz(screen.machine(), m_temp_bitmap_tilemaps, cliprect, 1 << 1);
447      draw_roz(machine(), m_temp_bitmap_tilemaps, cliprect, 1 << 1);
448448   else if (scr_pri == 2)
449449      if (m_tilemaplayoutcontrol&1)
450450      {
r17988r17989
465465      int xx, yy;
466466      int width = screen.width();
467467      int height = screen.height();
468      const pen_t *paldata = screen.machine().pens;
468      const pen_t *paldata = machine().pens;
469469
470470      UINT16* srcptr_tile;
471471      UINT8* srcptr_tilepri;
r17988r17989
479479      for (yy=0;yy<height;yy++)
480480      {
481481         srcptr_tile =     &m_temp_bitmap_tilemaps.pix16(yy);
482         srcptr_tilepri =  &screen.machine().priority_bitmap.pix8(yy);
482         srcptr_tilepri =  &machine().priority_bitmap.pix8(yy);
483483         srcptr_spri =     &m_temp_bitmap_sprites.pix16(yy);
484484         //srcptr_spripri =  &m_temp_bitmap_sprites_pri.pix8(yy);
485485         dstptr_bitmap  =  &bitmap.pix32(yy);
r17988r17989
568568            }
569569            else if (primask == 0xc0)
570570            {
571               dstptr_bitmap[xx] = paldata[screen.machine().rand()&0xfff];
571               dstptr_bitmap[xx] = paldata[machine().rand()&0xfff];
572572            }
573573            else if (primask == 0xf0)
574574            {
r17988r17989
652652               }
653653               else if (src_tilepri==0x06)
654654               {
655                  //dstptr_bitmap[xx] = paldata[screen.machine().rand()&0xfff];
655                  //dstptr_bitmap[xx] = paldata[machine().rand()&0xfff];
656656                  dstptr_bitmap[xx] = paldata[src_tile]; // assumed
657657               }
658658               else if (src_tilepri==0x07)
659659               {
660                  //dstptr_bitmap[xx] = paldata[screen.machine().rand()&0xfff];
660                  //dstptr_bitmap[xx] = paldata[machine().rand()&0xfff];
661661                  dstptr_bitmap[xx] = paldata[src_tile]; // assumed
662662               }
663663            }
trunk/src/mame/video/darkseal.c
r17988r17989
6262
6363UINT32 darkseal_state::screen_update_darkseal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6464{
65   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
65   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
6666
67   bitmap.fill(get_black_pen(screen.machine()), cliprect);
67   bitmap.fill(get_black_pen(machine()), cliprect);
6868
6969   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf1_rowscroll);
7070   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf3_rowscroll);
r17988r17989
7373   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
7474
7575   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
76   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
76   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
7777   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
7878
7979   return 0;
trunk/src/mame/video/20pacgal.c
r17988r17989
412412   bitmap.fill(0, cliprect);
413413   draw_stars(this, bitmap,cliprect);
414414   draw_chars(this, bitmap);
415   draw_sprites(screen.machine(),this, bitmap);
416   do_pen_lookup(screen.machine(), this, bitmap, cliprect);
415   draw_sprites(machine(),this, bitmap);
416   do_pen_lookup(machine(), this, bitmap, cliprect);
417417
418418   return 0;
419419}
trunk/src/mame/video/spbactn.c
r17988r17989
130130
131131      color = ((attr & 0x00f0) >> 4) | 0x80;
132132
133      drawgfx_transpen_raw(m_tile_bitmap_bg, cliprect, screen.machine().gfx[1],
133      drawgfx_transpen_raw(m_tile_bitmap_bg, cliprect, machine().gfx[1],
134134               code,
135               screen.machine().gfx[1]->colorbase() + color * screen.machine().gfx[1]->granularity(),
135               machine().gfx[1]->colorbase() + color * machine().gfx[1]->granularity(),
136136               0, 0,
137137               16 * sx, 8 * sy,
138138               (UINT32)-1);
r17988r17989
145145      }
146146   }
147147
148   if (draw_sprites(screen.machine(), m_tile_bitmap_bg, cliprect, 0))
148   if (draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 0))
149149   {
150150      /* kludge: draw table bg gfx again if priority 0 sprites are enabled */
151151      for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
r17988r17989
157157
158158         color = ((attr & 0x00f0) >> 4) | 0x80;
159159
160         drawgfx_transpen_raw(m_tile_bitmap_bg, cliprect, screen.machine().gfx[1],
160         drawgfx_transpen_raw(m_tile_bitmap_bg, cliprect, machine().gfx[1],
161161               code,
162               screen.machine().gfx[1]->colorbase() + color * screen.machine().gfx[1]->granularity(),
162               machine().gfx[1]->colorbase() + color * machine().gfx[1]->granularity(),
163163               0, 0,
164164               16 * sx, 8 * sy,
165165               0);
r17988r17989
173173      }
174174   }
175175
176   draw_sprites(screen.machine(), m_tile_bitmap_bg, cliprect, 1);
176   draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 1);
177177
178178   /* draw table fg gfx */
179179   for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
r17988r17989
191191      else
192192         color |= 0x0080;
193193
194      drawgfx_transpen_raw(m_tile_bitmap_fg, cliprect, screen.machine().gfx[0],
194      drawgfx_transpen_raw(m_tile_bitmap_fg, cliprect, machine().gfx[0],
195195               code,
196               screen.machine().gfx[0]->colorbase() + color * screen.machine().gfx[0]->granularity(),
196               machine().gfx[0]->colorbase() + color * machine().gfx[0]->granularity(),
197197               0, 0,
198198               16 * sx, 8 * sy,
199199               0);
r17988r17989
206206      }
207207   }
208208
209   draw_sprites(screen.machine(), m_tile_bitmap_fg, cliprect, 2);
210   draw_sprites(screen.machine(), m_tile_bitmap_fg, cliprect, 3);
209   draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 2);
210   draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 3);
211211
212212   /* mix & blend the tilemaps and sprites into a 32-bit bitmap */
213   blendbitmaps(screen.machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, cliprect);
213   blendbitmaps(machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, cliprect);
214214   return 0;
215215}
trunk/src/mame/video/seicross.c
r17988r17989
142142      m_bg_tilemap->set_scrolly(col, m_row_scroll[col]);
143143
144144   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
145   draw_sprites(screen.machine(), bitmap, cliprect);
145   draw_sprites(machine(), bitmap, cliprect);
146146   return 0;
147147}
trunk/src/mame/video/system16.c
r17988r17989
615615   int offset_bg0x = 187;
616616   int offset_bg0y = 0;
617617
618   bitmap.fill(get_black_pen(screen.machine()), cliprect);
618   bitmap.fill(get_black_pen(machine()), cliprect);
619619
620620   // start the sprites drawing
621621   m_sprites->draw_async(cliprect);
r17988r17989
664664      {
665665         UINT16 *dest = &bitmap.pix(y);
666666         UINT16 *src = &sprites.pix(y);
667//          UINT8 *pri = &screen.machine().priority_bitmap.pix(y);
667//          UINT8 *pri = &machine().priority_bitmap.pix(y);
668668         for (int x = rect->min_x; x <= rect->max_x; x++)
669669         {
670670            // only process written pixels
r17988r17989
677677               {
678678                  // if the color is set to maximum, shadow pixels underneath us
679679                  if ((pix & 0x03f0) == 0x03f0)
680                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? screen.machine().total_colors()*2 : screen.machine().total_colors();
680                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? machine().total_colors()*2 : machine().total_colors();
681681
682682                  // otherwise, just add in sprite palette base
683683                  else
r17988r17989
703703   int offset_bg0x = 5;
704704   int offset_bg0y = 32;
705705
706   bitmap.fill(get_black_pen(screen.machine()), cliprect);
706   bitmap.fill(get_black_pen(machine()), cliprect);
707707
708708   // start the sprites drawing
709709   m_sprites->draw_async(cliprect);
r17988r17989
735735      {
736736         UINT16 *dest = &bitmap.pix(y);
737737         UINT16 *src = &sprites.pix(y);
738//          UINT8 *pri = &screen.machine().priority_bitmap.pix(y);
738//          UINT8 *pri = &machine().priority_bitmap.pix(y);
739739         for (int x = rect->min_x; x <= rect->max_x; x++)
740740         {
741741            // only process written pixels
r17988r17989
748748               {
749749                  // if the color is set to maximum, shadow pixels underneath us
750750                  if ((pix & 0x03f0) == 0x03f0)
751                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? screen.machine().total_colors()*2 : screen.machine().total_colors();
751                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? machine().total_colors()*2 : machine().total_colors();
752752
753753                  // otherwise, just add in sprite palette base
754754                  else
r17988r17989
777777   // start the sprites drawing
778778   m_sprites->draw_async(cliprect);
779779
780   update_page(screen.machine());
780   update_page(machine());
781781
782   screen.machine().priority_bitmap.fill(0, cliprect);
782   machine().priority_bitmap.fill(0, cliprect);
783783
784784   m_background->set_scrollx(0, -320 - m_bg_scrollx);
785785   m_background->set_scrolly(0, -256 + m_bg_scrolly + m_back_yscroll);
r17988r17989
805805
806806   m_text_layer->draw(bitmap, cliprect, 0, 0xf);
807807
808   //draw_sprites(screen.machine(), bitmap, cliprect,0);
808   //draw_sprites(machine(), bitmap, cliprect,0);
809809
810810
811811   // mix in sprites
r17988r17989
815815      {
816816         UINT16 *dest = &bitmap.pix(y);
817817         UINT16 *src = &sprites.pix(y);
818//          UINT8 *pri = &screen.machine().priority_bitmap.pix(y);
818//          UINT8 *pri = &machine().priority_bitmap.pix(y);
819819         for (int x = rect->min_x; x <= rect->max_x; x++)
820820         {
821821            // only process written pixels
r17988r17989
828828               {
829829                  // if the color is set to maximum, shadow pixels underneath us
830830                  if ((pix & 0x03f0) == 0x03f0)
831                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? screen.machine().total_colors()*2 : screen.machine().total_colors();
831                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? machine().total_colors()*2 : machine().total_colors();
832832
833833                  // otherwise, just add in sprite palette base
834834                  else
r17988r17989
847847
848848   if (!m_refreshenable)
849849   {
850      bitmap.fill(get_black_pen(screen.machine()), cliprect);
850      bitmap.fill(get_black_pen(machine()), cliprect);
851851      return 0;
852852   }
853853
854854   // start the sprites drawing
855855   m_sprites->draw_async(cliprect);
856856
857   update_page(screen.machine());
857   update_page(machine());
858858
859   screen.machine().priority_bitmap.fill(0);
859   machine().priority_bitmap.fill(0);
860860
861861   bitmap.fill(0, cliprect);
862862
r17988r17989
879879      {
880880         UINT16 *dest = &bitmap.pix(y);
881881         UINT16 *src = &sprites.pix(y);
882//          UINT8 *pri = &screen.machine().priority_bitmap.pix(y);
882//          UINT8 *pri = &machine().priority_bitmap.pix(y);
883883         for (int x = rect->min_x; x <= rect->max_x; x++)
884884         {
885885            // only process written pixels
r17988r17989
892892               {
893893                  // if the color is set to maximum, shadow pixels underneath us
894894                  if ((pix & 0x03f0) == 0x03f0)
895                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? screen.machine().total_colors()*2 : screen.machine().total_colors();
895                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? machine().total_colors()*2 : machine().total_colors();
896896
897897                  // otherwise, just add in sprite palette base
898898                  else
trunk/src/mame/video/deniam.c
r17988r17989
373373   bg_scrollx = m_textram[m_bg_scrollx_reg] - m_bg_scrollx_offs;
374374   bg_scrolly = (m_textram[m_bg_scrolly_reg] & 0xff) - m_bg_scrolly_offs;
375375   page = m_textram[m_bg_page_reg];
376   set_bg_page(screen.machine(), 3, (page >>12) & 0x0f);
377   set_bg_page(screen.machine(), 2, (page >> 8) & 0x0f);
378   set_bg_page(screen.machine(), 1, (page >> 4) & 0x0f);
379   set_bg_page(screen.machine(), 0, (page >> 0) & 0x0f);
376   set_bg_page(machine(), 3, (page >>12) & 0x0f);
377   set_bg_page(machine(), 2, (page >> 8) & 0x0f);
378   set_bg_page(machine(), 1, (page >> 4) & 0x0f);
379   set_bg_page(machine(), 0, (page >> 0) & 0x0f);
380380
381381   fg_scrollx = m_textram[m_fg_scrollx_reg] - m_fg_scrollx_offs;
382382   fg_scrolly = (m_textram[m_fg_scrolly_reg] & 0xff) - m_fg_scrolly_offs;
383383   page = m_textram[m_fg_page_reg];
384   set_fg_page(screen.machine(), 3, (page >>12) & 0x0f);
385   set_fg_page(screen.machine(), 2, (page >> 8) & 0x0f);
386   set_fg_page(screen.machine(), 1, (page >> 4) & 0x0f);
387   set_fg_page(screen.machine(), 0, (page >> 0) & 0x0f);
384   set_fg_page(machine(), 3, (page >>12) & 0x0f);
385   set_fg_page(machine(), 2, (page >> 8) & 0x0f);
386   set_fg_page(machine(), 1, (page >> 4) & 0x0f);
387   set_fg_page(machine(), 0, (page >> 0) & 0x0f);
388388
389389   m_bg_tilemap->set_scrollx(0, bg_scrollx & 0x1ff);
390390   m_bg_tilemap->set_scrolly(0, bg_scrolly & 0x0ff);
391391   m_fg_tilemap->set_scrollx(0, fg_scrollx & 0x1ff);
392392   m_fg_tilemap->set_scrolly(0, fg_scrolly & 0x0ff);
393393
394   screen.machine().priority_bitmap.fill(0, cliprect);
394   machine().priority_bitmap.fill(0, cliprect);
395395
396396   m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
397397   m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
398398   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
399399
400   draw_sprites(screen.machine(), bitmap, cliprect);
400   draw_sprites(machine(), bitmap, cliprect);
401401   return 0;
402402}
trunk/src/mame/video/redalert.c
r17988r17989
188188   pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1];
189189   offs_t offs;
190190
191   get_pens(screen.machine(), pens);
191   get_pens(machine(), pens);
192192
193193   for (offs = 0; offs < 0x2000; offs++)
194194   {
r17988r17989
260260   pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1];
261261   offs_t offs;
262262
263   get_pens(screen.machine(), pens);
263   get_pens(machine(), pens);
264264
265265   for (offs = 0; offs < 0x2000; offs++)
266266   {
r17988r17989
334334   pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1];
335335   offs_t offs;
336336
337   get_panther_pens(screen.machine(), pens);
337   get_panther_pens(machine(), pens);
338338
339339   for (offs = 0; offs < 0x2000; offs++)
340340   {
trunk/src/mame/video/mcr3.c
r17988r17989
278278   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
279279
280280   /* draw the sprites */
281   mcr3_update_sprites(screen.machine(), bitmap, cliprect, 0x03, 0, 0, 0);
281   mcr3_update_sprites(machine(), bitmap, cliprect, 0x03, 0, 0, 0);
282282   return 0;
283283}
284284
r17988r17989
292292   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
293293
294294   /* draw the sprites */
295   mcr3_update_sprites(screen.machine(), bitmap, cliprect, m_spyhunt_sprite_color_mask, 0, -12, 0);
295   mcr3_update_sprites(machine(), bitmap, cliprect, m_spyhunt_sprite_color_mask, 0, -12, 0);
296296
297297   /* render any characters on top */
298298   m_alpha_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/stadhero.c
r17988r17989
2121
2222UINT32 stadhero_state::screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
2323{
24//  screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
24//  machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
2525
26   screen.machine().device<deco_bac06_device>("tilegen1")->set_bppmultmask(0x8, 0x7);
27   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
28   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f);
26   machine().device<deco_bac06_device>("tilegen1")->set_bppmultmask(0x8, 0x7);
27   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
28   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f);
2929   m_pf1_tilemap->draw(bitmap, cliprect, 0,0);
3030   return 0;
3131}
trunk/src/mame/video/prehisle.c
r17988r17989
161161{
162162
163163   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
164   draw_sprites(screen.machine(), bitmap, cliprect, 0);
164   draw_sprites(machine(), bitmap, cliprect, 0);
165165   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
166   draw_sprites(screen.machine(), bitmap, cliprect, 1);
166   draw_sprites(machine(), bitmap, cliprect, 1);
167167   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
168168   return 0;
169169}
trunk/src/mame/video/simpsons.c
r17988r17989
139139
140140   konami_sortlayers3(layer, m_layerpri);
141141
142   screen.machine().priority_bitmap.fill(0, cliprect);
142   machine().priority_bitmap.fill(0, cliprect);
143143   bitmap.fill(16 * bg_colorbase, cliprect);
144144   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[0], 0, 1);
145145   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[1], 0, 2);
trunk/src/mame/video/wwfsstar.c
r17988r17989
222222   m_bg0_tilemap->set_scrollx(0, m_scrollx  );
223223
224224   m_bg0_tilemap->draw(bitmap, cliprect, 0,0);
225   draw_sprites(screen.machine(), bitmap,cliprect );
225   draw_sprites(machine(), bitmap,cliprect );
226226   m_fg0_tilemap->draw(bitmap, cliprect, 0,0);
227227
228228   return 0;
trunk/src/mame/video/polepos.c
r17988r17989
503503   rectangle clip = cliprect;
504504   clip.max_y = 127;
505505   m_bg_tilemap->draw(bitmap, clip, 0,0);
506   draw_road(screen.machine(), bitmap);
507   draw_sprites(screen.machine(), bitmap,cliprect);
506   draw_road(machine(), bitmap);
507   draw_sprites(machine(), bitmap,cliprect);
508508   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
509509   return 0;
510510}
trunk/src/mame/video/actfancr.c
r17988r17989
2929
3030   /* Draw playfield */
3131   //m_flipscreen = m_control_2[0] & 0x80;
32   //screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
32   //machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
3333
34   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
35   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram16, 0x00, 0x00, 0x0f);
36   screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
34   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
35   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram16, 0x00, 0x00, 0x0f);
36   machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
3737
3838   return 0;
3939}
trunk/src/mame/video/taito_b.c
r17988r17989
367367
368368UINT32 taitob_state::screen_update_taitob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
369369{
370   address_space &space = screen.machine().driver_data()->generic_space();
370   address_space &space = machine().driver_data()->generic_space();
371371   UINT8 video_control = tc0180vcu_get_videoctrl(m_tc0180vcu, space, 0);
372372
373373   if ((video_control & 0x20) == 0)
r17988r17989
379379   /* Draw playfields */
380380   tc0180vcu_tilemap_draw(m_tc0180vcu, bitmap, cliprect, 0, 1);
381381
382   draw_framebuffer(screen.machine(), bitmap, cliprect, 1);
382   draw_framebuffer(machine(), bitmap, cliprect, 1);
383383
384384   tc0180vcu_tilemap_draw(m_tc0180vcu, bitmap, cliprect, 1, 0);
385385
r17988r17989
392392      copyscrollbitmap_trans(bitmap, *m_pixel_bitmap, 1, &scrollx, 1, &scrolly, cliprect, m_b_fg_color_base * 16);
393393   }
394394
395   draw_framebuffer(screen.machine(), bitmap, cliprect, 0);
395   draw_framebuffer(machine(), bitmap, cliprect, 0);
396396
397397   tc0180vcu_tilemap_draw(m_tc0180vcu, bitmap, cliprect, 2, 0);
398398
r17988r17989
403403
404404UINT32 taitob_state::screen_update_realpunc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
405405{
406   address_space &space = screen.machine().driver_data()->generic_space();
407   const rgb_t *palette = palette_entry_list_adjusted(screen.machine().palette);
406   address_space &space = machine().driver_data()->generic_space();
407   const rgb_t *palette = palette_entry_list_adjusted(machine().palette);
408408   UINT8 video_control = tc0180vcu_get_videoctrl(m_tc0180vcu, space, 0);
409409   int x, y;
410410
r17988r17989
418418   /* Draw the palettized playfields to an indexed bitmap */
419419   tc0180vcu_tilemap_draw(m_tc0180vcu, *m_realpunc_bitmap, cliprect, 0, 1);
420420
421   draw_framebuffer(screen.machine(), *m_realpunc_bitmap, cliprect, 1);
421   draw_framebuffer(machine(), *m_realpunc_bitmap, cliprect, 1);
422422
423423   tc0180vcu_tilemap_draw(m_tc0180vcu, *m_realpunc_bitmap, cliprect, 1, 0);
424424
425425   if (m_realpunc_video_ctrl & 0x0001)
426      draw_framebuffer(screen.machine(), *m_realpunc_bitmap, cliprect, 0);
426      draw_framebuffer(machine(), *m_realpunc_bitmap, cliprect, 0);
427427
428428   /* Copy the intermediate bitmap to the output bitmap, applying the palette */
429429   for (y = 0; y <= cliprect.max_y; y++)
r17988r17989
433433   /* Draw the 15bpp raw CRTC frame buffer directly to the output bitmap */
434434   if (m_realpunc_video_ctrl & 0x0002)
435435   {
436      device_t *hd63484 = screen.machine().device("hd63484");
436      device_t *hd63484 = machine().device("hd63484");
437437
438438      int base = (hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
439439      int stride = hd63484_regs_r(hd63484, space, 0xca/2, 0xffff);
r17988r17989
474474   m_realpunc_bitmap->fill(0, cliprect);
475475
476476   if (!(m_realpunc_video_ctrl & 0x0001))
477      draw_framebuffer(screen.machine(), *m_realpunc_bitmap, cliprect, 0);
477      draw_framebuffer(machine(), *m_realpunc_bitmap, cliprect, 0);
478478
479479   tc0180vcu_tilemap_draw(m_tc0180vcu, *m_realpunc_bitmap, cliprect, 2, 0);
480480
r17988r17989
498498   // rising edge
499499   if (state)
500500   {
501      address_space &space = screen.machine().driver_data()->generic_space();
501      address_space &space = machine().driver_data()->generic_space();
502502      UINT8 video_control = tc0180vcu_get_videoctrl(m_tc0180vcu, space, 0);
503503      UINT8 framebuffer_page = tc0180vcu_get_fb_page(m_tc0180vcu, space, 0);
504504
505505      if (~video_control & 0x01)
506         m_framebuffer[framebuffer_page]->fill(0, screen.machine().primary_screen->visible_area());
506         m_framebuffer[framebuffer_page]->fill(0, machine().primary_screen->visible_area());
507507
508508      if (~video_control & 0x80)
509509      {
r17988r17989
511511         tc0180vcu_set_fb_page(m_tc0180vcu, space, 0, framebuffer_page);
512512      }
513513
514      draw_sprites(screen.machine(), *m_framebuffer[framebuffer_page], screen.machine().primary_screen->visible_area());
514      draw_sprites(machine(), *m_framebuffer[framebuffer_page], machine().primary_screen->visible_area());
515515   }
516516}
trunk/src/mame/video/model1.c
r17988r17989
14741474      double delta;
14751475      delta = 1;
14761476
1477      if(screen.machine().input().code_pressed(KEYCODE_F)) {
1477      if(machine().input().code_pressed(KEYCODE_F)) {
14781478         mod = 1;
14791479         view->vxx -= delta;
14801480      }
1481      if(screen.machine().input().code_pressed(KEYCODE_G)) {
1481      if(machine().input().code_pressed(KEYCODE_G)) {
14821482         mod = 1;
14831483         view->vxx += delta;
14841484      }
1485      if(screen.machine().input().code_pressed(KEYCODE_H)) {
1485      if(machine().input().code_pressed(KEYCODE_H)) {
14861486         mod = 1;
14871487         view->vyy -= delta;
14881488      }
1489      if(screen.machine().input().code_pressed(KEYCODE_J)) {
1489      if(machine().input().code_pressed(KEYCODE_J)) {
14901490         mod = 1;
14911491         view->vyy += delta;
14921492      }
1493      if(screen.machine().input().code_pressed(KEYCODE_K)) {
1493      if(machine().input().code_pressed(KEYCODE_K)) {
14941494         mod = 1;
14951495         view->vzz -= delta;
14961496      }
1497      if(screen.machine().input().code_pressed(KEYCODE_L)) {
1497      if(machine().input().code_pressed(KEYCODE_L)) {
14981498         mod = 1;
14991499         view->vzz += delta;
15001500      }
1501      if(screen.machine().input().code_pressed(KEYCODE_U)) {
1501      if(machine().input().code_pressed(KEYCODE_U)) {
15021502         mod = 1;
15031503         view->ayy -= 0.05;
15041504      }
1505      if(screen.machine().input().code_pressed(KEYCODE_I)) {
1505      if(machine().input().code_pressed(KEYCODE_I)) {
15061506         mod = 1;
15071507         view->ayy += 0.05;
15081508      }
r17988r17989
15141514   view->ayyc = cos(view->ayy);
15151515   view->ayys = sin(view->ayy);
15161516
1517   screen.machine().priority_bitmap.fill(0);
1518   bitmap.fill(screen.machine().pens[0], cliprect);
1517   machine().priority_bitmap.fill(0);
1518   bitmap.fill(machine().pens[0], cliprect);
15191519
1520   segas24_tile *tile = screen.machine().device<segas24_tile>("tile");
1520   segas24_tile *tile = machine().device<segas24_tile>("tile");
15211521   tile->draw(bitmap, cliprect, 6, 0, 0);
15221522   tile->draw(bitmap, cliprect, 4, 0, 0);
15231523   tile->draw(bitmap, cliprect, 2, 0, 0);
15241524   tile->draw(bitmap, cliprect, 0, 0, 0);
15251525
1526   tgp_render(screen.machine(), bitmap, cliprect);
1526   tgp_render(machine(), bitmap, cliprect);
15271527
15281528   tile->draw(bitmap, cliprect, 7, 0, 0);
15291529   tile->draw(bitmap, cliprect, 5, 0, 0);
r17988r17989
15381538   // on rising edge
15391539   if (state)
15401540   {
1541      tgp_scan(screen.machine());
1542      end_frame(screen.machine());
1541      tgp_scan(machine());
1542      end_frame(machine());
15431543      LOG_TGP(("TGP: vsync\n"));
15441544   }
15451545}
trunk/src/mame/video/tank8.c
r17988r17989
176176
177177UINT32 tank8_state::screen_update_tank8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
178178{
179   set_pens(this, screen.machine().colortable);
179   set_pens(this, machine().colortable);
180180   m_tilemap->draw(bitmap, cliprect, 0, 0);
181181
182   draw_sprites(screen.machine(), bitmap, cliprect);
183   draw_bullets(screen.machine(), bitmap, cliprect);
182   draw_sprites(machine(), bitmap, cliprect);
183   draw_bullets(machine(), bitmap, cliprect);
184184   return 0;
185185}
186186
r17988r17989
192192   {
193193      int x;
194194      int y;
195      const rectangle &visarea = screen.machine().primary_screen->visible_area();
195      const rectangle &visarea = machine().primary_screen->visible_area();
196196
197197      m_tilemap->draw(m_helper1, visarea, 0, 0);
198198
199199      m_helper2.fill(8, visarea);
200200      m_helper3.fill(8, visarea);
201201
202      draw_sprites(screen.machine(), m_helper2, visarea);
203      draw_bullets(screen.machine(), m_helper3, visarea);
202      draw_sprites(machine(), m_helper2, visarea);
203      draw_bullets(machine(), m_helper3, visarea);
204204
205205      for (y = visarea.min_y; y <= visarea.max_y; y++)
206206      {
r17988r17989
210210         const UINT16* p2 = &m_helper2.pix16(y);
211211         const UINT16* p3 = &m_helper3.pix16(y);
212212
213         if (y % 2 != screen.machine().primary_screen->frame_number() % 2)
213         if (y % 2 != machine().primary_screen->frame_number() % 2)
214214            continue; /* video display is interlaced */
215215
216216         for (x = visarea.min_x; x <= visarea.max_x; x++)
r17988r17989
269269                  index |= 0x80; /* collision on right side */
270270            }
271271
272            screen.machine().scheduler().timer_set(screen.time_until_pos(y, x), FUNC(tank8_collision_callback), index);
272            machine().scheduler().timer_set(screen.time_until_pos(y, x), FUNC(tank8_collision_callback), index);
273273
274274            _state = 1;
275275         }
trunk/src/mame/video/jackal.c
r17988r17989
225225
226226UINT32 jackal_state::screen_update_jackal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
227227{
228   set_pens(screen.machine());
229   draw_background(screen.machine(), bitmap, cliprect);
230   draw_sprites(screen.machine(), bitmap, cliprect);
228   set_pens(machine());
229   draw_background(machine(), bitmap, cliprect);
230   draw_sprites(machine(), bitmap, cliprect);
231231   return 0;
232232}
trunk/src/mame/video/suna8.c
r17988r17989
434434
435435#ifdef MAME_DEBUG
436436#if TILEMAPS
437   if (screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X))
437   if (machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X))
438438   {
439439      int max_tiles = memregion("gfx1")->bytes() / (0x400 * 0x20);
440440
441      if (screen.machine().input().code_pressed_once(KEYCODE_Q))   { m_page--;   screen.machine().tilemap().mark_all_dirty();   }
442      if (screen.machine().input().code_pressed_once(KEYCODE_W))   { m_page++;   screen.machine().tilemap().mark_all_dirty();   }
443      if (screen.machine().input().code_pressed_once(KEYCODE_E))   { m_tiles--;   screen.machine().tilemap().mark_all_dirty();   }
444      if (screen.machine().input().code_pressed_once(KEYCODE_R))   { m_tiles++;   screen.machine().tilemap().mark_all_dirty();   }
445      if (screen.machine().input().code_pressed_once(KEYCODE_A))   { m_trombank--;   screen.machine().tilemap().mark_all_dirty();   }
446      if (screen.machine().input().code_pressed_once(KEYCODE_S))   { m_trombank++;   screen.machine().tilemap().mark_all_dirty();   }
441      if (machine().input().code_pressed_once(KEYCODE_Q))   { m_page--;   machine().tilemap().mark_all_dirty();   }
442      if (machine().input().code_pressed_once(KEYCODE_W))   { m_page++;   machine().tilemap().mark_all_dirty();   }
443      if (machine().input().code_pressed_once(KEYCODE_E))   { m_tiles--;   machine().tilemap().mark_all_dirty();   }
444      if (machine().input().code_pressed_once(KEYCODE_R))   { m_tiles++;   machine().tilemap().mark_all_dirty();   }
445      if (machine().input().code_pressed_once(KEYCODE_A))   { m_trombank--;   machine().tilemap().mark_all_dirty();   }
446      if (machine().input().code_pressed_once(KEYCODE_S))   { m_trombank++;   machine().tilemap().mark_all_dirty();   }
447447
448448      m_rombank  &= 0xf;
449449      m_page  &= (m_text_dim > 0)?3:7;
r17988r17989
463463#endif
464464#endif
465465   {
466      draw_normal_sprites(screen.machine() ,bitmap,cliprect);
467      draw_text_sprites(screen.machine(), bitmap,cliprect);
466      draw_normal_sprites(machine() ,bitmap,cliprect);
467      draw_text_sprites(machine(), bitmap,cliprect);
468468   }
469469   return 0;
470470}
trunk/src/mame/video/namcos86.c
r17988r17989
356356   /* flip screen is embedded in the sprite control registers */
357357   /* can't use flip_screen_set() because the visible area is asymmetrical */
358358   flip_screen_set_no_update(m_spriteram[0x07f6] & 1);
359   screen.machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
360   set_scroll(screen.machine(), 0);
361   set_scroll(screen.machine(), 1);
362   set_scroll(screen.machine(), 2);
363   set_scroll(screen.machine(), 3);
359   machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
360   set_scroll(machine(), 0);
361   set_scroll(machine(), 1);
362   set_scroll(machine(), 2);
363   set_scroll(machine(), 3);
364364
365   screen.machine().priority_bitmap.fill(0, cliprect);
365   machine().priority_bitmap.fill(0, cliprect);
366366
367   bitmap.fill(screen.machine().gfx[0]->colorbase() + 8*m_backcolor+7, cliprect);
367   bitmap.fill(machine().gfx[0]->colorbase() + 8*m_backcolor+7, cliprect);
368368
369369   for (layer = 0;layer < 8;layer++)
370370   {
r17988r17989
377377      }
378378   }
379379
380   draw_sprites(screen.machine(),bitmap,cliprect);
380   draw_sprites(machine(),bitmap,cliprect);
381381   return 0;
382382}
383383
trunk/src/mame/video/vaportra.c
r17988r17989
5252
5353UINT32 vaportra_state::screen_update_vaportra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5454{
55   address_space &space = screen.machine().driver_data()->generic_space();
55   address_space &space = machine().driver_data()->generic_space();
5656   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
5757   int pri = m_priority[0] & 0x03;
5858
r17988r17989
6060   deco16ic_pf_update(m_deco_tilegen1, 0, 0);
6161   deco16ic_pf_update(m_deco_tilegen2, 0, 0);
6262
63   screen.machine().device<deco_mxc06_device>("spritegen")->set_pri_type(1); // force priorities to be handled in a different way for this driver for now
63   machine().device<deco_mxc06_device>("spritegen")->set_pri_type(1); // force priorities to be handled in a different way for this driver for now
6464
6565   /* Draw playfields */
6666   if (pri == 0)
6767   {
6868      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
6969      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
70      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
70      machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
7171      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
7272   }
7373   else if (pri == 1)
7474   {
7575      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
7676      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
77      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
77      machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
7878      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
7979   }
8080   else if (pri == 2)
8181   {
8282      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
8383      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
84      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
84      machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
8585      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
8686   }
8787   else
8888   {
8989      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
9090      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
91      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
91      machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
9292      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
9393   }
9494
95   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram->buffer(), 1, m_priority[1], 0x0f);
95   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 1, m_priority[1], 0x0f);
9696   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
9797   return 0;
9898}
trunk/src/mame/video/btime.c
r17988r17989
429429         start = (start + 1) & 0x03;
430430      }
431431
432      draw_background(screen.machine(), bitmap, cliprect, m_btime_tilemap, 0);
433      draw_chars(screen.machine(), bitmap, cliprect, TRUE, 0, -1);
432      draw_background(machine(), bitmap, cliprect, m_btime_tilemap, 0);
433      draw_chars(machine(), bitmap, cliprect, TRUE, 0, -1);
434434   }
435435   else
436      draw_chars(screen.machine(), bitmap, cliprect, FALSE, 0, -1);
436      draw_chars(machine(), bitmap, cliprect, FALSE, 0, -1);
437437
438   draw_sprites(screen.machine(), bitmap, cliprect, 0, 1, 0, m_videoram, 0x20);
438   draw_sprites(machine(), bitmap, cliprect, 0, 1, 0, m_videoram, 0x20);
439439
440440   return 0;
441441}
r17988r17989
443443
444444UINT32 btime_state::screen_update_eggs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
445445{
446   draw_chars(screen.machine(), bitmap, cliprect, FALSE, 0, -1);
447   draw_sprites(screen.machine(), bitmap, cliprect, 0, 0, 0, m_videoram, 0x20);
446   draw_chars(machine(), bitmap, cliprect, FALSE, 0, -1);
447   draw_sprites(machine(), bitmap, cliprect, 0, 0, 0, m_videoram, 0x20);
448448
449449   return 0;
450450}
r17988r17989
452452
453453UINT32 btime_state::screen_update_lnc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
454454{
455   draw_chars(screen.machine(), bitmap, cliprect, FALSE, 0, -1);
456   draw_sprites(screen.machine(), bitmap, cliprect, 0, 1, 2, m_videoram, 0x20);
455   draw_chars(machine(), bitmap, cliprect, FALSE, 0, -1);
456   draw_sprites(machine(), bitmap, cliprect, 0, 1, 2, m_videoram, 0x20);
457457
458458   return 0;
459459}
r17988r17989
463463{
464464   if (m_bnj_scroll1 & 0x04)
465465   {
466      draw_background(screen.machine(), bitmap, cliprect, m_zoar_scrollram, m_btime_palette);
467      draw_chars(screen.machine(), bitmap, cliprect, TRUE, m_btime_palette + 1, -1);
466      draw_background(machine(), bitmap, cliprect, m_zoar_scrollram, m_btime_palette);
467      draw_chars(machine(), bitmap, cliprect, TRUE, m_btime_palette + 1, -1);
468468   }
469469   else
470      draw_chars(screen.machine(), bitmap, cliprect, FALSE, m_btime_palette + 1, -1);
470      draw_chars(machine(), bitmap, cliprect, FALSE, m_btime_palette + 1, -1);
471471
472472   /* The order is important for correct priorities */
473   draw_sprites(screen.machine(), bitmap, cliprect, m_btime_palette + 1, 1, 2, m_videoram + 0x1f, 0x20);
474   draw_sprites(screen.machine(), bitmap, cliprect, m_btime_palette + 1, 1, 2, m_videoram, 0x20);
473   draw_sprites(machine(), bitmap, cliprect, m_btime_palette + 1, 1, 2, m_videoram + 0x1f, 0x20);
474   draw_sprites(machine(), bitmap, cliprect, m_btime_palette + 1, 1, 2, m_videoram, 0x20);
475475
476476   return 0;
477477}
r17988r17989
497497            sy = 256 - sy;
498498         }
499499
500         drawgfx_opaque(*m_background_bitmap, m_background_bitmap->cliprect(), screen.machine().gfx[2],
500         drawgfx_opaque(*m_background_bitmap, m_background_bitmap->cliprect(), machine().gfx[2],
501501               (m_bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32,
502502               0,
503503               flip_screen(), flip_screen(),
r17988r17989
512512
513513      /* copy the low priority characters followed by the sprites
514514           then the high priority characters */
515      draw_chars(screen.machine(), bitmap, cliprect, TRUE, 0, 1);
516      draw_sprites(screen.machine(), bitmap, cliprect, 0, 0, 0, m_videoram, 0x20);
517      draw_chars(screen.machine(), bitmap, cliprect, TRUE, 0, 0);
515      draw_chars(machine(), bitmap, cliprect, TRUE, 0, 1);
516      draw_sprites(machine(), bitmap, cliprect, 0, 0, 0, m_videoram, 0x20);
517      draw_chars(machine(), bitmap, cliprect, TRUE, 0, 0);
518518   }
519519   else
520520   {
521      draw_chars(screen.machine(), bitmap, cliprect, FALSE, 0, -1);
522      draw_sprites(screen.machine(), bitmap, cliprect, 0, 0, 0, m_videoram, 0x20);
521      draw_chars(machine(), bitmap, cliprect, FALSE, 0, -1);
522      draw_sprites(machine(), bitmap, cliprect, 0, 0, 0, m_videoram, 0x20);
523523   }
524524
525525   return 0;
r17988r17989
543543         sy = 33 - sy;
544544      }
545545
546      drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[2],
546      drawgfx_opaque(bitmap, cliprect, machine().gfx[2],
547547            m_bnj_backgroundram[offs],
548548            0,
549549            flip_screen(), flip_screen(),
550550            8*sx,8*sy);
551551   }
552552
553   draw_chars(screen.machine(), bitmap, cliprect, TRUE, 0, -1);
554   draw_sprites(screen.machine(), bitmap, cliprect, 0, 1, 0, m_videoram, 0x20);
553   draw_chars(machine(), bitmap, cliprect, TRUE, 0, -1);
554   draw_sprites(machine(), bitmap, cliprect, 0, 1, 0, m_videoram, 0x20);
555555
556556   return 0;
557557}
r17988r17989
559559
560560UINT32 btime_state::screen_update_disco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
561561{
562   draw_chars(screen.machine(), bitmap, cliprect, FALSE, m_btime_palette, -1);
563   draw_sprites(screen.machine(), bitmap, cliprect, m_btime_palette, 0, 0, m_spriteram, 1);
562   draw_chars(machine(), bitmap, cliprect, FALSE, m_btime_palette, -1);
563   draw_sprites(machine(), bitmap, cliprect, m_btime_palette, 0, 0, m_spriteram, 1);
564564
565565   return 0;
566566}
trunk/src/mame/video/qdrmfgp.c
r17988r17989
5959
6060UINT32 qdrmfgp_state::screen_update_qdrmfgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6161{
62   device_t *k056832 = screen.machine().device("k056832");
63   bitmap.fill(get_black_pen(screen.machine()), cliprect);
62   device_t *k056832 = machine().device("k056832");
63   bitmap.fill(get_black_pen(machine()), cliprect);
6464
6565   k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 1);
6666   k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 2);
trunk/src/mame/video/nova2001.c
r17988r17989
343343{
344344   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
345345
346   nova2001_draw_sprites(screen.machine(), bitmap, cliprect);
346   nova2001_draw_sprites(machine(), bitmap, cliprect);
347347
348348   // according to the schematics, fg category 0 should be drawn behind sprites,
349349   // but it doesn't look right that way
r17988r17989
357357{
358358   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
359359
360   pkunwar_draw_sprites(screen.machine(), bitmap, cliprect);
360   pkunwar_draw_sprites(machine(), bitmap, cliprect);
361361
362362   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
363363
r17988r17989
370370
371371   m_fg_tilemap->draw(bitmap, cliprect, 1, 0);
372372
373   nova2001_draw_sprites(screen.machine(), bitmap, cliprect);
373   nova2001_draw_sprites(machine(), bitmap, cliprect);
374374
375375   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
376376
r17988r17989
381381{
382382   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
383383
384   pkunwar_draw_sprites(screen.machine(), bitmap, cliprect);
384   pkunwar_draw_sprites(machine(), bitmap, cliprect);
385385
386386   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
387387
trunk/src/mame/video/starcrus.c
r17988r17989
408408   /* Draw ship 1 */
409409   drawgfx_transpen(bitmap,
410410         cliprect,
411         screen.machine().gfx[8+((m_s1_sprite&0x04)>>2)],
411         machine().gfx[8+((m_s1_sprite&0x04)>>2)],
412412         (m_s1_sprite&0x03)^0x03,
413413         0,
414414         (m_s1_sprite&0x08)>>3, (m_s1_sprite&0x10)>>4,
r17988r17989
418418   /* Draw ship 2 */
419419   drawgfx_transpen(bitmap,
420420         cliprect,
421         screen.machine().gfx[10+((m_s2_sprite&0x04)>>2)],
421         machine().gfx[10+((m_s2_sprite&0x04)>>2)],
422422         (m_s2_sprite&0x03)^0x03,
423423         0,
424424         (m_s2_sprite&0x08)>>3, (m_s2_sprite&0x10)>>4,
r17988r17989
428428   /* Draw score/projectile 1 */
429429   drawgfx_transpen(bitmap,
430430         cliprect,
431         screen.machine().gfx[(m_p1_sprite&0x0c)>>2],
431         machine().gfx[(m_p1_sprite&0x0c)>>2],
432432         (m_p1_sprite&0x03)^0x03,
433433         0,
434434         0,0,
r17988r17989
438438   /* Draw score/projectile 2 */
439439   drawgfx_transpen(bitmap,
440440         cliprect,
441         screen.machine().gfx[4+((m_p2_sprite&0x0c)>>2)],
441         machine().gfx[4+((m_p2_sprite&0x0c)>>2)],
442442         (m_p2_sprite&0x03)^0x03,
443443         0,
444444         0,0,
r17988r17989
451451      m_collision_reg = 0x00;
452452
453453      /* Check for collisions between ship1 and ship2 */
454      if (collision_check_s1s2(screen.machine()))
454      if (collision_check_s1s2(machine()))
455455      {
456456         m_collision_reg |= 0x08;
457457      }
458458      /* Check for collisions between ship1 and projectiles */
459      if (collision_check_s1p1p2(screen.machine()))
459      if (collision_check_s1p1p2(machine()))
460460      {
461461         m_collision_reg |= 0x02;
462462      }
463463      /* Check for collisions between ship1 and projectiles */
464      if (collision_check_s2p1p2(screen.machine()))
464      if (collision_check_s2p1p2(machine()))
465465      {
466466         m_collision_reg |= 0x01;
467467      }
468468      /* Check for collisions between ship1 and projectiles */
469469      /* Note: I don't think this is used by the game */
470      if (collision_check_p1p2(screen.machine()))
470      if (collision_check_p1p2(machine()))
471471      {
472472         m_collision_reg |= 0x04;
473473      }
trunk/src/mame/video/cps1.c
r17988r17989
28002800   layercontrol = m_cps_b_regs[m_game_config->layer_control / 2];
28012801
28022802   /* Get video memory base registers */
2803   cps1_get_video_base(screen.machine());
2803   cps1_get_video_base(machine());
28042804
28052805   /* Find the offset of the last sprite in the sprite table */
2806   cps1_find_last_sprite(screen.machine());
2806   cps1_find_last_sprite(machine());
28072807
28082808   if (m_cps_version == 2)
28092809   {
2810      cps2_find_last_sprite(screen.machine());
2810      cps2_find_last_sprite(machine());
28112811   }
28122812
2813   cps1_update_transmasks(screen.machine());
2813   cps1_update_transmasks(machine());
28142814
28152815   m_bg_tilemap[0]->set_scrollx(0, m_scroll1x);
28162816   m_bg_tilemap[0]->set_scrolly(0, m_scroll1y);
r17988r17989
28522852      // Maybe Capcom changed the background handling due to the problems that
28532853      // it caused on several monitors (because the background extended into the
28542854      // blanking area instead of going black, causing the monitor to clip).
2855      bitmap.fill(get_black_pen(screen.machine()), cliprect);
2855      bitmap.fill(get_black_pen(machine()), cliprect);
28562856   }
28572857
28582858   cps1_render_stars(screen, bitmap, cliprect);
r17988r17989
28622862   l1 = (layercontrol >> 0x08) & 03;
28632863   l2 = (layercontrol >> 0x0a) & 03;
28642864   l3 = (layercontrol >> 0x0c) & 03;
2865   screen.machine().priority_bitmap.fill(0, cliprect);
2865   machine().priority_bitmap.fill(0, cliprect);
28662866
28672867   if (m_cps_version == 1)
28682868   {
2869      cps1_render_layer(screen.machine(), bitmap, cliprect, l0, 0);
2869      cps1_render_layer(machine(), bitmap, cliprect, l0, 0);
28702870
28712871      if (l1 == 0)
2872         cps1_render_high_layer(screen.machine(), bitmap, cliprect, l0); /* prepare mask for sprites */
2872         cps1_render_high_layer(machine(), bitmap, cliprect, l0); /* prepare mask for sprites */
28732873
2874      cps1_render_layer(screen.machine(), bitmap, cliprect, l1, 0);
2874      cps1_render_layer(machine(), bitmap, cliprect, l1, 0);
28752875
28762876      if (l2 == 0)
2877         cps1_render_high_layer(screen.machine(), bitmap, cliprect, l1); /* prepare mask for sprites */
2877         cps1_render_high_layer(machine(), bitmap, cliprect, l1); /* prepare mask for sprites */
28782878
2879      cps1_render_layer(screen.machine(), bitmap, cliprect, l2, 0);
2879      cps1_render_layer(machine(), bitmap, cliprect, l2, 0);
28802880
28812881      if (l3 == 0)
2882         cps1_render_high_layer(screen.machine(), bitmap, cliprect, l2); /* prepare mask for sprites */
2882         cps1_render_high_layer(machine(), bitmap, cliprect, l2); /* prepare mask for sprites */
28832883
2884      cps1_render_layer(screen.machine(), bitmap, cliprect, l3, 0);
2884      cps1_render_layer(machine(), bitmap, cliprect, l3, 0);
28852885   }
28862886   else
28872887   {
r17988r17989
28932893      l3pri = (m_pri_ctrl >> 4 * l3) & 0x0f;
28942894
28952895#if 0
2896if (   (cps2_port(screen.machine(), CPS2_OBJ_BASE) != 0x7080 && cps2_port(screen.machine(), CPS2_OBJ_BASE) != 0x7000) ||
2897      cps2_port(screen.machine(), CPS2_OBJ_UK1) != 0x807d ||
2898      (cps2_port(screen.machine(), CPS2_OBJ_UK2) != 0x0000 && cps2_port(screen.machine(), CPS2_OBJ_UK2) != 0x1101 && cps2_port(screen.machine(), CPS2_OBJ_UK2) != 0x0001))
2896if (   (cps2_port(machine(), CPS2_OBJ_BASE) != 0x7080 && cps2_port(machine(), CPS2_OBJ_BASE) != 0x7000) ||
2897      cps2_port(machine(), CPS2_OBJ_UK1) != 0x807d ||
2898      (cps2_port(machine(), CPS2_OBJ_UK2) != 0x0000 && cps2_port(machine(), CPS2_OBJ_UK2) != 0x1101 && cps2_port(machine(), CPS2_OBJ_UK2) != 0x0001))
28992899   popmessage("base %04x uk1 %04x uk2 %04x",
2900         cps2_port(screen.machine(), CPS2_OBJ_BASE),
2901         cps2_port(screen.machine(), CPS2_OBJ_UK1),
2902         cps2_port(screen.machine(), CPS2_OBJ_UK2));
2900         cps2_port(machine(), CPS2_OBJ_BASE),
2901         cps2_port(machine(), CPS2_OBJ_UK1),
2902         cps2_port(machine(), CPS2_OBJ_UK2));
29032903
2904if (0 && screen.machine().input().code_pressed(KEYCODE_Z))
2904if (0 && machine().input().code_pressed(KEYCODE_Z))
29052905   popmessage("order: %d (%d) %d (%d) %d (%d) %d (%d)",l0,l0pri,l1,l1pri,l2,l2pri,l3,l3pri);
29062906#endif
29072907
r17988r17989
29322932         }
29332933      }
29342934
2935      cps1_render_layer(screen.machine(), bitmap, cliprect, l0, 1);
2936      cps1_render_layer(screen.machine(), bitmap, cliprect, l1, 2);
2937      cps1_render_layer(screen.machine(), bitmap, cliprect, l2, 4);
2938      cps2_render_sprites(screen.machine(), bitmap, cliprect, primasks);
2935      cps1_render_layer(machine(), bitmap, cliprect, l0, 1);
2936      cps1_render_layer(machine(), bitmap, cliprect, l1, 2);
2937      cps1_render_layer(machine(), bitmap, cliprect, l2, 4);
2938      cps2_render_sprites(machine(), bitmap, cliprect, primasks);
29392939   }
29402940
29412941   return 0;
r17988r17989
29482948   {
29492949
29502950      /* Get video memory base registers */
2951      cps1_get_video_base(screen.machine());
2951      cps1_get_video_base(machine());
29522952
29532953      if (m_cps_version == 1)
29542954      {
trunk/src/mame/video/yunsun16.c
r17988r17989
206206
207207   //popmessage("%04X", *m_priorityram);
208208
209   screen.machine().priority_bitmap.fill(0, cliprect);
209   machine().priority_bitmap.fill(0, cliprect);
210210
211211   if ((*m_priorityram & 0x0c) == 4)
212212   {
r17988r17989
223223      m_tilemap_0->draw(bitmap, cliprect, 0, 2);
224224   }
225225
226   draw_sprites(screen.machine(), bitmap, cliprect);
226   draw_sprites(machine(), bitmap, cliprect);
227227   return 0;
228228}
trunk/src/mame/video/wiz.c
r17988r17989
204204UINT32 wiz_state::screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
205205{
206206   bitmap.fill(m_bgpen, cliprect);
207   draw_background(screen.machine(), bitmap, cliprect, 2 + m_char_bank[0] , 0);
208   draw_foreground(screen.machine(), bitmap, cliprect, 0);
209   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram2, 4);
210   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram  , 5);
207   draw_background(machine(), bitmap, cliprect, 2 + m_char_bank[0] , 0);
208   draw_foreground(machine(), bitmap, cliprect, 0);
209   draw_sprites(machine(), bitmap, cliprect, m_spriteram2, 4);
210   draw_sprites(machine(), bitmap, cliprect, m_spriteram  , 5);
211211   return 0;
212212}
213213
r17988r17989
216216   int bank;
217217
218218   bitmap.fill(m_bgpen, cliprect);
219   draw_background(screen.machine(), bitmap, cliprect, 2 + ((m_char_bank[0] << 1) | m_char_bank[1]), 0);
220   draw_foreground(screen.machine(), bitmap, cliprect, 0);
219   draw_background(machine(), bitmap, cliprect, 2 + ((m_char_bank[0] << 1) | m_char_bank[1]), 0);
220   draw_foreground(machine(), bitmap, cliprect, 0);
221221
222222   const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1);
223223   const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1);
r17988r17989
225225
226226   bank = 7 + *m_sprite_bank;
227227
228   draw_sprites(screen.machine(), bitmap, visible_area, m_spriteram2, 6);
229   draw_sprites(screen.machine(), bitmap, visible_area, m_spriteram  , bank);
228   draw_sprites(machine(), bitmap, visible_area, m_spriteram2, 6);
229   draw_sprites(machine(), bitmap, visible_area, m_spriteram  , bank);
230230   return 0;
231231}
232232
r17988r17989
234234UINT32 wiz_state::screen_update_stinger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
235235{
236236   bitmap.fill(m_bgpen, cliprect);
237   draw_background(screen.machine(), bitmap, cliprect, 2 + m_char_bank[0], 1);
238   draw_foreground(screen.machine(), bitmap, cliprect, 1);
239   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram2, 4);
240   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram  , 5);
237   draw_background(machine(), bitmap, cliprect, 2 + m_char_bank[0], 1);
238   draw_foreground(machine(), bitmap, cliprect, 1);
239   draw_sprites(machine(), bitmap, cliprect, m_spriteram2, 4);
240   draw_sprites(machine(), bitmap, cliprect, m_spriteram  , 5);
241241   return 0;
242242}
trunk/src/mame/video/stactics.c
r17988r17989
386386
387387   update_beam(this);
388388   draw_background(this, bitmap, cliprect);
389   update_artwork(screen.machine(), this);
389   update_artwork(machine(), this);
390390
391391   m_frame_count = (m_frame_count + 1) & 0x0f;
392392
trunk/src/mame/video/mermaid.c
r17988r17989
226226
227227   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
228228   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
229   draw_sprites(screen.machine(), bitmap, cliprect);
229   draw_sprites(machine(), bitmap, cliprect);
230230   return 0;
231231}
232232
r17988r17989
257257   // rising edge
258258   if (state)
259259   {
260      const rectangle &visarea = screen.machine().primary_screen->visible_area();
260      const rectangle &visarea = machine().primary_screen->visible_area();
261261      UINT8 *spriteram = m_spriteram;
262262
263263      int offs, offs2;
r17988r17989
302302
303303         rect.min_x = sx;
304304         rect.min_y = sy;
305         rect.max_x = sx + screen.machine().gfx[1]->width() - 1;
306         rect.max_y = sy + screen.machine().gfx[1]->height() - 1;
305         rect.max_x = sx + machine().gfx[1]->width() - 1;
306         rect.max_y = sy + machine().gfx[1]->height() - 1;
307307
308308         rect &= visarea;
309309
r17988r17989
314314
315315         m_bg_tilemap->draw(m_helper, rect, 0, 0);
316316
317         drawgfx_transpen(m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
317         drawgfx_transpen(m_helper2, rect, machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
318318
319         m_coll_bit2 |= collision_check(screen.machine(), rect);
319         m_coll_bit2 |= collision_check(machine(), rect);
320320
321321         // check collision sprite - foreground
322322
r17988r17989
325325
326326         m_fg_tilemap->draw(m_helper, rect, 0, 0);
327327
328         drawgfx_transpen(m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
328         drawgfx_transpen(m_helper2, rect, machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
329329
330         m_coll_bit1 |= collision_check(screen.machine(), rect);
330         m_coll_bit1 |= collision_check(machine(), rect);
331331
332332         // check collision sprite - sprite
333333
r17988r17989
363363                  sy2 = 240 - sy2;
364364               }
365365
366               drawgfx_transpen(m_helper, rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
366               drawgfx_transpen(m_helper, rect, machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
367367            }
368368
369         drawgfx_transpen(m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
369         drawgfx_transpen(m_helper2, rect, machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
370370
371         m_coll_bit0 |= collision_check(screen.machine(), rect);
371         m_coll_bit0 |= collision_check(machine(), rect);
372372      }
373373
374374      // check for bit 3 (sprite-sprite)
r17988r17989
405405
406406         rect.min_x = sx;
407407         rect.min_y = sy;
408         rect.max_x = sx + screen.machine().gfx[1]->width() - 1;
409         rect.max_y = sy + screen.machine().gfx[1]->height() - 1;
408         rect.max_x = sx + machine().gfx[1]->width() - 1;
409         rect.max_y = sy + machine().gfx[1]->height() - 1;
410410
411411         rect &= visarea;
412412
r17988r17989
444444                  sy2 = 240 - sy2;
445445               }
446446
447               drawgfx_transpen(m_helper, rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
447               drawgfx_transpen(m_helper, rect, machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
448448            }
449449
450         drawgfx_transpen(m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
450         drawgfx_transpen(m_helper2, rect, machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
451451
452         m_coll_bit3 |= collision_check(screen.machine(), rect);
452         m_coll_bit3 |= collision_check(machine(), rect);
453453      }
454454
455455      // check for bit 6
r17988r17989
486486
487487         rect.min_x = sx;
488488         rect.min_y = sy;
489         rect.max_x = sx + screen.machine().gfx[1]->width() - 1;
490         rect.max_y = sy + screen.machine().gfx[1]->height() - 1;
489         rect.max_x = sx + machine().gfx[1]->width() - 1;
490         rect.max_y = sy + machine().gfx[1]->height() - 1;
491491
492492         rect &= visarea;
493493
r17988r17989
525525                  sy2 = 240 - sy2;
526526               }
527527
528               drawgfx_transpen(m_helper, rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
528               drawgfx_transpen(m_helper, rect, machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
529529            }
530530
531         drawgfx_transpen(m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
531         drawgfx_transpen(m_helper2, rect, machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
532532
533         m_coll_bit6 |= collision_check(screen.machine(), rect);
533         m_coll_bit6 |= collision_check(machine(), rect);
534534      }
535535   }
536536}
trunk/src/mame/video/gaelco3d.c
r17988r17989
432432   int ret;
433433
434434/*
435    if (DISPLAY_TEXTURE && (screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X)))
435    if (DISPLAY_TEXTURE && (machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X)))
436436    {
437437        static int xv = 0, yv = 0x1000;
438438        UINT8 *base = m_texture;
439439        int length = m_texture_size;
440440
441        if (screen.machine().input().code_pressed(KEYCODE_X))
441        if (machine().input().code_pressed(KEYCODE_X))
442442        {
443443            base = m_texmask;
444444            length = m_texmask_size;
445445        }
446446
447        if (screen.machine().input().code_pressed(KEYCODE_LEFT) && xv >= 4)
447        if (machine().input().code_pressed(KEYCODE_LEFT) && xv >= 4)
448448            xv -= 4;
449        if (screen.machine().input().code_pressed(KEYCODE_RIGHT) && xv < 4096 - 4)
449        if (machine().input().code_pressed(KEYCODE_RIGHT) && xv < 4096 - 4)
450450            xv += 4;
451451
452        if (screen.machine().input().code_pressed(KEYCODE_UP) && yv >= 4)
452        if (machine().input().code_pressed(KEYCODE_UP) && yv >= 4)
453453            yv -= 4;
454        if (screen.machine().input().code_pressed(KEYCODE_DOWN) && yv < 0x40000)
454        if (machine().input().code_pressed(KEYCODE_DOWN) && yv < 0x40000)
455455            yv += 4;
456456
457457        for (y = cliprect.min_y; y <= cliprect.max_y; y++)
trunk/src/mame/video/dcon.c
r17988r17989
267267
268268UINT32 dcon_state::screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
269269{
270   screen.machine().priority_bitmap.fill(0, cliprect);
270   machine().priority_bitmap.fill(0, cliprect);
271271
272272   /* Setup the tilemaps */
273273   m_background_layer->set_scrollx(0, m_scroll_ram[0] );
r17988r17989
286286   m_foreground_layer->draw(bitmap, cliprect, 0,2);
287287   m_text_layer->draw(bitmap, cliprect, 0,4);
288288
289   draw_sprites(screen.machine(),bitmap,cliprect);
289   draw_sprites(machine(),bitmap,cliprect);
290290   return 0;
291291}
292292
293293UINT32 dcon_state::screen_update_sdgndmps(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
294294{
295295
296   screen.machine().priority_bitmap.fill(0, cliprect);
296   machine().priority_bitmap.fill(0, cliprect);
297297
298298   /* Gfx banking */
299299   if (m_last_gfx_bank!=m_gfx_bank_select)
r17988r17989
321321   m_foreground_layer->draw(bitmap, cliprect, 0,2);
322322   m_text_layer->draw(bitmap, cliprect, 0,4);
323323
324   draw_sprites(screen.machine(),bitmap,cliprect);
324   draw_sprites(machine(),bitmap,cliprect);
325325   return 0;
326326}
trunk/src/mame/video/itech8.c
r17988r17989
607607   struct tms34061_display &tms_state = m_tms_state;
608608   UINT32 page_offset;
609609   int x, y;
610   const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
610   const rgb_t *pens = tlc34076_get_pens(machine().device("tlc34076"));
611611
612612   /* first get the current display state */
613613   tms34061_get_display_state(&tms_state);
r17988r17989
615615   /* if we're blanked, just fill with black */
616616   if (tms_state.blanked)
617617   {
618      bitmap.fill(get_black_pen(screen.machine()), cliprect);
618      bitmap.fill(get_black_pen(machine()), cliprect);
619619      return 0;
620620   }
621621
r17988r17989
651651   /* if we're blanked, just fill with black */
652652   if (tms_state.blanked)
653653   {
654      bitmap.fill(get_black_pen(screen.machine()), cliprect);
654      bitmap.fill(get_black_pen(machine()), cliprect);
655655      return 0;
656656   }
657657
r17988r17989
692692   struct tms34061_display &tms_state = m_tms_state;
693693   UINT32 page_offset;
694694   int x, y;
695   const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
695   const rgb_t *pens = tlc34076_get_pens(machine().device("tlc34076"));
696696
697697   /* first get the current display state */
698698   tms34061_get_display_state(&tms_state);
r17988r17989
700700   /* if we're blanked, just fill with black */
701701   if (tms_state.blanked)
702702   {
703      bitmap.fill(get_black_pen(screen.machine()), cliprect);
703      bitmap.fill(get_black_pen(machine()), cliprect);
704704      return 0;
705705   }
706706
r17988r17989
724724   struct tms34061_display &tms_state = m_tms_state;
725725   UINT32 page_offset;
726726   int x, y;
727   const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
727   const rgb_t *pens = tlc34076_get_pens(machine().device("tlc34076"));
728728
729729   /* first get the current display state */
730730   tms34061_get_display_state(&tms_state);
r17988r17989
732732   /* if we're blanked, just fill with black */
733733   if (tms_state.blanked)
734734   {
735      bitmap.fill(get_black_pen(screen.machine()), cliprect);
735      bitmap.fill(get_black_pen(machine()), cliprect);
736736      return 0;
737737   }
738738
trunk/src/mame/video/kickgoal.c
r17988r17989
175175   m_bg2tm->draw(bitmap, cliprect, 0, 0);
176176   m_bgtm->draw(bitmap, cliprect, 0, 0);
177177
178   kickgoal_draw_sprites(screen.machine(), bitmap, cliprect);
178   kickgoal_draw_sprites(machine(), bitmap, cliprect);
179179
180180   m_fgtm->draw(bitmap, cliprect, 0, 0);
181181
trunk/src/mame/video/galaxian.c
r17988r17989
453453UINT32 galaxian_state::screen_update_galaxian(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
454454{
455455   /* draw the background layer (including stars) */
456   (*m_draw_background_ptr)(screen.machine(), bitmap, cliprect);
456   (*m_draw_background_ptr)(machine(), bitmap, cliprect);
457457
458458   /* draw the tilemap characters over top */
459459   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
460460
461461   /* render the sprites next. Some custom pcbs (eg. zigzag, fantastc) have more than one sprite generator (ideally, this should be rendered in parallel) */
462462   for (int i = 0; i < m_numspritegens; i++)
463      sprites_draw(screen.machine(), bitmap, cliprect, &m_spriteram[0x40 + i * 0x20]);
463      sprites_draw(machine(), bitmap, cliprect, &m_spriteram[0x40 + i * 0x20]);
464464
465465   /* if we have bullets to draw, render them following */
466466   if (m_draw_bullet_ptr != NULL)
467      bullets_draw(screen.machine(), bitmap, cliprect, &m_spriteram[m_bullets_base]);
467      bullets_draw(machine(), bitmap, cliprect, &m_spriteram[m_bullets_base]);
468468
469469   return 0;
470470}
trunk/src/mame/video/othldrby.c
r17988r17989
194194      }
195195   }
196196
197   screen.machine().priority_bitmap.fill(0, cliprect);
197   machine().priority_bitmap.fill(0, cliprect);
198198
199199   bitmap.fill(0, cliprect);
200200
201201   for (layer = 0; layer < 3; layer++)
202202      m_bg_tilemap[layer]->draw(bitmap, cliprect, 0, 0);
203   draw_sprites(screen.machine(), bitmap, cliprect, 0);
203   draw_sprites(machine(), bitmap, cliprect, 0);
204204
205205   for (layer = 0; layer < 3; layer++)
206206      m_bg_tilemap[layer]->draw(bitmap, cliprect, 1, 0);
207   draw_sprites(screen.machine(), bitmap, cliprect, 1);
207   draw_sprites(machine(), bitmap, cliprect, 1);
208208
209209   for (layer = 0; layer < 3; layer++)
210210      m_bg_tilemap[layer]->draw(bitmap, cliprect, 2, 0);
211   draw_sprites(screen.machine(), bitmap, cliprect, 2);
211   draw_sprites(machine(), bitmap, cliprect, 2);
212212
213213   for (layer = 0; layer < 3; layer++)
214214      m_bg_tilemap[layer]->draw(bitmap, cliprect, 3, 0);
215   draw_sprites(screen.machine(), bitmap, cliprect, 3);
215   draw_sprites(machine(), bitmap, cliprect, 3);
216216
217217   return 0;
218218}
trunk/src/mame/video/bbusters.c
r17988r17989
280280   m_pf2_tilemap->set_scrolly(0, m_pf2_scroll_data[1]);
281281
282282   m_pf2_tilemap->draw(bitmap, cliprect, 0, 0);
283   //draw_sprites(screen.machine(), bitmap, m_spriteram2->buffer(), 2, 0x8, 0x8);
283   //draw_sprites(machine(), bitmap, m_spriteram2->buffer(), 2, 0x8, 0x8);
284284   m_pf1_tilemap->draw(bitmap, cliprect, 0, 0);
285   draw_sprites(screen.machine(), bitmap, m_spriteram2->buffer(), 2, 0, 0);
286   draw_sprites(screen.machine(), bitmap, m_spriteram->buffer(), 1, 0, 0);
285   draw_sprites(machine(), bitmap, m_spriteram2->buffer(), 2, 0, 0);
286   draw_sprites(machine(), bitmap, m_spriteram->buffer(), 1, 0, 0);
287287   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
288288   return 0;
289289}
r17988r17989
298298
299299   m_pf2_tilemap->draw(bitmap, cliprect, 0, 0);
300300   m_pf1_tilemap->draw(bitmap, cliprect, 0, 0);
301   draw_sprites(screen.machine(), bitmap, m_spriteram->buffer(), 1, 0, 0);
301   draw_sprites(machine(), bitmap, m_spriteram->buffer(), 1, 0, 0);
302302   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
303303   return 0;
304304}
trunk/src/mame/video/gstriker.c
r17988r17989
527527
528528UINT32 gstriker_state::screen_update_gstriker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
529529{
530   bitmap.fill(get_black_pen(screen.machine()), cliprect);
530   bitmap.fill(get_black_pen(machine()), cliprect);
531531
532532   // Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably
533533   //  needs sprite orthogonality
534   MB60553_draw(screen.machine(), 0, bitmap,cliprect, 0);
534   MB60553_draw(machine(), 0, bitmap,cliprect, 0);
535535
536   CG10103_draw(screen.machine(), 0, bitmap, cliprect, 0);
536   CG10103_draw(machine(), 0, bitmap, cliprect, 0);
537537
538538   VS920A_draw(this, 0, bitmap, cliprect, 0);
539539
540   CG10103_draw(screen.machine(), 0, bitmap, cliprect, 1);
540   CG10103_draw(machine(), 0, bitmap, cliprect, 1);
541541
542542#if 0
543543   popmessage("%04x %04x %04x %04x %04x %04x %04x %04x",
trunk/src/mame/video/snk.c
r17988r17989
949949   m_fg_tilemap->set_scrolly(0, m_fg_scrolly);
950950
951951   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
952   marvins_draw_sprites(screen.machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, 0, m_sprite_split_point>>2);
952   marvins_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, 0, m_sprite_split_point>>2);
953953   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
954   marvins_draw_sprites(screen.machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_sprite_split_point>>2, 25);
954   marvins_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_sprite_split_point>>2, 25);
955955   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
956956
957957   return 0;
r17988r17989
965965   m_bg_tilemap->set_scrolly(0, m_bg_scrolly);
966966
967967   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
968   tnk3_draw_sprites(screen.machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly);
968   tnk3_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly);
969969   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
970970
971971   return 0;
r17988r17989
980980
981981   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
982982
983   ikari_draw_sprites(screen.machine(), bitmap, cliprect,  0, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 );
984   ikari_draw_sprites(screen.machine(), bitmap, cliprect,  0, m_sp32_scrollx, m_sp32_scrolly, m_spriteram,         3 );
985   ikari_draw_sprites(screen.machine(), bitmap, cliprect, 25, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 );
983   ikari_draw_sprites(machine(), bitmap, cliprect,  0, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 );
984   ikari_draw_sprites(machine(), bitmap, cliprect,  0, m_sp32_scrollx, m_sp32_scrolly, m_spriteram,         3 );
985   ikari_draw_sprites(machine(), bitmap, cliprect, 25, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 );
986986
987987   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
988988   return 0;
r17988r17989
997997
998998   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
999999
1000   tdfever_draw_sprites(screen.machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, 0, m_sprite_split_point );
1001   tdfever_draw_sprites(screen.machine(), bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram,         3, 0, 0, 32 );
1002   tdfever_draw_sprites(screen.machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, m_sprite_split_point, 64 );
1000   tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, 0, m_sprite_split_point );
1001   tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram,         3, 0, 0, 32 );
1002   tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, m_sprite_split_point, 64 );
10031003
10041004   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
10051005
r17988r17989
10151015
10161016   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
10171017
1018   tdfever_draw_sprites(screen.machine(), bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, 1, 0, 32 );
1018   tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, 1, 0, 32 );
10191019
10201020   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
10211021
trunk/src/mame/video/hyprduel.c
r17988r17989
694694
695695      if (dirty)
696696      {
697         dirty_tiles(screen.machine(), 0, m_vram_0);
698         dirty_tiles(screen.machine(), 1, m_vram_1);
699         dirty_tiles(screen.machine(), 2, m_vram_2);
697         dirty_tiles(machine(), 0, m_vram_0);
698         dirty_tiles(machine(), 1, m_vram_1);
699         dirty_tiles(machine(), 2, m_vram_2);
700700      }
701701   }
702702
r17988r17989
704704   m_sprite_yoffs = m_videoregs[0x04 / 2] - screen.height() / 2 - m_sprite_yoffs_sub;
705705
706706   /* The background color is selected by a register */
707   screen.machine().priority_bitmap.fill(0, cliprect);
707   machine().priority_bitmap.fill(0, cliprect);
708708   bitmap.fill((m_videoregs[0x12 / 2] & 0x0fff) + 0x1000, cliprect);
709709
710710   /*  Screen Control Register:
r17988r17989
723723   flip_screen_set(screenctrl & 1);
724724
725725#if 0
726if (screen.machine().input().code_pressed(KEYCODE_Z))
726if (machine().input().code_pressed(KEYCODE_Z))
727727{   int msk = 0;
728   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 0x01;
729   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 0x02;
730   if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 0x04;
731   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 0x08;
728   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 0x01;
729   if (machine().input().code_pressed(KEYCODE_W))   msk |= 0x02;
730   if (machine().input().code_pressed(KEYCODE_E))   msk |= 0x04;
731   if (machine().input().code_pressed(KEYCODE_A))   msk |= 0x08;
732732   if (msk != 0)
733733   {
734734      bitmap.fill(0, cliprect);
r17988r17989
743743#endif
744744
745745   for (pri = 3; pri >= 0; pri--)
746      draw_layers(screen.machine(), bitmap, cliprect, pri, layers_ctrl);
746      draw_layers(machine(), bitmap, cliprect, pri, layers_ctrl);
747747
748748   if (layers_ctrl & 0x08)
749      draw_sprites(screen.machine(), bitmap, cliprect);
749      draw_sprites(machine(), bitmap, cliprect);
750750
751751   return 0;
752752}
trunk/src/mame/video/namconb1.c
r17988r17989
146146   /* intersect with master clip rectangle */
147147   clip &= cliprect;
148148
149   bitmap.fill(get_black_pen(screen.machine()), cliprect );
149   bitmap.fill(get_black_pen(machine()), cliprect );
150150
151   video_update_common( screen.machine(), bitmap, clip, 0 );
151   video_update_common( machine(), bitmap, clip, 0 );
152152
153153   return 0;
154154}
r17988r17989
183183   /* intersect with master clip rectangle */
184184   clip &= cliprect;
185185
186   bitmap.fill(get_black_pen(screen.machine()), cliprect );
186   bitmap.fill(get_black_pen(machine()), cliprect );
187187
188188   if( memcmp(m_tilemap_tile_bank,m_tilebank32,sizeof(m_tilemap_tile_bank))!=0 )
189189   {
190190      namco_tilemap_invalidate();
191191      memcpy(m_tilemap_tile_bank,m_tilebank32,sizeof(m_tilemap_tile_bank));
192192   }
193   video_update_common( screen.machine(), bitmap, clip, 1 );
193   video_update_common( machine(), bitmap, clip, 1 );
194194   return 0;
195195}
196196
trunk/src/mame/video/arcadecl.c
r17988r17989
8181{
8282
8383   /* draw the playfield */
84   arcadecl_bitmap_render(screen.machine(), bitmap, cliprect);
84   arcadecl_bitmap_render(machine(), bitmap, cliprect);
8585
8686   /* draw and merge the MO */
8787   if (m_has_mo)
trunk/src/mame/video/flstory.c
r17988r17989
208208{
209209   m_bg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER1, 0);
210210   m_bg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER1, 0);
211   flstory_draw_sprites(screen.machine(), bitmap, cliprect, 0x00);
211   flstory_draw_sprites(machine(), bitmap, cliprect, 0x00);
212212   m_bg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER0, 0);
213   flstory_draw_sprites(screen.machine(), bitmap, cliprect, 0x80);
213   flstory_draw_sprites(machine(), bitmap, cliprect, 0x80);
214214   m_bg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER0, 0);
215215   return 0;
216216}
r17988r17989
263263UINT32 flstory_state::screen_update_victnine(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
264264{
265265   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
266   victnine_draw_sprites(screen.machine(), bitmap, cliprect);
266   victnine_draw_sprites(machine(), bitmap, cliprect);
267267   return 0;
268268}
269269
r17988r17989
271271{
272272   m_bg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER1, 0);
273273   m_bg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER1, 0);
274   victnine_draw_sprites(screen.machine(), bitmap, cliprect);
274   victnine_draw_sprites(machine(), bitmap, cliprect);
275275   m_bg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER0, 0);
276   victnine_draw_sprites(screen.machine(), bitmap, cliprect);
276   victnine_draw_sprites(machine(), bitmap, cliprect);
277277   m_bg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER0, 0);
278278   return 0;
279279}
trunk/src/mame/video/suprslam.c
r17988r17989
151151{
152152   m_screen_tilemap->set_scrollx(0, m_screen_vregs[0x04/2] );
153153
154   bitmap.fill(get_black_pen(screen.machine()), cliprect);
154   bitmap.fill(get_black_pen(machine()), cliprect);
155155   k053936_zoom_draw(m_k053936, bitmap, cliprect, m_bg_tilemap, 0, 0, 1);
156156   if(!(m_spr_ctrl[0] & 8))
157      draw_sprites(screen.machine(), bitmap, cliprect);
157      draw_sprites(machine(), bitmap, cliprect);
158158   m_screen_tilemap->draw(bitmap, cliprect, 0, 0);
159159   if(m_spr_ctrl[0] & 8)
160      draw_sprites(screen.machine(), bitmap, cliprect);
160      draw_sprites(machine(), bitmap, cliprect);
161161   return 0;
162162}
163163
trunk/src/mame/video/strnskil.c
r17988r17989
142142   }
143143
144144   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
145   draw_sprites(screen.machine(), bitmap, cliprect);
145   draw_sprites(machine(), bitmap, cliprect);
146146   return 0;
147147}
trunk/src/mame/video/cosmic.c
r17988r17989
549549UINT32 cosmic_state::screen_update_cosmicg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
550550{
551551   bitmap.fill(0, cliprect);
552   draw_bitmap(screen.machine(), bitmap, cliprect);
552   draw_bitmap(machine(), bitmap, cliprect);
553553   return 0;
554554}
555555
r17988r17989
557557UINT32 cosmic_state::screen_update_panic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
558558{
559559   bitmap.fill(0, cliprect);
560   draw_bitmap(screen.machine(), bitmap, cliprect);
561   draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 1);
560   draw_bitmap(machine(), bitmap, cliprect);
561   draw_sprites(machine(), bitmap, cliprect, 0x07, 1);
562562   return 0;
563563}
564564
r17988r17989
567567{
568568   bitmap.fill(0, cliprect);
569569   cosmica_draw_starfield(screen, bitmap, cliprect);
570   draw_bitmap(screen.machine(), bitmap, cliprect);
571   draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0);
570   draw_bitmap(machine(), bitmap, cliprect);
571   draw_sprites(machine(), bitmap, cliprect, 0x0f, 0);
572572   return 0;
573573}
574574
r17988r17989
576576UINT32 cosmic_state::screen_update_magspot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
577577{
578578   bitmap.fill(0, cliprect);
579   draw_bitmap(screen.machine(), bitmap, cliprect);
580   draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0);
579   draw_bitmap(machine(), bitmap, cliprect);
580   draw_sprites(machine(), bitmap, cliprect, 0x07, 0);
581581   return 0;
582582}
583583
r17988r17989
588588   bitmap.fill(0, cliprect);
589589
590590   if (m_background_enable)
591      devzone_draw_grid(screen.machine(), bitmap, cliprect);
591      devzone_draw_grid(machine(), bitmap, cliprect);
592592
593   draw_bitmap(screen.machine(), bitmap, cliprect);
594   draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0);
593   draw_bitmap(machine(), bitmap, cliprect);
594   draw_sprites(machine(), bitmap, cliprect, 0x07, 0);
595595   return 0;
596596}
597597
r17988r17989
603603       have the highest priority */
604604
605605   bitmap.fill(0, cliprect);
606   draw_bitmap(screen.machine(), bitmap, cliprect);
607   draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0);
606   draw_bitmap(machine(), bitmap, cliprect);
607   draw_sprites(machine(), bitmap, cliprect, 0x07, 0);
608608
609609   if (m_background_enable)
610610      nomnlnd_draw_background(screen, bitmap, cliprect);
trunk/src/mame/video/shaolins.c
r17988r17989
190190{
191191
192192   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
193   draw_sprites(screen.machine(), bitmap, cliprect);
193   draw_sprites(machine(), bitmap, cliprect);
194194   return 0;
195195}
trunk/src/mame/video/model2.c
r17988r17989
27212721{
27222722   logerror("--- frame ---\n");
27232723
2724   bitmap.fill(screen.machine().pens[0], cliprect);
2724   bitmap.fill(machine().pens[0], cliprect);
27252725   m_sys24_bitmap.fill(0, cliprect);
27262726
2727   segas24_tile *tile = screen.machine().device<segas24_tile>("tile");
2727   segas24_tile *tile = machine().device<segas24_tile>("tile");
27282728   tile->draw(m_sys24_bitmap, cliprect, 7, 0, 0);
27292729   tile->draw(m_sys24_bitmap, cliprect, 6, 0, 0);
27302730   tile->draw(m_sys24_bitmap, cliprect, 5, 0, 0);
trunk/src/mame/video/sshangha.c
r17988r17989
3131UINT32 sshangha_state::screen_update_sshangha(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
3232{
3333
34   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram, 0x800, true);
34   machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram, 0x800, true);
3535
3636   // I'm pretty sure only the original has the 2nd spriteram, used for the Japanese text on the 2nd scene (non-scrolling text) in the intro of the quest (3rd in JPN) mode
3737   if (m_spriteram2 != NULL)
38      screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2, 0x800, true);
38      machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2, 0x800, true);
3939
40   screen.machine().tilemap().set_flip_all(flip_screen_x() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
40   machine().tilemap().set_flip_all(flip_screen_x() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
4141
42   bitmap.fill(get_black_pen(screen.machine()), cliprect);
42   bitmap.fill(get_black_pen(machine()), cliprect);
4343
4444   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
4545
4646   /* the tilemap 4bpp + 4bpp = 8bpp mixing actually seems external to the tilemap, note video_control is not part of the tilemap chip */
4747   if ((m_video_control&4)==0) {
4848      deco16ic_tilemap_12_combine_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0, 1);
49      screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
49      machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
5050   }
5151   else {
5252
5353      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
54      screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
54      machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
5555      deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
5656   }
5757
5858   if (m_spriteram2 != NULL)
59      screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0, 0x1ff);
59      machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0, 0x1ff);
6060
61   screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0200, 0, 0x1ff);
61   machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0200, 0, 0x1ff);
6262   return 0;
6363}
trunk/src/mame/video/wiping.c
r17988r17989
120120         sy = 27 - sy;
121121      }
122122
123      drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
123      drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
124124            m_videoram[offs],
125125            m_colorram[offs] & 0x3f,
126126            m_flipscreen,m_flipscreen,
r17988r17989
148148         flipy = !flipy;
149149      }
150150
151      drawgfx_transmask(bitmap,cliprect,screen.machine().gfx[1],
151      drawgfx_transmask(bitmap,cliprect,machine().gfx[1],
152152         (spriteram[offs] & 0x3f) + 64 * otherbank,
153153         color,
154154         flipx,flipy,
155155         sx,sy,
156         colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color, 0x1f));
156         colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, 0x1f));
157157   }
158158
159159   /* redraw high priority chars */
r17988r17989
188188            sy = 27 - sy;
189189         }
190190
191         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
191         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
192192               m_videoram[offs],
193193               m_colorram[offs] & 0x3f,
194194               m_flipscreen,m_flipscreen,
trunk/src/mame/video/kyugo.c
r17988r17989
220220   m_bg_tilemap->set_scrolly(0, m_scroll_y);
221221
222222   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
223   draw_sprites(screen.machine(), bitmap, cliprect);
223   draw_sprites(machine(), bitmap, cliprect);
224224   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
225225   return 0;
226226}
trunk/src/mame/video/leland.c
r17988r17989
389389{
390390   int y;
391391
392   const UINT8 *bg_prom = screen.machine().root_device().memregion("user1")->base();
393   const UINT8 *bg_gfx = screen.machine().root_device().memregion("gfx1")->base();
392   const UINT8 *bg_prom = machine().root_device().memregion("user1")->base();
393   const UINT8 *bg_gfx = machine().root_device().memregion("gfx1")->base();
394394   offs_t bg_gfx_bank_page_size = memregion("gfx1")->bytes() / 3;
395395   offs_t char_bank = (((m_gfxbank >> 4) & 0x03) * 0x2000) & (bg_gfx_bank_page_size - 1);
396396   offs_t prom_bank = ((m_gfxbank >> 3) & 0x01) * 0x2000;
r17988r17989
457457{
458458   int y;
459459
460   const UINT8 *bg_gfx = screen.machine().root_device().memregion("gfx1")->base();
460   const UINT8 *bg_gfx = machine().root_device().memregion("gfx1")->base();
461461   offs_t bg_gfx_bank_page_size = memregion("gfx1")->bytes() / 6;
462462   offs_t bg_gfx_offs_mask = bg_gfx_bank_page_size - 1;
463463
trunk/src/mame/video/lazercmd.c
r17988r17989
5454{
5555   int i, x, y;
5656
57   int video_inverted = screen.machine().root_device().ioport("DSW")->read() & 0x20;
57   int video_inverted = machine().root_device().ioport("DSW")->read() & 0x20;
5858
5959   /* The first row of characters are invisible */
6060   for (i = 0; i < (VERT_RES - 1) * HORZ_RES; i++)
r17988r17989
6767      sx *= HORZ_CHR;
6868      sy *= VERT_CHR;
6969
70      drawgfx_opaque(bitmap, cliprect,screen.machine().gfx[0],
70      drawgfx_opaque(bitmap, cliprect,machine().gfx[0],
7171            m_videoram[i], video_inverted ? 1 : 0,
7272            0,0,
7373            sx,sy);
r17988r17989
7575
7676   x = m_marker_x - 1;             /* normal video lags marker by 1 pixel */
7777   y = vert_scale(m_marker_y) - VERT_CHR; /* first line used as scratch pad */
78   plot_pattern(screen.machine(), bitmap, x, y);
78   plot_pattern(machine(), bitmap, x, y);
7979
8080   return 0;
8181}
trunk/src/mame/video/popeye.c
r17988r17989
367367
368368UINT32 popeye_state::screen_update_popeye(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
369369{
370   draw_background(screen.machine(), bitmap, cliprect);
371   draw_sprites(screen.machine(), bitmap, cliprect);
370   draw_background(machine(), bitmap, cliprect);
371   draw_sprites(machine(), bitmap, cliprect);
372372   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
373373   return 0;
374374}
trunk/src/mame/video/compgolf.c
r17988r17989
124124
125125   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
126126   m_text_tilemap->draw(bitmap, cliprect, 0, 0);
127   draw_sprites(screen.machine(), bitmap, cliprect);
127   draw_sprites(machine(), bitmap, cliprect);
128128   return 0;
129129}
trunk/src/mame/video/lordgun.c
r17988r17989
322322   int layers_ctrl = -1;
323323
324324#ifdef MAME_DEBUG
325   if (screen.machine().input().code_pressed(KEYCODE_Z))
325   if (machine().input().code_pressed(KEYCODE_Z))
326326   {
327327      int msk = 0;
328328
329      if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
330      if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
331      if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 4;
332      if (screen.machine().input().code_pressed(KEYCODE_R))   msk |= 8;
333      if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 16;
329      if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
330      if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
331      if (machine().input().code_pressed(KEYCODE_E))   msk |= 4;
332      if (machine().input().code_pressed(KEYCODE_R))   msk |= 8;
333      if (machine().input().code_pressed(KEYCODE_A))   msk |= 16;
334334      if (msk != 0) layers_ctrl &= msk;
335335   }
336336#endif
337337
338338   if (m_whitescreen)
339339   {
340      bitmap.fill(get_white_pen(screen.machine()), cliprect);
340      bitmap.fill(get_white_pen(machine()), cliprect);
341341      return 0;
342342   }
343343
r17988r17989
373373   if (layers_ctrl & 2)   m_tilemap[1]->draw(*m_bitmaps[1], cliprect, 0, 0);
374374   if (layers_ctrl & 4)   m_tilemap[2]->draw(*m_bitmaps[2], cliprect, 0, 0);
375375   if (layers_ctrl & 8)   m_tilemap[3]->draw(*m_bitmaps[3], cliprect, 0, 0);
376   if (layers_ctrl & 16)   draw_sprites(screen.machine(), *m_bitmaps[4], cliprect);
376   if (layers_ctrl & 16)   draw_sprites(machine(), *m_bitmaps[4], cliprect);
377377
378378   // copy to screen bitmap
379379
trunk/src/mame/video/lemmings.c
r17988r17989
136136   rect.max_y = cliprect.max_y;
137137   rect.min_y = cliprect.min_y;
138138
139   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer_1, 0x400, true);
140   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer_0, 0x400, true);
139   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer_1, 0x400, true);
140   machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer_0, 0x400, true);
141141
142   bitmap.fill(get_black_pen(screen.machine()), cliprect);
143   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x300, 0xff);
142   bitmap.fill(get_black_pen(machine()), cliprect);
143   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x300, 0xff);
144144
145145   /* Pixel layer can be windowed in hardware (two player mode) */
146146   if ((m_control_data[6] & 2) == 0)
147147   {
148      lemmings_copy_bitmap(screen.machine(), bitmap, m_bitmap0, &x1, &y, cliprect);
148      lemmings_copy_bitmap(machine(), bitmap, m_bitmap0, &x1, &y, cliprect);
149149   }
150150   else
151151   {
152152      rect.max_x = 159;
153153      rect.min_x = 0;
154      lemmings_copy_bitmap(screen.machine(), bitmap, m_bitmap0, &x0, &y, rect);
154      lemmings_copy_bitmap(machine(), bitmap, m_bitmap0, &x0, &y, rect);
155155
156156      rect.max_x = 319;
157157      rect.min_x = 160;
158      lemmings_copy_bitmap(screen.machine(), bitmap, m_bitmap0, &x1, &y, rect);
158      lemmings_copy_bitmap(machine(), bitmap, m_bitmap0, &x1, &y, rect);
159159   }
160160
161   screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0xff);
162   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x300, 0xff);
161   machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0xff);
162   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x300, 0xff);
163163   m_vram_tilemap->draw(bitmap, cliprect, 0, 0);
164   screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0xff);
164   machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0xff);
165165   return 0;
166166}
trunk/src/mame/video/pushman.c
r17988r17989
124124   m_bg_tilemap->set_scrolly(0, 0xf00 - m_control[1]);
125125
126126   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
127   draw_sprites(screen.machine(), bitmap, cliprect);
127   draw_sprites(machine(), bitmap, cliprect);
128128   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
129129   return 0;
130130}
trunk/src/mame/video/espial.c
r17988r17989
229229{
230230
231231   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
232   draw_sprites(screen.machine(), bitmap, cliprect);
232   draw_sprites(machine(), bitmap, cliprect);
233233   return 0;
234234}
trunk/src/mame/video/hyperspt.c
r17988r17989
183183   }
184184
185185   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
186   draw_sprites(screen.machine(), bitmap, cliprect);
186   draw_sprites(machine(), bitmap, cliprect);
187187   return 0;
188188}
189189
trunk/src/mame/video/tiamc1.c
r17988r17989
200200      m_bg_tilemap1->draw(bitmap, cliprect, 0, 0);
201201
202202
203   draw_sprites(screen.machine(), bitmap, cliprect);
203   draw_sprites(machine(), bitmap, cliprect);
204204
205205   return 0;
206206}
trunk/src/mame/video/toaplan1.c
r17988r17989
11341134{
11351135   int priority;
11361136
1137   toaplan1_log_vram(screen.machine());
1137   toaplan1_log_vram(machine());
11381138
11391139   bitmap.fill(0x120, cliprect);
11401140
r17988r17989
11471147      m_pf3_tilemap->draw(bitmap, cliprect, priority, 0);
11481148      m_pf2_tilemap->draw(bitmap, cliprect, priority, 0);
11491149      m_pf1_tilemap->draw(bitmap, cliprect, priority, 0);
1150      rallybik_draw_sprites(screen.machine(), bitmap,cliprect,priority << 8);
1150      rallybik_draw_sprites(machine(), bitmap,cliprect,priority << 8);
11511151   }
11521152
11531153   return 0;
r17988r17989
11571157{
11581158   int priority;
11591159
1160   toaplan1_log_vram(screen.machine());
1160   toaplan1_log_vram(machine());
11611161
1162   screen.machine().priority_bitmap.fill(0, cliprect);
1162   machine().priority_bitmap.fill(0, cliprect);
11631163   bitmap.fill(0x120, cliprect);
11641164
11651165// it's really correct?
r17988r17989
11741174      m_pf1_tilemap->draw(bitmap, cliprect, priority, priority, 0);
11751175   }
11761176
1177   draw_sprites(screen.machine(), bitmap, cliprect);
1177   draw_sprites(machine(), bitmap, cliprect);
11781178   return 0;
11791179}
11801180
r17988r17989
12131213
12141214      memcpy(m_buffered_spriteram, m_spriteram, m_spriteram.bytes());
12151215      memcpy(m_buffered_spritesizeram16, m_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE);
1216      screen.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_2, HOLD_LINE);   /* Frame done */
1216      machine().device("maincpu")->execute().set_input_line(M68K_IRQ_2, HOLD_LINE);   /* Frame done */
12171217   }
12181218}
trunk/src/mame/video/segag80r.c
r17988r17989
802802      /* background: none */
803803      case G80_BACKGROUND_NONE:
804804         memset(transparent_pens, 0, 16);
805         draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens);
805         draw_videoram(machine(), bitmap, cliprect, transparent_pens);
806806         break;
807807
808808      /* foreground: visible except where black */
r17988r17989
810810      /* we draw the foreground first, then the background to do collision detection */
811811      case G80_BACKGROUND_SPACEOD:
812812         memset(transparent_pens, 0, 16);
813         draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens);
814         draw_background_spaceod(screen.machine(), bitmap, cliprect);
813         draw_videoram(machine(), bitmap, cliprect, transparent_pens);
814         draw_background_spaceod(machine(), bitmap, cliprect);
815815         break;
816816
817817      /* foreground: visible except for pen 0 (this disagrees with schematics) */
818818      /* background: page-granular scrolling */
819819      case G80_BACKGROUND_MONSTERB:
820820         memset(transparent_pens, 1, 16);
821         draw_background_page_scroll(screen.machine(), bitmap, cliprect);
822         draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens);
821         draw_background_page_scroll(machine(), bitmap, cliprect);
822         draw_videoram(machine(), bitmap, cliprect, transparent_pens);
823823         break;
824824
825825      /* foreground: visible except for pen 0 */
826826      /* background: full scrolling */
827827      case G80_BACKGROUND_PIGNEWT:
828828         memset(transparent_pens, 1, 16);
829         draw_background_full_scroll(screen.machine(), bitmap, cliprect);
830         draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens);
829         draw_background_full_scroll(machine(), bitmap, cliprect);
830         draw_videoram(machine(), bitmap, cliprect, transparent_pens);
831831         break;
832832
833833      /* foreground: visible except for pen 0 */
834834      /* background: page-granular scrolling */
835835      case G80_BACKGROUND_SINDBADM:
836836         memset(transparent_pens, 1, 16);
837         draw_background_page_scroll(screen.machine(), bitmap, cliprect);
838         draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens);
837         draw_background_page_scroll(machine(), bitmap, cliprect);
838         draw_videoram(machine(), bitmap, cliprect, transparent_pens);
839839         break;
840840   }
841841   return 0;
trunk/src/mame/video/hnayayoi.c
r17988r17989
266266
267267   if (m_total_pixmaps == 4)
268268   {
269      draw_layer_interleaved(screen.machine(), bitmap, cliprect, 3, 2, col1, 0);
270      draw_layer_interleaved(screen.machine(), bitmap, cliprect, 1, 0, col0, 1);
269      draw_layer_interleaved(machine(), bitmap, cliprect, 3, 2, col1, 0);
270      draw_layer_interleaved(machine(), bitmap, cliprect, 1, 0, col0, 1);
271271   }
272272   else   /* total_pixmaps == 8 */
273273   {
274      draw_layer_interleaved(screen.machine(), bitmap, cliprect, 7, 6, col3, 0);
275      draw_layer_interleaved(screen.machine(), bitmap, cliprect, 5, 4, col2, 1);
276      draw_layer_interleaved(screen.machine(), bitmap, cliprect, 3, 2, col1, 1);
277      draw_layer_interleaved(screen.machine(), bitmap, cliprect, 1, 0, col0, 1);
274      draw_layer_interleaved(machine(), bitmap, cliprect, 7, 6, col3, 0);
275      draw_layer_interleaved(machine(), bitmap, cliprect, 5, 4, col2, 1);
276      draw_layer_interleaved(machine(), bitmap, cliprect, 3, 2, col1, 1);
277      draw_layer_interleaved(machine(), bitmap, cliprect, 1, 0, col0, 1);
278278   }
279279   return 0;
280280}
trunk/src/mame/video/tmnt.c
r17988r17989
605605
606606   konami_sortlayers3(m_sorted_layer, m_layerpri);
607607
608   screen.machine().priority_bitmap.fill(0, cliprect);
608   machine().priority_bitmap.fill(0, cliprect);
609609   k052109_tilemap_draw(m_k052109, bitmap, cliprect, m_sorted_layer[0], TILEMAP_DRAW_OPAQUE, 1);
610610   k052109_tilemap_draw(m_k052109, bitmap, cliprect, m_sorted_layer[1], 0, 2);
611611   k052109_tilemap_draw(m_k052109, bitmap, cliprect, m_sorted_layer[2], 0, 4);
r17988r17989
636636
637637   konami_sortlayers3(m_sorted_layer, m_layerpri);
638638
639   screen.machine().priority_bitmap.fill(0, cliprect);
639   machine().priority_bitmap.fill(0, cliprect);
640640   bitmap.fill(16 * bg_colorbase, cliprect);
641641   k052109_tilemap_draw(m_k052109, bitmap, cliprect, m_sorted_layer[0], 0, 1);
642642   k052109_tilemap_draw(m_k052109, bitmap, cliprect, m_sorted_layer[1], 0, 2);
r17988r17989
683683
684684   /* not sure about the 053936 priority, but it seems to work */
685685
686   screen.machine().priority_bitmap.fill(0, cliprect);
686   machine().priority_bitmap.fill(0, cliprect);
687687   bitmap.fill(16 * bg_colorbase, cliprect);
688688   k052109_tilemap_draw(m_k052109, bitmap, cliprect, m_sorted_layer[0], 0, 1);
689689
r17988r17989
743743
744744      // dim all colors before it
745745      for (i = 0; i < cb; i++)
746         palette_set_pen_contrast(screen.machine(), i, brt);
746         palette_set_pen_contrast(machine(), i, brt);
747747
748748      // reset all colors in range
749749      for (i = cb; i < ce; i++)
750         palette_set_pen_contrast(screen.machine(), i, 1.0);
750         palette_set_pen_contrast(machine(), i, 1.0);
751751
752752      // dim all colors after it
753753      for (i = ce; i < 2048; i++)
754         palette_set_pen_contrast(screen.machine(), i, brt);
754         palette_set_pen_contrast(machine(), i, brt);
755755
756756      // toggle shadow/highlight
757757      if (~m_dim_c & 0x10)
758         palette_set_shadow_mode(screen.machine(), 1);
758         palette_set_shadow_mode(machine(), 1);
759759      else
760         palette_set_shadow_mode(screen.machine(), 0);
760         palette_set_shadow_mode(machine(), 0);
761761   }
762762
763763   SCREEN_UPDATE16_CALL_MEMBER(lgtnfght);
r17988r17989
786786
787787   konami_sortlayers3(m_sorted_layer, m_layerpri);
788788
789   screen.machine().priority_bitmap.fill(0, cliprect);
789   machine().priority_bitmap.fill(0, cliprect);
790790   bitmap.fill(16 * bg_colorbase, cliprect);
791791   k052109_tilemap_draw(m_k052109, bitmap, cliprect, m_sorted_layer[0], 0, 1);
792792   k052109_tilemap_draw(m_k052109, bitmap, cliprect, m_sorted_layer[1], 0, 2);
trunk/src/mame/video/dc.c
r17988r17989
26582658//  int y,x;
26592659
26602660#if DEBUG_PALRAM
2661   debug_paletteram(screen.machine());
2661   debug_paletteram(machine());
26622662#endif
26632663
26642664   // copy our fake framebuffer bitmap (where things have been rendered) to the screen
r17988r17989
26772677   bitmap.fill(MAKE_ARGB(0xff,vo_border_R,vo_border_G,vo_border_B), cliprect); //FIXME: Chroma bit?
26782678
26792679   if(!spg_blank_video)
2680      pvr_drawframebuffer(screen.machine(),bitmap,cliprect);
2680      pvr_drawframebuffer(machine(),bitmap,cliprect);
26812681
26822682   // update this here so we only do string lookup once per frame
2683   debug_dip_status = screen.machine().root_device().ioport("MAMEDEBUG")->read();
2683   debug_dip_status = machine().root_device().ioport("MAMEDEBUG")->read();
26842684
26852685   return 0;
26862686}
trunk/src/mame/video/taxidriv.c
r17988r17989
3131         sx = offs % 32;
3232         sy = offs / 32;
3333
34         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[3],
34         drawgfx_opaque(bitmap,cliprect,machine().gfx[3],
3535               m_vram3[offs],
3636               0,
3737               0,0,
r17988r17989
4343         sx = offs % 32;
4444         sy = offs / 32;
4545
46         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
46         drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
4747               m_vram2[offs]+256*m_vram2[offs+0x400],
4848               0,
4949               0,0,
r17988r17989
109109         sx = offs % 32;
110110         sy = offs / 32;
111111
112         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
112         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
113113               m_vram1[offs],
114114               0,
115115               0,0,
r17988r17989
136136      sx = offs % 32;
137137      sy = offs / 32;
138138
139      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
139      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
140140            m_vram0[offs],
141141            0,
142142            0,0,
trunk/src/mame/video/taitojc.c
r17988r17989
335335   bitmap.fill(0, cliprect);
336336
337337   // low priority objects
338   draw_object_bank(screen.machine(), bitmap, cliprect, 0, 0);
339   draw_object_bank(screen.machine(), bitmap, cliprect, 1, 0);
340   draw_object_bank(screen.machine(), bitmap, cliprect, 2, 0);
338   draw_object_bank(machine(), bitmap, cliprect, 0, 0);
339   draw_object_bank(machine(), bitmap, cliprect, 1, 0);
340   draw_object_bank(machine(), bitmap, cliprect, 2, 0);
341341
342342   // 3D layer
343343   copybitmap_trans(bitmap, m_framebuffer, 0, 0, 0, 0, cliprect, 0);
344344
345345   // high priority objects
346   draw_object_bank(screen.machine(), bitmap, cliprect, 0, 1);
347   draw_object_bank(screen.machine(), bitmap, cliprect, 1, 1);
348   draw_object_bank(screen.machine(), bitmap, cliprect, 2, 1);
346   draw_object_bank(machine(), bitmap, cliprect, 0, 1);
347   draw_object_bank(machine(), bitmap, cliprect, 1, 1);
348   draw_object_bank(machine(), bitmap, cliprect, 2, 1);
349349
350350   // text layer
351351   if (m_objlist[0xfc4/4] & 0x10000)
trunk/src/mame/video/pitnrun.c
r17988r17989
213213   rectangle myclip=cliprect;
214214
215215#ifdef MAME_DEBUG
216   if (screen.machine().input().code_pressed_once(KEYCODE_Q))
216   if (machine().input().code_pressed_once(KEYCODE_Q))
217217   {
218218      UINT8 *ROM = memregion("maincpu")->base();
219219      ROM[0x84f6]=0; /* lap 0 - normal */
220220   }
221221
222   if (screen.machine().input().code_pressed_once(KEYCODE_W))
222   if (machine().input().code_pressed_once(KEYCODE_W))
223223   {
224      UINT8 *ROM = screen.machine().root_device().memregion("maincpu")->base();
224      UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
225225      ROM[0x84f6]=6; /* lap 6 = spotlight */
226226   }
227227
228   if (screen.machine().input().code_pressed_once(KEYCODE_E))
228   if (machine().input().code_pressed_once(KEYCODE_E))
229229   {
230      UINT8 *ROM = screen.machine().root_device().memregion("maincpu")->base();
230      UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
231231      ROM[0x84f6]=2; /* lap 3 (trial 2)= lightnings */
232232      ROM[0x8102]=1;
233233   }
r17988r17989
254254      m_bg->draw(bitmap, myclip, 0,0);
255255   }
256256
257   draw_sprites(screen.machine(),bitmap,myclip);
257   draw_sprites(machine(),bitmap,myclip);
258258
259259   if(m_ha&4)
260260      copybitmap_trans(bitmap,*m_tmp_bitmap[m_ha&3],flip_screen_x(),flip_screen_y(),dx,dy,myclip, 1);
trunk/src/mame/video/midzeus2.c
r17988r17989
363363
364364   poly_wait(poly, "VIDEO_UPDATE");
365365
366if (screen.machine().input().code_pressed(KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); }
367if (screen.machine().input().code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); }
366if (machine().input().code_pressed(KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); }
367if (machine().input().code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); }
368368
369369   /* normal update case */
370   if (!screen.machine().input().code_pressed(KEYCODE_W))
370   if (!machine().input().code_pressed(KEYCODE_W))
371371   {
372372      const void *base = waveram1_ptr_from_expanded_addr(m_zeusbase[0x38]);
373373      int xoffs = screen.visible_area().min_x;
r17988r17989
384384   {
385385      const UINT64 *base;
386386
387      if (screen.machine().input().code_pressed(KEYCODE_DOWN)) yoffs += screen.machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
388      if (screen.machine().input().code_pressed(KEYCODE_UP)) yoffs -= screen.machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
389      if (screen.machine().input().code_pressed(KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (screen.machine().input().code_pressed(KEYCODE_LEFT)) ; }
390      if (screen.machine().input().code_pressed(KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (screen.machine().input().code_pressed(KEYCODE_RIGHT)) ; }
387      if (machine().input().code_pressed(KEYCODE_DOWN)) yoffs += machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
388      if (machine().input().code_pressed(KEYCODE_UP)) yoffs -= machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
389      if (machine().input().code_pressed(KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (machine().input().code_pressed(KEYCODE_LEFT)) ; }
390      if (machine().input().code_pressed(KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (machine().input().code_pressed(KEYCODE_RIGHT)) ; }
391391
392392      if (yoffs < 0) yoffs = 0;
393393      base = (const UINT64 *)waveram0_ptr_from_expanded_addr(yoffs << 16);
trunk/src/mame/video/tehkanwc.c
r17988r17989
159159   m_bg_tilemap->set_scrollx(0, m_scroll_x[0] + 256 * m_scroll_x[1]);
160160   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
161161   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
162   draw_sprites(screen.machine(), bitmap, cliprect);
162   draw_sprites(machine(), bitmap, cliprect);
163163   m_fg_tilemap->draw(bitmap, cliprect, 1, 0);
164   gridiron_draw_led(screen.machine(), bitmap, cliprect, m_led0, 0);
165   gridiron_draw_led(screen.machine(), bitmap, cliprect, m_led1, 1);
164   gridiron_draw_led(machine(), bitmap, cliprect, m_led0, 0);
165   gridiron_draw_led(machine(), bitmap, cliprect, m_led1, 1);
166166   return 0;
167167}
trunk/src/mame/video/bionicc.c
r17988r17989
239239UINT32 bionicc_state::screen_update_bionicc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
240240{
241241
242   bitmap.fill(get_black_pen(screen.machine()), cliprect);
242   bitmap.fill(get_black_pen(machine()), cliprect);
243243   m_fg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER1, 0);   /* nothing in FRONT */
244244   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
245245   m_fg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER1, 0);
246   draw_sprites(screen.machine(), bitmap, cliprect);
246   draw_sprites(machine(), bitmap, cliprect);
247247   m_fg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER0, 0);
248248   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
249249   return 0;
trunk/src/mame/video/citycon.c
r17988r17989
146146      int i;
147147
148148      for (i = 0; i < 4; i++)
149         changecolor_RRRRGGGGBBBBxxxx(screen.machine(), 640 + 4 * offs + i, 512 + 4 * indx + i);
149         changecolor_RRRRGGGGBBBBxxxx(machine(), 640 + 4 * offs + i, 512 + 4 * indx + i);
150150   }
151151
152152
r17988r17989
157157
158158   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
159159   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
160   draw_sprites(screen.machine(), bitmap, cliprect);
160   draw_sprites(machine(), bitmap, cliprect);
161161   return 0;
162162}
trunk/src/mame/video/suprridr.c
r17988r17989
206206         fy = !fy;
207207         y = 240 - y;
208208      }
209      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, fx, fy, x, y, 0);
209      drawgfx_transpen(bitmap, cliprect, machine().gfx[2], code, color, fx, fy, x, y, 0);
210210   }
211211   return 0;
212212}
trunk/src/mame/video/spy.c
r17988r17989
6666
6767   k052109_tilemap_update(m_k052109);
6868
69   screen.machine().priority_bitmap.fill(0, cliprect);
69   machine().priority_bitmap.fill(0, cliprect);
7070
7171   if (!m_video_enable)
7272      bitmap.fill(16 * m_layer_colorbase[0], cliprect);
trunk/src/mame/video/psikyo.c
r17988r17989
529529
530530   tilemap_t *tmptilemap0, *tmptilemap1;
531531
532   flip_screen_set(~screen.machine().root_device().ioport("DSW")->read() & 0x00010000);      // hardwired to a DSW bit
532   flip_screen_set(~machine().root_device().ioport("DSW")->read() & 0x00010000);      // hardwired to a DSW bit
533533
534534   /* Layers enable (not quite right) */
535535
r17988r17989
564564   /* For gfx banking for s1945jn/gunbird/btlkroad */
565565   if (m_ka302c_banking)
566566   {
567      psikyo_switch_banks(screen.machine(), 0, (layer0_ctrl & 0x400) >> 10);
568      psikyo_switch_banks(screen.machine(), 1, (layer1_ctrl & 0x400) >> 10);
567      psikyo_switch_banks(machine(), 0, (layer0_ctrl & 0x400) >> 10);
568      psikyo_switch_banks(machine(), 1, (layer1_ctrl & 0x400) >> 10);
569569   }
570570
571571   switch ((layer0_ctrl & 0x00c0) >> 6)
r17988r17989
664664   m_tilemap_1_size2->set_transparent_pen((layer1_ctrl & 8 ? 0 : 15));
665665   m_tilemap_1_size3->set_transparent_pen((layer1_ctrl & 8 ? 0 : 15));
666666
667   bitmap.fill(get_black_pen(screen.machine()), cliprect);
667   bitmap.fill(get_black_pen(machine()), cliprect);
668668
669   screen.machine().priority_bitmap.fill(0, cliprect);
669   machine().priority_bitmap.fill(0, cliprect);
670670
671671   if (layers_ctrl & 1)
672672      tmptilemap0->draw(bitmap, cliprect, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1);
r17988r17989
675675      tmptilemap1->draw(bitmap, cliprect, layer1_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 2);
676676
677677   if (layers_ctrl & 4)
678      draw_sprites(screen.machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15));
678      draw_sprites(machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15));
679679
680680   return 0;
681681}
r17988r17989
702702
703703   tilemap_t *tmptilemap0, *tmptilemap1;
704704
705   flip_screen_set(~screen.machine().root_device().ioport("DSW")->read() & 0x00010000);      // hardwired to a DSW bit
705   flip_screen_set(~machine().root_device().ioport("DSW")->read() & 0x00010000);      // hardwired to a DSW bit
706706
707707   /* Layers enable (not quite right) */
708708
r17988r17989
737737   /* For gfx banking for s1945jn/gunbird/btlkroad */
738738   if (m_ka302c_banking)
739739   {
740      psikyo_switch_banks(screen.machine(), 0, (layer0_ctrl & 0x400) >> 10);
741      psikyo_switch_banks(screen.machine(), 1, (layer1_ctrl & 0x400) >> 10);
740      psikyo_switch_banks(machine(), 0, (layer0_ctrl & 0x400) >> 10);
741      psikyo_switch_banks(machine(), 1, (layer1_ctrl & 0x400) >> 10);
742742   }
743743
744744   switch ((layer0_ctrl & 0x00c0) >> 6)
r17988r17989
837837   m_tilemap_1_size2->set_transparent_pen((layer1_ctrl & 8 ? 0 : 15));
838838   m_tilemap_1_size3->set_transparent_pen((layer1_ctrl & 8 ? 0 : 15));
839839
840   bitmap.fill(get_black_pen(screen.machine()), cliprect);
840   bitmap.fill(get_black_pen(machine()), cliprect);
841841
842   screen.machine().priority_bitmap.fill(0, cliprect);
842   machine().priority_bitmap.fill(0, cliprect);
843843
844844   if (layers_ctrl & 1)
845845      tmptilemap0->draw(bitmap, cliprect, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1);
r17988r17989
848848      tmptilemap1->draw(bitmap, cliprect, layer1_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 2);
849849
850850   if (layers_ctrl & 4)
851      draw_sprites_bootleg(screen.machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15));
851      draw_sprites_bootleg(machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15));
852852
853853   return 0;
854854}
trunk/src/mame/video/playmark.c
r17988r17989
496496UINT32 playmark_state::screen_update_bigtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
497497{
498498
499   screen.machine().priority_bitmap.fill(0, cliprect);
499   machine().priority_bitmap.fill(0, cliprect);
500500
501501   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
502502   if (m_bg_enable)
503      draw_bitmap(screen.machine(), bitmap, cliprect);
504   draw_sprites(screen.machine(), bitmap, cliprect, 4);
503      draw_bitmap(machine(), bitmap, cliprect);
504   draw_sprites(machine(), bitmap, cliprect, 4);
505505   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
506506   return 0;
507507}
r17988r17989
515515   {
516516      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
517517      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
518      bigtwinb_draw_sprites(screen.machine(), bitmap, cliprect, 4);
518      bigtwinb_draw_sprites(machine(), bitmap, cliprect, 4);
519519      m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
520520   }
521521   else
522      bitmap.fill(get_black_pen(screen.machine()), cliprect);
522      bitmap.fill(get_black_pen(machine()), cliprect);
523523   return 0;
524524}
525525
526526UINT32 playmark_state::screen_update_excelsr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
527527{
528528
529   screen.machine().priority_bitmap.fill(0, cliprect);
529   machine().priority_bitmap.fill(0, cliprect);
530530
531531   m_fg_tilemap->draw(bitmap, cliprect, 0, 1);
532532   if (m_bg_enable)
533      draw_bitmap(screen.machine(), bitmap, cliprect);
533      draw_bitmap(machine(), bitmap, cliprect);
534534   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
535   draw_sprites(screen.machine(), bitmap, cliprect, 2);
535   draw_sprites(machine(), bitmap, cliprect, 2);
536536   return 0;
537537}
538538
r17988r17989
553553      m_fg_tilemap->set_scrollx(0, m_fgscrollx);
554554   }
555555
556   screen.machine().priority_bitmap.fill(0, cliprect);
556   machine().priority_bitmap.fill(0, cliprect);
557557
558558   m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
559559   m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
560   draw_sprites(screen.machine(), bitmap, cliprect, 0);
560   draw_sprites(machine(), bitmap, cliprect, 0);
561561   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
562562   return 0;
563563}
r17988r17989
565565UINT32 playmark_state::screen_update_hrdtimes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
566566{
567567
568   screen.machine().priority_bitmap.fill(0, cliprect);
568   machine().priority_bitmap.fill(0, cliprect);
569569
570570   // video enabled
571571   if (m_scroll[6] & 1)
572572   {
573573      m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
574574      m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
575      draw_sprites(screen.machine(), bitmap, cliprect, 2);
575      draw_sprites(machine(), bitmap, cliprect, 2);
576576      m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
577577   }
578578   else
579      bitmap.fill(get_black_pen(screen.machine()), cliprect);
579      bitmap.fill(get_black_pen(machine()), cliprect);
580580   return 0;
581581}
trunk/src/mame/video/esd16.c
r17988r17989
167167{
168168   int layers_ctrl = -1;
169169
170   screen.machine().priority_bitmap.fill(0, cliprect);
170   machine().priority_bitmap.fill(0, cliprect);
171171
172172#ifdef MAME_DEBUG
173if (screen.machine().input().code_pressed(KEYCODE_Z))
173if (machine().input().code_pressed(KEYCODE_Z))
174174{
175175   int msk = 0;
176   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
177   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
178   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 4;
176   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
177   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
178   if (machine().input().code_pressed(KEYCODE_A))   msk |= 4;
179179   if (msk != 0) layers_ctrl &= msk;
180180}
181181#endif
r17988r17989
218218
219219   }
220220
221   if (layers_ctrl & 4) screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
221   if (layers_ctrl & 4) machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
222222
223223//  popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]);
224224   return 0;
trunk/src/mame/video/pgm.c
r17988r17989
643643
644644   bitmap.fill(0x3ff, cliprect); // ddp2 igs logo needs 0x3ff
645645
646   screen.machine().priority_bitmap.fill(0, cliprect);
646   machine().priority_bitmap.fill(0, cliprect);
647647
648648   m_bg_tilemap->set_scrolly(0, m_videoregs[0x2000/2]);
649649
r17988r17989
653653
654654   m_bg_tilemap->draw(bitmap, cliprect, 0, 2);
655655
656   draw_sprites(this, screen.machine(), bitmap, m_spritebufferram, screen.machine().priority_bitmap);
656   draw_sprites(this, machine(), bitmap, m_spritebufferram, machine().priority_bitmap);
657657
658658   m_tx_tilemap->set_scrolly(0, m_videoregs[0x5000/2]);
659659   m_tx_tilemap->set_scrollx(0, m_videoregs[0x6000/2]); // Check
trunk/src/mame/video/namcos21.c
r17988r17989
170170   UINT8 *videoram = m_videoram;
171171   int pivot = 3;
172172   int pri;
173   update_palette(screen.machine());
173   update_palette(machine());
174174   bitmap.fill(0xff, cliprect );
175175
176176   if( m_gametype != NAMCOS21_WINRUN91 )
r17988r17989
179179      c355_obj_draw(bitmap, cliprect, 14 );   //driver's eyes
180180   }
181181
182   CopyVisiblePolyFrameBuffer( screen.machine(), bitmap, cliprect, 0x7fc0, 0x7ffe );
182   CopyVisiblePolyFrameBuffer( machine(), bitmap, cliprect, 0x7fc0, 0x7ffe );
183183
184184   if( m_gametype != NAMCOS21_WINRUN91 )
185185   { /* draw low priority 2d sprites */
r17988r17989
187187      c355_obj_draw(bitmap, cliprect, 1 );
188188   }
189189
190   CopyVisiblePolyFrameBuffer( screen.machine(), bitmap, cliprect, 0, 0x7fbf );
190   CopyVisiblePolyFrameBuffer( machine(), bitmap, cliprect, 0, 0x7fbf );
191191
192192
193193   if( m_gametype != NAMCOS21_WINRUN91 )
trunk/src/mame/video/model3.c
r17988r17989
361361   if( m_tick >= 5 ) {
362362      m_tick = 0;
363363
364      if( screen.machine().input().code_pressed(KEYCODE_Y) )
364      if( machine().input().code_pressed(KEYCODE_Y) )
365365         m_debug_layer_disable ^= 0x1;
366      if( screen.machine().input().code_pressed(KEYCODE_U) )
366      if( machine().input().code_pressed(KEYCODE_U) )
367367         m_debug_layer_disable ^= 0x2;
368      if( screen.machine().input().code_pressed(KEYCODE_I) )
368      if( machine().input().code_pressed(KEYCODE_I) )
369369         m_debug_layer_disable ^= 0x4;
370      if( screen.machine().input().code_pressed(KEYCODE_O) )
370      if( machine().input().code_pressed(KEYCODE_O) )
371371         m_debug_layer_disable ^= 0x8;
372      if( screen.machine().input().code_pressed(KEYCODE_T) )
372      if( machine().input().code_pressed(KEYCODE_T) )
373373         m_debug_layer_disable ^= 0x10;
374374   }
375375
376376   bitmap.fill(0, cliprect);
377377
378378   if (!(m_debug_layer_disable & 0x8))
379      draw_layer(screen.machine(), bitmap, cliprect, 3, (m_layer_enable >> 3) & 0x1);
379      draw_layer(machine(), bitmap, cliprect, 3, (m_layer_enable >> 3) & 0x1);
380380
381381   if (!(m_debug_layer_disable & 0x4))
382      draw_layer(screen.machine(), bitmap, cliprect, 2, (m_layer_enable >> 2) & 0x1);
382      draw_layer(machine(), bitmap, cliprect, 2, (m_layer_enable >> 2) & 0x1);
383383
384384   if( !(m_debug_layer_disable & 0x10) )
385385   {
r17988r17989
387387      if(m_real3d_display_list) {
388388         m_zbuffer.fill(0, cliprect);
389389         m_bitmap3d.fill(0x8000, cliprect);
390         real3d_traverse_display_list(screen.machine());
390         real3d_traverse_display_list(machine());
391391      }
392392#endif
393393      copybitmap_trans(bitmap, m_bitmap3d, 0, 0, 0, 0, cliprect, 0x8000);
394394   }
395395
396396   if (!(m_debug_layer_disable & 0x2))
397      draw_layer(screen.machine(), bitmap, cliprect, 1, (m_layer_enable >> 1) & 0x1);
397      draw_layer(machine(), bitmap, cliprect, 1, (m_layer_enable >> 1) & 0x1);
398398
399399   if (!(m_debug_layer_disable & 0x1))
400      draw_layer(screen.machine(), bitmap, cliprect, 0, (m_layer_enable >> 0) & 0x1);
400      draw_layer(machine(), bitmap, cliprect, 0, (m_layer_enable >> 0) & 0x1);
401401
402402   //copy_screen(bitmap, cliprect);
403403
trunk/src/mame/video/ikki.c
r17988r17989
175175      bank = (color & 0xe0) << 3;
176176      color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2);
177177
178      drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
178      drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
179179         m_videoram[offs * 2 + 1] + bank,
180180         color,
181181         m_flipscreen,m_flipscreen,
182182         x,y);
183183   }
184184
185   draw_sprites(screen.machine(), bitmap, cliprect);
185   draw_sprites(machine(), bitmap, cliprect);
186186
187187   /* mask sprites */
188188
r17988r17989
210210         bank = (color & 0xe0) << 3;
211211         color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2);
212212
213         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
213         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
214214            m_videoram[offs * 2 + 1] + bank,
215215            color,
216216            m_flipscreen,m_flipscreen,
trunk/src/mame/video/capbowl.c
r17988r17989
172172   /* if we're blanked, just fill with black */
173173   if (state.blanked)
174174   {
175      bitmap.fill(get_black_pen(screen.machine()), cliprect);
175      bitmap.fill(get_black_pen(machine()), cliprect);
176176      return 0;
177177   }
178178
trunk/src/mame/video/cbasebal.c
r17988r17989
177177      bitmap.fill(768, cliprect);
178178
179179   if (m_obj_on)
180      draw_sprites(screen.machine(), bitmap, cliprect);
180      draw_sprites(machine(), bitmap, cliprect);
181181
182182   if (m_text_on)
183183      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/st0016.c
r17988r17989
586586
587587void st0016_state::st0016_draw_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
588588{
589   draw_bgmap(screen.machine(), bitmap,cliprect,0);
590   draw_sprites(screen.machine(), bitmap,cliprect);
591   draw_bgmap(screen.machine(), bitmap,cliprect,1);
589   draw_bgmap(machine(), bitmap,cliprect,0);
590   draw_sprites(machine(), bitmap,cliprect);
591   draw_bgmap(machine(), bitmap,cliprect,1);
592592}
593593
594594UINT32 st0016_state::screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
595595{
596596
597597#ifdef MAME_DEBUG
598   if(screen.machine().input().code_pressed_once(KEYCODE_Z))
598   if(machine().input().code_pressed_once(KEYCODE_Z))
599599   {
600600      int h,j;
601601      FILE *p=fopen("vram.bin","wb");
trunk/src/mame/video/sbasketb.c
r17988r17989
176176      m_bg_tilemap->set_scrolly(col, *m_scroll);
177177
178178   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
179   draw_sprites(screen.machine(), bitmap, cliprect);
179   draw_sprites(machine(), bitmap, cliprect);
180180   return 0;
181181}
trunk/src/mame/video/funkyjet.c
r17988r17989
1313
1414UINT32 funkyjet_state::screen_update_funkyjet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
1515{
16   address_space &space = screen.machine().driver_data()->generic_space();
16   address_space &space = machine().driver_data()->generic_space();
1717   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
1818
1919   flip_screen_set(BIT(flip, 7));
r17988r17989
2222   bitmap.fill(768, cliprect);
2323   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
2424   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
25   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
25   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
2626   return 0;
2727}
trunk/src/mame/video/xexex.c
r17988r17989
7979   k054338_update_all_shadows(m_k054338, 0);
8080   k054338_fill_backcolor(m_k054338, bitmap, 0);
8181
82   screen.machine().priority_bitmap.fill(0, cliprect);
82   machine().priority_bitmap.fill(0, cliprect);
8383
8484   for (plane = 0; plane < 4; plane++)
8585   {
trunk/src/mame/video/ksayakyu.c
r17988r17989
129129      m_tilemap->draw(bitmap, cliprect, 0, 0);
130130
131131   m_textmap->draw(bitmap, cliprect, 0, 0);
132   draw_sprites(screen.machine(), bitmap, cliprect);
132   draw_sprites(machine(), bitmap, cliprect);
133133   return 0;
134134}
trunk/src/mame/video/himesiki.c
r17988r17989
118118   m_bg_tilemap->set_scrolldx(x, x);
119119
120120   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
121   himesiki_draw_sprites(screen.machine(), bitmap, cliprect);
121   himesiki_draw_sprites(machine(), bitmap, cliprect);
122122
123123   return 0;
124124}
trunk/src/mame/video/battlex.c
r17988r17989
9494
9595   m_bg_tilemap->set_scrollx(0, m_scroll_lsb | (m_scroll_msb << 8));
9696   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
97   draw_sprites(screen.machine(), bitmap, cliprect);
97   draw_sprites(machine(), bitmap, cliprect);
9898
9999   return 0;
100100}
trunk/src/mame/video/ironhors.c
r17988r17989
242242      m_bg_tilemap->set_scrollx(row, m_scroll[row]);
243243
244244   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
245   draw_sprites(screen.machine(), bitmap, cliprect);
245   draw_sprites(machine(), bitmap, cliprect);
246246   return 0;
247247}
248248
r17988r17989
352352      m_bg_tilemap->set_scrollx(row, m_scroll[row]);
353353
354354   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
355   farwest_draw_sprites(screen.machine(), bitmap, cliprect);
355   farwest_draw_sprites(machine(), bitmap, cliprect);
356356   return 0;
357357}
358358
trunk/src/mame/video/mrflea.c
r17988r17989
103103
104104UINT32 mrflea_state::screen_update_mrflea(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
105105{
106   draw_background(screen.machine(), bitmap, cliprect);
107   draw_sprites(screen.machine(), bitmap, cliprect);
106   draw_background(machine(), bitmap, cliprect);
107   draw_sprites(machine(), bitmap, cliprect);
108108   return 0;
109109}
trunk/src/mame/video/epos.c
r17988r17989
7676   pen_t pens[0x20];
7777   offs_t offs;
7878
79   get_pens(screen.machine(), pens);
79   get_pens(machine(), pens);
8080
8181   for (offs = 0; offs < m_videoram.bytes(); offs++)
8282   {
trunk/src/mame/video/snes.c
r17988r17989
17921792   /*NTSC SNES draw range is 1-225. */
17931793   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
17941794   {
1795      snes_refresh_scanline(screen.machine(), bitmap, y + 1);
1795      snes_refresh_scanline(machine(), bitmap, y + 1);
17961796   }
17971797   return 0;
17981798}
trunk/src/mame/video/glass.c
r17988r17989
199199   m_pant[1]->set_scrollx(0, m_vregs[3]);
200200
201201   /* draw layers + sprites */
202   bitmap.fill(get_black_pen(screen.machine()), cliprect);
202   bitmap.fill(get_black_pen(machine()), cliprect);
203203   copybitmap(bitmap, *m_screen_bitmap, 0, 0, 0x18, 0x24, cliprect);
204204   m_pant[1]->draw(bitmap, cliprect, 0, 0);
205205   m_pant[0]->draw(bitmap, cliprect, 0, 0);
206   draw_sprites(screen.machine(), bitmap, cliprect);
206   draw_sprites(machine(), bitmap, cliprect);
207207   return 0;
208208}
trunk/src/mame/video/mcatadv.c
r17988r17989
202202{
203203   int i;
204204
205   bitmap.fill(get_black_pen(screen.machine()), cliprect);
206   screen.machine().priority_bitmap.fill(0, cliprect);
205   bitmap.fill(get_black_pen(machine()), cliprect);
206   machine().priority_bitmap.fill(0, cliprect);
207207
208208   if (m_scroll1[2] != m_palette_bank1)
209209   {
r17988r17989
228228   for (i = 0; i <= 3; i++)
229229   {
230230   #ifdef MAME_DEBUG
231         if (!screen.machine().input().code_pressed(KEYCODE_Q))
231         if (!machine().input().code_pressed(KEYCODE_Q))
232232   #endif
233233         mcatadv_draw_tilemap_part(m_scroll1,  m_videoram1, i, m_tilemap1, bitmap, cliprect);
234234
235235   #ifdef MAME_DEBUG
236         if (!screen.machine().input().code_pressed(KEYCODE_W))
236         if (!machine().input().code_pressed(KEYCODE_W))
237237   #endif
238238            mcatadv_draw_tilemap_part(m_scroll2, m_videoram2, i, m_tilemap2, bitmap, cliprect);
239239   }
240240
241241   g_profiler.start(PROFILER_USER1);
242242#ifdef MAME_DEBUG
243   if (!screen.machine().input().code_pressed(KEYCODE_E))
243   if (!machine().input().code_pressed(KEYCODE_E))
244244#endif
245      draw_sprites (screen.machine(), bitmap, cliprect);
245      draw_sprites (machine(), bitmap, cliprect);
246246   g_profiler.stop();
247247   return 0;
248248}
trunk/src/mame/video/toaplan2.c
r17988r17989
293293   {
294294      bitmap.fill(0, cliprect);
295295      m_custom_priority_bitmap.fill(0, cliprect);
296      m_vdp1->gp9001_render_vdp(screen.machine(), bitmap, cliprect);
296      m_vdp1->gp9001_render_vdp(machine(), bitmap, cliprect);
297297   }
298298   if (m_vdp0)
299299   {
300300   //  bitmap.fill(0, cliprect);
301301      m_custom_priority_bitmap.fill(0, cliprect);
302      m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect);
302      m_vdp0->gp9001_render_vdp(machine(), bitmap, cliprect);
303303   }
304304
305305
r17988r17989
318318   {
319319      bitmap.fill(0, cliprect);
320320      m_custom_priority_bitmap.fill(0, cliprect);
321      m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect);
321      m_vdp0->gp9001_render_vdp(machine(), bitmap, cliprect);
322322   }
323323   if (m_vdp1)
324324   {
325325      m_secondary_render_bitmap.fill(0, cliprect);
326326      m_custom_priority_bitmap.fill(0, cliprect);
327      m_vdp1->gp9001_render_vdp(screen.machine(), m_secondary_render_bitmap, cliprect);
327      m_vdp1->gp9001_render_vdp(machine(), m_secondary_render_bitmap, cliprect);
328328   }
329329
330330
r17988r17989
414414   {
415415      bitmap.fill(0, cliprect);
416416      m_custom_priority_bitmap.fill(0, cliprect);
417      m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect);
417      m_vdp0->gp9001_render_vdp(machine(), bitmap, cliprect);
418418   }
419419
420420   return 0;
trunk/src/mame/video/cinemat.c
r17988r17989
212212   SCREEN_UPDATE32_CALL(vector);
213213   vector_clear_list();
214214
215   ccpu_wdt_timer_trigger(screen.machine().device("maincpu"));
215   ccpu_wdt_timer_trigger(machine().device("maincpu"));
216216
217217   return 0;
218218}
r17988r17989
227227
228228UINT32 cinemat_state::screen_update_spacewar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
229229{
230   int sw_option = screen.machine().root_device().ioport("INPUTS")->read();
230   int sw_option = machine().root_device().ioport("INPUTS")->read();
231231
232232   SCREEN_UPDATE32_CALL_MEMBER(cinemat);
233233
trunk/src/mame/video/mjkjidai.c
r17988r17989
128128UINT32 mjkjidai_state::screen_update_mjkjidai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
129129{
130130   if (!m_display_enable)
131      bitmap.fill(get_black_pen(screen.machine()), cliprect);
131      bitmap.fill(get_black_pen(machine()), cliprect);
132132   else
133133   {
134134      m_bg_tilemap->draw(bitmap, cliprect, 0,0);
135      draw_sprites(screen.machine(), bitmap,cliprect);
135      draw_sprites(machine(), bitmap,cliprect);
136136   }
137137   return 0;
138138}
trunk/src/mame/video/jailbrek.c
r17988r17989
118118   }
119119
120120   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
121   draw_sprites(screen.machine(), bitmap, cliprect);
121   draw_sprites(machine(), bitmap, cliprect);
122122   return 0;
123123}
trunk/src/mame/video/gaelco.c
r17988r17989
191191   m_tilemap[1]->set_scrolly(0, m_vregs[2]);
192192   m_tilemap[1]->set_scrollx(0, m_vregs[3]);
193193
194   screen.machine().priority_bitmap.fill(0, cliprect);
194   machine().priority_bitmap.fill(0, cliprect);
195195   bitmap.fill(0, cliprect);
196196
197197   m_tilemap[1]->draw(bitmap, cliprect, 3, 0);
r17988r17989
206206   m_tilemap[1]->draw(bitmap, cliprect, 0, 4);
207207   m_tilemap[0]->draw(bitmap, cliprect, 0, 4);
208208
209   draw_sprites(screen.machine(), bitmap, cliprect);
209   draw_sprites(machine(), bitmap, cliprect);
210210   return 0;
211211}
212212
r17988r17989
219219   m_tilemap[1]->set_scrolly(0, m_vregs[2]);
220220   m_tilemap[1]->set_scrollx(0, m_vregs[3]);
221221
222   screen.machine().priority_bitmap.fill(0, cliprect);
222   machine().priority_bitmap.fill(0, cliprect);
223223   bitmap.fill(0, cliprect);
224224
225225   m_tilemap[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3, 0);
r17988r17989
246246   m_tilemap[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 8);
247247   m_tilemap[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 8);
248248
249   draw_sprites(screen.machine(), bitmap, cliprect);
249   draw_sprites(machine(), bitmap, cliprect);
250250   return 0;
251251}
trunk/src/mame/video/wecleman.c
r17988r17989
10221022   int cloud_sx, cloud_sy;
10231023   int i, j, k;
10241024
1025   mrct = screen.machine().pens;
1025   mrct = machine().pens;
10261026
10271027   video_on = m_irqctrl & 0x40;
10281028
1029   set_led_status(screen.machine(), 0, m_selected_ip & 0x04);   // Start lamp
1029   set_led_status(machine(), 0, m_selected_ip & 0x04);   // Start lamp
10301030
10311031   fg_y = (m_txtram[0x0f24>>1] & (TILEMAP_DIMY - 1));
10321032   bg_y = (m_txtram[0x0f26>>1] & (TILEMAP_DIMY - 1));
r17988r17989
10541054   /* palette hacks! */
10551055   ((pen_t *)mrct)[0x27] = mrct[0x24];
10561056
1057   get_sprite_info(screen.machine());
1057   get_sprite_info(machine());
10581058
10591059   bitmap.fill(m_black_pen, cliprect);
10601060
10611061   /* Draw the road (lines which have priority 0x02) */
1062   if (video_on) wecleman_draw_road(screen.machine(), bitmap, cliprect, 0x02);
1062   if (video_on) wecleman_draw_road(machine(), bitmap, cliprect, 0x02);
10631063
10641064   /* Draw the background */
10651065   if (video_on) m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
r17988r17989
10731073      if (video_on)
10741074         draw_cloud(
10751075         bitmap,
1076         screen.machine().gfx[0],
1076         machine().gfx[0],
10771077         m_pageram+0x1800,
10781078         BMP_PAD, BMP_PAD,
10791079         41, 20,
r17988r17989
10931093   if (video_on) m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
10941094
10951095   /* Draw the road (lines which have priority 0x04) */
1096   if (video_on) wecleman_draw_road(screen.machine(), bitmap,cliprect, 0x04);
1096   if (video_on) wecleman_draw_road(machine(), bitmap,cliprect, 0x04);
10971097
10981098   /* Draw the sprites */
1099   if (video_on) sprite_draw(screen.machine(), bitmap,cliprect);
1099   if (video_on) sprite_draw(machine(), bitmap,cliprect);
11001100
11011101   /* Draw the text layer */
11021102   if (video_on) m_txt_tilemap->draw(bitmap, cliprect, 0, 0);
r17988r17989
11091109
11101110UINT32 wecleman_state::screen_update_hotchase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
11111111{
1112   device_t *k051316_1 = screen.machine().device("k051316_1");
1113   device_t *k051316_2 = screen.machine().device("k051316_2");
1112   device_t *k051316_1 = machine().device("k051316_1");
1113   device_t *k051316_2 = machine().device("k051316_2");
11141114   int video_on;
11151115
11161116   video_on = m_irqctrl & 0x40;
11171117
1118   set_led_status(screen.machine(), 0, m_selected_ip & 0x04);   // Start lamp
1118   set_led_status(machine(), 0, m_selected_ip & 0x04);   // Start lamp
11191119
1120   get_sprite_info(screen.machine());
1120   get_sprite_info(machine());
11211121
11221122   bitmap.fill(m_black_pen, cliprect);
11231123
r17988r17989
11271127
11281128   /* Draw the road */
11291129   if (video_on)
1130      hotchase_draw_road(screen.machine(), bitmap, cliprect);
1130      hotchase_draw_road(machine(), bitmap, cliprect);
11311131
11321132   /* Draw the sprites */
11331133   if (video_on)
1134      sprite_draw(screen.machine(), bitmap,cliprect);
1134      sprite_draw(machine(), bitmap,cliprect);
11351135
11361136   /* Draw the foreground (text) */
11371137   if (video_on)
trunk/src/mame/video/tankbust.c
r17988r17989
238238#endif
239239
240240   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
241   draw_sprites(screen.machine(), bitmap, cliprect);
241   draw_sprites(machine(), bitmap, cliprect);
242242   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
243243
244244   m_txt_tilemap->draw(bitmap, cliprect, 0,0);
trunk/src/mame/video/crbaloon.c
r17988r17989
148148{
149149   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
150150
151   draw_sprite_and_check_collision(screen.machine(), bitmap);
151   draw_sprite_and_check_collision(machine(), bitmap);
152152
153153   return 0;
154154}
trunk/src/mame/video/portrait.c
r17988r17989
203203   m_background->draw(bitmap, cliprect_scroll, 0, 0);
204204   m_foreground->draw(bitmap, cliprect_scroll, 0, 0);
205205
206   draw_sprites(screen.machine(), bitmap,cliprect);
206   draw_sprites(machine(), bitmap,cliprect);
207207   return 0;
208208}
trunk/src/mame/video/bosco.c
r17988r17989
299299      fg_clip.min_x = 28*8;
300300   }
301301
302   bitmap.fill(get_black_pen(screen.machine()), cliprect);
303   draw_stars(screen.machine(),bitmap,cliprect,flip_screen());
302   bitmap.fill(get_black_pen(machine()), cliprect);
303   draw_stars(machine(),bitmap,cliprect,flip_screen());
304304
305305   m_bg_tilemap->draw(bitmap, bg_clip, 0,0);
306306   m_fg_tilemap->draw(bitmap, fg_clip, 0,0);
307307
308   draw_sprites(screen.machine(), bitmap,cliprect);
308   draw_sprites(machine(), bitmap,cliprect);
309309
310310   /* draw the high priority characters */
311311   m_bg_tilemap->draw(bitmap, bg_clip, 1,0);
312312   m_fg_tilemap->draw(bitmap, fg_clip, 1,0);
313313
314   draw_bullets(screen.machine(), bitmap,cliprect);
314   draw_bullets(machine(), bitmap,cliprect);
315315
316316   return 0;
317317}
trunk/src/mame/video/munchmo.c
r17988r17989
150150
151151UINT32 munchmo_state::screen_update_mnchmobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
152152{
153   draw_background(screen.machine(), bitmap, cliprect);
154   draw_sprites(screen.machine(), bitmap, cliprect);
155   draw_status(screen.machine(), bitmap, cliprect);
153   draw_background(machine(), bitmap, cliprect);
154   draw_sprites(machine(), bitmap, cliprect);
155   draw_status(machine(), bitmap, cliprect);
156156   return 0;
157157}
trunk/src/mame/video/funkybee.c
r17988r17989
158158UINT32 funkybee_state::screen_update_funkybee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
159159{
160160   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
161   draw_sprites(screen.machine(), bitmap, cliprect);
162   draw_columns(screen.machine(), bitmap, cliprect);
161   draw_sprites(machine(), bitmap, cliprect);
162   draw_columns(machine(), bitmap, cliprect);
163163   return 0;
164164}
trunk/src/mame/video/galastrm.c
r17988r17989
434434
435435UINT32 galastrm_state::screen_update_galastrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
436436{
437   device_t *tc0100scn = screen.machine().device("tc0100scn");
438   device_t *tc0480scp = screen.machine().device("tc0480scp");
437   device_t *tc0100scn = machine().device("tc0100scn");
438   device_t *tc0480scp = machine().device("tc0480scp");
439439   UINT8 layer[5];
440440   UINT8 pivlayer[3];
441441   UINT16 priority;
442442   static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
443   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
443   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
444444
445445   rectangle clip(0, screen.width() -1, 0, screen.height() -1);
446446
r17988r17989
468468#if 0
469469   if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1)
470470   {
471      if (!screen.machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[0], 0, 1);
472      if (!screen.machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[1], 0, 4);
473      if (!screen.machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[2], 0, 4);
474      if (!screen.machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[3], 0, 4);
471      if (!machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[0], 0, 1);
472      if (!machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[1], 0, 4);
473      if (!machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[2], 0, 4);
474      if (!machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[3], 0, 4);
475475   }
476476   else
477477   {
478      if (!screen.machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[0], 0, 1);
479      if (!screen.machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[1], 0, 2);
480      if (!screen.machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[2], 0, 4);
481      if (!screen.machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[3], 0, 8);
478      if (!machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[0], 0, 1);
479      if (!machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[1], 0, 2);
480      if (!machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[2], 0, 4);
481      if (!machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[3], 0, 8);
482482   }
483483
484484   if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2)
r17988r17989
497497      }
498498   }
499499
500   draw_sprites_pre(screen.machine(), 42-X_OFFSET, -571+Y_OFFSET);
501   draw_sprites(screen.machine(),m_tmpbitmaps,clip,primasks,1);
500   draw_sprites_pre(machine(), 42-X_OFFSET, -571+Y_OFFSET);
501   draw_sprites(machine(),m_tmpbitmaps,clip,primasks,1);
502502
503503   copybitmap_trans(bitmap,m_polybitmap,0,0, 0,0,cliprect,0);
504504   m_polybitmap->fill(0, clip);
505   tc0610_rotate_draw(screen.machine(),m_polybitmap,m_tmpbitmaps,cliprect);
505   tc0610_rotate_draw(machine(),m_polybitmap,m_tmpbitmaps,cliprect);
506506
507507   priority_bitmap.fill(0, cliprect);
508   draw_sprites(screen.machine(),bitmap,cliprect,primasks,0);
508   draw_sprites(machine(),bitmap,cliprect,primasks,0);
509509
510   if (!screen.machine().input().code_pressed(KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
511   if (!screen.machine().input().code_pressed(KEYCODE_M)) tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0);
510   if (!machine().input().code_pressed(KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
511   if (!machine().input().code_pressed(KEYCODE_M)) tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0);
512512
513513
514514
r17988r17989
544544      }
545545   }
546546
547   draw_sprites_pre(screen.machine(), 42-X_OFFSET, -571+Y_OFFSET);
548   draw_sprites(screen.machine(),m_tmpbitmaps,clip,primasks,1);
547   draw_sprites_pre(machine(), 42-X_OFFSET, -571+Y_OFFSET);
548   draw_sprites(machine(),m_tmpbitmaps,clip,primasks,1);
549549
550550   copybitmap_trans(bitmap,m_polybitmap,0,0, 0,0,cliprect,0);
551551   m_polybitmap.fill(0, clip);
552   tc0610_rotate_draw(screen.machine(),m_polybitmap,m_tmpbitmaps,cliprect);
552   tc0610_rotate_draw(machine(),m_polybitmap,m_tmpbitmaps,cliprect);
553553
554554   priority_bitmap.fill(0, cliprect);
555   draw_sprites(screen.machine(),bitmap,cliprect,primasks,0);
555   draw_sprites(machine(),bitmap,cliprect,primasks,0);
556556
557557   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
558558   tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0);
trunk/src/mame/video/tetrisp2.c
r17988r17989
431431
432432   /* Black background color */
433433   bitmap.fill(0, cliprect);
434   screen.machine().priority_bitmap.fill(0);
434   machine().priority_bitmap.fill(0);
435435
436436   /* Flip Screen */
437437   if (flipscreen != m_flipscreen_old)
438438   {
439439      m_flipscreen_old = flipscreen;
440      screen.machine().tilemap().set_flip_all(flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
440      machine().tilemap().set_flip_all(flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
441441   }
442442
443443   /* Flip Screen */
r17988r17989
499499   else if (asc_pri == 2)
500500      m_tilemap_fg->draw(bitmap, cliprect, 0, 1 << 2);
501501
502   tetrisp2_draw_sprites(   screen.machine(), bitmap, screen.machine().priority_bitmap, cliprect, m_priority,
502   tetrisp2_draw_sprites(   machine(), bitmap, machine().priority_bitmap, cliprect, m_priority,
503503                     m_spriteram, m_spriteram.bytes(), 0, (m_systemregs[0x00] & 0x02)   );
504504   return 0;
505505}
r17988r17989
516516
517517   /* Black background color */
518518   bitmap.fill(0, cliprect);
519   screen.machine().priority_bitmap.fill(0);
519   machine().priority_bitmap.fill(0);
520520
521521   /* Flip Screen */
522522   if (flipscreen != m_flipscreen_old)
523523   {
524524      m_flipscreen_old = flipscreen;
525      screen.machine().tilemap().set_flip_all(flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
525      machine().tilemap().set_flip_all(flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
526526   }
527527
528528   /* Flip Screen */
r17988r17989
584584   else if (asc_pri == 2)
585585      m_tilemap_fg->draw(bitmap, cliprect, 0, 1 << 2);
586586
587   tetrisp2_draw_sprites(   screen.machine(), bitmap, screen.machine().priority_bitmap, cliprect, m_priority,
587   tetrisp2_draw_sprites(   machine(), bitmap, machine().priority_bitmap, cliprect, m_priority,
588588                     m_spriteram, m_spriteram.bytes(), 0, (m_systemregs[0x00] & 0x02)   );
589589   return 0;
590590}
r17988r17989
605605   m_tilemap_sub_rot->set_scrollx(0, m_rocknms_sub_rotregs[ 0 ] + 0x400);
606606   m_tilemap_sub_rot->set_scrolly(0, m_rocknms_sub_rotregs[ 2 ] + 0x400);
607607
608   bitmap.fill(screen.machine().pens[0x0000], cliprect);
609   screen.machine().priority_bitmap.fill(0, cliprect);
608   bitmap.fill(machine().pens[0x0000], cliprect);
609   machine().priority_bitmap.fill(0, cliprect);
610610
611611   asc_pri = scr_pri = rot_pri = 0;
612612
r17988r17989
646646   else if (asc_pri == 2)
647647      m_tilemap_sub_fg->draw(bitmap, cliprect, 0, 1 << 2);
648648
649   tetrisp2_draw_sprites(   screen.machine(), bitmap, screen.machine().priority_bitmap, cliprect, m_priority,
649   tetrisp2_draw_sprites(   machine(), bitmap, machine().priority_bitmap, cliprect, m_priority,
650650                     m_spriteram2, m_spriteram2.bytes(), 4, (m_systemregs[0x00] & 0x02)   );
651651
652652   return 0;
r17988r17989
666666   m_tilemap_rot->set_scrolly(0, m_rotregs[ 2 ] + 0x400);
667667
668668   /* Black background color */
669   bitmap.fill(screen.machine().pens[0x0000], cliprect);
670   screen.machine().priority_bitmap.fill(0, cliprect);
669   bitmap.fill(machine().pens[0x0000], cliprect);
670   machine().priority_bitmap.fill(0, cliprect);
671671
672672   asc_pri = scr_pri = rot_pri = 0;
673673
r17988r17989
707707   else if (asc_pri == 2)
708708      m_tilemap_fg->draw(bitmap, cliprect, 0, 1 << 2);
709709
710   tetrisp2_draw_sprites(   screen.machine(), bitmap, screen.machine().priority_bitmap, cliprect, m_priority,
710   tetrisp2_draw_sprites(   machine(), bitmap, machine().priority_bitmap, cliprect, m_priority,
711711                     m_spriteram, m_spriteram.bytes(), 0, (m_systemregs[0x00] & 0x02)   );
712712
713713   return 0;
r17988r17989
761761{
762762
763763   bitmap.fill(0, cliprect);
764   screen.machine().priority_bitmap.fill(0);
764   machine().priority_bitmap.fill(0);
765765
766   tetrisp2_draw_sprites(   screen.machine(), bitmap, screen.machine().priority_bitmap, cliprect, m_priority,
766   tetrisp2_draw_sprites(   machine(), bitmap, machine().priority_bitmap, cliprect, m_priority,
767767                     m_spriteram, m_spriteram.bytes(), 1, (m_systemregs[0x00] & 0x02)   );
768768   return 0;
769769}
r17988r17989
771771{
772772
773773   bitmap.fill(0, cliprect);
774   screen.machine().priority_bitmap.fill(0);
774   machine().priority_bitmap.fill(0);
775775
776   tetrisp2_draw_sprites(   screen.machine(), bitmap, screen.machine().priority_bitmap, cliprect, m_priority,
776   tetrisp2_draw_sprites(   machine(), bitmap, machine().priority_bitmap, cliprect, m_priority,
777777                     m_spriteram3, m_spriteram3.bytes(), 1, (m_systemregs[0x00] & 0x02)   );
778778   return 0;
779779}
r17988r17989
782782{
783783
784784   bitmap.fill(0, cliprect);
785   screen.machine().priority_bitmap.fill(0);
785   machine().priority_bitmap.fill(0);
786786
787   tetrisp2_draw_sprites(   screen.machine(), bitmap, screen.machine().priority_bitmap, cliprect, m_priority,
787   tetrisp2_draw_sprites(   machine(), bitmap, machine().priority_bitmap, cliprect, m_priority,
788788                     m_spriteram2, m_spriteram2.bytes(), 0, (m_systemregs[0x00] & 0x02)   );
789789
790790   m_tilemap_fg->draw(bitmap, cliprect, 0, 1 << 2);
trunk/src/mame/video/lastduel.c
r17988r17989
260260
261261   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
262262   m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
263   draw_sprites(screen.machine(), bitmap, cliprect, 0);
263   draw_sprites(machine(), bitmap, cliprect, 0);
264264   m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
265   draw_sprites(screen.machine(), bitmap, cliprect, 1);
265   draw_sprites(machine(), bitmap, cliprect, 1);
266266   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
267267   return 0;
268268}
r17988r17989
273273   if (m_tilemap_priority)
274274   {
275275      m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | TILEMAP_DRAW_OPAQUE, 0);
276      draw_sprites(screen.machine(), bitmap, cliprect, 0);
276      draw_sprites(machine(), bitmap, cliprect, 0);
277277      m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
278278      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
279      draw_sprites(screen.machine(), bitmap, cliprect, 1);
279      draw_sprites(machine(), bitmap, cliprect, 1);
280280   }
281281   else
282282   {
283283      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
284284      m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
285      draw_sprites(screen.machine(), bitmap, cliprect, 0);
285      draw_sprites(machine(), bitmap, cliprect, 0);
286286      m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
287      draw_sprites(screen.machine(), bitmap, cliprect, 1);
287      draw_sprites(machine(), bitmap, cliprect, 1);
288288   }
289289   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
290290   return 0;
trunk/src/mame/video/alpha68k.c
r17988r17989
128128{
129129
130130   if (m_last_bank != m_bank_base)
131      screen.machine().tilemap().mark_all_dirty();
131      machine().tilemap().mark_all_dirty();
132132
133133   m_last_bank = m_bank_base;
134   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
134   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
135135
136136   bitmap.fill(2047, cliprect);
137137//AT
138   draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800);
139   draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800);
140   draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x0800);
141   draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x0000, 0x07c0);
138   draw_sprites(machine(), bitmap, cliprect, 0, 0x07c0, 0x0800);
139   draw_sprites(machine(), bitmap, cliprect, 1, 0x0000, 0x0800);
140   draw_sprites(machine(), bitmap, cliprect, 2, 0x0000, 0x0800);
141   draw_sprites(machine(), bitmap, cliprect, 0, 0x0000, 0x07c0);
142142//ZT
143143   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
144144   return 0;
r17988r17989
274274   UINT16 *spriteram = m_spriteram;
275275
276276   if (m_last_bank != m_bank_base)
277      screen.machine().tilemap().mark_all_dirty();
277      machine().tilemap().mark_all_dirty();
278278
279279   m_last_bank = m_bank_base;
280   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
280   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
281281
282282   bitmap.fill(4095, cliprect);
283283
284284   /* This appears to be correct priority */
285285   if (m_microcontroller_id == 0x8814) /* Sky Adventure */
286286   {
287      draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0, 0x8000, 0x7fff);
288      draw_sprites_V(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
287      draw_sprites_V(machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0, 0x8000, 0x7fff);
288      draw_sprites_V(machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
289289      //AT: *KLUDGE* fixes priest priority in level 1(could be a game bug)
290290      if (spriteram[0x1bde] == 0x24 && (spriteram[0x1bdf] >> 8) == 0x3b)
291291      {
292         draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff);
293         draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff);
292         draw_sprites_V(machine(), bitmap, cliprect, 2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff);
293         draw_sprites_V(machine(), bitmap, cliprect, 2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff);
294294      }
295295      else
296         draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
296         draw_sprites_V(machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
297297
298      draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0, 0x8000, 0x7fff);
298      draw_sprites_V(machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0, 0x8000, 0x7fff);
299299   }
300300   else   /* gangwars */
301301   {
302      draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x8000, 0, 0x7fff);
303      draw_sprites_V(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
304      draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
305      draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x8000, 0, 0x7fff);
302      draw_sprites_V(machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x8000, 0, 0x7fff);
303      draw_sprites_V(machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
304      draw_sprites_V(machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
305      draw_sprites_V(machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x8000, 0, 0x7fff);
306306   }
307307
308308   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
r17988r17989
313313{
314314
315315   if (m_last_bank != m_bank_base)
316      screen.machine().tilemap().mark_all_dirty();
316      machine().tilemap().mark_all_dirty();
317317
318318   m_last_bank = m_bank_base;
319   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
319   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
320320
321321   bitmap.fill(4095, cliprect);
322322
323323   /* This appears to be correct priority */
324   draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff);
325   draw_sprites_V(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
326   draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
327   draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x4000, 0x8000, 0x3fff);
324   draw_sprites_V(machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff);
325   draw_sprites_V(machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
326   draw_sprites_V(machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
327   draw_sprites_V(machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x4000, 0x8000, 0x3fff);
328328
329329   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
330330   return 0;
r17988r17989
364364{
365365   int yshift = (m_microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off
366366
367   bitmap.fill(get_black_pen(screen.machine()), cliprect);
367   bitmap.fill(get_black_pen(machine()), cliprect);
368368
369369   /* This appears to be correct priority */
370   draw_sprites_I(screen.machine(), bitmap, cliprect, 2, 0x0800, yshift);
371   draw_sprites_I(screen.machine(), bitmap, cliprect, 3, 0x0c00, yshift);
372   draw_sprites_I(screen.machine(), bitmap, cliprect, 1, 0x0400, yshift);
370   draw_sprites_I(machine(), bitmap, cliprect, 2, 0x0800, yshift);
371   draw_sprites_I(machine(), bitmap, cliprect, 3, 0x0c00, yshift);
372   draw_sprites_I(machine(), bitmap, cliprect, 1, 0x0400, yshift);
373373   return 0;
374374}
375375//ZT
r17988r17989
496496
497497UINT32 alpha68k_state::screen_update_kyros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
498498{
499   colortable_entry_set_value(screen.machine().colortable, 0x100, *m_videoram & 0xff);
499   colortable_entry_set_value(machine().colortable, 0x100, *m_videoram & 0xff);
500500   bitmap.fill(0x100, cliprect); //AT
501501
502   kyros_draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0800);
503   kyros_draw_sprites(screen.machine(), bitmap, cliprect, 3, 0x0c00);
504   kyros_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x0400);
502   kyros_draw_sprites(machine(), bitmap, cliprect, 2, 0x0800);
503   kyros_draw_sprites(machine(), bitmap, cliprect, 3, 0x0c00);
504   kyros_draw_sprites(machine(), bitmap, cliprect, 1, 0x0400);
505505   return 0;
506506}
507507
r17988r17989
555555
556556UINT32 alpha68k_state::screen_update_sstingry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
557557{
558   colortable_entry_set_value(screen.machine().colortable, 0x100, *m_videoram & 0xff);
558   colortable_entry_set_value(machine().colortable, 0x100, *m_videoram & 0xff);
559559   bitmap.fill(0x100, cliprect); //AT
560560
561   sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0800);
562   sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 3, 0x0c00);
563   sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x0400);
561   sstingry_draw_sprites(machine(), bitmap, cliprect, 2, 0x0800);
562   sstingry_draw_sprites(machine(), bitmap, cliprect, 3, 0x0c00);
563   sstingry_draw_sprites(machine(), bitmap, cliprect, 1, 0x0400);
564564   return 0;
565565}
trunk/src/mame/video/drgnmst.c
r17988r17989
186186
187187   }
188188
189   draw_sprites(screen.machine(),bitmap,cliprect);
189   draw_sprites(machine(),bitmap,cliprect);
190190
191191//  popmessage ("x %04x x %04x x %04x x %04x x %04x", m_vidregs2[0], m_vidregs[12], m_vidregs[13], m_vidregs[14], m_vidregs[15]);
192192//  popmessage ("x %04x x %04x y %04x y %04x z %04x z %04x",m_vidregs[0],m_vidregs[1],m_vidregs[2],m_vidregs[3],m_vidregs[4],m_vidregs[5]);
trunk/src/mame/video/freekick.c
r17988r17989
134134UINT32 freekick_state::screen_update_gigas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
135135{
136136   m_freek_tilemap->draw(bitmap, cliprect, 0, 0);
137   gigas_draw_sprites(screen.machine(), bitmap, cliprect);
137   gigas_draw_sprites(machine(), bitmap, cliprect);
138138   return 0;
139139}
140140
141141UINT32 freekick_state::screen_update_pbillrd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
142142{
143143   m_freek_tilemap->draw(bitmap, cliprect, 0, 0);
144   pbillrd_draw_sprites(screen.machine(), bitmap, cliprect);
144   pbillrd_draw_sprites(machine(), bitmap, cliprect);
145145   return 0;
146146}
147147
148148UINT32 freekick_state::screen_update_freekick(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
149149{
150150   m_freek_tilemap->draw(bitmap, cliprect, 0, 0);
151   freekick_draw_sprites(screen.machine(), bitmap, cliprect);
151   freekick_draw_sprites(machine(), bitmap, cliprect);
152152   return 0;
153153}
trunk/src/mame/video/namcos22.c
r17988r17989
27812781
27822782UINT32 namcos22_state::screen_update_namcos22s(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
27832783{
2784   UpdateVideoMixer(screen.machine());
2785   UpdatePalette(screen.machine());
2786   namcos22s_recalc_czram(screen.machine());
2787   screen.machine().priority_bitmap.fill(0, cliprect);
2784   UpdateVideoMixer(machine());
2785   UpdatePalette(machine());
2786   namcos22s_recalc_czram(machine());
2787   machine().priority_bitmap.fill(0, cliprect);
27882788
27892789   // background color
27902790   rgbint bg_color;
r17988r17989
27992799
28002800   // layers
28012801   UINT8 layer = nthbyte(m_gamma,0x1f);
2802   if (layer&4) DrawCharacterLayer(screen.machine(), bitmap, cliprect);
2803   if (layer&2) DrawSprites(screen.machine(), bitmap, cliprect);
2804   if (layer&1) DrawPolygons(screen.machine(), bitmap);
2805   RenderScene(screen.machine(), bitmap );
2806   if (layer&4) namcos22s_mix_textlayer(screen.machine(), bitmap, cliprect, 6);
2807   ApplyGamma(screen.machine(), bitmap);
2802   if (layer&4) DrawCharacterLayer(machine(), bitmap, cliprect);
2803   if (layer&2) DrawSprites(machine(), bitmap, cliprect);
2804   if (layer&1) DrawPolygons(machine(), bitmap);
2805   RenderScene(machine(), bitmap );
2806   if (layer&4) namcos22s_mix_textlayer(machine(), bitmap, cliprect, 6);
2807   ApplyGamma(machine(), bitmap);
28082808
28092809   // debug stuff
28102810#if ALLOW_MEMDUMP
2811   if( screen.machine().input().code_pressed(KEYCODE_D) )
2811   if( machine().input().code_pressed(KEYCODE_D) )
28122812   {
28132813      FILE *f = fopen( "dump.txt", "wb" );
28142814      if( f )
r17988r17989
28522852         //Dump(space, f,0xc00000, 0xc1ffff, "polygonram");
28532853         fclose( f );
28542854      }
2855      while( screen.machine().input().code_pressed(KEYCODE_D) ){}
2855      while( machine().input().code_pressed(KEYCODE_D) ){}
28562856   }
28572857#endif
28582858
r17988r17989
28632863
28642864UINT32 namcos22_state::screen_update_namcos22(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
28652865{
2866   UpdateVideoMixer(screen.machine());
2867   UpdatePalette(screen.machine());
2868   screen.machine().priority_bitmap.fill(0, cliprect);
2869   bitmap.fill(get_black_pen(screen.machine()), cliprect);
2870   DrawPolygons(screen.machine(), bitmap);
2871   RenderScene(screen.machine(), bitmap);
2872   DrawCharacterLayer(screen.machine(), bitmap, cliprect);
2873   ApplyGamma(screen.machine(), bitmap);
2866   UpdateVideoMixer(machine());
2867   UpdatePalette(machine());
2868   machine().priority_bitmap.fill(0, cliprect);
2869   bitmap.fill(get_black_pen(machine()), cliprect);
2870   DrawPolygons(machine(), bitmap);
2871   RenderScene(machine(), bitmap);
2872   DrawCharacterLayer(machine(), bitmap, cliprect);
2873   ApplyGamma(machine(), bitmap);
28742874
28752875#if ALLOW_MEMDUMP
2876   if( screen.machine().input().code_pressed(KEYCODE_D) )
2876   if( machine().input().code_pressed(KEYCODE_D) )
28772877   {
28782878      FILE *f = fopen( "dump.txt", "wb" );
28792879      if( f )
r17988r17989
28872887         //Dump(space, f,0x70000000, 0x7001ffff, "polygonram");
28882888         fclose( f );
28892889      }
2890      while( screen.machine().input().code_pressed(KEYCODE_D) ){}
2890      while( machine().input().code_pressed(KEYCODE_D) ){}
28912891   }
28922892#endif
28932893
trunk/src/mame/video/redclash.c
r17988r17989
421421{
422422   // falling edge
423423   if (!state)
424      redclash_update_stars_state(screen.machine());
424      redclash_update_stars_state(machine());
425425}
426426
427427UINT32 ladybug_state::screen_update_redclash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
428428{
429429
430   bitmap.fill(get_black_pen(screen.machine()), cliprect);
431   redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 0, 0x00, 0xff);
432   draw_sprites(screen.machine(), bitmap, cliprect);
433   draw_bullets(screen.machine(), bitmap, cliprect);
430   bitmap.fill(get_black_pen(machine()), cliprect);
431   redclash_draw_stars(machine(), bitmap, cliprect, 0x60, 0, 0x00, 0xff);
432   draw_sprites(machine(), bitmap, cliprect);
433   draw_bullets(machine(), bitmap, cliprect);
434434   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
435435   return 0;
436436}
trunk/src/mame/video/vicdual.c
r17988r17989
138138
139139UINT32 vicdual_state::screen_update_vicdual_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
140140{
141   if (vicdual_is_cabinet_color(screen.machine()))
141   if (vicdual_is_cabinet_color(machine()))
142142      SCREEN_UPDATE32_CALL_MEMBER(vicdual_color);
143143   else
144144      SCREEN_UPDATE32_CALL_MEMBER(vicdual_bw);
trunk/src/mame/video/galaxold.c
r17988r17989
17561756UINT32 galaxold_state::screen_update_galaxold(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
17571757{
17581758
1759   (*m_draw_background)(screen.machine(), bitmap, cliprect);
1759   (*m_draw_background)(machine(), bitmap, cliprect);
17601760
17611761   if (m_stars_on)
17621762   {
1763      (*m_draw_stars)(screen.machine(), bitmap, cliprect);
1763      (*m_draw_stars)(machine(), bitmap, cliprect);
17641764   }
17651765
17661766
r17988r17989
17681768
17691769   if (m_draw_bullets)
17701770   {
1771      draw_bullets_common(screen.machine(), bitmap, cliprect);
1771      draw_bullets_common(machine(), bitmap, cliprect);
17721772   }
17731773
17741774
1775   draw_sprites(screen.machine(), bitmap, m_spriteram, m_spriteram.bytes());
1775   draw_sprites(machine(), bitmap, m_spriteram, m_spriteram.bytes());
17761776
17771777   if (m_spriteram2_present)
17781778   {
1779      draw_sprites(screen.machine(), bitmap, m_spriteram2, m_spriteram2.bytes());
1779      draw_sprites(machine(), bitmap, m_spriteram2, m_spriteram2.bytes());
17801780   }
17811781   return 0;
17821782}
r17988r17989
17871787   int i, j;
17881788   UINT8 color;
17891789
1790   (*m_draw_background)(screen.machine(), bitmap, cliprect);
1790   (*m_draw_background)(machine(), bitmap, cliprect);
17911791
17921792   if (m_stars_on)
17931793   {
1794      (*m_draw_stars)(screen.machine(), bitmap, cliprect);
1794      (*m_draw_stars)(machine(), bitmap, cliprect);
17951795   }
17961796
17971797   /* save the background for drawing it again later, if background has priority over characters */
r17988r17989
18011801
18021802   if (m_draw_bullets)
18031803   {
1804      draw_bullets_common(screen.machine(), bitmap, cliprect);
1804      draw_bullets_common(machine(), bitmap, cliprect);
18051805   }
18061806
1807   draw_sprites(screen.machine(), bitmap, m_spriteram, m_spriteram.bytes());
1807   draw_sprites(machine(), bitmap, m_spriteram, m_spriteram.bytes());
18081808
18091809   if (m_dambustr_bg_priority)
18101810   {
18111811      /* draw the upper part of the background, as it has priority */
1812      dambustr_draw_upper_background(screen.machine(), bitmap, cliprect);
1812      dambustr_draw_upper_background(machine(), bitmap, cliprect);
18131813
18141814      /* only rows with color code > 3 are stronger than the background */
18151815      memset(m_dambustr_videoram2, 0x20, 0x0400);
trunk/src/mame/video/centiped.c
r17988r17989
442442      int x = spriteram[offs + 0x20];
443443      int y = 240 - spriteram[offs + 0x10];
444444
445      drawgfx_transmask(bitmap, spriteclip, screen.machine().gfx[1], code, color, flipx, flipy, x, y, m_penmask[color & 0x3f]);
445      drawgfx_transmask(bitmap, spriteclip, machine().gfx[1], code, color, flipx, flipy, x, y, m_penmask[color & 0x3f]);
446446   }
447447   return 0;
448448}
r17988r17989
451451UINT32 centiped_state::screen_update_warlords(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
452452{
453453   UINT8 *spriteram = m_spriteram;
454   int upright_mode = screen.machine().root_device().ioport("IN0")->read() & 0x80;
454   int upright_mode = machine().root_device().ioport("IN0")->read() & 0x80;
455455   int offs;
456456
457457   /* if the cocktail/upright switch flipped, force refresh */
r17988r17989
487487         flipx = !flipx;
488488      }
489489
490      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code, color, flipx, flipy, x, y, 0);
490      drawgfx_transpen(bitmap, cliprect, machine().gfx[1], code, color, flipx, flipy, x, y, 0);
491491   }
492492   return 0;
493493}
r17988r17989
518518      int x = spriteram[offs + 0x20];
519519      int y = 240 - spriteram[offs + 0x10];
520520
521      drawgfx_transpen(bitmap, spriteclip, screen.machine().gfx[1], code, color & 0x3f, 1, flipy, x, y, 0);
521      drawgfx_transpen(bitmap, spriteclip, machine().gfx[1], code, color & 0x3f, 1, flipy, x, y, 0);
522522   }
523523   return 0;
524524}
r17988r17989
555555         flipy = !flipy;
556556      }
557557
558      drawgfx_transmask(bitmap, spriteclip, screen.machine().gfx[1], code, color, flipx, flipy, x, y, m_penmask[color & 0x3f]);
558      drawgfx_transmask(bitmap, spriteclip, machine().gfx[1], code, color, flipx, flipy, x, y, m_penmask[color & 0x3f]);
559559   }
560560   return 0;
561561}
trunk/src/mame/video/wgp.c
r17988r17989
645645   UINT8 layer[3];
646646
647647#ifdef MAME_DEBUG
648   if (screen.machine().input().code_pressed_once (KEYCODE_V))
648   if (machine().input().code_pressed_once (KEYCODE_V))
649649   {
650650      m_dislayer[0] ^= 1;
651651      popmessage("piv0: %01x",m_dislayer[0]);
652652   }
653653
654   if (screen.machine().input().code_pressed_once (KEYCODE_B))
654   if (machine().input().code_pressed_once (KEYCODE_B))
655655   {
656656      m_dislayer[1] ^= 1;
657657      popmessage("piv1: %01x",m_dislayer[1]);
658658   }
659659
660   if (screen.machine().input().code_pressed_once (KEYCODE_N))
660   if (machine().input().code_pressed_once (KEYCODE_N))
661661   {
662662      m_dislayer[2] ^= 1;
663663      popmessage("piv2: %01x",m_dislayer[2]);
664664   }
665665
666   if (screen.machine().input().code_pressed_once (KEYCODE_M))
666   if (machine().input().code_pressed_once (KEYCODE_M))
667667   {
668668      m_dislayer[3] ^= 1;
669669      popmessage("TC0100SCN top bg layer: %01x",m_dislayer[3]);
r17988r17989
695695#ifdef MAME_DEBUG
696696   if (m_dislayer[layer[0]] == 0)
697697#endif
698   wgp_piv_layer_draw(screen.machine(), bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
698   wgp_piv_layer_draw(machine(), bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
699699
700700#ifdef MAME_DEBUG
701701   if (m_dislayer[layer[1]] == 0)
702702#endif
703   wgp_piv_layer_draw(screen.machine(), bitmap, cliprect, layer[1], 0, 2);
703   wgp_piv_layer_draw(machine(), bitmap, cliprect, layer[1], 0, 2);
704704
705705#ifdef MAME_DEBUG
706706   if (m_dislayer[layer[2]] == 0)
707707#endif
708   wgp_piv_layer_draw(screen.machine(), bitmap, cliprect, layer[2], 0, 4);
708   wgp_piv_layer_draw(machine(), bitmap, cliprect, layer[2], 0, 4);
709709
710   draw_sprites(screen.machine(), bitmap, cliprect, 16);
710   draw_sprites(machine(), bitmap, cliprect, 16);
711711
712712/* ... then here we should apply rotation from wgp_sate_ctrl[] to the bitmap before we draw the TC0100SCN layers on it */
713713   layer[0] = tc0100scn_bottomlayer(m_tc0100scn);
trunk/src/mame/video/welltris.c
r17988r17989
238238   m_char_tilemap->set_scrollx(0, m_scrollx);
239239   m_char_tilemap->set_scrolly(0, m_scrolly);
240240
241   draw_background(screen.machine(), bitmap, cliprect);
241   draw_background(machine(), bitmap, cliprect);
242242   m_char_tilemap->draw(bitmap, cliprect, 0, 0);
243   draw_sprites(screen.machine(), bitmap, cliprect);
243   draw_sprites(machine(), bitmap, cliprect);
244244   return 0;
245245}
trunk/src/mame/video/sprint8.c
r17988r17989
156156
157157UINT32 sprint8_state::screen_update_sprint8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
158158{
159   set_pens(this, screen.machine().colortable);
159   set_pens(this, machine().colortable);
160160   m_tilemap1->draw(bitmap, cliprect, 0, 0);
161   draw_sprites(screen.machine(), bitmap, cliprect);
161   draw_sprites(machine(), bitmap, cliprect);
162162   return 0;
163163}
164164
r17988r17989
170170   {
171171      int x;
172172      int y;
173      const rectangle &visarea = screen.machine().primary_screen->visible_area();
173      const rectangle &visarea = machine().primary_screen->visible_area();
174174
175175      m_tilemap2->draw(m_helper2, visarea, 0, 0);
176176
177177      m_helper1.fill(0x20, visarea);
178178
179      draw_sprites(screen.machine(), m_helper1, visarea);
179      draw_sprites(machine(), m_helper1, visarea);
180180
181181      for (y = visarea.min_y; y <= visarea.max_y; y++)
182182      {
r17988r17989
185185
186186         for (x = visarea.min_x; x <= visarea.max_x; x++)
187187            if (p1[x] != 0x20 && p2[x] == 0x23)
188               screen.machine().scheduler().timer_set(screen.machine().primary_screen->time_until_pos(y + 24, x),
188               machine().scheduler().timer_set(machine().primary_screen->time_until_pos(y + 24, x),
189189                     FUNC(sprint8_collision_callback),
190                     colortable_entry_get_value(screen.machine().colortable, p1[x]));
190                     colortable_entry_get_value(machine().colortable, p1[x]));
191191      }
192192   }
193193}
trunk/src/mame/video/ssv.c
r17988r17989
981981   SCREEN_UPDATE16_CALL_MEMBER(ssv);
982982
983983   // draw zooming sprites
984   m_gdfs_st0020->st0020_draw_all(screen.machine(), bitmap, cliprect);
984   m_gdfs_st0020->st0020_draw_all(machine(), bitmap, cliprect);
985985
986986   m_gdfs_tmap->set_scrollx(0, m_gdfs_tmapscroll[0x0c/2]);
987987   m_gdfs_tmap->set_scrolly(0, m_gdfs_tmapscroll[0x10/2]);
r17988r17989
10391039   if (!m_enable_video)
10401040      return 0;
10411041
1042   draw_layer(screen.machine(), bitmap, clip, 0);   // "background layer"
1042   draw_layer(machine(), bitmap, clip, 0);   // "background layer"
10431043
1044   draw_sprites(screen.machine(), bitmap, clip);   // sprites list
1044   draw_sprites(machine(), bitmap, clip);   // sprites list
10451045
10461046
10471047   return 0;
trunk/src/mame/video/dec0.c
r17988r17989
4949
5050   flip_screen_set(m_tilegen1->get_flip_state());
5151
52   m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
53   m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, 0x08, 0x0f);
54   m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
52   m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
53   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, 0x08, 0x0f);
54   m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
5555
5656   /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
5757
58   m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, 0x00, 0x0f);
59   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
58   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, 0x00, 0x0f);
59   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
6060   return 0;
6161}
6262
r17988r17989
6969   /* WARNING: inverted wrt Midnight Resistance */
7070   if ((m_pri & 0x01) == 0)
7171   {
72      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
73      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
72      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
73      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
7474
7575      if (m_pri & 2)
76         m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
76         m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
7777
78      m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
78      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
7979
8080      if (m_pri & 4)
81         m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
81         m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
8282   }
8383   else
8484   {
85      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
86      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
85      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
86      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
8787
8888      if (m_pri & 2)
89         m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
89         m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
9090
91      m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
91      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
9292
9393      if (m_pri & 4)
94         m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
94         m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
9595   }
9696
97   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
97   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
9898   return 0;
9999}
100100
r17988r17989
117117      /* Robocop uses it only for the title screen, so this might be just */
118118      /* completely wrong. The top 8 bits of the register might mean */
119119      /* something (they are 0x80 in midres, 0x00 here) */
120      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
120      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
121121
122122      if (m_pri & 0x02)
123         m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
123         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
124124
125      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
125      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
126126   }
127127   else
128128   {
129      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
129      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
130130
131131      if (m_pri & 0x02)
132         m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
132         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
133133
134      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
134      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
135135   }
136136
137137   if (m_pri & 0x02)
138      m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
138      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
139139   else
140      m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
140      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
141141
142   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
142   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
143143   return 0;
144144}
145145
r17988r17989
151151   // layer enables seem different... where are they?
152152
153153   // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
154   address_space &space = screen.machine().driver_data()->generic_space();
154   address_space &space = machine().driver_data()->generic_space();
155155   deco_bac06_pf_control_0_w(m_tilegen1,space,0,0x0003, 0x00ff); // 8x8
156156   deco_bac06_pf_control_0_w(m_tilegen1,space,1,0x0003, 0x00ff);
157157   deco_bac06_pf_control_0_w(m_tilegen1,space,2,0x0000, 0x00ff);
r17988r17989
187187
188188   if (m_pri & 0x01)
189189   {
190      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
190      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
191191
192192      if (m_pri & 0x02)
193         m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
193         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
194194
195      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
195      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
196196   }
197197   else
198198   {
199      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
199      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
200200
201201      if (m_pri & 0x02)
202         m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
202         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
203203
204      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
204      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
205205   }
206206
207207   if (m_pri & 0x02)
208      m_spritegen->draw_sprites_bootleg(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
208      m_spritegen->draw_sprites_bootleg(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
209209   else
210      m_spritegen->draw_sprites_bootleg(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
210      m_spritegen->draw_sprites_bootleg(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
211211
212   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
212   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
213213   return 0;
214214}
215215
r17988r17989
219219   // layer enables seem different... where are they?
220220
221221   // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
222   address_space &space = screen.machine().driver_data()->generic_space();
222   address_space &space = machine().driver_data()->generic_space();
223223   deco_bac06_pf_control_0_w(m_tilegen1,space,0,0x0003, 0x00ff); // 8x8
224224   deco_bac06_pf_control_0_w(m_tilegen1,space,1,0x0003, 0x00ff);
225225   deco_bac06_pf_control_0_w(m_tilegen1,space,2,0x0000, 0x00ff);
r17988r17989
247247
248248   flip_screen_set(m_tilegen1->get_flip_state());
249249
250   m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
251   m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
250   m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
251   m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
252252
253   m_spritegen->draw_sprites_bootleg(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
253   m_spritegen->draw_sprites_bootleg(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
254254
255255   /* Redraw top 8 pens of top 8 palettes over sprites */
256256   if (m_pri&0x80)
257      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
257      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
258258
259   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
259   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
260260   return 0;
261261}
262262
r17988r17989
270270
271271   /* This game doesn't have the extra playfield chip on the game board, but
272272    the palette does show through. */
273   bitmap.fill(screen.machine().pens[768], cliprect);
274   m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
275   m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
276   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
273   bitmap.fill(machine().pens[768], cliprect);
274   m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
275   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
276   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
277277   return 0;
278278}
279279
r17988r17989
285285
286286   if (m_pri & 0x01)
287287   {
288      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
289      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
288      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
289      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
290290   }
291291   else
292292   {
293      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
294      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
293      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
294      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
295295   }
296296
297   m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
298   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
297   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
298   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
299299   return 0;
300300}
301301
r17988r17989
305305{
306306   flip_screen_set(m_tilegen1->get_flip_state());
307307
308   m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
309   m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
308   m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
309   m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
310310
311   m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
311   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
312312
313313   /* Redraw top 8 pens of top 8 palettes over sprites */
314314   if (m_pri&0x80)
315      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
315      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
316316
317   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
317   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
318318   return 0;
319319}
320320
r17988r17989
332332
333333   if (m_pri & 0x01)
334334   {
335      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
335      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
336336
337337      if (m_pri & 0x02)
338         m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
338         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
339339
340      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
340      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
341341   }
342342   else
343343   {
344      m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
344      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
345345
346346      if (m_pri & 0x02)
347         m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
347         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
348348
349      m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
349      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
350350   }
351351
352352   if (m_pri & 0x02)
353      m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f);
353      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f);
354354   else
355      m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
355      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
356356
357   m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
357   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
358358   return 0;
359359}
360360
trunk/src/mame/video/taitoair.c
r17988r17989
601601
602602   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, 0, 0);
603603
604   draw_sprites(screen.machine(), bitmap, cliprect, 0);
604   draw_sprites(machine(), bitmap, cliprect, 0);
605605
606606   copybitmap_trans(bitmap, *m_framebuffer[1], 0, 0, 0, 0, cliprect, 0);
607607
608608   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0);
609609
610   draw_sprites(screen.machine(), bitmap, cliprect, 1);
610   draw_sprites(machine(), bitmap, cliprect, 1);
611611
612612   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 2, 0, 0);
613613
trunk/src/mame/video/atarig42.c
r17988r17989
179179
180180UINT32 atarig42_state::screen_update_atarig42(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
181181{
182   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
182   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
183183
184184   /* draw the playfield */
185185   priority_bitmap.fill(0, cliprect);
trunk/src/mame/video/tceptor.c
r17988r17989
534534   {
535535      m_c45_road->draw(bitmap, cliprect, pri * 2);
536536      m_c45_road->draw(bitmap, cliprect, pri * 2 + 1);
537      draw_sprites(screen.machine(), bitmap, cliprect, pri);
537      draw_sprites(machine(), bitmap, cliprect, pri);
538538   }
539539
540540   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/cop01.c
r17988r17989
207207   m_bg_tilemap->set_scrolly(0, m_vreg[3]);
208208
209209   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
210   draw_sprites(screen.machine(), bitmap, cliprect);
210   draw_sprites(machine(), bitmap, cliprect);
211211   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
212212   m_fg_tilemap->draw(bitmap, cliprect, 0, 0 );
213213   return 0;
trunk/src/mame/video/aquarium.c
r17988r17989
163163   m_bak_tilemap->draw(bitmap, cliprect, 0, 0);
164164   m_mid_tilemap->draw(bitmap, cliprect, 0, 0);
165165
166   draw_sprites(screen.machine(), bitmap, cliprect, 16);
166   draw_sprites(machine(), bitmap, cliprect, 16);
167167
168168   m_bak_tilemap->draw(bitmap, cliprect, 1, 0);
169169   m_mid_tilemap->draw(bitmap, cliprect, 1, 0);
trunk/src/mame/video/metro.c
r17988r17989
723723   m_sprite_yoffs = m_videoregs[0x04 / 2] - screen.height() / 2;
724724
725725   /* The background color is selected by a register */
726   screen.machine().priority_bitmap.fill(0, cliprect);
726   machine().priority_bitmap.fill(0, cliprect);
727727   bitmap.fill((m_videoregs[0x12/2] & 0x0fff) + 0x1000, cliprect);
728728
729729   /*  Screen Control Register:
r17988r17989
761761
762762
763763#ifdef MAME_DEBUG
764if (screen.machine().input().code_pressed(KEYCODE_Z))
764if (machine().input().code_pressed(KEYCODE_Z))
765765{
766766   int msk = 0;
767   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
768   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
769   if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 4;
770   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
767   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
768   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
769   if (machine().input().code_pressed(KEYCODE_E))   msk |= 4;
770   if (machine().input().code_pressed(KEYCODE_A))   msk |= 8;
771771   if (msk != 0)
772772   {
773773      bitmap.fill(0, cliprect);
r17988r17989
785785      k053936_zoom_draw(m_k053936, bitmap, cliprect, m_k053936_tilemap, 0, 0, 1);
786786
787787   for (pri = 3; pri >= 0; pri--)
788      draw_layers(screen.machine(), bitmap, cliprect, pri, layers_ctrl);
788      draw_layers(machine(), bitmap, cliprect, pri, layers_ctrl);
789789
790790   if (layers_ctrl & 0x08)
791      metro_draw_sprites(screen.machine(), bitmap, cliprect);
791      metro_draw_sprites(machine(), bitmap, cliprect);
792792   return 0;
793793}
trunk/src/mame/video/angelkds.c
r17988r17989
271271   if ((m_layer_ctrl & 0x80) == 0x00)
272272      m_bgtop_tilemap->draw(bitmap, clip, 0, 0);
273273
274   draw_sprites(screen.machine(), bitmap, clip, 0x80);
274   draw_sprites(machine(), bitmap, clip, 0x80);
275275
276276   if ((m_layer_ctrl & 0x20) == 0x00)
277277      m_tx_tilemap->draw(bitmap, clip, 0, 0);
r17988r17989
282282   if ((m_layer_ctrl & 0x40) == 0x00)
283283      m_bgbot_tilemap->draw(bitmap, clip, 0, 0);
284284
285   draw_sprites(screen.machine(), bitmap, clip, 0x40);
285   draw_sprites(machine(), bitmap, clip, 0x40);
286286
287287   if ((m_layer_ctrl & 0x20) == 0x00)
288288      m_tx_tilemap->draw(bitmap, clip, 0, 0);
trunk/src/mame/video/circusc.c
r17988r17989
206206
207207   bitmap.fill(0, cliprect);
208208   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
209   draw_sprites(screen.machine(), bitmap, cliprect);
209   draw_sprites(machine(), bitmap, cliprect);
210210   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
211211   return 0;
212212}
trunk/src/mame/video/mikie.c
r17988r17989
174174UINT32 mikie_state::screen_update_mikie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
175175{
176176   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_CATEGORY(0), 0);
177   draw_sprites(screen.machine(), bitmap, cliprect);
177   draw_sprites(machine(), bitmap, cliprect);
178178   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_CATEGORY(1), 0);
179179   return 0;
180180}
trunk/src/mame/video/opwolf.c
r17988r17989
4444   layer[0] = 0;
4545   layer[1] = 1;
4646
47   screen.machine().priority_bitmap.fill(0, cliprect);
47   machine().priority_bitmap.fill(0, cliprect);
4848
4949   pc080sn_tilemap_draw(m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
5050   pc080sn_tilemap_draw(m_pc080sn, bitmap, cliprect, layer[1], 0, 2);
trunk/src/mame/video/surpratk.c
r17988r17989
6767
6868   konami_sortlayers3(layer, m_layerpri);
6969
70   screen.machine().priority_bitmap.fill(0, cliprect);
70   machine().priority_bitmap.fill(0, cliprect);
7171   bitmap.fill(16 * bg_colorbase, cliprect);
7272   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[0], 0, 1);
7373   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[1], 0, 2);
trunk/src/mame/video/zaccaria.c
r17988r17989
247247
248248   // 3 layers of sprites, each with their own palette and priorities
249249   // Not perfect yet, does spriteram(1) layer have a priority bit somewhere?
250   draw_sprites(screen.machine(),bitmap,cliprect,m_spriteram2,2,1);
251   draw_sprites(screen.machine(),bitmap,cliprect,m_spriteram,1,0);
252   draw_sprites(screen.machine(),bitmap,cliprect,m_spriteram2+0x20,0,1);
250   draw_sprites(machine(),bitmap,cliprect,m_spriteram2,2,1);
251   draw_sprites(machine(),bitmap,cliprect,m_spriteram,1,0);
252   draw_sprites(machine(),bitmap,cliprect,m_spriteram2+0x20,0,1);
253253
254254   return 0;
255255}
trunk/src/mame/video/suna16.c
r17988r17989
222222
223223   /* Suna Quiz indicates the background is the last pen */
224224   bitmap.fill(0xff, cliprect);
225   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram, 0);
225   draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0);
226226   return 0;
227227}
228228
r17988r17989
231231   int layers_ctrl = -1;
232232
233233#ifdef MAME_DEBUG
234if (screen.machine().input().code_pressed(KEYCODE_Z))
234if (machine().input().code_pressed(KEYCODE_Z))
235235{   int msk = 0;
236   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
237   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
236   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
237   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
238238   if (msk != 0) layers_ctrl &= msk;
239239}
240240#endif
241241
242242   /* Suna Quiz indicates the background is the last pen */
243243   bitmap.fill(0xff, cliprect);
244   if (layers_ctrl & 1)   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram,  0);
245   if (layers_ctrl & 2)   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram2, 1);
244   if (layers_ctrl & 1)   draw_sprites(machine(), bitmap, cliprect, m_spriteram,  0);
245   if (layers_ctrl & 2)   draw_sprites(machine(), bitmap, cliprect, m_spriteram2, 1);
246246   return 0;
247247}
trunk/src/mame/video/speedbal.c
r17988r17989
126126{
127127   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
128128   m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
129   draw_sprites(screen.machine(), bitmap, cliprect);
129   draw_sprites(machine(), bitmap, cliprect);
130130   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
131131   m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
132132   return 0;
trunk/src/mame/video/shadfrce.c
r17988r17989
153153
154154UINT32 shadfrce_state::screen_update_shadfrce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
155155{
156   screen.machine().priority_bitmap.fill(0, cliprect);
156   machine().priority_bitmap.fill(0, cliprect);
157157
158158   if (m_video_enable)
159159   {
160160      m_bg1tilemap->draw(bitmap, cliprect, 0,0);
161161      m_bg0tilemap->draw(bitmap, cliprect, 0,1);
162      draw_sprites(screen.machine(), bitmap,cliprect);
162      draw_sprites(machine(), bitmap,cliprect);
163163      m_fgtilemap->draw(bitmap, cliprect, 0,0);
164164   }
165165   else
166166   {
167      bitmap.fill(get_black_pen(screen.machine()), cliprect);
167      bitmap.fill(get_black_pen(machine()), cliprect);
168168   }
169169
170170   return 0;
trunk/src/mame/video/tagteam.c
r17988r17989
189189UINT32 tagteam_state::screen_update_tagteam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
190190{
191191   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
192   draw_sprites(screen.machine(), bitmap, cliprect);
192   draw_sprites(machine(), bitmap, cliprect);
193193   return 0;
194194}
trunk/src/mame/video/bagman.c
r17988r17989
149149      return 0;
150150
151151   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
152   draw_sprites(screen.machine(), bitmap, cliprect);
152   draw_sprites(machine(), bitmap, cliprect);
153153   return 0;
154154}
trunk/src/mame/video/bigevglf.c
r17988r17989
8989{
9090
9191   copybitmap(bitmap, m_tmp_bitmap[m_plane_visible], 0, 0, 0, 0, cliprect);
92   draw_sprites(screen.machine(), bitmap, cliprect);
92   draw_sprites(machine(), bitmap, cliprect);
9393   return 0;
9494}
trunk/src/mame/video/inufuku.c
r17988r17989
229229{
230230   int i;
231231
232   bitmap.fill(get_black_pen(screen.machine()), cliprect);
233   screen.machine().priority_bitmap.fill(0);
232   bitmap.fill(get_black_pen(machine()), cliprect);
233   machine().priority_bitmap.fill(0);
234234
235235   if (m_bg_raster)
236236   {
r17988r17989
250250   m_tx_tilemap->set_scrolly(0, m_tx_scrolly);
251251   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
252252
253   draw_sprites(screen.machine(), bitmap, cliprect);
253   draw_sprites(machine(), bitmap, cliprect);
254254   return 0;
255255}
trunk/src/mame/video/commando.c
r17988r17989
130130{
131131
132132   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
133   draw_sprites(screen.machine(), bitmap, cliprect);
133   draw_sprites(machine(), bitmap, cliprect);
134134   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
135135   return 0;
136136}
trunk/src/mame/video/atarisy2.c
r17988r17989
318318
319319UINT32 atarisy2_state::screen_update_atarisy2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
320320{
321   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
321   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
322322   atarimo_rect_list rectlist;
323323   bitmap_ind16 *mobitmap;
324324   int x, y, r;
trunk/src/mame/video/yunsung8.c
r17988r17989
193193   int layers_ctrl = (~m_layers_ctrl) >> 4;
194194
195195#ifdef MAME_DEBUG
196if (screen.machine().input().code_pressed(KEYCODE_Z))
196if (machine().input().code_pressed(KEYCODE_Z))
197197{
198198   int msk = 0;
199   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
200   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
199   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
200   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
201201   if (msk != 0) layers_ctrl &= msk;
202202}
203203#endif
trunk/src/mame/video/skydiver.c
r17988r17989
204204{
205205   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
206206
207   draw_sprites(screen.machine(), bitmap, cliprect);
207   draw_sprites(machine(), bitmap, cliprect);
208208   return 0;
209209}
trunk/src/mame/video/ninjakd2.c
r17988r17989
461461{
462462   // updating sprites here instead than in screen_eof avoids a palette glitch
463463   // at the end of the "rainbow sky" screens.
464   update_sprites(screen.machine());
464   update_sprites(machine());
465465   m_sprites_updated = 1;
466466
467467   bitmap.fill(0, cliprect);
r17988r17989
477477
478478UINT32 ninjakd2_state::screen_update_robokid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
479479{
480   update_sprites(screen.machine());
480   update_sprites(machine());
481481   m_sprites_updated = 1;
482482
483483   bitmap.fill(0, cliprect);
r17988r17989
497497
498498UINT32 ninjakd2_state::screen_update_omegaf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
499499{
500   update_sprites(screen.machine());
500   update_sprites(machine());
501501   m_sprites_updated = 1;
502502
503503   bitmap.fill(0, cliprect);
r17988r17989
522522   if (state)
523523   {
524524      if (!m_sprites_updated)
525         update_sprites(screen.machine());
525         update_sprites(machine());
526526
527527      m_sprites_updated = 0;
528528   }
trunk/src/mame/video/m52.c
r17988r17989
360360   if (!(m_bgcontrol & 0x20))
361361   {
362362      if (!(m_bgcontrol & 0x10))
363         draw_background(screen.machine(), bitmap, cliprect, m_bg2xpos, m_bg2ypos, 2); /* distant mountains */
363         draw_background(machine(), bitmap, cliprect, m_bg2xpos, m_bg2ypos, 2); /* distant mountains */
364364
365365      if (!(m_bgcontrol & 0x02))
366         draw_background(screen.machine(), bitmap, cliprect, m_bg1xpos, m_bg1ypos, 3); /* hills */
366         draw_background(machine(), bitmap, cliprect, m_bg1xpos, m_bg1ypos, 3); /* hills */
367367
368368      if (!(m_bgcontrol & 0x04))
369         draw_background(screen.machine(), bitmap, cliprect, m_bg1xpos, m_bg1ypos, 4); /* cityscape */
369         draw_background(machine(), bitmap, cliprect, m_bg1xpos, m_bg1ypos, 4); /* cityscape */
370370   }
371371
372372   m_bg_tilemap->set_flip(flip_screen() ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
r17988r17989
413413      clip = cliprect;
414414#endif
415415
416      drawgfx_transmask(bitmap, clip, screen.machine().gfx[1],
416      drawgfx_transmask(bitmap, clip, machine().gfx[1],
417417         code, color, flipx, flipy, sx, sy,
418         colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color, 512 + 32));
418         colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, 512 + 32));
419419   }
420420   return 0;
421421}
trunk/src/mame/video/warpwarp.c
r17988r17989
239239{
240240   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
241241
242   draw_ball(screen.machine(), bitmap, cliprect, m_ball_pen);
242   draw_ball(machine(), bitmap, cliprect, m_ball_pen);
243243   return 0;
244244}
trunk/src/mame/video/spacefb.c
r17988r17989
396396
397397UINT32 spacefb_state::screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
398398{
399   draw_objects(screen.machine(), bitmap, cliprect);
399   draw_objects(machine(), bitmap, cliprect);
400400   draw_starfield(screen, bitmap, cliprect);
401401
402402   return 0;
trunk/src/mame/video/cbuster.c
r17988r17989
5050
5151UINT32 cbuster_state::screen_update_twocrude(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
5252{
53   address_space &space = screen.machine().driver_data()->generic_space();
53   address_space &space = machine().driver_data()->generic_space();
5454   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
5555
5656   flip_screen_set(!BIT(flip, 7));
5757
58   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram16_buffer, 0x400);
58   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram16_buffer, 0x400);
5959
6060
6161   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
r17988r17989
6363
6464   /* Draw playfields & sprites */
6565   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
66   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0900, 0x100, 0x0ff);
67   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0900, 0x0900, 0x500, 0x0ff);
66   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0900, 0x100, 0x0ff);
67   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0900, 0x0900, 0x500, 0x0ff);
6868
6969   if (m_pri)
7070   {
r17988r17989
7777      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
7878   }
7979
80   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0900, 0x100, 0x0ff);
81   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0100, 0x0900, 0x500, 0x0ff);
80   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0900, 0x100, 0x0ff);
81   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0100, 0x0900, 0x500, 0x0ff);
8282   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
8383   return 0;
8484}
trunk/src/mame/video/gng.c
r17988r17989
137137{
138138
139139   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
140   draw_sprites(screen.machine(), bitmap, cliprect);
140   draw_sprites(machine(), bitmap, cliprect);
141141   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
142142   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
143143   return 0;
trunk/src/mame/video/ojankohs.c
r17988r17989
307307
308308   if (m_screen_refresh)
309309   {
310      address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
310      address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
311311
312312      /* redraw bitmap */
313313      for (offs = 0; offs < 0x8000; offs++)
trunk/src/mame/video/n8080.c
r17988r17989
248248
249249UINT32 n8080_state::screen_update_helifire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
250250{
251   int SUN_BRIGHTNESS = screen.machine().root_device().ioport("POT0")->read();
252   int SEA_BRIGHTNESS = screen.machine().root_device().ioport("POT1")->read();
251   int SUN_BRIGHTNESS = machine().root_device().ioport("POT0")->read();
252   int SEA_BRIGHTNESS = machine().root_device().ioport("POT1")->read();
253253
254254   static const int wave[8] = { 0, 1, 2, 2, 2, 1, 0, 0 };
255255
r17988r17989
336336
337337      /* next line */
338338
339      helifire_next_line(screen.machine());
339      helifire_next_line(machine());
340340   }
341341
342342   m_helifire_mv = saved_mv;
r17988r17989
350350   // falling edge
351351   if (!state)
352352   {
353      int n = (screen.machine().primary_screen->frame_number() >> 1) % sizeof m_helifire_LSFR;
353      int n = (machine().primary_screen->frame_number() >> 1) % sizeof m_helifire_LSFR;
354354
355355      int i;
356356
r17988r17989
367367               G |= B;
368368            }
369369
370            if (screen.machine().primary_screen->frame_number() & 0x04)
370            if (machine().primary_screen->frame_number() & 0x04)
371371            {
372372               R |= G;
373373            }
374374         }
375375
376         palette_set_color_rgb(screen.machine(),i,
376         palette_set_color_rgb(machine(),i,
377377            R ? 255 : 0,
378378            G ? 255 : 0,
379379            B ? 255 : 0);
r17988r17989
381381
382382      for (i = 0; i < 256; i++)
383383      {
384         helifire_next_line(screen.machine());
384         helifire_next_line(machine());
385385      }
386386   }
387387}
trunk/src/mame/video/nbmj8891.c
r17988r17989
519519      m_screen_refresh = 0;
520520      for (y = 0; y < height; y++)
521521         for (x = 0; x < width; x++)
522            update_pixel0(screen.machine(), x, y);
522            update_pixel0(machine(), x, y);
523523
524524      if (m_gfxdraw_mode)
525525         for (y = 0; y < height; y++)
526526            for (x = 0; x < width; x++)
527               update_pixel1(screen.machine(), x, y);
527               update_pixel1(machine(), x, y);
528528   }
529529
530530   if (m_dispflag)
trunk/src/mame/video/wc90b.c
r17988r17989
134134
135135   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
136136   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
137   draw_sprites(screen.machine(), bitmap,cliprect, 1 );
137   draw_sprites(machine(), bitmap,cliprect, 1 );
138138   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
139   draw_sprites(screen.machine(), bitmap,cliprect, 0 );
139   draw_sprites(machine(), bitmap,cliprect, 0 );
140140   return 0;
141141}
trunk/src/mame/video/kncljoe.c
r17988r17989
238238{
239239
240240   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
241   draw_sprites(screen.machine(), bitmap, cliprect);
241   draw_sprites(machine(), bitmap, cliprect);
242242   return 0;
243243}
trunk/src/mame/video/holeland.c
r17988r17989
184184{
185185/*m_bg_tilemap->mark_all_dirty(); */
186186   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
187   holeland_draw_sprites(screen.machine(), bitmap, cliprect);
187   holeland_draw_sprites(machine(), bitmap, cliprect);
188188   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
189189   return 0;
190190}
r17988r17989
192192UINT32 holeland_state::screen_update_crzrally(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
193193{
194194   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
195   crzrally_draw_sprites(screen.machine(), bitmap, cliprect);
195   crzrally_draw_sprites(machine(), bitmap, cliprect);
196196   return 0;
197197}
trunk/src/mame/video/spdodgeb.c
r17988r17989
208208{
209209   m_bg_tilemap->set_scrollx(0,m_lastscroll+5);
210210   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
211   draw_sprites(screen.machine(), bitmap,cliprect);
211   draw_sprites(machine(), bitmap,cliprect);
212212   return 0;
213213}
trunk/src/mame/video/liberate.c
r17988r17989
510510      m_back_tilemap->draw(bitmap, cliprect, 0, 0);
511511
512512   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
513   prosoccr_draw_sprites(screen.machine(), bitmap, cliprect);
513   prosoccr_draw_sprites(machine(), bitmap, cliprect);
514514
515515   return 0;
516516}
r17988r17989
549549      my = (offs) % 32;
550550      mx = (offs) / 32;
551551
552      drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[gfx_region],
552      drawgfx_transpen(bitmap, cliprect,machine().gfx[gfx_region],
553553            tile, 1, 0, 0, 248 - 8 * mx, 8 * my, 0);
554554   }
555555
556   prosport_draw_sprites(screen.machine(), bitmap, cliprect);
556   prosport_draw_sprites(machine(), bitmap, cliprect);
557557
558558   return 0;
559559}
r17988r17989
568568   else
569569      m_back_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
570570
571   boomrang_draw_sprites(screen.machine(),bitmap,cliprect,8);
571   boomrang_draw_sprites(machine(),bitmap,cliprect,8);
572572   if (!m_background_disable)
573573      m_back_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
574574
575   boomrang_draw_sprites(screen.machine(), bitmap, cliprect, 0);
575   boomrang_draw_sprites(machine(), bitmap, cliprect, 0);
576576   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
577577   return 0;
578578}
r17988r17989
587587   else
588588      m_back_tilemap->draw(bitmap, cliprect, 0, 0);
589589
590   liberate_draw_sprites(screen.machine(), bitmap, cliprect);
590   liberate_draw_sprites(machine(), bitmap, cliprect);
591591   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
592592   return 0;
593593}
trunk/src/mame/video/gunsmoke.c
r17988r17989
177177   if (m_bgon)
178178      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
179179   else
180      bitmap.fill(get_black_pen(screen.machine()), cliprect);
180      bitmap.fill(get_black_pen(machine()), cliprect);
181181
182182   if (m_objon)
183      draw_sprites(screen.machine(), bitmap, cliprect);
183      draw_sprites(machine(), bitmap, cliprect);
184184
185185   if (m_chon)
186186      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/turbo.c
r17988r17989
400400UINT32 turbo_state::screen_update_turbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
401401{
402402   bitmap_ind16 &fgpixmap = m_fg_tilemap->pixmap();
403   const UINT8 *road_gfxdata = screen.machine().root_device().memregion("gfx3")->base();
403   const UINT8 *road_gfxdata = machine().root_device().memregion("gfx3")->base();
404404   const UINT8 *prom_base = memregion("proms")->base();
405405   const UINT8 *pr1114 = prom_base + 0x000;
406406   const UINT8 *pr1115 = prom_base + 0x020;
r17988r17989
429429
430430      /* compute the sprite information; we use y-1 since this info was computed during HBLANK */
431431      /* on the previous scanline */
432      turbo_prepare_sprites(screen.machine(), this, y, &sprinfo);
432      turbo_prepare_sprites(machine(), this, y, &sprinfo);
433433
434434      /* loop over columns */
435435      for (x = 0; x <= cliprect.max_x; x += TURBO_X_SCALE)
r17988r17989
769769
770770      /* compute the sprite information; we use y-1 since this info was computed during HBLANK */
771771      /* on the previous scanline */
772      subroc3d_prepare_sprites(screen.machine(), this, y, &sprinfo);
772      subroc3d_prepare_sprites(machine(), this, y, &sprinfo);
773773
774774      /* loop over columns */
775775      for (x = 0; x <= cliprect.max_x; x += TURBO_X_SCALE)
r17988r17989
971971UINT32 turbo_state::screen_update_buckrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
972972{
973973   bitmap_ind16 &fgpixmap = m_fg_tilemap->pixmap();
974   const UINT8 *bgcolor = screen.machine().root_device().memregion("gfx3")->base();
974   const UINT8 *bgcolor = machine().root_device().memregion("gfx3")->base();
975975   const UINT8 *prom_base = memregion("proms")->base();
976976   const UINT8 *pr5194 = prom_base + 0x000;
977977   const UINT8 *pr5198 = prom_base + 0x500;
r17988r17989
987987
988988      /* compute the sprite information; we use y-1 since this info was computed during HBLANK */
989989      /* on the previous scanline */
990      buckrog_prepare_sprites(screen.machine(), this, y, &sprinfo);
990      buckrog_prepare_sprites(machine(), this, y, &sprinfo);
991991
992992      /* loop over columns */
993993      for (x = 0; x <= cliprect.max_x; x += TURBO_X_SCALE)
trunk/src/mame/video/cvs.c
r17988r17989
144144   offs_t offs;
145145   int scroll[8];
146146
147   set_pens(screen.machine());
147   set_pens(machine());
148148
149149   /* draw the background */
150150   for (offs = 0; offs < 0x0400; offs++)
r17988r17989
158158
159159      int gfxnum = (code < ram_based_char_start_indices[m_character_banking_mode]) ? 0 : 1;
160160
161      drawgfx_opaque(m_background_bitmap, m_background_bitmap.cliprect(), screen.machine().gfx[gfxnum],
161      drawgfx_opaque(m_background_bitmap, m_background_bitmap.cliprect(), machine().gfx[gfxnum],
162162            code, color,
163163            0, 0,
164164            x, y);
r17988r17989
174174            collision_color = 0x102;
175175      }
176176
177      drawgfx_opaque(m_collision_background, m_collision_background.cliprect(), screen.machine().gfx[gfxnum],
177      drawgfx_opaque(m_collision_background, m_collision_background.cliprect(), machine().gfx[gfxnum],
178178            code, collision_color,
179179            0, 0,
180180            x, y);
r17988r17989
216216               m_collision_register |= 0x08;
217217
218218            /* Bullet/Background Collision */
219            if (colortable_entry_get_value(screen.machine().colortable, m_scrolled_collision_background.pix16(offs, bx)))
219            if (colortable_entry_get_value(machine().colortable, m_scrolled_collision_background.pix16(offs, bx)))
220220               m_collision_register |= 0x80;
221221
222222            bitmap.pix16(offs, bx) = BULLET_STAR_PEN;
r17988r17989
251251               if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x04;
252252
253253               /* S2636 vs. background collision detection */
254               if (colortable_entry_get_value(screen.machine().colortable, m_scrolled_collision_background.pix16(y, x)))
254               if (colortable_entry_get_value(machine().colortable, m_scrolled_collision_background.pix16(y, x)))
255255               {
256256                  if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision_register |= 0x10;
257257                  if (S2636_IS_PIXEL_DRAWN(pixel1)) m_collision_register |= 0x20;
r17988r17989
264264
265265   /* stars circuit */
266266   if (m_stars_on)
267      cvs_update_stars(screen.machine(), bitmap, cliprect, BULLET_STAR_PEN, 0);
267      cvs_update_stars(machine(), bitmap, cliprect, BULLET_STAR_PEN, 0);
268268
269269   return 0;
270270}
trunk/src/mame/video/seta.c
r17988r17989
826826/* For games without tilemaps */
827827UINT32 seta_state::screen_update_seta_no_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
828828{
829   set_pens(screen.machine());
829   set_pens(machine());
830830   bitmap.fill(0x1f0, cliprect);
831831
832   screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1);
832   machine().device<seta001_device>("spritegen")->seta001_draw_sprites(machine(),bitmap,cliprect,0x1000, 1);
833833   return 0;
834834}
835835
r17988r17989
10531053{
10541054   bitmap.fill(0x0, cliprect);
10551055
1056   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e );
1057   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 );
1056   machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e );
1057   machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 );
10581058
10591059   seta_layers_update(screen, bitmap, cliprect, 0x800, 1 );
10601060
r17988r17989
10651065{
10661066   // rising edge
10671067   if (state)
1068      screen.machine().device<seta001_device>("spritegen")->tnzs_eof();
1068      machine().device<seta001_device>("spritegen")->tnzs_eof();
10691069}
10701070
10711071
10721072
10731073UINT32 seta_state::screen_update_seta(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
10741074{
1075   set_pens(screen.machine());
1075   set_pens(machine());
10761076   return SCREEN_UPDATE16_CALL_MEMBER(seta_layers);
10771077}
10781078
10791079
10801080UINT32 seta_state::screen_update_usclssic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
10811081{
1082   usclssic_set_pens(screen.machine());
1082   usclssic_set_pens(machine());
10831083   return SCREEN_UPDATE16_CALL_MEMBER(seta_layers);
10841084}
10851085
trunk/src/mame/video/tnzs.c
r17988r17989
5050   machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e );
5151   machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 );
5252
53   machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(), bitmap, cliprect, 0x800, 0 );
53   machine().device<seta001_device>("spritegen")->seta001_draw_sprites(machine(), bitmap, cliprect, 0x800, 0 );
5454   return 0;
5555}
5656
trunk/src/mame/video/tp84.c
r17988r17989
179179
180180   if (cliprect.min_y == screen.visible_area().min_y)
181181   {
182      screen.machine().tilemap().mark_all_dirty();
182      machine().tilemap().mark_all_dirty();
183183
184184      m_bg_tilemap->set_scrollx(0, *m_scroll_x);
185185      m_bg_tilemap->set_scrolly(0, *m_scroll_y);
186186
187      screen.machine().tilemap().set_flip_all(((*m_flipscreen_x & 0x01) ? TILEMAP_FLIPX : 0) |
187      machine().tilemap().set_flip_all(((*m_flipscreen_x & 0x01) ? TILEMAP_FLIPX : 0) |
188188                              ((*m_flipscreen_y & 0x01) ? TILEMAP_FLIPY : 0));
189189   }
190190
191191   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
192   draw_sprites(screen.machine(), bitmap, cliprect);
192   draw_sprites(machine(), bitmap, cliprect);
193193
194194   /* draw top status region */
195195   clip.min_x = visarea.min_x;
trunk/src/mame/video/vball.c
r17988r17989
168168      //logerror("scrollx[%d] = %d\n",i,m_vb_scrollx[i]);
169169   }
170170   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
171   draw_sprites(screen.machine(),bitmap,cliprect);
171   draw_sprites(machine(),bitmap,cliprect);
172172   return 0;
173173}
trunk/src/mame/video/rohga.c
r17988r17989
6363
6464UINT32 rohga_state::screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6565{
66   address_space &space = screen.machine().driver_data()->generic_space();
66   address_space &space = machine().driver_data()->generic_space();
6767   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
6868   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
6969
r17988r17989
7373   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
7474
7575   /* Draw playfields */
76   screen.machine().priority_bitmap.fill(0, cliprect);
77   bitmap.fill(screen.machine().pens[768], cliprect);
76   machine().priority_bitmap.fill(0, cliprect);
77   bitmap.fill(machine().pens[768], cliprect);
7878
7979   switch (priority & 3)
8080   {
r17988r17989
104104      break;
105105   }
106106
107   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
107   machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
108108   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
109109
110110   return 0;
r17988r17989
166166
167167UINT32 rohga_state::screen_update_wizdfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
168168{
169   address_space &space = screen.machine().driver_data()->generic_space();
169   address_space &space = machine().driver_data()->generic_space();
170170   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
171171   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
172172
173173   /* draw sprite gfx to temp bitmaps */
174   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true);
175   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
174   machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true);
175   machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
176176
177177   /* Update playfields */
178178   flip_screen_set(BIT(flip, 7));
r17988r17989
180180   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
181181
182182   /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
183   bitmap.fill(screen.machine().pens[512], cliprect);
183   bitmap.fill(machine().pens[512], cliprect);
184184
185185   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
186   screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0600, 0x0600, 0x400, 0x1ff);
186   machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0600, 0x0600, 0x400, 0x1ff);
187187   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
188   screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0400, 0x0600, 0x400, 0x1ff);
188   machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0400, 0x0600, 0x400, 0x1ff);
189189
190190   if ((priority & 0x1f) == 0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */
191191      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0);
192192   else
193193      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
194194
195   screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0400, 0x400, 0x1ff); // 0x000 and 0x200 of 0x600
195   machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0400, 0x400, 0x1ff); // 0x000 and 0x200 of 0x600
196196
197   mixwizdfirelayer(screen.machine(), bitmap, cliprect, 4, 0x000, 0x000);
197   mixwizdfirelayer(machine(), bitmap, cliprect, 4, 0x000, 0x000);
198198
199199   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
200200   return 0;
r17988r17989
202202
203203UINT32 rohga_state::screen_update_nitrobal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
204204{
205   address_space &space = screen.machine().driver_data()->generic_space();
205   address_space &space = machine().driver_data()->generic_space();
206206   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
207207
208208   /* draw sprite gfx to temp bitmaps */
209   screen.machine().device<decospr_device>("spritegen1")->set_alt_format(true);
210   screen.machine().device<decospr_device>("spritegen2")->set_alt_format(true);
211   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, false);
212   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, false);
209   machine().device<decospr_device>("spritegen1")->set_alt_format(true);
210   machine().device<decospr_device>("spritegen2")->set_alt_format(true);
211   machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, false);
212   machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, false);
213213
214214   /* Update playfields */
215215   flip_screen_set(BIT(flip, 7));
r17988r17989
217217   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
218218
219219   /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
220   bitmap.fill(screen.machine().pens[512], cliprect);
221   screen.machine().priority_bitmap.fill(0);
220   bitmap.fill(machine().pens[512], cliprect);
221   machine().priority_bitmap.fill(0);
222222
223223   /* pf3 and pf4 are combined into a single 8bpp bitmap */
224224   deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
r17988r17989
226226   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 16);
227227
228228   /* ToDo reimplement priorities + mixing / alpha, it was busted worse than this before anyway, so no big loss that we don't do it for now ;-) */
229   screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x600, 0xff);
230   screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x400, 0x1ff);
229   machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x600, 0xff);
230   machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x400, 0x1ff);
231231
232232
233233   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
trunk/src/mame/video/plygonet.c
r17988r17989
118118
119119UINT32 polygonet_state::screen_update_polygonet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
120120{
121   device_t *k053936 = screen.machine().device("k053936");
122   screen.machine().priority_bitmap.fill(0);
123   bitmap.fill(get_black_pen(screen.machine()), cliprect);
121   device_t *k053936 = machine().device("k053936");
122   machine().priority_bitmap.fill(0);
123   bitmap.fill(get_black_pen(machine()), cliprect);
124124
125125   k053936_zoom_draw(k053936, bitmap, cliprect, m_roz_tilemap, 0, 0, 0);
126126
trunk/src/mame/video/higemaru.c
r17988r17989
144144UINT32 higemaru_state::screen_update_higemaru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
145145{
146146   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
147   draw_sprites(screen.machine(), bitmap, cliprect);
147   draw_sprites(machine(), bitmap, cliprect);
148148   return 0;
149149}
trunk/src/mame/video/batman.c
r17988r17989
192192
193193UINT32 batman_state::screen_update_batman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
194194{
195   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
195   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
196196   atarimo_rect_list rectlist;
197197   bitmap_ind16 *mobitmap;
198198   int x, y, r;
trunk/src/mame/video/nemesis.c
r17988r17989
417417   int offs;
418418   rectangle clip;
419419
420   screen.machine().priority_bitmap.fill(0, cliprect);
420   machine().priority_bitmap.fill(0, cliprect);
421421   bitmap.fill(0, cliprect);
422422
423423   clip.min_x = 0;
r17988r17989
462462      }
463463   }
464464
465   draw_sprites(screen.machine(),bitmap,cliprect);
465   draw_sprites(machine(),bitmap,cliprect);
466466
467467   return 0;
468468}
trunk/src/mame/video/cheekyms.c
r17988r17989
151151   int scrolly = ((*m_port_80 >> 3) & 0x07);
152152   int flip = *m_port_80 & 0x80;
153153
154   screen.machine().tilemap().mark_all_dirty();
155   screen.machine().tilemap().set_flip_all(flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
154   machine().tilemap().mark_all_dirty();
155   machine().tilemap().set_flip_all(flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
156156
157157   bitmap.fill(0, cliprect);
158158   m_bitmap_buffer->fill(0, cliprect);
159159
160160   /* sprites go under the playfield */
161   draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().gfx[1], flip);
161   draw_sprites(machine(), bitmap, cliprect, machine().gfx[1], flip);
162162
163163   /* draw the tilemap to a temp bitmap */
164164   m_cm_tilemap->draw(*m_bitmap_buffer, cliprect, 0, 0);
trunk/src/mame/video/magmax.c
r17988r17989
200200         if (code & 0x80)   /* sprite bankswitch */
201201            code += (*m_vreg & 0x30) * 0x8;
202202
203         drawgfx_transmask(bitmap, cliprect, screen.machine().gfx[1],
203         drawgfx_transmask(bitmap, cliprect, machine().gfx[1],
204204               code,
205205               color,
206206               flipx, flipy,
207207               sx, sy,
208               colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color, 0x1f));
208               colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, 0x1f));
209209      }
210210   }
211211
r17988r17989
230230            sy = 31 - sy;
231231         }
232232
233         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
233         drawgfx_transpen(bitmap, cliprect, machine().gfx[0],
234234               code,
235235               0,
236236               m_flipscreen, m_flipscreen,
trunk/src/mame/video/timelimt.c
r17988r17989
142142   m_bg_tilemap->set_scrolly(0, m_scrolly);
143143   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
144144
145   draw_sprites(screen.machine(), bitmap, cliprect);
145   draw_sprites(machine(), bitmap, cliprect);
146146
147147   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
148148   return 0;
trunk/src/mame/video/warriorb.c
r17988r17989
115115   return 0;
116116}
117117
118UINT32 warriorb_state::screen_update_warriorb_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 40 * 8 * 0, screen.machine().driver_data<warriorb_state>()->m_tc0100scn_1); }
119UINT32 warriorb_state::screen_update_warriorb_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 40 * 8 * 1, screen.machine().driver_data<warriorb_state>()->m_tc0100scn_2); }
118UINT32 warriorb_state::screen_update_warriorb_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 40 * 8 * 0, machine().driver_data<warriorb_state>()->m_tc0100scn_1); }
119UINT32 warriorb_state::screen_update_warriorb_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 40 * 8 * 1, machine().driver_data<warriorb_state>()->m_tc0100scn_2); }
trunk/src/mame/video/goal92.c
r17988r17989
159159      m_fg_layer->set_scrolly(0, m_scrollram[3] + 8);
160160   }
161161
162   bitmap.fill(get_black_pen(screen.machine()), cliprect);
162   bitmap.fill(get_black_pen(machine()), cliprect);
163163
164164   m_bg_layer->draw(bitmap, cliprect, 0, 0);
165   draw_sprites(screen.machine(), bitmap, cliprect, 2);
165   draw_sprites(machine(), bitmap, cliprect, 2);
166166
167167   if (!(m_fg_bank & 0xff))
168      draw_sprites(screen.machine(), bitmap, cliprect, 1);
168      draw_sprites(machine(), bitmap, cliprect, 1);
169169
170170   m_fg_layer->draw(bitmap, cliprect, 0, 0);
171171
172172   if(m_fg_bank & 0xff)
173      draw_sprites(screen.machine(), bitmap, cliprect, 1);
173      draw_sprites(machine(), bitmap, cliprect, 1);
174174
175   draw_sprites(screen.machine(), bitmap, cliprect, 0);
176   draw_sprites(screen.machine(), bitmap, cliprect, 3);
175   draw_sprites(machine(), bitmap, cliprect, 0);
176   draw_sprites(machine(), bitmap, cliprect, 3);
177177   m_tx_layer->draw(bitmap, cliprect, 0, 0);
178178   return 0;
179179}
trunk/src/mame/video/bishi.c
r17988r17989
6161
6262   konami_sortlayers4(layers, layerpri);
6363
64   screen.machine().priority_bitmap.fill(0, cliprect);
64   machine().priority_bitmap.fill(0, cliprect);
6565
6666   for (i = 0; i < 4; i++)
6767   {
trunk/src/mame/video/1942.c
r17988r17989
237237{
238238
239239   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
240   draw_sprites(screen.machine(), bitmap, cliprect);
240   draw_sprites(machine(), bitmap, cliprect);
241241   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
242242   return 0;
243243}
trunk/src/mame/video/poolshrk.c
r17988r17989
4040      int hpos = m_hpos_ram[i];
4141      int vpos = m_vpos_ram[i];
4242
43      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], i, (i == 0) ? 0 : 1, 0, 0,
43      drawgfx_transpen(bitmap, cliprect, machine().gfx[0], i, (i == 0) ? 0 : 1, 0, 0,
4444         248 - hpos, vpos - 15, 0);
4545   }
4646
trunk/src/mame/video/raiden.c
r17988r17989
162162   m_bg_layer->draw(bitmap, cliprect, 0,0);
163163
164164   /* Draw sprites underneath foreground */
165   draw_sprites(screen.machine(),bitmap,cliprect,0x40);
165   draw_sprites(machine(),bitmap,cliprect,0x40);
166166   m_fg_layer->draw(bitmap, cliprect, 0,0);
167167
168168   /* Rest of sprites */
169   draw_sprites(screen.machine(),bitmap,cliprect,0x80);
169   draw_sprites(machine(),bitmap,cliprect,0x80);
170170
171171   /* Text layer */
172172   m_tx_layer->draw(bitmap, cliprect, 0,0);
trunk/src/mame/video/bloodbro.c
r17988r17989
232232   m_fg_tilemap->set_scrollx(0,m_scroll[0x12]);
233233   m_fg_tilemap->set_scrolly(0,m_scroll[0x13]);
234234
235   screen.machine().priority_bitmap.fill(0, cliprect);
235   machine().priority_bitmap.fill(0, cliprect);
236236
237237   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
238238   m_fg_tilemap->draw(bitmap, cliprect, 0,1);
239   bloodbro_draw_sprites(screen.machine(),bitmap,cliprect);
239   bloodbro_draw_sprites(machine(),bitmap,cliprect);
240240   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
241241   return 0;
242242}
r17988r17989
248248//  m_fg_tilemap->set_scrollx(0,m_scroll[0x12]);
249249//  m_fg_tilemap->set_scrolly(0,m_scroll[0x13]);
250250
251   screen.machine().priority_bitmap.fill(0, cliprect);
251   machine().priority_bitmap.fill(0, cliprect);
252252
253253   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
254254   m_fg_tilemap->draw(bitmap, cliprect, 0,1);
255   weststry_draw_sprites(screen.machine(),bitmap,cliprect);
255   weststry_draw_sprites(machine(),bitmap,cliprect);
256256   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
257257   return 0;
258258}
r17988r17989
265265   m_fg_tilemap->set_scrollx(0,m_scroll[0x0a]);
266266   m_fg_tilemap->set_scrolly(0,m_scroll[0x0b]);   /* ? */
267267
268   screen.machine().priority_bitmap.fill(0, cliprect);
268   machine().priority_bitmap.fill(0, cliprect);
269269
270270   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
271271   m_fg_tilemap->draw(bitmap, cliprect, 0,1);
272   bloodbro_draw_sprites(screen.machine(),bitmap,cliprect);
272   bloodbro_draw_sprites(machine(),bitmap,cliprect);
273273   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
274274   return 0;
275275}
trunk/src/mame/video/galaxia.c
r17988r17989
111111{
112112   int x, y;
113113
114   bitmap_ind16 &s2636_0_bitmap = s2636_update(screen.machine().device("s2636_0"), cliprect);
115   bitmap_ind16 &s2636_1_bitmap = s2636_update(screen.machine().device("s2636_1"), cliprect);
116   bitmap_ind16 &s2636_2_bitmap = s2636_update(screen.machine().device("s2636_2"), cliprect);
114   bitmap_ind16 &s2636_0_bitmap = s2636_update(machine().device("s2636_0"), cliprect);
115   bitmap_ind16 &s2636_1_bitmap = s2636_update(machine().device("s2636_1"), cliprect);
116   bitmap_ind16 &s2636_2_bitmap = s2636_update(machine().device("s2636_2"), cliprect);
117117
118118   bitmap.fill(0, cliprect);
119   cvs_update_stars(screen.machine(), bitmap, cliprect, STAR_PEN, 1);
119   cvs_update_stars(machine(), bitmap, cliprect, STAR_PEN, 1);
120120   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
121121
122122   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
r17988r17989
177177   // astrowar has only one S2636
178178   int x, y;
179179
180   bitmap_ind16 &s2636_0_bitmap = s2636_update(screen.machine().device("s2636_0"), cliprect);
180   bitmap_ind16 &s2636_0_bitmap = s2636_update(machine().device("s2636_0"), cliprect);
181181
182182   bitmap.fill(0, cliprect);
183   cvs_update_stars(screen.machine(), bitmap, cliprect, STAR_PEN, 1);
183   cvs_update_stars(machine(), bitmap, cliprect, STAR_PEN, 1);
184184   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
185185   copybitmap(m_temp_bitmap, bitmap, 0, 0, 0, 0, cliprect);
186186
trunk/src/mame/video/bombjack.c
r17988r17989
131131{
132132   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
133133   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
134   draw_sprites(screen.machine(), bitmap, cliprect);
134   draw_sprites(machine(), bitmap, cliprect);
135135   return 0;
136136}
trunk/src/mame/video/gridlee.c
r17988r17989
131131
132132UINT32 gridlee_state::screen_update_gridlee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
133133{
134   const pen_t *pens = &screen.machine().pens[m_palettebank_vis * 32];
134   const pen_t *pens = &machine().pens[m_palettebank_vis * 32];
135135   UINT8 *gfx;
136136   int x, y, i;
137137
r17988r17989
156156   }
157157
158158   /* draw the sprite images */
159   gfx = screen.machine().root_device().memregion("gfx1")->base();
159   gfx = machine().root_device().memregion("gfx1")->base();
160160   for (i = 0; i < 32; i++)
161161   {
162162      UINT8 *sprite = m_spriteram + i * 4;
trunk/src/mame/video/rallyx.c
r17988r17989
639639      fg_clip.min_x = 28 * 8;
640640   }
641641
642   screen.machine().priority_bitmap.fill(0, cliprect);
642   machine().priority_bitmap.fill(0, cliprect);
643643
644644   m_bg_tilemap->draw(bitmap, bg_clip, 0, 0);
645645   m_fg_tilemap->draw(bitmap, fg_clip, 0, 0);
646646   m_bg_tilemap->draw(bitmap, bg_clip, 1, 1);
647647   m_fg_tilemap->draw(bitmap, fg_clip, 1, 1);
648648
649   rallyx_draw_bullets(screen.machine(), bitmap, cliprect, TRUE);
650   rallyx_draw_sprites(screen.machine(), bitmap, cliprect, 1);
651   rallyx_draw_bullets(screen.machine(), bitmap, cliprect, FALSE);
649   rallyx_draw_bullets(machine(), bitmap, cliprect, TRUE);
650   rallyx_draw_sprites(machine(), bitmap, cliprect, 1);
651   rallyx_draw_bullets(machine(), bitmap, cliprect, FALSE);
652652
653653   return 0;
654654}
r17988r17989
672672      fg_clip.min_x = 28 * 8;
673673   }
674674
675   screen.machine().priority_bitmap.fill(0, cliprect);
675   machine().priority_bitmap.fill(0, cliprect);
676676
677677   /* tile priority doesn't seem to be supported in Jungler */
678678   m_bg_tilemap->draw(bitmap, bg_clip, 0, 0);
r17988r17989
680680   m_bg_tilemap->draw(bitmap, bg_clip, 1, 0);
681681   m_fg_tilemap->draw(bitmap, fg_clip, 1, 0);
682682
683   jungler_draw_bullets(screen.machine(), bitmap, cliprect, TRUE);
684   rallyx_draw_sprites(screen.machine(), bitmap, cliprect, 0);
685   jungler_draw_bullets(screen.machine(), bitmap, cliprect, FALSE);
683   jungler_draw_bullets(machine(), bitmap, cliprect, TRUE);
684   rallyx_draw_sprites(machine(), bitmap, cliprect, 0);
685   jungler_draw_bullets(machine(), bitmap, cliprect, FALSE);
686686
687687   if (m_stars_enable)
688      draw_stars(screen.machine(), bitmap, cliprect);
688      draw_stars(machine(), bitmap, cliprect);
689689
690690   return 0;
691691}
r17988r17989
718718      fg_clip.min_x = 28 * 8;
719719   }
720720
721   screen.machine().priority_bitmap.fill(0, cliprect);
721   machine().priority_bitmap.fill(0, cliprect);
722722
723723   m_bg_tilemap->draw(bitmap, bg_clip, 0, 0);
724724   m_fg_tilemap->draw(bitmap, fg_clip, 0, 0);
725725   m_bg_tilemap->draw(bitmap, bg_clip, 1, 1);
726726   m_fg_tilemap->draw(bitmap, fg_clip, 1, 1);
727727
728   locomotn_draw_bullets(screen.machine(), bitmap, cliprect, TRUE);
729   locomotn_draw_sprites(screen.machine(), bitmap, cliprect, 0);
730   locomotn_draw_bullets(screen.machine(), bitmap, cliprect, FALSE);
728   locomotn_draw_bullets(machine(), bitmap, cliprect, TRUE);
729   locomotn_draw_sprites(machine(), bitmap, cliprect, 0);
730   locomotn_draw_bullets(machine(), bitmap, cliprect, FALSE);
731731
732732   if (m_stars_enable)
733      draw_stars(screen.machine(), bitmap, cliprect);
733      draw_stars(machine(), bitmap, cliprect);
734734
735735   return 0;
736736}
trunk/src/mame/video/unico.c
r17988r17989
351351   m_tilemap[2]->set_scrolly(0, m_scroll[0x02]);
352352
353353#ifdef MAME_DEBUG
354if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X) )
354if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) )
355355{
356356   int msk = 0;
357   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
358   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
359   if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 4;
360   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
357   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
358   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
359   if (machine().input().code_pressed(KEYCODE_E))   msk |= 4;
360   if (machine().input().code_pressed(KEYCODE_A))   msk |= 8;
361361   if (msk != 0) layers_ctrl &= msk;
362362}
363363#endif
364364
365365   /* The background color is the first of the last palette */
366366   bitmap.fill(0x1f00, cliprect);
367   screen.machine().priority_bitmap.fill(0, cliprect);
367   machine().priority_bitmap.fill(0, cliprect);
368368
369369   if (layers_ctrl & 1)   m_tilemap[0]->draw(bitmap, cliprect, 0,1);
370370   if (layers_ctrl & 2)   m_tilemap[1]->draw(bitmap, cliprect, 0,2);
r17988r17989
390390   m_tilemap[2]->set_scrolly(0, m_scroll32[1] >> 16);
391391
392392#ifdef MAME_DEBUG
393if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X) )
393if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) )
394394{
395395   int msk = 0;
396   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
397   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
398   if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 4;
399   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
396   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
397   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
398   if (machine().input().code_pressed(KEYCODE_E))   msk |= 4;
399   if (machine().input().code_pressed(KEYCODE_A))   msk |= 8;
400400   if (msk != 0) layers_ctrl &= msk;
401401}
402402#endif
trunk/src/mame/video/blockhl.c
r17988r17989
5555UINT32 blockhl_state::screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5656{
5757
58   screen.machine().priority_bitmap.fill(0, cliprect);
58   machine().priority_bitmap.fill(0, cliprect);
5959
6060   k052109_tilemap_update(m_k052109);
6161
trunk/src/mame/video/gcpinbal.c
r17988r17989
250250   UINT8 layer[3];
251251
252252#ifdef MAME_DEBUG
253   if (screen.machine().input().code_pressed_once(KEYCODE_V))
253   if (machine().input().code_pressed_once(KEYCODE_V))
254254   {
255255      m_dislayer[0] ^= 1;
256256      popmessage("bg0: %01x", m_dislayer[0]);
257257   }
258258
259   if (screen.machine().input().code_pressed_once(KEYCODE_B))
259   if (machine().input().code_pressed_once(KEYCODE_B))
260260   {
261261      m_dislayer[1] ^= 1;
262262      popmessage("bg1: %01x", m_dislayer[1]);
263263   }
264264
265   if (screen.machine().input().code_pressed_once(KEYCODE_N))
265   if (machine().input().code_pressed_once(KEYCODE_N))
266266   {
267267      m_dislayer[2] ^= 1;
268268      popmessage("fg: %01x", m_dislayer[2]);
r17988r17989
286286      m_tilemap[i]->set_scrolly(0, m_scrolly[i]);
287287   }
288288
289   screen.machine().priority_bitmap.fill(0, cliprect);
289   machine().priority_bitmap.fill(0, cliprect);
290290   bitmap.fill(0, cliprect);
291291
292292   layer[0] = 0;
r17988r17989
310310   m_tilemap[layer[2]]->draw(bitmap, cliprect, 0, 4);
311311
312312
313   draw_sprites(screen.machine(), bitmap, cliprect, 16);
313   draw_sprites(machine(), bitmap, cliprect, 16);
314314
315315#if 0
316316   {
trunk/src/mame/video/realbrk.c
r17988r17989
494494   m_tilemap_1->set_scrollx(0, m_vregs[0x6/2]);
495495
496496#ifdef MAME_DEBUG
497if ( screen.machine().input().code_pressed(KEYCODE_Z) )
497if ( machine().input().code_pressed(KEYCODE_Z) )
498498{
499499   int msk = 0;
500   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
501   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
502   if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 4;
503   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
500   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
501   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
502   if (machine().input().code_pressed(KEYCODE_E))   msk |= 4;
503   if (machine().input().code_pressed(KEYCODE_A))   msk |= 8;
504504   if (msk != 0) layers_ctrl &= msk;
505505}
506506#endif
507507
508508   if (m_disable_video)
509509   {
510      bitmap.fill(get_black_pen(screen.machine()), cliprect);
510      bitmap.fill(get_black_pen(machine()), cliprect);
511511      return 0;
512512   }
513513   else
r17988r17989
516516   if (layers_ctrl & 2)   m_tilemap_1->draw(bitmap, cliprect, 0,0);
517517   if (layers_ctrl & 1)   m_tilemap_0->draw(bitmap, cliprect, 0,0);
518518
519   if (layers_ctrl & 8)   draw_sprites(screen.machine(),bitmap,cliprect);
519   if (layers_ctrl & 8)   draw_sprites(machine(),bitmap,cliprect);
520520
521521   if (layers_ctrl & 4)   m_tilemap_2->draw(bitmap, cliprect, 0,0);
522522
r17988r17989
564564   m_tilemap_1->set_scrolly(0, bgy1 );
565565
566566#ifdef MAME_DEBUG
567if ( screen.machine().input().code_pressed(KEYCODE_Z) )
567if ( machine().input().code_pressed(KEYCODE_Z) )
568568{
569569   int msk = 0;
570   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
571   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
572   if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 4;
573   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
570   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
571   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
572   if (machine().input().code_pressed(KEYCODE_E))   msk |= 4;
573   if (machine().input().code_pressed(KEYCODE_A))   msk |= 8;
574574   if (msk != 0) layers_ctrl &= msk;
575575}
576576#endif
577577
578578   if (m_disable_video)
579579   {
580      bitmap.fill(get_black_pen(screen.machine()), cliprect);
580      bitmap.fill(get_black_pen(machine()), cliprect);
581581      return 0;
582582   }
583583   else
r17988r17989
586586
587587
588588   // spr 0
589   if (layers_ctrl & 8)   dai2kaku_draw_sprites(screen.machine(),bitmap,cliprect,2);
589   if (layers_ctrl & 8)   dai2kaku_draw_sprites(machine(),bitmap,cliprect,2);
590590
591591   // bglow
592592   if( m_vregs[8/2] & (0x8000)){
r17988r17989
596596   }
597597
598598   // spr 1
599   if (layers_ctrl & 8)   dai2kaku_draw_sprites(screen.machine(),bitmap,cliprect,1);
599   if (layers_ctrl & 8)   dai2kaku_draw_sprites(machine(),bitmap,cliprect,1);
600600
601601   // bghigh
602602   if( m_vregs[8/2] & (0x8000)){
r17988r17989
606606   }
607607
608608   // spr 2
609   if (layers_ctrl & 8)   dai2kaku_draw_sprites(screen.machine(),bitmap,cliprect,0);
609   if (layers_ctrl & 8)   dai2kaku_draw_sprites(machine(),bitmap,cliprect,0);
610610
611611   // fix
612612   if (layers_ctrl & 4)   m_tilemap_2->draw(bitmap, cliprect, 0,0);
trunk/src/mame/video/segag80v.c
r17988r17989
336336
337337UINT32 segag80v_state::screen_update_segag80v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
338338{
339   sega_generate_vector_list(screen.machine());
339   sega_generate_vector_list(machine());
340340   SCREEN_UPDATE32_CALL(vector);
341341   return 0;
342342}
trunk/src/mame/video/carjmbre.c
r17988r17989
148148            flipy = !flipy;
149149         }
150150
151         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
151         drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
152152               m_spriteram[troffs + 1],
153153               m_spriteram[troffs + 2] & 0xf,
154154               flipx,flipy,
trunk/src/mame/video/superchs.c
r17988r17989
200200
201201UINT32 superchs_state::screen_update_superchs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
202202{
203   device_t *tc0480scp = screen.machine().device("tc0480scp");
203   device_t *tc0480scp = machine().device("tc0480scp");
204204   UINT8 layer[5];
205205   UINT16 priority;
206206   static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
r17988r17989
214214   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
215215   layer[4] = 4;   /* text layer always over bg layers */
216216
217   screen.machine().priority_bitmap.fill(0, cliprect);
217   machine().priority_bitmap.fill(0, cliprect);
218218
219219   /* We have to assume 2nd to bottom layer is always underneath
220220       sprites as pdrawgfx cannot yet cope with more than 4 layers */
221221
222222#ifdef MAME_DEBUG
223   if (!screen.machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
224   if (!screen.machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
225   if (!screen.machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
226   if (!screen.machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
227   if (!screen.machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
228   if (!screen.machine().input().code_pressed (KEYCODE_N)) draw_sprites(screen.machine(), bitmap, cliprect, primasks, 48, -116);
223   if (!machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
224   if (!machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
225   if (!machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
226   if (!machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
227   if (!machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
228   if (!machine().input().code_pressed (KEYCODE_N)) draw_sprites(machine(), bitmap, cliprect, primasks, 48, -116);
229229#else
230230   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
231231   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
232232   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
233233   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
234234   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);   /* text layer */
235   draw_sprites(screen.machine(), bitmap, cliprect, primasks, 48, -116);
235   draw_sprites(machine(), bitmap, cliprect, primasks, 48, -116);
236236#endif
237237   return 0;
238238}
trunk/src/mame/video/battlera.c
r17988r17989
304304   int offs,code,scrollx,scrolly,mx,my;
305305
306306   /* if any tiles changed, redraw the VRAM */
307   if (screen.machine().gfx[0]->dirtyseq() != m_tile_dirtyseq)
307   if (machine().gfx[0]->dirtyseq() != m_tile_dirtyseq)
308308   {
309      m_tile_dirtyseq = screen.machine().gfx[0]->dirtyseq();
309      m_tile_dirtyseq = machine().gfx[0]->dirtyseq();
310310      memset(m_vram_dirty, 1, 0x1000);
311311   }
312312
r17988r17989
321321      /* If this tile was changed OR tilemap was changed, redraw */
322322      if (m_vram_dirty[offs/2]) {
323323         m_vram_dirty[offs/2]=0;
324         drawgfx_opaque(*m_tile_bitmap,m_tile_bitmap->cliprect(),screen.machine().gfx[0],
324         drawgfx_opaque(*m_tile_bitmap,m_tile_bitmap->cliprect(),machine().gfx[0],
325325               code,
326326               m_HuC6270_vram[offs] >> 4,
327327               0,0,
328328               8*mx,8*my);
329         drawgfx_opaque(*m_front_bitmap,m_tile_bitmap->cliprect(),screen.machine().gfx[2],
329         drawgfx_opaque(*m_front_bitmap,m_tile_bitmap->cliprect(),machine().gfx[2],
330330               0,
331331               0,   /* fill the spot with pen 256 */
332332               0,0,
333333               8*mx,8*my);
334         drawgfx_transmask(*m_front_bitmap,m_tile_bitmap->cliprect(),screen.machine().gfx[0],
334         drawgfx_transmask(*m_front_bitmap,m_tile_bitmap->cliprect(),machine().gfx[0],
335335               code,
336336               m_HuC6270_vram[offs] >> 4,
337337               0,0,
r17988r17989
348348   /* Todo:  Background enable (not used anyway) */
349349
350350   /* Render low priority sprites, if enabled */
351   if (m_sb_enable) draw_sprites(screen.machine(),bitmap,cliprect,0);
351   if (m_sb_enable) draw_sprites(machine(),bitmap,cliprect,0);
352352
353353   /* Render background over sprites */
354354   copyscrollbitmap_trans(bitmap,*m_front_bitmap,1,&scrollx,1,&scrolly,cliprect,256);
355355
356356   /* Render high priority sprites, if enabled */
357   if (m_sb_enable) draw_sprites(screen.machine(),bitmap,cliprect,1);
357   if (m_sb_enable) draw_sprites(machine(),bitmap,cliprect,1);
358358
359359   return 0;
360360}
trunk/src/mame/video/flower.c
r17988r17989
170170   m_bg0_tilemap->draw(bitmap, cliprect, 0,0);
171171   m_bg1_tilemap->draw(bitmap, cliprect, 0,0);
172172
173   draw_sprites(screen.machine(),bitmap,cliprect);
173   draw_sprites(machine(),bitmap,cliprect);
174174
175175   if(flip_screen())
176176   {
trunk/src/mame/video/xain.c
r17988r17989
219219   case 0:
220220      m_bgram0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
221221      m_bgram1_tilemap->draw(bitmap, cliprect, 0,0);
222      draw_sprites(screen.machine(), bitmap,cliprect);
222      draw_sprites(machine(), bitmap,cliprect);
223223      m_char_tilemap->draw(bitmap, cliprect, 0,0);
224224      break;
225225   case 1:
226226      m_bgram1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
227227      m_bgram0_tilemap->draw(bitmap, cliprect, 0,0);
228      draw_sprites(screen.machine(), bitmap,cliprect);
228      draw_sprites(machine(), bitmap,cliprect);
229229      m_char_tilemap->draw(bitmap, cliprect, 0,0);
230230      break;
231231   case 2:
232232      m_char_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
233233      m_bgram0_tilemap->draw(bitmap, cliprect, 0,0);
234      draw_sprites(screen.machine(), bitmap,cliprect);
234      draw_sprites(machine(), bitmap,cliprect);
235235      m_bgram1_tilemap->draw(bitmap, cliprect, 0,0);
236236      break;
237237   case 3:
238238      m_char_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
239239      m_bgram1_tilemap->draw(bitmap, cliprect, 0,0);
240      draw_sprites(screen.machine(), bitmap,cliprect);
240      draw_sprites(machine(), bitmap,cliprect);
241241      m_bgram0_tilemap->draw(bitmap, cliprect, 0,0);
242242      break;
243243   case 4:
244244      m_bgram0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
245245      m_char_tilemap->draw(bitmap, cliprect, 0,0);
246      draw_sprites(screen.machine(), bitmap,cliprect);
246      draw_sprites(machine(), bitmap,cliprect);
247247      m_bgram1_tilemap->draw(bitmap, cliprect, 0,0);
248248      break;
249249   case 5:
250250      m_bgram1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
251251      m_char_tilemap->draw(bitmap, cliprect, 0,0);
252      draw_sprites(screen.machine(), bitmap,cliprect);
252      draw_sprites(machine(), bitmap,cliprect);
253253      m_bgram0_tilemap->draw(bitmap, cliprect, 0,0);
254254      break;
255255   case 6:
256256      m_bgram0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
257      draw_sprites(screen.machine(), bitmap,cliprect);
257      draw_sprites(machine(), bitmap,cliprect);
258258      m_bgram1_tilemap->draw(bitmap, cliprect, 0,0);
259259      m_char_tilemap->draw(bitmap, cliprect, 0,0);
260260      break;
261261   case 7:
262262      m_bgram1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
263      draw_sprites(screen.machine(), bitmap,cliprect);
263      draw_sprites(machine(), bitmap,cliprect);
264264      m_bgram0_tilemap->draw(bitmap, cliprect, 0,0);
265265      m_char_tilemap->draw(bitmap, cliprect, 0,0);
266266      break;
trunk/src/mame/video/mrdo.c
r17988r17989
260260   bitmap.fill(0, cliprect);
261261   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
262262   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
263   draw_sprites(screen.machine(), bitmap, cliprect);
263   draw_sprites(machine(), bitmap, cliprect);
264264   return 0;
265265}
trunk/src/mame/video/namcos1.c
r17988r17989
371371   /* flip screen is embedded in the sprite control registers */
372372   /* can't use flip_screen_set() because the visible area is asymmetrical */
373373   flip_screen_set_no_update(m_spriteram[0x0ff6] & 1);
374   screen.machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
374   machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
375375
376376
377377   /* background color */
378   bitmap.fill(get_black_pen(screen.machine()), cliprect);
378   bitmap.fill(get_black_pen(machine()), cliprect);
379379
380380   /* berabohm uses asymmetrical visibility windows to iris on the character */
381381   i = ((m_cus116[0] << 8) | m_cus116[1]) - 1;         // min x
r17988r17989
414414   }
415415
416416
417   screen.machine().priority_bitmap.fill(0, new_clip);
417   machine().priority_bitmap.fill(0, new_clip);
418418
419419   /* bit 0-2 priority */
420420   /* bit 3   disable  */
r17988r17989
427427      }
428428   }
429429
430   draw_sprites(screen.machine(), bitmap, new_clip);
430   draw_sprites(machine(), bitmap, new_clip);
431431   return 0;
432432}
433433
trunk/src/mame/video/mainevt.c
r17988r17989
9696
9797   k052109_tilemap_update(m_k052109);
9898
99   screen.machine().priority_bitmap.fill(0, cliprect);
99   machine().priority_bitmap.fill(0, cliprect);
100100   k052109_tilemap_draw(m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1);
101101   k052109_tilemap_draw(m_k052109, bitmap, cliprect, 2, 1, 2);   /* low priority part of layer */
102102   k052109_tilemap_draw(m_k052109, bitmap, cliprect, 2, 0, 4);   /* high priority part of layer */
trunk/src/mame/video/m62.c
r17988r17989
475475      m_bg_tilemap->set_scrollx(i, m_m62_background_hscroll);
476476   }
477477   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
478   draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
478   draw_sprites(machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
479479   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
480480   return 0;
481481}
r17988r17989
515515   m_bg_tilemap->set_scrolly(0, m_m62_background_vscroll);
516516
517517   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
518   draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0x10, 0x00);
518   draw_sprites(machine(), bitmap, cliprect, 0x0f, 0x10, 0x00);
519519   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
520   draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0x10, 0x10);
520   draw_sprites(machine(), bitmap, cliprect, 0x0f, 0x10, 0x10);
521521   return 0;
522522}
523523
r17988r17989
563563
564564      my_cliprect.min_y = 0 * 8;
565565      my_cliprect.max_y = 1 * 8 - 1;
566      bitmap.fill(get_black_pen(screen.machine()), my_cliprect);
566      bitmap.fill(get_black_pen(machine()), my_cliprect);
567567
568568      my_cliprect.min_y = 31 * 8;
569569      my_cliprect.max_y = 32 * 8 - 1;
570      bitmap.fill(get_black_pen(screen.machine()), my_cliprect);
570      bitmap.fill(get_black_pen(machine()), my_cliprect);
571571   }
572572
573573   return 0;
r17988r17989
619619   m_fg_tilemap->set_transparent_pen(0);
620620
621621   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
622   draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0x10, 0x00);
622   draw_sprites(machine(), bitmap, cliprect, 0x0f, 0x10, 0x00);
623623   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
624   draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0x10, 0x10);
624   draw_sprites(machine(), bitmap, cliprect, 0x0f, 0x10, 0x10);
625625   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
626626   return 0;
627627}
r17988r17989
648648   m_bg_tilemap->set_scrollx(0, m_m62_background_hscroll - 2);
649649
650650   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
651   draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
651   draw_sprites(machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
652652   return 0;
653653}
654654
r17988r17989
693693
694694   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
695695   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
696   draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
696   draw_sprites(machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
697697   return 0;
698698}
699699
r17988r17989
756756   m_fg_tilemap->set_transparent_pen(0);
757757
758758   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
759   draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
759   draw_sprites(machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
760760   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
761761   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
762762   return 0;
r17988r17989
807807   m_fg_tilemap->set_transparent_pen(0);
808808
809809   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
810   draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
810   draw_sprites(machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
811811   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
812812   return 0;
813813}
r17988r17989
849849   m_fg_tilemap->set_transparent_pen(0);
850850
851851   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
852   draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
852   draw_sprites(machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
853853   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
854854   return 0;
855855}
r17988r17989
893893   m_fg_tilemap->set_transparent_pen(0);
894894
895895   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
896   draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
896   draw_sprites(machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
897897   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
898898   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
899899   return 0;
r17988r17989
934934      m_bg_tilemap->set_scrollx(i, m_scrollram[i << 1] | (m_scrollram[(i << 1) | 1] << 8));
935935   }
936936   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
937   draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
937   draw_sprites(machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
938938   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
939939   return 0;
940940}
trunk/src/mame/video/megazone.c
r17988r17989
133133         flipy = !flipy;
134134      }
135135
136      drawgfx_opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), screen.machine().gfx[1],
136      drawgfx_opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), machine().gfx[1],
137137            ((int)m_videoram[offs]) + ((m_colorram[offs] & (1 << 7) ? 256 : 0) ),
138138            (m_colorram[offs] & 0x0f) + 0x10,
139139            flipx,flipy,
r17988r17989
180180         else
181181            sx = sx + 32;
182182
183         drawgfx_transmask(bitmap,cliprect,screen.machine().gfx[0],
183         drawgfx_transmask(bitmap,cliprect,machine().gfx[0],
184184               spriteram[offs + 2],
185185               color,
186186               flipx,flipy,
187187               sx,sy,
188               colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[0], color, 0));
188               colortable_get_transpen_mask(machine().colortable, machine().gfx[0], color, 0));
189189      }
190190   }
191191
r17988r17989
213213
214214
215215
216         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1],
216         drawgfx_opaque(bitmap, cliprect, machine().gfx[1],
217217               ((int)m_videoram2[offs]) + ((m_colorram2[offs] & (1 << 7) ? 256 : 0) ),
218218               (m_colorram2[offs] & 0x0f) + 0x10,
219219               flipx,flipy,
trunk/src/mame/video/toki.c
r17988r17989
280280      m_foreground_layer->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
281281      m_background_layer->draw(bitmap, cliprect, 0,0);
282282   }
283   toki_draw_sprites(screen.machine(), bitmap,cliprect);
283   toki_draw_sprites(machine(), bitmap,cliprect);
284284   m_text_layer->draw(bitmap, cliprect, 0,0);
285285   return 0;
286286}
r17988r17989
302302      m_background_layer->draw(bitmap, cliprect, 0,0);
303303   }
304304
305   tokib_draw_sprites(screen.machine(), bitmap,cliprect);
305   tokib_draw_sprites(machine(), bitmap,cliprect);
306306   m_text_layer->draw(bitmap, cliprect, 0,0);
307307   return 0;
308308}
trunk/src/mame/video/40love.c
r17988r17989
352352
353353UINT32 fortyl_state::screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
354354{
355   draw_pixram(screen.machine(), bitmap, cliprect);
355   draw_pixram(machine(), bitmap, cliprect);
356356
357357   m_bg_tilemap->set_scrolldy(- m_video_ctrl[1] + 1, - m_video_ctrl[1] - 1 );
358358   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
359359
360   draw_sprites(screen.machine(), bitmap, cliprect);
360   draw_sprites(machine(), bitmap, cliprect);
361361   return 0;
362362}
trunk/src/mame/video/renegade.c
r17988r17989
128128{
129129   m_bg_tilemap->set_scrollx(0, m_scrollx);
130130   m_bg_tilemap->draw(bitmap, cliprect, 0 , 0);
131   draw_sprites(screen.machine(), bitmap, cliprect);
131   draw_sprites(machine(), bitmap, cliprect);
132132   m_fg_tilemap->draw(bitmap, cliprect, 0 , 0);
133133   return 0;
134134}
trunk/src/mame/video/galaga.c
r17988r17989
565565UINT32 galaga_state::screen_update_galaga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
566566{
567567
568   bitmap.fill(get_black_pen(screen.machine()), cliprect);
569   draw_stars(screen.machine(),bitmap,cliprect);
570   draw_sprites(screen.machine(),bitmap,cliprect);
568   bitmap.fill(get_black_pen(machine()), cliprect);
569   draw_stars(machine(),bitmap,cliprect);
570   draw_sprites(machine(),bitmap,cliprect);
571571   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
572572   return 0;
573573}
trunk/src/mame/video/lasso.c
r17988r17989
361361
362362UINT32 lasso_state::screen_update_lasso(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
363363{
364   palette_set_color(screen.machine(), 0, get_color(*m_back_color));
364   palette_set_color(machine(), 0, get_color(*m_back_color));
365365   bitmap.fill(0, cliprect);
366366
367367   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
368   draw_lasso(screen.machine(), bitmap, cliprect);
369   draw_sprites(screen.machine(), bitmap, cliprect, 0);
368   draw_lasso(machine(), bitmap, cliprect);
369   draw_sprites(machine(), bitmap, cliprect, 0);
370370
371371   return 0;
372372}
373373
374374UINT32 lasso_state::screen_update_chameleo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
375375{
376   palette_set_color(screen.machine(), 0, get_color(*m_back_color));
376   palette_set_color(machine(), 0, get_color(*m_back_color));
377377   bitmap.fill(0, cliprect);
378378
379379   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
380   draw_sprites(screen.machine(), bitmap, cliprect, 0);
380   draw_sprites(machine(), bitmap, cliprect, 0);
381381
382382   return 0;
383383}
r17988r17989
385385
386386UINT32 lasso_state::screen_update_wwjgtin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
387387{
388   colortable_palette_set_color(screen.machine().colortable, 0, get_color(*m_back_color));
389   wwjgtin_set_last_four_colors(screen.machine(), screen.machine().colortable);
388   colortable_palette_set_color(machine().colortable, 0, get_color(*m_back_color));
389   wwjgtin_set_last_four_colors(machine(), machine().colortable);
390390
391391   m_track_tilemap->set_scrollx(0, m_track_scroll[0] + m_track_scroll[1] * 256);
392392   m_track_tilemap->set_scrolly(0, m_track_scroll[2] + m_track_scroll[3] * 256);
r17988r17989
394394   if (m_track_enable)
395395      m_track_tilemap->draw(bitmap, cliprect, 0, 0);
396396   else
397      bitmap.fill(get_black_pen(screen.machine()), cliprect);
397      bitmap.fill(get_black_pen(machine()), cliprect);
398398
399   draw_sprites(screen.machine(), bitmap, cliprect, 1);   // reverse order
399   draw_sprites(machine(), bitmap, cliprect, 1);   // reverse order
400400   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
401401
402402   return 0;
trunk/src/mame/video/taito_h.c
r17988r17989
399399
400400   tc0080vco_tilemap_update(m_tc0080vco);
401401
402   taitoh_log_vram(screen.machine());
402   taitoh_log_vram(machine());
403403
404404   bitmap.fill(0, cliprect);
405405
406406   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
407407   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0);
408   syvalion_draw_sprites(screen.machine(), bitmap,cliprect);
408   syvalion_draw_sprites(machine(), bitmap,cliprect);
409409   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 2, 0, 0);
410410
411411   return 0;
r17988r17989
417417
418418   tc0080vco_tilemap_update(m_tc0080vco);
419419
420   taitoh_log_vram(screen.machine());
420   taitoh_log_vram(machine());
421421
422422   bitmap.fill(0, cliprect);
423423
424424#ifdef MAME_DEBUG
425   if (!screen.machine().input().code_pressed(KEYCODE_A))
425   if (!machine().input().code_pressed(KEYCODE_A))
426426      tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
427   if (!screen.machine().input().code_pressed(KEYCODE_S))
428      recordbr_draw_sprites(screen.machine(), bitmap, cliprect, 0);
429   if (!screen.machine().input().code_pressed(KEYCODE_D))
427   if (!machine().input().code_pressed(KEYCODE_S))
428      recordbr_draw_sprites(machine(), bitmap, cliprect, 0);
429   if (!machine().input().code_pressed(KEYCODE_D))
430430      tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0);
431   if (!screen.machine().input().code_pressed(KEYCODE_F))
432      recordbr_draw_sprites(screen.machine(), bitmap, cliprect, 1);
431   if (!machine().input().code_pressed(KEYCODE_F))
432      recordbr_draw_sprites(machine(), bitmap, cliprect, 1);
433433#else
434434   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
435   recordbr_draw_sprites(screen.machine(), bitmap, cliprect, 0);
435   recordbr_draw_sprites(machine(), bitmap, cliprect, 0);
436436   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0);
437   recordbr_draw_sprites(screen.machine(), bitmap, cliprect, 1);
437   recordbr_draw_sprites(machine(), bitmap, cliprect, 1);
438438#endif
439439
440440   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 2, 0, 0);
r17988r17989
447447
448448   tc0080vco_tilemap_update(m_tc0080vco);
449449
450   taitoh_log_vram(screen.machine());
450   taitoh_log_vram(machine());
451451
452452   bitmap.fill(0, cliprect);
453453
454454#ifdef MAME_DEBUG
455   if (!screen.machine().input().code_pressed(KEYCODE_A))
455   if (!machine().input().code_pressed(KEYCODE_A))
456456      tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
457   if (!screen.machine().input().code_pressed(KEYCODE_S))
458      dleague_draw_sprites(screen.machine(), bitmap, cliprect, 0);
459   if (!screen.machine().input().code_pressed(KEYCODE_D))
457   if (!machine().input().code_pressed(KEYCODE_S))
458      dleague_draw_sprites(machine(), bitmap, cliprect, 0);
459   if (!machine().input().code_pressed(KEYCODE_D))
460460      tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0);
461   if (!screen.machine().input().code_pressed(KEYCODE_F))
462      dleague_draw_sprites(screen.machine(), bitmap, cliprect, 1);
461   if (!machine().input().code_pressed(KEYCODE_F))
462      dleague_draw_sprites(machine(), bitmap, cliprect, 1);
463463#else
464464   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
465   dleague_draw_sprites (screen.machine(), bitmap, cliprect, 0);
465   dleague_draw_sprites (machine(), bitmap, cliprect, 0);
466466   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0);
467   dleague_draw_sprites (screen.machine(), bitmap, cliprect, 1);
467   dleague_draw_sprites (machine(), bitmap, cliprect, 1);
468468#endif
469469
470470   tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 2, 0, 0);
trunk/src/mame/video/psychic5.c
r17988r17989
411411
412412UINT32 psychic5_state::screen_update_psychic5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
413413{
414   bitmap.fill(get_black_pen(screen.machine()), cliprect);
414   bitmap.fill(get_black_pen(machine()), cliprect);
415415   if (m_bg_status & 1)   /* Backgound enable */
416      draw_background(screen.machine(), bitmap, cliprect);
416      draw_background(machine(), bitmap, cliprect);
417417   if (!(m_title_screen & 1))
418      draw_sprites(screen.machine(), bitmap, cliprect);
418      draw_sprites(machine(), bitmap, cliprect);
419419   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
420420   return 0;
421421}
r17988r17989
425425   if (m_bg_status & 1)   /* Backgound enable */
426426      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
427427   else
428      bitmap.fill(screen.machine().pens[0x0ff], cliprect);
429   draw_sprites(screen.machine(), bitmap, cliprect);
428      bitmap.fill(machine().pens[0x0ff], cliprect);
429   draw_sprites(machine(), bitmap, cliprect);
430430   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
431431   return 0;
432432}
trunk/src/mame/video/8080bw.c
r17988r17989
133133      UINT8 data = m_main_ram[offs];
134134      UINT8 fore_color = m_screen_red ? 1 : color_map_base[color_address] & 0x07;
135135
136      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0);
136      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, 0);
137137   }
138138
139   clear_extra_columns(screen.machine(), bitmap, pens, 0);
139   clear_extra_columns(machine(), bitmap, pens, 0);
140140
141141   return 0;
142142}
r17988r17989
165165      UINT8 fore_color = m_screen_red ? 1 : color_map_base[color_address] & 0x07;
166166
167167      /* blue background */
168      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 2);
168      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, 2);
169169   }
170170
171   clear_extra_columns(screen.machine(), bitmap, pens, 2);
171   clear_extra_columns(machine(), bitmap, pens, 2);
172172
173173   return 0;
174174}
r17988r17989
205205         back_color = (((back_data & 0x0c) == 0x0c) && m_schaser_background_select) ? 4 : 2;
206206      }
207207
208      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, back_color);
208      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, back_color);
209209   }
210210
211   clear_extra_columns(screen.machine(), bitmap, pens, m_schaser_background_disable ? 0 : 2);
211   clear_extra_columns(machine(), bitmap, pens, m_schaser_background_disable ? 0 : 2);
212212
213213   return 0;
214214}
r17988r17989
230230      UINT8 fore_color = m_colorram[offs & 0x1f9f] & 0x07;
231231
232232      /* blue background */
233      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 2);
233      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, 2);
234234   }
235235
236   clear_extra_columns(screen.machine(), bitmap, pens, 2);
236   clear_extra_columns(machine(), bitmap, pens, 2);
237237
238238   return 0;
239239}
r17988r17989
254254      UINT8 data = m_main_ram[offs];
255255      UINT8 fore_color = m_colorram[offs & 0x1f1f] & 0x07;
256256
257      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0);
257      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, 0);
258258   }
259259
260   clear_extra_columns(screen.machine(), bitmap, pens, 0);
260   clear_extra_columns(machine(), bitmap, pens, 0);
261261
262262   return 0;
263263}
r17988r17989
272272
273273   invadpt2_get_pens(pens);
274274
275   color_map_base = screen.machine().root_device().memregion("proms")->base();
275   color_map_base = machine().root_device().memregion("proms")->base();
276276   cloud_gfx = memregion("user1")->base();
277277
278278   for (offs = 0; offs < m_main_ram.bytes(); offs++)
r17988r17989
297297
298298      if ((color_map_base[color_address] & 0x08) || (cloud_y >= 64))
299299      {
300         set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, back_color);
300         set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, back_color);
301301      }
302302      else
303303      {
r17988r17989
320320               color = (cloud_gfx[cloud_gfx_offs] & bit) ? 7 : back_color;
321321            }
322322
323            set_pixel(screen.machine(), bitmap, y, x, pens, color);
323            set_pixel(machine(), bitmap, y, x, pens, color);
324324
325325            x = x + 1;
326326            data = data >> 1;
r17988r17989
328328      }
329329   }
330330
331   clear_extra_columns(screen.machine(), bitmap, pens, 6);
331   clear_extra_columns(machine(), bitmap, pens, 6);
332332
333333   return 0;
334334}
r17988r17989
349349      UINT8 data = m_main_ram[offs];
350350      UINT8 fore_color = ~m_colorram[offs & 0x1f9f] & 0x07;
351351
352      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0);
352      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, 0);
353353   }
354354
355   clear_extra_columns(screen.machine(), bitmap, pens, 0);
355   clear_extra_columns(machine(), bitmap, pens, 0);
356356
357357   return 0;
358358}
r17988r17989
375375      UINT8 data = m_main_ram[offs];
376376      UINT8 fore_color = m_colorram[color_address] & 0x07;
377377
378      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0);
378      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, 0);
379379   }
380380
381   clear_extra_columns(screen.machine(), bitmap, pens, 0);
381   clear_extra_columns(machine(), bitmap, pens, 0);
382382
383383   return 0;
384384}
r17988r17989
406406      UINT8 data = m_main_ram[offs];
407407      UINT8 fore_color = color_map_base[color_address] & 0x07;
408408
409      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0);
409      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, 0);
410410   }
411411
412   clear_extra_columns(screen.machine(), bitmap, pens, 0);
412   clear_extra_columns(machine(), bitmap, pens, 0);
413413
414414   return 0;
415415}
r17988r17989
439439      }
440440   }
441441
442   clear_extra_columns(screen.machine(), bitmap, pens, 0);
442   clear_extra_columns(machine(), bitmap, pens, 0);
443443
444444   return 0;
445445}
r17988r17989
460460      UINT8 data = m_main_ram[offs];
461461      UINT8 fore_color = m_colorram[offs & 0x1f9f] & 0x07;
462462
463      set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0);
463      set_8_pixels(machine(), bitmap, y, x, data, pens, fore_color, 0);
464464   }
465465
466   clear_extra_columns(screen.machine(), bitmap, pens, 0);
466   clear_extra_columns(machine(), bitmap, pens, 0);
467467
468468   return 0;
469469}
trunk/src/mame/video/othunder.c
r17988r17989
209209   layer[1] = layer[0] ^ 1;
210210   layer[2] = 2;
211211
212   screen.machine().priority_bitmap.fill(0, cliprect);
212   machine().priority_bitmap.fill(0, cliprect);
213213
214214   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
215215   bitmap.fill(0, cliprect);
r17988r17989
221221   /* Sprites can be under/over the layer below text layer */
222222   {
223223      static const int primasks[2] = {0xf0, 0xfc};
224      draw_sprites(screen.machine(), bitmap, cliprect, primasks, 3);
224      draw_sprites(machine(), bitmap, cliprect, primasks, 3);
225225   }
226226
227227   return 0;
trunk/src/mame/video/ginganin.c
r17988r17989
244244   int layers_ctrl1 = m_layers_ctrl;
245245
246246#ifdef MAME_DEBUG
247if (screen.machine().input().code_pressed(KEYCODE_Z))
247if (machine().input().code_pressed(KEYCODE_Z))
248248{
249249   int msk = 0;
250250
251   if (screen.machine().input().code_pressed(KEYCODE_Q)) { msk |= 0xfff1;}
252   if (screen.machine().input().code_pressed(KEYCODE_W)) { msk |= 0xfff2;}
253   if (screen.machine().input().code_pressed(KEYCODE_E)) { msk |= 0xfff4;}
254   if (screen.machine().input().code_pressed(KEYCODE_A))   { msk |= 0xfff8;}
251   if (machine().input().code_pressed(KEYCODE_Q)) { msk |= 0xfff1;}
252   if (machine().input().code_pressed(KEYCODE_W)) { msk |= 0xfff2;}
253   if (machine().input().code_pressed(KEYCODE_E)) { msk |= 0xfff4;}
254   if (machine().input().code_pressed(KEYCODE_A))   { msk |= 0xfff8;}
255255   if (msk != 0) layers_ctrl1 &= msk;
256256
257257#define SETSCROLL \
r17988r17989
261261   m_fg_tilemap->set_scrolly(0, m_posy); \
262262   popmessage("B>%04X:%04X F>%04X:%04X",m_posx%(BG_NX*16),m_posy%(BG_NY*16),m_posx%(FG_NX*16),m_posy%(FG_NY*16));
263263
264   if (screen.machine().input().code_pressed(KEYCODE_L))   { m_posx +=8; SETSCROLL }
265   if (screen.machine().input().code_pressed(KEYCODE_J))   { m_posx -=8; SETSCROLL }
266   if (screen.machine().input().code_pressed(KEYCODE_K))   { m_posy +=8; SETSCROLL }
267   if (screen.machine().input().code_pressed(KEYCODE_I))   { m_posy -=8; SETSCROLL }
268   if (screen.machine().input().code_pressed(KEYCODE_H))   { m_posx = m_posy = 0;   SETSCROLL }
264   if (machine().input().code_pressed(KEYCODE_L))   { m_posx +=8; SETSCROLL }
265   if (machine().input().code_pressed(KEYCODE_J))   { m_posx -=8; SETSCROLL }
266   if (machine().input().code_pressed(KEYCODE_K))   { m_posy +=8; SETSCROLL }
267   if (machine().input().code_pressed(KEYCODE_I))   { m_posy -=8; SETSCROLL }
268   if (machine().input().code_pressed(KEYCODE_H))   { m_posx = m_posy = 0;   SETSCROLL }
269269
270270}
271271#endif
r17988r17989
279279   if (layers_ctrl1 & 2)
280280      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
281281   if (layers_ctrl1 & 8)
282      draw_sprites(screen.machine(), bitmap, cliprect);
282      draw_sprites(machine(), bitmap, cliprect);
283283   if (layers_ctrl1 & 4)
284284      m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
285285
trunk/src/mame/video/tail2nos.c
r17988r17989
177177   if (m_video_enable)
178178   {
179179      k051316_zoom_draw(m_k051316, bitmap, cliprect, 0, 0);
180      draw_sprites(screen.machine(), bitmap, cliprect);
180      draw_sprites(machine(), bitmap, cliprect);
181181      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
182182   }
183183   else
trunk/src/mame/video/mrjong.c
r17988r17989
145145UINT32 mrjong_state::screen_update_mrjong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
146146{
147147   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
148   draw_sprites(screen.machine(), bitmap, cliprect);
148   draw_sprites(machine(), bitmap, cliprect);
149149   return 0;
150150}
trunk/src/mame/video/quasar.c
r17988r17989
125125            bitmap.pix16(y + oy, x + ox) = forecolor;
126126
127127      /* Main Screen */
128      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
128      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
129129            code,
130130            m_color_ram[offs] & 0x3f,
131131            0,0,
r17988r17989
135135      /* background for Collision Detection (it can only hit certain items) */
136136      if((m_color_ram[offs] & 7) == 0)
137137      {
138         drawgfx_opaque(m_collision_background,cliprect,screen.machine().gfx[0],
138         drawgfx_opaque(m_collision_background,cliprect,machine().gfx[0],
139139               code,
140140               64,
141141               0,0,
r17988r17989
189189               bitmap.pix16(y, x) = S2636_PIXEL_COLOR(pixel);
190190
191191               /* S2636 vs. background collision detection */
192               if (colortable_entry_get_value(screen.machine().colortable, m_collision_background.pix16(y, x)))
192               if (colortable_entry_get_value(machine().colortable, m_collision_background.pix16(y, x)))
193193               {
194194                  if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision_register |= 0x01;
195195                  if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x02;
trunk/src/mame/video/slapshot.c
r17988r17989
433433   if (state)
434434   {
435435
436      taito_update_sprites_active_area(screen.machine());
436      taito_update_sprites_active_area(machine());
437437
438438      m_prepare_sprites = 1;
439439   }
r17988r17989
458458
459459UINT32 slapshot_state::screen_update_slapshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
460460{
461   address_space &space = screen.machine().driver_data()->generic_space();
461   address_space &space = machine().driver_data()->generic_space();
462462   UINT8 layer[5];
463463   UINT8 tilepri[5];
464464   UINT8 spritepri[4];
465465   UINT16 priority;
466466
467467#ifdef MAME_DEBUG
468   if (screen.machine().input().code_pressed_once (KEYCODE_Z))
468   if (machine().input().code_pressed_once (KEYCODE_Z))
469469   {
470470      m_dislayer[0] ^= 1;
471471      popmessage("bg0: %01x",m_dislayer[0]);
472472   }
473473
474   if (screen.machine().input().code_pressed_once (KEYCODE_X))
474   if (machine().input().code_pressed_once (KEYCODE_X))
475475   {
476476      m_dislayer[1] ^= 1;
477477      popmessage("bg1: %01x",m_dislayer[1]);
478478   }
479479
480   if (screen.machine().input().code_pressed_once (KEYCODE_C))
480   if (machine().input().code_pressed_once (KEYCODE_C))
481481   {
482482      m_dislayer[2] ^= 1;
483483      popmessage("bg2: %01x",m_dislayer[2]);
484484   }
485485
486   if (screen.machine().input().code_pressed_once (KEYCODE_V))
486   if (machine().input().code_pressed_once (KEYCODE_V))
487487   {
488488      m_dislayer[3] ^= 1;
489489      popmessage("bg3: %01x",m_dislayer[3]);
490490   }
491491
492   if (screen.machine().input().code_pressed_once (KEYCODE_B))
492   if (machine().input().code_pressed_once (KEYCODE_B))
493493   {
494494      m_dislayer[4] ^= 1;
495495      popmessage("text: %01x",m_dislayer[4]);
496496   }
497497#endif
498498
499   taito_handle_sprite_buffering(screen.machine());
499   taito_handle_sprite_buffering(machine());
500500
501501   tc0480scp_tilemap_update(m_tc0480scp);
502502
r17988r17989
521521   spritepri[2] = tc0360pri_r(m_tc0360pri, space, 7) & 0x0f;
522522   spritepri[3] = tc0360pri_r(m_tc0360pri, space, 7) >> 4;
523523
524   screen.machine().priority_bitmap.fill(0, cliprect);
524   machine().priority_bitmap.fill(0, cliprect);
525525   bitmap.fill(0, cliprect);
526526
527527#ifdef MAME_DEBUG
r17988r17989
556556         if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00;
557557      }
558558
559      draw_sprites(screen.machine(),bitmap,cliprect,primasks,0);
559      draw_sprites(machine(),bitmap,cliprect,primasks,0);
560560   }
561561
562562   /*
trunk/src/mame/video/victory.c
r17988r17989
10931093   int x, y;
10941094
10951095   /* copy the palette from palette RAM */
1096   set_palette(screen.machine());
1096   set_palette(machine());
10971097
10981098   /* update the foreground & background */
1099   update_foreground(screen.machine());
1100   update_background(screen.machine());
1099   update_foreground(machine());
1100   update_background(machine());
11011101
11021102   /* blend the bitmaps and do collision detection */
11031103   for (y = 0; y < 256; y++)
r17988r17989
11141114         int bpix = bg[(x + m_scrollx) & 255];
11151115         scanline[x] = bpix | (fpix << 3);
11161116         if (fpix && (bpix & bgcollmask) && count++ < 128)
1117            screen.machine().scheduler().timer_set(screen.time_until_pos(y, x), FUNC(bgcoll_irq_callback), x | (y << 8));
1117            machine().scheduler().timer_set(screen.time_until_pos(y, x), FUNC(bgcoll_irq_callback), x | (y << 8));
11181118      }
11191119   }
11201120
trunk/src/mame/video/1943.c
r17988r17989
258258   if (m_bg2_on)
259259      m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
260260   else
261      bitmap.fill(get_black_pen(screen.machine()), cliprect);
261      bitmap.fill(get_black_pen(machine()), cliprect);
262262
263263   if (m_obj_on)
264      draw_sprites(screen.machine(), bitmap, cliprect, 0);
264      draw_sprites(machine(), bitmap, cliprect, 0);
265265
266266   if (m_bg1_on)
267267      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
268268
269269   if (m_obj_on)
270      draw_sprites(screen.machine(), bitmap, cliprect, 1);
270      draw_sprites(machine(), bitmap, cliprect, 1);
271271
272272   if (m_char_on)
273273      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/cninja.c
r17988r17989
126126
127127UINT32 cninja_state::screen_update_cninja(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
128128{
129   address_space &space = screen.machine().driver_data()->generic_space();
129   address_space &space = machine().driver_data()->generic_space();
130130   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
131131
132132   flip_screen_set(BIT(flip, 7));
r17988r17989
134134   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
135135
136136   /* Draw playfields */
137   screen.machine().priority_bitmap.fill(0, cliprect);
137   machine().priority_bitmap.fill(0, cliprect);
138138   bitmap.fill(512, cliprect);
139139   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
140140   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
141141   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
142142   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4);
143   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
143   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
144144   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
145145   return 0;
146146}
147147
148148UINT32 cninja_state::screen_update_cninjabl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
149149{
150   address_space &space = screen.machine().driver_data()->generic_space();
150   address_space &space = machine().driver_data()->generic_space();
151151   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
152152
153153   /* force layers to be enabled */
r17988r17989
159159   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
160160
161161   /* Draw playfields */
162   screen.machine().priority_bitmap.fill(0, cliprect);
162   machine().priority_bitmap.fill(0, cliprect);
163163   bitmap.fill(512, cliprect);
164164   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
165165   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
166166   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
167167   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4);
168   cninjabl_draw_sprites(screen.machine(), bitmap, cliprect);
168   cninjabl_draw_sprites(machine(), bitmap, cliprect);
169169   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
170170   return 0;
171171}
172172
173173UINT32 cninja_state::screen_update_edrandy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
174174{
175   address_space &space = screen.machine().driver_data()->generic_space();
175   address_space &space = machine().driver_data()->generic_space();
176176   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
177177
178178   flip_screen_set(BIT(flip, 7));
179179   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
180180   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
181181
182   screen.machine().priority_bitmap.fill(0, cliprect);
182   machine().priority_bitmap.fill(0, cliprect);
183183   bitmap.fill(0, cliprect);
184184   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
185185   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
186186   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
187   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
187   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
188188   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
189189   return 0;
190190}
191191
192192UINT32 cninja_state::screen_update_robocop2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
193193{
194   address_space &space = screen.machine().driver_data()->generic_space();
194   address_space &space = machine().driver_data()->generic_space();
195195   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
196196   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
197197
r17988r17989
215215   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
216216
217217   /* Draw playfields */
218   screen.machine().priority_bitmap.fill(0, cliprect);
218   machine().priority_bitmap.fill(0, cliprect);
219219   bitmap.fill(0x200, cliprect);
220220
221221   if ((priority & 4) == 0)
r17988r17989
235235         break;
236236   }
237237
238   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
238   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
239239   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
240240   return 0;
241241}
r17988r17989
248248
249249UINT32 cninja_state::screen_update_mutantf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
250250{
251   address_space &space = screen.machine().driver_data()->generic_space();
251   address_space &space = machine().driver_data()->generic_space();
252252   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
253253   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
254254
r17988r17989
260260   /* Draw playfields */
261261   bitmap.fill(0x400, cliprect); /* Confirmed */
262262
263   screen.machine().device<decospr_device>("spritegen1")->set_alt_format(true);
264   screen.machine().device<decospr_device>("spritegen2")->set_alt_format(true);
265   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true);
266   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
263   machine().device<decospr_device>("spritegen1")->set_alt_format(true);
264   machine().device<decospr_device>("spritegen2")->set_alt_format(true);
265   machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true);
266   machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
267267
268268
269269   /* There is no priority prom on this board, but there is a
r17988r17989
284284
285285   if (priority & 1)
286286   {
287      screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
288      screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer?
287      machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
288      machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer?
289289   }
290290   else
291291   {
292      screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80);  // fixed alpha of 0x80 for this layer?
293      screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
292      machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80);  // fixed alpha of 0x80 for this layer?
293      machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
294294   }
295295   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
296296   return 0;
trunk/src/mame/video/pacland.c
r17988r17989
376376   /* draw high priority sprite pixels, setting priority bitmap to non-zero
377377       wherever there is a high-priority pixel; note that we draw to the bitmap
378378       which is safe because the bg_tilemap draw will overwrite everything */
379   screen.machine().priority_bitmap.fill(0x00, cliprect);
380   draw_sprites(screen.machine(), bitmap, cliprect, 0);
379   machine().priority_bitmap.fill(0x00, cliprect);
380   draw_sprites(machine(), bitmap, cliprect, 0);
381381
382382   /* draw background */
383383   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
384384
385385   /* draw low priority fg tiles */
386   draw_fg(screen.machine(), bitmap, cliprect, 0);
386   draw_fg(machine(), bitmap, cliprect, 0);
387387
388388   /* draw sprites with regular transparency */
389   draw_sprites(screen.machine(), bitmap, cliprect, 1);
389   draw_sprites(machine(), bitmap, cliprect, 1);
390390
391391   /* draw high priority fg tiles */
392   draw_fg(screen.machine(), bitmap, cliprect, 1);
392   draw_fg(machine(), bitmap, cliprect, 1);
393393
394394   /* draw sprite pixels with colortable values >= 0xf0, which have priority over everything */
395   draw_sprites(screen.machine(), bitmap, cliprect, 2);
395   draw_sprites(machine(), bitmap, cliprect, 2);
396396   return 0;
397397}
trunk/src/mame/video/psikyo4.c
r17988r17989
130130UINT32 psikyo4_state::screen_update_psikyo4_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
131131{
132132   bitmap.fill(0x1000, cliprect);
133   draw_sprites(screen.machine(), bitmap, cliprect, 0x0000);
133   draw_sprites(machine(), bitmap, cliprect, 0x0000);
134134   return 0;
135135}
136136
137137UINT32 psikyo4_state::screen_update_psikyo4_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
138138{
139139   bitmap.fill(0x1001, cliprect);
140   draw_sprites(screen.machine(), bitmap, cliprect, 0x2000);
140   draw_sprites(machine(), bitmap, cliprect, 0x2000);
141141   return 0;
142142}
143143
trunk/src/mame/video/rollrace.c
r17988r17989
126126            sy = 31-sy ;
127127
128128         drawgfx_transpen(bitmap,
129            cliprect,screen.machine().gfx[RA_BGCHAR_BASE],
129            cliprect,machine().gfx[RA_BGCHAR_BASE],
130130            mem[offs + ( m_ra_bkgpage * 1024 )]
131131            + ((( mem[offs + 0x4000 + ( m_ra_bkgpage * 1024 )] & 0xc0 ) >> 6 ) * 256 ) ,
132132            m_ra_bkgcol,
r17988r17989
164164      if(bank)
165165         bank += m_ra_spritebank;
166166
167      drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[ RA_SP_BASE + bank ],
167      drawgfx_transpen(bitmap, cliprect,machine().gfx[ RA_SP_BASE + bank ],
168168         spriteram[offs+1] & 0x3f ,
169169         spriteram[offs+2] & 0x1f,
170170         m_ra_flipx,!(s_flipy^m_ra_flipy),
r17988r17989
192192
193193      if (m_ra_flipx) sx = 31 - sx;
194194
195      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[RA_FGCHAR_BASE + m_ra_chrbank]  ,
195      drawgfx_transpen(bitmap,cliprect,machine().gfx[RA_FGCHAR_BASE + m_ra_chrbank]  ,
196196         m_videoram[ offs ]  ,
197197         col,
198198         m_ra_flipx,m_ra_flipy,
trunk/src/mame/video/popper.c
r17988r17989
251251   m_ol_p123_tilemap->draw(bitmap, finalclip, TILEMAP_DRAW_LAYER1, 0);
252252   m_ol_p0_tilemap->draw(bitmap, finalclip, TILEMAP_DRAW_LAYER1, 0);
253253
254   draw_sprites(screen.machine(), bitmap, cliprect);
254   draw_sprites(machine(), bitmap, cliprect);
255255
256256   m_p123_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
257257   m_p0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
trunk/src/mame/video/ladyfrog.c
r17988r17989
161161{
162162
163163   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
164   draw_sprites(screen.machine(), bitmap, cliprect);
164   draw_sprites(machine(), bitmap, cliprect);
165165   return 0;
166166}
trunk/src/mame/video/sidearms.c
r17988r17989
339339UINT32 sidearms_state::screen_update_sidearms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
340340{
341341
342   sidearms_draw_starfield(screen.machine(), bitmap);
342   sidearms_draw_starfield(machine(), bitmap);
343343
344344   m_bg_tilemap->set_scrollx(0, m_bg_scrollx[0] + (m_bg_scrollx[1] << 8 & 0xf00));
345345   m_bg_tilemap->set_scrolly(0, m_bg_scrolly[0] + (m_bg_scrolly[1] << 8 & 0xf00));
r17988r17989
348348      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
349349
350350   if (m_objon)
351      draw_sprites(screen.machine(), bitmap, cliprect);
351      draw_sprites(machine(), bitmap, cliprect);
352352
353353   if (m_charon)
354354      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/tumblep.c
r17988r17989
2121
2222UINT32 tumblep_state::screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
2323{
24   address_space &space = screen.machine().driver_data()->generic_space();
24   address_space &space = machine().driver_data()->generic_space();
2525   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
2626
2727   flip_screen_set(BIT(flip, 7));
r17988r17989
3232   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
3333   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
3434
35   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
35   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
3636   return 0;
3737}
trunk/src/mame/video/jack.c
r17988r17989
9696UINT32 jack_state::screen_update_jack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
9797{
9898   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
99   jack_draw_sprites(screen.machine(), bitmap, cliprect);
99   jack_draw_sprites(machine(), bitmap, cliprect);
100100   return 0;
101101}
102102
r17988r17989
179179UINT32 jack_state::screen_update_joinem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
180180{
181181   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
182   joinem_draw_sprites(screen.machine(), bitmap, cliprect);
182   joinem_draw_sprites(machine(), bitmap, cliprect);
183183   return 0;
184184}
trunk/src/mame/video/dogfgt.c
r17988r17989
215215
216216   if (m_lastflip != flip_screen() || m_lastpixcolor != m_pixcolor)
217217   {
218      address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
218      address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
219219
220220      m_lastflip = flip_screen();
221221      m_lastpixcolor = m_pixcolor;
r17988r17989
227227
228228   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
229229
230   draw_sprites(screen.machine(), bitmap, cliprect);
230   draw_sprites(machine(), bitmap, cliprect);
231231
232232   copybitmap_trans(bitmap, m_pixbitmap, 0, 0, 0, 0, cliprect, PIXMAP_COLOR_BASE + 8 * m_pixcolor);
233233   return 0;
trunk/src/mame/video/dietgo.c
r17988r17989
55
66UINT32 dietgo_state::screen_update_dietgo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
77{
8   address_space &space = screen.machine().driver_data()->generic_space();
8   address_space &space = machine().driver_data()->generic_space();
99   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
1010
1111   flip_screen_set(BIT(flip, 7));
r17988r17989
1616   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
1717   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
1818
19   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
19   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
2020   return 0;
2121}
trunk/src/mame/video/vigilant.c
r17988r17989
274274      int color = (attributes & 0xF0) >> 4;
275275      int tile_number = videoram[offs] | ((attributes & 0x0F) << 8);
276276
277      drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
277      drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
278278            tile_number,
279279            color,
280280            0,0,
281281            sx,sy);
282282   }
283283
284   draw_sprites(screen.machine(),bitmap,cliprect);
284   draw_sprites(machine(),bitmap,cliprect);
285285   return 0;
286286}
287287
r17988r17989
299299      g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + i] << 3) & 0xFF;
300300      b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + i] << 3) & 0xFF;
301301
302      palette_set_color(screen.machine(),512 + i,MAKE_RGB(r,g,b));
302      palette_set_color(machine(),512 + i,MAKE_RGB(r,g,b));
303303
304304      r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + 32 + i] << 3) & 0xFF;
305305      g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + 32 + i] << 3) & 0xFF;
306306      b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + 32 + i] << 3) & 0xFF;
307307
308      palette_set_color(screen.machine(),512 + 16 + i,MAKE_RGB(r,g,b));
308      palette_set_color(machine(),512 + 16 + i,MAKE_RGB(r,g,b));
309309   }
310310
311311   if (m_rear_disable)    /* opaque foreground */
312312   {
313      draw_foreground(screen.machine(),bitmap,cliprect,0,1);
314      draw_sprites(screen.machine(),bitmap,bottomvisiblearea);
315      draw_foreground(screen.machine(),bitmap,cliprect,1,0);
313      draw_foreground(machine(),bitmap,cliprect,0,1);
314      draw_sprites(machine(),bitmap,bottomvisiblearea);
315      draw_foreground(machine(),bitmap,cliprect,1,0);
316316   }
317317   else
318318   {
319      draw_background(screen.machine(),bitmap,cliprect);
320      draw_foreground(screen.machine(),bitmap,cliprect,0,0);
321      draw_sprites(screen.machine(),bitmap,bottomvisiblearea);
322      draw_foreground(screen.machine(),bitmap,cliprect,1,0); // priority tiles
319      draw_background(machine(),bitmap,cliprect);
320      draw_foreground(machine(),bitmap,cliprect,0,0);
321      draw_sprites(machine(),bitmap,bottomvisiblearea);
322      draw_foreground(machine(),bitmap,cliprect,1,0); // priority tiles
323323   }
324324   return 0;
325325}
trunk/src/mame/video/taitosj.c
r17988r17989
744744
745745UINT32 taitosj_state::screen_update_taitosj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
746746{
747   return video_update_common(screen.machine(), bitmap, cliprect, taitosj_copy_layer);
747   return video_update_common(machine(), bitmap, cliprect, taitosj_copy_layer);
748748}
749749
750750
751751UINT32 taitosj_state::screen_update_kikstart(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
752752{
753   return video_update_common(screen.machine(), bitmap, cliprect, kikstart_copy_layer);
753   return video_update_common(machine(), bitmap, cliprect, kikstart_copy_layer);
754754}
trunk/src/mame/video/kingobox.c
r17988r17989
245245
246246   m_bg_tilemap->set_scrolly(0, -(*m_scroll_y));
247247   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
248   kingofb_draw_sprites(screen.machine(), bitmap, cliprect);
248   kingofb_draw_sprites(machine(), bitmap, cliprect);
249249   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
250250   return 0;
251251}
r17988r17989
304304
305305   m_bg_tilemap->set_scrolly(0, -(*m_scroll_y));
306306   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
307   ringking_draw_sprites(screen.machine(), bitmap, cliprect);
307   ringking_draw_sprites(machine(), bitmap, cliprect);
308308   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
309309   return 0;
310310}
trunk/src/mame/video/galivan.c
r17988r17989
351351   {
352352      m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
353353      m_tx_tilemap->draw(bitmap, cliprect, 1, 0);
354      draw_sprites(screen.machine(), bitmap, cliprect);
354      draw_sprites(machine(), bitmap, cliprect);
355355   }
356356   else
357357   {
358      draw_sprites(screen.machine(), bitmap, cliprect);
358      draw_sprites(machine(), bitmap, cliprect);
359359      m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
360360      m_tx_tilemap->draw(bitmap, cliprect, 1, 0);
361361   }
r17988r17989
375375   else
376376      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
377377
378   draw_sprites(screen.machine(), bitmap, cliprect);
378   draw_sprites(machine(), bitmap, cliprect);
379379   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
380380   return 0;
381381}
trunk/src/mame/video/nbmj8991.c
r17988r17989
304304
305305   if (m_screen_refresh)
306306   {
307      int width = screen.machine().primary_screen->width();
308      int height = screen.machine().primary_screen->height();
307      int width = machine().primary_screen->width();
308      int height = machine().primary_screen->height();
309309
310310      m_screen_refresh = 0;
311311
312312      for (y = 0; y < height; y++)
313313         for (x = 0; x < width; x++)
314            update_pixel(screen.machine(), x, y);
314            update_pixel(machine(), x, y);
315315   }
316316
317317   if (m_dispflag)
r17988r17989
350350
351351      for (y = 0; y < height; y++)
352352         for (x = 0; x < width; x++)
353            update_pixel(screen.machine(), x, y);
353            update_pixel(machine(), x, y);
354354   }
355355
356356   if (nb1413m3_inputport & 0x20)
trunk/src/mame/video/tsamurai.c
r17988r17989
208208    */
209209   bitmap.fill(m_bgcolor, cliprect);
210210   m_background->draw(bitmap, cliprect, 0,0);
211   draw_sprites(screen.machine(), bitmap,cliprect);
211   draw_sprites(machine(), bitmap,cliprect);
212212   m_foreground->draw(bitmap, cliprect, 0,0);
213213   return 0;
214214}
r17988r17989
250250UINT32 tsamurai_state::screen_update_vsgongf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
251251{
252252   #ifdef MAME_DEBUG
253   if( screen.machine().input().code_pressed( KEYCODE_Q ) ){
254      while( screen.machine().input().code_pressed( KEYCODE_Q ) ){
253   if( machine().input().code_pressed( KEYCODE_Q ) ){
254      while( machine().input().code_pressed( KEYCODE_Q ) ){
255255         m_key_count++;
256256         m_vsgongf_color = m_key_count;
257257         m_foreground ->mark_all_dirty();
r17988r17989
260260   #endif
261261
262262   m_foreground->draw(bitmap, cliprect, 0,0);
263   draw_sprites(screen.machine(),bitmap,cliprect);
263   draw_sprites(machine(),bitmap,cliprect);
264264   return 0;
265265}
trunk/src/mame/video/canyon.c
r17988r17989
7575
7676   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
7777
78   draw_sprites(screen.machine(), bitmap, cliprect);
78   draw_sprites(machine(), bitmap, cliprect);
7979
80   draw_bombs(screen.machine(), bitmap, cliprect);
80   draw_bombs(machine(), bitmap, cliprect);
8181
8282   /* watchdog is disabled during service mode */
83   screen.machine().watchdog_enable(!(screen.machine().root_device().ioport("IN2")->read() & 0x10));
83   machine().watchdog_enable(!(machine().root_device().ioport("IN2")->read() & 0x10));
8484
8585   return 0;
8686}
trunk/src/mame/video/splash.c
r17988r17989
261261   m_bg_tilemap[0]->set_scrolly(0, m_vregs[0]);
262262   m_bg_tilemap[1]->set_scrolly(0, m_vregs[1]);
263263
264   draw_bitmap(screen.machine(), bitmap, cliprect);
264   draw_bitmap(machine(), bitmap, cliprect);
265265
266266   m_bg_tilemap[1]->draw(bitmap, cliprect, 0, 0);
267   splash_draw_sprites(screen.machine(), bitmap, cliprect);
267   splash_draw_sprites(machine(), bitmap, cliprect);
268268   m_bg_tilemap[0]->draw(bitmap, cliprect, 0, 0);
269269   return 0;
270270}
r17988r17989
276276   m_bg_tilemap[0]->set_scrolly(0, m_vregs[0]);
277277   m_bg_tilemap[1]->set_scrolly(0, m_vregs[1]);
278278
279   draw_bitmap(screen.machine(), bitmap, cliprect);
279   draw_bitmap(machine(), bitmap, cliprect);
280280
281281   m_bg_tilemap[1]->draw(bitmap, cliprect, 0, 0);
282282   /*Sprite chip is similar but not the same*/
283   funystrp_draw_sprites(screen.machine(), bitmap, cliprect);
283   funystrp_draw_sprites(machine(), bitmap, cliprect);
284284   m_bg_tilemap[0]->draw(bitmap, cliprect, 0, 0);
285285   return 0;
286286}
trunk/src/mame/video/f1gp.c
r17988r17989
239239UINT32 f1gp_state::screen_update_f1gp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
240240{
241241
242   screen.machine().priority_bitmap.fill(0, cliprect);
242   machine().priority_bitmap.fill(0, cliprect);
243243
244244   k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, 0, 0, 1);
245245
r17988r17989
248248   /* quick kludge for "continue" screen priority */
249249   if (m_gfxctrl == 0x00)
250250   {
251      f1gp_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x02);
252      f1gp_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x02);
251      f1gp_draw_sprites(machine(), bitmap, cliprect, 0, 0x02);
252      f1gp_draw_sprites(machine(), bitmap, cliprect, 1, 0x02);
253253   }
254254   else
255255   {
256      f1gp_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x00);
257      f1gp_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x02);
256      f1gp_draw_sprites(machine(), bitmap, cliprect, 0, 0x00);
257      f1gp_draw_sprites(machine(), bitmap, cliprect, 1, 0x02);
258258   }
259259   return 0;
260260}
r17988r17989
341341
342342   m_fg_tilemap->set_scrolly(0, m_fgregs[0] + 8);
343343
344   screen.machine().priority_bitmap.fill(0, cliprect);
344   machine().priority_bitmap.fill(0, cliprect);
345345
346346   m_roz_tilemap->draw_roz(bitmap, cliprect,
347347      startx << 13, starty << 13,
r17988r17989
350350
351351   m_fg_tilemap->draw(bitmap, cliprect, 0, 1);
352352
353   f1gpb_draw_sprites(screen.machine(), bitmap, cliprect);
353   f1gpb_draw_sprites(machine(), bitmap, cliprect);
354354
355355   return 0;
356356}
r17988r17989
432432{
433433
434434   if (m_gfxctrl & 4)   /* blank screen */
435      bitmap.fill(get_black_pen(screen.machine()), cliprect);
435      bitmap.fill(get_black_pen(machine()), cliprect);
436436   else
437437   {
438438      switch (m_gfxctrl & 3)
439439      {
440440         case 0:
441441            k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1);
442            f1gp2_draw_sprites(screen.machine(), bitmap, cliprect);
442            f1gp2_draw_sprites(machine(), bitmap, cliprect);
443443            m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
444444            break;
445445         case 1:
446446            k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1);
447447            m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
448            f1gp2_draw_sprites(screen.machine(), bitmap, cliprect);
448            f1gp2_draw_sprites(machine(), bitmap, cliprect);
449449            break;
450450         case 2:
451451            m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
452452            k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, 0, 0, 1);
453            f1gp2_draw_sprites(screen.machine(), bitmap, cliprect);
453            f1gp2_draw_sprites(machine(), bitmap, cliprect);
454454            break;
455455#ifdef MAME_DEBUG
456456         case 3:
trunk/src/mame/video/route16.c
r17988r17989
7272{
7373   offs_t offs;
7474
75   UINT8 *color_prom1 = &screen.machine().root_device().memregion("proms")->base()[0x000];
75   UINT8 *color_prom1 = &machine().root_device().memregion("proms")->base()[0x000];
7676   UINT8 *color_prom2 = &memregion("proms")->base()[0x100];
7777
7878   for (offs = 0; offs < m_videoram1.bytes(); offs++)
r17988r17989
176176
177177UINT32 route16_state::screen_update_stratvox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
178178{
179   return video_update_stratvox_ttmahjng(screen.machine(), bitmap, cliprect, route16_make_pen);
179   return video_update_stratvox_ttmahjng(machine(), bitmap, cliprect, route16_make_pen);
180180}
181181
182182
183183UINT32 route16_state::screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
184184{
185   return video_update_stratvox_ttmahjng(screen.machine(), bitmap, cliprect, ttmajng_make_pen);
185   return video_update_stratvox_ttmahjng(machine(), bitmap, cliprect, ttmajng_make_pen);
186186}
trunk/src/mame/video/tecmosys.c
r17988r17989
288288UINT32 tecmosys_state::screen_update_tecmosys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
289289{
290290
291   bitmap.fill(screen.machine().pens[0x4000], cliprect);
291   bitmap.fill(machine().pens[0x4000], cliprect);
292292
293293
294294   m_bg0tilemap->set_scrolly(0, m_c80000regs[1]+16);
r17988r17989
319319   tecmosys_tilemap_copy_to_compose(this, 0xc000);
320320
321321
322   tecmosys_do_final_mix(screen.machine(), bitmap);
322   tecmosys_do_final_mix(machine(), bitmap);
323323
324324   // prepare sprites for NEXT frame - causes 1 frame palette errors, but prevents sprite lag in tkdensho, which is correct?
325   tecmosys_render_sprites_to_bitmap(screen.machine(), bitmap, m_880000regs[0x0], m_880000regs[0x1]);
325   tecmosys_render_sprites_to_bitmap(machine(), bitmap, m_880000regs[0x0], m_880000regs[0x1]);
326326
327327   return 0;
328328}
trunk/src/mame/video/kan_panb.c
r17988r17989
4545         sy = y;
4646      }
4747
48      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
48      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
4949            tile,
5050            tilecolour,
5151            flipx, flipy,
r17988r17989
7979      tilecolour = (tilecolour&0x03f0) >> 4;
8080      tilecolour ^=0x3f; // unusual, but correct..
8181
82      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
82      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
8383            tile,
8484            tilecolour,
8585            flipx, flipy,
r17988r17989
134134      tilecolour = (tilecolour&0x00f0) >> 4;
135135      tilecolour ^=0xf; // unusual, but correct..
136136
137      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
137      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
138138            tile,
139139            tilecolour,
140140            flipx, flipy,
r17988r17989
149149   UINT16 *spriteram16 = m_bootleg_spriteram16;
150150   int offs;
151151
152   bitmap.fill(get_black_pen(screen.machine()), cliprect);
152   bitmap.fill(get_black_pen(machine()), cliprect);
153153
154154   for (offs = 0;offs < m_bootleg_spriteram16.bytes()/2;offs += 8)
155155   {
r17988r17989
176176
177177      if ((xpos > -16) && (ypos > 0) && (xpos < 256) && (ypos < 240) && (disbl !=2))
178178      {
179         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
179         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
180180               tilen,
181181               colr,
182182               flipx, flipy,
r17988r17989
216216
217217   /* This clears & redraws the entire screen each pass */
218218
219   bitmap.fill(get_black_pen(screen.machine()), cliprect);
219   bitmap.fill(get_black_pen(machine()), cliprect);
220220
221221   for (offs = 0;offs < m_bootleg_spriteram16.bytes()/2;offs += 8)
222222   {
223      gfx_element *gfx = screen.machine().gfx[0];
223      gfx_element *gfx = machine().gfx[0];
224224      int dx = spriteram16[offs+4] & 0xff;
225225      int dy = spriteram16[offs+5] & 0xff;
226226      int tilecolour = spriteram16[offs+3];
r17988r17989
260260
261261      if (offs < 0x800) /* i guess this is the right way */
262262      {
263         gfx = screen.machine().gfx[1];
263         gfx = machine().gfx[1];
264264         tilecolour = 0x10;
265265      }
266266
trunk/src/mame/video/polyplay.c
r17988r17989
5757      int sy = offs >> 6 << 3;
5858      UINT8 code = videoram[offs];
5959
60      drawgfx_opaque(bitmap,cliprect, screen.machine().gfx[(code >> 7) & 0x01],
60      drawgfx_opaque(bitmap,cliprect, machine().gfx[(code >> 7) & 0x01],
6161            code, 0, 0, 0, sx, sy);
6262   }
6363
trunk/src/mame/video/exidy440.c
r17988r17989
433433   {
434434      int i;
435435
436      int beamx = ((screen.machine().root_device().ioport("AN0")->read() & 0xff) * (HBSTART - HBEND)) >> 8;
437      int beamy = ((screen.machine().root_device().ioport("AN1")->read() & 0xff) * (VBSTART - VBEND)) >> 8;
436      int beamx = ((machine().root_device().ioport("AN0")->read() & 0xff) * (HBSTART - HBEND)) >> 8;
437      int beamy = ((machine().root_device().ioport("AN1")->read() & 0xff) * (VBSTART - VBEND)) >> 8;
438438
439439      /* The timing of this FIRQ is very important. The games look for an FIRQ
440440            and then wait about 650 cycles, clear the old FIRQ, and wait a
r17988r17989
446446      attotime time = screen.time_until_pos(beamy, beamx) - increment * 6;
447447      for (i = 0; i <= 12; i++)
448448      {
449         screen.machine().scheduler().timer_set(time, FUNC(beam_firq_callback), beamx);
449         machine().scheduler().timer_set(time, FUNC(beam_firq_callback), beamx);
450450         time += increment;
451451      }
452452   }
trunk/src/mame/video/exzisus.c
r17988r17989
136136               y = 248 - y;
137137            }
138138
139            drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
139            drawgfx_transpen(bitmap, cliprect, machine().gfx[0],
140140                  code & 0x3fff,
141141                  color,
142142                  flip_screen(), flip_screen(),
r17988r17989
205205               y = 248 - y;
206206            }
207207
208            drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
208            drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
209209                  code & 0x3fff,
210210                  color,
211211                  flip_screen(), flip_screen(),
trunk/src/mame/video/tx1.c
r17988r17989
11861186
11871187   memset(m_obj_bmp, 0, 768*240);
11881188
1189   tx1_draw_char(screen.machine(), m_chr_bmp);
1190   tx1_draw_road(screen.machine(), m_rod_bmp);
1191   tx1_draw_objects(screen.machine(), m_obj_bmp);
1189   tx1_draw_char(machine(), m_chr_bmp);
1190   tx1_draw_road(machine(), m_rod_bmp);
1191   tx1_draw_objects(machine(), m_obj_bmp);
11921192
1193   tx1_combine_layers(screen.machine(), bitmap, 0);
1193   tx1_combine_layers(machine(), bitmap, 0);
11941194   return 0;
11951195}
11961196
11971197UINT32 tx1_state::screen_update_tx1_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
11981198{
1199   tx1_combine_layers(screen.machine(), bitmap, 1);
1199   tx1_combine_layers(machine(), bitmap, 1);
12001200   return 0;
12011201}
12021202
12031203UINT32 tx1_state::screen_update_tx1_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
12041204{
1205   tx1_combine_layers(screen.machine(), bitmap, 2);
1205   tx1_combine_layers(machine(), bitmap, 2);
12061206   return 0;
12071207}
12081208
r17988r17989
30423042   memset(m_obj_bmp, 0, 768*240);
30433043   memset(m_rod_bmp, 0, 768*240);
30443044
3045   buggyboy_draw_char(screen.machine(), m_chr_bmp, 1);
3046   buggyboy_draw_road(screen.machine(), m_rod_bmp);
3047   buggyboy_draw_objs(screen.machine(), m_obj_bmp, 1);
3045   buggyboy_draw_char(machine(), m_chr_bmp, 1);
3046   buggyboy_draw_road(machine(), m_rod_bmp);
3047   buggyboy_draw_objs(machine(), m_obj_bmp, 1);
30483048
3049   bb_combine_layers(screen.machine(), bitmap, 0);
3049   bb_combine_layers(machine(), bitmap, 0);
30503050   return 0;
30513051}
30523052
30533053UINT32 tx1_state::screen_update_buggyboy_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
30543054{
3055   bb_combine_layers(screen.machine(), bitmap, 1);
3055   bb_combine_layers(machine(), bitmap, 1);
30563056   return 0;
30573057}
30583058
30593059UINT32 tx1_state::screen_update_buggyboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
30603060{
3061   bb_combine_layers(screen.machine(), bitmap, 2);
3061   bb_combine_layers(machine(), bitmap, 2);
30623062   return 0;
30633063}
30643064
r17988r17989
30663066{
30673067   memset(m_obj_bmp, 0, 256*240);
30683068
3069   buggyboy_draw_char(screen.machine(), m_chr_bmp, 0);
3070   buggybjr_draw_road(screen.machine(), m_rod_bmp, 0);
3071   buggyboy_draw_objs(screen.machine(), m_obj_bmp, 0);
3069   buggyboy_draw_char(machine(), m_chr_bmp, 0);
3070   buggybjr_draw_road(machine(), m_rod_bmp, 0);
3071   buggyboy_draw_objs(machine(), m_obj_bmp, 0);
30723072
3073   bb_combine_layers(screen.machine(), bitmap, -1);
3073   bb_combine_layers(machine(), bitmap, -1);
30743074   return 0;
30753075}
trunk/src/mame/video/dassault.c
r17988r17989
7676/* are the priorities 100% correct? they're the same as they were before conversion to DECO52 sprite device, but if (for example) you walk to the side of the crates in the first part of the game you appear over them... */
7777UINT32 dassault_state::screen_update_dassault(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
7878{
79   address_space &space = screen.machine().driver_data()->generic_space();
79   address_space &space = machine().driver_data()->generic_space();
8080   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
8181   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
8282
83   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, false);
84   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, false);
85   bitmap_ind16* sprite_bitmap1 = &screen.machine().device<decospr_device>("spritegen1")->get_sprite_temp_bitmap();
86   bitmap_ind16* sprite_bitmap2 = &screen.machine().device<decospr_device>("spritegen2")->get_sprite_temp_bitmap();
83   machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, false);
84   machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, false);
85   bitmap_ind16* sprite_bitmap1 = &machine().device<decospr_device>("spritegen1")->get_sprite_temp_bitmap();
86   bitmap_ind16* sprite_bitmap2 = &machine().device<decospr_device>("spritegen2")->get_sprite_temp_bitmap();
8787
8888   /* Update tilemaps */
8989   flip_screen_set(BIT(flip, 7));
r17988r17989
9191   deco16ic_pf_update(m_deco_tilegen2, 0, m_pf4_rowscroll);
9292
9393   /* Draw playfields/update priority bitmap */
94   screen.machine().priority_bitmap.fill(0, cliprect);
95   bitmap.fill(screen.machine().pens[3072], cliprect);
94   machine().priority_bitmap.fill(0, cliprect);
95   bitmap.fill(machine().pens[3072], cliprect);
9696   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
9797
9898   /* The middle playfields can be swapped priority-wise */
9999   if ((priority & 3) == 0)
100100   {
101      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
101      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
102102      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2); // 2
103      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
103      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
104104      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 16); // 16
105      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
106      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 64?
107      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
105      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
106      mixdassaultlayer(machine(), bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 64?
107      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
108108
109109   }
110110   else if ((priority & 3) == 1)
111111   {
112      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
112      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
113113      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); // 2
114      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
115      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 16?
116      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
114      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
115      mixdassaultlayer(machine(), bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 16?
116      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
117117      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 64); // 64
118      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
118      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
119119   }
120120   else if ((priority & 3) == 3)
121121   {
122      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
122      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
123123      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); // 2
124      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
124      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
125125      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 16); // 16
126      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
127      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 64?
128      mixdassaultlayer(screen.machine(), bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
126      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
127      mixdassaultlayer(machine(), bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 64?
128      mixdassaultlayer(machine(), bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
129129   }
130130   else
131131   {
trunk/src/mame/video/pingpong.c
r17988r17989
146146UINT32 pingpong_state::screen_update_pingpong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
147147{
148148   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
149   draw_sprites(screen.machine(), bitmap, cliprect);
149   draw_sprites(machine(), bitmap, cliprect);
150150   return 0;
151151}
trunk/src/mame/video/ssrj.c
r17988r17989
279279   m_tilemap1->set_scrollx(0, 0xff-m_scrollram[2] );
280280   m_tilemap1->set_scrolly(0, m_scrollram[0] );
281281   m_tilemap1->draw(bitmap, cliprect, 0, 0);
282   draw_objects(screen.machine(), bitmap, cliprect);
282   draw_objects(machine(), bitmap, cliprect);
283283   m_tilemap2->draw(bitmap, cliprect, 0, 0);
284284
285285   if (m_scrollram[0x101] == 0xb) m_tilemap4->draw(bitmap, cliprect, 0, 0);/* hack to display 4th tilemap */
trunk/src/mame/video/gotya.c
r17988r17989
177177{
178178   m_bg_tilemap->set_scrollx(0, -(*m_scroll + (m_scroll_bit_8 * 256)) - 2 * 8);
179179   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
180   draw_sprites(screen.machine(), bitmap, cliprect);
181   draw_status(screen.machine(), bitmap, cliprect);
180   draw_sprites(machine(), bitmap, cliprect);
181   draw_status(machine(), bitmap, cliprect);
182182   return 0;
183183}
trunk/src/mame/video/tatsumi.c
r17988r17989
10641064
10651065UINT32 tatsumi_state::screen_update_apache3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
10661066{
1067   update_cluts(screen.machine(), 1024, 0, 2048);
1067   update_cluts(machine(), 1024, 0, 2048);
10681068
10691069   m_tx_layer->set_scrollx(0,24);
10701070
1071   bitmap.fill(screen.machine().pens[0], cliprect);
1072   draw_sky(screen.machine(), bitmap, cliprect, 256, m_apache3_rotate_ctrl[1]);
1073//  draw_ground(screen.machine(), bitmap, cliprect);
1074   draw_sprites(screen.machine(), bitmap,cliprect,0, (m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0);
1071   bitmap.fill(machine().pens[0], cliprect);
1072   draw_sky(machine(), bitmap, cliprect, 256, m_apache3_rotate_ctrl[1]);
1073//  draw_ground(machine(), bitmap, cliprect);
1074   draw_sprites(machine(), bitmap,cliprect,0, (m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0);
10751075   m_tx_layer->draw(bitmap, cliprect, 0,0);
10761076   return 0;
10771077}
r17988r17989
10811081//  UINT16 bg_x_scroll=m_roundup5_unknown1[0];
10821082//  UINT16 bg_y_scroll=m_roundup5_unknown2[0];
10831083
1084   update_cluts(screen.machine(), 1024, 512, 4096);
1084   update_cluts(machine(), 1024, 512, 4096);
10851085
10861086   m_tx_layer->set_scrollx(0,24);
10871087   m_tx_layer->set_scrolly(0,0); //(((m_roundupt_crt_reg[0xe]<<8)|m_roundupt_crt_reg[0xf])>>5) + 96);
10881088
1089   bitmap.fill(screen.machine().pens[384], cliprect); // todo
1090   screen.machine().priority_bitmap.fill(0, cliprect);
1089   bitmap.fill(machine().pens[384], cliprect); // todo
1090   machine().priority_bitmap.fill(0, cliprect);
10911091
1092   draw_sprites(screen.machine(), screen.machine().priority_bitmap,cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only
1093   draw_road(screen.machine(), bitmap,cliprect,screen.machine().priority_bitmap);
1094   draw_sprites(screen.machine(), bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass
1092   draw_sprites(machine(), machine().priority_bitmap,cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only
1093   draw_road(machine(), bitmap,cliprect,machine().priority_bitmap);
1094   draw_sprites(machine(), bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass
10951095   m_tx_layer->draw(bitmap, cliprect, 0,0);
10961096   return 0;
10971097}
r17988r17989
11081108      m_bigfight_last_bank=m_bigfight_bank;
11091109   }
11101110
1111   bitmap.fill(screen.machine().pens[0], cliprect);
1111   bitmap.fill(machine().pens[0], cliprect);
11121112
1113   draw_bg(screen.machine(), bitmap, m_layer3, &m_cyclwarr_videoram1[0x000], &m_cyclwarr_videoram1[0x100], m_cyclwarr_videoram1, m_bigfight_a40000[0], 8, -0x80, 512, 4096);
1114   draw_bg(screen.machine(), bitmap, m_layer2, &m_cyclwarr_videoram1[0x200], &m_cyclwarr_videoram1[0x300], m_cyclwarr_videoram1, m_bigfight_a40000[0], 8, -0x80, 512, 4096);
1115   draw_bg(screen.machine(), bitmap, m_layer1, &m_cyclwarr_videoram0[0x000], &m_cyclwarr_videoram0[0x100], m_cyclwarr_videoram0, m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
1116   update_cluts(screen.machine(), 8192, 4096, 8192);
1117   draw_sprites(screen.machine(), bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
1118   draw_bg(screen.machine(), bitmap, m_layer0, &m_cyclwarr_videoram0[0x200], &m_cyclwarr_videoram0[0x300], m_cyclwarr_videoram0, m_bigfight_a40000[0], 0x10, -0x80, 512, 4096);
1113   draw_bg(machine(), bitmap, m_layer3, &m_cyclwarr_videoram1[0x000], &m_cyclwarr_videoram1[0x100], m_cyclwarr_videoram1, m_bigfight_a40000[0], 8, -0x80, 512, 4096);
1114   draw_bg(machine(), bitmap, m_layer2, &m_cyclwarr_videoram1[0x200], &m_cyclwarr_videoram1[0x300], m_cyclwarr_videoram1, m_bigfight_a40000[0], 8, -0x80, 512, 4096);
1115   draw_bg(machine(), bitmap, m_layer1, &m_cyclwarr_videoram0[0x000], &m_cyclwarr_videoram0[0x100], m_cyclwarr_videoram0, m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
1116   update_cluts(machine(), 8192, 4096, 8192);
1117   draw_sprites(machine(), bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
1118   draw_bg(machine(), bitmap, m_layer0, &m_cyclwarr_videoram0[0x200], &m_cyclwarr_videoram0[0x300], m_cyclwarr_videoram0, m_bigfight_a40000[0], 0x10, -0x80, 512, 4096);
11191119
11201120   return 0;
11211121}
r17988r17989
11321132      m_bigfight_last_bank=m_bigfight_bank;
11331133   }
11341134
1135   bitmap.fill(screen.machine().pens[0], cliprect);
1136   draw_bg(screen.machine(), bitmap, m_layer3, &m_cyclwarr_videoram1[0x000], &m_cyclwarr_videoram1[0x100], m_cyclwarr_videoram1, m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
1137   draw_bg(screen.machine(), bitmap, m_layer2, &m_cyclwarr_videoram1[0x200], &m_cyclwarr_videoram1[0x300], m_cyclwarr_videoram1, m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
1138   draw_bg(screen.machine(), bitmap, m_layer1, &m_cyclwarr_videoram0[0x000], &m_cyclwarr_videoram0[0x100], m_cyclwarr_videoram0, m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
1139   update_cluts(screen.machine(), 8192, 4096, 8192);
1140   draw_sprites(screen.machine(), bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
1141   draw_bg(screen.machine(), bitmap, m_layer0, &m_cyclwarr_videoram0[0x200], &m_cyclwarr_videoram0[0x300], m_cyclwarr_videoram0, m_bigfight_a40000[0], 0x10, -0x40, 1024, 2048);
1135   bitmap.fill(machine().pens[0], cliprect);
1136   draw_bg(machine(), bitmap, m_layer3, &m_cyclwarr_videoram1[0x000], &m_cyclwarr_videoram1[0x100], m_cyclwarr_videoram1, m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
1137   draw_bg(machine(), bitmap, m_layer2, &m_cyclwarr_videoram1[0x200], &m_cyclwarr_videoram1[0x300], m_cyclwarr_videoram1, m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
1138   draw_bg(machine(), bitmap, m_layer1, &m_cyclwarr_videoram0[0x000], &m_cyclwarr_videoram0[0x100], m_cyclwarr_videoram0, m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
1139   update_cluts(machine(), 8192, 4096, 8192);
1140   draw_sprites(machine(), bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
1141   draw_bg(machine(), bitmap, m_layer0, &m_cyclwarr_videoram0[0x200], &m_cyclwarr_videoram0[0x300], m_cyclwarr_videoram0, m_bigfight_a40000[0], 0x10, -0x40, 1024, 2048);
11421142
11431143   return 0;
11441144}
trunk/src/mame/video/supbtime.c
r17988r17989
2323
2424UINT32 supbtime_state::screen_update_supbtime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
2525{
26   address_space &space = screen.machine().driver_data()->generic_space();
26   address_space &space = machine().driver_data()->generic_space();
2727   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
2828
2929   flip_screen_set(BIT(flip, 7));
r17988r17989
3232   bitmap.fill(768, cliprect);
3333
3434   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
35   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
35   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
3636   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
3737   return 0;
3838}
trunk/src/mame/video/blmbycar.c
r17988r17989
224224   m_tilemap_1->set_scrollx(0, m_scroll_1[1] + 5);
225225
226226#ifdef MAME_DEBUG
227if (screen.machine().input().code_pressed(KEYCODE_Z))
227if (machine().input().code_pressed(KEYCODE_Z))
228228{
229229   int msk = 0;
230230
231   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
232   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
233//  if (screen.machine().input().code_pressed(KEYCODE_E))    msk |= 4;
234   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
231   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
232   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
233//  if (machine().input().code_pressed(KEYCODE_E))    msk |= 4;
234   if (machine().input().code_pressed(KEYCODE_A))   msk |= 8;
235235   if (msk != 0) layers_ctrl &= msk;
236236}
237237#endif
238238
239   screen.machine().priority_bitmap.fill(0, cliprect);
239   machine().priority_bitmap.fill(0, cliprect);
240240
241241   if (layers_ctrl & 1)
242242      for (i = 0; i <= 1; i++)
r17988r17989
249249         m_tilemap_1->draw(bitmap, cliprect, i, i);
250250
251251   if (layers_ctrl & 8)
252      draw_sprites(screen.machine(), bitmap, cliprect);
252      draw_sprites(machine(), bitmap, cliprect);
253253
254254   return 0;
255255}
trunk/src/mame/video/retofinv.c
r17988r17989
223223UINT32 retofinv_state::screen_update_retofinv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
224224{
225225   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
226   draw_sprites(screen.machine(), bitmap);
226   draw_sprites(machine(), bitmap);
227227   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
228228   return 0;
229229}
trunk/src/mame/video/meadows.c
r17988r17989
107107   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
108108
109109   /* draw the sprites */
110   if (screen.machine().gfx[1])
111      draw_sprites(screen.machine(), bitmap, cliprect);
110   if (machine().gfx[1])
111      draw_sprites(machine(), bitmap, cliprect);
112112   return 0;
113113}
trunk/src/mame/video/bogeyman.c
r17988r17989
149149{
150150
151151   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
152   draw_sprites(screen.machine(), bitmap, cliprect);
152   draw_sprites(machine(), bitmap, cliprect);
153153   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
154154   return 0;
155155}
trunk/src/mame/video/srmp2.c
r17988r17989
5656{
5757   bitmap.fill(0x1ff, cliprect);
5858
59   screen.machine().device<seta001_device>("spritegen")->set_transpen(15);
59   machine().device<seta001_device>("spritegen")->set_transpen(15);
6060
61   screen.machine().device<seta001_device>("spritegen")->set_colorbase((m_color_bank)?0x20:0x00);
61   machine().device<seta001_device>("spritegen")->set_colorbase((m_color_bank)?0x20:0x00);
6262
63   screen.machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 );
64   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x05, 0x07 );
65   screen.machine().device<seta001_device>("spritegen")->set_bg_xoffsets( 0x00, 0x00 ); // bg not used?
66   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x00, 0x00 ); // bg not used?
63   machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 );
64   machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x05, 0x07 );
65   machine().device<seta001_device>("spritegen")->set_bg_xoffsets( 0x00, 0x00 ); // bg not used?
66   machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x00, 0x00 ); // bg not used?
6767
68   screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1);
68   machine().device<seta001_device>("spritegen")->seta001_draw_sprites(machine(),bitmap,cliprect,0x1000, 1);
6969   return 0;
7070}
7171
r17988r17989
7373{
7474   bitmap.fill(0x1f0, cliprect);
7575
76   screen.machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 );
77   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x06, 0x06 );
78   screen.machine().device<seta001_device>("spritegen")->set_bg_xoffsets( -0x01, 0x10 );
79   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( -0x06, 0x06 );
76   machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 );
77   machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x06, 0x06 );
78   machine().device<seta001_device>("spritegen")->set_bg_xoffsets( -0x01, 0x10 );
79   machine().device<seta001_device>("spritegen")->set_bg_yoffsets( -0x06, 0x06 );
8080
81   screen.machine().device<seta001_device>("spritegen")->set_gfxbank_callback( srmp3_gfxbank_callback );
81   machine().device<seta001_device>("spritegen")->set_gfxbank_callback( srmp3_gfxbank_callback );
8282
83   screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1);
83   machine().device<seta001_device>("spritegen")->seta001_draw_sprites(machine(),bitmap,cliprect,0x1000, 1);
8484   return 0;
8585}
8686
r17988r17989
8888{
8989   bitmap.fill(0x1f0, cliprect);
9090
91   screen.machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 );
92   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x06, 0x06 );
93   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x09, 0x07 );
91   machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 );
92   machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x06, 0x06 );
93   machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x09, 0x07 );
9494
95   screen.machine().device<seta001_device>("spritegen")->set_spritelimit( 0x1ff-6 );
95   machine().device<seta001_device>("spritegen")->set_spritelimit( 0x1ff-6 );
9696
97   screen.machine().device<seta001_device>("spritegen")->set_gfxbank_callback( srmp3_gfxbank_callback );
97   machine().device<seta001_device>("spritegen")->set_gfxbank_callback( srmp3_gfxbank_callback );
9898
99   screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1);
99   machine().device<seta001_device>("spritegen")->seta001_draw_sprites(machine(),bitmap,cliprect,0x1000, 1);
100100   return 0;
101101}
trunk/src/mame/video/m72.c
r17988r17989
519519{
520520   if (m_video_off)
521521   {
522      bitmap.fill(get_black_pen(screen.machine()), cliprect);
522      bitmap.fill(get_black_pen(machine()), cliprect);
523523      return 0;
524524   }
525525
r17988r17989
531531
532532   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
533533   m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
534   m72_draw_sprites(screen.machine(), bitmap,cliprect);
534   m72_draw_sprites(machine(), bitmap,cliprect);
535535   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
536536   m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
537537   return 0;
r17988r17989
544544
545545   if (m_video_off)
546546   {
547      bitmap.fill(get_black_pen(screen.machine()), cliprect);
547      bitmap.fill(get_black_pen(machine()), cliprect);
548548      return 0;
549549   }
550550
r17988r17989
567567
568568   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
569569   m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
570   majtitle_draw_sprites(screen.machine(), bitmap,cliprect);
571   m72_draw_sprites(screen.machine(), bitmap,cliprect);
570   majtitle_draw_sprites(machine(), bitmap,cliprect);
571   m72_draw_sprites(machine(), bitmap,cliprect);
572572   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
573573   m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
574574   return 0;
trunk/src/mame/video/ohmygod.c
r17988r17989
103103{
104104
105105   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
106   draw_sprites(screen.machine(), bitmap, cliprect);
106   draw_sprites(machine(), bitmap, cliprect);
107107   return 0;
108108}
trunk/src/mame/video/pokechmp.c
r17988r17989
7575UINT32 pokechmp_state::screen_update_pokechmp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7676{
7777   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
78   draw_sprites(screen.machine(), bitmap, cliprect);
78   draw_sprites(machine(), bitmap, cliprect);
7979   return 0;
8080}
trunk/src/mame/video/snk68.c
r17988r17989
282282   bitmap.fill(0x7ff, cliprect);
283283
284284   /* This appears to be the correct priority order */
285   draw_sprites(screen.machine(), bitmap, cliprect, 2);
286   draw_sprites(screen.machine(), bitmap, cliprect, 3);
287   draw_sprites(screen.machine(), bitmap, cliprect, 1);
285   draw_sprites(machine(), bitmap, cliprect, 2);
286   draw_sprites(machine(), bitmap, cliprect, 3);
287   draw_sprites(machine(), bitmap, cliprect, 1);
288288
289289   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
290290   return 0;
trunk/src/mame/video/aeroboto.c
r17988r17989
214214   m_bg_tilemap->set_scrolly(0, *m_vscroll);
215215   m_bg_tilemap->draw(bitmap, splitrect2, 0, 0);
216216
217   draw_sprites(screen.machine(), bitmap, cliprect);
217   draw_sprites(machine(), bitmap, cliprect);
218218
219219   // the status display behaves more closely to a 40-line splitscreen than an overlay
220220   m_bg_tilemap->set_scrolly(0, 0);
trunk/src/mame/video/madalien.c
r17988r17989
251251
252252UINT32 madalien_state::screen_update_madalien(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
253253{
254   int flip = BIT(screen.machine().root_device().ioport("DSW")->read(), 6) && BIT(*m_video_control, 0);
254   int flip = BIT(machine().root_device().ioport("DSW")->read(), 6) && BIT(*m_video_control, 0);
255255
256256   // bits #0 and #1 define scrolling mode
257257   //
r17988r17989
263263   int scroll_mode = *m_scroll & 3;
264264
265265   bitmap.fill(0, cliprect);
266   draw_edges(screen.machine(), bitmap, cliprect, flip, scroll_mode);
267   draw_foreground(screen.machine(), bitmap, cliprect, flip);
266   draw_edges(machine(), bitmap, cliprect, flip, scroll_mode);
267   draw_foreground(machine(), bitmap, cliprect, flip);
268268
269269   /* highlight section A (outside of tunnels).
270270     * also, bit 1 of the video_flags register (6A) is
r17988r17989
298298               bitmap.pix16(y, x) |= 8;
299299   }
300300
301   draw_headlight(screen.machine(), bitmap, cliprect, flip);
301   draw_headlight(machine(), bitmap, cliprect, flip);
302302
303303   return 0;
304304}
trunk/src/mame/video/crgolf.c
r17988r17989
115115   offs_t offs;
116116   pen_t pens[NUM_PENS];
117117
118   get_pens(screen.machine(), pens);
118   get_pens(machine(), pens);
119119
120120   /* for each byte in the video RAM */
121121   for (offs = 0; offs < VIDEORAM_SIZE / 3; offs++)
trunk/src/mame/video/firetrap.c
r17988r17989
265265{
266266   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
267267   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
268   draw_sprites(screen.machine(), bitmap, cliprect);
268   draw_sprites(machine(), bitmap, cliprect);
269269   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
270270   return 0;
271271}
trunk/src/mame/video/thedeep.c
r17988r17989
219219      m_tilemap_0->set_scrolly(x, y + scrolly);
220220   }
221221
222   bitmap.fill(get_black_pen(screen.machine()), cliprect);
222   bitmap.fill(get_black_pen(machine()), cliprect);
223223
224224   m_tilemap_0->draw(bitmap, cliprect, 0,0);
225   draw_sprites(screen.machine(), bitmap,cliprect);
225   draw_sprites(machine(), bitmap,cliprect);
226226   m_tilemap_1->draw(bitmap, cliprect, 0,0);
227227   return 0;
228228}
trunk/src/mame/video/oneshot.c
r17988r17989
152152UINT32 oneshot_state::screen_update_oneshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
153153{
154154
155   bitmap.fill(get_black_pen(screen.machine()), cliprect);
155   bitmap.fill(get_black_pen(machine()), cliprect);
156156
157157   m_mid_tilemap->set_scrollx(0, m_scroll[0] - 0x1f5);
158158   m_mid_tilemap->set_scrolly(0, m_scroll[1]);
159159
160160   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
161161   m_mid_tilemap->draw(bitmap, cliprect, 0, 0);
162   draw_sprites(screen.machine(), bitmap, cliprect);
162   draw_sprites(machine(), bitmap, cliprect);
163163   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
164   draw_crosshairs(screen.machine(), bitmap, cliprect);
164   draw_crosshairs(machine(), bitmap, cliprect);
165165   return 0;
166166}
167167
168168UINT32 oneshot_state::screen_update_maddonna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
169169{
170170
171   bitmap.fill(get_black_pen(screen.machine()), cliprect);
171   bitmap.fill(get_black_pen(machine()), cliprect);
172172
173173   m_mid_tilemap->set_scrolly(0, m_scroll[1]); // other registers aren't used so we don't know which layers they relate to
174174
175175   m_mid_tilemap->draw(bitmap, cliprect, 0, 0);
176176   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
177177   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
178   draw_sprites(screen.machine(), bitmap, cliprect);
178   draw_sprites(machine(), bitmap, cliprect);
179179
180180//  popmessage ("%04x %04x %04x %04x %04x %04x %04x %04x", m_scroll[0], m_scroll[1], m_scroll[2], m_scroll[3], m_scroll[4], m_scroll[5], m_scroll[6], m_scroll[7]);
181181   return 0;
trunk/src/mame/video/stlforce.c
r17988r17989
170170   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
171171   m_mlow_tilemap->draw(bitmap, cliprect, 0,0);
172172   m_mhigh_tilemap->draw(bitmap, cliprect, 0,0);
173   draw_sprites(screen.machine(), bitmap,cliprect);
173   draw_sprites(machine(), bitmap,cliprect);
174174   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
175175   return 0;
176176}
trunk/src/mame/video/topspeed.c
r17988r17989
114114   UINT8 layer[4];
115115
116116#ifdef MAME_DEBUG
117   if (screen.machine().input().code_pressed_once (KEYCODE_V))
117   if (machine().input().code_pressed_once (KEYCODE_V))
118118   {
119119      m_dislayer[0] ^= 1;
120120      popmessage("bg: %01x", m_dislayer[0]);
121121   }
122122
123   if (screen.machine().input().code_pressed_once (KEYCODE_B))
123   if (machine().input().code_pressed_once (KEYCODE_B))
124124   {
125125      m_dislayer[1] ^= 1;
126126      popmessage("fg: %01x", m_dislayer[1]);
127127   }
128128
129   if (screen.machine().input().code_pressed_once (KEYCODE_N))
129   if (machine().input().code_pressed_once (KEYCODE_N))
130130   {
131131      m_dislayer[2] ^= 1;
132132      popmessage("bg2: %01x", m_dislayer[2]);
133133   }
134134
135   if (screen.machine().input().code_pressed_once (KEYCODE_M))
135   if (machine().input().code_pressed_once (KEYCODE_M))
136136   {
137137      m_dislayer[3] ^= 1;
138138      popmessage("fg2: %01x", m_dislayer[3]);
139139   }
140140
141   if (screen.machine().input().code_pressed_once (KEYCODE_C))
141   if (machine().input().code_pressed_once (KEYCODE_C))
142142   {
143143      m_dislayer[4] ^= 1;
144144      popmessage("sprites: %01x", m_dislayer[4]);
r17988r17989
154154   layer[2] = 1;
155155   layer[3] = 0;
156156
157   screen.machine().priority_bitmap.fill(0, cliprect);
157   machine().priority_bitmap.fill(0, cliprect);
158158   bitmap.fill(0, cliprect);
159159
160160#ifdef MAME_DEBUG
r17988r17989
181181   if (m_dislayer[4] == 0)
182182#endif
183183
184   draw_sprites(screen.machine(), bitmap,cliprect);
184   draw_sprites(machine(), bitmap,cliprect);
185185   return 0;
186186}
trunk/src/mame/video/amspdwy.c
r17988r17989
144144UINT32 amspdwy_state::screen_update_amspdwy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
145145{
146146   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
147   draw_sprites(screen.machine(), bitmap, cliprect);
147   draw_sprites(machine(), bitmap, cliprect);
148148   return 0;
149149}
trunk/src/mame/video/fantland.c
r17988r17989
142142UINT32 fantland_state::screen_update_fantland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
143143{
144144   bitmap.fill(0, cliprect);
145   draw_sprites(screen.machine(),bitmap,cliprect);
145   draw_sprites(machine(),bitmap,cliprect);
146146
147147   return 0;
148148}
trunk/src/mame/video/toobin.c
r17988r17989
227227
228228UINT32 toobin_state::screen_update_toobin(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
229229{
230   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
231   const rgb_t *palette = palette_entry_list_adjusted(screen.machine().palette);
230   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
231   const rgb_t *palette = palette_entry_list_adjusted(machine().palette);
232232   atarimo_rect_list rectlist;
233233   bitmap_ind16 *mobitmap;
234234   int x, y;
trunk/src/mame/video/bladestl.c
r17988r17989
7979
8080UINT32 bladestl_state::screen_update_bladestl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8181{
82   set_pens(screen.machine());
82   set_pens(machine());
8383
8484   k007342_tilemap_update(m_k007342);
8585
8686   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE ,0);
87   k007420_sprites_draw(m_k007420, bitmap, cliprect, screen.machine().gfx[1]);
87   k007420_sprites_draw(m_k007420, bitmap, cliprect, machine().gfx[1]);
8888   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 1, 1 | TILEMAP_DRAW_OPAQUE ,0);
8989   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 0, 0 ,0);
9090   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 0, 1 ,0);
trunk/src/mame/video/srumbler.c
r17988r17989
158158UINT32 srumbler_state::screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
159159{
160160   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
161   draw_sprites(screen.machine(), bitmap,cliprect);
161   draw_sprites(machine(), bitmap,cliprect);
162162   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
163163   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
164164   return 0;
trunk/src/mame/video/legionna.c
r17988r17989
421421   m_text_layer->set_scrollx(0,  0/*m_scrollram16[6]*/ );
422422   m_text_layer->set_scrolly(0,  0/*m_scrollram16[7]*/ );
423423
424   screen.machine().priority_bitmap.fill(0, cliprect);
425   bitmap.fill(get_black_pen(screen.machine()), cliprect);   /* wrong color? */
424   machine().priority_bitmap.fill(0, cliprect);
425   bitmap.fill(get_black_pen(machine()), cliprect);   /* wrong color? */
426426
427427   /* m_layer_disable is a guess based on 'stage 1' screen in heatbrl  */
428428
r17988r17989
431431   if (!(m_layer_disable&0x0002)) m_background_layer->draw(bitmap, cliprect, 0, 1);
432432   if (!(m_layer_disable&0x0001)) m_text_layer->draw(bitmap, cliprect, 0, 2);
433433
434   draw_sprites(screen.machine(),bitmap,cliprect);
434   draw_sprites(machine(),bitmap,cliprect);
435435
436436
437437   return 0;
r17988r17989
454454
455455
456456   bitmap.fill(0x0200, cliprect);
457   screen.machine().priority_bitmap.fill(0, cliprect);
457   machine().priority_bitmap.fill(0, cliprect);
458458
459459   if (!(m_layer_disable&0x0001)) m_background_layer->draw(bitmap, cliprect, 0,0);
460460   if (!(m_layer_disable&0x0002)) m_midground_layer->draw(bitmap, cliprect, 0,0);
461461   if (!(m_layer_disable&0x0004)) m_foreground_layer->draw(bitmap, cliprect, 0,1);
462462   if (!(m_layer_disable&0x0008)) m_text_layer->draw(bitmap, cliprect, 0,2);
463463
464   draw_sprites(screen.machine(),bitmap,cliprect);
464   draw_sprites(machine(),bitmap,cliprect);
465465
466466   return 0;
467467}
r17988r17989
478478   m_text_layer->set_scrollx(0,  0/*m_scrollram16[6]*/ );
479479   m_text_layer->set_scrolly(0,  0/*m_scrollram16[7]*/ );
480480
481   bitmap.fill(get_black_pen(screen.machine()), cliprect);
482   screen.machine().priority_bitmap.fill(0, cliprect);
481   bitmap.fill(get_black_pen(machine()), cliprect);
482   machine().priority_bitmap.fill(0, cliprect);
483483
484484   if(!(m_layer_disable & 1))
485485      m_background_layer->draw(bitmap, cliprect, 0,1);
r17988r17989
493493   if(!(m_layer_disable & 8))
494494      m_text_layer->draw(bitmap, cliprect, 0,8);
495495
496   draw_sprites(screen.machine(),bitmap,cliprect);
496   draw_sprites(machine(),bitmap,cliprect);
497497
498498   return 0;
499499}
trunk/src/mame/video/mcr68.c
r17988r17989
320320   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
321321
322322   /* draw the low-priority sprites */
323   mcr68_update_sprites(screen.machine(), bitmap, cliprect, 0);
323   mcr68_update_sprites(machine(), bitmap, cliprect, 0);
324324
325325    /* redraw tiles with priority over sprites */
326326   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
327327
328328   /* draw the high-priority sprites */
329   mcr68_update_sprites(screen.machine(), bitmap, cliprect, 1);
329   mcr68_update_sprites(machine(), bitmap, cliprect, 1);
330330   return 0;
331331}
332332
r17988r17989
337337   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
338338
339339   /* draw the low-priority sprites */
340   zwackery_update_sprites(screen.machine(), bitmap, cliprect, 0);
340   zwackery_update_sprites(machine(), bitmap, cliprect, 0);
341341
342342    /* redraw tiles with priority over sprites */
343343   m_fg_tilemap->draw(bitmap, cliprect, 1, 0);
344344
345345   /* draw the high-priority sprites */
346   zwackery_update_sprites(screen.machine(), bitmap, cliprect, 1);
346   zwackery_update_sprites(machine(), bitmap, cliprect, 1);
347347   return 0;
348348}
trunk/src/mame/video/pbaction.c
r17988r17989
128128{
129129
130130   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
131   draw_sprites(screen.machine(), bitmap, cliprect);
131   draw_sprites(machine(), bitmap, cliprect);
132132   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
133133   return 0;
134134}
trunk/src/mame/video/overdriv.c
r17988r17989
5959   m_zoom_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI3);
6060   m_zoom_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI4);
6161
62   screen.machine().priority_bitmap.fill(0, cliprect);
62   machine().priority_bitmap.fill(0, cliprect);
6363
6464   k051316_zoom_draw(m_k051316_1, bitmap, cliprect, 0, 0);
6565   k051316_zoom_draw(m_k051316_2, bitmap, cliprect, 0, 1);
trunk/src/mame/video/thunderx.c
r17988r17989
7070
7171   k052109_tilemap_update(m_k052109);
7272
73   screen.machine().priority_bitmap.fill(0, cliprect);
73   machine().priority_bitmap.fill(0, cliprect);
7474
7575   /* The background color is always from layer 1 - but it's always black anyway */
7676//  bitmap.fill(16 * m_layer_colorbase[1], cliprect);
trunk/src/mame/video/spcforce.c
r17988r17989
3939         sy = 248 - sy;
4040      }
4141
42      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
42      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
4343            code, col,
4444            flip, flip,
4545            sx, sy,0);
trunk/src/mame/video/gsword.c
r17988r17989
205205UINT32 gsword_state::screen_update_gsword(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
206206{
207207   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
208   draw_sprites(screen.machine(), bitmap, cliprect);
208   draw_sprites(machine(), bitmap, cliprect);
209209   return 0;
210210}
trunk/src/mame/video/nbmj8900.c
r17988r17989
396396      {
397397         for (x = 0; x < m_screen_width; x++)
398398         {
399            update_pixel0(screen.machine(), x, y);
399            update_pixel0(machine(), x, y);
400400         }
401401      }
402402      if (m_gfxdraw_mode)
r17988r17989
405405         {
406406            for (x = 0; x < m_screen_width; x++)
407407            {
408               update_pixel1(screen.machine(), x, y);
408               update_pixel1(machine(), x, y);
409409            }
410410         }
411411      }
trunk/src/mame/video/xmen.c
r17988r17989
9191
9292   konami_sortlayers3(layer, m_layerpri);
9393
94   screen.machine().priority_bitmap.fill(0, cliprect);
94   machine().priority_bitmap.fill(0, cliprect);
9595   /* note the '+1' in the background color!!! */
9696   bitmap.fill(16 * bg_colorbase + 1, cliprect);
9797   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[0], 0, 1);
r17988r17989
148148      rectangle cliprect;
149149      int offset;
150150
151   //  const rectangle *visarea = screen.machine().primary_screen->visible_area();
151   //  const rectangle *visarea = machine().primary_screen->visible_area();
152152   //  cliprect = *visarea;
153153
154154      cliprect.set(0, 64 * 8 - 1, 2 * 8, 30 * 8 - 1);
155155
156156
157      address_space &space = screen.machine().driver_data()->generic_space();
158      if (screen.machine().primary_screen->frame_number() & 0x01)
157      address_space &space = machine().driver_data()->generic_space();
158      if (machine().primary_screen->frame_number() & 0x01)
159159      {
160160
161161         /* copy the desired spritelist to the chip */
r17988r17989
212212
213213      konami_sortlayers3(layer, m_layerpri);
214214
215      screen.machine().priority_bitmap.fill(0, cliprect);
215      machine().priority_bitmap.fill(0, cliprect);
216216      /* note the '+1' in the background color!!! */
217217      renderbitmap->fill(16 * bg_colorbase + 1, cliprect);
218218      k052109_tilemap_draw(m_k052109, *renderbitmap, cliprect, layer[0], 0, 1);
trunk/src/mame/video/mario.c
r17988r17989
206206{
207207   int t;
208208
209   t = screen.machine().root_device().ioport("MONITOR")->read();
209   t = machine().root_device().ioport("MONITOR")->read();
210210   if (t != m_monitor)
211211   {
212212      m_monitor = t;
213      screen.machine().tilemap().mark_all_dirty();
213      machine().tilemap().mark_all_dirty();
214214   }
215215
216216   m_bg_tilemap->set_scrollx(0, m_flip ? (HTOTAL-HBSTART) : 0);
217217   m_bg_tilemap->set_scrolly(0, m_gfx_scroll - (m_flip ? 8 : 0));
218218
219219   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
220   draw_sprites(screen.machine(), bitmap, cliprect);
220   draw_sprites(machine(), bitmap, cliprect);
221221
222222   return 0;
223223}
trunk/src/mame/video/atarifb.c
r17988r17989
175175
176176UINT32 atarifb_state::screen_update_atarifb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
177177{
178   draw_playfield_and_alpha(screen.machine(), bitmap, cliprect, 0, 0);
178   draw_playfield_and_alpha(machine(), bitmap, cliprect, 0, 0);
179179
180   draw_sprites(screen.machine(), bitmap, cliprect, 1, 0);
180   draw_sprites(machine(), bitmap, cliprect, 1, 0);
181181
182182   return 0;
183183}
r17988r17989
185185
186186UINT32 atarifb_state::screen_update_abaseb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
187187{
188   draw_playfield_and_alpha(screen.machine(), bitmap, cliprect, -8, 0);
188   draw_playfield_and_alpha(machine(), bitmap, cliprect, -8, 0);
189189
190   draw_sprites(screen.machine(), bitmap, cliprect, 1, 0);
190   draw_sprites(machine(), bitmap, cliprect, 1, 0);
191191
192192   return 0;
193193}
r17988r17989
195195
196196UINT32 atarifb_state::screen_update_soccer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
197197{
198   draw_playfield_and_alpha(screen.machine(), bitmap, cliprect, 0, 8);
198   draw_playfield_and_alpha(machine(), bitmap, cliprect, 0, 8);
199199
200   draw_sprites(screen.machine(), bitmap, cliprect, 2, 1);
200   draw_sprites(machine(), bitmap, cliprect, 2, 1);
201201
202202   return 0;
203203}
trunk/src/mame/video/silkroad.c
r17988r17989
136136
137137UINT32 silkroad_state::screen_update_silkroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
138138{
139   screen.machine().priority_bitmap.fill(0, cliprect);
139   machine().priority_bitmap.fill(0, cliprect);
140140   bitmap.fill(0x7c0, cliprect);
141141
142142   m_fg_tilemap->set_scrollx(0, ((m_regs[0] & 0xffff0000) >> 16) );
r17988r17989
151151   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
152152   m_fg2_tilemap->draw(bitmap, cliprect, 0,1);
153153   m_fg3_tilemap->draw(bitmap, cliprect, 0,2);
154   draw_sprites(screen.machine(),bitmap,cliprect);
154   draw_sprites(machine(),bitmap,cliprect);
155155
156156   if (0)
157157   {
trunk/src/mame/video/lethal.c
r17988r17989
104104{
105105
106106   bitmap.fill(7168, cliprect);
107   screen.machine().priority_bitmap.fill(0, cliprect);
107   machine().priority_bitmap.fill(0, cliprect);
108108
109109   k056832_tilemap_draw(m_k056832, bitmap, cliprect, 3, K056832_DRAW_FLAG_MIRROR, 1);
110110   k056832_tilemap_draw(m_k056832, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 2);
trunk/src/mame/video/videopin.c
r17988r17989
6868            {
6969               for (j = 0; j < 2; j++)
7070               {
71                  drawgfx_transpen(bitmap, rect, screen.machine().gfx[1],
71                  drawgfx_transpen(bitmap, rect, machine().gfx[1],
7272                     0, 0,
7373                     0, 0,
7474                     x + 16 * i,
trunk/src/mame/video/tecmo16.c
r17988r17989
468468
469469UINT32 tecmo16_state::screen_update_tecmo16(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
470470{
471   screen.machine().priority_bitmap.fill(0, cliprect);
471   machine().priority_bitmap.fill(0, cliprect);
472472
473473   m_tile_bitmap_bg.fill(0x300, cliprect);
474474   m_tile_bitmap_fg.fill(0, cliprect);
r17988r17989
483483   m_tx_tilemap->draw(m_tile_bitmap_fg, cliprect, 0, 4);
484484
485485   /* draw sprites into a 16-bit bitmap */
486   draw_sprites(screen.machine(), m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, cliprect);
486   draw_sprites(machine(), m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, cliprect);
487487
488488   /* mix & blend the tilemaps and sprites into a 32-bit bitmap */
489   blendbitmaps(screen.machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, 0, 0, cliprect);
489   blendbitmaps(machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, m_sprite_bitmap, 0, 0, cliprect);
490490   return 0;
491491}
trunk/src/mame/video/exprraid.c
r17988r17989
131131UINT32 exprraid_state::screen_update_exprraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
132132{
133133   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
134   draw_sprites(screen.machine(), bitmap, cliprect);
134   draw_sprites(machine(), bitmap, cliprect);
135135   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
136136   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
137137   return 0;
trunk/src/mame/video/naughtyb.c
r17988r17989
223223         }
224224      }
225225
226      drawgfx_opaque(tmpbitmap,tmpbitmap.cliprect(),screen.machine().gfx[0],
226      drawgfx_opaque(tmpbitmap,tmpbitmap.cliprect(),machine().gfx[0],
227227            m_videoram2[offs] + 256 * m_bankreg,
228228            (m_videoram2[offs] >> 5) + 8 * m_palreg,
229229            m_cocktail,m_cocktail,
230230            8*sx,8*sy);
231231
232      drawgfx_transpen(tmpbitmap,tmpbitmap.cliprect(),screen.machine().gfx[1],
232      drawgfx_transpen(tmpbitmap,tmpbitmap.cliprect(),machine().gfx[1],
233233            videoram[offs] + 256*m_bankreg,
234234            (videoram[offs] >> 5) + 8 * m_palreg,
235235            m_cocktail,m_cocktail,
trunk/src/mame/video/runaway.c
r17988r17989
101101
102102      code |= (m_sprite_ram[i + 0x30] << 2) & 0x1c0;
103103
104      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
104      drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
105105         code,
106106         0,
107107         flipx, flipy,
108108         x, 240 - y, 0);
109109
110      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
110      drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
111111         code,
112112         0,
113113         flipx, flipy,
r17988r17989
135135
136136      code |= (m_sprite_ram[i + 0x30] << 2) & 0x1c0;
137137
138      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
138      drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
139139         code,
140140         0,
141141         flipx, flipy,
142142         x, 240 - y, 0);
143143
144      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
144      drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
145145         code,
146146         0,
147147         flipx, flipy,
trunk/src/mame/video/toypop.c
r17988r17989
272272
273273UINT32 toypop_state::screen_update_toypop(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
274274{
275   draw_background(screen.machine(), bitmap);
275   draw_background(machine(), bitmap);
276276   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
277   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram);
277   draw_sprites(machine(), bitmap, cliprect, m_spriteram);
278278   return 0;
279279}
trunk/src/mame/video/tumbleb.c
r17988r17989
327327   int offs, offs2;
328328
329329   m_flipscreen = m_control_0[0] & 0x80;
330   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
330   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
331331
332332   if (m_flipscreen)
333333      offs = 1;
r17988r17989
339339   else
340340      offs2 = -5;
341341
342   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offs2, 0, offs, 0);
342   tumbleb_draw_common(machine(),bitmap,cliprect, offs2, 0, offs, 0);
343343
344344   return 0;
345345}
r17988r17989
349349   int offs, offs2;
350350
351351   m_flipscreen = m_control_0[0] & 0x80;
352   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
352   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
353353
354354   if (m_flipscreen)
355355      offs = 1;
r17988r17989
361361   else
362362      offs2 = -5;
363363
364   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offs2, 0, offs, 0);
364   tumbleb_draw_common(machine(),bitmap,cliprect, offs2, 0, offs, 0);
365365   return 0;
366366}
367367
r17988r17989
370370   int offs, offs2;
371371
372372   m_flipscreen = m_control_0[0] & 0x80;
373   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
373   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
374374
375375   if (m_flipscreen)
376376      offs = 1;
r17988r17989
382382   else
383383      offs2 = -5;
384384
385   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offs2, 0, offs, 0);
385   tumbleb_draw_common(machine(),bitmap,cliprect, offs2, 0, offs, 0);
386386   return 0;
387387}
388388
r17988r17989
396396   offsy = 2;
397397   offsx2 = -5;
398398
399   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offsx2, 0, offsx, offsy);
399   tumbleb_draw_common(machine(),bitmap,cliprect, offsx2, 0, offsx, offsy);
400400
401401   return 0;
402402}
r17988r17989
406406   int offs, offs2;
407407
408408   m_flipscreen = m_control_0[0] & 0x80;
409   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
409   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
410410
411411   /* not sure of this */
412412   if (m_flipscreen)
r17988r17989
420420   else
421421      offs2 = 8;
422422
423   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offs2, 0, offs, 0);
423   tumbleb_draw_common(machine(),bitmap,cliprect, offs2, 0, offs, 0);
424424   return 0;
425425}
426426
r17988r17989
429429   int offs, offs2;
430430
431431   m_flipscreen = m_control_0[0] & 0x80;
432   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
432   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
433433   offs = -1;
434434   offs2 = -2;
435435
436   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offs2, 0, offs, 0);
436   tumbleb_draw_common(machine(),bitmap,cliprect, offs2, 0, offs, 0);
437437
438438   return 0;
439439}
r17988r17989
443443   int offs, offs2;
444444
445445   m_flipscreen = m_control_0[0] & 0x80;
446   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
446   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
447447   offs = -1;
448448   offs2 = -5; // foreground scroll..
449449
450   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offs2, -16, offs, 0);
450   tumbleb_draw_common(machine(),bitmap,cliprect, offs2, -16, offs, 0);
451451
452   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, m_spriteram.bytes()/2);
452   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, m_spriteram.bytes()/2);
453453   return 0;
454454}
455455
r17988r17989
458458   int offs, offs2;
459459
460460   m_flipscreen = m_control_0[0] & 0x80;
461   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
461   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
462462
463463   if (m_flipscreen)
464464      offs = 1;
r17988r17989
470470   else
471471      offs2 = -5;
472472
473   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offs2, 0, offs, 0);
473   tumbleb_draw_common(machine(),bitmap,cliprect, offs2, 0, offs, 0);
474474
475475   return 0;
476476}
r17988r17989
480480   int offs, offs2;
481481
482482   m_flipscreen = m_control_0[0] & 0x80;
483   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
483   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
484484
485485   if (m_flipscreen)
486486      offs = 1;
r17988r17989
492492   else
493493      offs2 = -5;
494494
495   tumbleb_draw_common(screen.machine(),bitmap,cliprect, offs2, 0, offs, 0);
495   tumbleb_draw_common(machine(),bitmap,cliprect, offs2, 0, offs, 0);
496496   return 0;
497497}
498498
r17988r17989
509509   m_pf2_tilemap->draw(bitmap, cliprect, 0, 0);
510510   m_pf1_alt_tilemap->draw(bitmap, cliprect, 0, 0);
511511
512   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, m_spriteram.bytes()/2);
512   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, m_spriteram.bytes()/2);
513513   return 0;
514514}
515515
trunk/src/mame/video/momoko.c
r17988r17989
106106   int x, y, dx, dy, rx, ry, radr, chr, sy, fx, fy, px, py, offs, col, pri, flip ;
107107   UINT8 *spriteram = m_spriteram;
108108
109   UINT8 *BG_MAP     = screen.machine().root_device().memregion("user1")->base();
110   UINT8 *BG_COL_MAP = screen.machine().root_device().memregion("user2")->base();
111   UINT8 *FG_MAP     = screen.machine().root_device().memregion("user3")->base();
109   UINT8 *BG_MAP     = machine().root_device().memregion("user1")->base();
110   UINT8 *BG_COL_MAP = machine().root_device().memregion("user2")->base();
111   UINT8 *FG_MAP     = machine().root_device().memregion("user3")->base();
112112   UINT8 *TEXT_COLOR = memregion("proms")->base();
113113
114114
115   flip = m_flipscreen ^ (screen.machine().root_device().ioport("FAKE")->read() & 0x01);
115   flip = m_flipscreen ^ (machine().root_device().ioport("FAKE")->read() & 0x01);
116116
117117   /* draw BG layer */
118118   dx = (7 - m_bg_scrollx[0]) & 7;
r17988r17989
142142               py = 248 - (8 * y + dy + 9);
143143            }
144144
145            drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[1],
145            drawgfx_opaque(bitmap,cliprect,machine().gfx[1],
146146               chr,
147147               col,
148148               flip,flip,
r17988r17989
176176         py = y + 1;
177177      }
178178
179      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[3],
179      drawgfx_transpen(bitmap,cliprect,machine().gfx[3],
180180         chr,
181181         col,
182182         !fx,fy,
r17988r17989
210210            {
211211               col = col & 0x0f;
212212               chr = chr + m_bg_select * 512;
213               momoko_draw_bg_pri(screen.machine(), bitmap, chr, col, flip, flip, px, py, pri);
213               momoko_draw_bg_pri(machine(), bitmap, chr, col, flip, flip, px, py, pri);
214214            }
215215         }
216216      }
r17988r17989
238238         px = 248 - x;
239239         py = y + 1;
240240      }
241      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[3],
241      drawgfx_transpen(bitmap,cliprect,machine().gfx[3],
242242         chr,
243243         col,
244244         !fx,fy,
r17988r17989
271271            px = 248 - x * 8;
272272            py = 255 - y;
273273         }
274         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
274         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
275275            m_videoram[(sy >> 3) * 32 + x] * 8 + dy,
276276            col,
277277            flip,0,
r17988r17989
304304               px = 248 - (8 * x + dx - 8);
305305               py = 248 - (8 * y + dy + 9);
306306            }
307            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
307            drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
308308               chr,
309309               0, /* color */
310310               flip,flip, /* flip */
trunk/src/mame/video/kchamp.c
r17988r17989
128128{
129129
130130   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
131   kchamp_draw_sprites(screen.machine(), bitmap, cliprect);
131   kchamp_draw_sprites(machine(), bitmap, cliprect);
132132   return 0;
133133}
134134
r17988r17989
136136{
137137
138138   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
139   kchampvs_draw_sprites(screen.machine(), bitmap, cliprect);
139   kchampvs_draw_sprites(machine(), bitmap, cliprect);
140140   return 0;
141141}
trunk/src/mame/video/digdug.c
r17988r17989
313313
314314   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
315315   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
316   draw_sprites(screen.machine(),bitmap,cliprect);
316   draw_sprites(machine(),bitmap,cliprect);
317317   return 0;
318318}
trunk/src/mame/video/ultratnk.c
r17988r17989
7575
7676      if (!(attr & 0x80))
7777      {
78         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
78         drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
7979            (code >> 3) | bank,
8080            i,
8181            0, 0,
r17988r17989
9494   if (state)
9595   {
9696      int i;
97      UINT16 BG = colortable_entry_get_value(screen.machine().colortable, 0);
98      device_t *discrete = screen.machine().device("discrete");
97      UINT16 BG = colortable_entry_get_value(machine().colortable, 0);
98      device_t *discrete = machine().device("discrete");
9999      UINT8 *videoram = m_videoram;
100100
101101      /* check for sprite-playfield collisions */
r17988r17989
115115
116116         rect.min_x = horz - 15;
117117         rect.min_y = vert - 15;
118         rect.max_x = horz - 15 + screen.machine().gfx[1]->width() - 1;
119         rect.max_y = vert - 15 + screen.machine().gfx[1]->height() - 1;
118         rect.max_x = horz - 15 + machine().gfx[1]->width() - 1;
119         rect.max_y = vert - 15 + machine().gfx[1]->height() - 1;
120120
121         rect &= screen.machine().primary_screen->visible_area();
121         rect &= machine().primary_screen->visible_area();
122122
123123         m_playfield->draw(m_helper, rect, 0, 0);
124124
125125         if (code & 4)
126126            bank = 32;
127127
128         drawgfx_transpen(m_helper, rect, screen.machine().gfx[1],
128         drawgfx_transpen(m_helper, rect, machine().gfx[1],
129129            (code >> 3) | bank,
130130            4,
131131            0, 0,
r17988r17989
134134
135135         for (y = rect.min_y; y <= rect.max_y; y++)
136136            for (x = rect.min_x; x <= rect.max_x; x++)
137               if (colortable_entry_get_value(screen.machine().colortable, m_helper.pix16(y, x)) != BG)
137               if (colortable_entry_get_value(machine().colortable, m_helper.pix16(y, x)) != BG)
138138                  m_collision[i] = 1;
139139      }
140140
141141      /* update sound status */
142142
143      address_space &space = screen.machine().driver_data()->generic_space();
143      address_space &space = machine().driver_data()->generic_space();
144144      discrete_sound_w(discrete, space, ULTRATNK_MOTOR_DATA_1, videoram[0x391] & 15);
145145      discrete_sound_w(discrete, space, ULTRATNK_MOTOR_DATA_2, videoram[0x393] & 15);
146146   }
trunk/src/mame/video/m90.c
r17988r17989
357357      m_pf2_wide_layer->set_scrollx(0, m_video_control_data[3]+256-2 );
358358   }
359359
360   screen.machine().priority_bitmap.fill(0, cliprect);
360   machine().priority_bitmap.fill(0, cliprect);
361361
362362   if (video_enable)
363363   {
r17988r17989
448448         }
449449      }
450450
451      draw_sprites(screen.machine(),bitmap,cliprect);
451      draw_sprites(machine(),bitmap,cliprect);
452452
453453   } else {
454      bitmap.fill(get_black_pen(screen.machine()), cliprect);
454      bitmap.fill(get_black_pen(machine()), cliprect);
455455   }
456456
457457   return 0;
r17988r17989
460460UINT32 m90_state::screen_update_bomblord(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
461461{
462462   int i;
463   screen.machine().priority_bitmap.fill(0, cliprect);
464   bitmap.fill(get_black_pen(screen.machine()), cliprect);
463   machine().priority_bitmap.fill(0, cliprect);
464   bitmap.fill(get_black_pen(machine()), cliprect);
465465
466466   /* Setup scrolling */
467467   if (m_video_control_data[6]&0x20) {
r17988r17989
504504      m_pf1_layer->draw(bitmap, cliprect, 1,1);
505505   }
506506
507   bomblord_draw_sprites(screen.machine(),bitmap,cliprect);
507   bomblord_draw_sprites(machine(),bitmap,cliprect);
508508
509509   return 0;
510510}
511511
512512UINT32 m90_state::screen_update_dynablsb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
513513{
514   screen.machine().priority_bitmap.fill(0, cliprect);
515   bitmap.fill(get_black_pen(screen.machine()), cliprect);
514   machine().priority_bitmap.fill(0, cliprect);
515   bitmap.fill(get_black_pen(machine()), cliprect);
516516
517517   if (!(m_video_data[0xf008/2] & 0x4000)) {
518518      m_pf1_wide_layer->mark_all_dirty();
r17988r17989
546546      m_pf2_layer->draw(bitmap, cliprect, 1,1);
547547   }
548548
549   dynablsb_draw_sprites(screen.machine(),bitmap,cliprect);
549   dynablsb_draw_sprites(machine(),bitmap,cliprect);
550550
551551   return 0;
552552}
trunk/src/mame/video/taito_z.c
r17988r17989
847847   layer[1] = layer[0] ^ 1;
848848   layer[2] = 2;
849849
850   screen.machine().priority_bitmap.fill(0, cliprect);
850   machine().priority_bitmap.fill(0, cliprect);
851851
852852   bitmap.fill(0, cliprect);
853853
r17988r17989
856856   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -3, m_road_palbank << 6, 1, 0, 1, 2);   // -6
857857   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[2], 0, 4);
858858
859   contcirc_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 5);   // 7
859   contcirc_draw_sprites_16x8(machine(), bitmap, cliprect, 5);   // 7
860860   return 0;
861861}
862862
r17988r17989
873873   layer[1] = layer[0] ^ 1;
874874   layer[2] = 2;
875875
876   screen.machine().priority_bitmap.fill(0, cliprect);
876   machine().priority_bitmap.fill(0, cliprect);
877877
878878   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
879879   bitmap.fill(0, cliprect);
r17988r17989
883883   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
884884   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[2], 0, 4);
885885
886   chasehq_draw_sprites_16x16(screen.machine(), bitmap, cliprect, 7);
886   chasehq_draw_sprites_16x16(machine(), bitmap, cliprect, 7);
887887   return 0;
888888}
889889
r17988r17989
898898   layer[1] = layer[0] ^ 1;
899899   layer[2] = 2;
900900
901   screen.machine().priority_bitmap.fill(0, cliprect);
901   machine().priority_bitmap.fill(0, cliprect);
902902
903903   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
904904   bitmap.fill(0, cliprect);
r17988r17989
908908   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 1, 1, 2);
909909   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[2], 0, 4);
910910
911   bshark_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 8);
911   bshark_draw_sprites_16x8(machine(), bitmap, cliprect, 8);
912912   return 0;
913913}
914914
r17988r17989
923923   layer[1] = layer[0] ^ 1;
924924   layer[2] = 2;
925925
926   screen.machine().priority_bitmap.fill(0, cliprect);
926   machine().priority_bitmap.fill(0, cliprect);
927927
928928   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
929929   bitmap.fill(0, cliprect);
r17988r17989
933933   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
934934   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[2], 0, 4);
935935
936   sci_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 6);
936   sci_draw_sprites_16x8(machine(), bitmap, cliprect, 6);
937937   return 0;
938938}
939939
r17988r17989
948948   layer[1] = layer[0] ^ 1;
949949   layer[2] = 2;
950950
951   screen.machine().priority_bitmap.fill(0, cliprect);
951   machine().priority_bitmap.fill(0, cliprect);
952952
953953   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
954954   bitmap.fill(0, cliprect);
r17988r17989
958958   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0, 2, 1, 1, 2);
959959   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[2], 0, 4);
960960
961   aquajack_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 3);
961   aquajack_draw_sprites_16x8(machine(), bitmap, cliprect, 3);
962962   return 0;
963963}
964964
r17988r17989
973973   layer[1] = layer[0] ^ 1;
974974   layer[2] = 2;
975975
976   screen.machine().priority_bitmap.fill(0, cliprect);
976   machine().priority_bitmap.fill(0, cliprect);
977977
978978   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
979979   bitmap.fill(0, cliprect);
r17988r17989
982982   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[1], 0, 2);
983983   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[2], 0, 4);
984984
985   spacegun_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 4);
985   spacegun_draw_sprites_16x8(machine(), bitmap, cliprect, 4);
986986
987987   return 0;
988988}
r17988r17989
10031003   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
10041004   layer[4] = 4;   /* text layer always over bg layers */
10051005
1006   screen.machine().priority_bitmap.fill(0, cliprect);
1006   machine().priority_bitmap.fill(0, cliprect);
10071007
10081008   /* Ensure screen blanked - this shouldn't be necessary! */
10091009   bitmap.fill(0, cliprect);
r17988r17989
10131013   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[2], 0, 1);
10141014
10151015   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
1016   bshark_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 7);
1016   bshark_draw_sprites_16x8(machine(), bitmap, cliprect, 7);
10171017
10181018   /* This layer used for the big numeric displays */
10191019   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[3], 0, 4);
r17988r17989
10381038   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
10391039   layer[4] = 4;   /* text layer always over bg layers */
10401040
1041   screen.machine().priority_bitmap.fill(0, cliprect);
1041   machine().priority_bitmap.fill(0, cliprect);
10421042
10431043   /* Ensure screen blanked - this shouldn't be necessary! */
10441044   bitmap.fill(0, cliprect);
r17988r17989
10491049   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[3], 0, 2);
10501050
10511051   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
1052   sci_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 7);
1052   sci_draw_sprites_16x8(machine(), bitmap, cliprect, 7);
10531053
10541054   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[4], 0, 4);
10551055   return 0;
trunk/src/mame/video/scotrsht.c
r17988r17989
141141      m_bg_tilemap->set_scrolly(col, m_scroll[col]);
142142
143143   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
144   draw_sprites(screen.machine(), bitmap, cliprect);
144   draw_sprites(machine(), bitmap, cliprect);
145145   return 0;
146146}
trunk/src/mame/video/gunbustr.c
r17988r17989
203203
204204UINT32 gunbustr_state::screen_update_gunbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
205205{
206   device_t *tc0480scp = screen.machine().device("tc0480scp");
206   device_t *tc0480scp = machine().device("tc0480scp");
207207   UINT8 layer[5];
208208   UINT16 priority;
209209   static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
r17988r17989
217217   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
218218   layer[4] = 4;   /* text layer always over bg layers */
219219
220   screen.machine().priority_bitmap.fill(0, cliprect);
220   machine().priority_bitmap.fill(0, cliprect);
221221
222222   /* We have to assume 2nd to bottom layer is always underneath
223223       sprites as pdrawgfx cannot yet cope with more than 4 layers */
224224
225225#ifdef MAME_DEBUG
226   if (!screen.machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0);
227   if (!screen.machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
228   if (!screen.machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
229   if (!screen.machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
230   if (!screen.machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
231   if (!screen.machine().input().code_pressed (KEYCODE_N)) draw_sprites(screen.machine(), bitmap, cliprect, primasks, 48, -116);
226   if (!machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0);
227   if (!machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
228   if (!machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
229   if (!machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
230   if (!machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
231   if (!machine().input().code_pressed (KEYCODE_N)) draw_sprites(machine(), bitmap, cliprect, primasks, 48, -116);
232232#else
233233   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
234234   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
235235   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
236236   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
237237   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);   /* text layer */
238   draw_sprites(screen.machine(), bitmap, cliprect, primasks, 48, -116);
238   draw_sprites(machine(), bitmap, cliprect, primasks, 48, -116);
239239#endif
240240   return 0;
241241}
trunk/src/mame/video/superqix.c
r17988r17989
219219UINT32 superqix_state::screen_update_pbillian(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
220220{
221221   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
222   pbillian_draw_sprites(screen.machine(), bitmap,cliprect);
222   pbillian_draw_sprites(machine(), bitmap,cliprect);
223223
224224   return 0;
225225}
r17988r17989
228228{
229229   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
230230   copybitmap_trans(bitmap,*m_fg_bitmap[m_show_bitmap],flip_screen(),flip_screen(),0,0,cliprect,0);
231   superqix_draw_sprites(screen.machine(), bitmap,cliprect);
231   superqix_draw_sprites(machine(), bitmap,cliprect);
232232   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
233233   return 0;
234234}
trunk/src/mame/video/markham.c
r17988r17989
128128   }
129129
130130   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
131   draw_sprites(screen.machine(), bitmap, cliprect);
131   draw_sprites(machine(), bitmap, cliprect);
132132   return 0;
133133}
trunk/src/mame/video/msisaac.c
r17988r17989
234234{
235235   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
236236   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
237   draw_sprites(screen.machine(), bitmap, cliprect);
237   draw_sprites(machine(), bitmap, cliprect);
238238   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
239239   return 0;
240240}
trunk/src/mame/video/playch10.c
r17988r17989
115115
116116UINT32 playch10_state::screen_update_playch10_single(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
117117{
118   ppu2c0x_device *ppu = screen.machine().device<ppu2c0x_device>("ppu");
118   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
119119
120120   rectangle top_monitor = screen.visible_area();
121121
r17988r17989
143143
144144UINT32 playch10_state::screen_update_playch10_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
145145{
146   ppu2c0x_device *ppu = screen.machine().device<ppu2c0x_device>("ppu");
146   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
147147
148148   /* Single Monitor version */
149149   if (m_pc10_bios != 1)
trunk/src/mame/video/dday.c
r17988r17989
324324            UINT16 src_pixel = m_main_bitmap.pix16(y, x);
325325
326326            if (sl_bitmap.pix16(y, x) == 0xff)
327               src_pixel += screen.machine().total_colors();
327               src_pixel += machine().total_colors();
328328
329329            bitmap.pix16(y, x) = src_pixel;
330330         }
trunk/src/mame/video/lockon.c
r17988r17989
926926   /* If screen output is disabled, fill with black */
927927   if (!BIT(m_ctrl_reg, 7))
928928   {
929      bitmap.fill(get_black_pen(screen.machine()), cliprect);
929      bitmap.fill(get_black_pen(machine()), cliprect);
930930      return 0;
931931   }
932932
933933   /* Scan out the frame buffer in rotated order */
934   rotate_draw(screen.machine(), bitmap, cliprect);
934   rotate_draw(machine(), bitmap, cliprect);
935935
936936   /* Draw the character tilemap */
937937   m_tilemap->draw(bitmap, cliprect, 0, 0);
938938
939939   /* Draw the HUD */
940   hud_draw(screen.machine(), bitmap, cliprect);
940   hud_draw(machine(), bitmap, cliprect);
941941
942942   return 0;
943943}
r17988r17989
954954      m_back_buffer = tmp;
955955
956956      /* Draw the frame buffer layers */
957      scene_draw(screen.machine());
958      ground_draw(screen.machine());
959      objects_draw(screen.machine());
957      scene_draw(machine());
958      ground_draw(machine());
959      objects_draw(machine());
960960   }
961961}
trunk/src/mame/video/mappy.c
r17988r17989
541541   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
542542
543543   sprite_bitmap.fill(15, cliprect);
544   mappy_draw_sprites(screen.machine(),sprite_bitmap,cliprect,m_spriteram);
544   mappy_draw_sprites(machine(),sprite_bitmap,cliprect,m_spriteram);
545545   copybitmap_trans(bitmap,sprite_bitmap,0,0,0,0,cliprect,15);
546546
547547   /* Redraw the high priority characters */
r17988r17989
553553      for (x = 0;x < sprite_bitmap.width();x++)
554554      {
555555         int spr_entry = sprite_bitmap.pix16(y, x);
556         int spr_pen = colortable_entry_get_value(screen.machine().colortable, spr_entry);
556         int spr_pen = colortable_entry_get_value(machine().colortable, spr_entry);
557557         if (spr_pen == 0 || spr_pen == 1)
558558            bitmap.pix16(y, x) = spr_entry;
559559      }
r17988r17989
569569
570570   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
571571
572   phozon_draw_sprites(screen.machine(),bitmap,cliprect,m_spriteram);
572   phozon_draw_sprites(machine(),bitmap,cliprect,m_spriteram);
573573
574574   /* Redraw the high priority characters */
575575   m_bg_tilemap->draw(bitmap, cliprect, 1,0);
r17988r17989
585585
586586   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
587587
588   mappy_draw_sprites(screen.machine(),bitmap,cliprect,m_spriteram);
588   mappy_draw_sprites(machine(),bitmap,cliprect,m_spriteram);
589589
590590   /* Redraw the high priority characters */
591591   m_bg_tilemap->draw(bitmap, cliprect, 1,0);
trunk/src/mame/video/rastan.c
r17988r17989
3939   layer[0] = 0;
4040   layer[1] = 1;
4141
42   screen.machine().priority_bitmap.fill(0, cliprect);
42   machine().priority_bitmap.fill(0, cliprect);
4343
4444   pc080sn_tilemap_draw(m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
4545   pc080sn_tilemap_draw(m_pc080sn, bitmap, cliprect, layer[1], 0, 2);
trunk/src/mame/video/gijoe.c
r17988r17989
156156
157157   konami_sortlayers4(layer, m_layer_pri);
158158
159   bitmap.fill(get_black_pen(screen.machine()), cliprect);
160   screen.machine().priority_bitmap.fill(0, cliprect);
159   bitmap.fill(get_black_pen(machine()), cliprect);
160   machine().priority_bitmap.fill(0, cliprect);
161161
162162   k056832_tilemap_draw(m_k056832, bitmap, cliprect, layer[0], 0, 1);
163163   k056832_tilemap_draw(m_k056832, bitmap, cliprect, layer[1], 0, 2);
trunk/src/mame/video/tigeroad.c
r17988r17989
158158UINT32 tigeroad_state::screen_update_tigeroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
159159{
160160   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
161   draw_sprites(screen.machine(), bitmap, cliprect, 0);
161   draw_sprites(machine(), bitmap, cliprect, 0);
162162   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 1);
163   //draw_sprites(screen.machine(), bitmap, cliprect, 1); draw priority sprites?
163   //draw_sprites(machine(), bitmap, cliprect, 1); draw priority sprites?
164164   m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
165165   return 0;
166166}
trunk/src/mame/video/segas32.c
r17988r17989
24172417   /* if the display is off, punt */
24182418   if (!m_system32_displayenable[0])
24192419   {
2420      bitmap.fill(get_black_pen(screen.machine()), cliprect);
2420      bitmap.fill(get_black_pen(machine()), cliprect);
24212421      return 0;
24222422   }
24232423
r17988r17989
24282428
24292429   /* debugging */
24302430#if QWERTY_LAYER_ENABLE
2431   if (screen.machine().input().code_pressed(KEYCODE_Q)) enablemask = 0x01;
2432   if (screen.machine().input().code_pressed(KEYCODE_W)) enablemask = 0x02;
2433   if (screen.machine().input().code_pressed(KEYCODE_E)) enablemask = 0x04;
2434   if (screen.machine().input().code_pressed(KEYCODE_R)) enablemask = 0x08;
2435   if (screen.machine().input().code_pressed(KEYCODE_T)) enablemask = 0x10;
2436   if (screen.machine().input().code_pressed(KEYCODE_Y)) enablemask = 0x20;
2431   if (machine().input().code_pressed(KEYCODE_Q)) enablemask = 0x01;
2432   if (machine().input().code_pressed(KEYCODE_W)) enablemask = 0x02;
2433   if (machine().input().code_pressed(KEYCODE_E)) enablemask = 0x04;
2434   if (machine().input().code_pressed(KEYCODE_R)) enablemask = 0x08;
2435   if (machine().input().code_pressed(KEYCODE_T)) enablemask = 0x10;
2436   if (machine().input().code_pressed(KEYCODE_Y)) enablemask = 0x20;
24372437#endif
24382438
24392439   /* do the mixing */
r17988r17989
24412441   mix_all_layers(this, 0, 0, bitmap, cliprect, enablemask);
24422442   g_profiler.stop();
24432443
2444   if (LOG_SPRITES && screen.machine().input().code_pressed(KEYCODE_L))
2444   if (LOG_SPRITES && machine().input().code_pressed(KEYCODE_L))
24452445   {
24462446      const rectangle &visarea = screen.visible_area();
24472447      FILE *f = fopen("sprite.txt", "w");
trunk/src/mame/video/slapfght.c
r17988r17989
188188   }
189189
190190   m_pf1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
191   draw_sprites(screen.machine(), bitmap,cliprect,0);
191   draw_sprites(machine(), bitmap,cliprect,0);
192192   m_pf1_tilemap->draw(bitmap, cliprect, 0,0);
193   draw_sprites(screen.machine(), bitmap,cliprect,0x80);
193   draw_sprites(machine(), bitmap,cliprect,0x80);
194194
195   slapfght_log_vram(screen.machine());
195   slapfght_log_vram(machine());
196196   return 0;
197197}
198198
r17988r17989
202202   UINT8 *buffered_spriteram = m_spriteram->buffer();
203203   int offs;
204204
205   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
205   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
206206   if (m_flipscreen) {
207207      m_fix_tilemap->set_scrollx(0,296);
208208      m_pf1_tilemap->set_scrollx(0,(*m_slapfight_scrollx_lo + 256 * *m_slapfight_scrollx_hi)+296 );
r17988r17989
222222   for (offs = 0;offs < m_spriteram->bytes();offs += 4)
223223   {
224224      if (m_flipscreen)
225         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
225         drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
226226            buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2),
227227            (buffered_spriteram[offs+2] & 0x1e) >> 1,
228228            1,1,
229229            288-(buffered_spriteram[offs+1] + ((buffered_spriteram[offs+2] & 0x01) << 8)) +18,240-buffered_spriteram[offs+3],0);
230230      else
231         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
231         drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
232232            buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2),
233233            (buffered_spriteram[offs+2] & 0x1e) >> 1,
234234            0,0,
r17988r17989
237237
238238   m_fix_tilemap->draw(bitmap, cliprect, 0,0);
239239
240   slapfght_log_vram(screen.machine());
240   slapfght_log_vram(machine());
241241   return 0;
242242}
trunk/src/mame/video/psikyosh.c
r17988r17989
12661266#ifdef DEBUG_KEYS
12671267   for (i = 0; i <= 7; i++)
12681268   {
1269      if(screen.machine().input().code_pressed(pri_keys[i])) {
1269      if(machine().input().code_pressed(pri_keys[i])) {
12701270         pri_debug = true;
12711271      }
12721272   }
1273   if(screen.machine().input().code_pressed(KEYCODE_G)) {
1273   if(machine().input().code_pressed(KEYCODE_G)) {
12741274      sprites = false;
12751275   }
1276   if(screen.machine().input().code_pressed(KEYCODE_H)) {
1276   if(machine().input().code_pressed(KEYCODE_H)) {
12771277      backgrounds = false;
12781278   }
12791279#endif
r17988r17989
12881288
12891289   m_z_bitmap.fill(0, cliprect); /* z-buffer */
12901290
1291   psikyosh_prelineblend(screen.machine(), bitmap, cliprect); // fills screen
1291   psikyosh_prelineblend(machine(), bitmap, cliprect); // fills screen
12921292   for (i = 0; i <= 7; i++)
12931293   {
1294      if(!pri_debug || screen.machine().input().code_pressed(pri_keys[i]))
1294      if(!pri_debug || machine().input().code_pressed(pri_keys[i]))
12951295      {
12961296         if(sprites) {
1297            draw_sprites(screen.machine(), bitmap, cliprect, i); // When same priority bg's have higher pri
1297            draw_sprites(machine(), bitmap, cliprect, i); // When same priority bg's have higher pri
12981298         }
12991299         if(backgrounds) {
1300            draw_background(screen.machine(), bitmap, cliprect, i);
1300            draw_background(machine(), bitmap, cliprect, i);
13011301         }
1302         psikyosh_postlineblend(screen.machine(), bitmap, cliprect, i); // assume this has highest priority at same priority level
1302         psikyosh_postlineblend(machine(), bitmap, cliprect, i); // assume this has highest priority at same priority level
13031303      }
13041304   }
13051305   return 0;
trunk/src/mame/video/quizdna.c
r17988r17989
189189   if (m_video_enable)
190190   {
191191      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
192      draw_sprites(screen.machine(), bitmap, cliprect);
192      draw_sprites(machine(), bitmap, cliprect);
193193      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
194194   }
195195   else
196      bitmap.fill(get_black_pen(screen.machine()), cliprect);
196      bitmap.fill(get_black_pen(machine()), cliprect);
197197   return 0;
198198}
trunk/src/mame/video/boogwing.c
r17988r17989
180180
181181UINT32 boogwing_state::screen_update_boogwing(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
182182{
183   address_space &space = screen.machine().driver_data()->generic_space();
183   address_space &space = machine().driver_data()->generic_space();
184184   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
185185   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
186186
187187   /* Draw sprite planes to bitmaps for later mixing */
188   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true);
189   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
188   machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true);
189   machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
190190
191191   flip_screen_set(BIT(flip, 7));
192192   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
193193   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
194194
195195   /* Draw playfields */
196   bitmap.fill(screen.machine().pens[0x400], cliprect); /* pen not confirmed */
197   screen.machine().priority_bitmap.fill(0);
196   bitmap.fill(machine().pens[0x400], cliprect); /* pen not confirmed */
197   machine().priority_bitmap.fill(0);
198198
199199   // bit&0x8 is definitely some kind of palette effect
200200   // bit&0x4 combines playfields
r17988r17989
225225      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 32);
226226   }
227227
228   mix_boogwing(screen.machine(), bitmap,cliprect);
228   mix_boogwing(machine(), bitmap,cliprect);
229229
230230   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
231231   return 0;
trunk/src/mame/video/equites.c
r17988r17989
455455
456456   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
457457
458   equites_draw_sprites(screen.machine(), bitmap, cliprect);
458   equites_draw_sprites(machine(), bitmap, cliprect);
459459
460460   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
461461
r17988r17989
466466{
467467   bitmap.fill(m_bgcolor, cliprect);
468468
469   splndrbt_copy_bg(screen.machine(), bitmap, cliprect);
469   splndrbt_copy_bg(machine(), bitmap, cliprect);
470470
471471   if (m_fg_char_bank)
472472      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
473473
474   splndrbt_draw_sprites(screen.machine(), bitmap, cliprect);
474   splndrbt_draw_sprites(machine(), bitmap, cliprect);
475475
476476   if (!m_fg_char_bank)
477477      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/gradius3.c
r17988r17989
125125{
126126
127127   /* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */
128   address_space &space = screen.machine().driver_data()->generic_space();
128   address_space &space = machine().driver_data()->generic_space();
129129   k052109_w(m_k052109, space, 0x1d80, 0x10);
130130   k052109_w(m_k052109, space, 0x1f00, 0x32);
131131
132132   k052109_tilemap_update(m_k052109);
133133
134   screen.machine().priority_bitmap.fill(0, cliprect);
134   machine().priority_bitmap.fill(0, cliprect);
135135   if (m_priority == 0)
136136   {
137137      k052109_tilemap_draw(m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 2);
trunk/src/mame/video/decocass.c
r17988r17989
521521   int scrollx, scrolly_l, scrolly_r;
522522   rectangle clip;
523523
524   if (0xc0 != (screen.machine().root_device().ioport("IN2")->read() & 0xc0))  /* coin slots assert an NMI */
524   if (0xc0 != (machine().root_device().ioport("IN2")->read() & 0xc0))  /* coin slots assert an NMI */
525525      m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
526526
527527   if (0 == (m_watchdog_flip & 0x04))
528      screen.machine().watchdog_reset();
528      machine().watchdog_reset();
529529   else if (m_watchdog_count-- > 0)
530      screen.machine().watchdog_reset();
530      machine().watchdog_reset();
531531
532532#ifdef MAME_DEBUG
533533   {
534      if (screen.machine().input().code_pressed_once(KEYCODE_I))
534      if (machine().input().code_pressed_once(KEYCODE_I))
535535         m_showmsg ^= 1;
536536      if (m_showmsg)
537537         popmessage("mode:$%02x cm:$%02x ccb:$%02x h:$%02x vl:$%02x vr:$%02x ph:$%02x pv:$%02x ch:$%02x cv:$%02x",
r17988r17989
587587
588588   if (m_mode_set & 0x20)
589589   {
590      draw_object(screen.machine(), bitmap, cliprect);
591      draw_center(screen.machine(), bitmap, cliprect);
590      draw_object(machine(), bitmap, cliprect);
591      draw_center(machine(), bitmap, cliprect);
592592   }
593593   else
594594   {
595      draw_object(screen.machine(), bitmap, cliprect);
596      draw_center(screen.machine(), bitmap, cliprect);
595      draw_object(machine(), bitmap, cliprect);
596      draw_center(machine(), bitmap, cliprect);
597597      if (m_mode_set & 0x08)   /* bkg_ena on ? */
598598      {
599599         clip = m_bg_tilemap_l_clip;
r17988r17989
606606      }
607607   }
608608   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
609   draw_sprites(screen.machine(), bitmap, cliprect, (m_color_center_bot >> 1) & 1, 0, 0, m_fgvideoram, 0x20);
610   draw_missiles(screen.machine(), bitmap, cliprect, 1, 0, m_colorram, 0x20);
609   draw_sprites(machine(), bitmap, cliprect, (m_color_center_bot >> 1) & 1, 0, 0, m_fgvideoram, 0x20);
610   draw_missiles(machine(), bitmap, cliprect, 1, 0, m_colorram, 0x20);
611611   return 0;
612612}
trunk/src/mame/video/mystwarr.c
r17988r17989
336336
337337   m_sprite_colorbase = K055555_get_palette_index(4)<<5;
338338
339   konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0);
339   konamigx_mixer(machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0);
340340   return 0;
341341}
342342
r17988r17989
353353
354354   m_sprite_colorbase = K055555_get_palette_index(4)<<4;
355355
356   konamigx_mixer(screen.machine(), bitmap, cliprect, 0, GXSUB_K053250 | GXSUB_4BPP, 0, 0, 0, 0, 0);
356   konamigx_mixer(machine(), bitmap, cliprect, 0, GXSUB_K053250 | GXSUB_4BPP, 0, 0, 0, 0, 0);
357357   return 0;
358358}
359359
r17988r17989
376376   // not quite right
377377   blendmode = (m_oinprion==0xef && K054338_read_register(K338_REG_PBLEND)) ? ((1<<16|GXMIX_BLEND_FORCE)<<2) : 0;
378378
379   konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0);
379   konamigx_mixer(machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0);
380380   return 0;
381381}
382382
r17988r17989
537537         popmessage("K053936: PSAC colorbase changed");
538538   }
539539
540   konamigx_mixer(screen.machine(), bitmap, cliprect, (m_roz_enable) ? m_ult_936_tilemap : 0, rozmode, 0, 0, 0, 0, 0);
540   konamigx_mixer(machine(), bitmap, cliprect, (m_roz_enable) ? m_ult_936_tilemap : 0, rozmode, 0, 0, 0, 0, 0);
541541   return 0;
542542}
trunk/src/mame/video/irobot.c
r17988r17989
363363         int code = videoram[offs] & 0x3f;
364364         int color = ((videoram[offs] & 0xc0) >> 6) | (m_alphamap >> 3);
365365
366         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
366         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
367367               code, color,
368368               0,0,
369369               8*x,8*y,0);
trunk/src/mame/video/skykid.c
r17988r17989
252252      // draw low priority tiles
253253      m_tx_tilemap->draw(bitmap, cliprect, pri, 0);
254254
255      draw_sprites(screen.machine(), bitmap, cliprect);
255      draw_sprites(machine(), bitmap, cliprect);
256256
257257      // draw the other tiles
258258      for (cat = 0; cat < 0xf; cat++)
r17988r17989
260260   }
261261   else
262262   {
263      draw_sprites(screen.machine(), bitmap, cliprect);
263      draw_sprites(machine(), bitmap, cliprect);
264264      m_tx_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_ALL_CATEGORIES, 0);
265265   }
266266
trunk/src/mame/video/gomoku.c
r17988r17989
146146
147147UINT32 gomoku_state::screen_update_gomoku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
148148{
149   UINT8 *GOMOKU_BG_X = screen.machine().root_device().memregion( "user1" )->base();
150   UINT8 *GOMOKU_BG_Y = screen.machine().root_device().memregion( "user2" )->base();
149   UINT8 *GOMOKU_BG_X = machine().root_device().memregion( "user1" )->base();
150   UINT8 *GOMOKU_BG_Y = machine().root_device().memregion( "user2" )->base();
151151   UINT8 *GOMOKU_BG_D = memregion( "user3" )->base();
152152   int x, y;
153153   int bgram;
trunk/src/mame/video/djmain.c
r17988r17989
145145
146146UINT32 djmain_state::screen_update_djmain(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
147147{
148   device_t *k056832 = screen.machine().device("k056832");
149   device_t *k055555 = screen.machine().device("k055555");
148   device_t *k056832 = machine().device("k056832");
149   device_t *k055555 = machine().device("k055555");
150150   int enables = k055555_read_register(k055555, K55_INPUT_ENABLES);
151151   int pri[NUM_LAYERS + 1];
152152   int order[NUM_LAYERS + 1];
r17988r17989
169169            order[j] = temp;
170170         }
171171
172   bitmap.fill(screen.machine().pens[0], cliprect);
172   bitmap.fill(machine().pens[0], cliprect);
173173
174174   for (i = 0; i < NUM_LAYERS + 1; i++)
175175   {
r17988r17989
178178      if (layer == NUM_LAYERS)
179179      {
180180         if (enables & K55_INP_SUB2)
181            draw_sprites(screen.machine(), bitmap, cliprect);
181            draw_sprites(machine(), bitmap, cliprect);
182182      }
183183      else
184184      {
trunk/src/mame/video/firetrk.c
r17988r17989
349349
350350UINT32 firetrk_state::screen_update_firetrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
351351{
352   screen.machine().tilemap().mark_all_dirty();
352   machine().tilemap().mark_all_dirty();
353353   m_tilemap1->set_scrollx(0, *m_scroll_x - 37);
354354   m_tilemap2->set_scrollx(0, *m_scroll_x - 37);
355355   m_tilemap1->set_scrolly(0, *m_scroll_y);
r17988r17989
357357
358358   bitmap.fill(0, cliprect);
359359   m_tilemap1->draw(bitmap, playfield_window, 0, 0);
360   firetrk_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, 0, m_flash);
361   firetrk_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, 1, m_flash);
362   draw_text(bitmap, cliprect, screen.machine().gfx, m_alpha_num_ram + 0x00, 296, 0x10, 0x10);
363   draw_text(bitmap, cliprect, screen.machine().gfx, m_alpha_num_ram + 0x10,   8, 0x10, 0x10);
360   firetrk_draw_car(machine(), bitmap, playfield_window, machine().gfx, 0, m_flash);
361   firetrk_draw_car(machine(), bitmap, playfield_window, machine().gfx, 1, m_flash);
362   draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x00, 296, 0x10, 0x10);
363   draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x10,   8, 0x10, 0x10);
364364
365365   if (cliprect.max_y == screen.visible_area().max_y)
366366   {
367367      m_tilemap2->draw(m_helper1, playfield_window, 0, 0);
368368
369369      m_helper2.fill(0xff, playfield_window);
370      firetrk_draw_car(screen.machine(), m_helper2, playfield_window, screen.machine().gfx, 0, FALSE);
370      firetrk_draw_car(machine(), m_helper2, playfield_window, machine().gfx, 0, FALSE);
371371      check_collision(this, 0);
372372
373373      m_helper2.fill(0xff, playfield_window);
374      firetrk_draw_car(screen.machine(), m_helper2, playfield_window, screen.machine().gfx, 1, FALSE);
374      firetrk_draw_car(machine(), m_helper2, playfield_window, machine().gfx, 1, FALSE);
375375      check_collision(this, 1);
376376
377377      *m_blink = FALSE;
r17988r17989
383383
384384UINT32 firetrk_state::screen_update_superbug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
385385{
386   screen.machine().tilemap().mark_all_dirty();
386   machine().tilemap().mark_all_dirty();
387387   m_tilemap1->set_scrollx(0, *m_scroll_x - 37);
388388   m_tilemap2->set_scrollx(0, *m_scroll_x - 37);
389389   m_tilemap1->set_scrolly(0, *m_scroll_y);
r17988r17989
391391
392392   bitmap.fill(0, cliprect);
393393   m_tilemap1->draw(bitmap, playfield_window, 0, 0);
394   superbug_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, m_flash);
395   draw_text(bitmap, cliprect, screen.machine().gfx, m_alpha_num_ram + 0x00, 296, 0x10, 0x10);
396   draw_text(bitmap, cliprect, screen.machine().gfx, m_alpha_num_ram + 0x10,   8, 0x10, 0x10);
394   superbug_draw_car(machine(), bitmap, playfield_window, machine().gfx, m_flash);
395   draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x00, 296, 0x10, 0x10);
396   draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x10,   8, 0x10, 0x10);
397397
398398   if (cliprect.max_y == screen.visible_area().max_y)
399399   {
400400      m_tilemap2->draw(m_helper1, playfield_window, 0, 0);
401401
402402      m_helper2.fill(0xff, playfield_window);
403      superbug_draw_car(screen.machine(), m_helper2, playfield_window, screen.machine().gfx, FALSE);
403      superbug_draw_car(machine(), m_helper2, playfield_window, machine().gfx, FALSE);
404404      check_collision(this, 0);
405405
406406      *m_blink = FALSE;
r17988r17989
412412
413413UINT32 firetrk_state::screen_update_montecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
414414{
415   screen.machine().tilemap().mark_all_dirty();
415   machine().tilemap().mark_all_dirty();
416416   m_tilemap1->set_scrollx(0, *m_scroll_x - 37);
417417   m_tilemap2->set_scrollx(0, *m_scroll_x - 37);
418418   m_tilemap1->set_scrolly(0, *m_scroll_y);
r17988r17989
420420
421421   bitmap.fill(0x2c, cliprect);
422422   m_tilemap1->draw(bitmap, playfield_window, 0, 0);
423   montecar_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, 0, FALSE);
424   montecar_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, 1, FALSE);
425   draw_text(bitmap, cliprect, screen.machine().gfx, m_alpha_num_ram + 0x00, 24, 0x20, 0x08);
426   draw_text(bitmap, cliprect, screen.machine().gfx, m_alpha_num_ram + 0x20, 16, 0x20, 0x08);
423   montecar_draw_car(machine(), bitmap, playfield_window, machine().gfx, 0, FALSE);
424   montecar_draw_car(machine(), bitmap, playfield_window, machine().gfx, 1, FALSE);
425   draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x00, 24, 0x20, 0x08);
426   draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x20, 16, 0x20, 0x08);
427427
428428   if (cliprect.max_y == screen.visible_area().max_y)
429429   {
430430      m_tilemap2->draw(m_helper1, playfield_window, 0, 0);
431431
432432      m_helper2.fill(0xff, playfield_window);
433      montecar_draw_car(screen.machine(), m_helper2, playfield_window, screen.machine().gfx, 0, TRUE);
433      montecar_draw_car(machine(), m_helper2, playfield_window, machine().gfx, 0, TRUE);
434434      check_collision(this, 0);
435435
436436      m_helper2.fill(0xff, playfield_window);
437      montecar_draw_car(screen.machine(), m_helper2, playfield_window, screen.machine().gfx, 1, TRUE);
437      montecar_draw_car(machine(), m_helper2, playfield_window, machine().gfx, 1, TRUE);
438438      check_collision(this, 1);
439439   }
440440
trunk/src/mame/video/m57.c
r17988r17989
266266
267267UINT32 m57_state::screen_update_m57(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
268268{
269   draw_background(screen.machine(), bitmap, cliprect);
270   draw_sprites(screen.machine(), bitmap, cliprect);
269   draw_background(machine(), bitmap, cliprect);
270   draw_sprites(machine(), bitmap, cliprect);
271271   return 0;
272272}
trunk/src/mame/video/segas24.c
r17988r17989
2727{
2828
2929   if(vmixer->get_reg(13) & 1) {
30      bitmap.fill(get_black_pen(screen.machine()));
30      bitmap.fill(get_black_pen(machine()));
3131      return 0;
3232   }
3333
34   screen.machine().priority_bitmap.fill(0);
34   machine().priority_bitmap.fill(0);
3535   bitmap.fill(0, cliprect);
3636
3737   std::vector<int> order;
trunk/src/mame/video/mustache.c
r17988r17989
142142UINT32 mustache_state::screen_update_mustache(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
143143{
144144   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
145   draw_sprites(screen.machine(), bitmap, cliprect);
145   draw_sprites(machine(), bitmap, cliprect);
146146   return 0;
147147}
trunk/src/mame/video/neogeo.c
r17988r17989
923923   /* fill with background color first */
924924   bitmap.fill(m_pens[0x0fff], cliprect);
925925
926   draw_sprites(screen.machine(), bitmap, cliprect.min_y);
926   draw_sprites(machine(), bitmap, cliprect.min_y);
927927
928   draw_fixed_layer(screen.machine(), bitmap, cliprect.min_y);
928   draw_fixed_layer(machine(), bitmap, cliprect.min_y);
929929
930930   return 0;
931931}
trunk/src/mame/video/sprcros2.c
r17988r17989
192192{
193193
194194   m_bgtilemap->draw(bitmap, cliprect, 0, 0);
195   draw_sprites(screen.machine(), bitmap, cliprect);
195   draw_sprites(machine(), bitmap, cliprect);
196196   m_fgtilemap->draw(bitmap, cliprect, 0, 0);
197197   return 0;
198198}
trunk/src/mame/video/konamigx.c
r17988r17989
24332433
24342434   if (gx_specialrozenable==3)
24352435   {
2436      konamigx_mixer(screen.machine(), bitmap, cliprect, gx_psac_tilemap, GXSUB_8BPP,0,0,  0, 0, gx_rushingheroes_hack);
2436      konamigx_mixer(machine(), bitmap, cliprect, gx_psac_tilemap, GXSUB_8BPP,0,0,  0, 0, gx_rushingheroes_hack);
24372437   }
24382438   // hack, draw the roz tilemap if W is held
24392439   // todo: fix so that it works with the mixer without crashing(!)
r17988r17989
24482448      else K053936_0_zoom_draw(*type3_roz_temp_bitmap, temprect,gx_psac_tilemap, 0,0,0); // soccerss playfield
24492449
24502450
2451      konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, 0, type3_roz_temp_bitmap, gx_rushingheroes_hack);
2451      konamigx_mixer(machine(), bitmap, cliprect, 0, 0, 0, 0, 0, type3_roz_temp_bitmap, gx_rushingheroes_hack);
24522452   }
24532453   else
24542454   {
2455      konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, 0, 0, gx_rushingheroes_hack);
2455      konamigx_mixer(machine(), bitmap, cliprect, 0, 0, 0, 0, 0, 0, gx_rushingheroes_hack);
24562456   }
24572457
24582458
r17988r17989
24602460   /* Hack! draw type-1 roz layer here for testing purposes only */
24612461   if (gx_specialrozenable == 1)
24622462   {
2463      const pen_t *paldata = screen.machine().pens;
2463      const pen_t *paldata = machine().pens;
24642464
2465      if ( screen.machine().input().code_pressed(KEYCODE_W) )
2465      if ( machine().input().code_pressed(KEYCODE_W) )
24662466      {
24672467         int y,x;
24682468
r17988r17989
25102510         {
25112511            UINT32 coldat = m_generic_paletteram_32[offset];
25122512
2513            set_color_555(screen.machine(), offset*2, 0, 5, 10,coldat >> 16);
2514            set_color_555(screen.machine(), offset*2+1, 0, 5, 10,coldat & 0xffff);
2513            set_color_555(machine(), offset*2, 0, 5, 10,coldat >> 16);
2514            set_color_555(machine(), offset*2+1, 0, 5, 10,coldat & 0xffff);
25152515         }
25162516      }
25172517      else
r17988r17989
25242524            g = (m_generic_paletteram_32[offset] >> 8) & 0xff;
25252525            b = (m_generic_paletteram_32[offset] >> 0) & 0xff;
25262526
2527            palette_set_color(screen.machine(),offset,MAKE_RGB(r,g,b));
2527            palette_set_color(machine(),offset,MAKE_RGB(r,g,b));
25282528         }
25292529      }
25302530
r17988r17989
25572557         {
25582558            UINT32 coldat = m_subpaletteram32[offset];
25592559
2560            set_color_555(screen.machine(), offset*2, 0, 5, 10,coldat >> 16);
2561            set_color_555(screen.machine(), offset*2+1, 0, 5, 10,coldat & 0xffff);
2560            set_color_555(machine(), offset*2, 0, 5, 10,coldat >> 16);
2561            set_color_555(machine(), offset*2+1, 0, 5, 10,coldat & 0xffff);
25622562         }
25632563      }
25642564      else
r17988r17989
25712571            g = (m_subpaletteram32[offset] >> 8) & 0xff;
25722572            b = (m_subpaletteram32[offset] >> 0) & 0xff;
25732573
2574            palette_set_color(screen.machine(),offset,MAKE_RGB(r,g,b));
2574            palette_set_color(machine(),offset,MAKE_RGB(r,g,b));
25752575         }
25762576      }
25772577
trunk/src/mame/video/vectrex.c
r17988r17989
162162{
163163   int i;
164164
165   vectrex_configuration(screen.machine());
165   vectrex_configuration(machine());
166166
167167   /* start black */
168   vector_add_point(screen.machine(),
168   vector_add_point(machine(),
169169                m_points[m_display_start].x,
170170                m_points[m_display_start].y,
171171                m_points[m_display_start].col,
r17988r17989
173173
174174   for (i = m_display_start; i != m_display_end; i = (i + 1) % NVECT)
175175   {
176      vector_add_point(screen.machine(),
176      vector_add_point(machine(),
177177                   m_points[i].x,
178178                   m_points[i].y,
179179                   m_points[i].col,
trunk/src/mame/video/thunderj.c
r17988r17989
120120
121121UINT32 thunderj_state::screen_update_thunderj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
122122{
123   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
123   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
124124   atarimo_rect_list rectlist;
125125   bitmap_ind16 *mobitmap;
126126   int x, y, r;
trunk/src/mame/video/parodius.c
r17988r17989
6666
6767   konami_sortlayers3(layer, m_layerpri);
6868
69   screen.machine().priority_bitmap.fill(0, cliprect);
69   machine().priority_bitmap.fill(0, cliprect);
7070   bitmap.fill(16 * bg_colorbase, cliprect);
7171   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[0], 0,1);
7272   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[1], 0,2);
trunk/src/mame/video/ladybug.c
r17988r17989
297297   }
298298
299299   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
300   draw_sprites(screen.machine(), bitmap, cliprect);
300   draw_sprites(machine(), bitmap, cliprect);
301301   return 0;
302302}
303303
r17988r17989
305305{
306306   // falling edge
307307   if (!state)
308      redclash_update_stars_state(screen.machine());
308      redclash_update_stars_state(machine());
309309}
310310
311311UINT32 ladybug_state::screen_update_sraider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
r17988r17989
333333
334334   // draw the stars
335335   if (flip_screen())
336      redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 1, 0x27, 0xff);
336      redclash_draw_stars(machine(), bitmap, cliprect, 0x60, 1, 0x27, 0xff);
337337   else
338      redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 1, 0x00, 0xd8);
338      redclash_draw_stars(machine(), bitmap, cliprect, 0x60, 1, 0x00, 0xd8);
339339
340340   // draw the gridlines
341   colortable_palette_set_color(screen.machine().colortable, 0x40, MAKE_RGB(m_grid_color & 0x40 ? 0xff : 0,
341   colortable_palette_set_color(machine().colortable, 0x40, MAKE_RGB(m_grid_color & 0x40 ? 0xff : 0,
342342                                                             m_grid_color & 0x20 ? 0xff : 0,
343343                                                             m_grid_color & 0x10 ? 0xff : 0));
344344   m_grid_tilemap->draw(bitmap, cliprect, 0, flip_screen());
r17988r17989
361361   m_bg_tilemap->draw(bitmap, cliprect, 0, flip_screen());
362362
363363   // now the sprites
364   draw_sprites(screen.machine(), bitmap, cliprect);
364   draw_sprites(machine(), bitmap, cliprect);
365365
366366   return 0;
367367}
trunk/src/mame/video/blueprnt.c
r17988r17989
130130      for (i = 0; i < 32; i++)
131131         m_bg_tilemap->set_scrolly(i, m_scrollram[30 - i]);
132132
133   bitmap.fill(get_black_pen(screen.machine()), cliprect);
133   bitmap.fill(get_black_pen(machine()), cliprect);
134134   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
135   draw_sprites(screen.machine(), bitmap, cliprect);
135   draw_sprites(machine(), bitmap, cliprect);
136136   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
137137   return 0;
138138}
trunk/src/mame/video/combatsc.c
r17988r17989
397397{
398398   int i;
399399
400   set_pens(screen.machine());
400   set_pens(machine());
401401
402   address_space &space = screen.machine().driver_data()->generic_space();
402   address_space &space = machine().driver_data()->generic_space();
403403   if (k007121_ctrlram_r(m_k007121_1, space, 1) & 0x02)
404404   {
405405      m_bg_tilemap[0]->set_scroll_rows(32);
r17988r17989
427427   m_bg_tilemap[0]->set_scrolly(0, k007121_ctrlram_r(m_k007121_1, space, 2));
428428   m_bg_tilemap[1]->set_scrolly(0, k007121_ctrlram_r(m_k007121_2, space, 2));
429429
430   screen.machine().priority_bitmap.fill(0, cliprect);
430   machine().priority_bitmap.fill(0, cliprect);
431431
432432   if (m_priority == 0)
433433   {
r17988r17989
437437      m_bg_tilemap[0]->draw(bitmap, cliprect, 1, 2);
438438
439439      /* we use the priority buffer so sprites are drawn front to back */
440      draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram[1], 1, 0x0f00);
441      draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram[0], 0, 0x4444);
440      draw_sprites(machine(), bitmap, cliprect, m_spriteram[1], 1, 0x0f00);
441      draw_sprites(machine(), bitmap, cliprect, m_spriteram[0], 0, 0x4444);
442442   }
443443   else
444444   {
r17988r17989
448448      m_bg_tilemap[1]->draw(bitmap, cliprect, 0, 8);
449449
450450      /* we use the priority buffer so sprites are drawn front to back */
451      draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram[1], 1, 0x0f00);
452      draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram[0], 0, 0x4444);
451      draw_sprites(machine(), bitmap, cliprect, m_spriteram[1], 1, 0x0f00);
452      draw_sprites(machine(), bitmap, cliprect, m_spriteram[0], 0, 0x4444);
453453   }
454454
455455   if (k007121_ctrlram_r(m_k007121_1, space, 1) & 0x08)
r17988r17989
555555{
556556   int i;
557557
558   set_pens(screen.machine());
558   set_pens(machine());
559559
560560   for (i = 0; i < 32; i++)
561561   {
r17988r17989
568568   if (m_priority == 0)
569569   {
570570      m_bg_tilemap[1]->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
571      bootleg_draw_sprites(screen.machine(), bitmap,cliprect, m_page[0], 0);
571      bootleg_draw_sprites(machine(), bitmap,cliprect, m_page[0], 0);
572572      m_bg_tilemap[0]->draw(bitmap, cliprect, 0 ,0);
573      bootleg_draw_sprites(screen.machine(), bitmap,cliprect, m_page[1], 1);
573      bootleg_draw_sprites(machine(), bitmap,cliprect, m_page[1], 1);
574574   }
575575   else
576576   {
577577      m_bg_tilemap[0]->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
578      bootleg_draw_sprites(screen.machine(), bitmap,cliprect, m_page[0], 0);
578      bootleg_draw_sprites(machine(), bitmap,cliprect, m_page[0], 0);
579579      m_bg_tilemap[1]->draw(bitmap, cliprect, 0, 0);
580      bootleg_draw_sprites(screen.machine(), bitmap,cliprect, m_page[1], 1);
580      bootleg_draw_sprites(machine(), bitmap,cliprect, m_page[1], 1);
581581   }
582582
583583   m_textlayer->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/rockrage.c
r17988r17989
9999UINT32 rockrage_state::screen_update_rockrage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
100100{
101101
102   set_pens(screen.machine());
102   set_pens(machine());
103103
104104   k007342_tilemap_update(m_k007342);
105105
106106   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
107   k007420_sprites_draw(m_k007420, bitmap, cliprect, screen.machine().gfx[1]);
107   k007420_sprites_draw(m_k007420, bitmap, cliprect, machine().gfx[1]);
108108   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE, 0);
109109   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 1, 0, 0);
110110   k007342_tilemap_draw(m_k007342, bitmap, cliprect, 1, 1, 0);
trunk/src/mame/video/buggychl.c
r17988r17989
238238      bitmap.fill(0, cliprect);
239239
240240   if (m_bg_on)
241      draw_bg(screen.machine(), bitmap, cliprect);
241      draw_bg(machine(), bitmap, cliprect);
242242
243   draw_sprites(screen.machine(), bitmap, cliprect);
243   draw_sprites(machine(), bitmap, cliprect);
244244
245   draw_fg(screen.machine(), bitmap, cliprect);
245   draw_fg(machine(), bitmap, cliprect);
246246
247247   return 0;
248248}
trunk/src/mame/video/gotcha.c
r17988r17989
103103{
104104   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
105105   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
106   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
106   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
107107   return 0;
108108}
trunk/src/mame/video/starshp1.c
r17988r17989
352352
353353UINT32 starshp1_state::screen_update_starshp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
354354{
355   set_pens(this, screen.machine().colortable);
355   set_pens(this, machine().colortable);
356356
357357   bitmap.fill(0, cliprect);
358358
359359   if (m_starfield_kill == 0)
360360      draw_starfield(this, bitmap);
361361
362   draw_sprites(screen.machine(), bitmap, cliprect);
362   draw_sprites(machine(), bitmap, cliprect);
363363
364364   if (m_circle_kill == 0 && m_circle_mod != 0)
365      draw_circle(screen.machine(), bitmap);
365      draw_circle(machine(), bitmap);
366366
367367   if (m_attract == 0)
368      draw_spaceship(screen.machine(), bitmap, cliprect);
368      draw_spaceship(machine(), bitmap, cliprect);
369369
370370   if (m_circle_kill == 0 && m_circle_mod == 0)
371      draw_circle(screen.machine(), bitmap);
371      draw_circle(machine(), bitmap);
372372
373373   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
374374
r17988r17989
385385   if (state)
386386   {
387387      rectangle rect;
388      const rectangle &visarea = screen.machine().primary_screen->visible_area();
388      const rectangle &visarea = machine().primary_screen->visible_area();
389389
390390      rect.min_x = get_sprite_hpos(this, 13);
391391      rect.min_y = get_sprite_vpos(this, 13);
392      rect.max_x = rect.min_x + screen.machine().gfx[1]->width() - 1;
393      rect.max_y = rect.min_y + screen.machine().gfx[1]->height() - 1;
392      rect.max_x = rect.min_x + machine().gfx[1]->width() - 1;
393      rect.max_y = rect.min_y + machine().gfx[1]->height() - 1;
394394
395395      rect &= m_helper.cliprect();
396396
397397      m_helper.fill(0, visarea);
398398
399399      if (m_attract == 0)
400         draw_spaceship(screen.machine(), m_helper, visarea);
400         draw_spaceship(machine(), m_helper, visarea);
401401
402402      if (circle_collision(this, visarea))
403403         m_collision_latch |= 1;
r17988r17989
405405      if (circle_collision(this, rect))
406406         m_collision_latch |= 2;
407407
408      if (spaceship_collision(screen.machine(), m_helper, rect))
408      if (spaceship_collision(machine(), m_helper, rect))
409409         m_collision_latch |= 4;
410410
411      if (spaceship_collision(screen.machine(), m_helper, visarea))
411      if (spaceship_collision(machine(), m_helper, visarea))
412412         m_collision_latch |= 8;
413413   }
414414}
trunk/src/mame/video/pandoras.c
r17988r17989
175175UINT32 pandoras_state::screen_update_pandoras(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
176176{
177177   m_layer0->draw(bitmap, cliprect, 1 ,0);
178   draw_sprites(screen.machine(), bitmap, cliprect, &m_spriteram[0x800] );
178   draw_sprites(machine(), bitmap, cliprect, &m_spriteram[0x800] );
179179   m_layer0->draw(bitmap, cliprect, 0 ,0);
180180   return 0;
181181}
trunk/src/mame/video/bigstrkb.c
r17988r17989
124124UINT32 bigstrkb_state::screen_update_bigstrkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
125125{
126126
127//  bitmap.fill(get_black_pen(screen.machine()), cliprect);
127//  bitmap.fill(get_black_pen(machine()), cliprect);
128128
129129   m_tilemap2->set_scrollx(0, m_vidreg1[0]+(256-14));
130130   m_tilemap2->set_scrolly(0, m_vidreg2[0]);
r17988r17989
135135   m_tilemap2->draw(bitmap, cliprect, 0,0);
136136   m_tilemap3->draw(bitmap, cliprect, 0,0);
137137
138   draw_sprites(screen.machine(),bitmap,cliprect);
138   draw_sprites(machine(),bitmap,cliprect);
139139   m_tilemap->draw(bitmap, cliprect, 0,0);
140140
141141//  popmessage ("Regs %08x %08x %08x %08x",bsb_vidreg2[0],bsb_vidreg2[1],bsb_vidreg2[2],bsb_vidreg2[3]);
trunk/src/mame/video/n64.c
r17988r17989
38493849
38503850UINT32 n64_state::screen_update_n64(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
38513851{
3852   n64_periphs *n64 = screen.machine().device<n64_periphs>("rcp");
3852   n64_periphs *n64 = machine().device<n64_periphs>("rcp");
38533853    m_rdp->visarea = screen.visible_area();
38543854
38553855   //UINT16 *frame_buffer = (UINT16*)&rdram[(n64->vi_origin & 0xffffff) >> 2];
trunk/src/mame/video/taito_f2.c
r17988r17989
888888   if (state)
889889   {
890890
891      taitof2_update_sprites_active_area(screen.machine());
891      taitof2_update_sprites_active_area(machine());
892892
893893      m_prepare_sprites = 1;
894894   }
r17988r17989
902902      UINT16 *spriteram = m_spriteram;
903903      int i;
904904
905      taitof2_update_sprites_active_area(screen.machine());
905      taitof2_update_sprites_active_area(machine());
906906
907907      m_prepare_sprites = 0;
908908      memcpy(m_spriteram_buffered, m_spriteram_delayed, m_spriteram.bytes());
r17988r17989
920920      UINT16 *spriteram = m_spriteram;
921921      int i;
922922
923      taitof2_update_sprites_active_area(screen.machine());
923      taitof2_update_sprites_active_area(machine());
924924
925925      m_prepare_sprites = 0;
926926      memcpy(m_spriteram_buffered, m_spriteram_delayed, m_spriteram.bytes());
r17988r17989
938938      UINT16 *spriteram = m_spriteram;
939939      int i;
940940
941      taitof2_update_sprites_active_area(screen.machine());
941      taitof2_update_sprites_active_area(machine());
942942
943943      m_prepare_sprites = 0;
944944      memcpy(m_spriteram_buffered, m_spriteram_delayed, m_spriteram.bytes());
r17988r17989
963963      UINT16 *spriteram = m_spriteram;
964964      int i;
965965
966      taitof2_update_sprites_active_area(screen.machine());
966      taitof2_update_sprites_active_area(machine());
967967
968968      m_prepare_sprites = 0;
969969      memcpy(m_spriteram_buffered, m_spriteram_delayed, m_spriteram.bytes());
r17988r17989
984984/* SSI */
985985UINT32 taitof2_state::screen_update_taitof2_ssi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
986986{
987   taitof2_handle_sprite_buffering(screen.machine());
987   taitof2_handle_sprite_buffering(machine());
988988
989989   /* SSI only uses sprites, the tilemap registers are not even initialized.
990990       (they are in Majestic 12, but the tilemaps are not used anyway) */
991   screen.machine().priority_bitmap.fill(0, cliprect);
991   machine().priority_bitmap.fill(0, cliprect);
992992   bitmap.fill(0, cliprect);
993   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0);
993   draw_sprites(machine(), bitmap, cliprect, NULL, 0);
994994   return 0;
995995}
996996
r17988r17989
998998UINT32 taitof2_state::screen_update_taitof2_yesnoj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
999999{
10001000
1001   taitof2_handle_sprite_buffering(screen.machine());
1001   taitof2_handle_sprite_buffering(machine());
10021002
10031003   tc0100scn_tilemap_update(m_tc0100scn);
10041004
1005   screen.machine().priority_bitmap.fill(0, cliprect);
1005   machine().priority_bitmap.fill(0, cliprect);
10061006   bitmap.fill(0, cliprect);   /* wrong color? */
1007   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0);
1007   draw_sprites(machine(), bitmap, cliprect, NULL, 0);
10081008   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(m_tc0100scn), 0, 0);
10091009   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(m_tc0100scn) ^ 1, 0, 0);
10101010   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, 2, 0, 0);
r17988r17989
10151015UINT32 taitof2_state::screen_update_taitof2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
10161016{
10171017
1018   taitof2_handle_sprite_buffering(screen.machine());
1018   taitof2_handle_sprite_buffering(machine());
10191019
10201020   tc0100scn_tilemap_update(m_tc0100scn);
10211021
1022   screen.machine().priority_bitmap.fill(0, cliprect);
1022   machine().priority_bitmap.fill(0, cliprect);
10231023   bitmap.fill(0, cliprect);   /* wrong color? */
10241024   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(m_tc0100scn), 0, 0);
10251025   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(m_tc0100scn) ^ 1, 0, 0);
1026   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0);
1026   draw_sprites(machine(), bitmap, cliprect, NULL, 0);
10271027   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, 2, 0, 0);
10281028   return 0;
10291029}
r17988r17989
10311031
10321032UINT32 taitof2_state::screen_update_taitof2_pri(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
10331033{
1034   address_space &space = screen.machine().driver_data()->generic_space();
1034   address_space &space = machine().driver_data()->generic_space();
10351035   int layer[3];
10361036
1037   taitof2_handle_sprite_buffering(screen.machine());
1037   taitof2_handle_sprite_buffering(machine());
10381038
10391039   tc0100scn_tilemap_update(m_tc0100scn);
10401040
r17988r17989
10521052
10531053   m_spriteblendmode = tc0360pri_r(m_tc0360pri, space, 0) & 0xc0;
10541054
1055   screen.machine().priority_bitmap.fill(0, cliprect);
1055   machine().priority_bitmap.fill(0, cliprect);
10561056   bitmap.fill(0, cliprect);   /* wrong color? */
10571057
10581058   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[0], 0, 1);
10591059   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[1], 0, 2);
10601060   tc0100scn_tilemap_draw(m_tc0100scn, bitmap, cliprect, layer[2], 0, 4);
10611061
1062   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 1);
1062   draw_sprites(machine(), bitmap, cliprect, NULL, 1);
10631063   return 0;
10641064}
10651065
r17988r17989
10781078
10791079UINT32 taitof2_state::screen_update_taitof2_pri_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
10801080{
1081   address_space &space = screen.machine().driver_data()->generic_space();
1081   address_space &space = machine().driver_data()->generic_space();
10821082   int tilepri[3];
10831083   int rozpri;
10841084   int layer[3];
r17988r17989
10861086   int i,j;
10871087   int roz_base_color = (tc0360pri_r(m_tc0360pri, space, 1) & 0x3f) << 2;
10881088
1089   taitof2_handle_sprite_buffering(screen.machine());
1089   taitof2_handle_sprite_buffering(machine());
10901090
10911091   if (m_tc0280grd != NULL)
10921092      tc0280grd_tilemap_update(m_tc0280grd, roz_base_color);
r17988r17989
11141114
11151115   m_spriteblendmode = tc0360pri_r(m_tc0360pri, space, 0) & 0xc0;
11161116
1117   screen.machine().priority_bitmap.fill(0, cliprect);
1117   machine().priority_bitmap.fill(0, cliprect);
11181118   bitmap.fill(0, cliprect);   /* wrong color? */
11191119
11201120   drawn = 0;
r17988r17989
11221122   {
11231123      if (rozpri == i)
11241124      {
1125         draw_roz_layer(screen.machine(), bitmap, cliprect, 1 << drawn);
1125         draw_roz_layer(machine(), bitmap, cliprect, 1 << drawn);
11261126         m_tilepri[drawn] = i;
11271127         drawn++;
11281128      }
r17988r17989
11381138      }
11391139   }
11401140
1141   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 1);
1141   draw_sprites(machine(), bitmap, cliprect, NULL, 1);
11421142   return 0;
11431143}
11441144
r17988r17989
11471147/* Thunderfox */
11481148UINT32 taitof2_state::screen_update_taitof2_thundfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
11491149{
1150   address_space &space = screen.machine().driver_data()->generic_space();
1150   address_space &space = machine().driver_data()->generic_space();
11511151   int tilepri[2][3];
11521152   int spritepri[4];
11531153   int layer[2][3];
11541154   int drawn[2];
11551155
1156   taitof2_handle_sprite_buffering(screen.machine());
1156   taitof2_handle_sprite_buffering(machine());
11571157
11581158   tc0100scn_tilemap_update(m_tc0100scn_1);
11591159   tc0100scn_tilemap_update(m_tc0100scn_2);
r17988r17989
11771177   spritepri[2] = tc0360pri_r(m_tc0360pri, space, 7) & 0x0f;
11781178   spritepri[3] = tc0360pri_r(m_tc0360pri, space, 7) >> 4;
11791179
1180   screen.machine().priority_bitmap.fill(0, cliprect);
1180   machine().priority_bitmap.fill(0, cliprect);
11811181   bitmap.fill(0, cliprect);   /* wrong color? */
11821182
11831183   /*
r17988r17989
12291229         if (spritepri[i] < tilepri[1][1]) primasks[i] |= 0xff00;
12301230      }
12311231
1232      draw_sprites(screen.machine(), bitmap,cliprect,primasks,0);
1232      draw_sprites(machine(), bitmap,cliprect,primasks,0);
12331233   }
12341234
12351235
r17988r17989
12841284
12851285UINT32 taitof2_state::screen_update_taitof2_metalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
12861286{
1287   address_space &space = screen.machine().driver_data()->generic_space();
1287   address_space &space = machine().driver_data()->generic_space();
12881288   UINT8 layer[5], invlayer[4];
12891289   UINT16 priority;
12901290
1291   taitof2_handle_sprite_buffering(screen.machine());
1291   taitof2_handle_sprite_buffering(machine());
12921292
12931293   tc0480scp_tilemap_update(m_tc0480scp);
12941294
r17988r17989
13181318
13191319   m_spriteblendmode = tc0360pri_r(m_tc0360pri, space, 0) & 0xc0;
13201320
1321   screen.machine().priority_bitmap.fill(0, cliprect);
1321   machine().priority_bitmap.fill(0, cliprect);
13221322   bitmap.fill(0, cliprect);
13231323
13241324   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1);
r17988r17989
13271327   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[3], 0, 8);
13281328   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[4], 0, 16);
13291329
1330   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 1);
1330   draw_sprites(machine(), bitmap, cliprect, NULL, 1);
13311331   return 0;
13321332}
13331333
r17988r17989
13351335/* Deadconx, Footchmp */
13361336UINT32 taitof2_state::screen_update_taitof2_deadconx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
13371337{
1338   address_space &space = screen.machine().driver_data()->generic_space();
1338   address_space &space = machine().driver_data()->generic_space();
13391339   UINT8 layer[5];
13401340   UINT8 tilepri[5];
13411341   UINT8 spritepri[4];
13421342   UINT16 priority;
13431343
1344   taitof2_handle_sprite_buffering(screen.machine());
1344   taitof2_handle_sprite_buffering(machine());
13451345
13461346   tc0480scp_tilemap_update(m_tc0480scp);
13471347
r17988r17989
13661366   spritepri[2] = tc0360pri_r(m_tc0360pri, space, 7) & 0x0f;
13671367   spritepri[3] = tc0360pri_r(m_tc0360pri, space, 7) >> 4;
13681368
1369   screen.machine().priority_bitmap.fill(0, cliprect);
1369   machine().priority_bitmap.fill(0, cliprect);
13701370   bitmap.fill(0, cliprect);
13711371
13721372   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1);
r17988r17989
13861386         if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00;
13871387      }
13881388
1389      draw_sprites(screen.machine(), bitmap, cliprect, primasks, 0);
1389      draw_sprites(machine(), bitmap, cliprect, primasks, 0);
13901390   }
13911391
13921392   /*
trunk/src/mame/video/gberet.c
r17988r17989
167167{
168168
169169   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
170   gberet_draw_sprites(screen.machine(), bitmap, cliprect);
170   gberet_draw_sprites(machine(), bitmap, cliprect);
171171   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
172172   return 0;
173173}
r17988r17989
220220UINT32 gberet_state::screen_update_gberetb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
221221{
222222   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
223   gberetb_draw_sprites(screen.machine(), bitmap, cliprect);
223   gberetb_draw_sprites(machine(), bitmap, cliprect);
224224   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
225225   return 0;
226226}
trunk/src/mame/video/stfight.c
r17988r17989
290290
291291UINT32 stfight_state::screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
292292{
293   set_pens(screen.machine());
293   set_pens(machine());
294294
295   screen.machine().priority_bitmap.fill(0, cliprect);
295   machine().priority_bitmap.fill(0, cliprect);
296296
297297   bitmap.fill(0, cliprect);   /* in case m_bg_tilemap is disabled */
298298   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
r17988r17989
300300
301301   /* Draw sprites (may be obscured by foreground layer) */
302302   if (m_vh_latch_ram[0x07] & 0x40)
303      draw_sprites(screen.machine(), bitmap,cliprect);
303      draw_sprites(machine(), bitmap,cliprect);
304304
305305   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
306306   return 0;
trunk/src/mame/video/gottlieb.c
r17988r17989
246246   if (!m_background_priority)
247247      m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
248248   else
249      bitmap.fill(screen.machine().pens[0], cliprect);
249      bitmap.fill(machine().pens[0], cliprect);
250250
251251   /* draw the sprites */
252   draw_sprites(screen.machine(), bitmap, cliprect);
252   draw_sprites(machine(), bitmap, cliprect);
253253
254254   /* if the background has higher priority, render it now */
255255   if (m_background_priority)
trunk/src/mame/video/ddragon.c
r17988r17989
243243   m_bg_tilemap->set_scrolly(0, scrolly);
244244
245245   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
246   draw_sprites(screen.machine(), bitmap, cliprect);
246   draw_sprites(machine(), bitmap, cliprect);
247247   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
248248   return 0;
249249}
trunk/src/mame/video/asterix.c
r17988r17989
9494
9595   konami_sortlayers3(layer, m_layerpri);
9696
97   screen.machine().priority_bitmap.fill(0, cliprect);
97   machine().priority_bitmap.fill(0, cliprect);
9898   bitmap.fill(0, cliprect);
9999
100100   k056832_tilemap_draw(m_k056832, bitmap, cliprect, layer[0], K056832_DRAW_FLAG_MIRROR, 1);
trunk/src/mame/video/tubep.c
r17988r17989
584584   pen_t pen_base = 32; //change it later
585585
586586   UINT32 v;
587   UINT8 *text_gfx_base = screen.machine().root_device().memregion("gfx1")->base();
587   UINT8 *text_gfx_base = machine().root_device().memregion("gfx1")->base();
588588   UINT8 *romBxx = memregion("user1")->base() + 0x2000*m_background_romsel;
589589
590590   /* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect.min_y, cliprect.max_y+1); */
r17988r17989
738738   int DISP_ = m_DISP^1;
739739
740740   UINT32 v;
741   UINT8 *text_gfx_base = screen.machine().root_device().memregion("gfx1")->base();
741   UINT8 *text_gfx_base = machine().root_device().memregion("gfx1")->base();
742742   UINT8 *rom13D  = memregion("user1")->base();
743743   UINT8 *rom11BD = rom13D+0x1000;
744744   UINT8 *rom19C  = rom13D+0x5000;
trunk/src/mame/video/exidy.c
r17988r17989
359359UINT32 exidy_state::screen_update_exidy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
360360{
361361   /* refresh the colors from the palette (static or dynamic) */
362   set_colors(screen.machine());
362   set_colors(machine());
363363
364364   /* update the background and draw it */
365   draw_background(screen.machine());
365   draw_background(machine());
366366   copybitmap(bitmap, m_background_bitmap, 0, 0, 0, 0, cliprect);
367367
368368   /* draw the sprites */
369   draw_sprites(screen.machine(), bitmap, cliprect);
369   draw_sprites(machine(), bitmap, cliprect);
370370
371371   /* check for collision, this will set the appropriate bits in collision_mask */
372   check_collision(screen.machine());
372   check_collision(machine());
373373
374374   return 0;
375375}
trunk/src/mame/video/homedata.c
r17988r17989
808808   /* blank screen */
809809   if (m_vreg[0x3] == 0xc1 && m_vreg[0x4] == 0xc0 && m_vreg[0x5] == 0xff)
810810   {
811      bitmap.fill(get_black_pen(screen.machine()), cliprect);
811      bitmap.fill(get_black_pen(machine()), cliprect);
812812      return 0;
813813   }
814814
r17988r17989
816816   if (flags != m_flipscreen)
817817   {
818818      m_flipscreen = flags;
819      screen.machine().tilemap().mark_all_dirty();
819      machine().tilemap().mark_all_dirty();
820820   }
821821
822822   switch (m_vreg[0x3])
r17988r17989
866866   if (flags != m_flipscreen)
867867   {
868868      m_flipscreen = flags;
869      screen.machine().tilemap().mark_all_dirty();
869      machine().tilemap().mark_all_dirty();
870870   }
871871
872872
873   bitmap.fill(get_black_pen(screen.machine()), cliprect);
873   bitmap.fill(get_black_pen(machine()), cliprect);
874874
875875   pri = (m_bank & 0x70) >> 4;
876876   for (i = 0; i < 4; i++)
r17988r17989
912912   if (flags != m_flipscreen)
913913   {
914914      m_flipscreen = flags;
915      screen.machine().tilemap().mark_all_dirty();
915      machine().tilemap().mark_all_dirty();
916916   }
917917
918918
919   bitmap.fill(get_black_pen(screen.machine()), cliprect);
919   bitmap.fill(get_black_pen(machine()), cliprect);
920920
921921   pri = (m_blitter_bank & 0x70) >> 4;
922922   for (i = 0; i < 4; i++)
r17988r17989
933933   /* blank screen */
934934   if (m_vreg[0x3] == 0xc1 && m_vreg[0x4] == 0xc0 && m_vreg[0x5] == 0xff)
935935   {
936      bitmap.fill(get_black_pen(screen.machine()), cliprect);
936      bitmap.fill(get_black_pen(machine()), cliprect);
937937      return 0;
938938   }
939939
r17988r17989
941941   if (flags != m_flipscreen)
942942   {
943943      m_flipscreen = flags;
944      screen.machine().tilemap().mark_all_dirty();
944      machine().tilemap().mark_all_dirty();
945945   }
946946
947947   /* bit 2 of blitter_bank stretches characters horizontally by 3/2,
trunk/src/mame/video/xxmissio.c
r17988r17989
132132
133133UINT32 xxmissio_state::screen_update_xxmissio(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
134134{
135   screen.machine().tilemap().mark_all_dirty();
136   screen.machine().tilemap().set_flip_all(m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
135   machine().tilemap().mark_all_dirty();
136   machine().tilemap().set_flip_all(m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
137137
138138   m_bg_tilemap->set_scrollx(0, m_xscroll * 2);
139139   m_bg_tilemap->set_scrolly(0, m_yscroll);
140140
141141   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
142   draw_sprites(bitmap, cliprect, screen.machine().gfx[1]);
142   draw_sprites(bitmap, cliprect, machine().gfx[1]);
143143   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
144144
145145   return 0;
trunk/src/mame/video/mugsmash.c
r17988r17989
150150
151151   m_tilemap2->draw(bitmap, cliprect, 0, 0);
152152   m_tilemap1->draw(bitmap, cliprect, 0, 0);
153   draw_sprites(screen.machine(), bitmap, cliprect);
153   draw_sprites(machine(), bitmap, cliprect);
154154   return 0;
155155}
trunk/src/mame/video/pcktgal.c
r17988r17989
6767
6868UINT32 pcktgal_state::screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6969{
70//  flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
71   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
72   draw_sprites(screen.machine(), bitmap, cliprect);
70//  flip_screen_set(machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
71   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
72   draw_sprites(machine(), bitmap, cliprect);
7373   return 0;
7474}
7575
7676UINT32 pcktgal_state::screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7777{
7878   // the bootleg doesn't properly set the tilemap registers, because it's on non-original hardware, which probably doesn't have the flexible tilemaps.
79   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw_bootleg(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2);
80   draw_sprites(screen.machine(), bitmap, cliprect);
79   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw_bootleg(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2);
80   draw_sprites(machine(), bitmap, cliprect);
8181   return 0;}
trunk/src/mame/video/hng64.c
r17988r17989
14441444   // press in sams64_2 attract mode for a nice debug screen from the game
14451445   // not sure how functional it is, and it doesn't appear to test everything (rowscroll modes etc.)
14461446   // but it could be useful
1447   if ( screen.machine().input().code_pressed_once(KEYCODE_L) )
1447   if ( machine().input().code_pressed_once(KEYCODE_L) )
14481448   {
1449      address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
1449      address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
14501450      space.write_byte(0x2f27c8, 0x2);
14511451   }
14521452#endif
14531453
1454   bitmap.fill(hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(screen.machine()) : screen.machine().pens[0], cliprect); //FIXME: Is the register correct? check with HW tests
1455   screen.machine().priority_bitmap.fill(0x00, cliprect);
1454   bitmap.fill(hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(machine()) : machine().pens[0], cliprect); //FIXME: Is the register correct? check with HW tests
1455   machine().priority_bitmap.fill(0x00, cliprect);
14561456
14571457   if (m_screen_dis)
14581458      return 0;
r17988r17989
15221522   //hng64_mark_all_tiles_dirty(this, 2);
15231523   //hng64_mark_all_tiles_dirty(this, 3);
15241524
1525   hng64_drawtilemap(screen.machine(),bitmap,cliprect, 3);
1526   hng64_drawtilemap(screen.machine(),bitmap,cliprect, 2);
1527   hng64_drawtilemap(screen.machine(),bitmap,cliprect, 1);
1528   hng64_drawtilemap(screen.machine(),bitmap,cliprect, 0);
1525   hng64_drawtilemap(machine(),bitmap,cliprect, 3);
1526   hng64_drawtilemap(machine(),bitmap,cliprect, 2);
1527   hng64_drawtilemap(machine(),bitmap,cliprect, 1);
1528   hng64_drawtilemap(machine(),bitmap,cliprect, 0);
15291529
15301530   // 3d really shouldn't be last, but you don't see some cool stuff right now if it's put before sprites.
15311531   {
r17988r17989
15491549      //printf("NEW FRAME!\n");   /* Debug - ajg */
15501550   }
15511551
1552   draw_sprites(screen.machine(), bitmap,cliprect);
1552   draw_sprites(machine(), bitmap,cliprect);
15531553
15541554   if(0)
1555      transition_control(screen.machine(), bitmap, cliprect);
1555      transition_control(machine(), bitmap, cliprect);
15561556
15571557   if (0)
15581558      popmessage("%08x %08x %08x %08x %08x", m_spriteregs[0], m_spriteregs[1], m_spriteregs[2], m_spriteregs[3], m_spriteregs[4]);
r17988r17989
16121612      hng64_tcram[0x58/4],
16131613      hng64_tcram[0x5c/4]);
16141614
1615   if ( screen.machine().input().code_pressed_once(KEYCODE_T) )
1615   if ( machine().input().code_pressed_once(KEYCODE_T) )
16161616   {
16171617      m_additive_tilemap_debug ^= 1;
16181618      popmessage("blend changed %02x", m_additive_tilemap_debug);
16191619   }
1620   if ( screen.machine().input().code_pressed_once(KEYCODE_Y) )
1620   if ( machine().input().code_pressed_once(KEYCODE_Y) )
16211621   {
16221622      m_additive_tilemap_debug ^= 2;
16231623      popmessage("blend changed %02x", m_additive_tilemap_debug);
16241624   }
1625   if ( screen.machine().input().code_pressed_once(KEYCODE_U) )
1625   if ( machine().input().code_pressed_once(KEYCODE_U) )
16261626   {
16271627      m_additive_tilemap_debug ^= 4;
16281628      popmessage("blend changed %02x", m_additive_tilemap_debug);
16291629   }
1630   if ( screen.machine().input().code_pressed_once(KEYCODE_I) )
1630   if ( machine().input().code_pressed_once(KEYCODE_I) )
16311631   {
16321632      m_additive_tilemap_debug ^= 8;
16331633      popmessage("blend changed %02x", m_additive_tilemap_debug);
r17988r17989
16401640{
16411641   // rising edge
16421642   if (state)
1643      clear3d(screen.machine());
1643      clear3d(machine());
16441644}
16451645
16461646void hng64_state::video_start()
trunk/src/mame/video/solomon.c
r17988r17989
104104{
105105   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
106106   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
107   draw_sprites(screen.machine(), bitmap, cliprect);
107   draw_sprites(machine(), bitmap, cliprect);
108108   return 0;
109109}
trunk/src/mame/video/gladiatr.c
r17988r17989
243243UINT32 gladiatr_state::screen_update_ppking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
244244{
245245   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
246   draw_sprites(screen.machine(), bitmap,cliprect);
246   draw_sprites(machine(), bitmap,cliprect);
247247
248248   /* the fg layer just selects the upper palette bank on underlying pixels */
249249   {
r17988r17989
290290      m_fg_tilemap->set_scrolly(0, m_fg_scrolly);
291291
292292      m_bg_tilemap->draw(bitmap, cliprect, 0,0);
293      draw_sprites(screen.machine(), bitmap,cliprect);
293      draw_sprites(machine(), bitmap,cliprect);
294294      m_fg_tilemap->draw(bitmap, cliprect, 0,0);
295295   }
296296   else
297      bitmap.fill(get_black_pen(screen.machine()), cliprect );
297      bitmap.fill(get_black_pen(machine()), cliprect );
298298   return 0;
299299}
trunk/src/mame/video/macrossp.c
r17988r17989
382382{
383383   int layers[3],layerpri[3];
384384
385   bitmap.fill(get_black_pen(screen.machine()), cliprect);
385   bitmap.fill(get_black_pen(machine()), cliprect);
386386
387387   layers[0] = 0;
388388   layerpri[0] = (m_scra_videoregs[0] & 0x0000c000) >> 14;
r17988r17989
393393
394394   sortlayers(layers, layerpri);
395395
396   draw_layer(screen.machine(), bitmap, cliprect, layers[0]);
397   draw_sprites(screen.machine(), bitmap, cliprect, 0);
398   draw_layer(screen.machine(), bitmap, cliprect, layers[1]);
399   draw_sprites(screen.machine(), bitmap, cliprect, 1);
400   draw_layer(screen.machine(), bitmap, cliprect, layers[2]);
401   draw_sprites(screen.machine(), bitmap, cliprect, 2);
402   draw_sprites(screen.machine(), bitmap, cliprect, 3);
396   draw_layer(machine(), bitmap, cliprect, layers[0]);
397   draw_sprites(machine(), bitmap, cliprect, 0);
398   draw_layer(machine(), bitmap, cliprect, layers[1]);
399   draw_sprites(machine(), bitmap, cliprect, 1);
400   draw_layer(machine(), bitmap, cliprect, layers[2]);
401   draw_sprites(machine(), bitmap, cliprect, 2);
402   draw_sprites(machine(), bitmap, cliprect, 3);
403403   m_text_tilemap->draw(bitmap, cliprect, 0, 0);
404404
405405#if 0
trunk/src/mame/video/moo.c
r17988r17989
110110   k054338_update_all_shadows(m_k054338, 0);
111111   k054338_fill_backcolor(m_k054338, bitmap, 0);
112112
113   screen.machine().priority_bitmap.fill(0, cliprect);
113   machine().priority_bitmap.fill(0, cliprect);
114114
115115   if (m_layerpri[0] < k053251_get_priority(m_k053251, K053251_CI1))   /* bucky hides back layer behind background */
116116      k056832_tilemap_draw(m_k056832, bitmap, cliprect, layers[0], 0, 1);
trunk/src/mame/video/goindol.c
r17988r17989
125125
126126   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
127127   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
128   draw_sprites(screen.machine(), bitmap, cliprect, 1, m_spriteram);
129   draw_sprites(screen.machine(), bitmap, cliprect, 0, m_spriteram2);
128   draw_sprites(machine(), bitmap, cliprect, 1, m_spriteram);
129   draw_sprites(machine(), bitmap, cliprect, 0, m_spriteram2);
130130   return 0;
131131}
trunk/src/mame/video/taito_l.c
r17988r17989
297297
298298   if (m_cur_ctrl & 0x20)   /* display enable */
299299   {
300      screen.machine().priority_bitmap.fill(0, cliprect);
300      machine().priority_bitmap.fill(0, cliprect);
301301
302302      m_bg19_tilemap->draw(bitmap, cliprect, 0, 0);
303303
r17988r17989
306306      else               /* split priority */
307307         m_bg18_tilemap->draw(bitmap, cliprect, 0,1);
308308
309      draw_sprites(screen.machine(), bitmap, cliprect);
309      draw_sprites(machine(), bitmap, cliprect);
310310
311311      m_ch1a_tilemap->draw(bitmap, cliprect, 0, 0);
312312   }
313313   else
314      bitmap.fill(screen.machine().pens[0], cliprect);
314      bitmap.fill(machine().pens[0], cliprect);
315315   return 0;
316316}
317317
trunk/src/mame/video/gyruss.c
r17988r17989
153153
154154   if (cliprect.min_y == screen.visible_area().min_y)
155155   {
156      screen.machine().tilemap().mark_all_dirty();
157      screen.machine().tilemap().set_flip_all((*m_flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
156      machine().tilemap().mark_all_dirty();
157      machine().tilemap().set_flip_all((*m_flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
158158   }
159159
160160   m_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
161   draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().gfx);
161   draw_sprites(machine(), bitmap, cliprect, machine().gfx);
162162   m_tilemap->draw(bitmap, cliprect, 0, 0);
163163
164164   return 0;
trunk/src/mame/video/groundfx.c
r17988r17989
197197
198198UINT32 groundfx_state::screen_update_groundfx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
199199{
200   address_space &space = screen.machine().driver_data()->generic_space();
201   device_t *tc0100scn = screen.machine().device("tc0100scn");
202   device_t *tc0480scp = screen.machine().device("tc0480scp");
200   address_space &space = machine().driver_data()->generic_space();
201   device_t *tc0100scn = machine().device("tc0100scn");
202   device_t *tc0480scp = machine().device("tc0480scp");
203203   UINT8 layer[5];
204204   UINT8 pivlayer[3];
205205   UINT16 priority;
r17988r17989
219219   pivlayer[1] = pivlayer[0]^1;
220220   pivlayer[2] = 2;
221221
222   screen.machine().priority_bitmap.fill(0, cliprect);
222   machine().priority_bitmap.fill(0, cliprect);
223223   bitmap.fill(0, cliprect);   /* wrong color? */
224224
225225   tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[0], TILEMAP_DRAW_OPAQUE, 0);
r17988r17989
252252
253253      if (tc0480scp_long_r(tc0480scp, space, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */
254254         tc0480scp_tilemap_draw(tc0480scp, bitmap, m_hack_cliprect, layer[0], 0, 0);
255      draw_sprites(screen.machine(), bitmap, cliprect, 1, 44, -574);
255      draw_sprites(machine(), bitmap, cliprect, 1, 44, -574);
256256   }
257257   else
258258   {
r17988r17989
263263
264264      tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0);
265265
266      draw_sprites(screen.machine(), bitmap, cliprect, 0, 44, -574);
266      draw_sprites(machine(), bitmap, cliprect, 0, 44, -574);
267267   }
268268
269269   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);   /* TC0480SCP text layer */
trunk/src/mame/video/fastlane.c
r17988r17989
159159   finalclip0 &= cliprect;
160160   finalclip1 &= cliprect;
161161
162   set_pens(screen.machine());
162   set_pens(machine());
163163
164164   /* set scroll registers */
165   address_space &space = screen.machine().driver_data()->generic_space();
165   address_space &space = machine().driver_data()->generic_space();
166166   xoffs = k007121_ctrlram_r(m_k007121, space, 0);
167167   for (i = 0; i < 32; i++)
168168      m_layer0->set_scrollx(i, m_k007121_regs[0x20 + i] + xoffs - 40);
r17988r17989
170170   m_layer0->set_scrolly(0, k007121_ctrlram_r(m_k007121, space, 2));
171171
172172   m_layer0->draw(bitmap, finalclip0, 0, 0);
173   k007121_sprites_draw(m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, m_spriteram, 0, 40, 0, (UINT32)-1);
173   k007121_sprites_draw(m_k007121, bitmap, cliprect, machine().gfx[0], machine().colortable, m_spriteram, 0, 40, 0, (UINT32)-1);
174174   m_layer1->draw(bitmap, finalclip1, 0, 0);
175175   return 0;
176176}
trunk/src/mame/video/cabal.c
r17988r17989
143143UINT32 cabal_state::screen_update_cabal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
144144{
145145   m_background_layer->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
146   draw_sprites(screen.machine(),bitmap,cliprect);
146   draw_sprites(machine(),bitmap,cliprect);
147147   m_text_layer->draw(bitmap, cliprect, 0,0);
148148   return 0;
149149}
trunk/src/mame/video/suprloco.c
r17988r17989
262262UINT32 suprloco_state::screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
263263{
264264   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
265   draw_sprites(screen.machine(),bitmap,cliprect);
265   draw_sprites(machine(),bitmap,cliprect);
266266   m_bg_tilemap->draw(bitmap, cliprect, 1,0);
267267   return 0;
268268}
trunk/src/mame/video/m92.c
r17988r17989
533533
534534UINT32 m92_state::screen_update_m92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
535535{
536   screen.machine().priority_bitmap.fill(0, cliprect);
536   machine().priority_bitmap.fill(0, cliprect);
537537   bitmap.fill(0, cliprect);
538   m92_update_scroll_positions(screen.machine());
539   m92_draw_tiles(screen.machine(), bitmap, cliprect);
538   m92_update_scroll_positions(machine());
539   m92_draw_tiles(machine(), bitmap, cliprect);
540540
541   draw_sprites(screen.machine(), bitmap, cliprect);
541   draw_sprites(machine(), bitmap, cliprect);
542542
543543   /* Flipscreen appears hardwired to the dipswitch - strange */
544   if (screen.machine().root_device().ioport("DSW")->read() & 0x100)
544   if (machine().root_device().ioport("DSW")->read() & 0x100)
545545      flip_screen_set(0);
546546   else
547547      flip_screen_set(1);
r17988r17989
550550
551551UINT32 m92_state::screen_update_ppan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
552552{
553   screen.machine().priority_bitmap.fill(0, cliprect);
553   machine().priority_bitmap.fill(0, cliprect);
554554   bitmap.fill(0, cliprect);
555   m92_update_scroll_positions(screen.machine());
556   m92_draw_tiles(screen.machine(), bitmap, cliprect);
555   m92_update_scroll_positions(machine());
556   m92_draw_tiles(machine(), bitmap, cliprect);
557557
558   ppan_draw_sprites(screen.machine(), bitmap, cliprect);
558   ppan_draw_sprites(machine(), bitmap, cliprect);
559559
560560   /* Flipscreen appears hardwired to the dipswitch - strange */
561   if (screen.machine().root_device().ioport("DSW")->read() & 0x100)
561   if (machine().root_device().ioport("DSW")->read() & 0x100)
562562      flip_screen_set(0);
563563   else
564564      flip_screen_set(1);
trunk/src/mame/video/m58.c
r17988r17989
307307   m_bg_tilemap->set_scrolly(0, *m_yard_scroll_y_low);
308308
309309   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
310   draw_sprites(screen.machine(), bitmap, cliprect);
311   draw_panel(screen.machine(), bitmap, cliprect);
310   draw_sprites(machine(), bitmap, cliprect);
311   draw_panel(machine(), bitmap, cliprect);
312312   return 0;
313313}
trunk/src/mame/video/vendetta.c
r17988r17989
7272
7373   konami_sortlayers3(layer, m_layerpri);
7474
75   screen.machine().priority_bitmap.fill(0, cliprect);
75   machine().priority_bitmap.fill(0, cliprect);
7676   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
7777   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[1], 0, 2);
7878   k052109_tilemap_draw(m_k052109, bitmap, cliprect, layer[2], 0, 4);
trunk/src/mame/video/fcombat.c
r17988r17989
160160      int code2 = code;
161161
162162      int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (m_sprite_palette * 16);
163            gfx_element *gfx = screen.machine().gfx[1];
163            gfx_element *gfx = machine().gfx[1];
164164
165165      if (m_cocktail_flip)
166166      {
r17988r17989
202202         int y = m_cocktail_flip ? (31 * 8 - 8 * sy) : 8 * sy;
203203
204204         offs = sx + sy * 64;
205         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
205         drawgfx_transpen(bitmap, cliprect, machine().gfx[0],
206206            m_videoram[offs] + 256 * m_char_bank,
207207            ((m_videoram[offs] & 0xf0) >> 4) + m_char_palette * 16,
208208            m_cocktail_flip, m_cocktail_flip, x, y, 0);
trunk/src/mame/video/thoop2.c
r17988r17989
203203   m_pant[1]->set_scrolly(0, m_vregs[2]);
204204   m_pant[1]->set_scrollx(0, m_vregs[3]);
205205
206   thoop2_sort_sprites(screen.machine());
206   thoop2_sort_sprites(machine());
207207
208208   bitmap.fill(0, cliprect );
209209
210210   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3,0);
211211   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3,0);
212   draw_sprites(screen.machine(), bitmap,cliprect,3);
212   draw_sprites(machine(), bitmap,cliprect,3);
213213   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 3,0);
214214   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 3,0);
215215
216216   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 2,0);
217217   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 2,0);
218   draw_sprites(screen.machine(), bitmap,cliprect,2);
218   draw_sprites(machine(), bitmap,cliprect,2);
219219   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 2,0);
220220   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 2,0);
221221
222222   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1,0);
223223   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1,0);
224   draw_sprites(screen.machine(), bitmap,cliprect,1);
224   draw_sprites(machine(), bitmap,cliprect,1);
225225   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1,0);
226226   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1,0);
227227
228228   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0,0);
229229   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0,0);
230   draw_sprites(screen.machine(), bitmap,cliprect,0);
230   draw_sprites(machine(), bitmap,cliprect,0);
231231   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0,0);
232232   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0,0);
233233
234   draw_sprites(screen.machine(), bitmap,cliprect,4);
234   draw_sprites(machine(), bitmap,cliprect,4);
235235   return 0;
236236}
trunk/src/mame/video/wwfwfest.c
r17988r17989
266266   if (m_pri == 0x007b) {
267267      m_bg0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
268268      m_bg1_tilemap->draw(bitmap, cliprect, 0,0);
269      draw_sprites(screen.machine(), bitmap,cliprect);
269      draw_sprites(machine(), bitmap,cliprect);
270270      m_fg0_tilemap->draw(bitmap, cliprect, 0,0);
271271   }
272272
273273   if (m_pri == 0x007c) {
274274      m_bg0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
275      draw_sprites(screen.machine(), bitmap,cliprect);
275      draw_sprites(machine(), bitmap,cliprect);
276276      m_bg1_tilemap->draw(bitmap, cliprect, 0,0);
277277      m_fg0_tilemap->draw(bitmap, cliprect, 0,0);
278278   }
r17988r17989
280280   if (m_pri == 0x0078) {
281281      m_bg1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
282282      m_bg0_tilemap->draw(bitmap, cliprect, 0,0);
283      draw_sprites(screen.machine(), bitmap,cliprect);
283      draw_sprites(machine(), bitmap,cliprect);
284284      m_fg0_tilemap->draw(bitmap, cliprect, 0,0);
285285   }
286286   return 0;
trunk/src/mame/video/marineb.c
r17988r17989
173173{
174174   int offs;
175175
176   set_tilemap_scrolly(screen.machine(), 24);
176   set_tilemap_scrolly(machine(), 24);
177177   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
178178
179179   /* draw the sprites */
r17988r17989
211211
212212      if (!m_flipscreen_y)
213213      {
214         sy = 256 - screen.machine().gfx[gfx]->width() - sy;
214         sy = 256 - machine().gfx[gfx]->width() - sy;
215215         flipy = !flipy;
216216      }
217217
r17988r17989
220220         sx++;
221221      }
222222
223      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[gfx],
223      drawgfx_transpen(bitmap,cliprect,machine().gfx[gfx],
224224            code,
225225            col,
226226            flipx,flipy,
r17988r17989
234234{
235235   int offs, sx, sy, code, col, flipx, flipy;
236236
237   set_tilemap_scrolly(screen.machine(), 26);
237   set_tilemap_scrolly(machine(), 26);
238238   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
239239
240240   /* draw the small sprites */
r17988r17989
253253
254254      if (!m_flipscreen_y)
255255      {
256         sy = 256 - screen.machine().gfx[1]->width() - sy;
256         sy = 256 - machine().gfx[1]->width() - sy;
257257         flipy = !flipy;
258258      }
259259
r17988r17989
262262         sx++;
263263      }
264264
265      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
265      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
266266            code >> 2,
267267            col,
268268            flipx,flipy,
r17988r17989
280280
281281   if (!m_flipscreen_y)
282282   {
283      sy = 256 - screen.machine().gfx[2]->width() - sy;
283      sy = 256 - machine().gfx[2]->width() - sy;
284284      flipy = !flipy;
285285   }
286286
r17988r17989
291291
292292   code >>= 4;
293293
294   drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
294   drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
295295         code,
296296         col,
297297         flipx,flipy,
r17988r17989
299299
300300   /* draw again for wrap around */
301301
302   drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
302   drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
303303         code,
304304         col,
305305         flipx,flipy,
r17988r17989
312312{
313313   int offs;
314314
315   set_tilemap_scrolly(screen.machine(), 0);
315   set_tilemap_scrolly(machine(), 0);
316316   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
317317
318318   /* draw the sprites */
r17988r17989
348348
349349      if (!m_flipscreen_y)
350350      {
351         sy = 256 - screen.machine().gfx[gfx]->width() - sy;
351         sy = 256 - machine().gfx[gfx]->width() - sy;
352352         flipy = !flipy;
353353      }
354354
r17988r17989
357357         sx--;
358358      }
359359
360      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[gfx],
360      drawgfx_transpen(bitmap,cliprect,machine().gfx[gfx],
361361            code,
362362            col,
363363            flipx,flipy,
r17988r17989
371371{
372372   int offs;
373373
374   set_tilemap_scrolly(screen.machine(), 0);
374   set_tilemap_scrolly(machine(), 0);
375375   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
376376
377377   /* draw the sprites */
r17988r17989
390390
391391      if (!m_flipscreen_y)
392392      {
393         sy = 256 - screen.machine().gfx[1]->width() - sy;
393         sy = 256 - machine().gfx[1]->width() - sy;
394394         flipy = !flipy;
395395      }
396396
397397      if (m_flipscreen_x)
398398      {
399         sx = 256 - screen.machine().gfx[1]->width() - sx;
399         sx = 256 - machine().gfx[1]->width() - sx;
400400         flipx = !flipx;
401401      }
402402
403      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
403      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
404404            code >> 2,
405405            col,
406406            flipx,flipy,
r17988r17989
414414{
415415   int offs;
416416
417   set_tilemap_scrolly(screen.machine(), 0);
417   set_tilemap_scrolly(machine(), 0);
418418   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
419419
420420   /* draw the sprites */
r17988r17989
449449
450450      if (!m_flipscreen_y)
451451      {
452         sy = 256 - screen.machine().gfx[gfx]->width() - sy;
452         sy = 256 - machine().gfx[gfx]->width() - sy;
453453         flipy = !flipy;
454454      }
455455
r17988r17989
458458         sx--;
459459      }
460460
461      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[gfx],
461      drawgfx_transpen(bitmap,cliprect,machine().gfx[gfx],
462462            code,
463463            col,
464464            flipx,flipy,
trunk/src/mame/video/pktgaldx.c
r17988r17989
77
88UINT32 pktgaldx_state::screen_update_pktgaldx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
99{
10   address_space &space = screen.machine().driver_data()->generic_space();
10   address_space &space = machine().driver_data()->generic_space();
1111   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
1212
1313   flip_screen_set(BIT(flip, 7));
1414   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
1515
1616   bitmap.fill(0, cliprect); /* not Confirmed */
17   screen.machine().priority_bitmap.fill(0);
17   machine().priority_bitmap.fill(0);
1818
1919   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
20   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400, true);
20   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400, true);
2121   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
2222   return 0;
2323}
r17988r17989
3131   int tileno;
3232   int colour;
3333
34   bitmap.fill(get_black_pen(screen.machine()), cliprect);
34   bitmap.fill(get_black_pen(machine()), cliprect);
3535
3636   /* the bootleg seems to treat the tilemaps as sprites */
3737   for (offset = 0; offset < 0x1600 / 2; offset += 8)
r17988r17989
4545      y &= 0x1ff;
4646      y -= 8;
4747
48      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0);
48      drawgfx_transpen(bitmap, cliprect, machine().gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0);
4949   }
5050
5151   for (offset = 0x1600/2; offset < 0x2000 / 2; offset += 8)
r17988r17989
5959      y &= 0x1ff;
6060      y -= 8;
6161
62      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0);
62      drawgfx_transpen(bitmap, cliprect, machine().gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0);
6363   }
6464
6565   for (offset = 0x2000/2; offset < 0x4000 / 2; offset += 8)
r17988r17989
7373      y &= 0x1ff;
7474      y -= 8;
7575
76      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0);
76      drawgfx_transpen(bitmap, cliprect, machine().gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0);
7777   }
7878
7979   return 0;
trunk/src/mame/video/timeplt.c
r17988r17989
208208{
209209
210210   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
211   draw_sprites(screen.machine(), bitmap, cliprect);
211   draw_sprites(machine(), bitmap, cliprect);
212212   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
213213   return 0;
214214}
trunk/src/mame/video/atarigx2.c
r17988r17989
177177
178178UINT32 atarigx2_state::screen_update_atarigx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
179179{
180   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
180   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
181181
182182   /* draw the playfield */
183183   priority_bitmap.fill(0, cliprect);
trunk/src/mame/video/fuukifg2.c
r17988r17989
333333   /* The backmost tilemap decides the background color(s) but sprites can
334334       go below the opaque pixels of that tilemap. We thus need to mark the
335335       transparent pixels of this layer with a different priority value */
336//  fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0);
336//  fuuki16_draw_layer(machine(), bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0);
337337
338338   /* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */
339339   bitmap.fill((0x800 * 4) - 1, cliprect);
340   screen.machine().priority_bitmap.fill(0, cliprect);
340   machine().priority_bitmap.fill(0, cliprect);
341341
342   fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_back,   0, 1);
343   fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_middle, 0, 2);
344   fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_front,  0, 4);
342   fuuki16_draw_layer(machine(), bitmap, cliprect, tm_back,   0, 1);
343   fuuki16_draw_layer(machine(), bitmap, cliprect, tm_middle, 0, 2);
344   fuuki16_draw_layer(machine(), bitmap, cliprect, tm_front,  0, 4);
345345
346346   draw_sprites(screen, bitmap, cliprect);
347347
trunk/src/mame/video/vulgus.c
r17988r17989
218218   m_bg_tilemap->set_scrolly(0, m_scroll_low[0] + 256 * m_scroll_high[0]);
219219
220220   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
221   draw_sprites(screen.machine(), bitmap,cliprect);
221   draw_sprites(machine(), bitmap,cliprect);
222222   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
223223   return 0;
224224}
trunk/src/mame/video/sderby.c
r17988r17989
105105{
106106
107107   m_tilemap->draw(bitmap, cliprect, 0,0);
108   draw_sprites(screen.machine(), bitmap,cliprect,0);
108   draw_sprites(machine(), bitmap,cliprect,0);
109109   m_md_tilemap->draw(bitmap, cliprect, 0,0);
110110   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
111111   return 0;
r17988r17989
116116
117117   m_tilemap->draw(bitmap, cliprect, 0,0);
118118   m_md_tilemap->draw(bitmap, cliprect, 0,0);
119   draw_sprites(screen.machine(), bitmap,cliprect,0);
119   draw_sprites(machine(), bitmap,cliprect,0);
120120   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
121121   return 0;
122122}
trunk/src/mame/video/circus.c
r17988r17989
111111UINT32 circus_state::screen_update_circus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
112112{
113113   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
114   circus_draw_fg(screen.machine(), bitmap, cliprect);
115   draw_sprite_collision(screen.machine(), bitmap, cliprect);
114   circus_draw_fg(machine(), bitmap, cliprect);
115   draw_sprite_collision(machine(), bitmap, cliprect);
116116   return 0;
117117}
118118
r17988r17989
183183   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
184184   robotbwl_draw_scoreboard(bitmap, cliprect);
185185   robotbwl_draw_bowling_alley(bitmap, cliprect);
186   robotbwl_draw_ball(screen.machine(), bitmap, cliprect);
186   robotbwl_draw_ball(machine(), bitmap, cliprect);
187187   return 0;
188188}
189189
r17988r17989
201201UINT32 circus_state::screen_update_crash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
202202{
203203   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
204   crash_draw_car(screen.machine(), bitmap, cliprect);
204   crash_draw_car(machine(), bitmap, cliprect);
205205   return 0;
206206}
207207
208208UINT32 circus_state::screen_update_ripcord(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
209209{
210210   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
211   draw_sprite_collision(screen.machine(), bitmap, cliprect);
211   draw_sprite_collision(machine(), bitmap, cliprect);
212212   return 0;
213213}
trunk/src/mame/video/zac2650.c
r17988r17989
204204UINT32 zac2650_state::screen_update_tinvader(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
205205{
206206   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
207   draw_sprites(screen.machine(), bitmap, cliprect);
207   draw_sprites(machine(), bitmap, cliprect);
208208   return 0;
209209}
trunk/src/mame/video/vastar.c
r17988r17989
202202   {
203203   case 0:
204204      m_bg1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
205      draw_sprites(screen.machine(), bitmap,cliprect);
205      draw_sprites(machine(), bitmap,cliprect);
206206      m_bg2_tilemap->draw(bitmap, cliprect, 0,0);
207207      m_fg_tilemap->draw(bitmap, cliprect, 0,0);
208208      break;
209209
210210   case 2:
211211      m_bg1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
212      draw_sprites(screen.machine(), bitmap,cliprect);
212      draw_sprites(machine(), bitmap,cliprect);
213213      m_bg1_tilemap->draw(bitmap, cliprect, 0,0);
214214      m_bg2_tilemap->draw(bitmap, cliprect, 0,0);
215215      m_fg_tilemap->draw(bitmap, cliprect, 0,0);
r17988r17989
219219      m_bg1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
220220      m_bg2_tilemap->draw(bitmap, cliprect, 0,0);
221221      m_fg_tilemap->draw(bitmap, cliprect, 0,0);
222      draw_sprites(screen.machine(), bitmap,cliprect);
222      draw_sprites(machine(), bitmap,cliprect);
223223      break;
224224
225225   default:
trunk/src/mame/video/taotaido.c
r17988r17989
214214      m_bg_tilemap->draw(bitmap, clip, 0,0);
215215   }
216216
217   draw_sprites(screen.machine(), bitmap,cliprect);
217   draw_sprites(machine(), bitmap,cliprect);
218218   return 0;
219219}
220220
trunk/src/mame/video/relief.c
r17988r17989
107107
108108UINT32 relief_state::screen_update_relief(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
109109{
110   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
110   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
111111   atarimo_rect_list rectlist;
112112   bitmap_ind16 *mobitmap;
113113   int x, y, r;
trunk/src/mame/video/taito_f3.c
r17988r17989
512512   {
513513      if (m_sprite_lag==2)
514514      {
515         if (screen.machine().video().skip_this_frame() == 0)
515         if (machine().video().skip_this_frame() == 0)
516516         {
517            get_sprite_info(screen.machine(), m_spriteram16_buffered);
517            get_sprite_info(machine(), m_spriteram16_buffered);
518518         }
519519         memcpy(m_spriteram16_buffered,m_spriteram,0x10000);
520520      }
521521      else if (m_sprite_lag==1)
522522      {
523         if (screen.machine().video().skip_this_frame() == 0)
523         if (machine().video().skip_this_frame() == 0)
524524         {
525            get_sprite_info(screen.machine(), m_spriteram);
525            get_sprite_info(machine(), m_spriteram);
526526         }
527527      }
528528   }
r17988r17989
31533153   UINT32 sy_fix[5],sx_fix[5];
31543154
31553155   m_f3_skip_this_frame=0;
3156   screen.machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
3156   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
31573157
31583158   /* Setup scroll */
31593159   sy_fix[0]=((m_f3_control_0[4]&0xffff)<< 9) + (1<<16);
r17988r17989
31903190
31913191   /* sprites */
31923192   if (m_sprite_lag==0)
3193      get_sprite_info(screen.machine(), m_spriteram);
3193      get_sprite_info(machine(), m_spriteram);
31943194
31953195   /* Update sprite buffer */
3196   draw_sprites(screen.machine(), bitmap,cliprect);
3196   draw_sprites(machine(), bitmap,cliprect);
31973197
31983198   /* Parse sprite, alpha & clipping parts of lineram */
31993199   get_spritealphaclip_info(this);
32003200
32013201   /* Parse playfield effects */
3202   get_line_ram_info(screen.machine(), m_pf1_tilemap,sx_fix[0],sy_fix[0],0,m_f3_pf_data_1);
3203   get_line_ram_info(screen.machine(), m_pf2_tilemap,sx_fix[1],sy_fix[1],1,m_f3_pf_data_2);
3204   get_line_ram_info(screen.machine(), m_pf3_tilemap,sx_fix[2],sy_fix[2],2,m_f3_pf_data_3);
3205   get_line_ram_info(screen.machine(), m_pf4_tilemap,sx_fix[3],sy_fix[3],3,m_f3_pf_data_4);
3206   get_vram_info(screen.machine(), m_vram_layer,m_pixel_layer,sx_fix[4],sy_fix[4]);
3202   get_line_ram_info(machine(), m_pf1_tilemap,sx_fix[0],sy_fix[0],0,m_f3_pf_data_1);
3203   get_line_ram_info(machine(), m_pf2_tilemap,sx_fix[1],sy_fix[1],1,m_f3_pf_data_2);
3204   get_line_ram_info(machine(), m_pf3_tilemap,sx_fix[2],sy_fix[2],2,m_f3_pf_data_3);
3205   get_line_ram_info(machine(), m_pf4_tilemap,sx_fix[3],sy_fix[3],3,m_f3_pf_data_4);
3206   get_vram_info(machine(), m_vram_layer,m_pixel_layer,sx_fix[4],sy_fix[4]);
32073207
32083208   /* Draw final framebuffer */
3209   scanline_draw(screen.machine(), bitmap,cliprect);
3209   scanline_draw(machine(), bitmap,cliprect);
32103210
32113211   if (VERBOSE)
3212      print_debug_info(screen.machine(), bitmap);
3212      print_debug_info(machine(), bitmap);
32133213   return 0;
32143214}
trunk/src/mame/video/homerun.c
r17988r17989
141141   m_tilemap->set_scrollx(0, m_scrollx);
142142
143143   m_tilemap->draw(bitmap, cliprect, 0, 0);
144   draw_sprites(screen.machine(), bitmap, cliprect);
144   draw_sprites(machine(), bitmap, cliprect);
145145
146146   return 0;
147147}
trunk/src/mame/video/baraduke.c
r17988r17989
311311   /* flip screen is embedded in the sprite control registers */
312312   /* can't use flip_screen_set() because the visible area is asymmetrical */
313313   flip_screen_set_no_update(spriteram[0x07f6] & 0x01);
314   screen.machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
315   set_scroll(screen.machine(), 0);
316   set_scroll(screen.machine(), 1);
314   machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
315   set_scroll(machine(), 0);
316   set_scroll(machine(), 1);
317317
318318   if (((m_xscroll[0] & 0x0e00) >> 9) == 6)
319319      back = 1;
r17988r17989
321321      back = 0;
322322
323323   m_bg_tilemap[back]->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
324   draw_sprites(screen.machine(), bitmap,cliprect,0);
324   draw_sprites(machine(), bitmap,cliprect,0);
325325   m_bg_tilemap[back ^ 1]->draw(bitmap, cliprect, 0,0);
326   draw_sprites(screen.machine(), bitmap,cliprect,1);
326   draw_sprites(machine(), bitmap,cliprect,1);
327327
328328   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
329329   return 0;
trunk/src/mame/video/champbas.c
r17988r17989
280280UINT32 champbas_state::screen_update_champbas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
281281{
282282   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
283   champbas_draw_sprites(screen.machine(), bitmap, cliprect);
283   champbas_draw_sprites(machine(), bitmap, cliprect);
284284   return 0;
285285}
286286
287287UINT32 champbas_state::screen_update_exctsccr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
288288{
289289   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
290   exctsccr_draw_sprites(screen.machine(), bitmap, cliprect);
290   exctsccr_draw_sprites(machine(), bitmap, cliprect);
291291   return 0;
292292}
trunk/src/mame/video/ssozumo.c
r17988r17989
181181
182182   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
183183   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
184   draw_sprites(screen.machine(), bitmap, cliprect);
184   draw_sprites(machine(), bitmap, cliprect);
185185   return 0;
186186}
trunk/src/mame/video/mcr.c
r17988r17989
401401   bg_tilemap->set_flip(mcr_cocktail_flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
402402
403403   /* draw the background */
404   screen.machine().priority_bitmap.fill(0, cliprect);
404   machine().priority_bitmap.fill(0, cliprect);
405405   bg_tilemap->draw(bitmap, cliprect, 0, 0x00);
406406   bg_tilemap->draw(bitmap, cliprect, 1, 0x10);
407407   bg_tilemap->draw(bitmap, cliprect, 2, 0x20);
r17988r17989
411411   switch (mcr_sprite_board)
412412   {
413413      case 91399:
414         render_sprites_91399(screen.machine(), bitmap, cliprect);
414         render_sprites_91399(machine(), bitmap, cliprect);
415415         break;
416416
417417      case 91464:
418418         if (mcr_cpu_board == 91442)
419            render_sprites_91464(screen.machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
419            render_sprites_91464(machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
420420         else if (mcr_cpu_board == 91475)
421            render_sprites_91464(screen.machine(), bitmap, cliprect, 0x00, 0x30, 0x40);
421            render_sprites_91464(machine(), bitmap, cliprect, 0x00, 0x30, 0x40);
422422         else if (mcr_cpu_board == 91490)
423            render_sprites_91464(screen.machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
423            render_sprites_91464(machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
424424         else if (mcr_cpu_board == 91721)
425            render_sprites_91464(screen.machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
425            render_sprites_91464(machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
426426         break;
427427   }
428428   return 0;
trunk/src/mame/video/m107.c
r17988r17989
382382
383383UINT32 m107_state::screen_update_m107(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
384384{
385   m107_update_scroll_positions(screen.machine());
386   m107_screenrefresh(screen.machine(), bitmap, cliprect);
385   m107_update_scroll_positions(machine());
386   m107_screenrefresh(machine(), bitmap, cliprect);
387387   return 0;
388388}
389389
trunk/src/mame/video/ninjaw.c
r17988r17989
127127   return 0;
128128}
129129
130UINT32 ninjaw_state::screen_update_ninjaw_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 36 * 8 * 0, screen.machine().driver_data<ninjaw_state>()->m_tc0100scn_1); }
131UINT32 ninjaw_state::screen_update_ninjaw_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 36 * 8 * 1, screen.machine().driver_data<ninjaw_state>()->m_tc0100scn_2); }
132UINT32 ninjaw_state::screen_update_ninjaw_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 36 * 8 * 2, screen.machine().driver_data<ninjaw_state>()->m_tc0100scn_3); }
130UINT32 ninjaw_state::screen_update_ninjaw_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 36 * 8 * 0, machine().driver_data<ninjaw_state>()->m_tc0100scn_1); }
131UINT32 ninjaw_state::screen_update_ninjaw_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 36 * 8 * 1, machine().driver_data<ninjaw_state>()->m_tc0100scn_2); }
132UINT32 ninjaw_state::screen_update_ninjaw_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 36 * 8 * 2, machine().driver_data<ninjaw_state>()->m_tc0100scn_3); }
trunk/src/mame/video/matmania.c
r17988r17989
137137      int sx = 15 - offs / 32;
138138      int sy = offs % 32;
139139
140      drawgfx_opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), screen.machine().gfx[1],
140      drawgfx_opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), machine().gfx[1],
141141            m_videoram[offs] + ((m_colorram[offs] & 0x08) << 5),
142142            (m_colorram[offs] & 0x30) >> 4,
143143            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
r17988r17989
150150      int sx = 15 - offs / 32;
151151      int sy = offs % 32;
152152
153      drawgfx_opaque(*m_tmpbitmap2, m_tmpbitmap2->cliprect(), screen.machine().gfx[1],
153      drawgfx_opaque(*m_tmpbitmap2, m_tmpbitmap2->cliprect(), machine().gfx[1],
154154            m_videoram3[offs] + ((m_colorram3[offs] & 0x08) << 5),
155155            (m_colorram3[offs] & 0x30) >> 4,
156156            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
r17988r17989
172172   {
173173      if (spriteram[offs] & 0x01)
174174      {
175         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2],
175         drawgfx_transpen(bitmap, cliprect, machine().gfx[2],
176176               spriteram[offs + 1] + ((spriteram[offs] & 0xf0) << 4),
177177               (spriteram[offs] & 0x08) >> 3,
178178               spriteram[offs] & 0x04, spriteram[offs] & 0x02,
r17988r17989
187187      int sx = 31 - offs / 32;
188188      int sy = offs % 32;
189189
190      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
190      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
191191            m_videoram2[offs] + 256 * (m_colorram2[offs] & 0x07),
192192            (m_colorram2[offs] & 0x30) >> 4,
193193            0,0,
r17988r17989
208208      int sx = 15 - offs / 32;
209209      int sy = offs % 32;
210210
211      drawgfx_opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), screen.machine().gfx[1],
211      drawgfx_opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), machine().gfx[1],
212212            m_videoram[offs] + ((m_colorram[offs] & 0x03) << 8),
213213            (m_colorram[offs] & 0x30) >> 4,
214214            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
r17988r17989
221221      int sx = 15 - offs / 32;
222222      int sy = offs % 32;
223223
224      drawgfx_opaque(*m_tmpbitmap2, m_tmpbitmap2->cliprect(), screen.machine().gfx[1],
224      drawgfx_opaque(*m_tmpbitmap2, m_tmpbitmap2->cliprect(), machine().gfx[1],
225225            m_videoram3[offs] + ((m_colorram3[offs] & 0x03) << 8),
226226            (m_colorram3[offs] & 0x30) >> 4,
227227            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
r17988r17989
245245   {
246246      if (spriteram[offs] & 0x01)
247247      {
248         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],
248         drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
249249               spriteram[offs+1] + ((spriteram[offs] & 0xf0) << 4),
250250               (spriteram[offs] & 0x08) >> 3,
251251               spriteram[offs] & 0x04,spriteram[offs] & 0x02,
r17988r17989
260260      int sx = 31 - offs / 32;
261261      int sy = offs % 32;
262262
263      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
263      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
264264            m_videoram2[offs] + 256 * (m_colorram2[offs] & 0x07),
265265            (m_colorram2[offs] & 0x30) >> 4,
266266            0,0,
trunk/src/mame/video/twin16.c
r17988r17989
520520   if (m_video_register&TWIN16_SCREEN_FLIPX) text_flip|=TILEMAP_FLIPX;
521521   if (m_video_register&TWIN16_SCREEN_FLIPY) text_flip|=TILEMAP_FLIPY;
522522
523   screen.machine().priority_bitmap.fill(0, cliprect);
524   draw_layer( screen.machine(), bitmap, 1 );
525   draw_layer( screen.machine(), bitmap, 0 );
526   draw_sprites( screen.machine(), bitmap );
523   machine().priority_bitmap.fill(0, cliprect);
524   draw_layer( machine(), bitmap, 1 );
525   draw_layer( machine(), bitmap, 0 );
526   draw_sprites( machine(), bitmap );
527527
528528   if (text_flip) m_text_tilemap->set_flip(text_flip);
529529   m_text_tilemap->draw(bitmap, cliprect, 0, 0);
r17988r17989
535535   // rising edge
536536   if (state)
537537   {
538      twin16_set_sprite_timer(screen.machine());
538      twin16_set_sprite_timer(machine());
539539
540      if (twin16_spriteram_process_enable(screen.machine())) {
541         if (m_need_process_spriteram) twin16_spriteram_process(screen.machine());
540      if (twin16_spriteram_process_enable(machine())) {
541         if (m_need_process_spriteram) twin16_spriteram_process(machine());
542542         m_need_process_spriteram = 1;
543543
544544         /* if the sprite preprocessor is used, sprite ram is copied to an external buffer first,
trunk/src/mame/video/arkanoid.c
r17988r17989
200200{
201201
202202   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
203   draw_sprites(screen.machine(), bitmap, cliprect);
203   draw_sprites(machine(), bitmap, cliprect);
204204   return 0;
205205}
206206
trunk/src/mame/video/megasys1.c
r17988r17989
952952      active_layers |= 1 << ((pri & 0xf0000) >> 16);   // bottom layer can't be disabled
953953   }
954954
955   screen.machine().tilemap().set_flip_all((m_screen_flag & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0 );
955   machine().tilemap().set_flip_all((m_screen_flag & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0 );
956956
957957   for (i = 0;i < 3;i++)
958958   {
r17988r17989
965965      }
966966   }
967967
968   screen.machine().priority_bitmap.fill(0, cliprect);
968   machine().priority_bitmap.fill(0, cliprect);
969969
970970   flag = TILEMAP_DRAW_OPAQUE;
971971   primask = 0;
r17988r17989
10081008   }
10091009
10101010   if (active_layers & 0x08)
1011      draw_sprites(screen.machine(),bitmap,cliprect);
1011      draw_sprites(machine(),bitmap,cliprect);
10121012   return 0;
10131013}
10141014
trunk/src/mame/video/crshrace.c
r17988r17989
183183
184184   if (m_gfxctrl & 0x04)   /* display disable? */
185185   {
186      bitmap.fill(get_black_pen(screen.machine()), cliprect);
186      bitmap.fill(get_black_pen(machine()), cliprect);
187187      return 0;
188188   }
189189
r17988r17989
192192   switch (m_gfxctrl & 0xfb)
193193   {
194194      case 0x00:   /* high score screen */
195         draw_sprites(screen.machine(), bitmap, cliprect);
196         draw_bg(screen.machine(), bitmap, cliprect);
197         draw_fg(screen.machine(), bitmap, cliprect);
195         draw_sprites(machine(), bitmap, cliprect);
196         draw_bg(machine(), bitmap, cliprect);
197         draw_fg(machine(), bitmap, cliprect);
198198         break;
199199      case 0x01:
200200      case 0x02:
201         draw_bg(screen.machine(), bitmap, cliprect);
202         draw_fg(screen.machine(), bitmap, cliprect);
203         draw_sprites(screen.machine(), bitmap, cliprect);
201         draw_bg(machine(), bitmap, cliprect);
202         draw_fg(machine(), bitmap, cliprect);
203         draw_sprites(machine(), bitmap, cliprect);
204204         break;
205205      default:
206206         popmessage("gfxctrl = %02x", m_gfxctrl);
trunk/src/mame/video/pacman.c
r17988r17989
248248
249249         color = ( spriteram[offs + 1] & 0x1f ) | (m_colortablebank << 5) | (m_palettebank << 6 );
250250
251         drawgfx_transmask(bitmap,spriteclip,screen.machine().gfx[1],
251         drawgfx_transmask(bitmap,spriteclip,machine().gfx[1],
252252               ( spriteram[offs] >> 2 ) | (m_spritebank << 6),
253253               color,
254254               fx,fy,
255255               sx,sy,
256               colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0));
256               colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color & 0x3f, 0));
257257
258258         /* also plot the sprite with wraparound (tunnel in Crush Roller) */
259         drawgfx_transmask(bitmap,spriteclip,screen.machine().gfx[1],
259         drawgfx_transmask(bitmap,spriteclip,machine().gfx[1],
260260               ( spriteram[offs] >> 2 ) | (m_spritebank << 6),
261261               color,
262262               fx,fy,
263263               sx - 256,sy,
264               colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0));
264               colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color & 0x3f, 0));
265265      }
266266      /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
267267      /* one pixel to the left to get a more correct placement */
r17988r17989
286286         fx = (spriteram[offs] & 1) ^ m_inv_spr;
287287         fy = (spriteram[offs] & 2) ^ ((m_inv_spr) << 1);
288288
289         drawgfx_transmask(bitmap,spriteclip,screen.machine().gfx[1],
289         drawgfx_transmask(bitmap,spriteclip,machine().gfx[1],
290290               ( spriteram[offs] >> 2 ) | (m_spritebank << 6),
291291               color,
292292               fx,fy,
293293               sx,sy + m_xoffsethack,
294               colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0));
294               colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color & 0x3f, 0));
295295
296296         /* also plot the sprite with wraparound (tunnel in Crush Roller) */
297         drawgfx_transmask(bitmap,spriteclip,screen.machine().gfx[1],
297         drawgfx_transmask(bitmap,spriteclip,machine().gfx[1],
298298               ( spriteram[offs] >> 2 ) | (m_spritebank << 6),
299299               color,
300300               fy,fx,         //FIXME: flipping bits are really supposed to be inverted here?
301301               sx - 256,sy + m_xoffsethack,
302               colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0));
302               colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color & 0x3f, 0));
303303      }
304304   }
305305
r17988r17989
418418      color = spriteram[offs + 1] & 0x1f;
419419
420420      /* TODO: ?? */
421      drawgfx_transmask(bitmap,cliprect,screen.machine().gfx[1],
421      drawgfx_transmask(bitmap,cliprect,machine().gfx[1],
422422            (spriteram[offs] >> 2) | ((m_s2650_spriteram[offs] & 3) << 6),
423423            color,
424424            spriteram[offs] & 1,spriteram[offs] & 2,
425425            sx,sy,
426            colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0));
426            colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color & 0x3f, 0));
427427   }
428428   /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
429429   /* one pixel to the left to get a more correct placement */
r17988r17989
438438      color = spriteram[offs + 1] & 0x1f;
439439
440440      /* TODO: ?? */
441      drawgfx_transmask(bitmap,cliprect,screen.machine().gfx[1],
441      drawgfx_transmask(bitmap,cliprect,machine().gfx[1],
442442            (spriteram[offs] >> 2) | ((m_s2650_spriteram[offs] & 3)<<6),
443443            color,
444444            spriteram[offs] & 1,spriteram[offs] & 2,
445445            sx,sy + m_xoffsethack,
446            colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0));
446            colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color & 0x3f, 0));
447447   }
448448   return 0;
449449}
trunk/src/mame/video/clshroad.c
r17988r17989
332332
333333   m_tilemap_0a->draw(bitmap, cliprect, 0,0);   // Opaque
334334   m_tilemap_0b->draw(bitmap, cliprect, 0,0);
335   draw_sprites(screen.machine(),bitmap,cliprect);
335   draw_sprites(machine(),bitmap,cliprect);
336336   m_tilemap_1->draw(bitmap, cliprect, 0,0);
337337   return 0;
338338}
trunk/src/mame/video/bwing.c
r17988r17989
308308      m_bgmap->draw(bitmap, cliprect, 0, 0);
309309   }
310310   else
311      bitmap.fill(get_black_pen(screen.machine()), cliprect);
311      bitmap.fill(get_black_pen(machine()), cliprect);
312312
313313   // draw low priority sprites
314   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram, 0);
314   draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0);
315315
316316   // draw foreground
317317   if (!(m_mapmask & 2))
r17988r17989
325325   }
326326
327327   // draw high priority sprites
328   draw_sprites(screen.machine(), bitmap, cliprect, m_spriteram, 1);
328   draw_sprites(machine(), bitmap, cliprect, m_spriteram, 1);
329329
330330   // draw text layer
331331//  if (m_mapmask & 4)
trunk/src/mame/video/sf.c
r17988r17989
223223   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
224224
225225   if (m_sf_active & 0x80)
226      draw_sprites(screen.machine(), bitmap, cliprect);
226      draw_sprites(machine(), bitmap, cliprect);
227227
228228   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
229229   return 0;
trunk/src/mame/video/lsasquad.c
r17988r17989
202202{
203203   bitmap.fill(511, cliprect);
204204
205   draw_layer(screen.machine(), bitmap, cliprect, m_scrollram + 0x000);
206   draw_layer(screen.machine(), bitmap, cliprect, m_scrollram + 0x080);
207   draw_sprites(screen.machine(), bitmap, cliprect);
208   draw_layer(screen.machine(), bitmap, cliprect, m_scrollram + 0x100);
205   draw_layer(machine(), bitmap, cliprect, m_scrollram + 0x000);
206   draw_layer(machine(), bitmap, cliprect, m_scrollram + 0x080);
207   draw_sprites(machine(), bitmap, cliprect);
208   draw_layer(machine(), bitmap, cliprect, m_scrollram + 0x100);
209209   return 0;
210210}
211211
r17988r17989
213213UINT32 lsasquad_state::screen_update_daikaiju(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
214214{
215215   bitmap.fill(511, cliprect);
216   drawbg(screen.machine(), bitmap, cliprect, 0); // bottom
217   draw_sprites(screen.machine(), bitmap, cliprect);
218   drawbg(screen.machine(), bitmap, cliprect, 1);   // top = palette $d ?
216   drawbg(machine(), bitmap, cliprect, 0); // bottom
217   draw_sprites(machine(), bitmap, cliprect);
218   drawbg(machine(), bitmap, cliprect, 1);   // top = palette $d ?
219219   return 0;
220220}
trunk/src/mame/video/cave.c
r17988r17989
15321532   int pri, pri2, GFX;
15331533   int layers_ctrl = -1;
15341534
1535   set_pens(screen.machine());
1535   set_pens(machine());
15361536
15371537   m_blit.baseaddr = reinterpret_cast<UINT8 *>(bitmap.raw_pixptr(0));
15381538   m_blit.line_offset = bitmap.rowbytes();
r17988r17989
15531553
15541554#ifdef MAME_DEBUG
15551555{
1556   if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X) || screen.machine().input().code_pressed(KEYCODE_C) ||
1557        screen.machine().input().code_pressed(KEYCODE_V) || screen.machine().input().code_pressed(KEYCODE_B) )
1556   if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) || machine().input().code_pressed(KEYCODE_C) ||
1557        machine().input().code_pressed(KEYCODE_V) || machine().input().code_pressed(KEYCODE_B) )
15581558   {
15591559      int msk = 0, val = 0;
15601560
1561      if (screen.machine().input().code_pressed(KEYCODE_X))   val = 1;   // priority 0 only
1562      if (screen.machine().input().code_pressed(KEYCODE_C))   val = 2;   // ""       1
1563      if (screen.machine().input().code_pressed(KEYCODE_V))   val = 4;   // ""       2
1564      if (screen.machine().input().code_pressed(KEYCODE_B))   val = 8;   // ""       3
1565      if (screen.machine().input().code_pressed(KEYCODE_Z))   val = 1|2|4|8;   // All of the above priorities
1561      if (machine().input().code_pressed(KEYCODE_X))   val = 1;   // priority 0 only
1562      if (machine().input().code_pressed(KEYCODE_C))   val = 2;   // ""       1
1563      if (machine().input().code_pressed(KEYCODE_V))   val = 4;   // ""       2
1564      if (machine().input().code_pressed(KEYCODE_B))   val = 8;   // ""       3
1565      if (machine().input().code_pressed(KEYCODE_Z))   val = 1|2|4|8;   // All of the above priorities
15661566
1567      if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= val <<  0;   // for layer 0
1568      if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= val <<  4;   // for layer 1
1569      if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= val <<  8;   // for layer 2
1570      if (screen.machine().input().code_pressed(KEYCODE_R))   msk |= val << 12;   // for layer 3
1571      if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= val << 16;   // for sprites
1567      if (machine().input().code_pressed(KEYCODE_Q))   msk |= val <<  0;   // for layer 0
1568      if (machine().input().code_pressed(KEYCODE_W))   msk |= val <<  4;   // for layer 1
1569      if (machine().input().code_pressed(KEYCODE_E))   msk |= val <<  8;   // for layer 2
1570      if (machine().input().code_pressed(KEYCODE_R))   msk |= val << 12;   // for layer 3
1571      if (machine().input().code_pressed(KEYCODE_A))   msk |= val << 16;   // for sprites
15721572      if (msk != 0) layers_ctrl &= msk;
15731573
15741574#if 1
r17988r17989
16291629
16301630      for (pri2 = 0; pri2 <= 3; pri2++)   // priority of the whole layer
16311631      {
1632         if (layers_ctrl & (1 << (pri +  0)))   cave_tilemap_draw(screen.machine(), bitmap, cliprect, pri, 0, pri2, 0);
1633         if (layers_ctrl & (1 << (pri +  4)))   cave_tilemap_draw(screen.machine(), bitmap, cliprect, pri, 0, pri2, 1);
1634         if (layers_ctrl & (1 << (pri +  8)))   cave_tilemap_draw(screen.machine(), bitmap, cliprect, pri, 0, pri2, 2);
1635         if (layers_ctrl & (1 << (pri + 12)))   cave_tilemap_draw(screen.machine(), bitmap, cliprect, pri, 0, pri2, 3);
1632         if (layers_ctrl & (1 << (pri +  0)))   cave_tilemap_draw(machine(), bitmap, cliprect, pri, 0, pri2, 0);
1633         if (layers_ctrl & (1 << (pri +  4)))   cave_tilemap_draw(machine(), bitmap, cliprect, pri, 0, pri2, 1);
1634         if (layers_ctrl & (1 << (pri +  8)))   cave_tilemap_draw(machine(), bitmap, cliprect, pri, 0, pri2, 2);
1635         if (layers_ctrl & (1 << (pri + 12)))   cave_tilemap_draw(machine(), bitmap, cliprect, pri, 0, pri2, 3);
16361636      }
16371637   }
16381638   return 0;
trunk/src/mame/video/dooyong.c
r17988r17989
500500
501501UINT32 dooyong_state::screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
502502{
503   bitmap.fill(get_black_pen(screen.machine()), cliprect);
504   screen.machine().priority_bitmap.fill(0, cliprect);
503   bitmap.fill(get_black_pen(machine()), cliprect);
504   machine().priority_bitmap.fill(0, cliprect);
505505
506506   m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
507507   m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
508508   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
509509
510510   if (!m_sprites_disabled)
511      draw_sprites(screen.machine(), bitmap, cliprect, 0);
511      draw_sprites(machine(), bitmap, cliprect, 0);
512512   return 0;
513513}
514514
515515UINT32 dooyong_state::screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
516516{
517   bitmap.fill(get_black_pen(screen.machine()), cliprect);
518   screen.machine().priority_bitmap.fill(0, cliprect);
517   bitmap.fill(get_black_pen(machine()), cliprect);
518   machine().priority_bitmap.fill(0, cliprect);
519519
520520   m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
521521   m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
522522   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
523523
524   draw_sprites(screen.machine(), bitmap, cliprect, 1);
524   draw_sprites(machine(), bitmap, cliprect, 1);
525525   return 0;
526526}
527527
528528UINT32 dooyong_state::screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
529529{
530   bitmap.fill(get_black_pen(screen.machine()), cliprect);
531   screen.machine().priority_bitmap.fill(0, cliprect);
530   bitmap.fill(get_black_pen(machine()), cliprect);
531   machine().priority_bitmap.fill(0, cliprect);
532532
533533   m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
534534   m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
535535   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
536536
537   draw_sprites(screen.machine(), bitmap, cliprect, 2);
537   draw_sprites(machine(), bitmap, cliprect, 2);
538538   return 0;
539539}
540540
541541UINT32 dooyong_state::screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
542542{
543   bitmap.fill(get_black_pen(screen.machine()), cliprect);
544   screen.machine().priority_bitmap.fill(0, cliprect);
543   bitmap.fill(get_black_pen(machine()), cliprect);
544   machine().priority_bitmap.fill(0, cliprect);
545545
546546   if (m_flytiger_pri)
547547   {
r17988r17989
555555   }
556556   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
557557
558   draw_sprites(screen.machine(), bitmap, cliprect, 4);
558   draw_sprites(machine(), bitmap, cliprect, 4);
559559   return 0;
560560}
561561
562562
563563UINT32 dooyong_state::screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
564564{
565   bitmap.fill(get_black_pen(screen.machine()), cliprect);
566   screen.machine().priority_bitmap.fill(0, cliprect);
565   bitmap.fill(get_black_pen(machine()), cliprect);
566   machine().priority_bitmap.fill(0, cliprect);
567567
568568   m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
569569   m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
570570   m_fg2_tilemap->draw(bitmap, cliprect, 0, 4);
571571   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
572572
573   draw_sprites(screen.machine(), bitmap, cliprect, 3);
573   draw_sprites(machine(), bitmap, cliprect, 3);
574574   return 0;
575575}
576576
577577UINT32 dooyong_state::screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
578578{
579   bitmap.fill(get_black_pen(screen.machine()), cliprect);
579   bitmap.fill(get_black_pen(machine()), cliprect);
580580
581581   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
582582   if (m_tx_pri) m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
r17988r17989
587587
588588UINT32 dooyong_state::screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
589589{
590   bitmap.fill(get_black_pen(screen.machine()), cliprect);
591   screen.machine().priority_bitmap.fill(0, cliprect);
590   bitmap.fill(get_black_pen(machine()), cliprect);
591   machine().priority_bitmap.fill(0, cliprect);
592592
593593   m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
594594   m_bg2_tilemap->draw(bitmap, cliprect, 0, (m_rshark_pri ? 2 : 1));
595595   m_fg_tilemap->draw(bitmap, cliprect, 0, 2);
596596   m_fg2_tilemap->draw(bitmap, cliprect, 0, 2);
597597
598   rshark_draw_sprites(screen.machine(), bitmap, cliprect);
598   rshark_draw_sprites(machine(), bitmap, cliprect);
599599   return 0;
600600}
601601
602602UINT32 dooyong_state::screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
603603{
604   bitmap.fill(get_black_pen(screen.machine()), cliprect);
605   screen.machine().priority_bitmap.fill(0, cliprect);
604   bitmap.fill(get_black_pen(machine()), cliprect);
605   machine().priority_bitmap.fill(0, cliprect);
606606
607607   m_bg_tilemap->draw(bitmap, cliprect, 0, 1);
608608
609   rshark_draw_sprites(screen.machine(), bitmap, cliprect);
609   rshark_draw_sprites(machine(), bitmap, cliprect);
610610   return 0;
611611}
612612
trunk/src/mame/video/williams.c
r17988r17989
247247
248248   /* fetch the relevant pens */
249249   for (x = 1; x < 16; x++)
250      pens[x] = palette_get_color(screen.machine(), m_williams2_fg_color * 16 + x);
250      pens[x] = palette_get_color(machine(), m_williams2_fg_color * 16 + x);
251251
252252   /* loop over rows */
253253   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
trunk/src/mame/video/brkthru.c
r17988r17989
252252   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
253253
254254   /* low priority sprites */
255   draw_sprites(screen.machine(), bitmap, cliprect, 0x01);
255   draw_sprites(machine(), bitmap, cliprect, 0x01);
256256
257257   /* draw background over low priority sprites */
258258   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
259259
260260   /* high priority sprites */
261   draw_sprites(screen.machine(), bitmap, cliprect, 0x09);
261   draw_sprites(machine(), bitmap, cliprect, 0x09);
262262
263263   /* fg layer */
264264   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/dec8.c
r17988r17989
268268
269269   flip_screen_set(m_bg_control[0] >> 7);
270270
271   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
272   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x00, 0x03);
273   screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
274   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x04, 0x03);
271   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
272   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x00, 0x03);
273   machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
274   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x04, 0x03);
275275   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
276276   return 0;
277277}
r17988r17989
308308
309309UINT32 dec8_state::screen_update_ghostb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
310310{
311   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
312   screen.machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
311   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
312   machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
313313   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
314314   return 0;
315315}
r17988r17989
343343   flip_screen_set(m_bg_control[1] >> 7);
344344
345345   // we mimic the priority scheme in dec0.c, this was originally a bit different, so this could be wrong
346   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
347   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x00, 0x00, 0x0f);
348   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x08,0x08,0x08,0x08);
346   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
347   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x00, 0x00, 0x0f);
348   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x08,0x08,0x08,0x08);
349349   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
350350   return 0;
351351}
r17988r17989
382382   m_bg_tilemap->set_scrolly(0, ((m_scroll2[2] << 8)+ m_scroll2[3]));
383383
384384   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
385   screen.machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
385   machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
386386   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
387387   return 0;
388388}
r17988r17989
395395   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 0);
396396   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1, 0);
397397   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 0);
398   screen.machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
398   machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
399399   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 0);
400400   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
401401   return 0;
r17988r17989
464464   m_bg_tilemap->set_scrollx(0, (m_scroll2[0] << 8) + m_scroll2[1]);
465465
466466   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
467   srdarwin_draw_sprites(screen.machine(), bitmap, cliprect, 0); //* (srdarwin37b5gre)
467   srdarwin_draw_sprites(machine(), bitmap, cliprect, 0); //* (srdarwin37b5gre)
468468   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
469   srdarwin_draw_sprites(screen.machine(), bitmap, cliprect, 1);
469   srdarwin_draw_sprites(machine(), bitmap, cliprect, 1);
470470   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
471471   return 0;
472472}
r17988r17989
526526   m_bg_tilemap->set_scrolly(0, ((m_scroll2[2] << 8) + m_scroll2[3]));
527527
528528   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
529   screen.machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 2);
529   machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 2);
530530   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
531   screen.machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 1);
531   machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 1);
532532   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
533533   return 0;
534534}
r17988r17989
539539   m_bg_tilemap->set_scrolly(0, ((m_scroll2[2] << 8) + m_scroll2[3]));
540540
541541   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
542   screen.machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
542   machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
543543   m_bg_tilemap->draw(bitmap, cliprect, 1, 0);
544544   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
545545   return 0;
trunk/src/mame/video/fuukifg3.c
r17988r17989
355355
356356   /* The bg colour is the last pen i.e. 0x1fff */
357357   bitmap.fill((0x800 * 4) - 1, cliprect);
358   screen.machine().priority_bitmap.fill(0, cliprect);
358   machine().priority_bitmap.fill(0, cliprect);
359359
360   fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_back,   0, 1);
361   fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_middle, 0, 2);
362   fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_front,  0, 4);
360   fuuki32_draw_layer(machine(), bitmap, cliprect, tm_back,   0, 1);
361   fuuki32_draw_layer(machine(), bitmap, cliprect, tm_middle, 0, 2);
362   fuuki32_draw_layer(machine(), bitmap, cliprect, tm_front,  0, 4);
363363
364364   draw_sprites(screen, bitmap, cliprect);
365365   return 0;
trunk/src/mame/video/tbowl.c
r17988r17989
211211
212212   bitmap.fill(0x100, cliprect); /* is there a register controling the colour? looks odd when screen is blank */
213213   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
214   draw_sprites(screen.machine(), bitmap,cliprect, 0);
214   draw_sprites(machine(), bitmap,cliprect, 0);
215215   m_bg2_tilemap->draw(bitmap, cliprect, 0,0);
216216   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
217217
r17988r17989
230230
231231   bitmap.fill(0x100, cliprect); /* is there a register controling the colour? looks odd when screen is blank */
232232   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
233   draw_sprites(screen.machine(), bitmap,cliprect, 32*8);
233   draw_sprites(machine(), bitmap,cliprect, 32*8);
234234   m_bg2_tilemap->draw(bitmap, cliprect, 0,0);
235235   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
236236
trunk/src/mame/video/battlane.c
r17988r17989
231231   m_bg_tilemap->mark_all_dirty(); // HACK
232232
233233   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
234   draw_sprites(screen.machine(), bitmap, cliprect);
235   draw_fg_bitmap(screen.machine(), bitmap);
234   draw_sprites(machine(), bitmap, cliprect);
235   draw_fg_bitmap(machine(), bitmap);
236236   return 0;
237237}
trunk/src/mame/video/thepit.c
r17988r17989
297297   m_tilemap->draw(bitmap, cliprect, 0, 0);
298298
299299   /* low priority sprites */
300   draw_sprites(screen.machine(), bitmap, cliprect, 0);
300   draw_sprites(machine(), bitmap, cliprect, 0);
301301
302302   /* high priority tiles */
303303   m_solid_tilemap->draw(bitmap, cliprect, 1, 1);
304304
305305   /* high priority sprites */
306   draw_sprites(screen.machine(), bitmap, cliprect, 1);
306   draw_sprites(machine(), bitmap, cliprect, 1);
307307
308308   return 0;
309309}
trunk/src/mame/video/rpunch.c
r17988r17989
271271   effbins = (m_bins > m_gins) ? m_gins : m_bins;
272272
273273   m_background[0]->draw(bitmap, cliprect, 0,0);
274   draw_sprites(screen.machine(), bitmap, cliprect, 0, effbins);
274   draw_sprites(machine(), bitmap, cliprect, 0, effbins);
275275   m_background[1]->draw(bitmap, cliprect, 0,0);
276   draw_sprites(screen.machine(), bitmap, cliprect, effbins, m_gins);
276   draw_sprites(machine(), bitmap, cliprect, effbins, m_gins);
277277   if (m_bitmapram)
278      draw_bitmap(screen.machine(), bitmap, cliprect);
278      draw_bitmap(machine(), bitmap, cliprect);
279279   return 0;
280280}
trunk/src/mame/video/cloud9.c
r17988r17989
245245{
246246   UINT8 *spriteaddr = m_spriteram;
247247   int flip = m_video_control[5] ? 0xff : 0x00;   /* PLAYER2 */
248   pen_t black = get_black_pen(screen.machine());
248   pen_t black = get_black_pen(machine());
249249   int x, y, offs;
250250
251251   /* draw the sprites */
r17988r17989
260260         int which = spriteaddr[offs + 0x20];
261261         int color = 0;
262262
263         drawgfx_transpen(m_spritebitmap, cliprect, screen.machine().gfx[0], which, color, xflip, yflip, x, y, 0);
263         drawgfx_transpen(m_spritebitmap, cliprect, machine().gfx[0], which, color, xflip, yflip, x, y, 0);
264264         if (x >= 256 - 16)
265            drawgfx_transpen(m_spritebitmap, cliprect, screen.machine().gfx[0], which, color, xflip, yflip, x - 256, y, 0);
265            drawgfx_transpen(m_spritebitmap, cliprect, machine().gfx[0], which, color, xflip, yflip, x - 256, y, 0);
266266      }
267267
268268   /* draw the bitmap to the screen, looping over Y */
trunk/src/mame/video/changela.c
r17988r17989
727727   copybitmap_trans(bitmap, m_obj0_bitmap,  0, 0, 0, 0, cliprect, 0);
728728   copybitmap_trans(bitmap, m_tree0_bitmap, 0, 0, 0, 0, cliprect, 0);
729729   copybitmap_trans(bitmap, m_tree1_bitmap, 0, 0, 0, 0, cliprect, 0);
730   draw_obj1(screen.machine(), bitmap);
730   draw_obj1(machine(), bitmap);
731731
732732   return 0;
733733}
trunk/src/mame/video/asuka.c
r17988r17989
2828   layer[1] = layer[0] ^ 1;
2929   layer[2] = 2;
3030
31   screen.machine().priority_bitmap.fill(0, cliprect);
31   machine().priority_bitmap.fill(0, cliprect);
3232
3333   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
3434   bitmap.fill(0, cliprect);
r17988r17989
5353   layer[1] = layer[0] ^ 1;
5454   layer[2] = 2;
5555
56   screen.machine().priority_bitmap.fill(0, cliprect);
56   machine().priority_bitmap.fill(0, cliprect);
5757
5858   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
5959   bitmap.fill(0, cliprect);
trunk/src/mame/video/triplhnt.c
r17988r17989
105105
106106UINT32 triplhnt_state::screen_update_triplhnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
107107{
108   device_t *discrete = screen.machine().device("discrete");
108   device_t *discrete = machine().device("discrete");
109109
110110   m_bg_tilemap->mark_all_dirty();
111111
112112   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
113113
114   draw_sprites(screen.machine(), bitmap, cliprect);
114   draw_sprites(machine(), bitmap, cliprect);
115115
116   address_space &space = screen.machine().driver_data()->generic_space();
116   address_space &space = machine().driver_data()->generic_space();
117117   discrete_sound_w(discrete, space, TRIPLHNT_BEAR_ROAR_DATA, m_playfield_ram[0xfa] & 15);
118118   discrete_sound_w(discrete, space, TRIPLHNT_SHOT_DATA, m_playfield_ram[0xfc] & 15);
119119   return 0;
trunk/src/mame/video/pooyan.c
r17988r17989
193193{
194194
195195   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
196   draw_sprites(screen.machine(), bitmap, cliprect);
196   draw_sprites(machine(), bitmap, cliprect);
197197   return 0;
198198}
trunk/src/mame/video/sidepckt.c
r17988r17989
141141UINT32 sidepckt_state::screen_update_sidepckt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
142142{
143143   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
144   draw_sprites(screen.machine(), bitmap,cliprect);
144   draw_sprites(machine(), bitmap,cliprect);
145145   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
146146   return 0;
147147}
trunk/src/mame/video/rollerg.c
r17988r17989
6262{
6363   int bg_colorbase = 16;
6464
65   screen.machine().priority_bitmap.fill(0, cliprect);
65   machine().priority_bitmap.fill(0, cliprect);
6666   bitmap.fill(16 * bg_colorbase, cliprect);
6767   k051316_zoom_draw(m_k051316, bitmap, cliprect, 0, 1);
6868   k053245_sprites_draw(m_k053244, bitmap, cliprect);
trunk/src/mame/video/wolfpack.c
r17988r17989
248248   if (m_ship_size & 0x40) color += 0x3a;
249249   if (m_ship_size & 0x80) color += 0x48;
250250
251   colortable_palette_set_color(screen.machine().colortable, 3, MAKE_RGB(color,color,color));
252   colortable_palette_set_color(screen.machine().colortable, 7, MAKE_RGB(color < 0xb8 ? color + 0x48 : 0xff,
251   colortable_palette_set_color(machine().colortable, 3, MAKE_RGB(color,color,color));
252   colortable_palette_set_color(machine().colortable, 7, MAKE_RGB(color < 0xb8 ? color + 0x48 : 0xff,
253253                                                        color < 0xb8 ? color + 0x48 : 0xff,
254254                                                        color < 0xb8 ? color + 0x48 : 0xff));
255255
r17988r17989
261261         int code = m_alpha_num_ram[32 * i + j];
262262
263263         drawgfx_opaque(bitmap, cliprect,
264            screen.machine().gfx[0],
264            machine().gfx[0],
265265            code,
266266            m_video_invert,
267267            0, 0,
r17988r17989
269269            192 + 8 * i);
270270      }
271271
272   draw_pt(screen.machine(), bitmap, cliprect);
273   draw_ship(screen.machine(), bitmap, cliprect);
274   draw_torpedo(screen.machine(), bitmap, cliprect);
275   draw_water(screen.machine().colortable, bitmap, cliprect);
272   draw_pt(machine(), bitmap, cliprect);
273   draw_ship(machine(), bitmap, cliprect);
274   draw_torpedo(machine(), bitmap, cliprect);
275   draw_water(machine().colortable, bitmap, cliprect);
276276   return 0;
277277}
278278
r17988r17989
288288
289289      m_helper.fill(0);
290290
291      draw_ship(screen.machine(), m_helper, m_helper.cliprect());
291      draw_ship(machine(), m_helper, m_helper.cliprect());
292292
293293      for (y = 128; y < 224 - m_torpedo_v; y++)
294294      {
trunk/src/mame/video/pirates.c
r17988r17989
106106   m_fg_tilemap->set_scrollx(0,m_scroll[0]);
107107   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
108108   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
109   draw_sprites(screen.machine(),bitmap,cliprect);
109   draw_sprites(machine(),bitmap,cliprect);
110110   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
111111   return 0;
112112}
trunk/src/mame/video/tankbatt.c
r17988r17989
102102UINT32 tankbatt_state::screen_update_tankbatt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
103103{
104104   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
105   draw_bullets(screen.machine(), bitmap, cliprect);
105   draw_bullets(machine(), bitmap, cliprect);
106106   return 0;
107107}
trunk/src/mame/video/exerion.c
r17988r17989
353353   int sx, sy, offs, i;
354354
355355   /* draw background */
356   draw_background(screen.machine(), bitmap, cliprect);
356   draw_background(machine(), bitmap, cliprect);
357357
358358   /* draw sprites */
359359   for (i = 0; i < m_spriteram.bytes(); i += 4)
r17988r17989
370370      int code2 = code;
371371
372372      int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (m_sprite_palette * 16);
373      gfx_element *gfx = doubled ? screen.machine().gfx[2] : screen.machine().gfx[1];
373      gfx_element *gfx = doubled ? machine().gfx[2] : machine().gfx[1];
374374
375375      if (m_cocktail_flip)
376376      {
r17988r17989
389389            code &= ~0x10, code2 |= 0x10;
390390
391391         drawgfx_transmask(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height(),
392                 colortable_get_transpen_mask(screen.machine().colortable, gfx, color, 0x10));
392                 colortable_get_transpen_mask(machine().colortable, gfx, color, 0x10));
393393      }
394394
395395      drawgfx_transmask(bitmap, cliprect, gfx, code, color, xflip, yflip, x, y,
396             colortable_get_transpen_mask(screen.machine().colortable, gfx, color, 0x10));
396             colortable_get_transpen_mask(machine().colortable, gfx, color, 0x10));
397397
398398      if (doubled) i += 4;
399399   }
r17988r17989
406406         int y = m_cocktail_flip ? (31*8 - 8*sy) : 8*sy;
407407
408408         offs = sx + sy * 64;
409         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
409         drawgfx_transpen(bitmap, cliprect, machine().gfx[0],
410410            m_videoram[offs] + 256 * m_char_bank,
411411            ((m_videoram[offs] & 0xf0) >> 4) + m_char_palette * 16,
412412            m_cocktail_flip, m_cocktail_flip, x, y, 0);
trunk/src/mame/video/wrally.c
r17988r17989
196196   m_pant[1]->draw(bitmap, cliprect, TILEMAP_DRAW_CATEGORY(1),0);
197197   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_CATEGORY(1) | TILEMAP_DRAW_LAYER0,0);
198198
199   draw_sprites(screen.machine(),bitmap,cliprect,0);
199   draw_sprites(machine(),bitmap,cliprect,0);
200200
201201   m_pant[0]->draw(bitmap, cliprect, TILEMAP_DRAW_CATEGORY(1) | TILEMAP_DRAW_LAYER1,0);
202202
203   draw_sprites(screen.machine(),bitmap,cliprect,1);
203   draw_sprites(machine(),bitmap,cliprect,1);
204204
205205   return 0;
206206}
trunk/src/mame/video/segas18.c
r17988r17989
127127void segas18_state::draw_vdp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority)
128128{
129129
130   bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
130   bitmap_ind8 &priority_bitmap = machine().priority_bitmap;
131131   for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
132132   {
133133   //  UINT16 *src = vdp->m_render_line; // can't use this because we're not in RGB32, which we'll need to be if there are palette effects
trunk/src/mame/video/crospang.c
r17988r17989
119119{
120120   m_bg_layer->draw(bitmap, cliprect, 0, 0);
121121   m_fg_layer->draw(bitmap, cliprect, 0, 0);
122   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
122   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
123123   return 0;
124124}
trunk/src/mame/video/subs.c
r17988r17989
4343   UINT8 *spriteram = m_spriteram;
4444   int offs;
4545
46   device_t *discrete = screen.machine().device("discrete");
46   device_t *discrete = machine().device("discrete");
4747
4848   /* for every character in the Video RAM, check if it has been modified */
4949   /* since last time and update it accordingly. */
r17988r17989
7676
7777      /* draw the left screen */
7878      if ((left_enable || left_sonar_window) && (!right_sonar_window))
79         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
79         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
8080               charcode, 1,
8181               0,0,sx,sy);
8282      else
83         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
83         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
8484               0, 1,
8585               0,0,sx,sy);
8686   }
r17988r17989
106106
107107      /* left screen - special check for drawing right screen's sub */
108108      if ((offs!=0) || (sub_enable))
109         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
109         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
110110               charcode + 32 * prom_set,
111111               0,
112112               0,0,sx,sy,0);
113113   }
114114
115115   /* Update sound */
116   address_space &space = screen.machine().driver_data()->generic_space();
116   address_space &space = machine().driver_data()->generic_space();
117117   discrete_sound_w(discrete, space, SUBS_LAUNCH_DATA, spriteram[5] & 0x0f);   // Launch data
118118   discrete_sound_w(discrete, space, SUBS_CRASH_DATA, spriteram[5] >> 4);      // Crash/explode data
119119   return 0;
r17988r17989
156156
157157      /* draw the right screen */
158158      if ((right_enable || right_sonar_window) && (!left_sonar_window))
159         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
159         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
160160               charcode, 0,
161161               0,0,sx,sy);
162162      else
163         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],
163         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],
164164               0, 0,
165165               0,0,sx,sy);
166166   }
r17988r17989
185185      charcode = (charcode >> 3) & 0x1F;
186186
187187      if ((offs!=1) || (sub_enable))
188         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
188         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
189189               charcode + 32 * prom_set,
190190               0,
191191               0,0,sx,sy,0);
trunk/src/mame/video/darkmist.c
r17988r17989
133133
134134#define DM_GETSCROLL(n) (((m_scroll[(n)]<<1)&0xff) + ((m_scroll[(n)]&0x80)?1:0) +( ((m_scroll[(n)-1]<<4) | (m_scroll[(n)-1]<<12) )&0xff00))
135135
136   set_pens(screen.machine());
136   set_pens(machine());
137137
138138   m_bgtilemap->set_scrollx(0, DM_GETSCROLL(0x2));
139139   m_bgtilemap->set_scrolly(0, DM_GETSCROLL(0x6));
140140   m_fgtilemap->set_scrollx(0, DM_GETSCROLL(0xa));
141141   m_fgtilemap->set_scrolly(0, DM_GETSCROLL(0xe));
142142
143   bitmap.fill(get_black_pen(screen.machine()), cliprect);
143   bitmap.fill(get_black_pen(machine()), cliprect);
144144
145145   if(m_hw & DISPLAY_BG)
146146      m_bgtilemap->draw(bitmap, cliprect, 0,0);
r17988r17989
175175         palette=((spriteram[i+1])>>1)&0xf;
176176
177177         if(spriteram[i+1]&0x1)
178            palette=screen.machine().rand()&15;
178            palette=machine().rand()&15;
179179
180180         palette+=32;
181181
182182         drawgfx_transpen(
183183            bitmap,cliprect,
184            screen.machine().gfx[2],
184            machine().gfx[2],
185185            tile,
186186            palette,
187187            fx,fy,
trunk/src/mame/video/ajax.c
r17988r17989
9191
9292   k052109_tilemap_update(m_k052109);
9393
94   screen.machine().priority_bitmap.fill(0, cliprect);
94   machine().priority_bitmap.fill(0, cliprect);
9595
96   bitmap.fill(get_black_pen(screen.machine()), cliprect);
96   bitmap.fill(get_black_pen(machine()), cliprect);
9797   k052109_tilemap_draw(m_k052109, bitmap, cliprect, 2, 0, 1);
9898   if (m_priority)
9999   {
trunk/src/mame/video/funybubl.c
r17988r17989
7777   int x, y, offs;
7878   offs = 0;
7979
80   bitmap.fill(get_black_pen(screen.machine()), cliprect);
80   bitmap.fill(get_black_pen(machine()), cliprect);
8181
8282   /* tilemap .. convert it .. banking makes it slightly more annoying but still easy */
8383   for (y = 0; y < 32; y++)
r17988r17989
8787         int data;
8888
8989         data = m_banked_vram[offs] | (m_banked_vram[offs + 1] << 8);
90         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], data & 0x7fff, (data & 0x8000) ? 2 : 1, 0, 0, x*8, y*8, 0);
90         drawgfx_transpen(bitmap, cliprect, machine().gfx[0], data & 0x7fff, (data & 0x8000) ? 2 : 1, 0, 0, x*8, y*8, 0);
9191         offs += 2;
9292      }
9393   }
9494
95   draw_sprites(screen.machine(), bitmap, cliprect);
95   draw_sprites(machine(), bitmap, cliprect);
9696
9797#if 0
98   if ( screen.machine().input().code_pressed_once(KEYCODE_W) )
98   if ( machine().input().code_pressed_once(KEYCODE_W) )
9999   {
100100      FILE *fp;
101101
trunk/src/mame/video/shisen.c
r17988r17989
6363   // on Irem boards, screen flip is handled in both hardware and software.
6464   // this game doesn't have cocktail mode so if there's software control we don't
6565   // know where it is mapped.
66   flip_screen_set(~screen.machine().root_device().ioport("DSW2")->read() & 1);
66   flip_screen_set(~machine().root_device().ioport("DSW2")->read() & 1);
6767
6868
6969   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/video/tutankhm.c
r17988r17989
6464   pen_t pens[NUM_PENS];
6565   int x, y;
6666
67   get_pens(screen.machine(), pens);
67   get_pens(machine(), pens);
6868
6969   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
7070   {
trunk/src/mame/video/nmk16.c
r17988r17989
990990   nmk16_draw_sprites_flipsupported(machine, bitmap,cliprect,0);
991991}
992992
993UINT32 nmk16_state::screen_update_afega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){   video_update(screen.machine(),bitmap,cliprect, 1, -0x100,+0x000, 0x0001);   return 0; }
994UINT32 nmk16_state::screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){   video_update(screen.machine(),bitmap,cliprect, 0, -0x100,+0x000, 0x0001);   return 0; }   // no flipscreen support, I really would confirmation from the schematics
995UINT32 nmk16_state::screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){   video_update(screen.machine(),bitmap,cliprect, 0, +0x000,+0x100, 0x0001);   return 0; }
996UINT32 nmk16_state::screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){   redhawki_video_update(screen.machine(),bitmap,cliprect); return 0;} // strange scroll regs
993UINT32 nmk16_state::screen_update_afega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){   video_update(machine(),bitmap,cliprect, 1, -0x100,+0x000, 0x0001);   return 0; }
994UINT32 nmk16_state::screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){   video_update(machine(),bitmap,cliprect, 0, -0x100,+0x000, 0x0001);   return 0; }   // no flipscreen support, I really would confirmation from the schematics
995UINT32 nmk16_state::screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){   video_update(machine(),bitmap,cliprect, 0, +0x000,+0x100, 0x0001);   return 0; }
996UINT32 nmk16_state::screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){   redhawki_video_update(machine(),bitmap,cliprect); return 0;} // strange scroll regs
997997
998998UINT32 nmk16_state::screen_update_firehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
999999{
r17988r17989
10021002
10031003   m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
10041004
1005   nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,3);
1006   nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,2);
1007   nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,1);
1008   nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,0);
1005   nmk16_draw_sprites_flipsupported(machine(), bitmap,cliprect,3);
1006   nmk16_draw_sprites_flipsupported(machine(), bitmap,cliprect,2);
1007   nmk16_draw_sprites_flipsupported(machine(), bitmap,cliprect,1);
1008   nmk16_draw_sprites_flipsupported(machine(), bitmap,cliprect,0);
10091009
10101010   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
10111011   return 0;
trunk/src/mame/video/m10.c
r17988r17989
150150      int y;
151151
152152      for (y = IREMM10_VBEND; y < IREMM10_VBSTART; y++)
153         plot_pixel_m10(screen.machine(), bitmap, 16, y, 1);
153         plot_pixel_m10(machine(), bitmap, 16, y, 1);
154154   }
155155
156156   for (offs = m_videoram.bytes() - 1; offs >= 0; offs--)
trunk/src/mame/video/nitedrvr.c
r17988r17989
7373{
7474
7575   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
76   draw_roadway(screen.machine(), bitmap);
76   draw_roadway(machine(), bitmap);
7777   return 0;
7878}
trunk/src/mame/drivers/bfcobra.c
r17988r17989
412412
413413         if ( ( m_videomode & 0x81 ) == 1 || (m_videomode & 0x80 && pen & 0x80) )
414414         {
415            *dest++ = screen.machine().pens[hirescol[pen & 0x0f]];
416            *dest++ = screen.machine().pens[hirescol[(pen >> 4) & 0x0f]];
415            *dest++ = machine().pens[hirescol[pen & 0x0f]];
416            *dest++ = machine().pens[hirescol[(pen >> 4) & 0x0f]];
417417         }
418418         else
419419         {
420            *dest++ = screen.machine().pens[lorescol[pen]];
421            *dest++ = screen.machine().pens[lorescol[pen]];
420            *dest++ = machine().pens[lorescol[pen]];
421            *dest++ = machine().pens[lorescol[pen]];
422422         }
423423      }
424424   }
trunk/src/mame/drivers/mgolf.c
r17988r17989
7373   /* draw sprites */
7474   for (i = 0; i < 2; i++)
7575   {
76      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
76      drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
7777         m_video_ram[0x399 + 4 * i],
7878         i,
7979         0, 0,
8080         m_video_ram[0x390 + 2 * i] - 7,
8181         m_video_ram[0x398 + 4 * i] - 16, 0);
8282
83      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
83      drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
8484         m_video_ram[0x39b + 4 * i],
8585         i,
8686         0, 0,
trunk/src/mame/drivers/expro02.c
r17988r17989
199199
200200UINT32 expro02_state::screen_update_galsnew(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
201201{
202//  kaneko16_fill_bitmap(screen.machine(),bitmap,cliprect);
202//  kaneko16_fill_bitmap(machine(),bitmap,cliprect);
203203   int y,x;
204204   int count;
205205
r17988r17989
238238
239239   int i;
240240
241   screen.machine().priority_bitmap.fill(0, cliprect);
241   machine().priority_bitmap.fill(0, cliprect);
242242
243243   m_view2_0->kaneko16_prepare(bitmap, cliprect);
244244
r17988r17989
247247      m_view2_0->render_tilemap_chip(bitmap,cliprect,i);
248248   }
249249
250   m_kaneko_spr->kaneko16_render_sprites(screen.machine(),bitmap,cliprect, m_spriteram, m_spriteram.bytes());
250   m_kaneko_spr->kaneko16_render_sprites(machine(),bitmap,cliprect, m_spriteram, m_spriteram.bytes());
251251   return 0;
252252}
253253
trunk/src/mame/drivers/magicard.c
r17988r17989
415415
416416UINT32 magicard_state::screen_update_magicard(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
417417{
418   magicard_state *state = screen.machine().driver_data<magicard_state>();
418   magicard_state *state = machine().driver_data<magicard_state>();
419419   int x,y;
420420   UINT32 count;
421421
422   bitmap.fill(get_black_pen(screen.machine()), cliprect); //TODO
422   bitmap.fill(get_black_pen(machine()), cliprect); //TODO
423423
424424   if(!(SCC_DE_VREG)) //display enable
425425      return 0;
r17988r17989
437437            color = ((m_magicram[count]) & 0x000f)>>0;
438438
439439            if(cliprect.contains((x*4)+3, y))
440               bitmap.pix32(y, (x*4)+3) = screen.machine().pens[color];
440               bitmap.pix32(y, (x*4)+3) = machine().pens[color];
441441
442442            color = ((m_magicram[count]) & 0x00f0)>>4;
443443
444444            if(cliprect.contains((x*4)+2, y))
445               bitmap.pix32(y, (x*4)+2) = screen.machine().pens[color];
445               bitmap.pix32(y, (x*4)+2) = machine().pens[color];
446446
447447            color = ((m_magicram[count]) & 0x0f00)>>8;
448448
449449            if(cliprect.contains((x*4)+1, y))
450               bitmap.pix32(y, (x*4)+1) = screen.machine().pens[color];
450               bitmap.pix32(y, (x*4)+1) = machine().pens[color];
451451
452452            color = ((m_magicram[count]) & 0xf000)>>12;
453453
454454            if(cliprect.contains((x*4)+0, y))
455               bitmap.pix32(y, (x*4)+0) = screen.machine().pens[color];
455               bitmap.pix32(y, (x*4)+0) = machine().pens[color];
456456
457457            count++;
458458         }
r17988r17989
469469            color = ((m_magicram[count]) & 0x00ff)>>0;
470470
471471            if(cliprect.contains((x*2)+1, y))
472               bitmap.pix32(y, (x*2)+1) = screen.machine().pens[color];
472               bitmap.pix32(y, (x*2)+1) = machine().pens[color];
473473
474474            color = ((m_magicram[count]) & 0xff00)>>8;
475475
476476            if(cliprect.contains((x*2)+0, y))
477               bitmap.pix32(y, (x*2)+0) = screen.machine().pens[color];
477               bitmap.pix32(y, (x*2)+0) = machine().pens[color];
478478
479479            count++;
480480         }
trunk/src/mame/drivers/murogem.c
r17988r17989
217217         int tileno = m_videoram[count]&0x3f;
218218         int attr = m_videoram[count+0x400]&0x0f;
219219
220         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],tileno,attr,0,0,xx*8,yy*8,0);
220         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],tileno,attr,0,0,xx*8,yy*8,0);
221221
222222         count++;
223223
trunk/src/mame/drivers/snowbros.c
r17988r17989
8484
8585UINT32 snowbros_state::screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8686{
87   device_t *pandora = screen.machine().device("pandora");
87   device_t *pandora = machine().device("pandora");
8888
8989   /* This clears & redraws the entire screen each pass */
9090   bitmap.fill(0xf0, cliprect);
r17988r17989
9898   // rising edge
9999   if (state)
100100   {
101      device_t *pandora = screen.machine().device("pandora");
101      device_t *pandora = machine().device("pandora");
102102      pandora_eof(pandora);
103103   }
104104}
trunk/src/mame/drivers/cntsteer.c
r17988r17989
284284{
285285
286286   if (m_disable_roz)
287      bitmap.fill(screen.machine().pens[8 * m_bg_color_bank], cliprect);
287      bitmap.fill(machine().pens[8 * m_bg_color_bank], cliprect);
288288   else
289289   {
290290      int p1, p2, p3, p4;
r17988r17989
324324                  0, 0);
325325   }
326326
327   zerotrgt_draw_sprites(screen.machine(), bitmap, cliprect);
327   zerotrgt_draw_sprites(machine(), bitmap, cliprect);
328328   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
329329
330330   return 0;
r17988r17989
334334{
335335
336336   if (m_disable_roz)
337      bitmap.fill(screen.machine().pens[8 * m_bg_color_bank], cliprect);
337      bitmap.fill(machine().pens[8 * m_bg_color_bank], cliprect);
338338   else
339339   {
340340      int p1, p2, p3, p4;
r17988r17989
372372                  0, 0);
373373   }
374374
375   cntsteer_draw_sprites(screen.machine(), bitmap, cliprect);
375   cntsteer_draw_sprites(machine(), bitmap, cliprect);
376376   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
377377
378378   return 0;
trunk/src/mame/drivers/dblewing.c
r17988r17989
111111   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
112112
113113   bitmap.fill(0, cliprect); /* not Confirmed */
114   screen.machine().priority_bitmap.fill(0);
114   machine().priority_bitmap.fill(0);
115115
116116   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
117117   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
118   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
118   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
119119   return 0;
120120}
121121
trunk/src/mame/drivers/hornet.c
r17988r17989
424424
425425UINT32 hornet_state::screen_update_hornet(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
426426{
427   device_t *voodoo = screen.machine().device("voodoo0");
428   device_t *k037122 = screen.machine().device("k037122_1");
427   device_t *voodoo = machine().device("voodoo0");
428   device_t *k037122 = machine().device("k037122_1");
429429
430430   voodoo_update(voodoo, bitmap, cliprect);
431431
r17988r17989
440440{
441441   if (strcmp(screen.tag(), ":lscreen") == 0)
442442   {
443      device_t *k037122 = screen.machine().device("k037122_1");
444      device_t *voodoo = screen.machine().device("voodoo0");
443      device_t *k037122 = machine().device("k037122_1");
444      device_t *voodoo = machine().device("voodoo0");
445445      voodoo_update(voodoo, bitmap, cliprect);
446446
447447      /* TODO: tilemaps per screen */
r17988r17989
449449   }
450450   else if (strcmp(screen.tag(), ":rscreen") == 0)
451451   {
452      device_t *k037122 = screen.machine().device("k037122_2");
453      device_t *voodoo = screen.machine().device("voodoo1");
452      device_t *k037122 = machine().device("k037122_2");
453      device_t *voodoo = machine().device("voodoo1");
454454      voodoo_update(voodoo, bitmap, cliprect);
455455
456456      /* TODO: tilemaps per screen */
trunk/src/mame/drivers/discoboy.c
r17988r17989
159159      g = ((pal >> 4) & 0xf) << 4;
160160      r = ((pal >> 8) & 0xf) << 4;
161161
162      palette_set_color(screen.machine(), i / 2, MAKE_RGB(r, g, b));
162      palette_set_color(machine(), i / 2, MAKE_RGB(r, g, b));
163163   }
164164
165165   for (i = 0; i < 0x800; i += 2)
r17988r17989
172172      g = ((pal >> 4) & 0xf) << 4;
173173      r = ((pal >> 8) & 0xf) << 4;
174174
175      palette_set_color(screen.machine(), (i / 2) + 0x400, MAKE_RGB(r, g, b));
175      palette_set_color(machine(), (i / 2) + 0x400, MAKE_RGB(r, g, b));
176176   }
177177
178178   bitmap.fill(0x3ff, cliprect);
r17988r17989
191191               tileno = 0x2000 + (tileno & 0x1fff) + 0x0000;
192192         }
193193
194         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1], tileno, m_ram_att[count / 2], 0, 0, x*8, y*8);
194         drawgfx_opaque(bitmap, cliprect, machine().gfx[1], tileno, m_ram_att[count / 2], 0, 0, x*8, y*8);
195195         count += 2;
196196      }
197197   }
198198
199   draw_sprites(screen.machine(), bitmap, cliprect);
199   draw_sprites(machine(), bitmap, cliprect);
200200
201201   return 0;
202202}
trunk/src/mame/drivers/mediagx.c
r17988r17989
384384{
385385   bitmap.fill(0, cliprect);
386386
387   draw_framebuffer(screen.machine(), bitmap, cliprect);
387   draw_framebuffer(machine(), bitmap, cliprect);
388388
389389   if (m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1)   // don't show MDA text screen on 16-bit mode. this is basically a hack
390390   {
391      draw_cga(screen.machine(), bitmap, cliprect);
391      draw_cga(machine(), bitmap, cliprect);
392392   }
393393   return 0;
394394}
trunk/src/mame/drivers/summit.c
r17988r17989
4242
4343UINT32 summit_state::screen_update_summit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
4444{
45   gfx_element *gfx = screen.machine().gfx[0];
45   gfx_element *gfx = machine().gfx[0];
4646   int count = 0x0000;
4747
4848   int y,x;
trunk/src/mame/drivers/mwarr.c
r17988r17989
485485{
486486   int i;
487487
488   screen.machine().priority_bitmap.fill(0, cliprect);
488   machine().priority_bitmap.fill(0, cliprect);
489489
490490   if (BIT(m_vidattrram[6], 0))
491491   {
r17988r17989
531531   m_mlow_tilemap->draw(bitmap, cliprect, 0, 0x02);
532532   m_mhigh_tilemap->draw(bitmap, cliprect, 0, 0x04);
533533   m_tx_tilemap->draw(bitmap, cliprect, 0, 0x10);
534   draw_sprites(screen.machine(), bitmap, cliprect);
534   draw_sprites(machine(), bitmap, cliprect);
535535   return 0;
536536}
537537
trunk/src/mame/drivers/vroulet.c
r17988r17989
119119UINT32 vroulet_state::screen_update_vroulet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
120120{
121121   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
122   drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], 0x320, 1, 0, 0,
122   drawgfx_transpen(bitmap, cliprect, machine().gfx[0], 0x320, 1, 0, 0,
123123      m_ball[1], m_ball[0] - 12, 0);
124124   return 0;
125125}
trunk/src/mame/drivers/coinmvga.c
r17988r17989
252252
253253UINT32 coinmvga_state::screen_update_coinmvga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
254254{
255   gfx_element *gfx = screen.machine().gfx[0];
255   gfx_element *gfx = machine().gfx[0];
256256   int count = 0x04000/2;
257257
258258   int y,x;
trunk/src/mame/drivers/twins.c
r17988r17989
124124   int i;
125125   static const int xxx=320,yyy=204;
126126
127   bitmap.fill(get_black_pen(screen.machine()));
127   bitmap.fill(get_black_pen(machine()));
128128
129129   for (i=0;i<0x100;i++)
130130   {
r17988r17989
140140      b = (dat>>10) & 0x1f;
141141      b = BITSWAP8(b,7,6,5,0,1,2,3,4);
142142
143      palette_set_color_rgb(screen.machine(),i, pal5bit(r),pal5bit(g),pal5bit(b));
143      palette_set_color_rgb(machine(),i, pal5bit(r),pal5bit(g),pal5bit(b));
144144   }
145145
146146   count=0;
r17988r17989
229229   int i;
230230   static const int xxx=320,yyy=204;
231231
232   bitmap.fill(get_black_pen(screen.machine()));
232   bitmap.fill(get_black_pen(machine()));
233233
234234   for (i=0;i<0x1000-3;i+=3)
235235   {
r17988r17989
238238      g = m_pal[i+1];
239239      b = m_pal[i+2];
240240
241      palette_set_color_rgb(screen.machine(),i/3, pal6bit(r), pal6bit(g), pal6bit(b));
241      palette_set_color_rgb(machine(),i/3, pal6bit(r), pal6bit(g), pal6bit(b));
242242   }
243243
244244   count=0;
trunk/src/mame/drivers/galpani3.c
r17988r17989
195195   UINT16* src1;
196196   UINT32* dst;
197197   UINT16 pixdata1;
198   const pen_t *paldata = screen.machine().pens;
198   const pen_t *paldata = machine().pens;
199199
200200   bitmap.fill(0x0000, cliprect);
201201
r17988r17989
259259                  UINT16 pen = dat1+0x4000;
260260                  UINT32 pal = paldata[pen];
261261
262                  if (gp3_is_alpha_pen(screen.machine(), pen))
262                  if (gp3_is_alpha_pen(machine(), pen))
263263                  {
264264                     int r,g,b;
265265                     r = (pal & 0x00ff0000)>>16;
r17988r17989
287287                  UINT16 pen = dat2+0x4100;
288288                  UINT32 pal = paldata[pen];
289289
290                  if (gp3_is_alpha_pen(screen.machine(), pen))
290                  if (gp3_is_alpha_pen(machine(), pen))
291291                  {
292292                     int r,g,b;
293293                     r = (pal & 0x00ff0000)>>16;
r17988r17989
319319            /*
320320                else if (pridat==0x2f) // area outside of the girl
321321                {
322                    //dst[0] = screen.machine().rand()&0x3fff;
322                    //dst[0] = machine().rand()&0x3fff;
323323                }
324324
325325                else if (pridat==0x00) // the initial line / box that gets drawn
326326                {
327                    //dst[0] = screen.machine().rand()&0x3fff;
327                    //dst[0] = machine().rand()&0x3fff;
328328                }
329329                else if (pridat==0x30) // during the 'gals boxes' on the intro
330330                {
331                    //dst[0] = screen.machine().rand()&0x3fff;
331                    //dst[0] = machine().rand()&0x3fff;
332332                }
333333                else if (pridat==0x0c) // 'nice' at end of level
334334                {
335                    //dst[0] = screen.machine().rand()&0x3fff;
335                    //dst[0] = machine().rand()&0x3fff;
336336                }
337337                else
338338                {
r17988r17989
346346
347347   m_sprite_bitmap_1.fill(0x0000, cliprect);
348348
349   m_spritegen->skns_draw_sprites(screen.machine(), m_sprite_bitmap_1, cliprect, &m_spriteram32[0], 0x4000, screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), m_spc_regs );
349   m_spritegen->skns_draw_sprites(machine(), m_sprite_bitmap_1, cliprect, &m_spriteram32[0], 0x4000, machine().root_device().memregion("gfx1")->base(), machine().root_device().memregion ("gfx1")->bytes(), m_spc_regs );
350350
351351   // ignoring priority bits for now..
352352   for (y=0;y<240;y++)
trunk/src/mame/drivers/itgambl2.c
r17988r17989
9090   int x,y,count;
9191   const UINT8 *blit_ram = memregion("gfx1")->base();
9292
93   if(screen.machine().input().code_pressed(KEYCODE_Z))
93   if(machine().input().code_pressed(KEYCODE_Z))
9494      m_test_x++;
9595
96   if(screen.machine().input().code_pressed(KEYCODE_X))
96   if(machine().input().code_pressed(KEYCODE_X))
9797      m_test_x--;
9898
99   if(screen.machine().input().code_pressed(KEYCODE_A))
99   if(machine().input().code_pressed(KEYCODE_A))
100100      m_test_y++;
101101
102   if(screen.machine().input().code_pressed(KEYCODE_S))
102   if(machine().input().code_pressed(KEYCODE_S))
103103      m_test_y--;
104104
105   if(screen.machine().input().code_pressed(KEYCODE_Q))
105   if(machine().input().code_pressed(KEYCODE_Q))
106106      m_start_offs+=0x200;
107107
108   if(screen.machine().input().code_pressed(KEYCODE_W))
108   if(machine().input().code_pressed(KEYCODE_W))
109109      m_start_offs-=0x200;
110110
111   if(screen.machine().input().code_pressed(KEYCODE_E))
111   if(machine().input().code_pressed(KEYCODE_E))
112112      m_start_offs++;
113113
114   if(screen.machine().input().code_pressed(KEYCODE_R))
114   if(machine().input().code_pressed(KEYCODE_R))
115115      m_start_offs--;
116116
117117   popmessage("%d %d %04x",m_test_x,m_test_y,m_start_offs);
118118
119   bitmap.fill(get_black_pen(screen.machine()), cliprect);
119   bitmap.fill(get_black_pen(machine()), cliprect);
120120
121121   count = (m_start_offs);
122122
r17988r17989
129129         color = (blit_ram[count] & 0xff)>>0;
130130
131131         if(cliprect.contains(x, y))
132            bitmap.pix32(y, x) = screen.machine().pens[color];
132            bitmap.pix32(y, x) = machine().pens[color];
133133
134134         count++;
135135      }
trunk/src/mame/drivers/bestleag.c
r17988r17989
185185
186186   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
187187   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
188   draw_sprites(screen.machine(),bitmap,cliprect);
188   draw_sprites(machine(),bitmap,cliprect);
189189   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
190190   return 0;
191191}
r17988r17989
201201
202202   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
203203   m_fg_tilemap->draw(bitmap, cliprect, 0,0);
204   draw_sprites(screen.machine(),bitmap,cliprect);
204   draw_sprites(machine(),bitmap,cliprect);
205205   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
206206   return 0;
207207}
trunk/src/mame/drivers/norautp.c
r17988r17989
569569
570570   count = 0;
571571
572   bitmap.fill(screen.machine().pens[0], cliprect); //black pen
572   bitmap.fill(machine().pens[0], cliprect); //black pen
573573
574574   for(y = 0; y < 8; y++)
575575   {
r17988r17989
581581            int tile = m_np_vram[count] & 0x3f;
582582            int colour = (m_np_vram[count] & 0xc0) >> 6;
583583
584            drawgfx_opaque(bitmap,cliprect, screen.machine().gfx[1], tile, colour, 0, 0, (x * 32) + 8, y * 32);
584            drawgfx_opaque(bitmap,cliprect, machine().gfx[1], tile, colour, 0, 0, (x * 32) + 8, y * 32);
585585
586586            count+=2;
587587         }
r17988r17989
593593            int tile = m_np_vram[count] & 0x3f;
594594            int colour = (m_np_vram[count] & 0xc0) >> 6;
595595
596            drawgfx_opaque(bitmap,cliprect, screen.machine().gfx[0], tile, colour, 0, 0, x * 16, y * 32);
596            drawgfx_opaque(bitmap,cliprect, machine().gfx[0], tile, colour, 0, 0, x * 16, y * 32);
597597
598598            count++;
599599         }
trunk/src/mame/drivers/ddenlovr.c
r17988r17989
13071307
13081308#if 0
13091309   static int base = 0x0;
1310   const UINT8 *gfx = screen.machine().root_device().memregion("blitter")->base();
1310   const UINT8 *gfx = machine().root_device().memregion("blitter")->base();
13111311   int next;
13121312   memset(m_ddenlovr_pixmap[0], 0, 512 * 512);
13131313   memset(m_ddenlovr_pixmap[1], 0, 512 * 512);
r17988r17989
13181318   m_ddenlovr_blit_pen_mode = 0;
13191319   m_ddenlovr_blit_y = 5;
13201320   m_ddenlovr_clip_ctrl = 0x0f;
1321   next = blit_draw(screen.machine(), base, 0);
1321   next = blit_draw(machine(), base, 0);
13221322   popmessage("GFX %06x", base);
1323   if (screen.machine().input().code_pressed(KEYCODE_S)) base = next;
1324   if (screen.machine().input().code_pressed_once(KEYCODE_X)) base = next;
1325   if (screen.machine().input().code_pressed(KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
1326   if (screen.machine().input().code_pressed(KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
1327   if (screen.machine().input().code_pressed_once(KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
1328   if (screen.machine().input().code_pressed_once(KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
1323   if (machine().input().code_pressed(KEYCODE_S)) base = next;
1324   if (machine().input().code_pressed_once(KEYCODE_X)) base = next;
1325   if (machine().input().code_pressed(KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
1326   if (machine().input().code_pressed(KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
1327   if (machine().input().code_pressed_once(KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
1328   if (machine().input().code_pressed_once(KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
13291329#endif
13301330
13311331   bitmap.fill(m_ddenlovr_bgcolor, cliprect);
13321332
13331333#ifdef MAME_DEBUG
1334   if (screen.machine().input().code_pressed(KEYCODE_Z))
1334   if (machine().input().code_pressed(KEYCODE_Z))
13351335   {
13361336      int mask, mask2;
13371337
13381338      mask = 0;
13391339
1340      if (screen.machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
1341      if (screen.machine().input().code_pressed(KEYCODE_W))   mask |= 2;
1342      if (screen.machine().input().code_pressed(KEYCODE_E))   mask |= 4;
1343      if (screen.machine().input().code_pressed(KEYCODE_R))   mask |= 8;
1340      if (machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
1341      if (machine().input().code_pressed(KEYCODE_W))   mask |= 2;
1342      if (machine().input().code_pressed(KEYCODE_E))   mask |= 4;
1343      if (machine().input().code_pressed(KEYCODE_R))   mask |= 8;
13441344
13451345      mask2 = 0;
13461346
13471347      if (m_extra_layers)
13481348      {
1349         if (screen.machine().input().code_pressed(KEYCODE_A))   mask2 |= 1;
1350         if (screen.machine().input().code_pressed(KEYCODE_S))   mask2 |= 2;
1351         if (screen.machine().input().code_pressed(KEYCODE_D))   mask2 |= 4;
1352         if (screen.machine().input().code_pressed(KEYCODE_F))   mask2 |= 8;
1349         if (machine().input().code_pressed(KEYCODE_A))   mask2 |= 1;
1350         if (machine().input().code_pressed(KEYCODE_S))   mask2 |= 2;
1351         if (machine().input().code_pressed(KEYCODE_D))   mask2 |= 4;
1352         if (machine().input().code_pressed(KEYCODE_F))   mask2 |= 8;
13531353      }
13541354
13551355      if (mask || mask2)
r17988r17989
13681368      pri = 0;
13691369   }
13701370
1371   copylayer(screen.machine(), bitmap, cliprect, order[pri][0]);
1372   copylayer(screen.machine(), bitmap, cliprect, order[pri][1]);
1373   copylayer(screen.machine(), bitmap, cliprect, order[pri][2]);
1374   copylayer(screen.machine(), bitmap, cliprect, order[pri][3]);
1371   copylayer(machine(), bitmap, cliprect, order[pri][0]);
1372   copylayer(machine(), bitmap, cliprect, order[pri][1]);
1373   copylayer(machine(), bitmap, cliprect, order[pri][2]);
1374   copylayer(machine(), bitmap, cliprect, order[pri][3]);
13751375
13761376   if (m_extra_layers)
13771377   {
r17988r17989
13831383         pri = 0;
13841384      }
13851385
1386      copylayer(screen.machine(), bitmap, cliprect, order[pri][0] + 4);
1387      copylayer(screen.machine(), bitmap, cliprect, order[pri][1] + 4);
1388      copylayer(screen.machine(), bitmap, cliprect, order[pri][2] + 4);
1389      copylayer(screen.machine(), bitmap, cliprect, order[pri][3] + 4);
1386      copylayer(machine(), bitmap, cliprect, order[pri][0] + 4);
1387      copylayer(machine(), bitmap, cliprect, order[pri][1] + 4);
1388      copylayer(machine(), bitmap, cliprect, order[pri][2] + 4);
1389      copylayer(machine(), bitmap, cliprect, order[pri][3] + 4);
13901390   }
13911391
13921392   m_ddenlovr_layer_enable = enab;
trunk/src/mame/drivers/viper.c
r17988r17989
351351
352352UINT32 viper_state::screen_update_viper(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
353353{
354   device_t *device = screen.machine().device("voodoo");
354   device_t *device = machine().device("voodoo");
355355   return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
356356}
357357
trunk/src/mame/drivers/pinkiri8.c
r17988r17989
205205UINT32 pinkiri8_state::screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
206206{
207207   int col_bank;
208   gfx_element *gfx = screen.machine().gfx[0];
208   gfx_element *gfx = machine().gfx[0];
209209
210210   /* update palette */
211211   for (int pen = 0; pen < 0x800 ; pen++)
r17988r17989
214214      int r = (val & 0x001f) >> 0;
215215      int g = (val & 0x03e0) >> 5;
216216      int b = (val & 0x7c00) >> 10;
217      palette_set_color_rgb(screen.machine(), pen, pal5bit(r), pal5bit(g), pal5bit(b));
217      palette_set_color_rgb(machine(), pen, pal5bit(r), pal5bit(g), pal5bit(b));
218218   }
219219
220220   int game_type_hack = 0;
221221
222   if (!strcmp(screen.machine().system().name,"janshi")) game_type_hack = 1;
222   if (!strcmp(machine().system().name,"janshi")) game_type_hack = 1;
223223
224   if ( screen.machine().input().code_pressed_once(KEYCODE_W) )
224   if ( machine().input().code_pressed_once(KEYCODE_W) )
225225   {
226226      int i;
227227      int count2;
r17988r17989
251251   //popmessage("%02x",m_janshi_crtc_regs[0x0a]);
252252   col_bank = (m_janshi_crtc_regs[0x0a] & 0x40) >> 6;
253253
254   bitmap.fill(get_black_pen(screen.machine()), cliprect);
254   bitmap.fill(get_black_pen(machine()), cliprect);
255255
256256   /* FIXME: color is a bit of a mystery */
257257   {
r17988r17989
325325
326326         if (bit)
327327         {
328            //col = screen.machine().rand();
328            //col = machine().rand();
329329            width = 2;
330330         }
331331         else
trunk/src/mame/drivers/chanbara.c
r17988r17989
212212
213213   m_bg2_tilemap->set_scrolly(0, m_scroll | (m_scrollhi << 8));
214214   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
215   draw_sprites(screen.machine(), bitmap, cliprect);
215   draw_sprites(machine(), bitmap, cliprect);
216216   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
217217   return 0;
218218}
trunk/src/mame/drivers/jantotsu.c
r17988r17989
169169               color |= (((m_bitmap[count + pen_i*0x2000]) >> (7 - i)) & 1) << pen_i;
170170
171171            if (cliprect.contains(x + i, y))
172               bitmap.pix32(y, x + i) = screen.machine().pens[color];
172               bitmap.pix32(y, x + i) = machine().pens[color];
173173         }
174174
175175         count++;
trunk/src/mame/drivers/highvdeo.c
r17988r17989
152152         color = ((m_blit_ram[count]) & 0x00ff)>>0;
153153
154154         if(cliprect.contains((x*2)+0, y))
155            bitmap.pix32(y, (x*2)+0) = screen.machine().pens[color];
155            bitmap.pix32(y, (x*2)+0) = machine().pens[color];
156156
157157         color = ((m_blit_ram[count]) & 0xff00)>>8;
158158
159159         if(cliprect.contains((x*2)+1, y))
160            bitmap.pix32(y, (x*2)+1) = screen.machine().pens[color];
160            bitmap.pix32(y, (x*2)+1) = machine().pens[color];
161161
162162         count++;
163163      }
trunk/src/mame/drivers/fcrash.c
r17988r17989
228228   layercontrol = m_cps_b_regs[0x20 / 2];
229229
230230   /* Get video memory base registers */
231   cps1_get_video_base(screen.machine());
231   cps1_get_video_base(machine());
232232
233233   /* Build palette */
234   fcrash_build_palette(screen.machine());
234   fcrash_build_palette(machine());
235235
236   fcrash_update_transmasks(screen.machine());
236   fcrash_update_transmasks(machine());
237237
238238   m_bg_tilemap[0]->set_scrollx(0, m_scroll1x - 62);
239239   m_bg_tilemap[0]->set_scrolly(0, m_scroll1y);
r17988r17989
270270   /* Blank screen */
271271   bitmap.fill(0xbff, cliprect);
272272
273   screen.machine().priority_bitmap.fill(0, cliprect);
273   machine().priority_bitmap.fill(0, cliprect);
274274   l0 = (layercontrol >> 0x06) & 03;
275275   l1 = (layercontrol >> 0x08) & 03;
276276   l2 = (layercontrol >> 0x0a) & 03;
277277   l3 = (layercontrol >> 0x0c) & 03;
278278
279   fcrash_render_layer(screen.machine(), bitmap, cliprect, l0, 0);
279   fcrash_render_layer(machine(), bitmap, cliprect, l0, 0);
280280
281281   if (l1 == 0)
282      fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l0);
282      fcrash_render_high_layer(machine(), bitmap, cliprect, l0);
283283
284   fcrash_render_layer(screen.machine(), bitmap, cliprect, l1, 0);
284   fcrash_render_layer(machine(), bitmap, cliprect, l1, 0);
285285
286286   if (l2 == 0)
287      fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l1);
287      fcrash_render_high_layer(machine(), bitmap, cliprect, l1);
288288
289   fcrash_render_layer(screen.machine(), bitmap, cliprect, l2, 0);
289   fcrash_render_layer(machine(), bitmap, cliprect, l2, 0);
290290
291291   if (l3 == 0)
292      fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l2);
292      fcrash_render_high_layer(machine(), bitmap, cliprect, l2);
293293
294   fcrash_render_layer(screen.machine(), bitmap, cliprect, l3, 0);
294   fcrash_render_layer(machine(), bitmap, cliprect, l3, 0);
295295
296296   return 0;
297297}
r17988r17989
307307   layercontrol = m_cps_b_regs[0x20 / 2];
308308
309309   /* Get video memory base registers */
310   cps1_get_video_base(screen.machine());
310   cps1_get_video_base(machine());
311311
312312   /* Build palette */
313   fcrash_build_palette(screen.machine());
313   fcrash_build_palette(machine());
314314
315   fcrash_update_transmasks(screen.machine());
315   fcrash_update_transmasks(machine());
316316
317317   m_bg_tilemap[0]->set_scrollx(0, m_scroll1x);
318318   m_bg_tilemap[0]->set_scrolly(0, m_scroll1y);
r17988r17989
350350   /* Blank screen */
351351   bitmap.fill(0xbff, cliprect);
352352
353   screen.machine().priority_bitmap.fill(0, cliprect);
353   machine().priority_bitmap.fill(0, cliprect);
354354   l0 = (layercontrol >> 0x06) & 03;
355355   l1 = (layercontrol >> 0x08) & 03;
356356   l2 = (layercontrol >> 0x0a) & 03;
357357   l3 = (layercontrol >> 0x0c) & 03;
358358
359   fcrash_render_layer(screen.machine(), bitmap, cliprect, l0, 0);
359   fcrash_render_layer(machine(), bitmap, cliprect, l0, 0);
360360
361361   if (l1 == 0)
362      fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l0);
362      fcrash_render_high_layer(machine(), bitmap, cliprect, l0);
363363
364   fcrash_render_layer(screen.machine(), bitmap, cliprect, l1, 0);
364   fcrash_render_layer(machine(), bitmap, cliprect, l1, 0);
365365
366366   if (l2 == 0)
367      fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l1);
367      fcrash_render_high_layer(machine(), bitmap, cliprect, l1);
368368
369   fcrash_render_layer(screen.machine(), bitmap, cliprect, l2, 0);
369   fcrash_render_layer(machine(), bitmap, cliprect, l2, 0);
370370
371371   if (l3 == 0)
372      fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l2);
372      fcrash_render_high_layer(machine(), bitmap, cliprect, l2);
373373
374   fcrash_render_layer(screen.machine(), bitmap, cliprect, l3, 0);
374   fcrash_render_layer(machine(), bitmap, cliprect, l3, 0);
375375
376376   return 0;
377377}
trunk/src/mame/drivers/majorpkr.c
r17988r17989
540540UINT32 majorpkr_state::screen_update_majorpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
541541{
542542
543   bitmap.fill(get_black_pen(screen.machine()), cliprect);
543   bitmap.fill(get_black_pen(machine()), cliprect);
544544
545545   rectangle custom_clip;
546546
trunk/src/mame/drivers/gstream.c
r17988r17989
526526      if (x & 0x8000) x -= 0x10000;
527527      if (y & 0x8000) y -= 0x10000;
528528
529      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],code,col,0,0,x-2,y,0);
529      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],code,col,0,0,x-2,y,0);
530530   }
531531
532532   return 0;
trunk/src/mame/drivers/igs017.c
r17988r17989
415415   int layers_ctrl = -1;
416416
417417#ifdef MAME_DEBUG
418   if (screen.machine().input().code_pressed(KEYCODE_Z))
418   if (machine().input().code_pressed(KEYCODE_Z))
419419   {
420420      int mask = 0;
421      if (screen.machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
422      if (screen.machine().input().code_pressed(KEYCODE_W))   mask |= 2;
423      if (screen.machine().input().code_pressed(KEYCODE_A))   mask |= 4;
421      if (machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
422      if (machine().input().code_pressed(KEYCODE_W))   mask |= 2;
423      if (machine().input().code_pressed(KEYCODE_A))   mask |= 4;
424424      if (mask != 0) layers_ctrl &= mask;
425425   }
426426#endif
427427
428   if (debug_viewer(screen.machine(), bitmap,cliprect))
428   if (debug_viewer(machine(), bitmap,cliprect))
429429      return 0;
430430
431   bitmap.fill(get_black_pen(screen.machine()), cliprect);
431   bitmap.fill(get_black_pen(machine()), cliprect);
432432
433433   if (m_video_disable)
434434      return 0;
435435
436436   if (layers_ctrl & 1)   m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
437437
438   if (layers_ctrl & 4)   draw_sprites(screen.machine(), bitmap, cliprect);
438   if (layers_ctrl & 4)   draw_sprites(machine(), bitmap, cliprect);
439439
440440   if (layers_ctrl & 2)   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
441441
trunk/src/mame/drivers/monzagp.c
r17988r17989
7474{
7575   int x,y;
7676
77   if(screen.machine().input().code_pressed_once(KEYCODE_Z))
77   if(machine().input().code_pressed_once(KEYCODE_Z))
7878      m_bank--;
7979
80   if(screen.machine().input().code_pressed_once(KEYCODE_X))
80   if(machine().input().code_pressed_once(KEYCODE_X))
8181      m_bank++;
8282
83   if(screen.machine().input().code_pressed_once(KEYCODE_Q))
83   if(machine().input().code_pressed_once(KEYCODE_Q))
8484   {
8585      m_screenw--;
8686      printf("%x\n",m_screenw);
8787   }
8888
89   if(screen.machine().input().code_pressed_once(KEYCODE_W))
89   if(machine().input().code_pressed_once(KEYCODE_W))
9090   {
9191      m_screenw++;
9292      printf("%x\n",m_screenw);
9393   }
9494
95   if(screen.machine().input().code_pressed_once(KEYCODE_A))
95   if(machine().input().code_pressed_once(KEYCODE_A))
9696   {
9797      FILE * p=fopen("vram.bin","wb");
9898      fwrite(&m_vram[0],1,0x10000,p);
r17988r17989
104104   {
105105      for(x=0;x<256;x++)
106106      {
107         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[m_bank&1],
107         drawgfx_transpen(bitmap,cliprect,machine().gfx[m_bank&1],
108108            m_vram[y*m_screenw+x],
109109            //(m_vram[y*m_screenw+x]&0x3f)+(m_bank>>1)*64,
110110            0,
trunk/src/mame/drivers/shanghai.c
r17988r17989
7878
7979UINT32 shanghai_state::screen_update_shanghai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8080{
81   device_t *hd63484 = screen.machine().device("hd63484");
81   device_t *hd63484 = machine().device("hd63484");
8282   int x, y, b, src;
8383
84   address_space &space = screen.machine().driver_data()->generic_space();
84   address_space &space = machine().driver_data()->generic_space();
8585   b = ((hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
8686   for (y = 0; y < 280; y++)
8787   {
trunk/src/mame/drivers/amaticmg.c
r17988r17989
467467
468468UINT32 amaticmg_state::screen_update_amaticmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
469469{
470   gfx_element *gfx = screen.machine().gfx[0];
470   gfx_element *gfx = machine().gfx[0];
471471   int y,x;
472472   int count = 0;
473473
r17988r17989
492492
493493UINT32 amaticmg_state::screen_update_amaticmg2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
494494{
495   gfx_element *gfx = screen.machine().gfx[0];
495   gfx_element *gfx = machine().gfx[0];
496496   int y,x;
497497   int count = 16;
498498
trunk/src/mame/drivers/avt.c
r17988r17989
509509{
510510   int x,y;
511511   int count;
512   gfx_element *gfx = screen.machine().gfx[0];
512   gfx_element *gfx = machine().gfx[0];
513513
514514   count = 0;
515515
trunk/src/mame/drivers/missb2.c
r17988r17989
6666   //popmessage("%02x",(*m_bgvram) & 0x1f);
6767   for (bg_offs = ((*m_bgvram) << 4); bg_offs < (((*m_bgvram) << 4) | 0xf); bg_offs++)
6868   {
69      drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[1],
69      drawgfx_opaque(bitmap,cliprect,machine().gfx[1],
7070            bg_offs,
7171            1,
7272            0,0,
r17988r17989
7676
7777   sx = 0;
7878
79   prom = screen.machine().root_device().memregion("proms")->base();
79   prom = machine().root_device().memregion("proms")->base();
8080   for (offs = 0; offs < m_objectram.bytes(); offs += 4)
8181   {
8282      /* skip empty sprites */
r17988r17989
126126               flipy = !flipy;
127127            }
128128
129            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
129            drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
130130                  code,
131131                  0,
132132                  flipx,flipy,
trunk/src/mame/drivers/photon.c
r17988r17989
208208
209209UINT32 photon_state::screen_update_photon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
210210{
211   return pk8000_video_update(screen, bitmap, cliprect, screen.machine().root_device().memregion("maincpu")->base());
211   return pk8000_video_update(screen, bitmap, cliprect, machine().root_device().memregion("maincpu")->base());
212212}
213213
214214static MACHINE_CONFIG_START( photon, photon_state )
trunk/src/mame/drivers/sigmab52.c
r17988r17989
168168
169169UINT32 sigmab52_state::screen_update_jwildb52(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
170170{
171   device_t *hd63484 = screen.machine().device("hd63484");
171   device_t *hd63484 = machine().device("hd63484");
172172
173173   int x, y, b, src;
174174
175   address_space &space = screen.machine().driver_data()->generic_space();
175   address_space &space = machine().driver_data()->generic_space();
176176   b = ((hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
177177
178178//save vram to file
179179#if 0
180   if (screen.machine().input().code_pressed_once(KEYCODE_Q))
180   if (machine().input().code_pressed_once(KEYCODE_Q))
181181   {
182182      FILE *p = fopen("vram.bin", "wb");
183183      fwrite(&HD63484_ram[0], 1, 0x40000 * 4, p);
r17988r17989
201201      }
202202   }
203203
204if (!screen.machine().input().code_pressed(KEYCODE_O))
204if (!machine().input().code_pressed(KEYCODE_O))
205205   if ((hd63484_regs_r(hd63484, space, 0x06/2, 0xffff) & 0x0300) == 0x0300)
206206   {
207207      int sy = (hd63484_regs_r(hd63484, space, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, space, 0x88/2, 0xffff) >> 8);
trunk/src/mame/drivers/jangou.c
r17988r17989
158158      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
159159      {
160160         UINT32 srcpix = *src++;
161         *dst++ = screen.machine().pens[srcpix & 0xf];
162         *dst++ = screen.machine().pens[(srcpix >> 4) & 0xf];
161         *dst++ = machine().pens[srcpix & 0xf];
162         *dst++ = machine().pens[(srcpix >> 4) & 0xf];
163163      }
164164   }
165165
trunk/src/mame/drivers/itgamble.c
r17988r17989
9090
9191UINT32 itgamble_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
9292{
93   bitmap.fill(get_black_pen(screen.machine()));
93   bitmap.fill(get_black_pen(machine()));
9494   return 0;
9595}
9696
trunk/src/mame/drivers/sub.c
r17988r17989
142142
143143UINT32 sub_state::screen_update_sub(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
144144{
145   gfx_element *gfx = screen.machine().gfx[0];
146   gfx_element *gfx_1 = screen.machine().gfx[1];
145   gfx_element *gfx = machine().gfx[0];
146   gfx_element *gfx_1 = machine().gfx[1];
147147   int y,x;
148148   int count = 0;
149149
trunk/src/mame/drivers/mpoker.c
r17988r17989
210210{
211211   int y,x;
212212   int count;
213   gfx_element *gfx = screen.machine().gfx[0];
213   gfx_element *gfx = machine().gfx[0];
214214
215215   count = 0;
216216   for (y=0;y<32;y++)
trunk/src/mame/drivers/skyarmy.c
r17988r17989
145145      flipy = (spriteram[offs+1]&0x80)>>7;
146146      flipx = (spriteram[offs+1]&0x40)>>6;
147147
148      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
148      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
149149         spriteram[offs+1]&0x3f,
150150         pal,
151151         flipx,flipy,
trunk/src/mame/drivers/suprgolf.c
r17988r17989
9898UINT32 suprgolf_state::screen_update_suprgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
9999{
100100   int x,y,count,color;
101   bitmap.fill(get_black_pen(screen.machine()), cliprect);
101   bitmap.fill(get_black_pen(machine()), cliprect);
102102
103103   {
104104      count = 0;
r17988r17989
110110            color = m_bg_fb[count];
111111
112112            if(x <= cliprect.max_x && y <= cliprect.max_y)
113               bitmap.pix16(y, x) = screen.machine().pens[(color & 0x7ff)];
113               bitmap.pix16(y, x) = machine().pens[(color & 0x7ff)];
114114
115115            count++;
116116         }
r17988r17989
127127            color = m_fg_fb[count];
128128
129129            if(((m_fg_fb[count] & 0x0f) != 0x0f) && (x <= cliprect.max_x && y <= cliprect.max_y))
130               bitmap.pix16(y, x) = screen.machine().pens[(color & 0x7ff)];
130               bitmap.pix16(y, x) = machine().pens[(color & 0x7ff)];
131131
132132            count++;
133133         }
trunk/src/mame/drivers/adp.c
r17988r17989
227227         b++;
228228      }
229229   }
230if (!screen.machine().input().code_pressed(KEYCODE_O)) // debug: toggle window
230if (!machine().input().code_pressed(KEYCODE_O)) // debug: toggle window
231231   if ((hd63484_regs_r(m_hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300)
232232   {
233233      int sy = (hd63484_regs_r(m_hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(m_hd63484, 0x88/2, 0xffff) >> 8);
trunk/src/mame/drivers/pcxt.c
r17988r17989
154154                  color |= ((bg_rom[y*320/8+x+(pen_i*0x20000)+yi*0x400+m_bg_bank*0x2000+1] >> (7-xi)) & 1) << pen_i;
155155
156156               if(cliprect.contains(x*8+xi, y*8+yi))
157                  bitmap.pix32(y*8+yi, x*8+xi) = screen.machine().pens[color];
157                  bitmap.pix32(y*8+yi, x*8+xi) = machine().pens[color];
158158            }
159159         }
160160      }
trunk/src/mame/drivers/dmndrby.c
r17988r17989
350350{
351351   int x,y,count;
352352   int off,scrolly;
353   gfx_element *gfx = screen.machine().gfx[0];
354   gfx_element *sprites = screen.machine().gfx[1];
355   gfx_element *track = screen.machine().gfx[2];
353   gfx_element *gfx = machine().gfx[0];
354   gfx_element *sprites = machine().gfx[1];
355   gfx_element *track = machine().gfx[2];
356356
357   bitmap.fill(get_black_pen(screen.machine()), cliprect);
357   bitmap.fill(get_black_pen(machine()), cliprect);
358358
359359
360360/* Draw racetrack
trunk/src/mame/drivers/cmmb.c
r17988r17989
7878UINT32 cmmb_state::screen_update_cmmb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7979{
8080   UINT8 *videoram = m_videoram;
81   gfx_element *gfx = screen.machine().gfx[0];
81   gfx_element *gfx = machine().gfx[0];
8282   int count = 0x00000;
8383
8484   int y,x;
trunk/src/mame/drivers/boxer.c
r17988r17989
184184         UINT8 code = m_tile_ram[32 * i + j];
185185
186186         drawgfx_transpen(bitmap, cliprect,
187            screen.machine().gfx[2],
187            machine().gfx[2],
188188            code,
189189            0,
190190            code & 0x40, code & 0x40,
r17988r17989
193193      }
194194   }
195195
196   draw_boxer(screen.machine(), bitmap, cliprect);
196   draw_boxer(machine(), bitmap, cliprect);
197197   return 0;
198198}
199199
trunk/src/mame/drivers/speglsht.c
r17988r17989
376376      {
377377         if(srcline[x])
378378         {
379            rgb_t color=palette_get_color(screen.machine(), srcline[x]);
379            rgb_t color=palette_get_color(machine(), srcline[x]);
380380            PLOT_PIXEL_RGB(x,y,RGB_RED(color),RGB_GREEN(color),RGB_BLUE(color));
381381         }
382382      }
trunk/src/mame/drivers/gal3.c
r17988r17989
201201   static int pivot = 15;
202202   int pri;
203203
204   update_palette(screen.machine());
204   update_palette(machine());
205205
206   if( screen.machine().input().code_pressed_once(KEYCODE_H)&&(pivot<15) )   pivot+=1;
207   if( screen.machine().input().code_pressed_once(KEYCODE_J)&&(pivot>0) )   pivot-=1;
206   if( machine().input().code_pressed_once(KEYCODE_H)&&(pivot<15) )   pivot+=1;
207   if( machine().input().code_pressed_once(KEYCODE_J)&&(pivot>0) )   pivot-=1;
208208
209209   for( pri=0; pri<pivot; pri++ )
210210   {
trunk/src/mame/drivers/nightgal.c
r17988r17989
108108      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
109109      {
110110         UINT32 srcpix = *src++;
111         *dst++ = screen.machine().pens[srcpix & 0xf];
112         *dst++ = screen.machine().pens[(srcpix >> 4) & 0xf];
111         *dst++ = machine().pens[srcpix & 0xf];
112         *dst++ = machine().pens[(srcpix >> 4) & 0xf];
113113      }
114114   }
115115
trunk/src/mame/drivers/maygayv1.c
r17988r17989
311311   /* If screen output is disabled, fill with black */
312312   if (!(VREG(VCR0) & VCR0_DEN))
313313   {
314      bitmap.fill(get_black_pen(screen.machine()), cliprect);
314      bitmap.fill(get_black_pen(machine()), cliprect);
315315      return 0;
316316   }
317317
r17988r17989
453453         for (i = 0; i < 16; ++i)
454454         {
455455            UINT16 entry = *palbase++;
456            palette_set_color_rgb(screen.machine(), entry & 0xf, pal4bit(entry >> 12), pal4bit(entry >> 8), pal4bit(entry >> 4));
456            palette_set_color_rgb(machine(), entry & 0xf, pal4bit(entry >> 12), pal4bit(entry >> 8), pal4bit(entry >> 4));
457457         }
458458      }
459459   }
trunk/src/mame/drivers/rgum.c
r17988r17989
4343UINT32 rgum_state::screen_update_royalgum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
4444{
4545   int x,y,count;
46   gfx_element *gfx = screen.machine().gfx[0];
46   gfx_element *gfx = machine().gfx[0];
4747
4848   count = 0;
4949
trunk/src/mame/drivers/chihiro.c
r17988r17989
10991099
11001100void nv2a_renderer::vblank_callback(screen_device &screen, bool state)
11011101{
1102   chihiro_state *chst=screen.machine().driver_data<chihiro_state>();
1102   chihiro_state *chst=machine().driver_data<chihiro_state>();
11031103
11041104   printf("vblank_callback\n\r");
11051105   if (state == true)
trunk/src/mame/drivers/namcos23.c
r17988r17989
24212421
24222422UINT32 namcos23_state::screen_update_ss23(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
24232423{
2424   bitmap.fill(get_black_pen(screen.machine()), cliprect);
2424   bitmap.fill(get_black_pen(machine()), cliprect);
24252425
2426   render_run( screen.machine(), bitmap );
2426   render_run( machine(), bitmap );
24272427
2428   gfx_element *gfx = screen.machine().gfx[0];
2428   gfx_element *gfx = machine().gfx[0];
24292429   gfx->mark_all_dirty();
24302430
24312431   m_bgtilemap->draw(bitmap, cliprect, 0/*flags*/, 0/*priority*/ ); /* opaque */
trunk/src/mame/drivers/mjsister.c
r17988r17989
139139
140140      for (offs = 0; offs < 0x8000; offs++)
141141      {
142         mjsister_plot0(screen.machine(), offs, m_videoram0[offs]);
143         mjsister_plot1(screen.machine(), offs, m_videoram1[offs]);
142         mjsister_plot0(machine(), offs, m_videoram0[offs]);
143         mjsister_plot1(machine(), offs, m_videoram1[offs]);
144144      }
145145      m_screen_redraw = 0;
146146   }
r17988r17989
155155      copybitmap_trans(bitmap, *m_tmpbitmap1, flip, flip, 2, 0, cliprect, 0);
156156   }
157157   else
158      bitmap.fill(get_black_pen(screen.machine()), cliprect);
158      bitmap.fill(get_black_pen(machine()), cliprect);
159159   return 0;
160160}
161161
trunk/src/mame/drivers/seta.c
r17988r17989
16001600   // rising edge
16011601   if (state)
16021602   {
1603      screen.machine().device<seta001_device>("spritegen")->setac_eof();
1603      machine().device<seta001_device>("spritegen")->setac_eof();
16041604   }
16051605}
16061606
trunk/src/mame/drivers/laserbat.c
r17988r17989
528528   }
529529
530530   if (m_sprite_enable)
531      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
531      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
532532              m_sprite_code,
533533            m_sprite_color,
534534            0,0,
trunk/src/mame/drivers/champbwl.c
r17988r17989
460460{
461461   bitmap.fill(0x1f0, cliprect);
462462
463   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e );
464   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 );
463   machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e );
464   machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 );
465465
466   screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(), bitmap, cliprect, 0x800, 1 );
466   machine().device<seta001_device>("spritegen")->seta001_draw_sprites(machine(), bitmap, cliprect, 0x800, 1 );
467467   return 0;
468468}
469469
r17988r17989
471471{
472472   // rising edge
473473   if (state)
474      screen.machine().device<seta001_device>("spritegen")->tnzs_eof();
474      machine().device<seta001_device>("spritegen")->tnzs_eof();
475475}
476476
477477
r17988r17989
519519{
520520   bitmap.fill(0x1f0, cliprect);
521521
522   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x00, 0x01 );
523   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x00, 0x10 );
522   machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x00, 0x01 );
523   machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x00, 0x10 );
524524
525   screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(), bitmap, cliprect, 0x800, 1 );
525   machine().device<seta001_device>("spritegen")->seta001_draw_sprites(machine(), bitmap, cliprect, 0x800, 1 );
526526   return 0;
527527}
528528
r17988r17989
530530{
531531   // rising edge
532532   if (state)
533      screen.machine().device<seta001_device>("spritegen")->setac_eof();
533      machine().device<seta001_device>("spritegen")->setac_eof();
534534}
535535
536536MACHINE_START_MEMBER(champbwl_state,doraemon)
trunk/src/mame/drivers/bnstars.c
r17988r17989
535535UINT32 bnstars_state::screen_update_bnstars_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
536536{
537537
538   screen.machine().priority_bitmap.fill(0, cliprect);
538   machine().priority_bitmap.fill(0, cliprect);
539539
540540   bitmap.fill(0, cliprect);   /* bg color */
541541
r17988r17989
544544   m_ms32_bg_tilemap[0]->set_scrolly(0, m_ms32_bg0_scroll[0x0c/4] + m_ms32_bg0_scroll[0x14/4] );
545545   m_ms32_bg_tilemap[0]->draw(bitmap, cliprect, 0,1);
546546
547   draw_roz(screen.machine(),bitmap,cliprect,2,0);
547   draw_roz(machine(),bitmap,cliprect,2,0);
548548
549549   m_ms32_tx_tilemap[0]->set_scrollx(0, m_ms32_tx0_scroll[0x00/4] + m_ms32_tx0_scroll[0x08/4] + 0x18);
550550   m_ms32_tx_tilemap[0]->set_scrolly(0, m_ms32_tx0_scroll[0x0c/4] + m_ms32_tx0_scroll[0x14/4]);
551551   m_ms32_tx_tilemap[0]->draw(bitmap, cliprect, 0,4);
552552
553553
554   draw_sprites(screen.machine(),bitmap,cliprect, m_ms32_spram, 0x20000, 0);
554   draw_sprites(machine(),bitmap,cliprect, m_ms32_spram, 0x20000, 0);
555555
556556   return 0;
557557}
r17988r17989
559559UINT32 bnstars_state::screen_update_bnstars_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
560560{
561561
562   screen.machine().priority_bitmap.fill(0, cliprect);
562   machine().priority_bitmap.fill(0, cliprect);
563563
564564   bitmap.fill(0x8000+0, cliprect);   /* bg color */
565565
r17988r17989
568568   m_ms32_bg_tilemap[1]->set_scrolly(0, m_ms32_bg1_scroll[0x0c/4] + m_ms32_bg1_scroll[0x14/4] );
569569   m_ms32_bg_tilemap[1]->draw(bitmap, cliprect, 0,1);
570570
571   draw_roz(screen.machine(),bitmap,cliprect,2,1);
571   draw_roz(machine(),bitmap,cliprect,2,1);
572572
573573   m_ms32_tx_tilemap[1]->set_scrollx(0, m_ms32_tx1_scroll[0x00/4] + m_ms32_tx1_scroll[0x08/4] + 0x18);
574574   m_ms32_tx_tilemap[1]->set_scrolly(0, m_ms32_tx1_scroll[0x0c/4] + m_ms32_tx1_scroll[0x14/4]);
575575   m_ms32_tx_tilemap[1]->draw(bitmap, cliprect, 0,4);
576576
577   draw_sprites(screen.machine(),bitmap,cliprect, m_ms32_spram+(0x20000/4), 0x20000, 4);
577   draw_sprites(machine(),bitmap,cliprect, m_ms32_spram+(0x20000/4), 0x20000, 4);
578578
579579   return 0;
580580}
trunk/src/mame/drivers/diverboy.c
r17988r17989
116116
117117UINT32 diverboy_state::screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
118118{
119//  bitmap.fill(get_black_pen(screen.machine()), cliprect);
120   draw_sprites(screen.machine(), bitmap, cliprect);
119//  bitmap.fill(get_black_pen(machine()), cliprect);
120   draw_sprites(machine(), bitmap, cliprect);
121121   return 0;
122122}
123123
trunk/src/mame/drivers/vmetal.c
r17988r17989
460460UINT32 vmetal_state::screen_update_varia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
461461{
462462
463   bitmap.fill(get_black_pen(screen.machine()), cliprect);
464   screen.machine().priority_bitmap.fill(0, cliprect);
463   bitmap.fill(get_black_pen(machine()), cliprect);
464   machine().priority_bitmap.fill(0, cliprect);
465465
466466   m_mid2tilemap->set_scrollx(0, m_vmetal_videoregs[0x06a/2]-64 /*+ m_vmetal_videoregs[0x066/2]*/);
467467   m_mid1tilemap->set_scrollx(0, m_vmetal_videoregs[0x07a/2]-64 /*+ m_vmetal_videoregs[0x076/2]*/);
r17988r17989
473473
474474   m_mid1tilemap->draw(bitmap, cliprect, 0, 0);
475475   m_mid2tilemap->draw(bitmap, cliprect, 0, 0);
476   metro_draw_sprites(screen.machine(), bitmap, cliprect);
476   metro_draw_sprites(machine(), bitmap, cliprect);
477477   m_texttilemap->draw(bitmap, cliprect, 0, 0);
478478   return 0;
479479}
trunk/src/mame/drivers/firefox.c
r17988r17989
220220   int sprite;
221221   int gfxtop = screen.visible_area().min_y;
222222
223   bitmap.fill(palette_get_color(screen.machine(), 256), cliprect);
223   bitmap.fill(palette_get_color(machine(), 256), cliprect);
224224
225225   for( sprite = 0; sprite < 32; sprite++ )
226226   {
r17988r17989
240240            int flipx = flags & 0x20;
241241            int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) );
242242
243            drawgfx_transpen( bitmap, cliprect, screen.machine().gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 );
243            drawgfx_transpen( bitmap, cliprect, machine().gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 );
244244         }
245245      }
246246   }
trunk/src/mame/drivers/deco156.c
r17988r17989
7474   //FIXME: flip_screen_x should not be written!
7575   flip_screen_set_no_update(1);
7676
77   screen.machine().priority_bitmap.fill(0);
77   machine().priority_bitmap.fill(0);
7878   bitmap.fill(0);
7979
8080   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
8181
8282   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
83   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x800);
83   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x800);
8484   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
8585   return 0;
8686}
trunk/src/mame/drivers/dwarfd.c
r17988r17989
850850
851851UINT32 dwarfd_state::screen_update_dwarfd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
852852{
853   bitmap.fill(get_black_pen(screen.machine()), cliprect);
854   drawCrt(screen.machine(), bitmap, cliprect);
853   bitmap.fill(get_black_pen(machine()), cliprect);
854   drawCrt(machine(), bitmap, cliprect);
855855   return 0;
856856}
857857
trunk/src/mame/drivers/hitpoker.c
r17988r17989
111111         gfx_bpp = (m_colorram[count] & 0x80)>>7; //flag between 4 and 8 bpp
112112         color = gfx_bpp ? ((m_colorram[count] & 0x70)>>4) : (m_colorram[count] & 0xf);
113113
114         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[gfx_bpp],tile,color,0,0,x*8,y*8);
114         drawgfx_opaque(bitmap,cliprect,machine().gfx[gfx_bpp],tile,color,0,0,x*8,y*8);
115115
116116         count+=2;
117117      }
trunk/src/mame/drivers/meritm.c
r17988r17989
464464
465465UINT32 meritm_state::screen_update_meritm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
466466{
467   if(screen.machine().input().code_pressed_once(KEYCODE_Q))
467   if(machine().input().code_pressed_once(KEYCODE_Q))
468468   {
469469      m_layer0_enabled^=1;
470470      popmessage("Layer 0 %sabled",m_layer0_enabled ? "en" : "dis");
471471   }
472   if(screen.machine().input().code_pressed_once(KEYCODE_W))
472   if(machine().input().code_pressed_once(KEYCODE_W))
473473   {
474474      m_layer1_enabled^=1;
475475      popmessage("Layer 1 %sabled",m_layer1_enabled ? "en" : "dis");
476476   }
477477
478   bitmap.fill(get_black_pen(screen.machine()), cliprect);
478   bitmap.fill(get_black_pen(machine()), cliprect);
479479
480480   if ( m_layer0_enabled )
481481   {
trunk/src/mame/drivers/atarisy4.c
r17988r17989
182182      {
183183         UINT16 data = *src++;
184184
185         *dest++ = screen.machine().pens[data & 0xff];
186         *dest++ = screen.machine().pens[data >> 8];
185         *dest++ = machine().pens[data & 0xff];
186         *dest++ = machine().pens[data >> 8];
187187      }
188188   }
189189   return 0;
trunk/src/mame/drivers/go2000.c
r17988r17989
187187      {
188188         int tile = m_videoram[count];
189189         int attr = m_videoram2[count];
190         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8);
190         drawgfx_opaque(bitmap, cliprect, machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8);
191191         count++;
192192      }
193193   }
r17988r17989
199199      {
200200         int tile = m_videoram[count];
201201         int attr = m_videoram2[count];
202         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf);
202         drawgfx_transpen(bitmap, cliprect, machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf);
203203         count++;
204204      }
205205   }
r17988r17989
208208   {
209209   int offs;
210210
211   int max_x = screen.machine().primary_screen->width() - 8;
212   int max_y = screen.machine().primary_screen->height() - 8;
211   int max_x = machine().primary_screen->width() - 8;
212   int max_y = machine().primary_screen->height() - 8;
213213
214214   for (offs = 0xf800 / 2; offs < 0x10000 / 2 ; offs += 4/2)
215215   {
r17988r17989
290290               tile_flipy = !tile_flipy;
291291            }
292292
293            drawgfx_transpen(   bitmap, cliprect,screen.machine().gfx[0],
293            drawgfx_transpen(   bitmap, cliprect,machine().gfx[0],
294294                     (tile & 0x1fff) + bank*0x4000,
295295                     attr,
296296                     tile_flipx, tile_flipy,
trunk/src/mame/drivers/igs_m027.c
r17988r17989
185185UINT32 igs_m027_state::screen_update_igs_majhong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
186186{
187187   //??????????
188   bitmap.fill(get_black_pen(screen.machine()), cliprect);
188   bitmap.fill(get_black_pen(machine()), cliprect);
189189
190190   //??????
191191   m_igs_bg_tilemap->draw(bitmap, cliprect, 0,0);
trunk/src/mame/drivers/buster.c
r17988r17989
3333
3434UINT32 buster_state::screen_update_buster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3535{
36   gfx_element *gfx = screen.machine().gfx[0];
36   gfx_element *gfx = machine().gfx[0];
3737   int count = 0x0000;
3838
3939   int y,x;
trunk/src/mame/drivers/subsino2.c
r17988r17989
638638   int y;
639639
640640#ifdef MAME_DEBUG
641   if (screen.machine().input().code_pressed(KEYCODE_Z))
641   if (machine().input().code_pressed(KEYCODE_Z))
642642   {
643643      int msk = 0;
644      if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
645      if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
644      if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
645      if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
646646      if (msk != 0) layers_ctrl &= msk;
647647   }
648648#endif
r17988r17989
687687      }
688688   }
689689
690   bitmap.fill(get_black_pen(screen.machine()), cliprect);
690   bitmap.fill(get_black_pen(machine()), cliprect);
691691
692692   if (layers_ctrl & 1)
693693   {
trunk/src/mame/drivers/m63.c
r17988r17989
369369      m_bg_tilemap->set_scrolly(col, m_scrollram[col * 8]);
370370
371371   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
372   draw_sprites(screen.machine(), bitmap, cliprect);
372   draw_sprites(machine(), bitmap, cliprect);
373373   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
374374   return 0;
375375}
trunk/src/mame/drivers/mpu4dealem.c
r17988r17989
124124      {
125125         int tile = m_dealem_videoram[count + 0x1000] | (m_dealem_videoram[count] << 8);
126126         count++;
127         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,0,0,0,x * 8,y * 8);
127         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],tile,0,0,0,x * 8,y * 8);
128128      }
129129   }
130130
trunk/src/mame/drivers/mastboy.c
r17988r17989
498498   {
499499      int coldat = m_colram[i+1] |  (m_colram[i+0]<<8);
500500
501      palette_set_color_rgb(screen.machine(),i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4));
501      palette_set_color_rgb(machine(),i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4));
502502   }
503503
504504   for (y=0;y<32;y++)
r17988r17989
512512
513513         if (tileno&0x800)
514514         {
515            gfx = screen.machine().gfx[1];
515            gfx = machine().gfx[1];
516516            tileno &=0x7ff;
517517         }
518518         else
519519         {
520            gfx = screen.machine().gfx[0];
520            gfx = machine().gfx[0];
521521         }
522522
523523
trunk/src/mame/drivers/jclub2.c
r17988r17989
238238   int layers_ctrl = -1;
239239
240240#if DARKHORS_DEBUG
241   if (screen.machine().input().code_pressed(KEYCODE_Z))
241   if (machine().input().code_pressed(KEYCODE_Z))
242242   {
243243      int mask = 0;
244      if (screen.machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
245      if (screen.machine().input().code_pressed(KEYCODE_W))   mask |= 2;
246      if (screen.machine().input().code_pressed(KEYCODE_A))   mask |= 4;
244      if (machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
245      if (machine().input().code_pressed(KEYCODE_W))   mask |= 2;
246      if (machine().input().code_pressed(KEYCODE_A))   mask |= 4;
247247      if (mask != 0) layers_ctrl &= mask;
248248   }
249249#endif
250250
251   bitmap.fill(get_black_pen(screen.machine()), cliprect);
251   bitmap.fill(get_black_pen(machine()), cliprect);
252252
253253   m_tmap->set_scrollx(0, (m_tmapscroll[0] >> 16) - 5);
254254   m_tmap->set_scrolly(0, (m_tmapscroll[0] & 0xffff) - 0xff );
r17988r17989
258258   m_tmap2->set_scrolly(0, (m_tmapscroll2[0] & 0xffff) - 0xff );
259259   if (layers_ctrl & 2)   m_tmap2->draw(bitmap, cliprect, 0, 0);
260260
261   if (layers_ctrl & 4)   draw_sprites(screen.machine(),bitmap,cliprect);
261   if (layers_ctrl & 4)   draw_sprites(machine(),bitmap,cliprect);
262262
263263#if DARKHORS_DEBUG
264264#if 0
r17988r17989
725725{
726726
727727   // this isn't an st0020..
728   m_gdfs_st0020->st0020_draw_all(screen.machine(), bitmap, cliprect);
728   m_gdfs_st0020->st0020_draw_all(machine(), bitmap, cliprect);
729729
730730   return 0;
731731}
r17988r17989
788788
789789UINT32 darkhors_state::screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
790790{
791   m_gdfs_st0020->st0020_draw_all(screen.machine(), bitmap, cliprect);
791   m_gdfs_st0020->st0020_draw_all(machine(), bitmap, cliprect);
792792   return 0;
793793}
794794
trunk/src/mame/drivers/albazc.c
r17988r17989
9191UINT32 albazc_state::screen_update_hanaroku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
9292{
9393   bitmap.fill(0x1f0, cliprect);   // ???
94   draw_sprites(screen.machine(), bitmap, cliprect);
94   draw_sprites(machine(), bitmap, cliprect);
9595   return 0;
9696}
9797
trunk/src/mame/drivers/midas.c
r17988r17989
190190   int layers_ctrl = -1;
191191
192192#ifdef MAME_DEBUG
193   if ( screen.machine().input().code_pressed(KEYCODE_Z) )
193   if ( machine().input().code_pressed(KEYCODE_Z) )
194194   {
195195      int msk = 0;
196      if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1 << 0;   // for m_tmap
197      if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 1 << 1;   // for sprites
196      if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1 << 0;   // for m_tmap
197      if (machine().input().code_pressed(KEYCODE_A))   msk |= 1 << 1;   // for sprites
198198      if (msk != 0) layers_ctrl &= msk;
199199   }
200200#endif
201201
202202   bitmap.fill(4095, cliprect);
203203
204   if (layers_ctrl & 2)   draw_sprites(screen.machine(), bitmap,cliprect);
204   if (layers_ctrl & 2)   draw_sprites(machine(), bitmap,cliprect);
205205   if (layers_ctrl & 1)   m_tmap->draw(bitmap, cliprect, 0, 0);
206206
207207   return 0;
trunk/src/mame/drivers/aristmk4.c
r17988r17989
373373
374374UINT32 aristmk4_state::screen_update_aristmk4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
375375{
376   gfx_element *gfx = screen.machine().gfx[0];
376   gfx_element *gfx = machine().gfx[0];
377377   int x,y;
378378   int count = 0;
379379   int color;
r17988r17989
389389      color = ((m_mkiv_vram[count]) & 0xe0) >> 5;
390390         tile = (m_mkiv_vram[count+1]|m_mkiv_vram[count]<<8) & 0x3ff;
391391         bgtile = (m_mkiv_vram[count+1]|m_mkiv_vram[count]<<8) & 0xff; // first 256 tiles
392         uBackgroundColour(screen.machine());   // read sw7
392         uBackgroundColour(machine());   // read sw7
393393         gfx->decode(bgtile);   // force the machine to update only the first 256 tiles.
394394                        // as we only update the background, not the entire display.
395395         flipx = ((m_mkiv_vram[count]) & 0x04);
trunk/src/mame/drivers/galaxi.c
r17988r17989
187187   int layers_ctrl = -1;
188188
189189#ifdef MAME_DEBUG
190   if (screen.machine().input().code_pressed(KEYCODE_R))   // remapped due to inputs changes.
190   if (machine().input().code_pressed(KEYCODE_R))   // remapped due to inputs changes.
191191   {
192192      int msk = 0;
193      if (screen.machine().input().code_pressed(KEYCODE_T))   msk |= 1;
194      if (screen.machine().input().code_pressed(KEYCODE_Y))   msk |= 2;
195      if (screen.machine().input().code_pressed(KEYCODE_U))   msk |= 4;
196      if (screen.machine().input().code_pressed(KEYCODE_I))   msk |= 8;
197      if (screen.machine().input().code_pressed(KEYCODE_O))   msk |= 16;
193      if (machine().input().code_pressed(KEYCODE_T))   msk |= 1;
194      if (machine().input().code_pressed(KEYCODE_Y))   msk |= 2;
195      if (machine().input().code_pressed(KEYCODE_U))   msk |= 4;
196      if (machine().input().code_pressed(KEYCODE_I))   msk |= 8;
197      if (machine().input().code_pressed(KEYCODE_O))   msk |= 16;
198198      if (msk != 0) layers_ctrl &= msk;
199199   }
200200#endif
201201
202202   if (layers_ctrl & 1)   m_bg1_tmap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
203   else            bitmap.fill(get_black_pen(screen.machine()), cliprect);
203   else            bitmap.fill(get_black_pen(machine()), cliprect);
204204   if (layers_ctrl & 2)   m_bg2_tmap->draw(bitmap, cliprect, 0, 0);
205205   if (layers_ctrl & 4)   m_bg3_tmap->draw(bitmap, cliprect, 0, 0);
206206   if (layers_ctrl & 8)   m_bg4_tmap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/drivers/murogmbl.c
r17988r17989
9797
9898UINT32 murogmbl_state::screen_update_murogmbl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
9999{
100   gfx_element *gfx = screen.machine().gfx[0];
100   gfx_element *gfx = machine().gfx[0];
101101   int count = 0;
102102
103103   int y, x;
trunk/src/mame/drivers/bmcpokr.c
r17988r17989
201201
202202UINT32 bmcpokr_state::screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
203203{
204   gfx_element *gfx = screen.machine().gfx[0];
204   gfx_element *gfx = machine().gfx[0];
205205
206206   int count = 0;
207207   for (int y=0;y<32;y++)
trunk/src/mame/drivers/taitotz.c
r17988r17989
12851285
12861286   bitmap.fill(0x000000, cliprect);
12871287   m_renderer->set_fb(&bitmap);
1288   m_renderer->render_displaylist(screen.machine(), cliprect);
1288   m_renderer->render_displaylist(machine(), cliprect);
12891289
12901290
12911291   UINT16 *screen_src = (UINT16*)&m_screen_ram[m_scr_base];
trunk/src/mame/drivers/cabaret.c
r17988r17989
115115
116116UINT32 cabaret_state::screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
117117{
118   bitmap.fill(get_black_pen(screen.machine()), cliprect);
118   bitmap.fill(get_black_pen(machine()), cliprect);
119119
120120   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
121121
trunk/src/mame/drivers/olibochu.c
r17988r17989
230230UINT32 olibochu_state::screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
231231{
232232   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
233   draw_sprites(screen.machine(), bitmap, cliprect);
233   draw_sprites(machine(), bitmap, cliprect);
234234   return 0;
235235}
236236
trunk/src/mame/drivers/tugboat.c
r17988r17989
139139   int startaddr1 = m_hd46505_1_reg[0x0c]*256 + m_hd46505_1_reg[0x0d];
140140
141141
142   draw_tilemap(screen.machine(), bitmap,cliprect,startaddr0,0,1,FALSE);
143   draw_tilemap(screen.machine(), bitmap,cliprect,startaddr1,2,3,TRUE);
142   draw_tilemap(machine(), bitmap,cliprect,startaddr0,0,1,FALSE);
143   draw_tilemap(machine(), bitmap,cliprect,startaddr1,2,3,TRUE);
144144   return 0;
145145}
146146
trunk/src/mame/drivers/kingdrby.c
r17988r17989
243243
244244   /*TILEMAP_DRAW_CATEGORY + TILEMAP_DRAW_OPAQUE doesn't suit well?*/
245245   m_sc0_tilemap->draw(bitmap, cliprect, 0,0);
246   draw_sprites(screen.machine(),bitmap,cliprect);
246   draw_sprites(machine(),bitmap,cliprect);
247247   m_sc1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_CATEGORY(1),0);
248248   m_sc0w_tilemap->draw(bitmap, clip, 0,0);
249249
trunk/src/mame/drivers/r2dx_v33.c
r17988r17989
216216
217217UINT32 r2dx_v33_state::screen_update_rdx_v33(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
218218{
219   bitmap.fill(get_black_pen(screen.machine()), cliprect);
219   bitmap.fill(get_black_pen(machine()), cliprect);
220220
221221   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
222222   m_md_tilemap->draw(bitmap, cliprect, 0, 0);
223223   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
224224
225   draw_sprites(screen.machine(),bitmap,cliprect,0);
225   draw_sprites(machine(),bitmap,cliprect,0);
226226
227227   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
228228
r17988r17989
231231   {
232232      static UINT32 src_addr = 0x100000;
233233      static int frame;
234      address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
234      address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
235235
236      //if(screen.machine().input().code_pressed_once(KEYCODE_A))
236      //if(machine().input().code_pressed_once(KEYCODE_A))
237237      //  src_addr+=0x800;
238238
239      //if(screen.machine().input().code_pressed_once(KEYCODE_S))
239      //if(machine().input().code_pressed_once(KEYCODE_S))
240240      //  src_addr-=0x800;
241241
242242      frame++;
243243
244244      popmessage("%08x 0",src_addr);
245245
246      //if(screen.machine().input().code_pressed_once(KEYCODE_Z))
246      //if(machine().input().code_pressed_once(KEYCODE_Z))
247247      if(frame == 5)
248248      {
249249         int i,data;
trunk/src/mame/drivers/lastfght.c
r17988r17989
151151#if 1
152152   // gfx roms viewer (toggle with enter, use pgup/down to browse)
153153   int x, y, count = 0;
154   UINT8 *gfxdata = screen.machine().root_device().memregion("gfx1")->base();
154   UINT8 *gfxdata = machine().root_device().memregion("gfx1")->base();
155155   UINT8 data;
156156
157   if (screen.machine().input().code_pressed_once(KEYCODE_ENTER))   m_view_roms ^= 1;
157   if (machine().input().code_pressed_once(KEYCODE_ENTER))   m_view_roms ^= 1;
158158   if (m_view_roms)
159159   {
160      if (screen.machine().input().code_pressed_once(KEYCODE_PGDN))   m_base += 512 * 256;
161      if (screen.machine().input().code_pressed_once(KEYCODE_PGUP))   m_base -= 512 * 256;
160      if (machine().input().code_pressed_once(KEYCODE_PGDN))   m_base += 512 * 256;
161      if (machine().input().code_pressed_once(KEYCODE_PGUP))   m_base -= 512 * 256;
162162      m_base %= memregion("gfx1")->bytes();
163163
164164      count = m_base;
165165
166      bitmap.fill(get_black_pen(screen.machine()), cliprect );
166      bitmap.fill(get_black_pen(machine()), cliprect );
167167      for (y = 0 ; y < 256; y++)
168168      {
169169         for (x = 0; x < 512; x++)
170170         {
171            data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(screen.machine()) : gfxdata[count];   // white grid or data
171            data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(machine()) : gfxdata[count];   // white grid or data
172172            bitmap.pix16(y, x) = data;
173173            count++;
174174         }
trunk/src/mame/drivers/vega.c
r17988r17989
582582
583583         //  if(color==0) color=0xf;
584584
585            drawgfx_transpen(bitmap, cliprect,  screen.machine().gfx[0], character, color, 0, 0, x*7, y*10,0);
585            drawgfx_transpen(bitmap, cliprect,  machine().gfx[0], character, color, 0, 0, x*7, y*10,0);
586586
587587            ++idx;
588588         }
r17988r17989
604604         {
605605            //for(int x=0;x<4;++x)
606606            {
607               drawgfx_transpen(bitmap, cliprect,  screen.machine().gfx[2], num, 0, 1, flip?1:0, x*4+x0, (flip?(3-y):y)*8+y0, 0);
607               drawgfx_transpen(bitmap, cliprect,  machine().gfx[2], num, 0, 1, flip?1:0, x*4+x0, (flip?(3-y):y)*8+y0, 0);
608608               ++num;
609609            }
610610         }
r17988r17989
645645            for(int y=0;y<4;++y)
646646            {
647647
648               drawgfx_transpen(bitmap, cliprect,  screen.machine().gfx[3], strip_num, 0, !xor_line, 0, x*4+x0, y*8+y0, 0);
648               drawgfx_transpen(bitmap, cliprect,  machine().gfx[3], strip_num, 0, !xor_line, 0, x*4+x0, y*8+y0, 0);
649649               ++strip_num;
650650            }
651651         }
trunk/src/mame/drivers/looping.c
r17988r17989
308308{
309309   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
310310
311   draw_sprites(screen.machine(), bitmap, cliprect);
311   draw_sprites(machine(), bitmap, cliprect);
312312   return 0;
313313}
314314
trunk/src/mame/drivers/1945kiii.c
r17988r17989
127127UINT32 k3_state::screen_update_k3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
128128{
129129   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
130   draw_sprites(screen.machine(), bitmap, cliprect);
130   draw_sprites(machine(), bitmap, cliprect);
131131   return 0;
132132}
133133
trunk/src/mame/drivers/astinvad.c
r17988r17989
181181      {
182182         UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (m_screen_flip ? 0 : 4);
183183         UINT8 data = m_videoram[(((y ^ m_screen_flip) + yoffs) << 5) | ((x ^ m_screen_flip) >> 3)];
184         plot_byte(screen.machine(), bitmap, y, x, data, m_screen_red ? 1 : color);
184         plot_byte(machine(), bitmap, y, x, data, m_screen_red ? 1 : color);
185185      }
186186
187187   return 0;
r17988r17989
205205      offs_t n = ((offs >> 5) & 0xf0) | color;
206206      color = color_prom[n] & 0x07;
207207
208      plot_byte(screen.machine(), bitmap, y, x, data, color);
208      plot_byte(machine(), bitmap, y, x, data, color);
209209   }
210210
211211   return 0;
trunk/src/mame/drivers/esh.c
r17988r17989
7777         //int blinkLine = (m_tile_control_ram[current_screen_character] & 0x40) >> 6;
7878         //int blinkChar = (m_tile_control_ram[current_screen_character] & 0x80) >> 7;
7979
80         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
80         drawgfx_transpen(bitmap, cliprect, machine().gfx[0],
8181               m_tile_ram[current_screen_character] + (0x100 * tileOffs),
8282               palIndex,
8383               0, 0, charx*8, chary*8, 0);
trunk/src/mame/drivers/halleys.c
r17988r17989
14941494      bitmap.fill(m_bgcolor, cliprect);
14951495
14961496#ifdef MAME_DEBUG
1497   if (screen.machine().root_device().ioport("DEBUG")->read()) copy_scroll_xp(bitmap, m_render_layer[3], *m_scrollx0, *m_scrolly0); // not used???
1497   if (machine().root_device().ioport("DEBUG")->read()) copy_scroll_xp(bitmap, m_render_layer[3], *m_scrollx0, *m_scrolly0); // not used???
14981498#endif
14991499
15001500   copy_scroll_xp(bitmap, m_render_layer[2], *m_scrollx1, *m_scrolly1);
r17988r17989
15041504   // HALF-HACK: apply RGB filter when the following conditions are met
15051505   i = m_io_ram[0xa0];
15061506   j = m_io_ram[0xa1];
1507   if (m_io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen.machine(), bitmap, i);
1507   if (m_io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(machine(), bitmap, i);
15081508   return 0;
15091509}
15101510
trunk/src/mame/drivers/statriv2.c
r17988r17989
194194
195195UINT32 statriv2_state::screen_update_statriv2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
196196{
197   if (tms9927_screen_reset(screen.machine().device("tms")))
198      bitmap.fill(get_black_pen(screen.machine()), cliprect);
197   if (tms9927_screen_reset(machine().device("tms")))
198      bitmap.fill(get_black_pen(machine()), cliprect);
199199   else
200200      m_tilemap->draw(bitmap, cliprect, 0, 0);
201201   return 0;
trunk/src/mame/drivers/carrera.c
r17988r17989
260260      {
261261         int tile = m_tileram[count&0x7ff] | m_tileram[(count&0x7ff)+0x800]<<8;
262262
263         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,0,0,0,x*8,y*8);
263         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],tile,0,0,0,x*8,y*8);
264264         count++;
265265      }
266266   }
trunk/src/mame/drivers/aristmk6.c
r17988r17989
3232   int x,y,count;
3333   const UINT8 *blit_ram = memregion("maincpu")->base();
3434
35   if(screen.machine().input().code_pressed(KEYCODE_Z))
35   if(machine().input().code_pressed(KEYCODE_Z))
3636      m_test_x++;
3737
38   if(screen.machine().input().code_pressed(KEYCODE_X))
38   if(machine().input().code_pressed(KEYCODE_X))
3939      m_test_x--;
4040
41   if(screen.machine().input().code_pressed(KEYCODE_A))
41   if(machine().input().code_pressed(KEYCODE_A))
4242      m_test_y++;
4343
44   if(screen.machine().input().code_pressed(KEYCODE_S))
44   if(machine().input().code_pressed(KEYCODE_S))
4545      m_test_y--;
4646
47   if(screen.machine().input().code_pressed(KEYCODE_Q))
47   if(machine().input().code_pressed(KEYCODE_Q))
4848      m_start_offs+=0x2000;
4949
50   if(screen.machine().input().code_pressed(KEYCODE_W))
50   if(machine().input().code_pressed(KEYCODE_W))
5151      m_start_offs-=0x2000;
5252
53   if(screen.machine().input().code_pressed(KEYCODE_E))
53   if(machine().input().code_pressed(KEYCODE_E))
5454      m_start_offs++;
5555
56   if(screen.machine().input().code_pressed(KEYCODE_R))
56   if(machine().input().code_pressed(KEYCODE_R))
5757      m_start_offs--;
5858
59   if(screen.machine().input().code_pressed_once(KEYCODE_L))
59   if(machine().input().code_pressed_once(KEYCODE_L))
6060      m_type^=1;
6161
6262   popmessage("%d %d %04x %d",m_test_x,m_test_y,m_start_offs,m_type);
6363
64   bitmap.fill(get_black_pen(screen.machine()), cliprect);
64   bitmap.fill(get_black_pen(machine()), cliprect);
6565
6666   count = (m_start_offs);
6767
r17988r17989
9696            color = blit_ram[count];
9797
9898            if(cliprect.contains(x, y))
99               bitmap.pix32(y, x) = screen.machine().pens[color];
99               bitmap.pix32(y, x) = machine().pens[color];
100100
101101            count++;
102102         }
trunk/src/mame/drivers/ttchamp.c
r17988r17989
104104//  int i;
105105   static const int xxx=320,yyy=204;
106106
107   bitmap.fill(get_black_pen(screen.machine()));
107   bitmap.fill(get_black_pen(machine()));
108108
109109//  for (i=0;i<256;i++)
110110//  {
trunk/src/mame/drivers/acommand.c
r17988r17989
253253UINT32 acommand_state::screen_update_acommand(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
254254{
255255   m_bg_tilemap->draw(bitmap, cliprect, 0,0);
256   draw_sprites(screen.machine(),bitmap,cliprect,0,0);
256   draw_sprites(machine(),bitmap,cliprect,0,0);
257257   m_tx_tilemap->draw(bitmap, cliprect, 0,0);
258258
259259   /*Order might be wrong,but these for sure are the led numbers tested*/
trunk/src/mame/drivers/segald.c
r17988r17989
111111{
112112   bitmap.fill(0, cliprect);
113113
114   astron_draw_characters(screen.machine(), bitmap, cliprect);
115   astron_draw_sprites(screen.machine(), bitmap, cliprect);
114   astron_draw_characters(machine(), bitmap, cliprect);
115   astron_draw_sprites(machine(), bitmap, cliprect);
116116
117117   return 0;
118118}
trunk/src/mame/drivers/srmp5.c
r17988r17989
212212      {
213213         if (m_tileduty[i] == 1)
214214         {
215            screen.machine().gfx[0]->decode(i);
215            machine().gfx[0]->decode(i);
216216            m_tileduty[i] = 0;
217217         }
218218      }
trunk/src/mame/drivers/destroyr.c
r17988r17989
8282            continue;
8383      }
8484
85      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], num, 0, flipx, 0, horz, 16 * i, 0);
85      drawgfx_transpen(bitmap, cliprect, machine().gfx[2], num, 0, flipx, 0, horz, 16 * i, 0);
8686   }
8787
8888   /* draw alpha numerics */
r17988r17989
9292      {
9393         int num = m_alpha_num_ram[32 * i + j];
9494
95         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0);
95         drawgfx_transpen(bitmap, cliprect, machine().gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0);
9696      }
9797   }
9898
r17988r17989
103103      int horz = 256 - m_minor_obj_ram[i + 2];
104104      int vert = 256 - m_minor_obj_ram[i + 4];
105105
106      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], num, 0, 0, 0, horz, vert, 0);
106      drawgfx_transpen(bitmap, cliprect, machine().gfx[1], num, 0, 0, 0, horz, vert, 0);
107107   }
108108
109109   /* draw waves */
110110   for (i = 0; i < 4; i++)
111111   {
112      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[3], m_wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0);
112      drawgfx_transpen(bitmap, cliprect, machine().gfx[3], m_wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0);
113113   }
114114
115115   /* draw cursor */
trunk/src/mame/drivers/feversoc.c
r17988r17989
9494   UINT32 *spriteram32 = m_spriteram;
9595   int offs,spr_offs,colour,sx,sy,h,w,dx,dy;
9696
97   bitmap.fill(screen.machine().pens[0], cliprect); //black pen
97   bitmap.fill(machine().pens[0], cliprect); //black pen
9898
9999   for(offs=(0x2000/4)-2;offs>-1;offs-=2)
100100   {
r17988r17989
112112
113113      for(dx=0;dx<w;dx++)
114114         for(dy=0;dy<h;dy++)
115            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f);
115            drawgfx_transpen(bitmap,cliprect,machine().gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f);
116116   }
117117
118118   return 0;
trunk/src/mame/drivers/multigam.c
r17988r17989
11181118UINT32 multigam_state::screen_update_multigam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
11191119{
11201120   /* render the ppu */
1121   ppu2c0x_device *ppu = screen.machine().device<ppu2c0x_device>("ppu");
1121   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
11221122   ppu->render(bitmap, 0, 0, 0, 0);
11231123   return 0;
11241124}
trunk/src/mame/drivers/fortecar.c
r17988r17989
369369         if(bpp)
370370            color&=0x3;
371371
372         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[bpp],tile,color,0,0,x*8,y*8);
372         drawgfx_opaque(bitmap,cliprect,machine().gfx[bpp],tile,color,0,0,x*8,y*8);
373373         count++;
374374
375375      }
trunk/src/mame/drivers/superwng.c
r17988r17989
152152      int sy = m_colorram_bg[i];
153153      int color = m_colorram_bg[i + 1] & 0xf;
154154
155      drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[1],
155      drawgfx_transpen(bitmap, cliprect,machine().gfx[1],
156156                  code,
157157                  color,
158158                  flip, flip,
trunk/src/mame/drivers/guab.c
r17988r17989
269269   /* If blanked, fill with black */
270270   if (state.blanked)
271271   {
272      bitmap.fill(get_black_pen(screen.machine()), cliprect);
272      bitmap.fill(get_black_pen(machine()), cliprect);
273273      return 0;
274274   }
275275
r17988r17989
283283         UINT8 pen = src[x >> 1];
284284
285285         /* Draw two 4-bit pixels */
286         *dest++ = screen.machine().pens[pen >> 4];
287         *dest++ = screen.machine().pens[pen & 0x0f];
286         *dest++ = machine().pens[pen >> 4];
287         *dest++ = machine().pens[pen & 0x0f];
288288      }
289289   }
290290
trunk/src/mame/drivers/bingor.c
r17988r17989
466466{
467467   int x,y,count;
468468
469   bitmap.fill(get_black_pen(screen.machine()), cliprect);
469   bitmap.fill(get_black_pen(machine()), cliprect);
470470
471471   count = (0x2000/2);
472472
r17988r17989
479479         color = (m_blit_ram[count] & 0xf000)>>12;
480480
481481         if(cliprect.contains(x+3, y))
482            bitmap.pix32(y, x+3) = screen.machine().pens[color];
482            bitmap.pix32(y, x+3) = machine().pens[color];
483483
484484         color = (m_blit_ram[count] & 0x0f00)>>8;
485485
486486         if(cliprect.contains(x+2, y))
487            bitmap.pix32(y, x+2) = screen.machine().pens[color];
487            bitmap.pix32(y, x+2) = machine().pens[color];
488488
489489         color = (m_blit_ram[count] & 0x00f0)>>4;
490490
491491         if(cliprect.contains(x+1, y))
492            bitmap.pix32(y, x+1) = screen.machine().pens[color];
492            bitmap.pix32(y, x+1) = machine().pens[color];
493493
494494         color = (m_blit_ram[count] & 0x000f)>>0;
495495
496496         if(cliprect.contains(x+0, y))
497            bitmap.pix32(y, x+0) = screen.machine().pens[color];
497            bitmap.pix32(y, x+0) = machine().pens[color];
498498
499499         count++;
500500      }
trunk/src/mame/drivers/mpu4vid.c
r17988r17989
517517
518518   bitmap.fill(0, cliprect);
519519
520   m_scn2674->scn2574_draw(screen.machine(), bitmap, cliprect, m_vid_mainram );
520   m_scn2674->scn2574_draw(machine(), bitmap, cliprect, m_vid_mainram );
521521
522522   return 0;
523523}
trunk/src/mame/drivers/cham24.c
r17988r17989
306306UINT32 cham24_state::screen_update_cham24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
307307{
308308   /* render the ppu */
309   ppu2c0x_device *ppu = screen.machine().device<ppu2c0x_device>("ppu");
309   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
310310   ppu->render(bitmap, 0, 0, 0, 0);
311311   return 0;
312312}
trunk/src/mame/drivers/silvmil.c
r17988r17989
154154
155155   m_bg_layer->draw(bitmap, cliprect, 0, 0);
156156   m_fg_layer->draw(bitmap, cliprect, 0, 0);
157   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
157   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
158158   return 0;
159159}
160160
trunk/src/mame/drivers/rbmk.c
r17988r17989
508508      for (x=0;x<64;x++)
509509      {
510510         int tile = m_gms_vidram2[count+0x600];
511         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],(tile&0xfff)+((m_tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32);
511         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],(tile&0xfff)+((m_tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32);
512512         count++;
513513      }
514514   }
r17988r17989
520520      for (x=0;x<64;x++)
521521      {
522522         int tile = m_gms_vidram[count];
523         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],(tile&0xfff)+((m_tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0);
523         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],(tile&0xfff)+((m_tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0);
524524         count++;
525525      }
526526   }
trunk/src/mame/drivers/trvmadns.c
r17988r17989
295295UINT32 trvmadns_state::screen_update_trvmadns(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
296296{
297297   int x,y,count;
298   gfx_element *gfx = screen.machine().gfx[0];
298   gfx_element *gfx = machine().gfx[0];
299299
300300   bitmap.fill(0xd, cliprect);
301301
trunk/src/mame/drivers/backfire.c
r17988r17989
121121   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
122122   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
123123
124   screen.machine().priority_bitmap.fill(0);
124   machine().priority_bitmap.fill(0);
125125   bitmap.fill(0x100, cliprect);
126126
127127   if (m_left_priority[0] == 0)
128128   {
129129      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1);
130130      deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
131      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram_1, 0x800);
131      machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram_1, 0x800);
132132   }
133133   else if (m_left_priority[0] == 2)
134134   {
135135      deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
136136      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
137      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram_1, 0x800);
137      machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram_1, 0x800);
138138   }
139139   else
140140      popmessage( "unknown left priority %08x", m_left_priority[0]);
r17988r17989
153153   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
154154   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
155155
156   screen.machine().priority_bitmap.fill(0);
156   machine().priority_bitmap.fill(0);
157157   bitmap.fill(0x500, cliprect);
158158
159159   if (m_right_priority[0] == 0)
160160   {
161161      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1);
162162      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
163      screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram_2, 0x800);
163      machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram_2, 0x800);
164164   }
165165   else if (m_right_priority[0] == 2)
166166   {
167167      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
168168      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
169      screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram_2, 0x800);
169      machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram_2, 0x800);
170170   }
171171   else
172172      popmessage( "unknown right priority %08x", m_right_priority[0]);
trunk/src/mame/drivers/cubeqst.c
r17988r17989
127127   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
128128   {
129129      int i;
130      int num_entries = cubeqcpu_get_ptr_ram_val(screen.machine().device("line_cpu"), y);
131      UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen.machine().device("line_cpu"));
130      int num_entries = cubeqcpu_get_ptr_ram_val(machine().device("line_cpu"), y);
131      UINT32 *stk_ram = cubeqcpu_get_stack_ram(machine().device("line_cpu"));
132132      UINT32 *dest = &bitmap.pix32(y);
133133      UINT32 pen;
134134
trunk/src/mame/drivers/astrocorp.c
r17988r17989
157157   if (m_screen_enable & 1)
158158      copybitmap(bitmap, m_bitmap, 0,0,0,0, cliprect);
159159   else
160      bitmap.fill(get_black_pen(screen.machine()), cliprect);
160      bitmap.fill(get_black_pen(machine()), cliprect);
161161
162162   return 0;
163163}
trunk/src/mame/drivers/coolridr.c
r17988r17989
335335UINT32 coolridr_state::screen_update_coolridr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
336336{
337337   /* planes seems to basically be at 0x8000 and 0x28000... */
338   gfx_element *gfx = screen.machine().gfx[2];
338   gfx_element *gfx = machine().gfx[2];
339339   UINT32 count;
340340   int y,x;
341341
342342
343   if(screen.machine().input().code_pressed(KEYCODE_Z))
343   if(machine().input().code_pressed(KEYCODE_Z))
344344      m_test_offs+=4;
345345
346   if(screen.machine().input().code_pressed(KEYCODE_X))
346   if(machine().input().code_pressed(KEYCODE_X))
347347      m_test_offs-=4;
348348
349   if(screen.machine().input().code_pressed(KEYCODE_C))
349   if(machine().input().code_pressed(KEYCODE_C))
350350      m_test_offs+=0x40;
351351
352   if(screen.machine().input().code_pressed(KEYCODE_V))
352   if(machine().input().code_pressed(KEYCODE_V))
353353      m_test_offs-=0x40;
354354
355   if(screen.machine().input().code_pressed(KEYCODE_B))
355   if(machine().input().code_pressed(KEYCODE_B))
356356      m_test_offs+=0x400;
357357
358   if(screen.machine().input().code_pressed(KEYCODE_N))
358   if(machine().input().code_pressed(KEYCODE_N))
359359      m_test_offs-=0x400;
360360
361   if(screen.machine().input().code_pressed_once(KEYCODE_A))
361   if(machine().input().code_pressed_once(KEYCODE_A))
362362      m_color++;
363363
364   if(screen.machine().input().code_pressed_once(KEYCODE_S))
364   if(machine().input().code_pressed_once(KEYCODE_S))
365365      m_color--;
366366
367367   if(m_test_offs > 0x100000*4)
trunk/src/mame/drivers/cobra.c
r17988r17989
10001000
10011001   if (m_has_psac)
10021002   {
1003      device_t *k001604 = screen.machine().device("k001604");
1003      device_t *k001604 = machine().device("k001604");
10041004
10051005      k001604_draw_back_layer(k001604, bitmap, cliprect);
10061006      k001604_draw_front_layer(k001604, bitmap, cliprect);
trunk/src/mame/drivers/intrscti.c
r17988r17989
3838   int y,x;
3939   int count;
4040
41   bitmap.fill(get_black_pen(screen.machine()), cliprect);
41   bitmap.fill(get_black_pen(machine()), cliprect);
4242
4343   count = 0;
4444   for (y=0;y<32;y++)
r17988r17989
4747      {
4848         int dat;
4949         dat = m_vram[count];
50         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
50         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
5151         count++;
5252      }
5353   }
r17988r17989
5959      {
6060         int dat;
6161         dat = m_vram[count];
62         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],dat+0x100,0,0,0,x*8,y*8,0);
62         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],dat+0x100,0,0,0,x*8,y*8,0);
6363         count++;
6464      }
6565   }
trunk/src/mame/drivers/sfbonus.c
r17988r17989
10731073   globalyscroll += 8;
10741074   globalxscroll += 8;
10751075
1076   bitmap.fill(screen.machine().pens[0], cliprect);
1077   m_temp_reel_bitmap->fill(screen.machine().pens[0], cliprect);
1076   bitmap.fill(machine().pens[0], cliprect);
1077   m_temp_reel_bitmap->fill(machine().pens[0], cliprect);
10781078
10791079   /* render reels to bitmap */
10801080   sfbonus_draw_reel_layer(screen,*m_temp_reel_bitmap,cliprect,0);
r17988r17989
11701170    m_1800_regs[7]);
11711171#endif
11721172
1173   ipt = screen.machine().system().ipt;
1173   ipt = machine().system().ipt;
11741174   if ((ipt == INPUT_PORTS_NAME(amcoe2_reels3)) || (ipt == INPUT_PORTS_NAME(amcoe2_reels4))
11751175      || (ipt == INPUT_PORTS_NAME(amcoe2_poker)))
11761176   {
trunk/src/mame/drivers/crystal.c
r17988r17989
651651
652652UINT32 crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
653653{
654   address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
654   address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
655655   int DoFlip;
656656
657657   UINT32 B0 = 0x0;
r17988r17989
716716   // rising edge
717717   if (state)
718718   {
719      address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
719      address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
720720      UINT16 head, tail;
721721      int DoFlip = 0;
722722
trunk/src/mame/drivers/chinsan.c
r17988r17989
109109         int tileno, colour;
110110         tileno = m_video[count] | (m_video[count + 0x800] << 8);
111111         colour = m_video[count + 0x1000] >> 3;
112         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tileno,colour,0,0,x*8,y*8);
112         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],tileno,colour,0,0,x*8,y*8);
113113         count++;
114114      }
115115   }
trunk/src/mame/drivers/famibox.c
r17988r17989
542542UINT32 famibox_state::screen_update_famibox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
543543{
544544   /* render the ppu */
545   ppu2c0x_device *ppu = screen.machine().device<ppu2c0x_device>("ppu");
545   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
546546   ppu->render(bitmap, 0, 0, 0, 0);
547547   return 0;
548548}
trunk/src/mame/drivers/cshooter.c
r17988r17989
166166         {
167167            int tile=0x30+((spriteram[i]>>2)&0x1f);
168168
169            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
169            drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
170170                     tile,
171171                     spriteram[i+1],
172172                     0, 0,
173173                     spriteram[i+3],spriteram[i+2],3);
174174
175            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
175            drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
176176                     tile,
177177                     spriteram[i+1],
178178                     0, 0,
179179                     spriteram[i+3]+8,spriteram[i+2],3);
180180
181            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
181            drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
182182                     tile,
183183                     spriteram[i+1],
184184                     0, 0,
185185                     spriteram[i+3]+8,spriteram[i+2]+8,3);
186186
187            drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],
187            drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
188188                     tile,
189189                     spriteram[i+1],
190190                     0, 0,
trunk/src/mame/drivers/hitme.c
r17988r17989
6868UINT32 hitme_state::screen_update_hitme(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6969{
7070   /* the card width resistor comes from an input port, scaled to the range 0-25 kOhms */
71   double width_resist = screen.machine().root_device().ioport("WIDTH")->read() * 25000 / 100;
71   double width_resist = machine().root_device().ioport("WIDTH")->read() * 25000 / 100;
7272   /* this triggers a oneshot for the following length of time */
7373   double width_duration = 0.45 * 1000e-12 * width_resist;
7474   /* the dot clock runs at the standard horizontal frequency * 320+16 clocks per scanline */
trunk/src/mame/drivers/lgp.c
r17988r17989
101101   int charx, chary;
102102
103103   /* make color 0 transparent */
104   palette_set_color(screen.machine(), 0, MAKE_ARGB(0,0,0,0));
104   palette_set_color(machine(), 0, MAKE_ARGB(0,0,0,0));
105105
106106   /* clear */
107107   bitmap.fill(0, cliprect);
r17988r17989
115115
116116         /* Somewhere there's a flag that offsets the tilemap by 0x100*x */
117117         /* Palette is likely set somewhere as well (tile_control_ram?) */
118         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
118         drawgfx_transpen(bitmap, cliprect, machine().gfx[0],
119119               m_tile_ram[current_screen_character],
120120               0,
121121               0, 0, charx*8, chary*8, 0);
trunk/src/mame/drivers/multfish.c
r17988r17989
285285{
286286   int i;
287287
288   bitmap.fill(get_black_pen(screen.machine()), cliprect);
288   bitmap.fill(get_black_pen(machine()), cliprect);
289289
290290   if (!m_disp_enable) return 0;
291291
trunk/src/mame/drivers/tmmjprd.c
r17988r17989
295295{
296296   UINT8* gfxroms = memregion("gfx2")->base();
297297
298   bitmap.fill(get_black_pen(screen.machine()), cliprect);
298   bitmap.fill(get_black_pen(machine()), cliprect);
299299
300   ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, m_tilemap_ram[3], m_tilemap_regs[3], gfxroms );
301   draw_sprites(screen.machine(),bitmap,cliprect, 1);
302   ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, m_tilemap_ram[2], m_tilemap_regs[2], gfxroms );
300   ttmjprd_draw_tilemap( machine(), bitmap, cliprect, m_tilemap_ram[3], m_tilemap_regs[3], gfxroms );
301   draw_sprites(machine(),bitmap,cliprect, 1);
302   ttmjprd_draw_tilemap( machine(), bitmap, cliprect, m_tilemap_ram[2], m_tilemap_regs[2], gfxroms );
303303
304304   /*
305305    popmessage("%08x %08x %08x %08x %08x %08x",
r17988r17989
329329{
330330   UINT8* gfxroms = memregion("gfx2")->base();
331331
332   bitmap.fill(get_black_pen(screen.machine()), cliprect);
332   bitmap.fill(get_black_pen(machine()), cliprect);
333333
334   ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, m_tilemap_ram[1], m_tilemap_regs[1], gfxroms );
335   draw_sprites(screen.machine(),bitmap,cliprect, 0);
336   ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, m_tilemap_ram[0], m_tilemap_regs[0], gfxroms );
334   ttmjprd_draw_tilemap( machine(), bitmap, cliprect, m_tilemap_ram[1], m_tilemap_regs[1], gfxroms );
335   draw_sprites(machine(),bitmap,cliprect, 0);
336   ttmjprd_draw_tilemap( machine(), bitmap, cliprect, m_tilemap_ram[0], m_tilemap_regs[0], gfxroms );
337337
338338   return 0;
339339}
trunk/src/mame/drivers/witch.c
r17988r17989
774774
775775   m_gfx1_tilemap->draw(bitmap, cliprect, 0,0);
776776   m_gfx0a_tilemap->draw(bitmap, cliprect, 0,0);
777   draw_sprites(screen.machine(), bitmap, cliprect);
777   draw_sprites(machine(), bitmap, cliprect);
778778   m_gfx0b_tilemap->draw(bitmap, cliprect, 0,0);
779779   return 0;
780780}
trunk/src/mame/drivers/luckgrln.c
r17988r17989
362362            if (bgenable==3) m_reel4_tilemap->draw(bitmap, clip, 0, 0);
363363         }
364364
365         if (tileattr&0x08) drawgfx_transpen(bitmap,clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
365         if (tileattr&0x08) drawgfx_transpen(bitmap,clip,machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
366366
367367#else // treat it as priority flag instead (looks better in non-adult title screen - needs verifying)
368         if (!(tileattr&0x08)) drawgfx_transpen(bitmap,clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
368         if (!(tileattr&0x08)) drawgfx_transpen(bitmap,clip,machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
369369
370370         if (tileattr&0x04)
371371         {
r17988r17989
375375            if (bgenable==3) m_reel4_tilemap->draw(bitmap, clip, 0, 0);
376376         }
377377
378         if ((tileattr&0x08)) drawgfx_transpen(bitmap,clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
378         if ((tileattr&0x08)) drawgfx_transpen(bitmap,clip,machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
379379#endif
380380
381381         count++;
trunk/src/mame/drivers/sigmab98.c
r17988r17989
309309   int layers_ctrl = -1;
310310
311311#ifdef MAME_DEBUG
312   if (screen.machine().input().code_pressed(KEYCODE_Z))
312   if (machine().input().code_pressed(KEYCODE_Z))
313313   {
314314      int msk = 0;
315      if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
316      if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
317      if (screen.machine().input().code_pressed(KEYCODE_E))   msk |= 4;
318      if (screen.machine().input().code_pressed(KEYCODE_R))   msk |= 8;
315      if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
316      if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
317      if (machine().input().code_pressed(KEYCODE_E))   msk |= 4;
318      if (machine().input().code_pressed(KEYCODE_R))   msk |= 8;
319319      if (msk != 0) layers_ctrl &= msk;
320320   }
321321#endif
322322
323   bitmap.fill(get_black_pen(screen.machine()), cliprect);
323   bitmap.fill(get_black_pen(machine()), cliprect);
324324
325325   // Draw from priority 3 (bottom, converted to a bitmask) to priority 0 (top)
326   draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 8);
327   draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 4);
328   draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 2);
329   draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 1);
326   draw_sprites(machine(), bitmap, cliprect, layers_ctrl & 8);
327   draw_sprites(machine(), bitmap, cliprect, layers_ctrl & 4);
328   draw_sprites(machine(), bitmap, cliprect, layers_ctrl & 2);
329   draw_sprites(machine(), bitmap, cliprect, layers_ctrl & 1);
330330
331331   return 0;
332332}
trunk/src/mame/drivers/popobear.c
r17988r17989
264264
265265   //popmessage("%04x",m_vregs[0/2]);
266266
267   draw_layer(screen.machine(),bitmap,cliprect,3);
268   draw_layer(screen.machine(),bitmap,cliprect,2);
269   draw_layer(screen.machine(),bitmap,cliprect,1);
270   draw_layer(screen.machine(),bitmap,cliprect,0);
271   draw_sprites(screen.machine(),bitmap,cliprect);
267   draw_layer(machine(),bitmap,cliprect,3);
268   draw_layer(machine(),bitmap,cliprect,2);
269   draw_layer(machine(),bitmap,cliprect,1);
270   draw_layer(machine(),bitmap,cliprect,0);
271   draw_sprites(machine(),bitmap,cliprect);
272272
273273   return 0;
274274}
trunk/src/mame/drivers/astrof.c
r17988r17989
417417{
418418   pen_t pens[ASTROF_NUM_PENS];
419419
420   astrof_get_pens(screen.machine(), pens);
420   astrof_get_pens(machine(), pens);
421421
422   video_update_common(screen.machine(), bitmap, cliprect, pens);
422   video_update_common(machine(), bitmap, cliprect, pens);
423423
424424   return 0;
425425}
r17988r17989
429429{
430430   pen_t pens[TOMAHAWK_NUM_PENS];
431431
432   tomahawk_get_pens(screen.machine(), pens);
432   tomahawk_get_pens(machine(), pens);
433433
434   video_update_common(screen.machine(), bitmap, cliprect, pens);
434   video_update_common(machine(), bitmap, cliprect, pens);
435435
436436   return 0;
437437}
trunk/src/mame/drivers/galpanic.c
r17988r17989
129129   // rising edge
130130   if (state)
131131   {
132      device_t *pandora = screen.machine().device("pandora");
132      device_t *pandora = machine().device("pandora");
133133      pandora_eof(pandora);
134134   }
135135}
trunk/src/mame/drivers/igspoker.c
r17988r17989
201201
202202UINT32 igspoker_state::screen_update_igs_video(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
203203{
204   bitmap.fill(get_black_pen(screen.machine()), cliprect);
204   bitmap.fill(get_black_pen(machine()), cliprect);
205205
206206   // FIX: CSK227IT must have some way to disable background, or wrong gfx?
207207   if (m_bg_enable) m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/drivers/mazerbla.c
r17988r17989
239239
240240   m_tmpbitmaps[0].fill(color_base);
241241
242   if (screen.machine().input().code_pressed_once(KEYCODE_1))   /* plane 1 */
242   if (machine().input().code_pressed_once(KEYCODE_1))   /* plane 1 */
243243      planes_enabled[0] ^= 1;
244244
245   if (screen.machine().input().code_pressed_once(KEYCODE_2))   /* plane 2 */
245   if (machine().input().code_pressed_once(KEYCODE_2))   /* plane 2 */
246246      planes_enabled[1] ^= 1;
247247
248   if (screen.machine().input().code_pressed_once(KEYCODE_3))   /* plane 3 */
248   if (machine().input().code_pressed_once(KEYCODE_3))   /* plane 3 */
249249      planes_enabled[2] ^= 1;
250250
251   if (screen.machine().input().code_pressed_once(KEYCODE_4))   /* plane 4 */
251   if (machine().input().code_pressed_once(KEYCODE_4))   /* plane 4 */
252252      planes_enabled[3] ^= 1;
253253
254   if (screen.machine().input().code_pressed_once(KEYCODE_I))   /* show/hide debug info */
254   if (machine().input().code_pressed_once(KEYCODE_I))   /* show/hide debug info */
255255      m_dbg_info = !m_dbg_info;
256256
257   if (screen.machine().input().code_pressed_once(KEYCODE_G))   /* enable gfx area handling */
257   if (machine().input().code_pressed_once(KEYCODE_G))   /* enable gfx area handling */
258258      m_dbg_gfx_e = !m_dbg_gfx_e;
259259
260   if (screen.machine().input().code_pressed_once(KEYCODE_C))   /* enable color area handling */
260   if (machine().input().code_pressed_once(KEYCODE_C))   /* enable color area handling */
261261      m_dbg_clr_e = !m_dbg_clr_e;
262262
263   if (screen.machine().input().code_pressed_once(KEYCODE_V))   /* draw only when vbank==dbg_vbank */
263   if (machine().input().code_pressed_once(KEYCODE_V))   /* draw only when vbank==dbg_vbank */
264264      m_dbg_vbank ^= 1;
265265
266   if (screen.machine().input().code_pressed_once(KEYCODE_L))   /* showlookup ram */
266   if (machine().input().code_pressed_once(KEYCODE_L))   /* showlookup ram */
267267      m_dbg_lookup = (m_dbg_lookup + 1) % 5;   //0,1,2,3, 4-off
268268
269269
270270   if (m_dbg_info)
271271   {
272272      sprintf(buf,"I-info, G-gfx, C-color, V-vbank, 1-4 enable planes");
273      ui_draw_text(buf, 10, 0 * ui_get_line_height(screen.machine()));
273      ui_draw_text(buf, 10, 0 * ui_get_line_height(machine()));
274274
275275      sprintf(buf,"g:%1i c:%1i v:%1i vbk=%1i  planes=%1i%1i%1i%1i  ", m_dbg_gfx_e&1, m_dbg_clr_e&1, m_dbg_vbank, vbank&1,
276276         planes_enabled[0],
r17988r17989
278278         planes_enabled[2],
279279         planes_enabled[3] );
280280
281      ui_draw_text(buf, 10, 1 * ui_get_line_height(screen.machine()));
281      ui_draw_text(buf, 10, 1 * ui_get_line_height(machine()));
282282
283283      if (m_dbg_lookup!=4)
284284      {
r17988r17989
293293            {
294294               sprintf(buf + strlen(buf), "%02x ", lookup_ram[lookup_offs + x + y * 16]);
295295            }
296            ui_draw_text(buf, 0, (2 + y) * ui_get_line_height(screen.machine()));
296            ui_draw_text(buf, 0, (2 + y) * ui_get_line_height(machine()));
297297         }
298298      }
299299   }
trunk/src/mame/drivers/itgambl3.c
r17988r17989
7878   int x,y,count;
7979   const UINT8 *blit_ram = memregion("gfx1")->base();
8080
81   if(screen.machine().input().code_pressed(KEYCODE_Z))
81   if(machine().input().code_pressed(KEYCODE_Z))
8282      m_test_x++;
8383
84   if(screen.machine().input().code_pressed(KEYCODE_X))
84   if(machine().input().code_pressed(KEYCODE_X))
8585      m_test_x--;
8686
87   if(screen.machine().input().code_pressed(KEYCODE_A))
87   if(machine().input().code_pressed(KEYCODE_A))
8888      m_test_y++;
8989
90   if(screen.machine().input().code_pressed(KEYCODE_S))
90   if(machine().input().code_pressed(KEYCODE_S))
9191      m_test_y--;
9292
93   if(screen.machine().input().code_pressed(KEYCODE_Q))
93   if(machine().input().code_pressed(KEYCODE_Q))
9494      m_start_offs+=0x200;
9595
96   if(screen.machine().input().code_pressed(KEYCODE_W))
96   if(machine().input().code_pressed(KEYCODE_W))
9797      m_start_offs-=0x200;
9898
99   if(screen.machine().input().code_pressed(KEYCODE_E))
99   if(machine().input().code_pressed(KEYCODE_E))
100100      m_start_offs++;
101101
102   if(screen.machine().input().code_pressed(KEYCODE_R))
102   if(machine().input().code_pressed(KEYCODE_R))
103103      m_start_offs--;
104104
105105   popmessage("%d %d %04x",m_test_x,m_test_y,m_start_offs);
106106
107   bitmap.fill(get_black_pen(screen.machine()), cliprect);
107   bitmap.fill(get_black_pen(machine()), cliprect);
108108
109109   count = (m_start_offs);
110110
r17988r17989
117117         color = (blit_ram[count] & 0xff)>>0;
118118
119119         if(cliprect.contains(x, y))
120            bitmap.pix32(y, x) = screen.machine().pens[color];
120            bitmap.pix32(y, x) = machine().pens[color];
121121
122122         count++;
123123      }
trunk/src/mame/drivers/acefruit.c
r17988r17989
111111
112112         if( color < 0x4 )
113113         {
114            drawgfx_opaque( bitmap, cliprect, screen.machine().gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 );
114            drawgfx_opaque( bitmap, cliprect, machine().gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 );
115115         }
116116         else if( color >= 0x5 && color <= 0x7 )
117117         {
r17988r17989
119119            int x;
120120            static const int spriteskip[] = { 1, 2, 4 };
121121            int spritesize = spriteskip[ color - 5 ];
122            gfx_element *gfx = screen.machine().gfx[ 0 ];
122            gfx_element *gfx = machine().gfx[ 0 ];
123123
124124            for( x = 0; x < 16; x++ )
125125            {
trunk/src/mame/drivers/limenko.c
r17988r17989
519519{
520520   // m_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?)
521521
522   screen.machine().priority_bitmap.fill(0, cliprect);
522   machine().priority_bitmap.fill(0, cliprect);
523523
524524   m_bg_tilemap->enable(m_videoreg[0] & 4);
525525   m_md_tilemap->enable(m_videoreg[0] & 2);
r17988r17989
538538   m_fg_tilemap->draw(bitmap, cliprect, 0,1);
539539
540540   if(m_videoreg[0] & 8)
541      copy_sprites(screen.machine(), bitmap, m_sprites_bitmap, screen.machine().priority_bitmap, cliprect);
541      copy_sprites(machine(), bitmap, m_sprites_bitmap, machine().priority_bitmap, cliprect);
542542
543543   return 0;
544544}
trunk/src/mame/drivers/poo.c
r17988r17989
8080{
8181   int y,x;
8282   int count;
83   gfx_element *gfx = screen.machine().gfx[0];
83   gfx_element *gfx = machine().gfx[0];
8484
8585   count = 0;
8686
trunk/src/mame/drivers/galgame.c
r17988r17989
171171
172172UINT32 galaxygame_state::screen_update_galaxygame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
173173{
174   bitmap.fill(get_black_pen(screen.machine()), cliprect);
174   bitmap.fill(get_black_pen(machine()), cliprect);
175175   for (int i = 0; i < m_point_display_list_index; i++ )
176176   {
177177      bitmap.pix16(m_point_display_list[i].x >> 7, m_point_display_list[i].y >> 7) = 1;
trunk/src/mame/drivers/drtomy.c
r17988r17989
137137
138138   m_tilemap_bg->draw(bitmap, cliprect, 0, 0);
139139   m_tilemap_fg->draw(bitmap, cliprect, 0, 0);
140   draw_sprites(screen.machine(), bitmap, cliprect);
140   draw_sprites(machine(), bitmap, cliprect);
141141   return 0;
142142}
143143
trunk/src/mame/drivers/calorie.c
r17988r17989
192192      if (m_sprites[x + 1] & 0x10)
193193      {
194194          /* 32x32 sprites */
195         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0);
195         drawgfx_transpen(bitmap, cliprect, machine().gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0);
196196      }
197197      else
198198      {
199199         /* 16x16 sprites */
200         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], tileno, color, flipx, flipy, xpos, ypos - 15, 0);
200         drawgfx_transpen(bitmap, cliprect, machine().gfx[2], tileno, color, flipx, flipy, xpos, ypos - 15, 0);
201201      }
202202   }
203203   return 0;
trunk/src/mame/drivers/bmcbowl.c
r17988r17989
157157*/
158158
159159   int x,y,z,pixdat;
160   bitmap.fill(get_black_pen(screen.machine()), cliprect);
160   bitmap.fill(get_black_pen(machine()), cliprect);
161161
162162   z=0;
163163   for (y=0;y<230;y++)
trunk/src/mame/drivers/tasman.c
r17988r17989
5858UINT32 kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5959{
6060   #if CUSTOM_DRAW
61   gfx_element *gfx = screen.machine().gfx[0];
61   gfx_element *gfx = machine().gfx[0];
6262   UINT32 count;
6363
6464   count = 0;
r17988r17989
6969      {
7070         UINT32 tile = m_vram[count] & 0xffff;
7171
72         if(screen.machine().primary_screen->visible_area().contains(x*8, y*8))
72         if(machine().primary_screen->visible_area().contains(x*8, y*8))
7373            drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8);
7474
7575         count++;
r17988r17989
8484      {
8585         UINT32 tile = m_vram[count] & 0xffff;
8686
87         if(screen.machine().primary_screen->visible_area().contains(x*8, y*8))
87         if(machine().primary_screen->visible_area().contains(x*8, y*8))
8888            drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8,0);
8989
9090         count++;
r17988r17989
9393
9494
9595   #else
96   device_t *k056832 = screen.machine().device("k056832");
96   device_t *k056832 = machine().device("k056832");
9797
9898   bitmap.fill(0, cliprect);
99   screen.machine().priority_bitmap.fill(0, cliprect);
99   machine().priority_bitmap.fill(0, cliprect);
100100
101101   k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 0);
102102   k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 0);
trunk/src/mame/drivers/raiden2.c
r17988r17989
962962
963963UINT32 raiden2_state::screen_update_raiden2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
964964{
965   bitmap.fill(get_black_pen(screen.machine()), cliprect);
965   bitmap.fill(get_black_pen(machine()), cliprect);
966966
967   //if (!screen.machine().input().code_pressed(KEYCODE_Q))
967   //if (!machine().input().code_pressed(KEYCODE_Q))
968968   {
969969      if (!(raiden2_tilemap_enable & 1))
970970         background_layer->draw(bitmap, cliprect, 0, 0);
971971   }
972972
973   //if (!screen.machine().input().code_pressed(KEYCODE_W))
973   //if (!machine().input().code_pressed(KEYCODE_W))
974974   {
975975      if (!(raiden2_tilemap_enable & 2))
976976         midground_layer->draw(bitmap, cliprect, 0, 0);
977977   }
978978
979   //if (!screen.machine().input().code_pressed(KEYCODE_E))
979   //if (!machine().input().code_pressed(KEYCODE_E))
980980   {
981981      if (!(raiden2_tilemap_enable & 4))
982982         foreground_layer->draw(bitmap, cliprect, 0, 0);
983983   }
984984
985   //if (!screen.machine().input().code_pressed(KEYCODE_S))
985   //if (!machine().input().code_pressed(KEYCODE_S))
986986   {
987987      //if (!(raiden2_tilemap_enable & 0x10))
988         draw_sprites(screen.machine(), bitmap, cliprect, 0);
988         draw_sprites(machine(), bitmap, cliprect, 0);
989989   }
990990
991   //if (!screen.machine().input().code_pressed(KEYCODE_A))
991   //if (!machine().input().code_pressed(KEYCODE_A))
992992   {
993993      if (!(raiden2_tilemap_enable & 8))
994994         text_layer->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/drivers/ddealer.c
r17988r17989
281281   {
282282      if (m_vregs[0xcc / 2] & 0x80)
283283      {
284         ddealer_draw_video_layer(screen.machine(), &m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
285         ddealer_draw_video_layer(screen.machine(), &m_vregs[0xcc / 2], m_right_fg_vram_top, m_right_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
284         ddealer_draw_video_layer(machine(), &m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
285         ddealer_draw_video_layer(machine(), &m_vregs[0xcc / 2], m_right_fg_vram_top, m_right_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
286286      }
287287      else
288288      {
289         ddealer_draw_video_layer(screen.machine(), &m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
289         ddealer_draw_video_layer(machine(), &m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
290290      }
291291   }
292292   else
293293   {
294294      if (m_vregs[0xcc / 2] & 0x80)
295295      {
296         ddealer_draw_video_layer(screen.machine(), &m_vregs[0xcc / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
297         ddealer_draw_video_layer(screen.machine(), &m_vregs[0x1e0 / 2], m_right_fg_vram_top, m_right_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
296         ddealer_draw_video_layer(machine(), &m_vregs[0xcc / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
297         ddealer_draw_video_layer(machine(), &m_vregs[0x1e0 / 2], m_right_fg_vram_top, m_right_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
298298      }
299299      else
300300      {
301         ddealer_draw_video_layer(screen.machine(), &m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
301         ddealer_draw_video_layer(machine(), &m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
302302      }
303303
304304   }
trunk/src/mame/drivers/berzerk.c
r17988r17989
461461   pen_t pens[NUM_PENS];
462462   offs_t offs;
463463
464   get_pens(screen.machine(), pens);
464   get_pens(machine(), pens);
465465
466466   for (offs = 0; offs < m_videoram.bytes(); offs++)
467467   {
trunk/src/mame/drivers/vpoker.c
r17988r17989
137137UINT32 vpoker_state::screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
138138{
139139   UINT8 *videoram = m_videoram;
140   gfx_element *gfx = screen.machine().gfx[0];
140   gfx_element *gfx = machine().gfx[0];
141141   int count = 0x0000;
142142
143143   int y,x;
trunk/src/mame/drivers/igs009.c
r17988r17989
287287   int layers_ctrl = m_video_enable ? -1 : 0;
288288
289289#ifdef MAME_DEBUG
290   if (screen.machine().input().code_pressed(KEYCODE_Z))
290   if (machine().input().code_pressed(KEYCODE_Z))
291291   {
292292      int mask = 0;
293      if (screen.machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
294      if (screen.machine().input().code_pressed(KEYCODE_W))   mask |= 2;
295      if (screen.machine().input().code_pressed(KEYCODE_A))   mask |= 4;
293      if (machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
294      if (machine().input().code_pressed(KEYCODE_W))   mask |= 2;
295      if (machine().input().code_pressed(KEYCODE_A))   mask |= 4;
296296      if (mask != 0) layers_ctrl &= mask;
297297   }
298298#endif
r17988r17989
323323         /* draw top of screen */
324324         clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+2);
325325
326         bitmap.fill(screen.machine().pens[rowenable], clip);
326         bitmap.fill(machine().pens[rowenable], clip);
327327
328328         if (rowenable==0)
329329         { // 0 and 1 are the same? or is there a global switchoff?
r17988r17989
347347      }
348348
349349   }
350   else               bitmap.fill(get_black_pen(screen.machine()), cliprect);
350   else               bitmap.fill(get_black_pen(machine()), cliprect);
351351
352352
353353   if (layers_ctrl & 2)   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/drivers/blitz68k.c
r17988r17989
218218   {
219219      for(x = 0; x < 512; x++)
220220      {
221         bitmap.pix32(y, x) = screen.machine().pens[*src++];
221         bitmap.pix32(y, x) = machine().pens[*src++];
222222      }
223223   }
224224
r17988r17989
239239      for(x = 0; x < 512; )
240240      {
241241         UINT16 pen = *src++;
242         bitmap.pix32(y, x++) = screen.machine().pens[(pen >>  8) & 0xf];
243         bitmap.pix32(y, x++) = screen.machine().pens[(pen >> 12) & 0xf];
244         bitmap.pix32(y, x++) = screen.machine().pens[(pen >>  0) & 0xf];
245         bitmap.pix32(y, x++) = screen.machine().pens[(pen >>  4) & 0xf];
242         bitmap.pix32(y, x++) = machine().pens[(pen >>  8) & 0xf];
243         bitmap.pix32(y, x++) = machine().pens[(pen >> 12) & 0xf];
244         bitmap.pix32(y, x++) = machine().pens[(pen >>  0) & 0xf];
245         bitmap.pix32(y, x++) = machine().pens[(pen >>  4) & 0xf];
246246      }
247247   }
248248
trunk/src/mame/drivers/dacholer.c
r17988r17989
167167   }
168168
169169   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
170   draw_sprites(screen.machine(), bitmap, cliprect);
170   draw_sprites(machine(), bitmap, cliprect);
171171   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
172172   return 0;
173173}
trunk/src/mame/drivers/cb2001.c
r17988r17989
335335UINT32 cb2001_state::screen_update_cb2001(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
336336{
337337   int count,x,y;
338   bitmap.fill(get_black_pen(screen.machine()), cliprect);
338   bitmap.fill(get_black_pen(machine()), cliprect);
339339
340340   count = 0x0000;
341341
r17988r17989
356356               tile += m_videobank*0x2000;
357357
358358
359               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,colour,0,0,x*8,y*8);
359               drawgfx_opaque(bitmap,cliprect,machine().gfx[0],tile,colour,0,0,x*8,y*8);
360360
361361               count++;
362362            }
r17988r17989
422422            tile += 0x1000;
423423         }
424424
425         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],tile,colour,0,0,x*8,y*8,0);
425         drawgfx_transpen(bitmap,cliprect,machine().gfx[0],tile,colour,0,0,x*8,y*8,0);
426426         count++;
427427      }
428428   }
trunk/src/mame/drivers/marinedt.c
r17988r17989
527527   m_tx_tilemap->draw(*m_tile, cliprect, 0, 0);
528528
529529   m_obj1->fill(0);
530   drawgfx_transpen(*m_obj1, m_obj1->cliprect(), screen.machine().gfx[1],
530   drawgfx_transpen(*m_obj1, m_obj1->cliprect(), machine().gfx[1],
531531         OBJ_CODE(m_obj1_a),
532532         OBJ_COLOR(m_obj1_a),
533533         OBJ_FLIPX(m_obj1_a), OBJ_FLIPY(m_obj1_a),
534534         0, 0, 0);
535535
536536   m_obj2->fill(0);
537   drawgfx_transpen(*m_obj2, m_obj2->cliprect(), screen.machine().gfx[2],
537   drawgfx_transpen(*m_obj2, m_obj2->cliprect(), machine().gfx[2],
538538         OBJ_CODE(m_obj2_a),
539539         OBJ_COLOR(m_obj2_a),
540540         OBJ_FLIPX(m_obj2_a), OBJ_FLIPY(m_obj2_a),
trunk/src/mame/drivers/cps3.c
r17988r17989
10821082               {
10831083                  for (uu=0;uu<1023;uu++)
10841084                  {
1085                     cps3_draw_tilemapsprite_line(screen.machine(), tilemapnum, uu, m_renderbuffer_bitmap, m_renderbuffer_clip );
1085                     cps3_draw_tilemapsprite_line(machine(), tilemapnum, uu, m_renderbuffer_bitmap, m_renderbuffer_clip );
10861086                  }
10871087               }
10881088               bg_drawn[tilemapnum] = 1;
r17988r17989
11551155                        /* use the bpp value from the main list or the sublists? */
11561156                        if (whichbpp)
11571157                        {
1158                           if (!global_bpp) screen.machine().gfx[1]->set_granularity(256);
1159                           else screen.machine().gfx[1]->set_granularity(64);
1158                           if (!global_bpp) machine().gfx[1]->set_granularity(256);
1159                           else machine().gfx[1]->set_granularity(64);
11601160                        }
11611161                        else
11621162                        {
1163                           if (!bpp) screen.machine().gfx[1]->set_granularity(256);
1164                           else screen.machine().gfx[1]->set_granularity(64);
1163                           if (!bpp) machine().gfx[1]->set_granularity(256);
1164                           else machine().gfx[1]->set_granularity(64);
11651165                        }
11661166
11671167                        {
r17988r17989
11691169
11701170                           if (global_alpha || alpha)
11711171                           {
1172                              cps3_drawgfxzoom(m_renderbuffer_bitmap,m_renderbuffer_clip,screen.machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
1172                              cps3_drawgfxzoom(m_renderbuffer_bitmap,m_renderbuffer_clip,machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
11731173                           }
11741174                           else
11751175                           {
1176                              cps3_drawgfxzoom(m_renderbuffer_bitmap,m_renderbuffer_clip,screen.machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
1176                              cps3_drawgfxzoom(m_renderbuffer_bitmap,m_renderbuffer_clip,machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
11771177                           }
11781178                           count++;
11791179                        }
r17988r17989
12391239            pal += m_ss_pal_base << 5;
12401240            tile+=0x200;
12411241
1242            cps3_drawgfxzoom(bitmap, cliprect, screen.machine().gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
1242            cps3_drawgfxzoom(bitmap, cliprect, machine().gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
12431243            count++;
12441244         }
12451245      }
trunk/src/mame/drivers/jchan.c
r17988r17989
305305   UINT16 pixdata1;
306306   UINT16 pixdata2;
307307
308   bitmap.fill(get_black_pen(screen.machine()), cliprect);
308   bitmap.fill(get_black_pen(machine()), cliprect);
309309
310   screen.machine().priority_bitmap.fill(0, cliprect);
310   machine().priority_bitmap.fill(0, cliprect);
311311
312312   m_view2_0->kaneko16_prepare(bitmap, cliprect);
313313
r17988r17989
319319   m_sprite_bitmap_1->fill(0x0000, cliprect);
320320   m_sprite_bitmap_2->fill(0x0000, cliprect);
321321
322   m_spritegen1->skns_draw_sprites(screen.machine(), *m_sprite_bitmap_1, cliprect, m_sprite_ram32_1, 0x4000, screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), m_sprite_regs32_1 );
323   m_spritegen2->skns_draw_sprites(screen.machine(), *m_sprite_bitmap_2, cliprect, m_sprite_ram32_2, 0x4000, screen.machine().root_device().memregion("gfx2")->base(), memregion ("gfx2")->bytes(), m_sprite_regs32_2 );
322   m_spritegen1->skns_draw_sprites(machine(), *m_sprite_bitmap_1, cliprect, m_sprite_ram32_1, 0x4000, machine().root_device().memregion("gfx1")->base(), machine().root_device().memregion ("gfx1")->bytes(), m_sprite_regs32_1 );
323   m_spritegen2->skns_draw_sprites(machine(), *m_sprite_bitmap_2, cliprect, m_sprite_ram32_2, 0x4000, machine().root_device().memregion("gfx2")->base(), memregion ("gfx2")->bytes(), m_sprite_regs32_2 );
324324
325325   // ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes
326326   for (y=0;y<240;y++)
trunk/src/mame/drivers/mlanding.c
r17988r17989
103103      {
104104         UINT16 srcpix = *src++;
105105
106         *dst++ = screen.machine().pens[256+(srcpix & 0xff) + (m_pal_fg_bank & 1 ? 0x100 : 0x000)];
107         *dst++ = screen.machine().pens[256+(srcpix >> 8) + (m_pal_fg_bank & 1 ? 0x100 : 0x000)];
106         *dst++ = machine().pens[256+(srcpix & 0xff) + (m_pal_fg_bank & 1 ? 0x100 : 0x000)];
107         *dst++ = machine().pens[256+(srcpix >> 8) + (m_pal_fg_bank & 1 ? 0x100 : 0x000)];
108108      }
109109   }
110110
trunk/src/mame/drivers/neoprint.c
r17988r17989
115115{
116116   bitmap.fill(0, cliprect);
117117
118   draw_layer(screen.machine(),bitmap,cliprect,1,2);
119   draw_layer(screen.machine(),bitmap,cliprect,0,2);
118   draw_layer(machine(),bitmap,cliprect,1,2);
119   draw_layer(machine(),bitmap,cliprect,0,2);
120120
121121   return 0;
122122}
r17988r17989
125125{
126126   bitmap.fill(0, cliprect);
127127
128   draw_layer(screen.machine(),bitmap,cliprect,1,0);
129   draw_layer(screen.machine(),bitmap,cliprect,2,0);
130   draw_layer(screen.machine(),bitmap,cliprect,0,0);
128   draw_layer(machine(),bitmap,cliprect,1,0);
129   draw_layer(machine(),bitmap,cliprect,2,0);
130   draw_layer(machine(),bitmap,cliprect,0,0);
131131
132132   return 0;
133133}
trunk/src/mame/drivers/tmaster.c
r17988r17989
363363   int layers_ctrl = -1;
364364
365365#ifdef MAME_DEBUG
366   if (screen.machine().input().code_pressed(KEYCODE_Z))
366   if (machine().input().code_pressed(KEYCODE_Z))
367367   {
368368      int mask = 0;
369      if (screen.machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
370      if (screen.machine().input().code_pressed(KEYCODE_W))   mask |= 2;
369      if (machine().input().code_pressed(KEYCODE_Q))   mask |= 1;
370      if (machine().input().code_pressed(KEYCODE_W))   mask |= 2;
371371      if (mask != 0) layers_ctrl &= mask;
372372   }
373373#endif
374374
375375
376   bitmap.fill(get_black_pen(screen.machine()), cliprect);
376   bitmap.fill(get_black_pen(machine()), cliprect);
377377
378378   if (layers_ctrl & 1)   copybitmap_trans(bitmap, m_bitmap[0][(m_regs[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff);
379379   if (layers_ctrl & 2)   copybitmap_trans(bitmap, m_bitmap[1][(m_regs[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff);
trunk/src/mame/drivers/flyball.c
r17988r17989
117117   m_tmap->draw(bitmap, cliprect, 0, 0);
118118
119119   /* draw pitcher */
120   drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], m_pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1);
120   drawgfx_transpen(bitmap, cliprect, machine().gfx[1], m_pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1);
121121
122122   /* draw ball */
123123
trunk/src/mame/drivers/pturn.c
r17988r17989
196196
197197      if(sx|sy)
198198      {
199         drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[2],
199         drawgfx_transpen(bitmap, cliprect,machine().gfx[2],
200200         spriteram[offs+1] & 0x3f ,
201201         (spriteram[offs+2] & 0x1f),
202202         flipx, flipy,
trunk/src/mame/drivers/dunhuang.c
r17988r17989
164164   int layers_ctrl = -1;
165165
166166#if DUNHUANG_DEBUG
167if (screen.machine().input().code_pressed(KEYCODE_Z))
167if (machine().input().code_pressed(KEYCODE_Z))
168168{
169169   int msk = 0;
170   if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
171   if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
170   if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
171   if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
172172   if (msk != 0) layers_ctrl &= msk;
173173}
174174#endif
175175
176   bitmap.fill(get_black_pen(screen.machine()), cliprect);
176   bitmap.fill(get_black_pen(machine()), cliprect);
177177
178178   switch (m_layers)
179179   {
trunk/src/mame/drivers/deco_ld.c
r17988r17989
196196
197197UINT32 deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
198198{
199   gfx_element *gfx = screen.machine().gfx[0];
199   gfx_element *gfx = machine().gfx[0];
200200   int y,x;
201201
202202   bitmap.fill(0, cliprect);
203203
204   draw_sprites(screen.machine(), bitmap,cliprect,m_vram1,0x000);
205   draw_sprites(screen.machine(), bitmap,cliprect,m_vram0,0x100);
204   draw_sprites(machine(), bitmap,cliprect,m_vram1,0x000);
205   draw_sprites(machine(), bitmap,cliprect,m_vram0,0x100);
206206
207207   for (y=0;y<32;y++)
208208   {
trunk/src/mame/drivers/progolf.c
r17988r17989
118118         {
119119            int tile = videoram[count];
120120
121            drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8);
121            drawgfx_opaque(bitmap,cliprect,machine().gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8);
122122            /* wrap-around */
123            drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8);
123            drawgfx_opaque(bitmap,cliprect,machine().gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8);
124124
125125            count++;
126126         }
r17988r17989
142142                  color = m_fg_fb[(xi+yi*8)+count*0x40];
143143
144144                  if(color != 0 && cliprect.contains(x+yi, 256-y+xi))
145                     bitmap.pix16(x+yi, 256-y+xi) = screen.machine().pens[(color & 0x7)];
145                     bitmap.pix16(x+yi, 256-y+xi) = machine().pens[(color & 0x7)];
146146               }
147147            }
148148
trunk/src/mame/drivers/powerbal.c
r17988r17989
430430{
431431
432432   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
433   draw_sprites(screen.machine(), bitmap, cliprect);
433   draw_sprites(machine(), bitmap, cliprect);
434434   return 0;
435435}
436436
trunk/src/mame/drivers/jackie.c
r17988r17989
204204   int startclipmin = 0;
205205   const rectangle &visarea = screen.visible_area();
206206
207   bitmap.fill(get_black_pen(screen.machine()), cliprect);
207   bitmap.fill(get_black_pen(machine()), cliprect);
208208
209209   for (i=0;i < 0x40;i++)
210210   {
trunk/src/mame/drivers/blackt96.c
r17988r17989
232232{
233233   int count;
234234   int x,y;
235   gfx_element *gfx = screen.machine().gfx[2];
235   gfx_element *gfx = machine().gfx[2];
236236
237   bitmap.fill(get_black_pen(screen.machine()), cliprect);
237   bitmap.fill(get_black_pen(machine()), cliprect);
238238
239239   int strip;
240240   int page;
r17988r17989
243243   {
244244      for (page = 7;page>0;page--)
245245      {
246         draw_strip(screen.machine(), bitmap, cliprect, page, strip, 1);
246         draw_strip(machine(), bitmap, cliprect, page, strip, 1);
247247      }
248248   }
249249
r17988r17989
251251   {
252252      for (page = 7;page>0;page--)
253253      {
254         draw_strip(screen.machine(), bitmap, cliprect, page, strip, 0);
254         draw_strip(machine(), bitmap, cliprect, page, strip, 0);
255255      }
256256   }
257257
trunk/src/mame/drivers/ace.c
r17988r17989
9999   /* first of all, fill the screen with the background color */
100100   bitmap.fill(0, cliprect);
101101
102   drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1],
102   drawgfx_opaque(bitmap, cliprect, machine().gfx[1],
103103         0,
104104         0,
105105         0, 0,
106106         m_objpos[0], m_objpos[1]);
107107
108   drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[2],
108   drawgfx_opaque(bitmap, cliprect, machine().gfx[2],
109109         0,
110110         0,
111111         0, 0,
112112         m_objpos[2], m_objpos[3]);
113113
114   drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[3],
114   drawgfx_opaque(bitmap, cliprect, machine().gfx[3],
115115         0,
116116         0,
117117         0, 0,
r17988r17989
120120   for (offs = 0; offs < 8; offs++)
121121   {
122122      drawgfx_opaque(bitmap,/* ?? */
123            cliprect, screen.machine().gfx[4],
123            cliprect, machine().gfx[4],
124124            offs,
125125            0,
126126            0, 0,
trunk/src/mame/drivers/dreamwld.c
r17988r17989
395395   tmptilemap0->draw(bitmap, cliprect, 0, 0);
396396   tmptilemap1->draw(bitmap, cliprect, 0, 0);
397397
398   draw_sprites(screen.machine(), bitmap, cliprect);
398   draw_sprites(machine(), bitmap, cliprect);
399399
400400   return 0;
401401}
trunk/src/mame/drivers/panicr.c
r17988r17989
250250
251251UINT32 panicr_state::screen_update_panicr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
252252{
253   bitmap.fill(get_black_pen(screen.machine()), cliprect);
253   bitmap.fill(get_black_pen(machine()), cliprect);
254254   m_txttilemap->mark_all_dirty();
255255   m_bgtilemap->set_scrollx(0, m_scrollx);
256256   m_bgtilemap->draw(bitmap, cliprect, 0,0);
257   draw_sprites(screen.machine(),bitmap,cliprect);
257   draw_sprites(machine(),bitmap,cliprect);
258258   m_txttilemap->draw(bitmap, cliprect, 0,0);
259259
260260   return 0;
trunk/src/mame/drivers/istellar.c
r17988r17989
7777         int tile = m_tile_ram[x+y*32];
7878         int attr = m_tile_control_ram[x+y*32];
7979
80         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],tile,attr & 0x0f,0, 0, x*8, y*8, 0);
80         drawgfx_transpen(bitmap, cliprect, machine().gfx[0],tile,attr & 0x0f,0, 0, x*8, y*8, 0);
8181      }
8282   }
8383
trunk/src/mame/drivers/mirage.c
r17988r17989
8787
8888UINT32 miragemi_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
8989{
90   address_space &space = screen.machine().driver_data()->generic_space();
90   address_space &space = machine().driver_data()->generic_space();
9191   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
9292
9393   flip_screen_set(BIT(flip, 7));
9494
95   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
95   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
9696
9797   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
9898
9999   bitmap.fill(256, cliprect); /* not verified */
100100
101101   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
102   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff);
102   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff);
103103   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
104   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0x1ff);
104   machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0x1ff);
105105
106106   return 0;
107107}
trunk/src/mame/drivers/jalmah.c
r17988r17989
442442{
443443   UINT16 *jm_scrollram = m_jm_scrollram;
444444   UINT8 cur_prin;
445   jalmah_priority_system(screen.machine());
445   jalmah_priority_system(machine());
446446
447447   m_sc0_tilemap_0->set_scrollx(0, jm_scrollram[0] & 0xfff);
448448   m_sc0_tilemap_1->set_scrollx(0, jm_scrollram[0] & 0x7ff);
r17988r17989
485485   m_sc3_tilemap_2->set_scrolly(0, jm_scrollram[7] & 0x1ff);
486486   m_sc3_tilemap_3->set_scrolly(0, jm_scrollram[7] & 0x3ff);
487487
488   bitmap.fill(screen.machine().pens[0xff], cliprect); //selectable by a ram address?
488   bitmap.fill(machine().pens[0xff], cliprect); //selectable by a ram address?
489489
490490   for(cur_prin=1;cur_prin<=0x8;cur_prin<<=1)
491491   {
492      if(cur_prin==m_sc0_prin) { draw_sc0_layer(screen.machine(),bitmap,cliprect); }
493      if(cur_prin==m_sc1_prin) { draw_sc1_layer(screen.machine(),bitmap,cliprect); }
494      if(cur_prin==m_sc2_prin) { draw_sc2_layer(screen.machine(),bitmap,cliprect); }
495      if(cur_prin==m_sc3_prin) { draw_sc3_layer(screen.machine(),bitmap,cliprect); }
492      if(cur_prin==m_sc0_prin) { draw_sc0_layer(machine(),bitmap,cliprect); }
493      if(cur_prin==m_sc1_prin) { draw_sc1_layer(machine(),bitmap,cliprect); }
494      if(cur_prin==m_sc2_prin) { draw_sc2_layer(machine(),bitmap,cliprect); }
495      if(cur_prin==m_sc3_prin) { draw_sc3_layer(machine(),bitmap,cliprect); }
496496   }
497497
498498   return 0;
r17988r17989
507507   m_sc0_tilemap_0->set_scrolly(0, jm_scrollram[4]);
508508   m_sc3_tilemap_0->set_scrolly(0, jm_scrollram[7]);
509509
510   bitmap.fill(screen.machine().pens[0x1ff], cliprect);//selectable by a ram address?
510   bitmap.fill(machine().pens[0x1ff], cliprect);//selectable by a ram address?
511511   if(m_jm_vregs[0] & 1) { m_sc0_tilemap_0->draw(bitmap, cliprect, 0,0); }
512512   if(m_jm_vregs[3] & 1) { m_sc3_tilemap_0->draw(bitmap, cliprect, 0,0); }
513513   return 0;
trunk/src/mame/drivers/supdrapo.c
r17988r17989
119119         /* Global Column Coloring, GUESS! */
120120         color = m_col_line[(x*2) + 1] ? (m_col_line[(x*2) + 1] - 1) & 7 : 0;
121121
122         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile,color, 0, 0, x*8, y*8);
122         drawgfx_opaque(bitmap, cliprect, machine().gfx[0], tile,color, 0, 0, x*8, y*8);
123123
124124         count++;
125125      }
trunk/src/mame/drivers/spoker.c
r17988r17989
105105UINT32 spoker_state::screen_update_spoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
106106{
107107
108   bitmap.fill(get_black_pen(screen.machine()), cliprect);
108   bitmap.fill(get_black_pen(machine()), cliprect);
109109   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
110110   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
111111   return 0;
trunk/src/mame/drivers/zr107.c
r17988r17989
222222
223223UINT32 zr107_state::screen_update_jetwave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
224224{
225   device_t *k001604 = screen.machine().device("k001604");
225   device_t *k001604 = machine().device("k001604");
226226
227   bitmap.fill(screen.machine().pens[0], cliprect);
227   bitmap.fill(machine().pens[0], cliprect);
228228
229229   K001005_draw(bitmap, cliprect);
230230
r17988r17989
233233   draw_7segment_led(bitmap, 3, 3, m_led_reg0);
234234   draw_7segment_led(bitmap, 9, 3, m_led_reg1);
235235
236   sharc_set_flag_input(screen.machine().device("dsp"), 1, ASSERT_LINE);
236   sharc_set_flag_input(machine().device("dsp"), 1, ASSERT_LINE);
237237   return 0;
238238}
239239
r17988r17989
274274
275275UINT32 zr107_state::screen_update_zr107(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
276276{
277   device_t *k056832 = screen.machine().device("k056832");
278   bitmap.fill(screen.machine().pens[0], cliprect);
277   device_t *k056832 = machine().device("k056832");
278   bitmap.fill(machine().pens[0], cliprect);
279279
280280   k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0);
281281   K001005_draw(bitmap, cliprect);
r17988r17989
284284   draw_7segment_led(bitmap, 3, 3, m_led_reg0);
285285   draw_7segment_led(bitmap, 9, 3, m_led_reg1);
286286
287   sharc_set_flag_input(screen.machine().device("dsp"), 1, ASSERT_LINE);
287   sharc_set_flag_input(machine().device("dsp"), 1, ASSERT_LINE);
288288   return 0;
289289}
290290
trunk/src/mame/drivers/flipjack.c
r17988r17989
152152{
153153   int x,y,count;
154154
155   bitmap.fill(get_black_pen(screen.machine()), cliprect);
155   bitmap.fill(get_black_pen(machine()), cliprect);
156156
157157   // draw playfield
158158   if (m_layer & 2)
r17988r17989
179179                  color = ((pen_r >> (7-xi)) & 1)<<0;
180180                  color|= ((pen_g >> (7-xi)) & 1)<<1;
181181                  color|= ((pen_b >> (7-xi)) & 1)<<2;
182                  bitmap.pix32(y, x+xi) = screen.machine().pens[color+0x80];
182                  bitmap.pix32(y, x+xi) = machine().pens[color+0x80];
183183               }
184184            }
185185
r17988r17989
193193   {
194194      for (x=0;x<32;x++)
195195      {
196         gfx_element *gfx = screen.machine().gfx[0];
196         gfx_element *gfx = machine().gfx[0];
197197         int tile = m_bank << 8 | m_vram[x+y*0x100];
198198         int color = m_cram[x+y*0x100] & 0x3f;
199199
r17988r17989
221221               {
222222                  color = ((pen >> (7-xi)) & 1) ? 0x87 : 0;
223223                  if(color)
224                     bitmap.pix32(y, x+xi) = screen.machine().pens[color];
224                     bitmap.pix32(y, x+xi) = machine().pens[color];
225225               }
226226            }
227227
trunk/src/mame/drivers/dominob.c
r17988r17989
135135      {
136136         drawgfx_opaque(bitmap,
137137               cliprect,
138               screen.machine().gfx[1],
138               machine().gfx[1],
139139               m_bgram[index] + 256 * (m_bgram[index + 1] & 0xf),
140140               m_bgram[index + 1] >> 4,
141141               0, 0,
r17988r17989
150150      {
151151         drawgfx_transpen(   bitmap,
152152               cliprect,
153               screen.machine().gfx[0],
153               machine().gfx[0],
154154               m_videoram[(y * 32 + x) * 2 + 1] + (m_videoram[(y * 32 + x) * 2] & 7) * 256,
155155               (m_videoram[(y * 32 + x) * 2] >> 3),
156156               0, 0,
r17988r17989
158158      }
159159   }
160160
161   draw_sprites(screen.machine(), bitmap, cliprect);
161   draw_sprites(machine(), bitmap, cliprect);
162162
163163   return 0;
164164}
trunk/src/mame/drivers/sbrkout.c
r17988r17989
341341      int sx = 31 * 8 - videoram[0x380 + 0x10 + ball * 2];
342342      int sy = 30 * 8 - videoram[0x380 + 0x18 + ball * 2];
343343
344      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code, 0, 0, 0, sx, sy, 0);
344      drawgfx_transpen(bitmap, cliprect, machine().gfx[1], code, 0, 0, 0, sx, sy, 0);
345345   }
346346   return 0;
347347}
trunk/src/mame/drivers/jackpool.c
r17988r17989
4747
4848UINT32 jackpool_state::screen_update_jackpool(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
4949{
50   gfx_element *gfx = screen.machine().gfx[0];
50   gfx_element *gfx = machine().gfx[0];
5151   int count;// = 0x00000/2;
5252
5353   int y,x;
trunk/src/mame/drivers/nmg5.c
r17988r17989
897897
898898   if (m_priority_reg == 0)
899899   {
900      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
900      machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
901901      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
902      draw_bitmap(screen.machine(), bitmap);
902      draw_bitmap(machine(), bitmap);
903903   }
904904   else if (m_priority_reg == 1)
905905   {
906      draw_bitmap(screen.machine(), bitmap);
907      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
906      draw_bitmap(machine(), bitmap);
907      machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
908908      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
909909   }
910910   else if (m_priority_reg == 2)
911911   {
912      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
913      draw_bitmap(screen.machine(), bitmap);
912      machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
913      draw_bitmap(machine(), bitmap);
914914      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
915915   }
916916   else if (m_priority_reg == 3)
917917   {
918918      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
919      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
920      draw_bitmap(screen.machine(), bitmap);
919      machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
920      draw_bitmap(machine(), bitmap);
921921   }
922922   else if (m_priority_reg == 7)
923923   {
924924      m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
925      draw_bitmap(screen.machine(), bitmap);
926      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
925      draw_bitmap(machine(), bitmap);
926      machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
927927   }
928928   return 0;
929929}
trunk/src/mame/drivers/taitowlf.c
r17988r17989
8989UINT32 taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
9090{
9191   int x,y,count;
92   const UINT8 *blit_ram = screen.machine().root_device().memregion("user5")->base();
92   const UINT8 *blit_ram = machine().root_device().memregion("user5")->base();
9393
94   bitmap.fill(get_black_pen(screen.machine()), cliprect);
94   bitmap.fill(get_black_pen(machine()), cliprect);
9595
9696   count = (0);
9797
r17988r17989
104104         color = (blit_ram[count] & 0xff);
105105
106106         if(cliprect.contains(x+0, y))
107            bitmap.pix32(y, x+0) = screen.machine().pens[color];
107            bitmap.pix32(y, x+0) = machine().pens[color];
108108
109109         count++;
110110      }
trunk/src/mame/drivers/pzletime.c
r17988r17989
9797   int count;
9898   int y, x;
9999
100   bitmap.fill(screen.machine().pens[0], cliprect); //bg pen
100   bitmap.fill(machine().pens[0], cliprect); //bg pen
101101
102102   m_txt_tilemap->set_scrolly(0, m_tilemap_regs[0] - 3);
103103   m_txt_tilemap->set_scrollx(0, m_tilemap_regs[1]);
r17988r17989
139139
140140         // is spriteram[offs + 0] & 0x200 flipy? it's always set
141141
142         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], spr_offs, colour, 0, 1, sx, sy, 0);
142         drawgfx_transpen(bitmap, cliprect, machine().gfx[1], spr_offs, colour, 0, 1, sx, sy, 0);
143143      }
144144   }
145145
trunk/src/mame/drivers/funkball.c
r17988r17989
11371137
11381138UINT32 funkball_state::screen_update_funkball(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
11391139{
1140   voodoo_update(screen.machine().device("voodoo_0"), bitmap, cliprect);
1140   voodoo_update(machine().device("voodoo_0"), bitmap, cliprect);
11411141   return 0;
11421142}
11431143
trunk/src/mame/drivers/mirax.c
r17988r17989
222222
223223UINT32 mirax_state::screen_update_mirax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
224224{
225   draw_tilemap(screen.machine(),bitmap,cliprect,1);
226   draw_sprites(screen.machine(),bitmap,cliprect);
227   draw_tilemap(screen.machine(),bitmap,cliprect,0);
225   draw_tilemap(machine(),bitmap,cliprect,1);
226   draw_sprites(machine(),bitmap,cliprect);
227   draw_tilemap(machine(),bitmap,cliprect,0);
228228   return 0;
229229}
230230
trunk/src/mame/drivers/cardline.c
r17988r17989
6464         int index=y*64+x;
6565         if(m_video&1)
6666         {
67            DRAW_TILE(screen.machine(),0,0);
68            DRAW_TILE(screen.machine(),0x800,1);
67            DRAW_TILE(machine(),0,0);
68            DRAW_TILE(machine(),0x800,1);
6969         }
7070
7171         if(m_video&2)
7272         {
73            DRAW_TILE(screen.machine(),0x1000,0);
74            DRAW_TILE(screen.machine(),0x1800,1);
73            DRAW_TILE(machine(),0x1000,0);
74            DRAW_TILE(machine(),0x1800,1);
7575         }
7676      }
7777   }
trunk/src/mame/drivers/dlair.c
r17988r17989
237237      for (x = 0; x < 32; x++)
238238      {
239239         UINT8 *base = &videoram[y * 64 + x * 2 + 1];
240         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y);
240         drawgfx_opaque(bitmap, cliprect, machine().gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y);
241241      }
242242
243243   return 0;
trunk/src/mame/drivers/jollyjgr.c
r17988r17989
504504   if(m_pri) //used in Frog & Spiders level 3
505505   {
506506      if(!(m_bitmap_disable))
507         draw_bitmap(screen.machine(), bitmap);
507         draw_bitmap(machine(), bitmap);
508508
509509      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
510510   }
r17988r17989
513513      m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
514514
515515      if(!(m_bitmap_disable))
516         draw_bitmap(screen.machine(), bitmap);
516         draw_bitmap(machine(), bitmap);
517517   }
518518
519519   /* Sprites are the same as in Galaxian */
r17988r17989
540540      if (offs < 3 * 4)
541541         sy++;
542542
543      drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
543      drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
544544            code,color,
545545            flipx,flipy,
546546            sx,sy,0);
trunk/src/mame/drivers/ddayjlc.c
r17988r17989
406406
407407      code = (code & 0x7f) | ((flags & 0x30) << 3);
408408
409      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], code, color, xflip, yflip, x, y, 0);
409      drawgfx_transpen(bitmap, cliprect, machine().gfx[0], code, color, xflip, yflip, x, y, 0);
410410   }
411411
412412   {
r17988r17989
417417         {
418418            c = m_videoram[y * 32 + x];
419419            if (x > 1 && x < 30)
420               drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], c + m_char_bank * 0x100, 2, 0, 0, x*8, y*8, 0);
420               drawgfx_transpen(bitmap, cliprect, machine().gfx[1], c + m_char_bank * 0x100, 2, 0, 0, x*8, y*8, 0);
421421            else
422               drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1], c + m_char_bank * 0x100, 2, 0, 0, x*8, y*8);
422               drawgfx_opaque(bitmap, cliprect, machine().gfx[1], c + m_char_bank * 0x100, 2, 0, 0, x*8, y*8);
423423         }
424424   }
425425   return 0;
trunk/src/mame/drivers/quizpun2.c
r17988r17989
161161   int layers_ctrl = -1;
162162
163163#ifdef MAME_DEBUG
164   if (screen.machine().input().code_pressed(KEYCODE_Z))
164   if (machine().input().code_pressed(KEYCODE_Z))
165165   {
166166      int msk = 0;
167      if (screen.machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
168      if (screen.machine().input().code_pressed(KEYCODE_W))   msk |= 2;
167      if (machine().input().code_pressed(KEYCODE_Q))   msk |= 1;
168      if (machine().input().code_pressed(KEYCODE_W))   msk |= 2;
169169      if (msk != 0) layers_ctrl &= msk;
170170   }
171171#endif
172172
173173   if (layers_ctrl & 1)   m_bg_tmap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
174   else               bitmap.fill(get_black_pen(screen.machine()), cliprect);
174   else               bitmap.fill(get_black_pen(machine()), cliprect);
175175
176bitmap.fill(get_black_pen(screen.machine()), cliprect);
176bitmap.fill(get_black_pen(machine()), cliprect);
177177   if (layers_ctrl & 2)   m_fg_tmap->draw(bitmap, cliprect, 0, 0);
178178
179179   return 0;
trunk/src/mame/drivers/egghunt.c
r17988r17989
184184UINT32 egghunt_state::screen_update_egghunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
185185{
186186   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
187   draw_sprites(screen.machine(), bitmap, cliprect);
187   draw_sprites(machine(), bitmap, cliprect);
188188   return 0;
189189}
190190
trunk/src/mame/drivers/segac2.c
r17988r17989
12751275//  and applies it's own external colour circuity
12761276UINT32 segac2_state::screen_update_segac2_new(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
12771277{
1278   const pen_t *paldata = screen.machine().pens;
1278   const pen_t *paldata = machine().pens;
12791279   if (!m_segac2_enable_display)
12801280   {
1281      bitmap.fill(get_black_pen(screen.machine()), cliprect);
1281      bitmap.fill(get_black_pen(machine()), cliprect);
12821282      return 0;
12831283   }
12841284
trunk/src/mame/drivers/sandscrp.c
r17988r17989
117117
118118UINT32 sandscrp_state::screen_update_sandscrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
119119{
120   device_t *pandora = screen.machine().device("pandora");
120   device_t *pandora = machine().device("pandora");
121121   bitmap.fill(0, cliprect);
122122
123123   int i;
124124
125   screen.machine().priority_bitmap.fill(0, cliprect);
125   machine().priority_bitmap.fill(0, cliprect);
126126
127127   m_view2_0->kaneko16_prepare(bitmap, cliprect);
128128
r17988r17989
173173   // rising edge
174174   if (state)
175175   {
176      device_t *pandora = screen.machine().device("pandora");
176      device_t *pandora = machine().device("pandora");
177177      m_sprite_irq = 1;
178      update_irq_state(screen.machine());
178      update_irq_state(machine());
179179      pandora_eof(pandora);
180180   }
181181}
trunk/src/mame/drivers/gpworld.c
r17988r17989
228228{
229229   bitmap.fill(0, cliprect);
230230
231   gpworld_draw_tiles(screen.machine(), bitmap, cliprect);
232   gpworld_draw_sprites(screen.machine(), bitmap, cliprect);
231   gpworld_draw_tiles(machine(), bitmap, cliprect);
232   gpworld_draw_sprites(machine(), bitmap, cliprect);
233233
234234   return 0;
235235}
trunk/src/mame/drivers/poker72.c
r17988r17989
5858
5959         tile|= m_tile_bank << 12;
6060
61         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,color,fx,fy,x*8,y*8);
61         drawgfx_opaque(bitmap,cliprect,machine().gfx[0],tile,color,fx,fy,x*8,y*8);
6262
6363         count+=2;
6464      }
trunk/src/mame/drivers/umipoker.c
r17988r17989
141141   m_tilemap_2->set_scrolly(0, m_umipoker_scrolly[2]);
142142   m_tilemap_3->set_scrolly(0, m_umipoker_scrolly[3]);
143143
144   bitmap.fill(get_black_pen(screen.machine()), cliprect);
144   bitmap.fill(get_black_pen(machine()), cliprect);
145145
146146   m_tilemap_0->draw(bitmap, cliprect, 0,0);
147147   m_tilemap_1->draw(bitmap, cliprect, 0,0);
trunk/src/mame/drivers/gamecstl.c
r17988r17989
166166UINT32 gamecstl_state::screen_update_gamecstl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
167167{
168168   int i, j;
169   gfx_element *gfx = screen.machine().gfx[0];
169   gfx_element *gfx = machine().gfx[0];
170170   UINT32 *cga = m_cga_ram;
171171   int index = 0;
172172
trunk/src/mame/drivers/hotblock.c
r17988r17989
149149   int i;
150150   static const int xxx = 320, yyy = 204;
151151
152   bitmap.fill(get_black_pen(screen.machine()));
152   bitmap.fill(get_black_pen(machine()));
153153
154154   for (i = 0; i < 256; i++)
155155   {
156156      int dat = (m_pal[i * 2 + 1] << 8) | m_pal[i * 2];
157      palette_set_color_rgb(screen.machine(), i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10));
157      palette_set_color_rgb(machine(), i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10));
158158   }
159159
160160   count = 0;
trunk/src/mame/drivers/nwk-tr.c
r17988r17989
276276
277277UINT32 nwktr_state::screen_update_nwktr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
278278{
279   device_t *voodoo = screen.machine().device("voodoo");
280   device_t *k001604 = screen.machine().device("k001604");
279   device_t *voodoo = machine().device("voodoo");
280   device_t *k001604 = machine().device("k001604");
281281
282   bitmap.fill(screen.machine().pens[0], cliprect);
282   bitmap.fill(machine().pens[0], cliprect);
283283
284284   voodoo_update(voodoo, bitmap, cliprect);
285285
trunk/src/mame/drivers/jpmsys5.c
r17988r17989
233233
234234   if (state.blanked)
235235   {
236      bitmap.fill(get_black_pen(screen.machine()), cliprect);
236      bitmap.fill(get_black_pen(machine()), cliprect);
237237      return 0;
238238   }
239239
r17988r17989
247247         UINT8 pen = src[(x-cliprect.min_x)>>1];
248248
249249         /* Draw two 4-bit pixels */
250         *dest++ = screen.machine().pens[(pen >> 4) & 0xf];
251         *dest++ = screen.machine().pens[pen & 0xf];
250         *dest++ = machine().pens[(pen >> 4) & 0xf];
251         *dest++ = machine().pens[pen & 0xf];
252252      }
253253   }
254254
trunk/src/mame/drivers/champbas.c
r17988r17989
103103      m_watchdog_count++;
104104
105105      if (m_watchdog_count == 0x10)
106         screen.machine().schedule_soft_reset();
106         machine().schedule_soft_reset();
107107   }
108108}
109109
trunk/src/mame/drivers/igs011.c
r17988r17989
255255   UINT16 *pri_ram;
256256
257257#ifdef MAME_DEBUG
258   if (screen.machine().input().code_pressed(KEYCODE_Z))
258   if (machine().input().code_pressed(KEYCODE_Z))
259259   {
260260      int mask = 0;
261      if (screen.machine().input().code_pressed(KEYCODE_Q))   mask |= 0x01;
262      if (screen.machine().input().code_pressed(KEYCODE_W))   mask |= 0x02;
263      if (screen.machine().input().code_pressed(KEYCODE_E))   mask |= 0x04;
264      if (screen.machine().input().code_pressed(KEYCODE_R))   mask |= 0x08;
265      if (screen.machine().input().code_pressed(KEYCODE_A))   mask |= 0x10;
266      if (screen.machine().input().code_pressed(KEYCODE_S))   mask |= 0x20;
267      if (screen.machine().input().code_pressed(KEYCODE_D))   mask |= 0x40;
268      if (screen.machine().input().code_pressed(KEYCODE_F))   mask |= 0x80;
261      if (machine().input().code_pressed(KEYCODE_Q))   mask |= 0x01;
262      if (machine().input().code_pressed(KEYCODE_W))   mask |= 0x02;
263      if (machine().input().code_pressed(KEYCODE_E))   mask |= 0x04;
264      if (machine().input().code_pressed(KEYCODE_R))   mask |= 0x08;
265      if (machine().input().code_pressed(KEYCODE_A))   mask |= 0x10;
266      if (machine().input().code_pressed(KEYCODE_S))   mask |= 0x20;
267      if (machine().input().code_pressed(KEYCODE_D))   mask |= 0x40;
268      if (machine().input().code_pressed(KEYCODE_F))   mask |= 0x80;
269269      if (mask)   layer_enable &= mask;
270270   }
271271#endif
r17988r17989
294294
295295#ifdef MAME_DEBUG
296296         if ((layer_enable != -1) && (pri_addr == 0xff))
297            bitmap.pix16(y, x) = get_black_pen(screen.machine());
297            bitmap.pix16(y, x) = get_black_pen(machine());
298298         else
299299#endif
300300            bitmap.pix16(y, x) = m_layer[l][scr_addr] | (l << 8);
trunk/src/mame/drivers/srmp6.c
r17988r17989
190190
191191#if 0
192192   /* debug */
193   if(screen.machine().input().code_pressed_once(KEYCODE_Q))
193   if(machine().input().code_pressed_once(KEYCODE_Q))
194194   {
195195      ++xixi;
196196      printf("%x\n",xixi);
197197   }
198198
199   if(screen.machine().input().code_pressed_once(KEYCODE_W))
199   if(machine().input().code_pressed_once(KEYCODE_W))
200200   {
201201      --xixi;
202202      printf("%x\n",xixi);
r17988r17989
273273                  else
274274                     yb=y+(height-yw-1)*8+global_y;
275275
276                  drawgfx_alpha(bitmap,cliprect,screen.machine().gfx[0],tileno,global_pal,flip_x,flip_y,xb,yb,0,alpha);
276                  drawgfx_alpha(bitmap,cliprect,machine().gfx[0],tileno,global_pal,flip_x,flip_y,xb,yb,0,alpha);
277277                  tileno++;
278278               }
279279            }
r17988r17989
287287
288288   memcpy(m_sprram_old, m_sprram, 0x80000);
289289
290   if(screen.machine().input().code_pressed_once(KEYCODE_Q))
290   if(machine().input().code_pressed_once(KEYCODE_Q))
291291   {
292292      FILE *p=fopen("tileram.bin","wb");
293293      fwrite(m_tileram, 1, 0x100000*16, p);
trunk/src/mame/drivers/cball.c
r17988r17989
6464   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
6565
6666   /* draw sprite */
67   drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
67   drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
6868      m_video_ram[0x399] >> 4,
6969      0,
7070      0, 0,
trunk/src/mame/drivers/dec8.c
r17988r17989
7171   // rising edge
7272   if (state)
7373   {
74      address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
74      address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
7575      dec8_mxc06_karn_buffer_spriteram_w(space, 0, 0);
7676   }
7777}
trunk/src/mame/drivers/rabbit.c
r17988r17989
466466{
467467   int prilevel;
468468
469   bitmap.fill(get_black_pen(screen.machine()), cliprect);
469   bitmap.fill(get_black_pen(machine()), cliprect);
470470
471471//  popmessage("%08x %08x", m_viewregs0[0], m_viewregs0[1]);
472472//  popmessage("%08x %08x %08x %08x %08x %08x", m_tilemap_regs[0][0],m_tilemap_regs[0][1],m_tilemap_regs[0][2],m_tilemap_regs[0][3],m_tilemap_regs[0][4],m_tilemap_regs[0][5]);
r17988r17989
484484   /* prio isnt certain but seems to work.. */
485485   for (prilevel = 0xf; prilevel >0; prilevel--)
486486   {
487      if (prilevel == ((m_tilemap_regs[3][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen.machine(),bitmap,cliprect, 3);
488      if (prilevel == ((m_tilemap_regs[2][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen.machine(),bitmap,cliprect, 2);
489      if (prilevel == ((m_tilemap_regs[1][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen.machine(),bitmap,cliprect, 1);
490      if (prilevel == ((m_tilemap_regs[0][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen.machine(),bitmap,cliprect, 0);
487      if (prilevel == ((m_tilemap_regs[3][0]&0x0f000000)>>24)) rabbit_drawtilemap(machine(),bitmap,cliprect, 3);
488      if (prilevel == ((m_tilemap_regs[2][0]&0x0f000000)>>24)) rabbit_drawtilemap(machine(),bitmap,cliprect, 2);
489      if (prilevel == ((m_tilemap_regs[1][0]&0x0f000000)>>24)) rabbit_drawtilemap(machine(),bitmap,cliprect, 1);
490      if (prilevel == ((m_tilemap_regs[0][0]&0x0f000000)>>24)) rabbit_drawtilemap(machine(),bitmap,cliprect, 0);
491491
492492      if (prilevel == 0x09) // should it be selectable?
493493      {
494         rabbit_clearspritebitmap(screen.machine(),bitmap,cliprect);
495         draw_sprites(screen.machine(),bitmap,cliprect);  // render to bitmap
496         draw_sprite_bitmap(screen.machine(),bitmap,cliprect); // copy bitmap to screen
494         rabbit_clearspritebitmap(machine(),bitmap,cliprect);
495         draw_sprites(machine(),bitmap,cliprect);  // render to bitmap
496         draw_sprite_bitmap(machine(),bitmap,cliprect); // copy bitmap to screen
497497      }
498498   }
499499   return 0;
trunk/src/mame/drivers/hvyunit.c
r17988r17989
186186
187187   m_bg_tilemap->set_scrollx(0, ((m_port0_data & 0x40) << 2) + m_scrollx + SX_POS); // TODO
188188   m_bg_tilemap->set_scrolly(0, ((m_port0_data & 0x80) << 1) + m_scrolly + SY_POS); // TODO
189   bitmap.fill(get_black_pen(screen.machine()), cliprect);
189   bitmap.fill(get_black_pen(machine()), cliprect);
190190   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
191191   pandora_update(m_pandora, bitmap, cliprect);
192192
trunk/src/mess/machine/amstrad.c
r17988r17989
24222422   // rising edge
24232423   if (state)
24242424   {
2425      cpc_multiface2_device* mface2 = dynamic_cast<cpc_multiface2_device*>(get_expansion_device(screen.machine(),"multiface2"));
2425      cpc_multiface2_device* mface2 = dynamic_cast<cpc_multiface2_device*>(get_expansion_device(machine(),"multiface2"));
24262426
24272427      if(mface2 != NULL)
24282428      {
trunk/src/mess/machine/sms.c
r17988r17989
21922192
21932193   if (&screen != m_main_scr)
21942194   {
2195      sscope = screen.machine().root_device().ioport("SEGASCOPE")->read_safe(0x00);
2195      sscope = machine().root_device().ioport("SEGASCOPE")->read_safe(0x00);
21962196      if (!sscope)
21972197      {
21982198         occluded_view = 1;
r17988r17989
22192219      // save a copy of current bitmap for the binocular hack
22202220      if (sscope)
22212221      {
2222         sscope_binocular_hack = screen.machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
2222         sscope_binocular_hack = machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
22232223
22242224         if (&screen == m_left_lcd)
22252225         {
r17988r17989
22392239      // use the copied bitmap for the binocular hack
22402240      if (sscope)
22412241      {
2242         sscope_binocular_hack = screen.machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
2242         sscope_binocular_hack = machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
22432243
22442244         if (&screen == m_left_lcd)
22452245         {
trunk/src/mess/machine/lisa.c
r17988r17989
838838      for (x = 0; x < resx; x++)
839839//          line_buffer[x] = (v[(x+y*resx)>>4] & (0x8000 >> ((x+y*resx) & 0xf))) ? 0 : 1;
840840         line_buffer[x] = (v[(x+y*resx)>>4] & (0x8000 >> (x & 0xf))) ? 0 : 1;
841      draw_scanline8(bitmap, 0, y, resx, line_buffer, screen.machine().pens);
841      draw_scanline8(bitmap, 0, y, resx, line_buffer, machine().pens);
842842   }
843843   return 0;
844844}
trunk/src/mess/video/pdp1.c
r17988r17989
9191   crt_update(m_crt, bitmap);
9292   pdp1_draw_lightpen(this, bitmap);
9393
94   pdp1_draw_panel(screen.machine(), m_panel_bitmap);
94   pdp1_draw_panel(machine(), m_panel_bitmap);
9595   copybitmap(bitmap, m_panel_bitmap, 0, 0, panel_window_offset_x, panel_window_offset_y, cliprect);
9696
9797   copybitmap(bitmap, m_typewriter_bitmap, 0, 0, typewriter_window_offset_x, typewriter_window_offset_y, cliprect);
trunk/src/mess/video/hp48.c
r17988r17989
129129
130130UINT32 hp48_state::screen_update_hp48(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
131131{
132   hp48_state *state = screen.machine().driver_data<hp48_state>();
133   address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
132   hp48_state *state = machine().driver_data<hp48_state>();
133   address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
134134   int x, y, xp, i, addr;
135135   int display       = HP48_IO_4(0) >> 3;           /* 1=on, 0=off */
136136   int left_margin   = HP48_IO_4(0) & 7;            /* 0..7 pixels for main bitmap */
r17988r17989
142142   int menu_start    = HP48_IO_20(0x30) & ~1;       /* menu bitmap address */
143143   int fg = contrast + 2;
144144
145   LOG(( "%f hp48 video_update called: ", screen.machine().time().as_double()));
145   LOG(( "%f hp48 video_update called: ", machine().time().as_double()));
146146
147147   if ( !display || refresh )
148148   {
trunk/src/mess/video/apple3.c
r17988r17989
369369   {
370370      case 0:
371371      case VAR_VM0:
372         apple3_video_text40(screen.machine(),bitmap);
372         apple3_video_text40(machine(),bitmap);
373373         break;
374374
375375      case VAR_VM1:
376376      case VAR_VM1|VAR_VM0:
377         apple3_video_text80(screen.machine(),bitmap);
377         apple3_video_text80(machine(),bitmap);
378378         break;
379379
380380      case VAR_VM3:
381         apple3_video_graphics_hgr(screen.machine(),bitmap);   /* hgr mode */
381         apple3_video_graphics_hgr(machine(),bitmap);   /* hgr mode */
382382         break;
383383
384384      case VAR_VM3|VAR_VM0:
385         apple3_video_graphics_chgr(screen.machine(),bitmap);
385         apple3_video_graphics_chgr(machine(),bitmap);
386386         break;
387387
388388      case VAR_VM3|VAR_VM1:
389         apple3_video_graphics_shgr(screen.machine(),bitmap);
389         apple3_video_graphics_shgr(machine(),bitmap);
390390         break;
391391
392392      case VAR_VM3|VAR_VM1|VAR_VM0:
393         apple3_video_graphics_chires(screen.machine(),bitmap);
393         apple3_video_graphics_chires(machine(),bitmap);
394394         break;
395395   }
396396   return 0;
trunk/src/mess/video/dai.c
r17988r17989
5757
5858UINT32 dai_state::screen_update_dai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5959{
60   address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
60   address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
6161   int i, j, k, l;
6262
6363   UINT8* char_rom = memregion("gfx1")->base();
trunk/src/mess/video/nc.c
r17988r17989
9090    {
9191      int by;
9292      /* 64 bytes per line */
93      char *line_ptr = ((char*)screen.machine().device<ram_device>(RAM_TAG)->pointer()) + m_display_memory_start + (y<<6);
93      char *line_ptr = ((char*)machine().device<ram_device>(RAM_TAG)->pointer()) + m_display_memory_start + (y<<6);
9494
9595      x = 0;
9696      for (by=0; by<width>>3; by++)
trunk/src/mess/video/mac.c
r17988r17989
8686   UINT16 *line;
8787   int y, x, b;
8888
89   video_base = screen.machine().device<ram_device>(RAM_TAG)->size() - (m_screen_buffer ? MAC_MAIN_SCREEN_BUF_OFFSET : MAC_ALT_SCREEN_BUF_OFFSET);
90   video_ram = (const UINT16 *) (screen.machine().device<ram_device>(RAM_TAG)->pointer() + video_base);
89   video_base = machine().device<ram_device>(RAM_TAG)->size() - (m_screen_buffer ? MAC_MAIN_SCREEN_BUF_OFFSET : MAC_ALT_SCREEN_BUF_OFFSET);
90   video_ram = (const UINT16 *) (machine().device<ram_device>(RAM_TAG)->pointer() + video_base);
9191
9292   for (y = 0; y < MAC_V_VIS; y++)
9393   {
r17988r17989
373373{
374374   UINT32 *scanline;
375375   int x, y, hres, vres;
376   UINT8 *vram8 = (UINT8 *)screen.machine().device<ram_device>(RAM_TAG)->pointer();
376   UINT8 *vram8 = (UINT8 *)machine().device<ram_device>(RAM_TAG)->pointer();
377377
378378   switch (m_rbv_montype)
379379   {
trunk/src/mess/video/ac1.c
r17988r17989
2929UINT32 ac1_state::screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3030{
3131   int x,y;
32   address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
32   address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
3333
3434   for(y = 0; y < 16; y++ )
3535   {
3636      for(x = 0; x < 64; x++ )
3737      {
3838         int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
39         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, 63*6-x*6,15*8-y*8);
39         drawgfx_opaque(bitmap, cliprect, machine().gfx[0],  code , 0, 0,0, 63*6-x*6,15*8-y*8);
4040      }
4141   }
4242   return 0;
r17988r17989
4545UINT32 ac1_state::screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
4646{
4747   int x,y;
48   address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
48   address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
4949
5050   for(y = 0; y < 32; y++ )
5151   {
5252      for(x = 0; x < 64; x++ )
5353      {
5454         int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
55         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, 63*6-x*6,31*8-y*8);
55         drawgfx_opaque(bitmap, cliprect, machine().gfx[0],  code , 0, 0,0, 63*6-x*6,31*8-y*8);
5656      }
5757   }
5858   return 0;
trunk/src/mess/video/nes.c
r17988r17989
4747   if (m_disk_expansion && m_pcb_id == NO_BOARD)
4848   {
4949      // latch this input so it doesn't go at warp speed
50      if ((screen.machine().root_device().ioport("FLIPDISK")->read() & 0x01) && (!m_last_frame_flip))
50      if ((machine().root_device().ioport("FLIPDISK")->read() & 0x01) && (!m_last_frame_flip))
5151      {
5252         m_last_frame_flip = 1;
5353         m_fds_current_side++;
r17988r17989
6060            popmessage("Disk set to side %d", m_fds_current_side);
6161      }
6262
63      if (!(screen.machine().root_device().ioport("FLIPDISK")->read() & 0x01))
63      if (!(machine().root_device().ioport("FLIPDISK")->read() & 0x01))
6464         m_last_frame_flip = 0;
6565   }
6666   return 0;
trunk/src/mess/video/pcw16.c
r17988r17989
156156***************************************************************************/
157157UINT32 pcw16_state::screen_update_pcw16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
158158{
159   UINT8 *ram = screen.machine().device<ram_device>(RAM_TAG)->pointer();
159   UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
160160   unsigned char *pScanLine = (unsigned char *)ram + 0x0fc00;   //0x03c00;  //0x020FC00;
161161
162162   int y;
trunk/src/mess/video/radio86.c
r17988r17989
109109
110110UINT32 radio86_state::screen_update_radio86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
111111{
112   device_t *devconf = screen.machine().device("i8275");
112   device_t *devconf = machine().device("i8275");
113113   i8275_update( devconf, bitmap, cliprect);
114114   copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
115115   return 0;
trunk/src/mess/video/mz700.c
r17988r17989
5151   UINT8 *videoram = m_videoram;
5252   int offs;
5353
54   bitmap.fill(get_black_pen(screen.machine()), cliprect);
54   bitmap.fill(get_black_pen(machine()), cliprect);
5555
5656   for(offs = 0; offs < 40*25; offs++)
5757   {
r17988r17989
6363      color = m_colorram[offs];
6464      code = videoram[offs] | (color & 0x80) << 1;
6565
66      drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code, color, 0, 0, sx, sy);
66      drawgfx_opaque(bitmap, cliprect, machine().gfx[0], code, color, 0, 0, sx, sy);
6767   }
6868
6969   return 0;
r17988r17989
8383{
8484   UINT8 *videoram = m_videoram;
8585
86   bitmap.fill(get_black_pen(screen.machine()), cliprect);
86   bitmap.fill(get_black_pen(machine()), cliprect);
8787
8888   if (m_mz700_mode)
8989      return SCREEN_UPDATE16_CALL_MEMBER(mz700);
trunk/src/mess/video/b2m.c
r17988r17989
2121   UINT8 code2;
2222   UINT8 col;
2323   int y, x, b;
24   UINT8 *ram = screen.machine().device<ram_device>(RAM_TAG)->pointer();
24   UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
2525
2626   for (x = 0; x < 48; x++)
2727   {
trunk/src/mess/video/cgenie.c
r17988r17989
413413UINT32 cgenie_state::screen_update_cgenie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
414414{
415415    if( m_tv_mode )
416      cgenie_refresh_tv_set(screen.machine(), bitmap, cliprect);
416      cgenie_refresh_tv_set(machine(), bitmap, cliprect);
417417   else
418      cgenie_refresh_monitor(screen.machine(), bitmap, cliprect);
418      cgenie_refresh_monitor(machine(), bitmap, cliprect);
419419   return 0;
420420}
trunk/src/mess/video/x68k.c
r17988r17989
12001200      rect.max_y = cliprect.max_y;
12011201
12021202   // update tiles
1203   //rom = screen.machine().root_device().memregion("user1")->base();
1203   //rom = machine().root_device().memregion("user1")->base();
12041204   for(x=0;x<256;x++)
12051205   {
12061206      if(m_video.tile16_dirty[x] != 0)
12071207      {
1208         screen.machine().gfx[1]->mark_dirty(x);
1208         machine().gfx[1]->mark_dirty(x);
12091209         m_video.tile16_dirty[x] = 0;
12101210      }
12111211      if(m_video.tile8_dirty[x] != 0)
12121212      {
1213         screen.machine().gfx[0]->mark_dirty(x);
1213         machine().gfx[0]->mark_dirty(x);
12141214         m_video.tile8_dirty[x] = 0;
12151215      }
12161216   }
r17988r17989
12191219   {
12201220      // Graphics screen(s)
12211221      if(priority == m_video.gfx_pri)
1222         x68k_draw_gfx(screen.machine(),bitmap,rect);
1222         x68k_draw_gfx(machine(),bitmap,rect);
12231223
12241224      // Sprite / BG Tiles
12251225      if(priority == m_video.sprite_pri /*&& (m_spritereg[0x404] & 0x0200)*/ && (m_video.reg[2] & 0x0040))
12261226      {
1227         x68k_draw_sprites(screen.machine(), bitmap,1,rect);
1227         x68k_draw_sprites(machine(), bitmap,1,rect);
12281228         if((m_spritereg[0x404] & 0x0008))
12291229         {
12301230            if((m_spritereg[0x404] & 0x0030) == 0x10)  // BG1 TXSEL
r17988r17989
12401240               x68k_bg1->draw(bitmap,rect,0,0);
12411241            }
12421242         }
1243         x68k_draw_sprites(screen.machine(),bitmap,2,rect);
1243         x68k_draw_sprites(machine(),bitmap,2,rect);
12441244         if((m_spritereg[0x404] & 0x0001))
12451245         {
12461246            if((m_spritereg[0x404] & 0x0006) == 0x02)  // BG0 TXSEL
r17988r17989
12561256               x68k_bg1->draw(bitmap,rect,0,0);
12571257            }
12581258         }
1259         x68k_draw_sprites(screen.machine(),bitmap,3,rect);
1259         x68k_draw_sprites(machine(),bitmap,3,rect);
12601260      }
12611261
12621262      // Text screen
r17988r17989
12651265         xscr = (m_crtc.reg[10] & 0x3ff);
12661266         yscr = (m_crtc.reg[11] & 0x3ff);
12671267         if(!(m_crtc.reg[20] & 0x1000))  // if text layer is set to buffer, then it's not visible
1268            x68k_draw_text(screen.machine(),bitmap,xscr,yscr,rect);
1268            x68k_draw_text(machine(),bitmap,xscr,yscr,rect);
12691269      }
12701270   }
12711271
12721272#ifdef MAME_DEBUG
1273   if(screen.machine().input().code_pressed(KEYCODE_I))
1273   if(machine().input().code_pressed(KEYCODE_I))
12741274   {
12751275      m_mfp.isra = 0;
12761276      m_mfp.isrb = 0;
12771277//      mfp_trigger_irq(MFP_IRQ_GPIP6);
12781278//      machine().device("maincpu")->execute().set_input_line_and_vector(6,ASSERT_LINE,0x43);
12791279   }
1280   if(screen.machine().input().code_pressed(KEYCODE_9))
1280   if(machine().input().code_pressed(KEYCODE_9))
12811281   {
12821282      m_sprite_shift--;
12831283      popmessage("Sprite shift = %i",m_sprite_shift);
12841284   }
1285   if(screen.machine().input().code_pressed(KEYCODE_0))
1285   if(machine().input().code_pressed(KEYCODE_0))
12861286   {
12871287      m_sprite_shift++;
12881288      popmessage("Sprite shift = %i",m_sprite_shift);
trunk/src/mess/video/kramermc.c
r17988r17989
3030UINT32 kramermc_state::screen_update_kramermc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3131{
3232   int x,y;
33   address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
33   address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
3434
3535   for(y = 0; y < 16; y++ )
3636   {
3737      for(x = 0; x < 64; x++ )
3838      {
3939         int code = space.read_byte(KRAMERMC_VIDEO_MEMORY + x + y*64);
40         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, x*8,y*8);
40         drawgfx_opaque(bitmap, cliprect, machine().gfx[0],  code , 0, 0,0, x*8,y*8);
4141      }
4242   }
4343   return 0;
trunk/src/mess/video/spectrum.c
r17988r17989
7474
7575      /* Empty event buffer for undisplayed frames noting the last border
7676           colour (in case colours are not changed in the next frame). */
77      NumItems = spectrum_EventList_NumEvents(screen.machine());
77      NumItems = spectrum_EventList_NumEvents(machine());
7878      if (NumItems)
7979      {
80         pItem = spectrum_EventList_GetFirstItem(screen.machine());
81         spectrum_border_set_last_color ( screen.machine(), pItem[NumItems-1].Event_Data );
82         spectrum_EventList_Reset(screen.machine());
83         spectrum_EventList_SetOffsetStartTime ( screen.machine(), screen.machine().firstcpu->attotime_to_cycles(screen.scan_period() * screen.vpos()) );
80         pItem = spectrum_EventList_GetFirstItem(machine());
81         spectrum_border_set_last_color ( machine(), pItem[NumItems-1].Event_Data );
82         spectrum_EventList_Reset(machine());
83         spectrum_EventList_SetOffsetStartTime ( machine(), machine().firstcpu->attotime_to_cycles(screen.scan_period() * screen.vpos()) );
8484         logerror ("Event log reset in callback fn.\n");
8585      }
8686   }
r17988r17989
159159      }
160160   }
161161
162   spectrum_border_draw(screen.machine(), bitmap, full_refresh,
162   spectrum_border_draw(machine(), bitmap, full_refresh,
163163      SPEC_TOP_BORDER, SPEC_DISPLAY_YSIZE, SPEC_BOTTOM_BORDER,
164164      SPEC_LEFT_BORDER, SPEC_DISPLAY_XSIZE, SPEC_RIGHT_BORDER,
165165      SPEC_LEFT_BORDER_CYCLES, SPEC_DISPLAY_XSIZE_CYCLES,
trunk/src/mess/video/ondra.c
r17988r17989
2929      {
3030         for (y = 127; y >=0; y--)
3131         {
32            code1 = screen.machine().device<ram_device>(RAM_TAG)->pointer()[0xd700 + Vaddr + 0x80];
33            code2 = screen.machine().device<ram_device>(RAM_TAG)->pointer()[0xd700 + Vaddr + 0x00];
32            code1 = machine().device<ram_device>(RAM_TAG)->pointer()[0xd700 + Vaddr + 0x80];
33            code2 = machine().device<ram_device>(RAM_TAG)->pointer()[0xd700 + Vaddr + 0x00];
3434            for (b = 0; b < 8; b++)
3535            {
3636               bitmap.pix16(2*y, x*8+b) =  ((code1 << b) & 0x80) ? 1 : 0;
trunk/src/mess/video/super80.c
r17988r17989
7676   if (state)
7777   {
7878      /* if we chose another palette or colour mode, enable it */
79      UINT8 chosen_palette = (screen.machine().root_device().ioport("CONFIG")->read() & 0x60)>>5;            // read colour dipswitches
79      UINT8 chosen_palette = (machine().root_device().ioport("CONFIG")->read() & 0x60)>>5;            // read colour dipswitches
8080
8181      if (chosen_palette != m_current_palette)                  // any changes?
8282      {
8383         m_current_palette = chosen_palette;               // save new palette
8484         if (!m_current_palette)
85            palette_set_colors_rgb(screen.machine(), super80_comp_palette);      // composite colour
85            palette_set_colors_rgb(machine(), super80_comp_palette);      // composite colour
8686         else
87            palette_set_colors_rgb(screen.machine(), super80_rgb_palette);      // rgb and b&w
87            palette_set_colors_rgb(machine(), super80_rgb_palette);      // rgb and b&w
8888      }
8989   }
9090}
r17988r17989
9797
9898   output_set_value("cass_led",(m_shared & 0x20) ? 1 : 0);
9999
100   if ((m_shared & 4) || (!(screen.machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
100   if ((m_shared & 4) || (!(machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
101101      screen_on++;
102102
103103   for (y = 0; y < 16; y++)
r17988r17989
138138
139139   output_set_value("cass_led",(m_shared & 0x20) ? 1 : 0);
140140
141   if ((m_shared & 4) || (!(screen.machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
141   if ((m_shared & 4) || (!(machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
142142      screen_on++;
143143
144144   for (y = 0; y < 16; y++)
r17988r17989
179179
180180   output_set_value("cass_led",(m_shared & 0x20) ? 1 : 0);
181181
182   if ((m_shared & 4) || (!(screen.machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
182   if ((m_shared & 4) || (!(machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
183183      screen_on++;
184184
185185   for (y = 0; y < 16; y++)
r17988r17989
216216{
217217   UINT8 y,ra,chr=32,gfx,screen_on=0;
218218   UINT16 sy=0,ma=m_vidpg,x;
219   UINT8 col, bg=0, fg=0, options=screen.machine().root_device().ioport("CONFIG")->read();
219   UINT8 col, bg=0, fg=0, options=machine().root_device().ioport("CONFIG")->read();
220220   UINT8 *RAM = memregion("maincpu")->base();
221221
222222   /* get selected character generator */
r17988r17989
384384   m_framecnt++;
385385   m_speed = m_mc6845_reg[10]&0x20, m_flash = m_mc6845_reg[10]&0x40; // cursor modes
386386   m_cursor = (m_mc6845_reg[14]<<8) | m_mc6845_reg[15]; // get cursor position
387   m_s_options=screen.machine().root_device().ioport("CONFIG")->read();
387   m_s_options=machine().root_device().ioport("CONFIG")->read();
388388   output_set_value("cass_led",(m_shared & 0x20) ? 1 : 0);
389389   m_6845->screen_update(screen, bitmap, cliprect);
390390   return 0;
trunk/src/mess/video/tx0.c
r17988r17989
7777{
7878   crt_update(m_crt, bitmap);
7979
80   tx0_draw_panel(screen.machine(), m_panel_bitmap);
80   tx0_draw_panel(machine(), m_panel_bitmap);
8181   copybitmap(bitmap, m_panel_bitmap, 0, 0, panel_window_offset_x, panel_window_offset_y, cliprect);
8282
8383   copybitmap(bitmap, m_typewriter_bitmap, 0, 0, typewriter_window_offset_x, typewriter_window_offset_y, cliprect);
trunk/src/mess/video/timex.c
r17988r17989
189189      /* 64 Column mode */
190190      unsigned short inkcolor = (m_port_ff_data & 0x38) >> 3;
191191      for (count = 0; count < 192; count++)
192         ts2068_64col_scanline(screen.machine(),bitmap, count, TS2068_TOP_BORDER, inkcolor);
192         ts2068_64col_scanline(machine(),bitmap, count, TS2068_TOP_BORDER, inkcolor);
193193   }
194194   else if ((m_port_ff_data & 7) == 2)
195195   {
196196      /* Extended Color mode */
197197      for (count = 0; count < 192; count++)
198         ts2068_hires_scanline(screen.machine(),bitmap, count, TS2068_TOP_BORDER);
198         ts2068_hires_scanline(machine(),bitmap, count, TS2068_TOP_BORDER);
199199   }
200200   else if ((m_port_ff_data & 7) == 1)
201201   {
202202      /* Screen 6000-7aff */
203203      for (count = 0; count < 192; count++)
204         ts2068_lores_scanline(screen.machine(),bitmap, count, TS2068_TOP_BORDER, 1);
204         ts2068_lores_scanline(machine(),bitmap, count, TS2068_TOP_BORDER, 1);
205205   }
206206   else
207207   {
208208      /* Screen 4000-5aff */
209209      for (count = 0; count < 192; count++)
210         ts2068_lores_scanline(screen.machine(),bitmap, count, TS2068_TOP_BORDER, 0);
210         ts2068_lores_scanline(machine(),bitmap, count, TS2068_TOP_BORDER, 0);
211211   }
212212
213   spectrum_border_draw(screen.machine(), bitmap, full_refresh,
213   spectrum_border_draw(machine(), bitmap, full_refresh,
214214      TS2068_TOP_BORDER, SPEC_DISPLAY_YSIZE, TS2068_BOTTOM_BORDER,
215215      TS2068_LEFT_BORDER, TS2068_DISPLAY_XSIZE, TS2068_RIGHT_BORDER,
216216      SPEC_LEFT_BORDER_CYCLES, SPEC_DISPLAY_XSIZE_CYCLES,
r17988r17989
229229      /* 64 Column mode */
230230      unsigned short inkcolor = (m_port_ff_data & 0x38) >> 3;
231231      for (count = 0; count < 192; count++)
232         ts2068_64col_scanline(screen.machine(),bitmap, count, SPEC_TOP_BORDER, inkcolor);
232         ts2068_64col_scanline(machine(),bitmap, count, SPEC_TOP_BORDER, inkcolor);
233233   }
234234   else if ((m_port_ff_data & 7) == 2)
235235   {
236236      /* Extended Color mode */
237237      for (count = 0; count < 192; count++)
238         ts2068_hires_scanline(screen.machine(),bitmap, count, SPEC_TOP_BORDER);
238         ts2068_hires_scanline(machine(),bitmap, count, SPEC_TOP_BORDER);
239239   }
240240   else if ((m_port_ff_data & 7) == 1)
241241   {
242242      /* Screen 6000-7aff */
243243      for (count = 0; count < 192; count++)
244         ts2068_lores_scanline(screen.machine(),bitmap, count, SPEC_TOP_BORDER, 1);
244         ts2068_lores_scanline(machine(),bitmap, count, SPEC_TOP_BORDER, 1);
245245   }
246246   else
247247   {
248248      /* Screen 4000-5aff */
249249      for (count = 0; count < 192; count++)
250         ts2068_lores_scanline(screen.machine(),bitmap, count, SPEC_TOP_BORDER, 0);
250         ts2068_lores_scanline(machine(),bitmap, count, SPEC_TOP_BORDER, 0);
251251   }
252252
253   spectrum_border_draw(screen.machine(), bitmap, full_refresh,
253   spectrum_border_draw(machine(), bitmap, full_refresh,
254254      SPEC_TOP_BORDER, SPEC_DISPLAY_YSIZE, SPEC_BOTTOM_BORDER,
255255      TS2068_LEFT_BORDER, TS2068_DISPLAY_XSIZE, TS2068_RIGHT_BORDER,
256256      SPEC_LEFT_BORDER_CYCLES, SPEC_DISPLAY_XSIZE_CYCLES,
trunk/src/mess/video/pet.c
r17988r17989
7575   {
7676      for (x=0;x<40;x++, i++)
7777      {
78         drawgfx_opaque(bitmap, cliprect,screen.machine().gfx[m_font],
78         drawgfx_opaque(bitmap, cliprect,machine().gfx[m_font],
7979               videoram[i], 0, 0, 0, 8*x,8*y);
8080      }
8181   }
trunk/src/mess/video/pcw.c
r17988r17989
9292
9393         x = PCW_BORDER_WIDTH;
9494
95         roller_ram_ptr = screen.machine().device<ram_device>(RAM_TAG)->pointer() + m_roller_ram_addr + roller_ram_offs;
95         roller_ram_ptr = machine().device<ram_device>(RAM_TAG)->pointer() + m_roller_ram_addr + roller_ram_offs;
9696
9797         /* get line address */
9898         /* b16-14 control which bank the line is to be found in, b13-3 the address in the bank (in 16-byte units), and b2-0 the offset. Thus a roller RAM address bbbxxxxxxxxxxxyyy indicates bank bbb, address 00xxxxxxxxxxx0yyy. */
9999         line_data = ((unsigned char *)roller_ram_ptr)[0] | (((unsigned char *)roller_ram_ptr)[1]<<8);
100100
101101         /* calculate address of pixel data */
102         line_ptr = screen.machine().device<ram_device>(RAM_TAG)->pointer() + ((line_data & 0x0e000)<<1) + ((line_data & 0x01ff8)<<1) + (line_data & 0x07);
102         line_ptr = machine().device<ram_device>(RAM_TAG)->pointer() + ((line_data & 0x0e000)<<1) + ((line_data & 0x01ff8)<<1) + (line_data & 0x07);
103103
104104         for (by=0; by<90; by++)
105105         {
trunk/src/mess/video/oric.c
r17988r17989
182182      int x = 0;
183183
184184      /* foreground colour white */
185      oric_vh_update_attribute(screen.machine(),7);
185      oric_vh_update_attribute(machine(),7);
186186      /* background colour black */
187      oric_vh_update_attribute(screen.machine(),(1<<3));
188      oric_vh_update_attribute(screen.machine(),(1<<4));
187      oric_vh_update_attribute(machine(),(1<<3));
188      oric_vh_update_attribute(machine(),(1<<4));
189189
190190      for (byte_offset=0; byte_offset<40; byte_offset++)
191191      {
r17988r17989
213213         }
214214
215215         /* fetch data */
216         c = RAM ? RAM[read_addr] : screen.machine().device("maincpu")->memory().space(AS_PROGRAM)->read_byte(read_addr);
216         c = RAM ? RAM[read_addr] : machine().device("maincpu")->memory().space(AS_PROGRAM)->read_byte(read_addr);
217217
218218         /* if bits 6 and 5 are zero, the byte contains a serial attribute */
219219         if ((c & ((1 << 6) | (1 << 5))) == 0)
220220         {
221            oric_vh_update_attribute(screen.machine(), c);
221            oric_vh_update_attribute(machine(), c);
222222
223223            /* display background colour when attribute has been found */
224224            oric_vh_render_6pixels(bitmap, x, y, m_vh_state.active_foreground_colour, m_vh_state.active_background_colour, 0, (c & 0x080));
trunk/src/mess/video/vector06.c
r17988r17989
1919   UINT8 code1,code2,code3,code4;
2020   UINT8 col;
2121   int y, x, b,draw_y;
22   UINT8 *ram = screen.machine().device<ram_device>(RAM_TAG)->pointer();
22   UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
2323
2424   int width = (m_video_mode==0x00) ? 256 : 512;
2525   rectangle screen_area(0,width+64-1,0,256+64-1);
trunk/src/mess/video/galeb.c
r17988r17989
3636      for(x = 0; x < 48; x++ )
3737      {
3838         int code = m_video_ram[15 + x + y*64];
39         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, x*8,y*8);
39         drawgfx_opaque(bitmap, cliprect, machine().gfx[0],  code , 0, 0,0, x*8,y*8);
4040      }
4141   }
4242   return 0;
trunk/src/mess/video/apple1.c
r17988r17989
393393
394394UINT32 apple1_state::screen_update_apple1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
395395{
396   apple1_vh_cursor_blink(screen.machine());
397   terminal_draw(screen.machine(), bitmap, cliprect, m_terminal);
396   apple1_vh_cursor_blink(machine());
397   terminal_draw(machine(), bitmap, cliprect, m_terminal);
398398   return 0;
399399}
trunk/src/mess/video/orion.c
r17988r17989
2424   int part1addr = (3-((m_orion128_video_page & 3) | orionproshift)) * 0x4000;
2525   int part2addr = part1addr + 0x10000;
2626   int video_mode = m_orion128_video_mode & m_video_mode_mask;
27   UINT8 *ram = screen.machine().device<ram_device>(RAM_TAG)->pointer();
27   UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
2828
2929   for (x = 0; x < m_orion128_video_width; x++)
3030   {
trunk/src/mess/video/fmtowns.c
r17988r17989
18141814
18151815   if(!(m_video.towns_video_reg[1] & 0x01))
18161816   {
1817      if(!screen.machine().input().code_pressed(KEYCODE_Q))
1817      if(!machine().input().code_pressed(KEYCODE_Q))
18181818      {
18191819         if((m_video.towns_layer_ctrl & 0x03) != 0)
1820            towns_crtc_draw_layer(screen.machine(),bitmap,&m_video.towns_crtc_layerscr[1],1);
1820            towns_crtc_draw_layer(machine(),bitmap,&m_video.towns_crtc_layerscr[1],1);
18211821      }
1822      if(!screen.machine().input().code_pressed(KEYCODE_W))
1822      if(!machine().input().code_pressed(KEYCODE_W))
18231823      {
18241824         if((m_video.towns_layer_ctrl & 0x0c) != 0)
1825            towns_crtc_draw_layer(screen.machine(),bitmap,&m_video.towns_crtc_layerscr[0],0);
1825            towns_crtc_draw_layer(machine(),bitmap,&m_video.towns_crtc_layerscr[0],0);
18261826      }
18271827   }
18281828   else
18291829   {
1830      if(!screen.machine().input().code_pressed(KEYCODE_Q))
1830      if(!machine().input().code_pressed(KEYCODE_Q))
18311831      {
18321832         if((m_video.towns_layer_ctrl & 0x0c) != 0)
1833            towns_crtc_draw_layer(screen.machine(),bitmap,&m_video.towns_crtc_layerscr[0],0);
1833            towns_crtc_draw_layer(machine(),bitmap,&m_video.towns_crtc_layerscr[0],0);
18341834      }
1835      if(!screen.machine().input().code_pressed(KEYCODE_W))
1835      if(!machine().input().code_pressed(KEYCODE_W))
18361836      {
18371837         if((m_video.towns_layer_ctrl & 0x03) != 0)
1838            towns_crtc_draw_layer(screen.machine(),bitmap,&m_video.towns_crtc_layerscr[1],1);
1838            towns_crtc_draw_layer(machine(),bitmap,&m_video.towns_crtc_layerscr[1],1);
18391839      }
18401840   }
18411841
18421842#if 0
18431843#ifdef SPR_DEBUG
1844   if(screen.machine().input().code_pressed(KEYCODE_O))
1844   if(machine().input().code_pressed(KEYCODE_O))
18451845      pshift+=0x80;
1846   if(screen.machine().input().code_pressed(KEYCODE_I))
1846   if(machine().input().code_pressed(KEYCODE_I))
18471847      pshift-=0x80;
18481848   popmessage("Pixel shift = %08x",pshift);
18491849#endif
trunk/src/mess/video/nascom1.c
r17988r17989
1717   for (sx = 0; sx < 48; sx++)
1818   {
1919      drawgfx_opaque (bitmap, cliprect,
20         screen.machine().gfx[0], videoram[0x03ca + sx],
20         machine().gfx[0], videoram[0x03ca + sx],
2121         1, 0, 0, sx * 8, 0);
2222   }
2323
r17988r17989
2626      for (sx = 0; sx < 48; sx++)
2727      {
2828         drawgfx_opaque (bitmap, cliprect,
29            screen.machine().gfx[0], videoram[0x000a + (sy * 64) + sx],
29            machine().gfx[0], videoram[0x000a + (sy * 64) + sx],
3030            1, 0, 0, sx * 8, (sy + 1) * 16);
3131      }
3232   }
r17988r17989
4141   for (sx = 0; sx < 48; sx++)
4242   {
4343      drawgfx_opaque (bitmap, cliprect,
44         screen.machine().gfx[0], videoram[0x03ca + sx],
44         machine().gfx[0], videoram[0x03ca + sx],
4545         1, 0, 0, sx * 8, 0);
4646   }
4747
r17988r17989
5050      for (sx = 0; sx < 48; sx++)
5151      {
5252         drawgfx_opaque (bitmap, cliprect,
53            screen.machine().gfx[0], videoram[0x000a + (sy * 64) + sx],
53            machine().gfx[0], videoram[0x000a + (sy * 64) + sx],
5454            1, 0, 0, sx * 8, (sy + 1) * 14);
5555      }
5656   }
trunk/src/mess/video/p2000m.c
r17988r17989
4141         if (code < 32) code = 32;
4242      }
4343
44      drawgfxzoom_opaque (bitmap, cliprect, screen.machine().gfx[0], code,
44      drawgfxzoom_opaque (bitmap, cliprect, machine().gfx[0], code,
4545         videoram[offs + 2048] & 0x08 ? 0 : 1, 0, 0, sx, sy, 0x20000, 0x20000);
4646
4747      if (videoram[offs] & 0x80)
trunk/src/mess/video/intv.c
r17988r17989
800800         {
801801            offs = current_row*64+x;
802802            drawgfx_transpen(bitmap, cliprect,
803               screen.machine().gfx[1],
803               machine().gfx[1],
804804               videoram[offs],
805805               7, /* white */
806806               0,0,
r17988r17989
811811            /* draw the cursor as a solid white block */
812812            /* (should use a filled rect here!) */
813813            drawgfx_transpen(bitmap, cliprect,
814               screen.machine().gfx[1],
814               machine().gfx[1],
815815               191, /* a block */
816816               7,   /* white   */
817817               0,0,
trunk/src/mess/video/ssystem3.c
r17988r17989
204204   ssystem3_draw_led(bitmap, m_lcd.data[3]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '3');
205205   ssystem3_draw_led(bitmap, m_lcd.data[4]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '4');
206206
207   if (screen.machine().root_device().ioport("Configuration")->read()&1) { // playfield(optional device)
207   if (machine().root_device().ioport("Configuration")->read()&1) { // playfield(optional device)
208208      static const int lcd_signs_on[]={
209209         0, // empty
210210         1, // bauer
r17988r17989
221221            int figure, black;
222222            int xp=263+x*22;
223223            int yp=55+(y^7)*28;
224            ssystem3_playfield_getfigure(screen.machine(), x, y, &figure, &black);
224            ssystem3_playfield_getfigure(machine(), x, y, &figure, &black);
225225            ssystem3_draw_led(bitmap, lcd_signs_on[figure]&1?1:0, xp, yp, '6');
226226            ssystem3_draw_led(bitmap, lcd_signs_on[figure]&2?1:0, xp, yp, '8');
227227            ssystem3_draw_led(bitmap, lcd_signs_on[figure]&4?1:0, xp, yp, '9');
trunk/src/mess/video/ut88.c
r17988r17989
3535      {
3636         int code = m_p_videoram[ x + y*64 ] & 0x7f;
3737         int attr = m_p_videoram[ x+1 + y*64 ] & 0x80;
38         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code | attr, 0, 0,0, x*8,y*8);
38         drawgfx_opaque(bitmap, cliprect, machine().gfx[0], code | attr, 0, 0,0, x*8,y*8);
3939      }
4040   }
4141   return 0;
trunk/src/mess/video/pp01.c
r17988r17989
2020   UINT8 code_r,code_g,code_b;
2121   UINT8 col;
2222   int y, x, b;
23   UINT8 *ram = screen.machine().device<ram_device>(RAM_TAG)->pointer();
23   UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
2424
2525   for (y = 0; y < 256; y++)
2626   {
trunk/src/mess/video/apple2.c
r17988r17989
478478   UINT32 new_a2;
479479
480480   /* calculate the m_flash value */
481   m_flash = ((screen.machine().time() * 4).seconds & 1) ? 1 : 0;
481   m_flash = ((machine().time() * 4).seconds & 1) ? 1 : 0;
482482
483483   /* read out relevant softswitch variables; to see what has changed */
484484   new_a2 = effective_a2(this);
trunk/src/mess/video/primo.c
r17988r17989
4141   int primo_scanline;
4242
4343   for (primo_scanline=0; primo_scanline<192; primo_scanline++)
44      primo_draw_scanline(screen.machine(), bitmap, primo_scanline);
44      primo_draw_scanline(machine(), bitmap, primo_scanline);
4545   return 0;
4646}
trunk/src/mess/video/hec2video.c
r17988r17989
125125      if (m_hector_flag_80c==0)
126126         {
127127            screen.set_visible_area(0, 243, 0, 227);
128            hector_hr( screen.machine(), bitmap , &videoram_HR[0], 227, 64);
128            hector_hr( machine(), bitmap , &videoram_HR[0], 227, 64);
129129         }
130130      else
131131         {
132132            screen.set_visible_area(0, 243*2, 0, 227);
133            hector_80c( screen.machine(), bitmap , &videoram_HR[0], 227, 64);
133            hector_80c( machine(), bitmap , &videoram_HR[0], 227, 64);
134134         }
135135      }
136136   else
137137      {
138138         screen.set_visible_area(0, 113, 0, 75);
139         hector_hr( screen.machine(), bitmap, videoram,  77, 32);
139         hector_hr( machine(), bitmap, videoram,  77, 32);
140140      }
141141   return 0;
142142}
trunk/src/mess/video/pk8020.c
r17988r17989
1919{
2020   int y, x, b, j;
2121   UINT8 *gfx = memregion("gfx1")->base();
22   UINT8 *ram = screen.machine().device<ram_device>(RAM_TAG)->pointer();
22   UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
2323
2424   for (y = 0; y < 16; y++)
2525   {
trunk/src/mess/video/bbc.c
r17988r17989
640640UINT32 bbc_state::screen_update_bbc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
641641{
642642
643    mc6845_device *mc6845 = screen.machine().device<mc6845_device>("mc6845");
643    mc6845_device *mc6845 = machine().device<mc6845_device>("mc6845");
644644    mc6845->update( bitmap, cliprect);
645645
646646    return 0;
r17988r17989
665665    while((m_BBC_VSync)&&(c<60000))
666666    {
667667        // Clock the 6845
668        m6845_clock(screen.machine());
668        m6845_clock(machine());
669669        c++;
670670    }
671671
r17988r17989
674674    // or until a timeout (this catches the 6845 with silly register values that would not give a VSYNC signal)
675675    while((!m_BBC_VSync)&&(c<60000))
676676    {
677        if ((m_y_screen_pos>=cliprect.min_y) && (m_y_screen_pos<=cliprect.max_y)) (m_draw_function)(screen.machine());
677        if ((m_y_screen_pos>=cliprect.min_y) && (m_y_screen_pos<=cliprect.max_y)) (m_draw_function)(machine());
678678
679679        // and check the cursor
680680        if (m_VideoULA_CR) BBC_Clock_CR(this);
681681
682682        // Clock the 6845
683        m6845_clock(screen.machine());
683        m6845_clock(machine());
684684        c++;
685685    }
686686
trunk/src/mess/video/vtech2.c
r17988r17989
142142               sy = BORDER_V/2 + y;
143143               sx = BORDER_H/2 + x * 8;
144144               code = videoram[offs];
145               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[2],code,color,0,0,sx,sy);
145               drawgfx_opaque(bitmap,cliprect,machine().gfx[2],code,color,0,0,sx,sy);
146146            }
147147         }
148148         break;
r17988r17989
162162               sx = BORDER_H/2 + x * 16;
163163               code = videoram[offs];
164164               color = videoram[offs+1];
165               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[3],code,color,0,0,sx,sy);
165               drawgfx_opaque(bitmap,cliprect,machine().gfx[3],code,color,0,0,sx,sy);
166166            }
167167         }
168168         break;
r17988r17989
181181               sy = BORDER_V/2 + y;
182182               sx = BORDER_H/2 + x * 8;
183183               code = videoram[offs];
184               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[5],code,0,0,0,sx,sy);
184               drawgfx_opaque(bitmap,cliprect,machine().gfx[5],code,0,0,0,sx,sy);
185185            }
186186         }
187187         break;
r17988r17989
201201               sy = BORDER_V/2 + y * 2;
202202               sx = BORDER_H/2 + x * 8;
203203               code = videoram[offs];
204               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[6],code,0,0,0,sx,sy);
204               drawgfx_opaque(bitmap,cliprect,machine().gfx[6],code,0,0,0,sx,sy);
205205            }
206206         }
207207         break;
r17988r17989
220220               sy = BORDER_V/2 + y;
221221               sx = BORDER_H/2 + x * 16;
222222               code = videoram[offs];
223               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[3],code,color,0,0,sx,sy);
223               drawgfx_opaque(bitmap,cliprect,machine().gfx[3],code,color,0,0,sx,sy);
224224            }
225225         }
226226         break;
r17988r17989
240240               sx = BORDER_H/2 + x * 32;
241241               code = videoram[offs];
242242               color = videoram[offs+1];
243               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[4],code,color,0,0,sx,sy);
243               drawgfx_opaque(bitmap,cliprect,machine().gfx[4],code,color,0,0,sx,sy);
244244            }
245245         }
246246         break;
r17988r17989
261261               sy = BORDER_V/2 + y * 8;
262262               sx = BORDER_H/2 + x * 8;
263263               code = videoram[0x3800+offs];
264               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],code,color,0,0,sx,sy);
264               drawgfx_opaque(bitmap,cliprect,machine().gfx[0],code,color,0,0,sx,sy);
265265            }
266266         }
267267      }
r17988r17989
278278               sx = BORDER_H/2 + x * 16;
279279               code = videoram[0x3800+offs];
280280               color = videoram[0x3801+offs];
281               drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[1],code,color,0,0,sx,sy);
281               drawgfx_opaque(bitmap,cliprect,machine().gfx[1],code,color,0,0,sx,sy);
282282            }
283283         }
284284      }
trunk/src/mess/drivers/rainbow.c
r17988r17989
207207
208208UINT32 rainbow_state::screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
209209{
210   device_t *devconf = screen.machine().device("vt100_video");
210   device_t *devconf = machine().device("vt100_video");
211211   rainbow_video_update( devconf, bitmap, cliprect);
212212   return 0;
213213}
trunk/src/mess/drivers/pc100.c
r17988r17989
9696               dot |= pen[pen_i]<<pen_i;
9797
9898            if(y < 512 && x*16+xi < 768) /* TODO: safety check */
99               bitmap.pix16(y, x*16+xi) = screen.machine().pens[dot];
99               bitmap.pix16(y, x*16+xi) = machine().pens[dot];
100100         }
101101
102102         count++;
trunk/src/mess/drivers/mz2000.c
r17988r17989
8787
8888UINT32 mz2000_state::screen_update_mz2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8989{
90   UINT8 *tvram = screen.machine().root_device().memregion("tvram")->base();
91   UINT8 *gvram = screen.machine().root_device().memregion("gvram")->base();
90   UINT8 *tvram = machine().root_device().memregion("tvram")->base();
91   UINT8 *gvram = machine().root_device().memregion("gvram")->base();
9292   UINT8 *gfx_data = memregion("chargen")->base();
9393   int x,y,xi,yi;
9494   UINT8 x_size;
r17988r17989
108108            pen |= ((gvram[count+0xc000] >> (xi)) & 1) ? 4 : 0; //G
109109            pen &= m_gvram_mask;
110110
111            bitmap.pix16(y*2+0, x+xi) = screen.machine().pens[pen];
112            bitmap.pix16(y*2+1, x+xi) = screen.machine().pens[pen];
111            bitmap.pix16(y*2+0, x+xi) = machine().pens[pen];
112            bitmap.pix16(y*2+1, x+xi) = machine().pens[pen];
113113         }
114114         count++;
115115      }
r17988r17989
149149                  {
150150                     if(m_width80 == 0)
151151                     {
152                        bitmap.pix16(res_y, res_x*2+0) = screen.machine().pens[pen];
153                        bitmap.pix16(res_y, res_x*2+1) = screen.machine().pens[pen];
152                        bitmap.pix16(res_y, res_x*2+0) = machine().pens[pen];
153                        bitmap.pix16(res_y, res_x*2+1) = machine().pens[pen];
154154                     }
155155                     else
156156                     {
157                        bitmap.pix16(res_y, res_x) = screen.machine().pens[pen];
157                        bitmap.pix16(res_y, res_x) = machine().pens[pen];
158158                     }
159159                  }
160160                  else
161161                  {
162162                     if(m_width80 == 0)
163163                     {
164                        bitmap.pix16(res_y*2+0, res_x*2+0) = screen.machine().pens[pen];
165                        bitmap.pix16(res_y*2+0, res_x*2+1) = screen.machine().pens[pen];
166                        bitmap.pix16(res_y*2+1, res_x*2+0) = screen.machine().pens[pen];
167                        bitmap.pix16(res_y*2+1, res_x*2+1) = screen.machine().pens[pen];
164                        bitmap.pix16(res_y*2+0, res_x*2+0) = machine().pens[pen];
165                        bitmap.pix16(res_y*2+0, res_x*2+1) = machine().pens[pen];
166                        bitmap.pix16(res_y*2+1, res_x*2+0) = machine().pens[pen];
167                        bitmap.pix16(res_y*2+1, res_x*2+1) = machine().pens[pen];
168168                     }
169169                     else
170170                     {
171                        bitmap.pix16(res_y*2+0, res_x) = screen.machine().pens[pen];
172                        bitmap.pix16(res_y*2+1, res_x) = screen.machine().pens[pen];
171                        bitmap.pix16(res_y*2+0, res_x) = machine().pens[pen];
172                        bitmap.pix16(res_y*2+1, res_x) = machine().pens[pen];
173173                     }
174174                  }
175175               }
trunk/src/mess/drivers/z100.c
r17988r17989
262262                  dot = m_display_mask;
263263
264264               if(y*mc6845_tile_height+yi < 216 && x*8+xi < 640) /* TODO: safety check */
265                  bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = screen.machine().pens[dot];
265                  bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[dot];
266266            }
267267         }
268268      }
trunk/src/mess/drivers/c65.c
r17988r17989
234234
235235UINT32 c65_state::screen_update_c65(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
236236{
237   device_t *vic3 = screen.machine().device("vic3");
237   device_t *vic3 = machine().device("vic3");
238238
239239   vic3_video_update(vic3, bitmap, cliprect);
240240   return 0;
trunk/src/mess/drivers/multi16.c
r17988r17989
7575            int dot = (BITSWAP16(m_p_vram[count],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8) >> (15-xi)) & 0x1;
7676
7777            if(screen.visible_area().contains(x*16+xi, y))
78               bitmap.pix16(y, x*16+xi) = screen.machine().pens[dot];
78               bitmap.pix16(y, x*16+xi) = machine().pens[dot];
7979         }
8080
8181         count++;
trunk/src/mess/drivers/pc88va.c
r17988r17989
447447         {
448448            switch(cur_pri_lv & 3) // (palette color mode)
449449            {
450               case 0: draw_text(screen.machine(),bitmap,cliprect); break;
451               case 1: if(m_tsp.spr_on) { draw_sprites(screen.machine(),bitmap,cliprect); } break;
450               case 0: draw_text(machine(),bitmap,cliprect); break;
451               case 1: if(m_tsp.spr_on) { draw_sprites(machine(),bitmap,cliprect); } break;
452452               case 2: /* A = graphic 0 */ break;
453453               case 3: /* B = graphic 1 */ break;
454454            }
trunk/src/mess/drivers/pc6001.c
r17988r17989
508508
509509UINT32 pc6001_state::screen_update_pc6001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
510510{
511   pc6001_screen_draw(screen.machine(),bitmap,cliprect,1);
511   pc6001_screen_draw(machine(),bitmap,cliprect,1);
512512
513513   return 0;
514514}
r17988r17989
551551               color |= ((pen[1] & 2) << 2);
552552
553553               if (cliprect.contains((x+i)*2+0, y))
554                  bitmap.pix16(y, (x+i)*2+0) = screen.machine().pens[color];
554                  bitmap.pix16(y, (x+i)*2+0) = machine().pens[color];
555555               if (cliprect.contains((x+i)*2+1, y))
556                  bitmap.pix16(y, (x+i)*2+1) = screen.machine().pens[color];
556                  bitmap.pix16(y, (x+i)*2+1) = machine().pens[color];
557557            }
558558
559559            count++;
r17988r17989
599599               }
600600
601601               if (cliprect.contains(x+i, y))
602                  bitmap.pix16(y, (x+i)) = screen.machine().pens[color];
602                  bitmap.pix16(y, (x+i)) = machine().pens[color];
603603            }
604604
605605            count++;
r17988r17989
610610   else if(m_exgfx_text_mode)
611611   {
612612      int xi,yi,pen,fgcol,bgcol,color;
613      UINT8 *gfx_data = screen.machine().root_device().memregion("gfx1")->base();
613      UINT8 *gfx_data = machine().root_device().memregion("gfx1")->base();
614614
615615      for(y=0;y<20;y++)
616616      {
r17988r17989
639639                  color = pen ? fgcol : bgcol;
640640
641641                  if (cliprect.contains(x*8+xi, y*12+yi))
642                     bitmap.pix16(((y*12+yi)), (x*8+xi)) = screen.machine().pens[color];
642                     bitmap.pix16(((y*12+yi)), (x*8+xi)) = machine().pens[color];
643643               }
644644            }
645645         }
r17988r17989
648648   else
649649   {
650650      attr = m_video_ram[0];
651      pc6001_screen_draw(screen.machine(),bitmap,cliprect,0);
651      pc6001_screen_draw(machine(),bitmap,cliprect,0);
652652   }
653653
654654   return 0;
r17988r17989
683683                  color = pen ? fgcol : bgcol;
684684
685685                  if (cliprect.contains(x*8+xi, y*12+yi))
686                     bitmap.pix16(((y*12+yi)), (x*8+xi)) = screen.machine().pens[color];
686                     bitmap.pix16(((y*12+yi)), (x*8+xi)) = machine().pens[color];
687687               }
688688            }
689689         }
r17988r17989
702702            color = m_video_ram[count] & 0x0f;
703703
704704            if (cliprect.contains(x+0, y+0))
705               bitmap.pix16((y+0), (x+0)) = screen.machine().pens[color+0x10];
705               bitmap.pix16((y+0), (x+0)) = machine().pens[color+0x10];
706706
707707            color = (m_video_ram[count] & 0xf0) >> 4;
708708
709709            if (cliprect.contains(x+1, y+0))
710               bitmap.pix16((y+0), (x+1)) = screen.machine().pens[color+0x10];
710               bitmap.pix16((y+0), (x+1)) = machine().pens[color+0x10];
711711
712712            color = m_video_ram[count+1] & 0x0f;
713713
714714            if (cliprect.contains(x+2, y+0))
715               bitmap.pix16((y+0), (x+2)) = screen.machine().pens[color+0x10];
715               bitmap.pix16((y+0), (x+2)) = machine().pens[color+0x10];
716716
717717            color = (m_video_ram[count+1] & 0xf0) >> 4;
718718
719719            if (cliprect.contains(x+3, y+0))
720               bitmap.pix16((y+0), (x+3)) = screen.machine().pens[color+0x10];
720               bitmap.pix16((y+0), (x+3)) = machine().pens[color+0x10];
721721
722722            color = m_video_ram[count+2] & 0x0f;
723723
724724            if (cliprect.contains(x+0, y+1))
725               bitmap.pix16((y+1), (x+0)) = screen.machine().pens[color+0x10];
725               bitmap.pix16((y+1), (x+0)) = machine().pens[color+0x10];
726726
727727            color = (m_video_ram[count+2] & 0xf0) >> 4;
728728
729729            if (cliprect.contains(x+1, y+1))
730               bitmap.pix16((y+1), (x+1)) = screen.machine().pens[color+0x10];
730               bitmap.pix16((y+1), (x+1)) = machine().pens[color+0x10];
731731
732732            color = m_video_ram[count+3] & 0x0f;
733733
734734            if (cliprect.contains(x+2, y+1))
735               bitmap.pix16((y+1), (x+2)) = screen.machine().pens[color+0x10];
735               bitmap.pix16((y+1), (x+2)) = machine().pens[color+0x10];
736736
737737            color = (m_video_ram[count+3] & 0xf0) >> 4;
738738
739739            if (cliprect.contains(x+3, y+1))
740               bitmap.pix16((y+1), (x+3)) = screen.machine().pens[color+0x10];
740               bitmap.pix16((y+1), (x+3)) = machine().pens[color+0x10];
741741
742742
743743            count+=4;
trunk/src/mess/drivers/vii.c
r17988r17989
422422
423423   for(i = 0; i < 4; i++)
424424   {
425      vii_blit_page(screen.machine(), bitmap, cliprect, i, 0x40 * m_video_regs[0x20], m_video_regs + 0x10);
426      vii_blit_page(screen.machine(), bitmap, cliprect, i, 0x40 * m_video_regs[0x21], m_video_regs + 0x16);
427      vii_blit_sprites(screen.machine(), bitmap, cliprect, i);
425      vii_blit_page(machine(), bitmap, cliprect, i, 0x40 * m_video_regs[0x20], m_video_regs + 0x10);
426      vii_blit_page(machine(), bitmap, cliprect, i, 0x40 * m_video_regs[0x21], m_video_regs + 0x16);
427      vii_blit_sprites(machine(), bitmap, cliprect, i);
428428   }
429429
430430   for(y = 0; y < 240; y++)
trunk/src/mess/drivers/x1.c
r17988r17989
547547
548548   bitmap.fill(MAKE_ARGB(0xff,0x00,0x00,0x00), cliprect);
549549
550   draw_gfxbitmap(screen.machine(),bitmap,cliprect,m_scrn_reg.disp_bank,m_scrn_reg.pri);
551   draw_fgtilemap(screen.machine(),bitmap,cliprect);
552   draw_gfxbitmap(screen.machine(),bitmap,cliprect,m_scrn_reg.disp_bank,m_scrn_reg.pri^0xff);
550   draw_gfxbitmap(machine(),bitmap,cliprect,m_scrn_reg.disp_bank,m_scrn_reg.pri);
551   draw_fgtilemap(machine(),bitmap,cliprect);
552   draw_gfxbitmap(machine(),bitmap,cliprect,m_scrn_reg.disp_bank,m_scrn_reg.pri^0xff);
553553
554554   return 0;
555555}
trunk/src/mess/drivers/smc777.c
r17988r17989
102102{
103103   int x,y,yi;
104104   UINT16 count;
105   UINT8 *vram = screen.machine().root_device().memregion("vram")->base();
106   UINT8 *attr = screen.machine().root_device().memregion("attr")->base();
105   UINT8 *vram = machine().root_device().memregion("vram")->base();
106   UINT8 *attr = machine().root_device().memregion("attr")->base();
107107   UINT8 *gram = memregion("fbuf")->base();
108108   int x_width;
109109
110   bitmap.fill(screen.machine().pens[m_backdrop_pen], cliprect);
110   bitmap.fill(machine().pens[m_backdrop_pen], cliprect);
111111
112112   x_width = (m_display_reg & 0x80) ? 2 : 4;
113113
r17988r17989
125125            /* todo: clean this up! */
126126            if(x_width == 2)
127127            {
128               bitmap.pix16(y+yi+CRTC_MIN_Y, x*2+0+CRTC_MIN_X) = screen.machine().pens[color];
128               bitmap.pix16(y+yi+CRTC_MIN_Y, x*2+0+CRTC_MIN_X) = machine().pens[color];
129129            }
130130            else
131131            {
132               bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+0+CRTC_MIN_X) = screen.machine().pens[color];
133               bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+1+CRTC_MIN_X) = screen.machine().pens[color];
132               bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+0+CRTC_MIN_X) = machine().pens[color];
133               bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+1+CRTC_MIN_X) = machine().pens[color];
134134            }
135135
136136            color = (gram[count] & 0x0f) >> 0;
137137            if(x_width == 2)
138138            {
139               bitmap.pix16(y+yi+CRTC_MIN_Y, x*2+1+CRTC_MIN_X) = screen.machine().pens[color];
139               bitmap.pix16(y+yi+CRTC_MIN_Y, x*2+1+CRTC_MIN_X) = machine().pens[color];
140140            }
141141            else
142142            {
143               bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+2+CRTC_MIN_X) = screen.machine().pens[color];
144               bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+3+CRTC_MIN_X) = screen.machine().pens[color];
143               bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+2+CRTC_MIN_X) = machine().pens[color];
144               bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+3+CRTC_MIN_X) = machine().pens[color];
145145            }
146146
147147            count++;
r17988r17989
181181            case 3: bk_pen = (color ^ 0xf); break; //complementary
182182         }
183183
184         if(blink && screen.machine().primary_screen->frame_number() & 0x10) //blinking, used by Dragon's Alphabet
184         if(blink && machine().primary_screen->frame_number() & 0x10) //blinking, used by Dragon's Alphabet
185185            color = bk_pen;
186186
187187         for(yi=0;yi<8;yi++)
188188         {
189189            for(xi=0;xi<8;xi++)
190190            {
191               UINT8 *gfx_data = screen.machine().root_device().memregion("pcg")->base();
191               UINT8 *gfx_data = machine().root_device().memregion("pcg")->base();
192192               int pen;
193193
194194               pen = ((gfx_data[tile*8+yi]>>(7-xi)) & 1) ? (color+m_pal_mode) : bk_pen;
195195
196196               if(pen != -1)
197                  bitmap.pix16(y*8+CRTC_MIN_Y+yi, x*8+CRTC_MIN_X+xi) = screen.machine().pens[pen];
197                  bitmap.pix16(y*8+CRTC_MIN_Y+yi, x*8+CRTC_MIN_X+xi) = machine().pens[pen];
198198            }
199199         }
200200
r17988r17989
208208            {
209209               case 0x00: cursor_on = 1; break; //always on
210210               case 0x20: cursor_on = 0; break; //always off
211               case 0x40: if(screen.machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
212               case 0x60: if(screen.machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
211               case 0x40: if(machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
212               case 0x60: if(machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
213213            }
214214
215215            if(cursor_on)
r17988r17989
218218               {
219219                  for(xc=0;xc<8;xc++)
220220                  {
221                     bitmap.pix16(y*8+CRTC_MIN_Y-yc+7, x*8+CRTC_MIN_X+xc) = screen.machine().pens[0x7];
221                     bitmap.pix16(y*8+CRTC_MIN_Y-yc+7, x*8+CRTC_MIN_X+xc) = machine().pens[0x7];
222222                  }
223223               }
224224            }
trunk/src/mess/drivers/m20.c
r17988r17989
112112   UINT8 pen;
113113   UINT32 count;
114114
115   bitmap.fill(get_black_pen(screen.machine()), cliprect);
115   bitmap.fill(get_black_pen(machine()), cliprect);
116116
117117   count = (0);
118118
r17988r17989
125125            pen = (m_p_videoram[count]) >> (15 - i) & 1;
126126
127127            if (screen.visible_area().contains(x + i, y))
128               bitmap.pix32(y, x + i) = screen.machine().pens[pen];
128               bitmap.pix32(y, x + i) = machine().pens[pen];
129129         }
130130
131131         count++;
trunk/src/mess/drivers/myb3k.c
r17988r17989
9191                  dot = 0;
9292
9393               if(y*mc6845_tile_height+yi < 200 && x*8+xi < 320) /* TODO: safety check */
94                  bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = screen.machine().pens[dot];
94                  bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[dot];
9595            }
9696         }
9797      }
trunk/src/mess/drivers/ssem.c
r17988r17989
446446UINT32 ssem_state::screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
447447{
448448   UINT32 line = 0;
449   device_t *ssem_cpu = screen.machine().device("maincpu");
449   device_t *ssem_cpu = machine().device("maincpu");
450450   UINT32 accum = ssem_cpu->state().state_int(SSEM_A);
451451   UINT32 bit = 0;
452452   UINT32 word = 0;
r17988r17989
461461      {
462462         if(word & (1 << (31 - bit)))
463463         {
464            glyph_print(screen.machine(), bitmap, bit << 3, line << 3, "%c", line == m_store_line ? 4 : 2);
464            glyph_print(machine(), bitmap, bit << 3, line << 3, "%c", line == m_store_line ? 4 : 2);
465465         }
466466         else
467467         {
468            glyph_print(screen.machine(), bitmap, bit << 3, line << 3, "%c", line == m_store_line ? 3 : 1);
468            glyph_print(machine(), bitmap, bit << 3, line << 3, "%c", line == m_store_line ? 3 : 1);
469469         }
470470      }
471471   }
r17988r17989
474474   {
475475      if(accum & (1 << bit))
476476      {
477         glyph_print(screen.machine(), bitmap, bit << 3, 264, "%c", 2);
477         glyph_print(machine(), bitmap, bit << 3, 264, "%c", 2);
478478      }
479479      else
480480      {
481         glyph_print(screen.machine(), bitmap, bit << 3, 264, "%c", 1);
481         glyph_print(machine(), bitmap, bit << 3, 264, "%c", 1);
482482      }
483483   }
484484
r17988r17989
486486               (m_store[(m_store_line << 2) | 1] << 16) |
487487               (m_store[(m_store_line << 2) | 2] <<  8) |
488488               (m_store[(m_store_line << 2) | 3] <<  0));
489   glyph_print(screen.machine(), bitmap, 0, 272, "LINE:%02d  VALUE:%08x  HALT:%d", m_store_line, word, ssem_cpu->state().state_int(SSEM_HALT));
489   glyph_print(machine(), bitmap, 0, 272, "LINE:%02d  VALUE:%08x  HALT:%d", m_store_line, word, ssem_cpu->state().state_int(SSEM_HALT));
490490   return 0;
491491}
492492
trunk/src/mess/drivers/mz2500.c
r17988r17989
634634
635635UINT32 mz2500_state::screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
636636{
637   bitmap.fill(screen.machine().pens[0], cliprect); //TODO: correct?
637   bitmap.fill(machine().pens[0], cliprect); //TODO: correct?
638638
639   draw_cg_screen(screen.machine(),bitmap,cliprect,0);
640   draw_tv_screen(screen.machine(),bitmap,cliprect);
641   draw_cg_screen(screen.machine(),bitmap,cliprect,1);
639   draw_cg_screen(machine(),bitmap,cliprect,0);
640   draw_tv_screen(machine(),bitmap,cliprect);
641   draw_cg_screen(machine(),bitmap,cliprect,1);
642642   //  popmessage("%02x (%02x %02x) (%02x %02x) (%02x %02x) (%02x %02x)",m_cg_reg[0x0f],m_cg_reg[0x10],m_cg_reg[0x11],m_cg_reg[0x12],m_cg_reg[0x13],m_cg_reg[0x14],m_cg_reg[0x15],m_cg_reg[0x16],m_cg_reg[0x17]);
643643   //  popmessage("%02x",m_text_reg[0x0f]);
644644
trunk/src/mess/drivers/tk80bs.c
r17988r17989
273273      {
274274         int tile = m_p_videoram[count++];
275275
276         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile, 0, 0, 0, x*8, y*8);
276         drawgfx_opaque(bitmap, cliprect, machine().gfx[0], tile, 0, 0, 0, x*8, y*8);
277277      }
278278   }
279279
trunk/src/mess/drivers/einstein.c
r17988r17989
485485
486486   if (&screen == m_color_screen)
487487   {
488      tms9929a_device *tms9929a = screen.machine().device<tms9929a_device>( "tms9929a" );
488      tms9929a_device *tms9929a = machine().device<tms9929a_device>( "tms9929a" );
489489      const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
490490      bitmap_ind16 &src = tms9929a->get_bitmap();
491491      for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
trunk/src/mess/drivers/vboy.c
r17988r17989
488488
489489UINT32 vboy_state::screen_update_vboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
490490{
491   bitmap.fill(screen.machine().pens[m_vip_regs.BKCOL], cliprect);
491   bitmap.fill(machine().pens[m_vip_regs.BKCOL], cliprect);
492492   int cur_spt;
493493
494494   if(!(m_vip_regs.DPCTRL & 2)) /* Don't bother if screen is off */
r17988r17989
514514            yi = ((y & 0x3)*2);
515515            pix = (pen >> yi) & 3;
516516
517            bitmap.pix16(y, x) = screen.machine().pens[pix & 3];
517            bitmap.pix16(y, x) = machine().pens[pix & 3];
518518         }
519519      }
520520   }
r17988r17989
524524
525525UINT32 vboy_state::screen_update_vboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
526526{
527   bitmap.fill(screen.machine().pens[m_vip_regs.BKCOL], cliprect);
527   bitmap.fill(machine().pens[m_vip_regs.BKCOL], cliprect);
528528   int cur_spt;
529529
530530   if(!(m_vip_regs.DPCTRL & 2)) /* Don't bother if screen is off */
trunk/src/mess/drivers/ti99_2.c
r17988r17989
169169   for (i = 0; i < 768; i++)
170170   {
171171      /* Is the char code masked or not ??? */
172      drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], videoram[i] & 0x7F, 0,
172      drawgfx_opaque(bitmap, cliprect, machine().gfx[0], videoram[i] & 0x7F, 0,
173173         0, 0, sx, sy);
174174
175175      sx += 8;
trunk/src/mess/drivers/multi8.c
r17988r17989
148148            else
149149               color = (pen_b) | (pen_r << 1) | (pen_g << 2);
150150
151            multi8_draw_pixel(screen.machine(),bitmap, y, x*8+xi,m_pen_clut[color], 0);
151            multi8_draw_pixel(machine(),bitmap, y, x*8+xi,m_pen_clut[color], 0);
152152         }
153153         count++;
154154      }
r17988r17989
176176                  pen = (m_p_chargen[tile*8+yi] >> (7-xi) & 1) ? color : 0;
177177
178178               if(pen)
179                  multi8_draw_pixel(screen.machine(),bitmap, y*mc6845_tile_height+yi, x*8+xi, pen, (m_display_reg & 0x40) == 0x00);
179                  multi8_draw_pixel(machine(),bitmap, y*mc6845_tile_height+yi, x*8+xi, pen, (m_display_reg & 0x40) == 0x00);
180180            }
181181         }
182182
183         //drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile,color >> 5, 0, 0, x*8, y*8);
183         //drawgfx_opaque(bitmap, cliprect, machine().gfx[0], tile,color >> 5, 0, 0, x*8, y*8);
184184
185185         // draw cursor
186186         if(mc6845_cursor_addr+0xc000 == count)
r17988r17989
192192            {
193193               case 0x00: cursor_on = 1; break; //always on
194194               case 0x20: cursor_on = 0; break; //always off
195               case 0x40: if(screen.machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
196               case 0x60: if(screen.machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
195               case 0x40: if(machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
196               case 0x60: if(machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
197197            }
198198
199199            if(cursor_on)
r17988r17989
201201               for (yc=0; yc<(mc6845_tile_height-(mc6845_cursor_y_start & 7)); yc++)
202202               {
203203                  for (xc=0; xc<8; xc++)
204                     multi8_draw_pixel(screen.machine(),bitmap, y*mc6845_tile_height+yc, x*8+xc,0x07,(m_display_reg & 0x40) == 0x00);
204                     multi8_draw_pixel(machine(),bitmap, y*mc6845_tile_height+yc, x*8+xc,0x07,(m_display_reg & 0x40) == 0x00);
205205
206206               }
207207            }
trunk/src/mess/drivers/bml3.c
r17988r17989
186186            {
187187               case 0x00: cursor_on = 1; break; //always on
188188               case 0x20: cursor_on = 0; break; //always off
189               case 0x40: if(screen.machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
190               case 0x60: if(screen.machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
189               case 0x40: if(machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
190               case 0x60: if(machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
191191            }
192192
193193            if(cursor_on)
trunk/src/mess/drivers/itt3030.c
r17988r17989
5555   return 0x40;
5656}
5757
58UINT32 itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
58UINT32 itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5959{
60   address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
60   address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
6161
6262   for(int y = 0; y < 24; y++ )
6363   {
6464      for(int x = 0; x < 80; x++ )
6565      {
6666         UINT8 code = space.read_byte(0x3000 + x + y*128);
67         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, x*8,y*16);
67         drawgfx_opaque(bitmap, cliprect, machine().gfx[0],  code , 0, 0,0, x*8,y*16);
6868      }
6969   }
7070
trunk/src/mess/drivers/interact.c
r17988r17989
134134{
135135   UINT8 *videoram = m_videoram;
136136   screen.set_visible_area(0, 113, 0, 75);
137   hector_hr( screen.machine(), bitmap, videoram,  77, 32);
137   hector_hr( machine(), bitmap, videoram,  77, 32);
138138   return 0;
139139}
140140
trunk/src/mess/drivers/fp6000.c
r17988r17989
9494            int dot = (m_gvram[count] >> (12-xi*4)) & 0xf;
9595
9696            if(y < 400 && x*4+xi < 640) /* TODO: safety check */
97               bitmap.pix16(y, x*4+xi) = screen.machine().pens[dot];
97               bitmap.pix16(y, x*4+xi) = machine().pens[dot];
9898         }
9999
100100         count++;
r17988r17989
117117
118118               if(pen != -1)
119119                  if(y*mc6845_tile_height < 400 && x*8+xi < 640) /* TODO: safety check */
120                     bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = screen.machine().pens[pen];
120                     bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[pen];
121121            }
122122         }
123123      }
r17988r17989
132132         {
133133            x = mc6845_cursor_addr % mc6845_h_display;
134134            y = mc6845_cursor_addr / mc6845_h_display;
135            bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = screen.machine().pens[7];
135            bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[7];
136136         }
137137      }
138138   }
trunk/src/mess/drivers/pasopia7.c
r17988r17989
309309{
310310   int width;
311311
312   bitmap.fill(screen.machine().pens[0], cliprect);
312   bitmap.fill(machine().pens[0], cliprect);
313313
314314   width = m_x_width ? 80 : 40;
315315
316316   if(m_gfx_mode)
317      draw_mixed_screen(screen.machine(),bitmap,cliprect,width);
317      draw_mixed_screen(machine(),bitmap,cliprect,width);
318318   else
319319   {
320      draw_cg4_screen(screen.machine(),bitmap,cliprect,width);
321      draw_tv_screen(screen.machine(),bitmap,cliprect,width);
320      draw_cg4_screen(machine(),bitmap,cliprect,width);
321      draw_tv_screen(machine(),bitmap,cliprect,width);
322322   }
323323
324324   return 0;
trunk/src/mess/drivers/sm1800.c
r17988r17989
8686
8787UINT32 sm1800_state::screen_update_sm1800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8888{
89   device_t *devconf = screen.machine().device("i8275");
89   device_t *devconf = machine().device("i8275");
9090   i8275_update( devconf, bitmap, cliprect);
9191   copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
9292   return 0;
trunk/src/mess/drivers/pv1000.c
r17988r17989
279279         if ( tile < 0xe0 )
280280         {
281281            tile += ( m_io_regs[7] * 8 );
282            drawgfx_opaque( bitmap, cliprect, screen.machine().gfx[0], tile, 0, 0, 0, x*8, y*8 );
282            drawgfx_opaque( bitmap, cliprect, machine().gfx[0], tile, 0, 0, 0, x*8, y*8 );
283283         }
284284         else
285285         {
286286            tile -= 0xe0;
287            drawgfx_opaque( bitmap, cliprect, screen.machine().gfx[1], tile, 0, 0, 0, x*8, y*8 );
287            drawgfx_opaque( bitmap, cliprect, machine().gfx[1], tile, 0, 0, 0, x*8, y*8 );
288288         }
289289      }
290290   }
trunk/src/mess/drivers/pk8000.c
r17988r17989
331331
332332UINT32 pk8000_state::screen_update_pk8000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
333333{
334   return pk8000_video_update(screen, bitmap, cliprect, screen.machine().device<ram_device>(RAM_TAG)->pointer());
334   return pk8000_video_update(screen, bitmap, cliprect, machine().device<ram_device>(RAM_TAG)->pointer());
335335}
336336
337337/* Machine driver */
trunk/src/mess/drivers/paso1600.c
r17988r17989
9090   UINT32 count;
9191   static int test_x;
9292
93   if(screen.machine().input().code_pressed(KEYCODE_Z))
93   if(machine().input().code_pressed(KEYCODE_Z))
9494      test_x++;
9595
96   if(screen.machine().input().code_pressed(KEYCODE_X))
96   if(machine().input().code_pressed(KEYCODE_X))
9797      test_x--;
9898
9999   popmessage("%d",test_x);
r17988r17989
111111            int pen = (m_p_gvram[count] >> xi) & 1;
112112
113113            if(y < 475 && x*16+xi < 640) /* TODO: safety check */
114               bitmap.pix16(y, x*16+xi) = screen.machine().pens[pen];
114               bitmap.pix16(y, x*16+xi) = machine().pens[pen];
115115         }
116116
117117         count++;
r17988r17989
140140
141141               //if(pen != -1)
142142                  if(y*19 < 475 && x*8+xi < 640) /* TODO: safety check */
143                     bitmap.pix16(y*19+yi, x*8+xi) = screen.machine().pens[pen];
143                     bitmap.pix16(y*19+yi, x*8+xi) = machine().pens[pen];
144144            }
145145         }
146146      }
r17988r17989
156156         {
157157            x = mc6845_cursor_addr % mc6845_h_display;
158158            y = mc6845_cursor_addr / mc6845_h_display;
159            bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = screen.machine().pens[7];
159            bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[7];
160160         }
161161      }
162162   }
trunk/src/mess/drivers/vt100.c
r17988r17989
319319
320320UINT32 vt100_state::screen_update_vt100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
321321{
322   device_t *devconf = screen.machine().device("vt100_video");
322   device_t *devconf = machine().device("vt100_video");
323323   vt_video_update( devconf, bitmap, cliprect);
324324   return 0;
325325}
trunk/src/mess/drivers/pasogo.c
r17988r17989
394394UINT32 pasogo_state::screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
395395{
396396   //static int width=-1,height=-1;
397   UINT8 *rom = screen.machine().root_device().memregion("maincpu")->base()+0xb8000;
397   UINT8 *rom = machine().root_device().memregion("maincpu")->base()+0xb8000;
398398   static const UINT16 c[]={ 3, 0 };
399399   int x,y;
400400//  plot_box(bitmap, 0, 0, 64/*bitmap.width*/, bitmap.height, 0);
trunk/src/mess/drivers/apexc.c
r17988r17989
598598   char the_char;
599599
600600   bitmap.fill(0, /*machine().visible_area*/panel_window);
601   apexc_draw_string(screen.machine(), bitmap, "power", 8, 0, 0);
602   apexc_draw_string(screen.machine(), bitmap, "running", 8, 8, 0);
603   apexc_draw_string(screen.machine(), bitmap, "data :", 0, 24, 0);
601   apexc_draw_string(machine(), bitmap, "power", 8, 0, 0);
602   apexc_draw_string(machine(), bitmap, "running", 8, 8, 0);
603   apexc_draw_string(machine(), bitmap, "data :", 0, 24, 0);
604604
605605   copybitmap(bitmap, *m_bitmap, 0, 0, 0, 0, teletyper_window);
606606
607607
608608   apexc_draw_led(bitmap, 0, 0, 1);
609609
610   apexc_draw_led(bitmap, 0, 8, screen.machine().device("maincpu")->state().state_int(APEXC_STATE));
610   apexc_draw_led(bitmap, 0, 8, machine().device("maincpu")->state().state_int(APEXC_STATE));
611611
612612   for (i=0; i<32; i++)
613613   {
614614      apexc_draw_led(bitmap, i*8, 32, (m_panel_data_reg << i) & 0x80000000UL);
615615      the_char = '0' + ((i + 1) % 10);
616      apexc_draw_char(screen.machine(), bitmap, the_char, i*8, 40, 0);
616      apexc_draw_char(machine(), bitmap, the_char, i*8, 40, 0);
617617      if (((i + 1) % 10) == 0)
618618      {
619619         the_char = '0' + ((i + 1) / 10);
620         apexc_draw_char(screen.machine(), bitmap, the_char, i*8, 48, 0);
620         apexc_draw_char(machine(), bitmap, the_char, i*8, 48, 0);
621621      }
622622   }
623623   return 0;
trunk/src/mess/drivers/pc8801.c
r17988r17989
825825   }
826826}
827827
828UINT32 pc8801_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
828UINT32 pc8801_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
829829{
830   bitmap.fill(screen.machine().pens[0], cliprect);
830   bitmap.fill(machine().pens[0], cliprect);
831831
832832//  popmessage("%04x %04x %02x",m_dma_address[2],m_dma_counter[2],m_dmac_mode);
833833
trunk/src/mess/drivers/jr200.c
r17988r17989
158158               }
159159               else // tile mode
160160               {
161                  gfx_data = screen.machine().root_device().memregion(attr & 0x40 ? "pcg" : "gfx_ram")->base();
161                  gfx_data = machine().root_device().memregion(attr & 0x40 ? "pcg" : "gfx_ram")->base();
162162
163163                  pen = (gfx_data[(tile*8)+yi]>>(7-xi) & 1) ? (attr & 0x7) : ((attr & 0x38) >> 3);
164164               }
165165
166               bitmap.pix16(y*8+yi+16, x*8+xi+16) = screen.machine().pens[pen];
166               bitmap.pix16(y*8+yi+16, x*8+xi+16) = machine().pens[pen];
167167            }
168168         }
169169      }
trunk/src/mess/drivers/supracan.c
r17988r17989
780780         m_sprite_final_bitmap.fill(0x00, visarea);
781781         bitmap.fill(0x80, visarea);
782782
783         draw_sprites(screen.machine(), m_sprite_final_bitmap, visarea);
783         draw_sprites(machine(), m_sprite_final_bitmap, visarea);
784784      }
785785   }
786786   else
r17988r17989
789789      m_sprite_final_bitmap.fill(0x00, cliprect);
790790      bitmap.fill(0x80, cliprect);
791791
792      draw_sprites(screen.machine(), m_sprite_final_bitmap, cliprect);
792      draw_sprites(machine(), m_sprite_final_bitmap, cliprect);
793793   }
794794
795795
r17988r17989
829829         if (priority==pri)
830830         {
831831//            tilemap_num = layer;
832            which_tilemap_size = get_tilemap_dimensions(screen.machine(), xsize, ysize, layer);
832            which_tilemap_size = get_tilemap_dimensions(machine(), xsize, ysize, layer);
833833            bitmap_ind16 &src_bitmap = m_tilemap_sizes[layer][which_tilemap_size]->pixmap();
834            int gfx_region = supracan_tilemap_get_region(screen.machine(), layer);
834            int gfx_region = supracan_tilemap_get_region(machine(), layer);
835835            int transmask = 0xff;
836836
837837            switch (gfx_region)
r17988r17989
953953
954954
955955                        if (m_vram[m_roz_unk_base0/2 + y]) // incxx = 0, no draw?
956                           supracan_suprnova_draw_roz(screen.machine(), bitmap, clip, m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask);
956                           supracan_suprnova_draw_roz(machine(), bitmap, clip, m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask);
957957                     }
958958                  }
959959                  else
960960                  {
961                     supracan_suprnova_draw_roz(screen.machine(), bitmap, cliprect, m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask);
961                     supracan_suprnova_draw_roz(machine(), bitmap, cliprect, m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask);
962962                  }
963963               }
964964            }
trunk/src/mess/drivers/cybiko.c
r17988r17989
301301
302302UINT32 cybiko_state::screen_update_cybiko(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
303303{
304   hd66421_device *hd66421 = screen.machine().device<hd66421_device>( "hd66421" );
304   hd66421_device *hd66421 = machine().device<hd66421_device>( "hd66421" );
305305   hd66421->update_screen(bitmap, cliprect);
306306   return 0;
307307}
trunk/src/mess/drivers/mbc200.c
r17988r17989
170170               dot = (m_vram[count] >> (7-xi)) & 1;
171171
172172               if(y*4+yi < 400 && x*8+xi < 640) /* TODO: safety check */
173                  bitmap.pix16(y*4+yi, x*8+xi) = screen.machine().pens[dot];
173                  bitmap.pix16(y*4+yi, x*8+xi) = machine().pens[dot];
174174            }
175175
176176            count++;
trunk/src/mess/drivers/svision.c
r17988r17989
352352
353353UINT32 svision_state::screen_update_svision(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
354354{
355   svision_state *state = screen.machine().driver_data<svision_state>();
355   svision_state *state = machine().driver_data<svision_state>();
356356   int x, y, i, j=XPOS/4+YPOS*0x30;
357357   UINT8 *videoram = m_videoram;
358358
r17988r17989
384384
385385UINT32 svision_state::screen_update_tvlink(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
386386{
387   svision_state *state = screen.machine().driver_data<svision_state>();
387   svision_state *state = machine().driver_data<svision_state>();
388388   int x, y, i, j = XPOS/4+YPOS*0x30;
389389   UINT8 *videoram = m_videoram;
390390
r17988r17989
409409   }
410410   else
411411   {
412      bitmap.plot_box(3, 0, 162, 159, screen.machine().pens[PALETTE_START]);
412      bitmap.plot_box(3, 0, 162, 159, machine().pens[PALETTE_START]);
413413   }
414414   return 0;
415415}
trunk/src/mess/drivers/ipds.c
r17988r17989
117117
118118UINT32 ipds_state::screen_update_ipds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
119119{
120   device_t *devconf = screen.machine().device("i8275");
120   device_t *devconf = machine().device("i8275");
121121   i8275_update( devconf, bitmap, cliprect);
122122   copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
123123   return 0;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team