Previous 15994 Revisions Next

r815 Saturday 11th August, 2007 at 16:14:23 UTC by Nathan Woods
Updated to 0.118u1 core (apple2 temporarily broken)
[docs]messnew.txt
[src/emu]rendutil.c tilemap.c tilemap.h uigfx.c uimenu.c
[src/emu/cpu/arm7]arm7core.c arm7exec.c
[src/emu/cpu/cop400]410ops.c 420ops.c cop410.c cop410ds.c cop420.c cop420ds.c
[src/emu/cpu/m6800]m6800.c
[src/emu/debug]debugcmd.c debugcpu.c debugcpu.h debugvw.c debugvw.h
[src/mame]mamedriv.c
[src/mame/drivers]1945kiii.c acommand.c ampoker.c bestleag.c bigfghtr.c calorie.c cball.c cherrym.c cherrym2.c cntsteer.c coinmstr.c couple.c cowrace.c cshooter.c cybertnk.c dacholer.c darkhors.c ddayjlc.c deco156.c dreamwld.c drtomy.c dunhuang.c dynadice.c egghunt.c ettrivia.c fcrash.c galaxian.c gdrawpkr.c good.c gstream.c hitme.c hornet.c igs_m027.c itech32.c jackpool.c jalmah.c jollyjgr.c koikoi.c laserbat.c limenko.c lockon.c looping.c ltcasino.c lucky8.c madalien.c magic10.c magicfly.c marinedt.c merit.c mgolf.c midas.c miniboy7.c mogura.c mpu4.c mwarr.c namcoic.c namcos23.c nmg5.c nwk-tr.c olibochu.c onetwo.c panicr.c pipeline.c pkscram.c pmpoker.c powerbal.c ppmast93.c pturn.c rabbit.c raiden2.c rcasino.c rmhaihai.c royalmah.c safarir.c sbowling.c segas18.c segas32.c skyarmy.c skylncr.c statriv2.c supdrapo.c superdq.c suprgolf.c suprnova.c talbot.c tattack.c tecmosys.c trvmadns.c vamphalf.c vmetal.c vroulet.c wallc.c wilytowr.c wink.c witch.c yumefuda.c
[src/mame/machine]konamigx.c msm6242.c
[src/mame/video]1942.c 1943.c 40love.c 4enraya.c 88games.c actfancr.c aeroboto.c aerofgt.c afega.c airbustr.c ajax.c alpha68k.c amspdwy.c angelkds.c appoooh.c aquarium.c argus.c arkanoid.c armedf.c ashnojoe.c asuka.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c atetris.c badlands.c bagman.c bankp.c baraduke.c batman.c battlane.c battlex.c battlnts.c bbusters.c bfm_adr2.c bigstrkb.c bionicc.c bking2.c bladestl.c blktiger.c blmbycar.c blockade.c blockhl.c bloodbro.c blstroid.c blueprnt.c bogeyman.c bombjack.c boogwing.c bosco.c bottom9.c brkthru.c bsktball.c bwing.c cabal.c canyon.c carjmbre.c cave.c cbasebal.c cbuster.c cclimber.c centiped.c chaknpop.c champbas.c chqflag.c circus.c circusc.c citycon.c cloak.c clshroad.c cninja.c combatsc.c commando.c compgolf.c contra.c cop01.c cps1.c crbaloon.c crimfght.c crospang.c crshrace.c cyberbal.c darius.c darkmist.c darkseal.c dassault.c dbz.c dcon.c dday.c ddragon.c ddragon3.c ddrible.c deadang.c dec0.c dec8.c deco16ic.c deco32.c decocass.c deniam.c dietgo.c digdug.c djboy.c dkong.c docastle.c dogfgt.c dooyong.c dragrace.c drgnmst.c drmicro.c dynduke.c eprom.c equites.c esd16.c espial.c exctsccr.c exedexes.c exprraid.c f1gp.c fastfred.c fastlane.c fcombat.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c flyball.c foodf.c freekick.c fromanc2.c fromance.c funkybee.c funkyjet.c funworld.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c gaiden.c galaga.c galaxian.c galivan.c gaplus.c gauntlet.c gberet.c gbusters.c gcpinbal.c ginganin.c gladiatr.c glass.c gng.c goal92.c goindol.c gomoku.c gotcha.c gottlieb.c gotya.c gradius3.c grchamp.c gstriker.c gsword.c gumbo.c gunbustr.c gundealr.c gunsmoke.c hanaawas.c hcastle.c hexa.c hexion.c higemaru.c hng64.c holeland.c homedata.c homerun.c hyperspt.c hyprduel.c inufuku.c iqblock.c ironhors.c jack.c jackal.c jailbrek.c jcross.c kaneko16.c karnov.c kchamp.c kickgoal.c kingobox.c klax.c kncljoe.c konamigx.c konamiic.c kopunch.c ksayakyu.c kyugo.c labyrunr.c ladybug.c ladyfrog.c lasso.c lastduel.c legionna.c lemmings.c liberate.c lkage.c lordgun.c lvcards.c lwings.c m107.c m62.c m72.c m90.c m92.c macrossp.c madmotor.c mainevt.c mainsnk.c mappy.c marineb.c mario.c markham.c marvins.c mayumi.c mcatadv.c mcr.c mcr3.c mcr68.c meadows.c megasys1.c mermaid.c metlclsh.c metro.c mikie.c mitchell.c mjkjidai.c mole.c moo.c mosaic.c mpatrol.c mrdo.c mrjong.c ms32.c msisaac.c mugsmash.c mustache.c mystston.c mystwarr.c namcona1.c namcos1.c namcos2.c namcos22.c namcos86.c nemesis.c news.c ninjakd2.c ninjakid.c ninjaw.c nitedrvr.c nmk16.c nova2001.c nycaptor.c offtwall.c ohmygod.c ojankohs.c omegaf.c oneshot.c orbit.c othldrby.c othunder.c overdriv.c pacland.c pacman.c pandoras.c paradise.c pass.c pbaction.c pcktgal.c pgm.c phoenix.c pingpong.c pirates.c pitnrun.c playch10.c playmark.c plygonet.c pokechmp.c polepos.c poolshrk.c pooyan.c popeye.c popper.c portrait.c powerins.c prehisle.c psikyo.c psychic5.c punchout.c pushman.c quizdna.c quizpani.c raiden.c raiders5.c rallyx.c rastan.c realbrk.c redclash.c relief.c renegade.c retofinv.c rockola.c rockrage.c rocnrope.c rohga.c rollerg.c rpunch.c runaway.c rungun.c sauro.c sbasketb.c sbrkout.c sbugger.c scotrsht.c sderby.c segag80r.c segaic16.c segaic24.c segas16a.c segas16b.c segas18.c segas32.c seibuspi.c seicross.c sengokmj.c senjyo.c seta.c sf.c shadfrce.c shangkid.c shaolins.c shisen.c shootout.c shuuz.c sidearms.c sidepckt.c silkroad.c skullxbo.c skydiver.c skykid.c slapfght.c snk68.c solomon.c sonson.c spdodgeb.c speedatk.c speedbal.c speedspn.c splash.c sprcros2.c sprint2.c sprint4.c sprint8.c spy.c srumbler.c sshangha.c sslam.c ssozumo.c ssrj.c ssv.c stadhero.c starshp1.c stfight.c stlforce.c strnskil.c suna8.c superchs.c superqix.c suprloco.c suprnova.c suprridr.c suprslam.c system16.c tagteam.c tail2nos.c taito_b.c taito_f3.c taito_h.c taito_l.c taito_z.c taitoic.c taitojc.c tank8.c tankbatt.c tankbust.c taotaido.c targeth.c tatsumi.c tbowl.c tceptor.c tecmo.c tecmo16.c tehkanwc.c terracre.c tetrisp2.c thedeep.c thepit.c thoop2.c thunderj.c thunderx.c tiamc1.c tigeroad.c timelimt.c timeplt.c tmnt.c toaplan1.c toaplan2.c toki.c toobin.c topspeed.c toypop.c tp84.c trackfld.c travrusa.c triplhnt.c trucocl.c tryout.c tsamurai.c tumbleb.c tumblep.c tunhunt.c turbo.c twin16.c twincobr.c tx1.c ultraman.c ultratnk.c unico.c usgames.c vaportra.c vastar.c vball.c vendetta.c videopin.c vindictr.c vulgus.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c williams.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c xexex.c xorworld.c xybots.c xyonix.c yard.c ygv608.c yiear.c yunsun16.c yunsung8.c zac2650.c zaccaria.c zaxxon.c zerozone.c zodiack.c
[src/mess]mscommon.c
[src/mess/video]abc80.c abc80x.c apple2.c aquarius.c microtan.c osi.c trs80.c x68k.c
[src/tools]chdcd.c chdman.c

src/mame/machine/msm6242.c
r814r815
3232READ8_HANDLER( msm6242_r )
3333{
3434   mame_system_time curtime, *systime = &curtime;
35   
35
3636   if ( msm6264_reg[0] & 1 ) /* if HOLD is set, use the hold time */
3737   {
3838      systime = &msm6264_hold_time;
r814r815
5656         {
5757            int   hour = systime->local_time.hour;
5858            int   pm = (hour >= 12) ? 1 : 0;
59           
59
6060            if ( pm ) hour -= 12;
6161            if ( hour == 0 ) hour = 12;
62           
62
6363            if ( offset == MSM6264_REG_H1 )
6464               return hour % 10;
65               
65
6666            return (hour / 10) | (pm << 2);
6767         }
68         
68
6969         if ( offset == MSM6264_REG_H1 )
7070            return systime->local_time.hour % 10;
71               
71
7272         return systime->local_time.hour / 10;
7373      }
74     
74
7575      case MSM6264_REG_D1: return systime->local_time.mday % 10;
7676      case MSM6264_REG_D10: return systime->local_time.mday / 10;
7777      case MSM6264_REG_MO1: return (systime->local_time.month+1) % 10;
r814r815
9595      case MSM6264_REG_CD:
9696      {
9797          msm6264_reg[0] = data;
98         
98
9999          if ( data & 1 )   /* was Hold set? */
100100          {
101101             mame_get_current_datetime(Machine, &msm6264_hold_time);
102102          }
103         
103
104104          return;
105105      }
106     
106
107107      case MSM6264_REG_CE: msm6264_reg[1] = data; return;
108     
108
109109      case MSM6264_REG_CF:
110110      {
111111         /* the 12/24 mode bit can only be changed while REST is 1 */
r814r815
121121         return;
122122      }
123123   }
124   
124
125125   logerror("%04x: MSM6242 unmapped offset %02X written with %02X\n",activecpu_get_pc(),offset,data);
126126}
127127
src/mame/machine/konamigx.c
r814r815
15971597                  temp4 = K054338_set_alpha_level(temp2);
15981598
15991599                  if (temp4 <= 0) continue;
1600                  if (temp4 < 255) k = TILEMAP_ALPHA;
1600                  if (temp4 < 255) k = TILEMAP_DRAW_ALPHA;
16011601               }
16021602
16031603               if (mixerflags & 1<<(code+12)) k |= TILE_LINE_DISABLED;
src/mame/mamedriv.c
r814r815
68916891   DRIVER( tontonb )   /* "09" (c) 1987 Dynax */
68926892   DRIVER( hanamai )   /* "16" (c) 1988 Dynax */
68936893   DRIVER( majs101b )   /* "17" (c) [1988] Dynax */
6894   DRIVER( mjapinky )   /* 1988 Dynax */
68946895   DRIVER( hnkochou )   /* "20" (c) 1989 Dynax */
68956896   DRIVER( mjderngr )   /* "22" (c) 1989 Dynax */
68966897   DRIVER( hnoridur )   /* "23" (c) 1989 Dynax */
r814r815
76567657    DRIVER( goldnpkb )   /* (c) 1981 Bonanza */
76577658    DRIVER( goldnpkc )   /* Bootleg */
76587659   DRIVER( jokerpkr )   /* Bootleg in Coinmaster hardware */
7659   DRIVER( pottnpkr )   /* (c) 198? Unknown */
7660   DRIVER( pottnpkr )   /* Bootleg */
7661   DRIVER( pottnpkb )   /* Bootleg */
76607662   DRIVER( gdrawpkr )   /* (c) 1981 Cal Omega / Casino Electronics Inc. */
76617663   DRIVER( altair )   /* (c) 1981 Cidelsa */
76627664   DRIVER( destryer )   /* (c) 1981 Cidelsa */
src/mame/video/sbugger.c
r814r815
1313   tileno = sbugger_videoram[tile_index];
1414   color = sbugger_videoram_attr[tile_index];
1515
16   SET_TILE_INFO(0,tileno,color,0)
16   SET_TILE_INFO(0,tileno,color,0);
1717}
1818
1919WRITE8_HANDLER( sbugger_videoram_w )
r814r815
3030
3131VIDEO_START(sbugger)
3232{
33   sbugger_tilemap = tilemap_create(get_sbugger_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 16,64,16);
33   sbugger_tilemap = tilemap_create(get_sbugger_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 16,64,16);
3434}
3535
3636VIDEO_UPDATE(sbugger)
src/mame/video/targeth.c
r814r815
4343   int data2 = targeth_videoram[(tile_index << 1) + 1];
4444   int code = data & 0x3fff;
4545
46   SET_TILE_INFO(0, code, data2 & 0x1f, TILE_FLIPXY((data2 >> 5) & 0x03))
46   SET_TILE_INFO(0, code, data2 & 0x1f, TILE_FLIPXY((data2 >> 5) & 0x03));
4747}
4848
4949static TILE_GET_INFO( get_tile_info_targeth_screen1 )
r814r815
5252   int data2 = targeth_videoram[(0x2000/2) + (tile_index << 1) + 1];
5353   int code = data & 0x3fff;
5454
55   SET_TILE_INFO(0, code, data2 & 0x1f, TILE_FLIPXY((data2 >> 5) & 0x03))
55   SET_TILE_INFO(0, code, data2 & 0x1f, TILE_FLIPXY((data2 >> 5) & 0x03));
5656}
5757
5858/***************************************************************************
r814r815
7676
7777VIDEO_START( targeth )
7878{
79   pant[0] = tilemap_create(get_tile_info_targeth_screen0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
80   pant[1] = tilemap_create(get_tile_info_targeth_screen1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
79   pant[0] = tilemap_create(get_tile_info_targeth_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
80   pant[1] = tilemap_create(get_tile_info_targeth_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
8181
8282   tilemap_set_transparent_pen(pant[0],0);
8383}
src/mame/video/nycaptor.c
r814r815
4545
4646static TILE_GET_INFO( get_tile_info )
4747{
48   int flags,pal;
49   tileinfo->priority = (videoram[tile_index*2 + 1] & 0x30)>>4;
48   int pal;
49   tileinfo->category = (videoram[tile_index*2 + 1] & 0x30)>>4;
5050   pal=videoram[tile_index*2+1]&0x0f;
51  flags=TILE_SPLIT(0);
52  if((!nycaptor_spot())&&(pal==6))flags=TILE_SPLIT(1);
53   if(((nycaptor_spot()==3)&&(pal==8))||((nycaptor_spot()==1)&&(pal==0xc)))flags=TILE_SPLIT(2);
54   if((nycaptor_spot()==1)&&(tileinfo->priority==2))flags=TILE_SPLIT(3);
51  tileinfo->group=0;
52  if((!nycaptor_spot())&&(pal==6))tileinfo->group=1;
53   if(((nycaptor_spot()==3)&&(pal==8))||((nycaptor_spot()==1)&&(pal==0xc)))tileinfo->group=2;
54   if((nycaptor_spot()==1)&&(tileinfo->category==2))tileinfo->group=3;
5555#ifdef MAME_DEBUG
56  if(nycaptor_mask&(1<<tileinfo->priority))
56  if(nycaptor_mask&(1<<tileinfo->category))
5757  {
5858    if(nycaptor_spot())pal=0xe;else pal=4;
5959  }
r814r815
6262   SET_TILE_INFO(
6363         0,
6464         videoram[tile_index*2] + ((videoram[tile_index*2+1] & 0xc0) << 2) +0x400 * char_bank,
65         pal,flags;
66         )
65         pal,0
66         );
6767}
6868
6969
7070VIDEO_START( nycaptor )
7171{
7272  nycaptor_spriteram = auto_malloc (160);
73  bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,32,32 );
73  bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
7474
7575  tilemap_set_transmask(bg_tilemap,0,0xf800,0x7ff); //split 0
7676  tilemap_set_transmask(bg_tilemap,1,0xfe00,0x01ff);//split 1
r814r815
230230  nycaptor_setmask();
231231  if(nycaptor_mask&0x1000)
232232  {
233        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|3,0);
234        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|3,0);
235        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|2,0);
236        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|2,0);
237        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|1,0);
238        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|1,0);
239        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|0,0);
240        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|0,0);
233        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0);
234        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0);
235        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|2,0);
236        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|2,0);
237        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0);
238        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0);
239        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0);
240        tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0);
241241        draw_sprites(machine, bitmap,cliprect,0);
242242        draw_sprites(machine, bitmap,cliprect,1);
243243        draw_sprites(machine, bitmap,cliprect,2);
r814r815
252252 switch (nycaptor_spot()&3)
253253 {
254254  case 0:
255     tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|3,0);
255     tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0);
256256    draw_sprites(machine, bitmap,cliprect,6);
257    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|3,0);
258    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|2,0);
259     tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|2,0);
260      tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|1,0);
257    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0);
258    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|2,0);
259     tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|2,0);
260      tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0);
261261    draw_sprites(machine, bitmap,cliprect,3);
262    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|1,0);
262    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0);
263263    draw_sprites(machine, bitmap,cliprect,0);
264264    draw_sprites(machine, bitmap,cliprect,2);
265    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|0,0);
265    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0);
266266    draw_sprites(machine, bitmap,cliprect,1);
267    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|0,0);
267    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0);
268268  break;
269269
270270  case 1:
271    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|3,0);
271    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0);
272272    draw_sprites(machine, bitmap,cliprect,3);
273    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|3,0);
273    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0);
274274    draw_sprites(machine, bitmap,cliprect,2);
275    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|2,0);
276    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|1,0);
275    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|2,0);
276    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0);
277277    draw_sprites(machine, bitmap,cliprect,1);
278    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|1,0);
279    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|2,0);
278    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0);
279    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|2,0);
280280    draw_sprites(machine, bitmap,cliprect,0);
281    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|0,0);
282    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|0,0);
281    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0);
282    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0);
283283  break;
284284
285285  case 2:
286      tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|3,0);
287    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|3,0);
288    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|1,0);
286      tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0);
287    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0);
288    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0);
289289    draw_sprites(machine, bitmap,cliprect,1);
290    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|1,0);
291    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|2,0);
292    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|2,0);
290    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0);
291    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|2,0);
292    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|2,0);
293293    draw_sprites(machine, bitmap,cliprect,0);
294    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|0,0);
295    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|0,0);
294    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0);
295    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0);
296296  break;
297297
298298  case 3:
299    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|1,0);
299    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0);
300300    draw_sprites(machine, bitmap,cliprect,1);
301    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|1,0);
301    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0);
302302    draw_sprites(machine, bitmap,cliprect,0);
303    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK|0,0);
304    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT|0,0);
303    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0);
304    tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0);
305305  break;
306306 }
307307   return 0;
src/mame/video/mitchell.c
r814r815
3535         0,
3636         code,
3737         attr & 0x7f,
38         (attr & 0x80) ? TILE_FLIPX : 0)
38         (attr & 0x80) ? TILE_FLIPX : 0);
3939}
4040
4141
r814r815
5252   paletteram=NULL;
5353
5454
55   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
55   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
5656
5757   tilemap_set_transparent_pen(bg_tilemap,15);
5858
src/mame/video/xevious.c
r814r815
196196         0,
197197         xevious_fg_videoram[tile_index] | (flip_screen ? 0x100 : 0),
198198         ((attr & 0x03) << 4) | ((attr & 0x3c) >> 2),
199         TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen ? TILE_FLIPX : 0))
199         TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen ? TILE_FLIPX : 0));
200200}
201201
202202static TILE_GET_INFO( get_bg_tile_info )
r814r815
207207         1,
208208         code + ((attr & 0x01) << 8),
209209         ((attr & 0x3c) >> 2) | ((code & 0x80) >> 3) | ((attr & 0x03) << 5),
210         TILE_FLIPYX((attr & 0xc0) >> 6))
210         TILE_FLIPYX((attr & 0xc0) >> 6));
211211}
212212
213213
r814r815
220220
221221VIDEO_START( xevious )
222222{
223   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,32);
224   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
223   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
224   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
225225
226226   tilemap_set_scrolldx(bg_tilemap,-20,288+27);
227227   tilemap_set_scrolldy(bg_tilemap,-16,-16);
src/mame/video/blktiger.c
r814r815
1919
2020***************************************************************************/
2121
22static UINT32 bg8x4_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
22static TILEMAP_MAPPER( bg8x4_scan )
2323{
2424   /* logical (col,row) -> memory offset */
2525   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x70) << 4) + ((row & 0x30) << 7);
2626}
2727
28static UINT32 bg4x8_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
28static TILEMAP_MAPPER( bg4x8_scan )
2929{
3030   /* logical (col,row) -> memory offset */
3131   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x30) << 4) + ((row & 0x70) << 6);
r814r815
4848         1,
4949         scroll_ram[2*tile_index] + ((attr & 0x07) << 8),
5050         color,
51         TILE_SPLIT(split_table[color]) | ((attr & 0x80) ? TILE_FLIPX : 0))
51         (attr & 0x80) ? TILE_FLIPX : 0);
52   tileinfo->group = split_table[color];
5253}
5354
5455static TILE_GET_INFO( get_tx_tile_info )
r814r815
5859         0,
5960         blktiger_txvideoram[tile_index] + ((attr & 0xe0) << 3),
6061         attr & 0x1f,
61         0)
62         0);
6263}
6364
6465
r814r815
7273{
7374   scroll_ram = auto_malloc(BGRAM_BANK_SIZE * BGRAM_BANKS);
7475
75   tx_tilemap =    tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
76   bg_tilemap8x4 = tilemap_create(get_bg_tile_info,bg8x4_scan,       TILEMAP_TYPE_SPLIT,   16,16,128,64);
77   bg_tilemap4x8 = tilemap_create(get_bg_tile_info,bg4x8_scan,       TILEMAP_TYPE_SPLIT,   16,16,64,128);
76   tx_tilemap =    tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
77   bg_tilemap8x4 = tilemap_create(get_bg_tile_info,bg8x4_scan,       TILEMAP_TYPE_PEN,   16,16,128,64);
78   bg_tilemap4x8 = tilemap_create(get_bg_tile_info,bg4x8_scan,       TILEMAP_TYPE_PEN,   16,16,64,128);
7879
7980   tilemap_set_transparent_pen(tx_tilemap,3);
8081
r814r815
228229   fillbitmap(bitmap,machine->pens[1023],cliprect);
229230
230231   if (bgon)
231      tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_BACK,0);
232      tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_DRAW_LAYER1,0);
232233
233234   if (objon)
234235      draw_sprites(machine, bitmap,cliprect);
235236
236237   if (bgon)
237      tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_FRONT,0);
238      tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_DRAW_LAYER0,0);
238239
239240   if (chon)
240241      tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
src/mame/video/dynduke.c
r814r815
1818   palette_set_color_rgb(Machine,offset/2,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8));
1919
2020   /* This is a kludge to handle 5bpp graphics but 4bpp palette data */
21   /* the 5th bit is actually transparency, so I should use TILEMAP_TYPE_BITMASK */
21   /* the 5th bit is actually transparency, so I should use TILEMAP_TYPE_PEN */
2222   if (offset<1024) {
2323      palette_set_color_rgb(Machine,((offset&0x1f)/2) | (offset&0xffe0) | 2048,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8));
2424      palette_set_color_rgb(Machine,((offset&0x1f)/2) | (offset&0xffe0) | 2048 | 16,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8));
r814r815
5454         1,
5555         tile+back_bankbase,
5656         color+back_palbase,
57         0)
57         0);
5858}
5959
6060static TILE_GET_INFO( get_fg_tile_info )
r814r815
6868         2,
6969         tile+fore_bankbase,
7070         color,
71         0)
71         0);
7272}
7373
7474static TILE_GET_INFO( get_tx_tile_info )
r814r815
8080         0,
8181         tile,
8282         color,
83         0)
83         0);
8484}
8585
8686VIDEO_START( dynduke )
8787{
88   bg_layer = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_SPLIT,      16,16,32,32);
89   fg_layer = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
90   tx_layer = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
88   bg_layer = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,      16,16,32,32);
89   fg_layer = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,32);
90   tx_layer = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
9191
9292   tilemap_set_transmask(bg_layer,0,0x0000ffff,0xffff0000); /* 4bpp + The rest - 1bpp */
9393
r814r815
175175   tilemap_set_enable( fg_layer,fore_enable);
176176
177177   if (back_enable)
178      tilemap_draw(bitmap,cliprect,bg_layer,TILEMAP_BACK,0);
178      tilemap_draw(bitmap,cliprect,bg_layer,TILEMAP_DRAW_LAYER1,0);
179179   else
180180      fillbitmap(bitmap,get_black_pen(machine),cliprect);
181181
182182   draw_sprites(machine,bitmap,cliprect,0); // Untested: does anything use it? Could be behind background
183183   draw_sprites(machine,bitmap,cliprect,1);
184   tilemap_draw(bitmap,cliprect,bg_layer,TILEMAP_FRONT,0);
184   tilemap_draw(bitmap,cliprect,bg_layer,TILEMAP_DRAW_LAYER0,0);
185185   draw_sprites(machine,bitmap,cliprect,2);
186186   tilemap_draw(bitmap,cliprect,fg_layer,0,0);
187187   draw_sprites(machine,bitmap,cliprect,3);
src/mame/video/tunhunt.c
r814r815
6969   int attr = videoram[tile_index];
7070   int code = attr & 0x3f;
7171   int color = attr >> 6;
72   int flags = color ? TILE_IGNORE_TRANSPARENCY : 0;
72   int flags = color ? TILE_FORCE_LAYER0 : 0;
7373
74   SET_TILE_INFO(0, code, color, flags)
74   SET_TILE_INFO(0, code, color, flags);
7575}
7676
7777VIDEO_START( tunhunt )
r814r815
8787   tmpbitmap = auto_bitmap_alloc( 256, 64, machine->screen[0].format );
8888
8989   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
90      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
90      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9191
9292   tilemap_set_transparent_pen(fg_tilemap, 0);
9393   tilemap_set_scrollx(fg_tilemap, 0, 64);
src/mame/video/tryout.c
r814r815
4949
5050   code |= ((attr & 0x03) << 8);
5151
52   SET_TILE_INFO(0, code, 6, 0)
52   SET_TILE_INFO(0, code, 6, 0);
5353}
5454
5555static TILE_GET_INFO( get_bg_tile_info )
5656{
57   SET_TILE_INFO(2, tryout_vram[tile_index] & 0x7f, 0, 0)
57   SET_TILE_INFO(2, tryout_vram[tile_index] & 0x7f, 0, 0);
5858}
5959
6060READ8_HANDLER( tryout_vram_r )
r814r815
154154   flip_screen_set(data & 1);
155155}
156156
157static UINT32 get_fg_memory_offset( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
157static TILEMAP_MAPPER( get_fg_memory_offset )
158158{
159159   return (row ^ 0x1f) + (col << 5);
160160}
161161
162static UINT32 get_bg_memory_offset( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
162static TILEMAP_MAPPER( get_bg_memory_offset )
163163{
164164   int a;
165165//  if (col&0x20)
r814r815
173173
174174VIDEO_START( tryout )
175175{
176   fg_tilemap = tilemap_create(get_fg_tile_info,get_fg_memory_offset,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
177   bg_tilemap = tilemap_create(get_bg_tile_info,get_bg_memory_offset,TILEMAP_TYPE_OPAQUE,16,16,64,16);
176   fg_tilemap = tilemap_create(get_fg_tile_info,get_fg_memory_offset,TILEMAP_TYPE_PEN,8,8,32,32);
177   bg_tilemap = tilemap_create(get_bg_tile_info,get_bg_memory_offset,TILEMAP_TYPE_PEN,16,16,64,16);
178178
179179   tryout_vram=auto_malloc(8 * 0x800);
180180   tryout_vram_gfx=auto_malloc(0x6000);
src/mame/video/rungun.c
r814r815
3232   SET_TILE_INFO(ttl_gfx_index, code, attr, 0);
3333}
3434
35static UINT32 ttl_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
36{
37   /* logical (col,row) -> memory offset */
38   return((row<<6) + col);
39}
40
4135static void rng_sprite_callback(int *code, int *color, int *priority_mask)
4236{
4337   *color = sprite_colorbase | (*color & 0x001f);
r814r815
7064
7165   colour = 0x10 + (rng_936_videoram[tile_index*2] & 0x000f);
7266
73   SET_TILE_INFO(0, tileno, colour, TILE_FLIPYX(flipx))
67   SET_TILE_INFO(0, tileno, colour, TILE_FLIPYX(flipx));
7468}
7569
7670
r814r815
9286   K053936_wraparound_enable(0, 0);
9387   K053936_set_offset(0, 34, 9);
9488
95   rng_936_tilemap = tilemap_create(get_rng_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 128);
89   rng_936_tilemap = tilemap_create(get_rng_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
9690   tilemap_set_transparent_pen(rng_936_tilemap, 0);
9791
9892   /* find first empty slot to decode gfx */
r814r815
118112   }
119113
120114   // create the tilemap
121   ttl_tilemap = tilemap_create(ttl_get_tile_info, ttl_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
115   ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
122116
123117   tilemap_set_transparent_pen(ttl_tilemap, 0);
124118
src/mame/video/madmotor.c
r814r815
2222
2323
2424/* 512 by 512 playfield, 8 by 8 tiles */
25static UINT32 pf1_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
25static TILEMAP_MAPPER( pf1_scan )
2626{
2727   /* logical (col,row) -> memory offset */
2828   return (col & 0x1f) + ((row & 0x1f) << 5) + ((row & 0x20) << 5) + ((col & 0x20) << 6);
r814r815
4040         0,
4141         tile,
4242         color,
43         0)
43         0);
4444}
4545
4646/* 512 by 512 playfield, 16 by 16 tiles */
47static UINT32 pf2_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
47static TILEMAP_MAPPER( pf2_scan )
4848{
4949   /* logical (col,row) -> memory offset */
5050   return (col & 0x0f) + ((row & 0x0f) << 4) + ((row & 0x10) << 4) + ((col & 0x10) << 5);
r814r815
6262         1,
6363         tile,
6464         color,
65         0)
65         0);
6666}
6767
6868/* 512 by 1024 playfield, 16 by 16 tiles */
69static UINT32 pf3_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
69static TILEMAP_MAPPER( pf3_scan )
7070{
7171   /* logical (col,row) -> memory offset */
7272   return (col & 0x0f) + ((row & 0x0f) << 4) + ((row & 0x30) << 4) + ((col & 0x10) << 6);
r814r815
8484         2,
8585         tile,
8686         color,
87         0)
87         0);
8888}
8989
9090/* 2048 by 256 playfield, 16 by 16 tiles */
91static UINT32 pf3a_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
91static TILEMAP_MAPPER( pf3a_scan )
9292{
9393   /* logical (col,row) -> memory offset */
9494   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x70) << 4);
r814r815
106106         2,
107107         tile,
108108         color,
109         0)
109         0);
110110}
111111
112112/******************************************************************************/
113113
114114VIDEO_START( madmotor )
115115{
116   madmotor_pf1_tilemap = tilemap_create(get_pf1_tile_info, pf1_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64,64);
117   madmotor_pf2_tilemap = tilemap_create(get_pf2_tile_info, pf2_scan, TILEMAP_TYPE_TRANSPARENT,16,16, 32,32);
118   madmotor_pf3_tilemap = tilemap_create(get_pf3_tile_info, pf3_scan, TILEMAP_TYPE_OPAQUE,     16,16, 32,64);
119   madmotor_pf3a_tilemap= tilemap_create(get_pf3a_tile_info,pf3a_scan,TILEMAP_TYPE_OPAQUE,     16,16,128,16);
116   madmotor_pf1_tilemap = tilemap_create(get_pf1_tile_info, pf1_scan, TILEMAP_TYPE_PEN, 8, 8, 64,64);
117   madmotor_pf2_tilemap = tilemap_create(get_pf2_tile_info, pf2_scan, TILEMAP_TYPE_PEN,16,16, 32,32);
118   madmotor_pf3_tilemap = tilemap_create(get_pf3_tile_info, pf3_scan, TILEMAP_TYPE_PEN,     16,16, 32,64);
119   madmotor_pf3a_tilemap= tilemap_create(get_pf3a_tile_info,pf3a_scan,TILEMAP_TYPE_PEN,     16,16,128,16);
120120
121121   tilemap_set_transparent_pen(madmotor_pf1_tilemap,0);
122122   tilemap_set_transparent_pen(madmotor_pf2_tilemap,0);
src/mame/video/eprom.c
r814r815
2323   int code = data & 0x3ff;
2424   int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20);
2525   int opaque = data & 0x8000;
26   SET_TILE_INFO(1, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
26   SET_TILE_INFO(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
2727}
2828
2929
r814r815
8484   };
8585
8686   /* initialize the playfield */
87   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
87   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
8888
8989   /* initialize the motion objects */
9090   atarimo_init(machine, 0, &modesc);
9191
9292   /* initialize the alphanumerics */
93   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
93   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
9494   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
9595}
9696
src/mame/video/rocnrope.c
r814r815
9898   int color = attr & 0x0f;
9999   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x20) ? TILE_FLIPY : 0);
100100
101   SET_TILE_INFO(0, code, color, flags)
101   SET_TILE_INFO(0, code, color, flags);
102102}
103103
104104VIDEO_START( rocnrope )
105105{
106106   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
107      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
107      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
108108}
109109
110110static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/aerofgt.c
r814r815
3030         0,
3131         (code & 0x0fff) + (gfxbank[bank] << 12),
3232         ((code & 0xe000) >> 13) + 8 * charpalettebank,
33         0)
33         0);
3434}
3535
3636static TILE_GET_INFO( karatblz_bg1_tile_info )
r814r815
4040         0,
4141         (code & 0x1fff) + (gfxbank[0] << 13),
4242         (code & 0xe000) >> 13,
43         0)
43         0);
4444}
4545
4646/* also spinlbrk */
r814r815
5151         1,
5252         (code & 0x1fff) + (gfxbank[1] << 13),
5353         (code & 0xe000) >> 13,
54         0)
54         0);
5555}
5656
5757static TILE_GET_INFO( spinlbrk_bg1_tile_info )
r814r815
6161         0,
6262         (code & 0x0fff) + (gfxbank[0] << 12),
6363         (code & 0xf000) >> 12,
64         0)
64         0);
6565}
6666
6767static TILE_GET_INFO( get_bg1_tile_info )
r814r815
7272         0,
7373         (code & 0x07ff) + (gfxbank[bank] << 11),
7474         (code & 0xe000) >> 13,
75         0)
75         0);
7676}
7777
7878static TILE_GET_INFO( get_bg2_tile_info )
r814r815
8383         1,
8484         (code & 0x07ff) + (gfxbank[bank] << 11),
8585         (code & 0xe000) >> 13,
86         0)
86         0);
8787}
8888
8989
r814r815
9595
9696VIDEO_START( pspikes )
9797{
98   bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
98   bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
9999   /* no bg2 in this game */
100100
101101   sprite_gfx = 1;
r814r815
104104
105105VIDEO_START( karatblz )
106106{
107   bg1_tilemap = tilemap_create(karatblz_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,64);
108   bg2_tilemap = tilemap_create(karatblz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
107   bg1_tilemap = tilemap_create(karatblz_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,64);
108   bg2_tilemap = tilemap_create(karatblz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
109109
110110   tilemap_set_transparent_pen(bg2_tilemap,15);
111111
r814r815
118118{
119119   int i;
120120
121   bg1_tilemap = tilemap_create(spinlbrk_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,64);
122   bg2_tilemap = tilemap_create(karatblz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
121   bg1_tilemap = tilemap_create(spinlbrk_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,64);
122   bg2_tilemap = tilemap_create(karatblz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
123123
124124   tilemap_set_transparent_pen(bg2_tilemap,15);
125125
r814r815
143143
144144VIDEO_START( turbofrc )
145145{
146   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,64);
147   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
146   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,64);
147   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
148148
149149   tilemap_set_transparent_pen(bg2_tilemap,15);
150150
r814r815
155155
156156VIDEO_START( wbbc97 )
157157{
158   bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
158   bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
159159   /* no bg2 in this game */
160160
161161   tilemap_set_transparent_pen(bg1_tilemap,15);
r814r815
736736   }
737737   else
738738   {
739      tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
739      tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_DRAW_OPAQUE,0);
740740   }
741741
742742   turbofrc_draw_sprites(machine,bitmap,cliprect,0,-1);
src/mame/video/omegaf.c
r814r815
126126         0,
127127         tile,
128128         color,
129         0)
130   tileinfo->priority = 0;
129         0);
130   tileinfo->category = 0;
131131}
132132
133133static TILE_GET_INFO( get_bg1_tile_info )
r814r815
145145         1,
146146         tile,
147147         color,
148         0)
149   tileinfo->priority = 0;
148         0);
149   tileinfo->category = 0;
150150}
151151
152152static TILE_GET_INFO( get_bg2_tile_info )
r814r815
164164         2,
165165         tile,
166166         color,
167         0)
168   tileinfo->priority = 0;
167         0);
168   tileinfo->category = 0;
169169}
170170
171171static TILE_GET_INFO( robokid_get_bg0_tile_info )
r814r815
183183         0,
184184         tile,
185185         color,
186         0)
187   tileinfo->priority = 0;
186         0);
187   tileinfo->category = 0;
188188}
189189
190190static TILE_GET_INFO( robokid_get_bg1_tile_info )
r814r815
202202         1,
203203         tile,
204204         color,
205         0)
206   tileinfo->priority = 0;
205         0);
206   tileinfo->category = 0;
207207}
208208
209209static TILE_GET_INFO( robokid_get_bg2_tile_info )
r814r815
221221         2,
222222         tile,
223223         color,
224         0)
225   tileinfo->priority = 0;
224         0);
225   tileinfo->category = 0;
226226}
227227
228228static TILE_GET_INFO( get_fg_tile_info )
r814r815
238238         5,
239239         tile,
240240         color,
241         0)
242   tileinfo->priority = 0;
241         0);
242   tileinfo->category = 0;
243243}
244244
245245
r814r815
270270   videoram_alloc(machine, 0x2000);
271271
272272   /*                           Info               Offset             Type                 w   h  col  row */
273   fg_tilemap  = tilemap_create(get_fg_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,  8,  32, 32);
274   bg0_tilemap = tilemap_create(get_bg0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 32);
275   bg1_tilemap = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 32);
276   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 32);
273   fg_tilemap  = tilemap_create(get_fg_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,  8,  32, 32);
274   bg0_tilemap = tilemap_create(get_bg0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 32);
275   bg1_tilemap = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 32);
276   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 32);
277277
278278   tilemap_set_transparent_pen( fg_tilemap,  15 );
279279   tilemap_set_transparent_pen( bg0_tilemap, 15 );
r814r815
289289   videoram_alloc(machine, 0x0800);
290290
291291   /*                           Info               Offset             Type                         w   h  col  row */
292   fg_tilemap  = tilemap_create(        get_fg_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,  8,  32, 32);
293   bg0_tilemap = tilemap_create(robokid_get_bg0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      16, 16, 32, 32);
294   bg1_tilemap = tilemap_create(robokid_get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32);
295   bg2_tilemap = tilemap_create(robokid_get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32);
292   fg_tilemap  = tilemap_create(        get_fg_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,  8,  32, 32);
293   bg0_tilemap = tilemap_create(robokid_get_bg0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
294   bg1_tilemap = tilemap_create(robokid_get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
295   bg2_tilemap = tilemap_create(robokid_get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
296296
297297   tilemap_set_transparent_pen( fg_tilemap,  15 );
298298   tilemap_set_transparent_pen( bg1_tilemap, 15 );
src/mame/video/docastle.c
r814r815
183183   int code = videoram[tile_index] + 8 * (colorram[tile_index] & 0x20);
184184   int color = colorram[tile_index] & 0x1f;
185185
186   SET_TILE_INFO(0, code, color, 0)
186   SET_TILE_INFO(0, code, color, 0);
187187}
188188
189189static TILE_GET_INFO( get_fg_tile_info )
r814r815
191191   int code = videoram[tile_index] + 8 * (colorram[tile_index] & 0x20);
192192   int color = (colorram[tile_index] & 0x1f) + 32;
193193
194   SET_TILE_INFO(0, code, color, 0)
194   SET_TILE_INFO(0, code, color, 0);
195195}
196196
197197VIDEO_START( docastle )
198198{
199199   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
200      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
200      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
201201
202202   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
203      TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 32, 32);
203      TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
204204
205205   tilemap_set_transparent_pen(fg_tilemap, 256);
206206}
src/mame/video/mystston.c
r814r815
110110   int code = mystston_videoram2[tile_index] + ((mystston_videoram2[tile_index + 0x200] & 0x01) << 8);
111111   int flags = (tile_index & 0x10) ? TILE_FLIPY : 0;
112112
113   SET_TILE_INFO(1, code, 0, flags)
113   SET_TILE_INFO(1, code, 0, flags);
114114}
115115
116116static TILE_GET_INFO( get_fg_tile_info )
r814r815
118118   int code = videoram[tile_index] + ((videoram[tile_index + 0x400] & 0x07) << 8);
119119   int color = mystston_fgcolor;
120120
121   SET_TILE_INFO(0, code, color, 0)
121   SET_TILE_INFO(0, code, color, 0);
122122}
123123
124124VIDEO_START( mystston )
125125{
126126   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x,
127      TILEMAP_TYPE_OPAQUE, 16, 16, 16, 32);
127      TILEMAP_TYPE_PEN, 16, 16, 16, 32);
128128
129129   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x,
130      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
130      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
131131
132132   tilemap_set_transparent_pen(fg_tilemap, 0);
133133}
src/mame/video/mainsnk.c
r814r815
2424         0,
2525         code,
2626         0x10,
27         0)
27         0);
2828}
2929
3030static void stuff_palette( running_machine *machine, int source_index, int dest_index, int num_colors )
r814r815
8888         0,
8989         code  + ((me_gfx_ctrl<<4)&0x700),
9090         0x10,
91         0)
91         0);
9292}
9393
9494
r814r815
104104   old_bg_color = -1;
105105   stuff_palette( machine, 0, 0, 16*8 );
106106   stuff_palette( machine, 16*8*3, 16*8, 16*8 );
107   me_fg_tilemap = tilemap_create(get_me_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32, 32);
107   me_fg_tilemap = tilemap_create(get_me_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32, 32);
108108   tilemap_set_transparent_pen(me_fg_tilemap,15);
109   me_bg_tilemap = tilemap_create(get_me_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,8,8,32, 32);
109   me_bg_tilemap = tilemap_create(get_me_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32, 32);
110110   tilemap_set_scrollx( me_fg_tilemap, 0, -mainsnk_offset );
111111   tilemap_set_scrollx( me_bg_tilemap, 0, -mainsnk_offset );
112112}
src/mame/video/ygv608.c
r814r815
9292}
9393
9494
95static UINT32 get_tile_offset( UINT32 col, UINT32 row,
96                               UINT32 numcols, UINT32 numrows )
95static TILEMAP_MAPPER( get_tile_offset )
9796{
9897    // this optimisation is not much good to us,
9998    // since we really need row,col in the get_tile_info() routines
r814r815
508507   namcond1_gfxbank = 0;
509508
510509   /* create tilemaps of all sizes and combinations */
511   tilemap_A_cache_8[0] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 8,8, 32,32);
512   tilemap_A_cache_8[1] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
513   tilemap_A_cache_8[2] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 8,8, 32,64);
510   tilemap_A_cache_8[0] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 32,32);
511   tilemap_A_cache_8[1] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
512   tilemap_A_cache_8[2] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 32,64);
514513
515   tilemap_A_cache_16[0] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 16,16, 32,32);
516   tilemap_A_cache_16[1] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32);
517   tilemap_A_cache_16[2] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 16,16, 32,64);
514   tilemap_A_cache_16[0] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 32,32);
515   tilemap_A_cache_16[1] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 64,32);
516   tilemap_A_cache_16[2] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 32,64);
518517
519   tilemap_B_cache_8[0] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 8,8, 32,32);
520   tilemap_B_cache_8[1] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
521   tilemap_B_cache_8[2] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 8,8, 32,64);
518   tilemap_B_cache_8[0] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 32,32);
519   tilemap_B_cache_8[1] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
520   tilemap_B_cache_8[2] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 32,64);
522521
523   tilemap_B_cache_16[0] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 16,16, 32,32);
524   tilemap_B_cache_16[1] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32);
525   tilemap_B_cache_16[2] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_TRANSPARENT, 16,16, 32,64);
522   tilemap_B_cache_16[0] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 32,32);
523   tilemap_B_cache_16[1] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 64,32);
524   tilemap_B_cache_16[2] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 32,64);
526525
527526   tilemap_A = NULL;
528527   tilemap_B = NULL;
src/mame/video/senjyo.c
r814r815
5656   int flags = (attr & 0x80) ? TILE_FLIPY : 0;
5757
5858   if (senjyo && (tile_index & 0x1f) >= 32-8)
59      flags |= TILE_IGNORE_TRANSPARENCY;
59      flags |= TILE_FORCE_LAYER0;
6060
6161   SET_TILE_INFO(
6262         0,
6363         senjyo_fgvideoram[tile_index] + ((attr & 0x10) << 4),
6464         attr & 0x07,
65         flags)
65         flags);
6666}
6767
6868static TILE_GET_INFO( senjyo_bg1_tile_info )
r814r815
7272         1,
7373         code,
7474         (code & 0x70) >> 4,
75         0)
75         0);
7676}
7777
7878static TILE_GET_INFO( starforc_bg1_tile_info )
r814r815
8585         1,
8686         code,
8787         colormap[(code & 0xe0) >> 5],
88         0)
88         0);
8989}
9090
9191static TILE_GET_INFO( get_bg2_tile_info )
r814r815
9595         2,
9696         code,
9797         (code & 0xe0) >> 5,
98         0)
98         0);
9999}
100100
101101static TILE_GET_INFO( get_bg3_tile_info )
r814r815
105105         3,
106106         code,
107107         (code & 0xe0) >> 5,
108         0)
108         0);
109109}
110110
111111
r814r815
118118
119119VIDEO_START( senjyo )
120120{
121   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
121   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
122122
123123   if (senjyo)
124124   {
125      bg1_tilemap = tilemap_create(senjyo_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,16,32);
126      bg2_tilemap = tilemap_create(get_bg2_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,16,48);   /* only 16x32 used by Star Force */
127      bg3_tilemap = tilemap_create(get_bg3_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,16,56);   /* only 16x32 used by Star Force */
125      bg1_tilemap = tilemap_create(senjyo_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,32);
126      bg2_tilemap = tilemap_create(get_bg2_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,48);   /* only 16x32 used by Star Force */
127      bg3_tilemap = tilemap_create(get_bg3_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,56);   /* only 16x32 used by Star Force */
128128   }
129129   else
130130   {
131      bg1_tilemap = tilemap_create(starforc_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,16,32);
132      bg2_tilemap = tilemap_create(get_bg2_tile_info,     tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,16,32);   /* only 16x32 used by Star Force */
133      bg3_tilemap = tilemap_create(get_bg3_tile_info,     tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,16,32);   /* only 16x32 used by Star Force */
131      bg1_tilemap = tilemap_create(starforc_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,32);
132      bg2_tilemap = tilemap_create(get_bg2_tile_info,     tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,32);   /* only 16x32 used by Star Force */
133      bg3_tilemap = tilemap_create(get_bg3_tile_info,     tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,32);   /* only 16x32 used by Star Force */
134134   }
135135
136136   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/yiear.c
r814r815
9999//  int color = (attr & 0xf0) >> 4;
100100   int flags = ((attr & 0x80) ? TILE_FLIPX : 0) | ((attr & 0x40) ? TILE_FLIPY : 0);
101101
102   SET_TILE_INFO(0, code, 0, flags)
102   SET_TILE_INFO(0, code, 0, flags);
103103}
104104
105105VIDEO_START( yiear )
106106{
107107   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
108      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
108      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
109109}
110110
111111static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/sonson.c
r814r815
122122   int code = videoram[tile_index] + 256 * (attr & 0x03);
123123   int color = attr >> 2;
124124
125   SET_TILE_INFO(0, code, color, 0)
125   SET_TILE_INFO(0, code, color, 0);
126126}
127127
128128VIDEO_START( sonson )
129129{
130130   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
131      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
131      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
132132
133133   tilemap_set_scroll_rows(bg_tilemap, 32);
134134}
src/mame/video/sslam.c
r814r815
8282   int code = sslam_tx_tileram[tile_index] & 0x0fff;
8383   int colr = sslam_tx_tileram[tile_index] & 0xf000;
8484
85   SET_TILE_INFO(3,code+0xc000 ,colr >> 12,0)
85   SET_TILE_INFO(3,code+0xc000 ,colr >> 12,0);
8686}
8787
8888WRITE16_HANDLER( sslam_tx_tileram_w )
r814r815
9898   int code = sslam_md_tileram[tile_index] & 0x0fff;
9999   int colr = sslam_md_tileram[tile_index] & 0xf000;
100100
101   SET_TILE_INFO(2,code+0x2000 ,colr >> 12,0)
101   SET_TILE_INFO(2,code+0x2000 ,colr >> 12,0);
102102}
103103
104104WRITE16_HANDLER( sslam_md_tileram_w )
r814r815
114114   int code = sslam_bg_tileram[tile_index] & 0x1fff;
115115   int colr = sslam_bg_tileram[tile_index] & 0xe000;
116116
117   SET_TILE_INFO(1,code ,colr >> 13,0)
117   SET_TILE_INFO(1,code ,colr >> 13,0);
118118}
119119
120120WRITE16_HANDLER( sslam_bg_tileram_w )
r814r815
131131
132132   //(sslam_bg_tileram[tile_index*2] & 0x0f00) == 0xf000 ???
133133
134   SET_TILE_INFO(1,code,colr,0)
134   SET_TILE_INFO(1,code,colr,0);
135135}
136136
137137WRITE16_HANDLER( powerbls_bg_tileram_w )
r814r815
142142
143143VIDEO_START(sslam)
144144{
145   sslam_bg_tilemap = tilemap_create(get_sslam_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,16,16,32,32);
146   sslam_md_tilemap = tilemap_create(get_sslam_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
147   sslam_tx_tilemap = tilemap_create(get_sslam_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
145   sslam_bg_tilemap = tilemap_create(get_sslam_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
146   sslam_md_tilemap = tilemap_create(get_sslam_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
147   sslam_tx_tilemap = tilemap_create(get_sslam_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
148148
149149   tilemap_set_transparent_pen(sslam_md_tilemap,0);
150150   tilemap_set_transparent_pen(sslam_tx_tilemap,0);
r814r815
155155
156156VIDEO_START(powerbls)
157157{
158   sslam_bg_tilemap = tilemap_create(get_powerbls_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,64);
158   sslam_bg_tilemap = tilemap_create(get_powerbls_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
159159
160160   sprites_x_offset = -21;
161161   state_save_register_global(sprites_x_offset);
src/mame/video/hcastle.c
r814r815
4848
4949***************************************************************************/
5050
51static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
51static TILEMAP_MAPPER( tilemap_scan )
5252{
5353   /* logical (col,row) -> memory offset */
5454   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 6);   /* skip 0x400 */
r814r815
7373         0,
7474         tile + bank*0x100 + pf1_bankbase,
7575         ((K007121_ctrlram[0][6]&0x30)*2+16) + color,
76         0)
76         0);
7777}
7878
7979static TILE_GET_INFO( get_bg_tile_info )
r814r815
9595         1,
9696         tile + bank*0x100 + pf2_bankbase,
9797         ((K007121_ctrlram[1][6]&0x30)*2+16) + color,
98         0)
98         0);
9999}
100100
101101
r814r815
108108
109109VIDEO_START( hcastle )
110110{
111   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
112   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan,TILEMAP_TYPE_OPAQUE,     8,8,64,32);
111   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,64,32);
112   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,     8,8,64,32);
113113
114114   tilemap_set_transparent_pen(fg_tilemap,0);
115115}
src/mame/video/deadang.c
r814r815
2929
3030/******************************************************************************/
3131
32static UINT32 bg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
32static TILEMAP_MAPPER( bg_scan )
3333{
3434   return (col&0xf) | ((row&0xf)<<4) | ((col&0x70)<<4) | ((row&0xf0)<<7);
3535}
r814r815
5555   int color=tile >> 12;
5656   tile=tile&0xfff;
5757
58   SET_TILE_INFO(2,tile+deadangle_tilebank*0x1000,color,0)
58   SET_TILE_INFO(2,tile+deadangle_tilebank*0x1000,color,0);
5959}
6060
6161static TILE_GET_INFO( get_text_tile_info )
r814r815
6464   int tile=videoram[offs]+((videoram[offs+1]&0xc0)<<2);
6565   int color=videoram[offs+1]&0xf;
6666
67   SET_TILE_INFO(0,tile,color,0)
67   SET_TILE_INFO(0,tile,color,0);
6868}
6969
7070VIDEO_START( deadang )
7171{
72   pf3_layer = tilemap_create(get_pf3_tile_info,bg_scan,          TILEMAP_TYPE_OPAQUE,     16,16,128,256);
73   pf2_layer = tilemap_create(get_pf2_tile_info,bg_scan,          TILEMAP_TYPE_TRANSPARENT,16,16,128,256);
74   pf1_layer = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16, 32, 32);
75   text_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
72   pf3_layer = tilemap_create(get_pf3_tile_info,bg_scan,          TILEMAP_TYPE_PEN,     16,16,128,256);
73   pf2_layer = tilemap_create(get_pf2_tile_info,bg_scan,          TILEMAP_TYPE_PEN,16,16,128,256);
74   pf1_layer = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16, 32, 32);
75   text_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 32, 32);
7676
7777   tilemap_set_transparent_pen(pf2_layer, 15);
7878   tilemap_set_transparent_pen(pf1_layer, 15);
src/mame/video/twincobr.c
r814r815
6666         2,
6767         tile_number,
6868         color,
69         0)
69         0);
7070}
7171
7272static TILE_GET_INFO( get_fg_tile_info )
r814r815
8080         1,
8181         tile_number,
8282         color,
83         0)
83         0);
8484}
8585
8686static TILE_GET_INFO( get_tx_tile_info )
r814r815
9494         0,
9595         tile_number,
9696         color,
97         0)
97         0);
9898}
9999
100100/***************************************************************************
r814r815
103103
104104static void twincobr_create_tilemaps(void)
105105{
106   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
107   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
108   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
106   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
107   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
108   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
109109
110110   tilemap_set_transparent_pen(fg_tilemap,0);
111111   tilemap_set_transparent_pen(tx_tilemap,0);
r814r815
502502
503503   fillbitmap(bitmap,machine->pens[0],cliprect);
504504
505   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
505   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
506506   draw_sprites(machine, bitmap,cliprect,0x0400);
507507   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
508508   draw_sprites(machine, bitmap,cliprect,0x0800);
src/mame/video/hexion.c
r814r815
2020         0,
2121         ram[tile_index] + ((ram[tile_index+1] & 0x3f) << 8),
2222         ram[tile_index+2] & 0x0f,
23         0)
23         0);
2424}
2525
2626static TILE_GET_INFO( get_tile_info0 )
r814r815
4343
4444VIDEO_START( hexion )
4545{
46   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
47   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,32);
46   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
47   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
4848
4949   tilemap_set_transparent_pen(bg_tilemap[0],0);
5050   tilemap_set_scrollx(bg_tilemap[1],0,-4);
src/mame/video/battlnts.c
r814r815
6060
6161   K007342_tilemap_update();
6262
63   K007342_tilemap_draw( bitmap, cliprect, 0, TILEMAP_IGNORE_TRANSPARENCY ,0);
63   K007342_tilemap_draw( bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE ,0);
6464   K007420_sprites_draw( bitmap, cliprect );
65   K007342_tilemap_draw( bitmap, cliprect, 0, 1 | TILEMAP_IGNORE_TRANSPARENCY ,0);
65   K007342_tilemap_draw( bitmap, cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE ,0);
6666   return 0;
6767}
src/mame/video/labyrunr.c
r814r815
5757         0,
5858         code+bank*256,
5959         ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7),
60         0)
60         0);
6161}
6262
6363static TILE_GET_INFO( get_tile_info1 )
r814r815
8282         0,
8383         code+bank*256,
8484         ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7),
85         0)
85         0);
8686}
8787
8888
r814r815
9494
9595VIDEO_START( labyrunr )
9696{
97   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
98   layer1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
97   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
98   layer1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
9999
100100   tilemap_set_transparent_pen(layer0,0);
101101   tilemap_set_transparent_pen(layer1,0);
r814r815
167167            tilemap_set_scrolly(layer0,(i+2) & 0x1f,K007121_ctrlram[0][0x02]);
168168      }
169169
170      tilemap_draw(bitmap,&finalclip0,layer0,TILEMAP_IGNORE_TRANSPARENCY,0);
170      tilemap_draw(bitmap,&finalclip0,layer0,TILEMAP_DRAW_OPAQUE,0);
171171      K007121_sprites_draw(machine,0,bitmap,cliprect,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
172172      /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */
173      tilemap_draw(bitmap,&finalclip1,layer1,TILEMAP_IGNORE_TRANSPARENCY,0);
173      tilemap_draw(bitmap,&finalclip1,layer1,TILEMAP_DRAW_OPAQUE,0);
174174   }
175175   else
176176   {
src/mame/video/ddragon3.c
r814r815
7070   int code = (attr & 0x0fff) | ((ddragon3_bg_tilebase & 0x01) << 12);
7171   int color = ((attr & 0xf000) >> 12) + 16;
7272
73   SET_TILE_INFO(0, code, color, 0)
73   SET_TILE_INFO(0, code, color, 0);
7474}
7575
7676static TILE_GET_INFO( get_fg_tile_info )
r814r815
9494    state_save_register_global(ddragon3_bg_tilebase);
9595
9696    bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
97      TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32);
97      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
9898
9999   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
100      TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32);
100      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
101101
102102   tilemap_set_transparent_pen(bg_tilemap, 0);
103103   tilemap_set_transparent_pen(fg_tilemap, 0);
r814r815
182182
183183   if ((ddragon3_vreg & 0x60) == 0x40)
184184   {
185      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
185      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
186186      tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
187187      draw_sprites(machine, bitmap, cliprect);
188188   }
189189   else if ((ddragon3_vreg & 0x60) == 0x60)
190190   {
191      tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
191      tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
192192      tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
193193      draw_sprites(machine, bitmap, cliprect);
194194   }
195195   else
196196   {
197      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
197      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
198198      draw_sprites(machine, bitmap, cliprect);
199199      tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
200200   }
r814r815
210210
211211   if(ddragon3_vreg & 8)
212212   {
213      tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
213      tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
214214      draw_sprites(machine, bitmap, cliprect);
215215      tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
216216   }
217217   else
218218   {
219      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
219      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
220220      tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
221221      draw_sprites(machine, bitmap, cliprect);
222222   }
src/mame/video/sprint2.c
r814r815
1919{
2020   UINT8 code = sprint2_video_ram[tile_index];
2121
22   SET_TILE_INFO(0, code & 0x3f, code >> 7, 0)
22   SET_TILE_INFO(0, code & 0x3f, code >> 7, 0);
2323}
2424
2525
r814r815
2727{
2828   helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
2929
30   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16, 8, 32, 32);
30   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 8, 32, 32);
3131}
3232
3333
src/mame/video/dragrace.c
r814r815
1313static tilemap* bg_tilemap;
1414
1515
16static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
17{
18   return num_cols * row + col;
19}
20
21
2216static TILE_GET_INFO( get_tile_info )
2317{
2418   UINT8 code = dragrace_playfield_ram[tile_index];
r814r815
4943      break;
5044   }
5145
52   SET_TILE_INFO(((code & 0xA0) == 0x80) ? 1 : 0, num, col, 0)
46   SET_TILE_INFO(((code & 0xA0) == 0x80) ? 1 : 0, num, col, 0);
5347}
5448
5549
5650VIDEO_START( dragrace )
5751{
5852   bg_tilemap = tilemap_create(
59      get_tile_info, get_memory_offset, TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
53      get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 16, 16);
6054}
6155
6256
src/mame/video/orbit.c
r814r815
2828}
2929
3030
31static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
32{
33   return num_cols * row + col;
34}
35
36
3731static TILE_GET_INFO( get_tile_info )
3832{
3933   UINT8 code = orbit_playfield_ram[tile_index];
r814r815
4943      flags |= TILE_FLIPY;
5044   }
5145
52   SET_TILE_INFO(3, code & 0x3f, 0, flags)
46   SET_TILE_INFO(3, code & 0x3f, 0, flags);
5347}
5448
5549
5650VIDEO_START( orbit )
5751{
58   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, 0, 16, 16, 32, 30);
52   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 0, 16, 16, 32, 30);
5953}
6054
6155
src/mame/video/seibuspi.c
r814r815
425425
426426   tile &= 0xfff;
427427
428   SET_TILE_INFO(0, tile, color, 0)
428   SET_TILE_INFO(0, tile, color, 0);
429429}
430430
431431static TILE_GET_INFO( get_back_tile_info )
r814r815
439439   if( rf2_layer_bank[0] )
440440      tile |= 0x4000;
441441
442   SET_TILE_INFO(1, tile, color, 0)
442   SET_TILE_INFO(1, tile, color, 0);
443443}
444444
445445static TILE_GET_INFO( get_mid_tile_info )
r814r815
454454   if( rf2_layer_bank[1] )
455455      tile |= 0x4000;
456456
457   SET_TILE_INFO(1, tile, color + 16, 0)
457   SET_TILE_INFO(1, tile, color + 16, 0);
458458}
459459
460460static TILE_GET_INFO( get_fore_tile_info )
r814r815
471471
472472   tile |= ((layer_bank >> 27) & 0x1) << 13;
473473
474   SET_TILE_INFO(1, tile, color + 8, 0)
474   SET_TILE_INFO(1, tile, color + 8, 0);
475475}
476476
477477VIDEO_START( spi )
r814r815
479479   int i;
480480   int region_length;
481481
482   text_layer   = tilemap_create( get_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8,64,32 );
483   back_layer   = tilemap_create( get_back_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 16,16,32,32 );
484   mid_layer   = tilemap_create( get_mid_tile_info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 16,16,32,32 );
485   fore_layer   = tilemap_create( get_fore_tile_info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 16,16,32,32 );
482   text_layer   = tilemap_create( get_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8,64,32 );
483   back_layer   = tilemap_create( get_back_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,16,32,32 );
484   mid_layer   = tilemap_create( get_mid_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,16,32,32 );
485   fore_layer   = tilemap_create( get_fore_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,16,32,32 );
486486
487487   tilemap_set_transparent_pen(text_layer, 31);
488488   tilemap_set_transparent_pen(mid_layer, 63);
r814r815
565565   UINT8 *t;
566566   UINT32 xscroll_mask, yscroll_mask;
567567   mame_bitmap *pen_bitmap;
568   mame_bitmap *trans_bitmap;
568   mame_bitmap *flags_bitmap;
569569
570570   pen_bitmap = tilemap_get_pixmap(tile);
571   trans_bitmap = tilemap_get_transparency_bitmap(tile);
571   flags_bitmap = tilemap_get_flagsmap(tile);
572572   xscroll_mask = pen_bitmap->width - 1;
573573   yscroll_mask = pen_bitmap->height - 1;
574574
r814r815
584584
585585      d = BITMAP_ADDR16(bitmap, j, 0);
586586      s = BITMAP_ADDR16(pen_bitmap, (j+y) & yscroll_mask, 0);
587      t = BITMAP_ADDR8(trans_bitmap, (j+y) & yscroll_mask, 0);
587      t = BITMAP_ADDR8(flags_bitmap, (j+y) & yscroll_mask, 0);
588588      for (i=cliprect->min_x+rx; i <= cliprect->max_x+rx; i++)
589589      {
590         if (opaque || (t[i & xscroll_mask] & (TILE_FLAG_FG_OPAQUE | TILE_FLAG_BG_OPAQUE)))
590         if (opaque || (t[i & xscroll_mask] & (TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1)))
591591         {
592592            UINT16 pen = s[i & xscroll_mask];
593593            UINT8 alpha = alpha_table[pen];
src/mame/video/sauro.c
r814r815
5757   int color = (tecfri_colorram[tile_index] >> 4) & 0x0f;
5858   int flags = tecfri_colorram[tile_index] & 0x08 ? TILE_FLIPX : 0;
5959
60   SET_TILE_INFO(0, code, color, flags)
60   SET_TILE_INFO(0, code, color, flags);
6161}
6262
6363static TILE_GET_INFO( get_tile_info_fg )
r814r815
6666   int color = (tecfri_colorram2[tile_index] >> 4) & 0x0f;
6767   int flags = tecfri_colorram2[tile_index] & 0x08 ? TILE_FLIPX : 0;
6868
69   SET_TILE_INFO(1, code, color, flags)
69   SET_TILE_INFO(1, code, color, flags);
7070}
7171
7272/* Sauro */
r814r815
8585VIDEO_START( sauro )
8686{
8787   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols,
88      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
88      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
8989
9090   fg_tilemap = tilemap_create(get_tile_info_fg, tilemap_scan_cols,
91      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
91      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9292
9393   tilemap_set_transparent_pen(fg_tilemap, 0);
9494}
r814r815
157157VIDEO_START( trckydoc )
158158{
159159   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols,
160      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
160      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
161161}
162162
163163static void trckydoc_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/gaplus.c
r814r815
8787***************************************************************************/
8888
8989/* convert from 32x32 to 36x28 */
90static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
90static TILEMAP_MAPPER( tilemap_scan )
9191{
9292   int offs;
9393
r814r815
104104static TILE_GET_INFO( get_tile_info )
105105{
106106   UINT8 attr = gaplus_videoram[tile_index + 0x400];
107   tileinfo->priority = (attr & 0x40) >> 6;
107   tileinfo->category = (attr & 0x40) >> 6;
108108   SET_TILE_INFO(
109109         0,
110110         gaplus_videoram[tile_index] + ((attr & 0x80) << 1),
111111         attr & 0x3f,
112         0)
112         0);
113113}
114114
115115
r814r815
196196
197197VIDEO_START( gaplus )
198198{
199   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,36,28);
199   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,36,28);
200200
201201   tilemap_set_transparent_pen(bg_tilemap, 0xff);
202202
src/mame/video/drmicro.c
r814r815
5151   flags = ((col & 0x20) ? TILEMAP_FLIPY : 0) | ((col & 0x10) ? TILEMAP_FLIPX : 0);
5252   col &= 0x0f;
5353
54   SET_TILE_INFO( 0, code, col, flags)
54   SET_TILE_INFO( 0, code, col, flags);
5555}
5656
5757static TILE_GET_INFO( get_bg2_tile_info )
r814r815
6565   flags = ((col & 0x20) ? TILEMAP_FLIPY : 0) | ((col & 0x10) ? TILEMAP_FLIPX : 0);
6666   col &= 0x0f;
6767
68   SET_TILE_INFO( 1, code, col, flags)
68   SET_TILE_INFO( 1, code, col, flags);
6969}
7070
7171/****************************************************************************/
r814r815
103103{
104104   drmicro_videoram = auto_malloc(0x1000);
105105
106   drmicro_bg1 = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8,8,32,32);
107   drmicro_bg2 = tilemap_create(get_bg2_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8,8,32,32);
106   drmicro_bg1 = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,32,32);
107   drmicro_bg2 = tilemap_create(get_bg2_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,32,32);
108108
109109   tilemap_set_transparent_pen(drmicro_bg2,0);
110110}
src/mame/video/speedatk.c
r814r815
9494   if (region == 1)
9595      color &= 0x1f;
9696
97   SET_TILE_INFO(region, code, color, 0)
97   SET_TILE_INFO(region, code, color, 0);
9898}
9999
100100VIDEO_START( speedatk )
101101{
102   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,34,32);
102   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,34,32);
103103}
104104
105105VIDEO_UPDATE( speedatk )
src/mame/video/powerins.c
r814r815
134134         0,
135135         (code & 0x07ff) + (tile_bank*0x800),
136136         ((code & 0xf000) >> (16-4)) + ((code & 0x0800) >> (11-4)),
137         0)
137         0);
138138}
139139
140140WRITE16_HANDLER( powerins_vram_0_w )
r814r815
143143   tilemap_mark_tile_dirty(tilemap_0, offset);
144144}
145145
146UINT32 powerins_get_memory_offset_0(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
146static TILEMAP_MAPPER( powerins_get_memory_offset_0 )
147147{
148148   return    (col * TILES_PER_PAGE_Y) +
149149
r814r815
174174         1,
175175         code & 0x0fff,
176176         (code & 0xf000) >> (16-4),
177         0)
177         0);
178178}
179179
180180WRITE16_HANDLER( powerins_vram_1_w )
r814r815
199199{
200200   tilemap_0 = tilemap_create(   get_tile_info_0,
201201                        powerins_get_memory_offset_0,
202                        TILEMAP_TYPE_OPAQUE,
202                        TILEMAP_TYPE_PEN,
203203                        16,16,
204204                        DIM_NX_0, DIM_NY_0 );
205205
206206   tilemap_1 = tilemap_create(   get_tile_info_1,
207207                        tilemap_scan_cols,
208                        TILEMAP_TYPE_TRANSPARENT,
208                        TILEMAP_TYPE_PEN,
209209                        8,8,
210210                        DIM_NX_1, DIM_NY_1 );
211211
212212      tilemap_set_scroll_rows(tilemap_0,1);
213213      tilemap_set_scroll_cols(tilemap_0,1);
214      tilemap_set_transparent_pen(tilemap_0,15);
215214
216215      tilemap_set_scroll_rows(tilemap_1,1);
217216      tilemap_set_scroll_cols(tilemap_1,1);
src/mame/video/exedexes.c
r814r815
142142   int color = tilerom[tile_index + (8 * 8)];
143143   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
144144
145   SET_TILE_INFO(1, code, color, flags)
145   SET_TILE_INFO(1, code, color, flags);
146146}
147147
148148static TILE_GET_INFO( get_fg_tile_info )
149149{
150150   int code = memory_region(REGION_GFX5)[tile_index];
151151
152   SET_TILE_INFO(2, code, 0, 0)
152   SET_TILE_INFO(2, code, 0, 0);
153153}
154154
155155static TILE_GET_INFO( get_tx_tile_info )
r814r815
157157   int code = videoram[tile_index] + 2 * (colorram[tile_index] & 0x80);
158158   int color = colorram[tile_index] & 0x3f;
159159
160   SET_TILE_INFO(0, code, color, 0)
160   SET_TILE_INFO(0, code, color, 0);
161161}
162162
163static UINT32 exedexes_bg_tilemap_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
163static TILEMAP_MAPPER( exedexes_bg_tilemap_scan )
164164{
165165   /* logical (col,row) -> memory offset */
166166   return ((col * 32 & 0xe0) >> 5) + ((row * 32 & 0xe0) >> 2) + ((col * 32 & 0x3f00) >> 1) + 0x4000;
167167}
168168
169static UINT32 exedexes_fg_tilemap_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
169static TILEMAP_MAPPER( exedexes_fg_tilemap_scan )
170170{
171171   /* logical (col,row) -> memory offset */
172172   return ((col * 16 & 0xf0) >> 4) + (row * 16 & 0xf0) + (col * 16 & 0x700) + ((row * 16 & 0x700) << 3);
r814r815
175175VIDEO_START( exedexes )
176176{
177177   bg_tilemap = tilemap_create(get_bg_tile_info, exedexes_bg_tilemap_scan,
178      TILEMAP_TYPE_OPAQUE, 32, 32, 64, 64);
178      TILEMAP_TYPE_PEN, 32, 32, 64, 64);
179179
180180   fg_tilemap = tilemap_create(get_fg_tile_info, exedexes_fg_tilemap_scan,
181      TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 128);
181      TILEMAP_TYPE_PEN, 16, 16, 128, 128);
182182
183183   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_rows,
184      TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 32, 32);
184      TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
185185
186186   tilemap_set_transparent_pen(fg_tilemap, 0);
187187   tilemap_set_transparent_pen(tx_tilemap, 207);
src/mame/video/suprnova.c
r814r815
698698         0+depth,
699699         code,
700700         0x40+colr,
701         flags)
702//  tileinfo->priority = pri;
701         flags);
702//  tileinfo->category = pri;
703703}
704704
705705WRITE32_HANDLER ( skns_tilemapA_w )
r814r815
723723         1+depth,
724724         code,
725725         0x40+colr,
726         flags)
727//  tileinfo->priority = pri;
726         flags);
727//  tileinfo->category = pri;
728728}
729729
730730WRITE32_HANDLER ( skns_tilemapB_w )
r814r815
755755
756756VIDEO_START(skns)
757757{
758   skns_tilemap_A = tilemap_create(get_tilemap_A_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64, 64);
758   skns_tilemap_A = tilemap_create(get_tilemap_A_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
759759      tilemap_set_transparent_pen(skns_tilemap_A,0);
760760
761   skns_tilemap_B = tilemap_create(get_tilemap_B_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64, 64);
761   skns_tilemap_B = tilemap_create(get_tilemap_B_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
762762      tilemap_set_transparent_pen(skns_tilemap_B,0);
763763
764764   machine->gfx[2]->color_granularity=256;
r814r815
805805            for(offs=0; offs<(0x1000/4); offs++)
806806               tilemap_set_scrollx( skns_tilemap_A, offs, startx - (skns_v3slc_ram[offs]&0x3ff) );
807807         }
808            tilemap_draw(bitmap,cliprect,skns_tilemap_A,tran ? 0 : TILEMAP_IGNORE_TRANSPARENCY,0);
808            tilemap_draw(bitmap,cliprect,skns_tilemap_A,tran ? 0 : TILEMAP_DRAW_OPAQUE,0);
809809      }
810810      else
811811      {
812812         tilemap_draw_roz(bitmap,cliprect,skns_tilemap_A,startx << 8,starty << 8,
813813               incxx << 8,incxy << 8,incyx << 8,incyy << 8,
814814               1,   /* wraparound */
815                  tran ? 0 : TILEMAP_IGNORE_TRANSPARENCY,0);
815                  tran ? 0 : TILEMAP_DRAW_OPAQUE,0);
816816      }
817817   }
818818}
r814r815
857857            for(offs=0; offs<(0x1000/4); offs++)
858858               tilemap_set_scrollx( skns_tilemap_B, offs, startx - (skns_v3slc_ram[offs+(0x1000/4)]&0x3ff) );
859859         }
860            tilemap_draw(bitmap,cliprect,skns_tilemap_B,tran ? 0 : TILEMAP_IGNORE_TRANSPARENCY,0);
860            tilemap_draw(bitmap,cliprect,skns_tilemap_B,tran ? 0 : TILEMAP_DRAW_OPAQUE,0);
861861      }
862862      else
863863      {
864864         tilemap_draw_roz(bitmap,cliprect,skns_tilemap_B,startx << 8,starty << 8,
865865               incxx << 8,incxy << 8,incyx << 8,incyy << 8,
866866               1,   /* wraparound */
867                  tran ? 0 : TILEMAP_IGNORE_TRANSPARENCY,0);
867                  tran ? 0 : TILEMAP_DRAW_OPAQUE,0);
868868      }
869869   }
870870}
src/mame/video/flkatck.c
r814r815
4848         0,
4949         code + 256*bank,
5050         (attr & 0x0f) + 16,
51         (attr & 0x20) ? TILE_FLIPY : 0)
51         (attr & 0x20) ? TILE_FLIPY : 0);
5252}
5353
5454static TILE_GET_INFO( get_tile_info_B )
r814r815
6060         0,
6161         code,
6262         (attr & 0x0f) + 16,
63         0)
63         0);
6464}
6565
6666
r814r815
7272
7373VIDEO_START( flkatck )
7474{
75   k007121_tilemap[0] = tilemap_create(get_tile_info_A,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
76   k007121_tilemap[1] = tilemap_create(get_tile_info_B,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
75   k007121_tilemap[0] = tilemap_create(get_tile_info_A,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
76   k007121_tilemap[1] = tilemap_create(get_tile_info_B,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
7777
7878   k007121_clip[0] = machine->screen[0].visarea;
7979   k007121_clip[0].min_x += 40;
src/mame/video/shootout.c
r814r815
4848         2,
4949         tile_number,
5050         color,
51         0)
51         0);
5252}
5353
5454static TILE_GET_INFO( get_fg_tile_info ){
r814r815
5959         0,
6060         tile_number,
6161         color,
62         0)
62         0);
6363}
6464
6565WRITE8_HANDLER( shootout_videoram_w ){
r814r815
7272}
7373
7474VIDEO_START( shootout ){
75   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
76   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
75   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
76   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
7777      tilemap_set_transparent_pen( foreground, 0 );
7878}
7979
src/mame/video/contra.c
r814r815
8282         0,
8383         contra_fg_vram[tile_index]+bank*256,
8484         ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7),
85         0)
85         0);
8686}
8787
8888static TILE_GET_INFO( get_bg_tile_info )
r814r815
106106         1,
107107         contra_bg_vram[tile_index]+bank*256,
108108         ((K007121_ctrlram[1][6]&0x30)*2+16)+(attr&7),
109         0)
109         0);
110110}
111111
112112static TILE_GET_INFO( get_tx_tile_info )
r814r815
125125         0,
126126         contra_text_vram[tile_index]+bank*256,
127127         ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7),
128         0)
128         0);
129129}
130130
131131
r814r815
137137
138138VIDEO_START( contra )
139139{
140   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
141   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
142   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
140   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
141   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
142   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
143143
144144   private_spriteram = auto_malloc(0x800);
145145   private_spriteram_2 = auto_malloc(0x800);
src/mame/video/paradise.c
r814r815
155155VIDEO_START( paradise )
156156{
157157   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
158                        TILEMAP_TYPE_TRANSPARENT, 8,8, 0x20,0x20 );
158                        TILEMAP_TYPE_PEN, 8,8, 0x20,0x20 );
159159
160160   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
161                        TILEMAP_TYPE_TRANSPARENT, 8,8, 0x20,0x20 );
161                        TILEMAP_TYPE_PEN, 8,8, 0x20,0x20 );
162162
163163   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
164                        TILEMAP_TYPE_TRANSPARENT, 8,8, 0x20,0x20 );
164                        TILEMAP_TYPE_PEN, 8,8, 0x20,0x20 );
165165
166166   /* pixmap */
167167   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
src/mame/video/chaknpop.c
r814r815
163163      tile += 0xc0;               /* 0xc0-0xff -> 0x180-0x1bf */
164164   tile |= tile_h_bank;
165165
166   SET_TILE_INFO(1, tile, color, 0)
166   SET_TILE_INFO(1, tile, color, 0);
167167}
168168
169169
r814r815
176176   UINT8 *RAM = memory_region(REGION_CPU1);
177177
178178   /*                          info                       offset             type             w   h  col row */
179   tx_tilemap = tilemap_create(chaknpop_get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,  8,  8, 32, 32);
179   tx_tilemap = tilemap_create(chaknpop_get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
180180
181   tilemap_set_transparent_pen(tx_tilemap, 0);
182
183181   vram1 = &RAM[0x10000];
184182   vram2 = &RAM[0x12000];
185183   vram3 = &RAM[0x14000];
src/mame/video/fitfight.c
r814r815
5454   int xflip = (fof_bak_tileram[tile_index*2] & 0x0020)>>5;
5555   xflip ^= 1;
5656
57   SET_TILE_INFO(2,code,colr,TILE_FLIPYX(xflip))
57   SET_TILE_INFO(2,code,colr,TILE_FLIPYX(xflip));
5858}
5959
6060WRITE16_HANDLER(  fof_bak_tileram_w )
r814r815
7171   int xflip = (fof_mid_tileram[tile_index*2] & 0x0020)>>5;
7272   xflip ^= 1;
7373
74   SET_TILE_INFO(1,code,colr,TILE_FLIPYX(xflip))
74   SET_TILE_INFO(1,code,colr,TILE_FLIPYX(xflip));
7575}
7676
7777WRITE16_HANDLER( fof_mid_tileram_w )
r814r815
8888   int xflip = (fof_txt_tileram[tile_index*2] & 0x0020)>>5;
8989   xflip ^= 1;
9090
91   SET_TILE_INFO(0,code,colr,TILE_FLIPYX(xflip))
91   SET_TILE_INFO(0,code,colr,TILE_FLIPYX(xflip));
9292}
9393
9494WRITE16_HANDLER( fof_txt_tileram_w )
r814r815
101101
102102VIDEO_START(fitfight)
103103{
104   fof_bak_tilemap = tilemap_create(get_fof_bak_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,8,8,128, 32);
104   fof_bak_tilemap = tilemap_create(get_fof_bak_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,128, 32);
105105   /* opaque */
106106
107   fof_mid_tilemap = tilemap_create(get_fof_mid_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,128, 32);
107   fof_mid_tilemap = tilemap_create(get_fof_mid_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,128, 32);
108108   tilemap_set_transparent_pen(fof_mid_tilemap,0);
109109
110   fof_txt_tilemap = tilemap_create(get_fof_txt_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,128, 32);
110   fof_txt_tilemap = tilemap_create(get_fof_txt_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,128, 32);
111111   tilemap_set_transparent_pen(fof_txt_tilemap,0);
112112}
113113
src/mame/video/ashnojoe.c
r814r815
2020         2,
2121         code & 0xfff,
2222         ((code >> 12) & 0x0f),
23         0)
23         0);
2424}
2525
2626static TILE_GET_INFO( get_joe_tile_info_2 )
r814r815
3232         4,
3333         (code & 0x7fff),
3434         ((attr >> 8) & 0x1f) + 0x40,
35         0)
35         0);
3636}
3737
3838static TILE_GET_INFO( get_joe_tile_info_3 )
r814r815
4343         0,
4444         code & 0xfff,
4545         ((code >> 12) & 0x0f) + 0x10,
46         0)
46         0);
4747}
4848
4949static TILE_GET_INFO( get_joe_tile_info_4 )
r814r815
5454         1,
5555         code & 0xfff,
5656         ((code >> 12) & 0x0f) + 0x60,
57         0)
57         0);
5858}
5959
6060static TILE_GET_INFO( get_joe_tile_info_5 )
r814r815
6666         4,
6767         (code & 0x7fff),
6868         ((attr >> 8) & 0x1f) + 0x20,
69         0)
69         0);
7070}
7171
7272static TILE_GET_INFO( get_joe_tile_info_6 )
r814r815
7878         3,
7979         (code & 0x1fff),
8080         ((attr >> 8) & 0x1f) + 0x70,
81         0)
81         0);
8282}
8383
8484
r814r815
9191         3,
9292         (code & 0x1fff),
9393         ((attr >> 8) & 0x1f) + 0x70,
94         0)
94         0);
9595}
9696
9797WRITE16_HANDLER( ashnojoe_tileram_w )
r814r815
185185
186186VIDEO_START( ashnojoe )
187187{
188   joetilemap  =  tilemap_create(get_joe_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
189   joetilemap2 =  tilemap_create(get_joe_tile_info_2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
190   joetilemap3 =  tilemap_create(get_joe_tile_info_3,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
191   joetilemap4 =  tilemap_create(get_joe_tile_info_4,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
192   joetilemap5 =  tilemap_create(get_joe_tile_info_5,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
193   joetilemap6 =  tilemap_create(get_joe_tile_info_6,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,      16,16,32,32);
194   joetilemap7 =  tilemap_create(get_joe_tile_info_7,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,      16,16,32,32);
188   joetilemap  =  tilemap_create(get_joe_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
189   joetilemap2 =  tilemap_create(get_joe_tile_info_2,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
190   joetilemap3 =  tilemap_create(get_joe_tile_info_3,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
191   joetilemap4 =  tilemap_create(get_joe_tile_info_4,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
192   joetilemap5 =  tilemap_create(get_joe_tile_info_5,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
193   joetilemap6 =  tilemap_create(get_joe_tile_info_6,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16,32,32);
194   joetilemap7 =  tilemap_create(get_joe_tile_info_7,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16,32,32);
195195
196196   tilemap_set_transparent_pen(joetilemap, 15);
197197   tilemap_set_transparent_pen(joetilemap2,15);
src/mame/video/terracre.c
r814r815
199199
200200VIDEO_START( amazon )
201201{
202   background = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,16,16,64,32);
203   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
202   background = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
203   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
204204      tilemap_set_transparent_pen(foreground,0xf);
205205
206206   /* register for saving */
src/mame/video/deco32.c
r814r815
839839static TILE_GET_INFO( get_pf1_tile_info )
840840{
841841   int tile=deco32_pf1_data[tile_index];
842   SET_TILE_INFO(0,(tile&0xfff)|deco32_pf1_bank,(tile>>12)&0xf,0)
842   SET_TILE_INFO(0,(tile&0xfff)|deco32_pf1_bank,(tile>>12)&0xf,0);
843843}
844844
845845static TILE_GET_INFO( get_pf1a_tile_info )
846846{
847847
848848   int tile=deco32_pf1_data[tile_index];
849   SET_TILE_INFO(1,(tile&0xfff)|deco32_pf1_bank,(tile>>12)&0xf,0)
849   SET_TILE_INFO(1,(tile&0xfff)|deco32_pf1_bank,(tile>>12)&0xf,0);
850850}
851851
852852static TILE_GET_INFO( get_pf2_tile_info )
r814r815
866866      }
867867   }
868868
869   SET_TILE_INFO(1,(tile&0xfff)|deco32_pf2_bank,colour+deco32_pf2_colourbank,flags)
869   SET_TILE_INFO(1,(tile&0xfff)|deco32_pf2_bank,colour+deco32_pf2_colourbank,flags);
870870}
871871
872872static TILE_GET_INFO( get_pf3_tile_info )
r814r815
886886      }
887887   }
888888
889   SET_TILE_INFO(2,(tile&0xfff)|deco32_pf3_bank,colour,flags)
889   SET_TILE_INFO(2,(tile&0xfff)|deco32_pf3_bank,colour,flags);
890890}
891891
892892static TILE_GET_INFO( get_pf4_tile_info )
r814r815
906906      }
907907   }
908908
909   SET_TILE_INFO(2,(tile&0xfff)|deco32_pf4_bank,colour+deco32_pf4_colourbank,flags)
909   SET_TILE_INFO(2,(tile&0xfff)|deco32_pf4_bank,colour+deco32_pf4_colourbank,flags);
910910}
911911
912912/* Captain America tilemap chip 2 has different banking and colour from normal */
913913static TILE_GET_INFO( get_ca_pf3_tile_info )
914914{
915915   int tile=deco32_pf3_data[tile_index];
916   SET_TILE_INFO(2,(tile&0x3fff)+deco32_pf3_bank,(tile >> 14)&3,0)
916   SET_TILE_INFO(2,(tile&0x3fff)+deco32_pf3_bank,(tile >> 14)&3,0);
917917}
918918
919919static TILE_GET_INFO( get_ll_pf3_tile_info )
r814r815
928928         flags|=TILE_FLIPY;
929929   }
930930
931   SET_TILE_INFO(2,(tile&0x0fff)|deco32_pf3_bank,(tile >> 12)&3,flags)
931   SET_TILE_INFO(2,(tile&0x0fff)|deco32_pf3_bank,(tile >> 12)&3,flags);
932932}
933933
934934static TILE_GET_INFO( get_ll_pf4_tile_info )
r814r815
943943         flags|=TILE_FLIPY;
944944   }
945945
946   SET_TILE_INFO(2,(tile&0x0fff)|deco32_pf4_bank,(tile >> 12)&3,flags)
946   SET_TILE_INFO(2,(tile&0x0fff)|deco32_pf4_bank,(tile >> 12)&3,flags);
947947}
948948
949949VIDEO_START( captaven )
950950{
951   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
952   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
953   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
954   pf3_tilemap = tilemap_create(get_ca_pf3_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
951   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
952   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
953   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
954   pf3_tilemap = tilemap_create(get_ca_pf3_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
955955   deco32_raster_display_list=auto_malloc(10 * 256);
956956   memset(deco32_raster_display_list, 0, 10 * 256);
957957
r814r815
967967
968968VIDEO_START( fghthist )
969969{
970   pf1_tilemap = tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
971   pf2_tilemap = tilemap_create(get_pf2_tile_info, deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
972   pf3_tilemap = tilemap_create(get_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
973   pf4_tilemap = tilemap_create(get_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
970   pf1_tilemap = tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
971   pf2_tilemap = tilemap_create(get_pf2_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
972   pf3_tilemap = tilemap_create(get_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
973   pf4_tilemap = tilemap_create(get_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
974974   pf1a_tilemap =0;
975975   dirty_palette = auto_malloc(4096);
976976
r814r815
979979   tilemap_set_transparent_pen(pf1_tilemap,0);
980980   tilemap_set_transparent_pen(pf2_tilemap,0);
981981   tilemap_set_transparent_pen(pf3_tilemap,0);
982   tilemap_set_transparent_pen(pf4_tilemap,0);
983982
984983   deco32_raster_display_list=0;
985984   deco32_pf2_colourbank=deco32_pf4_colourbank=0;
r814r815
988987
989988VIDEO_START( dragngun )
990989{
991   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
992   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
993   pf3_tilemap = tilemap_create(get_ll_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
994   pf4_tilemap = tilemap_create(get_ll_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
995   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
990   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
991   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
992   pf3_tilemap = tilemap_create(get_ll_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
993   pf4_tilemap = tilemap_create(get_ll_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
994   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
996995   dirty_palette = auto_malloc(4096);
997996   deco32_raster_display_list = auto_malloc(10 * 256);
998997
r814r815
10111010
10121011VIDEO_START( lockload )
10131012{
1014   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
1015   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
1016   pf3_tilemap = tilemap_create(get_ll_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
1017   pf4_tilemap = tilemap_create(get_ll_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
1018   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
1013   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
1014   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
1015   pf3_tilemap = tilemap_create(get_ll_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
1016   pf4_tilemap = tilemap_create(get_ll_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
1017   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
10191018   dirty_palette = auto_malloc(4096);
10201019   deco32_raster_display_list = auto_malloc(10 * 256);
10211020   memset(deco32_raster_display_list, 0, 10 * 256);
r814r815
10351034
10361035VIDEO_START( nslasher )
10371036{
1038   pf1_tilemap = tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
1039   pf2_tilemap = tilemap_create(get_pf2_tile_info, deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
1040   pf3_tilemap = tilemap_create(get_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
1041   pf4_tilemap = tilemap_create(get_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
1037   pf1_tilemap = tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
1038   pf2_tilemap = tilemap_create(get_pf2_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
1039   pf3_tilemap = tilemap_create(get_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
1040   pf4_tilemap = tilemap_create(get_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
10421041   pf1a_tilemap =0;
10431042   dirty_palette = auto_malloc(4096);
10441043
r814r815
12411240   fillbitmap(priority_bitmap,0,cliprect);
12421241   if ((deco32_pri&1)==0) {
12431242      if (pf3_enable)
1244         tilemap_draw(bitmap,cliprect,pf3_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
1243         tilemap_draw(bitmap,cliprect,pf3_tilemap,TILEMAP_DRAW_OPAQUE,0);
12451244      else
12461245         fillbitmap(bitmap,get_black_pen(machine),cliprect);
12471246
r814r815
12521251   } else {
12531252      if (pf2_enable) {
12541253         if (deco32_raster_display_position)
1255            tilemap_raster_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
1254            tilemap_raster_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
12561255         else
12571256            tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0);
12581257      }
src/mame/video/argus.c
r814r815
176176         3,
177177         ((hi & 0xc0) << 2) | lo,
178178         hi & 0x0f,
179         TILE_FLIPYX((hi & 0x30) >> 4))
179         TILE_FLIPYX((hi & 0x30) >> 4));
180180}
181181
182182static TILE_GET_INFO( argus_get_bg0_tile_info )
r814r815
190190         1,
191191         ((hi & 0xc0) << 2) | lo,
192192         hi & 0x0f,
193         TILE_FLIPYX((hi & 0x30) >> 4))
193         TILE_FLIPYX((hi & 0x30) >> 4));
194194}
195195
196196static TILE_GET_INFO( argus_get_bg1_tile_info )
r814r815
204204         2,
205205         lo,
206206         hi & 0x0f,
207         TILE_FLIPYX((hi & 0x30) >> 4))
207         TILE_FLIPYX((hi & 0x30) >> 4));
208208}
209209
210210static TILE_GET_INFO( valtric_get_tx_tile_info )
r814r815
218218         2,
219219         ((hi & 0xc0) << 2) | lo,
220220         hi & 0x0f,
221         TILE_FLIPYX((hi & 0x30) >> 4))
221         TILE_FLIPYX((hi & 0x30) >> 4));
222222}
223223
224224static TILE_GET_INFO( valtric_get_bg_tile_info )
r814r815
235235         1,
236236         tile,
237237         color,
238         0)
238         0);
239239}
240240
241241static TILE_GET_INFO( butasan_get_tx_tile_info )
r814r815
251251         3,
252252         ((hi & 0xc0) << 2) | lo,
253253         hi & 0x0f,
254         TILE_FLIPYX((hi & 0x30) >> 4))
254         TILE_FLIPYX((hi & 0x30) >> 4));
255255}
256256
257257static TILE_GET_INFO( butasan_get_bg0_tile_info )
r814r815
270270         1,
271271         ((hi & 0xc0) << 2) | lo,
272272         hi & 0x0f,
273         TILE_FLIPYX((hi & 0x30) >> 4))
273         TILE_FLIPYX((hi & 0x30) >> 4));
274274}
275275
276276
r814r815
294294         2,
295295         tile,
296296         color,
297         0)
297         0);
298298}
299299
300300
r814r815
306306{
307307   lowbitscroll = 0;
308308   /*                           info                      offset             type                  w   h  col  row */
309   bg0_tilemap = tilemap_create(argus_get_bg0_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_OPAQUE,      16, 16, 32, 32);
310   bg1_tilemap = tilemap_create(argus_get_bg1_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32);
311   tx_tilemap  = tilemap_create(argus_get_tx_tile_info,   tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT,  8,  8, 32, 32);
309   bg0_tilemap = tilemap_create(argus_get_bg0_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
310   bg1_tilemap = tilemap_create(argus_get_bg1_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
311   tx_tilemap  = tilemap_create(argus_get_tx_tile_info,   tilemap_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
312312
313313   /* dummy RAM for back ground */
314314   argus_dummy_bg0ram = auto_malloc( 0x800 );
r814r815
327327VIDEO_START( valtric )
328328{
329329   /*                           info                       offset             type                 w   h  col  row */
330   bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_OPAQUE,      16, 16, 32, 32);
331   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT,  8,  8, 32, 32);
330   bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
331   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
332332
333333   tilemap_set_transparent_pen( bg1_tilemap, 15 );
334334   tilemap_set_transparent_pen( tx_tilemap,  15 );
r814r815
340340VIDEO_START( butasan )
341341{
342342   /*                           info                       offset             type                 w   h  col  row */
343   bg0_tilemap = tilemap_create(butasan_get_bg0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      16, 16, 32, 32);
344   bg1_tilemap = tilemap_create(butasan_get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      16, 16, 32, 32);
345   tx_tilemap  = tilemap_create(butasan_get_tx_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT,  8,  8, 32, 32);
343   bg0_tilemap = tilemap_create(butasan_get_bg0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
344   bg1_tilemap = tilemap_create(butasan_get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
345   tx_tilemap  = tilemap_create(butasan_get_tx_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
346346
347347   butasan_txram = auto_malloc( BUTASAN_TEXT_RAMSIZE );
348348   butasan_bg0ram = auto_malloc( BUTASAN_BG0_RAMSIZE );
r814r815
372372         2,
373373         ((hi & 0xc0) << 2) | lo,
374374         hi & 0x0f,
375         TILE_FLIPYX((hi & 0x30) >> 4))
375         TILE_FLIPYX((hi & 0x30) >> 4));
376376}
377377#endif
378378
r814r815
388388         1,
389389         tileno,
390390         col,
391         0)
391         0);
392392}
393393
394394
395395VIDEO_START( bombsa )
396396{
397397   /*                           info                       offset             type                 w   h  col  row */
398//  bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_OPAQUE,      16, 16, 32, 32);
399   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT,  8,  8, 32, 32);
398//  bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
399   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
400400
401401#if 0
402402   /* this might be wrong.. but it looks like there may be a tilemap here that can change between 8x8 and 16x16 mode.. */
403403   /* when you start the game it gets 'corrupted' with data for another layer.. */
404   tx_alt_tilemap  = tilemap_create(bombsa_get_tx_alt_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT,  8,  8, 32, 32);
404   tx_alt_tilemap  = tilemap_create(bombsa_get_tx_alt_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
405405#endif
406406
407   bombsa_bg_tilemap  = tilemap_create(bombsa_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT,  16,  16, 64, 32);
407   bombsa_bg_tilemap  = tilemap_create(bombsa_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,  16,  16, 64, 32);
408408
409409#if 0
410410   bombsa_tx_alt_ram = auto_malloc(0x800);
src/mame/video/grchamp.c
r814r815
9898   SET_TILE_INFO(3, state->centerram[tile_index], 0, 0);
9999}
100100
101static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
101static TILEMAP_MAPPER( get_memory_offset )
102102{
103103   return (col % 32) + row * 32 + (col / 32) * 32*32;
104104}
r814r815
111111   state->work_bitmap = auto_bitmap_alloc(32,32,machine->screen[0].format);
112112
113113   /* allocate tilemaps for each of the three sections */
114   state->text_tilemap = tilemap_create(get_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
115   state->left_tilemap = tilemap_create(get_left_tile_info, get_memory_offset, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
116   state->right_tilemap = tilemap_create(get_right_tile_info, get_memory_offset, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
117   state->center_tilemap = tilemap_create(get_center_tile_info, get_memory_offset, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
114   state->text_tilemap = tilemap_create(get_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
115   state->left_tilemap = tilemap_create(get_left_tile_info, get_memory_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
116   state->right_tilemap = tilemap_create(get_right_tile_info, get_memory_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
117   state->center_tilemap = tilemap_create(get_center_tile_info, get_memory_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
118118}
119119
120120#if 0
src/mame/video/lkage.c
r814r815
6262static TILE_GET_INFO( get_bg_tile_info )
6363{
6464   int code = videoram[tile_index + 0x800] + 256 * (bg_tile_bank?5:1);
65   SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/ )
65   SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/ );
6666}
6767
6868static TILE_GET_INFO( get_fg_tile_info )
6969{
7070   int code = videoram[tile_index + 0x400] + 256 * (fg_tile_bank?1:0);
71   SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/)
71   SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/);
7272}
7373
7474static TILE_GET_INFO( get_tx_tile_info )
7575{
7676   int code = videoram[tile_index];
77   SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/)
77   SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/);
7878}
7979
8080VIDEO_START( lkage )
8181{
8282   bg_tile_bank = fg_tile_bank = 0;
8383
84   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
85   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
86   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
84   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
85   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
86   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
8787
8888   tilemap_set_transparent_pen(fg_tilemap,0);
8989   tilemap_set_transparent_pen(tx_tilemap,0);
r814r815
203203   }
204204   else
205205   {
206      tilemap_draw( bitmap,cliprect,tx_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
206      tilemap_draw( bitmap,cliprect,tx_tilemap,TILEMAP_DRAW_OPAQUE,0);
207207   }
208208   draw_sprites(machine, bitmap,cliprect );
209209   return 0;
src/mame/video/ninjakid.c
r814r815
2020         0,
2121         tile_number,
2222         (attr&0xf),
23         0)
23         0);
2424}
2525
2626static TILE_GET_INFO( get_bg_tile_info ){
r814r815
3131         1,
3232         tile_number,
3333         (attr&0xf),
34         0)
34         0);
3535}
3636
3737WRITE8_HANDLER( ninjakid_fg_videoram_w ){
r814r815
197197*******************************************************************************/
198198
199199VIDEO_START( ninjakid ){
200    fg_tilemap = tilemap_create( get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32 );
201   bg_tilemap = tilemap_create( get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
200    fg_tilemap = tilemap_create( get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
201   bg_tilemap = tilemap_create( get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
202202   tilemap_set_transparent_pen( fg_tilemap,0 );
203203
204204   /* Save State Support */
src/mame/video/gaiden.c
r814r815
2727         1,
2828         videoram1[tile_index] & 0x0fff,
2929         (videoram2[tile_index] & 0xf0) >> 4,
30         0)
30         0);
3131}
3232
3333static TILE_GET_INFO( get_fg_tile_info )
r814r815
3838         2,
3939         videoram1[tile_index] & 0x0fff,
4040         (videoram2[tile_index] & 0xf0) >> 4,
41         0)
41         0);
4242}
4343
4444static TILE_GET_INFO( get_fg_tile_info_raiga )
r814r815
4747   UINT16 *videoram2 = gaiden_videoram2;
4848
4949   /* bit 3 controls blending */
50   tileinfo->priority = (videoram2[tile_index] & 0x08) >> 3;
50   tileinfo->category = (videoram2[tile_index] & 0x08) >> 3;
5151
5252   SET_TILE_INFO(
5353         2,
5454         videoram1[tile_index] & 0x0fff,
55         ((videoram2[tile_index] & 0xf0) >> 4) | (tileinfo->priority ? 0x80 : 0x00),
56         0)
55         ((videoram2[tile_index] & 0xf0) >> 4) | (tileinfo->category ? 0x80 : 0x00),
56         0);
5757}
5858
5959static TILE_GET_INFO( get_tx_tile_info )
r814r815
6464         0,
6565         videoram1[tile_index] & 0x07ff,
6666         (videoram2[tile_index] & 0xf0) >> 4,
67         0)
67         0);
6868}
6969
7070
r814r815
7777VIDEO_START( gaiden )
7878{
7979   /* set up tile layers */
80   background = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 64, 32);
81   foreground = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 64, 32);
82   text_layer = tilemap_create(get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT,  8,  8, 32, 32);
80   background = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 64, 32);
81   foreground = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 64, 32);
82   text_layer = tilemap_create(get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
8383
8484   tilemap_set_transparent_pen(background, 0);
8585   tilemap_set_transparent_pen(foreground, 0);
r814r815
9292   tile_bitmap_bg = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
9393   tile_bitmap_fg = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
9494
95   background = tilemap_create(get_bg_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
96   foreground = tilemap_create(get_fg_tile_info_raiga,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
97   text_layer = tilemap_create(get_tx_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
95   background = tilemap_create(get_bg_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
96   foreground = tilemap_create(get_fg_tile_info_raiga,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
97   text_layer = tilemap_create(get_tx_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
9898
9999   tilemap_set_transparent_pen(background,0);
100100   tilemap_set_transparent_pen(foreground,0);
r814r815
107107VIDEO_START( drgnbowl )
108108{
109109   /* set up tile layers */
110   background = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      16, 16, 64, 32);
111   foreground = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 64, 32);
112   text_layer = tilemap_create(get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT,  8,  8, 32, 32);
110   background = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 64, 32);
111   foreground = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 64, 32);
112   text_layer = tilemap_create(get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
113113
114114   tilemap_set_transparent_pen(foreground, 15);
115115   tilemap_set_transparent_pen(text_layer, 15);
src/mame/video/zaxxon.c
r814r815
9797   int sy = tile_index / 32;
9898   int code = videoram[tile_index];
9999   int color = color_codes[sx + 32 * (sy / 4)] & 0x0f;
100   SET_TILE_INFO(0, code, color * 2, 0)
100   SET_TILE_INFO(0, code, color * 2, 0);
101101}
102102
103103
r814r815
105105{
106106   int code = videoram[tile_index];
107107   int color = color_codes[code] & 0x0f;
108   SET_TILE_INFO(0, code, color * 2, 0)
108   SET_TILE_INFO(0, code, color * 2, 0);
109109}
110110
111111
r814r815
113113{
114114   int code = videoram[tile_index] + (congo_fg_bank << 8);
115115   int color = colorram[tile_index] & 0x1f;
116   SET_TILE_INFO(0, code, color * 2, 0)
116   SET_TILE_INFO(0, code, color * 2, 0);
117117}
118118
119119
r814r815
124124 *
125125 *************************************/
126126
127static void video_start_common(running_machine *machine, tile_get_info_fn fg_tile_info)
127static void video_start_common(running_machine *machine, tile_get_info_callback fg_tile_info)
128128{
129129   /* reset globals */
130130   bg_enable = 0;
r814r815
136136   memset(congo_custom, 0, sizeof(congo_custom));
137137
138138   /* create a background and foreground tilemap */
139   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,512);
140   fg_tilemap = tilemap_create(fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 32,32);
139   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,512);
140   fg_tilemap = tilemap_create(fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
141141
142142   /* configure the foreground tilemap */
143143   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/shangkid.c
r814r815
2727            0,
2828            tile_number,
2929            color,
30            (attributes&0x04)?TILE_FLIPX:0)
30            (attributes&0x04)?TILE_FLIPX:0);
3131   }
3232   else
3333   {
r814r815
4141            0,
4242            tile_number,
4343            color,
44            (attributes&0x80)?TILE_FLIPX:0)
44            (attributes&0x80)?TILE_FLIPX:0);
4545   }
4646
47   tileinfo->priority =
47   tileinfo->category =
4848      (memory_region( REGION_PROMS )[0x800+color*4]==2)?1:0;
4949}
5050
5151VIDEO_START( shangkid )
5252{
53   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
53   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
5454}
5555
5656WRITE8_HANDLER( shangkid_videoram_w )
src/mame/video/trackfld.c
r814r815
161161   if( bg_bank )
162162      code |= 0x400;
163163
164   SET_TILE_INFO(0, code, color, flags)
164   SET_TILE_INFO(0, code, color, flags);
165165}
166166
167167VIDEO_START( trackfld )
168168{
169169   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
170      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
170      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
171171
172172   tilemap_set_scroll_rows(bg_tilemap, 32);
173173}
src/mame/video/fastfred.c
r814r815
115115   UINT16 code = charbank | fastfred_videoram[tile_index];
116116   UINT8 color = colorbank | (fastfred_attributesram[2 * x + 1] & 0x07);
117117
118   SET_TILE_INFO(0, code, color, 0)
118   SET_TILE_INFO(0, code, color, 0);
119119}
120120
121121
r814r815
128128
129129VIDEO_START( fastfred )
130130{
131   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
131   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
132132
133133   tilemap_set_scroll_cols(bg_tilemap, 32);
134134}
r814r815
345345   UINT16 code = charbank * 0x100 + fastfred_videoram[tile_index];
346346   UINT8 color = colorbank | (fastfred_attributesram[2 * x + 1] & 0x07);
347347
348   SET_TILE_INFO(0, code, color, 0)
348   SET_TILE_INFO(0, code, color, 0);
349349}
350350
351351static TILE_GET_INFO( imago_get_tile_info_fg )
352352{
353353   int code = imago_fg_videoram[tile_index];
354   SET_TILE_INFO(2, code, 2, 0)
354   SET_TILE_INFO(2, code, 2, 0);
355355}
356356
357357static TILE_GET_INFO( imago_get_tile_info_web )
358358{
359   SET_TILE_INFO(3, tile_index & 0x1ff, 0, 0)
359   SET_TILE_INFO(3, tile_index & 0x1ff, 0, 0);
360360}
361361
362362WRITE8_HANDLER( imago_fg_videoram_w )
r814r815
376376
377377VIDEO_START( imago )
378378{
379   web_tilemap = tilemap_create(imago_get_tile_info_web,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
380   bg_tilemap   = tilemap_create(imago_get_tile_info_bg, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
381   fg_tilemap   = tilemap_create(imago_get_tile_info_fg, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
379   web_tilemap = tilemap_create(imago_get_tile_info_web,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
380   bg_tilemap   = tilemap_create(imago_get_tile_info_bg, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
381   fg_tilemap   = tilemap_create(imago_get_tile_info_fg, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
382382
383383   tilemap_set_transparent_pen(bg_tilemap, 0);
384384   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/karnov.c
r814r815
215215         0,
216216         tile&0xfff,
217217         tile>>14,
218         0)
218         0);
219219}
220220
221221WRITE16_HANDLER( karnov_videoram_w )
r814r815
240240   dirty_f=auto_malloc(0x800);
241241   memset(dirty_f,1,0x800);
242242
243   fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
243   fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
244244
245245   tilemap_set_transparent_pen(fix_tilemap,0);
246246}
r814r815
253253   dirty_f=auto_malloc(0x800);
254254   memset(dirty_f,1,0x800);
255255
256   fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
256   fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
257257
258258   tilemap_set_transparent_pen(fix_tilemap,0);
259259}
src/mame/video/lwings.c
r814r815
2121
2222***************************************************************************/
2323
24static UINT32 get_bg2_memory_offset( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
24static TILEMAP_MAPPER( get_bg2_memory_offset )
2525{
2626   return (row * 0x800) | (col * 2);
2727}
r814r815
3636         0,
3737         code + ((color & 0xc0) << 2),
3838         color & 0x0f,
39         TILE_FLIPYX((color & 0x30) >> 4))
39         TILE_FLIPYX((color & 0x30) >> 4));
4040}
4141
4242static TILE_GET_INFO( lwings_get_bg1_tile_info )
r814r815
4949         1,
5050         code + ((color & 0xe0) << 3),
5151         color & 0x07,
52         TILE_FLIPYX((color & 0x18) >> 3))
52         TILE_FLIPYX((color & 0x18) >> 3));
5353}
5454
5555static TILE_GET_INFO( trojan_get_bg1_tile_info )
r814r815
6363         1,
6464         code,
6565         bAvengersHardware ? ((color & 7) ^ 6) : (color & 7),
66         TILE_SPLIT((color & 0x08) >> 3) | ((color & 0x10) ? TILE_FLIPX : 0))
66         ((color & 0x10) ? TILE_FLIPX : 0));
67   tileinfo->group = (color & 0x08) >> 3;
6768}
6869
6970static TILE_GET_INFO( get_bg2_tile_info )
r814r815
7980         3,
8081         code + ((color & 0x80) << 1),
8182         color & 0x07,
82         TILE_FLIPYX((color & 0x30) >> 4))
83         TILE_FLIPYX((color & 0x30) >> 4));
8384}
8485
8586/***************************************************************************
r814r815
9091
9192VIDEO_START( lwings )
9293{
93   fg_tilemap  = tilemap_create(get_fg_tile_info,        tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
94   bg1_tilemap = tilemap_create(lwings_get_bg1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
94   fg_tilemap  = tilemap_create(get_fg_tile_info,        tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
95   bg1_tilemap = tilemap_create(lwings_get_bg1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,32,32);
9596
9697   tilemap_set_transparent_pen(fg_tilemap,3);
9798}
9899
99100VIDEO_START( trojan )
100101{
101   fg_tilemap  = tilemap_create(get_fg_tile_info,        tilemap_scan_rows,    TILEMAP_TYPE_TRANSPARENT,8, 8,32,32);
102   bg1_tilemap = tilemap_create(trojan_get_bg1_tile_info,tilemap_scan_cols,    TILEMAP_TYPE_SPLIT,     16,16,32,32);
103   bg2_tilemap = tilemap_create(get_bg2_tile_info,       get_bg2_memory_offset,TILEMAP_TYPE_OPAQUE,    16,16,32,16);
102   fg_tilemap  = tilemap_create(get_fg_tile_info,        tilemap_scan_rows,    TILEMAP_TYPE_PEN,8, 8,32,32);
103   bg1_tilemap = tilemap_create(trojan_get_bg1_tile_info,tilemap_scan_cols,    TILEMAP_TYPE_PEN,     16,16,32,32);
104   bg2_tilemap = tilemap_create(get_bg2_tile_info,       get_bg2_memory_offset,TILEMAP_TYPE_PEN,    16,16,32,16);
104105
105106      tilemap_set_transparent_pen(fg_tilemap,3);
106107      tilemap_set_transmask(bg1_tilemap,0,0xffff,0x0001); /* split type 0 is totally transparent in front half */
r814r815
279280VIDEO_UPDATE( trojan )
280281{
281282   tilemap_draw(bitmap,cliprect,bg2_tilemap,0,0);
282   tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_BACK,0);
283   tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_DRAW_LAYER1,0);
283284   trojan_draw_sprites(machine,bitmap,cliprect);
284   tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_FRONT,0);
285   tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_DRAW_LAYER0,0);
285286   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
286287   return 0;
287288}
src/mame/video/punchout.c
r814r815
219219
220220VIDEO_START( punchout )
221221{
222   toptilemap = tilemap_create(top_get_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
223   bottilemap = tilemap_create(bot_get_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
222   toptilemap = tilemap_create(top_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
223   bottilemap = tilemap_create(bot_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
224224   tilemap_set_scroll_rows(bottilemap, 32);
225225
226   spr1tilemap = tilemap_create(bs1_get_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 16,32);
227   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 16,32);
226   spr1tilemap = tilemap_create(bs1_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
227   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
228228
229229   fgtilemap = NULL;
230230}
r814r815
247247   SET_TILE_INFO(0, code, color, flipx ? TILE_FLIPX : 0);
248248}
249249
250static UINT32 armwrest_bs1_scan(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
250static TILEMAP_MAPPER( armwrest_bs1_scan )
251251{
252252   int halfcols = num_cols/2;
253253   return (col/halfcols)*(halfcols*num_rows) + row*halfcols + col%halfcols;
r814r815
263263
264264VIDEO_START( armwrest )
265265{
266   toptilemap = tilemap_create(armwrest_top_get_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
267   bottilemap = tilemap_create(armwrest_bot_get_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
266   toptilemap = tilemap_create(armwrest_top_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
267   bottilemap = tilemap_create(armwrest_bot_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
268268
269   spr1tilemap = tilemap_create(bs1_get_info, armwrest_bs1_scan, TILEMAP_TYPE_OPAQUE, 8,8, 32,16);
270   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 16,32);
269   spr1tilemap = tilemap_create(bs1_get_info, armwrest_bs1_scan, TILEMAP_TYPE_PEN, 8,8, 32,16);
270   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
271271
272   fgtilemap = tilemap_create(armwrest_fg_get_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 32,32);
272   fgtilemap = tilemap_create(armwrest_fg_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
273273   tilemap_set_transparent_pen(fgtilemap, 7);
274274}
275275
src/mame/video/kopunch.c
r814r815
7878{
7979   int code = videoram[tile_index];
8080
81   SET_TILE_INFO(0, code, 0, 0)
81   SET_TILE_INFO(0, code, 0, 0);
8282}
8383
8484static TILE_GET_INFO( get_fg_tile_info )
8585{
8686   int code = (kopunch_videoram2[tile_index] & 0x7f) + 128 * gfxbank;
8787
88   SET_TILE_INFO(1, code, 0, 0)
88   SET_TILE_INFO(1, code, 0, 0);
8989}
9090
9191VIDEO_START( kopunch )
9292{
9393   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
94      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
94      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9595
9696   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
97      TILEMAP_TYPE_TRANSPARENT, 8, 8, 16, 16);
97      TILEMAP_TYPE_PEN, 8, 8, 16, 16);
9898
9999   tilemap_set_transparent_pen(fg_tilemap, 0);
100100}
src/mame/video/tecmo.c
r814r815
3030         3,
3131         tecmo_bgvideoram[tile_index] + ((attr & 0x07) << 8),
3232         attr >> 4,
33         0)
33         0);
3434}
3535
3636static TILE_GET_INFO( get_fg_tile_info )
r814r815
4040         2,
4141         tecmo_fgvideoram[tile_index] + ((attr & 0x07) << 8),
4242         attr >> 4,
43         0)
43         0);
4444}
4545
4646static TILE_GET_INFO( gemini_get_bg_tile_info )
r814r815
5050         3,
5151         tecmo_bgvideoram[tile_index] + ((attr & 0x70) << 4),
5252         attr & 0x0f,
53         0)
53         0);
5454}
5555
5656static TILE_GET_INFO( gemini_get_fg_tile_info )
r814r815
6060         2,
6161         tecmo_fgvideoram[tile_index] + ((attr & 0x70) << 4),
6262         attr & 0x0f,
63         0)
63         0);
6464}
6565
6666static TILE_GET_INFO( get_tx_tile_info )
r814r815
7070         0,
7171         tecmo_txvideoram[tile_index] + ((attr & 0x03) << 8),
7272         attr >> 4,
73         0)
73         0);
7474}
7575
7676
r814r815
8585{
8686   if (tecmo_video_type == 2)   /* gemini */
8787   {
88      bg_tilemap = tilemap_create(gemini_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
89      fg_tilemap = tilemap_create(gemini_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
88      bg_tilemap = tilemap_create(gemini_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
89      fg_tilemap = tilemap_create(gemini_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
9090   }
9191   else   /* rygar, silkworm */
9292   {
93      bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
94      fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
93      bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
94      fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
9595   }
96   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
96   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
9797
9898   tilemap_set_transparent_pen(bg_tilemap,0);
9999   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/news.c
r814r815
2323         0,
2424         code & 0x0fff,
2525         (code & 0xf000) >> 12,
26         0)
26         0);
2727}
2828
2929static TILE_GET_INFO( get_bg_tile_info )
r814r815
3838         0,
3939         code,
4040         color,
41         0)
41         0);
4242}
4343
4444
r814r815
5252VIDEO_START( news )
5353{
5454
55   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32, 32);
55   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
5656   tilemap_set_transparent_pen(fg_tilemap,0);
5757
58   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32, 32);
58   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
5959}
6060
6161
src/mame/video/shuuz.c
r814r815
7373   };
7474
7575   /* initialize the playfield */
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
7777
7878   /* initialize the motion objects */
7979   atarimo_init(machine, 0, &modesc);
src/mame/video/cclimber.c
r814r815
802802
803803   palette=(attr&0xf)+0x18 ;
804804
805   SET_TILE_INFO(1, code, palette, (flipx?TILE_FLIPX:0)|(flipy?TILE_FLIPY:0))
805   SET_TILE_INFO(1, code, palette, (flipx?TILE_FLIPX:0)|(flipy?TILE_FLIPY:0));
806806}
807807
808808VIDEO_START( toprollr )
809809{
810   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
810   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
811811}
812812
813813static void toprollr_draw_big_sprite(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int priority)
src/mame/video/xorworld.c
r814r815
7575VIDEO_START( xorworld )
7676{
7777   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
78      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
78      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
7979}
8080
8181/*
src/mame/video/speedspn.c
r814r815
1515   int code = speedspn_vidram[tile_index*2+1] | (speedspn_vidram[tile_index*2] << 8);
1616   int attr = speedspn_attram[tile_index^0x400];
1717
18   SET_TILE_INFO(0,code,attr & 0x3f,(attr & 0x80) ? TILE_FLIPX : 0)
18   SET_TILE_INFO(0,code,attr & 0x3f,(attr & 0x80) ? TILE_FLIPX : 0);
1919}
2020
2121VIDEO_START(speedspn)
2222{
2323   speedspn_vidram = auto_malloc(0x1000 * 2);
24   speedspn_tilemap = tilemap_create(get_speedspn_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE, 8, 8,64,32);
24   speedspn_tilemap = tilemap_create(get_speedspn_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 8, 8,64,32);
2525}
2626
2727WRITE8_HANDLER( speedspn_vidram_w )
src/mame/video/hexa.c
r814r815
5858   int tile = videoram[offs + 1] + ((videoram[offs] & 0x07) << 8) + (charbank << 11);
5959   int color = (videoram[offs] & 0xf8) >> 3;
6060
61   SET_TILE_INFO(0, tile, color, 0)
61   SET_TILE_INFO(0, tile, color, 0);
6262}
6363
6464VIDEO_START( hexa )
6565{
6666   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
67      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
67      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
6868}
6969
7070
src/mame/video/cloak.c
r814r815
161161{
162162   int code = videoram[tile_index];
163163
164   SET_TILE_INFO(0, code, 0, 0)
164   SET_TILE_INFO(0, code, 0, 0);
165165}
166166
167167static void refresh_bitmaps(void)
r814r815
181181VIDEO_START( cloak )
182182{
183183   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
184      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
184      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
185185
186186   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
187187   tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
src/mame/video/namcona1.c
r814r815
3333
3434   if( data&0x8000 )
3535   {
36      SET_TILE_INFO( 0,tile,tilemap_color,TILE_IGNORE_TRANSPARENCY );
36      SET_TILE_INFO( 0,tile,tilemap_color,TILE_FORCE_LAYER0 );
3737   }
3838   else
3939   {
r814r815
219219{
220220   int i;
221221   gfx_element *gfx0,*gfx1;
222   static tile_get_info_fn get_info[4] =
222   static tile_get_info_callback get_info[4] =
223223   { tilemap_get_info0, tilemap_get_info1, tilemap_get_info2, tilemap_get_info3 };
224224
225225   for( i=0; i<NAMCONA1_NUM_TILEMAPS; i++ )
r814r815
227227      bg_tilemap[i] = tilemap_create(
228228         get_info[i],
229229         tilemap_scan_rows,
230         TILEMAP_TYPE_BITMASK,8,8,64,64 );
230         TILEMAP_TYPE_PEN,8,8,64,64 );
231231
232232      tilemap_palette_bank[i] = -1;
233233   }
src/mame/video/foodf.c
r814r815
4242   static const int resistances[3] = { 1000, 470, 220 };
4343
4444   /* initialize the playfield */
45   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 8,8, 32,32);
45   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 32,32);
4646   tilemap_set_transparent_pen(atarigen_playfield_tilemap, 0);
4747
4848   /* adjust the playfield for the 8 pixel offset */
r814r815
123123   int offs;
124124
125125   /* first draw the playfield opaquely */
126   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
126   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, TILEMAP_DRAW_OPAQUE, 0);
127127
128128   /* then draw the non-transparent parts with a priority of 1 */
129129   fillbitmap(priority_bitmap, 0, 0);
src/mame/video/bsktball.c
r814r815
2424   int color = (attr & 0x40) >> 6;
2525   int flags = (attr & 0x80) ? TILE_FLIPX : 0;
2626
27   SET_TILE_INFO(0, code, color, flags)
27   SET_TILE_INFO(0, code, color, flags);
2828}
2929
3030VIDEO_START( bsktball )
3131{
3232   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
33      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
33      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
3434}
3535
3636static void draw_sprites(running_machine *machine,  mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/armedf.c
r814r815
2929
3030***************************************************************************/
3131
32static UINT32 armedf_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
32static TILEMAP_MAPPER( armedf_scan )
3333{ /* col: 0..63; row: 0..31 */
3434   switch( scroll_type )
3535   {
r814r815
6262         0,
6363         tile_number + 256 * (attributes & 0x3),
6464         attributes >> 4,
65         0)
65         0);
6666}
6767
6868static TILE_GET_INFO( get_fg_tile_info )
r814r815
7272         1,
7373         data&0x7ff,
7474         data>>11,
75         0)
75         0);
7676}
7777
7878
r814r815
8383         2,
8484         data&0x3ff,
8585         data>>11,
86         0)
86         0);
8787}
8888
8989
r814r815
107107      sprite_offy = 128;
108108   }
109109
110   //bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,16,16,64,32);
111   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
112   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
113   armedf_tx_tilemap = tilemap_create(get_tx_tile_info,armedf_scan,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
110   //bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
111   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
112   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
113   armedf_tx_tilemap = tilemap_create(get_tx_tile_info,armedf_scan,TILEMAP_TYPE_PEN,8,8,64,32);
114114
115115   tilemap_set_transparent_pen(fg_tilemap,0xf);
116116   tilemap_set_transparent_pen(armedf_tx_tilemap,0xf);
src/mame/video/dkong.c
r814r815
427427   int code = videoram[tile_index] + 256 * gfx_bank;
428428   int color = (color_codes[tile_index % 32 + 32 * (tile_index / 32 / 4)] & 0x0f) + 0x10 * palette_bank;
429429
430   SET_TILE_INFO(0, code, color, 0)
430   SET_TILE_INFO(0, code, color, 0);
431431}
432432
433433static TILE_GET_INFO( radarsc1_bg_tile_info )
r814r815
436436   int color = (color_codes[tile_index % 32] & 0x0f);
437437   color = color | (palette_bank<<4);
438438
439   SET_TILE_INFO(0, code, color, 0)
439   SET_TILE_INFO(0, code, color, 0);
440440}
441441
442442/***************************************************************************
r814r815
807807
808808   video_start_dkong_base(machine);
809809
810   bg_tilemap = tilemap_create(dkong_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
810   bg_tilemap = tilemap_create(dkong_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
811811   tilemap_set_scrolldx(bg_tilemap, 0, 128);
812812}
813813
r814r815
832832
833833   vid_hw = HW_TRS01;
834834
835   bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
835   bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
836836   tilemap_set_scrolldx(bg_tilemap, 0, 128);
837837
838838   bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
src/mame/video/sprint4.c
r814r815
4343
4444   if ((code & 0x30) == 0x30)
4545   {
46      SET_TILE_INFO(0, code & ~0x40, (code >> 6) ^ 3, 0)
46      SET_TILE_INFO(0, code & ~0x40, (code >> 6) ^ 3, 0);
4747   }
4848   else
4949   {
50      SET_TILE_INFO(0, code, 4, 0)
50      SET_TILE_INFO(0, code, 4, 0);
5151   }
5252}
5353
r814r815
5656{
5757   helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
5858
59   playfield = tilemap_create(sprint4_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
59   playfield = tilemap_create(sprint4_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
6060}
6161
6262
src/mame/video/appoooh.c
r814r815
151151***************************************************************************/
152152VIDEO_START( appoooh )
153153{
154   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
155   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
154   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
155   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
156156
157157   tilemap_set_transparent_pen(fg_tilemap,0);
158158   tilemap_set_scrolldy(fg_tilemap,8,8);
src/mame/video/travrusa.c
r814r815
191191   UINT8 attr = travrusa_videoram[2*tile_index+1];
192192   int flags = TILE_FLIPXY((attr & 0x30) >> 4);
193193
194   if ((attr & 0x0f) == 0x0f) flags |= TILE_SPLIT(1);   /* tunnels */
194   tileinfo->group = ((attr & 0x0f) == 0x0f) ? 1 : 0;   /* tunnels */
195195
196196   SET_TILE_INFO(
197197         0,
198198         travrusa_videoram[2*tile_index] + ((attr & 0xc0) << 2),
199199         attr & 0x0f,
200         flags)
200         flags);
201201}
202202
203203
r814r815
210210
211211VIDEO_START( travrusa )
212212{
213   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,64,32);
213   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
214214
215215   tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */
216216   tilemap_set_transmask(bg_tilemap,1,0x3f,0xc0); /* split type 1 has pens 6 and 7 opaque - tunnels */
r814r815
325325
326326VIDEO_UPDATE( travrusa )
327327{
328   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
328   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
329329   draw_sprites(machine, bitmap,cliprect);
330   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
330   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
331331   return 0;
332332}
src/mame/video/metlclsh.c
r814r815
7373
7474***************************************************************************/
7575
76UINT32 metlclsh_bgtilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
76static TILEMAP_MAPPER( metlclsh_bgtilemap_scan )
7777{
7878   return   (row & 7) + ((row & ~7) << 4) + ((col & 0xf) << 3) + ((col & ~0xf) << 4);
7979}
8080
8181static TILE_GET_INFO( get_bg_tile_info )
8282{
83   SET_TILE_INFO(1, metlclsh_bgram[tile_index] + (metlclsh_gfxbank << 7),0,0)
83   SET_TILE_INFO(1, metlclsh_bgram[tile_index] + (metlclsh_gfxbank << 7),0,0);
8484}
8585
8686WRITE8_HANDLER( metlclsh_bgram_w )
r814r815
123123{
124124   UINT8 code = metlclsh_fgram[tile_index + 0x000];
125125   UINT8 attr = metlclsh_fgram[tile_index + 0x400];
126   SET_TILE_INFO(2, code + ((attr & 0x03) << 8), (attr >> 5) & 3, 0)
127   tileinfo->priority = ((attr & 0x80) ? 1 : 2);
126   SET_TILE_INFO(2, code + ((attr & 0x03) << 8), (attr >> 5) & 3, 0);
127   tileinfo->category = ((attr & 0x80) ? 1 : 2);
128128}
129129
130130WRITE8_HANDLER( metlclsh_fgram_w )
r814r815
144144{
145145   metlclsh_otherram = auto_malloc(0x800);   // banked ram
146146
147   bg_tilemap = tilemap_create(get_bg_tile_info,metlclsh_bgtilemap_scan,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
148   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
147   bg_tilemap = tilemap_create(get_bg_tile_info,metlclsh_bgtilemap_scan,TILEMAP_TYPE_PEN,16,16,32,16);
148   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
149149
150150   tilemap_set_transparent_pen( bg_tilemap, 0 );
151151   tilemap_set_transparent_pen( fg_tilemap, 0 );
src/mame/video/88games.c
r814r815
6363   zoom_colorbase = 48;
6464   K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tile_callback);
6565   K051960_vh_start(machine,REGION_GFX2,NORMAL_PLANE_ORDER,sprite_callback);
66   K051316_vh_start_0(machine,REGION_GFX3,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback);
66   K051316_vh_start_0(machine,REGION_GFX3,4,FALSE,0,zoom_callback);
6767}
6868
6969
r814r815
8080
8181   if (k88games_priority)
8282   {
83      tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_IGNORE_TRANSPARENCY,0);
83      tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_DRAW_OPAQUE,0);
8484      K051960_sprites_draw(bitmap,cliprect,1,1);
8585      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0);
8686      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0);
r814r815
8989   }
9090   else
9191   {
92      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_IGNORE_TRANSPARENCY,0);
92      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_DRAW_OPAQUE,0);
9393      K051316_zoom_draw_0(bitmap,cliprect,0,0);
9494      K051960_sprites_draw(bitmap,cliprect,0,0);
9595      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0);
src/mame/video/kaneko16.c
r814r815
107107   UINT16 code_hi = kaneko16_vram_##_N_[ 2 * tile_index + 0]; \
108108   UINT16 code_lo = kaneko16_vram_##_N_[ 2 * tile_index + 1]; \
109109   SET_TILE_INFO(1 + _N_/2, code_lo, (code_hi >> 2) & 0x3f, TILE_FLIPXY( code_hi & 3 )); \
110   tileinfo->priority   =   (code_hi >> 8) & 7; \
110   tileinfo->category   =   (code_hi >> 8) & 7; \
111111} \
112112\
113113WRITE16_HANDLER( kaneko16_vram_##_N_##_w ) \
r814r815
133133   video_start_kaneko16_sprites(machine);
134134
135135   kaneko16_tmap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
136                              TILEMAP_TYPE_TRANSPARENT, 16,16, 0x20,0x20   );
136                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
137137   kaneko16_tmap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
138                              TILEMAP_TYPE_TRANSPARENT, 16,16, 0x20,0x20   );
138                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
139139
140140   kaneko16_tmap_2 = 0;
141141
r814r815
179179   video_start_kaneko16_1xVIEW2(machine);
180180
181181   kaneko16_tmap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
182                              TILEMAP_TYPE_TRANSPARENT, 16,16, 0x20,0x20   );
182                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
183183   kaneko16_tmap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
184                              TILEMAP_TYPE_TRANSPARENT, 16,16, 0x20,0x20   );
184                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
185185
186186   {
187187      int dx, xdim = machine->screen[0].width;
src/mame/video/dbz.c
r814r815
4848   colour = (dbz_bg2_videoram[tile_index*2] & 0x000f);
4949   flag = (dbz_bg2_videoram[tile_index*2] & 0x0080) ? TILE_FLIPX : 0;
5050
51   SET_TILE_INFO(0,tileno,colour + (layer_colorbase[5] << 1),flag)
51   SET_TILE_INFO(0,tileno,colour + (layer_colorbase[5] << 1),flag);
5252}
5353
5454WRITE16_HANDLER( dbz_bg1_videoram_w )
r814r815
6565   colour = (dbz_bg1_videoram[tile_index*2] & 0x000f);
6666   flag = (dbz_bg1_videoram[tile_index*2] & 0x0080) ? TILE_FLIPX : 0;
6767
68   SET_TILE_INFO(1,tileno,colour + (layer_colorbase[4] << 1),flag)
68   SET_TILE_INFO(1,tileno,colour + (layer_colorbase[4] << 1),flag);
6969}
7070
7171/* useful function to sort the four tile layers by priority order */
r814r815
9797   K056832_vh_start(machine, REGION_GFX1, K056832_BPP_4, 1, NULL, dbz_tile_callback, 1);
9898   K053247_vh_start(machine, REGION_GFX2, -52, 16, NORMAL_PLANE_ORDER, dbz_sprite_callback);
9999
100   dbz_bg1_tilemap = tilemap_create(get_dbz_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,64,32);
101   dbz_bg2_tilemap = tilemap_create(get_dbz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,64,32);
100   dbz_bg1_tilemap = tilemap_create(get_dbz_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,64,32);
101   dbz_bg2_tilemap = tilemap_create(get_dbz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,64,32);
102102
103103   tilemap_set_transparent_pen(dbz_bg1_tilemap,0);
104104   tilemap_set_transparent_pen(dbz_bg2_tilemap,0);
r814r815
165165
166166      if(plane == 0)
167167      {
168         flag = TILEMAP_IGNORE_TRANSPARENCY;
168         flag = TILEMAP_DRAW_OPAQUE;
169169         pri = 0;
170170      }
171171      else
src/mame/video/wc90.c
r814r815
3232         2,
3333         tile,
3434         attr >> 4,
35         0)
35         0);
3636}
3737
3838static TILE_GET_INFO( get_fg_tile_info )
r814r815
4444         1,
4545         tile,
4646         attr >> 4,
47         0)
47         0);
4848}
4949
5050static TILE_GET_INFO( get_tx_tile_info )
r814r815
5353         0,
5454         wc90_txvideoram[tile_index + 0x800] + ((wc90_txvideoram[tile_index] & 0x07) << 8),
5555         wc90_txvideoram[tile_index] >> 4,
56         0)
56         0);
5757}
5858
5959static TILE_GET_INFO( track_get_bg_tile_info )
r814r815
6565         2,
6666         tile,
6767         attr >> 4,
68         0)
68         0);
6969}
7070
7171static TILE_GET_INFO( track_get_fg_tile_info )
r814r815
7777         1,
7878         tile,
7979         attr >> 4,
80         0)
80         0);
8181}
8282
8383
r814r815
8989
9090VIDEO_START( wc90 )
9191{
92   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
93   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
94   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
92   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
93   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
94   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
9595
9696   tilemap_set_transparent_pen(fg_tilemap,0);
9797   tilemap_set_transparent_pen(tx_tilemap,0);
r814r815
9999
100100VIDEO_START( wc90t )
101101{
102   bg_tilemap = tilemap_create(track_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
103   fg_tilemap = tilemap_create(track_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
104   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
102   bg_tilemap = tilemap_create(track_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
103   fg_tilemap = tilemap_create(track_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
104   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
105105
106106   tilemap_set_transparent_pen(fg_tilemap,0);
107107   tilemap_set_transparent_pen(tx_tilemap,0);
src/mame/video/gauntlet.c
r814r815
4343   int code = data & 0x3ff;
4444   int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20);
4545   int opaque = data & 0x8000;
46   SET_TILE_INFO(1, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
46   SET_TILE_INFO(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
4747}
4848
4949
r814r815
106106   int i, size;
107107
108108   /* initialize the playfield */
109   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
109   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
110110
111111   /* initialize the motion objects */
112112   atarimo_init(machine, 0, &modesc);
113113
114114   /* initialize the alphanumerics */
115   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
115   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
116116   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
117117
118118   /* modify the motion object code lookup table to account for the code XOR */
src/mame/video/ms32.c
r814r815
4343   tileno = ms32_txram[tile_index *2] & 0x0000ffff;
4444   colour = ms32_txram[tile_index *2+1] & 0x000000f;
4545
46   SET_TILE_INFO(3,tileno,colour,0)
46   SET_TILE_INFO(3,tileno,colour,0);
4747}
4848
4949static TILE_GET_INFO( get_ms32_roz_tile_info )
r814r815
5353   tileno = ms32_rozram[tile_index *2] & 0x0000ffff;
5454   colour = ms32_rozram[tile_index *2+1] & 0x000000f;
5555
56   SET_TILE_INFO(1,tileno,colour,0)
56   SET_TILE_INFO(1,tileno,colour,0);
5757}
5858
5959static TILE_GET_INFO( get_ms32_bg_tile_info )
r814r815
6363   tileno = ms32_bgram[tile_index *2] & 0x0000ffff;
6464   colour = ms32_bgram[tile_index *2+1] & 0x000000f;
6565
66   SET_TILE_INFO(2,tileno,colour,0)
66   SET_TILE_INFO(2,tileno,colour,0);
6767}
6868
6969static UINT32 brt[4];
r814r815
7171
7272VIDEO_START( ms32 )
7373{
74   ms32_tx_tilemap = tilemap_create(get_ms32_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
75   ms32_bg_tilemap = tilemap_create(get_ms32_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
76   ms32_roz_tilemap = tilemap_create(get_ms32_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,128,128);
74   ms32_tx_tilemap = tilemap_create(get_ms32_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
75   ms32_bg_tilemap = tilemap_create(get_ms32_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
76   ms32_roz_tilemap = tilemap_create(get_ms32_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,128,128);
7777
7878   tilemap_set_transparent_pen(ms32_tx_tilemap,0);
7979   tilemap_set_transparent_pen(ms32_bg_tilemap,0);
src/mame/video/darkseal.c
r814r815
9999/***************************************************************************/
100100
101101/* Function for all 16x16 1024x1024 layers */
102static UINT32 darkseal_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
102static TILEMAP_MAPPER( darkseal_scan )
103103{
104104   /* logical (col,row) -> memory offset */
105105   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6);
r814r815
117117         gfx_bank,
118118         tile,
119119         color,
120         0)
120         0);
121121}
122122
123123static TILE_GET_INFO( get_bg_tile_info2 ) { get_bg_tile_info(machine,tileinfo,tile_index,1,darkseal_pf2_data); }
r814r815
133133         0,
134134         tile,
135135         color,
136         0)
136         0);
137137}
138138
139139/******************************************************************************/
r814r815
267267
268268VIDEO_START( darkseal )
269269{
270   pf1_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
271   pf2_tilemap = tilemap_create(get_bg_tile_info2,darkseal_scan,    TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
272   pf3_tilemap = tilemap_create(get_bg_tile_info3,darkseal_scan,    TILEMAP_TYPE_OPAQUE,     16,16,64,64);
270   pf1_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
271   pf2_tilemap = tilemap_create(get_bg_tile_info2,darkseal_scan,    TILEMAP_TYPE_PEN,16,16,64,64);
272   pf3_tilemap = tilemap_create(get_bg_tile_info3,darkseal_scan,    TILEMAP_TYPE_PEN,     16,16,64,64);
273273
274274   tilemap_set_transparent_pen(pf1_tilemap,0);
275275   tilemap_set_transparent_pen(pf2_tilemap,0);
src/mame/video/seicross.c
r814r815
8282   int color = colorram[tile_index] & 0x0f;
8383   int flags = ((colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x80) ? TILE_FLIPY : 0);
8484
85   SET_TILE_INFO(0, code, color, flags)
85   SET_TILE_INFO(0, code, color, flags);
8686}
8787
8888VIDEO_START( seicross )
8989{
9090   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
91      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
91      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9292
9393   tilemap_set_scroll_cols(bg_tilemap, 32);
9494}
src/mame/video/system16.c
r814r815
435435
436436/***************************************************************************/
437437
438UINT32 sys16_bg_map( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ){
438static TILEMAP_MAPPER( sys16_bg_map )
439{
439440   int page = 0;
440441   if( row<32 ){ /* top */
441442      if( col<64 ) page = 0; else page = 1;
r814r815
448449   return page*64*32+row*64+col;
449450}
450451
451UINT32 sys16_text_map( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ){
452static TILEMAP_MAPPER( sys16_text_map )
453{
452454   return row*64+col+(64-40);
453455}
454456
r814r815
592594            0,
593595            tile_number,
594596            (data>>6)&0x7f,
595            0)
597            0);
596598   }
597599   else
598600   {
r814r815
600602            0,
601603            tile_number,
602604            (data>>5)&0x7f,
603            0)
605            0);
604606   }
605607
606608   switch(sys16_bg_priority_mode) {
607609   case 1: // Alien Syndrome
608      tileinfo->priority = (data&0x8000)?1:0;
610      tileinfo->category = (data&0x8000)?1:0;
609611      break;
610612   case 2: // Body Slam / wrestwar
611      tileinfo->priority = ((data&0xff00) >= sys16_bg_priority_value)?1:0;
613      tileinfo->category = ((data&0xff00) >= sys16_bg_priority_value)?1:0;
612614      break;
613615   case 3: // sys18 games
614616      if( data&0x8000 ){
615         tileinfo->priority = 2;
617         tileinfo->category = 2;
616618      }
617619      else {
618         tileinfo->priority = ((data&0xff00) >= sys16_bg_priority_value)?1:0;
620         tileinfo->category = ((data&0xff00) >= sys16_bg_priority_value)?1:0;
619621      }
620622      break;
621623   }
r814r815
632634            0,
633635            tile_number,
634636            (data>>6)&0x7f,
635            0)
637            0);
636638   }
637639   else
638640   {
r814r815
640642            0,
641643            tile_number,
642644            (data>>5)&0x7f,
643            0)
645            0);
644646   }
645647
646648   switch(sys16_fg_priority_mode){
647649   case 1: // alien syndrome
648      tileinfo->priority = (data&0x8000)?1:0;
650      tileinfo->category = (data&0x8000)?1:0;
649651      break;
650652
651653   case 3:
652      tileinfo->priority = ((data&0xff00) >= sys16_fg_priority_value)?1:0;
654      tileinfo->category = ((data&0xff00) >= sys16_fg_priority_value)?1:0;
653655      break;
654656
655657   default:
656658      if( sys16_fg_priority_mode>=0 ){
657         tileinfo->priority = (data&0x8000)?1:0;
659         tileinfo->category = (data&0x8000)?1:0;
658660      }
659661      break;
660662   }
r814r815
669671         0,
670672         tile_number,
671673         (data>>6)&0x7f,
672         0)
674         0);
673675
674   tileinfo->priority = 0;
676   tileinfo->category = 0;
675677}
676678
677679static TILE_GET_INFO( get_fg2_tile_info ){
r814r815
683685         0,
684686         tile_number,
685687         (data>>6)&0x7f,
686         0)
688         0);
687689
688   if((data&0xff00) >= sys16_fg_priority_value) tileinfo->priority = 1;
689   else tileinfo->priority = 0;
690   if((data&0xff00) >= sys16_fg_priority_value) tileinfo->category = 1;
691   else tileinfo->category = 0;
690692}
691693
692694WRITE16_HANDLER( sys16_tileram_w ){
r814r815
733735            0,
734736            (tile_number&0x1ff) + sys16_tile_bank0 * 0x1000,
735737            (tile_number>>9)%8,
736            0)
738            0);
737739   }
738740   else
739741   {
r814r815
741743            0,
742744            (tile_number&0xff)  + sys16_tile_bank0 * 0x1000,
743745            (tile_number>>8)%8,
744            0)
746            0);
745747   }
746748
747749   if(pri>=sys16_textlayer_lo_min && pri<=sys16_textlayer_lo_max)
748      tileinfo->priority = 1;
750      tileinfo->category = 1;
749751   if(pri>=sys16_textlayer_hi_min && pri<=sys16_textlayer_hi_max)
750      tileinfo->priority = 0;
752      tileinfo->category = 0;
751753}
752754
753755WRITE16_HANDLER( sys16_textram_w ){
r814r815
785787      background = tilemap_create(
786788         get_bg_tile_info,
787789         sys16_bg_map,
788         TILEMAP_TYPE_OPAQUE,
790         TILEMAP_TYPE_PEN,
789791         8,8,
790792         64*2,32*2 );
791793   else
792794      background = tilemap_create(
793795         get_bg_tile_info,
794796         sys16_bg_map,
795         TILEMAP_TYPE_TRANSPARENT,
797         TILEMAP_TYPE_PEN,
796798         8,8,
797799         64*2,32*2 );
798800
799801   foreground = tilemap_create(
800802      get_fg_tile_info,
801803      sys16_bg_map,
802      TILEMAP_TYPE_TRANSPARENT,
804      TILEMAP_TYPE_PEN,
803805      8,8,
804806      64*2,32*2 );
805807
806808   text_layer = tilemap_create(
807809      get_text_tile_info,
808810      sys16_text_map,
809      TILEMAP_TYPE_TRANSPARENT,
811      TILEMAP_TYPE_PEN,
810812      8,8,
811813      40,28 );
812814
r814r815
872874   background2 = tilemap_create(
873875      get_bg2_tile_info,
874876      sys16_bg_map,
875      TILEMAP_TYPE_OPAQUE,
877      TILEMAP_TYPE_PEN,
876878      8,8,
877879      64*2,32*2 );
878880
879881   foreground2 = tilemap_create(
880882      get_fg2_tile_info,
881883      sys16_bg_map,
882      TILEMAP_TYPE_TRANSPARENT,
884      TILEMAP_TYPE_PEN,
883885      8,8,
884886      64*2,32*2 );
885887
r814r815
10751077
10761078   fillbitmap(priority_bitmap,0,cliprect);
10771079
1078   tilemap_draw( bitmap,cliprect, background, TILEMAP_IGNORE_TRANSPARENCY, 0x00 );
1079   if(sys16_bg_priority_mode) tilemap_draw( bitmap,cliprect, background, TILEMAP_IGNORE_TRANSPARENCY | 1, 0x00 );
1080   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE, 0x00 );
1081   if(sys16_bg_priority_mode) tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 1, 0x00 );
10801082//  sprite_draw(sprite_list,3); // needed for Aurail
10811083   if( sys16_bg_priority_mode==2 ) tilemap_draw( bitmap,cliprect, background, 1, 0x01 );// body slam (& wrestwar??)
10821084//  sprite_draw(sprite_list,2);
r814r815
11111113   else
11121114      fillbitmap(bitmap,machine->pens[0],cliprect);
11131115
1114   tilemap_draw( bitmap,cliprect, background, TILEMAP_IGNORE_TRANSPARENCY, 0 );
1115   tilemap_draw( bitmap,cliprect, background, TILEMAP_IGNORE_TRANSPARENCY | 1, 0 );   //??
1116   tilemap_draw( bitmap,cliprect, background, TILEMAP_IGNORE_TRANSPARENCY | 2, 0 );   //??
1116   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE, 0 );
1117   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 1, 0 );   //??
1118   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 2, 0 );   //??
11171119
11181120   if (!strcmp(machine->gamedrv->name,"astorm"))  update_system18_vdp(bitmap,cliprect); // kludge: render vdp here for astorm
11191121   /* ASTORM also draws some sprites with the vdp, needs to be higher priority..*/
src/mame/video/deniam.c
r814r815
4949
5050***************************************************************************/
5151
52static UINT32 scan_pages(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
52static TILEMAP_MAPPER( scan_pages )
5353{
5454   /* logical (col,row) -> memory offset */
5555   return (col & 0x3f) + ((row & 0x1f) << 6) + ((col & 0x40) << 5) + ((row & 0x20) << 7);
r814r815
6363         0,
6464         attr,
6565         (attr & 0x1fc0) >> 6,
66         0)
66         0);
6767}
6868
6969static TILE_GET_INFO( get_fg_tile_info )
r814r815
7474         0,
7575         attr,
7676         (attr & 0x1fc0) >> 6,
77         0)
77         0);
7878}
7979
8080static TILE_GET_INFO( get_tx_tile_info )
r814r815
8484         0,
8585         attr & 0xf1ff,
8686         (attr & 0x0e00) >> 9,
87         0)
87         0);
8888}
8989
9090
r814r815
9797
9898VIDEO_START( deniam )
9999{
100   bg_tilemap = tilemap_create(get_bg_tile_info,scan_pages,       TILEMAP_TYPE_OPAQUE,     8,8,128,64);
101   fg_tilemap = tilemap_create(get_fg_tile_info,scan_pages,       TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
102   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8, 64,32);
100   bg_tilemap = tilemap_create(get_bg_tile_info,scan_pages,       TILEMAP_TYPE_PEN,     8,8,128,64);
101   fg_tilemap = tilemap_create(get_fg_tile_info,scan_pages,       TILEMAP_TYPE_PEN,8,8,128,64);
102   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8, 64,32);
103103
104104   tilemap_set_transparent_pen(fg_tilemap,0);
105105   tilemap_set_transparent_pen(tx_tilemap,0);
src/mame/video/mcr3.c
r814r815
6060}
6161
6262
63static UINT32 spyhunt_bg_scan(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
63static TILEMAP_MAPPER( spyhunt_bg_scan )
6464{
6565   /* logical (col,row) -> memory offset */
6666   return (row & 0x0f) | ((col & 0x3f) << 4) | ((row & 0x10) << 6);
r814r815
108108VIDEO_START( mcr3 )
109109{
110110   /* initialize the background tilemap */
111   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,16, 32,30);
111   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
112112}
113113
114114
115115VIDEO_START( mcrmono )
116116{
117117   /* initialize the background tilemap */
118   bg_tilemap = tilemap_create(mcrmono_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,16, 32,30);
118   bg_tilemap = tilemap_create(mcrmono_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
119119}
120120
121121
122122VIDEO_START( spyhunt )
123123{
124124   /* initialize the background tilemap */
125   bg_tilemap = tilemap_create(spyhunt_get_bg_tile_info, spyhunt_bg_scan, TILEMAP_TYPE_OPAQUE, 64,32, 64,32);
125   bg_tilemap = tilemap_create(spyhunt_get_bg_tile_info, spyhunt_bg_scan, TILEMAP_TYPE_PEN, 64,32, 64,32);
126126
127127   /* initialize the text tilemap */
128   alpha_tilemap = tilemap_create(spyhunt_get_alpha_tile_info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 16,16, 32,32);
128   alpha_tilemap = tilemap_create(spyhunt_get_alpha_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,16, 32,32);
129129   tilemap_set_transparent_pen(alpha_tilemap, 0);
130130   tilemap_set_scrollx(alpha_tilemap, 0, 16);
131131
src/mame/video/stadhero.c
r814r815
124124
125125/******************************************************************************/
126126
127static UINT32 stadhero_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
127static TILEMAP_MAPPER( stadhero_scan )
128128{
129129   /* logical (col,row) -> memory offset */
130130   return (col & 0xf) + ((row & 0xf) << 4) + ((row & 0x30) << 4) + ((col & 0x30) << 6);
r814r815
142142         1,
143143         tile,
144144         color,
145         0)
145         0);
146146}
147147
148148static TILE_GET_INFO( get_pf1_tile_info )
r814r815
155155         0,
156156         tile,
157157         color,
158         0)
158         0);
159159}
160160
161161VIDEO_START( stadhero )
162162{
163   pf1_tilemap =     tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
164   pf2_tilemap =     tilemap_create(get_pf2_tile_info,stadhero_scan,TILEMAP_TYPE_OPAQUE,     16,16,64,64);
163   pf1_tilemap =     tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
164   pf2_tilemap =     tilemap_create(get_pf2_tile_info,stadhero_scan,TILEMAP_TYPE_PEN,     16,16,64,64);
165165
166166   tilemap_set_transparent_pen(pf1_tilemap,0);
167167}
src/mame/video/prehisle.c
r814r815
7070   int color = attr >> 12;
7171   int flags = (attr & 0x800) ? TILE_FLIPX : 0;
7272
73   SET_TILE_INFO(1, code, color, flags)
73   SET_TILE_INFO(1, code, color, flags);
7474}
7575
7676static TILE_GET_INFO( get_bg_tile_info )
r814r815
8080   int color = attr >> 12;
8181   int flags = (attr & 0x800) ? TILE_FLIPY : 0;
8282
83   SET_TILE_INFO(2, code, color, flags)
83   SET_TILE_INFO(2, code, color, flags);
8484}
8585
8686static TILE_GET_INFO( get_fg_tile_info )
r814r815
8989   int code = attr & 0xfff;
9090   int color = attr >> 12;
9191
92   SET_TILE_INFO(0, code, color, 0)
92   SET_TILE_INFO(0, code, color, 0);
9393}
9494
9595VIDEO_START( prehisle )
9696{
9797   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_cols,
98      TILEMAP_TYPE_OPAQUE, 16, 16, 1024, 32);
98      TILEMAP_TYPE_PEN, 16, 16, 1024, 32);
9999
100100   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
101      TILEMAP_TYPE_TRANSPARENT, 16, 16, 256, 32);
101      TILEMAP_TYPE_PEN, 16, 16, 256, 32);
102102
103103   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
104      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
104      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
105105
106106   tilemap_set_transparent_pen(bg_tilemap, 15);
107107   tilemap_set_transparent_pen(fg_tilemap, 15);
src/mame/video/marvins.c
r814r815
124124         2,
125125         spriteram_3[tile_index],
126126         0,
127         0)
127         0);
128128}
129129
130130static TILE_GET_INFO( get_fg_tilemap_info )
r814r815
133133         1,
134134         spriteram_2[tile_index],
135135         0,
136         0)
136         0);
137137}
138138
139139static TILE_GET_INFO( get_tx_tilemap_info )
r814r815
143143         0,
144144         tile_number,
145145         (tile_number>>5),
146         0)
146         0);
147147}
148148
149149/***************************************************************************
r814r815
159159   stuff_palette( machine, 0, 0, 16*8 ); /* load sprite colors */
160160   stuff_palette( machine, 16*8*3, 16*8, 16*8 ); /* load text colors */
161161
162   fg_tilemap = tilemap_create(get_fg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
163   bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
164   tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
162   fg_tilemap = tilemap_create(get_fg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
163   bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
164   tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
165165
166166   {
167167      tilemap_clip = machine->screen[0].visarea;
r814r815
357357      tilemap_set_scrollx( tx_tilemap,  0, 0 );
358358      tilemap_set_scrolly( tx_tilemap,  0, 0 );
359359
360      tilemap_draw( bitmap,&finalclip,fg_tilemap,TILEMAP_IGNORE_TRANSPARENCY ,0);
360      tilemap_draw( bitmap,&finalclip,fg_tilemap,TILEMAP_DRAW_OPAQUE ,0);
361361      draw_sprites( machine,bitmap,cliprect, sprite_scrollx+29+1, sprite_scrolly+16, 0, sprite_partition );
362362      tilemap_draw( bitmap,&finalclip,bg_tilemap,0 ,0);
363363      draw_sprites( machine,bitmap,cliprect, sprite_scrollx+29+1, sprite_scrolly+16, 1, sprite_partition );
r814r815
420420      tilemap_set_scrollx( tx_tilemap,  0, 0 );
421421      tilemap_set_scrolly( tx_tilemap,  0, 0 );
422422
423      tilemap_draw( bitmap,&finalclip,bg_tilemap,TILEMAP_IGNORE_TRANSPARENCY ,0);
423      tilemap_draw( bitmap,&finalclip,bg_tilemap,TILEMAP_DRAW_OPAQUE ,0);
424424      draw_sprites( machine,bitmap,cliprect, sprite_scrollx+29, sprite_scrolly+17, 0, sprite_partition );
425425      tilemap_draw( bitmap,&finalclip,fg_tilemap,0 ,0);
426426      draw_sprites( machine,bitmap,cliprect, sprite_scrollx+29, sprite_scrolly+17, 1, sprite_partition );
src/mame/video/wwfsstar.c
r814r815
6161         0,
6262         tileno,
6363         colbank,
64         0)
64         0);
6565}
6666
67static UINT32 bg0_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
67static TILEMAP_MAPPER( bg0_scan )
6868{
6969   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5);
7070}
r814r815
9797         2,
9898         tileno,
9999         colbank,
100         flipx ? TILE_FLIPX : 0)
100         flipx ? TILE_FLIPX : 0);
101101}
102102
103103/*******************************************************************************
r814r815
205205
206206VIDEO_START( wwfsstar )
207207{
208   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
208   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
209209   tilemap_set_transparent_pen(fg0_tilemap,0);
210210
211   bg0_tilemap = tilemap_create(get_bg0_tile_info,bg0_scan,TILEMAP_TYPE_OPAQUE, 16, 16,32,32);
211   bg0_tilemap = tilemap_create(get_bg0_tile_info,bg0_scan,TILEMAP_TYPE_PEN, 16, 16,32,32);
212212   tilemap_set_transparent_pen(fg0_tilemap,0);
213213}
214214
src/mame/video/polepos.c
r814r815
159159         1,
160160         code,
161161         color,
162         0)
162         0);
163163}
164164
165165static TILE_GET_INFO( tx_get_tile_info )
r814r815
184184         0,
185185         code,
186186         color,
187         0)
187         0);
188188}
189189
190190
r814r815
197197
198198VIDEO_START( polepos )
199199{
200   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,8,8,64,16);
201   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,32,32);
200   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,16);
201   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_COLORTABLE,8,8,32,32);
202202
203203   tilemap_set_transparent_pen(tx_tilemap, 0x2f);
204204}
src/mame/video/actfancr.c
r814r815
1212static tilemap *pf1_tilemap,*pf1_alt_tilemap,*pf2_tilemap;
1313static int flipscreen;
1414
15static UINT32 actfancr_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
15static TILEMAP_MAPPER( actfancr_scan )
1616{
1717   /* logical (col,row) -> memory offset */
1818   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0xf0) << 4);
1919}
2020
21static UINT32 actfancr_scan2(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
21static TILEMAP_MAPPER( actfancr_scan2 )
2222{
2323   /* logical (col,row) -> memory offset */
2424   return (col & 0x0f) + ((row & 0x0f) << 4) + ((row & 0x10) << 4) + ((col & 0x70) << 5);
r814r815
3636         2,
3737         tile,
3838         color,
39         0)
39         0);
4040}
4141
42static UINT32 triothep_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
42static TILEMAP_MAPPER( triothep_scan )
4343{
4444   /* logical (col,row) -> memory offset */
4545   return (col & 0x0f) + ((row & 0x0f) << 4) + ((row & 0x10) << 4) + ((col & 0x10) << 5);
r814r815
5757         2,
5858         tile,
5959         color,
60         0)
60         0);
6161}
6262
6363static TILE_GET_INFO( get_pf2_tile_info )
r814r815
7373            0,
7474            tile,
7575            color,
76            0)
76            0);
7777}
7878
7979/******************************************************************************/
r814r815
8686
8787VIDEO_START( actfancr )
8888{
89   pf1_tilemap = tilemap_create(get_tile_info,actfancr_scan,TILEMAP_TYPE_OPAQUE,16,16,256,16);
90   pf1_alt_tilemap = tilemap_create(get_tile_info,actfancr_scan2,TILEMAP_TYPE_OPAQUE,16,16,128,32);
91   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
89   pf1_tilemap = tilemap_create(get_tile_info,actfancr_scan,TILEMAP_TYPE_PEN,16,16,256,16);
90   pf1_alt_tilemap = tilemap_create(get_tile_info,actfancr_scan2,TILEMAP_TYPE_PEN,16,16,128,32);
91   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
9292
9393   tilemap_set_transparent_pen(pf2_tilemap,0);
9494
r814r815
9797
9898VIDEO_START( triothep )
9999{
100   pf1_tilemap = tilemap_create(get_trio_tile_info,triothep_scan,TILEMAP_TYPE_OPAQUE,16,16,32,32);
101   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
100   pf1_tilemap = tilemap_create(get_trio_tile_info,triothep_scan,TILEMAP_TYPE_PEN,16,16,32,32);
101   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
102102
103103   tilemap_set_transparent_pen(pf2_tilemap,0);
104104
src/mame/video/taito_b.c
r814r815
174174      1,
175175      tile,
176176      b_bg_color_base + (color&0x3f),
177      TILE_FLIPYX((color & 0x00c0)>>6))
177      TILE_FLIPYX((color & 0x00c0)>>6));
178178}
179179
180180static TILE_GET_INFO( get_fg_tile_info )
r814r815
186186      1,
187187      tile,
188188      b_fg_color_base + (color&0x3f),
189      TILE_FLIPYX((color & 0x00c0)>>6))
189      TILE_FLIPYX((color & 0x00c0)>>6));
190190}
191191
192192static TILE_GET_INFO( get_tx_tile_info )
r814r815
197197      0,
198198      (tile & 0x07ff) | ((TC0180VCU_ctrl[4 + ((tile & 0x800) >> 11)]>>8) << 11),
199199      b_tx_color_base + ((tile >> 12) & 0x0f),
200      0)
200      0);
201201}
202202
203203
r814r815
207207   framebuffer[1] = auto_bitmap_alloc(512,256,machine->screen[0].format);
208208   pixel_bitmap = NULL;  /* only hitice needs this */
209209
210   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,64);
211   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
212   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
210   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,64);
211   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
212   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
213213
214214   tilemap_set_transparent_pen(fg_tilemap,0);
215215   tilemap_set_transparent_pen(tx_tilemap,0);
src/mame/video/jackal.c
r814r815
5656   int color = attr & 0x0f;
5757   int flags = ((attr & 0x10) ? TILE_FLIPX : 0) | ((attr & 0x20) ? TILE_FLIPY : 0);
5858
59   SET_TILE_INFO(0, code, color, flags)
59   SET_TILE_INFO(0, code, color, flags);
6060}
6161
6262VIDEO_START( jackal )
6363{
6464   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
65      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
65      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
6666}
6767
6868static void draw_background( mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/tank8.c
r814r815
5757      }
5858   }
5959
60   SET_TILE_INFO(code >> 7, code, color, (code & 0x40) ? (TILE_FLIPX | TILE_FLIPY) : 0)
60   SET_TILE_INFO(code >> 7, code, color, (code & 0x40) ? (TILE_FLIPX | TILE_FLIPY) : 0);
6161}
6262
6363
r814r815
7979      }
8080   }
8181
82   SET_TILE_INFO(code >> 7, code, color, (code & 0x40) ? (TILE_FLIPX | TILE_FLIPY) : 0)
82   SET_TILE_INFO(code >> 7, code, color, (code & 0x40) ? (TILE_FLIPX | TILE_FLIPY) : 0);
8383}
8484
8585
r814r815
8989   helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
9090   helper3 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
9191
92   tilemap1 = tilemap_create(tank8_get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16, 16, 32, 32);
93   tilemap2 = tilemap_create(tank8_get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16, 16, 32, 32);
92   tilemap1 = tilemap_create(tank8_get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
93   tilemap2 = tilemap_create(tank8_get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
9494
9595   /* VBLANK starts on scanline #256 and ends on scanline #24 */
9696
src/mame/video/taitoic.c
r814r815
709709         gfxnum,
710710         code,
711711         (attr & 0x1ff),
712         TILE_FLIPYX((attr & 0xc000) >> 14))
712         TILE_FLIPYX((attr & 0xc000) >> 14));
713713}
714714
715715INLINE void common_get_PC080SN_fg_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *ram,int gfxnum)
r814r815
731731         gfxnum,
732732         code,
733733         (attr & 0x1ff),
734         TILE_FLIPYX((attr & 0xc000) >> 14))
734         TILE_FLIPYX((attr & 0xc000) >> 14));
735735}
736736
737737static TILE_GET_INFO( PC080SN_get_bg_tile_info_0 )
r814r815
754754   common_get_PC080SN_fg_tile_info(machine,tileinfo,tile_index,PC080SN_bg_ram[1][1],PC080SN_bg_gfx[1]);
755755}
756756
757tile_get_info_fn PC080SN_get_tile_info[PC080SN_MAX_CHIPS][2] =
757tile_get_info_callback PC080SN_get_tile_info[PC080SN_MAX_CHIPS][2] =
758758{
759759   { PC080SN_get_bg_tile_info_0, PC080SN_get_fg_tile_info_0 },
760760   { PC080SN_get_bg_tile_info_1, PC080SN_get_fg_tile_info_1 }
r814r815
796796
797797      if (!PC080SN_dblwidth)   /* standard tilemaps */
798798      {
799         PC080SN_tilemap[i][0] = tilemap_create(PC080SN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
800         PC080SN_tilemap[i][1] = tilemap_create(PC080SN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
799         PC080SN_tilemap[i][0] = tilemap_create(PC080SN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
800         PC080SN_tilemap[i][1] = tilemap_create(PC080SN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
801801      }
802802      else   /* double width tilemaps */
803803      {
804         PC080SN_tilemap[i][0] = tilemap_create(PC080SN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
805         PC080SN_tilemap[i][1] = tilemap_create(PC080SN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
804         PC080SN_tilemap[i][0] = tilemap_create(PC080SN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
805         PC080SN_tilemap[i][1] = tilemap_create(PC080SN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
806806      }
807807
808808      PC080SN_ram[i] = auto_malloc(PC080SN_RAM_SIZE);
r814r815
10761076   UINT16 scanline[1024];   /* won't be called by a wide-screen game, but just in case... */
10771077
10781078   mame_bitmap *srcbitmap = tilemap_get_pixmap(PC080SN_tilemap[chip][layer]);
1079   mame_bitmap *transbitmap = tilemap_get_transparency_bitmap(PC080SN_tilemap[chip][layer]);
1079   mame_bitmap *flagsbitmap = tilemap_get_flagsmap(PC080SN_tilemap[chip][layer]);
10801080
10811081   UINT16 a,color;
10821082   int sx,x_index;
r814r815
11141114      x_index = sx - (PC080SN_bgscroll_ram[chip][layer][row_index]);
11151115
11161116      src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
1117      tsrc  = BITMAP_ADDR8(transbitmap, src_y_index, 0);
1117      tsrc  = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
11181118      dst16 = scanline;
11191119
1120      if (flags & TILEMAP_IGNORE_TRANSPARENCY)
1120      if (flags & TILEMAP_DRAW_OPAQUE)
11211121      {
11221122         for (i=0; i<screen_width; i++)
11231123         {
r814r815
11471147         }
11481148      }
11491149
1150      if (flags & TILEMAP_IGNORE_TRANSPARENCY)
1150      if (flags & TILEMAP_DRAW_OPAQUE)
11511151         taitoic_drawscanline(bitmap,0,y,scanline,0,ROT0,priority,cliprect);
11521152      else
11531153         taitoic_drawscanline(bitmap,0,y,scanline,1,ROT0,priority,cliprect);
r814r815
13951395   color = TC0080VCO_bg0_ram_1[ tile_index ] & 0x001f;
13961396   tile  = TC0080VCO_bg0_ram_0[ tile_index ] & 0x7fff;
13971397
1398   tileinfo->priority = 0;
1398   tileinfo->category = 0;
13991399
14001400   SET_TILE_INFO(
14011401         TC0080VCO_bg_gfx,
14021402         tile,
14031403         color,
1404         TILE_FLIPYX((TC0080VCO_bg0_ram_1[tile_index] & 0x00c0) >> 6))
1404         TILE_FLIPYX((TC0080VCO_bg0_ram_1[tile_index] & 0x00c0) >> 6));
14051405}
14061406
14071407static TILE_GET_INFO( TC0080VCO_get_bg1_tile_info_0 )
r814r815
14111411   color = TC0080VCO_bg1_ram_1[ tile_index ] & 0x001f;
14121412   tile  = TC0080VCO_bg1_ram_0[ tile_index ] & 0x7fff;
14131413
1414   tileinfo->priority = 0;
1414   tileinfo->category = 0;
14151415
14161416   SET_TILE_INFO(
14171417         TC0080VCO_bg_gfx,
14181418         tile,
14191419         color,
1420         TILE_FLIPYX((TC0080VCO_bg1_ram_1[tile_index] & 0x00c0) >> 6))
1420         TILE_FLIPYX((TC0080VCO_bg1_ram_1[tile_index] & 0x00c0) >> 6));
14211421}
14221422
14231423static TILE_GET_INFO( TC0080VCO_get_tx_tile_info )
r814r815
14301430         tile = (TC0080VCO_tx_ram_0[tile_index >> 1] & 0x00ff);
14311431      else
14321432         tile = (TC0080VCO_tx_ram_0[tile_index >> 1] & 0xff00) >> 8;
1433      tileinfo->priority = 0;
1433      tileinfo->category = 0;
14341434   }
14351435   else
14361436   {
r814r815
14381438         tile = (TC0080VCO_tx_ram_0[tile_index >> 1] & 0xff00) >> 8;
14391439      else
14401440         tile = (TC0080VCO_tx_ram_0[tile_index >> 1] & 0x00ff);
1441      tileinfo->priority = 0;
1441      tileinfo->category = 0;
14421442   }
14431443
14441444   SET_TILE_INFO(
14451445         TC0080VCO_tx_gfx,
14461446         tile,
14471447         0x40,
1448         0)      /* 0x20<<1 as 3bpp */
1448         0);      /* 0x20<<1 as 3bpp */
14491449}
14501450
14511451
r814r815
15321532   TC0080VCO_bg_flip_yoffs = bg_flip_yoffs;   /* usually -2 */
15331533   TC0080VCO_has_tx = has_fg0;   /* for debugging only */
15341534
1535   TC0080VCO_tilemap[0] = tilemap_create(TC0080VCO_get_bg0_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
1536   TC0080VCO_tilemap[1] = tilemap_create(TC0080VCO_get_bg1_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
1535   TC0080VCO_tilemap[0] = tilemap_create(TC0080VCO_get_bg0_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
1536   TC0080VCO_tilemap[1] = tilemap_create(TC0080VCO_get_bg1_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
15371537   TC0080VCO_ram = auto_malloc(TC0080VCO_RAM_SIZE);
15381538
15391539   memset( TC0080VCO_ram,0,TC0080VCO_RAM_SIZE );
r814r815
15561556
15571557   /* Perform extra initialisations for text layer */
15581558   {
1559      TC0080VCO_tilemap[2] = tilemap_create(TC0080VCO_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
1559      TC0080VCO_tilemap[2] = tilemap_create(TC0080VCO_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
15601560      TC0080VCO_char_dirty = auto_malloc(TC0080VCO_TOTAL_CHARS);
15611561
15621562      TC0080VCO_dirty_chars();
r814r815
17771777      UINT8 *tsrc;
17781778      UINT16 scanline[512];
17791779      mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0080VCO_tilemap[0]);
1780      mame_bitmap *transbitmap = tilemap_get_transparency_bitmap(TC0080VCO_tilemap[0]);
1780      mame_bitmap *flagsbitmap = tilemap_get_flagsmap(TC0080VCO_tilemap[0]);
17811781
17821782      int sx,zoomx,zoomy;
17831783      int dx,ex,dy,ey;
r814r815
18611861         x_index = sx - ((TC0080VCO_bgscroll_ram[row_index] << 16));
18621862
18631863         src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
1864         tsrc  = BITMAP_ADDR8(transbitmap, src_y_index, 0);
1864         tsrc  = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
18651865         dst16 = scanline;
18661866
18671867         x_step = zoomx;
18681868
18691869/*** NEW ***/
1870         if (flags & TILEMAP_IGNORE_TRANSPARENCY)
1870         if (flags & TILEMAP_DRAW_OPAQUE)
18711871         {
18721872            for (i=0; i<screen_width; i++)
18731873            {
r814r815
18981898//                      scanline,0,0,rot,priority);
18991899
19001900/*** NEW ***/
1901         if (flags & TILEMAP_IGNORE_TRANSPARENCY)
1901         if (flags & TILEMAP_DRAW_OPAQUE)
19021902            taitoic_drawscanline(bitmap,0,y,scanline,0,ROT0,priority,cliprect);
19031903         else
19041904            taitoic_drawscanline(bitmap,0,y,scanline,1,ROT0,priority,cliprect);
r814r815
20722072         gfxnum,
20732073         code,
20742074         (((attr * TC0100SCN_bg_col_mult) + TC0100SCN_colbank[0]) & 0xff) + colbank,
2075         TILE_FLIPYX((attr & 0xc000) >> 14))
2075         TILE_FLIPYX((attr & 0xc000) >> 14));
20762076}
20772077
20782078INLINE void common_get_bg1_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *ram,int gfxnum,int colbank,int dblwidth)
r814r815
20942094         gfxnum,
20952095         code,
20962096         (((attr * TC0100SCN_bg_col_mult) + TC0100SCN_colbank[1]) & 0xff) + colbank,
2097         TILE_FLIPYX((attr & 0xc000) >> 14))
2097         TILE_FLIPYX((attr & 0xc000) >> 14));
20982098}
20992099
21002100INLINE void common_get_tx_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *ram,int gfxnum,int colbank,int dblwidth)
r814r815
21052105         gfxnum,
21062106         attr & 0xff,
21072107         ((((attr >> 6) &0xfc) * TC0100SCN_tx_col_mult + (TC0100SCN_colbank[2] << 2)) &0x3ff) + colbank*4,
2108         TILE_FLIPYX((attr & 0xc000) >> 14))
2108         TILE_FLIPYX((attr & 0xc000) >> 14));
21092109}
21102110
21112111static TILE_GET_INFO( TC0100SCN_get_bg_tile_info_0 )
r814r815
21642164
21652165/* This array changes with TC0100SCN_MAX_CHIPS */
21662166
2167tile_get_info_fn TC0100SCN_get_tile_info[TC0100SCN_MAX_CHIPS][3] =
2167tile_get_info_callback TC0100SCN_get_tile_info[TC0100SCN_MAX_CHIPS][3] =
21682168{
21692169   { TC0100SCN_get_bg_tile_info_0, TC0100SCN_get_fg_tile_info_0, TC0100SCN_get_tx_tile_info_0 },
21702170   { TC0100SCN_get_bg_tile_info_1, TC0100SCN_get_fg_tile_info_1, TC0100SCN_get_tx_tile_info_1 },
r814r815
22912291      TC0100SCN_dblwidth[i]=0;
22922292
22932293      /* Single width versions */
2294      TC0100SCN_tilemap[i][0][0] = tilemap_create(TC0100SCN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
2295      TC0100SCN_tilemap[i][1][0] = tilemap_create(TC0100SCN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
2296      TC0100SCN_tilemap[i][2][0] = tilemap_create(TC0100SCN_get_tile_info[i][2],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
2294      TC0100SCN_tilemap[i][0][0] = tilemap_create(TC0100SCN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
2295      TC0100SCN_tilemap[i][1][0] = tilemap_create(TC0100SCN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
2296      TC0100SCN_tilemap[i][2][0] = tilemap_create(TC0100SCN_get_tile_info[i][2],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
22972297
22982298      /* Double width versions */
2299      TC0100SCN_tilemap[i][0][1] = tilemap_create(TC0100SCN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
2300      TC0100SCN_tilemap[i][1][1] = tilemap_create(TC0100SCN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
2301      TC0100SCN_tilemap[i][2][1] = tilemap_create(TC0100SCN_get_tile_info[i][2],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,32);
2299      TC0100SCN_tilemap[i][0][1] = tilemap_create(TC0100SCN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
2300      TC0100SCN_tilemap[i][1][1] = tilemap_create(TC0100SCN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
2301      TC0100SCN_tilemap[i][2][1] = tilemap_create(TC0100SCN_get_tile_info[i][2],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,32);
23022302
23032303      /* Set up clipping for multi-TC0100SCN games. We assume
23042304           this code won't ever affect single screen games:
r814r815
27152715         column_offset=TC0100SCN_colscroll_ram[chip][(src_x&0x3ff) / 8];
27162716         p=*BITMAP_ADDR16(src_bitmap, (src_y - column_offset)&height_mask, src_x);
27172717
2718         if ((p&0xf)!=0 || (flags & TILEMAP_IGNORE_TRANSPARENCY))
2718         if ((p&0xf)!=0 || (flags & TILEMAP_DRAW_OPAQUE))
27192719         {
27202720            *BITMAP_ADDR16(bitmap, y, x + cliprect->min_x) = machine->pens[p];
27212721            if (priority_bitmap)
r814r815
27812781         TC0280GRD_gfxnum,
27822782         attr & 0x3fff,
27832783         ((attr & 0xc000) >> 14) + TC0280GRD_base_color,
2784         0)
2784         0);
27852785}
27862786
27872787
27882788void TC0280GRD_vh_start(int gfxnum)
27892789{
27902790   TC0280GRD_ram = auto_malloc(TC0280GRD_RAM_SIZE);
2791   TC0280GRD_tilemap = tilemap_create(TC0280GRD_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
2791   TC0280GRD_tilemap = tilemap_create(TC0280GRD_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
27922792
27932793   state_save_register_global_pointer(TC0280GRD_ram, TC0280GRD_RAM_SIZE/2);
27942794   state_save_register_global_array(TC0280GRD_ctrl);
r814r815
29752975         gfxnum,
29762976         code,
29772977         (attr & 0xff) + TC0480SCP_tile_colbase,
2978         TILE_FLIPYX((attr & 0xc000) >> 14))
2978         TILE_FLIPYX((attr & 0xc000) >> 14));
29792979}
29802980
29812981INLINE void common_get_tc0480tx_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *ram,int gfxnum)
r814r815
29852985         gfxnum,
29862986         attr & 0xff,
29872987         ((attr & 0x3f00) >> 8) + TC0480SCP_tile_colbase,
2988         TILE_FLIPYX((attr & 0xc000) >> 14))
2988         TILE_FLIPYX((attr & 0xc000) >> 14));
29892989}
29902990
29912991static TILE_GET_INFO( TC0480SCP_get_bg0_tile_info )
r814r815
30133013   common_get_tc0480tx_tile_info(machine,tileinfo,tile_index,TC0480SCP_tx_ram,TC0480SCP_tx_gfx);
30143014}
30153015
3016tile_get_info_fn tc480_get_tile_info[5] =
3016tile_get_info_callback tc480_get_tile_info[5] =
30173017{
30183018   TC0480SCP_get_bg0_tile_info, TC0480SCP_get_bg1_tile_info,
30193019   TC0480SCP_get_bg2_tile_info, TC0480SCP_get_bg3_tile_info,
r814r815
31663166      TC0480SCP_dblwidth=0;
31673167
31683168      /* Single width versions */
3169      TC0480SCP_tilemap[0][0] = tilemap_create(tc480_get_tile_info[0],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
3170      TC0480SCP_tilemap[1][0] = tilemap_create(tc480_get_tile_info[1],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
3171      TC0480SCP_tilemap[2][0] = tilemap_create(tc480_get_tile_info[2],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
3172      TC0480SCP_tilemap[3][0] = tilemap_create(tc480_get_tile_info[3],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
3173      TC0480SCP_tilemap[4][0] = tilemap_create(tc480_get_tile_info[4],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
3169      TC0480SCP_tilemap[0][0] = tilemap_create(tc480_get_tile_info[0],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
3170      TC0480SCP_tilemap[1][0] = tilemap_create(tc480_get_tile_info[1],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
3171      TC0480SCP_tilemap[2][0] = tilemap_create(tc480_get_tile_info[2],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
3172      TC0480SCP_tilemap[3][0] = tilemap_create(tc480_get_tile_info[3],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
3173      TC0480SCP_tilemap[4][0] = tilemap_create(tc480_get_tile_info[4],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
31743174
31753175      /* Double width versions */
3176      TC0480SCP_tilemap[0][1] = tilemap_create(tc480_get_tile_info[0],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
3177      TC0480SCP_tilemap[1][1] = tilemap_create(tc480_get_tile_info[1],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
3178      TC0480SCP_tilemap[2][1] = tilemap_create(tc480_get_tile_info[2],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
3179      TC0480SCP_tilemap[3][1] = tilemap_create(tc480_get_tile_info[3],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
3180      TC0480SCP_tilemap[4][1] = tilemap_create(tc480_get_tile_info[4],tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
3176      TC0480SCP_tilemap[0][1] = tilemap_create(tc480_get_tile_info[0],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
3177      TC0480SCP_tilemap[1][1] = tilemap_create(tc480_get_tile_info[1],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
3178      TC0480SCP_tilemap[2][1] = tilemap_create(tc480_get_tile_info[2],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
3179      TC0480SCP_tilemap[3][1] = tilemap_create(tc480_get_tile_info[3],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
3180      TC0480SCP_tilemap[4][1] = tilemap_create(tc480_get_tile_info[4],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
31813181
31823182      TC0480SCP_ram = auto_malloc(TC0480SCP_RAM_SIZE);
31833183      TC0480SCP_char_dirty = auto_malloc(TC0480SCP_TOTAL_CHARS);
r814r815
36133613      UINT16 scanline[512];
36143614      UINT32 sx;
36153615      mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]);
3616      mame_bitmap *transbitmap = tilemap_get_transparency_bitmap
3616      mame_bitmap *flagsbitmap = tilemap_get_flagsmap
36173617                     (TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]);
36183618      int flip = TC0480SCP_pri_reg & 0x40;
36193619      int i,y,y_index,src_y_index,row_index;
r814r815
36643664            - ((TC0480SCP_bgscroll_ram[layer][row_index+0x800] << 8) &0xffff);
36653665
36663666         src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
3667         tsrc  = BITMAP_ADDR8(transbitmap, src_y_index, 0);
3667         tsrc  = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
36683668         dst16 = scanline;
36693669
36703670         x_step = zoomx;
36713671
3672         if (flags & TILEMAP_IGNORE_TRANSPARENCY)
3672         if (flags & TILEMAP_DRAW_OPAQUE)
36733673         {
36743674            for (i=0; i<screen_width; i++)
36753675            {
r814r815
36893689            }
36903690         }
36913691
3692         if (flags & TILEMAP_IGNORE_TRANSPARENCY)
3692         if (flags & TILEMAP_DRAW_OPAQUE)
36933693            taitoic_drawscanline(bitmap,0,y,scanline,0,ROT0,priority,cliprect);
36943694         else
36953695            taitoic_drawscanline(bitmap,0,y,scanline,1,ROT0,priority,cliprect);
r814r815
37463746static void TC0480SCP_bg23_draw(mame_bitmap *bitmap,const rectangle *cliprect,int layer,int flags,UINT32 priority)
37473747{
37483748   mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]);
3749   mame_bitmap *transbitmap = tilemap_get_transparency_bitmap
3749   mame_bitmap *flagsbitmap = tilemap_get_flagsmap
37503750                  (TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]);
37513751
37523752   UINT16 *dst16,*src16;
r814r815
38323832      }
38333833
38343834      src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
3835      tsrc  = BITMAP_ADDR8(transbitmap, src_y_index, 0);
3835      tsrc  = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
38363836      dst16 = scanline;
38373837
3838      if (flags & TILEMAP_IGNORE_TRANSPARENCY)
3838      if (flags & TILEMAP_DRAW_OPAQUE)
38393839      {
38403840         for (i=0; i<screen_width; i++)
38413841         {
r814r815
38553855         }
38563856      }
38573857
3858      if (flags & TILEMAP_IGNORE_TRANSPARENCY)
3858      if (flags & TILEMAP_DRAW_OPAQUE)
38593859         taitoic_drawscanline(bitmap,0,y,scanline,0,ROT0,priority,cliprect);
38603860      else
38613861         taitoic_drawscanline(bitmap,0,y,scanline,1,ROT0,priority,cliprect);
src/mame/video/namcos86.c
r814r815
114114         (layer & 2) ? 1 : 0,
115115         vram[2*tile_index] + tile_offs,
116116         attr,
117         0)
117         0);
118118}
119119
120120static TILE_GET_INFO( get_tile_info0 ) { get_tile_info(machine,tileinfo,tile_index,0,&rthunder_videoram1[0x0000]); }
r814r815
131131
132132VIDEO_START( namcos86 )
133133{
134   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
135   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
136   bg_tilemap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
137   bg_tilemap[3] = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
134   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
135   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
136   bg_tilemap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
137   bg_tilemap[3] = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
138138
139139   tilemap_set_transparent_pen(bg_tilemap[0],7);
140140   tilemap_set_transparent_pen(bg_tilemap[1],7);
src/mame/video/suna8.c
r814r815
108108         0,
109109         ( (attr & 0x03) << 8 ) + code + tiles*0x400,
110110         (attr >> 2) & 0xf,
111         TILE_FLIPYX( (attr >> 6) & 3 ))
111         TILE_FLIPYX( (attr >> 6) & 3 ));
112112}
113113#endif
114114
r814r815
183183
184184#if TILEMAPS
185185   bg_tilemap = tilemap_create(   get_tile_info, tilemap_scan_cols,
186                        TILEMAP_TYPE_TRANSPARENT,
186                        TILEMAP_TYPE_PEN,
187187                        8,8,0x20*((suna8_text_dim > 0)?4:8),0x20);
188188
189189   tilemap_set_transparent_pen(bg_tilemap,15);
src/mame/video/vaportra.c
r814r815
157157
158158   /* Draw playfields */
159159   if (pri==0) {
160      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
160      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
161161      deco16_tilemap_3_draw(bitmap,cliprect,0,0);
162162      draw_sprites(machine, bitmap,cliprect,0);
163163      deco16_tilemap_2_draw(bitmap,cliprect,0,0);
164164   }
165165   else if (pri==1) {
166      deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
166      deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
167167      deco16_tilemap_4_draw(bitmap,cliprect,0,0);
168168      draw_sprites(machine, bitmap,cliprect,0);
169169      deco16_tilemap_2_draw(bitmap,cliprect,0,0);
170170   }
171171   else if (pri==2) {
172      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
172      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
173173      deco16_tilemap_2_draw(bitmap,cliprect,0,0);
174174      draw_sprites(machine, bitmap,cliprect,0);
175175      deco16_tilemap_3_draw(bitmap,cliprect,0,0);
176176   }
177177   else {
178      deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
178      deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
179179      deco16_tilemap_2_draw(bitmap,cliprect,0,0);
180180      draw_sprites(machine, bitmap,cliprect,0);
181181      deco16_tilemap_4_draw(bitmap,cliprect,0,0);
src/mame/video/nova2001.c
r814r815
135135   int code = videoram[tile_index];
136136   int color = colorram[tile_index] & 0x0f;
137137
138   SET_TILE_INFO(1, code, color, 0)
138   SET_TILE_INFO(1, code, color, 0);
139139}
140140
141141static TILE_GET_INFO( get_fg_tile_info )
r814r815
143143   int code = nova2001_videoram2[tile_index];
144144   int color = nova2001_colorram2[tile_index] & 0x0f;
145145
146   SET_TILE_INFO(0, code, color, 0)
146   SET_TILE_INFO(0, code, color, 0);
147147}
148148
149149VIDEO_START( nova2001 )
150150{
151151   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
152      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
152      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
153153
154154   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
155      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
155      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
156156
157157   tilemap_set_transparent_pen(fg_tilemap, 0);
158158}
src/mame/video/cps1.c
r814r815
982982
983983***************************************************************************/
984984
985static UINT32 tilemap0_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
985static TILEMAP_MAPPER( tilemap0_scan )
986986{
987987   /* logical (col,row) -> memory offset */
988988   return (row & 0x1f) + ((col & 0x3f) << 5) + ((row & 0x20) << 6);
989989}
990990
991static UINT32 tilemap1_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
991static TILEMAP_MAPPER( tilemap1_scan )
992992{
993993   /* logical (col,row) -> memory offset */
994994   return (row & 0x0f) + ((col & 0x3f) << 4) + ((row & 0x30) << 6);
995995}
996996
997static UINT32 tilemap2_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
997static TILEMAP_MAPPER( tilemap2_scan )
998998{
999999   /* logical (col,row) -> memory offset */
10001000   return (row & 0x07) + ((col & 0x3f) << 3) + ((row & 0x38) << 6);
r814r815
10261026         gfxset,
10271027         code + base,
10281028         (attr & 0x1f) + palette_basecolor[1],
1029         TILE_FLIPYX((attr & 0x60) >> 5) | TILE_SPLIT((attr & 0x0180) >> 7))
1029         TILE_FLIPYX((attr & 0x60) >> 5));
1030   tileinfo->group = (attr & 0x0180) >> 7;
10301031}
10311032
10321033static TILE_GET_INFO( get_tile1_info )
r814r815
10411042         2,
10421043         code + base,
10431044         (attr & 0x1f) + palette_basecolor[2],
1044         TILE_FLIPYX((attr & 0x60) >> 5) | TILE_SPLIT((attr & 0x0180) >> 7))
1045         TILE_FLIPYX((attr & 0x60) >> 5));
1046   tileinfo->group = (attr & 0x0180) >> 7;
10451047
10461048   if (code < startcode || code > endcode
10471049   /*
r814r815
10791081         3,
10801082         code + base,
10811083         (attr & 0x1f) + palette_basecolor[3],
1082         TILE_FLIPYX((attr & 0x60) >> 5) | TILE_SPLIT((attr & 0x0180) >> 7))
1084         TILE_FLIPYX((attr & 0x60) >> 5));
1085   tileinfo->group = (attr & 0x0180) >> 7;
10831086
10841087   if (code < startcode || code > endcode)
10851088   {
r814r815
11351138
11361139    machine_reset_cps(machine);
11371140
1138   cps1_bg_tilemap[0] = tilemap_create(get_tile0_info,tilemap0_scan,TILEMAP_TYPE_SPLIT, 8, 8,64,64);
1139   cps1_bg_tilemap[1] = tilemap_create(get_tile1_info,tilemap1_scan,TILEMAP_TYPE_SPLIT,16,16,64,64);
1140   cps1_bg_tilemap[2] = tilemap_create(get_tile2_info,tilemap2_scan,TILEMAP_TYPE_SPLIT,32,32,64,64);
1141   cps1_bg_tilemap[0] = tilemap_create(get_tile0_info,tilemap0_scan,TILEMAP_TYPE_PEN, 8, 8,64,64);
1142   cps1_bg_tilemap[1] = tilemap_create(get_tile1_info,tilemap1_scan,TILEMAP_TYPE_PEN,16,16,64,64);
1143   cps1_bg_tilemap[2] = tilemap_create(get_tile2_info,tilemap2_scan,TILEMAP_TYPE_PEN,32,32,64,64);
11411144
11421145   /* front masks will change at runtime to handle sprite occluding */
11431146   cps1_update_transmasks();
r814r815
17621765      case 1:
17631766      case 2:
17641767      case 3:
1765         tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_BACK,primask);
1768         tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER1,primask);
17661769         break;
17671770   }
17681771}
r814r815
17771780      case 1:
17781781      case 2:
17791782      case 3:
1780         tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_FRONT,1);
1783         tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER0,1);
17811784         break;
17821785   }
17831786}
src/mame/video/yunsun16.c
r814r815
4545#define PAGES_PER_TMAP_X   (0x4)
4646#define PAGES_PER_TMAP_Y   (0x4)
4747
48UINT32 yunsun16_tilemap_scan_pages(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
48static TILEMAP_MAPPER( yunsun16_tilemap_scan_pages )
4949{
5050   return   (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y * PAGES_PER_TMAP_X +
5151         (row % TILES_PER_PAGE_Y) +
r814r815
6262         TMAP_GFX,
6363         code,
6464         attr & 0xf,
65         (attr & 0x20) ? TILE_FLIPX : 0)
65         (attr & 0x20) ? TILE_FLIPX : 0);
6666}
6767
6868static TILE_GET_INFO( get_tile_info_1 )
r814r815
7373         TMAP_GFX,
7474         code,
7575         attr & 0xf,
76         (attr & 0x20) ? TILE_FLIPX : 0)
76         (attr & 0x20) ? TILE_FLIPX : 0);
7777}
7878
7979WRITE16_HANDLER( yunsun16_vram_0_w )
r814r815
102102VIDEO_START( yunsun16 )
103103{
104104   tilemap_0 = tilemap_create(   get_tile_info_0,yunsun16_tilemap_scan_pages,
105                        TILEMAP_TYPE_TRANSPARENT,
105                        TILEMAP_TYPE_PEN,
106106                        16,16,
107107                        TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
108108
109109   tilemap_1 = tilemap_create(   get_tile_info_1,yunsun16_tilemap_scan_pages,
110                        TILEMAP_TYPE_TRANSPARENT,
110                        TILEMAP_TYPE_PEN,
111111                        16,16,
112112                        TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
113113
r814r815
216216   if((*yunsun16_priority & 0x0c) == 4)
217217   {
218218      /* The color of the this layer's transparent pen goes below everything */
219      tilemap_draw(bitmap,cliprect,tilemap_0, TILEMAP_IGNORE_TRANSPARENCY, 0);
219      tilemap_draw(bitmap,cliprect,tilemap_0, TILEMAP_DRAW_OPAQUE, 0);
220220
221221      tilemap_draw(bitmap,cliprect,tilemap_0, 0, 1);
222222
r814r815
225225   else if((*yunsun16_priority & 0x0c) == 8)
226226   {
227227      /* The color of the this layer's transparent pen goes below everything */
228      tilemap_draw(bitmap,cliprect,tilemap_1, TILEMAP_IGNORE_TRANSPARENCY, 0);
228      tilemap_draw(bitmap,cliprect,tilemap_1, TILEMAP_DRAW_OPAQUE, 0);
229229
230230      tilemap_draw(bitmap,cliprect,tilemap_1, 0, 1);
231231
src/mame/video/mermaid.c
r814r815
123123   int sx = tile_index % 32;
124124   int color = (sx >= 26) ? 0 : 1;
125125
126   SET_TILE_INFO(2, code, color, 0)
126   SET_TILE_INFO(2, code, color, 0);
127127}
128128
129129static TILE_GET_INFO( get_fg_tile_info )
r814r815
136136   code |= rougien_gfxbank1 * 0x2800;
137137   code |= rougien_gfxbank2 * 0x2400;
138138
139   SET_TILE_INFO(0, code, color, flags)
139   SET_TILE_INFO(0, code, color, flags);
140140}
141141
142142VIDEO_START( mermaid )
143143{
144144   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
145      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
145      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
146146
147147   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
148      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
148      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
149149
150150   tilemap_set_scroll_cols(bg_tilemap, 32);
151151   tilemap_set_scroll_cols(fg_tilemap, 32);
src/mame/video/dcon.c
r814r815
8484         1,
8585         tile,
8686         color,
87         0)
87         0);
8888}
8989
9090static TILE_GET_INFO( get_fore_tile_info )
r814r815
9898         2,
9999         tile,
100100         color,
101         0)
101         0);
102102}
103103
104104static TILE_GET_INFO( get_mid_tile_info )
r814r815
112112         3,
113113         tile|dcon_gfx_bank_select,
114114         color,
115         0)
115         0);
116116}
117117
118118static TILE_GET_INFO( get_text_tile_info )
r814r815
126126         0,
127127         tile,
128128         color,
129         0)
129         0);
130130}
131131
132132VIDEO_START( dcon )
133133{
134   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
135   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
136   midground_layer =  tilemap_create(get_mid_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
137   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,64,32);
134   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
135   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
136   midground_layer =  tilemap_create(get_mid_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
137   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
138138
139139   tilemap_set_transparent_pen(midground_layer,15);
140140   tilemap_set_transparent_pen(foreground_layer,15);
src/mame/video/kickgoal.c
r814r815
1111   int tileno = kickgoal_fgram[tile_index*2] & 0x0fff;
1212   int color = kickgoal_fgram[tile_index*2+1] & 0x000f;
1313
14   SET_TILE_INFO(0,tileno + 0x7000,color + 0x00,0)
14   SET_TILE_INFO(0,tileno + 0x7000,color + 0x00,0);
1515}
1616
1717/* BG */
r814r815
2020   int tileno = kickgoal_bgram[tile_index*2] & 0x0fff;
2121   int color = kickgoal_bgram[tile_index*2+1] & 0x000f;
2222
23   SET_TILE_INFO(1,tileno + 0x1000,color + 0x10,0)
23   SET_TILE_INFO(1,tileno + 0x1000,color + 0x10,0);
2424}
2525
2626/* BG 2 */
r814r815
3434}
3535
3636
37static UINT32 tilemap_scan_kicksbg2( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
37static TILEMAP_MAPPER( tilemap_scan_kicksbg )
3838{
3939   /* logical (col,row) -> memory offset */
4040   return col*8 + (row & 0x7) + ((row & 0x3c) >> 3) * 0x200;
4141}
4242
43static UINT32 tilemap_scan_kicksbg( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
43static TILEMAP_MAPPER( tilemap_scan_kicksbg2 )
4444{
4545   /* logical (col,row) -> memory offset */
4646   return col*16 + (row & 0xf) + ((row & 0x70) >> 4) * 0x400;
4747}
4848
49static UINT32 tilemap_scan_kicksfg( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
49static TILEMAP_MAPPER( tilemap_scan_kicksfg )
5050{
5151   /* logical (col,row) -> memory offset */
5252   return col*32 + (row & 0x1f) + ((row & 0x20) >> 5) * 0x800;
r814r815
5555
5656VIDEO_START( kickgoal )
5757{
58   kickgoal_fgtm = tilemap_create(get_kickgoal_fg_tile_info,tilemap_scan_kicksfg,TILEMAP_TYPE_TRANSPARENT, 8, 16,64,64);
58   kickgoal_fgtm = tilemap_create(get_kickgoal_fg_tile_info,tilemap_scan_kicksfg,TILEMAP_TYPE_PEN, 8, 16,64,64);
5959      tilemap_set_transparent_pen(kickgoal_fgtm,15);
60   kickgoal_bgtm = tilemap_create(get_kickgoal_bg_tile_info,tilemap_scan_kicksbg,TILEMAP_TYPE_TRANSPARENT, 16, 32,64,64);
60   kickgoal_bgtm = tilemap_create(get_kickgoal_bg_tile_info,tilemap_scan_kicksbg,TILEMAP_TYPE_PEN, 16, 32,64,64);
6161      tilemap_set_transparent_pen(kickgoal_bgtm,15);
62   kickgoal_bg2tm = tilemap_create(get_kickgoal_bg2_tile_info,tilemap_scan_kicksbg2,TILEMAP_TYPE_OPAQUE, 32, 64,64,64);
62   kickgoal_bg2tm = tilemap_create(get_kickgoal_bg2_tile_info,tilemap_scan_kicksbg2,TILEMAP_TYPE_PEN, 32, 64,64,64);
6363}
6464
6565
r814r815
153153   int tileno = kickgoal_fgram[tile_index*2] & 0x0fff;
154154   int color = kickgoal_fgram[tile_index*2+1] & 0x000f;
155155
156   SET_TILE_INFO(0,tileno + 0x7000*2,color + 0x00,0)
156   SET_TILE_INFO(0,tileno + 0x7000*2,color + 0x00,0);
157157}
158158
159159/* BG */
r814r815
164164   int flipx = kickgoal_bgram[tile_index*2+1] & 0x0020;
165165   int flipy = kickgoal_bgram[tile_index*2+1] & 0x0040;
166166
167   SET_TILE_INFO(1,tileno + 0x0000,color + 0x10,(flipx ? TILE_FLIPX : 0) | (flipy ? TILE_FLIPY : 0))
167   SET_TILE_INFO(1,tileno + 0x0000,color + 0x10,(flipx ? TILE_FLIPX : 0) | (flipy ? TILE_FLIPY : 0));
168168}
169169
170170/* BG 2 */
r814r815
175175   int flipx = kickgoal_bg2ram[tile_index*2+1] & 0x0020;
176176   int flipy = kickgoal_bg2ram[tile_index*2+1] & 0x0040;
177177
178   SET_TILE_INFO(1,tileno + 0x2000,color + 0x20,(flipx ? TILE_FLIPX : 0) | (flipy ? TILE_FLIPY : 0))
178   SET_TILE_INFO(1,tileno + 0x2000,color + 0x20,(flipx ? TILE_FLIPX : 0) | (flipy ? TILE_FLIPY : 0));
179179}
180180
181181
182static UINT32 tilemap_scan_actionhwbg2( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
182static TILEMAP_MAPPER( tilemap_scan_actionhwbg2 )
183183{
184184   /* logical (col,row) -> memory offset */
185185   return col*16 + (row & 0xf) + ((row & 0x70) >> 4) * 0x400;
186186}
187187
188static UINT32 tilemap_scan_actionhwbg( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
188static TILEMAP_MAPPER( tilemap_scan_actionhwbg )
189189{
190190   /* logical (col,row) -> memory offset */
191191   return col*16 + (row & 0xf) + ((row & 0x70) >> 4) * 0x400;
192192}
193193
194static UINT32 tilemap_scan_actionhwfg( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
194static TILEMAP_MAPPER( tilemap_scan_actionhwfg )
195195{
196196   /* logical (col,row) -> memory offset */
197197   return col*32 + (row & 0x1f) + ((row & 0x20) >> 5) * 0x800;
r814r815
200200
201201VIDEO_START( actionhw )
202202{
203   kickgoal_fgtm  = tilemap_create(get_actionhw_fg_tile_info,tilemap_scan_actionhwfg,TILEMAP_TYPE_TRANSPARENT,  8, 8,64,64);
204   kickgoal_bgtm  = tilemap_create(get_actionhw_bg_tile_info,tilemap_scan_actionhwbg,TILEMAP_TYPE_TRANSPARENT, 16,16,64,64);
205   kickgoal_bg2tm = tilemap_create(get_actionhw_bg2_tile_info,tilemap_scan_actionhwbg2,TILEMAP_TYPE_OPAQUE,    16,16,64,64);
203   kickgoal_fgtm  = tilemap_create(get_actionhw_fg_tile_info,tilemap_scan_actionhwfg,TILEMAP_TYPE_PEN,  8, 8,64,64);
204   kickgoal_bgtm  = tilemap_create(get_actionhw_bg_tile_info,tilemap_scan_actionhwbg,TILEMAP_TYPE_PEN, 16,16,64,64);
205   kickgoal_bg2tm = tilemap_create(get_actionhw_bg2_tile_info,tilemap_scan_actionhwbg2,TILEMAP_TYPE_PEN,    16,16,64,64);
206206
207207   tilemap_set_transparent_pen(kickgoal_fgtm,15);
208208   tilemap_set_transparent_pen(kickgoal_bgtm,15);
src/mame/video/galaxian.c
r814r815
512512   state_save_register_global(background_blue);
513513}
514514
515static void video_start_common(running_machine *machine, UINT32 (*get_memory_offset)(UINT32,UINT32,UINT32,UINT32))
515static void video_start_common(running_machine *machine, tilemap_mapper_callback get_memory_offset)
516516{
517   bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
517   bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,TILEMAP_TYPE_PEN,8,8,32,32);
518518   tilemap_set_scrolldx(bg_tilemap, 0, -128);
519519
520520   tilemap_set_transparent_pen(bg_tilemap,0);
r814r815
813813VIDEO_START( rockclim )
814814{
815815   video_start_galaxian(machine);
816   rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
816   rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
817817   draw_background = rockclim_draw_background;
818818   modify_charcode = mooncrst_modify_charcode;
819819   modify_spritecode = rockclim_modify_spritecode;
r814r815
832832   code |= (bank << 4);
833833   color |= ((galaxian_attributesram[(x << 1) | 1] & 0x40) >> 3);
834834
835   SET_TILE_INFO(0, code, color, 0)
835   SET_TILE_INFO(0, code, color, 0);
836836}
837837
838838VIDEO_START( drivfrcg )
839839{
840   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
840   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
841841
842842   tilemap_set_transparent_pen(bg_tilemap,0);
843843   tilemap_set_scroll_cols(bg_tilemap, 32);
r814r815
875875
876876VIDEO_START( ad2083 )
877877{
878   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
878   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
879879
880880   tilemap_set_transparent_pen(bg_tilemap,0);
881881   tilemap_set_scroll_cols(bg_tilemap, 32);
r814r815
928928
929929   code |= (bank << 8);
930930
931   SET_TILE_INFO(0, code, color, 0)
931   SET_TILE_INFO(0, code, color, 0);
932932}
933933
934934VIDEO_START( racknrol )
935935{
936   bg_tilemap = tilemap_create(racknrol_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
936   bg_tilemap = tilemap_create(racknrol_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
937937
938938   tilemap_set_transparent_pen(bg_tilemap,0);
939939   tilemap_set_scroll_cols(bg_tilemap, 32);
r814r815
993993      modify_color(&color);
994994   }
995995
996   SET_TILE_INFO(0, code, color, 0)
996   SET_TILE_INFO(0, code, color, 0);
997997}
998998
999999VIDEO_START( dambustr )
r814r815
10181018
10191019   /* make a copy of the tilemap to emulate background priority */
10201020   dambustr_videoram2 = auto_malloc(0x0400);
1021   dambustr_tilemap2 = tilemap_create(dambustr_get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
1021   dambustr_tilemap2 = tilemap_create(dambustr_get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
10221022
10231023   tilemap_set_transparent_pen(dambustr_tilemap2,0);
10241024}
r814r815
20682068      modify_color(&color);
20692069   }
20702070
2071   SET_TILE_INFO(0, code, color, 0)
2071   SET_TILE_INFO(0, code, color, 0);
20722072}
20732073
20742074static TILE_GET_INFO( rockclim_get_tile_info )
20752075{
20762076   UINT16 code = rockclim_videoram[tile_index];
2077   SET_TILE_INFO(2, code, 0, 0)
2077   SET_TILE_INFO(2, code, 0, 0);
20782078}
20792079
20802080static void draw_bullets_common(running_machine *machine, mame_bitmap *bitmap)
src/mame/video/othldrby.c
r814r815
3030         1,
3131         vram[tile_index+1],
3232         attr & 0x7f,
33         0)
34   tileinfo->priority = (attr & 0x0600) >> 9;
33         0);
34   tileinfo->category = (attr & 0x0600) >> 9;
3535}
3636
3737static TILE_GET_INFO( get_tile_info0 )
r814r815
5959
6060VIDEO_START( othldrby )
6161{
62   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
63   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
64   bg_tilemap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
62   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
63   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
64   bg_tilemap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
6565
6666   vram = auto_malloc(VIDEORAM_SIZE * sizeof(vram[0]));
6767   buf_spriteram = auto_malloc(2*SPRITERAM_SIZE * sizeof(buf_spriteram[0]));
src/mame/video/bbusters.c
r814r815
3434static TILE_GET_INFO( get_bbuster_tile_info )
3535{
3636   UINT16 tile=videoram16[tile_index];
37   SET_TILE_INFO(0,tile&0xfff,tile>>12,0)
37   SET_TILE_INFO(0,tile&0xfff,tile>>12,0);
3838}
3939
4040static TILE_GET_INFO( get_pf1_tile_info )
4141{
4242   UINT16 tile=bbuster_pf1_data[tile_index];
43   SET_TILE_INFO(3,tile&0xfff,tile>>12,0)
43   SET_TILE_INFO(3,tile&0xfff,tile>>12,0);
4444}
4545
4646static TILE_GET_INFO( get_pf2_tile_info )
4747{
4848   UINT16 tile=bbuster_pf2_data[tile_index];
49   SET_TILE_INFO(4,tile&0xfff,tile>>12,0)
49   SET_TILE_INFO(4,tile&0xfff,tile>>12,0);
5050}
5151
5252WRITE16_HANDLER( bbuster_video_w )
r814r815
7171
7272VIDEO_START( bbuster )
7373{
74   fix_tilemap = tilemap_create(get_bbuster_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
75   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,128,32);
76   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,128,32);
74   fix_tilemap = tilemap_create(get_bbuster_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
75   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,128,32);
76   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,128,32);
7777
7878   tilemap_set_transparent_pen(pf1_tilemap, 15);
7979   tilemap_set_transparent_pen(fix_tilemap, 15);
r814r815
8181
8282VIDEO_START( mechatt )
8383{
84   fix_tilemap = tilemap_create(get_bbuster_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
85   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,256,32);
86   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,256,32);
84   fix_tilemap = tilemap_create(get_bbuster_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
85   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,256,32);
86   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,256,32);
8787
8888   tilemap_set_transparent_pen(pf1_tilemap, 15);
8989   tilemap_set_transparent_pen(fix_tilemap, 15);
src/mame/video/gstriker.c
r814r815
4343   tileno = data & 0xFFF;
4444   pal =   (data >> 12) & 0xF;
4545
46   SET_TILE_INFO(VS920A_cur_chip->gfx_region, tileno, VS920A_cur_chip->pal_base + pal, 0)
46   SET_TILE_INFO(VS920A_cur_chip->gfx_region, tileno, VS920A_cur_chip->pal_base + pal, 0);
4747}
4848
4949WRITE16_HANDLER( VS920A_0_vram_w )
r814r815
6767
6868   for (i=0;i<numchips;i++)
6969   {
70      VS920A[i].tmap = tilemap_create(VS920A_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
70      VS920A[i].tmap = tilemap_create(VS920A_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
7171
7272      tilemap_set_transparent_pen(VS920A[i].tmap, 0);
7373   }
r814r815
158158   pal = (data >> 12) & 0xF;
159159   bankno = (data >> 9) & 0x7;
160160
161   SET_TILE_INFO(MB60553->gfx_region, tileno + MB60553_cur_chip->bank[bankno] * 0x200, pal + MB60553->pal_base, 0)
161   SET_TILE_INFO(MB60553->gfx_region, tileno + MB60553_cur_chip->bank[bankno] * 0x200, pal + MB60553->pal_base, 0);
162162}
163163
164164static void MB60553_reg_written(int numchip, int num_reg)
r814r815
210210}
211211
212212/* twc94 has the tilemap made of 2 pages .. it needs this */
213UINT32 twc94_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
213static TILEMAP_MAPPER( twc94_scan )
214214{
215215   /* logical (col,row) -> memory offset */
216216   return (row*64) + (col&63) + ((col&64)<<6);
r814r815
225225
226226   for (i=0;i<numchips;i++)
227227   {
228      MB60553[i].tmap = tilemap_create(MB60553_get_tile_info,twc94_scan,TILEMAP_TYPE_TRANSPARENT, 16,16,128,64);
228      MB60553[i].tmap = tilemap_create(MB60553_get_tile_info,twc94_scan,TILEMAP_TYPE_PEN, 16,16,128,64);
229229
230230      tilemap_set_transparent_pen(MB60553[i].tmap, 0);
231231   }
src/mame/video/hyprduel.c
r814r815
148148   {
149149      int _code = code & 0x000f;
150150      tileinfo->pen_data = empty_tiles + _code*16*16;
151      tileinfo->pal_data = &machine->remapped_colortable[(((code & 0x0ff0) ^ 0x0f0) + 0x1000)];
151      tileinfo->palette_base = ((code & 0x0ff0) ^ 0x0f0) + 0x1000;
152152      tileinfo->flags = 0;
153153   }
154154   else
r814r815
156156            0,
157157            (tile & 0xfffff) + (code & 0xf),
158158            (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100,
159            TILE_FLIPXY((code & 0x6000) >> 13))
159            TILE_FLIPXY((code & 0x6000) >> 13));
160160}
161161
162162
r814r815
184184   {
185185      int _code = code & 0x000f;
186186      tileinfo->pen_data = empty_tiles + _code*16*16;
187      tileinfo->pal_data = &machine->remapped_colortable[(((code & 0x0ff0) ^ 0x0f0) + 0x1000)];
187      tileinfo->palette_base = ((code & 0x0ff0) ^ 0x0f0) + 0x1000;
188188      tileinfo->flags = 0;
189189   }
190190   else if ((tile & 0x00f00000)==0x00f00000)   /* draw tile as 8bpp */
r814r815
192192            1,
193193            (tile & 0xfffff) + 2*(code & 0xf),
194194            ((tile & 0x0f000000) >> 24) + 0x10,
195            TILE_FLIPXY((code & 0x6000) >> 13))
195            TILE_FLIPXY((code & 0x6000) >> 13));
196196   else
197197      SET_TILE_INFO(
198198            0,
199199            (tile & 0xfffff) + (code & 0xf),
200200            (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100,
201            TILE_FLIPXY((code & 0x6000) >> 13))
201            TILE_FLIPXY((code & 0x6000) >> 13));
202202}
203203
204204/* 16x16x4 or 16x16x8 tiles. It's the tile's color that decides: if its low 4
r814r815
225225   {
226226      int _code = code & 0x000f;
227227      tileinfo->pen_data = empty_tiles + _code*16*16;
228      tileinfo->pal_data = &machine->remapped_colortable[(((code & 0x0ff0) ^ 0x0f0) + 0x1000)];
228      tileinfo->palette_base = ((code & 0x0ff0) ^ 0x0f0) + 0x1000;
229229      tileinfo->flags = 0;
230230   }
231231   else if ((tile & 0x00f00000)==0x00f00000)   /* draw tile as 8bpp */
r814r815
233233            3,
234234            (tile & 0xfffff) + 8*(code & 0xf),
235235            ((tile & 0x0f000000) >> 24) + 0x10,
236            TILE_FLIPXY((code & 0x6000) >> 13))
236            TILE_FLIPXY((code & 0x6000) >> 13));
237237   else
238238      SET_TILE_INFO(
239239            2,
240240            (tile & 0xfffff) + 4*(code & 0xf),
241241            (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100,
242            TILE_FLIPXY((code & 0x6000) >> 13))
242            TILE_FLIPXY((code & 0x6000) >> 13));
243243}
244244
245245
r814r815
317317   hypr_tiletable_old = auto_malloc(hyprduel_tiletable_size);
318318   dirtyindex = auto_malloc(hyprduel_tiletable_size/4);
319319
320   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
321   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
322   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
320   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
321   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
322   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
323323
324324   tilemap_set_transparent_pen(bg_tilemap[0],0);
325325   tilemap_set_transparent_pen(bg_tilemap[1],0);
src/mame/video/flstory.c
r814r815
1919   int code = videoram[tile_index*2];
2020   int attr = videoram[tile_index*2+1];
2121   int tile_number = code + ((attr & 0xc0) << 2) + 0x400 + 0x800 * char_bank;
22   int flags = TILE_FLIPYX((attr & 0x18) >> 3) | TILE_SPLIT((attr & 0x20) >> 5);
23   tileinfo->priority = (attr & 0x20) >> 5;
22   int flags = TILE_FLIPYX((attr & 0x18) >> 3);
23   tileinfo->category = (attr & 0x20) >> 5;
24   tileinfo->group = (attr & 0x20) >> 5;
2425   SET_TILE_INFO(
2526         0,
2627         tile_number,
2728         attr & 0x0f,
28         flags)
29         flags);
2930}
3031
3132static TILE_GET_INFO( victnine_get_tile_info )
r814r815
3940         0,
4041         tile_number,
4142         attr & 0x07,
42         flags)
43         flags);
4344}
4445
4546
4647VIDEO_START( flstory )
4748{
48   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,32,32 );
49   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
4950//  tilemap_set_transparent_pen( bg_tilemap,15 );
5051   tilemap_set_transmask(bg_tilemap,0,0x3fff,0xc000); /* split type 0 has pens 0-13 transparent in front half */
5152   tilemap_set_transmask(bg_tilemap,1,0x8000,0x7fff); /* split type 1 has pen 15 transparent in front half */
r814r815
5859
5960VIDEO_START( victnine )
6061{
61   bg_tilemap = tilemap_create( victnine_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
62   bg_tilemap = tilemap_create( victnine_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
6263   tilemap_set_scroll_cols(bg_tilemap,32);
6364
6465   paletteram = auto_malloc(0x200);
r814r815
186187
187188VIDEO_UPDATE( flstory )
188189{
189   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_BACK,0);
190   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_BACK,0);
190   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_LAYER1,0);
191   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_LAYER1,0);
191192   flstory_draw_sprites(machine,bitmap,cliprect,0x00);
192   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_FRONT,0);
193   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_LAYER0,0);
193194   flstory_draw_sprites(machine,bitmap,cliprect,0x80);
194   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_FRONT,0);
195   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_LAYER0,0);
195196   return 0;
196197}
197198
src/mame/video/suprslam.c
r814r815
111111   tileno += screen_bank;
112112   colour = colour >> 12;
113113
114   SET_TILE_INFO(0,tileno,colour,0)
114   SET_TILE_INFO(0,tileno,colour,0);
115115}
116116
117117
r814r815
133133   tileno += bg_bank;
134134   colour = colour >> 12;
135135
136   SET_TILE_INFO(2,tileno,colour,0)
136   SET_TILE_INFO(2,tileno,colour,0);
137137}
138138
139139
140140VIDEO_START( suprslam )
141141{
142   suprslam_bg_tilemap = tilemap_create(get_suprslam_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 16, 16,64,64);
143   suprslam_screen_tilemap = tilemap_create(get_suprslam_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
142   suprslam_bg_tilemap = tilemap_create(get_suprslam_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,64,64);
143   suprslam_screen_tilemap = tilemap_create(get_suprslam_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
144144
145145   K053936_wraparound_enable(0, 1);
146146   K053936_set_offset(0, -45, -21);
src/mame/video/strnskil.c
r814r815
7171   int code = videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3);
7272   int color = (attr & 0x1f) | ((attr & 0x80) >> 2);
7373
74   SET_TILE_INFO(0, code, color, 0)
74   SET_TILE_INFO(0, code, color, 0);
7575}
7676
7777VIDEO_START( strnskil )
7878{
7979   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
80      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
80      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
8181
8282   tilemap_set_scroll_rows(bg_tilemap, 32);
8383}
src/mame/video/atetris.c
r814r815
4949
5050VIDEO_START( atetris )
5151{
52   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
52   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
5353}
5454
5555
src/mame/video/shaolins.c
r814r815
142142   int color = (attr & 0x0f) + 16 * palettebank;
143143   int flags = (attr & 0x20) ? TILE_FLIPY : 0;
144144
145   SET_TILE_INFO(0, code, color, flags)
145   SET_TILE_INFO(0, code, color, flags);
146146}
147147
148148VIDEO_START( shaolins )
149149{
150150   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
151      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
151      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
152152
153153   tilemap_set_scroll_cols(bg_tilemap, 32);
154154}
src/mame/video/sshangha.c
r814r815
155155static TILE_GET_INFO( get_pf2_tile_info )
156156{
157157   UINT16 tile=sshangha_pf2_data[tile_index];
158   SET_TILE_INFO(1,(tile&0xfff)|sshangha_pf2_bank,(tile>>12)|32,0)
158   SET_TILE_INFO(1,(tile&0xfff)|sshangha_pf2_bank,(tile>>12)|32,0);
159159}
160160
161161static TILE_GET_INFO( get_pf1_16x16_tile_info )
162162{
163163   UINT16 tile=sshangha_pf1_data[tile_index];
164   SET_TILE_INFO(1,(tile&0xfff)|sshangha_pf1_bank,tile>>12,0)
164   SET_TILE_INFO(1,(tile&0xfff)|sshangha_pf1_bank,tile>>12,0);
165165}
166166
167167static TILE_GET_INFO( get_pf1_8x8_tile_info )
168168{
169169   UINT16 tile=sshangha_pf1_data[tile_index];
170   SET_TILE_INFO(0,(tile&0xfff)|sshangha_pf1_bank,tile>>12,0)
170   SET_TILE_INFO(0,(tile&0xfff)|sshangha_pf1_bank,tile>>12,0);
171171}
172172
173173VIDEO_START( sshangha )
174174{
175   pf1_8x8_tilemap   = tilemap_create(get_pf1_8x8_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
176   pf1_16x16_tilemap = tilemap_create(get_pf1_16x16_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
177   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,    TILEMAP_TYPE_OPAQUE,     16,16,32,32);
175   pf1_8x8_tilemap   = tilemap_create(get_pf1_8x8_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
176   pf1_16x16_tilemap = tilemap_create(get_pf1_16x16_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
177   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,    TILEMAP_TYPE_PEN,     16,16,32,32);
178178
179179   tilemap_set_transparent_pen(pf1_8x8_tilemap,0);
180180   tilemap_set_transparent_pen(pf1_16x16_tilemap,0);
src/mame/video/kyugo.c
r814r815
3737   SET_TILE_INFO(0,
3838              code,
3939              2*color_codes[code >> 3] + fgcolor,
40              0)
40              0);
4141}
4242
4343
r814r815
4848   SET_TILE_INFO(1,
4949              code | ((attr & 0x03) << 8),
5050              (attr >> 4) | (bgpalbank << 4),
51              TILE_FLIPYX((attr & 0x0c) >> 2))
51              TILE_FLIPYX((attr & 0x0c) >> 2));
5252}
5353
5454
r814r815
6363   color_codes = memory_region(REGION_PROMS) + 0x300;
6464
6565
66   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
67   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8,8, 64,32);
66   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
67   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,8, 64,32);
6868
6969   tilemap_set_transparent_pen(fg_tilemap,0);
7070
src/mame/video/segaic24.c
r814r815
102102static TILE_GET_INFO( sys24_tile_info_0s )
103103{
104104   UINT16 val = sys24_tile_ram[tile_index];
105   tileinfo->priority = (val & 0x8000) != 0;
105   tileinfo->category = (val & 0x8000) != 0;
106106   SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0);
107107}
108108
109109static TILE_GET_INFO( sys24_tile_info_0w )
110110{
111111   UINT16 val = sys24_tile_ram[tile_index|0x1000];
112   tileinfo->priority = (val & 0x8000) != 0;
112   tileinfo->category = (val & 0x8000) != 0;
113113   SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0);
114114}
115115
116116static TILE_GET_INFO( sys24_tile_info_1s )
117117{
118118   UINT16 val = sys24_tile_ram[tile_index|0x2000];
119   tileinfo->priority = (val & 0x8000) != 0;
119   tileinfo->category = (val & 0x8000) != 0;
120120   SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0);
121121}
122122
123123static TILE_GET_INFO( sys24_tile_info_1w )
124124{
125125   UINT16 val = sys24_tile_ram[tile_index|0x3000];
126   tileinfo->priority = (val & 0x8000) != 0;
126   tileinfo->category = (val & 0x8000) != 0;
127127   SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0);
128128}
129129
r814r815
148148
149149   sys24_char_dirtymap = auto_malloc(SYS24_TILES);
150150
151   sys24_tile_layer[0] = tilemap_create(sys24_tile_info_0s, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
152   sys24_tile_layer[1] = tilemap_create(sys24_tile_info_0w, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
153   sys24_tile_layer[2] = tilemap_create(sys24_tile_info_1s, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
154   sys24_tile_layer[3] = tilemap_create(sys24_tile_info_1w, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
151   sys24_tile_layer[0] = tilemap_create(sys24_tile_info_0s, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
152   sys24_tile_layer[1] = tilemap_create(sys24_tile_info_0w, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
153   sys24_tile_layer[2] = tilemap_create(sys24_tile_info_1s, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
154   sys24_tile_layer[3] = tilemap_create(sys24_tile_info_1w, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
155155
156156   tilemap_set_transparent_pen(sys24_tile_layer[0], 0);
157157   tilemap_set_transparent_pen(sys24_tile_layer[1], 0);
r814r815
208208   UINT8        *prib = priority_bitmap->base;
209209   UINT16       *dest = dm->base;
210210
211   tpri |= TILE_FLAG_FG_OPAQUE;
211   tpri |= TILEMAP_PIXEL_LAYER0;
212212
213213   dest += yy1*dm->rowpixels + xx1;
214214   prib += yy1*priority_bitmap->rowpixels + xx1;
r814r815
342342   UINT16       *dest = dm->base;
343343   pen_t        *pens   = machine->pens;
344344
345   tpri |= TILE_FLAG_FG_OPAQUE;
345   tpri |= TILEMAP_PIXEL_LAYER0;
346346
347347   dest += yy1*dm->rowpixels + xx1;
348348   mask += yy1*4;
r814r815
530530         draw = sys24_tile_draw_rect;
531531
532532      bm = tilemap_get_pixmap(sys24_tile_layer[layer]);
533      tm = tilemap_get_transparency_bitmap(sys24_tile_layer[layer]);
533      tm = tilemap_get_flagsmap(sys24_tile_layer[layer]);
534534
535535      if(hscr & 0x8000) {
536536         int y;
src/mame/video/popeye.c
r814r815
256256   int code = videoram[tile_index];
257257   int color = colorram[tile_index] & 0x0f;
258258
259   SET_TILE_INFO(0, code, color, 0)
259   SET_TILE_INFO(0, code, color, 0);
260260}
261261
262262VIDEO_START( skyskipr )
r814r815
268268   bitmap_type = TYPE_SKYSKIPR;
269269
270270   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
271      TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32);
271      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
272272
273273   tilemap_set_transparent_pen(fg_tilemap, 0);
274274}
r814r815
282282   bitmap_type = TYPE_POPEYE;
283283
284284   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
285      TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32);
285      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
286286
287287   tilemap_set_transparent_pen(fg_tilemap, 0);
288288}
src/mame/video/4enraya.c
r814r815
2424      0,
2525      code,
2626      0,
27      0)
27      0);
2828}
2929
3030VIDEO_START( 4enraya )
3131{
32   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
32   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
3333   video_start_generic(machine);
3434}
3535
src/mame/video/blockade.c
r814r815
1919{
2020   int code = videoram[tile_index];
2121
22   SET_TILE_INFO(0, code, 0, 0)
22   SET_TILE_INFO(0, code, 0, 0);
2323}
2424
2525VIDEO_START( blockade )
2626{
2727   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
28      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
28      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
2929}
3030
3131VIDEO_UPDATE( blockade )
src/mame/video/compgolf.c
r814r815
5151static TILE_GET_INFO( get_text_info )
5252{
5353   tile_index<<=1;
54   SET_TILE_INFO(2, videoram[tile_index+1]|(videoram[tile_index]<<8), videoram[tile_index]>>2, 0)
54   SET_TILE_INFO(2, videoram[tile_index+1]|(videoram[tile_index]<<8), videoram[tile_index]>>2, 0);
5555}
5656
57static UINT32 back_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
57static TILEMAP_MAPPER( back_scan )
5858{
5959   /* logical (col,row) -> memory offset */
6060   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5);
r814r815
6666   int code = compgolf_bg_ram[tile_index*2+1] + ((attr & 1) << 8);
6767   int color = (attr & 0x3e) >> 1;
6868
69   SET_TILE_INFO(1,code,color,0)
69   SET_TILE_INFO(1,code,color,0);
7070}
7171
7272VIDEO_START( compgolf )
7373{
74   background_tilemap = tilemap_create(get_back_info,back_scan,TILEMAP_TYPE_OPAQUE, 16, 16, 32, 32);
75   text_tilemap = tilemap_create(get_text_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
74   background_tilemap = tilemap_create(get_back_info,back_scan,TILEMAP_TYPE_PEN, 16, 16, 32, 32);
75   text_tilemap = tilemap_create(get_text_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 32, 32);
7676
7777   tilemap_set_transparent_pen(text_tilemap,0);
7878}
src/mame/video/lordgun.c
r814r815
6666{
6767   UINT16 attr = lordgun_vram_0[ tile_index * 2 + 0 ];
6868   UINT16 code = lordgun_vram_0[ tile_index * 2 + 1 ];
69   SET_TILE_INFO( 1, code, (attr & 0x0030) >> 4, TILE_FLIPXY(attr >> 14))
69   SET_TILE_INFO( 1, code, (attr & 0x0030) >> 4, TILE_FLIPXY(attr >> 14));
7070}
7171
7272static TILE_GET_INFO( get_tile_info_1 )
7373{
7474   UINT16 attr = lordgun_vram_1[ tile_index * 2 + 0 ];
7575   UINT16 code = lordgun_vram_1[ tile_index * 2 + 1 ];
76   SET_TILE_INFO( 2, code, (attr & 0x0070) >> 4, TILE_FLIPXY(attr >> 14))
76   SET_TILE_INFO( 2, code, (attr & 0x0070) >> 4, TILE_FLIPXY(attr >> 14));
7777}
7878
7979static TILE_GET_INFO( get_tile_info_2 )
8080{
8181   UINT16 attr = lordgun_vram_2[ tile_index * 2 + 0 ];
8282   UINT16 code = lordgun_vram_2[ tile_index * 2 + 1 ];
83   SET_TILE_INFO( 3, code, (attr & 0x0300) >> 8, TILE_FLIPXY(attr >> 14))
83   SET_TILE_INFO( 3, code, (attr & 0x0300) >> 8, TILE_FLIPXY(attr >> 14));
8484}
8585
8686static TILE_GET_INFO( get_tile_info_3 )
8787{
8888   UINT16 attr = lordgun_vram_3[ tile_index * 2 + 0 ];
8989   UINT16 code = lordgun_vram_3[ tile_index * 2 + 1 ];
90   SET_TILE_INFO( 4, code, (attr & 0x00f0) >> 4, TILE_FLIPXY(attr >> 14))
90   SET_TILE_INFO( 4, code, (attr & 0x00f0) >> 4, TILE_FLIPXY(attr >> 14));
9191}
9292
9393WRITE16_HANDLER( lordgun_vram_0_w )
r814r815
123123VIDEO_START( lordgun )
124124{
125125   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
126                        TILEMAP_TYPE_TRANSPARENT, 8,8, 0x100, 0x40 );
126                        TILEMAP_TYPE_PEN, 8,8, 0x100, 0x40 );
127127
128128   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
129                        TILEMAP_TYPE_TRANSPARENT, 16,16, 0x80,0x20 );
129                        TILEMAP_TYPE_PEN, 16,16, 0x80,0x20 );
130130
131131   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
132                        TILEMAP_TYPE_TRANSPARENT, 32,32, 0x40,0x40 );
132                        TILEMAP_TYPE_PEN, 32,32, 0x40,0x40 );
133133
134134   tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
135                        TILEMAP_TYPE_TRANSPARENT, 8,8, 0x40,0x20 );
135                        TILEMAP_TYPE_PEN, 8,8, 0x40,0x20 );
136136
137137   tilemap_set_scroll_rows(tilemap_0,1);
138138   tilemap_set_scroll_cols(tilemap_0,1);
src/mame/video/pushman.c
r814r815
1010
1111***************************************************************************/
1212
13static UINT32 background_scan_rows(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
13static TILEMAP_MAPPER( background_scan_rows )
1414{
1515   /* logical (col,row) -> memory offset */
1616   return ((col & 0x7)) + ((7-(row & 0x7)) << 3) + ((col & 0x78) <<3) + ((0x38-(row&0x38))<<7);
r814r815
2626         2,
2727         (tile&0xff)|((tile&0x4000)>>6),
2828         (tile>>8)&0xf,
29         (tile&0x2000)?TILE_FLIPX:0)
29         (tile&0x2000)?TILE_FLIPX:0);
3030}
3131
3232static TILE_GET_INFO( get_text_tile_info )
r814r815
3636         0,
3737         (tile&0xff)|((tile&0xc000)>>6)|((tile&0x2000)>>3),
3838         (tile>>8)&0xf,
39         (tile&0x1000)?TILE_FLIPY:0)   /* not used? from Tiger Road */
39         (tile&0x1000)?TILE_FLIPY:0);   /* not used? from Tiger Road */
4040}
4141
4242
r814r815
4949
5050VIDEO_START( pushman )
5151{
52   bg_tilemap = tilemap_create(get_back_tile_info,background_scan_rows,TILEMAP_TYPE_OPAQUE,     32,32,128,64);
53   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,   TILEMAP_TYPE_TRANSPARENT, 8, 8, 32,32);
52   bg_tilemap = tilemap_create(get_back_tile_info,background_scan_rows,TILEMAP_TYPE_PEN,     32,32,128,64);
53   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,   TILEMAP_TYPE_PEN, 8, 8, 32,32);
5454
5555   tilemap_set_transparent_pen(tx_tilemap,3);
5656}
src/mame/video/lemmings.c
r814r815
8888         2,
8989         tile&0x7ff,
9090         (tile>>12)&0xf,
91         0)
91         0);
9292}
9393
9494VIDEO_START( lemmings )
9595{
9696   bitmap0 = auto_bitmap_alloc(2048,256,machine->screen[0].format);
97   vram_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
97   vram_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
9898
9999   vram_buffer = (UINT8*)auto_malloc(2048*64); /* 64 bytes per VRAM character */
100100   vram_dirty = (UINT8*)auto_malloc(2048);
src/mame/video/zerozone.c
r814r815
3333
3434   if (zerozone_videoram[tile_index] & 0x0800) tileno += zerozone_tilebank * 0x800;
3535
36   SET_TILE_INFO(0,tileno,colour>>12,0)
36   SET_TILE_INFO(0,tileno,colour>>12,0);
3737}
3838
3939VIDEO_START( zerozone )
4040{
4141   // i'm not 100% sure it should be opaque, pink title screen looks strange in las vegas girls
4242   // but if its transparent other things look incorrect
43   zerozone_tilemap = tilemap_create(get_zerozone_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,      8, 8, 64,32);
43   zerozone_tilemap = tilemap_create(get_zerozone_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,      8, 8, 64,32);
4444}
4545
4646VIDEO_UPDATE( zerozone )
src/mame/video/espial.c
r814r815
8787   SET_TILE_INFO(0,
8888              code | ((attr & 0x03) << 8),
8989              col & 0x3f,
90              TILE_FLIPYX(attr >> 2))
90              TILE_FLIPYX(attr >> 2));
9191}
9292
9393
r814r815
100100
101101VIDEO_START( espial )
102102{
103   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
103   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
104104
105105   tilemap_set_scroll_cols(bg_tilemap, 32);
106106}
r814r815
108108VIDEO_START( netwars )
109109{
110110   /* Net Wars has a tile map that's twice as big as Espial's */
111   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,64);
111   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,64);
112112
113113   tilemap_set_scroll_cols(bg_tilemap, 32);
114114   tilemap_set_scrolldy(bg_tilemap, 0, 0x100);
src/mame/video/hyperspt.c
r814r815
100100   int color = colorram[tile_index] & 0x0f;
101101   int flags = ((colorram[tile_index] & 0x10) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x20) ? TILE_FLIPY : 0);
102102
103   SET_TILE_INFO(0, code, color, flags)
103   SET_TILE_INFO(0, code, color, flags);
104104}
105105
106106VIDEO_START( hyperspt )
107107{
108108   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
109      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
109      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
110110
111111   tilemap_set_scroll_rows(bg_tilemap, 32);
112112}
r814r815
177177   int color = colorram[tile_index] & 0x0f;
178178   int flags = (colorram[tile_index] & 0x10) ? TILE_FLIPX : 0;
179179
180   SET_TILE_INFO(0, code, color, flags)
180   SET_TILE_INFO(0, code, color, flags);
181181}
182182
183183VIDEO_START( roadf )
184184{
185185   bg_tilemap = tilemap_create(roadf_get_bg_tile_info, tilemap_scan_rows,
186      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
186      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
187187
188188   tilemap_set_scroll_rows(bg_tilemap, 32);
189189}
src/mame/video/tiamc1.c
r814r815
126126   decodechar(machine->gfx[0], code, tiamc1_charram,
127127         machine->drv->gfxdecodeinfo[0].gfxlayout);
128128
129   SET_TILE_INFO(0, code, 0, 0)
129   SET_TILE_INFO(0, code, 0, 0);
130130}
131131
132132static TILE_GET_INFO( get_bg2_tile_info )
r814r815
136136   decodechar(machine->gfx[0], code, tiamc1_charram,
137137         machine->drv->gfxdecodeinfo[0].gfxlayout);
138138
139   SET_TILE_INFO(0, code, 0, 0)
139   SET_TILE_INFO(0, code, 0, 0);
140140}
141141
142142VIDEO_START( tiamc1 )
143143{
144144   bg_tilemap1 = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,
145      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
145      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
146146
147147   bg_tilemap2 = tilemap_create(get_bg2_tile_info, tilemap_scan_rows,
148      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
148      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
149149
150150   tiamc1_bg_vshift = 0;
151151   tiamc1_bg_hshift = 0;
src/mame/video/toaplan1.c
r814r815
194194         0,
195195         tile_number,
196196         color,
197         0)
198   if (pf1_tilevram16[2*tile_index+1] & 0x8000) tileinfo->priority = 0;
199   else tileinfo->priority = (attrib & 0xf000) >> 12;
197         0);
198   if (pf1_tilevram16[2*tile_index+1] & 0x8000) tileinfo->category = 0;
199   else tileinfo->category = (attrib & 0xf000) >> 12;
200200}
201201
202202static TILE_GET_INFO( get_pf2_tile_info )
r814r815
210210         0,
211211         tile_number,
212212         color,
213         0)
214   if (pf2_tilevram16[2*tile_index+1] & 0x8000) tileinfo->priority = 0;
215   else tileinfo->priority = (attrib & 0xf000) >> 12;
213         0);
214   if (pf2_tilevram16[2*tile_index+1] & 0x8000) tileinfo->category = 0;
215   else tileinfo->category = (attrib & 0xf000) >> 12;
216216}
217217
218218static TILE_GET_INFO( get_pf3_tile_info )
r814r815
226226         0,
227227         tile_number,
228228         color,
229         0)
230   if (pf3_tilevram16[2*tile_index+1] & 0x8000) tileinfo->priority = 0;
231   else tileinfo->priority = (attrib & 0xf000) >> 12;
229         0);
230   if (pf3_tilevram16[2*tile_index+1] & 0x8000) tileinfo->category = 0;
231   else tileinfo->category = (attrib & 0xf000) >> 12;
232232}
233233
234234static TILE_GET_INFO( get_pf4_tile_info )
r814r815
242242         0,
243243         tile_number,
244244         color,
245         0)
246   if (pf4_tilevram16[2*tile_index+1] & 0x8000) tileinfo->priority = 0;
247   else tileinfo->priority = (attrib & 0xf000) >> 12;
245         0);
246   if (pf4_tilevram16[2*tile_index+1] & 0x8000) tileinfo->category = 0;
247   else tileinfo->category = (attrib & 0xf000) >> 12;
248248}
249249
250250/***************************************************************************
r814r815
255255
256256static void toaplan1_create_tilemaps(void)
257257{
258   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
259   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
260   pf3_tilemap = tilemap_create(get_pf3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
261   pf4_tilemap = tilemap_create(get_pf4_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
258   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
259   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
260   pf3_tilemap = tilemap_create(get_pf3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
261   pf4_tilemap = tilemap_create(get_pf4_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
262262
263263   tilemap_set_transparent_pen(pf1_tilemap,0);
264264   tilemap_set_transparent_pen(pf2_tilemap,0);
r814r815
11531153
11541154   fillbitmap(bitmap,machine->pens[0],cliprect);
11551155
1156   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_IGNORE_TRANSPARENCY | 0,0);
1157   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_IGNORE_TRANSPARENCY | 1,0);
1156   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | 0,0);
1157   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | 1,0);
11581158
11591159   for (priority = 1; priority < 16; priority++)
11601160   {
r814r815
11781178   fillbitmap(priority_bitmap,0,cliprect);
11791179   fillbitmap(bitmap,machine->pens[0x120],cliprect);
11801180
1181   tilemap_draw(bitmap,cliprect,pf4_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
1181   tilemap_draw(bitmap,cliprect,pf4_tilemap,TILEMAP_DRAW_OPAQUE,0);
11821182   for (priority = 8; priority < 16; priority++)
1183      tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_IGNORE_TRANSPARENCY | priority,0);
1183      tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | priority,0);
11841184
11851185   for (priority = 1; priority < 16; priority++)
11861186   {
r814r815
12051205   fillbitmap(priority_bitmap,0,cliprect);
12061206   fillbitmap(bitmap,machine->pens[0x120],cliprect);
12071207
1208   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_IGNORE_TRANSPARENCY | 0,0);
1209   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_IGNORE_TRANSPARENCY | 1,0);
1208   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | 0,0);
1209   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | 1,0);
12101210
12111211   for (priority = 1; priority < 16; priority++)
12121212   {
src/mame/video/segag80r.c
r814r815
172172static TILE_GET_INFO( spaceod_get_tile_info )
173173{
174174   int code = memory_region(REGION_GFX2)[tile_index + 0x1000 * (spaceod_bg_control >> 6)];
175   SET_TILE_INFO(1, code + 0x100 * ((spaceod_bg_control >> 2) & 1), 0, 0)
175   SET_TILE_INFO(1, code + 0x100 * ((spaceod_bg_control >> 2) & 1), 0, 0);
176176}
177177
178178
179static UINT32 spaceod_scan_rows(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
179static TILEMAP_MAPPER( spaceod_scan_rows )
180180{
181181   /* this works for both horizontal and vertical tilemaps */
182182   /* which are 4 32x32 sections */
r814r815
187187static TILE_GET_INFO( bg_get_tile_info )
188188{
189189   int code = memory_region(REGION_GFX2)[tile_index];
190   SET_TILE_INFO(1, code + 0x100 * bg_char_bank, code >> 4, 0)
190   SET_TILE_INFO(1, code + 0x100 * bg_char_bank, code >> 4, 0);
191191}
192192
193193
r814r815
227227      /* and one vertically scrolling */
228228      case G80_BACKGROUND_SPACEOD:
229229         spaceod_bg_init_palette(machine);
230         spaceod_bg_htilemap = tilemap_create(spaceod_get_tile_info, spaceod_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 128,32);
231         spaceod_bg_vtilemap = tilemap_create(spaceod_get_tile_info, spaceod_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,128);
230         spaceod_bg_htilemap = tilemap_create(spaceod_get_tile_info, spaceod_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,32);
231         spaceod_bg_vtilemap = tilemap_create(spaceod_get_tile_info, spaceod_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,128);
232232         break;
233233
234234      /* background tilemap is effectively 1 screen x n screens */
235235      case G80_BACKGROUND_MONSTERB:
236         bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,memory_region_length(REGION_GFX2) / 32);
236         bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,memory_region_length(REGION_GFX2) / 32);
237237         break;
238238
239239      /* background tilemap is effectively 4 screens x n screens */
240240      case G80_BACKGROUND_PIGNEWT:
241241      case G80_BACKGROUND_SINDBADM:
242         bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 128,memory_region_length(REGION_GFX2) / 128);
242         bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,memory_region_length(REGION_GFX2) / 128);
243243         break;
244244   }
245245
src/mame/video/tmnt.c
r814r815
2525
2626   code = rom[tile_index+0x80000] + 256*rom[tile_index] + 256*256*((rom[tile_index/4+0x100000]>>(2*(tile_index&3)))&3);
2727
28   SET_TILE_INFO(0,code & 0x3fff,code >> 14,0)
28   SET_TILE_INFO(0,code & 0x3fff,code >> 14,0);
2929}
3030
3131static TILE_GET_INFO( prmrsocr_get_roz_tile_info )
r814r815
3333   UINT8 *rom = memory_region(REGION_USER1);
3434   int code = rom[tile_index+0x20000] + 256*rom[tile_index];
3535
36   SET_TILE_INFO(0,code & 0x1fff,code >> 13,0)
36   SET_TILE_INFO(0,code & 0x1fff,code >> 13,0);
3737}
3838
3939
r814r815
279279   K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tmnt_tile_callback);
280280   K053245_vh_start(machine,0, REGION_GFX2,NORMAL_PLANE_ORDER,lgtnfght_sprite_callback);
281281
282   roz_tilemap = tilemap_create(glfgreat_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,512,512);
282   roz_tilemap = tilemap_create(glfgreat_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,512,512);
283283
284284   tilemap_set_transparent_pen(roz_tilemap,0);
285285
r814r815
300300   K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tmnt_tile_callback);
301301   K053245_vh_start(machine,0, REGION_GFX2,NORMAL_PLANE_ORDER,prmrsocr_sprite_callback);
302302
303   roz_tilemap = tilemap_create(prmrsocr_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,512,256);
303   roz_tilemap = tilemap_create(prmrsocr_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,512,256);
304304
305305   tilemap_set_transparent_pen(roz_tilemap,0);
306306
r814r815
573573{
574574   K052109_tilemap_update();
575575
576   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_IGNORE_TRANSPARENCY,0);
576   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_DRAW_OPAQUE,0);
577577   if ((priorityflag & 1) == 1) K051960_sprites_draw(bitmap,cliprect,0,0);
578578   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0);
579579   if ((priorityflag & 1) == 0) K051960_sprites_draw(bitmap,cliprect,0,0);
r814r815
585585{
586586   K052109_tilemap_update();
587587
588   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_IGNORE_TRANSPARENCY,0);
588   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_DRAW_OPAQUE,0);
589589   if ((priorityflag & 1) == 1) K051960_sprites_draw(bitmap,cliprect,0,0);
590590   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0);
591591   if ((priorityflag & 1) == 0) K051960_sprites_draw(bitmap,cliprect,0,0);
r814r815
614614   sortlayers(sorted_layer,layerpri);
615615
616616   fillbitmap(priority_bitmap,0,cliprect);
617   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[0]],TILEMAP_IGNORE_TRANSPARENCY,1);
617   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[0]],TILEMAP_DRAW_OPAQUE,1);
618618   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[1]],0,2);
619619   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[2]],0,4);
620620
src/mame/video/zodiack.c
r814r815
119119   int code = zodiack_videoram2[tile_index];
120120   int color = (zodiack_attributesram[2 * (tile_index % 32) + 1] >> 4) & 0x07;
121121
122   SET_TILE_INFO(0, code, color, 0)
122   SET_TILE_INFO(0, code, color, 0);
123123}
124124
125125static TILE_GET_INFO( get_fg_tile_info )
r814r815
127127   int code = videoram[tile_index];
128128   int color = zodiack_attributesram[2 * (tile_index % 32) + 1] & 0x07;
129129
130   SET_TILE_INFO(3, code, color, 0)
130   SET_TILE_INFO(3, code, color, 0);
131131}
132132
133133VIDEO_START( zodiack )
134134{
135135   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
136      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
136      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
137137
138138   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
139      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
139      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
140140
141141   tilemap_set_transparent_pen(fg_tilemap, 0);
142142   tilemap_set_scroll_cols(fg_tilemap, 32);
src/mame/video/mole.c
r814r815
2424static TILE_GET_INFO( get_bg_tile_info )
2525{
2626   UINT16 code = tileram[tile_index];
27   SET_TILE_INFO((code & 0x200) ? 1 : 0, code & 0x1ff, 0, 0)
27   SET_TILE_INFO((code & 0x200) ? 1 : 0, code & 0x1ff, 0, 0);
2828}
2929
3030VIDEO_START( mole )
r814r815
3232   tileram = (UINT16 *)auto_malloc(0x400 * sizeof(UINT16));
3333
3434   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
35      TILEMAP_TYPE_OPAQUE, 8, 8, 40, 25);
35      TILEMAP_TYPE_PEN, 8, 8, 40, 25);
3636}
3737
3838WRITE8_HANDLER( mole_videoram_w )
src/mame/video/taitojc.c
r814r815
189189
190190   assert(taitojc_gfx_index != MAX_GFX_ELEMENTS);
191191
192   taitojc_tilemap = tilemap_create(taitojc_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 64, 64);
192   taitojc_tilemap = tilemap_create(taitojc_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 64, 64);
193193   taitojc_dirty_map = auto_malloc(TAITOJC_NUM_TILES);
194194
195195   tilemap_set_transparent_pen(taitojc_tilemap, 0);
src/mame/video/pitnrun.c
r814r815
3737      0,
3838      code,
3939      0,
40      0)
40      0);
4141}
4242
4343static TILE_GET_INFO( get_tile_info2 )
r814r815
4848      1,
4949      code + (pitnrun_char_bank<<8),
5050      pitnrun_color_select&1,
51      0)
51      0);
5252}
5353
5454WRITE8_HANDLER( pitnrun_videoram_w )
r814r815
177177
178178VIDEO_START(pitnrun)
179179{
180   fg = tilemap_create( get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32 );
181   bg = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32*4,32 );
180   fg = tilemap_create( get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
181   bg = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32*4,32 );
182182   tilemap_set_transparent_pen( fg, 0 );
183183   tmp_bitmap[0] = auto_bitmap_alloc(128,128,machine->screen[0].format);
184184   tmp_bitmap[1] = auto_bitmap_alloc(128,128,machine->screen[0].format);
src/mame/video/segaic16.c
r814r815
805805
806806static TILE_GET_INFO( segaic16_tilemap_16a_tile_info )
807807{
808   const struct tilemap_callback_info *info = tileinfo->user_data;
808   const struct tilemap_callback_info *info = param;
809809   UINT16 data = info->rambase[tile_index];
810810   int code = ((data >> 1) & 0x1000) | (data & 0xfff);
811811   int color = (data >> 5) & 0x7f;
812812
813813   SET_TILE_INFO(0, code, color, 0);
814   tileinfo->priority = (data >> 12) & 1;
814   tileinfo->category = (data >> 12) & 1;
815815}
816816
817817
818818static TILE_GET_INFO( segaic16_tilemap_16a_text_info )
819819{
820   const struct tilemap_callback_info *info = tileinfo->user_data;
820   const struct tilemap_callback_info *info = param;
821821   UINT16 data = info->rambase[tile_index];
822822   int color = (data >> 8) & 0x07;
823823   int code = data & 0xff;
824824
825825   SET_TILE_INFO(0, code, color, 0);
826   tileinfo->priority = (data >> 11) & 1;
826   tileinfo->category = (data >> 11) & 1;
827827}
828828
829829
r814r815
10171017
10181018static TILE_GET_INFO( segaic16_tilemap_16b_tile_info )
10191019{
1020   const struct tilemap_callback_info *info = tileinfo->user_data;
1020   const struct tilemap_callback_info *info = param;
10211021   UINT16 data = info->rambase[tile_index];
10221022   int color = (data >> 6) & 0x7f;
10231023   int code = data & 0x1fff;
r814r815
10251025   code = info->bank[code / info->banksize] * info->banksize + code % info->banksize;
10261026
10271027   SET_TILE_INFO(0, code, color, 0);
1028   tileinfo->priority = (data >> 15) & 1;
1028   tileinfo->category = (data >> 15) & 1;
10291029}
10301030
10311031
10321032static TILE_GET_INFO( segaic16_tilemap_16b_text_info )
10331033{
1034   const struct tilemap_callback_info *info = tileinfo->user_data;
1034   const struct tilemap_callback_info *info = param;
10351035   UINT16 data = info->rambase[tile_index];
10361036   int bank = info->bank[0];
10371037   int color = (data >> 9) & 0x07;
10381038   int code = data & 0x1ff;
10391039
10401040   SET_TILE_INFO(0, bank * info->banksize + code, color, 0);
1041   tileinfo->priority = (data >> 15) & 1;
1041   tileinfo->category = (data >> 15) & 1;
10421042}
10431043
10441044
10451045static TILE_GET_INFO( segaic16_tilemap_16b_alt_tile_info )
10461046{
1047   const struct tilemap_callback_info *info = tileinfo->user_data;
1047   const struct tilemap_callback_info *info = param;
10481048   UINT16 data = info->rambase[tile_index];
10491049   int color = (data >> 5) & 0x7f;
10501050   int code = data & 0x1fff;
r814r815
10521052   code = info->bank[code / info->banksize] * info->banksize + code % info->banksize;
10531053
10541054   SET_TILE_INFO(0, code, color, 0);
1055   tileinfo->priority = (data >> 15) & 1;
1055   tileinfo->category = (data >> 15) & 1;
10561056}
10571057
10581058
10591059static TILE_GET_INFO( segaic16_tilemap_16b_alt_text_info )
10601060{
1061   const struct tilemap_callback_info *info = tileinfo->user_data;
1061   const struct tilemap_callback_info *info = param;
10621062   UINT16 data = info->rambase[tile_index];
10631063   int bank = info->bank[0];
10641064   int color = (data >> 8) & 0x07;
10651065   int code = data & 0xff;
10661066
10671067   SET_TILE_INFO(0, bank * info->banksize + code, color, 0);
1068   tileinfo->priority = (data >> 15) & 1;
1068   tileinfo->category = (data >> 15) & 1;
10691069}
10701070
10711071
r814r815
11991199void segaic16_tilemap_init(int which, int type, int colorbase, int xoffs, int numbanks)
12001200{
12011201   struct tilemap_info *info = &bg_tilemap[which];
1202   tile_get_info_fn get_text_info;
1203   tile_get_info_fn get_tile_info;
1202   tile_get_info_callback get_text_info;
1203   tile_get_info_callback get_tile_info;
12041204   int pagenum;
12051205   int i;
12061206
r814r815
12651265   }
12661266
12671267   /* create the tilemap for the text layer */
1268   info->textmap = tilemap_create(get_text_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,28);
1268   info->textmap = tilemap_create(get_text_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,28);
12691269
12701270   /* configure it */
12711271   info->textmap_info.rambase = info->textram;
r814r815
12811281   for (pagenum = 0; pagenum < info->numpages; pagenum++)
12821282   {
12831283      /* each page is 64x32 */
1284      info->tilemaps[pagenum] = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
1284      info->tilemaps[pagenum] = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
12851285
12861286      /* configure the tilemap */
12871287      info->tilemap_info[pagenum].rambase = info->tileram + pagenum * 64*32;
src/mame/video/tehkanwc.c
r814r815
7474   int color = attr & 0x0f;
7575   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
7676
77   SET_TILE_INFO(2, code, color, flags)
77   SET_TILE_INFO(2, code, color, flags);
7878}
7979
8080static TILE_GET_INFO( get_fg_tile_info )
r814r815
8484   int color = attr & 0x0f;
8585   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
8686
87   tileinfo->priority = (attr & 0x20) ? 0 : 1;
87   tileinfo->category = (attr & 0x20) ? 0 : 1;
8888
89   SET_TILE_INFO(0, code, color, flags)
89   SET_TILE_INFO(0, code, color, flags);
9090}
9191
9292VIDEO_START( tehkanwc )
9393{
9494   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
95      TILEMAP_TYPE_OPAQUE, 16, 8, 32, 32);
95      TILEMAP_TYPE_PEN, 16, 8, 32, 32);
9696
9797   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
98      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
98      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9999
100100   tilemap_set_transparent_pen(fg_tilemap, 0);
101101}
src/mame/video/bionicc.c
r814r815
4545         1,
4646         (bionicc_bgvideoram[2*tile_index] & 0xff) + ((attr & 0x07) << 8),
4747         (attr & 0x18) >> 3,
48         TILE_FLIPXY((attr & 0xc0) >> 6))
48         TILE_FLIPXY((attr & 0xc0) >> 6));
4949}
5050
5151static TILE_GET_INFO( get_fg_tile_info )
r814r815
5555
5656   if ((attr & 0xc0) == 0xc0)
5757   {
58      tileinfo->priority = 1;
59      flags = TILE_SPLIT(0);
58      tileinfo->category = 1;
59      tileinfo->group = 0;
60      flags = 0;
6061   }
6162   else
6263   {
63      tileinfo->priority = 0;
64      flags = TILE_SPLIT((attr & 0x20) >> 5) | TILE_FLIPXY((attr & 0xc0) >> 6);
64      tileinfo->category = 0;
65      tileinfo->group = (attr & 0x20) >> 5;
66      flags = TILE_FLIPXY((attr & 0xc0) >> 6);
6567   }
6668
6769   SET_TILE_INFO(
6870         2,
6971         (bionicc_fgvideoram[2*tile_index] & 0xff) + ((attr & 0x07) << 8),
7072         (attr & 0x18) >> 3,
71         flags)
73         flags);
7274}
7375
7476static TILE_GET_INFO( get_tx_tile_info )
r814r815
7880         0,
7981         (bionicc_txvideoram[tile_index] & 0xff) + ((attr & 0x00c0) << 2),
8082         attr & 0x3f,
81         0)
83         0);
8284}
8385
8486
r814r815
9193
9294VIDEO_START( bionicc )
9395{
94   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,32,32);
95   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,      16,16,64,64);
96   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,64,64);
96   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,32,32);
97   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16,64,64);
98   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,64);
9799
98100   tilemap_set_transparent_pen(tx_tilemap,3);
99101   tilemap_set_transmask(fg_tilemap,0,0xffff,0x8000); /* split type 0 is completely transparent in front half */
r814r815
215217VIDEO_UPDATE( bionicc )
216218{
217219   fillbitmap(bitmap,machine->pens[0],cliprect);
218   tilemap_draw(bitmap,cliprect,fg_tilemap,1|TILEMAP_BACK,0);   /* nothing in FRONT */
220   tilemap_draw(bitmap,cliprect,fg_tilemap,1|TILEMAP_DRAW_LAYER1,0);   /* nothing in FRONT */
219221   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
220   tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_BACK,0);
222   tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_DRAW_LAYER1,0);
221223   draw_sprites(machine,bitmap,cliprect);
222   tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_FRONT,0);
224   tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_DRAW_LAYER0,0);
223225   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
224226   return 0;
225227}
src/mame/video/citycon.c
r814r815
2424
2525***************************************************************************/
2626
27static UINT32 citycon_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
27static TILEMAP_MAPPER( citycon_scan )
2828{
2929   /* logical (col,row) -> memory offset */
3030   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5);
r814r815
3636         0,
3737         citycon_videoram[tile_index],
3838         (tile_index & 0x03e0) >> 5,   /* color depends on scanline only */
39         0)
39         0);
4040}
4141
4242static TILE_GET_INFO( get_bg_tile_info )
r814r815
4747         3 + bg_image,
4848         code,
4949         rom[0xc000 + 0x100 * bg_image + code],
50         0)
50         0);
5151}
5252
5353
r814r815
6060
6161VIDEO_START( citycon )
6262{
63   fg_tilemap = tilemap_create(get_fg_tile_info,citycon_scan,TILEMAP_TYPE_TRANSPARENT,8,8,128,32);
64   bg_tilemap = tilemap_create(get_bg_tile_info,citycon_scan,TILEMAP_TYPE_OPAQUE,     8,8,128,32);
63   fg_tilemap = tilemap_create(get_fg_tile_info,citycon_scan,TILEMAP_TYPE_PEN,8,8,128,32);
64   bg_tilemap = tilemap_create(get_bg_tile_info,citycon_scan,TILEMAP_TYPE_PEN,     8,8,128,32);
6565
6666   tilemap_set_transparent_pen(fg_tilemap,0);
6767   tilemap_set_scroll_rows(fg_tilemap,32);
src/mame/video/suprridr.c
r814r815
4747
4848VIDEO_START( suprridr )
4949{
50   fg_tilemap          = tilemap_create(get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 32,32);
51   bg_tilemap          = tilemap_create(get_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8,8, 32,32);
52   bg_tilemap_noscroll = tilemap_create(get_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8,8, 32,32);
50   fg_tilemap          = tilemap_create(get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
51   bg_tilemap          = tilemap_create(get_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,8, 32,32);
52   bg_tilemap_noscroll = tilemap_create(get_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,8, 32,32);
5353
5454   tilemap_set_transparent_pen(fg_tilemap, 0);
5555}
src/mame/video/spy.c
r814r815
7676      return 0;
7777   }
7878
79   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY,1);
79   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,1);
8080   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,2);
8181   K051960_sprites_draw(bitmap,cliprect,-1,-1);
8282   tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,0);
src/mame/video/psikyo.c
r814r815
8888         1,
8989         (code & 0x1fff) + 0x2000*tilemap_0_bank,
9090         (code >> 13) & 7,
91         0)
91         0);
9292}
9393
9494static TILE_GET_INFO( get_tile_info_1 )
r814r815
9898         1,
9999         (code & 0x1fff) + 0x2000*tilemap_1_bank,
100100         ((code >> 13) & 7) + 0x40, // So we only have to decode the gfx once.
101         0)
101         0);
102102}
103103
104104
r814r815
170170
171171   tilemap_0_size0   =   tilemap_create(   get_tile_info_0,
172172                           tilemap_scan_rows,
173                           TILEMAP_TYPE_TRANSPARENT,
173                           TILEMAP_TYPE_PEN,
174174                           16,16,
175175                           0x20, 0x80 );
176176   tilemap_0_size1   =   tilemap_create(   get_tile_info_0,
177177                           tilemap_scan_rows,
178                           TILEMAP_TYPE_TRANSPARENT,
178                           TILEMAP_TYPE_PEN,
179179                           16,16,
180180                           0x40, 0x40 );
181181
182182   tilemap_0_size2   =   tilemap_create(   get_tile_info_0,
183183                           tilemap_scan_rows,
184                           TILEMAP_TYPE_TRANSPARENT,
184                           TILEMAP_TYPE_PEN,
185185                           16,16,
186186                           0x80, 0x20 );
187187
188188   tilemap_0_size3   =   tilemap_create(   get_tile_info_0,
189189                           tilemap_scan_rows,
190                           TILEMAP_TYPE_TRANSPARENT,
190                           TILEMAP_TYPE_PEN,
191191                           16,16,
192192                           0x100, 0x10 );
193193
194194   tilemap_1_size0   =   tilemap_create(   get_tile_info_1,
195195                           tilemap_scan_rows,
196                           TILEMAP_TYPE_TRANSPARENT,
196                           TILEMAP_TYPE_PEN,
197197                           16,16,
198198                           0x20, 0x80 );
199199
200200   tilemap_1_size1   =   tilemap_create(   get_tile_info_1,
201201                           tilemap_scan_rows,
202                           TILEMAP_TYPE_TRANSPARENT,
202                           TILEMAP_TYPE_PEN,
203203                           16,16,
204204                           0x40, 0x40 );
205205
206206   tilemap_1_size2   =   tilemap_create(   get_tile_info_1,
207207                           tilemap_scan_rows,
208                           TILEMAP_TYPE_TRANSPARENT,
208                           TILEMAP_TYPE_PEN,
209209                           16,16,
210210                           0x80, 0x20 );
211211
212212   tilemap_1_size3   =   tilemap_create(   get_tile_info_1,
213213                           tilemap_scan_rows,
214                           TILEMAP_TYPE_TRANSPARENT,
214                           TILEMAP_TYPE_PEN,
215215                           16,16,
216216                           0x100, 0x10 );
217217
r814r815
581581   fillbitmap(priority_bitmap,0,cliprect);
582582
583583   if (layers_ctrl & 1)
584      tilemap_draw(bitmap,cliprect,tmptilemap0, layer0_ctrl & 2 ? TILEMAP_IGNORE_TRANSPARENCY : 0, 1);
584      tilemap_draw(bitmap,cliprect,tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1);
585585
586586   if (layers_ctrl & 2)
587      tilemap_draw(bitmap,cliprect,tmptilemap1, layer1_ctrl & 2 ? TILEMAP_IGNORE_TRANSPARENCY : 0, 2);
587      tilemap_draw(bitmap,cliprect,tmptilemap1, layer1_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 2);
588588
589589   if (layers_ctrl & 4)
590590      draw_sprites(machine, bitmap,cliprect,(spr_ctrl & 4 ? 0 : 15));
src/mame/video/playmark.c
r814r815
2929         2,
3030         code,
3131         color,
32         0)
32         0);
3333}
3434
3535static TILE_GET_INFO( bigtwin_get_fg_tile_info )
r814r815
4040         1,
4141         code,
4242         color,
43         0)
43         0);
4444}
4545
4646static TILE_GET_INFO( wbeachvl_get_tx_tile_info )
r814r815
5252         2,
5353         code,
5454         color / 4,
55         0)
55         0);
5656}
5757
5858static TILE_GET_INFO( wbeachvl_get_fg_tile_info )
r814r815
6464         1,
6565         code & 0x7fff,
6666         color / 4 + 8,
67         (code & 0x8000) ? TILE_FLIPX : 0)
67         (code & 0x8000) ? TILE_FLIPX : 0);
6868}
6969
7070static TILE_GET_INFO( wbeachvl_get_bg_tile_info )
r814r815
7676         1,
7777         code & 0x7fff,
7878         color / 4,
79         (code & 0x8000) ? TILE_FLIPX : 0)
79         (code & 0x8000) ? TILE_FLIPX : 0);
8080}
8181
8282static TILE_GET_INFO( hrdtimes_get_tx_tile_info )
r814r815
8484   int code = wbeachvl_videoram1[tile_index] & 0x03ff;
8585   int colr = wbeachvl_videoram1[tile_index] & 0xe000;
8686
87   SET_TILE_INFO(2,code + txt_tile_offset,colr >> 13,0)
87   SET_TILE_INFO(2,code + txt_tile_offset,colr >> 13,0);
8888}
8989
9090static TILE_GET_INFO( hrdtimes_get_fg_tile_info )
r814r815
9292   int code = wbeachvl_videoram2[tile_index] & 0x1fff;
9393   int colr = wbeachvl_videoram2[tile_index] & 0xe000;
9494
95   SET_TILE_INFO(1,code + 0x2000,(colr >> 13) + 8,0)
95   SET_TILE_INFO(1,code + 0x2000,(colr >> 13) + 8,0);
9696}
9797
9898static TILE_GET_INFO( hrdtimes_get_bg_tile_info )
r814r815
100100   int code = wbeachvl_videoram3[tile_index] & 0x1fff;
101101   int colr = wbeachvl_videoram3[tile_index] & 0xe000;
102102
103   SET_TILE_INFO(1,code,colr >> 13,0)
103   SET_TILE_INFO(1,code,colr >> 13,0);
104104}
105105
106106/***************************************************************************
r814r815
111111
112112VIDEO_START( bigtwin )
113113{
114   tx_tilemap = tilemap_create(bigtwin_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
115   fg_tilemap = tilemap_create(bigtwin_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
114   tx_tilemap = tilemap_create(bigtwin_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
115   fg_tilemap = tilemap_create(bigtwin_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
116116
117117   tilemap_set_transparent_pen(tx_tilemap,0);
118118
r814r815
124124
125125VIDEO_START( wbeachvl )
126126{
127   tx_tilemap = tilemap_create(wbeachvl_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
128   fg_tilemap = tilemap_create(wbeachvl_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
129   bg_tilemap = tilemap_create(wbeachvl_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
127   tx_tilemap = tilemap_create(wbeachvl_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
128   fg_tilemap = tilemap_create(wbeachvl_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
129   bg_tilemap = tilemap_create(wbeachvl_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
130130
131131   tilemap_set_transparent_pen(tx_tilemap,0);
132132   tilemap_set_transparent_pen(fg_tilemap,0);
r814r815
138138
139139VIDEO_START( excelsr )
140140{
141   tx_tilemap = tilemap_create(bigtwin_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
142   fg_tilemap = tilemap_create(bigtwin_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
141   tx_tilemap = tilemap_create(bigtwin_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
142   fg_tilemap = tilemap_create(bigtwin_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
143143
144144   tilemap_set_transparent_pen(tx_tilemap,0);
145145
r814r815
150150
151151VIDEO_START( hotmind )
152152{
153   tx_tilemap = tilemap_create(hrdtimes_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
154   fg_tilemap = tilemap_create(hrdtimes_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
155   bg_tilemap = tilemap_create(hrdtimes_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
153   tx_tilemap = tilemap_create(hrdtimes_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
154   fg_tilemap = tilemap_create(hrdtimes_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
155   bg_tilemap = tilemap_create(hrdtimes_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
156156
157157   tilemap_set_transparent_pen(tx_tilemap,0);
158158   tilemap_set_transparent_pen(fg_tilemap,0);
r814r815
172172
173173VIDEO_START( hrdtimes )
174174{
175   tx_tilemap = tilemap_create(hrdtimes_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
176   fg_tilemap = tilemap_create(hrdtimes_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
177   bg_tilemap = tilemap_create(hrdtimes_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
175   tx_tilemap = tilemap_create(hrdtimes_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
176   fg_tilemap = tilemap_create(hrdtimes_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
177   bg_tilemap = tilemap_create(hrdtimes_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
178178
179179   tilemap_set_transparent_pen(tx_tilemap,0);
180180   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/esd16.c
r814r815
7474         1,
7575         code,
7676         esd16_tilemap0_color,
77         0)
77         0);
7878}
7979
8080static TILE_GET_INFO( get_tile_info_1 )
r814r815
8484         1,
8585         code,
8686         0,
87         0)
87         0);
8888}
8989
9090static TILE_GET_INFO( get_tile_info_1_16x16 )
r814r815
9494         2,
9595         code,
9696         0,
97         0)
97         0);
9898}
9999
100100WRITE16_HANDLER( esd16_vram_0_w )
r814r815
131131VIDEO_START( esd16 )
132132{
133133   esdtilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
134                        TILEMAP_TYPE_OPAQUE,         8,8,   0x80,0x40);
134                        TILEMAP_TYPE_PEN,         8,8,   0x80,0x40);
135135
136136   esdtilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
137                        TILEMAP_TYPE_TRANSPARENT,   8,8,   0x80,0x40);
137                        TILEMAP_TYPE_PEN,   8,8,   0x80,0x40);
138138
139139   /* hedpanic changes tilemap 1 to 16x16 at various times */
140140   esdtilemap_1_16x16 = tilemap_create(   get_tile_info_1_16x16, tilemap_scan_rows,
141                        TILEMAP_TYPE_TRANSPARENT,   16,16,   0x40,0x40);
141                        TILEMAP_TYPE_PEN,   16,16,   0x40,0x40);
142142
143143   tilemap_set_scrolldx(esdtilemap_0, -0x60 + 2, -0x60     );
144144   tilemap_set_scrolldx(esdtilemap_1, -0x60    , -0x60 + 2 );
145145   tilemap_set_scrolldx(esdtilemap_1_16x16, -0x60    , -0x60 + 2 );
146146
147   tilemap_set_transparent_pen(esdtilemap_0,0x00);
148147   tilemap_set_transparent_pen(esdtilemap_1,0x00);
149148   tilemap_set_transparent_pen(esdtilemap_1_16x16,0x00);
150149}
src/mame/video/pgm.c
r814r815
276276
277277   if (tileno > 0xbfff) { tileno -= 0xc000 ; tileno += 0x20000; } /* not sure about this */
278278
279   SET_TILE_INFO(0,tileno,colour,TILE_FLIPYX(flipyx))
279   SET_TILE_INFO(0,tileno,colour,TILE_FLIPYX(flipyx));
280280}
281281
282282/* BG Layer */
r814r815
298298   colour = (pgm_bg_videoram[tile_index*2+1] & 0x3e) >> 1;
299299   flipyx = (pgm_bg_videoram[tile_index*2+1] & 0xc0) >> 6;
300300
301   SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(flipyx))
301   SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(flipyx));
302302}
303303
304304
r814r815
307307
308308VIDEO_START( pgm )
309309{
310   pgm_tx_tilemap= tilemap_create(get_pgm_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
310   pgm_tx_tilemap= tilemap_create(get_pgm_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
311311   tilemap_set_transparent_pen(pgm_tx_tilemap,15);
312312
313   pgm_bg_tilemap = tilemap_create(get_pgm_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 32, 32,64,64);
313   pgm_bg_tilemap = tilemap_create(get_pgm_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 32, 32,64,64);
314314   tilemap_set_transparent_pen(pgm_bg_tilemap,31);
315315   tilemap_set_scroll_rows(pgm_bg_tilemap,64*32);
316316
src/mame/video/iqblock.c
r814r815
2424         0,
2525         code &(iqblock_video_type ? 0x1fff : 0x3fff),
2626         iqblock_video_type? (2*(code >> 13)+1) : (4*(code >> 14)+3),
27         0)
27         0);
2828}
2929
3030static TILE_GET_INFO( get_fg_tile_info )
r814r815
3434         1,
3535         code & 0x7f,
3636         (code & 0x80) ? 3 : 0,
37         0)
37         0);
3838}
3939
4040
r814r815
4747
4848VIDEO_START( iqblock )
4949{
50   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,     8, 8,64,32);
51   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,32,64, 8);
50   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8, 8,64,32);
51   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,32,64, 8);
5252
5353   tilemap_set_transparent_pen(bg_tilemap,0);
5454   tilemap_set_scroll_cols(fg_tilemap,64);
src/mame/video/darius.c
r814r815
2828         gfxnum,
2929         code,
3030         ((attr & 0xff) << 2),
31         TILE_FLIPYX((attr & 0xc000) >> 14))
31         TILE_FLIPYX((attr & 0xc000) >> 14));
3232}
3333
3434static TILE_GET_INFO( get_fg_tile_info )
r814r815
4545
4646VIDEO_START( darius )
4747{
48   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
48   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
4949
5050   spritelist = auto_malloc(0x800 * sizeof(*spritelist));
5151
r814r815
137137   PC080SN_tilemap_update();
138138
139139   // draw bottom layer(always active)
140    PC080SN_tilemap_draw_offset(bitmap,cliprect,0,0,TILEMAP_IGNORE_TRANSPARENCY,0,-xoffs,0);
140    PC080SN_tilemap_draw_offset(bitmap,cliprect,0,0,TILEMAP_DRAW_OPAQUE,0,-xoffs,0);
141141
142142   /* Sprites can be under/over the layer below text layer */
143143   draw_sprites(machine,bitmap,cliprect,0,xoffs,-8); // draw sprites with priority 0 which are under the mid layer
src/mame/video/cbasebal.c
r814r815
2222         1,
2323         cbasebal_scrollram[2*tile_index] + ((attr & 0x07) << 8) + 0x800 * tilebank,
2424         (attr & 0xf0) >> 4,
25         (attr & 0x08) ? TILE_FLIPX : 0)
25         (attr & 0x08) ? TILE_FLIPX : 0);
2626}
2727
2828static TILE_GET_INFO( get_fg_tile_info )
r814r815
3232         0,
3333         cbasebal_textram[tile_index] + ((attr & 0xf0) << 4),
3434         attr & 0x07,
35         (attr & 0x08) ? TILE_FLIPX : 0)
35         (attr & 0x08) ? TILE_FLIPX : 0);
3636}
3737
3838
r814r815
4848   cbasebal_textram = auto_malloc(0x1000);
4949   cbasebal_scrollram = auto_malloc(0x1000);
5050
51   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,   16,16,64,32);
52   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
51   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,   16,16,64,32);
52   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
5353
5454   tilemap_set_transparent_pen(fg_tilemap,3);
5555}
src/mame/video/sbasketb.c
r814r815
119119   int color = colorram[tile_index] & 0x0f;
120120   int flags = ((colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x80) ? TILE_FLIPY : 0);
121121
122   SET_TILE_INFO(0, code, color, flags)
122   SET_TILE_INFO(0, code, color, flags);
123123}
124124
125125VIDEO_START( sbasketb )
126126{
127127   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
128      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
128      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
129129
130130   tilemap_set_scroll_cols(bg_tilemap, 32);
131131}
src/mame/video/funkyjet.c
r814r815
8383   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
8484
8585   fillbitmap(bitmap,machine->pens[768],cliprect);
86   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
86   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
8787   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
8888   draw_sprites(machine,bitmap,cliprect);
8989   return 0;
src/mame/video/ksayakyu.c
r814r815
4949   int code = memory_region(REGION_USER1)[tile_index];
5050   int attr = memory_region(REGION_USER1)[tile_index+0x2000];
5151   code+=(attr&3)<<8;
52   SET_TILE_INFO(1,code,((attr>>2)&0x07)*2,(attr&0x80) ? TILE_FLIPX : 0)
52   SET_TILE_INFO(1,code,((attr>>2)&0x07)*2,(attr&0x80) ? TILE_FLIPX : 0);
5353}
5454
5555static TILE_GET_INFO( get_text_tile_info )
r814r815
6060
6161   code|=(attr&3)<<8;
6262
63   SET_TILE_INFO(0,code,((attr>>2)&7),flags)
63   SET_TILE_INFO(0,code,((attr>>2)&7),flags);
6464}
6565
6666static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
r814r815
100100
101101VIDEO_START(ksayakyu)
102102{
103   ksayakyu_tilemap = tilemap_create(get_ksayakyu_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,32,32*8);
104   ksayakyu_textmap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
103   ksayakyu_tilemap = tilemap_create(get_ksayakyu_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32*8);
104   ksayakyu_textmap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
105105   tilemap_set_transparent_pen(ksayakyu_textmap,0);
106106}
107107
src/mame/video/xexex.c
r814r815
134134
135135      if (alpha > 0)
136136      {
137         K056832_tilemap_draw(machine, bitmap, cliprect, 1, (alpha >= 255) ? 0 : TILEMAP_ALPHA, 0);
137         K056832_tilemap_draw(machine, bitmap, cliprect, 1, (alpha >= 255) ? 0 : TILEMAP_DRAW_ALPHA, 0);
138138      }
139139   }
140140
src/mame/video/ironhors.c
r814r815
149149   int flags = ((colorram[tile_index] & 0x10) ? TILE_FLIPX : 0) |
150150      ((colorram[tile_index] & 0x20) ? TILE_FLIPY : 0);
151151
152   SET_TILE_INFO(0, code, color, flags)
152   SET_TILE_INFO(0, code, color, flags);
153153}
154154
155155VIDEO_START( ironhors )
156156{
157157   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
158      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
158      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
159159
160160   tilemap_set_scroll_rows(bg_tilemap, 32);
161161}
src/mame/video/battlex.c
r814r815
7272   int tile = videoram[tile_index*2] | (((videoram[tile_index*2+1] & 0x01)) << 8);
7373   int color = (videoram[tile_index*2+1] & 0x0e) >> 1;
7474
75   SET_TILE_INFO(0,tile,color,0)
75   SET_TILE_INFO(0,tile,color,0);
7676}
7777
7878VIDEO_START( battlex )
7979{
8080   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
81      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
81      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
8282}
8383
8484static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/skullxbo.c
r814r815
2222   int code = (data ^ 0x400) & 0x7ff;
2323   int color = (data >> 11) & 0x0f;
2424   int opaque = data & 0x8000;
25   SET_TILE_INFO(2, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
25   SET_TILE_INFO(2, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
2626}
2727
2828
r814r815
8383   };
8484
8585   /* initialize the playfield */
86   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 16,8, 64,64);
86   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,8, 64,64);
8787
8888   /* initialize the motion objects */
8989   atarimo_init(machine, 0, &modesc);
9090
9191   /* initialize the alphanumerics */
92   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16,8, 64,32);
92   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,32);
9393   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
9494}
9595
src/mame/video/glass.c
r814r815
4747   int data2 = glass_videoram[(tile_index << 1) + 1];
4848   int code = ((data & 0x03) << 14) | ((data & 0x0fffc) >> 2);
4949
50   SET_TILE_INFO(0, code, 0x20 + (data2 & 0x1f), TILE_FLIPYX((data2 & 0xc0) >> 6))
50   SET_TILE_INFO(0, code, 0x20 + (data2 & 0x1f), TILE_FLIPYX((data2 & 0xc0) >> 6));
5151}
5252
5353
r814r815
5757   int data2 = glass_videoram[(0x1000/2) + (tile_index << 1) + 1];
5858   int code = ((data & 0x03) << 14) | ((data & 0x0fffc) >> 2);
5959
60   SET_TILE_INFO(0, code, 0x20 + (data2 & 0x1f), TILE_FLIPYX((data2 & 0xc0) >> 6))
60   SET_TILE_INFO(0, code, 0x20 + (data2 & 0x1f), TILE_FLIPYX((data2 & 0xc0) >> 6));
6161}
6262
6363/***************************************************************************
r814r815
131131
132132VIDEO_START( glass )
133133{
134   pant[0] = tilemap_create(get_tile_info_glass_screen0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
135   pant[1] = tilemap_create(get_tile_info_glass_screen1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
134   pant[0] = tilemap_create(get_tile_info_glass_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
135   pant[1] = tilemap_create(get_tile_info_glass_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
136136   screen_bitmap = auto_bitmap_alloc (320, 200, machine->screen[0].format);
137137
138138   tilemap_set_transparent_pen(pant[0],0);
src/mame/video/mcatadv.c
r814r815
3131   colour = (mcatadv_videoram1[tile_index*2] & 0x3f00)>>8;
3232   pri = (mcatadv_videoram1[tile_index*2] & 0xc000)>>14;
3333
34   SET_TILE_INFO(0,tileno,colour + palette_bank1*0x40,0)
35   tileinfo->priority = pri;
34   SET_TILE_INFO(0,tileno,colour + palette_bank1*0x40,0);
35   tileinfo->category = pri;
3636}
3737
3838WRITE16_HANDLER( mcatadv_videoram1_w )
r814r815
4949   colour = (mcatadv_videoram2[tile_index*2] & 0x3f00)>>8;
5050   pri = (mcatadv_videoram2[tile_index*2] & 0xc000)>>14;
5151
52   SET_TILE_INFO(1,tileno,colour + palette_bank2*0x40,0)
53   tileinfo->priority = pri;
52   SET_TILE_INFO(1,tileno,colour + palette_bank2*0x40,0);
53   tileinfo->category = pri;
5454}
5555
5656WRITE16_HANDLER( mcatadv_videoram2_w )
r814r815
251251
252252VIDEO_START( mcatadv )
253253{
254   mcatadv_tilemap1 = tilemap_create(get_mcatadv_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
254   mcatadv_tilemap1 = tilemap_create(get_mcatadv_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
255255   tilemap_set_transparent_pen(mcatadv_tilemap1,0);
256256
257   mcatadv_tilemap2 = tilemap_create(get_mcatadv_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
257   mcatadv_tilemap2 = tilemap_create(get_mcatadv_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
258258   tilemap_set_transparent_pen(mcatadv_tilemap2,0);
259259
260260   spriteram_old = auto_malloc(spriteram_size);
src/mame/video/toaplan2.c
r814r815
255255         0,
256256         tile_number,
257257         color,
258         0)
259   tileinfo->priority = (attrib & 0x0f00) >> 8;
258         0);
259   tileinfo->category = (attrib & 0x0f00) >> 8;
260260}
261261
262262static TILE_GET_INFO( get_fg0_tile_info )
r814r815
270270         0,
271271         tile_number,
272272         color,
273         0)
274   tileinfo->priority = (attrib & 0x0f00) >> 8;
273         0);
274   tileinfo->category = (attrib & 0x0f00) >> 8;
275275}
276276
277277static TILE_GET_INFO( get_bg0_tile_info )
r814r815
285285         0,
286286         tile_number,
287287         color,
288         0)
289   tileinfo->priority = (attrib & 0x0f00) >> 8;
290/// if ((attrib & 0x0f00) == 0) tileinfo->flags |= TILE_IGNORE_TRANSPARENCY;
288         0);
289   tileinfo->category = (attrib & 0x0f00) >> 8;
290/// if ((attrib & 0x0f00) == 0) tileinfo->flags |= TILE_FORCE_LAYER0;
291291}
292292
293293static TILE_GET_INFO( get_top1_tile_info )
r814r815
301301         2,
302302         tile_number,
303303         color,
304         0)
305   tileinfo->priority = (attrib & 0x0f00) >> 8;
304         0);
305   tileinfo->category = (attrib & 0x0f00) >> 8;
306306}
307307
308308static TILE_GET_INFO( get_fg1_tile_info )
r814r815
316316         2,
317317         tile_number,
318318         color,
319         0)
320   tileinfo->priority = (attrib & 0x0f00) >> 8;
319         0);
320   tileinfo->category = (attrib & 0x0f00) >> 8;
321321}
322322
323323static TILE_GET_INFO( get_bg1_tile_info )
r814r815
331331         2,
332332         tile_number,
333333         color,
334         0)
335   tileinfo->priority = (attrib & 0x0f00) >> 8;
334         0);
335   tileinfo->category = (attrib & 0x0f00) >> 8;
336336}
337337
338338static TILE_GET_INFO( batrider_get_top0_tile_info )
r814r815
347347         0,
348348         tile_number,
349349         color,
350         0)
351   tileinfo->priority = (attrib & 0x0f00) >> 8;
350         0);
351   tileinfo->category = (attrib & 0x0f00) >> 8;
352352}
353353
354354static TILE_GET_INFO( batrider_get_fg0_tile_info )
r814r815
363363         0,
364364         tile_number,
365365         color,
366         0)
367   tileinfo->priority = (attrib & 0x0f00) >> 8;
366         0);
367   tileinfo->category = (attrib & 0x0f00) >> 8;
368368}
369369
370370static TILE_GET_INFO( batrider_get_bg0_tile_info )
r814r815
379379         0,
380380         tile_number,
381381         color,
382         0)
383   tileinfo->priority = (attrib & 0x0f00) >> 8;
382         0);
383   tileinfo->category = (attrib & 0x0f00) >> 8;
384384}
385385
386386static TILE_GET_INFO( get_text_tile_info )
r814r815
394394         2,
395395         tile_number,
396396         color,
397         0)
398   tileinfo->priority = 0;
397         0);
398   tileinfo->category = 0;
399399}
400400
401401/***************************************************************************
r814r815
405405***************************************************************************/
406406static void create_tilemaps_0(void)
407407{
408   top_tilemap[0] = tilemap_create(get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
409   fg_tilemap[0] = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
410   bg_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
408   top_tilemap[0] = tilemap_create(get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
409   fg_tilemap[0] = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
410   bg_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
411411
412412   tilemap_set_transparent_pen(top_tilemap[0],0);
413413   tilemap_set_transparent_pen(fg_tilemap[0],0);
r814r815
416416
417417static void create_tilemaps_1(void)
418418{
419   top_tilemap[1] = tilemap_create(get_top1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
420   fg_tilemap[1] = tilemap_create(get_fg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
421   bg_tilemap[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
419   top_tilemap[1] = tilemap_create(get_top1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
420   fg_tilemap[1] = tilemap_create(get_fg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
421   bg_tilemap[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
422422
423423   tilemap_set_transparent_pen(top_tilemap[1],0);
424424   tilemap_set_transparent_pen(fg_tilemap[1],0);
r814r815
427427
428428static void truxton2_create_tilemaps_0(void)
429429{
430   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
431   top_tilemap[0] = tilemap_create(get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
432   fg_tilemap[0] = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
433   bg_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
430   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
431   top_tilemap[0] = tilemap_create(get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
432   fg_tilemap[0] = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
433   bg_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
434434
435435   tilemap_set_scroll_rows(tx_tilemap,8*32);   /* line scrolling */
436436   tilemap_set_scroll_cols(tx_tilemap,1);
r814r815
443443
444444static void batrider_create_tilemaps_0(void)
445445{
446   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
447   top_tilemap[0] = tilemap_create(batrider_get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
448   fg_tilemap[0] = tilemap_create(batrider_get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
449   bg_tilemap[0] = tilemap_create(batrider_get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
446   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
447   top_tilemap[0] = tilemap_create(batrider_get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
448   fg_tilemap[0] = tilemap_create(batrider_get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
449   bg_tilemap[0] = tilemap_create(batrider_get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
450450
451451   tilemap_set_scroll_rows(tx_tilemap,8*32);   /* line scrolling */
452452   tilemap_set_scroll_cols(tx_tilemap,1);
src/mame/video/mjkjidai.c
r814r815
3232
3333VIDEO_START( mjkjidai )
3434{
35   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
35   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
3636}
3737
3838
src/mame/video/jailbrek.c
r814r815
6565   int code = videoram[tile_index] + ((attr & 0xc0) << 2);
6666   int color = attr & 0x0f;
6767
68   SET_TILE_INFO(0, code, color, 0)
68   SET_TILE_INFO(0, code, color, 0);
6969}
7070
7171VIDEO_START( jailbrek )
7272{
7373   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
74      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
74      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
7575}
7676
7777static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/gaelco.c
r814r815
4444   int data2 = gaelco_videoram[(tile_index << 1) + 1];
4545   int code = ((data & 0xfffc) >> 2);
4646
47   tileinfo->priority = (data2 >> 6) & 0x03;
47   tileinfo->category = (data2 >> 6) & 0x03;
4848
49   SET_TILE_INFO(1, 0x4000 + code, data2 & 0x3f, TILE_FLIPYX(data & 0x03))
49   SET_TILE_INFO(1, 0x4000 + code, data2 & 0x3f, TILE_FLIPYX(data & 0x03));
5050}
5151
5252
r814r815
5656   int data2 = gaelco_videoram[(0x1000/2) + (tile_index << 1) + 1];
5757   int code = ((data & 0xfffc) >> 2);
5858
59   tileinfo->priority = (data2 >> 6) & 0x03;
59   tileinfo->category = (data2 >> 6) & 0x03;
6060
61   SET_TILE_INFO(1, 0x4000 + code, data2 & 0x3f, TILE_FLIPYX(data & 0x03))
61   SET_TILE_INFO(1, 0x4000 + code, data2 & 0x3f, TILE_FLIPYX(data & 0x03));
6262}
6363
6464/***************************************************************************
r814r815
8181
8282VIDEO_START( bigkarnk )
8383{
84   pant[0] = tilemap_create(get_tile_info_gaelco_screen0,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
85   pant[1] = tilemap_create(get_tile_info_gaelco_screen1,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
84   pant[0] = tilemap_create(get_tile_info_gaelco_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
85   pant[1] = tilemap_create(get_tile_info_gaelco_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
8686
8787   tilemap_set_transmask(pant[0],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
8888   tilemap_set_transmask(pant[1],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
r814r815
9090
9191VIDEO_START( maniacsq )
9292{
93   pant[0] = tilemap_create(get_tile_info_gaelco_screen0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
94   pant[1] = tilemap_create(get_tile_info_gaelco_screen1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
93   pant[0] = tilemap_create(get_tile_info_gaelco_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
94   pant[1] = tilemap_create(get_tile_info_gaelco_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
9595
9696   tilemap_set_transparent_pen(pant[0],0);
9797   tilemap_set_transparent_pen(pant[1],0);
r814r815
225225   fillbitmap(priority_bitmap,0,cliprect);
226226   fillbitmap( bitmap, machine->pens[0], cliprect );
227227
228   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_BACK | 3,0);
229   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_BACK | 3,0);
228   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 3,0);
229   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 3,0);
230230
231   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_FRONT | 3,1);
232   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_FRONT | 3,1);
231   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER0 | 3,1);
232   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER0 | 3,1);
233233
234   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_BACK | 2,1);
235   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_BACK | 2,1);
234   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 2,1);
235   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 2,1);
236236
237   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_FRONT | 2,2);
238   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_FRONT | 2,2);
237   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER0 | 2,2);
238   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER0 | 2,2);
239239
240   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_BACK | 1,2);
241   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_BACK | 1,2);
240   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 1,2);
241   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 1,2);
242242
243   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_FRONT | 1,4);
244   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_FRONT | 1,4);
243   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER0 | 1,4);
244   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER0 | 1,4);
245245
246   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_BACK | 0,4);
247   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_BACK | 0,4);
246   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 0,4);
247   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 0,4);
248248
249   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_FRONT | 0,8);
250   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_FRONT | 0,8);
249   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER0 | 0,8);
250   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER0 | 0,8);
251251
252252   draw_sprites(machine,bitmap,cliprect);
253253   return 0;
src/mame/video/bankp.c
r814r815
138138   int color = bankp_colorram2[tile_index] >> 4;
139139   int flags = (bankp_colorram2[tile_index] & 0x08) ? TILE_FLIPX : 0;
140140
141   SET_TILE_INFO(1, code, color, flags)
141   SET_TILE_INFO(1, code, color, flags);
142142}
143143
144144static TILE_GET_INFO( get_fg_tile_info )
r814r815
147147   int color = colorram[tile_index] >> 3;
148148   int flags = (colorram[tile_index] & 0x04) ? TILE_FLIPX : 0;
149149
150   SET_TILE_INFO(0, code, color, flags)
150   SET_TILE_INFO(0, code, color, flags);
151151}
152152
153153VIDEO_START( bankp )
154154{
155155   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
156      TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 32, 32);
156      TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
157157
158158   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
159      TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 32, 32);
159      TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
160160
161161   tilemap_set_transparent_pen(bg_tilemap, 0);
162162   tilemap_set_transparent_pen(fg_tilemap, 0);
r814r815
180180   switch (priority)
181181   {
182182   case 0: // combat hawk uses this
183      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
183      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
184184      tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
185185      break;
186186   case 1:
187      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
187      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
188188      tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
189189      break;
190190   case 2:
191      tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
191      tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
192192      tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
193193      break;
194194   case 3:
195      tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0); // just a guess
195      tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_DRAW_OPAQUE, 0); // just a guess
196196      tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
197197      break;
198198   }
src/mame/video/tankbust.c
r814r815
5454#endif
5555
5656   /* priority bg/sprites (1 = this bg tile on top of sprites) */
57   tileinfo->priority = (attr & 0x08) >> 3;
57   tileinfo->category = (attr & 0x08) >> 3;
5858
5959   SET_TILE_INFO(   1,
6060         code,
6161         (color&4) | ((color&2)>>1) | ((color&1)<<1),
62         0)
62         0);
6363}
6464
6565static TILE_GET_INFO( get_txt_tile_info )
r814r815
7070   SET_TILE_INFO(   2,
7171         code & 0x3f,
7272         ((color&2)>>1) | ((color&1)<<1),
73         0)
73         0);
7474}
7575
7676
r814r815
8383VIDEO_START( tankbust )
8484{
8585   /* not scrollable */
86   txt_tilemap = tilemap_create(get_txt_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
86   txt_tilemap = tilemap_create(get_txt_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
8787
8888   /* scrollable */
89   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
89   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
9090
9191
9292   tilemap_set_transparent_pen(txt_tilemap, 0);
src/mame/video/wecleman.c
r814r815
419419TILE_GET_INFO( wecleman_get_txt_tile_info )
420420{
421421   int code = wecleman_txtram[tile_index];
422   SET_TILE_INFO(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0)
422   SET_TILE_INFO(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0);
423423}
424424
425425WRITE16_HANDLER( wecleman_txtram_w )
r814r815
467467   int page = wecleman_bgpage[((tile_index&0x7f)>>6) + ((tile_index>>12)<<1)];
468468   int code = wecleman_pageram[(tile_index&0x3f) + ((tile_index>>7&0x1f)<<6) + (page<<11)];
469469
470   SET_TILE_INFO(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0)
470   SET_TILE_INFO(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0);
471471}
472472
473473/*------------------------------------------------------------------------
r814r815
480480   int code = wecleman_pageram[(tile_index&0x3f) + ((tile_index>>7&0x1f)<<6) + (page<<11)];
481481
482482   if (!code || code==0xffff) code = 0x20;
483   SET_TILE_INFO(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0)
483   SET_TILE_INFO(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0);
484484}
485485
486486/*------------------------------------------------------------------------
r814r815
920920
921921   bg_tilemap = tilemap_create(wecleman_get_bg_tile_info,
922922                        tilemap_scan_rows,
923                        TILEMAP_TYPE_TRANSPARENT,   /* We draw part of the road below */
923                        TILEMAP_TYPE_PEN,   /* We draw part of the road below */
924924                        8,8,
925925                        PAGE_NX * 2, PAGE_NY * 2 );
926926
927927   fg_tilemap = tilemap_create(wecleman_get_fg_tile_info,
928928                        tilemap_scan_rows,
929                        TILEMAP_TYPE_TRANSPARENT,
929                        TILEMAP_TYPE_PEN,
930930                        8,8,
931931                        PAGE_NX * 2, PAGE_NY * 2);
932932
933933   txt_tilemap = tilemap_create(wecleman_get_txt_tile_info,
934934                         tilemap_scan_rows,
935                         TILEMAP_TYPE_TRANSPARENT,
935                         TILEMAP_TYPE_PEN,
936936                         8,8,
937937                         PAGE_NX * 1, PAGE_NY * 1);
938938
r814r815
998998
999999   sprite_list = sprite_list_create(NUM_SPRITES);
10001000
1001   K051316_vh_start_0(machine,ZOOMROM0_MEM_REGION,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback_0);
1002   K051316_vh_start_1(machine,ZOOMROM1_MEM_REGION,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback_1);
1001   K051316_vh_start_0(machine,ZOOMROM0_MEM_REGION,4,FALSE,0,zoom_callback_0);
1002   K051316_vh_start_1(machine,ZOOMROM1_MEM_REGION,4,FALSE,0,zoom_callback_1);
10031003
10041004   K051316_wraparound_enable(0,1);
10051005//  K051316_wraparound_enable(1,1);
src/mame/video/crbaloon.c
r814r815
8888   int code = videoram[tile_index];
8989   int color = colorram[tile_index] & 0x0f;
9090
91   SET_TILE_INFO(0, code, color, 0)
91   SET_TILE_INFO(0, code, color, 0);
9292}
9393
9494VIDEO_START( crbaloon )
9595{
9696   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy,
97      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
97      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9898
9999   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
100100
src/mame/video/portrait.c
r814r815
4646         break;
4747   }
4848
49   SET_TILE_INFO( 0, tilenum, color, flags )
49   SET_TILE_INFO( 0, tilenum, color, flags );
5050}
5151
5252static TILE_GET_INFO( get_bg_tile_info )
r814r815
6161
6262VIDEO_START( portrait )
6363{
64   background = tilemap_create( get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      16, 16, 32, 32 );
65   foreground = tilemap_create( get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32 );
64   background = tilemap_create( get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 32, 32 );
65   foreground = tilemap_create( get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32 );
6666
6767      tilemap_set_transparent_pen( foreground, 0 );
6868}
src/mame/video/bosco.c
r814r815
9797***************************************************************************/
9898
9999/* the video RAM has space for 32x32 tiles and is only partially used for the radar */
100static UINT32 fg_tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
100static TILEMAP_MAPPER( fg_tilemap_scan )
101101{
102102   return col + (row << 5);
103103}
r814r815
106106INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int ram_offs)
107107{
108108   UINT8 attr = bosco_videoram[ram_offs + tile_index + 0x800];
109   tileinfo->priority = (attr & 0x20) >> 5;
109   tileinfo->category = (attr & 0x20) >> 5;
110110   SET_TILE_INFO(
111111         0,
112112         bosco_videoram[ram_offs + tile_index],
113113         attr & 0x3f,
114         TILE_FLIPYX(attr >> 6) ^ TILE_FLIPX)
114         TILE_FLIPYX(attr >> 6) ^ TILE_FLIPX);
115115}
116116
117117static TILE_GET_INFO( bg_get_tile_info )
r814r815
135135VIDEO_START( bosco )
136136{
137137
138   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
139   fg_tilemap = tilemap_create(fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_OPAQUE,8,8, 8,32);
138   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
139   fg_tilemap = tilemap_create(fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_PEN,8,8, 8,32);
140140
141141   tilemap_set_scrolldx(bg_tilemap,3,3);
142142
src/mame/video/funkybee.c
r814r815
7878   int code = videoram[tile_index] + ((colorram[tile_index] & 0x80) << 1);
7979   int color = colorram[tile_index] & 0x03;
8080
81   SET_TILE_INFO(gfx_bank, code, color, 0)
81   SET_TILE_INFO(gfx_bank, code, color, 0);
8282}
8383
84static UINT32 funkybee_tilemap_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
84static TILEMAP_MAPPER( funkybee_tilemap_scan )
8585{
8686   /* logical (col,row) -> memory offset */
8787   return 256 * row + col;
r814r815
9090VIDEO_START( funkybee )
9191{
9292   bg_tilemap = tilemap_create(get_bg_tile_info, funkybee_tilemap_scan,
93      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
93      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9494}
9595
9696static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/tetrisp2.c
r814r815
159159         1,
160160         code_hi,
161161         code_lo & 0xf,
162         0)
162         0);
163163}
164164
165165WRITE16_HANDLER( tetrisp2_vram_bg_w )
r814r815
181181         3,
182182         code_hi,
183183         code_lo & 0xf,
184         0)
184         0);
185185}
186186
187187WRITE16_HANDLER( tetrisp2_vram_fg_w )
r814r815
199199         2,
200200         code_hi,
201201         code_lo & 0xf,
202         0)
202         0);
203203}
204204
205205WRITE16_HANDLER( tetrisp2_vram_rot_w )
r814r815
216216         5,
217217         code_hi,
218218         code_lo & 0xf,
219         0)
219         0);
220220}
221221
222222WRITE16_HANDLER( rocknms_sub_vram_bg_w )
r814r815
234234         7,
235235         code_hi,
236236         code_lo & 0xf,
237         0)
237         0);
238238}
239239
240240WRITE16_HANDLER( rocknms_sub_vram_fg_w )
r814r815
252252         6,
253253         code_hi,
254254         code_lo & 0xf,
255         0)
255         0);
256256}
257257
258258WRITE16_HANDLER( rocknms_sub_vram_rot_w )
r814r815
267267VIDEO_START( tetrisp2 )
268268{
269269   tilemap_bg = tilemap_create(   get_tile_info_bg,tilemap_scan_rows,
270                        TILEMAP_TYPE_TRANSPARENT,
270                        TILEMAP_TYPE_PEN,
271271                        16,16,NX_0,NY_0);
272272
273273   tilemap_fg = tilemap_create(   get_tile_info_fg,tilemap_scan_rows,
274                        TILEMAP_TYPE_TRANSPARENT,
274                        TILEMAP_TYPE_PEN,
275275                        8,8,NX_1,NY_1);
276276
277277   tilemap_rot = tilemap_create(   get_tile_info_rot,tilemap_scan_rows,
278                        TILEMAP_TYPE_TRANSPARENT,
278                        TILEMAP_TYPE_PEN,
279279                        16,16,NX_0*2,NY_0*2);
280280
281281   tilemap_set_transparent_pen(tilemap_bg,0);
r814r815
286286VIDEO_START( rockntread )
287287{
288288   tilemap_bg = tilemap_create(   get_tile_info_bg,tilemap_scan_rows,
289                        TILEMAP_TYPE_TRANSPARENT,
289                        TILEMAP_TYPE_PEN,
290290                        16, 16, 256, 16);   // rockn ms(main),1,2,3,4
291291
292292   tilemap_fg = tilemap_create(   get_tile_info_fg,tilemap_scan_rows,
293                        TILEMAP_TYPE_TRANSPARENT,
293                        TILEMAP_TYPE_PEN,
294294                        8, 8, 64, 64);
295295
296296   tilemap_rot = tilemap_create(   get_tile_info_rot,tilemap_scan_rows,
297                        TILEMAP_TYPE_TRANSPARENT,
297                        TILEMAP_TYPE_PEN,
298298                        16, 16, 128, 128);
299299
300300   tilemap_set_transparent_pen(tilemap_bg, 0);
r814r815
306306VIDEO_START( rocknms )
307307{
308308   tilemap_bg = tilemap_create(get_tile_info_bg,tilemap_scan_rows,
309               TILEMAP_TYPE_TRANSPARENT,
309               TILEMAP_TYPE_PEN,
310310               16, 16, 256, 16);   // rockn ms(main),1,2,3,4
311311
312312   tilemap_fg = tilemap_create(get_tile_info_fg,tilemap_scan_rows,
313               TILEMAP_TYPE_TRANSPARENT,
313               TILEMAP_TYPE_PEN,
314314               8, 8, 64, 64);
315315
316316   tilemap_rot = tilemap_create(get_tile_info_rot,tilemap_scan_rows,
317               TILEMAP_TYPE_TRANSPARENT,
317               TILEMAP_TYPE_PEN,
318318               16, 16, 128, 128);
319319
320320   tilemap_sub_bg = tilemap_create(get_tile_info_rocknms_sub_bg,tilemap_scan_rows,
321               TILEMAP_TYPE_TRANSPARENT,
321               TILEMAP_TYPE_PEN,
322322               16, 16, 32, 256);   // rockn ms(sub)
323323
324324   tilemap_sub_fg = tilemap_create(get_tile_info_rocknms_sub_fg,tilemap_scan_rows,
325               TILEMAP_TYPE_TRANSPARENT,
325               TILEMAP_TYPE_PEN,
326326               8, 8, 64, 64);
327327
328328   tilemap_sub_rot = tilemap_create( get_tile_info_rocknms_sub_rot,tilemap_scan_rows,
329               TILEMAP_TYPE_TRANSPARENT,
329               TILEMAP_TYPE_PEN,
330330               16, 16, 128, 128);
331331
332332   tilemap_set_transparent_pen(tilemap_bg, 0);
src/mame/video/lastduel.c
r814r815
2929   SET_TILE_INFO(
3030         2,
3131         tile,color & 0xf,
32         TILE_FLIPYX((color & 0x60) >> 5))
32         TILE_FLIPYX((color & 0x60) >> 5));
3333}
3434
3535static TILE_GET_INFO( ld_get_fg_tile_info )
r814r815
4040         3,
4141         tile,
4242         color & 0xf,
43         TILE_FLIPYX((color & 0x60) >> 5) | TILE_SPLIT((color & 0x80) >> 7))
43         TILE_FLIPYX((color & 0x60) >> 5));
44   tileinfo->group = (color & 0x80) >> 7;
4445}
4546
4647static TILE_GET_INFO( get_bg_tile_info )
r814r815
5152         2,
5253         tile,
5354         color & 0xf,
54         TILE_FLIPYX((color & 0x60) >> 5))
55         TILE_FLIPYX((color & 0x60) >> 5));
5556}
5657
5758static TILE_GET_INFO( get_fg_tile_info )
r814r815
6263         3,
6364         tile,
6465         color & 0xf,
65         TILE_FLIPYX((color & 0x60) >> 5) | TILE_SPLIT((color & 0x10) >> 4))
66         TILE_FLIPYX((color & 0x60) >> 5));
67   tileinfo->group = (color & 0x10) >> 4;
6668}
6769
6870static TILE_GET_INFO( get_fix_info )
r814r815
7274         1,
7375         tile & 0x7ff,
7476         tile>>12,
75         (tile & 0x800) ? TILE_FLIPY : 0)
77         (tile & 0x800) ? TILE_FLIPY : 0);
7678}
7779
7880
r814r815
8587
8688VIDEO_START( lastduel )
8789{
88   bg_tilemap = tilemap_create(ld_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,16,16,64,64);
89   fg_tilemap = tilemap_create(ld_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,64,64);
90   tx_tilemap = tilemap_create(get_fix_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
90   bg_tilemap = tilemap_create(ld_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
91   fg_tilemap = tilemap_create(ld_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
92   tx_tilemap = tilemap_create(get_fix_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
9193
9294   tilemap_set_transmask(fg_tilemap,0,0xffff,0x0001);
9395   tilemap_set_transmask(fg_tilemap,1,0xf07f,0x0f81);
r814r815
99101
100102VIDEO_START( madgear )
101103{
102   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,16,16,64,32);
103   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_SPLIT,16,16,64,32);
104   tx_tilemap = tilemap_create(get_fix_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
104   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
105   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
106   tx_tilemap = tilemap_create(get_fix_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
105107
106108   tilemap_set_transmask(fg_tilemap,0,0xffff,0x8000);
107109   tilemap_set_transmask(fg_tilemap,1,0x80ff,0xff00);
r814r815
233235VIDEO_UPDATE( lastduel )
234236{
235237   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
236   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_BACK,0);
238   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER1,0);
237239   draw_sprites(machine,bitmap,cliprect,0);
238   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_FRONT,0);
240   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER0,0);
239241   draw_sprites(machine,bitmap,cliprect,1);
240242   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
241243   return 0;
src/mame/video/alpha68k.c
r814r815
4949
5050   tile=tile | (bank_base<<8);
5151
52   SET_TILE_INFO(
53         0,
54         tile,
55         color,
56         0)
52   SET_TILE_INFO(0, tile, color, 0);
5753}
5854
5955WRITE16_HANDLER( alpha68k_videoram_w )
r814r815
7268
7369VIDEO_START( alpha68k )
7470{
75   fix_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
71   fix_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
7672
7773   tilemap_set_transparent_pen(fix_tilemap,0);
7874}
src/mame/video/drgnmst.c
r814r815
2424   colour = drgnmst_fg_videoram[tile_index*2+1] & 0x1f;
2525   flipyx = (drgnmst_fg_videoram[tile_index*2+1] & 0x60)>>5;
2626
27   SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(flipyx))
27   SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(flipyx));
2828}
2929
3030WRITE16_HANDLER( drgnmst_fg_videoram_w )
r814r815
4242   colour = drgnmst_bg_videoram[tile_index*2+1] & 0x1f;
4343   flipyx = (drgnmst_bg_videoram[tile_index*2+1] & 0x60)>>5;
4444
45   SET_TILE_INFO(3,tileno,colour,TILE_FLIPYX(flipyx))
45   SET_TILE_INFO(3,tileno,colour,TILE_FLIPYX(flipyx));
4646}
4747
4848WRITE16_HANDLER( drgnmst_bg_videoram_w )
r814r815
5959   colour = drgnmst_md_videoram[tile_index*2+1] & 0x1f;
6060   flipyx = (drgnmst_md_videoram[tile_index*2+1] & 0x60)>>5;
6161
62   SET_TILE_INFO(2,tileno,colour,TILE_FLIPYX(flipyx))
62   SET_TILE_INFO(2,tileno,colour,TILE_FLIPYX(flipyx));
6363}
6464
6565WRITE16_HANDLER( drgnmst_md_videoram_w )
r814r815
116116}
117117
118118
119UINT32 drgnmst_fg_tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
119static TILEMAP_MAPPER( drgnmst_fg_tilemap_scan_cols )
120120{
121121   return (col*32)+(row&0x1f)+((row&0xe0)>>5)*2048;
122122}
123123
124UINT32 drgnmst_md_tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
124static TILEMAP_MAPPER( drgnmst_md_tilemap_scan_cols )
125125{
126126   return (col*16)+(row&0x0f)+((row&0xf0)>>4)*1024;
127127}
128128
129UINT32 drgnmst_bg_tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
129static TILEMAP_MAPPER( drgnmst_bg_tilemap_scan_cols )
130130{
131131   return (col*8)+(row&0x07)+((row&0xf8)>>3)*512;
132132}
133133
134134VIDEO_START(drgnmst)
135135{
136   drgnmst_fg_tilemap = tilemap_create(get_drgnmst_fg_tile_info,drgnmst_fg_tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,      8, 8, 64,64);
136   drgnmst_fg_tilemap = tilemap_create(get_drgnmst_fg_tile_info,drgnmst_fg_tilemap_scan_cols,TILEMAP_TYPE_PEN,      8, 8, 64,64);
137137   tilemap_set_transparent_pen(drgnmst_fg_tilemap,15);
138138
139   drgnmst_md_tilemap = tilemap_create(get_drgnmst_md_tile_info,drgnmst_md_tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,      16, 16, 64,64);
139   drgnmst_md_tilemap = tilemap_create(get_drgnmst_md_tile_info,drgnmst_md_tilemap_scan_cols,TILEMAP_TYPE_PEN,      16, 16, 64,64);
140140   tilemap_set_transparent_pen(drgnmst_md_tilemap,15);
141141
142   drgnmst_bg_tilemap = tilemap_create(get_drgnmst_bg_tile_info,drgnmst_bg_tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,      32, 32, 64,64);
142   drgnmst_bg_tilemap = tilemap_create(get_drgnmst_bg_tile_info,drgnmst_bg_tilemap_scan_cols,TILEMAP_TYPE_PEN,      32, 32, 64,64);
143143   tilemap_set_transparent_pen(drgnmst_bg_tilemap,15);
144144
145145   // do the other tilemaps have rowscroll too? probably not ..
r814r815
171171      case 0x2d9a: // fg unsure
172172      case 0x2440: // all ok
173173      case 0x245a: // fg unsure, title screen
174         tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
174         tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,TILEMAP_DRAW_OPAQUE,0);
175175         tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,0,0);
176176         tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,0,0);
177177         break;
178178      case 0x23c0: // all ok
179         tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
179         tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
180180         tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,0,0);
181181         tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,0,0);
182182         break;
183183      case 0x38da: // fg unsure
184184      case 0x215a: // fg unsure
185185      case 0x2140: // all ok
186         tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
186         tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,TILEMAP_DRAW_OPAQUE,0);
187187         tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,0,0);
188188         tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,0,0);
189189         break;
190190      case 0x2d80: // all ok
191         tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
191         tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,TILEMAP_DRAW_OPAQUE,0);
192192         tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,0,0);
193193         tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,0,0);
194194         break;
195195      default:
196         tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
196         tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
197197         tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,0,0);
198198         tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,0,0);
199199         logerror ("unknown video priority regs %04x\n", drgnmst_vidregs2[0]);
src/mame/video/freekick.c
r814r815
1212
1313   tileno = freek_videoram[tile_index]+((freek_videoram[tile_index+0x400]&0xe0)<<3);
1414   palno=freek_videoram[tile_index+0x400]&0x1f;
15   SET_TILE_INFO(0,tileno,palno,0)
15   SET_TILE_INFO(0,tileno,palno,0);
1616}
1717
1818
1919
2020VIDEO_START(freekick)
2121{
22   freek_tilemap = tilemap_create(get_freek_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,32,32);
22   freek_tilemap = tilemap_create(get_freek_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
2323}
2424
2525
src/mame/video/namcos22.c
r814r815
18251825   SET_TILE_INFO( GFX_CHAR,data&0x03ff,data>>12,TILE_FLIPYX((data&0x0c00)>>10) );
18261826   if( data&0x8000 )
18271827   {
1828      tileinfo->priority = 1;
1828      tileinfo->category = 1;
18291829   }
18301830} /* TextTilemapGetInfo */
18311831
r814r815
18451845DrawTranslucentCharacters( mame_bitmap *bitmap, const rectangle *cliprect )
18461846{
18471847   alpha_set_level( 0xff-mixer.text_translucency ); /* ? */
1848   tilemap_draw( bitmap, cliprect, bgtilemap, TILEMAP_ALPHA|1, 0 );
1848   tilemap_draw( bitmap, cliprect, bgtilemap, TILEMAP_DRAW_ALPHA|1, 0 );
18491849}
18501850
18511851static void DrawCharacterLayer(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
r814r815
25422542
25432543static void video_start_common(running_machine *machine)
25442544{
2545   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64 );
2545   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64 );
25462546      tilemap_set_transparent_pen( bgtilemap, 0xf );
25472547
25482548   mbDSPisActive = 0;
src/mame/video/redclash.c
r814r815
149149   int code = videoram[tile_index];
150150   int color = (videoram[tile_index] & 0x70) >> 4; // ??
151151
152   SET_TILE_INFO(0, code, color, 0)
152   SET_TILE_INFO(0, code, color, 0);
153153}
154154
155155VIDEO_START( redclash )
156156{
157157   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
158      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
158      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
159159
160160   tilemap_set_transparent_pen(fg_tilemap, 0);
161161}
src/mame/video/flyball.c
r814r815
1717UINT8* flyball_playfield_ram;
1818
1919
20static UINT32 flyball_get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
20static TILEMAP_MAPPER( flyball_get_memory_offset )
2121{
2222   if (col == 0)
2323   {
r814r815
4343      code += 64;
4444   }
4545
46   SET_TILE_INFO(0, code, 0, flags)
46   SET_TILE_INFO(0, code, 0, flags);
4747}
4848
4949
5050VIDEO_START( flyball )
5151{
5252   flyball_tilemap = tilemap_create(flyball_get_tile_info,
53      flyball_get_memory_offset, TILEMAP_TYPE_OPAQUE, 8, 16, 32, 16);
53      flyball_get_memory_offset, TILEMAP_TYPE_PEN, 8, 16, 32, 16);
5454}
5555
5656
src/mame/video/xybots.c
r814r815
2222   int code = data & 0x3ff;
2323   int color = (data >> 12) & 7;
2424   int opaque = data & 0x8000;
25   SET_TILE_INFO(2, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
25   SET_TILE_INFO(2, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
2626}
2727
2828
r814r815
8282   };
8383
8484   /* initialize the playfield */
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
8686
8787   /* initialize the motion objects */
8888   atarimo_init(machine, 0, &modesc);
8989
9090   /* initialize the alphanumerics */
91   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
91   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
9292   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
9393}
9494
src/mame/video/rockola.c
r814r815
158158   int code = videoram[tile_index] + 256 * charbank;
159159   int color = (colorram[tile_index] & 0x38) >> 3;
160160
161   SET_TILE_INFO(1, code, color, 0)
161   SET_TILE_INFO(1, code, color, 0);
162162}
163163
164164static TILE_GET_INFO( get_fg_tile_info )
r814r815
169169   decodechar(machine->gfx[0], code, rockola_charram,
170170      machine->drv->gfxdecodeinfo[0].gfxlayout);
171171
172   SET_TILE_INFO(0, code, color, 0)
172   SET_TILE_INFO(0, code, color, 0);
173173}
174174
175175VIDEO_START( rockola )
176176{
177177   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
178      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
178      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
179179
180180   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
181      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
181      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
182182
183183   tilemap_set_transparent_pen(fg_tilemap, 0);
184184}
r814r815
287287   int code = videoram[tile_index];
288288   int color = (colorram[tile_index] & 0x0c) >> 2;
289289
290   SET_TILE_INFO(1, code, color, 0)
290   SET_TILE_INFO(1, code, color, 0);
291291}
292292
293293static TILE_GET_INFO( satansat_get_fg_tile_info )
r814r815
298298   decodechar(machine->gfx[0], code, rockola_charram,
299299      machine->drv->gfxdecodeinfo[0].gfxlayout);
300300
301   SET_TILE_INFO(0, code, color, 0)
301   SET_TILE_INFO(0, code, color, 0);
302302}
303303
304304VIDEO_START( satansat )
305305{
306306   bg_tilemap = tilemap_create(satansat_get_bg_tile_info, tilemap_scan_rows,
307      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
307      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
308308
309309   fg_tilemap = tilemap_create(satansat_get_fg_tile_info, tilemap_scan_rows,
310      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
310      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
311311
312312   tilemap_set_transparent_pen(fg_tilemap, 0);
313313}
src/mame/video/centiped.c
r814r815
6464
6565VIDEO_START( centiped )
6666{
67   bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
67   bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
6868
6969   centiped_flipscreen = 0;
7070
r814r815
7575
7676VIDEO_START( warlords )
7777{
78   bg_tilemap = tilemap_create(warlords_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
78   bg_tilemap = tilemap_create(warlords_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
7979
8080   /* we overload centiped_flipscreen here to track the cocktail/upright state */
8181   centiped_flipscreen = readinputport(0) & 0x80;
r814r815
8585
8686VIDEO_START( milliped )
8787{
88   bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
88   bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
8989
9090   centiped_flipscreen = 0;
9191   state_save_register_global(centiped_flipscreen);
r814r815
9494
9595VIDEO_START( bullsdrt )
9696{
97   bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
97   bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
9898
9999   centiped_flipscreen = 0;
100100}
src/mame/video/atarisy1.c
r814r815
105105   int code = data & 0x3ff;
106106   int color = (data >> 10) & 0x07;
107107   int opaque = data & 0x2000;
108   SET_TILE_INFO(0, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
108   SET_TILE_INFO(0, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
109109}
110110
111111
r814r815
175175   decode_gfx(machine, playfield_lookup, motable);
176176
177177   /* initialize the playfield */
178   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
178   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,64);
179179
180180   /* initialize the motion objects */
181181   atarimo_init(machine, 0, &modesc);
182182
183183   /* initialize the alphanumerics */
184   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
184   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
185185   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
186186
187187   /* modify the motion object code lookup */
src/mame/video/wgp.c
r814r815
2828         2,
2929         tilenum & 0x3fff,
3030         (attr & 0x3f),   /* attr &0x1 ?? */
31         TILE_FLIPYX( (attr & 0xc0) >> 6))
31         TILE_FLIPYX( (attr & 0xc0) >> 6));
3232}
3333
3434static TILE_GET_INFO( get_piv0_tile_info )
r814r815
5656
5757static void wgp_core_vh_start(running_machine *machine, int x_offs,int y_offs,int piv_xoffs,int piv_yoffs)
5858{
59   wgp_piv_tilemap[0] = tilemap_create(get_piv0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
60   wgp_piv_tilemap[1] = tilemap_create(get_piv1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
61   wgp_piv_tilemap[2] = tilemap_create(get_piv2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
59   wgp_piv_tilemap[0] = tilemap_create(get_piv0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
60   wgp_piv_tilemap[1] = tilemap_create(get_piv1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
61   wgp_piv_tilemap[2] = tilemap_create(get_piv2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
6262
6363   TC0100SCN_vh_start(machine,1,TC0100SCN_GFX_NUM,x_offs,y_offs,0,0,0,0,0);
6464
r814r815
535535static void wgp_piv_layer_draw(mame_bitmap *bitmap,const rectangle *cliprect,int layer,int flags,UINT32 priority)
536536{
537537   mame_bitmap *srcbitmap = tilemap_get_pixmap(wgp_piv_tilemap[layer]);
538   mame_bitmap *transbitmap = tilemap_get_transparency_bitmap(wgp_piv_tilemap[layer]);
538   mame_bitmap *flagsbitmap = tilemap_get_flagsmap(wgp_piv_tilemap[layer]);
539539
540540   UINT16 *dst16,*src16;
541541   UINT8 *tsrc;
r814r815
617617
618618      x_max = x_index + screen_width * x_step;
619619      src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
620      tsrc  = BITMAP_ADDR8(transbitmap, src_y_index, 0);
620      tsrc  = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
621621      dst16 = scanline;
622622
623      if (flags & TILEMAP_IGNORE_TRANSPARENCY)
623      if (flags & TILEMAP_DRAW_OPAQUE)
624624      {
625625         for (i=0; i<screen_width; i++)
626626         {
r814r815
640640         }
641641      }
642642
643      if (flags & TILEMAP_IGNORE_TRANSPARENCY)
643      if (flags & TILEMAP_DRAW_OPAQUE)
644644         bryan2_drawscanline(bitmap,0,y,screen_width,scanline,0,ROT0,priority);
645645      else
646646         bryan2_drawscanline(bitmap,0,y,screen_width,scanline,1,ROT0,priority);
r814r815
718718#ifdef MAME_DEBUG
719719   if (dislayer[layer[0]]==0)
720720#endif
721   wgp_piv_layer_draw(bitmap,cliprect,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
721   wgp_piv_layer_draw(bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,1);
722722
723723#ifdef MAME_DEBUG
724724   if (dislayer[layer[1]]==0)
src/mame/video/welltris.c
r814r815
205205         0,
206206         (code & 0x0fff) + (gfxbank[bank] << 12),
207207         ((code & 0xe000) >> 13) + (8 * charpalettebank),
208         0)
208         0);
209209}
210210
211211WRITE16_HANDLER( welltris_charvideoram_w )
r814r815
216216
217217VIDEO_START( welltris )
218218{
219   char_tilemap = tilemap_create(get_welltris_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
219   char_tilemap = tilemap_create(get_welltris_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
220220
221221   tilemap_set_transparent_pen(char_tilemap, 15);
222222}
src/mame/video/sprint8.c
r814r815
4545      }
4646   }
4747
48   SET_TILE_INFO(code >> 7, code, color, (code & 0x40) ? (TILE_FLIPX | TILE_FLIPY) : 0)
48   SET_TILE_INFO(code >> 7, code, color, (code & 0x40) ? (TILE_FLIPX | TILE_FLIPY) : 0);
4949}
5050
5151
r814r815
6464      color = 17;
6565   }
6666
67   SET_TILE_INFO(code >> 7, code, color, (code & 0x40) ? (TILE_FLIPX | TILE_FLIPY) : 0)
67   SET_TILE_INFO(code >> 7, code, color, (code & 0x40) ? (TILE_FLIPX | TILE_FLIPY) : 0);
6868}
6969
7070
r814r815
8181   helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
8282   helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
8383
84   tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16, 8, 32, 32);
85   tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16, 8, 32, 32);
84   tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 8, 32, 32);
85   tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 8, 32, 32);
8686
8787   tilemap_set_scrolly(tilemap1, 0, +24);
8888   tilemap_set_scrolly(tilemap2, 0, +24);
src/mame/video/gumbo.c
r814r815
1818{
1919   int tileno;
2020   tileno = gumbo_bg_videoram[tile_index];
21   SET_TILE_INFO(0,tileno,0,0)
21   SET_TILE_INFO(0,tileno,0,0);
2222}
2323
2424
r814r815
3232{
3333   int tileno;
3434   tileno = gumbo_fg_videoram[tile_index];
35   SET_TILE_INFO(1,tileno,1,0)
35   SET_TILE_INFO(1,tileno,1,0);
3636}
3737
3838
3939VIDEO_START( gumbo )
4040{
41   gumbo_bg_tilemap = tilemap_create(get_gumbo_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,      8, 8, 64,32);
42   gumbo_fg_tilemap = tilemap_create(get_gumbo_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 4, 4,128,64);
41   gumbo_bg_tilemap = tilemap_create(get_gumbo_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      8, 8, 64,32);
42   gumbo_fg_tilemap = tilemap_create(get_gumbo_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 4, 4,128,64);
4343   tilemap_set_transparent_pen(gumbo_fg_tilemap,0xff);
4444}
4545
src/mame/video/dec0.c
r814r815
277277         p = *BITMAP_ADDR16(src_bitmap, (src_y + column_offset)&height_mask, src_x&width_mask);
278278
279279         src_x++;
280         if ((flags&TILEMAP_IGNORE_TRANSPARENCY) || (p&0xf))
280         if ((flags&TILEMAP_DRAW_OPAQUE) || (p&0xf))
281281         {
282            if( flags & TILEMAP_FRONT )
282            if( flags & TILEMAP_DRAW_LAYER0 )
283283            {
284284               /* Top 8 pens of top 8 palettes only */
285285               if ((p&0x88)==0x88)
r814r815
351351{
352352   flip_screen_set(dec0_pf1_control_0[0]&0x80);
353353
354   dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
354   dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
355355   draw_sprites(machine,bitmap,cliprect,0x08,0x08);
356356   dec0_pf2_draw(machine,bitmap,cliprect,0);
357357
r814r815
371371   /* WARNING: inverted wrt Midnight Resistance */
372372   if ((dec0_pri & 0x01) == 0)
373373   {
374      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
374      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
375375      dec0_pf3_draw(machine,bitmap,cliprect,0);
376376
377377      if (dec0_pri & 2)
378         dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_FRONT); /* Foreground pens only */
378         dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
379379
380380      draw_sprites(machine,bitmap,cliprect,0x00,0x00);
381381
382382      if (dec0_pri & 4)
383         dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_FRONT); /* Foreground pens only */
383         dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
384384   }
385385   else
386386   {
387      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
387      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
388388      dec0_pf2_draw(machine,bitmap,cliprect,0);
389389
390390      if (dec0_pri & 2)
391         dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_FRONT); /* Foreground pens only */
391         dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
392392
393393      draw_sprites(machine,bitmap,cliprect,0x00,0x00);
394394
395395      if (dec0_pri & 4)
396         dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_FRONT); /* Foreground pens only */
396         dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
397397   }
398398
399399   dec0_pf1_draw(machine,bitmap,cliprect,0);
r814r815
419419      /* Robocop uses it only for the title screen, so this might be just */
420420      /* completely wrong. The top 8 bits of the register might mean */
421421      /* something (they are 0x80 in midres, 0x00 here) */
422      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_BACK|TILEMAP_IGNORE_TRANSPARENCY);
422      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER1|TILEMAP_DRAW_OPAQUE);
423423
424424      if (dec0_pri & 0x02)
425425         draw_sprites(machine,bitmap,cliprect,0x08,trans);
r814r815
428428   }
429429   else
430430   {
431      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
431      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
432432
433433      if (dec0_pri & 0x02)
434434         draw_sprites(machine,bitmap,cliprect,0x08,trans);
r814r815
468468
469469   if (dec0_pri & 0x01)
470470   {
471      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
471      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
472472      dec0_pf3_draw(machine,bitmap,cliprect,0);
473473   }
474474   else
475475   {
476      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
476      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
477477      dec0_pf2_draw(machine,bitmap,cliprect,0);
478478   }
479479
r814r815
488488{
489489   flip_screen_set(dec0_pf1_control_0[0]&0x80);
490490
491   dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
491   dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
492492   dec0_pf2_draw(machine,bitmap,cliprect,0);
493493
494494   draw_sprites(machine,bitmap,cliprect,0x00,0x00);
495495
496496   /* Redraw top 8 pens of top 8 palettes over sprites */
497497   if (dec0_pri&0x80)
498      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_FRONT);
498      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0);
499499
500500   dec0_pf1_draw(machine,bitmap,cliprect,0);
501501   return 0;
r814r815
515515
516516   if (dec0_pri & 0x01)
517517   {
518      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
518      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
519519
520520      if (dec0_pri & 0x02)
521521         draw_sprites(machine,bitmap,cliprect,0x08,trans);
r814r815
524524   }
525525   else
526526   {
527      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY);
527      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
528528
529529      if (dec0_pri & 0x02)
530530         draw_sprites(machine,bitmap,cliprect,0x08,trans);
r814r815
644644
645645/******************************************************************************/
646646
647static UINT32 tile_shape0_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
647static TILEMAP_MAPPER( tile_shape0_scan )
648648{
649649   return (col & 0xf) + ((row & 0xf) << 4) + ((col & 0x30) << 4);
650650}
651651
652static UINT32 tile_shape1_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
652static TILEMAP_MAPPER( tile_shape1_scan )
653653{
654654   return (col & 0xf) + ((row & 0xf) << 4) + ((row & 0x10) << 4) + ((col & 0x10) << 5);
655655}
656656
657static UINT32 tile_shape2_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
657static TILEMAP_MAPPER( tile_shape2_scan )
658658{
659659   return (col & 0xf) + ((row & 0x3f) << 4);
660660}
661661
662static UINT32 tile_shape0_8x8_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
662static TILEMAP_MAPPER( tile_shape0_8x8_scan )
663663{
664664   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5);
665665}
666666
667static UINT32 tile_shape1_8x8_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
667static TILEMAP_MAPPER( tile_shape1_8x8_scan )
668668{
669669   return (col & 0x1f) + ((row & 0x1f) << 5) + ((row & 0x20) << 5) + ((col & 0x20) << 6);
670670}
671671
672static UINT32 tile_shape2_8x8_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
672static TILEMAP_MAPPER( tile_shape2_8x8_scan )
673673{
674674   return (col & 0x1f) + ((row & 0x7f) << 5);
675675}
r814r815
677677static TILE_GET_INFO( get_pf1_tile_info )
678678{
679679   int tile=dec0_pf1_data[tile_index];
680   SET_TILE_INFO(0,tile&0xfff,tile>>12,0)
680   SET_TILE_INFO(0,tile&0xfff,tile>>12,0);
681681}
682682
683683static TILE_GET_INFO( get_pf2_tile_info )
684684{
685685   int tile=dec0_pf2_data[tile_index];
686686   int pri=((tile>>12)>7);
687   SET_TILE_INFO(1,tile&0xfff,tile>>12,TILE_SPLIT(pri))
687   SET_TILE_INFO(1,tile&0xfff,tile>>12,0);
688   tileinfo->group = pri;
688689}
689690
690691static TILE_GET_INFO( get_pf3_tile_info )
691692{
692693   int tile=dec0_pf3_data[tile_index];
693694   int pri=((tile>>12)>7);
694   SET_TILE_INFO(2,tile&0xfff,tile>>12,TILE_SPLIT(pri))
695   SET_TILE_INFO(2,tile&0xfff,tile>>12,0);
696   tileinfo->group = pri;
695697}
696698
697699VIDEO_START( dec0_nodma )
698700{
699   pf1_tilemap_0 = tilemap_create(get_pf1_tile_info,tile_shape0_8x8_scan,TILEMAP_TYPE_TRANSPARENT, 8, 8,128, 32);
700   pf1_tilemap_1 = tilemap_create(get_pf1_tile_info,tile_shape1_8x8_scan,TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
701   pf1_tilemap_2 = tilemap_create(get_pf1_tile_info,tile_shape2_8x8_scan,TILEMAP_TYPE_TRANSPARENT, 8, 8, 32,128);
702   pf2_tilemap_0 = tilemap_create(get_pf2_tile_info,tile_shape0_scan,    TILEMAP_TYPE_TRANSPARENT,16,16, 64, 16);
703   pf2_tilemap_1 = tilemap_create(get_pf2_tile_info,tile_shape1_scan,    TILEMAP_TYPE_TRANSPARENT,16,16, 32, 32);
704   pf2_tilemap_2 = tilemap_create(get_pf2_tile_info,tile_shape2_scan,    TILEMAP_TYPE_TRANSPARENT,16,16, 16, 64);
705   pf3_tilemap_0 = tilemap_create(get_pf3_tile_info,tile_shape0_scan,    TILEMAP_TYPE_TRANSPARENT,16,16, 64, 16);
706   pf3_tilemap_1 = tilemap_create(get_pf3_tile_info,tile_shape1_scan,    TILEMAP_TYPE_TRANSPARENT,16,16, 32, 32);
707   pf3_tilemap_2 = tilemap_create(get_pf3_tile_info,tile_shape2_scan,    TILEMAP_TYPE_TRANSPARENT,16,16, 16, 64);
701   pf1_tilemap_0 = tilemap_create(get_pf1_tile_info,tile_shape0_8x8_scan,TILEMAP_TYPE_PEN, 8, 8,128, 32);
702   pf1_tilemap_1 = tilemap_create(get_pf1_tile_info,tile_shape1_8x8_scan,TILEMAP_TYPE_PEN, 8, 8, 64, 64);
703   pf1_tilemap_2 = tilemap_create(get_pf1_tile_info,tile_shape2_8x8_scan,TILEMAP_TYPE_PEN, 8, 8, 32,128);
704   pf2_tilemap_0 = tilemap_create(get_pf2_tile_info,tile_shape0_scan,    TILEMAP_TYPE_PEN,16,16, 64, 16);
705   pf2_tilemap_1 = tilemap_create(get_pf2_tile_info,tile_shape1_scan,    TILEMAP_TYPE_PEN,16,16, 32, 32);
706   pf2_tilemap_2 = tilemap_create(get_pf2_tile_info,tile_shape2_scan,    TILEMAP_TYPE_PEN,16,16, 16, 64);
707   pf3_tilemap_0 = tilemap_create(get_pf3_tile_info,tile_shape0_scan,    TILEMAP_TYPE_PEN,16,16, 64, 16);
708   pf3_tilemap_1 = tilemap_create(get_pf3_tile_info,tile_shape1_scan,    TILEMAP_TYPE_PEN,16,16, 32, 32);
709   pf3_tilemap_2 = tilemap_create(get_pf3_tile_info,tile_shape2_scan,    TILEMAP_TYPE_PEN,16,16, 16, 64);
708710
709711   dec0_spriteram=spriteram16;
710712}
src/mame/video/ssv.c
r814r815
229229   eaglshot_dirty_tile   =   (char*)auto_malloc(4 * 0x100000 / (16*8));
230230
231231   gdfs_tmap         =   tilemap_create(   get_tile_info_0, tilemap_scan_rows,
232                                 TILEMAP_TYPE_TRANSPARENT, 16,16, 0x100,0x100   );
232                                 TILEMAP_TYPE_PEN, 16,16, 0x100,0x100   );
233233
234234   tilemap_set_transparent_pen(gdfs_tmap, 0);
235235}
src/mame/video/atarig42.c
r814r815
6363   int code = data & 0xfff;
6464   int color = (data >> 12) & 0x0f;
6565   int opaque = data & 0x8000;
66   SET_TILE_INFO(1, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
66   SET_TILE_INFO(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
6767}
6868
6969
r814r815
7373   int code = (playfield_tile_bank << 12) | (data & 0xfff);
7474   int color = (atarig42_playfield_base >> 5) + ((playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7);
7575   SET_TILE_INFO(0, code, color, (data >> 15) & 1);
76   tileinfo->priority = (playfield_color_bank >> 2) & 7;
76   tileinfo->category = (playfield_color_bank >> 2) & 7;
7777}
7878
7979
80static UINT32 atarig42_playfield_scan(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
80static TILEMAP_MAPPER( atarig42_playfield_scan )
8181{
8282   int bank = 1 - (col / (num_cols / 2));
8383   return bank * (num_rows * num_cols / 2) + row * (num_cols / 2) + (col % (num_cols / 2));
r814r815
120120   atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
121121
122122   /* initialize the playfield */
123   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarig42_playfield_scan, TILEMAP_TYPE_OPAQUE, 8,8, 128,64);
123   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarig42_playfield_scan, TILEMAP_TYPE_PEN, 8,8, 128,64);
124124
125125   /* initialize the motion objects */
126126   adjusted_modesc.palettebase = atarig42_motion_object_base;
r814r815
129129   atarirle_init(0, &adjusted_modesc);
130130
131131   /* initialize the alphanumerics */
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
133133   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
134134
135135   /* reset statics */
src/mame/video/tceptor.c
r814r815
445445
446446   namco_road_set_transparent_color(machine->remapped_colortable[0xfff]);
447447
448   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 34, 28);
448   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, TILEMAP_TYPE_COLORTABLE, 8, 8, 34, 28);
449449
450450   tilemap_set_scrollx(tx_tilemap, 0, -2*8);
451451   tilemap_set_scrolly(tx_tilemap, 0, 0);
452452   tilemap_set_transparent_pen(tx_tilemap, 7);
453453
454   bg1_tilemap = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
455   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
454   bg1_tilemap = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
455   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
456456
457   tilemap_set_transparent_pen(bg1_tilemap, 0);
458   tilemap_set_transparent_pen(bg2_tilemap, 0);
459
460457   state_save_register_global(bg1_scroll_x);
461458   state_save_register_global(bg1_scroll_y);
462459   state_save_register_global(bg2_scroll_x);
src/mame/video/cop01.c
r814r815
9292     */
9393   if (attr & 0x10) pri = 0;
9494
95   SET_TILE_INFO(1,tile + ((attr & 0x03) << 8),(attr & 0x1c) >> 2,TILE_SPLIT(pri));
95   SET_TILE_INFO(1,tile + ((attr & 0x03) << 8),(attr & 0x1c) >> 2,0);
96   tileinfo->group = pri;
9697}
9798
9899static TILE_GET_INFO( get_fg_tile_info )
r814r815
111112
112113VIDEO_START( cop01 )
113114{
114   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,      8,8,64,32);
115   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
115   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      8,8,64,32);
116   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
116117
117118   tilemap_set_transparent_pen(fg_tilemap,15);
118119
r814r815
217218   tilemap_set_scrollx(bg_tilemap,0,mightguy_vreg[1] + 256 * (mightguy_vreg[2] & 1));
218219   tilemap_set_scrolly(bg_tilemap,0,mightguy_vreg[3]);
219220
220   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
221   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
221222   draw_sprites(machine, bitmap,cliprect);
222   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
223   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
223224   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0 );
224225   return 0;
225226}
src/mame/video/vindictr.c
r814r815
3535   int code = data & 0x3ff;
3636   int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20);
3737   int opaque = data & 0x8000;
38   SET_TILE_INFO(1, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
38   SET_TILE_INFO(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
3939}
4040
4141
r814r815
9595   };
9696
9797   /* initialize the playfield */
98   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
98   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
9999
100100   /* initialize the motion objects */
101101   atarimo_init(machine, 0, &modesc);
102102
103103   /* initialize the alphanumerics */
104   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
104   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
105105   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
106106}
107107
src/mame/video/hanaawas.c
r814r815
102102   int code = videoram[tile_index] + ((attr & 0x20) << 3);
103103   int color = colorram[tile_index] & 0x1f;
104104
105   SET_TILE_INFO(gfxbank, code, color, 0)
105   SET_TILE_INFO(gfxbank, code, color, 0);
106106}
107107
108108VIDEO_START( hanaawas )
109109{
110110   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
111      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
111      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
112112}
113113
114114VIDEO_UPDATE( hanaawas )
src/mame/video/aquarium.c
r814r815
100100
101101   tileno = (aquarium_txt_videoram[tile_index] & 0x0fff);
102102   colour = (aquarium_txt_videoram[tile_index] & 0xf000) >> 12;
103   SET_TILE_INFO(2,tileno,colour,0)
103   SET_TILE_INFO(2,tileno,colour,0);
104104}
105105
106106WRITE16_HANDLER( aquarium_txt_videoram_w )
r814r815
119119   colour = (aquarium_mid_videoram[tile_index*2+1] & 0x001f);
120120   flag   = TILE_FLIPYX((aquarium_mid_videoram[tile_index*2+1] & 0x300) >> 8);
121121
122   SET_TILE_INFO(1,tileno,colour,flag)
122   SET_TILE_INFO(1,tileno,colour,flag);
123123
124   tileinfo->priority = (aquarium_mid_videoram[tile_index*2+1] & 0x20) >> 5;
124   tileinfo->category = (aquarium_mid_videoram[tile_index*2+1] & 0x20) >> 5;
125125}
126126
127127WRITE16_HANDLER( aquarium_mid_videoram_w )
r814r815
140140   colour = (aquarium_bak_videoram[tile_index*2+1] & 0x001f);
141141   flag   = TILE_FLIPYX((aquarium_bak_videoram[tile_index*2+1] & 0x300) >> 8);
142142
143   SET_TILE_INFO(3,tileno,colour,flag)
143   SET_TILE_INFO(3,tileno,colour,flag);
144144
145   tileinfo->priority = (aquarium_bak_videoram[tile_index*2+1] & 0x20) >> 5;
145   tileinfo->category = (aquarium_bak_videoram[tile_index*2+1] & 0x20) >> 5;
146146}
147147
148148WRITE16_HANDLER( aquarium_bak_videoram_w )
r814r815
153153
154154VIDEO_START(aquarium)
155155{
156   aquarium_txt_tilemap = tilemap_create(get_aquarium_txt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
156   aquarium_txt_tilemap = tilemap_create(get_aquarium_txt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
157157   tilemap_set_transparent_pen(aquarium_txt_tilemap,0);
158158
159   aquarium_bak_tilemap = tilemap_create(get_aquarium_bak_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 16, 16,32,32);
160   aquarium_mid_tilemap = tilemap_create(get_aquarium_mid_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
159   aquarium_bak_tilemap = tilemap_create(get_aquarium_bak_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
160   aquarium_mid_tilemap = tilemap_create(get_aquarium_mid_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
161161   tilemap_set_transparent_pen(aquarium_mid_tilemap,0);
162162}
163163
src/mame/video/metro.c
r814r815
8383         2,
8484         code & 0x7fff,
8585         0x1e,
86         0)
86         0);
8787}
8888
8989static TILE_GET_INFO( metro_K053936_gstrik2_get_tile_info )
r814r815
9494         2,
9595         (code & 0x7fff)>>2,
9696         0x1e,
97         0)
97         0);
9898}
9999
100100WRITE16_HANDLER( metro_K053936_w )
r814r815
103103   tilemap_mark_tile_dirty(metro_K053936_tilemap,offset);
104104}
105105
106UINT32 tilemap_scan_gstrik2( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
106static TILEMAP_MAPPER( tilemap_scan_gstrik2 )
107107{
108108   /* logical (col,row) -> memory offset */
109109   int val;
r814r815
202202   {
203203      int _code = code & 0x000f;
204204      tileinfo->pen_data = empty_tiles + _code*16*16;
205      tileinfo->pal_data = &machine->remapped_colortable[(((code & 0x0ff0) ^ 0x0f0) + 0x1000)];
205      tileinfo->palette_base = ((code & 0x0ff0) ^ 0x0f0) + 0x1000;
206206      tileinfo->flags = 0;
207207   }
208208   else
r814r815
210210            0,
211211            (tile & 0xfffff) + (code & 0xf),
212212            (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100,
213            TILE_FLIPXY((code & 0x6000) >> 13))
213            TILE_FLIPXY((code & 0x6000) >> 13));
214214}
215215
216216
r814r815
238238   {
239239      int _code = code & 0x000f;
240240      tileinfo->pen_data = empty_tiles + _code*16*16;
241      tileinfo->pal_data = &machine->remapped_colortable[(((code & 0x0ff0) ^ 0x0f0) + 0x1000)];
241      tileinfo->palette_base = ((code & 0x0ff0) ^ 0x0f0) + 0x1000;
242242      tileinfo->flags = 0;
243243   }
244244   else if ((tile & 0x00f00000)==0x00f00000)   /* draw tile as 8bpp */
r814r815
246246            1,
247247            (tile & 0xfffff) + 2*(code & 0xf),
248248            ((tile & 0x0f000000) >> 24) + 0x10,
249            TILE_FLIPXY((code & 0x6000) >> 13))
249            TILE_FLIPXY((code & 0x6000) >> 13));
250250   else
251251      SET_TILE_INFO(
252252            0,
253253            (tile & 0xfffff) + (code & 0xf),
254254            (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100,
255            TILE_FLIPXY((code & 0x6000) >> 13))
255            TILE_FLIPXY((code & 0x6000) >> 13));
256256}
257257
258258/* 16x16x4 or 16x16x8 tiles. It's the tile's color that decides: if its low 4
r814r815
279279   {
280280      int _code = code & 0x000f;
281281      tileinfo->pen_data = empty_tiles + _code*16*16;
282      tileinfo->pal_data = &machine->remapped_colortable[(((code & 0x0ff0) ^ 0x0f0) + 0x1000)];
282      tileinfo->palette_base = ((code & 0x0ff0) ^ 0x0f0) + 0x1000;
283283      tileinfo->flags = 0;
284284   }
285285   else if ((tile & 0x00f00000)==0x00f00000)   /* draw tile as 8bpp */
r814r815
287287            3,
288288            (tile & 0xfffff) + 8*(code & 0xf),
289289            ((tile & 0x0f000000) >> 24) + 0x10,
290            TILE_FLIPXY((code & 0x6000) >> 13))
290            TILE_FLIPXY((code & 0x6000) >> 13));
291291   else
292292      SET_TILE_INFO(
293293            2,
294294            (tile & 0xfffff) + 4*(code & 0xf),
295295            (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100,
296            TILE_FLIPXY((code & 0x6000) >> 13))
296            TILE_FLIPXY((code & 0x6000) >> 13));
297297}
298298
299299
r814r815
391391   metro_tiletable_old = auto_malloc(metro_tiletable_size);
392392   dirtyindex = auto_malloc(metro_tiletable_size/4);
393393
394   bg_tilemap[0] = tilemap_create(get_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
395   bg_tilemap[1] = tilemap_create(get_tile_info_1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
396   bg_tilemap[2] = tilemap_create(get_tile_info_2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
394   bg_tilemap[0] = tilemap_create(get_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
395   bg_tilemap[1] = tilemap_create(get_tile_info_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
396   bg_tilemap[2] = tilemap_create(get_tile_info_2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
397397
398398   tilemap_16x16[0] = NULL;
399399   tilemap_16x16[1] = NULL;
r814r815
414414   metro_tiletable_old = auto_malloc(metro_tiletable_size);
415415   dirtyindex = auto_malloc(metro_tiletable_size/4);
416416
417   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
418   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
419   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
417   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
418   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
419   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
420420
421421   tilemap_16x16[0] = NULL;
422422   tilemap_16x16[1] = NULL;
r814r815
441441   metro_tiletable_old = auto_malloc(metro_tiletable_size);
442442   dirtyindex = auto_malloc(metro_tiletable_size/4);
443443
444   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
445   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
446   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,WIN_NX,WIN_NY);
444   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
445   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
446   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
447447
448   tilemap_16x16[0] = tilemap_create(get_tile_info_0_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,WIN_NX,WIN_NY);
449   tilemap_16x16[1] = tilemap_create(get_tile_info_1_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,WIN_NX,WIN_NY);
450   tilemap_16x16[2] = tilemap_create(get_tile_info_2_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,WIN_NX,WIN_NY);
448   tilemap_16x16[0] = tilemap_create(get_tile_info_0_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,WIN_NX,WIN_NY);
449   tilemap_16x16[1] = tilemap_create(get_tile_info_1_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,WIN_NX,WIN_NY);
450   tilemap_16x16[2] = tilemap_create(get_tile_info_2_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,WIN_NX,WIN_NY);
451451
452452   tilemap_set_transparent_pen(bg_tilemap[0],0);
453453   tilemap_set_transparent_pen(bg_tilemap[1],0);
r814r815
464464   has_zoom = 1;
465465
466466   metro_K053936_tilemap = tilemap_create(metro_K053936_get_tile_info, tilemap_scan_rows,
467                        TILEMAP_TYPE_OPAQUE, 8,8, 256, 512 );
467                        TILEMAP_TYPE_PEN, 8,8, 256, 512 );
468468
469469   K053936_wraparound_enable(0, 0);
470470   K053936_set_offset(0, -69, -21);
r814r815
481481   has_zoom = 1;
482482
483483   metro_K053936_tilemap = tilemap_create(metro_K053936_gstrik2_get_tile_info, tilemap_scan_gstrik2,
484                        TILEMAP_TYPE_OPAQUE, 16,16, 128, 256 );
484                        TILEMAP_TYPE_PEN, 16,16, 128, 256 );
485485
486486   K053936_wraparound_enable(0, 0);
487487   K053936_set_offset(0, -69, -19);
src/mame/video/angelkds.c
r814r815
2626
2727   tileno = angelkds_txvideoram[tile_index] + (angelkds_txbank * 0x100);
2828
29   SET_TILE_INFO(0,tileno,0,0)
29   SET_TILE_INFO(0,tileno,0,0);
3030}
3131
3232WRITE8_HANDLER( angelkds_txvideoram_w )
r814r815
6060   tileno = angelkds_bgtopvideoram[tile_index];
6161
6262   tileno += angelkds_bgtopbank*0x100 ;
63   SET_TILE_INFO(1,tileno,0,0)
63   SET_TILE_INFO(1,tileno,0,0);
6464}
6565
6666WRITE8_HANDLER( angelkds_bgtopvideoram_w )
r814r815
9898   tileno = angelkds_bgbotvideoram[tile_index];
9999
100100   tileno += angelkds_bgbotbank * 0x100 ;
101   SET_TILE_INFO(2,tileno,1,0)
101   SET_TILE_INFO(2,tileno,1,0);
102102}
103103
104104WRITE8_HANDLER( angelkds_bgbotvideoram_w )
r814r815
263263VIDEO_START( angelkds )
264264{
265265
266   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
266   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
267267   tilemap_set_transparent_pen(tx_tilemap,0);
268268
269   bgbot_tilemap = tilemap_create(get_bgbot_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
269   bgbot_tilemap = tilemap_create(get_bgbot_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
270270   tilemap_set_transparent_pen(bgbot_tilemap,15);
271271
272   bgtop_tilemap = tilemap_create(get_bgtop_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
272   bgtop_tilemap = tilemap_create(get_bgtop_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
273273   tilemap_set_transparent_pen(bgtop_tilemap,15);
274274}
275275
src/mame/video/circusc.c
r814r815
8989static TILE_GET_INFO( get_tile_info )
9090{
9191   UINT8 attr = circusc_colorram[tile_index];
92   tileinfo->priority = (attr & 0x10) >> 4;
92   tileinfo->category = (attr & 0x10) >> 4;
9393   SET_TILE_INFO(
9494         0,
9595         circusc_videoram[tile_index] + ((attr & 0x20) << 3),
9696         attr & 0x0f,
97         TILE_FLIPYX((attr & 0xc0) >> 6))
97         TILE_FLIPYX((attr & 0xc0) >> 6));
9898}
9999
100100
r814r815
107107
108108VIDEO_START( circusc )
109109{
110   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
110   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
111111
112112   tilemap_set_scroll_cols(bg_tilemap,32);
113113}
src/mame/video/mikie.c
r814r815
125125   int color = (colorram[tile_index] & 0x0f) + 16 * palettebank;
126126   int flags = ((colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x80) ? TILE_FLIPY : 0);
127127
128   SET_TILE_INFO(0, code, color, flags)
128   SET_TILE_INFO(0, code, color, flags);
129129}
130130
131131VIDEO_START( mikie )
132132{
133133   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
134      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
134      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
135135}
136136
137137static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/usgames.c
r814r815
4141   tileno = usg_videoram[tile_index*2];
4242   colour = usg_videoram[tile_index*2+1];
4343
44   SET_TILE_INFO(0,tileno,colour,0)
44   SET_TILE_INFO(0,tileno,colour,0);
4545}
4646
4747VIDEO_START(usg)
4848{
49   usg_tilemap = tilemap_create(get_usg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,64,32);
49   usg_tilemap = tilemap_create(get_usg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
5050}
5151
5252
src/mame/video/zaccaria.c
r814r815
136136         0,
137137         zaccaria_videoram[tile_index] + ((attr & 0x03) << 8),
138138         ((attr & 0x0c) >> 2) + ((zaccaria_attributesram[2 * (tile_index % 32) + 1] & 0x07) << 2),
139         0)
139         0);
140140}
141141
142142
r814r815
149149
150150VIDEO_START( zaccaria )
151151{
152   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
152   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
153153
154154   tilemap_set_scroll_cols(bg_tilemap,32);
155155}
src/mame/video/shadfrce.c
r814r815
1616   tileno = (shadfrce_fgvideoram[tile_index *2] & 0x00ff) | ((shadfrce_fgvideoram[tile_index *2+1] & 0x000f) << 8);
1717   colour = (shadfrce_fgvideoram[tile_index *2+1] & 0x00f0) >>4;
1818
19   SET_TILE_INFO(0,tileno,colour*4,0)
19   SET_TILE_INFO(0,tileno,colour*4,0);
2020}
2121
2222WRITE16_HANDLER( shadfrce_fgvideoram_w )
r814r815
3636   if (colour & 0x10) colour ^= 0x30;   /* skip hole */
3737   fyx = (shadfrce_bg0videoram[tile_index *2] & 0x00c0) >>6;
3838
39   SET_TILE_INFO(2,tileno,colour,TILE_FLIPYX(fyx))
39   SET_TILE_INFO(2,tileno,colour,TILE_FLIPYX(fyx));
4040}
4141
4242WRITE16_HANDLER( shadfrce_bg0videoram_w )
r814r815
5252   tileno = (shadfrce_bg1videoram[tile_index] & 0x0fff);
5353   colour = (shadfrce_bg1videoram[tile_index] & 0xf000) >> 12;
5454
55   SET_TILE_INFO(2,tileno,colour+64,0)
55   SET_TILE_INFO(2,tileno,colour+64,0);
5656}
5757
5858WRITE16_HANDLER( shadfrce_bg1videoram_w )
r814r815
6666
6767VIDEO_START( shadfrce )
6868{
69   shadfrce_fgtilemap = tilemap_create(get_shadfrce_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
69   shadfrce_fgtilemap = tilemap_create(get_shadfrce_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
7070      tilemap_set_transparent_pen(shadfrce_fgtilemap,0);
7171
72   shadfrce_bg0tilemap = tilemap_create(get_shadfrce_bg0tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
72   shadfrce_bg0tilemap = tilemap_create(get_shadfrce_bg0tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
7373      tilemap_set_transparent_pen(shadfrce_bg0tilemap,0);
7474
75   shadfrce_bg1tilemap = tilemap_create(get_shadfrce_bg1tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 16, 16,32,32);
75   shadfrce_bg1tilemap = tilemap_create(get_shadfrce_bg1tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
7676
7777   shadfrce_spvideoram_old = auto_malloc(spriteram_size);
7878}
src/mame/video/speedbal.c
r814r815
1818   int code = speedbal_background_videoram[tile_index*2] + ((speedbal_background_videoram[tile_index*2+1] & 0x30) << 4);
1919   int color = speedbal_background_videoram[tile_index*2+1] & 0x0f;
2020
21   SET_TILE_INFO(1, code, color, TILE_SPLIT(color == 8 ? 1 : 0))
21   SET_TILE_INFO(1, code, color, 0);
22   tileinfo->group = (color == 8);
2223}
2324
2425static TILE_GET_INFO( get_tile_info_fg )
r814r815
2627   int code = speedbal_foreground_videoram[tile_index*2] + ((speedbal_foreground_videoram[tile_index*2+1] & 0x30) << 4);
2728   int color = speedbal_foreground_videoram[tile_index*2+1] & 0x0f;
2829
29   SET_TILE_INFO(0, code, color, TILE_SPLIT(color == 9 ? 1 : 0))
30   SET_TILE_INFO(0, code, color, 0);
31   tileinfo->group = (color == 9);
3032}
3133
3234/*************************************
r814r815
3739
3840VIDEO_START( speedbal )
3941{
40   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols_flip_x, TILEMAP_TYPE_SPLIT, 16, 16, 16, 16);
41   fg_tilemap = tilemap_create(get_tile_info_fg, tilemap_scan_cols_flip_x, TILEMAP_TYPE_SPLIT,  8,  8, 32, 32);
42   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols_flip_x, TILEMAP_TYPE_PEN, 16, 16, 16, 16);
43   fg_tilemap = tilemap_create(get_tile_info_fg, tilemap_scan_cols_flip_x, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
4244
4345   tilemap_set_transmask(bg_tilemap,0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
4446   tilemap_set_transmask(bg_tilemap,1,0x00f7,0x0000); /* split type 1 has pen 0-2, 4-7 transparent in front half */
r814r815
124126
125127VIDEO_UPDATE( speedbal )
126128{
127   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_BACK, 0);
128   tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_BACK, 0);
129   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
130   tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_DRAW_LAYER1, 0);
129131   draw_sprites(machine, bitmap, cliprect);
130   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_FRONT, 0);
131   tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_FRONT, 0);
132   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
133   tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_DRAW_LAYER0, 0);
132134   return 0;
133135}
src/mame/video/tagteam.c
r814r815
124124   int code = videoram[tile_index] + 256 * colorram[tile_index];
125125   int color = palettebank * 2; // GUESS
126126
127   SET_TILE_INFO(0, code, color, 0)
127   SET_TILE_INFO(0, code, color, 0);
128128}
129129
130130VIDEO_START( tagteam )
131131{
132132   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_x,
133      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
133      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
134134}
135135
136136static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/bagman.c
r814r815
9898   int code = videoram[tile_index] + 8 * (colorram[tile_index] & 0x20);
9999   int color = colorram[tile_index] & 0x0f;
100100
101   SET_TILE_INFO(gfxbank, code, color, 0)
101   SET_TILE_INFO(gfxbank, code, color, 0);
102102}
103103
104104VIDEO_START( bagman )
105105{
106106   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
107      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
107      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
108108}
109109
110110static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/inufuku.c
r814r815
179179         0,
180180         inufuku_bg_videoram[tile_index],
181181         inufuku_bg_palettebank,
182         0)
182         0);
183183}
184184
185185static TILE_GET_INFO( get_inufuku_text_tile_info )
r814r815
188188         1,
189189         inufuku_text_videoram[tile_index],
190190         inufuku_text_palettebank,
191         0)
191         0);
192192}
193193
194194READ16_HANDLER( inufuku_bg_videoram_r )
r814r815
222222
223223VIDEO_START( inufuku )
224224{
225   inufuku_bg_tilemap = tilemap_create(get_inufuku_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
226   inufuku_text_tilemap = tilemap_create(get_inufuku_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
225   inufuku_bg_tilemap = tilemap_create(get_inufuku_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
226   inufuku_text_tilemap = tilemap_create(get_inufuku_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
227227
228228   tilemap_set_transparent_pen(inufuku_bg_tilemap, 255);
229229   tilemap_set_transparent_pen(inufuku_text_tilemap, 255);
src/mame/video/commando.c
r814r815
7272   int color = attr & 0x0f;
7373   int flags = TILE_FLIPYX((attr & 0x30) >> 4);
7474
75   SET_TILE_INFO(1, code, color, flags)
75   SET_TILE_INFO(1, code, color, flags);
7676}
7777
7878static TILE_GET_INFO( get_fg_tile_info )
r814r815
8282   int color = attr & 0x0f;
8383   int flags = TILE_FLIPYX((attr & 0x30) >> 4);
8484
85   SET_TILE_INFO(0, code, color, flags)
85   SET_TILE_INFO(0, code, color, flags);
8686}
8787
8888VIDEO_START( commando )
8989{
9090   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
91      TILEMAP_TYPE_OPAQUE, 16, 16, 32, 32);
91      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
9292
9393   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
94      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
94      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9595
9696   tilemap_set_transparent_pen(fg_tilemap, 3);
9797}
src/mame/video/atarisy2.c
r814r815
6565   int code = playfield_tile_bank[(data >> 10) & 1] + (data & 0x3ff);
6666   int color = (data >> 11) & 7;
6767   SET_TILE_INFO(0, code, color, 0);
68   tileinfo->priority = (~data >> 14) & 3;
68   tileinfo->category = (~data >> 14) & 3;
6969}
7070
7171
r814r815
123123   atarigen_playfield = &vram[0x2000];
124124
125125   /* initialize the playfield */
126   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 128,64);
126   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,64);
127127
128128   /* initialize the motion objects */
129129   atarimo_init(machine, 0, &modesc);
130130
131131   /* initialize the alphanumerics */
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,48);
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,48);
133133   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
134134
135135   /* reset the statics */
src/mame/video/ninjakd2.c
r814r815
1111{
1212   int code = ((ninjakd2_bg_videoram[tile_index*2 + 1] & 0xc0) << 2) | ninjakd2_bg_videoram[tile_index*2];
1313   int color = ninjakd2_bg_videoram[tile_index*2 + 1] & 0xf;
14   SET_TILE_INFO(0, code, color, TILE_FLIPYX((ninjakd2_bg_videoram[tile_index*2 + 1] & 0x30) >> 4))
14   SET_TILE_INFO(0, code, color, TILE_FLIPYX((ninjakd2_bg_videoram[tile_index*2 + 1] & 0x30) >> 4));
1515}
1616
1717static TILE_GET_INFO( get_fg_tile_info )
1818{
1919   int code = ((ninjakd2_fg_videoram[tile_index*2 + 1] & 0xc0) << 2) | ninjakd2_fg_videoram[tile_index*2];
2020   int color = ninjakd2_fg_videoram[tile_index*2 + 1] & 0xf;
21   SET_TILE_INFO(2, code, color, TILE_FLIPYX((ninjakd2_fg_videoram[tile_index*2 + 1] & 0x30) >> 4))
21   SET_TILE_INFO(2, code, color, TILE_FLIPYX((ninjakd2_fg_videoram[tile_index*2 + 1] & 0x30) >> 4));
2222}
2323
2424VIDEO_START( ninjakd2 )
2525{
26   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      16, 16, 32, 32);
27   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT,  8,  8,  32, 32);
26   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
27   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8,  32, 32);
2828
2929   tilemap_set_transparent_pen(fg_tilemap, 15);
3030
src/mame/video/skydiver.c
r814r815
4242static TILE_GET_INFO( get_tile_info )
4343{
4444   UINT8 code = skydiver_videoram[tile_index];
45   SET_TILE_INFO(0, code & 0x3f, code >> 6, 0)
45   SET_TILE_INFO(0, code & 0x3f, code >> 6, 0);
4646}
4747
4848
r814r815
5555
5656VIDEO_START( skydiver )
5757{
58   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
58   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
5959}
6060
6161
src/mame/video/yunsung8.c
r814r815
133133         0,
134134         code,
135135         color,
136         0)
136         0);
137137}
138138
139139/* Text Plane */
r814r815
149149         1,
150150         code,
151151         color,
152         0)
152         0);
153153}
154154
155155
r814r815
166166VIDEO_START( yunsung8 )
167167{
168168   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
169                        TILEMAP_TYPE_OPAQUE, 8,8, DIM_NX_0, DIM_NY_0 );
169                        TILEMAP_TYPE_PEN, 8,8, DIM_NX_0, DIM_NY_0 );
170170
171171   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
172                        TILEMAP_TYPE_TRANSPARENT, 8,8, DIM_NX_1, DIM_NY_1 );
172                        TILEMAP_TYPE_PEN, 8,8, DIM_NX_1, DIM_NY_1 );
173173
174174      tilemap_set_transparent_pen(tilemap_1,0);
175175}
src/mame/video/warpwarp.c
r814r815
148148         0,
149149         code,
150150         color,
151         0)
151         0);
152152}
153153
154154static TILE_GET_INFO( navarone_get_tile_info )
r814r815
159159         0,
160160         code,
161161         color,
162         0)
162         0);
163163}
164164
165165static TILE_GET_INFO( warpwarp_get_tile_info )
r814r815
168168         0,
169169         warpwarp_videoram[tile_index],
170170         warpwarp_videoram[tile_index + 0x400],
171         0)
171         0);
172172}
173173
174174
r814r815
181181
182182VIDEO_START( geebee )
183183{
184   bg_tilemap = tilemap_create(geebee_get_tile_info,tilemap_scan,TILEMAP_TYPE_OPAQUE,8,8,34,28);
184   bg_tilemap = tilemap_create(geebee_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,34,28);
185185}
186186
187187VIDEO_START( navarone )
188188{
189   bg_tilemap = tilemap_create(navarone_get_tile_info,tilemap_scan,TILEMAP_TYPE_OPAQUE,8,8,34,28);
189   bg_tilemap = tilemap_create(navarone_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,34,28);
190190}
191191
192192VIDEO_START( warpwarp )
193193{
194   bg_tilemap = tilemap_create(warpwarp_get_tile_info,tilemap_scan,TILEMAP_TYPE_TRANSPARENT,8,8,34,28);
194   bg_tilemap = tilemap_create(warpwarp_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,34,28);
195195}
196196
197197
src/mame/video/cbuster.c
r814r815
143143   deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
144144
145145   /* Draw playfields & sprites */
146   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
146   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
147147   draw_sprites(machine,bitmap,cliprect,0);
148148
149149   if (twocrude_pri) {
src/mame/video/gng.c
r814r815
3131         0,
3232         gng_fgvideoram[tile_index] + ((attr & 0xc0) << 2),
3333         attr & 0x0f,
34         TILE_FLIPYX((attr & 0x30) >> 4))
34         TILE_FLIPYX((attr & 0x30) >> 4));
3535}
3636
3737static TILE_GET_INFO( get_bg_tile_info )
r814r815
4141         1,
4242         gng_bgvideoram[tile_index] + ((attr & 0xc0) << 2),
4343         attr & 0x07,
44         TILE_FLIPYX((attr & 0x30) >> 4) | TILE_SPLIT((attr & 0x08) >> 3))
44         TILE_FLIPYX((attr & 0x30) >> 4));
45   tileinfo->group = (attr & 0x08) >> 3;
4546}
4647
4748
r814r815
5455
5556VIDEO_START( gng )
5657{
57   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
58   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_SPLIT,    16,16,32,32);
58   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
59   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,    16,16,32,32);
5960
6061   tilemap_set_transparent_pen(fg_tilemap,3);
6162
r814r815
146147
147148VIDEO_UPDATE( gng )
148149{
149   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
150   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
150151   draw_sprites(machine,bitmap,cliprect);
151   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
152   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
152153   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
153154   return 0;
154155}
src/mame/video/ojankohs.c
r814r815
186186      color |= (ojankohs_gfxreg & 0xe0) >> 2;
187187   }
188188
189   SET_TILE_INFO(0, tile, color, 0)
189   SET_TILE_INFO(0, tile, color, 0);
190190}
191191
192192static TILE_GET_INFO( ojankoy_get_tile_info )
r814r815
198198   flipx = ((ojankohs_colorram[tile_index] & 0x40) >> 6) ? TILEMAP_FLIPX : 0;
199199   flipy = ((ojankohs_colorram[tile_index] & 0x80) >> 7) ? TILEMAP_FLIPY : 0;
200200
201   SET_TILE_INFO(0, tile, color, (flipx | flipy))
201   SET_TILE_INFO(0, tile, color, (flipx | flipy));
202202}
203203
204204
r814r815
278278
279279VIDEO_START( ojankohs )
280280{
281   ojankohs_tilemap = tilemap_create(ojankohs_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 4, 64, 64);
281   ojankohs_tilemap = tilemap_create(ojankohs_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 4, 64, 64);
282282   ojankohs_videoram = auto_malloc(0x2000);
283283   ojankohs_colorram = auto_malloc(0x1000);
284284   ojankohs_paletteram = auto_malloc(0x800);
r814r815
286286
287287VIDEO_START( ojankoy )
288288{
289   ojankohs_tilemap = tilemap_create(ojankoy_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 4, 64, 64);
289   ojankohs_tilemap = tilemap_create(ojankoy_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 4, 64, 64);
290290   ojankohs_videoram = auto_malloc(0x2000);
291291   ojankohs_colorram = auto_malloc(0x1000);
292292   ojankohs_paletteram = auto_malloc(0x800);
src/mame/video/bfm_adr2.c
r814r815
145145   flags = ((data & 0x4000)?TILE_FLIPY:0) |
146146         ((data & 0x2000)?TILE_FLIPX:0);
147147
148   SET_TILE_INFO(0, code, color, flags)
148   SET_TILE_INFO(0, code, color, flags);
149149}
150150
151151///////////////////////////////////////////////////////////////////////////
r814r815
168168   flags = ((data & 0x4000)?TILE_FLIPY:0) |
169169         ((data & 0x2000)?TILE_FLIPX:0);
170170
171   SET_TILE_INFO(0, code, color, flags)
171   SET_TILE_INFO(0, code, color, flags);
172172}
173173
174174// video initialisation ///////////////////////////////////////////////////
r814r815
206206   state_save_register_item_array("Adder", 0, adder_ram);
207207   state_save_register_item_2d_array("Adder", 0, adder_screen_ram);
208208
209   tilemap0 = tilemap_create(get_tile0_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 50, 35);
209   tilemap0 = tilemap_create(get_tile0_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 50, 35);
210210
211   tilemap1 = tilemap_create(get_tile1_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 50, 35);
211   tilemap1 = tilemap_create(get_tile1_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 50, 35);
212212}
213213
214214// video update ///////////////////////////////////////////////////////////
src/mame/video/raiders5.c
r814r815
4343
4444   UINT8 color = raiders5_background_colorram[tile_index] >> 4;
4545
46   SET_TILE_INFO(bank, code, color, 0)
46   SET_TILE_INFO(bank, code, color, 0);
4747}
4848
4949
r814r815
5353
5454   UINT8 color = raiders5_foreground_colorram[tile_index] >> 4;
5555
56   SET_TILE_INFO(2, code, color, 0)
56   SET_TILE_INFO(2, code, color, 0);
5757}
5858
5959
r814r815
6666
6767VIDEO_START( raiders5 )
6868{
69   background_tilemap = tilemap_create(get_background_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
70   foreground_tilemap = tilemap_create(get_foreground_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
69   background_tilemap = tilemap_create(get_background_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
70   foreground_tilemap = tilemap_create(get_foreground_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
7171
7272   tilemap_set_scrolldx(background_tilemap, 7, 0);
7373
src/mame/video/wc90b.c
r814r815
2929         9 + ((attr & 3) + ((attr >> 1) & 4)),
3030         tile,
3131         attr >> 4,
32         0)
32         0);
3333}
3434
3535static TILE_GET_INFO( get_fg_tile_info )
r814r815
4040         1 + ((attr & 3) + ((attr >> 1) & 4)),
4141         tile,
4242         attr >> 4,
43         0)
43         0);
4444}
4545
4646static TILE_GET_INFO( get_tx_tile_info )
r814r815
4949         0,
5050         wc90b_txvideoram[tile_index + 0x800] + ((wc90b_txvideoram[tile_index] & 0x07) << 8),
5151         wc90b_txvideoram[tile_index] >> 4,
52         0)
52         0);
5353}
5454
5555
r814r815
6262
6363VIDEO_START( wc90b )
6464{
65   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
66   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
67   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
65   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
66   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
67   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
6868
6969   tilemap_set_transparent_pen(fg_tilemap,15);
7070   tilemap_set_transparent_pen(tx_tilemap,15);
src/mame/video/kncljoe.c
r814r815
9999         0,
100100         code,
101101         attr & 0xf,
102         TILE_FLIPXY((attr & 0x30) >> 4))
102         TILE_FLIPXY((attr & 0x30) >> 4));
103103}
104104
105105
r814r815
112112
113113VIDEO_START( kncljoe )
114114{
115   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
115   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
116116
117117   tilemap_set_scroll_rows(bg_tilemap,4);
118118
src/mame/video/holeland.c
r814r815
3131         0,
3232         tile_number,
3333         palette_offset + ((attr >> 4) & 0x0f),
34         TILE_FLIPYX((attr >> 2) & 0x03) | TILE_SPLIT((attr >> 4) & 1))
34         TILE_FLIPYX((attr >> 2) & 0x03));
35   tileinfo->group = (attr >> 4) & 1;
3536}
3637
3738static TILE_GET_INFO( crzrally_get_tile_info )
r814r815
4344         0,
4445         tile_number,
4546         palette_offset + ((attr >> 4) & 0x0f),
46         TILE_FLIPYX((attr >> 2) & 0x03) | TILE_SPLIT((attr >> 4) & 1))
47         TILE_FLIPYX((attr >> 2) & 0x03));
48   tileinfo->group = (attr >> 4) & 1;
4749}
4850
4951/***************************************************************************
r814r815
5456
5557VIDEO_START( holeland )
5658{
57   bg_tilemap = tilemap_create(holeland_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
59   bg_tilemap = tilemap_create(holeland_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
5860
5961   tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */
6062   tilemap_set_transmask(bg_tilemap,1,0x01,0xfe); /* split type 1 has pen 0? transparent in front half */
r814r815
6264
6365VIDEO_START( crzrally )
6466{
65   bg_tilemap = tilemap_create(crzrally_get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_SPLIT,8,8,32,32);
67   bg_tilemap = tilemap_create(crzrally_get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
6668}
6769
6870WRITE8_HANDLER( holeland_videoram_w )
r814r815
180182VIDEO_UPDATE( holeland )
181183{
182184/*tilemap_mark_all_tiles_dirty(bg_tilemap); */
183   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
185   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
184186   holeland_draw_sprites(machine, bitmap,cliprect);
185   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
187   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
186188   return 0;
187189}
188190
src/mame/video/liberate.c
r814r815
2828}
2929#endif
3030
31static UINT32 back_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
31static TILEMAP_MAPPER( back_scan )
3232{
3333   /* logical (col,row) -> memory offset */
3434   return ((row & 0xf)) + ((15-(col &0xf))<<4) + ((row&0x10)<<5) + ((col&0x10)<<4);
3535}
3636
37static UINT32 fix_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
37static TILEMAP_MAPPER( fix_scan )
3838{
3939   /* logical (col,row) -> memory offset */
4040   return (row & 0x1f) + ((31-(col &0x1f))<<5);
r814r815
6060
6161   tile=RAM[tile_index];
6262   if (tile>0x7f) bank=3; else bank=2;
63   SET_TILE_INFO(bank,tile&0x7f,background_color,0)
63   SET_TILE_INFO(bank,tile&0x7f,background_color,0);
6464}
6565
6666static TILE_GET_INFO( get_fix_tile_info )
r814r815
7575//else if (tile&0x100) tile-=0x100;
7676//else tile+=0x200;
7777
78   SET_TILE_INFO(0,tile,color,0)
78   SET_TILE_INFO(0,tile,color,0);
7979}
8080
8181/***************************************************************************/
r814r815
118118
119119VIDEO_START( prosoccr )
120120{
121   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_OPAQUE,16,16,32,32);
122   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
121   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_PEN,16,16,32,32);
122   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_PEN,8,8,32,32);
123123
124124   tilemap_set_transparent_pen(fix_tilemap,0);
125125}
126126
127127VIDEO_START( boomrang )
128128{
129   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_SPLIT,16,16,32,32);
130   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
129   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_PEN,16,16,32,32);
130   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_PEN,8,8,32,32);
131131
132132   tilemap_set_transmask(background_tilemap,0,0x0001,0x007e); /* Bottom 1 pen/Top 7 pens */
133133   tilemap_set_transparent_pen(fix_tilemap,0);
r814r815
135135
136136VIDEO_START( liberate )
137137{
138   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_OPAQUE,16,16,32,32);
139   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
138   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_PEN,16,16,32,32);
139   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_PEN,8,8,32,32);
140140
141141   tilemap_set_transparent_pen(fix_tilemap,0);
142142}
r814r815
393393   if (background_disable)
394394      fillbitmap(bitmap,machine->pens[32],cliprect);
395395   else
396      tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_BACK,0);
396      tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_DRAW_LAYER1,0);
397397
398398   boomrang_draw_sprites(machine,bitmap,cliprect,8);
399399   if (!background_disable)
400      tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_FRONT,0);
400      tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_DRAW_LAYER0,0);
401401   boomrang_draw_sprites(machine,bitmap,cliprect,0);
402402   tilemap_draw(bitmap,cliprect,fix_tilemap,0,0);
403403   return 0;
src/mame/video/spdodgeb.c
r814r815
5353
5454***************************************************************************/
5555
56static UINT32 background_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
56static TILEMAP_MAPPER( background_scan )
5757{
5858   /* logical (col,row) -> memory offset */
5959   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5);
r814r815
6767         0,
6868         code + ((attr & 0x1f) << 8),
6969         ((attr & 0xe0) >> 5) + 8 * tile_palbank,
70         0)
70         0);
7171}
7272
7373
r814r815
7979
8080VIDEO_START( spdodgeb )
8181{
82   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_OPAQUE,8,8,64,32);
82   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_PEN,8,8,64,32);
8383
8484   tilemap_set_scroll_rows(bg_tilemap,32);
8585}
src/mame/video/gunsmoke.c
r814r815
135135   int color = (attr & 0x3c) >> 2;
136136   int flags = TILE_FLIPYX((attr & 0xc0) >> 6);
137137
138   SET_TILE_INFO(1, code, color, flags)
138   SET_TILE_INFO(1, code, color, flags);
139139}
140140
141141static TILE_GET_INFO( get_fg_tile_info )
r814r815
144144   int code = videoram[tile_index] + ((attr & 0xe0) << 2);
145145   int color = attr & 0x1f;
146146
147   SET_TILE_INFO(0, code, color, 0)
147   SET_TILE_INFO(0, code, color, 0);
148148}
149149
150150VIDEO_START( gunsmoke )
r814r815
155155
156156   /* create tilemaps */
157157   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
158      TILEMAP_TYPE_OPAQUE, 32, 32, 2048, 8);
158      TILEMAP_TYPE_PEN, 32, 32, 2048, 8);
159159
160160   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
161      TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 32, 32);
161      TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
162162
163163   tilemap_set_transparent_pen(fg_tilemap, 0x4f);
164164
src/mame/video/turbo.c
r814r815
170170{
171171   turbo_state *state = Machine->driver_data;
172172   int code = state->videoram[tile_index];
173   SET_TILE_INFO(0, code, code >> 2, 0)
173   SET_TILE_INFO(0, code, code >> 2, 0);
174174}
175175
176176
r814r815
179179   turbo_state *state = machine->driver_data;
180180
181181   /* initialize the foreground tilemap */
182   state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
182   state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
183183}
184184
185185
r814r815
188188   turbo_state *state = machine->driver_data;
189189
190190   /* initialize the foreground tilemap */
191   state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
191   state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
192192
193193   /* allocate the bitmap RAM */
194194   state->buckrog_bitmap_ram = auto_malloc(0xe000);
src/mame/video/seta.c
r814r815
377377   UINT16 attr =   vram[ tile_index + 0x800 ];
378378   if ((code & 0x3e00) == 0x3e00)
379379      code = (code & 0xc07f) | ((twineagl_tilebank[(code & 0x0180) >> 7] >> 1) << 7);
380   SET_TILE_INFO( 1, (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14) )
380   SET_TILE_INFO( 1, (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14) );
381381}
382382
383383static TILE_GET_INFO( twineagl_get_tile_info_0 ) { twineagl_tile_info( machine, tileinfo, tile_index, seta_vram_0 + 0x0000 ); }
r814r815
388388{
389389   UINT16 code =   vram[ tile_index ];
390390   UINT16 attr =   vram[ tile_index + 0x800 ];
391   SET_TILE_INFO( 1 + layer, seta_tiles_offset + (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14) )
391   SET_TILE_INFO( 1 + layer, seta_tiles_offset + (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14) );
392392}
393393
394394static TILE_GET_INFO( get_tile_info_0 ) { get_tile_info( machine, tileinfo, tile_index, 0, seta_vram_0 + 0x0000 ); }
r814r815
445445
446446   /* layer 0 */
447447   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
448                        TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32 );
448                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
449449
450450   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
451                        TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32 );
451                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
452452
453453
454454   /* layer 1 */
455455   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
456                        TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32 );
456                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
457457
458458   tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
459                        TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32 );
459                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
460460
461461      tilemaps_flip = 0;
462462
r814r815
478478
479479   /* layer 0 */
480480   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
481                        TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32 );
481                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
482482
483483   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
484                        TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32 );
484                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
485485
486486
487487   /* NO layer 1 */
r814r815
504504
505505   /* layer 0 */
506506   tilemap_0 = tilemap_create(   twineagl_get_tile_info_0, tilemap_scan_rows,
507                        TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32 );
507                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
508508
509509   tilemap_1 = tilemap_create(   twineagl_get_tile_info_1, tilemap_scan_rows,
510                        TILEMAP_TYPE_TRANSPARENT, 16,16, 64,32 );
510                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
511511
512512
513513   /* NO layer 1 */
r814r815
918918   {
919919      if (tilemap_2)
920920      {
921         if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tilemap_2, TILEMAP_IGNORE_TRANSPARENCY, 0);
922         if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tilemap_3, TILEMAP_IGNORE_TRANSPARENCY, 0);
921         if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tilemap_2, TILEMAP_DRAW_OPAQUE, 0);
922         if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tilemap_3, TILEMAP_DRAW_OPAQUE, 0);
923923      }
924924
925925      if (order & 2)   // layer-sprite priority?
r814r815
937937   }
938938   else
939939   {
940      if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tilemap_0,  TILEMAP_IGNORE_TRANSPARENCY, 0);
941      if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tilemap_1,  TILEMAP_IGNORE_TRANSPARENCY, 0);
940      if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tilemap_0,  TILEMAP_DRAW_OPAQUE, 0);
941      if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tilemap_1,  TILEMAP_DRAW_OPAQUE, 0);
942942
943943      if (order & 2)   // layer-sprite priority?
944944      {
src/mame/video/tp84.c
r814r815
186186   int color = (attr & 0x0f) + coloffs;
187187   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
188188
189   SET_TILE_INFO(0, code, color, flags)
189   SET_TILE_INFO(0, code, color, flags);
190190}
191191
192192static TILE_GET_INFO( get_fg_tile_info )
r814r815
195195   int attr = tp84_colorram2[tile_index];
196196   int code = tp84_videoram2[tile_index]+ ((attr & 0x30) << 4);
197197   int color = (attr & 0x0f) + coloffs;
198   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0) | TILE_IGNORE_TRANSPARENCY;
198   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0) | TILE_FORCE_LAYER0;
199199
200   SET_TILE_INFO(0, code, color, flags)
200   SET_TILE_INFO(0, code, color, flags);
201201}
202202
203203VIDEO_START( tp84 )
204204{
205205   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
206      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
206      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
207207
208208   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
209      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
209      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
210210
211211   tilemap_set_transparent_pen(fg_tilemap, 0);
212212
src/mame/video/rohga.c
r814r815
452452      if (deco16_priority&4)
453453      {
454454         // Draw as 1 8BPP layer
455         deco16_tilemap_34_combine_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,3);
455         deco16_tilemap_34_combine_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,3);
456456      }
457457      else
458458      {
459459         // Draw as 2 4BPP layers
460         deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,1);
460         deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
461461         deco16_tilemap_3_draw(bitmap,cliprect,0,2);
462462      }
463463      deco16_tilemap_2_draw(bitmap,cliprect,0,4);
464464      break;
465465   case 1:
466      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,1);
466      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
467467      deco16_tilemap_2_draw(bitmap,cliprect,0,2);
468468      deco16_tilemap_3_draw(bitmap,cliprect,0,4);
469469      break;
470470   case 2:
471      deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,1);
471      deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
472472      deco16_tilemap_4_draw(bitmap,cliprect,0,2);
473473      deco16_tilemap_3_draw(bitmap,cliprect,0,4);
474474      break;
r814r815
502502   /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
503503   fillbitmap(bitmap,machine->pens[512],&machine->screen[0].visarea);
504504
505   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
505   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
506506   wizdfire_draw_sprites(machine,bitmap,cliprect,buffered_spriteram16,4,3);
507507   deco16_tilemap_2_draw(bitmap,cliprect,0,0);
508508   wizdfire_draw_sprites(machine,bitmap,cliprect,buffered_spriteram16,3,3);
509509
510510   if ((deco16_priority&0x1f)==0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */
511      deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_ALPHA,0);
511      deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_DRAW_ALPHA,0);
512512   else
513513      deco16_tilemap_3_draw(bitmap,cliprect,0,0);
514514
r814r815
534534   deco16_clear_sprite_priority_bitmap();
535535
536536   /* pf3 and pf4 are combined into a single 8bpp bitmap */
537   deco16_tilemap_34_combine_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
537   deco16_tilemap_34_combine_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
538538
539539   deco16_tilemap_2_draw(bitmap,cliprect,0,16);
540540   nitrobal_draw_sprites(machine,bitmap,cliprect,buffered_spriteram16,3);
src/mame/video/vball.c
r814r815
2929
3030***************************************************************************/
3131
32static UINT32 background_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
32static TILEMAP_MAPPER( background_scan )
3333{
3434   /* logical (col,row) -> memory offset */
3535   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) <<6);
r814r815
4343         0,
4444         code + ((attr & 0x1f) << 8) + (vball_gfxset<<8),
4545         (attr >> 5) & 0x7,
46         0)
46         0);
4747}
4848
4949
5050VIDEO_START( vb )
5151{
52   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_OPAQUE, 8, 8,64,64);
52   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_PEN, 8, 8,64,64);
5353
5454   tilemap_set_scroll_rows(bg_tilemap,32);
5555}
src/mame/video/plygonet.c
r814r815
2828   SET_TILE_INFO(ttl_gfx_index, code, attr, 0);
2929}
3030
31static UINT32 ttl_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
32{
33   /* logical (col,row) -> memory offset */
34
35   return row*64 + col;
36}
37
3831READ32_HANDLER( polygonet_ttl_ram_r )
3932{
4033   UINT32 *vram = (UINT32 *)ttl_vram;
r814r815
8881   }
8982
9083   // create the tilemap
91   ttl_tilemap = tilemap_create(ttl_get_tile_info, ttl_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
84   ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
9285
9386   tilemap_set_transparent_pen(ttl_tilemap, 0);
9487
src/mame/video/higemaru.c
r814r815
8484   int code = videoram[tile_index] + ((colorram[tile_index] & 0x80) << 1);
8585   int color = colorram[tile_index] & 0x1f;
8686
87   SET_TILE_INFO(0, code, color, 0)
87   SET_TILE_INFO(0, code, color, 0);
8888}
8989
9090VIDEO_START( higemaru )
9191{
9292   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
93      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
93      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9494}
9595
9696static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/batman.c
r814r815
3333   int code = ((data & 0x400) ? (batman_alpha_tile_bank * 0x400) : 0) + (data & 0x3ff);
3434   int color = (data >> 11) & 0x0f;
3535   int opaque = data & 0x8000;
36   SET_TILE_INFO(2, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
36   SET_TILE_INFO(2, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
3737}
3838
3939
r814r815
4444   int code = data1 & 0x7fff;
4545   int color = 0x10 + (data2 & 0x0f);
4646   SET_TILE_INFO(0, code, color, (data1 >> 15) & 1);
47   tileinfo->priority = (data2 >> 4) & 3;
47   tileinfo->category = (data2 >> 4) & 3;
4848}
4949
5050
r814r815
5555   int code = data1 & 0x7fff;
5656   int color = data2 & 0x0f;
5757   SET_TILE_INFO(0, code, color, (data1 >> 15) & 1);
58   tileinfo->priority = (data2 >> 4) & 3;
58   tileinfo->category = (data2 >> 4) & 3;
5959}
6060
6161
r814r815
106106   };
107107
108108   /* initialize the playfield */
109   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
109   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
110110
111111   /* initialize the second playfield */
112   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,64);
112   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
113113   tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0);
114114
115115   /* initialize the motion objects */
116116   atarimo_init(machine, 0, &modesc);
117117
118118   /* initialize the alphanumerics */
119   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
119   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
120120   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
121121}
122122
src/mame/video/nemesis.c
r814r815
5252   if ( color & 0x80)  flags |= TILE_FLIPX;
5353   if ( code & 0x0800) flags |= TILE_FLIPY;
5454   if ((~code & 0x2000) || ((code & 0xc000) == 0x4000))
55       flags |= TILE_IGNORE_TRANSPARENCY;
55       flags |= TILE_FORCE_LAYER0;
5656   if (code & 0xf800) {
5757      SET_TILE_INFO( 0, code&0x7ff, color&0x7f, flags );
5858   } else {
5959      SET_TILE_INFO( 0, 0x800, 0x00, 0 );
6060   }
61   tileinfo->priority = (code & 0x1000)>>12;
61   tileinfo->category = (code & 0x1000)>>12;
6262}
6363
6464static TILE_GET_INFO( get_fg_tile_info )
r814r815
7070   if ( color & 0x80)  flags |= TILE_FLIPX;
7171   if ( code & 0x0800) flags |= TILE_FLIPY;
7272   if ((~code & 0x2000) || ((code & 0xc000) == 0x4000))
73       flags |= TILE_IGNORE_TRANSPARENCY;
73       flags |= TILE_FORCE_LAYER0;
7474   if (code & 0xf800) {
7575      SET_TILE_INFO( 0, code&0x7ff, color&0x7f, flags );
7676   } else {
7777      SET_TILE_INFO( 0, 0x800, 0x00, 0 );
7878   }
79   tileinfo->priority = (code & 0x1000)>>12;
79   tileinfo->category = (code & 0x1000)>>12;
8080}
8181
8282WRITE16_HANDLER( nemesis_gfx_flipx_w )
r814r815
213213   spriteram_words = spriteram_size / 2;
214214
215215   background = tilemap_create(
216      get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32 );
216      get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32 );
217217
218218   foreground = tilemap_create(
219      get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32 );
219      get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32 );
220220
221221   tilemap_set_transparent_pen( background, 0 );
222222   tilemap_set_transparent_pen( foreground, 0 );
src/mame/video/afega.c
r814r815
101101#define TWINACTN_PAGES_PER_TMAP_Y   (0x1)
102102
103103
104UINT32 afega_tilemap_scan_pages(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
104static TILEMAP_MAPPER( afega_tilemap_scan_pages )
105105{
106106   return   (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y * PAGES_PER_TMAP_X +
107107         (row % TILES_PER_PAGE_Y) +
r814r815
110110         (col % TILES_PER_PAGE_X) * TILES_PER_PAGE_Y;
111111}
112112
113UINT32 twinactn_tilemap_scan_pages(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
113static TILEMAP_MAPPER( twinactn_tilemap_scan_pages )
114114{
115115   return   (row / TWINACTN_TILES_PER_PAGE_Y) * TWINACTN_TILES_PER_PAGE_X * TWINACTN_TILES_PER_PAGE_Y * TWINACTN_PAGES_PER_TMAP_X +
116116         (row % TWINACTN_TILES_PER_PAGE_Y) +
r814r815
119119         (col % TWINACTN_TILES_PER_PAGE_X) * TWINACTN_TILES_PER_PAGE_Y;
120120}
121121
122UINT32 firehawk_tilemap_scan_pages(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
122static TILEMAP_MAPPER( firehawk_tilemap_scan_pages )
123123{
124124   return   (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y * FIREHAWK_PAGES_PER_TMAP_X +
125125         (row % TILES_PER_PAGE_Y) +
r814r815
137137         1,
138138         code,
139139         (code & 0xf000) >> 12,
140         0)
140         0);
141141}
142142static TILE_GET_INFO( get_tile_info_1 )
143143{
r814r815
146146         2,
147147         code,
148148         (code & 0xf000) >> 12,
149         0)
149         0);
150150}
151151
152152WRITE16_HANDLER( afega_vram_0_w )
r814r815
172172VIDEO_START( afega )
173173{
174174   tilemap_0 = tilemap_create(   get_tile_info_0, afega_tilemap_scan_pages,
175                        TILEMAP_TYPE_OPAQUE,
175                        TILEMAP_TYPE_PEN,
176176                        16,16,
177177                        TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
178178
179179   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_cols,
180                        TILEMAP_TYPE_TRANSPARENT,
180                        TILEMAP_TYPE_PEN,
181181                        8,8,
182182                        32,32);
183183
184   tilemap_set_transparent_pen(tilemap_0,0x0);
185184   tilemap_set_transparent_pen(tilemap_1,0xf);
186185}
187186
188187VIDEO_START( twinactn )
189188{
190189   tilemap_0 = tilemap_create(   get_tile_info_0, afega_tilemap_scan_pages,
191                        TILEMAP_TYPE_OPAQUE,
190                        TILEMAP_TYPE_PEN,
192191                        16,16,
193192                        TWINACTN_TILES_PER_PAGE_X*TWINACTN_PAGES_PER_TMAP_X,TWINACTN_TILES_PER_PAGE_Y*TWINACTN_PAGES_PER_TMAP_Y);
194193
195194   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_cols,
196                        TILEMAP_TYPE_TRANSPARENT,
195                        TILEMAP_TYPE_PEN,
197196                        8,8,
198197                        32,32);
199198
200   tilemap_set_transparent_pen(tilemap_0,0x0);
201199   tilemap_set_transparent_pen(tilemap_1,0xf);
202200}
203201
204202VIDEO_START( firehawk )
205203{
206204   tilemap_0 = tilemap_create(   get_tile_info_0, firehawk_tilemap_scan_pages,
207                        TILEMAP_TYPE_OPAQUE,
205                        TILEMAP_TYPE_PEN,
208206                        16,16,
209207                        TILES_PER_PAGE_X*FIREHAWK_PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*FIREHAWK_PAGES_PER_TMAP_Y);
210208
211209   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_cols,
212                        TILEMAP_TYPE_TRANSPARENT,
210                        TILEMAP_TYPE_PEN,
213211                        8,8,
214212                        32,32);
215213
216   tilemap_set_transparent_pen(tilemap_0,0x0);
217214   tilemap_set_transparent_pen(tilemap_1,0xf);
218215}
219216
src/mame/video/timelimt.c
r814r815
7373VIDEO_START( timelimt )
7474{
7575   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
76      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
76      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
7777
7878   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
79      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
79      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
8080
8181   tilemap_set_transparent_pen(fg_tilemap, 0);
8282}
src/mame/video/warriorb.c
r814r815
121121
122122   /* chip 0 does tilemaps on the left, chip 1 does the ones on the right */
123123   // draw bottom layer
124   nodraw  = TC0100SCN_tilemap_draw(machine,bitmap,cliprect,screen,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);   /* left */
124   nodraw  = TC0100SCN_tilemap_draw(machine,bitmap,cliprect,screen,layer[0],TILEMAP_DRAW_OPAQUE,0);   /* left */
125125
126126   /* Ensure screen blanked even when bottom layers not drawn due to disable bit */
127127   if(nodraw) fillbitmap(bitmap, get_black_pen(machine), cliprect);
src/mame/video/deco16ic.c
r814r815
236236
237237/*****************************************************************************************/
238238
239static UINT32 deco16_scan_rows(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
239static TILEMAP_MAPPER( deco16_scan_rows )
240240{
241241   /* logical (col,row) -> memory offset */
242242   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6);
r814r815
263263         deco16_pf34_16x16_gfx_bank,
264264         (tile&0xfff)|deco16_pf4_bank,
265265         (colour&deco16_pf4_colourmask)+deco16_pf4_colour_bank,
266         flags)
266         flags);
267267}
268268
269269static TILE_GET_INFO( get_pf3_tile_info )
r814r815
287287         deco16_pf34_16x16_gfx_bank,
288288         (tile&0xfff)|deco16_pf3_bank,
289289         (colour&deco16_pf3_colourmask)+deco16_pf3_colour_bank,
290         flags)
290         flags);
291291}
292292
293293static TILE_GET_INFO( get_pf2_tile_info )
r814r815
311311         deco16_pf12_16x16_gfx_bank,
312312         (tile&0xfff)|deco16_pf2_bank,
313313         (colour&deco16_pf2_colourmask)+deco16_pf2_colour_bank,
314         flags)
314         flags);
315315}
316316
317317static TILE_GET_INFO( get_pf1_tile_info )
r814r815
335335         deco16_pf12_16x16_gfx_bank,
336336         (tile&0xfff)|deco16_pf1_bank,
337337         (colour&deco16_pf1_colourmask)+deco16_pf1_colour_bank,
338         flags)
338         flags);
339339}
340340
341341static TILE_GET_INFO( get_pf2_tile_info_b )
r814r815
359359         deco16_pf12_8x8_gfx_bank,
360360         (tile&0xfff)|deco16_pf2_bank,
361361         (colour&deco16_pf2_colourmask)+deco16_pf2_colour_bank,
362         flags)
362         flags);
363363}
364364
365365static TILE_GET_INFO( get_pf1_tile_info_b )
r814r815
383383         deco16_pf12_8x8_gfx_bank,
384384         (tile&0xfff)|deco16_pf1_bank,
385385         (colour&deco16_pf1_colourmask)+deco16_pf1_colour_bank,
386         flags)
386         flags);
387387}
388388
389389/******************************************************************************/
r814r815
519519{
520520   sprite_priority_bitmap = auto_bitmap_alloc( Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED8 );
521521
522   pf1_tilemap_16x16 =   tilemap_create(get_pf1_tile_info,   deco16_scan_rows, TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
523   pf1_tilemap_8x8 =   tilemap_create(get_pf1_tile_info_b, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
522   pf1_tilemap_16x16 =   tilemap_create(get_pf1_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,64,32);
523   pf1_tilemap_8x8 =   tilemap_create(get_pf1_tile_info_b, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
524524
525525   if (split)
526      pf2_tilemap_16x16 =   tilemap_create(get_pf2_tile_info,   deco16_scan_rows, TILEMAP_TYPE_SPLIT,16,16,full_width ? 64 : 32,32);
526      pf2_tilemap_16x16 =   tilemap_create(get_pf2_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,full_width ? 64 : 32,32);
527527   else
528      pf2_tilemap_16x16 =   tilemap_create(get_pf2_tile_info,   deco16_scan_rows, TILEMAP_TYPE_TRANSPARENT,16,16,full_width ? 64 : 32,32);
529   pf2_tilemap_8x8 =   tilemap_create(get_pf2_tile_info_b, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,full_width ? 64 : 32,32);
528      pf2_tilemap_16x16 =   tilemap_create(get_pf2_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,full_width ? 64 : 32,32);
529   pf2_tilemap_8x8 =   tilemap_create(get_pf2_tile_info_b, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,full_width ? 64 : 32,32);
530530
531531   dirty_palette = auto_malloc(4096);
532532   deco16_raster_display_list=auto_malloc(20 * 256);
533533
534534   if (!pf12_only)
535535   {
536      pf4_tilemap_16x16 =   tilemap_create(get_pf4_tile_info,   deco16_scan_rows, TILEMAP_TYPE_TRANSPARENT,16,16,full_width ? 64 : 32,32);
537      pf3_tilemap_16x16 =   tilemap_create(get_pf3_tile_info,   deco16_scan_rows, TILEMAP_TYPE_TRANSPARENT,16,16,full_width ? 64 : 32,32);
536      pf4_tilemap_16x16 =   tilemap_create(get_pf4_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,full_width ? 64 : 32,32);
537      pf3_tilemap_16x16 =   tilemap_create(get_pf3_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,full_width ? 64 : 32,32);
538538   }
539539   else
540540   {
r814r815
965965   int flags,
966966   UINT32 priority)
967967{
968   const mame_bitmap *src_bitmap0 = (control1&0x80) ? tilemap_get_pixmap(tilemap0_8x8) : tilemap_get_pixmap(tilemap0_16x16);
969   const mame_bitmap *src_bitmap1 = (control1&0x80) ? tilemap_get_pixmap(tilemap1_8x8) : tilemap_get_pixmap(tilemap1_16x16);
968   tilemap *tilemap0 = (control1&0x80) ? tilemap0_8x8 : tilemap0_16x16;
969   tilemap *tilemap1 = (control1&0x80) ? tilemap1_8x8 : tilemap1_16x16;
970   const mame_bitmap *src_bitmap0 = tilemap0 ? tilemap_get_pixmap(tilemap0) : NULL;
971   const mame_bitmap *src_bitmap1 = tilemap1 ? tilemap_get_pixmap(tilemap1) : NULL;
970972   int width_mask, height_mask, x, y, p;
971973   int column_offset, src_x=0, src_y=0;
972974   int   row_type=1 << ((control0>>3)&0xf);
r814r815
10021004            p|=(*BITMAP_ADDR16(src_bitmap1, (src_y + column_offset)&height_mask, src_x)&combine_mask)<<combine_shift;
10031005
10041006         src_x=(src_x+1)&width_mask;
1005         if ((flags&TILEMAP_IGNORE_TRANSPARENCY) || (p&trans_mask))
1007         if ((flags&TILEMAP_DRAW_OPAQUE) || (p&trans_mask))
10061008         {
10071009            *BITMAP_ADDR16(bitmap, y, x) = Machine->pens[p];
10081010            if (priority_bitmap)
src/mame/video/goal92.c
r814r815
5454
5555   tile |= 0xc000;
5656
57   SET_TILE_INFO(1,tile,color,0)
57   SET_TILE_INFO(1,tile,color,0);
5858}
5959
6060static TILE_GET_INFO( get_back_tile_info )
r814r815
6464
6565   tile &= 0xfff;
6666
67   SET_TILE_INFO(2,tile,color,0)
67   SET_TILE_INFO(2,tile,color,0);
6868}
6969
7070static TILE_GET_INFO( get_fore_tile_info )
r814r815
8686      tile |= 0x2000;
8787   }
8888
89   SET_TILE_INFO(region,tile,color,0)
89   SET_TILE_INFO(region,tile,color,0);
9090}
9191
9292static void draw_sprites(running_machine *machine,mame_bitmap *bitmap,const rectangle *cliprect,int pri)
r814r815
135135
136136VIDEO_START( goal92 )
137137{
138   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
139   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
140   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,64,32);
138   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
139   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
140   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
141141
142142   buffered_spriteram16 = auto_malloc(0x400*2);
143143
src/mame/video/1942.c
r814r815
105105         0,
106106         code + ((color & 0x80) << 1),
107107         color & 0x3f,
108         0)
108         0);
109109}
110110
111111static TILE_GET_INFO( get_bg_tile_info )
r814r815
120120         1,
121121         code + ((color & 0x80) << 1),
122122         (color & 0x1f) + (0x20 * c1942_palette_bank),
123         TILE_FLIPYX((color & 0x60) >> 5))
123         TILE_FLIPYX((color & 0x60) >> 5));
124124}
125125
126126
r814r815
131131***************************************************************************/
132132VIDEO_START( 1942 )
133133{
134   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
135   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,     16,16,32,16);
134   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
135   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,32,16);
136136
137137   tilemap_set_transparent_pen(fg_tilemap,0);
138138
src/mame/video/poolshrk.c
r814r815
1414static tilemap* bg_tilemap;
1515
1616
17static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
18{
19   return num_cols * row + col;
20}
21
22
2317static TILE_GET_INFO( get_tile_info )
2418{
25   SET_TILE_INFO(1, poolshrk_playfield_ram[tile_index] & 0x3f, 0, 0)
19   SET_TILE_INFO(1, poolshrk_playfield_ram[tile_index] & 0x3f, 0, 0);
2620}
2721
2822
2923VIDEO_START( poolshrk )
3024{
31   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset,
32      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
25   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows,
26      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
3327
3428   tilemap_set_transparent_pen(bg_tilemap, 0);
3529}
src/mame/video/mayumi.c
r814r815
1717   int code = mayumi_videoram[tile_index] + (mayumi_videoram[tile_index+0x800] & 0x1f)*0x100 ;
1818   int col = (mayumi_videoram[tile_index+0x1000] >> 3) & 0x1f;
1919
20   SET_TILE_INFO(0, code, col, 0)
20   SET_TILE_INFO(0, code, col, 0);
2121}
2222
2323VIDEO_START( mayumi )
2424{
2525   mayumi_videoram = auto_malloc(0x1800);
2626
27   mayumi_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32 );
27   mayumi_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
2828}
2929
3030WRITE8_HANDLER( mayumi_videoram_w )
src/mame/video/raiden.c
r814r815
5353         1,
5454         tile,
5555         color,
56         0)
56         0);
5757}
5858
5959static TILE_GET_INFO( get_fore_tile_info )
r814r815
6767         2,
6868         tile,
6969         color,
70         0)
70         0);
7171}
7272
7373static TILE_GET_INFO( get_text_tile_info )
r814r815
7979         0,
8080         tile,
8181         color,
82         0)
82         0);
8383}
8484
8585VIDEO_START( raiden )
8686{
87   bg_layer = tilemap_create(get_back_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
88   fg_layer = tilemap_create(get_fore_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
89   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
87   bg_layer = tilemap_create(get_back_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,32,32);
88   fg_layer = tilemap_create(get_fore_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,32);
89   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
9090   ALTERNATE=0;
9191
9292   tilemap_set_transparent_pen(fg_layer,15);
r814r815
9595
9696VIDEO_START( raidena )
9797{
98   bg_layer = tilemap_create(get_back_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
99   fg_layer = tilemap_create(get_fore_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
100   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
98   bg_layer = tilemap_create(get_back_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,32,32);
99   fg_layer = tilemap_create(get_fore_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,32);
100   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
101101   ALTERNATE=1;
102102
103103   tilemap_set_transparent_pen(fg_layer,15);
src/mame/video/bloodbro.c
r814r815
2626         1,
2727         code & 0xfff,
2828         code >> 12,
29         0)
29         0);
3030}
3131
3232static TILE_GET_INFO( get_fg_tile_info )
r814r815
3636         2,
3737         code & 0xfff,
3838         code >> 12,
39         0)
39         0);
4040}
4141
4242static TILE_GET_INFO( get_tx_tile_info )
r814r815
4646         0,
4747         code & 0xfff,
4848         code >> 12,
49         0)
49         0);
5050}
5151
5252
r814r815
5959
6060VIDEO_START( bloodbro )
6161{
62   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,16);
63   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
64   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
62   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,16);
63   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
64   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
6565
6666   tilemap_set_transparent_pen(fg_tilemap,15);
6767   tilemap_set_transparent_pen(tx_tilemap,15);
src/mame/video/fromanc2.c
r814r815
2727   tile  = (fromanc2_videoram[vram][layer][tile_index] & 0x3fff) | (fromanc2_gfxbank[vram][layer] << 14);
2828   color = ((fromanc2_videoram[vram][layer][tile_index] & 0xc000) >> 14) | (0x10 * vram);
2929
30   SET_TILE_INFO(layer, tile, color, 0)
30   SET_TILE_INFO(layer, tile, color, 0);
3131}
3232
3333static TILE_GET_INFO( fromanc2_get_v0_l0_tile_info ) { fromanc2_get_tile_info(machine, tileinfo, tile_index, 0, 0); }
r814r815
4747   tile  = fromanc2_videoram[vram][layer][tile_index] | (fromanc2_gfxbank[vram][layer] << 16);
4848   color = vram;
4949
50   SET_TILE_INFO(layer, tile, color, 0)
50   SET_TILE_INFO(layer, tile, color, 0);
5151}
5252
5353static TILE_GET_INFO( fromancr_get_v0_l0_tile_info ) { fromancr_get_tile_info(machine, tileinfo, tile_index, 0, 0); }
r814r815
370370
371371VIDEO_START( fromanc2 )
372372{
373   fromanc2_tilemap[0][0] = tilemap_create(fromanc2_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64, 64);
374   fromanc2_tilemap[0][1] = tilemap_create(fromanc2_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
375   fromanc2_tilemap[0][2] = tilemap_create(fromanc2_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
376   fromanc2_tilemap[0][3] = tilemap_create(fromanc2_get_v0_l3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
377   fromanc2_tilemap[1][0] = tilemap_create(fromanc2_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64, 64);
378   fromanc2_tilemap[1][1] = tilemap_create(fromanc2_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
379   fromanc2_tilemap[1][2] = tilemap_create(fromanc2_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
380   fromanc2_tilemap[1][3] = tilemap_create(fromanc2_get_v1_l3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
373   fromanc2_tilemap[0][0] = tilemap_create(fromanc2_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64, 64);
374   fromanc2_tilemap[0][1] = tilemap_create(fromanc2_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
375   fromanc2_tilemap[0][2] = tilemap_create(fromanc2_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
376   fromanc2_tilemap[0][3] = tilemap_create(fromanc2_get_v0_l3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
377   fromanc2_tilemap[1][0] = tilemap_create(fromanc2_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64, 64);
378   fromanc2_tilemap[1][1] = tilemap_create(fromanc2_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
379   fromanc2_tilemap[1][2] = tilemap_create(fromanc2_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
380   fromanc2_tilemap[1][3] = tilemap_create(fromanc2_get_v1_l3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
381381
382382   fromanc2_videoram[0][0] = auto_malloc((64 * 64) * sizeof(UINT16));
383383   fromanc2_videoram[0][1] = auto_malloc((64 * 64) * sizeof(UINT16));
r814r815
401401
402402VIDEO_START( fromancr )
403403{
404   fromanc2_tilemap[0][0] = tilemap_create(fromancr_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64, 64);
405   fromanc2_tilemap[0][1] = tilemap_create(fromancr_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
406   fromanc2_tilemap[0][2] = tilemap_create(fromancr_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
404   fromanc2_tilemap[0][0] = tilemap_create(fromancr_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64, 64);
405   fromanc2_tilemap[0][1] = tilemap_create(fromancr_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
406   fromanc2_tilemap[0][2] = tilemap_create(fromancr_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
407407   fromanc2_tilemap[0][3] = 0;
408   fromanc2_tilemap[1][0] = tilemap_create(fromancr_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64, 64);
409   fromanc2_tilemap[1][1] = tilemap_create(fromancr_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
410   fromanc2_tilemap[1][2] = tilemap_create(fromancr_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
408   fromanc2_tilemap[1][0] = tilemap_create(fromancr_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64, 64);
409   fromanc2_tilemap[1][1] = tilemap_create(fromancr_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
410   fromanc2_tilemap[1][2] = tilemap_create(fromancr_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
411411   fromanc2_tilemap[1][3] = 0;
412412
413413   fromanc2_videoram[0][0] = auto_malloc((64 * 64) * sizeof(UINT16));
r814r815
429429
430430VIDEO_START( fromanc4 )
431431{
432   fromanc2_tilemap[0][0] = tilemap_create(fromancr_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 256, 64);
433   fromanc2_tilemap[0][1] = tilemap_create(fromancr_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 256, 64);
434   fromanc2_tilemap[0][2] = tilemap_create(fromancr_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 256, 64);
432   fromanc2_tilemap[0][0] = tilemap_create(fromancr_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 256, 64);
433   fromanc2_tilemap[0][1] = tilemap_create(fromancr_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
434   fromanc2_tilemap[0][2] = tilemap_create(fromancr_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
435435   fromanc2_tilemap[0][3] = 0;
436   fromanc2_tilemap[1][0] = tilemap_create(fromancr_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 256, 64);
437   fromanc2_tilemap[1][1] = tilemap_create(fromancr_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 256, 64);
438   fromanc2_tilemap[1][2] = tilemap_create(fromancr_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 256, 64);
436   fromanc2_tilemap[1][0] = tilemap_create(fromancr_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 256, 64);
437   fromanc2_tilemap[1][1] = tilemap_create(fromancr_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
438   fromanc2_tilemap[1][2] = tilemap_create(fromancr_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
439439   fromanc2_tilemap[1][3] = 0;
440440
441441   fromanc2_videoram[0][0] = auto_malloc((256 * 64) * sizeof(UINT16));
src/mame/video/bombjack.c
r814r815
5252   int color = attr & 0x0f;
5353   int flags = (attr & 0x80) ? TILE_FLIPY : 0;
5454
55   SET_TILE_INFO(1, code, color, flags)
55   SET_TILE_INFO(1, code, color, flags);
5656}
5757
5858static TILE_GET_INFO( get_fg_tile_info )
r814r815
6060   int code = videoram[tile_index] + 16 * (colorram[tile_index] & 0x10);
6161   int color = colorram[tile_index] & 0x0f;
6262
63   SET_TILE_INFO(0, code, color, 0)
63   SET_TILE_INFO(0, code, color, 0);
6464}
6565
6666VIDEO_START( bombjack )
6767{
6868   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
69      TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
69      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
7070
7171   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
72      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
72      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
7373
7474   tilemap_set_transparent_pen(fg_tilemap, 0);
7575
src/mame/video/rallyx.c
r814r815
192192***************************************************************************/
193193
194194/* the video RAM has space for 32x32 tiles and is only partially used for the radar */
195static UINT32 fg_tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
195static TILEMAP_MAPPER( fg_tilemap_scan )
196196{
197197   return col + (row << 5);
198198}
r814r815
201201INLINE void rallyx_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int ram_offs)
202202{
203203   UINT8 attr = rallyx_videoram[ram_offs + tile_index + 0x800];
204   tileinfo->priority = (attr & 0x20) >> 5;
204   tileinfo->category = (attr & 0x20) >> 5;
205205   SET_TILE_INFO(
206206         0,
207207         rallyx_videoram[ram_offs + tile_index],
208208         attr & 0x3f,
209         TILE_FLIPYX(attr >> 6) ^ TILE_FLIPX)
209         TILE_FLIPYX(attr >> 6) ^ TILE_FLIPX);
210210}
211211
212212static TILE_GET_INFO( rallyx_bg_get_tile_info )
r814r815
225225   UINT8 attr = rallyx_videoram[ram_offs + tile_index + 0x800];
226226   int code = rallyx_videoram[ram_offs + tile_index];
227227   code = (code & 0x7f) + 2*(attr & 0x40) + 2*(code & 0x80);
228   tileinfo->priority = (attr & 0x20) >> 5;
228   tileinfo->category = (attr & 0x20) >> 5;
229229   SET_TILE_INFO(
230230         0,
231231         code,
232232         attr & 0x3f,
233         (attr & 0x80) ? (TILE_FLIPX | TILE_FLIPY) : 0)
233         (attr & 0x80) ? (TILE_FLIPX | TILE_FLIPY) : 0);
234234}
235235
236236static TILE_GET_INFO( locomotn_bg_get_tile_info )
r814r815
257257
258258   if (video_type == TYPE_RALLYX || video_type == TYPE_JUNGLER)
259259   {
260      bg_tilemap = tilemap_create(rallyx_bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
261      fg_tilemap = tilemap_create(rallyx_fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_OPAQUE,8,8, 8,32);
260      bg_tilemap = tilemap_create(rallyx_bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
261      fg_tilemap = tilemap_create(rallyx_fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_PEN,8,8, 8,32);
262262   }
263263   else
264264   {
265      bg_tilemap = tilemap_create(locomotn_bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
266      fg_tilemap = tilemap_create(locomotn_fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_OPAQUE,8,8, 8,32);
265      bg_tilemap = tilemap_create(locomotn_bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
266      fg_tilemap = tilemap_create(locomotn_fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_PEN,8,8, 8,32);
267267   }
268268
269269   /* the scrolling tilemap is slightly misplaced in Rally X */
src/mame/video/trucocl.c
r814r815
6767   code |= ( bank & 2 ) << 8;
6868   code += ( bank & 4 ) << 6;
6969
70   SET_TILE_INFO(gfxsel,code,colour,0)
70   SET_TILE_INFO(gfxsel,code,colour,0);
7171}
7272
7373VIDEO_START( trucocl )
7474{
75   bg_tilemap = tilemap_create( get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32 );
75   bg_tilemap = tilemap_create( get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
7676}
7777
7878VIDEO_UPDATE( trucocl )
src/mame/video/bking2.c
r814r815
228228}
229229
230230
231static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
232{
233   return num_cols * row + col;
234}
235
236
237231static TILE_GET_INFO( get_tile_info )
238232{
239233   UINT8 code0 = bking2_playfield_ram[2 * tile_index + 0];
r814r815
244238   if (code1 & 4) flags |= TILE_FLIPX;
245239   if (code1 & 8) flags |= TILE_FLIPY;
246240
247   SET_TILE_INFO(0, code0 + 256 * code1, palette_bank, flags)
241   SET_TILE_INFO(0, code0 + 256 * code1, palette_bank, flags);
248242}
249243
250244
251245VIDEO_START( bking2 )
252246{
253   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, 0, 8, 8, 32, 32);
247   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 0, 8, 8, 32, 32);
254248   helper0 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
255249   helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
256250}
src/mame/video/unico.c
r814r815
101101{ \
102102   UINT16 code = unico_vram_##_N_[ 2 * tile_index + 0 ]; \
103103   UINT16 attr = unico_vram_##_N_[ 2 * tile_index + 1 ]; \
104   SET_TILE_INFO(1, code, attr & 0x1f, TILE_FLIPYX( attr >> 5 )) \
104   SET_TILE_INFO(1, code, attr & 0x1f, TILE_FLIPYX( attr >> 5 )); \
105105} \
106106\
107107static TILE_GET_INFO( get_tile_info32_##_N_ ) \
108108{ \
109109   UINT32 code = unico_vram32_##_N_[tile_index]; \
110   SET_TILE_INFO(1, code >> 16, code & 0x1f, TILE_FLIPYX( code >> 5 )) \
110   SET_TILE_INFO(1, code >> 16, code & 0x1f, TILE_FLIPYX( code >> 5 )); \
111111} \
112112\
113113WRITE16_HANDLER( unico_vram_##_N_##_w ) \
r814r815
141141VIDEO_START( unico )
142142{
143143   tilemap_0 = tilemap_create(   get_tile_info_0,tilemap_scan_rows,
144                        TILEMAP_TYPE_TRANSPARENT,   16,16,   0x40, 0x40);
144                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
145145
146146   tilemap_1 = tilemap_create(   get_tile_info_1,tilemap_scan_rows,
147                        TILEMAP_TYPE_TRANSPARENT,   16,16,   0x40, 0x40);
147                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
148148
149149   tilemap_2 = tilemap_create(   get_tile_info_2,tilemap_scan_rows,
150                        TILEMAP_TYPE_TRANSPARENT,   16,16,   0x40, 0x40);
150                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
151151
152152   sprites_scrolldx = -0x3f;
153153   sprites_scrolldy = -0x0e;
r814r815
168168VIDEO_START( zeropnt2 )
169169{
170170   tilemap_0 = tilemap_create(   get_tile_info32_0,tilemap_scan_rows,
171                        TILEMAP_TYPE_TRANSPARENT,   16,16,   0x40, 0x40);
171                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
172172
173173   tilemap_1 = tilemap_create(   get_tile_info32_1,tilemap_scan_rows,
174                        TILEMAP_TYPE_TRANSPARENT,   16,16,   0x40, 0x40);
174                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
175175
176176   tilemap_2 = tilemap_create(   get_tile_info32_2,tilemap_scan_rows,
177                        TILEMAP_TYPE_TRANSPARENT,   16,16,   0x40, 0x40);
177                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
178178
179179   sprites_scrolldx = -0x3f;
180180   sprites_scrolldy = -0x0e;
src/mame/video/blockhl.c
r814r815
5858
5959   K052109_tilemap_update();
6060
61   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_IGNORE_TRANSPARENCY,0);
61   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_DRAW_OPAQUE,0);
6262   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,1);
6363   tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,2);
6464
src/mame/video/gcpinbal.c
r814r815
2929         1,
3030         (tilenum & 0xfff) + bg0_gfxset,
3131         (attr & 0x1f),
32         TILE_FLIPYX( (attr & 0x300) >> 8))
32         TILE_FLIPYX( (attr & 0x300) >> 8));
3333}
3434
3535static TILE_GET_INFO( get_bg1_tile_info )
r814r815
4141         1,
4242         (tilenum & 0xfff) + 0x2000 + bg1_gfxset,
4343         (attr & 0x1f) + 0x30,
44         TILE_FLIPYX( (attr & 0x300) >> 8))
44         TILE_FLIPYX( (attr & 0x300) >> 8));
4545}
4646
4747static TILE_GET_INFO( get_fg_tile_info )
r814r815
5252         2,
5353         (tilenum & 0xfff),
5454         (tilenum >> 12) | 0x70,
55         0)
55         0);
5656}
5757
5858#if 0
r814r815
6969   int xoffs = 0;
7070   int yoffs = 0;
7171
72   gcpinbal_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
73   gcpinbal_tilemap[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
74   gcpinbal_tilemap[2] = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
72   gcpinbal_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
73   gcpinbal_tilemap[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
74   gcpinbal_tilemap[2] = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
7575
7676   tilemap_set_transparent_pen( gcpinbal_tilemap[0],0 );
7777   tilemap_set_transparent_pen( gcpinbal_tilemap[1],0 );
r814r815
328328#ifdef MAME_DEBUG
329329   if (dislayer[layer[0]]==0)
330330#endif
331   tilemap_draw(bitmap,cliprect,gcpinbal_tilemap[layer[0]],TILEMAP_IGNORE_TRANSPARENCY,1);
331   tilemap_draw(bitmap,cliprect,gcpinbal_tilemap[layer[0]],TILEMAP_DRAW_OPAQUE,1);
332332
333333#ifdef MAME_DEBUG
334334   if (dislayer[layer[1]]==0)
src/mame/video/realbrk.c
r814r815
8484         0,
8585         code,
8686         attr & 0x7f,
87         TILE_FLIPYX( attr >> 14 ))
87         TILE_FLIPYX( attr >> 14 ));
8888}
8989
9090static TILE_GET_INFO( get_tile_info_1 )
r814r815
9595         0,
9696         code,
9797         attr & 0x7f,
98         TILE_FLIPYX( attr >> 14 ))
98         TILE_FLIPYX( attr >> 14 ));
9999}
100100
101101WRITE16_HANDLER( realbrk_vram_0_w )
r814r815
131131         1,
132132         code & 0x0fff,
133133         ((code & 0xf000) >> 12) | ((realbrk_vregs[0xa/2] & 0x7f) << 4),
134         0)
134         0);
135135}
136136
137137WRITE16_HANDLER( realbrk_vram_2_w )
r814r815
154154{
155155   /* Backgrounds */
156156   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
157                        TILEMAP_TYPE_TRANSPARENT,
157                        TILEMAP_TYPE_PEN,
158158                        16,16,
159159                        0x40, 0x20);
160160
161161   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
162                        TILEMAP_TYPE_TRANSPARENT,
162                        TILEMAP_TYPE_PEN,
163163                        16,16,
164164                        0x40, 0x20);
165165
166166   /* Text */
167167   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
168                        TILEMAP_TYPE_TRANSPARENT,
168                        TILEMAP_TYPE_PEN,
169169                        8,8,
170170                        0x40, 0x20);
171171
src/mame/video/carjmbre.c
r814r815
6969         0,
7070         tile_number,
7171         (attr&0x7),
72         0)
72         0);
7373}
7474
7575WRITE8_HANDLER( carjmbre_videoram_w ){
r814r815
8282VIDEO_START( carjmbre )
8383{
8484
85   carjmbre_tilemap = tilemap_create( get_carjmbre_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
85   carjmbre_tilemap = tilemap_create( get_carjmbre_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
8686
8787   state_save_register_global(carjmbre_flipscreen);
8888   state_save_register_global(carjmbre_bgcolor);
src/mame/video/superchs.c
r814r815
233233       sprites as pdrawgfx cannot yet cope with more than 4 layers */
234234
235235#ifdef MAME_DEBUG
236   if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
236   if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0);
237237   if (!input_code_pressed (KEYCODE_X)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,1);
238238   if (!input_code_pressed (KEYCODE_C)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,2);
239239   if (!input_code_pressed (KEYCODE_V)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,4);
240240   if (!input_code_pressed (KEYCODE_B)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[4],0,8);
241241   if (!input_code_pressed (KEYCODE_N)) draw_sprites(machine,bitmap,cliprect,primasks,48,-116);
242242#else
243   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
243   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0);
244244   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,1);
245245   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,2);
246246   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,4);
src/mame/video/bottom9.c
r814r815
6565   zoom_colorbase = 48;
6666   K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tile_callback);
6767   K051960_vh_start(machine,REGION_GFX2,NORMAL_PLANE_ORDER,sprite_callback);
68   K051316_vh_start_0(machine,REGION_GFX3,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback);
68   K051316_vh_start_0(machine,REGION_GFX3,4,FALSE,0,zoom_callback);
6969}
7070
7171
src/mame/video/flower.c
r814r815
115115   int color = flower_bg0ram[tile_index+0x100];
116116   /* Todo - may be tile flip bits? */
117117
118   SET_TILE_INFO(2, code, color>>4, 0)
118   SET_TILE_INFO(2, code, color>>4, 0);
119119}
120120
121121static TILE_GET_INFO( get_bg1_tile_info )
r814r815
124124   int color = flower_bg1ram[tile_index+0x100];
125125   /* Todo - may be tile flip bits? */
126126
127   SET_TILE_INFO(2, code, color>>4, 0)
127   SET_TILE_INFO(2, code, color>>4, 0);
128128}
129129
130130static TILE_GET_INFO( get_text_tile_info )
r814r815
133133   int color = flower_textram[tile_index+0x400];
134134   /* Todo - may be tile flip bits? */
135135
136   SET_TILE_INFO(0, code, color>>2, 0)
136   SET_TILE_INFO(0, code, color>>2, 0);
137137}
138138
139139VIDEO_START(flower)
140140{
141   flower_bg0_tilemap        = tilemap_create(get_bg0_tile_info, tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,16,16);
142   flower_bg1_tilemap        = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,16,16);
143   flower_text_tilemap       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
144   flower_text_right_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT, 8, 8, 2,32);
141   flower_bg0_tilemap        = tilemap_create(get_bg0_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,16,16);
142   flower_bg1_tilemap        = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,16);
143   flower_text_tilemap       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
144   flower_text_right_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 8, 8, 2,32);
145145
146146   tilemap_set_transparent_pen(flower_bg1_tilemap,15);
147147   tilemap_set_transparent_pen(flower_text_tilemap,3);
src/mame/video/xain.c
r814r815
4343
4444***************************************************************************/
4545
46static UINT32 back_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
46static TILEMAP_MAPPER( back_scan )
4747{
4848   /* logical (col,row) -> memory offset */
4949   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5);
r814r815
5656         2,
5757         xain_bgram0[tile_index] | ((attr & 7) << 8),
5858         (attr & 0x70) >> 4,
59         (attr & 0x80) ? TILE_FLIPX : 0)
59         (attr & 0x80) ? TILE_FLIPX : 0);
6060}
6161
6262static TILE_GET_INFO( get_bgram1_tile_info )
r814r815
6666         1,
6767         xain_bgram1[tile_index] | ((attr & 7) << 8),
6868         (attr & 0x70) >> 4,
69         (attr & 0x80) ? TILE_FLIPX : 0)
69         (attr & 0x80) ? TILE_FLIPX : 0);
7070}
7171
7272static TILE_GET_INFO( get_char_tile_info )
r814r815
7676         0,
7777         xain_charram[tile_index] | ((attr & 3) << 8),
7878         (attr & 0xe0) >> 5,
79         0)
79         0);
8080}
8181
8282
r814r815
8888
8989VIDEO_START( xain )
9090{
91   bgram0_tilemap = tilemap_create(get_bgram0_tile_info,back_scan,    TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
92   bgram1_tilemap = tilemap_create(get_bgram1_tile_info,back_scan,    TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
93   char_tilemap = tilemap_create(get_char_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
91   bgram0_tilemap = tilemap_create(get_bgram0_tile_info,back_scan,    TILEMAP_TYPE_PEN,16,16,32,32);
92   bgram1_tilemap = tilemap_create(get_bgram1_tile_info,back_scan,    TILEMAP_TYPE_PEN,16,16,32,32);
93   char_tilemap = tilemap_create(get_char_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
9494
9595   tilemap_set_transparent_pen(bgram0_tilemap,0);
9696   tilemap_set_transparent_pen(bgram1_tilemap,0);
r814r815
223223   switch (xain_pri&0x7)
224224   {
225225   case 0:
226      tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
226      tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0);
227227      tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0);
228228      draw_sprites(machine, bitmap,cliprect);
229229      tilemap_draw(bitmap,cliprect,char_tilemap,0,0);
230230      break;
231231   case 1:
232      tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
232      tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0);
233233      tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0);
234234      draw_sprites(machine, bitmap,cliprect);
235235      tilemap_draw(bitmap,cliprect,char_tilemap,0,0);
236236      break;
237237   case 2:
238      tilemap_draw(bitmap,cliprect,char_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
238      tilemap_draw(bitmap,cliprect,char_tilemap,TILEMAP_DRAW_OPAQUE,0);
239239      tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0);
240240      draw_sprites(machine, bitmap,cliprect);
241241      tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0);
242242      break;
243243   case 3:
244      tilemap_draw(bitmap,cliprect,char_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
244      tilemap_draw(bitmap,cliprect,char_tilemap,TILEMAP_DRAW_OPAQUE,0);
245245      tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0);
246246      draw_sprites(machine, bitmap,cliprect);
247247      tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0);
248248      break;
249249   case 4:
250      tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
250      tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0);
251251      tilemap_draw(bitmap,cliprect,char_tilemap,0,0);
252252      draw_sprites(machine, bitmap,cliprect);
253253      tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0);
254254      break;
255255   case 5:
256      tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
256      tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0);
257257      tilemap_draw(bitmap,cliprect,char_tilemap,0,0);
258258      draw_sprites(machine, bitmap,cliprect);
259259      tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0);
260260      break;
261261   case 6:
262      tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
262      tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0);
263263      draw_sprites(machine, bitmap,cliprect);
264264      tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0);
265265      tilemap_draw(bitmap,cliprect,char_tilemap,0,0);
266266      break;
267267   case 7:
268      tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
268      tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0);
269269      draw_sprites(machine, bitmap,cliprect);
270270      tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0);
271271      tilemap_draw(bitmap,cliprect,char_tilemap,0,0);
src/mame/video/namcos1.c
r814r815
106106   namcos1_spriteram = auto_malloc(0x1000);
107107
108108   /* initialize playfields */
109   bg_tilemap[0] = tilemap_create(bg_get_info0,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,64,64);
110   bg_tilemap[1] = tilemap_create(bg_get_info1,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,64,64);
111   bg_tilemap[2] = tilemap_create(bg_get_info2,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,64,64);
112   bg_tilemap[3] = tilemap_create(bg_get_info3,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,64,32);
113   bg_tilemap[4] = tilemap_create(fg_get_info4,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,36,28);
114   bg_tilemap[5] = tilemap_create(fg_get_info5,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,36,28);
109   bg_tilemap[0] = tilemap_create(bg_get_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
110   bg_tilemap[1] = tilemap_create(bg_get_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
111   bg_tilemap[2] = tilemap_create(bg_get_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
112   bg_tilemap[3] = tilemap_create(bg_get_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
113   bg_tilemap[4] = tilemap_create(fg_get_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,36,28);
114   bg_tilemap[5] = tilemap_create(fg_get_info5,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,36,28);
115115
116116   tilemap_set_scrolldx(bg_tilemap[4],73,512-73);
117117   tilemap_set_scrolldx(bg_tilemap[5],73,512-73);
src/mame/video/mrdo.c
r814r815
130130         1,
131131         mrdo_bgvideoram[tile_index+0x400] + ((attr & 0x80) << 1),
132132         attr & 0x3f,
133         (attr & 0x40) ? TILE_IGNORE_TRANSPARENCY : 0)
133         (attr & 0x40) ? TILE_FORCE_LAYER0 : 0);
134134}
135135
136136static TILE_GET_INFO( get_fg_tile_info )
r814r815
140140         0,
141141         mrdo_fgvideoram[tile_index+0x400] + ((attr & 0x80) << 1),
142142         attr & 0x3f,
143         (attr & 0x40) ? TILE_IGNORE_TRANSPARENCY : 0)
143         (attr & 0x40) ? TILE_FORCE_LAYER0 : 0);
144144}
145145
146146
r814r815
153153
154154VIDEO_START( mrdo )
155155{
156   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
157   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
156   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
157   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
158158
159159   tilemap_set_transparent_pen(bg_tilemap,0);
160160   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/gundealr.c
r814r815
3030         0,
3131         gundealr_bg_videoram[2*tile_index] + ((attr & 0x07) << 8),
3232         (attr & 0xf0) >> 4,
33         0)
33         0);
3434}
3535
36static UINT32 gundealr_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
36static TILEMAP_MAPPER( gundealr_scan )
3737{
3838   /* logical (col,row) -> memory offset */
3939   return (row & 0x0f) + ((col & 0x3f) << 4) + ((row & 0x10) << 6);
r814r815
4646         1,
4747         gundealr_fg_videoram[2*tile_index] + ((attr & 0x03) << 8),
4848         (attr & 0xf0) >> 4,
49         0)
49         0);
5050}
5151
5252
r814r815
5959
6060VIDEO_START( gundealr )
6161{
62   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,      8, 8,32,32);
63   fg_tilemap = tilemap_create(get_fg_tile_info,gundealr_scan,    TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
62   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,      8, 8,32,32);
63   fg_tilemap = tilemap_create(get_fg_tile_info,gundealr_scan,    TILEMAP_TYPE_PEN,16,16,64,32);
6464
6565   tilemap_set_transparent_pen(fg_tilemap,15);
6666}
src/mame/video/mainevt.c
r814r815
9494   K052109_tilemap_update();
9595
9696   fillbitmap(priority_bitmap,0,cliprect);
97   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY,1);
97   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,1);
9898   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],1,2);   /* low priority part of layer */
9999   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4);   /* high priority part of layer */
100100   tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,8);
r814r815
107107{
108108   K052109_tilemap_update();
109109
110   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY,0);
110   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,0);
111111   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0);
112112   K051960_sprites_draw(bitmap,cliprect,0,0);
113113   tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,0);
src/mame/video/m62.c
r814r815
364364   }
365365}
366366
367void m62_start( tile_get_info_fn tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
367void m62_start( tile_get_info_callback tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
368368{
369   m62_background = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, x1, y1, x2, y2 );
369   m62_background = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, x1, y1, x2, y2 );
370370
371371   m62_background_hscroll = 0;
372372   m62_background_vscroll = 0;
r814r815
383383   }
384384}
385385
386void m62_textlayer( tile_get_info_fn tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
386void m62_textlayer( tile_get_info_callback tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
387387{
388   m62_foreground = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, x1, y1, x2, y2 );
388   m62_foreground = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, x1, y1, x2, y2 );
389389
390390   if( rows != 0 )
391391   {
r814r815
420420   /* is the following right? */
421421   if( ( tile_index / 64 ) < 6 || ( ( color & 0x1f ) >> 1 ) > 0x0c )
422422   {
423      tileinfo->priority = 1;
423      tileinfo->category = 1;
424424   }
425425   else
426426   {
427      tileinfo->priority = 0;
427      tileinfo->category = 0;
428428   }
429429}
430430
r814r815
466466   SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, flags );
467467   if( ( ( color & 0x1f ) >> 1 ) >= 0x0c )
468468   {
469      tileinfo->priority = 1;
469      tileinfo->category = 1;
470470   }
471471   else
472472   {
473      tileinfo->priority = 0;
473      tileinfo->category = 0;
474474   }
475475}
476476
r814r815
506506   SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, flags );
507507   if( ( ( color & 0x1f ) >> 1 ) >= 0x04 )
508508   {
509      tileinfo->priority = 1;
509      tileinfo->category = 1;
510510   }
511511   else
512512   {
513      tileinfo->priority = 0;
513      tileinfo->category = 0;
514514   }
515515}
516516
r814r815
534534   SET_TILE_INFO( 0, code | ( ( color & 0x40 ) << 3 ) | ( ( color & 0x10 ) << 4 ), color & 0x0f, flags );
535535   if( ( ( color & 0x1f ) >> 1 ) >= 0x04 )
536536   {
537      tileinfo->priority = 1;
537      tileinfo->category = 1;
538538   }
539539   else
540540   {
541      tileinfo->priority = 0;
541      tileinfo->category = 0;
542542   }
543543}
544544
r814r815
670670   int color;
671671   code = m62_tileram[ tile_index << 1 ];
672672   color = m62_tileram[ ( tile_index << 1 ) | 1 ];
673   SET_TILE_INFO( 0, code | ( ( color & 0xe0 ) << 3 ) | ( kidniki_background_bank << 11 ), color & 0x1f,
674         TILE_SPLIT( ( ( color & 0xe0 ) == 0xe0 ) ? 1 : 0 ) );
673   SET_TILE_INFO( 0, code | ( ( color & 0xe0 ) << 3 ) | ( kidniki_background_bank << 11 ), color & 0x1f, 0);
674   tileinfo->group = ( ( color & 0xe0 ) == 0xe0 ) ? 1 : 0;
675675}
676676
677677static TILE_GET_INFO( get_kidniki_fg_tile_info )
r814r815
690690   tilemap_set_scrolly( m62_foreground, 0, kidniki_text_vscroll + 128 );
691691   tilemap_set_transparent_pen( m62_foreground, 0 );
692692
693   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_BACK, 0 );
693   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
694694   draw_sprites( machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
695   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_FRONT, 0 );
695   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
696696   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
697697   return 0;
698698}
699699
700700VIDEO_START( kidniki )
701701{
702   m62_background = tilemap_create( get_kidniki_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_SPLIT, 8, 8, 64, 32 );
702   m62_background = tilemap_create( get_kidniki_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32 );
703703
704704   m62_background_hscroll = 0;
705705   m62_background_vscroll = 0;
r814r815
814814   SET_TILE_INFO( 0, code | ( ( color & 0x60 ) << 3 ), color & 0x1f, 0 );
815815   if( ( ( color & 0x1f ) >> 1 ) >= 0x08 )
816816   {
817      tileinfo->priority = 1;
817      tileinfo->category = 1;
818818   }
819819   else
820820   {
821      tileinfo->priority = 0;
821      tileinfo->category = 0;
822822   }
823823}
824824
r814r815
866866   SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ) | ( ( color & 0x20 ) << 5 ), color & 0x1f, 0 );
867867   if( ( ( color & 0x1f ) >> 1 ) >= 0x08 )
868868   {
869      tileinfo->priority = 1;
869      tileinfo->category = 1;
870870   }
871871   else
872872   {
873      tileinfo->priority = 0;
873      tileinfo->category = 0;
874874   }
875875}
876876
src/mame/video/pass.c
r814r815
1818
1919   tileno = pass_bg_videoram[tile_index] & 0x1fff;
2020   fx = (pass_bg_videoram[tile_index] & 0xc000) >> 14;
21   SET_TILE_INFO(1,tileno,0,TILE_FLIPYX(fx))
21   SET_TILE_INFO(1,tileno,0,TILE_FLIPYX(fx));
2222
2323}
2424
r814r815
5959
6060VIDEO_START( pass )
6161{
62   pass_bg_tilemap = tilemap_create(get_pass_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,64,32);
63   pass_fg_tilemap = tilemap_create(get_pass_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 4, 4,128,64);
62   pass_bg_tilemap = tilemap_create(get_pass_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
63   pass_fg_tilemap = tilemap_create(get_pass_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 4, 4,128,64);
6464
6565   tilemap_set_transparent_pen(pass_fg_tilemap,255);
6666}
src/mame/video/toki.c
r814r815
5858         0,
5959         tile,
6060         color,
61         0)
61         0);
6262}
6363
6464static TILE_GET_INFO( get_back_tile_info )
r814r815
7272         2,
7373         tile,
7474         color,
75         0)
75         0);
7676}
7777
7878static TILE_GET_INFO( get_fore_tile_info )
r814r815
8686         3,
8787         tile,
8888         color,
89         0)
89         0);
9090}
9191
9292
r814r815
9898
9999VIDEO_START( toki )
100100{
101   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,32,32);
102   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
103   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
101   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,32,32);
102   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
103   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
104104
105105   tilemap_set_transparent_pen(text_layer,15);
106106   tilemap_set_transparent_pen(background_layer,15);
r814r815
287287   flip_screen_set((toki_scrollram16[0x28]&0x8000)==0);
288288
289289   if (toki_scrollram16[0x28]&0x100) {
290      tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_IGNORE_TRANSPARENCY,0);
290      tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_DRAW_OPAQUE,0);
291291      tilemap_draw(bitmap,cliprect,foreground_layer,0,0);
292292   } else {
293      tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_IGNORE_TRANSPARENCY,0);
293      tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_DRAW_OPAQUE,0);
294294      tilemap_draw(bitmap,cliprect,background_layer,0,0);
295295   }
296296   toki_draw_sprites(machine, bitmap,cliprect);
r814r815
308308   tilemap_set_scrollx( foreground_layer, 0, toki_scrollram16[3]-0x101 );
309309
310310   if (toki_scrollram16[3]&0x2000) {
311      tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_IGNORE_TRANSPARENCY,0);
311      tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_DRAW_OPAQUE,0);
312312      tilemap_draw(bitmap,cliprect,foreground_layer,0,0);
313313   } else {
314      tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_IGNORE_TRANSPARENCY,0);
314      tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_DRAW_OPAQUE,0);
315315      tilemap_draw(bitmap,cliprect,background_layer,0,0);
316316   }
317317
src/mame/video/40love.c
r814r815
9393   SET_TILE_INFO(   0,
9494         code,
9595         tile_attrib & 0x07,
96         0)
96         0);
9797}
9898
9999/***************************************************************************
r814r815
110110   pixel_bitmap1 = auto_bitmap_alloc(256,256,machine->screen[0].format);
111111   pixel_bitmap2 = auto_bitmap_alloc(256,256,machine->screen[0].format);
112112
113   background  = tilemap_create(get_bg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8,8,64,32);
113   background  = tilemap_create(get_bg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,64,32);
114114
115115   tilemap_set_scroll_rows(background,32);
116116   tilemap_set_transparent_pen(background,0);
src/mame/video/renegade.c
r814r815
4848      1 + (attributes & 0x7),
4949      source[0],
5050      attributes >> 5,
51      0)
51      0);
5252}
5353
5454static TILE_GET_INFO( get_fg_tilemap_info )
r814r815
5959      0,
6060      (attributes & 3) * 256 + source[0],
6161      attributes >> 6,
62      0)
62      0);
6363}
6464
6565static void all_tiles_dirty(void)
r814r815
7070
7171VIDEO_START( renegade )
7272{
73   bg_tilemap = tilemap_create(get_bg_tilemap_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,     16, 16, 64, 16);
74   fg_tilemap = tilemap_create(get_fg_tilemap_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT,  8, 8, 32, 32);
73   bg_tilemap = tilemap_create(get_bg_tilemap_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,     16, 16, 64, 16);
74   fg_tilemap = tilemap_create(get_fg_tilemap_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8, 8, 32, 32);
7575
7676   tilemap_set_transparent_pen(fg_tilemap, 0);
7777   tilemap_set_scrolldx(bg_tilemap, 256, 0);
src/mame/video/galaga.c
r814r815
395395***************************************************************************/
396396
397397/* convert from 32x32 to 36x28 */
398static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
398static TILEMAP_MAPPER( tilemap_scan )
399399{
400400   int offs;
401401
r814r815
421421         0,
422422         (galaga_videoram[tile_index] & 0x7f) | (flip_screen ? 0x80 : 0) | (galaga_gfxbank << 8),
423423         galaga_videoram[tile_index + 0x400] & 0x3f,
424         flip_screen ? TILE_FLIPX : 0)
424         flip_screen ? TILE_FLIPX : 0);
425425}
426426
427427
r814r815
434434
435435VIDEO_START( galaga )
436436{
437   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,36,28);
437   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,36,28);
438438
439439   tilemap_set_transparent_pen(tx_tilemap, 0x1f);
440440
src/mame/video/lasso.c
r814r815
111111   SET_TILE_INFO(0,
112112              code + ((UINT16)gfxbank << 8),
113113              color & 0x0f,
114              0)
114              0);
115115}
116116
117117static TILE_GET_INFO( wwjgtin_get_track_tile_info )
r814r815
122122   SET_TILE_INFO(2,
123123              code,
124124              color & 0x0f,
125              0)
125              0);
126126}
127127
128128static TILE_GET_INFO( pinbo_get_bg_tile_info )
r814r815
132132   SET_TILE_INFO(0,
133133              code + ((color & 0x30) << 4),
134134              color & 0x0f,
135              0)
135              0);
136136}
137137
138138
r814r815
145145VIDEO_START( lasso )
146146{
147147   /* create tilemap */
148   bg_tilemap = tilemap_create(lasso_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
148   bg_tilemap = tilemap_create(lasso_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
149149
150150   /* register for saving */
151151   state_save_register_global(gfxbank);
r814r815
154154VIDEO_START( wwjgtin )
155155{
156156   /* create tilemaps */
157   bg_tilemap =    tilemap_create(lasso_get_bg_tile_info,      tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8,  32,  32);
158   track_tilemap = tilemap_create(wwjgtin_get_track_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      16,16, 0x80,0x40);
157   bg_tilemap =    tilemap_create(lasso_get_bg_tile_info,      tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,  32,  32);
158   track_tilemap = tilemap_create(wwjgtin_get_track_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16,16, 0x80,0x40);
159159
160160   tilemap_set_transparent_pen(bg_tilemap,0);
161161
r814r815
167167VIDEO_START( pinbo )
168168{
169169   /* create tilemap */
170   bg_tilemap = tilemap_create(pinbo_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
170   bg_tilemap = tilemap_create(pinbo_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
171171
172172   /* register for saving */
173173   state_save_register_global(gfxbank);
src/mame/video/psychic5.c
r814r815
251251   int color = attr & 0x0f;
252252   int flags = ((attr & 0x10) ? TILE_FLIPX : 0) + ((attr & 0x20) ? TILE_FLIPY : 0);
253253
254   SET_TILE_INFO(1, code, color, flags)
254   SET_TILE_INFO(1, code, color, flags);
255255}
256256
257257static TILE_GET_INFO( get_fg_tile_info )
r814r815
262262   int color = attr & 0x0f;
263263   int flags = ((attr & 0x10) ? TILE_FLIPX : 0) + ((attr & 0x20) ? TILE_FLIPY : 0);
264264
265   SET_TILE_INFO(2, code, color, flags)
265   SET_TILE_INFO(2, code, color, flags);
266266}
267267
268268VIDEO_START( psychic5 )
r814r815
282282   memset(jal_blend_table,0,0xc00) ;
283283
284284   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
285      TILEMAP_TYPE_OPAQUE, 16, 16, 64, 32);
285      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
286286
287287   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
288      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
288      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
289289
290290   tilemap_set_transparent_pen(fg_tilemap, 15);
291291}
src/mame/video/taito_h.c
r814r815
431431
432432   fillbitmap(bitmap, machine->pens[0], cliprect);
433433
434   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_IGNORE_TRANSPARENCY,0);
434   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0);
435435   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,1,0,0);
436436   syvalion_draw_sprites (bitmap,cliprect);
437437   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,2,0,0);
r814r815
451451
452452#ifdef MAME_DEBUG
453453   if ( !input_code_pressed(KEYCODE_A) )
454      TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_IGNORE_TRANSPARENCY,0);
454      TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0);
455455   if ( !input_code_pressed(KEYCODE_S) )
456456      recordbr_draw_sprites(bitmap,cliprect,0);
457457   if ( !input_code_pressed(KEYCODE_D) )
r814r815
459459   if ( !input_code_pressed(KEYCODE_F) )
460460      recordbr_draw_sprites(bitmap,cliprect,1);
461461#else
462   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_IGNORE_TRANSPARENCY,0);
462   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0);
463463   recordbr_draw_sprites (bitmap,cliprect,0);
464464   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,1,0,0);
465465   recordbr_draw_sprites (bitmap,cliprect,1);
r814r815
482482
483483#ifdef MAME_DEBUG
484484   if ( !input_code_pressed(KEYCODE_A) )
485      TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_IGNORE_TRANSPARENCY,0);
485      TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0);
486486   if ( !input_code_pressed(KEYCODE_S) )
487487      dleague_draw_sprites(bitmap,cliprect,0);
488488   if ( !input_code_pressed(KEYCODE_D) )
r814r815
490490   if ( !input_code_pressed(KEYCODE_F) )
491491      dleague_draw_sprites(bitmap,cliprect,1);
492492#else
493   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_IGNORE_TRANSPARENCY,0);
493   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0);
494494   dleague_draw_sprites  (bitmap,cliprect,0);
495495   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,1,0,0);
496496   dleague_draw_sprites  (bitmap,cliprect,1);
src/mame/video/othunder.c
r814r815
247247   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
248248   fillbitmap(bitmap, machine->pens[0], cliprect);
249249
250   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
250   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
251251   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2);
252252   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4);
253253
src/mame/video/ginganin.c
r814r815
8989         BG_GFX,
9090         code,
9191         code >> 12,
92         0)
92         0);
9393}
9494
9595
r814r815
106106         FG_GFX,
107107         code,
108108         code >> 12,
109         0)
109         0);
110110}
111111
112112WRITE16_HANDLER( ginganin_fgram16_w )
r814r815
129129         TXT_GFX,
130130         code,
131131         code >> 12,
132         0)
132         0);
133133}
134134
135135WRITE16_HANDLER( ginganin_txtram16_w )
r814r815
141141
142142VIDEO_START( ginganin )
143143{
144   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,16,16,BG_NX,BG_NY);
145   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,FG_NX,FG_NY);
146   tx_tilemap = tilemap_create(get_txt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,TXT_NX,TXT_NY);
144   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,BG_NX,BG_NY);
145   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,FG_NX,FG_NY);
146   tx_tilemap = tilemap_create(get_txt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,TXT_NX,TXT_NY);
147147
148148   tilemap_set_transparent_pen(fg_tilemap,15);
149149   tilemap_set_transparent_pen(tx_tilemap,15);
src/mame/video/tail2nos.c
r814r815
2828         0,
2929         (code & 0x1fff) + (charbank << 13),
3030         ((code & 0xe000) >> 13) + charpalette * 16,
31         0)
31         0);
3232}
3333
3434
r814r815
5252
5353VIDEO_START( tail2nos )
5454{
55   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
55   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
5656
57   K051316_vh_start_0(machine,REGION_GFX3,4,TILEMAP_TYPE_OPAQUE,0,zoom_callback);
57   K051316_vh_start_0(machine,REGION_GFX3,4,TRUE,0,zoom_callback);
5858
5959   dirtychar = auto_malloc(TOTAL_CHARS);
6060   memset(dirtychar,1,TOTAL_CHARS);
src/mame/video/mrjong.c
r814r815
8787   int color = colorram[tile_index] & 0x1f;
8888   int flags = ((colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x80) ? TILE_FLIPY : 0);
8989
90   SET_TILE_INFO(0, code, color, flags)
90   SET_TILE_INFO(0, code, color, flags);
9191}
9292
9393VIDEO_START( mrjong )
9494{
9595   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy,
96      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
96      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9797}
9898
9999static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/xyonix.c
r814r815
4242
4343   tileno = (xyonix_vidram[tile_index+1] << 0) | ((attr & 0x0f) << 8);
4444
45   SET_TILE_INFO(0,tileno,attr >> 4,0)
45   SET_TILE_INFO(0,tileno,attr >> 4,0);
4646}
4747
4848WRITE8_HANDLER( xyonix_vidram_w )
r814r815
5353
5454VIDEO_START(xyonix)
5555{
56   xyonix_tilemap = tilemap_create(get_xyonix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 4, 8,80,32);
56   xyonix_tilemap = tilemap_create(get_xyonix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 4, 8,80,32);
5757}
5858
5959VIDEO_UPDATE(xyonix)
src/mame/video/1943.c
r814r815
152152   int color = (attr & 0x3c) >> 2;
153153   int flags = TILE_FLIPYX((attr & 0xc0) >> 6);
154154
155   SET_TILE_INFO(2, code, color, flags)
155   SET_TILE_INFO(2, code, color, flags);
156156}
157157
158158static TILE_GET_INFO( c1943_get_bg_tile_info )
r814r815
165165   int color = (attr & 0x3c) >> 2;
166166   int flags = TILE_FLIPYX((attr & 0xc0) >> 6);
167167
168   SET_TILE_INFO(1, code, color, flags)
168   SET_TILE_INFO(1, code, color, flags);
169169}
170170
171171static TILE_GET_INFO( c1943_get_fg_tile_info )
r814r815
174174   int code = videoram[tile_index] + ((attr & 0xe0) << 3);
175175   int color = attr & 0x1f;
176176
177   SET_TILE_INFO(0, code, color, 0)
177   SET_TILE_INFO(0, code, color, 0);
178178}
179179
180180VIDEO_START( 1943 )
181181{
182182   bg2_tilemap = tilemap_create(c1943_get_bg2_tile_info, tilemap_scan_cols,
183      TILEMAP_TYPE_OPAQUE, 32, 32, 2048, 8);
183      TILEMAP_TYPE_PEN, 32, 32, 2048, 8);
184184
185185   bg_tilemap = tilemap_create(c1943_get_bg_tile_info, tilemap_scan_cols,
186      TILEMAP_TYPE_TRANSPARENT, 32, 32, 2048, 8);
186      TILEMAP_TYPE_PEN, 32, 32, 2048, 8);
187187
188188   fg_tilemap = tilemap_create(c1943_get_fg_tile_info, tilemap_scan_rows,
189      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
189      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
190190
191191   tilemap_set_transparent_pen(bg_tilemap, 0);
192192   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/pacland.c
r814r815
142142   int color = ((attr & 0x3e) >> 1) + ((code & 0x1c0) >> 1);
143143   int flags = TILE_FLIPYX(attr >> 6);
144144
145   SET_TILE_INFO(1, code, color, flags)
145   SET_TILE_INFO(1, code, color, flags);
146146}
147147
148148static TILE_GET_INFO( get_fg_tile_info )
r814r815
153153   int color = ((attr & 0x1e) >> 1) + ((code & 0x1e0) >> 1);
154154   int flags = TILE_FLIPYX(attr >> 6);
155155
156   tileinfo->priority = (attr & 0x20) ? 1 : 0;
156   tileinfo->category = (attr & 0x20) ? 1 : 0;
157157
158   SET_TILE_INFO(0, code, color, flags)
158   SET_TILE_INFO(0, code, color, flags);
159159}
160160
161161
r814r815
171171   fg_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
172172   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
173173
174   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,           8,8,64,32);
175   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,64,32);
174   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,           8,8,64,32);
175   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_COLORTABLE,8,8,64,32);
176176
177177   tilemap_set_scroll_rows(fg_tilemap, 32);
178178   tilemap_set_transparent_pen(fg_tilemap, 0xff);
src/mame/video/cninja.c
r814r815
404404   /* Draw playfields */
405405   fillbitmap(priority_bitmap,0,cliprect);
406406   fillbitmap(bitmap,machine->pens[512],cliprect);
407   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,1);
407   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
408408   deco16_tilemap_3_draw(bitmap,cliprect,0,2);
409   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_BACK,2);
410   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_FRONT,4);
409   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER1,2);
410   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0,4);
411411   cninja_draw_sprites(machine,bitmap,cliprect);
412412   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
413413   return 0;
r814r815
421421
422422   fillbitmap(priority_bitmap,0,cliprect);
423423   fillbitmap(bitmap,machine->pens[0],cliprect);
424   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,1);
424   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
425425   if (deco16_raster_display_position)
426426      raster_pf3_draw(bitmap,cliprect,0,2);
427427   else
r814r815
454454   fillbitmap(priority_bitmap,0,cliprect);
455455   fillbitmap(bitmap,machine->pens[0x200],cliprect);
456456   if ((deco16_priority&4)==0)
457      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,1);
457      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
458458
459459   /* Switchable priority */
460460   switch (deco16_priority&0x8) {
r814r815
500500    The other bits may control alpha blend on the 2nd sprite chip, or
501501    layer order.
502502    */
503   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
503   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
504504   deco16_tilemap_2_draw(bitmap,cliprect,0,0);
505505   deco16_tilemap_3_draw(bitmap,cliprect,0,0);
506506
src/mame/video/jcross.c
r814r815
7676         1,
7777         videoram[tile_index],
7878         0,
79         0)
79         0);
8080}
8181
8282static TILE_GET_INFO( get_tx_tilemap_info )
r814r815
8686         0,
8787         tile_number,
8888         0,
89         0)
89         0);
9090}
9191
9292VIDEO_START( jcross )
r814r815
9696   stuff_palette( machine, 0, 0, 16*8 );
9797   stuff_palette( machine, 16*8*3, 16*8, 16*8 );
9898
99   bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,8,8,64,64);
100   tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
99   bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,64);
100   tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
101101
102   tilemap_set_transparent_pen(bg_tilemap,0x0f);
103102   tilemap_set_transparent_pen(tx_tilemap,0xf);
104103   tilemap_set_scrolldx( bg_tilemap,   16, 22 );
105104}
src/mame/video/popper.c
r814r815
103103         0,
104104         tile_number,
105105         (attr&0xf),
106         TILE_SPLIT((attr & 0x80)>>7))
106         0);
107   tileinfo->group = (attr & 0x80)>>7;
107108}
108109
109110static TILE_GET_INFO( get_popper_p0_tile_info )
110111{
111112   UINT32 tile_number = popper_videoram[tile_index];
112113   UINT8 attr = popper_attribram[tile_index];
113   UINT32 flags = 0;
114114   tile_number += popper_gfx_bank << 8;
115115
116116   //pen 0 only in front if colour set as well
117   if (attr&0x70) flags=TILE_SPLIT((attr & 0x80)>>7);
117   tileinfo->group = (attr&0x70) ? ((attr & 0x80)>>7) : 0;
118118
119119   SET_TILE_INFO(
120120         0,
121121         tile_number,
122122         ((attr&0x70)>>4)+8,
123         flags)
123         0);
124124}
125125
126126static TILE_GET_INFO( get_popper_ol_p123_tile_info )
r814r815
133133         0,
134134         tile_number,
135135         (attr&0xf),
136         TILE_SPLIT((attr & 0x80)>>7))
136         0);
137   tileinfo->group = (attr & 0x80)>>7;
137138}
138139
139140static TILE_GET_INFO( get_popper_ol_p0_tile_info )
140141{
141142   UINT32 tile_number = popper_ol_videoram[tile_index];
142143   UINT8 attr = popper_ol_attribram[tile_index];
143   UINT32 flags = 0;
144144   tile_number += popper_gfx_bank << 8;
145145
146146   //pen 0 only in front if colour set as well
147   if (attr&0x70) flags=TILE_SPLIT((attr & 0x80)>>7);
147   tileinfo->group = (attr&0x70) ? ((attr & 0x80)>>7) : 0;
148148
149149   SET_TILE_INFO(
150150         0,
151151         tile_number,
152152         ((attr&0x70)>>4)+8,
153         flags)
153         0);
154154}
155155
156156VIDEO_START( popper )
157157{
158   popper_p123_tilemap    = tilemap_create( get_popper_p123_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_SPLIT,8,8,33,32 );
159   popper_p0_tilemap      = tilemap_create( get_popper_p0_tile_info,     tilemap_scan_cols,TILEMAP_TYPE_SPLIT,8,8,33,32 );
160   popper_ol_p123_tilemap = tilemap_create( get_popper_ol_p123_tile_info,tilemap_scan_cols,TILEMAP_TYPE_SPLIT,8,8,2 ,32 );
161   popper_ol_p0_tilemap   = tilemap_create( get_popper_ol_p0_tile_info,  tilemap_scan_cols,TILEMAP_TYPE_SPLIT,8,8,2 ,32 );
158   popper_p123_tilemap    = tilemap_create( get_popper_p123_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,33,32 );
159   popper_p0_tilemap      = tilemap_create( get_popper_p0_tile_info,     tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,33,32 );
160   popper_ol_p123_tilemap = tilemap_create( get_popper_ol_p123_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,2 ,32 );
161   popper_ol_p0_tilemap   = tilemap_create( get_popper_ol_p0_tile_info,  tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,2 ,32 );
162162
163163   tilemap_set_transmask(popper_p123_tilemap,   0,0x0f,0x01);
164164   tilemap_set_transmask(popper_p123_tilemap,   1,0x01,0x0f);
r814r815
229229   //-xxx---- colour for pen 0 (from second prom?)
230230   //----xxxx colour for pens 1,2,3
231231
232   tilemap_draw( bitmap,cliprect,popper_p123_tilemap,     TILEMAP_BACK,0 );
233   tilemap_draw( bitmap,cliprect,popper_p0_tilemap,       TILEMAP_BACK,0 );
234   tilemap_draw( bitmap,&finalclip,popper_ol_p123_tilemap,TILEMAP_BACK,0 );
235   tilemap_draw( bitmap,&finalclip,popper_ol_p0_tilemap,  TILEMAP_BACK,0 );
232   tilemap_draw( bitmap,cliprect,popper_p123_tilemap,     TILEMAP_DRAW_LAYER1,0 );
233   tilemap_draw( bitmap,cliprect,popper_p0_tilemap,       TILEMAP_DRAW_LAYER1,0 );
234   tilemap_draw( bitmap,&finalclip,popper_ol_p123_tilemap,TILEMAP_DRAW_LAYER1,0 );
235   tilemap_draw( bitmap,&finalclip,popper_ol_p0_tilemap,  TILEMAP_DRAW_LAYER1,0 );
236236
237237   draw_sprites(machine, bitmap,cliprect);
238238
239   tilemap_draw( bitmap,cliprect,popper_p123_tilemap,     TILEMAP_FRONT,0 );
240   tilemap_draw( bitmap,cliprect,popper_p0_tilemap,       TILEMAP_FRONT,0 );
241   tilemap_draw( bitmap,&finalclip,popper_ol_p123_tilemap,TILEMAP_FRONT,0 );
242   tilemap_draw( bitmap,&finalclip,popper_ol_p0_tilemap,  TILEMAP_FRONT,0 );
239   tilemap_draw( bitmap,cliprect,popper_p123_tilemap,     TILEMAP_DRAW_LAYER0,0 );
240   tilemap_draw( bitmap,cliprect,popper_p0_tilemap,       TILEMAP_DRAW_LAYER0,0 );
241   tilemap_draw( bitmap,&finalclip,popper_ol_p123_tilemap,TILEMAP_DRAW_LAYER0,0 );
242   tilemap_draw( bitmap,&finalclip,popper_ol_p0_tilemap,  TILEMAP_DRAW_LAYER0,0 );
243243   return 0;
244244}
src/mame/video/ddrible.c
r814r815
7474
7575***************************************************************************/
7676
77static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
77static TILEMAP_MAPPER( tilemap_scan )
7878{
7979   /* logical (col,row) -> memory offset */
8080   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 6);   /* skip 0x400 */
r814r815
8989         0,
9090         num,
9191         0,
92         TILE_FLIPYX((attr & 0x30) >> 4))
92         TILE_FLIPYX((attr & 0x30) >> 4));
9393}
9494
9595static TILE_GET_INFO( get_bg_tile_info )
r814r815
101101         1,
102102         num,
103103         0,
104         TILE_FLIPYX((attr & 0x30) >> 4))
104         TILE_FLIPYX((attr & 0x30) >> 4));
105105}
106106
107107/***************************************************************************
r814r815
112112
113113VIDEO_START( ddrible )
114114{
115   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
116   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan,TILEMAP_TYPE_OPAQUE,     8,8,64,32);
115   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,64,32);
116   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,     8,8,64,32);
117117
118118   tilemap_set_transparent_pen(fg_tilemap,0);
119119}
src/mame/video/ladyfrog.c
r814r815
3434   SET_TILE_INFO(
3535         0,
3636         tile +0x1000 * tilebank,
37         pal,TILE_FLIPY;
38         )
37         pal,TILE_FLIPY
38         );
3939}
4040
4141WRITE8_HANDLER( ladyfrog_videoram_w )
r814r815
134134VIDEO_START( ladyfrog )
135135{
136136  ladyfrog_spriteram = auto_malloc (160);
137  bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
137  bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
138138
139139  paletteram = auto_malloc(0x200);
140140  paletteram_2 = auto_malloc(0x200);
src/mame/video/djboy.c
r814r815
4444
4545VIDEO_START( djboy )
4646{
47   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,16,16,64,32);
47   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
4848   pandora_start(0,0,0);
4949}
5050
src/mame/video/sidearms.c
r814r815
110110   color = attr>>3 & 0x1f;
111111   flags = attr>>1 & 0x03;
112112
113   SET_TILE_INFO(1, code, color, flags)
113   SET_TILE_INFO(1, code, color, flags);
114114}
115115
116116static TILE_GET_INFO( get_philko_bg_tile_info )
r814r815
123123   color = attr>>3 & 0x0f;
124124   flags = attr>>1 & 0x03;
125125
126   SET_TILE_INFO(1, code, color, flags)
126   SET_TILE_INFO(1, code, color, flags);
127127}
128128
129129static TILE_GET_INFO( get_fg_tile_info )
r814r815
132132   int code = videoram[tile_index] + (attr<<2 & 0x300);
133133   int color = attr & 0x3f;
134134
135   SET_TILE_INFO(0, code, color, 0)
135   SET_TILE_INFO(0, code, color, 0);
136136}
137137
138static UINT32 sidearms_tilemap_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
138static TILEMAP_MAPPER( sidearms_tilemap_scan )
139139{
140140   /* logical (col,row) -> memory offset */
141141   int offset = ((row << 7) + col) << 1;
r814r815
151151   if (!sidearms_gameid)
152152   {
153153      bg_tilemap = tilemap_create(get_sidearms_bg_tile_info, sidearms_tilemap_scan,
154         TILEMAP_TYPE_TRANSPARENT, 32, 32, 128, 128);
154         TILEMAP_TYPE_PEN, 32, 32, 128, 128);
155155
156156      tilemap_set_transparent_pen(bg_tilemap, 15);
157157   }
158158   else
159159   {
160      bg_tilemap = tilemap_create(get_philko_bg_tile_info, sidearms_tilemap_scan,TILEMAP_TYPE_OPAQUE, 32, 32, 128, 128);
160      bg_tilemap = tilemap_create(get_philko_bg_tile_info, sidearms_tilemap_scan,TILEMAP_TYPE_PEN, 32, 32, 128, 128);
161161   }
162162
163163   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
164      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
164      TILEMAP_TYPE_PEN, 8, 8, 64, 64);
165165
166166   tilemap_set_transparent_pen(fg_tilemap, 3);
167167
src/mame/video/jack.c
r814r815
4444   int code = videoram[tile_index] + ((colorram[tile_index] & 0x18) << 5);
4545   int color = colorram[tile_index] & 0x07;
4646
47   SET_TILE_INFO(0, code, color, 0)
47   SET_TILE_INFO(0, code, color, 0);
4848}
4949
5050static UINT32 tilemap_scan_cols_flipy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
r814r815
5555
5656VIDEO_START( jack )
5757{
58   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
58   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
5959}
6060
6161static void jack_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
r814r815
131131   int code = videoram[tile_index] + ((colorram[tile_index] & 0x01) << 8);
132132   int color = (colorram[tile_index] & 0x38) >> 3;
133133
134   SET_TILE_INFO(0, code, color, 0)
134   SET_TILE_INFO(0, code, color, 0);
135135}
136136
137137VIDEO_START( joinem )
138138{
139   bg_tilemap = tilemap_create(joinem_get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
139   bg_tilemap = tilemap_create(joinem_get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
140140}
141141
142142static void joinem_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/tumblep.c
r814r815
9292
9393   fillbitmap(bitmap,machine->pens[256],cliprect); /* not verified */
9494
95   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
95   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
9696   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
9797
9898   draw_sprites(machine,bitmap,cliprect);
src/mame/video/dogfgt.c
r814r815
6969         0,
7070         dogfgt_bgvideoram[tile_index],
7171         dogfgt_bgvideoram[tile_index + 0x400] & 0x03,
72         0)
72         0);
7373}
7474
7575
r814r815
8181
8282VIDEO_START( dogfgt )
8383{
84   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,16,16,32,32);
84   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
8585
8686   bitmapram = auto_malloc(BITMAPRAM_SIZE);
8787
src/mame/video/dietgo.c
r814r815
8585
8686   fillbitmap(bitmap,machine->pens[256],cliprect); /* not verified */
8787
88   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
88   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
8989   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
9090
9191   draw_sprites(machine,bitmap,cliprect);
src/mame/video/kingobox.c
r814r815
173173   int code = (tile_index / 16) ? videoram[tile_index] + ((attr & 0x03) << 8) : 0;
174174   int color = ((attr & 0x70) >> 4) + 8 * palette_bank;
175175
176   SET_TILE_INFO(bank, code, color, 0)
176   SET_TILE_INFO(bank, code, color, 0);
177177}
178178
179179static TILE_GET_INFO( get_fg_tile_info )
r814r815
183183   int code = kingofb_videoram2[tile_index] + ((attr & 0x01) << 8);
184184   int color = (attr & 0x38) >> 3;
185185
186   SET_TILE_INFO(bank, code, color, 0)
186   SET_TILE_INFO(bank, code, color, 0);
187187}
188188
189189VIDEO_START( kingofb )
190190{
191191   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y,
192      TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
192      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
193193
194194   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_y,
195      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
195      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
196196
197197   tilemap_set_transparent_pen(fg_tilemap, 0);
198198}
r814r815
243243   int code = (tile_index / 16) ? videoram[tile_index] : 0;
244244   int color = ((colorram[tile_index] & 0x70) >> 4) + 8 * palette_bank;
245245
246   SET_TILE_INFO(4, code, color, 0)
246   SET_TILE_INFO(4, code, color, 0);
247247}
248248
249249VIDEO_START( ringking )
250250{
251251   bg_tilemap = tilemap_create(ringking_get_bg_tile_info, tilemap_scan_cols_flip_y,
252      TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
252      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
253253
254254   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_y,
255      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
255      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
256256
257257   tilemap_set_transparent_pen(fg_tilemap, 0);
258258}
src/mame/video/galivan.c
r814r815
151151         1,
152152         code,
153153         (attr & 0x78) >> 3,      /* seems correct */
154         0)
154         0);
155155}
156156
157157static TILE_GET_INFO( get_tx_tile_info )
r814r815
162162         0,
163163         code,
164164         (attr & 0xe0) >> 5,      /* not sure */
165         0)
166   tileinfo->priority = attr & 8 ? 0 : 1;   /* seems correct */
165         0);
166   tileinfo->category = attr & 8 ? 0 : 1;   /* seems correct */
167167}
168168
169169static TILE_GET_INFO( ninjemak_get_bg_tile_info )
r814r815
175175         1,
176176         code,
177177         ((attr & 0x60) >> 3) | ((attr & 0x0c) >> 2),   /* seems correct */
178         0)
178         0);
179179}
180180
181181static TILE_GET_INFO( ninjemak_get_tx_tile_info )
r814r815
186186         0,
187187         code,
188188         (attr & 0x1c) >> 2,      /* seems correct ? */
189         0)
189         0);
190190}
191191
192192
r814r815
203203   UINT8 *rombase = memory_region(REGION_CPU1);
204204   memory_configure_bank(1, 0, 2, &rombase[0x10000], 0x2000);
205205
206   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,   16,16,128,128);
207   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
206   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,   16,16,128,128);
207   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
208208
209209   tilemap_set_transparent_pen(tx_tilemap,15);
210210
r814r815
222222   UINT8 *rombase = memory_region(REGION_CPU1);
223223   memory_configure_bank(1, 0, 4, &rombase[0x10000], 0x2000);
224224
225   bg_tilemap = tilemap_create(ninjemak_get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,   16,16,512,32);
226   tx_tilemap = tilemap_create(ninjemak_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
225   bg_tilemap = tilemap_create(ninjemak_get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,   16,16,512,32);
226   tx_tilemap = tilemap_create(ninjemak_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
227227
228228   tilemap_set_transparent_pen(tx_tilemap,15);
229229
src/mame/video/tsamurai.c
r814r815
3131         0,
3232         tile_number,
3333         attributes & 0x1f,
34         0)
34         0);
3535}
3636
3737static TILE_GET_INFO( get_fg_tile_info )
r814r815
4343         1,
4444         tile_number,
4545         colorram[((tile_index&0x1f)*2)+1] & 0x1f,
46         0)
46         0);
4747}
4848
4949
r814r815
5555
5656VIDEO_START( tsamurai )
5757{
58   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
59   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
58   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
59   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
6060
6161   tilemap_set_transparent_pen(background,0);
6262   tilemap_set_transparent_pen(foreground,0);
r814r815
250250         1,
251251         tile_number,
252252         color,
253         0)
253         0);
254254}
255255
256256VIDEO_START( vsgongf )
257257{
258   foreground = tilemap_create(get_vsgongf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
258   foreground = tilemap_create(get_vsgongf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
259259}
260260
261261VIDEO_UPDATE( vsgongf )
src/mame/video/canyon.c
r814r815
2323{
2424   UINT8 code = canyon_videoram[tile_index];
2525
26   SET_TILE_INFO(0, code & 0x3f, code >> 7, 0)
26   SET_TILE_INFO(0, code & 0x3f, code >> 7, 0);
2727}
2828
2929
3030VIDEO_START( canyon )
3131{
3232   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
33      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
33      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
3434}
3535
3636
src/mame/video/splash.c
r814r815
5656         0,
5757         code + ((0x20 + (attr & 0x0f)) << 8),
5858         (attr & 0xf0) >> 4,
59         0)
59         0);
6060}
6161
6262static TILE_GET_INFO( get_tile_info_splash_tilemap1 )
r814r815
6969         1,
7070         (code >> 2) + ((0x30 + (attr & 0x0f)) << 6),
7171         (attr & 0xf0) >> 4,
72         TILE_FLIPXY(code & 0x03))
72         TILE_FLIPXY(code & 0x03));
7373}
7474
7575/***************************************************************************
r814r815
177177
178178VIDEO_START( splash )
179179{
180   bg_tilemap[0] = tilemap_create(get_tile_info_splash_tilemap0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
181   bg_tilemap[1] = tilemap_create(get_tile_info_splash_tilemap1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
180   bg_tilemap[0] = tilemap_create(get_tile_info_splash_tilemap0,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
181   bg_tilemap[1] = tilemap_create(get_tile_info_splash_tilemap1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
182182
183183   tilemap_set_transparent_pen(bg_tilemap[0],0);
184184   tilemap_set_transparent_pen(bg_tilemap[1],0);
src/mame/video/f1gp.c
r814r815
2828{
2929   int code = f1gp_rozvideoram[tile_index];
3030
31   SET_TILE_INFO(3,code & 0x7ff,code >> 12,0)
31   SET_TILE_INFO(3,code & 0x7ff,code >> 12,0);
3232}
3333
3434static TILE_GET_INFO( f1gp2_get_roz_tile_info )
3535{
3636   int code = f1gp_rozvideoram[tile_index];
3737
38   SET_TILE_INFO(2,(code & 0x7ff) + (f1gp2_roz_bank << 11),code >> 12,0)
38   SET_TILE_INFO(2,(code & 0x7ff) + (f1gp2_roz_bank << 11),code >> 12,0);
3939}
4040
4141static TILE_GET_INFO( get_fg_tile_info )
4242{
4343   int code = f1gp_fgvideoram[tile_index];
4444
45   SET_TILE_INFO(0,code & 0x7fff,0,(code & 0x8000)?TILE_FLIPY:0)
45   SET_TILE_INFO(0,code & 0x7fff,0,(code & 0x8000)?TILE_FLIPY:0);
4646}
4747
4848
r814r815
5454
5555VIDEO_START( f1gp )
5656{
57   roz_tilemap = tilemap_create(f1gp_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,64);
58   fg_tilemap =  tilemap_create(get_fg_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
57   roz_tilemap = tilemap_create(f1gp_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,64);
58   fg_tilemap =  tilemap_create(get_fg_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
5959
6060   K053936_wraparound_enable(0, 1);
6161   K053936_set_offset(0, -58, -2);
r814r815
7070
7171VIDEO_START( f1gp2 )
7272{
73   roz_tilemap = tilemap_create(f1gp2_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
74   fg_tilemap =  tilemap_create(get_fg_tile_info,       tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
73   roz_tilemap = tilemap_create(f1gp2_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
74   fg_tilemap =  tilemap_create(get_fg_tile_info,       tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
7575
7676   K053936_wraparound_enable(0, 1);
7777   K053936_set_offset(0, -48, -21);
r814r815
395395      switch (gfxctrl & 3)
396396      {
397397         case 0:
398            K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
398            K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_DRAW_OPAQUE,0);
399399            f1gp2_draw_sprites(machine,bitmap,cliprect);
400400            tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
401401            break;
402402         case 1:
403            K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
403            K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_DRAW_OPAQUE,0);
404404            tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
405405            f1gp2_draw_sprites(machine,bitmap,cliprect);
406406            break;
407407         case 2:
408            tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
408            tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_OPAQUE,0);
409409            K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,0,0);
410410            f1gp2_draw_sprites(machine,bitmap,cliprect);
411411            break;
src/mame/video/lvcards.c
r814r815
9999   int color = attr & 0x0f;
100100   int flags = (attr & 0x40) ? TILE_FLIPX : 0;
101101
102   SET_TILE_INFO(0, code, color, flags)
102   SET_TILE_INFO(0, code, color, flags);
103103}
104104
105105VIDEO_START( lvcards )
106106{
107107   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
108      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
108      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
109109}
110110
111111VIDEO_UPDATE( lvcards )
src/mame/video/namcos2.c
r814r815
5858static TILE_GET_INFO( get_tile_info_roz )
5959{
6060   int tile = namcos2_68k_roz_ram[tile_index];
61   SET_TILE_INFO(3,tile,0/*color*/,0)
61   SET_TILE_INFO(3,tile,0/*color*/,0);
6262} /* get_tile_info_roz */
6363
6464struct RozParam
r814r815
8383   {
8484      UINT32 size_mask = rozInfo->size-1;
8585      mame_bitmap *srcbitmap = tilemap_get_pixmap( tmap );
86      mame_bitmap *transparency_bitmap = tilemap_get_transparency_bitmap( tmap );
86      mame_bitmap *flagsbitmap = tilemap_get_flagsmap( tmap );
8787      UINT32 startx = rozInfo->startx + clip->min_x * rozInfo->incxx + clip->min_y * rozInfo->incyx;
8888      UINT32 starty = rozInfo->starty + clip->min_x * rozInfo->incxy + clip->min_y * rozInfo->incyy;
8989      int sx = clip->min_x;
r814r815
108108               goto L_SkipPixel;
109109            }
110110
111            if( *BITMAP_ADDR8(transparency_bitmap, ypos, xpos)&TILE_FLAG_FG_OPAQUE )
111            if( *BITMAP_ADDR8(flagsbitmap, ypos, xpos)&TILEMAP_PIXEL_LAYER0 )
112112            {
113113               *dest = *BITMAP_ADDR16(srcbitmap, ypos, xpos)+rozInfo->color;
114114            }
r814r815
322322VIDEO_START( namcos2 )
323323{
324324   namco_tilemap_init(2,memory_region(REGION_GFX4),TilemapCB);
325   tilemap_roz = tilemap_create(get_tile_info_roz,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,256,256);
325   tilemap_roz = tilemap_create(get_tile_info_roz,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,256,256);
326326   tilemap_set_transparent_pen(tilemap_roz,0xff);
327327   DrawSpriteInit();
328328}
src/mame/video/tx1.c
r814r815
4343   lower = (tx1_vram[tile_index]<<3);
4444   tileno = (bit15 | upper | lower)/8;
4545
46   SET_TILE_INFO(0,tileno,0,0)
46   SET_TILE_INFO(0,tileno,0,0);
4747}
4848
4949VIDEO_START( tx1 )
5050{
51   tx1_tilemap = tilemap_create(get_tx1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,128,64);
51   tx1_tilemap = tilemap_create(get_tx1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,128,64);
5252   tilemap_set_transparent_pen(tx1_tilemap,0xff);
5353}
5454
r814r815
199199   lower = (buggyboy_vram[tile_index]<<3);
200200   tileno = (bit15 | upper | lower)/8;
201201
202   SET_TILE_INFO(0,tileno,color,0)
202   SET_TILE_INFO(0,tileno,color,0);
203203}
204204
205205
r814r815
344344
345345VIDEO_START( buggyb1 )
346346{
347   buggyb1_tilemap = tilemap_create(get_buggyb1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
347   buggyb1_tilemap = tilemap_create(get_buggyb1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
348348        tilemap_set_transparent_pen(buggyb1_tilemap, 0);
349349}
350350
351351
352352VIDEO_START( buggyboy )
353353{
354   buggyboy_tilemap = tilemap_create(get_buggyboy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,128,64);
354   buggyboy_tilemap = tilemap_create(get_buggyboy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,128,64);
355355        tilemap_set_transparent_pen(buggyboy_tilemap, 0);
356356}
357357
r814r815
393393   }
394394   else
395395   {
396      tilemap_draw(bitmap,cliprect,buggyb1_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
396      tilemap_draw(bitmap,cliprect,buggyb1_tilemap,TILEMAP_DRAW_OPAQUE,0);
397397      draw_objects(machine, bitmap,cliprect,0);
398398   }
399399   return 0;
r814r815
413413   }
414414   else
415415   {
416      tilemap_draw(bitmap,cliprect,buggyboy_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
416      tilemap_draw(bitmap,cliprect,buggyboy_tilemap,TILEMAP_DRAW_OPAQUE,0);
417417      draw_objects(machine, bitmap,cliprect,xscrollamount);
418418   }
419419   return 0;
src/mame/video/dassault.c
r814r815
173173   deco16_clear_sprite_priority_bitmap();
174174   fillbitmap(priority_bitmap,0,cliprect);
175175   fillbitmap(bitmap,machine->pens[3072],cliprect);
176   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
176   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
177177
178178   /* The middle playfields can be swapped priority-wise */
179179   if ((deco16_priority&3)==0) {
src/mame/video/pingpong.c
r814r815
113113   int color = attr & 0x1f;
114114   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
115115
116   SET_TILE_INFO(0, code, color, flags)
116   SET_TILE_INFO(0, code, color, flags);
117117}
118118
119119VIDEO_START( pingpong )
120120{
121121   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
122      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
122      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
123123}
124124
125125static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/ssrj.c
r814r815
2424      0,
2525      code&1023,
2626      (code>>12)&0x3,
27     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   )
27     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
2828}
2929
3030/* tilemap 2 */
r814r815
4848      0,
4949      code&1023,
5050      ((code>>12)&0x3)+4,
51     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   )
51     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
5252}
5353
5454/* tilemap 4 */
r814r815
7272      0,
7373      code&1023,
7474      ((code>>12)&0x3)+12,
75     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   )
75     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
7676}
7777
7878
r814r815
232232
233233VIDEO_START( ssrj )
234234{
235   tilemap1 = tilemap_create( get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
236   tilemap2 = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32 );
237   tilemap4 = tilemap_create( get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32 );
235   tilemap1 = tilemap_create( get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
236   tilemap2 = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
237   tilemap4 = tilemap_create( get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
238238   tilemap_set_transparent_pen(tilemap2,0);
239239   tilemap_set_transparent_pen(tilemap4,0);
240240}
src/mame/video/blstroid.c
r814r815
8282   };
8383
8484   /* initialize the playfield */
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,8, 64,64);
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,64);
8686
8787   /* initialize the motion objects */
8888   atarimo_init(machine, 0, &modesc);
src/mame/video/gotya.c
r814r815
9898   int code = videoram[tile_index];
9999   int color = colorram[tile_index] & 0x0f;
100100
101   SET_TILE_INFO(0, code, color, 0)
101   SET_TILE_INFO(0, code, color, 0);
102102}
103103
104UINT32 tilemap_scan_rows_thehand( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
104static TILEMAP_MAPPER( tilemap_scan_rows_thehand )
105105{
106106   /* logical (col,row) -> memory offset */
107107   row = 31-row;
r814r815
112112VIDEO_START( gotya )
113113{
114114   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_thehand,
115      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
115      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
116116}
117117
118118static void draw_status_row(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int sx, int col)
src/mame/video/tatsumi.c
r814r815
169169         1,
170170         tile,
171171         color,
172         0)
172         0);
173173}
174174
175175static TILE_GET_INFO( get_bg_tile_info_cyclwarr )
r814r815
183183         1,
184184         tile,
185185         color,
186         0)
186         0);
187187}
188188
189189static TILE_GET_INFO( get_text_tile_info_cyclwarr )
r814r815
197197         1,
198198         tile,
199199         color,
200         0)
200         0);
201201}
202202
203203/********************************************************************/
204204
205205VIDEO_START( apache3 )
206206{
207   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
207   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
208208   shadow_pen_array = auto_malloc(8192);
209209   temp_bitmap = auto_bitmap_alloc(512, 512, BITMAP_FORMAT_RGB32);
210210
r814r815
214214
215215VIDEO_START( roundup5 )
216216{
217   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
217   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
218218   shadow_pen_array = auto_malloc(8192);
219219   roundup5_vram = auto_malloc(0x48000 * 4);
220220
r814r815
224224
225225VIDEO_START( cyclwarr )
226226{
227   bg_layer = tilemap_create(get_bg_tile_info_cyclwarr,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,256,256);
228   tx_layer = tilemap_create(get_text_tile_info_cyclwarr,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
227   bg_layer = tilemap_create(get_bg_tile_info_cyclwarr,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,256,256);
228   tx_layer = tilemap_create(get_text_tile_info_cyclwarr,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
229229   shadow_pen_array = auto_malloc(8192);
230230
231231   memset(shadow_pen_array, 0, 8192);
src/mame/video/konamiic.c
r814r815
14671467  color RAM     ----xxxx    depends on external connections (usually color and banking)
14681468*/
14691469
1470static UINT32 K007342_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
1470static TILEMAP_MAPPER( K007342_scan )
14711471{
14721472   /* logical (col,row) -> memory offset */
14731473   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5);
r814r815
14811481   code = vram[tile_index];
14821482   flags = TILE_FLIPYX((color & 0x30) >> 4);
14831483
1484   tileinfo->priority = (color & 0x80) >> 7;
1484   tileinfo->category = (color & 0x80) >> 7;
14851485
14861486   (*K007342_callback)(layer, K007342_regs[1], &code, &color, &flags);
14871487
r814r815
14891489         K007342_gfxnum,
14901490         code,
14911491         color,
1492         flags)
1492         flags);
14931493}
14941494
14951495static TILE_GET_INFO( K007342_get_tile_info0 ) { K007342_get_tile_info(machine,tileinfo,tile_index,0,K007342_colorram_0,K007342_videoram_0); }
r814r815
15021502   K007342_gfxnum = gfx_index;
15031503   K007342_callback = callback;
15041504
1505   K007342_tilemap[0] = tilemap_create(K007342_get_tile_info0,K007342_scan,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
1506   K007342_tilemap[1] = tilemap_create(K007342_get_tile_info1,K007342_scan,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
1505   K007342_tilemap[0] = tilemap_create(K007342_get_tile_info0,K007342_scan,TILEMAP_TYPE_PEN,8,8,64,32);
1506   K007342_tilemap[1] = tilemap_create(K007342_get_tile_info1,K007342_scan,TILEMAP_TYPE_PEN,8,8,64,32);
15071507
15081508   K007342_ram = auto_malloc(0x2000);
15091509   K007342_scroll_ram = auto_malloc(0x0200);
r814r815
19281928         color,
19291929         flags);
19301930
1931   tileinfo->priority = priority;
1931   tileinfo->category = priority;
19321932}
19331933
19341934static TILE_GET_INFO( K052109_get_tile_info0 ) { K052109_get_tile_info(machine,tileinfo,tile_index,0,K052109_colorram_F,K052109_videoram_F,K052109_videoram2_F); }
r814r815
19991999
20002000   has_extra_video_ram = 0;
20012001
2002   K052109_tilemap[0] = tilemap_create(K052109_get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
2003   K052109_tilemap[1] = tilemap_create(K052109_get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
2004   K052109_tilemap[2] = tilemap_create(K052109_get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
2002   K052109_tilemap[0] = tilemap_create(K052109_get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
2003   K052109_tilemap[1] = tilemap_create(K052109_get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
2004   K052109_tilemap[2] = tilemap_create(K052109_get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
20052005
20062006   K052109_ram = auto_malloc(0x6000);
20072007
r814r815
45424542         K051316_gfxnum[chip],
45434543         code,
45444544         color,
4545         flags)
4545         flags);
45464546}
45474547
45484548static TILE_GET_INFO( K051316_get_tile_info0 ) { K051316_get_tile_info(machine,tileinfo,tile_index,0); }
r814r815
45514551
45524552
45534553void K051316_vh_start(running_machine *machine,int chip, int gfx_memory_region,int bpp,
4554      int tilemap_type,int transparent_pen,
4554      int pen_is_mask,int transparent_pen,
45554555      void (*callback)(int *code,int *color,int *flags))
45564556{
45574557   int gfx_index;
4558   static tile_get_info_fn get_tile_info[3] = { K051316_get_tile_info0,K051316_get_tile_info1,K051316_get_tile_info2 };
4558   static tile_get_info_callback get_tile_info[3] = { K051316_get_tile_info0,K051316_get_tile_info1,K051316_get_tile_info2 };
45594559
45604560   /* find first empty slot to decode gfx */
45614561   for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
r814r815
46354635   K051316_bpp[chip] = bpp;
46364636   K051316_callback[chip] = callback;
46374637
4638   K051316_tilemap[chip] = tilemap_create(get_tile_info[chip],tilemap_scan_rows,tilemap_type,16,16,32,32);
4638   K051316_tilemap[chip] = tilemap_create(get_tile_info[chip],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
46394639
46404640   K051316_ram[chip] = auto_malloc(0x800);
46414641
4642   tilemap_set_transparent_pen(K051316_tilemap[chip],transparent_pen);
4642   if (!pen_is_mask)
4643      tilemap_set_transparent_pen(K051316_tilemap[chip],transparent_pen);
4644   else
4645   {
4646      tilemap_map_pens_to_layer(K051316_tilemap[chip], 0, 0, 0, TILEMAP_PIXEL_LAYER1);
4647      tilemap_map_pens_to_layer(K051316_tilemap[chip], 0, transparent_pen, transparent_pen, TILEMAP_PIXEL_LAYER0);
4648   }
46434649
46444650   K051316_wraparound[chip] = 0;   /* default = no wraparound */
46454651   K051316_offset[chip][0] = K051316_offset[chip][1] = 0;
46464652}
46474653
46484654void K051316_vh_start_0(running_machine *machine,int gfx_memory_region,int bpp,
4649      int tilemap_type,int transparent_pen,
4655      int pen_is_mask,int transparent_pen,
46504656      void (*callback)(int *code,int *color,int *flags))
46514657{
4652   K051316_vh_start(machine,0,gfx_memory_region,bpp,tilemap_type,transparent_pen,callback);
4658   K051316_vh_start(machine,0,gfx_memory_region,bpp,pen_is_mask,transparent_pen,callback);
46534659}
46544660
46554661void K051316_vh_start_1(running_machine *machine,int gfx_memory_region,int bpp,
4656      int tilemap_type,int transparent_pen,
4662      int pen_is_mask,int transparent_pen,
46574663      void (*callback)(int *code,int *color,int *flags))
46584664{
4659   K051316_vh_start(machine,1,gfx_memory_region,bpp,tilemap_type,transparent_pen,callback);
4665   K051316_vh_start(machine,1,gfx_memory_region,bpp,pen_is_mask,transparent_pen,callback);
46604666}
46614667
46624668void K051316_vh_start_2(running_machine *machine,int gfx_memory_region,int bpp,
4663      int tilemap_type,int transparent_pen,
4669      int pen_is_mask,int transparent_pen,
46644670      void (*callback)(int *code,int *color,int *flags))
46654671{
4666   K051316_vh_start(machine,2,gfx_memory_region,bpp,tilemap_type,transparent_pen,callback);
4672   K051316_vh_start(machine,2,gfx_memory_region,bpp,pen_is_mask,transparent_pen,callback);
46674673}
46684674
46694675
r814r815
54175423
54185424static void (*K056832_callback)(int layer, int *code, int *color, int *flags);
54195425
5420static UINT32 K056832_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
5421{
5422   return (row<<6) + col;
5423}
5424
54255426INLINE void K056832_get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int pageIndex )
54265427{
54275428   static struct K056832_SHIFTMASKS
r814r815
54625463   SET_TILE_INFO(K056832_gfxnum,
54635464         code,
54645465         color,
5465         flags)
5466         flags);
54665467}
54675468
54685469static TILE_GET_INFO( K056832_get_tile_info0 ) { K056832_get_tile_info(machine,tileinfo,tile_index,0x0); }
r814r815
57385739
57395740   K056832_videoram = auto_malloc(0x2000 * (K056832_PAGE_COUNT+1));
57405741
5741   K056832_tilemap[0x0] = tilemap_create(K056832_get_tile_info0, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5742   K056832_tilemap[0x1] = tilemap_create(K056832_get_tile_info1, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5743   K056832_tilemap[0x2] = tilemap_create(K056832_get_tile_info2, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5744   K056832_tilemap[0x3] = tilemap_create(K056832_get_tile_info3, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5745   K056832_tilemap[0x4] = tilemap_create(K056832_get_tile_info4, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5746   K056832_tilemap[0x5] = tilemap_create(K056832_get_tile_info5, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5747   K056832_tilemap[0x6] = tilemap_create(K056832_get_tile_info6, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5748   K056832_tilemap[0x7] = tilemap_create(K056832_get_tile_info7, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5749   K056832_tilemap[0x8] = tilemap_create(K056832_get_tile_info8, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5750   K056832_tilemap[0x9] = tilemap_create(K056832_get_tile_info9, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5751   K056832_tilemap[0xa] = tilemap_create(K056832_get_tile_infoa, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5752   K056832_tilemap[0xb] = tilemap_create(K056832_get_tile_infob, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5753   K056832_tilemap[0xc] = tilemap_create(K056832_get_tile_infoc, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5754   K056832_tilemap[0xd] = tilemap_create(K056832_get_tile_infod, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5755   K056832_tilemap[0xe] = tilemap_create(K056832_get_tile_infoe, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5756   K056832_tilemap[0xf] = tilemap_create(K056832_get_tile_infof, K056832_scan, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
5742   K056832_tilemap[0x0] = tilemap_create(K056832_get_tile_info0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5743   K056832_tilemap[0x1] = tilemap_create(K056832_get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5744   K056832_tilemap[0x2] = tilemap_create(K056832_get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5745   K056832_tilemap[0x3] = tilemap_create(K056832_get_tile_info3, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5746   K056832_tilemap[0x4] = tilemap_create(K056832_get_tile_info4, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5747   K056832_tilemap[0x5] = tilemap_create(K056832_get_tile_info5, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5748   K056832_tilemap[0x6] = tilemap_create(K056832_get_tile_info6, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5749   K056832_tilemap[0x7] = tilemap_create(K056832_get_tile_info7, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5750   K056832_tilemap[0x8] = tilemap_create(K056832_get_tile_info8, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5751   K056832_tilemap[0x9] = tilemap_create(K056832_get_tile_info9, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5752   K056832_tilemap[0xa] = tilemap_create(K056832_get_tile_infoa, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5753   K056832_tilemap[0xb] = tilemap_create(K056832_get_tile_infob, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5754   K056832_tilemap[0xc] = tilemap_create(K056832_get_tile_infoc, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5755   K056832_tilemap[0xd] = tilemap_create(K056832_get_tile_infod, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5756   K056832_tilemap[0xe] = tilemap_create(K056832_get_tile_infoe, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5757   K056832_tilemap[0xf] = tilemap_create(K056832_get_tile_infof, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
57575758
57585759   for (i=0; i<K056832_PAGE_COUNT; i++)
57595760   {
r814r815
64016402
64026403#define DRAW_PIX(N) \
64036404   if ((pen = src_ptr[N])) \
6404   { pen += basepen; xpr_ptr[count+N] = TILE_FLAG_FG_OPAQUE; dst_ptr[count+N] = pen; } else \
6405   { pen += basepen; xpr_ptr[count+N] = TILEMAP_PIXEL_LAYER0; dst_ptr[count+N] = pen; } else \
64056406   { xpr_ptr[count+N] = 0; }
64066407
64076408   rectangle zerorect;
r814r815
64296430
64306431   tmap = K056832_tilemap[page];
64316432   pixmap  = K056832_pixmap[page];
6432   xprmap  = tilemap_get_transparency_bitmap(tmap);
6433   xprdata = tilemap_get_transparency_data(tmap);
6433   xprmap  = tilemap_get_flagsmap(tmap);
6434   xprdata = tilemap_get_tile_flags(tmap);
64346435
64356436   dirty = K056832_LineDirty[page];
64366437   all_dirty = K056832_AllLinesDirty[page];
r814r815
64456446      memset (&zerorect, 0, sizeof(rectangle));   // zero dimension
64466447      tilemap_draw(bitmap, &zerorect, tmap, 0, 0);   // dummy call to reset tile_dirty_map
64476448      fillbitmap(xprmap, 0, 0);                  // reset pixel transparency_bitmap;
6448      memset(xprdata, TILE_FLAG_FG_OPAQUE, 0x800);   // reset tile transparency_data;
6449      memset(xprdata, TILEMAP_PIXEL_LAYER0, 0x800);   // reset tile transparency_data;
64496450   }
64506451   else
64516452   {
r814r815
64746475
64756476      K056832_get_tile_info(machine, tileinfo, line, page);
64766477      src_ptr = tileinfo->pen_data;//src_base + ((tileinfo->tile_number & ~7) << 6);
6477      basepen = tileinfo->pal_data - pal_ptr;
6478      code_transparent = tileinfo->priority;
6479      code_opaque = code_transparent | TILE_FLAG_FG_OPAQUE;
6478      basepen = tileinfo->palette_base;
6479      code_transparent = tileinfo->category;
6480      code_opaque = code_transparent | TILEMAP_PIXEL_LAYER0;
64806481      count = -LINE_WIDTH;
64816482
64826483      do
src/mame/video/blmbycar.c
r814r815
8383         0,
8484         code,
8585         attr & 0x1f,
86         TILE_FLIPYX((attr >> 6) & 3))
86         TILE_FLIPYX((attr >> 6) & 3));
8787
88   tileinfo->priority = (attr >> 5) & 1;
88   tileinfo->category = (attr >> 5) & 1;
8989}
9090
9191static TILE_GET_INFO( get_tile_info_1 )
r814r815
9696         0,
9797         code,
9898         attr & 0x1f,
99         TILE_FLIPYX((attr >> 6) & 3))
99         TILE_FLIPYX((attr >> 6) & 3));
100100
101   tileinfo->priority = (attr >> 5) & 1;
101   tileinfo->category = (attr >> 5) & 1;
102102}
103103
104104
r814r815
126126VIDEO_START( blmbycar )
127127{
128128   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
129                        TILEMAP_TYPE_OPAQUE, 16,16, DIM_NX, DIM_NY );
129                        TILEMAP_TYPE_PEN, 16,16, DIM_NX, DIM_NY );
130130
131131   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
132                        TILEMAP_TYPE_TRANSPARENT, 16,16, DIM_NX, DIM_NY );
132                        TILEMAP_TYPE_PEN, 16,16, DIM_NX, DIM_NY );
133133
134134      tilemap_set_scroll_rows(tilemap_0,1);
135135      tilemap_set_scroll_cols(tilemap_0,1);
136      tilemap_set_transparent_pen(tilemap_0,0);
137136
138137      tilemap_set_scroll_rows(tilemap_1,1);
139138      tilemap_set_scroll_cols(tilemap_1,1);
src/mame/video/retofinv.c
r814r815
7979***************************************************************************/
8080
8181/* convert from 32x32 to 36x28 */
82static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
82static TILEMAP_MAPPER( tilemap_scan )
8383{
8484   row += 2;
8585   col -= 2;
r814r815
9595         1,
9696         retofinv_bg_videoram[tile_index] + 256 * bg_bank,
9797         retofinv_bg_videoram[0x400 + tile_index] & 0x3f,
98         0)
98         0);
9999}
100100
101101static TILE_GET_INFO( fg_get_tile_info )
r814r815
105105         0,
106106         retofinv_fg_videoram[tile_index] + 256 * fg_bank,
107107         retofinv_fg_videoram[0x400 + tile_index],
108         (tile_index < 0x40 || tile_index >= 0x3c0) ? TILE_IGNORE_TRANSPARENCY : 0)
108         (tile_index < 0x40 || tile_index >= 0x3c0) ? TILE_FORCE_LAYER0 : 0);
109109}
110110
111111
r814r815
118118
119119VIDEO_START( retofinv )
120120{
121   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan,TILEMAP_TYPE_OPAQUE,8,8,36,28);
122   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,36,28);
121   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
122   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,36,28);
123123
124124   tilemap_set_transparent_pen(fg_tilemap,0);
125125
src/mame/video/gbusters.c
r814r815
5858   if (gbusters_priority)
5959   {
6060//      K051960_sprites_draw(bitmap,cliprect,1,1);  /* are these used? */
61      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_IGNORE_TRANSPARENCY,0);
61      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_DRAW_OPAQUE,0);
6262      K051960_sprites_draw(bitmap,cliprect,2,2);
6363      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0);
6464      K051960_sprites_draw(bitmap,cliprect,0,0);
r814r815
6767   else
6868   {
6969//      K051960_sprites_draw(bitmap,cliprect,1,1);  /* are these used? */
70      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY,0);
70      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,0);
7171      K051960_sprites_draw(bitmap,cliprect,2,2);
7272      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0);
7373      K051960_sprites_draw(bitmap,cliprect,0,0);
src/mame/video/meadows.c
r814r815
3636
3737VIDEO_START( meadows )
3838{
39   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,30);
39   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,30);
4040}
4141
4242
src/mame/video/bogeyman.c
r814r815
7474   int code = videoram[tile_index] & 0x7f;
7575   int color = (attr >> 1) & 0x07;
7676
77   SET_TILE_INFO(gfxbank, code, color, 0)
77   SET_TILE_INFO(gfxbank, code, color, 0);
7878}
7979
8080static TILE_GET_INFO( get_fg_tile_info )
r814r815
8484   int gfxbank = tile / 0x200;
8585   int code = tile & 0x1ff;
8686
87   SET_TILE_INFO(gfxbank, code, 0, 0)
87   SET_TILE_INFO(gfxbank, code, 0, 0);
8888}
8989
9090VIDEO_START( bogeyman )
9191{
9292   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
93      TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
93      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
9494
9595   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
96      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
96      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9797
9898   tilemap_set_transparent_pen(fg_tilemap, 0);
9999}
src/mame/video/m72.c
r814r815
8484         gfxnum,
8585         code + ((attr & 0x3f) << 8),
8686         color & 0x0f,
87         TILE_FLIPYX((attr & 0xc0) >> 6) | TILE_SPLIT(pri))
87         TILE_FLIPYX((attr & 0xc0) >> 6));
88   tileinfo->group = pri;
8889}
8990
9091INLINE void rtype2_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT8 *vram,int gfxnum)
r814r815
108109         gfxnum,
109110         code,
110111         color & 0x0f,
111         TILE_FLIPYX((color & 0x60) >> 5) | TILE_SPLIT(pri))
112         TILE_FLIPYX((color & 0x60) >> 5));
113   tileinfo->group = pri;
112114}
113115
114116
r814r815
138140}
139141
140142
141static UINT32 majtitle_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
143static TILEMAP_MAPPER( majtitle_scan_rows )
142144{
143145   /* logical (col,row) -> memory offset */
144146   return row*256 + col;
r814r815
165167
166168VIDEO_START( m72 )
167169{
168   bg_tilemap = tilemap_create(m72_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,64,64);
169   fg_tilemap = tilemap_create(m72_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,64,64);
170   bg_tilemap = tilemap_create(m72_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
171   fg_tilemap = tilemap_create(m72_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
170172
171173   m72_spriteram = auto_malloc(spriteram_size);
172174
r814r815
188190
189191VIDEO_START( rtype2 )
190192{
191   bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,64,64);
192   fg_tilemap = tilemap_create(rtype2_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,64,64);
193   bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
194   fg_tilemap = tilemap_create(rtype2_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
193195
194196   m72_spriteram = auto_malloc(spriteram_size);
195197
r814r815
222224{
223225// The tilemap can be 256x64, but seems to be used at 128x64 (scroll wraparound).
224226// The layout ramains 256x64, the right half is just not displayed.
225//  bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,256,64);
226   bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,majtitle_scan_rows,TILEMAP_TYPE_SPLIT,8,8,128,64);
227   fg_tilemap = tilemap_create(rtype2_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,64,64);
227//  bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,256,64);
228   bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,majtitle_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
229   fg_tilemap = tilemap_create(rtype2_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
228230
229231   m72_spriteram = auto_malloc(spriteram_size);
230232
r814r815
246248
247249VIDEO_START( hharry )
248250{
249   bg_tilemap = tilemap_create(hharry_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,64,64);
250   fg_tilemap = tilemap_create(m72_get_fg_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,64,64);
251   bg_tilemap = tilemap_create(hharry_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
252   fg_tilemap = tilemap_create(m72_get_fg_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
251253
252254   m72_spriteram = auto_malloc(spriteram_size);
253255
r814r815
581583   tilemap_set_scrollx(bg_tilemap,0,scrollx2 + xadjust + bgadjust);
582584   tilemap_set_scrolly(bg_tilemap,0,scrolly2);
583585
584   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
585   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_BACK,0);
586   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
587   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER1,0);
586588   m72_draw_sprites(machine, bitmap,cliprect);
587   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
588   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_FRONT,0);
589   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
590   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER0,0);
589591   return 0;
590592}
591593
r814r815
617619   }
618620   tilemap_set_scrolly(bg_tilemap,0,scrolly2);
619621
620   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
621   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_BACK,0);
622   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
623   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER1,0);
622624   majtitle_draw_sprites(machine, bitmap,cliprect);
623625   m72_draw_sprites(machine, bitmap,cliprect);
624   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
625   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_FRONT,0);
626   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
627   tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER0,0);
626628   return 0;
627629}
src/mame/video/pokechmp.c
r814r815
2424   int code = videoram[tile_index*2+1] + ((videoram[tile_index*2] & 0x3f) << 8);
2525   int color = videoram[tile_index*2] >> 6;
2626
27   SET_TILE_INFO(0, code, color, 0)
27   SET_TILE_INFO(0, code, color, 0);
2828}
2929
3030VIDEO_START( pokechmp )
3131{
3232   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
33      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
33      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
3434}
3535
3636static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/ohmygod.c
r814r815
2222         0,
2323         code,
2424         (attr & 0x0f00) >> 8,
25         0)
25         0);
2626}
2727
2828
r814r815
3535
3636VIDEO_START( ohmygod )
3737{
38   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,64);
38   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
3939}
4040
4141
src/mame/video/snk68.c
r814r815
3535         0,
3636         tile,
3737         color,
38         0)
38         0);
3939}
4040
4141static TILE_GET_INFO( get_sar_tile_info )
r814r815
4949         0,
5050         tile,
5151         color,
52         0)
52         0);
5353}
5454
5555static TILE_GET_INFO( get_ikari3_tile_info )
r814r815
6868         0,
6969         tile,
7070         color,
71         0)
71         0);
7272}
7373
7474/***************************************************************************
r814r815
7979
8080VIDEO_START( pow )
8181{
82   fix_tilemap = tilemap_create(get_pow_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
82   fix_tilemap = tilemap_create(get_pow_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
8383
8484   tilemap_set_transparent_pen(fix_tilemap,0);
8585}
8686
8787VIDEO_START( searchar )
8888{
89   fix_tilemap = tilemap_create(get_sar_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
89   fix_tilemap = tilemap_create(get_sar_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
9090
9191   tilemap_set_transparent_pen(fix_tilemap,0);
9292}
9393
9494VIDEO_START( ikari3 )
9595{
96   fix_tilemap = tilemap_create(get_ikari3_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
96   fix_tilemap = tilemap_create(get_ikari3_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
9797
9898   tilemap_set_transparent_pen(fix_tilemap,0);
9999}
src/mame/video/aeroboto.c
r814r815
2929         0,
3030         code + (aeroboto_charbank << 8),
3131         aeroboto_tilecolor[code],
32         (aeroboto_tilecolor[code] >= 0x33) ? 0 : TILE_IGNORE_TRANSPARENCY)
32         (aeroboto_tilecolor[code] >= 0x33) ? 0 : TILE_FORCE_LAYER0);
3333}
3434// transparency should only affect tiles with color 0x33 or higher
3535
r814r815
4242
4343VIDEO_START( aeroboto )
4444{
45   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,64);
45   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,64);
4646
4747   tilemap_set_transparent_pen(bg_tilemap,0);
4848
src/mame/video/firetrap.c
r814r815
7979
8080***************************************************************************/
8181
82static UINT32 get_fg_memory_offset( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
82static TILEMAP_MAPPER( get_fg_memory_offset )
8383{
8484   return (row ^ 0x1f) + (col << 5);
8585}
8686
87static UINT32 get_bg_memory_offset( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
87static TILEMAP_MAPPER( get_bg_memory_offset )
8888{
8989   return ((row & 0x0f) ^ 0x0f) | ((col & 0x0f) << 4) |
9090         /* hole at bit 8 */
r814r815
101101         0,
102102         code | ((color & 0x01) << 8),
103103         color >> 4,
104         0)
104         0);
105105}
106106
107107INLINE void get_bg_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index, UINT8 *bgvideoram, int gfx_region)
r814r815
114114         gfx_region,
115115         code + ((color & 0x03) << 8),
116116         (color & 0x30) >> 4,
117         TILE_FLIPXY((color & 0x0c) >> 2))
117         TILE_FLIPXY((color & 0x0c) >> 2));
118118}
119119
120120static TILE_GET_INFO( get_bg1_tile_info )
r814r815
136136
137137VIDEO_START( firetrap )
138138{
139   fg_tilemap  = tilemap_create(get_fg_tile_info, get_fg_memory_offset,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
140   bg1_tilemap = tilemap_create(get_bg1_tile_info,get_bg_memory_offset,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
141   bg2_tilemap = tilemap_create(get_bg2_tile_info,get_bg_memory_offset,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
139   fg_tilemap  = tilemap_create(get_fg_tile_info, get_fg_memory_offset,TILEMAP_TYPE_PEN, 8, 8,32,32);
140   bg1_tilemap = tilemap_create(get_bg1_tile_info,get_bg_memory_offset,TILEMAP_TYPE_PEN,16,16,32,32);
141   bg2_tilemap = tilemap_create(get_bg2_tile_info,get_bg_memory_offset,TILEMAP_TYPE_PEN,     16,16,32,32);
142142
143143   tilemap_set_transparent_pen(fg_tilemap,0);
144144   tilemap_set_transparent_pen(bg1_tilemap,0);
src/mame/video/thedeep.c
r814r815
4747
4848***************************************************************************/
4949
50static UINT32 tilemap_scan_rows_back( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
50static TILEMAP_MAPPER( tilemap_scan_rows_back )
5151{
5252   return (col & 0x0f) + ((col & 0x10) << 5) + (row << 4);
5353}
r814r815
6060         1,
6161         code + (color << 8),
6262         (color & 0xf0) >> 4,
63         TILE_FLIPX   )   // why?
63         TILE_FLIPX   );   // why?
6464}
6565
6666static TILE_GET_INFO( get_tile_info_1 )
r814r815
7171         2,
7272         code + (color << 8),
7373         (color & 0xf0) >> 4,
74         0)
74         0);
7575}
7676
7777WRITE8_HANDLER( thedeep_vram_0_w )
r814r815
108108
109109VIDEO_START( thedeep )
110110{
111   tilemap_0  = tilemap_create(get_tile_info_0,tilemap_scan_rows_back,TILEMAP_TYPE_TRANSPARENT,16,16,0x20,0x20);
112   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,0x20,0x20);
111   tilemap_0  = tilemap_create(get_tile_info_0,tilemap_scan_rows_back,TILEMAP_TYPE_PEN,16,16,0x20,0x20);
112   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,0x20,0x20);
113113
114114   tilemap_set_transparent_pen( tilemap_0,  0 );
115115   tilemap_set_transparent_pen( tilemap_1,  0 );
src/mame/video/oneshot.c
r814r815
2323
2424   tileno = oneshot_bg_videoram[tile_index*2+1];
2525
26   SET_TILE_INFO(0,tileno,0,0)
26   SET_TILE_INFO(0,tileno,0,0);
2727}
2828
2929WRITE16_HANDLER( oneshot_bg_videoram_w )
r814r815
3939
4040   tileno = oneshot_mid_videoram[tile_index*2+1];
4141
42   SET_TILE_INFO(0,tileno,2,0)
42   SET_TILE_INFO(0,tileno,2,0);
4343}
4444
4545WRITE16_HANDLER( oneshot_mid_videoram_w )
r814r815
5656
5757   tileno = oneshot_fg_videoram[tile_index*2+1];
5858
59   SET_TILE_INFO(0,tileno,3,0)
59   SET_TILE_INFO(0,tileno,3,0);
6060}
6161
6262WRITE16_HANDLER( oneshot_fg_videoram_w )
r814r815
6767
6868VIDEO_START( oneshot )
6969{
70   oneshot_bg_tilemap = tilemap_create(get_oneshot_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
71   oneshot_mid_tilemap = tilemap_create(get_oneshot_mid_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
72   oneshot_fg_tilemap = tilemap_create(get_oneshot_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
70   oneshot_bg_tilemap = tilemap_create(get_oneshot_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
71   oneshot_mid_tilemap = tilemap_create(get_oneshot_mid_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
72   oneshot_fg_tilemap = tilemap_create(get_oneshot_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
7373
7474   tilemap_set_transparent_pen(oneshot_bg_tilemap,0);
7575   tilemap_set_transparent_pen(oneshot_mid_tilemap,0);
src/mame/video/stlforce.c
r814r815
2020   tileno = stlforce_bg_videoram[tile_index] & 0x0fff;
2121   colour = stlforce_bg_videoram[tile_index] & 0xe000;
2222   colour = colour >> 13;
23   SET_TILE_INFO(0,tileno,colour,0)
23   SET_TILE_INFO(0,tileno,colour,0);
2424}
2525
2626WRITE16_HANDLER( stlforce_bg_videoram_w )
r814r815
4141   colour += 8;
4242   tileno += 0x1000;
4343
44   SET_TILE_INFO(0,tileno,colour,0)
44   SET_TILE_INFO(0,tileno,colour,0);
4545}
4646
4747WRITE16_HANDLER( stlforce_mlow_videoram_w )
r814r815
6262   colour += 16;
6363   tileno += 0x2000;
6464
65   SET_TILE_INFO(0,tileno,colour,0)
65   SET_TILE_INFO(0,tileno,colour,0);
6666}
6767
6868WRITE16_HANDLER( stlforce_mhigh_videoram_w )
r814r815
8484   tileno += 0xc000;
8585
8686   colour += 24;
87   SET_TILE_INFO(1,tileno,colour,0)
87   SET_TILE_INFO(1,tileno,colour,0);
8888}
8989
9090WRITE16_HANDLER( stlforce_tx_videoram_w )
r814r815
181181
182182VIDEO_START( stlforce )
183183{
184   stlforce_bg_tilemap    = tilemap_create(get_stlforce_bg_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,      16,16,64,16);
185   stlforce_mlow_tilemap  = tilemap_create(get_stlforce_mlow_tile_info, tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT, 16,16,64,16);
186   stlforce_mhigh_tilemap = tilemap_create(get_stlforce_mhigh_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT, 16,16,64,16);
187   stlforce_tx_tilemap    = tilemap_create(get_stlforce_tx_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8, 8,64,32);
184   stlforce_bg_tilemap    = tilemap_create(get_stlforce_bg_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_PEN,      16,16,64,16);
185   stlforce_mlow_tilemap  = tilemap_create(get_stlforce_mlow_tile_info, tilemap_scan_cols,TILEMAP_TYPE_PEN, 16,16,64,16);
186   stlforce_mhigh_tilemap = tilemap_create(get_stlforce_mhigh_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 16,16,64,16);
187   stlforce_tx_tilemap    = tilemap_create(get_stlforce_tx_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,  8, 8,64,32);
188188
189189   tilemap_set_transparent_pen(stlforce_mlow_tilemap,0);
190190   tilemap_set_transparent_pen(stlforce_mhigh_tilemap,0);
src/mame/video/topspeed.c
r814r815
171171#ifdef MAME_DEBUG
172172   if (dislayer[3]==0)
173173#endif
174   PC080SN_tilemap_draw(bitmap,cliprect,1,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
174   PC080SN_tilemap_draw(bitmap,cliprect,1,layer[0],TILEMAP_DRAW_OPAQUE,1);
175175
176176#ifdef MAME_DEBUG
177177   if (dislayer[2]==0)
src/mame/video/amspdwy.c
r814r815
5353         0,
5454         code + ((color & 0x18)<<5),
5555         color & 0x07,
56         0)
56         0);
5757}
5858
5959WRITE8_HANDLER( amspdwy_videoram_w )
r814r815
7070
7171
7272/* logical (col,row) -> memory offset */
73UINT32 tilemap_scan_cols_back( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
73static TILEMAP_MAPPER( tilemap_scan_cols_back )
7474{
7575   return col*num_rows + (num_rows - row - 1);
7676}
r814r815
7979VIDEO_START( amspdwy )
8080{
8181   bg_tilemap   =   tilemap_create(   get_tile_info,   tilemap_scan_cols_back,
82                        TILEMAP_TYPE_OPAQUE,   8,8,   0x20, 0x20 );
82                        TILEMAP_TYPE_PEN,   8,8,   0x20, 0x20 );
8383}
8484
8585
src/mame/video/atarig1.c
r814r815
4646   int code = data & 0xfff;
4747   int color = (data >> 12) & 0x0f;
4848   int opaque = data & 0x8000;
49   SET_TILE_INFO(1, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
49   SET_TILE_INFO(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
5050}
5151
5252
r814r815
114114   atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x10);
115115
116116   /* initialize the playfield */
117   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
117   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,64);
118118
119119   /* initialize the motion objects */
120120   atarirle_init(0, atarig1_pitfight ? &modesc_pitfight : &modesc_hydra);
121121
122122   /* initialize the alphanumerics */
123   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
123   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
124124   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
125125
126126   /* reset statics */
src/mame/video/sbrkout.c
r814r815
2222{
2323   int code = (videoram[tile_index] & 0x80) ? videoram[tile_index] : 0;
2424
25   SET_TILE_INFO(0, code, 0, 0)
25   SET_TILE_INFO(0, code, 0, 0);
2626}
2727
2828VIDEO_START( sbrkout )
2929{
3030   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
31      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
31      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
3232}
3333
3434static void draw_balls(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/bladestl.c
r814r815
6666{
6767   K007342_tilemap_update();
6868
69   K007342_tilemap_draw( bitmap, cliprect, 1, TILEMAP_IGNORE_TRANSPARENCY ,0);
69   K007342_tilemap_draw( bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE ,0);
7070   K007420_sprites_draw( bitmap, cliprect );
71   K007342_tilemap_draw( bitmap, cliprect, 1, 1 | TILEMAP_IGNORE_TRANSPARENCY ,0);
71   K007342_tilemap_draw( bitmap, cliprect, 1, 1 | TILEMAP_DRAW_OPAQUE ,0);
7272   K007342_tilemap_draw( bitmap, cliprect, 0, 0 ,0);
7373   K007342_tilemap_draw( bitmap, cliprect, 0, 1 ,0);
7474   return 0;
src/mame/video/toobin.c
r814r815
4242   int code = data2 & 0x3fff;
4343   int color = data1 & 0x0f;
4444   SET_TILE_INFO(0, code, color, TILE_FLIPYX(data2 >> 14));
45   tileinfo->priority = (data1 >> 4) & 3;
45   tileinfo->category = (data1 >> 4) & 3;
4646}
4747
4848
r814r815
9393   };
9494
9595   /* initialize the playfield */
96   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 128,64);
96   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,64);
9797
9898   /* initialize the motion objects */
9999   atarimo_init(machine, 0, &modesc);
100100
101101   /* initialize the alphanumerics */
102   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,48);
102   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,48);
103103   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
104104}
105105
src/mame/video/srumbler.c
r814r815
2727         0,
2828         srumbler_foregroundram[2*tile_index + 1] + ((attr & 0x03) << 8),
2929         (attr & 0x3c) >> 2,
30         (attr & 0x40) ? TILE_IGNORE_TRANSPARENCY : 0)
30         (attr & 0x40) ? TILE_FORCE_LAYER0 : 0);
3131}
3232
3333static TILE_GET_INFO( get_bg_tile_info )
r814r815
3737         1,
3838         srumbler_backgroundram[2*tile_index + 1] + ((attr & 0x07) << 8),
3939         (attr & 0xe0) >> 5,
40         TILE_SPLIT((attr & 0x10) >> 4) | ((attr & 0x08) ? TILE_FLIPY : 0))
40         ((attr & 0x08) ? TILE_FLIPY : 0));
41   tileinfo->group = (attr & 0x10) >> 4;
4142}
4243
4344
r814r815
5051
5152VIDEO_START( srumbler )
5253{
53   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
54   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_SPLIT,    16,16,64,64);
54   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
55   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,    16,16,64,64);
5556
5657   tilemap_set_transparent_pen(fg_tilemap,3);
5758
r814r815
160161
161162VIDEO_UPDATE( srumbler )
162163{
163   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
164   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
164165   draw_sprites(machine, bitmap,cliprect);
165   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
166   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
166167   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
167168   return 0;
168169}
src/mame/video/legionna.c
r814r815
8585   tile &= 0xfff;
8686   tile |= back_gfx_bank;      /* Heatbrl uses banking */
8787
88   SET_TILE_INFO(1,tile,color,0)
88   SET_TILE_INFO(1,tile,color,0);
8989}
9090
9191static TILE_GET_INFO( get_mid_tile_info )
r814r815
9595
9696   tile &= 0xfff;
9797
98   SET_TILE_INFO(5,tile,color,0)
98   SET_TILE_INFO(5,tile,color,0);
9999}
100100
101101static TILE_GET_INFO( get_mid_tile_info_denji )
r814r815
106106   tile &= 0xfff;
107107   tile |= mid_gfx_bank;
108108
109   SET_TILE_INFO(5,tile,color,0)
109   SET_TILE_INFO(5,tile,color,0);
110110}
111111
112112static TILE_GET_INFO( get_mid_tile_info_cupsoc )
r814r815
118118
119119   tile |= 0x1000;
120120
121   SET_TILE_INFO(1,tile,color,0)
121   SET_TILE_INFO(1,tile,color,0);
122122}
123123
124124static TILE_GET_INFO( get_fore_tile_info )   /* this is giving bad tiles... */
r814r815
129129   // legionnaire tile numbers / gfx set wrong, see screen after coin insertion
130130   tile &= 0xfff;
131131
132   SET_TILE_INFO(4,tile,color,0)
132   SET_TILE_INFO(4,tile,color,0);
133133}
134134
135135static TILE_GET_INFO( get_fore_tile_info_denji )
r814r815
140140   tile &= 0xfff;
141141   tile |= fore_gfx_bank;
142142
143   SET_TILE_INFO(4,tile,color,0)
143   SET_TILE_INFO(4,tile,color,0);
144144}
145145
146146static TILE_GET_INFO( get_text_tile_info )
r814r815
150150
151151   tile &= 0xfff;
152152
153   SET_TILE_INFO(0,tile,color,0)
153   SET_TILE_INFO(0,tile,color,0);
154154}
155155
156156VIDEO_START( legionna )
157157{
158   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
159   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
160   midground_layer =  tilemap_create(get_mid_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
161   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,64,32);
158   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
159   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
160   midground_layer =  tilemap_create(get_mid_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
161   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
162162
163163   legionna_scrollram16 = auto_malloc(0x60);
164164
r814r815
170170
171171VIDEO_START( denjinmk )
172172{
173   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
174   foreground_layer = tilemap_create(get_fore_tile_info_denji,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
175   midground_layer =  tilemap_create(get_mid_tile_info_denji, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
176   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,64,32);
173   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
174   foreground_layer = tilemap_create(get_fore_tile_info_denji,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
175   midground_layer =  tilemap_create(get_mid_tile_info_denji, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
176   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
177177
178178   legionna_scrollram16 = auto_malloc(0x60);
179179
r814r815
185185
186186VIDEO_START( cupsoc )
187187{
188   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
189   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
190   midground_layer =  tilemap_create(get_mid_tile_info_cupsoc, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
191   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,64,32);
188   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
189   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
190   midground_layer =  tilemap_create(get_mid_tile_info_cupsoc, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
191   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
192192
193193   legionna_scrollram16 = auto_malloc(0x60);
194194
r814r815
362362#if LAYER_DB
363363   if (dislayer[2]==0)
364364#endif
365   tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_IGNORE_TRANSPARENCY,0);
365   tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_DRAW_OPAQUE,0);
366366
367367#if LAYER_DB
368368   if (dislayer[1]==0)
src/mame/video/pbaction.c
r814r815
5858   int color = attr & 0x0f;
5959   int flags = (attr & 0x80) ? TILE_FLIPY : 0;
6060
61   SET_TILE_INFO(1, code, color, flags)
61   SET_TILE_INFO(1, code, color, flags);
6262}
6363
6464static TILE_GET_INFO( get_fg_tile_info )
r814r815
6868   int color = attr & 0x0f;
6969   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
7070
71   SET_TILE_INFO(0, code, color, flags)
71   SET_TILE_INFO(0, code, color, flags);
7272}
7373
7474VIDEO_START( pbaction )
7575{
7676   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
77      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
77      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
7878
7979   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
80      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
80      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
8181
8282   tilemap_set_transparent_pen(fg_tilemap, 0);
8383}
src/mame/video/mcr68.c
r814r815
3232   int color = (~data >> 12) & 3;
3333   SET_TILE_INFO(0, code, color, TILE_FLIPYX((data >> 10) & 3));
3434   if (machine->gfx[0]->total_elements < 0x1000)
35      tileinfo->priority = (data >> 15) & 1;
35      tileinfo->category = (data >> 15) & 1;
3636}
3737
3838
r814r815
4949   int data = videoram16[tile_index];
5050   int color = (data >> 13) & 7;
5151   SET_TILE_INFO(2, data & 0x3ff, color, TILE_FLIPYX((data >> 11) & 3));
52   tileinfo->priority = (color != 0);
52   tileinfo->category = (color != 0);
5353}
5454
5555
r814r815
6363VIDEO_START( mcr68 )
6464{
6565   /* initialize the background tilemap */
66   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16,16, 32,32);
66   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32);
6767   tilemap_set_transparent_pen(bg_tilemap, 0);
6868}
6969
r814r815
7676   int code, y, x;
7777
7878   /* initialize the background tilemap */
79   bg_tilemap = tilemap_create(zwackery_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,16, 32,32);
79   bg_tilemap = tilemap_create(zwackery_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32);
8080
8181   /* initialize the foreground tilemap */
82   fg_tilemap = tilemap_create(zwackery_get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16,16, 32,32);
82   fg_tilemap = tilemap_create(zwackery_get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32);
8383   tilemap_set_transparent_pen(fg_tilemap, 0);
8484
8585   /* "colorize" each code */
r814r815
303303VIDEO_UPDATE( mcr68 )
304304{
305305   /* draw the background */
306   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY | 0, 0);
307   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY | 1, 0);
306   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
307   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
308308
309309   /* draw the low-priority sprites */
310310   mcr68_update_sprites(machine, bitmap, cliprect, 0);
src/mame/video/overdriv.c
r814r815
5252VIDEO_START( overdriv )
5353{
5454   K053251_vh_start();
55   K051316_vh_start_0(machine,REGION_GFX2,4,TILEMAP_TYPE_OPAQUE,0,zoom_callback_0);
56   K051316_vh_start_1(machine,REGION_GFX3,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback_1);
55   K051316_vh_start_0(machine,REGION_GFX2,4,TRUE,0,zoom_callback_0);
56   K051316_vh_start_1(machine,REGION_GFX3,4,FALSE,0,zoom_callback_1);
5757   K053247_vh_start(machine, REGION_GFX1,77,22,NORMAL_PLANE_ORDER,overdriv_sprite_callback);
5858
5959   K051316_wraparound_enable(0,1);
src/mame/video/funworld.c
r814r815
9999   int code = attr & 0xfff;
100100   int color = colorram[offs] >> 4;   // 4 bits for color.
101101
102   SET_TILE_INFO(0, code, color, 0)
102   SET_TILE_INFO(0, code, color, 0);
103103}
104104
105105VIDEO_START(funworld)
106106{
107107   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
108      TILEMAP_TYPE_OPAQUE, 4, 8, 96, 29);
108      TILEMAP_TYPE_PEN, 4, 8, 96, 29);
109109}
110110
111111VIDEO_START(magiccrd)
112112{
113113   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
114      TILEMAP_TYPE_OPAQUE, 4, 8, 112, 34);
114      TILEMAP_TYPE_PEN, 4, 8, 112, 34);
115115}
116116
117117VIDEO_UPDATE(funworld)
src/mame/video/thunderx.c
r814r815
7676//  fillbitmap(bitmap,machine->pens[16 * layer_colorbase[1]],cliprect);
7777   if (scontra_priority)
7878   {
79      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_IGNORE_TRANSPARENCY,1);
79      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_DRAW_OPAQUE,1);
8080      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,2);
8181   }
8282   else
8383   {
84      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY,1);
84      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,1);
8585      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,2);
8686   }
8787   tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,4);
src/mame/video/gsword.c
r814r815
161161   int color = ((code & 0x3c0) >> 6) + 16 * charpalbank;
162162   int flags = flipscreen ? (TILE_FLIPX | TILE_FLIPY) : 0;
163163
164   SET_TILE_INFO(0, code, color, flags)
164   SET_TILE_INFO(0, code, color, flags);
165165}
166166
167167VIDEO_START( gsword )
168168{
169169   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
170      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 64);
170      TILEMAP_TYPE_PEN, 8, 8, 32, 64);
171171}
172172
173173static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/mario.c
r814r815
119119   int code = videoram[tile_index] + 256 * gfx_bank;
120120   int color = (videoram[tile_index] >> 5) + 8 * palette_bank;
121121
122   SET_TILE_INFO(0, code, color, 0)
122   SET_TILE_INFO(0, code, color, 0);
123123}
124124
125125VIDEO_START( mario )
126126{
127127   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
128      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
128      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
129129
130130   state_save_register_global(gfx_bank);
131131   state_save_register_global(palette_bank);
src/mame/video/silkroad.c
r814r815
8080         0,
8181         code,
8282         color,
83         TILE_FLIPYX(flipx))
83         TILE_FLIPYX(flipx));
8484}
8585
8686
r814r815
101101         0,
102102         code,
103103         color,
104         TILE_FLIPYX(flipx))
104         TILE_FLIPYX(flipx));
105105}
106106
107107
r814r815
122122         0,
123123         code,
124124         color,
125         TILE_FLIPYX(flipx))
125         TILE_FLIPYX(flipx));
126126}
127127
128128
r814r815
137137
138138VIDEO_START(silkroad)
139139{
140   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64, 64);
140   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
141141      tilemap_set_transparent_pen(fg_tilemap,0);
142142
143   fg2_tilemap = tilemap_create(get_fg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64, 64);
143   fg2_tilemap = tilemap_create(get_fg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
144144      tilemap_set_transparent_pen(fg2_tilemap,0);
145145
146   fg3_tilemap = tilemap_create(get_fg3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64, 64);
146   fg3_tilemap = tilemap_create(get_fg3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
147147      tilemap_set_transparent_pen(fg3_tilemap,0);
148148}
149149
src/mame/video/videopin.c
r814r815
1515static tilemap* bg_tilemap;
1616
1717
18static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
18static TILEMAP_MAPPER( get_memory_offset )
1919{
2020   return num_rows * ((col + 16) % 48) + row;
2121}
r814r815
2525{
2626   UINT8 code = videopin_video_ram[tile_index];
2727
28   SET_TILE_INFO(0, code, 0, (code & 0x40) ? TILE_FLIPY : 0)
28   SET_TILE_INFO(0, code, 0, (code & 0x40) ? TILE_FLIPY : 0);
2929}
3030
3131
3232VIDEO_START( videopin )
3333{
34   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, TILEMAP_TYPE_OPAQUE, 8, 8, 48, 32);
34   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, TILEMAP_TYPE_PEN, 8, 8, 48, 32);
3535}
3636
3737
src/mame/video/exprraid.c
r814r815
6666   color = (attr & 0x18) >> 3;
6767   flags = (attr & 0x04) ? TILE_FLIPX : 0;
6868
69   tileinfo->priority = ((attr & 0x80) ? 1 : 0);
69   tileinfo->category = ((attr & 0x80) ? 1 : 0);
7070
71   SET_TILE_INFO(bank, code, color, flags)
71   SET_TILE_INFO(bank, code, color, flags);
7272}
7373
7474static TILE_GET_INFO( get_fg_tile_info )
r814r815
7777   int code = videoram[tile_index] + ((attr & 0x07) << 8);
7878   int color = (attr & 0x10) >> 4;
7979
80   SET_TILE_INFO(0, code, color, 0)
80   SET_TILE_INFO(0, code, color, 0);
8181}
8282
8383VIDEO_START( exprraid )
8484{
8585   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
86      TILEMAP_TYPE_OPAQUE, 16, 16, 32, 32);
86      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
8787
8888   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
89      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
89      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9090
9191   tilemap_set_scroll_rows(bg_tilemap, 2);
9292   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/tecmo16.c
r814r815
2929   int color = tecmo16_colorram[tile_index] & 0x0f;
3030
3131   /* bit 4 controls blending */
32   tileinfo->priority = (tecmo16_colorram[tile_index] & 0x10) >> 4;
32   tileinfo->category = (tecmo16_colorram[tile_index] & 0x10) >> 4;
3333
3434   SET_TILE_INFO(
3535         1,
3636         tile,
37         color | (tileinfo->priority ? 0x70 : 0x00),
38         0)
37         color | (tileinfo->category ? 0x70 : 0x00),
38         0);
3939}
4040
4141static TILE_GET_INFO( bg_get_tile_info )
r814r815
4747         1,
4848         tile,
4949         color,
50         0)
50         0);
5151}
5252
5353static TILE_GET_INFO( tx_get_tile_info )
r814r815
5757         0,
5858         tile & 0x0fff,
5959         tile >> 12,
60         0)
60         0);
6161}
6262
6363/******************************************************************************/
r814r815
7171   /* set up sprites */
7272   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
7373
74   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
75   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
76   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
74   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
75   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
76   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
7777
7878   tilemap_set_transparent_pen(fg_tilemap,0);
7979   tilemap_set_transparent_pen(bg_tilemap,0);
r814r815
9393   /* set up sprites */
9494   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
9595
96   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
97   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
98   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
96   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
97   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
98   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
9999
100100   tilemap_set_transparent_pen(fg_tilemap,0);
101101   tilemap_set_transparent_pen(bg_tilemap,0);
r814r815
113113   /* set up sprites */
114114   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
115115
116   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
117   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
118   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
116   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
117   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
118   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
119119
120120   tilemap_set_transparent_pen(fg_tilemap,0);
121121   tilemap_set_transparent_pen(bg_tilemap,0);
src/mame/video/runaway.c
r814r815
7676
7777VIDEO_START( runaway )
7878{
79   bg_tilemap = tilemap_create(runaway_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 30);
79   bg_tilemap = tilemap_create(runaway_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 30);
8080}
8181
8282
8383VIDEO_START( qwak )
8484{
85   bg_tilemap = tilemap_create(qwak_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 30);
85   bg_tilemap = tilemap_create(qwak_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 30);
8686}
8787
8888
src/mame/video/toypop.c
r814r815
9292***************************************************************************/
9393
9494/* convert from 32x32 to 36x28 */
95static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
95static TILEMAP_MAPPER( tilemap_scan )
9696{
9797   int offs;
9898
r814r815
113113         0,
114114         toypop_videoram[tile_index],
115115         (attr & 0x3f) + 0x40 * palettebank,
116         0)
116         0);
117117}
118118
119119
r814r815
126126
127127VIDEO_START( toypop )
128128{
129   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_TRANSPARENT,8,8,36,28);
129   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
130130
131131   tilemap_set_transparent_pen(bg_tilemap, 0);
132132}
src/mame/video/tumbleb.c
r814r815
291291
292292/******************************************************************************/
293293
294static UINT32 tumblep_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
294static TILEMAP_MAPPER( tumblep_scan )
295295{
296296   /* logical (col,row) -> memory offset */
297297   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5);
r814r815
305305         gfx_bank,
306306         (data & 0x0fff)|(bcstory_tilebank>>2),
307307         data >> 12,
308         0)
308         0);
309309}
310310
311311static TILE_GET_INFO( get_bg1_tile_info ) { get_bg_tile_info(machine,tileinfo,tile_index,2,tumblepb_pf1_data); }
r814r815
319319         0,
320320         (data & 0x0fff)|bcstory_tilebank,
321321         data >> 12,
322         0)
322         0);
323323}
324324
325325INLINE void get_fncywld_bg_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int gfx_bank,UINT16 *gfx_base)
r814r815
331331         gfx_bank,
332332         data & 0x1fff,
333333         attr & 0x1f,
334         0)
334         0);
335335}
336336
337337static TILE_GET_INFO( get_fncywld_bg1_tile_info ) { get_fncywld_bg_tile_info(machine,tileinfo,tile_index,2,tumblepb_pf1_data); }
r814r815
346346         0,
347347         data & 0x1fff,
348348         attr & 0x1f,
349         0)
349         0);
350350}
351351
352352
r814r815
359359         2,
360360         data & 0x3fff,
361361         0,
362         0)
362         0);
363363}
364364
365365static TILE_GET_INFO( get_jumppop_bg2_tile_info )
r814r815
370370         1,
371371         data & 0x1fff,
372372         1,
373         0)
373         0);
374374}
375375
376376static TILE_GET_INFO( get_jumppop_bg2_alt_tile_info )
r814r815
381381         0,
382382         data & 0x7fff,
383383         1,
384         0)
384         0);
385385}
386386
387387
r814r815
393393         0,
394394         data & 0x7fff,
395395         0,
396         0)
396         0);
397397}
398398
399399
r814r815
424424         gfx_bank,
425425         data & 0x1fff,
426426         (attr >>12) & 0xf,
427         0)
427         0);
428428}
429429
430430INLINE void pangpang_get_bg2x_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index,int gfx_bank,UINT16 *gfx_base)
r814r815
436436         gfx_bank,
437437         (data & 0xfff)+0x1000,
438438         (attr >>12) & 0xf,
439         0)
439         0);
440440}
441441
442442
r814r815
452452         0,
453453         data & 0x1fff,
454454         (attr >> 12)& 0x1f,
455         0)
455         0);
456456}
457457
458458
459459VIDEO_START( pangpang )
460460{
461   pf1_tilemap =     tilemap_create(pangpang_get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
462   pf1_alt_tilemap = tilemap_create(pangpang_get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
463   pf2_tilemap =     tilemap_create(pangpang_get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
461   pf1_tilemap =     tilemap_create(pangpang_get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
462   pf1_alt_tilemap = tilemap_create(pangpang_get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
463   pf2_tilemap =     tilemap_create(pangpang_get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
464464
465465   tilemap_set_transparent_pen(pf1_tilemap,0);
466466   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
r814r815
473473
474474VIDEO_START( tumblepb )
475475{
476   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
477   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
478   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
476   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
477   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
478   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
479479
480480   tilemap_set_transparent_pen(pf1_tilemap,0);
481481   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
r814r815
487487
488488VIDEO_START( sdfight )
489489{
490   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64); // 64*64 to prevent bad tilemap wrapping? - check real behavior
491   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
492   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
490   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64); // 64*64 to prevent bad tilemap wrapping? - check real behavior
491   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
492   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
493493
494494   tilemap_set_transparent_pen(pf1_tilemap,0);
495495   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
r814r815
502502
503503VIDEO_START( fncywld )
504504{
505   pf1_tilemap =     tilemap_create(get_fncywld_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
506   pf1_alt_tilemap = tilemap_create(get_fncywld_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
507   pf2_tilemap =     tilemap_create(get_fncywld_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
505   pf1_tilemap =     tilemap_create(get_fncywld_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
506   pf1_alt_tilemap = tilemap_create(get_fncywld_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
507   pf2_tilemap =     tilemap_create(get_fncywld_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
508508
509509   tilemap_set_transparent_pen(pf1_tilemap,15);
510510   tilemap_set_transparent_pen(pf1_alt_tilemap,15);
r814r815
516516
517517VIDEO_START( jumppop )
518518{
519   pf1_tilemap =     tilemap_create(get_jumppop_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,128,64);
520   pf1_alt_tilemap = tilemap_create(get_jumppop_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
521   pf2_tilemap =     tilemap_create(get_jumppop_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,64,64);
522   pf2_alt_tilemap =     tilemap_create(get_jumppop_bg2_alt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,128,64);
519   pf1_tilemap =     tilemap_create(get_jumppop_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,128,64);
520   pf1_alt_tilemap = tilemap_create(get_jumppop_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
521   pf2_tilemap =     tilemap_create(get_jumppop_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,64);
522   pf2_alt_tilemap =     tilemap_create(get_jumppop_bg2_alt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,128,64);
523523
524524   tilemap_set_transparent_pen(pf1_tilemap,0);
525525   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
r814r815
829829
830830VIDEO_START( suprtrio )
831831{
832   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,64,32);
833   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
834   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
832   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
833   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
834   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
835835
836836   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
837837   bcstory_tilebank = 0;
src/mame/video/kchamp.c
r814r815
4848   int code = videoram[tile_index] + ((colorram[tile_index] & 7) << 8);
4949   int color = (colorram[tile_index] >> 3) & 0x1f;
5050
51   SET_TILE_INFO(0, code, color, 0)
51   SET_TILE_INFO(0, code, color, 0);
5252}
5353
5454VIDEO_START( kchamp )
5555{
5656   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
57      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
57      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
5858}
5959
6060/*
src/mame/video/digdug.c
r814r815
7878***************************************************************************/
7979
8080/* convert from 32x32 to 36x28 */
81static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
81static TILEMAP_MAPPER( tilemap_scan )
8282{
8383   int offs;
8484
r814r815
107107         2,
108108         code,
109109         color | bg_color_bank,
110         0)
110         0);
111111}
112112
113113static TILE_GET_INFO( tx_get_tile_info )
r814r815
134134         0,
135135         (code & 0x7f) | (flip_screen ? 0x80 : 0),
136136         color,
137         flip_screen ? TILE_FLIPX : 0)
137         flip_screen ? TILE_FLIPX : 0);
138138}
139139
140140
r814r815
147147
148148VIDEO_START( digdug )
149149{
150   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan,TILEMAP_TYPE_OPAQUE,     8,8,36,28);
151   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan,TILEMAP_TYPE_TRANSPARENT,8,8,36,28);
150   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,     8,8,36,28);
151   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
152152
153153   tilemap_set_transparent_pen(tx_tilemap, 0);
154154
src/mame/video/ultratnk.c
r814r815
4242
4343   if (code & 0x20)
4444   {
45      SET_TILE_INFO(0, code, code >> 6, 0)
45      SET_TILE_INFO(0, code, code >> 6, 0);
4646   }
4747   else
4848   {
49      SET_TILE_INFO(0, code, 4, 0)
49      SET_TILE_INFO(0, code, 4, 0);
5050   }
5151}
5252
r814r815
5555{
5656   helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
5757
58   playfield = tilemap_create(ultratnk_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
58   playfield = tilemap_create(ultratnk_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
5959}
6060
6161
src/mame/video/m90.c
r814r815
4242         0,
4343         tile,
4444         color&0xf,
45         TILE_FLIPYX((color & 0xc0) >> 6))
46   tileinfo->priority = (color & 0x30) ? 1 : 0;
45         TILE_FLIPYX((color & 0xc0) >> 6));
46   tileinfo->category = (color & 0x30) ? 1 : 0;
4747}
4848
4949
r814r815
5555
5656VIDEO_START( m90 )
5757{
58   pf1_layer =      tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
59   pf1_wide_layer = tilemap_create(get_pf1w_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
60   pf2_layer =      tilemap_create(get_pf2_tile_info, tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,64);
61   pf2_wide_layer = tilemap_create(get_pf2w_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,128,64);
58   pf1_layer =      tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
59   pf1_wide_layer = tilemap_create(get_pf1w_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
60   pf2_layer =      tilemap_create(get_pf2_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
61   pf2_wide_layer = tilemap_create(get_pf2w_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
6262
6363   tilemap_set_transparent_pen(pf1_layer,0);
6464   tilemap_set_transparent_pen(pf1_wide_layer,0);
src/mame/video/scotrsht.c
r814r815
118118
119119   // data & 0x80 -> tile priority?
120120
121   SET_TILE_INFO(0, code, color, flag)
121   SET_TILE_INFO(0, code, color, flag);
122122}
123123
124124/* Same as Jailbreak + palette bank */
r814r815
151151
152152VIDEO_START( scotrsht )
153153{
154   bg_tilemap = tilemap_create(scotrsht_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
154   bg_tilemap = tilemap_create(scotrsht_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
155155
156156   tilemap_set_scroll_cols(bg_tilemap, 64);
157157}
src/mame/video/gunbustr.c
r814r815
236236       sprites as pdrawgfx cannot yet cope with more than 4 layers */
237237
238238#ifdef MAME_DEBUG
239   if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
239   if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0);
240240   if (!input_code_pressed (KEYCODE_X)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,1);
241241   if (!input_code_pressed (KEYCODE_C)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,2);
242242   if (!input_code_pressed (KEYCODE_V)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,4);
243243   if (!input_code_pressed (KEYCODE_B)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[4],0,8);
244244   if (!input_code_pressed (KEYCODE_N)) draw_sprites(machine,bitmap,cliprect,primasks,48,-116);
245245#else
246   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
246   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0);
247247   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,1);
248248   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,2);
249249   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,4);
src/mame/video/taito_z.c
r814r815
885885   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
886886   fillbitmap(bitmap, machine->pens[0], cliprect);
887887
888   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
888   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
889889   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
890890   TC0150ROD_draw(bitmap,cliprect,-1,0xc0,0,0,1,2);
891891   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4);
r814r815
910910   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
911911   fillbitmap(bitmap, machine->pens[0],cliprect);
912912
913   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
913   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
914914   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
915915   TC0150ROD_draw(bitmap,cliprect,-1,0xc0,0,1,1,2);
916916   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4);
r814r815
935935   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
936936   fillbitmap(bitmap, machine->pens[0], cliprect);
937937
938   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
938   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
939939   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
940940   TC0150ROD_draw(bitmap,cliprect,-1,0xc0,0,0,1,2);
941941   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4);
r814r815
960960   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
961961   fillbitmap(bitmap, machine->pens[0], cliprect);
962962
963   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
963   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
964964   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
965965   TC0150ROD_draw(bitmap,cliprect,-1,0,2,1,1,2);
966966   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4);
r814r815
985985   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
986986   fillbitmap(bitmap, machine->pens[0], cliprect);
987987
988   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
988   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
989989   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2);
990990   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4);
991991
r814r815
10151015   /* Ensure screen blanked - this shouldn't be necessary! */
10161016   fillbitmap(bitmap, machine->pens[0], cliprect);
10171017
1018   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
1018   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0);
10191019   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,0);
10201020   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,1);
10211021
src/mame/video/phoenix.c
r814r815
135135         1,
136136         code,
137137         (code >> 5) | (palette_bank << 3),
138         (tile_index & 0x1f) ? 0 : TILE_IGNORE_TRANSPARENCY)   /* first row (column) is opaque */
138         (tile_index & 0x1f) ? 0 : TILE_FORCE_LAYER0);   /* first row (column) is opaque */
139139}
140140
141141static TILE_GET_INFO( get_bg_tile_info )
r814r815
147147         0,
148148         code,
149149         (code >> 5) | (palette_bank << 3),
150         0)
150         0);
151151}
152152
153153
r814r815
170170   current_videoram_pg = videoram_pg1;      /* otherwise, hiscore loading crashes */
171171
172172
173   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
174   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
173   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
174   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
175175
176176   tilemap_set_transparent_pen(fg_tilemap,0);
177177   tilemap_set_scrolldx(fg_tilemap,0,8);
src/mame/video/msisaac.c
r814r815
2727   SET_TILE_INFO(   0,
2828         tile_number,
2929         0x10,
30         0)
30         0);
3131}
3232
3333static TILE_GET_INFO( get_bg2_tile_info )
r814r815
4040   SET_TILE_INFO(   gfx_b,
4141         tile_number,
4242         0x20,
43         0)
43         0);
4444}
4545
4646static TILE_GET_INFO( get_bg_tile_info )
r814r815
4949   SET_TILE_INFO(   1,
5050         0x100+tile_number,
5151         0x30,
52         0)
52         0);
5353}
5454
5555/***************************************************************************
r814r815
6060
6161VIDEO_START( msisaac )
6262{
63   background  = tilemap_create(get_bg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
64   background2 = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
65   foreground  = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
63   background  = tilemap_create(get_bg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
64   background2 = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
65   foreground  = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
6666
6767   tilemap_set_transparent_pen(background2,0);
6868   tilemap_set_transparent_pen(foreground,0);
src/mame/video/markham.c
r814r815
6868   int code = videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3);
6969   int color = (attr & 0x1f) | ((attr & 0x80) >> 2);
7070
71   SET_TILE_INFO(0, code, color, 0)
71   SET_TILE_INFO(0, code, color, 0);
7272}
7373
7474VIDEO_START( markham )
7575{
7676   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
77      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
77      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
7878
7979   tilemap_set_scroll_rows(bg_tilemap, 32);
8080}
src/mame/video/superqix.c
r814r815
2929   int attr = superqix_videoram[tile_index + 0x400];
3030   int code = superqix_videoram[tile_index] + 256 * (attr & 0x7);
3131   int color = (attr & 0xf0) >> 4;
32   SET_TILE_INFO(0, code, color, 0)
32   SET_TILE_INFO(0, code, color, 0);
3333}
3434
3535static TILE_GET_INFO( sqix_get_bg_tile_info )
r814r815
4141
4242   if (bank) code += 1024 * gfxbank;
4343
44   SET_TILE_INFO(bank, code, color, TILE_SPLIT((attr & 0x08) >> 3))
44   SET_TILE_INFO(bank, code, color, 0);
45   tileinfo->group = (attr & 0x08) >> 3;
4546}
4647
4748
r814r815
5455
5556VIDEO_START( pbillian )
5657{
57   bg_tilemap = tilemap_create(pb_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8,32,32);
58   bg_tilemap = tilemap_create(pb_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,32,32);
5859}
5960
6061VIDEO_START( superqix )
6162{
6263   fg_bitmap[0] = auto_bitmap_alloc(256, 256, machine->screen[0].format);
6364   fg_bitmap[1] = auto_bitmap_alloc(256, 256, machine->screen[0].format);
64   bg_tilemap = tilemap_create(sqix_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_SPLIT, 8, 8, 32, 32);
65   bg_tilemap = tilemap_create(sqix_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
6566
6667   tilemap_set_transmask(bg_tilemap,0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
6768   tilemap_set_transmask(bg_tilemap,1,0x0001,0xfffe); /* split type 1 has pen 0 transparent in front half */
r814r815
251252
252253VIDEO_UPDATE( superqix )
253254{
254   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_BACK, 0);
255   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
255256   copybitmap(bitmap,fg_bitmap[show_bitmap],flip_screen,flip_screen,0,0,cliprect,TRANSPARENCY_PEN,0);
256257   superqix_draw_sprites(machine, bitmap,cliprect);
257   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_FRONT, 0);
258   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
258259   return 0;
259260}
src/mame/video/playch10.c
r814r815
9292   int code = videoram[offs] + ((videoram[offs + 1] & 0x07) << 8);
9393   int color = (videoram[offs + 1] >> 3) & 0x1f;
9494
95   SET_TILE_INFO(0, code, color, 0)
95   SET_TILE_INFO(0, code, color, 0);
9696}
9797
9898VIDEO_START( playch10 )
9999{
100100   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
101      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
101      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
102102
103103   ppu2c0x_init(machine, &ppu_interface );
104104}
src/mame/video/dday.c
r814r815
198198   int code;
199199
200200   code = dday_textvideoram[tile_index];
201   SET_TILE_INFO(1, code, code >> 5, 0)
201   SET_TILE_INFO(1, code, code >> 5, 0);
202202}
203203
204204static TILE_GET_INFO( get_sl_tile_info )
r814r815
225225      }
226226   }
227227
228   SET_TILE_INFO(3, code & 0x3f, 0, flipx ? TILE_FLIPX : 0)
228   SET_TILE_INFO(3, code & 0x3f, 0, flipx ? TILE_FLIPX : 0);
229229}
230230
231231
r814r815
237237
238238VIDEO_START( dday )
239239{
240   bg_tilemap   = tilemap_create(get_bg_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,32,32);
241   fg_tilemap   = tilemap_create(get_fg_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
242   text_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
243   sl_tilemap   = tilemap_create(get_sl_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
240   bg_tilemap   = tilemap_create(get_bg_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
241   fg_tilemap   = tilemap_create(get_fg_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
242   text_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
243   sl_tilemap   = tilemap_create(get_sl_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
244244
245245   main_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
246246
r814r815
338338
339339VIDEO_UPDATE( dday )
340340{
341   tilemap_draw(main_bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
341   tilemap_draw(main_bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
342342   tilemap_draw(main_bitmap,cliprect,fg_tilemap,0,0);
343   tilemap_draw(main_bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
343   tilemap_draw(main_bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
344344   tilemap_draw(main_bitmap,cliprect,text_tilemap,0,0);
345345
346346   if (sl_enable)
src/mame/video/cyberbal.c
r814r815
169169   atarimo_1_slipram = &current_slip[1];
170170
171171   /* initialize the playfield */
172   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,8, 64,64);
172   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,64);
173173
174174   /* initialize the motion objects */
175175   atarimo_init(machine, 0, &mo0desc);
176176
177177   /* initialize the alphanumerics */
178   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16,8, 64,32);
178   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,32);
179179   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
180180
181181   /* allocate the second screen if necessary */
182182   if (screens == 2)
183183   {
184184      /* initialize the playfield */
185      atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,8, 64,64);
185      atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,64);
186186      tilemap_set_scrollx(atarigen_playfield2_tilemap, 0, 0);
187187
188188      /* initialize the motion objects */
189189      atarimo_init(machine, 1, &mo1desc);
190190
191191      /* initialize the alphanumerics */
192      atarigen_alpha2_tilemap = tilemap_create(get_alpha2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16,8, 64,32);
192      atarigen_alpha2_tilemap = tilemap_create(get_alpha2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,32);
193193      tilemap_set_scrollx(atarigen_alpha2_tilemap, 0, 0);
194194      tilemap_set_transparent_pen(atarigen_alpha2_tilemap, 0);
195195   }
src/mame/video/mappy.c
r814r815
260260***************************************************************************/
261261
262262/* convert from 32x32 to 36x28 */
263static UINT32 superpac_tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
263static TILEMAP_MAPPER( superpac_tilemap_scan )
264264{
265265   int offs;
266266
r814r815
275275}
276276
277277/* tilemap is a composition of a 32x60 scrolling portion and two 2x28 fixed portions on the sides */
278static UINT32 mappy_tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
278static TILEMAP_MAPPER( mappy_tilemap_scan )
279279{
280280   int offs;
281281
r814r815
299299static TILE_GET_INFO( superpac_get_tile_info )
300300{
301301   UINT8 attr = mappy_videoram[tile_index + 0x400];
302   tileinfo->priority = (attr & 0x40) >> 6;
302   tileinfo->category = (attr & 0x40) >> 6;
303303   SET_TILE_INFO(
304304         0,
305305         mappy_videoram[tile_index],
306306         attr & 0x3f,
307         0)
307         0);
308308}
309309
310310static TILE_GET_INFO( phozon_get_tile_info )
311311{
312312   UINT8 attr = mappy_videoram[tile_index + 0x400];
313   tileinfo->priority = (attr & 0x40) >> 6;
313   tileinfo->category = (attr & 0x40) >> 6;
314314   SET_TILE_INFO(
315315         0,
316316         mappy_videoram[tile_index] + ((attr & 0x80) << 1),
317317         attr & 0x3f,
318         0)
318         0);
319319}
320320
321321static TILE_GET_INFO( mappy_get_tile_info )
322322{
323323   UINT8 attr = mappy_videoram[tile_index + 0x800];
324   tileinfo->priority = (attr & 0x40) >> 6;
324   tileinfo->category = (attr & 0x40) >> 6;
325325   SET_TILE_INFO(
326326         0,
327327         mappy_videoram[tile_index],
328328         attr & 0x3f,
329         0)
329         0);
330330}
331331
332332
r814r815
339339
340340VIDEO_START( superpac )
341341{
342   bg_tilemap = tilemap_create(superpac_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,36,28);
342   bg_tilemap = tilemap_create(superpac_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,36,28);
343343   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
344344
345345   tilemap_set_transparent_pen(bg_tilemap, 31);
r814r815
351351
352352VIDEO_START( phozon )
353353{
354   bg_tilemap = tilemap_create(phozon_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,36,28);
354   bg_tilemap = tilemap_create(phozon_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,36,28);
355355
356356   tilemap_set_transparent_pen(bg_tilemap, 15);
357357
r814r815
362362
363363VIDEO_START( mappy )
364364{
365   bg_tilemap = tilemap_create(mappy_get_tile_info,mappy_tilemap_scan,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,36,60);
365   bg_tilemap = tilemap_create(mappy_get_tile_info,mappy_tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,36,60);
366366
367367   tilemap_set_transparent_pen(bg_tilemap, 31);
368368   tilemap_set_scroll_cols(bg_tilemap, 36);
r814r815
548548{
549549   int x,y;
550550
551   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_IGNORE_TRANSPARENCY,0);
552   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_IGNORE_TRANSPARENCY,0);
551   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_OPAQUE,0);
552   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_OPAQUE,0);
553553
554554   fillbitmap(sprite_bitmap,15,cliprect);
555555   mappy_draw_sprites(machine,sprite_bitmap,cliprect,0,0,transmask);
r814r815
575575   /* flip screen control is embedded in RAM */
576576   flip_screen_set(mappy_spriteram[0x1f7f-0x800] & 1);
577577
578   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_IGNORE_TRANSPARENCY,0);
579   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_IGNORE_TRANSPARENCY,0);
578   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_OPAQUE,0);
579   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_OPAQUE,0);
580580
581581   phozon_draw_sprites(machine,bitmap,cliprect);
582582
r814r815
592592   for (offs = 2;offs < 34;offs++)
593593      tilemap_set_scrolly(bg_tilemap,offs,mappy_scroll);
594594
595   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_IGNORE_TRANSPARENCY,0);
596   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_IGNORE_TRANSPARENCY,0);
595   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_OPAQUE,0);
596   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_OPAQUE,0);
597597
598598   mappy_draw_sprites(machine,bitmap,cliprect,0,0,transmask);
599599
src/mame/video/rastan.c
r814r815
104104
105105   fillbitmap(priority_bitmap,0,cliprect);
106106
107    PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
107    PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
108108   PC080SN_tilemap_draw(bitmap,cliprect,0,layer[1],0,2);
109109
110110   PC090OJ_draw_sprites(machine,bitmap,cliprect,0);
r814r815
124124
125125   fillbitmap(priority_bitmap,0,cliprect);
126126
127    PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
127    PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
128128   PC080SN_tilemap_draw(bitmap,cliprect,0,layer[1],0,2);
129129
130130   PC090OJ_draw_sprites(machine,bitmap,cliprect,1);
r814r815
149149
150150   fillbitmap(priority_bitmap,0,cliprect);
151151
152   PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
152   PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
153153   PC080SN_tilemap_draw(bitmap,cliprect,0,layer[1],0,2);
154154
155155   PC090OJ_draw_sprites(machine,bitmap,cliprect,1);
r814r815
181181
182182   fillbitmap(priority_bitmap,0,cliprect);
183183
184    PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);
184    PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
185185
186186   /* Draw the sprites. 128 sprites in total */
187187   for (offs = spriteram_size/2-8; offs >= 0; offs -= 8)
src/mame/video/tigeroad.c
r814r815
117117   int attr = tilerom[tile_index + 1];
118118   int code = data + ((attr & 0xc0) << 2) + (bgcharbank << 10);
119119   int color = attr & 0x0f;
120   int flags = ((attr & 0x20) ? TILE_FLIPX : 0) | ((attr & 0x10) ? TILE_SPLIT(1) : 0);
120   int flags = (attr & 0x20) ? TILE_FLIPX : 0;
121121
122   SET_TILE_INFO(1, code, color, flags)
122   SET_TILE_INFO(1, code, color, flags);
123   tileinfo->group = (attr & 0x10) ? 1 : 0;
123124}
124125
125126static TILE_GET_INFO( get_fg_tile_info )
r814r815
130131   int color = attr & 0x0f;
131132   int flags = (attr & 0x10) ? TILE_FLIPY : 0;
132133
133   SET_TILE_INFO(0, code, color, flags)
134   SET_TILE_INFO(0, code, color, flags);
134135}
135136
136static UINT32 tigeroad_tilemap_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
137static TILEMAP_MAPPER( tigeroad_tilemap_scan )
137138{
138139   /* logical (col,row) -> memory offset */
139140   return 2 * (col % 8) + 16 * ((127 - row) % 8) + 128 * (col / 8) + 2048 * ((127 - row) / 8);
r814r815
142143VIDEO_START( tigeroad )
143144{
144145   bg_tilemap = tilemap_create(get_bg_tile_info, tigeroad_tilemap_scan,
145      TILEMAP_TYPE_SPLIT, 32, 32, 128, 128);
146      TILEMAP_TYPE_PEN, 32, 32, 128, 128);
146147
147148   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
148      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
149      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
149150
150151   tilemap_set_transmask(bg_tilemap, 0, 0xffff, 0);
151152   tilemap_set_transmask(bg_tilemap, 1, 0x1ff, 0xfe00);
r814r815
155156
156157VIDEO_UPDATE( tigeroad )
157158{
158   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_BACK, 0);
159   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
159160   draw_sprites(machine, bitmap, cliprect, 0);
160   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_FRONT, 1);
161   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER0, 1);
161162   //draw_sprites(machine, bitmap, cliprect, 1); draw priority sprites?
162163   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 2);
163164   return 0;
src/mame/video/segas32.c
r814r815
302302   {
303303      struct cache_entry *entry = auto_malloc(sizeof(struct cache_entry));
304304
305      entry->tmap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,16, 32,16);
305      entry->tmap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,16);
306306      entry->page = 0xff;
307307      entry->bank = 0;
308308      entry->next = cache_head;
r814r815
797797
798798static TILE_GET_INFO( get_tile_info )
799799{
800   struct cache_entry *entry = tileinfo->user_data;
800   struct cache_entry *entry = param;
801801   UINT16 data = system32_videoram[(entry->page & 0x7f) * 0x200 + tile_index];
802802   SET_TILE_INFO(0, (entry->bank << 13) + (data & 0x1fff), (data >> 4) & 0x1ff, (data >> 14) & 3);
803803}
src/mame/video/badlands.c
r814r815
8282   };
8383
8484   /* initialize the playfield */
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
8686
8787   /* initialize the motion objects */
8888   atarimo_init(machine, 0, &modesc);
src/mame/video/slapfght.c
r814r815
3535         0,
3636         tile,
3737         color,
38         0)
38         0);
3939}
4040
4141static TILE_GET_INFO( get_pf1_tile_info )
r814r815
4949         1,
5050         tile,
5151         color,
52         0)
52         0);
5353}
5454
5555static TILE_GET_INFO( get_fix_tile_info )
r814r815
6363         0,
6464         tile,
6565         color,
66         0)
66         0);
6767}
6868
6969
r814r815
7575
7676VIDEO_START( perfrman )
7777{
78   pf1_tilemap = tilemap_create(get_pf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
78   pf1_tilemap = tilemap_create(get_pf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
7979
8080   tilemap_set_transparent_pen(pf1_tilemap,0);
8181}
8282
8383VIDEO_START( slapfight )
8484{
85   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
86   fix_tilemap = tilemap_create(get_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
85   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
86   fix_tilemap = tilemap_create(get_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
8787
8888   tilemap_set_transparent_pen(fix_tilemap,0);
8989}
r814r815
194194      tilemap_set_scrollx( pf1_tilemap ,0 , -16 );
195195   }
196196
197   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
197   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE,0);
198198   draw_sprites(machine, bitmap,cliprect,0);
199199   tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0);
200200   draw_sprites(machine, bitmap,cliprect,0x80);
src/mame/video/quizdna.c
r814r815
3131   if (code>0x7fff)
3232      code &= 0x83ff;
3333
34   SET_TILE_INFO(1, code, col, 0)
34   SET_TILE_INFO(1, code, col, 0);
3535}
3636
3737static TILE_GET_INFO( get_fg_tile_info )
r814r815
5050   col >>= 5;
5151   col = (col & 3) | ((col & 4) << 1);
5252
53   SET_TILE_INFO(0, code, col, 0)
53   SET_TILE_INFO(0, code, col, 0);
5454}
5555
5656
r814r815
5959   quizdna_bg_ram = auto_malloc(0x2000);
6060   quizdna_fg_ram = auto_malloc(0x1000);
6161
62   quizdna_bg_tilemap = tilemap_create( get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32 );
63   quizdna_fg_tilemap = tilemap_create( get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,8,32,32 );
62   quizdna_bg_tilemap = tilemap_create( get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
63   quizdna_fg_tilemap = tilemap_create( get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,8,32,32 );
6464
6565   tilemap_set_transparent_pen( quizdna_fg_tilemap,0 );
6666}
src/mame/video/boogwing.c
r814r815
170170   // bit&0x4 combines playfields
171171   if ((deco16_priority&0x7)==0x5)
172172   {
173      deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
173      deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
174174      deco16_tilemap_34_combine_draw(bitmap,cliprect,0,32);
175175   }
176176   else if ((deco16_priority&0x7)==0x1 || (deco16_priority&0x7)==0x2)
177177   {
178      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
178      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
179179      deco16_tilemap_2_draw(bitmap,cliprect,0,8);
180180      deco16_tilemap_3_draw(bitmap,cliprect,0,32);
181181   }
182182   else if ((deco16_priority&0x7)==0x3)
183183   {
184      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
184      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
185185      deco16_tilemap_2_draw(bitmap,cliprect,0,8);
186186
187187      // This mode uses playfield 3 to shadow sprites & playfield 2 (instead of
188188      // regular alpha-blending, the destination is inverted).  Not yet implemented.
189//      deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_ALPHA,32);
189//      deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_DRAW_ALPHA,32);
190190   }
191191   else
192192   {
193      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
193      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
194194      deco16_tilemap_3_draw(bitmap,cliprect,0,8);
195195      deco16_tilemap_2_draw(bitmap,cliprect,0,32);
196196   }
src/mame/video/offtwall.c
r814r815
7373   };
7474
7575   /* initialize the playfield */
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
7777
7878   /* initialize the motion objects */
7979   atarimo_init(machine, 0, &modesc);
src/mame/video/mpatrol.c
r814r815
188188
189189   if (tile_index / 32 <= 6)
190190   {
191      flag |= TILE_IGNORE_TRANSPARENCY; /* lines 0 to 6 are opaqe? */
191      flag |= TILE_FORCE_LAYER0; /* lines 0 to 6 are opaqe? */
192192   }
193193
194   SET_TILE_INFO(0, code, color & 0x3f, flag)
194   SET_TILE_INFO(0, code, color & 0x3f, flag);
195195}
196196
197197
r814r815
200200{
201201   int y;
202202
203   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
203   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
204204
205205   tilemap_set_transparent_pen(bg_tilemap, 0);
206206
src/mame/video/equites.c
r814r815
106106
107107VIDEO_START( equites )
108108{
109   charmap0 = tilemap_create(equites_charinfo, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
109   charmap0 = tilemap_create(equites_charinfo, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
110110   tilemap_set_transparent_pen(charmap0, 0);
111111   tilemap_set_scrolldx(charmap0, BMPAD, BMPAD);
112112   tilemap_set_scrolldy(charmap0, BMPAD, BMPAD);
r814r815
224224
225225   tmpbitmap = auto_bitmap_alloc(BMW, BMW, machine->screen[0].format);
226226
227   charmap0 = tilemap_create(splndrbt_char0info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 32, 32);
227   charmap0 = tilemap_create(splndrbt_char0info, tilemap_scan_cols, TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
228228   tilemap_set_transparent_pen(charmap0, 0);
229229   tilemap_set_scrolldx(charmap0, 8, 8);
230230   tilemap_set_scrolldy(charmap0, 32, 32);
231231
232   charmap1 = tilemap_create(splndrbt_char1info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 32, 32);
232   charmap1 = tilemap_create(splndrbt_char1info, tilemap_scan_cols, TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
233233   tilemap_set_transparent_pen(charmap1, 0);
234234   tilemap_set_scrolldx(charmap1, 8, 8);
235235   tilemap_set_scrolldy(charmap1, 32, 32);
src/mame/video/gradius3.c
r814r815
179179   fillbitmap(priority_bitmap,0,cliprect);
180180   if (gradius3_priority == 0)
181181   {
182      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY,2);
182      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,2);
183183      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4);
184184      tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,1);
185185   }
186186   else
187187   {
188      tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_IGNORE_TRANSPARENCY,1);
188      tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_DRAW_OPAQUE,1);
189189      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,2);
190190      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4);
191191   }
src/mame/video/decocass.c
r814r815
101101    tilemap callbacks
102102 ********************************************/
103103
104static UINT32 fgvideoram_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
104static TILEMAP_MAPPER( fgvideoram_scan_cols )
105105{
106106   /* logical (col,row) -> memory offset */
107107   return (num_cols - 1 - col) * num_rows + row;
108108}
109109
110static UINT32 bgvideoram_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
110static TILEMAP_MAPPER( bgvideoram_scan_cols )
111111{
112112   /* logical (col,row) -> memory offset */
113113   return tile_offset[col * num_rows + row];
r814r815
120120         2,
121121         (0x80 == (tile_index & 0x80)) ? 16 : decocass_bgvideoram[tile_index] >> 4,
122122         color,
123         0)
123         0);
124124}
125125
126126static TILE_GET_INFO( get_bg_r_tile_info )
r814r815
130130         2,
131131         (0x00 == (tile_index & 0x80)) ? 16 : decocass_bgvideoram[tile_index] >> 4,
132132         color,
133         TILE_FLIPY)
133         TILE_FLIPY);
134134}
135135
136136static TILE_GET_INFO( get_fg_tile_info )
r814r815
141141         0,
142142         256 * (attr & 3) + code,
143143         color_center_bot & 1,
144         0)
144         0);
145145}
146146
147147/********************************************
r814r815
583583   char_dirty = auto_malloc(1024);
584584   tile_dirty = auto_malloc(16);
585585
586   bg_tilemap_l = tilemap_create( get_bg_l_tile_info, bgvideoram_scan_cols, TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32 );
587   bg_tilemap_r = tilemap_create( get_bg_r_tile_info, bgvideoram_scan_cols, TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32 );
588   fg_tilemap = tilemap_create( get_fg_tile_info, fgvideoram_scan_cols, TILEMAP_TYPE_TRANSPARENT,  8,  8, 32, 32 );
586   bg_tilemap_l = tilemap_create( get_bg_l_tile_info, bgvideoram_scan_cols, TILEMAP_TYPE_PEN, 16, 16, 32, 32 );
587   bg_tilemap_r = tilemap_create( get_bg_r_tile_info, bgvideoram_scan_cols, TILEMAP_TYPE_PEN, 16, 16, 32, 32 );
588   fg_tilemap = tilemap_create( get_fg_tile_info, fgvideoram_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32 );
589589
590590   tilemap_set_transparent_pen( bg_tilemap_l, 0 );
591591   tilemap_set_transparent_pen( bg_tilemap_r, 0 );
r814r815
679679   {
680680      clip = bg_tilemap_l_clip;
681681      sect_rect(&clip,cliprect);
682      tilemap_draw(bitmap,&clip, bg_tilemap_l, TILEMAP_IGNORE_TRANSPARENCY, 0);
682      tilemap_draw(bitmap,&clip, bg_tilemap_l, TILEMAP_DRAW_OPAQUE, 0);
683683
684684      clip = bg_tilemap_r_clip;
685685      sect_rect(&clip,cliprect);
686      tilemap_draw(bitmap,&clip, bg_tilemap_r, TILEMAP_IGNORE_TRANSPARENCY, 0);
686      tilemap_draw(bitmap,&clip, bg_tilemap_r, TILEMAP_DRAW_OPAQUE, 0);
687687   }
688688
689689   if (mode_set & 0x20)
src/mame/video/mystwarr.c
r814r815
152152
153153   colour |= sub1_colorbase << 4;
154154
155   SET_TILE_INFO(0, tileno, colour, 0)
155   SET_TILE_INFO(0, tileno, colour, 0);
156156}
157157
158158VIDEO_START(gaiapols)
r814r815
180180   K053936_wraparound_enable(0, 1);
181181   K053936GP_set_offset(0, -10,  0); // floor tiles in demo loop2 (Elaine vs. boss)
182182
183   ult_936_tilemap = tilemap_create(get_gai_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 512, 512);
183   ult_936_tilemap = tilemap_create(get_gai_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 512, 512);
184184   tilemap_set_transparent_pen(ult_936_tilemap, 0);
185185}
186186
r814r815
194194
195195   colour = sub1_colorbase;
196196
197   SET_TILE_INFO(0, tileno, colour, (dat1[tile_index]&0x40) ? TILE_FLIPX : 0)
197   SET_TILE_INFO(0, tileno, colour, (dat1[tile_index]&0x40) ? TILE_FLIPX : 0);
198198}
199199
200200VIDEO_START(dadandrn)
r814r815
224224   K053936_wraparound_enable(0, 1);
225225   K053936GP_set_offset(0, -8, 0); // Brainy's laser
226226
227   ult_936_tilemap = tilemap_create(get_ult_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 512, 512);
227   ult_936_tilemap = tilemap_create(get_ult_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 512, 512);
228228   tilemap_set_transparent_pen(ult_936_tilemap, 0);
229229}
230230
src/mame/video/fromance.c
r814r815
7676VIDEO_START( fromance )
7777{
7878   /* allocate tilemaps */
79   bg_tilemap = tilemap_create(get_fromance_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8,4, 64,64);
80   fg_tilemap = tilemap_create(get_fromance_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,4, 64,64);
79   bg_tilemap = tilemap_create(get_fromance_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,4, 64,64);
80   fg_tilemap = tilemap_create(get_fromance_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,4, 64,64);
8181
8282   /* allocate local videoram */
8383   local_videoram[0] = auto_malloc(0x1000 * 3);
r814r815
115115VIDEO_START( nekkyoku )
116116{
117117   /* allocate tilemaps */
118   bg_tilemap = tilemap_create(get_nekkyoku_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8,4, 64,64);
119   fg_tilemap = tilemap_create(get_nekkyoku_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,4, 64,64);
118   bg_tilemap = tilemap_create(get_nekkyoku_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,4, 64,64);
119   fg_tilemap = tilemap_create(get_nekkyoku_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,4, 64,64);
120120
121121   /* allocate local videoram */
122122   local_videoram[0] = auto_malloc(0x1000 * 3);
src/mame/video/skykid.c
r814r815
7777***************************************************************************/
7878
7979/* convert from 32x32 to 36x28 */
80static UINT32 tx_tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
80static TILEMAP_MAPPER( tx_tilemap_scan )
8181{
8282   int offs;
8383
r814r815
101101         0,
102102         skykid_textram[tile_index] | (flip_screen ? 0x100 : 0),
103103         skykid_textram[tile_index + 0x400] & 0x3f,
104         flip_screen ? (TILE_FLIPY | TILE_FLIPX) : 0)
104         flip_screen ? (TILE_FLIPY | TILE_FLIPX) : 0);
105105}
106106
107107
r814r815
114114         1,
115115         code + ((attr & 0x01) << 8),
116116         ((attr & 0x7e) >> 1) | ((attr & 0x01) << 6),
117         0)
117         0);
118118}
119119
120120
r814r815
127127
128128VIDEO_START( skykid )
129129{
130   tx_tilemap = tilemap_create(tx_get_tile_info,tx_tilemap_scan,  TILEMAP_TYPE_TRANSPARENT,8,8,36,28);
131   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,32);
130   tx_tilemap = tilemap_create(tx_get_tile_info,tx_tilemap_scan,  TILEMAP_TYPE_PEN,8,8,36,28);
131   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
132132
133133   tilemap_set_transparent_pen(tx_tilemap, 0);
134134
src/mame/video/klax.c
r814r815
7373   };
7474
7575   /* initialize the playfield */
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,32);
7777
7878   /* initialize the motion objects */
7979   atarimo_init(machine, 0, &modesc);
src/mame/video/quizpani.c
r814r815
1313
1414static int quizpani_bgbank = 0, quizpani_txtbank = 0;
1515
16static UINT32 bg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
16static TILEMAP_MAPPER( bg_scan )
1717{
1818   /* logical (col,row) -> memory offset */
1919   return (row & 0x0f) + ((col & 0xff) << 4) + ((row & 0x70) << 8);
r814r815
2727         1,
2828         (code & 0xfff) + (0x1000 * quizpani_bgbank),
2929         code >> 12,
30         0)
30         0);
3131}
3232
3333static TILE_GET_INFO( txt_tile_info )
r814r815
3838         0,
3939         (code & 0xfff) + (0x1000 * quizpani_txtbank),
4040         code >> 12,
41         0)
41         0);
4242}
4343
4444WRITE16_HANDLER( quizpani_bg_videoram_w )
r814r815
7373
7474VIDEO_START( quizpani )
7575{
76   bg_tilemap  = tilemap_create(bg_tile_info, bg_scan,TILEMAP_TYPE_OPAQUE,16,16,256,32);
77   txt_tilemap = tilemap_create(txt_tile_info,bg_scan,TILEMAP_TYPE_TRANSPARENT,16,16,256,32);
76   bg_tilemap  = tilemap_create(bg_tile_info, bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
77   txt_tilemap = tilemap_create(txt_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
7878   tilemap_set_transparent_pen(txt_tilemap,15);
7979}
8080
src/mame/video/gomoku.c
r814r815
7373         0,
7474         code,
7575         color,
76         TILE_FLIPYX(flipyx))
76         TILE_FLIPYX(flipyx));
7777}
7878
7979WRITE8_HANDLER( gomoku_videoram_w )
r814r815
121121
122122   gomoku_bg_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
123123
124   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32, 32);
124   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
125125
126126   tilemap_set_transparent_pen(fg_tilemap,0);
127127
src/mame/video/firetrk.c
r814r815
9494}
9595
9696
97static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
98{
99   return num_cols * row + col;
100}
101
102
10397static TILE_GET_INFO( get_tile_info1 )
10498{
10599   UINT8 code = firetrk_playfield_ram[tile_index];
r814r815
115109      color |= 4;
116110   }
117111
118   SET_TILE_INFO(1, code & 0x3f, color, 0)
112   SET_TILE_INFO(1, code & 0x3f, color, 0);
119113}
120114
121115
r814r815
171165      }
172166   }
173167
174   SET_TILE_INFO(2, code & 0x3f, color, 0)
168   SET_TILE_INFO(2, code & 0x3f, color, 0);
175169}
176170
177171
r814r815
296290   helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
297291   helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
298292
299   tilemap1 = tilemap_create(get_tile_info1, get_memory_offset, TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
300   tilemap2 = tilemap_create(get_tile_info2, get_memory_offset, TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
293   tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 16, 16);
294   tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 16, 16);
301295
302296   memset(&car[0], 0, sizeof (struct sprite_data));
303297   memset(&car[1], 0, sizeof (struct sprite_data));
src/mame/video/mustache.c
r814r815
8181   int code = videoram[2 * tile_index] + ((attr & 0x60) << 3) + ((control_byte & 0x08) << 7);
8282   int color = attr & 0x0f;
8383
84   SET_TILE_INFO(0, code, color, ((attr & 0x10) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0)   )
84   SET_TILE_INFO(0, code, color, ((attr & 0x10) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0)   );
8585
8686
8787}
r814r815
8989VIDEO_START( mustache )
9090{
9191   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_x,
92      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
92      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
9393
9494   tilemap_set_scroll_rows(bg_tilemap, 4);
9595}
src/mame/video/segas16a.c
r814r815
4949   fillbitmap(priority_bitmap, 0, cliprect);
5050
5151   /* draw background opaquely first, not setting any priorities */
52   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_IGNORE_TRANSPARENCY, 0x00);
53   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_IGNORE_TRANSPARENCY, 0x00);
52   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
53   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
5454
5555   /* draw background again, just to set the priorities on non-transparent pixels */
5656   segaic16_tilemap_draw(machine, 0, NULL, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
src/mame/video/konamigx.c
r814r815
2727   colour = (psac_colorbase << 4);
2828   flipx = 0;
2929
30   SET_TILE_INFO(0, tileno, colour, TILE_FLIPYX(flipx))
30   SET_TILE_INFO(0, tileno, colour, TILE_FLIPYX(flipx));
3131}
3232
3333/* Soccer Superstars (tile and flip bits now TRUSTED) */
r814r815
4343   if (tmap[(tile_index*2)+1] & 0x20) flip |= TILE_FLIPX;
4444   if (tmap[(tile_index*2)+1] & 0x10) flip |= TILE_FLIPY;
4545
46   SET_TILE_INFO(0, tileno, colour, flip)
46   SET_TILE_INFO(0, tileno, colour, flip);
4747}
4848
4949/* PSAC4 */
r814r815
6363   if (flipx) flip |= TILE_FLIPX;
6464   if (flipy) flip |= TILE_FLIPY;
6565
66   SET_TILE_INFO(1, tileno, colour, flip)
66   SET_TILE_INFO(1, tileno, colour, flip);
6767}
6868
6969static TILE_GET_INFO( get_gx_psac1b_tile_info )
r814r815
8080   if (flipx) flip |= TILE_FLIPX;
8181   if (flipy) flip |= TILE_FLIPY;
8282
83   SET_TILE_INFO(0, tileno, colour, flip)
83   SET_TILE_INFO(0, tileno, colour, flip);
8484}
8585
8686static void konamigx_type2_tile_callback(int layer, int *code, int *color, int *flags)
r814r815
273273
274274   _gxcommoninit(machine);
275275
276   gx_psac_tilemap = tilemap_create(get_gx_psac3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 256, 1024);
276   gx_psac_tilemap = tilemap_create(get_gx_psac3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 256, 1024);
277277   gx_rozenable = 1;
278278
279279   K053936_wraparound_enable(0, 1);
r814r815
286286
287287   _gxcommoninit(machine);
288288
289   gx_psac_tilemap = tilemap_create(get_gx_psac_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 128);
289   gx_psac_tilemap = tilemap_create(get_gx_psac_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
290290   gx_rozenable = 1;
291291
292292   K053936_wraparound_enable(0, 0);
r814r815
321321   K056832_set_LayerOffset(2,  2+1, 0);
322322   K056832_set_LayerOffset(3,  3+1, 0);
323323
324   gx_psac_tilemap = tilemap_create(get_gx_psac1a_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 128);
325   gx_psac_tilemap2 = tilemap_create(get_gx_psac1b_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 128);
324   gx_psac_tilemap = tilemap_create(get_gx_psac1a_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
325   gx_psac_tilemap2 = tilemap_create(get_gx_psac1b_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
326326   tilemap_set_transparent_pen(gx_psac_tilemap, 0);
327327   tilemap_set_transparent_pen(gx_psac_tilemap2, 0);
328328
r814r815
341341   K056832_set_LayerOffset(2,  2+1, 0);
342342   K056832_set_LayerOffset(3,  3+1, 0);
343343
344   gx_psac_tilemap = tilemap_create(get_gx_psac1a_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 128);
345   gx_psac_tilemap2 = tilemap_create(get_gx_psac1b_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128, 128);
344   gx_psac_tilemap = tilemap_create(get_gx_psac1a_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
345   gx_psac_tilemap2 = tilemap_create(get_gx_psac1b_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
346346   tilemap_set_transparent_pen(gx_psac_tilemap, 0);
347347   tilemap_set_transparent_pen(gx_psac_tilemap2, 0);
348348
src/mame/video/sprcros2.c
r814r815
8484         0,
8585         tile_number,
8686         (attr&0xf0)>>4,
87         (attr&0x08)?TILE_FLIPX:0)
87         (attr&0x08)?TILE_FLIPX:0);
8888}
8989
9090static TILE_GET_INFO( get_sprcros2_fgtile_info )
r814r815
103103         2,
104104         tile_number,
105105         (attr&0xfc)>>2,
106         0)
106         0);
107107}
108108
109109VIDEO_START( sprcros2 )
110110{
111   sprcros2_bgtilemap = tilemap_create( get_sprcros2_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
112   sprcros2_fgtilemap = tilemap_create( get_sprcros2_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,32,32 );
111   sprcros2_bgtilemap = tilemap_create( get_sprcros2_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
112   sprcros2_fgtilemap = tilemap_create( get_sprcros2_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_COLORTABLE,8,8,32,32 );
113113
114114   tilemap_set_transparent_pen(sprcros2_fgtilemap,0);
115115}
src/mame/video/thunderj.c
r814r815
3232   int code = ((data & 0x200) ? (thunderj_alpha_tile_bank * 0x200) : 0) + (data & 0x1ff);
3333   int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20);
3434   int opaque = data & 0x8000;
35   SET_TILE_INFO(2, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
35   SET_TILE_INFO(2, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
3636}
3737
3838
r814r815
4343   int code = data1 & 0x7fff;
4444   int color = 0x10 + (data2 & 0x0f);
4545   SET_TILE_INFO(0, code, color, (data1 >> 15) & 1);
46   tileinfo->priority = (data2 >> 4) & 3;
46   tileinfo->category = (data2 >> 4) & 3;
4747}
4848
4949
r814r815
5454   int code = data1 & 0x7fff;
5555   int color = data2 & 0x0f;
5656   SET_TILE_INFO(0, code, color, (data1 >> 15) & 1);
57   tileinfo->priority = (data2 >> 4) & 3;
57   tileinfo->category = (data2 >> 4) & 3;
5858}
5959
6060
r814r815
105105   };
106106
107107   /* initialize the playfield */
108   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
108   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
109109
110110   /* initialize the second playfield */
111   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,64);
111   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
112112   tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0);
113113
114114   /* initialize the motion objects */
115115   atarimo_init(machine, 0, &modesc);
116116
117117   /* initialize the alphanumerics */
118   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
118   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
119119   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
120120}
121121
src/mame/video/ultraman.c
r814r815
6464   zoom_colorbase[2] = 128;
6565
6666   K051960_vh_start(machine,SPRITEROM_MEM_REGION,NORMAL_PLANE_ORDER,sprite_callback);
67   K051316_vh_start_0(machine,ZOOMROM0_MEM_REGION,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback_0);
68   K051316_vh_start_1(machine,ZOOMROM1_MEM_REGION,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback_1);
69   K051316_vh_start_2(machine,ZOOMROM2_MEM_REGION,4,TILEMAP_TYPE_OPAQUE,0,zoom_callback_2);
67   K051316_vh_start_0(machine,ZOOMROM0_MEM_REGION,4,FALSE,0,zoom_callback_0);
68   K051316_vh_start_1(machine,ZOOMROM1_MEM_REGION,4,FALSE,0,zoom_callback_1);
69   K051316_vh_start_2(machine,ZOOMROM2_MEM_REGION,4,TRUE,0,zoom_callback_2);
7070
7171   K051316_set_offset(0, 8, 0);
7272   K051316_set_offset(1, 8, 0);
src/mame/video/ladybug.c
r814r815
308308   int code = videoram[tile_index] + 32 * (colorram[tile_index] & 0x08);
309309   int color = colorram[tile_index] & 0x07;
310310
311   SET_TILE_INFO(0, code, color, 0)
311   SET_TILE_INFO(0, code, color, 0);
312312}
313313
314314static TILE_GET_INFO( get_grid_tile_info )
315315{
316316   if (tile_index < 512)
317      SET_TILE_INFO(3, tile_index, 0, 0)
317      SET_TILE_INFO(3, tile_index, 0, 0);
318318   else
319319   {
320320      int temp = tile_index/32;
321321      tile_index = (31 - temp) * 32 + (tile_index % 32);
322      SET_TILE_INFO(4, tile_index, 0, 0)
322      SET_TILE_INFO(4, tile_index, 0, 0);
323323   }
324324}
325325
326326VIDEO_START( ladybug )
327327{
328328   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
329      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
329      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
330330
331331   tilemap_set_scroll_rows(bg_tilemap, 32);
332332}
r814r815
334334VIDEO_START( sraider )
335335{
336336   grid_tilemap = tilemap_create(get_grid_tile_info, tilemap_scan_rows,
337      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
337      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
338338
339339   tilemap_set_scroll_rows(grid_tilemap, 32);
340340
341341   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
342      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
342      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
343343
344344   tilemap_set_scroll_rows(bg_tilemap, 32);
345345
src/mame/video/combatsc.c
r814r815
110110         0,
111111         number,
112112         color,
113         0)
114   tileinfo->priority = (attributes & 0x40) >> 6;
113         0);
114   tileinfo->category = (attributes & 0x40) >> 6;
115115}
116116
117117static TILE_GET_INFO( get_tile_info1 )
r814r815
135135         1,
136136         number,
137137         color,
138         0)
139   tileinfo->priority = (attributes & 0x40) >> 6;
138         0);
139   tileinfo->category = (attributes & 0x40) >> 6;
140140}
141141
142142static TILE_GET_INFO( get_text_info )
r814r815
149149         0,
150150         number,
151151         color,
152         0)
152         0);
153153}
154154
155155
r814r815
174174         0,
175175         number,
176176         color,
177         0)
177         0);
178178}
179179
180180static TILE_GET_INFO( get_tile_info1_bootleg )
r814r815
198198         1,
199199         number,
200200         color,
201         0)
201         0);
202202}
203203
204204static TILE_GET_INFO( get_text_info_bootleg )
r814r815
211211         1,
212212         number,
213213         color,
214         0)
214         0);
215215}
216216
217217/***************************************************************************
r814r815
224224{
225225   combasc_vreg = -1;
226226
227   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
228   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
229   textlayer =  tilemap_create(get_text_info, tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
227   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
228   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
229   textlayer =  tilemap_create(get_text_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
230230
231231   private_spriteram[0] = auto_malloc(0x800);
232232   private_spriteram[1] = auto_malloc(0x800);
r814r815
244244{
245245   combasc_vreg = -1;
246246
247   bg_tilemap[0] = tilemap_create(get_tile_info0_bootleg,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
248   bg_tilemap[1] = tilemap_create(get_tile_info1_bootleg,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
249   textlayer =  tilemap_create(get_text_info_bootleg, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
247   bg_tilemap[0] = tilemap_create(get_tile_info0_bootleg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
248   bg_tilemap[1] = tilemap_create(get_tile_info1_bootleg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
249   textlayer =  tilemap_create(get_text_info_bootleg, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
250250
251251   private_spriteram[0] = auto_malloc(0x800);
252252   private_spriteram[1] = auto_malloc(0x800);
r814r815
255255
256256      tilemap_set_transparent_pen(bg_tilemap[0],0);
257257      tilemap_set_transparent_pen(bg_tilemap[1],0);
258      tilemap_set_transparent_pen(textlayer,0);
259258
260259      tilemap_set_scroll_rows(bg_tilemap[0],32);
261260      tilemap_set_scroll_rows(bg_tilemap[1],32);
r814r815
490489
491490   if (priority == 0)
492491   {
493      tilemap_draw(bitmap,cliprect,bg_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY|0,4);
494      tilemap_draw(bitmap,cliprect,bg_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY|1,8);
492      tilemap_draw(bitmap,cliprect,bg_tilemap[1],TILEMAP_DRAW_OPAQUE|0,4);
493      tilemap_draw(bitmap,cliprect,bg_tilemap[1],TILEMAP_DRAW_OPAQUE|1,8);
495494      tilemap_draw(bitmap,cliprect,bg_tilemap[0],0,1);
496495      tilemap_draw(bitmap,cliprect,bg_tilemap[0],1,2);
497496
r814r815
501500   }
502501   else
503502   {
504      tilemap_draw(bitmap,cliprect,bg_tilemap[0],TILEMAP_IGNORE_TRANSPARENCY|0,1);
505      tilemap_draw(bitmap,cliprect,bg_tilemap[0],TILEMAP_IGNORE_TRANSPARENCY|1,2);
503      tilemap_draw(bitmap,cliprect,bg_tilemap[0],TILEMAP_DRAW_OPAQUE|0,1);
504      tilemap_draw(bitmap,cliprect,bg_tilemap[0],TILEMAP_DRAW_OPAQUE|1,2);
506505      tilemap_draw(bitmap,cliprect,bg_tilemap[1],1,4);
507506      tilemap_draw(bitmap,cliprect,bg_tilemap[1],0,8);
508507
r814r815
623622
624623   if (priority == 0)
625624   {
626      tilemap_draw( bitmap,cliprect,bg_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY,0);
625      tilemap_draw( bitmap,cliprect,bg_tilemap[1],TILEMAP_DRAW_OPAQUE,0);
627626      bootleg_draw_sprites(machine, bitmap,cliprect, combasc_page[0], 0 );
628627      tilemap_draw( bitmap,cliprect,bg_tilemap[0],0 ,0);
629628      bootleg_draw_sprites(machine, bitmap,cliprect, combasc_page[1], 1 );
630629   }
631630   else
632631   {
633      tilemap_draw( bitmap,cliprect,bg_tilemap[0],TILEMAP_IGNORE_TRANSPARENCY,0);
632      tilemap_draw( bitmap,cliprect,bg_tilemap[0],TILEMAP_DRAW_OPAQUE,0);
634633      bootleg_draw_sprites(machine, bitmap,cliprect, combasc_page[0], 0 );
635634      tilemap_draw( bitmap,cliprect,bg_tilemap[1],0 ,0);
636635      bootleg_draw_sprites(machine, bitmap,cliprect, combasc_page[1], 1 );
src/mame/video/blueprnt.c
r814r815
7474   int code = videoram[tile_index] + 256 * gfx_bank;
7575   int color = attr & 0x7f;
7676
77   tileinfo->priority = (attr & 0x80) ? 1 : 0;
77   tileinfo->category = (attr & 0x80) ? 1 : 0;
7878
79   SET_TILE_INFO(0, code, color, 0)
79   SET_TILE_INFO(0, code, color, 0);
8080}
8181
8282VIDEO_START( blueprnt )
8383{
8484   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x,
85      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
85      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
8686
8787   tilemap_set_transparent_pen(bg_tilemap, 0);
8888   tilemap_set_scroll_cols(bg_tilemap, 32);
src/mame/video/rockrage.c
r814r815
8686{
8787   K007342_tilemap_update();
8888
89   K007342_tilemap_draw( bitmap,cliprect, 0, TILEMAP_IGNORE_TRANSPARENCY ,0);
89   K007342_tilemap_draw( bitmap,cliprect, 0, TILEMAP_DRAW_OPAQUE ,0);
9090   K007420_sprites_draw( bitmap,cliprect );
91   K007342_tilemap_draw( bitmap,cliprect, 0, 1 | TILEMAP_IGNORE_TRANSPARENCY ,0);
91   K007342_tilemap_draw( bitmap,cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE ,0);
9292   K007342_tilemap_draw( bitmap,cliprect, 1, 0 ,0);
9393   K007342_tilemap_draw( bitmap,cliprect, 1, 1 ,0);
9494   return 0;
src/mame/video/gotcha.c
r814r815
1313
1414***************************************************************************/
1515
16UINT32 gotcha_tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
16static TILEMAP_MAPPER( gotcha_tilemap_scan )
1717{
1818   return (col & 0x1f) | (row << 5) | ((col & 0x20) << 5);
1919}
r814r815
2323   UINT16 data = vram[tile_index];
2424   int code = (data & 0x3ff) | (gfxbank[(data & 0x0c00) >> 10] << 10);
2525
26   SET_TILE_INFO(0,code,(data >> 12) + color_offs,0)
26   SET_TILE_INFO(0,code,(data >> 12) + color_offs,0);
2727}
2828
2929static TILE_GET_INFO( fg_get_tile_info ) { get_tile_info(machine,tileinfo,tile_index,gotcha_fgvideoram, 0); }
r814r815
3939
4040VIDEO_START( gotcha )
4141{
42   fg_tilemap = tilemap_create(fg_get_tile_info,gotcha_tilemap_scan,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
43   bg_tilemap = tilemap_create(bg_get_tile_info,gotcha_tilemap_scan,TILEMAP_TYPE_OPAQUE,     16,16,64,32);
42   fg_tilemap = tilemap_create(fg_get_tile_info,gotcha_tilemap_scan,TILEMAP_TYPE_PEN,16,16,64,32);
43   bg_tilemap = tilemap_create(bg_get_tile_info,gotcha_tilemap_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
4444
4545   tilemap_set_transparent_pen(fg_tilemap,0);
4646
src/mame/video/starshp1.c
r814r815
3737static tilemap* bg_tilemap;
3838
3939
40static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
41{
42   return num_cols * row + col;
43}
44
45
4640static TILE_GET_INFO( get_tile_info )
4741{
4842   UINT8 code = starshp1_playfield_ram[tile_index];
4943
50   SET_TILE_INFO(0, code & 0x3f, 0, 0)
44   SET_TILE_INFO(0, code & 0x3f, 0, 0);
5145}
5246
5347
r814r815
5751
5852   int i;
5953
60   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, TILEMAP_TYPE_TRANSPARENT, 16, 8, 32, 32);
54   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 8, 32, 32);
6155
6256   tilemap_set_transparent_pen(bg_tilemap, 0);
6357
src/mame/video/pandoras.c
r814r815
7878         0,
7979         videoram[tile_index] + ((attr & 0x10) << 4),
8080         attr & 0x0f,
81         TILE_FLIPYX((attr & 0xc0) >> 6))
82   tileinfo->priority = (attr & 0x20) >> 5;
81         TILE_FLIPYX((attr & 0xc0) >> 6));
82   tileinfo->category = (attr & 0x20) >> 5;
8383}
8484
8585/***************************************************************************
r814r815
9090
9191VIDEO_START( pandoras )
9292{
93   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
93   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
9494}
9595
9696/***************************************************************************
src/mame/video/bigstrkb.c
r814r815
5151
5252/* Tilemaps */
5353
54static UINT32 bsb_bg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
54static TILEMAP_MAPPER( bsb_bg_scan )
5555{
5656   int offset;
5757
r814r815
6969   tileno = bsb_videoram[tile_index] & 0x0fff;
7070   col=    bsb_videoram[tile_index] & 0xf000;
7171
72   SET_TILE_INFO(0,tileno,col>>12,0)
72   SET_TILE_INFO(0,tileno,col>>12,0);
7373}
7474
7575WRITE16_HANDLER( bsb_videoram_w )
r814r815
8585   tileno = bsb_videoram2[tile_index] & 0x0fff;
8686   col=    bsb_videoram2[tile_index] & 0xf000;
8787
88   SET_TILE_INFO(1,tileno,col>>12,0)
88   SET_TILE_INFO(1,tileno,col>>12,0);
8989}
9090
9191WRITE16_HANDLER( bsb_videoram2_w )
r814r815
102102   tileno = bsb_videoram3[tile_index] & 0x0fff;
103103   col=    bsb_videoram3[tile_index] & 0xf000;
104104
105   SET_TILE_INFO(1,tileno+0x2000,(col>>12)+(0x100/16),0)
105   SET_TILE_INFO(1,tileno+0x2000,(col>>12)+(0x100/16),0);
106106}
107107
108108WRITE16_HANDLER( bsb_videoram3_w )
r814r815
115115
116116VIDEO_START(bigstrkb)
117117{
118   bsb_tilemap = tilemap_create(get_bsb_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
119   bsb_tilemap2 = tilemap_create(get_bsb_tile2_info,bsb_bg_scan,TILEMAP_TYPE_OPAQUE, 16, 16,128,64);
120   bsb_tilemap3 = tilemap_create(get_bsb_tile3_info,bsb_bg_scan,TILEMAP_TYPE_TRANSPARENT, 16, 16,128,64);
118   bsb_tilemap = tilemap_create(get_bsb_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 8, 8,64,32);
119   bsb_tilemap2 = tilemap_create(get_bsb_tile2_info,bsb_bg_scan,TILEMAP_TYPE_PEN, 16, 16,128,64);
120   bsb_tilemap3 = tilemap_create(get_bsb_tile3_info,bsb_bg_scan,TILEMAP_TYPE_PEN, 16, 16,128,64);
121121
122122   tilemap_set_transparent_pen(bsb_tilemap,15);
123123//  tilemap_set_transparent_pen(bsb_tilemap2,15);
src/mame/video/gberet.c
r814r815
100100   int color = attr & 0x0f;
101101   int flags = TILE_FLIPYX((attr & 0x30) >> 4);
102102
103   tileinfo->priority = (attr & 0x80) >> 7;
103   tileinfo->category = (attr & 0x80) >> 7;
104104
105105   SET_TILE_INFO(0, code, color, flags);
106106}
r814r815
108108VIDEO_START( gberet )
109109{
110110   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
111      TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8, 64, 32);
111      TILEMAP_TYPE_COLORTABLE, 8, 8, 64, 32);
112112
113113   tilemap_set_transparent_pen(bg_tilemap, 0x10);
114114   tilemap_set_scroll_rows(bg_tilemap, 32);
r814r815
152152
153153VIDEO_UPDATE( gberet )
154154{
155   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY | 0, 0);
156   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY | 1, 0);
155   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
156   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
157157   gberet_draw_sprites(machine, bitmap, cliprect);
158158   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
159159   return 0;
r814r815
204204
205205VIDEO_UPDATE( gberetb )
206206{
207   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY | 0, 0);
208   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY | 1, 0);
207   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
208   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
209209   gberetb_draw_sprites(machine, bitmap, cliprect);
210210   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
211211   return 0;
src/mame/video/stfight.c
r814r815
8787
8888***************************************************************************/
8989
90static UINT32 fg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
90static TILEMAP_MAPPER( fg_scan )
9191{
9292   /* logical (col,row) -> memory offset */
9393   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x70) << 4) + ((row & 0xf0) << 7);
r814r815
105105         1,
106106         tile_base + fgMap[tile_index],
107107         attr & 0x07,
108         0)
108         0);
109109}
110110
111static UINT32 bg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
111static TILEMAP_MAPPER( bg_scan )
112112{
113113   /* logical (col,row) -> memory offset */
114114   return ((col & 0x0e) >> 1) + ((row & 0x0f) << 3) + ((col & 0x70) << 3) +
r814r815
129129         2+tile_bank,
130130         tile_base + bgMap[tile_index],
131131         attr & 0x07,
132         0)
132         0);
133133}
134134
135135static TILE_GET_INFO( get_tx_tile_info )
r814r815
140140         0,
141141         stfight_text_char_ram[tile_index] + ((attr & 0x80) << 1),
142142         attr & 0x0f,
143         TILE_FLIPYX((attr & 0x60) >> 5))
143         TILE_FLIPYX((attr & 0x60) >> 5));
144144}
145145
146146
r814r815
152152
153153VIDEO_START( stfight )
154154{
155   bg_tilemap = tilemap_create(get_bg_tile_info,bg_scan,TILEMAP_TYPE_OPAQUE,     16,16,128,256);
156   fg_tilemap = tilemap_create(get_fg_tile_info,fg_scan,TILEMAP_TYPE_TRANSPARENT,16,16,128,256);
155   bg_tilemap = tilemap_create(get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,     16,16,128,256);
156   fg_tilemap = tilemap_create(get_fg_tile_info,fg_scan,TILEMAP_TYPE_PEN,16,16,128,256);
157157   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,
158         TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,32,32);
158         TILEMAP_TYPE_COLORTABLE,8,8,32,32);
159159
160160   tilemap_set_transparent_pen(fg_tilemap,0x0F);
161161   tilemap_set_transparent_pen(tx_tilemap,256);
src/mame/video/gottlieb.c
r814r815
152152{
153153   int code = videoram[tile_index];
154154
155   SET_TILE_INFO(0, code^swap_bg_ramrom, 0, 0)
155   SET_TILE_INFO(0, code^swap_bg_ramrom, 0, 0);
156156}
157157
158158static void gottlieb_video_start_common(void)
159159{
160160   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
161      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
161      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
162162
163163   tilemap_set_transparent_pen(bg_tilemap, 0);
164164}
r814r815
204204{
205205   if (!background_priority)
206206   {
207      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_IGNORE_TRANSPARENCY, 0);
207      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
208208   }
209209   else
210210   {
src/mame/video/ddragon.c
r814r815
6060
6161***************************************************************************/
6262
63static UINT32 background_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
63static TILEMAP_MAPPER( background_scan )
6464{
6565   /* logical (col,row) -> memory offset */
6666   return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5);
r814r815
7373         2,
7474         ddragon_bgvideoram[2*tile_index+1] + ((attr & 0x07) << 8),
7575         (attr >> 3) & 0x07,
76         TILE_FLIPYX((attr & 0xc0) >> 6))
76         TILE_FLIPYX((attr & 0xc0) >> 6));
7777}
7878
7979static TILE_GET_INFO( get_fg_tile_info )
r814r815
8383         0,
8484         ddragon_fgvideoram[2*tile_index+1] + ((attr & 0x07) << 8),
8585         attr >> 5,
86         0)
86         0);
8787}
8888
8989static TILE_GET_INFO( get_fg_16color_tile_info )
r814r815
9393         0,
9494         ddragon_fgvideoram[2*tile_index+1] + ((attr & 0x0f) << 8),
9595         attr >> 4,
96         0)
96         0);
9797}
9898
9999
r814r815
105105
106106VIDEO_START( ddragon )
107107{
108   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,  TILEMAP_TYPE_OPAQUE,     16,16,32,32);
109   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
108   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,  TILEMAP_TYPE_PEN,     16,16,32,32);
109   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
110110
111111   tilemap_set_transparent_pen(fg_tilemap,0);
112112}
113113
114114VIDEO_START( chinagat )
115115{
116   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,  TILEMAP_TYPE_OPAQUE,     16,16,32,32);
117   fg_tilemap = tilemap_create(get_fg_16color_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
116   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,  TILEMAP_TYPE_PEN,     16,16,32,32);
117   fg_tilemap = tilemap_create(get_fg_16color_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
118118
119119   tilemap_set_transparent_pen(fg_tilemap,0);
120120}
src/mame/video/homedata.c
r814r815
502502
503503VIDEO_START( mrokumei )
504504{
505   bg_tilemap[0][0] = tilemap_create( mrokumei_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64,32 );
506   bg_tilemap[0][1] = tilemap_create( mrokumei_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64,32 );
507   bg_tilemap[1][0] = tilemap_create( mrokumei_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64,32 );
508   bg_tilemap[1][1] = tilemap_create( mrokumei_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64,32 );
505   bg_tilemap[0][0] = tilemap_create( mrokumei_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
506   bg_tilemap[0][1] = tilemap_create( mrokumei_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
507   bg_tilemap[1][0] = tilemap_create( mrokumei_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
508   bg_tilemap[1][1] = tilemap_create( mrokumei_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
509509
510510   tilemap_set_transparent_pen(bg_tilemap[0][1],0);
511511   tilemap_set_transparent_pen(bg_tilemap[1][1],0);
r814r815
513513
514514VIDEO_START( reikaids )
515515{
516   bg_tilemap[0][0] = tilemap_create( reikaids_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32 );
517   bg_tilemap[0][1] = tilemap_create( reikaids_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32 );
518   bg_tilemap[0][2] = tilemap_create( reikaids_get_info0_2, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32 );
519   bg_tilemap[0][3] = tilemap_create( reikaids_get_info0_3, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32 );
520   bg_tilemap[1][0] = tilemap_create( reikaids_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32 );
521   bg_tilemap[1][1] = tilemap_create( reikaids_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32 );
522   bg_tilemap[1][2] = tilemap_create( reikaids_get_info1_2, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32 );
523   bg_tilemap[1][3] = tilemap_create( reikaids_get_info1_3, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32 );
516   bg_tilemap[0][0] = tilemap_create( reikaids_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
517   bg_tilemap[0][1] = tilemap_create( reikaids_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
518   bg_tilemap[0][2] = tilemap_create( reikaids_get_info0_2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
519   bg_tilemap[0][3] = tilemap_create( reikaids_get_info0_3, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
520   bg_tilemap[1][0] = tilemap_create( reikaids_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
521   bg_tilemap[1][1] = tilemap_create( reikaids_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
522   bg_tilemap[1][2] = tilemap_create( reikaids_get_info1_2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
523   bg_tilemap[1][3] = tilemap_create( reikaids_get_info1_3, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
524524
525525   tilemap_set_transparent_pen(bg_tilemap[0][0],0xff);
526526   tilemap_set_transparent_pen(bg_tilemap[0][1],0xff);
r814r815
534534
535535VIDEO_START( pteacher )
536536{
537   bg_tilemap[0][0] = tilemap_create( pteacher_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64,32 );
538   bg_tilemap[0][1] = tilemap_create( pteacher_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64,32 );
539   bg_tilemap[1][0] = tilemap_create( pteacher_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64,32 );
540   bg_tilemap[1][1] = tilemap_create( pteacher_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64,32 );
537   bg_tilemap[0][0] = tilemap_create( pteacher_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
538   bg_tilemap[0][1] = tilemap_create( pteacher_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
539   bg_tilemap[1][0] = tilemap_create( pteacher_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
540   bg_tilemap[1][1] = tilemap_create( pteacher_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
541541
542542   tilemap_set_transparent_pen(bg_tilemap[0][1],0xff);
543543   tilemap_set_transparent_pen(bg_tilemap[1][1],0xff);
r814r815
545545
546546VIDEO_START( lemnangl )
547547{
548   bg_tilemap[0][0] = tilemap_create( lemnangl_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64,32 );
549   bg_tilemap[0][1] = tilemap_create( lemnangl_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64,32 );
550   bg_tilemap[1][0] = tilemap_create( lemnangl_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8, 64,32 );
551   bg_tilemap[1][1] = tilemap_create( lemnangl_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64,32 );
548   bg_tilemap[0][0] = tilemap_create( lemnangl_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
549   bg_tilemap[0][1] = tilemap_create( lemnangl_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
550   bg_tilemap[1][0] = tilemap_create( lemnangl_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
551   bg_tilemap[1][1] = tilemap_create( lemnangl_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
552552
553553   tilemap_set_transparent_pen(bg_tilemap[0][1],0x0f);
554554   tilemap_set_transparent_pen(bg_tilemap[1][1],0x0f);
src/mame/video/mugsmash.c
r814r815
8080   colour = mugsmash_videoram1[tile_index *2] & 0x000f;
8181   fx = (mugsmash_videoram1[tile_index *2] & 0xc0) >>6;
8282
83   SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(fx))
83   SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(fx));
8484}
8585
8686WRITE16_HANDLER( mugsmash_videoram1_w )
r814r815
106106   colour = mugsmash_videoram2[tile_index *2] & 0x000f;
107107   fx = (mugsmash_videoram2[tile_index *2] & 0xc0) >>6;
108108
109   SET_TILE_INFO(1,tileno,16+colour,TILE_FLIPYX(fx))
109   SET_TILE_INFO(1,tileno,16+colour,TILE_FLIPYX(fx));
110110}
111111
112112WRITE16_HANDLER( mugsmash_videoram2_w )
r814r815
140140VIDEO_START( mugsmash )
141141{
142142
143   mugsmash_tilemap1 = tilemap_create(get_mugsmash_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
143   mugsmash_tilemap1 = tilemap_create(get_mugsmash_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
144144   tilemap_set_transparent_pen(mugsmash_tilemap1,0);
145145
146   mugsmash_tilemap2 = tilemap_create(get_mugsmash_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 16, 16,32,32);
146   mugsmash_tilemap2 = tilemap_create(get_mugsmash_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
147147}
148148
149149VIDEO_UPDATE( mugsmash )
src/mame/video/pcktgal.c
r814r815
5050   int code = videoram[tile_index*2+1] + ((videoram[tile_index*2] & 0x0f) << 8);
5151   int color = videoram[tile_index*2] >> 4;
5252
53   SET_TILE_INFO(0, code, color, 0)
53   SET_TILE_INFO(0, code, color, 0);
5454}
5555
5656VIDEO_START( pcktgal )
5757{
5858   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
59      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
59      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
6060}
6161
6262static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/hng64.c
r814r815
942942   int tileno,pal;
943943   tileno = hng64_videoram[tile_index];
944944   pal = hng64_videoram[tile_index]>>24;
945   SET_TILE_INFO((tileno&1)?0:1,(tileno&0x3fffff)>>1,pal,TILE_FLIPYX((tileno&0xc00000)>>22))
945   SET_TILE_INFO((tileno&1)?0:1,(tileno&0x3fffff)>>1,pal,TILE_FLIPYX((tileno&0xc00000)>>22));
946946}
947947
948948/* 16x16 tiles, 8bpp layer */
r814r815
952952   tileno = hng64_videoram[tile_index+(0x10000/4)];
953953   pal = hng64_videoram[tile_index+(0x10000/4)]>>24;
954954
955   SET_TILE_INFO(3,(tileno&0x3fffff)>>3,pal>>4,  TILE_FLIPYX((tileno&0xc00000)>>22) )
955   SET_TILE_INFO(3,(tileno&0x3fffff)>>3,pal>>4,  TILE_FLIPYX((tileno&0xc00000)>>22) );
956956}
957957
958958/* 16x16 tiles, 8bpp layer */
r814r815
961961   int tileno,pal;
962962   tileno = hng64_videoram[tile_index+(0x20000/4)];
963963   pal = hng64_videoram[tile_index+(0x20000/4)]>>24;
964   SET_TILE_INFO(3,(tileno&0x3fffff)>>3,pal>>4,TILE_FLIPYX((tileno&0xc00000)>>22))
964   SET_TILE_INFO(3,(tileno&0x3fffff)>>3,pal>>4,TILE_FLIPYX((tileno&0xc00000)>>22));
965965}
966966
967967/* 16x16 tiles, 8bpp layer */
r814r815
970970   int tileno,pal;
971971   tileno = hng64_videoram[tile_index+(0x30000/4)];
972972   pal = hng64_videoram[tile_index+(0x30000/4)]>>24;
973   SET_TILE_INFO(3,(tileno&0x3fffff)>>3,pal>>4,TILE_FLIPYX((tileno&0xc00000)>>22))
973   SET_TILE_INFO(3,(tileno&0x3fffff)>>3,pal>>4,TILE_FLIPYX((tileno&0xc00000)>>22));
974974}
975975
976976
r814r815
12531253        tilemap2Offset = hng64_videoregs[0xc] ;
12541254
12551255        tilemap_dispose(hng64_tilemap1) ;
1256        hng64_tilemap1 = tilemap_create(get_hng64_tile2_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16, 128,128); // 128x128x4 = 0x10000
1256        hng64_tilemap1 = tilemap_create(get_hng64_tile2_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16, 128,128); // 128x128x4 = 0x10000
12571257    }
12581258    */
12591259
r814r815
12961296
12971297VIDEO_START( hng64 )
12981298{
1299   hng64_tilemap0 = tilemap_create(get_hng64_tile0_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,   8, 128,128); /* 128x128x4 = 0x10000 */
1300   hng64_tilemap1 = tilemap_create(get_hng64_tile1_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
1301   hng64_tilemap2 = tilemap_create(get_hng64_tile2_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
1302   hng64_tilemap3 = tilemap_create(get_hng64_tile3_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
1299   hng64_tilemap0 = tilemap_create(get_hng64_tile0_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,   8, 128,128); /* 128x128x4 = 0x10000 */
1300   hng64_tilemap1 = tilemap_create(get_hng64_tile1_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
1301   hng64_tilemap2 = tilemap_create(get_hng64_tile2_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
1302   hng64_tilemap3 = tilemap_create(get_hng64_tile3_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
13031303   tilemap_set_transparent_pen(hng64_tilemap0,0);
13041304   tilemap_set_transparent_pen(hng64_tilemap1,0);
13051305   tilemap_set_transparent_pen(hng64_tilemap2,0);
src/mame/video/solomon.c
r814r815
4545   int color = ((attr & 0x70) >> 4);
4646   int flags = ((attr & 0x80) ? TILE_FLIPX : 0) | ((attr & 0x08) ? TILE_FLIPY : 0);
4747
48   SET_TILE_INFO(1, code, color, flags)
48   SET_TILE_INFO(1, code, color, flags);
4949}
5050
5151static TILE_GET_INFO( get_fg_tile_info )
r814r815
5454   int code = videoram[tile_index] + 256 * (attr & 0x07);
5555   int color = (attr & 0x70) >> 4;
5656
57   SET_TILE_INFO(0, code, color, 0)
57   SET_TILE_INFO(0, code, color, 0);
5858}
5959
6060VIDEO_START( solomon )
6161{
6262   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
63      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
63      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
6464
6565   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
66      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
66      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
6767
6868   tilemap_set_transparent_pen(fg_tilemap, 0);
6969}
src/mame/video/macrossp.c
r814r815
4747         break;
4848   }
4949
50   SET_TILE_INFO(1,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30))
50   SET_TILE_INFO(1,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30));
5151}
5252
5353/*** SCR B LAYER ***/
r814r815
8282         break;
8383   }
8484
85   SET_TILE_INFO(2,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30))
85   SET_TILE_INFO(2,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30));
8686}
8787
8888/*** SCR C LAYER ***/
r814r815
117117         break;
118118   }
119119
120   SET_TILE_INFO(3,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30))
120   SET_TILE_INFO(3,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30));
121121}
122122
123123/*** TEXT LAYER ***/
r814r815
137137   tileno = macrossp_text_videoram[tile_index] & 0x0000ffff;
138138   colour = (macrossp_text_videoram[tile_index] & 0x00fe0000) >> 17;
139139
140   SET_TILE_INFO(4,tileno,colour,0)
140   SET_TILE_INFO(4,tileno,colour,0);
141141}
142142
143143
r814r815
152152   memset(spriteram_old,0,spriteram_size);
153153   memset(spriteram_old2,0,spriteram_size);
154154
155   macrossp_text_tilemap = tilemap_create(get_macrossp_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
156   macrossp_scra_tilemap = tilemap_create(get_macrossp_scra_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
157   macrossp_scrb_tilemap = tilemap_create(get_macrossp_scrb_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
158   macrossp_scrc_tilemap = tilemap_create(get_macrossp_scrc_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
155   macrossp_text_tilemap = tilemap_create(get_macrossp_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
156   macrossp_scra_tilemap = tilemap_create(get_macrossp_scra_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
157   macrossp_scrb_tilemap = tilemap_create(get_macrossp_scrb_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
158   macrossp_scrc_tilemap = tilemap_create(get_macrossp_scrc_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
159159
160160   tilemap_set_transparent_pen(macrossp_text_tilemap,0);
161161   tilemap_set_transparent_pen(macrossp_scra_tilemap,0);
src/mame/video/gladiatr.c
r814r815
3131         1,
3232         gladiatr_videoram[tile_index] + ((attr & 0x07) << 8) + (bg_tile_bank << 11),
3333         (attr >> 3) ^ 0x1f,
34         0)
34         0);
3535}
3636
3737static TILE_GET_INFO( fg_get_tile_info )
r814r815
4040         0,
4141         gladiatr_textram[tile_index] + (fg_tile_bank << 8),
4242         0,
43         0)
43         0);
4444}
4545
4646
r814r815
5353
5454VIDEO_START( ppking )
5555{
56   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,64);
57   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,64);
56   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,64);
57   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,64);
5858
5959   tilemap_set_transparent_pen(fg_tilemap,0);
6060
r814r815
6565
6666VIDEO_START( gladiatr )
6767{
68   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
69   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
68   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
69   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
7070
7171   tilemap_set_transparent_pen(fg_tilemap,0);
7272
r814r815
256256
257257   /* the fg layer just selects the upper palette bank on underlying pixels */
258258   {
259      mame_bitmap *transparency_bitmap;
259      mame_bitmap *flagsbitmap;
260260      int sx = cliprect->min_x;
261261      int sy = cliprect->min_y;
262262
263263      tilemap_get_pixmap( fg_tilemap );
264      transparency_bitmap = tilemap_get_transparency_bitmap( fg_tilemap );
264      flagsbitmap = tilemap_get_flagsmap( fg_tilemap );
265265
266266      while( sy <= cliprect->max_y )
267267      {
r814r815
271271         UINT16 *dest = BITMAP_ADDR16(bitmap, sy, sx);
272272         while( x <= cliprect->max_x )
273273         {
274            if( *BITMAP_ADDR8(transparency_bitmap, y, x)&TILE_FLAG_FG_OPAQUE )
274            if( *BITMAP_ADDR8(flagsbitmap, y, x)&TILEMAP_PIXEL_LAYER0 )
275275            {
276276               *dest += 512;
277277            }
src/mame/video/moo.c
r814r815
158158   alpha = (alpha_enabled) ? K054338_set_alpha_level(1) : 255;
159159
160160   if (alpha > 0)
161      K056832_tilemap_draw(machine, bitmap, cliprect, layers[2], (alpha >= 255) ? 0 : TILEMAP_ALPHA, 4);
161      K056832_tilemap_draw(machine, bitmap, cliprect, layers[2], (alpha >= 255) ? 0 : TILEMAP_DRAW_ALPHA, 4);
162162
163163   K053247_sprites_draw(machine, bitmap,cliprect);
164164
src/mame/video/goindol.c
r814r815
3434         0,
3535         code | ((attr & 0x7) << 8) | (goindol_char_bank << 11),
3636         (attr & 0xf8) >> 3,
37         0)
37         0);
3838}
3939
4040static TILE_GET_INFO( get_bg_tile_info )
r814r815
4545         1,
4646         code | ((attr & 0x7) << 8) | (goindol_char_bank << 11),
4747         (attr & 0xf8) >> 3,
48         0)
48         0);
4949}
5050
5151
r814r815
5858
5959VIDEO_START( goindol )
6060{
61   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,      8,8,32,32);
62   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
61   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      8,8,32,32);
62   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
6363
6464   tilemap_set_transparent_pen(fg_tilemap,0);
6565}
src/mame/video/taito_l.c
r814r815
3333         0,
3434         code,
3535         (attr & 0xf0) >> 4,
36         0)
36         0);
3737}
3838
3939static TILE_GET_INFO( get_bg19_tile_info )
r814r815
4848         0,
4949         code,
5050         (attr & 0xf0) >> 4,
51         0)
51         0);
5252}
5353
5454static TILE_GET_INFO( get_ch1a_tile_info )
r814r815
6060         2,
6161         code,
6262         (attr & 0xf0) >> 4,
63         0)
63         0);
6464}
6565
6666
r814r815
7575{
7676   int i;
7777
78   bg18_tilemap = tilemap_create(get_bg18_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
79   bg19_tilemap = tilemap_create(get_bg19_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,32);
80   ch1a_tilemap = tilemap_create(get_ch1a_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
78   bg18_tilemap = tilemap_create(get_bg18_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
79   bg19_tilemap = tilemap_create(get_bg19_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
80   ch1a_tilemap = tilemap_create(get_ch1a_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
8181
8282   bankc[0] = bankc[1] = bankc[2] = bankc[3] = 0;
8383   horshoes_gfxbank = 0;
src/mame/video/fastlane.c
r814r815
4747         0,
4848         code+bank*256,
4949         1 + 64 * (attr & 0x0f),
50         0)
50         0);
5151}
5252
5353static TILE_GET_INFO( get_tile_info1 )
r814r815
7272         0,
7373         code+bank*256,
7474         0 + 64 * (attr & 0x0f),
75         0)
75         0);
7676}
7777
7878/***************************************************************************
r814r815
8383
8484VIDEO_START( fastlane )
8585{
86   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
87   layer1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
86   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
87   layer1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
8888
8989   tilemap_set_scroll_rows( layer0, 32 );
9090
src/mame/video/cabal.c
r814r815
2222         1,
2323         tile,
2424         color,
25         0)
25         0);
2626}
2727
2828static TILE_GET_INFO( get_text_tile_info )
r814r815
3636         0,
3737         tile,
3838         color,
39         0)
39         0);
4040}
4141
4242
4343VIDEO_START( cabal )
4444{
45   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,16,16);
46   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,8,32,32);
45   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,16);
46   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,32,32);
4747
4848   tilemap_set_transparent_pen(text_layer,3);
4949   tilemap_set_transparent_pen(background_layer,15);
r814r815
140140
141141VIDEO_UPDATE( cabal )
142142{
143   tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_IGNORE_TRANSPARENCY,0);
143   tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_DRAW_OPAQUE,0);
144144   draw_sprites(machine,bitmap,cliprect);
145145   tilemap_draw(bitmap,cliprect,text_layer,0,0);
146146   return 0;
src/mame/video/suprloco.c
r814r815
8383         0,
8484         suprloco_videoram[2*tile_index] | ((attr & 0x03) << 8),
8585         (attr & 0x1c) >> 2,
86         0)
87   tileinfo->priority = (attr & 0x20) >> 5;
86         0);
87   tileinfo->category = (attr & 0x20) >> 5;
8888}
8989
9090
r814r815
9797
9898VIDEO_START( suprloco )
9999{
100   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
100   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
101101
102102   tilemap_set_scroll_rows(bg_tilemap,32);
103103}
src/mame/video/m92.c
r814r815
150150         0,
151151         tile,
152152         color&0x7f,
153         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1) | TILE_SPLIT(pri))
153         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1));
154   tileinfo->group = pri;
154155}
155156
156157static TILE_GET_INFO( get_pf2_tile_info )
r814r815
168169         0,
169170         tile,
170171         color&0x7f,
171         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1) | TILE_SPLIT(pri))
172         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1));
173   tileinfo->group = pri;
172174}
173175
174176static TILE_GET_INFO( get_pf3_tile_info )
r814r815
185187         0,
186188         tile,
187189         color&0x7f,
188         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1) | TILE_SPLIT(pri))
190         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1));
191   tileinfo->group = pri;
189192}
190193
191194static TILE_GET_INFO( get_pf1_wide_tile_info )
r814r815
203206         0,
204207         tile,
205208         color&0x7f,
206         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1) | TILE_SPLIT(pri))
209         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1));
210   tileinfo->group = pri;
207211}
208212
209213static TILE_GET_INFO( get_pf3_wide_tile_info )
r814r815
221225         0,
222226         tile,
223227         color&0x7f,
224         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1) | TILE_SPLIT(pri))
228         TILE_FLIPYX((m92_vram_data[tile_index+3] & 0x6)>>1));
229   tileinfo->group = pri;
225230}
226231
227232/*****************************************************************************/
r814r815
349354{
350355   pf1_layer = tilemap_create(
351356      get_pf1_tile_info,tilemap_scan_rows,
352      TILEMAP_TYPE_SPLIT,
357      TILEMAP_TYPE_PEN,
353358      8,8,
354359      64,64
355360   );
356361
357362   pf2_layer = tilemap_create(
358363      get_pf2_tile_info,tilemap_scan_rows,
359      TILEMAP_TYPE_SPLIT,
364      TILEMAP_TYPE_PEN,
360365      8,8,
361366      64,64
362367   );
363368
364369   pf3_layer = tilemap_create(
365370      get_pf3_tile_info,tilemap_scan_rows,
366      TILEMAP_TYPE_SPLIT,
371      TILEMAP_TYPE_PEN,
367372      8,8,
368373      64,64
369374   );
370375
371376   pf1_wide_layer = tilemap_create(
372377      get_pf1_wide_tile_info,tilemap_scan_rows,
373      TILEMAP_TYPE_SPLIT,
378      TILEMAP_TYPE_PEN,
374379      8,8,
375380      128,64
376381   );
377382
378383   pf3_wide_layer = tilemap_create(
379384      get_pf3_wide_tile_info,tilemap_scan_rows,
380      TILEMAP_TYPE_SPLIT,
385      TILEMAP_TYPE_PEN,
381386      8,8,
382387      128,64
383388   );
r814r815
600605   fillbitmap(priority_bitmap,0,cliprect);
601606
602607   if (pf3_enable) {
603      tilemap_draw(bitmap,cliprect,pf3_wide_layer,TILEMAP_BACK,0);
604      tilemap_draw(bitmap,cliprect,pf3_layer,      TILEMAP_BACK,0);
608      tilemap_draw(bitmap,cliprect,pf3_wide_layer,TILEMAP_DRAW_LAYER1,0);
609      tilemap_draw(bitmap,cliprect,pf3_layer,      TILEMAP_DRAW_LAYER1,0);
605610   }
606611   else
607612      fillbitmap(bitmap,machine->pens[0],cliprect);
608613
609   tilemap_draw(bitmap,cliprect,pf3_wide_layer,TILEMAP_FRONT,1);
610   tilemap_draw(bitmap,cliprect,pf3_layer,      TILEMAP_FRONT,1);
614   tilemap_draw(bitmap,cliprect,pf3_wide_layer,TILEMAP_DRAW_LAYER0,1);
615   tilemap_draw(bitmap,cliprect,pf3_layer,      TILEMAP_DRAW_LAYER0,1);
611616
612   tilemap_draw(bitmap,cliprect,pf2_layer,      TILEMAP_BACK, 0);
613   tilemap_draw(bitmap,cliprect,pf2_layer,      TILEMAP_FRONT,1);
617   tilemap_draw(bitmap,cliprect,pf2_layer,      TILEMAP_DRAW_LAYER1, 0);
618   tilemap_draw(bitmap,cliprect,pf2_layer,      TILEMAP_DRAW_LAYER0,1);
614619
615   tilemap_draw(bitmap,cliprect,pf1_wide_layer,TILEMAP_BACK, 0);
616   tilemap_draw(bitmap,cliprect,pf1_layer,      TILEMAP_BACK, 0);
617   tilemap_draw(bitmap,cliprect,pf1_wide_layer,TILEMAP_FRONT,1);
618   tilemap_draw(bitmap,cliprect,pf1_layer,      TILEMAP_FRONT,1);
620   tilemap_draw(bitmap,cliprect,pf1_wide_layer,TILEMAP_DRAW_LAYER1, 0);
621   tilemap_draw(bitmap,cliprect,pf1_layer,      TILEMAP_DRAW_LAYER1, 0);
622   tilemap_draw(bitmap,cliprect,pf1_wide_layer,TILEMAP_DRAW_LAYER0,1);
623   tilemap_draw(bitmap,cliprect,pf1_layer,      TILEMAP_DRAW_LAYER0,1);
619624
620625   draw_sprites(machine,bitmap,cliprect);
621626}
src/mame/video/vendetta.c
r814r815
115115   sortlayers(layer,layerpri);
116116
117117   fillbitmap(priority_bitmap,0,cliprect);
118   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],TILEMAP_IGNORE_TRANSPARENCY,1);
118   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],TILEMAP_DRAW_OPAQUE,1);
119119   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[1]],0,2);
120120   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[2]],0,4);
121121
src/mame/video/fcombat.c
r814r815
2929
3030   tileno = memory_region(REGION_USER1)[tile_index];
3131   palno=0x18;//memory_region(REGION_USER2)[tile_index]>>3;
32   SET_TILE_INFO(2,tileno,palno,0)
32   SET_TILE_INFO(2,tileno,palno,0);
3333}
3434
3535UINT8 fcombat_cocktail_flip;
r814r815
115115
116116VIDEO_START( fcombat )
117117{
118   bgmap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 16, 16,32*8*2,32);
118   bgmap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32*8*2,32);
119119   video_start_generic(machine);
120120}
121121
src/mame/video/segas16b.c
r814r815
6161   fillbitmap(priority_bitmap, 0, cliprect);
6262
6363   /* draw background opaquely first, not setting any priorities */
64   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_IGNORE_TRANSPARENCY, 0x00);
65   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_IGNORE_TRANSPARENCY, 0x00);
64   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
65   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
6666
6767   /* draw background again, just to set the priorities on non-transparent pixels */
6868   segaic16_tilemap_draw(machine, 0, NULL, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
src/mame/video/thoop2.c
r814r815
4949   int data2 = thoop2_videoram[(tile_index << 1) + 1];
5050   int code = ((data & 0xfffc) >> 2) | ((data & 0x0003) << 14);
5151
52   tileinfo->priority = (data2 >> 6) & 0x03;
52   tileinfo->category = (data2 >> 6) & 0x03;
5353
54   SET_TILE_INFO(1, code, data2 & 0x3f, TILE_FLIPYX((data2 >> 14) & 0x03))
54   SET_TILE_INFO(1, code, data2 & 0x3f, TILE_FLIPYX((data2 >> 14) & 0x03));
5555}
5656
5757
r814r815
6161   int data2 = thoop2_videoram[(0x1000/2) + (tile_index << 1) + 1];
6262   int code = ((data & 0xfffc) >> 2) | ((data & 0x0003) << 14);
6363
64   tileinfo->priority = (data2 >> 6) & 0x03;
64   tileinfo->category = (data2 >> 6) & 0x03;
6565
66   SET_TILE_INFO(1, code, data2 & 0x3f, TILE_FLIPYX((data2 >> 14) & 0x03))
66   SET_TILE_INFO(1, code, data2 & 0x3f, TILE_FLIPYX((data2 >> 14) & 0x03));
6767}
6868
6969/***************************************************************************
r814r815
8888{
8989   int i;
9090
91   pant[0] = tilemap_create(get_tile_info_thoop2_screen0,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
92   pant[1] = tilemap_create(get_tile_info_thoop2_screen1,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
91   pant[0] = tilemap_create(get_tile_info_thoop2_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
92   pant[1] = tilemap_create(get_tile_info_thoop2_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
9393
9494   tilemap_set_transmask(pant[0],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
9595   tilemap_set_transmask(pant[1],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
r814r815
213213
214214   fillbitmap( bitmap, machine->pens[0], cliprect );
215215
216   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_BACK | 3,0);
217   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_BACK | 3,0);
216   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 3,0);
217   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 3,0);
218218   draw_sprites(machine, bitmap,cliprect,3);
219   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_FRONT | 3,0);
220   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_FRONT | 3,0);
219   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER0 | 3,0);
220   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER0 | 3,0);
221221
222   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_BACK | 2,0);
223   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_BACK | 2,0);
222   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 2,0);
223   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 2,0);
224224   draw_sprites(machine, bitmap,cliprect,2);
225   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_FRONT | 2,0);
226   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_FRONT | 2,0);
225   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER0 | 2,0);
226   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER0 | 2,0);
227227
228   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_BACK | 1,0);
229   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_BACK | 1,0);
228   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 1,0);
229   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 1,0);
230230   draw_sprites(machine, bitmap,cliprect,1);
231   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_FRONT | 1,0);
232   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_FRONT | 1,0);
231   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER0 | 1,0);
232   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER0 | 1,0);
233233
234   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_BACK | 0,0);
235   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_BACK | 0,0);
234   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 0,0);
235   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 0,0);
236236   draw_sprites(machine, bitmap,cliprect,0);
237   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_FRONT | 0,0);
238   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_FRONT | 0,0);
237   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER0 | 0,0);
238   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER0 | 0,0);
239239
240240   draw_sprites(machine, bitmap,cliprect,4);
241241   return 0;
src/mame/video/wwfwfest.c
r814r815
7878         0,
7979         tileno,
8080         colbank,
81         0)
81         0);
8282}
8383
8484static TILE_GET_INFO( get_bg0_tile_info )
r814r815
108108         2,
109109         tileno,
110110         colbank,
111         TILE_FLIPYX((tilebase[0] & 0x00c0) >> 6))
111         TILE_FLIPYX((tilebase[0] & 0x00c0) >> 6));
112112}
113113
114114static TILE_GET_INFO( get_bg1_tile_info )
r814r815
134134         3,
135135         tileno,
136136         colbank,
137         0)
137         0);
138138}
139139
140140/*******************************************************************************
r814r815
224224
225225VIDEO_START( wwfwfest )
226226{
227   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
228   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
229   bg0_tilemap = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
227   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
228   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
229   bg0_tilemap = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
230230
231231   tilemap_set_transparent_pen(fg0_tilemap,0);
232232   tilemap_set_transparent_pen(bg1_tilemap,0);
r814r815
261261   /* todo : which bits of pri are significant to the order */
262262
263263   if (wwfwfest_pri == 0x007b) {
264      tilemap_draw(bitmap,cliprect,bg0_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
264      tilemap_draw(bitmap,cliprect,bg0_tilemap,TILEMAP_DRAW_OPAQUE,0);
265265      tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0);
266266      draw_sprites(machine, bitmap,cliprect);
267267      tilemap_draw(bitmap,cliprect,fg0_tilemap,0,0);
268268   }
269269
270270   if (wwfwfest_pri == 0x007c) {
271      tilemap_draw(bitmap,cliprect,bg0_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
271      tilemap_draw(bitmap,cliprect,bg0_tilemap,TILEMAP_DRAW_OPAQUE,0);
272272      draw_sprites(machine, bitmap,cliprect);
273273      tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0);
274274      tilemap_draw(bitmap,cliprect,fg0_tilemap,0,0);
275275   }
276276
277277   if (wwfwfest_pri == 0x0078) {
278      tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
278      tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_DRAW_OPAQUE,0);
279279      tilemap_draw(bitmap,cliprect,bg0_tilemap,0,0);
280280      draw_sprites(machine, bitmap,cliprect);
281281      tilemap_draw(bitmap,cliprect,fg0_tilemap,0,0);
src/mame/video/marineb.c
r814r815
4949
5050VIDEO_START( marineb )
5151{
52   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
52   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
5353
5454   tilemap_set_scroll_cols(bg_tilemap, 32);
5555}
src/mame/video/timeplt.c
r814r815
9696static TILE_GET_INFO( get_tile_info )
9797{
9898   UINT8 attr = timeplt_colorram[tile_index];
99   tileinfo->priority = (attr & 0x10) >> 4;
99   tileinfo->category = (attr & 0x10) >> 4;
100100   SET_TILE_INFO(
101101         0,
102102         timeplt_videoram[tile_index] + ((attr & 0x20) << 3),
103103         attr & 0x1f,
104         TILE_FLIPYX((attr & 0xc0) >> 6))
104         TILE_FLIPYX((attr & 0xc0) >> 6));
105105}
106106
107107
r814r815
114114
115115VIDEO_START( timeplt )
116116{
117   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
117   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
118118
119119   sprite_mux_buffer = auto_malloc(256 * spriteram_size);
120120   sprite_mux_buffer_2 = auto_malloc(256 * spriteram_size);
src/mame/video/atarigx2.c
r814r815
6363   int code = data & 0xfff;
6464   int color = (data >> 12) & 0x0f;
6565   int opaque = data & 0x8000;
66   SET_TILE_INFO(1, code, color, opaque ? TILE_IGNORE_TRANSPARENCY : 0);
66   SET_TILE_INFO(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0);
6767}
6868
6969
r814r815
7373   int code = (playfield_tile_bank << 12) | (data & 0xfff);
7474   int color = (atarigx2_playfield_base >> 5) + ((playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7);
7575   SET_TILE_INFO(0, code, color, (data >> 15) & 1);
76   tileinfo->priority = (playfield_color_bank >> 2) & 7;
76   tileinfo->category = (playfield_color_bank >> 2) & 7;
7777}
7878
7979
80static UINT32 atarigx2_playfield_scan(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
80static TILEMAP_MAPPER( atarigx2_playfield_scan )
8181{
8282   int bank = 1 - (col / (num_cols / 2));
8383   return bank * (num_rows * num_cols / 2) + row * (num_cols / 2) + (col % (num_cols / 2));
r814r815
120120   atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
121121
122122   /* initialize the playfield */
123   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigx2_playfield_scan, TILEMAP_TYPE_OPAQUE, 8,8, 128,64);
123   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigx2_playfield_scan, TILEMAP_TYPE_PEN, 8,8, 128,64);
124124
125125   /* initialize the motion objects */
126126   adjusted_modesc.palettebase = atarigx2_motion_object_base;
r814r815
129129   atarirle_init(0, &adjusted_modesc);
130130
131131   /* initialize the alphanumerics */
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,32);
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
133133   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
134134
135135   /* reset statics */
src/mame/video/fuukifg2.c
r814r815
5858{ \
5959   UINT16 code = fuuki16_vram_##_N_[ 2 * tile_index + 0 ]; \
6060   UINT16 attr = fuuki16_vram_##_N_[ 2 * tile_index + 1 ]; \
61   SET_TILE_INFO(1 + _N_, code, attr & 0x3f,TILE_FLIPYX( (attr >> 6) & 3 )) \
61   SET_TILE_INFO(1 + _N_, code, attr & 0x3f,TILE_FLIPYX( (attr >> 6) & 3 )); \
6262} \
6363\
6464WRITE16_HANDLER( fuuki16_vram_##_N_##_w ) \
r814r815
9797VIDEO_START( fuuki16 )
9898{
9999   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
100                        TILEMAP_TYPE_TRANSPARENT, 16, 16, 64,32);
100                        TILEMAP_TYPE_PEN, 16, 16, 64,32);
101101
102102   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
103                        TILEMAP_TYPE_TRANSPARENT, 16, 16, 64,32);
103                        TILEMAP_TYPE_PEN, 16, 16, 64,32);
104104
105105   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
106                        TILEMAP_TYPE_TRANSPARENT,  8,  8, 64,32);
106                        TILEMAP_TYPE_PEN,  8,  8, 64,32);
107107
108108   tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
109                        TILEMAP_TYPE_TRANSPARENT,  8,  8, 64,32);
109                        TILEMAP_TYPE_PEN,  8,  8, 64,32);
110110
111111   tilemap_set_transparent_pen(tilemap_0,0x0f);   // 4 bits
112112   tilemap_set_transparent_pen(tilemap_1,0xff);   // 8 bits
r814r815
337337   /* The backmost tilemap decides the background color(s) but sprites can
338338       go below the opaque pixels of that tilemap. We thus need to mark the
339339       transparent pixels of this layer with a different priority value */
340//  fuuki16_draw_layer(bitmap,cliprect, tm_back,  TILEMAP_IGNORE_TRANSPARENCY, 0);
340//  fuuki16_draw_layer(bitmap,cliprect, tm_back,  TILEMAP_DRAW_OPAQUE, 0);
341341
342342   /* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */
343343   fillbitmap(bitmap,(0x800*4)-1,cliprect);
src/mame/video/vulgus.c
r814r815
9595         0,
9696         code + ((color & 0x80) << 1),
9797         color & 0x3f,
98         0)
98         0);
9999}
100100
101101static TILE_GET_INFO( get_bg_tile_info )
r814r815
108108         1,
109109         code + ((color & 0x80) << 1),
110110         (color & 0x1f) + (0x20 * vulgus_palette_bank),
111         TILE_FLIPYX((color & 0x60) >> 5))
111         TILE_FLIPYX((color & 0x60) >> 5));
112112}
113113
114114
r814r815
120120
121121VIDEO_START( vulgus )
122122{
123   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT_COLOR, 8, 8,32,32);
124   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE           ,16,16,32,32);
123   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_COLORTABLE, 8, 8,32,32);
124   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN           ,16,16,32,32);
125125
126126   tilemap_set_transparent_pen(fg_tilemap,47);
127127}
src/mame/video/sderby.c
r814r815
1818   tileno = sderby_videoram[tile_index*2];
1919   colour = sderby_videoram[tile_index*2+1] & 0x0f;
2020
21   SET_TILE_INFO(1,tileno,colour,0)
21   SET_TILE_INFO(1,tileno,colour,0);
2222}
2323
2424WRITE16_HANDLER( sderby_videoram_w )
r814r815
3636   tileno = sderby_md_videoram[tile_index*2];
3737   colour = sderby_md_videoram[tile_index*2+1] & 0x0f;
3838
39   SET_TILE_INFO(1,tileno,colour+16,0)
39   SET_TILE_INFO(1,tileno,colour+16,0);
4040}
4141
4242WRITE16_HANDLER( sderby_md_videoram_w )
r814r815
5454   tileno = sderby_fg_videoram[tile_index*2];
5555   colour = sderby_fg_videoram[tile_index*2+1] & 0x0f;
5656
57   SET_TILE_INFO(0,tileno,colour+32,0)
57   SET_TILE_INFO(0,tileno,colour+32,0);
5858}
5959
6060WRITE16_HANDLER( sderby_fg_videoram_w )
r814r815
9595
9696VIDEO_START( sderby )
9797{
98   sderby_tilemap = tilemap_create(get_sderby_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 16, 16,32,32);
99   sderby_md_tilemap = tilemap_create(get_sderby_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,32,32);
98   sderby_tilemap = tilemap_create(get_sderby_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
99   sderby_md_tilemap = tilemap_create(get_sderby_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
100100
101101   tilemap_set_transparent_pen(sderby_md_tilemap,0);
102102
103   sderby_fg_tilemap = tilemap_create(get_sderby_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
103   sderby_fg_tilemap = tilemap_create(get_sderby_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
104104   tilemap_set_transparent_pen(sderby_fg_tilemap,0);
105105}
106106
src/mame/video/circus.c
r814r815
4242{
4343   int code = videoram[tile_index];
4444
45   SET_TILE_INFO(0, code, 0, 0)
45   SET_TILE_INFO(0, code, 0, 0);
4646}
4747
4848VIDEO_START( circus )
4949{
5050   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
51      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
51      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
5252}
5353
5454static void draw_line(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int x1, int y1, int x2, int y2, int dotted)
src/mame/video/zac2650.c
r814r815
134134{
135135   int code = videoram[tile_index];
136136
137   SET_TILE_INFO(0, code, 0, 0)
137   SET_TILE_INFO(0, code, 0, 0);
138138}
139139
140140VIDEO_START( tinvader )
141141{
142142   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
143      TILEMAP_TYPE_OPAQUE, 24, 24, 32, 32);
143      TILEMAP_TYPE_PEN, 24, 24, 32, 32);
144144
145145   spritebitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
146146   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
src/mame/video/vastar.c
r814r815
3434         0,
3535         code,
3636         color & 0x3f,
37         0)
37         0);
3838}
3939
4040static TILE_GET_INFO( get_bg1_tile_info )
r814r815
4747         4,
4848         code,
4949         color & 0x3f,
50         0)
50         0);
5151}
5252
5353static TILE_GET_INFO( get_bg2_tile_info )
r814r815
6060         3,
6161         code,
6262         color & 0x3f,
63         0)
63         0);
6464}
6565
6666
r814r815
7272
7373VIDEO_START( vastar )
7474{
75   fg_tilemap  = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
76   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
77   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
75   fg_tilemap  = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
76   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
77   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
7878
7979   tilemap_set_transparent_pen(fg_tilemap,0);
8080   tilemap_set_transparent_pen(bg1_tilemap,0);
r814r815
200200   switch (*vastar_sprite_priority)
201201   {
202202   case 0:
203      tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_IGNORE_TRANSPARENCY,0);
203      tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_DRAW_OPAQUE,0);
204204      draw_sprites(machine, bitmap,cliprect);
205205      tilemap_draw(bitmap,cliprect, bg2_tilemap, 0,0);
206206      tilemap_draw(bitmap,cliprect, fg_tilemap, 0,0);
207207      break;
208208
209209   case 2:
210      tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_IGNORE_TRANSPARENCY,0);
210      tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_DRAW_OPAQUE,0);
211211      draw_sprites(machine, bitmap,cliprect);
212212      tilemap_draw(bitmap,cliprect, bg1_tilemap, 0,0);
213213      tilemap_draw(bitmap,cliprect, bg2_tilemap, 0,0);
r814r815
215215      break;
216216
217217   case 3:
218      tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_IGNORE_TRANSPARENCY,0);
218      tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_DRAW_OPAQUE,0);
219219      tilemap_draw(bitmap,cliprect, bg2_tilemap, 0,0);
220220      tilemap_draw(bitmap,cliprect, fg_tilemap, 0,0);
221221      draw_sprites(machine, bitmap,cliprect);
src/mame/video/taotaido.c
r814r815
180180         1,
181181         code,
182182         col,
183         0)
183         0);
184184}
185185
186UINT32 taotaido_tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
186static TILEMAP_MAPPER( taotaido_tilemap_scan_rows )
187187{
188188   /* logical (col,row) -> memory offset */
189189   return row*0x40 + (col&0x3f) + ((col&0x40)<<6);
r814r815
191191
192192VIDEO_START(taotaido)
193193{
194   bg_tilemap = tilemap_create(taotaido_bg_tile_info,taotaido_tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,128,64);
194   bg_tilemap = tilemap_create(taotaido_bg_tile_info,taotaido_tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,128,64);
195195
196196   taotaido_spriteram_old = auto_malloc(0x2000);
197197   taotaido_spriteram_older = auto_malloc(0x2000);
src/mame/video/relief.c
r814r815
8686   atarigen_blend_gfx(machine, 1, 2, 0x0f, 0x10);
8787
8888   /* initialize the playfield */
89   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 8,8, 64,64);
89   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
9090
9191   /* initialize the second playfield */
92   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_TRANSPARENT, 8,8, 64,64);
92   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
9393   tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0);
9494
9595   /* initialize the motion objects */
src/mame/video/taito_f3.c
r814r815
447447         1,
448448         tile&0xffff,
449449         (tile>>16)&0x1ff,
450         TILE_FLIPYX( tile >> 30 ))
451   tileinfo->priority =  abtype&1;      /* alpha blending type */
450         TILE_FLIPYX( tile >> 30 ));
451   tileinfo->category =  abtype&1;      /* alpha blending type */
452452}
453453
454454static TILE_GET_INFO( get_tile_info1 )
r814r815
488488         0,
489489         vram_tile&0xff,
490490         (vram_tile>>9)&0x3f,
491         flags)
491         flags);
492492}
493493
494494static TILE_GET_INFO( get_tile_info_pixel )
r814r815
516516         3,
517517         tile_index,
518518         (vram_tile>>9)&0x3f,
519         flags)
519         flags);
520520}
521521
522522/******************************************************************************/
r814r815
565565   f3_game_config=pCFG;
566566
567567   if (f3_game_config->extend) {
568      pf1_tilemap = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
569      pf2_tilemap = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
570      pf3_tilemap = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
571      pf4_tilemap = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
568      pf1_tilemap = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
569      pf2_tilemap = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
570      pf3_tilemap = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
571      pf4_tilemap = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
572572
573573      f3_pf_data_1=f3_pf_data+0x0000;
574574      f3_pf_data_2=f3_pf_data+0x0800;
r814r815
580580      twidth_mask_bit=6;
581581
582582   } else {
583      pf1_tilemap = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
584      pf2_tilemap = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
585      pf3_tilemap = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
586      pf4_tilemap = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
583      pf1_tilemap = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
584      pf2_tilemap = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
585      pf3_tilemap = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
586      pf4_tilemap = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
587587
588588      f3_pf_data_1=f3_pf_data+0x0000;
589589      f3_pf_data_2=f3_pf_data+0x0400;
r814r815
598598   spriteram32_buffered = (UINT32 *)auto_malloc(0x10000);
599599   spritelist = auto_malloc(0x400 * sizeof(*spritelist));
600600   sprite_end = spritelist;
601   vram_layer = tilemap_create(get_tile_info_vram,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
602   pixel_layer = tilemap_create(get_tile_info_pixel,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
601   vram_layer = tilemap_create(get_tile_info_vram,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
602   pixel_layer = tilemap_create(get_tile_info_pixel,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
603603   pivot_dirty = (UINT8 *)auto_malloc(2048);
604604   pf_line_inf = auto_malloc(5 * sizeof(struct f3_playfield_line_inf));
605605   sa_line_inf = auto_malloc(1 * sizeof(struct f3_spritealpha_line_inf));
r814r815
18691869{
18701870   struct f3_playfield_line_inf *line_t=&pf_line_inf[pos];
18711871   const mame_bitmap *srcbitmap;
1872   const mame_bitmap *transbitmap;
1872   const mame_bitmap *flagsbitmap;
18731873
18741874   int y,y_start,y_end,y_inc;
18751875   int line_base,zoom_base,col_base,pri_base,inc;
r814r815
20472047
20482048   /* set pixmap pointer */
20492049   srcbitmap = tilemap_get_pixmap(tmap);
2050   transbitmap = tilemap_get_transparency_bitmap(tmap);
2050   flagsbitmap = tilemap_get_flagsmap(tmap);
20512051
20522052   y=y_start;
20532053   while(y!=y_end)
r814r815
20762076         line_t->src_e[y]=&src_s[width_mask+1];
20772077         line_t->src[y]=&src_s[x_index_fx>>16];
20782078
2079         line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(transbitmap, y_index, 0);
2079         line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap, y_index, 0);
20802080         line_t->tsrc[y]=&tsrc_s[x_index_fx>>16];
20812081      }
20822082
r814r815
20902090   const struct f3_spritealpha_line_inf *sprite_alpha_line_t=&sa_line_inf[0];
20912091   struct f3_playfield_line_inf *line_t=&pf_line_inf[4];
20922092   const mame_bitmap *srcbitmap_pixel, *srcbitmap_vram;
2093   const mame_bitmap *transbitmap_pixel, *transbitmap_vram;
2093   const mame_bitmap *flagsbitmap_pixel, *flagsbitmap_vram;
20942094
20952095   int y,y_start,y_end,y_inc;
20962096   int pri_base,inc;
r814r815
21742174
21752175   /* set pixmap pointer */
21762176   srcbitmap_pixel = tilemap_get_pixmap(pixel_tilemap);
2177   transbitmap_pixel = tilemap_get_transparency_bitmap(pixel_tilemap);
2177   flagsbitmap_pixel = tilemap_get_flagsmap(pixel_tilemap);
21782178   srcbitmap_vram = tilemap_get_pixmap(vram_tilemap);
2179   transbitmap_vram = tilemap_get_transparency_bitmap(vram_tilemap);
2179   flagsbitmap_vram = tilemap_get_flagsmap(vram_tilemap);
21802180
21812181   y=y_start;
21822182   while(y!=y_end)
r814r815
22002200         line_t->src[y]=&src_s[sx];
22012201
22022202         if (usePixelLayer)
2203            line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(transbitmap_pixel, sy&0xff, 0);
2203            line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap_pixel, sy&0xff, 0);
22042204         else
2205            line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(transbitmap_vram, sy&0x1ff, 0);
2205            line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap_vram, sy&0x1ff, 0);
22062206         line_t->tsrc[y]=&tsrc_s[sx];
22072207      }
22082208
src/mame/video/gaelco2.c
r814r815
113113   int data2 = gaelco2_videoram[(((gaelco2_vregs[0] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)];
114114   int code = ((data & 0x07) << 16) | (data2 & 0xffff);
115115
116   SET_TILE_INFO(0, code, ((data >> 9) & 0x7f), TILE_FLIPXY((data >> 6) & 0x03))
116   SET_TILE_INFO(0, code, ((data >> 9) & 0x7f), TILE_FLIPXY((data >> 6) & 0x03));
117117}
118118
119119static TILE_GET_INFO( get_tile_info_gaelco2_screen1 )
r814r815
122122   int data2 = gaelco2_videoram[(((gaelco2_vregs[1] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)];
123123   int code = ((data & 0x07) << 16) | (data2 & 0xffff);
124124
125   SET_TILE_INFO(0, code, ((data >> 9) & 0x7f), TILE_FLIPXY((data >> 6) & 0x03))
125   SET_TILE_INFO(0, code, ((data >> 9) & 0x7f), TILE_FLIPXY((data >> 6) & 0x03));
126126}
127127
128128
r814r815
154154   int data2 = gaelco2_videoram[(((gaelco2_vregs[0] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)];
155155   int code = ((data & 0x07) << 16) | (data2 & 0xffff);
156156
157   SET_TILE_INFO(0, code, ((data >> 9) & 0x3f), TILE_FLIPXY((data >> 6) & 0x03))
157   SET_TILE_INFO(0, code, ((data >> 9) & 0x3f), TILE_FLIPXY((data >> 6) & 0x03));
158158}
159159
160160static TILE_GET_INFO( get_tile_info_gaelco2_screen1_dual )
r814r815
163163   int data2 = gaelco2_videoram[(((gaelco2_vregs[1] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)];
164164   int code = ((data & 0x07) << 16) | (data2 & 0xffff);
165165
166   SET_TILE_INFO(0, code, 0x40 + ((data >> 9) & 0x3f), TILE_FLIPXY((data >> 6) & 0x03))
166   SET_TILE_INFO(0, code, 0x40 + ((data >> 9) & 0x3f), TILE_FLIPXY((data >> 6) & 0x03));
167167}
168168
169169
r814r815
267267   gaelco2_videoram = spriteram16;
268268
269269   /* create tilemaps */
270   pant[0] = tilemap_create(get_tile_info_gaelco2_screen0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
271   pant[1] = tilemap_create(get_tile_info_gaelco2_screen1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
270   pant[0] = tilemap_create(get_tile_info_gaelco2_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
271   pant[1] = tilemap_create(get_tile_info_gaelco2_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
272272
273273   /* set tilemap properties */
274274   tilemap_set_transparent_pen(pant[0],0);
r814r815
287287   gaelco2_videoram = spriteram16;
288288
289289   /* create tilemaps */
290   pant[0] = tilemap_create(get_tile_info_gaelco2_screen0_dual,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
291   pant[1] = tilemap_create(get_tile_info_gaelco2_screen1_dual,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
290   pant[0] = tilemap_create(get_tile_info_gaelco2_screen0_dual,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
291   pant[1] = tilemap_create(get_tile_info_gaelco2_screen1_dual,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
292292
293293   /* set tilemap properties */
294294   tilemap_set_transparent_pen(pant[0],0);
src/mame/video/homerun.c
r814r815
5555   int tileno,palno;
5656   tileno = (homerun_videoram[tile_index])+((homerun_videoram[tile_index+0x1000]&0x38)<<5)+ ((homerun_gfx_ctrl&1)<<11);
5757   palno=(homerun_videoram[tile_index+0x1000]&0x7);
58   SET_TILE_INFO(0,tileno,palno,0)
58   SET_TILE_INFO(0,tileno,palno,0);
5959}
6060
6161
6262
6363VIDEO_START(homerun)
6464{
65   homerun_tilemap = tilemap_create(get_homerun_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,64,64);
65   homerun_tilemap = tilemap_create(get_homerun_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
6666}
6767
6868static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/champbas.c
r814r815
111111   int code = videoram[tile_index];
112112   int color = (colorram[tile_index] & 0x1f) + 32;
113113
114   SET_TILE_INFO(gfxbank, code, color, 0)
114   SET_TILE_INFO(gfxbank, code, color, 0);
115115}
116116
117117VIDEO_START( champbas )
118118{
119119   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
120      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
120      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
121121}
122122
123123static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/baraduke.c
r814r815
6262***************************************************************************/
6363
6464/* convert from 32x32 to 36x28 */
65static UINT32 tx_tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
65static TILEMAP_MAPPER( tx_tilemap_scan )
6666{
6767   int offs;
6868
r814r815
8282         0,
8383         baraduke_textram[tile_index],
8484         (baraduke_textram[tile_index+0x400] << 2) & 0x1ff,
85         0)
85         0);
8686}
8787
8888static TILE_GET_INFO( get_tile_info0 )
r814r815
9494         1,
9595         code + ((attr & 0x03) << 8),
9696         attr,
97         0)
97         0);
9898}
9999
100100static TILE_GET_INFO( get_tile_info1 )
r814r815
106106         2,
107107         code + ((attr & 0x03) << 8),
108108         attr,
109         0)
109         0);
110110}
111111
112112
r814r815
119119
120120VIDEO_START( baraduke )
121121{
122   tx_tilemap = tilemap_create(tx_get_tile_info,tx_tilemap_scan,TILEMAP_TYPE_TRANSPARENT,8,8,36,28);
123   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
124   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
122   tx_tilemap = tilemap_create(tx_get_tile_info,tx_tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
123   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
124   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
125125
126126   tilemap_set_transparent_pen(tx_tilemap,3);
127127   tilemap_set_transparent_pen(bg_tilemap[0],7);
r814r815
323323   else
324324      back = 0;
325325
326   tilemap_draw(bitmap,cliprect,bg_tilemap[back],TILEMAP_IGNORE_TRANSPARENCY,0);
326   tilemap_draw(bitmap,cliprect,bg_tilemap[back],TILEMAP_DRAW_OPAQUE,0);
327327   draw_sprites(machine, bitmap,cliprect,0);
328328   tilemap_draw(bitmap,cliprect,bg_tilemap[back ^ 1],0,0);
329329   draw_sprites(machine, bitmap,cliprect,1);
src/mame/video/ssozumo.c
r814r815
117117   int color = (colorram[tile_index] & 0x30) >> 4;
118118   int flags = ((tile_index % 32) >= 16) ? TILE_FLIPY : 0;
119119
120   SET_TILE_INFO(1, code, color, flags)
120   SET_TILE_INFO(1, code, color, flags);
121121}
122122
123123static TILE_GET_INFO( get_fg_tile_info )
r814r815
125125   int code = ssozumo_videoram2[tile_index] + 256 * (ssozumo_colorram2[tile_index] & 0x07);
126126   int color = (ssozumo_colorram2[tile_index] & 0x30) >> 4;
127127
128   SET_TILE_INFO(0, code, color, 0)
128   SET_TILE_INFO(0, code, color, 0);
129129}
130130
131131VIDEO_START( ssozumo )
132132{
133133   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x,
134      TILEMAP_TYPE_OPAQUE, 16, 16, 16, 32);
134      TILEMAP_TYPE_PEN, 16, 16, 16, 32);
135135
136136   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x,
137      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
137      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
138138
139139   tilemap_set_transparent_pen(fg_tilemap, 0);
140140}
src/mame/video/mcr.c
r814r815
3131   SET_TILE_INFO(0, videoram[tile_index], 0, 0);
3232
3333   /* sprite color base is constant 0x10 */
34   tileinfo->priority = 1;
34   tileinfo->category = 1;
3535}
3636
3737
r814r815
5656   SET_TILE_INFO(0, code, color, TILE_FLIPYX((data >> 9) & 3));
5757
5858   /* sprite color base comes from the top 2 bits */
59   tileinfo->priority = (data >> 14) & 3;
59   tileinfo->category = (data >> 14) & 3;
6060}
6161
6262
r814r815
8181   SET_TILE_INFO(0, code, color, TILE_FLIPYX((data >> 10) & 3));
8282
8383   /* sprite color base might come from the top 2 bits */
84   tileinfo->priority = (data >> 14) & 3;
84   tileinfo->category = (data >> 14) & 3;
8585}
8686
8787
r814r815
9898   switch (mcr_cpu_board)
9999   {
100100      case 90009:
101         bg_tilemap = tilemap_create(mcr_90009_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,16, 32,30);
101         bg_tilemap = tilemap_create(mcr_90009_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
102102         break;
103103
104104      case 90010:
105         bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,16, 32,30);
105         bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
106106         break;
107107
108108      case 91475:
109         bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,16, 32,30);
109         bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
110110         break;
111111
112112      case 91490:
113         bg_tilemap = tilemap_create(mcr_91490_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 16,16, 32,30);
113         bg_tilemap = tilemap_create(mcr_91490_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
114114         break;
115115
116116      default:
src/mame/video/m107.c
r814r815
6262         0,
6363         tile,
6464         color&0x7f,
65         TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2))
65         TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2));
6666
6767   /* Priority 1 = tile appears above sprites */
68   tileinfo->priority = ((m107_vram_data[tile_index+3]&2)>>1);
68   tileinfo->category = ((m107_vram_data[tile_index+3]&2)>>1);
6969}
7070
7171static TILE_GET_INFO( get_pf2_tile_info )
r814r815
8181         0,
8282         tile,
8383         color&0x7f,
84         TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2))
84         TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2));
8585
86   tileinfo->priority = ((m107_vram_data[tile_index+3]&2)>>1);
86   tileinfo->category = ((m107_vram_data[tile_index+3]&2)>>1);
8787}
8888
8989static TILE_GET_INFO( get_pf3_tile_info )
r814r815
9999         0,
100100         tile,
101101         color&0x7f,
102         TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2))
102         TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2));
103103}
104104
105105static TILE_GET_INFO( get_pf4_tile_info )
r814r815
115115         0,
116116         tile,
117117         color&0x7f,
118         TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2))
118         TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2));
119119}
120120
121121/*****************************************************************************/
r814r815
218218{
219219   pf1_layer = tilemap_create(
220220      get_pf1_tile_info,tilemap_scan_rows,
221      TILEMAP_TYPE_TRANSPARENT,
221      TILEMAP_TYPE_PEN,
222222      8,8,
223223      64,64
224224   );
225225
226226   pf2_layer = tilemap_create(
227227      get_pf2_tile_info,tilemap_scan_rows,
228      TILEMAP_TYPE_TRANSPARENT,
228      TILEMAP_TYPE_PEN,
229229      8,8,
230230      64,64
231231   );
232232
233233   pf3_layer = tilemap_create(
234234      get_pf3_tile_info,tilemap_scan_rows,
235      TILEMAP_TYPE_TRANSPARENT,
235      TILEMAP_TYPE_PEN,
236236      8,8,
237237      64,64
238238   );
src/mame/video/ninjaw.c
r814r815
150150
151151   /* chip 0 does tilemaps on the left, chip 1 center, chip 2 the right */
152152   // draw bottom layer
153   nodraw  = TC0100SCN_tilemap_draw(machine,bitmap,cliprect,screen,layer[0],TILEMAP_IGNORE_TRANSPARENCY,0);   /* left */
153   nodraw  = TC0100SCN_tilemap_draw(machine,bitmap,cliprect,screen,layer[0],TILEMAP_DRAW_OPAQUE,0);   /* left */
154154
155155   /* Ensure screen blanked even when bottom layers not drawn due to disable bit */
156156   if (nodraw) fillbitmap(bitmap, get_black_pen(machine), cliprect);
src/mame/video/arkanoid.c
r814r815
6969   int code = videoram[offs + 1] + ((videoram[offs] & 0x07) << 8) + 2048 * gfxbank;
7070   int color = ((videoram[offs] & 0xf8) >> 3) + 32 * palettebank;
7171
72   SET_TILE_INFO(0, code, color, 0)
72   SET_TILE_INFO(0, code, color, 0);
7373}
7474
7575VIDEO_START( arkanoid )
7676{
7777   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
78      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
78      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
7979
8080   state_save_register_global(gfxbank);
8181   state_save_register_global(palettebank);
src/mame/video/twin16.c
r814r815
497497   int code = attr & 0x1ff;
498498   int color = (attr >> 9) & 0x0f;
499499
500   SET_TILE_INFO(0, code, color, 0)
500   SET_TILE_INFO(0, code, color, 0);
501501}
502502
503503VIDEO_START( twin16 )
504504{
505505   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows_flip_y,
506      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
506      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
507507
508508   tilemap_set_transparent_pen(fg_tilemap, 0);
509509}
r814r815
511511VIDEO_START( fround )
512512{
513513   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
514      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
514      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
515515
516516   tilemap_set_transparent_pen(fg_tilemap, 0);
517517}
src/mame/video/megasys1.c
r814r815
349349            3                2 x 16     2 x 4
350350*/
351351
352static UINT32 megasys1_scan_8x8(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
352static TILEMAP_MAPPER( megasys1_scan_8x8 )
353353{
354354   return (col * TILES_PER_PAGE_Y) +
355355         (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE * (num_cols / TILES_PER_PAGE_X) +
356356         (row % TILES_PER_PAGE_Y);
357357}
358358
359static UINT32 megasys1_scan_16x16(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
359static TILEMAP_MAPPER( megasys1_scan_16x16 )
360360{
361361   return ( ((col / 2) * (TILES_PER_PAGE_Y / 2)) +
362362          ((row / 2) / (TILES_PER_PAGE_Y / 2)) * (TILES_PER_PAGE / 4) * (num_cols / TILES_PER_PAGE_X) +
r814r815
365365
366366static TILE_GET_INFO( megasys1_get_scroll_tile_info_8x8 )
367367{
368   int tmap = (FPTR)tileinfo->user_data;
368   int tmap = (FPTR)param;
369369   UINT16 code = megasys1_scrollram[tmap][tile_index];
370370   SET_TILE_INFO(tmap, (code & 0xfff) * megasys1_8x8_scroll_factor[tmap], code >> (16 - megasys1_bits_per_color_code), 0);
371371}
372372
373373static TILE_GET_INFO( megasys1_get_scroll_tile_info_16x16 )
374374{
375   int tmap = (FPTR)tileinfo->user_data;
375   int tmap = (FPTR)param;
376376   UINT16 code = megasys1_scrollram[tmap][tile_index/4];
377377   SET_TILE_INFO(tmap, (code & 0xfff) * megasys1_16x16_scroll_factor[tmap] + (tile_index & 3), code >> (16 - megasys1_bits_per_color_code), 0);
378378}
r814r815
385385   {
386386      /* 16x16 tilemaps */
387387      megasys1_tilemap[layer][0][0] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16,
388                        TILEMAP_TYPE_TRANSPARENT, 8,8, TILES_PER_PAGE_X * 16, TILES_PER_PAGE_Y * 2);
388                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 16, TILES_PER_PAGE_Y * 2);
389389      megasys1_tilemap[layer][0][1] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16,
390                        TILEMAP_TYPE_TRANSPARENT, 8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 4);
390                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 4);
391391      megasys1_tilemap[layer][0][2] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16,
392                        TILEMAP_TYPE_TRANSPARENT, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 8);
392                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 8);
393393      megasys1_tilemap[layer][0][3] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16,
394                        TILEMAP_TYPE_TRANSPARENT, 8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 16);
394                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 16);
395395
396396      /* 8x8 tilemaps */
397397      megasys1_tilemap[layer][1][0] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8,
398                        TILEMAP_TYPE_TRANSPARENT, 8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 1);
398                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 1);
399399      megasys1_tilemap[layer][1][1] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8,
400                        TILEMAP_TYPE_TRANSPARENT, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
400                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
401401      megasys1_tilemap[layer][1][2] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8,
402                        TILEMAP_TYPE_TRANSPARENT, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
402                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
403403      megasys1_tilemap[layer][1][3] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8,
404                        TILEMAP_TYPE_TRANSPARENT, 8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 4);
404                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 4);
405405
406406      /* set user data and transparency */
407407      for (i = 0; i < 8; i++)
r814r815
976976
977977   fillbitmap(priority_bitmap,0,cliprect);
978978
979   flag = TILEMAP_IGNORE_TRANSPARENCY;
979   flag = TILEMAP_DRAW_OPAQUE;
980980   primask = 0;
981981
982982   for (i = 0;i < 5;i++)
src/mame/video/crshrace.c
r814r815
2222{
2323   int code = crshrace_videoram1[tile_index];
2424
25   SET_TILE_INFO(1,(code & 0xfff) + (roz_bank << 12),code >> 12,0)
25   SET_TILE_INFO(1,(code & 0xfff) + (roz_bank << 12),code >> 12,0);
2626}
2727
2828static TILE_GET_INFO( get_tile_info2 )
2929{
3030   int code = crshrace_videoram2[tile_index];
3131
32   SET_TILE_INFO(0,code,0,0)
32   SET_TILE_INFO(0,code,0,0);
3333}
3434
3535
r814r815
4141
4242VIDEO_START( crshrace )
4343{
44   tilemap1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
45   tilemap2 = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
44   tilemap1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
45   tilemap2 = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
4646
4747   K053936_wraparound_enable(0, 1);
4848   K053936_set_offset(0, -48, -21);
src/mame/video/airbustr.c
r814r815
101101   int code = airbustr_videoram2[tile_index] + ((attr & 0x0f) << 8);
102102   int color = attr >> 4;
103103
104   SET_TILE_INFO(0, code, color, 0)
104   SET_TILE_INFO(0, code, color, 0);
105105}
106106
107107static TILE_GET_INFO( get_bg_tile_info )
r814r815
110110   int code = videoram[tile_index] + ((attr & 0x0f) << 8);
111111   int color = (attr >> 4) + 16;
112112
113   SET_TILE_INFO(0, code, color, 0)
113   SET_TILE_INFO(0, code, color, 0);
114114}
115115
116116VIDEO_START( airbustr )
117117{
118118   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
119      TILEMAP_TYPE_OPAQUE, 16, 16, 32, 32);
119      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
120120
121121   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
122      TILEMAP_TYPE_TRANSPARENT, 16, 16, 32, 32);
122      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
123123
124124   sprites_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
125125   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/pacman.c
r814r815
143143   }
144144}
145145
146static UINT32 pacman_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
146static TILEMAP_MAPPER( pacman_scan_rows )
147147{
148148   int offs;
149149
r814r815
162162   int code = videoram[tile_index] | (charbank << 8);
163163   int attr = (colorram[tile_index] & 0x1f) | (colortablebank << 5) | (palettebank << 6 );
164164
165   SET_TILE_INFO(0,code,attr,0)
165   SET_TILE_INFO(0,code,attr,0);
166166}
167167
168168/***************************************************************************
r814r815
197197   /* one pixel to the left to get a more correct placement */
198198   xoffsethack = 1;
199199
200   bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 36, 28 );
200   bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 36, 28 );
201201
202202   tilemap_set_scrolldx( bg_tilemap, 0, 384 - 288 );
203203   tilemap_set_scrolldy( bg_tilemap, 0, 264 - 224 );
r814r815
227227   if (bgpriority != 0)
228228      fillbitmap(bitmap,machine->pens[0],cliprect);
229229   else
230      tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
230      tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
231231
232232   if( spriteram_size )
233233   {
r814r815
315315
316316   xoffsethack = 0;
317317
318   bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 36, 28 );
318   bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 36, 28 );
319319}
320320
321321WRITE8_HANDLER( pengo_palettebank_w )
r814r815
375375   code = videoram[tile_index] + (colbank << 8);
376376   attr = colorram[tile_index & 0x1f];
377377
378   SET_TILE_INFO(0,code,attr & 0x1f,0)
378   SET_TILE_INFO(0,code,attr & 0x1f,0);
379379}
380380
381381VIDEO_START( s2650games )
r814r815
391391
392392   xoffsethack = 1;
393393
394   bg_tilemap = tilemap_create( s2650_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
394   bg_tilemap = tilemap_create( s2650_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
395395
396396   tilemap_set_scroll_cols(bg_tilemap, 32);
397397}
r814r815
4884882018 - 2045 = column 1 attr (28 rows)
489489*/
490490
491static UINT32 jrpacman_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
491static TILEMAP_MAPPER( jrpacman_scan_rows )
492492{
493493   int offs;
494494
r814r815
518518   code = videoram[tile_index] | (charbank << 8);
519519   attr = (videoram[color_index] & 0x1f) | (colortablebank << 5) | (palettebank << 6 );
520520
521   SET_TILE_INFO(0,code,attr,0)
521   SET_TILE_INFO(0,code,attr,0);
522522}
523523
524524static void jrpacman_mark_tile_dirty( int offset )
r814r815
562562
563563   xoffsethack = 1;
564564
565   bg_tilemap = tilemap_create( jrpacman_get_tile_info,jrpacman_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,36,54 );
565   bg_tilemap = tilemap_create( jrpacman_get_tile_info,jrpacman_scan_rows,TILEMAP_TYPE_PEN,8,8,36,54 );
566566
567567   tilemap_set_transparent_pen( bg_tilemap, 0 );
568568   tilemap_set_scroll_cols( bg_tilemap, 36 );
src/mame/video/clshroad.c
r814r815
137137         1,
138138         code,
139139         0,
140         0)
140         0);
141141}
142142
143143static TILE_GET_INFO( get_tile_info_0b )
r814r815
150150         1,
151151         code,
152152         0,
153         0)
153         0);
154154}
155155
156156WRITE8_HANDLER( clshroad_vram_0_w )
r814r815
181181***************************************************************************/
182182
183183/* logical (col,row) -> memory offset */
184static UINT32 tilemap_scan_rows_extra( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
184static TILEMAP_MAPPER( tilemap_scan_rows_extra )
185185{
186186   // The leftmost columns come from the bottom rows
187187   if (col <= 0x01)   return row + (col + 0x1e) * 0x20;
r814r815
205205         2,
206206         code,
207207         color & 0x3f,
208         0)
208         0);
209209}
210210
211211static TILE_GET_INFO( get_tile_info_1 )
r814r815
216216         2,
217217         code + ((color & 0xf0)<<4),
218218         color & 0x0f,
219         0)
219         0);
220220}
221221
222222WRITE8_HANDLER( clshroad_vram_1_w )
r814r815
229229VIDEO_START( firebatl )
230230{
231231   /* These 2 use the graphics and scroll value */
232   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,0x20,0x10);
233   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,0x20,0x10);
232   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,0x20,0x10);
233   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
234234   /* Text (No scrolling) */
235   tilemap_1  = tilemap_create(get_tile_info_fb1,tilemap_scan_rows_extra,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,0x24,0x20);
235   tilemap_1  = tilemap_create(get_tile_info_fb1,tilemap_scan_rows_extra,TILEMAP_TYPE_COLORTABLE,8,8,0x24,0x20);
236236
237237   tilemap_set_scroll_rows( tilemap_0a, 1);
238238   tilemap_set_scroll_rows( tilemap_0b, 1);
r814r815
245245   tilemap_set_scrolldx( tilemap_0a, -0x30, -0xb5);
246246   tilemap_set_scrolldx( tilemap_0b, -0x30, -0xb5);
247247
248   tilemap_set_transparent_pen( tilemap_0a, 0 );
249248   tilemap_set_transparent_pen( tilemap_0b, 0 );
250249   tilemap_set_transparent_pen( tilemap_1,  0x0f );
251250}
r814r815
253252VIDEO_START( clshroad )
254253{
255254   /* These 2 use the graphics and scroll value */
256   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,0x20,0x10);
257   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,0x20,0x10);
255   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,0x20,0x10);
256   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
258257   /* Text (No scrolling) */
259   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows_extra,TILEMAP_TYPE_TRANSPARENT,8,8,0x24,0x20);
258   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows_extra,TILEMAP_TYPE_PEN,8,8,0x24,0x20);
260259
261260   tilemap_set_scroll_rows( tilemap_0a, 1);
262261   tilemap_set_scroll_rows( tilemap_0b, 1);
r814r815
269268   tilemap_set_scrolldx( tilemap_0a, -0x30, -0xb5);
270269   tilemap_set_scrolldx( tilemap_0b, -0x30, -0xb5);
271270
272   tilemap_set_transparent_pen( tilemap_0a, 0x0f );
273271   tilemap_set_transparent_pen( tilemap_0b, 0x0f );
274272   tilemap_set_transparent_pen( tilemap_1,  0x0f );
275273}
src/mame/video/chqflag.c
r814r815
6161   zoom_colorbase[1] = 0x02;
6262
6363   K051960_vh_start(machine,SPRITEROM_MEM_REGION,NORMAL_PLANE_ORDER,sprite_callback);
64   K051316_vh_start_0(machine,ZOOMROM0_MEM_REGION,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback_0);
65   K051316_vh_start_1(machine,ZOOMROM1_MEM_REGION,8,TILEMAP_TYPE_SPLIT_PENBIT,0xc0,zoom_callback_1);
64   K051316_vh_start_0(machine,ZOOMROM0_MEM_REGION,4,FALSE,0,zoom_callback_0);
65   K051316_vh_start_1(machine,ZOOMROM1_MEM_REGION,8,TRUE,0xc0,zoom_callback_1);
6666
6767   K051316_set_offset(0,7,0);
6868   K051316_wraparound_enable(1,1);
r814r815
7878{
7979   fillbitmap(bitmap,machine->pens[0],cliprect);
8080
81   K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_BACK,0);
81   K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_DRAW_LAYER1,0);
8282   K051960_sprites_draw(bitmap,cliprect,0,0);
83   K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_FRONT,0);
83   K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_DRAW_LAYER0,0);
8484   K051960_sprites_draw(bitmap,cliprect,1,1);
8585   K051316_zoom_draw_0(bitmap,cliprect,0,0);
8686   return 0;
src/mame/video/bwing.c
r814r815
165165
166166#define BW_SET_TILE_INFO(GFX, CODE, COLOR) { \
167167   tileinfo->pen_data = GFX->gfxdata + (CODE) * GFX->char_modulo; \
168   tileinfo->pal_data = &GFX->colortable[(COLOR) << 3]; \
168   tileinfo->palette_base = (GFX->colortable - Machine->remapped_colortable) + ((COLOR) << 3); \
169169   }
170170
171171static TILE_GET_INFO( get_fgtileinfo )
172172{
173173   unsigned code = fgdata[tile_index];
174   BW_SET_TILE_INFO(fgfx, code & (BW_NTILES-1), code >> 7)
174   BW_SET_TILE_INFO(fgfx, code & (BW_NTILES-1), code >> 7);
175175}
176176
177177static TILE_GET_INFO( get_bgtileinfo )
178178{
179179   unsigned code = bgdata[tile_index];
180   BW_SET_TILE_INFO(bgfx, code & (BW_NTILES-1), code >> 7)
180   BW_SET_TILE_INFO(bgfx, code & (BW_NTILES-1), code >> 7);
181181}
182182
183183static TILE_GET_INFO( get_charinfo )
184184{
185   SET_TILE_INFO(0, videoram[tile_index], 0, 0)
185   SET_TILE_INFO(0, videoram[tile_index], 0, 0);
186186}
187187
188static UINT32 bwing_scan_cols(UINT32 col, UINT32 row, UINT32 nc, UINT32 nr)
188static TILEMAP_MAPPER( bwing_scan_cols )
189189{
190190   return((col<<6) + row);
191191}
r814r815
196196   UINT32 *dwptr;
197197   int i;
198198
199   charmap = tilemap_create(get_charinfo,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
200   fgmap = tilemap_create(get_fgtileinfo,bwing_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
201   bgmap = tilemap_create(get_bgtileinfo,bwing_scan_cols,TILEMAP_TYPE_OPAQUE,16,16,64,64);
199   charmap = tilemap_create(get_charinfo,tilemap_scan_cols,TILEMAP_TYPE_PEN, 8, 8,32,32);
200   fgmap = tilemap_create(get_fgtileinfo,bwing_scan_cols,TILEMAP_TYPE_PEN,16,16,64,64);
201   bgmap = tilemap_create(get_bgtileinfo,bwing_scan_cols,TILEMAP_TYPE_PEN,16,16,64,64);
202202   srxlat = auto_malloc(0x8000);
203203
204204   scrollmap[0] = fgmap;
src/mame/video/sf.c
r814r815
2424         0,
2525         code,
2626         color,
27         TILE_FLIPYX(attr & 3))
27         TILE_FLIPYX(attr & 3));
2828}
2929
3030static TILE_GET_INFO( get_fg_tile_info )
r814r815
3737         1,
3838         code,
3939         color,
40         TILE_FLIPYX(attr & 3))
40         TILE_FLIPYX(attr & 3));
4141}
4242
4343static TILE_GET_INFO( get_tx_tile_info )
r814r815
4747         3,
4848         code & 0x3ff,
4949         code>>12,
50         TILE_FLIPYX((code & 0xc00)>>10))
50         TILE_FLIPYX((code & 0xc00)>>10));
5151}
5252
5353
r814r815
6060
6161VIDEO_START( sf )
6262{
63   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,     16,16,2048,16);
64   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,2048,16);
65   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,  64,32);
63   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,2048,16);
64   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,2048,16);
65   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,  64,32);
6666
6767   tilemap_set_transparent_pen(fg_tilemap,15);
6868   tilemap_set_transparent_pen(tx_tilemap,3);
src/mame/video/sengokmj.c
r814r815
3737{
3838   int tile = sengokmj_bgvram[tile_index*2] + (sengokmj_bgvram[2*tile_index+1] << 8);
3939   int color = (tile >> 12) & 0x0f;
40   SET_TILE_INFO(1, tile & 0xfff, color, 0)
40   SET_TILE_INFO(1, tile & 0xfff, color, 0);
4141}
4242
4343static TILE_GET_INFO( sengoku_md_tile_info )
4444{
4545   int tile = sengokmj_mdvram[tile_index*2] + (sengokmj_mdvram[2*tile_index+1] << 8);
4646   int color = (tile >> 12) & 0x0f;
47   SET_TILE_INFO(1, (tile & 0xfff) + 0x1000, color + 0x10, 0)
47   SET_TILE_INFO(1, (tile & 0xfff) + 0x1000, color + 0x10, 0);
4848}
4949
5050static TILE_GET_INFO( sengoku_fg_tile_info )
5151{
5252   int tile = sengokmj_fgvram[tile_index*2] + (sengokmj_fgvram[2*tile_index+1] << 8);
5353   int color = (tile >> 12) & 0x0f;
54   SET_TILE_INFO(1, (tile & 0xfff) + 0x2000, color + 0x20, 0)
54   SET_TILE_INFO(1, (tile & 0xfff) + 0x2000, color + 0x20, 0);
5555}
5656
5757static TILE_GET_INFO( sengoku_tx_tile_info )
5858{
5959   int tile = sengokmj_txvram[tile_index*2] + (sengokmj_txvram[2*tile_index+1] << 8);
6060   int color = (tile >> 12) & 0x0f;
61   SET_TILE_INFO(2, (tile & 0xfff) + 0x3000, color, 0)
61   SET_TILE_INFO(2, (tile & 0xfff) + 0x3000, color, 0);
6262}
6363
6464static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int pri)
r814r815
105105
106106VIDEO_START( sengokmj )
107107{
108   bg_tilemap = tilemap_create(sengoku_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,16);
109   md_tilemap = tilemap_create(sengoku_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
110   fg_tilemap = tilemap_create(sengoku_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
111   tx_tilemap = tilemap_create(sengoku_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
108   bg_tilemap = tilemap_create(sengoku_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,16);
109   md_tilemap = tilemap_create(sengoku_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
110   fg_tilemap = tilemap_create(sengoku_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
111   tx_tilemap = tilemap_create(sengoku_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
112112
113113   tilemap_set_transparent_pen(md_tilemap,15);
114114   tilemap_set_transparent_pen(fg_tilemap,15);
src/mame/video/cave.c
r814r815
269269                     code,
270270                     color,
271271                     0   );
272   tileinfo->priority   =   pri;
272   tileinfo->category   =   pri;
273273}
274274
275275/* Sailormn: the lower 2 Megabytes of tiles banked */
r814r815
320320                     code,
321321                     color,
322322                     0   );
323   tileinfo->priority   =   pri;
323   tileinfo->category   =   pri;
324324}
325325
326326
r814r815
410410   {
411411      case 4:
412412         tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
413                              TILEMAP_TYPE_TRANSPARENT, 8,8, 512/8,512/8 );
413                              TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
414414         tilemap_set_transparent_pen(tilemap_3, 0);
415415         tilemap_set_scroll_rows(tilemap_3, 1);
416416         tilemap_set_scroll_cols(tilemap_3, 1);
417417
418418      case 3:
419419         tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
420                              TILEMAP_TYPE_TRANSPARENT, 8,8, 512/8,512/8 );
420                              TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
421421         tilemap_set_transparent_pen(tilemap_2, 0);
422422         tilemap_set_scroll_rows(tilemap_2, 1);
423423         tilemap_set_scroll_cols(tilemap_2, 1);
424424
425425      case 2:
426426         tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
427                              TILEMAP_TYPE_TRANSPARENT, 8,8, 512/8,512/8 );
427                              TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
428428         tilemap_set_transparent_pen(tilemap_1, 0);
429429         tilemap_set_scroll_rows(tilemap_1, 1);
430430         tilemap_set_scroll_cols(tilemap_1, 1);
431431
432432      case 1:
433433         tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
434                              TILEMAP_TYPE_TRANSPARENT, 8,8, 512/8,512/8 );
434                              TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
435435         tilemap_set_transparent_pen(tilemap_0, 0);
436436         tilemap_set_scroll_rows(tilemap_0, 1);
437437         tilemap_set_scroll_cols(tilemap_0, 1);
r814r815
479479
480480   /* Layer 2 (8x8) needs to be handled differently */
481481   tilemap_2 = tilemap_create(   sailormn_get_tile_info_2, tilemap_scan_rows,
482                        TILEMAP_TYPE_TRANSPARENT, 8,8, 512/8,512/8 );
482                        TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
483483   tilemap_set_transparent_pen(tilemap_2, 0);
484484   tilemap_set_scroll_rows(tilemap_2, 1);
485485   tilemap_set_scroll_cols(tilemap_2, 1);
src/mame/video/dooyong.c
r814r815
630630
631631   /* Create tilemaps */
632632   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
633      TILEMAP_TYPE_OPAQUE, 32, 32, 32, 8);
633      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
634634   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
635      TILEMAP_TYPE_TRANSPARENT, 32, 32, 32, 8);
635      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
636636   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
637      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
637      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
638638
639639   /* Configure tilemap transparency */
640640   tilemap_set_transparent_pen(fg_tilemap, 15);
r814r815
662662
663663   /* Create tilemaps */
664664   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
665      TILEMAP_TYPE_OPAQUE, 32, 32, 32, 8);
665      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
666666   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
667      TILEMAP_TYPE_TRANSPARENT, 32, 32, 32, 8);
667      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
668668   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
669      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
669      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
670670
671671   /* Configure tilemap transparency */
672672   tilemap_set_transparent_pen(fg_tilemap, 15);
r814r815
693693
694694   /* Create tilemaps */
695695   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
696      TILEMAP_TYPE_OPAQUE, 32, 32, 32, 8);
696      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
697697   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
698      TILEMAP_TYPE_TRANSPARENT, 32, 32, 32, 8);
698      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
699699   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
700      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
700      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
701701
702702   /* Configure tilemap transparency */
703703   tilemap_set_transparent_pen(fg_tilemap, 15);
r814r815
724724
725725   /* Create tilemaps */
726726   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
727      TILEMAP_TYPE_OPAQUE, 32, 32, 32, 8);
727      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
728728   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
729      TILEMAP_TYPE_TRANSPARENT, 32, 32, 32, 8);
729      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
730730   fg2_tilemap = tilemap_create(get_fg2_tile_info, tilemap_scan_cols,
731      TILEMAP_TYPE_TRANSPARENT, 32, 32, 32, 8);
731      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
732732   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
733      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
733      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
734734
735735   /* Configure tilemap transparency */
736736   tilemap_set_transparent_pen(fg_tilemap, 15);
r814r815
756756
757757   /* Create tilemaps */
758758   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
759      TILEMAP_TYPE_TRANSPARENT, 32, 32, 32, 8);
759      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
760760   fg_tilemap = tilemap_create(flytiger_get_fg_tile_info, tilemap_scan_cols,
761      TILEMAP_TYPE_TRANSPARENT, 32, 32, 32, 8);
761      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
762762   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
763      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
763      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
764764
765765   /* Configure tilemap transparency */
766766   tilemap_set_transparent_pen(bg_tilemap, 15);
r814r815
789789
790790   /* Create tilemaps */
791791   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
792      TILEMAP_TYPE_OPAQUE, 32, 32, 32, 8);
792      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
793793   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
794      TILEMAP_TYPE_TRANSPARENT, 32, 32, 32, 8);
794      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
795795   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
796      TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 32);
796      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
797797
798798   /* Configure tilemap transparency */
799799   tilemap_set_transparent_pen(fg_tilemap, 15);
r814r815
823823
824824   /* Create tilemaps */
825825   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
826      TILEMAP_TYPE_OPAQUE, 16, 16, 64, 32);
826      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
827827   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_cols,
828      TILEMAP_TYPE_TRANSPARENT, 16, 16, 64, 32);
828      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
829829   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
830      TILEMAP_TYPE_TRANSPARENT, 16, 16, 64, 32);
830      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
831831   fg2_tilemap = tilemap_create(get_fg2_tile_info, tilemap_scan_cols,
832      TILEMAP_TYPE_TRANSPARENT, 16, 16, 64, 32);
832      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
833833
834834   /* Configure tilemap transparency */
835835   tilemap_set_transparent_pen(bg2_tilemap, 15);
r814r815
852852
853853   /* Create tilemaps */
854854   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
855      TILEMAP_TYPE_OPAQUE, 32, 32, 32, 8);
855      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
856856   bg2_tilemap = fg_tilemap = fg2_tilemap = NULL;   /* Stop scroll handler from crashing on these */
857857
858858   /* Register for save/restore */
src/mame/video/brkthru.c
r814r815
9393   int region = 1 + (code >> 7);
9494   int colour = bgbasecolor + ((videoram[tile_index*2+1] & 0x04) >> 2);
9595
96   SET_TILE_INFO(region, code & 0x7f,colour,0)
96   SET_TILE_INFO(region, code & 0x7f,colour,0);
9797}
9898
9999WRITE8_HANDLER( brkthru_bgram_w )
r814r815
106106static TILE_GET_INFO( get_fg_tile_info )
107107{
108108   UINT8 code = brkthru_videoram[tile_index];
109   SET_TILE_INFO(0, code, 0, 0)
109   SET_TILE_INFO(0, code, 0, 0);
110110}
111111
112112WRITE8_HANDLER( brkthru_fgram_w )
r814r815
117117
118118VIDEO_START( brkthru )
119119{
120   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
121   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,32,16);
120   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
121   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,16);
122122
123123   tilemap_set_transparent_pen( fg_tilemap, 0 );
124124   tilemap_set_transparent_pen( bg_tilemap, 0 );
r814r815
263263VIDEO_UPDATE( brkthru )
264264   {
265265   tilemap_set_scrollx(bg_tilemap,0, bgscroll);
266   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
266   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
267267
268268   /* low priority sprites */
269269   draw_sprites(machine, bitmap, cliprect, 0x01 );
src/mame/video/williams.c
r814r815
209209   state_save_register_global_pointer(williams2_paletteram, 0x400 * 2);
210210
211211   /* create the tilemap */
212   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_OPAQUE, 24,16, 128,16);
212   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 24,16, 128,16);
213213   tilemap_set_scrolldx(bg_tilemap, 2, 0);
214214
215215   state_save_register();
src/mame/video/dec8.c
r814r815
462462
463463   tile=(dec8_pf0_data[offs]<<8) | dec8_pf0_data[offs+1];
464464   color=tile >> 12;
465   if (color>7 && game_uses_priority) tileinfo->priority=1; else tileinfo->priority=0;
465   if (color>7 && game_uses_priority) tileinfo->category=1; else tileinfo->category=0;
466466
467467   SET_TILE_INFO(
468468         2,
469469         tile&0xfff,
470470         color&gfx_mask,
471         0)
471         0);
472472}
473473
474474static TILE_GET_INFO( get_bac1_tile_info )
r814r815
477477
478478   tile=(dec8_pf1_data[offs]<<8) | dec8_pf1_data[offs+1];
479479   color=tile >> 12;
480   if (color>7 && game_uses_priority) tileinfo->priority=1; else tileinfo->priority=0;
480   if (color>7 && game_uses_priority) tileinfo->category=1; else tileinfo->category=0;
481481
482482   SET_TILE_INFO(
483483         3,
484484         tile&0xfff,
485485         color&3,
486         0)
486         0);
487487}
488488
489static UINT32 bac0_scan_rows(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
489static TILEMAP_MAPPER( bac0_scan_rows )
490490{
491491   /* logical (col,row) -> memory offset */
492492   return ((col & 0x0f) + ((row & 0x0f) << 4)) + ((col & 0x10) << 5) + ((row & 0x10) << 4);
r814r815
502502         0,
503503         tile&0xfff,
504504         color,
505         0)
505         0);
506506}
507507
508508VIDEO_START( cobracom )
509509{
510510   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,0,16,16,32,32);
511   dec8_pf1_tilemap = tilemap_create(get_bac1_tile_info,bac0_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
512   dec8_fix_tilemap = tilemap_create(get_cobracom_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
511   dec8_pf1_tilemap = tilemap_create(get_bac1_tile_info,bac0_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
512   dec8_fix_tilemap = tilemap_create(get_cobracom_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
513513
514514   tilemap_set_transparent_pen(dec8_pf1_tilemap,0);
515515   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
r814r815
550550         0,
551551         tile&0x3ff,
552552         color,
553         0)
553         0);
554554}
555555
556556VIDEO_START( ghostb )
557557{
558558   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,0,16,16,32,32);
559   dec8_fix_tilemap = tilemap_create(get_ghostb_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
559   dec8_fix_tilemap = tilemap_create(get_ghostb_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
560560   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
561561
562562   game_uses_priority=0;
r814r815
571571   tilemap_set_scrolly( dec8_pf0_tilemap,0, (dec8_pf0_control[0x12]<<8)+dec8_pf0_control[0x13] );
572572   flip_screen_set(dec8_pf0_control[1]>>7);
573573
574   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_BACK | 0,0);
575   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_BACK | 1,0);
576   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_FRONT | 0,0);
574   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1 | 0,0);
575   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1 | 1,0);
576   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0 | 0,0);
577577   draw_sprites2(machine,bitmap,cliprect,0);
578   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_FRONT | 1,0);
578   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0 | 1,0);
579579   tilemap_draw(bitmap,cliprect,dec8_fix_tilemap,0,0);
580580   return 0;
581581}
r814r815
590590         0,
591591         tile&0xfff,
592592         color,
593         0)
593         0);
594594}
595595
596596VIDEO_START( oscar )
597597{
598   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
599   dec8_fix_tilemap = tilemap_create(get_oscar_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
598   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
599   dec8_fix_tilemap = tilemap_create(get_oscar_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
600600
601601   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
602602   tilemap_set_transmask(dec8_pf0_tilemap,0,0x00ff,0xff00); /* Bottom 8 pens */
r814r815
623623   tilemap_set_scrollx( dec8_pf0_tilemap,0, ((scroll2[0]<<8)+scroll2[1]) );
624624   tilemap_set_scrolly( dec8_pf0_tilemap,0, ((scroll2[2]<<8)+scroll2[3]) );
625625
626   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_BACK | 0,0);
627   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_BACK | 1,0);
628   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_FRONT | 0,0);
626   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1 | 0,0);
627   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1 | 1,0);
628   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0 | 0,0);
629629   draw_sprites1(machine,bitmap,cliprect,0);
630   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_FRONT | 1,0);
630   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0 | 1,0);
631631   tilemap_draw(bitmap,cliprect,dec8_fix_tilemap,0,0);
632632   return 0;
633633}
634634
635static UINT32 lastmiss_scan_rows(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
635static TILEMAP_MAPPER( lastmiss_scan_rows )
636636{
637637   /* logical (col,row) -> memory offset */
638638   return ((col & 0x0f) + ((row & 0x0f) << 4)) + ((col & 0x10) << 4) + ((row & 0x10) << 5);
r814r815
644644   int tile=dec8_pf0_data[offs+1]+(dec8_pf0_data[offs]<<8);
645645   int color=tile >> 12;
646646
647   if (color>7 && game_uses_priority) tileinfo->priority=1; else tileinfo->priority=0;
647   if (color>7 && game_uses_priority) tileinfo->category=1; else tileinfo->category=0;
648648
649649   SET_TILE_INFO(
650650         2,
651651         tile&0xfff,
652652         color,
653         0)
653         0);
654654}
655655
656656static TILE_GET_INFO( get_lastmiss_fix_tile_info )
r814r815
663663         0,
664664         tile&0xfff,
665665         color,
666         0)
666         0);
667667}
668668
669669VIDEO_START( lastmiss )
670670{
671671   dec8_pf0_tilemap = tilemap_create(get_lastmiss_tile_info,lastmiss_scan_rows,0,16,16,32,32);
672   dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
672   dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
673673
674674   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
675675   game_uses_priority=0;
r814r815
677677
678678VIDEO_START( shackled )
679679{
680   dec8_pf0_tilemap = tilemap_create(get_lastmiss_tile_info,lastmiss_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
681   dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
680   dec8_pf0_tilemap = tilemap_create(get_lastmiss_tile_info,lastmiss_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
681   dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
682682
683683   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
684684   tilemap_set_transmask(dec8_pf0_tilemap,0,0x000f,0xfff0); /* Bottom 12 pens */
r814r815
691691{
692692   tilemap_set_scrollx( dec8_pf0_tilemap,0, (scroll2[0]<<8)+scroll2[1] );
693693
694   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_BACK,0);
694   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1,0);
695695   srdarwin_draw_sprites(machine,bitmap,cliprect,0); //* (srdarwin37b5gre)
696   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_FRONT,0);
696   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0,0);
697697   srdarwin_draw_sprites(machine,bitmap,cliprect,1);
698698   tilemap_draw(bitmap,cliprect,dec8_fix_tilemap,0,0);
699699   return 0;
r814r815
704704   int tile=videoram[tile_index];
705705   int color=0; /* ? */
706706
707   if (color>1) tileinfo->priority=1; else tileinfo->priority=0;
707   if (color>1) tileinfo->category=1; else tileinfo->category=0;
708708
709709   SET_TILE_INFO(
710710         0,
711711         tile,
712712         color,
713         0)
713         0);
714714}
715715
716716//AT: improved priority and fixed stage 4+ crashes caused by bank overflow
r814r815
718718{
719719   int tile=dec8_pf0_data[2*tile_index+1]+(dec8_pf0_data[2*tile_index]<<8);
720720   int color=tile >> 12 & 3;
721   int flag = TILE_SPLIT(color);
722721   int bank;
723722
724723   tile=tile&0x3ff;
r814r815
728727         bank,
729728         tile,
730729         color,
731         flag)
730         0);
731   tileinfo->group = color;
732732}
733733
734734VIDEO_START( srdarwin )
735735{
736   dec8_pf0_tilemap = tilemap_create(get_srdarwin_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,16);
737   dec8_fix_tilemap = tilemap_create(get_srdarwin_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
736   dec8_pf0_tilemap = tilemap_create(get_srdarwin_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
737   dec8_fix_tilemap = tilemap_create(get_srdarwin_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
738738
739739   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
740740   tilemap_set_transmask(dec8_pf0_tilemap,0,0xffff,0x0000); //* draw as background only
r814r815
750750   tilemap_set_scrollx( dec8_pf0_tilemap,0, ((scroll2[0]<<8)+scroll2[1]) );
751751   tilemap_set_scrolly( dec8_pf0_tilemap,0, ((scroll2[2]<<8)+scroll2[3]) );
752752
753   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_BACK,0);
753   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1,0);
754754   draw_sprites1(machine,bitmap,cliprect,2);
755   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_FRONT,0);
755   tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0,0);
756756   draw_sprites1(machine,bitmap,cliprect,1);
757757   tilemap_draw(bitmap,cliprect,dec8_fix_tilemap,0,0);
758758   return 0;
r814r815
780780         0,
781781         tile&0xfff,
782782         color,
783         0)
783         0);
784784}
785785
786786static TILE_GET_INFO( get_gondo_tile_info )
r814r815
789789   int tile=dec8_pf0_data[offs+1]+(dec8_pf0_data[offs]<<8);
790790   int color=tile>> 12;
791791
792   if (color>7 && game_uses_priority) tileinfo->priority=1; else tileinfo->priority=0;
792   if (color>7 && game_uses_priority) tileinfo->category=1; else tileinfo->category=0;
793793
794794   SET_TILE_INFO(
795795         2,
796796         tile&0xfff,
797797         color,
798         0)
798         0);
799799}
800800
801801VIDEO_START( gondo )
802802{
803   dec8_fix_tilemap=tilemap_create(get_gondo_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
804   dec8_pf0_tilemap=tilemap_create(get_gondo_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
803   dec8_fix_tilemap=tilemap_create(get_gondo_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
804   dec8_pf0_tilemap=tilemap_create(get_gondo_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
805805
806806   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
807807   tilemap_set_transmask(dec8_pf0_tilemap,0,0x00ff,0xff00); /* Bottom 8 pens */
r814r815
810810
811811VIDEO_START( garyoret )
812812{
813   dec8_fix_tilemap=tilemap_create(get_gondo_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
814   dec8_pf0_tilemap=tilemap_create(get_gondo_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,16,16,32,32);
813   dec8_fix_tilemap=tilemap_create(get_gondo_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
814   dec8_pf0_tilemap=tilemap_create(get_gondo_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
815815
816816   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
817817   game_uses_priority=1;
src/mame/video/fuukifg3.c
r814r815
6363{ \
6464   UINT16 code = (fuuki32_vram_##_N_[tile_index]&0xffff0000)>>16; \
6565   UINT16 attr = (fuuki32_vram_##_N_[tile_index]&0x0000ffff); \
66   SET_TILE_INFO(1 + _N_, code, (attr & 0x3f)>>4,TILE_FLIPYX( (attr >> 6) & 3 )) \
66   SET_TILE_INFO(1 + _N_, code, (attr & 0x3f)>>4,TILE_FLIPYX( (attr >> 6) & 3 )); \
6767} \
6868\
6969WRITE32_HANDLER( fuuki32_vram_##_N_##_w ) \
r814r815
8080{ \
8181   UINT16 code = (fuuki32_vram_##_N_[tile_index]&0xffff0000)>>16; \
8282   UINT16 attr = (fuuki32_vram_##_N_[tile_index]&0x0000ffff); \
83   SET_TILE_INFO(1 + _N_, code, attr & 0x3f,TILE_FLIPYX( (attr >> 6) & 3 )) \
83   SET_TILE_INFO(1 + _N_, code, attr & 0x3f,TILE_FLIPYX( (attr >> 6) & 3 )); \
8484} \
8585\
8686WRITE32_HANDLER( fuuki32_vram_##_N_##_w ) \
r814r815
110110   buffered_spriteram32_2 = auto_malloc(spriteram_size);
111111
112112   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
113                        TILEMAP_TYPE_TRANSPARENT, 16, 16, 64,32);
113                        TILEMAP_TYPE_PEN, 16, 16, 64,32);
114114
115115   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
116                        TILEMAP_TYPE_TRANSPARENT, 16, 16, 64,32);
116                        TILEMAP_TYPE_PEN, 16, 16, 64,32);
117117
118118   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
119                        TILEMAP_TYPE_TRANSPARENT,  8,  8, 64,32);
119                        TILEMAP_TYPE_PEN,  8,  8, 64,32);
120120
121121   tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
122                        TILEMAP_TYPE_TRANSPARENT,  8,  8, 64,32);
122                        TILEMAP_TYPE_PEN,  8,  8, 64,32);
123123
124124   tilemap_set_transparent_pen(tilemap_0,0xff);   // 8 bits
125125   tilemap_set_transparent_pen(tilemap_1,0xff);   // 8 bits
src/mame/video/tbowl.c
r814r815
2828   tileno = tbowl_txvideoram[tile_index] | ((tbowl_txvideoram[tile_index+0x800] & 0x07) << 8);
2929   col = (tbowl_txvideoram[tile_index+0x800] & 0xf0) >> 4;
3030
31   SET_TILE_INFO(0,tileno,col,0)
31   SET_TILE_INFO(0,tileno,col,0);
3232}
3333
3434WRITE8_HANDLER( tbowl_txvideoram_w )
r814r815
4747   tileno = tbowl_bgvideoram[tile_index] | ((tbowl_bgvideoram[tile_index+0x1000] & 0x0f) << 8);
4848   col = (tbowl_bgvideoram[tile_index+0x1000] & 0xf0) >> 4;
4949
50   SET_TILE_INFO(1,tileno,col,0)
50   SET_TILE_INFO(1,tileno,col,0);
5151}
5252
5353WRITE8_HANDLER( tbowl_bg2videoram_w )
r814r815
8787   tileno ^= 0x400;
8888   col = (tbowl_bg2videoram[tile_index+0x1000] & 0xf0) >> 4;
8989
90   SET_TILE_INFO(2,tileno,col,0)
90   SET_TILE_INFO(2,tileno,col,0);
9191}
9292
9393WRITE8_HANDLER( tbowl_bgvideoram_w )
r814r815
204204
205205VIDEO_START( tbowl )
206206{
207   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
208   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,128,32);
209   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16,128,32);
207   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
208   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,128,32);
209   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,128,32);
210210
211211   tilemap_set_transparent_pen(tx_tilemap,0);
212212   tilemap_set_transparent_pen(bg_tilemap,0);
src/mame/video/battlane.c
r814r815
108108   int gfxn = (attr & 0x01) + 1;
109109   int color = (attr >> 1) & 0x03;
110110
111   SET_TILE_INFO(gfxn, code, color, 0)
111   SET_TILE_INFO(gfxn, code, color, 0);
112112}
113113
114static UINT32 battlane_tilemap_scan_rows_2x2( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
114static TILEMAP_MAPPER( battlane_tilemap_scan_rows_2x2 )
115115{
116116   /*
117117            Tilemap Memory Organization
r814r815
144144VIDEO_START( battlane )
145145{
146146   bg_tilemap = tilemap_create(get_tile_info_bg, battlane_tilemap_scan_rows_2x2,
147      TILEMAP_TYPE_OPAQUE, 16, 16, 32, 32);
147      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
148148
149149   screen_bitmap = auto_bitmap_alloc(32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED8);
150150}
src/mame/video/atarigt.c
r814r815
9595}
9696
9797
98static UINT32 atarigt_playfield_scan(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
98static TILEMAP_MAPPER( atarigt_playfield_scan )
9999{
100100   int bank = 1 - (col / (num_cols / 2));
101101   return bank * (num_rows * num_cols / 2) + row * (num_cols / 2) + (col % (num_cols / 2));
r814r815
138138   atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
139139
140140   /* initialize the playfield */
141   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigt_playfield_scan, TILEMAP_TYPE_OPAQUE, 8,8, 128,64);
141   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigt_playfield_scan, TILEMAP_TYPE_PEN, 8,8, 128,64);
142142
143143   /* initialize the motion objects */
144144   atarirle_init(0, &adjusted_modesc);
145145
146146   /* initialize the alphanumerics */
147   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 64,32);
147   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
148148
149149   /* allocate temp bitmaps */
150150   pf_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
src/mame/video/thepit.c
r814r815
178178   }
179179
180180   SET_TILE_INFO(2 * graphics_bank, code, fore_color, 0);
181   tileinfo->priority = priority;
181   tileinfo->category = priority;
182182}
183183
184184
r814r815
191191
192192static void video_start_common(UINT8 _color_count, int _color_granularity)
193193{
194   thepit_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
194   thepit_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
195195
196196   tilemap_set_scroll_cols(thepit_tilemap, 32);
197197
src/mame/video/rpunch.c
r814r815
5050         0,
5151         code,
5252         ((videoflags & 0x0010) >> 1) | ((data >> 13) & 7),
53         0)
53         0);
5454}
5555
5656static TILE_GET_INFO( get_bg1_tile_info )
r814r815
6464         1,
6565         code,
6666         ((videoflags & 0x0020) >> 2) | ((data >> 13) & 7),
67         0)
67         0);
6868}
6969
7070
r814r815
8585VIDEO_START( rpunch )
8686{
8787   /* allocate tilemaps for the backgrounds */
88   background[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,     8,8,64,64);
89   background[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
88   background[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     8,8,64,64);
89   background[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,64);
9090
9191   /* configure the tilemaps */
9292   tilemap_set_transparent_pen(background[1],15);
src/mame/video/yard.c
r814r815
191191   int color = attr & 0x1f;
192192   int flags = (attr & 0x20) ? TILE_FLIPX : 0;
193193
194   SET_TILE_INFO(0, code, color, flags)
194   SET_TILE_INFO(0, code, color, flags);
195195}
196196
197197static UINT32 yard_tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
r814r815
206206VIDEO_START( yard )
207207{
208208   bg_tilemap = tilemap_create(yard_get_bg_tile_info, yard_tilemap_scan_rows,
209      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
209      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
210210
211211   scroll_panel_bitmap = auto_bitmap_alloc(SCROLL_PANEL_WIDTH, machine->screen[0].height, machine->screen[0].format);
212212}
src/mame/video/crimfght.c
r814r815
7676{
7777   K052109_tilemap_update();
7878
79   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_IGNORE_TRANSPARENCY,0);
79   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,0);
8080   K051960_sprites_draw(bitmap,cliprect,2,2);
8181   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0);
8282   K051960_sprites_draw(bitmap,cliprect,1,1);
src/mame/video/asuka.c
r814r815
5858   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
5959   fillbitmap(bitmap, machine->pens[0], cliprect);
6060
61   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
61   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
6262   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2);
6363   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4);
6464
r814r815
8383   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
8484   fillbitmap(bitmap, machine->pens[0], cliprect);
8585
86   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_IGNORE_TRANSPARENCY,1);
86   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
8787   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2);
8888   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4);
8989
src/mame/video/triplhnt.c
r814r815
2121static tilemap* bg_tilemap;
2222
2323
24static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
25{
26   return num_cols * row + col;
27}
28
29
3024static TILE_GET_INFO( get_tile_info )
3125{
3226   int code = triplhnt_playfield_ram[tile_index] & 0x3f;
3327
34   SET_TILE_INFO(2, code, code == 0x3f ? 1 : 0, 0)
28   SET_TILE_INFO(2, code, code == 0x3f ? 1 : 0, 0);
3529}
3630
3731
r814r815
3933{
4034   helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
4135
42   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, 0, 16, 16, 16, 16);
36   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 0, 16, 16, 16, 16);
4337}
4438
4539
src/mame/video/pooyan.c
r814r815
9999   int color = attr & 0x0f;
100100   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
101101
102   SET_TILE_INFO(0, code, color, flags)
102   SET_TILE_INFO(0, code, color, flags);
103103}
104104
105105VIDEO_START( pooyan )
106106{
107107   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
108      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
108      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
109109}
110110
111111static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/rollerg.c
r814r815
5353   zoom_colorbase = 0;
5454
5555   K053245_vh_start(machine,0,REGION_GFX1,NORMAL_PLANE_ORDER,sprite_callback);
56   K051316_vh_start_0(machine,REGION_GFX2,4,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback);
56   K051316_vh_start_0(machine,REGION_GFX2,4,FALSE,0,zoom_callback);
5757
5858   K051316_set_offset(0, 22, 1);
5959}
src/mame/video/sidepckt.c
r814r815
5151         0,
5252         videoram[tile_index] + ((attr & 0x07) << 8),
5353         ((attr & 0x10) >> 3) | ((attr & 0x20) >> 5),
54         TILE_FLIPX | TILE_SPLIT((attr & 0x80) >> 7))
54         TILE_FLIPX);
55   tileinfo->group = (attr & 0x80) >> 7;
5556}
5657
5758
r814r815
6465
6566VIDEO_START( sidepckt )
6667{
67   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_SPLIT,8,8,32,32);
68   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
6869
6970   tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */
7071   tilemap_set_transmask(bg_tilemap,1,0x01,0xfe); /* split type 1 has pen 0 transparent in front half */
r814r815
141142
142143VIDEO_UPDATE( sidepckt )
143144{
144   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_BACK,0);
145   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0);
145146   draw_sprites(machine, bitmap,cliprect);
146   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_FRONT,0);
147   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0);
147148   return 0;
148149}
src/mame/video/pirates.c
r814r815
1616   int code = pirates_tx_tileram[tile_index*2];
1717   int colr = pirates_tx_tileram[tile_index*2+1];
1818
19   SET_TILE_INFO(0,code,colr,0)
19   SET_TILE_INFO(0,code,colr,0);
2020}
2121
2222static TILE_GET_INFO( get_fg_tile_info )
r814r815
2424   int code = pirates_fg_tileram[tile_index*2];
2525   int colr = pirates_fg_tileram[tile_index*2+1]+0x80;
2626
27   SET_TILE_INFO(0,code,colr,0)
27   SET_TILE_INFO(0,code,colr,0);
2828}
2929
3030static TILE_GET_INFO( get_bg_tile_info )
r814r815
3232   int code = pirates_bg_tileram[tile_index*2];
3333   int colr = pirates_bg_tileram[tile_index*2+1]+ 0x100;
3434
35   SET_TILE_INFO(0,code,colr,0)
35   SET_TILE_INFO(0,code,colr,0);
3636}
3737
3838
r814r815
4040
4141VIDEO_START(pirates)
4242{
43   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,36,32);
43   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,36,32);
4444
4545   /* Not sure how big they can be, Pirates uses only 32 columns, Genix 44 */
46   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
47   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,     8,8,64,32);
46   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
47   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     8,8,64,32);
4848
4949   tilemap_set_transparent_pen(tx_tilemap,0);
5050   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/tankbatt.c
r814r815
7474   int code = videoram[tile_index];
7575   int color = videoram[tile_index] >> 2;
7676
77   SET_TILE_INFO(0, code, color, 0)
77   SET_TILE_INFO(0, code, color, 0);
7878}
7979
8080VIDEO_START( tankbatt )
8181{
8282   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
83      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
83      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
8484}
8585
8686static void draw_bullets(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/wrally.c
r814r815
4545   int data2 = wrally_videoram[(tile_index << 1) + 1];
4646   int code = data & 0x3fff;
4747
48   SET_TILE_INFO(0, code, data2 & 0x1f, TILE_FLIPXY((data2 >> 5) & 0x00))
48   SET_TILE_INFO(0, code, data2 & 0x1f, TILE_FLIPXY((data2 >> 5) & 0x00));
4949}
5050
5151static TILE_GET_INFO( get_tile_info_wrally_screen1 )
r814r815
5454   int data2 = wrally_videoram[(0x2000/2) + (tile_index << 1) + 1];
5555   int code = data & 0x3fff;
5656
57   SET_TILE_INFO(0, code, data2 & 0x1f, TILE_FLIPXY((data2 >> 5) & 0x00))
57   SET_TILE_INFO(0, code, data2 & 0x1f, TILE_FLIPXY((data2 >> 5) & 0x00));
5858}
5959
6060/***************************************************************************
r814r815
7979
8080VIDEO_START( wrally )
8181{
82   pant[0] = tilemap_create(get_tile_info_wrally_screen0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
83   pant[1] = tilemap_create(get_tile_info_wrally_screen1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
82   pant[0] = tilemap_create(get_tile_info_wrally_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
83   pant[1] = tilemap_create(get_tile_info_wrally_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
8484
8585   tilemap_set_transparent_pen(pant[0],0);
8686   tilemap_set_transparent_pen(pant[1],0);
src/mame/video/mosaic.c
r814r815
2929         0,
3030         mosaic_fgvideoram[tile_index] + (mosaic_fgvideoram[tile_index+1] << 8),
3131         0,
32         0)
32         0);
3333}
3434
3535static TILE_GET_INFO( get_bg_tile_info )
r814r815
3939         1,
4040         mosaic_bgvideoram[tile_index] + (mosaic_bgvideoram[tile_index+1] << 8),
4141         0,
42         0)
42         0);
4343}
4444
4545
r814r815
5252
5353VIDEO_START( mosaic )
5454{
55   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
56   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,32);
55   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
56   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
5757
5858   tilemap_set_transparent_pen(fg_tilemap,0xff);
5959}
src/mame/video/segas18.c
r814r815
218218   fillbitmap(priority_bitmap, 0, cliprect);
219219
220220   /* draw background opaquely first, not setting any priorities */
221   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_IGNORE_TRANSPARENCY, 0x00);
222   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_IGNORE_TRANSPARENCY, 0x00);
221   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
222   segaic16_tilemap_draw(machine, 0, bitmap, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
223223   if (vdp_enable && vdplayer == 0) draw_vdp(bitmap, cliprect, vdppri);
224224
225225   /* draw background again to draw non-transparent pixels over the VDP and set the priority */
src/mame/video/crospang.c
r814r815
9191   int tile  = data & 0xfff;
9292   int color = (data >> 12) & 0x0f;
9393
94   SET_TILE_INFO(1,tile+ bestri_tilebank * 0x1000,color + 0x20,0)
94   SET_TILE_INFO(1,tile+ bestri_tilebank * 0x1000,color + 0x20,0);
9595}
9696
9797static TILE_GET_INFO( get_fg_tile_info )
r814r815
100100   int tile  = data & 0xfff;
101101   int color = (data >> 12) & 0x0f;
102102
103   SET_TILE_INFO(1,tile+ bestri_tilebank * 0x1000,color + 0x10,0)
103   SET_TILE_INFO(1,tile+ bestri_tilebank * 0x1000,color + 0x10,0);
104104}
105105
106106/*
r814r815
190190
191191VIDEO_START( crospang )
192192{
193   bg_layer = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,16,16,32,32);
194   fg_layer = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
193   bg_layer = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
194   fg_layer = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
195195
196196   tilemap_set_transparent_pen(fg_layer,0);
197197   bestri_tilebank = 0;
src/mame/video/darkmist.c
r814r815
2929      1,
3030        code,
3131        pal,
32        0)
32        0);
3333}
3434
3535static TILE_GET_INFO( get_fgtile_info )
r814r815
5050      1,
5151        code,
5252        pal,
53        0)
53        0);
5454}
5555
5656static TILE_GET_INFO( get_txttile_info )
r814r815
6969      0,
7070        code,
7171        pal,
72        0)
72        0);
7373}
7474
7575PALETTE_INIT(darkmist)
r814r815
137137
138138VIDEO_START(darkmist)
139139{
140   bgtilemap = tilemap_create( get_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,16,16,512,64 );
141   fgtilemap = tilemap_create( get_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,256 );
142   txtilemap = tilemap_create( get_txttile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32 );
140   bgtilemap = tilemap_create( get_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,512,64 );
141   fgtilemap = tilemap_create( get_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,256 );
142   txtilemap = tilemap_create( get_txttile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
143143   tilemap_set_transparent_pen(fgtilemap, 0);
144144   tilemap_set_transparent_pen(txtilemap, 0);
145145}
src/mame/video/exctsccr.c
r814r815
135135   int code = videoram[tile_index];
136136   int color = colorram[tile_index] & 0x1f;
137137
138   SET_TILE_INFO(gfx_bank, code, color, 0)
138   SET_TILE_INFO(gfx_bank, code, color, 0);
139139}
140140
141141VIDEO_START( exctsccr )
142142{
143143   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
144      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
144      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
145145
146146   mame_timer_pulse(MAME_TIME_IN_HZ(75), 0, exctsccr_fm_callback); /* updates fm */
147147}
src/mame/video/ajax.c
r814r815
7777   zoom_colorbase = 6;   /* == 48 since it's 7-bit graphics */
7878   K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tile_callback);
7979   K051960_vh_start(machine,REGION_GFX2,NORMAL_PLANE_ORDER,sprite_callback);
80   K051316_vh_start_0(machine,REGION_GFX3,7,TILEMAP_TYPE_TRANSPARENT,0,zoom_callback);
80   K051316_vh_start_0(machine,REGION_GFX3,7,FALSE,0,zoom_callback);
8181}
8282
8383
src/mame/video/shisen.c
r814r815
4949   int code = videoram[offs] + ((videoram[offs + 1] & 0x0f) << 8) + (gfxbank << 12);
5050   int color = (videoram[offs + 1] & 0xf0) >> 4;
5151
52   SET_TILE_INFO(0, code, color, 0)
52   SET_TILE_INFO(0, code, color, 0);
5353}
5454
5555VIDEO_START( sichuan2 )
5656{
5757   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
58      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
58      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5959}
6060
6161VIDEO_UPDATE( sichuan2 )
src/mame/video/nmk16.c
r814r815
2323***************************************************************************/
2424
2525//not 100% right yet (check attract mode in raphero)
26static UINT32 bg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
26static TILEMAP_MAPPER( bg_scan )
2727{
2828   /* logical (col,row) -> memory offset */
2929
r814r815
3232   return (row & 0x0f) + ((col & 0x6ff) << 4) + ((row & 0x70) << 8);
3333}
3434
35static UINT32 bg_scan_td2(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
35static TILEMAP_MAPPER( bg_scan_td2 )
3636{
3737   /* logical (col,row) -> memory offset */
3838   return (row & 0x0f) + ((col & 0x3ff) << 4) + ((row & 0x70) << 10);
r814r815
4646         1,
4747         (code & 0xfff) + (bgbank << 12),
4848         code >> 12,
49         0)
49         0);
5050}
5151
5252static TILE_GET_INFO( strahl_get_fg_tile_info )
r814r815
5656         3,
5757         (code & 0xfff),
5858         code >> 12,
59         0)
59         0);
6060}
6161
6262static TILE_GET_INFO( macross_get_tx_tile_info )
r814r815
6666         0,
6767         code & 0xfff,
6868         code >> 12,
69         0)
69         0);
7070}
7171
7272static TILE_GET_INFO( bjtwin_get_bg_tile_info )
r814r815
7777         bank,
7878         (code & 0x7ff) + ((bank) ? (bgbank << 11) : 0),
7979         code >> 12,
80         0)
80         0);
8181}
8282
8383
r814r815
9090
9191VIDEO_START( bioship )
9292{
93   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_TRANSPARENT,16,16,256,32);
94   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
93   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
94   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
9595   spriteram_old = auto_malloc(spriteram_size);
9696   spriteram_old2 = auto_malloc(spriteram_size);
9797   background_bitmap = auto_bitmap_alloc(8192,512,machine->screen[0].format);
r814r815
109109
110110VIDEO_START( strahl )
111111{
112   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_OPAQUE,16,16,256,32);
113   fg_tilemap = tilemap_create(strahl_get_fg_tile_info, bg_scan,TILEMAP_TYPE_TRANSPARENT,16,16,256,32);
114   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
112   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
113   fg_tilemap = tilemap_create(strahl_get_fg_tile_info, bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
114   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
115115   spriteram_old = auto_malloc(spriteram_size);
116116   spriteram_old2 = auto_malloc(spriteram_size);
117117
r814r815
127127
128128VIDEO_START( macross )
129129{
130   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_OPAQUE,16,16,256,32);
131   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
130   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
131   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
132132   spriteram_old = auto_malloc(spriteram_size);
133133   spriteram_old2 = auto_malloc(spriteram_size);
134134
r814r815
143143
144144VIDEO_START( gunnail )
145145{
146   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_OPAQUE,16,16,256,32);
147   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
146   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
147   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
148148   spriteram_old = auto_malloc(spriteram_size);
149149   spriteram_old2 = auto_malloc(spriteram_size);
150150
r814r815
161161
162162VIDEO_START( macross2 )
163163{
164   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_OPAQUE,16,16,1024,128);
165   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
164   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,1024,128);
165   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
166166   spriteram_old = auto_malloc(spriteram_size);
167167   spriteram_old2 = auto_malloc(spriteram_size);
168168
r814r815
178178
179179VIDEO_START( tdragon2 )
180180{
181   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan_td2,TILEMAP_TYPE_OPAQUE,16,16,1024,32);
182   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
181   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan_td2,TILEMAP_TYPE_PEN,16,16,1024,32);
182   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
183183   spriteram_old = auto_malloc(spriteram_size);
184184   spriteram_old2 = auto_malloc(spriteram_size);
185185
r814r815
195195
196196VIDEO_START( bjtwin )
197197{
198   bg_tilemap = tilemap_create(bjtwin_get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,8,8,64,32);
198   bg_tilemap = tilemap_create(bjtwin_get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
199199   spriteram_old = auto_malloc(spriteram_size);
200200   spriteram_old2 = auto_malloc(spriteram_size);
201201
src/mame/video/nitedrvr.c
r814r815
2929{
3030   int code = videoram[tile_index] & 0x3f;
3131
32   SET_TILE_INFO(0, code, 0, 0)
32   SET_TILE_INFO(0, code, 0, 0);
3333}
3434
3535
r814r815
3737VIDEO_START( nitedrvr )
3838{
3939   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
40      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
40      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
4141}
4242
4343static void draw_box(running_machine *machine, mame_bitmap *bitmap, int bx, int by, int ex, int ey )
src/mame/drivers/rcasino.c
r814r815
9797   int code = videoram[tile_index] + ((attr & 0x30) << 4);
9898   int color = attr & 0x0f;
9999
100   SET_TILE_INFO(bank, code, color, 0)
100   SET_TILE_INFO(bank, code, color, 0);
101101}
102102
103103VIDEO_START(rcasino)
104104{
105105   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
106      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
106      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
107107}
108108
109109VIDEO_UPDATE(rcasino)
src/mame/drivers/mgolf.c
r814r815
2121{
2222   UINT8 code = mgolf_video_ram[tile_index];
2323
24   SET_TILE_INFO(0, code, code >> 7, 0)
24   SET_TILE_INFO(0, code, code >> 7, 0);
2525}
2626
2727
r814r815
3434
3535static VIDEO_START( mgolf )
3636{
37   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
37   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
3838}
3939
4040
src/mame/drivers/cshooter.c
r814r815
127127         rg,
128128         (code & 0x1ff),
129129         0x2c+(attr&0x1f), //test
130         0)
130         0);
131131}
132132
133133WRITE8_HANDLER(cshooter_txram_w)
r814r815
138138
139139VIDEO_START(cshooter)
140140{
141   cshooter_txtilemap = tilemap_create(get_cstx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32, 32);
141   cshooter_txtilemap = tilemap_create(get_cstx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
142142   tilemap_set_transparent_pen(cshooter_txtilemap, 3);
143143}
144144
src/mame/drivers/coinmstr.c
r814r815
530530   tile |= (attr_ram1[tile_index + 0x0240] & 0x80) << 1;
531531   tile |= (attr_ram2[tile_index + 0x0240] & 0x80) << 2;
532532
533   SET_TILE_INFO(0,tile,color,0)
533   SET_TILE_INFO(0,tile,color,0);
534534}
535535
536536VIDEO_START( coinmstr )
537537{
538   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8, 46, 64);
538   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 46, 64);
539539}
540540
541541VIDEO_UPDATE( coinmstr )
src/mame/drivers/hitme.c
r814r815
5555
5656static VIDEO_START(hitme)
5757{
58   hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8,10, 40,19);
58   hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,10, 40,19);
5959}
6060
6161
6262static VIDEO_START(barricad)
6363{
64   hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8,8, 32,24);
64   hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8, 32,24);
6565}
6666
6767
src/mame/drivers/cntsteer.c
r814r815
6868{
6969   int code = videoram2[tile_index];
7070
71   SET_TILE_INFO(2, code + bg_bank, 0/*colo*/, 0)
71   SET_TILE_INFO(2, code + bg_bank, 0/*colo*/, 0);
7272}
7373
7474static TILE_GET_INFO( get_fg_tile_info )
r814r815
7676   int code = videoram[tile_index];
7777   int attr = videoram[tile_index + 0x400];
7878
79   SET_TILE_INFO(0, code + ((attr & 0x0f) << 8), ((attr & 0x70) >> 4)+colo, 0)
79   SET_TILE_INFO(0, code + ((attr & 0x0f) << 8), ((attr & 0x70) >> 4)+colo, 0);
8080}
8181
8282VIDEO_START( zerotrgt )
8383{
84   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,       TILEMAP_TYPE_OPAQUE,     16,16,64,64);
85   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows_flip_x,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
84   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,       TILEMAP_TYPE_PEN,     16,16,64,64);
85   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows_flip_x,TILEMAP_TYPE_PEN, 8, 8,32,32);
8686
8787   tilemap_set_transparent_pen(fg_tilemap,0);
8888
src/mame/drivers/hornet.c
r814r815
323323
324324   if (chip == 0)
325325   {
326      K037122_layer[chip][0] = tilemap_create(K037122_0_tile_info_layer0, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 256, 64);
327      K037122_layer[chip][1] = tilemap_create(K037122_0_tile_info_layer1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 128, 64);
326      K037122_layer[chip][0] = tilemap_create(K037122_0_tile_info_layer0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
327      K037122_layer[chip][1] = tilemap_create(K037122_0_tile_info_layer1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 128, 64);
328328   }
329329   else
330330   {
331      K037122_layer[chip][0] = tilemap_create(K037122_1_tile_info_layer0, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 256, 64);
332      K037122_layer[chip][1] = tilemap_create(K037122_1_tile_info_layer1, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 128, 64);
331      K037122_layer[chip][0] = tilemap_create(K037122_1_tile_info_layer0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
332      K037122_layer[chip][1] = tilemap_create(K037122_1_tile_info_layer1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 128, 64);
333333   }
334334
335335   tilemap_set_transparent_pen(K037122_layer[chip][0], 0);
src/mame/drivers/mwarr.c
r814r815
276276   tileno = bg_videoram[tile_index] & 0x1fff;
277277   colour = (bg_videoram[tile_index] & 0xe000) >> 13;
278278
279   SET_TILE_INFO(4,tileno,colour,0)
279   SET_TILE_INFO(4,tileno,colour,0);
280280}
281281
282282static TILE_GET_INFO( get_mlow_tile_info )
r814r815
286286   tileno = mlow_videoram[tile_index] & 0x1fff;
287287   colour = (mlow_videoram[tile_index] & 0xe000) >> 13;
288288
289   SET_TILE_INFO(3,tileno,colour,0)
289   SET_TILE_INFO(3,tileno,colour,0);
290290}
291291
292292static TILE_GET_INFO( get_mhigh_tile_info )
r814r815
296296   tileno = mhigh_videoram[tile_index] & 0x1fff;
297297   colour = (mhigh_videoram[tile_index] & 0xe000) >> 13;
298298
299   SET_TILE_INFO(2,tileno,colour,0)
299   SET_TILE_INFO(2,tileno,colour,0);
300300}
301301
302302static TILE_GET_INFO( get_tx_tile_info )
r814r815
306306   tileno = tx_videoram[tile_index] & 0x1fff;
307307   colour = (tx_videoram[tile_index] & 0xe000) >> 13;
308308
309   SET_TILE_INFO(1,tileno,colour,0)
309   SET_TILE_INFO(1,tileno,colour,0);
310310}
311311
312312VIDEO_START( mwarr )
313313{
314   bg_tilemap    = tilemap_create(get_bg_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,      16, 16,64,16);
315   mlow_tilemap  = tilemap_create(get_mlow_tile_info, tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT, 16, 16,64,16);
316   mhigh_tilemap = tilemap_create(get_mhigh_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT, 16, 16,64,16);
317   tx_tilemap    = tilemap_create(get_tx_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,  8,  8,64,32);
314   bg_tilemap    = tilemap_create(get_bg_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_PEN,      16, 16,64,16);
315   mlow_tilemap  = tilemap_create(get_mlow_tile_info, tilemap_scan_cols,TILEMAP_TYPE_PEN, 16, 16,64,16);
316   mhigh_tilemap = tilemap_create(get_mhigh_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 16, 16,64,16);
317   tx_tilemap    = tilemap_create(get_tx_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,  8,64,32);
318318
319319   sprites_buffer = auto_malloc(sizeof(UINT16) * 0x800);
320320
src/mame/drivers/vroulet.c
r814r815
8181   int code = videoram[tile_index] + ((attr & 0xc0) << 2);
8282   int color = attr & 0x1f;
8383
84   SET_TILE_INFO(0, code, color, 0)
84   SET_TILE_INFO(0, code, color, 0);
8585}
8686
8787VIDEO_START(vroulet)
8888{
8989   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
90      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
90      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9191}
9292
9393VIDEO_UPDATE(vroulet)
src/mame/drivers/suprnova.c
r814r815
456456{
457457   mame_timer_pulse(MAME_TIME_IN_MSEC(2), 15, interrupt_callback);
458458   mame_timer_pulse(MAME_TIME_IN_MSEC(8), 11, interrupt_callback);
459   mame_timer_pulse(MAME_TIME_IN_CYCLES(0,1824), 9, interrupt_callback);
459   mame_timer_pulse(MAME_TIME_IN_CYCLES(1824, 0), 9, interrupt_callback);
460460
461461   memory_set_bankptr(1,memory_region(REGION_USER1));
462462}
src/mame/drivers/witch.c
r814r815
229229         1,
230230         code,//tiles beyond 0x7ff only for sprites?
231231         color & 0x0f,
232         0)
232         0);
233233}
234234
235235static TILE_GET_INFO( get_gfx0a_tile_info )
r814r815
248248         1,
249249         code,//tiles beyond 0x7ff only for sprites?
250250         color & 0x0f,
251         0)
251         0);
252252}
253253
254254static TILE_GET_INFO( get_gfx1_tile_info )
r814r815
260260         0,
261261         code | ((color & 0xf0) << 4),
262262         (color>>0) & 0x0f,
263         0)
263         0);
264264}
265265
266266static WRITE8_HANDLER( gfx0_vram_w )
r814r815
681681
682682VIDEO_START(witch)
683683{
684   gfx0a_tilemap = tilemap_create(get_gfx0a_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
685   gfx0b_tilemap = tilemap_create(get_gfx0b_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
686   gfx1_tilemap = tilemap_create(get_gfx1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
684   gfx0a_tilemap = tilemap_create(get_gfx0a_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
685   gfx0b_tilemap = tilemap_create(get_gfx0b_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
686   gfx1_tilemap = tilemap_create(get_gfx1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
687687
688688   tilemap_set_transparent_pen(gfx0a_tilemap,0);
689689   tilemap_set_transparent_pen(gfx0b_tilemap,0);
src/mame/drivers/itech32.c
r814r815
6060
6161    GT Classic was the last chipset for this platform and was sold mainly as an upgrade for GT99/GT2K
6262
63    Starting with GT Fore!, I.T. moved to a redesigned hardware platform based on a PC like main board
64        with a 3Dfx video card and is hard drive based.  This series starts with GT Fore! in 2000
65        and continues through 2005, it is also I.T.'s current gaming platform.  Some time in 2004
66        I.T. introduced a new bowling game called Silver Strike Bowling on a full blown PC type
67        system to replace it's aging World Class Bowling game.
68
6963    Later versions of games (Golden Tee Golf, Shuffle Shot & World Class
7064    Bowling) converged to a single platform, the large single PCB
7165    (P/N 1082 Rev 2).  With the correct jumpers setting (surface mounted)
7266    and chipset this board can run any of the 3 listed programs.
7367
68    Starting with GT Fore!, I.T. moved to a redesigned hardware platform known as the Eagle platform.
69        It has a main board with a 3Dfx video card and is hard drive based. This series started with
70        GT Fore! in 2000 and continued through 2006 ending with Golden Tee Complete. This final
71        version incuded all the courses from the previous years in the Fore! series.
72        The Eagle platform also supports I.T.'s hunting series "Big Buck Hunter" and the light game
73        gun called Carnival King.
74
75        Some time in 2004 I.T. introduced a new bowling game called Silver Strike Bowling on a full
76        blown PC type system to replace it's aging World Class Bowling game.
77
78    Trivia: For the Golden Tee series, the second generation was called GT2.  The third gen was known
79            as GT3 but also included Golden Tee '97 through 2K and Classic.  The fourth gen on the
80            Eagle platform was GT4... using the pun or play on words became the GT Fore! series ;-)
81
7482****************************************************************************
7583
7684    Memory map TBD
r814r815
19571965   ROM_LOAD32_BYTE( "wcbdprm3.200", 0x00003, 0x20000, CRC(43ecad0b) SHA1(890a843c162c052a790e432db10f968875be835c) )
19581966
19591967   ROM_REGION( 0x28000, REGION_CPU2, 0 )
1960   ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) )
1968   ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) ) /* Actual version is 4.01 but may be labeled V4.0 or V4.01 */
19611969   ROM_CONTINUE(             0x08000, 0x08000 )
19621970
19631971   ROM_REGION( 0x880000, REGION_GFX1, 0 )
r814r815
19761984   ROM_FILL(                      0x500000, 0x380000, 0xff )
19771985
19781986   ROM_REGION16_BE( 0x400000, REGION_SOUND1, ROMREGION_ERASE00 )
1979   ROM_LOAD16_BYTE( "wcb_srom.0",  0x000000, 0x080000, CRC(d42dd283) SHA1(8ef75c398d1c51d2d7d299ac309a2352179864d9) )
1980   ROM_LOAD16_BYTE( "wcb_srom.1",  0x200000, 0x080000, CRC(7a69ab54) SHA1(d1f9194446e235af69c6ff28af0dccc44ab9b5d3) )
1987   ROM_LOAD16_BYTE( "wcb_srom.0",  0x000000, 0x080000, CRC(d42dd283) SHA1(8ef75c398d1c51d2d7d299ac309a2352179864d9) ) /* Newer sound sample roms */
1988   ROM_LOAD16_BYTE( "wcb_srom.1",  0x200000, 0x080000, CRC(7a69ab54) SHA1(d1f9194446e235af69c6ff28af0dccc44ab9b5d3) ) /* Newer sound sample roms */
19811989
19821990   ROM_REGION16_BE( 0x400000, REGION_SOUND2, ROMREGION_ERASE00 )
1983   ROM_LOAD16_BYTE( "wcb_srom.2",  0x000000, 0x080000, CRC(346530a2) SHA1(9951971ad6d368fb718027e18331d12f0a72970c) )
1984   ROM_LOAD16_BYTE( "wcb_srom.3",  0x200000, 0x040000, CRC(1dfe3a31) SHA1(94947f495692288fbf14fc7796a84c5548a2e8a8) )
1991   ROM_LOAD16_BYTE( "wcb_srom.2",  0x000000, 0x080000, CRC(346530a2) SHA1(9951971ad6d368fb718027e18331d12f0a72970c) ) /* Newer sound sample roms */
1992   ROM_LOAD16_BYTE( "wcb_srom.3",  0x200000, 0x040000, CRC(1dfe3a31) SHA1(94947f495692288fbf14fc7796a84c5548a2e8a8) ) /* Newer sound sample roms, rom is a 27C020 in this set */
19851993ROM_END
19861994
19871995
r814r815
19932001   ROM_LOAD32_BYTE( "wcb_prm3.166", 0x00003, 0x20000, CRC(dd72c796) SHA1(4c1542c51848a88a663e56ae0b47bf9d2d9f7d54) )
19942002
19952003   ROM_REGION( 0x28000, REGION_CPU2, 0 )
1996   ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) )
2004   ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) ) /* Actual version is 4.01 but may be labeled V4.0 or V4.01 */
19972005   ROM_CONTINUE(           0x08000, 0x08000 )
19982006
19992007   ROM_REGION( 0x880000, REGION_GFX1, 0 )
r814r815
20082016   ROM_FILL(                        0x400000, 0x480000, 0xff )
20092017
20102018   ROM_REGION16_BE( 0x400000, REGION_SOUND1, ROMREGION_ERASE00 )
2011   ROM_LOAD16_BYTE( "wcb_srom.0",  0x000000, 0x080000, CRC(d42dd283) SHA1(8ef75c398d1c51d2d7d299ac309a2352179864d9) )
2012   ROM_LOAD16_BYTE( "wcb_srom.1",  0x200000, 0x080000, CRC(7a69ab54) SHA1(d1f9194446e235af69c6ff28af0dccc44ab9b5d3) )
2019   ROM_LOAD16_BYTE( "wcb_srom.0",  0x000000, 0x080000, CRC(d42dd283) SHA1(8ef75c398d1c51d2d7d299ac309a2352179864d9) ) /* Newer sound sample roms */
2020   ROM_LOAD16_BYTE( "wcb_srom.1",  0x200000, 0x080000, CRC(7a69ab54) SHA1(d1f9194446e235af69c6ff28af0dccc44ab9b5d3) ) /* Newer sound sample roms */
20132021
20142022   ROM_REGION16_BE( 0x400000, REGION_SOUND2, ROMREGION_ERASE00 )
2015   ROM_LOAD16_BYTE( "wcb_srom.2",  0x000000, 0x080000, CRC(346530a2) SHA1(9951971ad6d368fb718027e18331d12f0a72970c) )
2016   ROM_LOAD16_BYTE( "wcb_srom.3",  0x200000, 0x040000, CRC(1dfe3a31) SHA1(94947f495692288fbf14fc7796a84c5548a2e8a8) )
2023   ROM_LOAD16_BYTE( "wcb_srom.2",  0x000000, 0x080000, CRC(346530a2) SHA1(9951971ad6d368fb718027e18331d12f0a72970c) ) /* Newer sound sample roms */
2024   ROM_LOAD16_BYTE( "wcb_srom.3",  0x200000, 0x040000, CRC(1dfe3a31) SHA1(94947f495692288fbf14fc7796a84c5548a2e8a8) ) /* Newer sound sample roms, rom is a 27C020 in this set */
20172025ROM_END
20182026
20192027
r814r815
20252033   ROM_LOAD32_BYTE( "wcb_prm3.165", 0x00003, 0x20000, CRC(4c6b4e4f) SHA1(77f5f4b632dd1919ae210bbdc75042bdbebf6660) )
20262034
20272035   ROM_REGION( 0x28000, REGION_CPU2, 0 )
2028   ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) )
2036   ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) ) /* Actual version is 4.01 but may be labeled V4.0 or V4.01 */
20292037   ROM_CONTINUE(           0x08000, 0x08000 )
20302038
20312039   ROM_REGION( 0x880000, REGION_GFX1, 0 )
r814r815
20402048   ROM_FILL(                        0x400000, 0x480000, 0xff )
20412049
20422050   ROM_REGION16_BE( 0x400000, REGION_SOUND1, ROMREGION_ERASE00 )
2043   ROM_LOAD16_BYTE( "wcb_srom.0",  0x000000, 0x080000, CRC(d42dd283) SHA1(8ef75c398d1c51d2d7d299ac309a2352179864d9) )
2044   ROM_LOAD16_BYTE( "wcb_srom.1",  0x200000, 0x080000, CRC(7a69ab54) SHA1(d1f9194446e235af69c6ff28af0dccc44ab9b5d3) )
2051   ROM_LOAD16_BYTE( "wcb_srom.0",  0x000000, 0x080000, CRC(d42dd283) SHA1(8ef75c398d1c51d2d7d299ac309a2352179864d9) ) /* Newer sound sample roms */
2052   ROM_LOAD16_BYTE( "wcb_srom.1",  0x200000, 0x080000, CRC(7a69ab54) SHA1(d1f9194446e235af69c6ff28af0dccc44ab9b5d3) ) /* Newer sound sample roms */
20452053
20462054   ROM_REGION16_BE( 0x400000, REGION_SOUND2, ROMREGION_ERASE00 )
2047   ROM_LOAD16_BYTE( "wcb_srom.2",  0x000000, 0x080000, CRC(346530a2) SHA1(9951971ad6d368fb718027e18331d12f0a72970c) )
2048   ROM_LOAD16_BYTE( "wcb_srom.3",  0x200000, 0x040000, CRC(1dfe3a31) SHA1(94947f495692288fbf14fc7796a84c5548a2e8a8) )
2055   ROM_LOAD16_BYTE( "wcb_srom.2",  0x000000, 0x080000, CRC(346530a2) SHA1(9951971ad6d368fb718027e18331d12f0a72970c) ) /* Newer sound sample roms */
2056   ROM_LOAD16_BYTE( "wcb_srom.3",  0x200000, 0x040000, CRC(1dfe3a31) SHA1(94947f495692288fbf14fc7796a84c5548a2e8a8) ) /* Newer sound sample roms, rom is a 27C020 in this set */
20492057ROM_END
20502058
20512059
r814r815
20572065   ROM_LOAD32_BYTE( "wcb_prm3.161", 0x00003, 0x20000, CRC(e5081f85) SHA1(a5513b8dd917a35f1c8b7f833c2d5622353d39f0) )
20582066
20592067   ROM_REGION( 0x28000, REGION_CPU2, 0 )
2060   ROM_LOAD( "wcbo_snd.u88", 0x10000, 0x18000, CRC(194a51d7) SHA1(c67b042008ff2a2713562d3789e5bc3a312fae17) )
2068   ROM_LOAD( "wcbo_snd.u88", 0x10000, 0x18000, CRC(194a51d7) SHA1(c67b042008ff2a2713562d3789e5bc3a312fae17) ) /* Version 4.0 */
20612069   ROM_CONTINUE(           0x08000, 0x08000 )
20622070
20632071   ROM_REGION( 0x880000, REGION_GFX1, 0 )
r814r815
20722080   ROM_FILL(                        0x400000, 0x480000, 0xff )
20732081
20742082   ROM_REGION16_BE( 0x400000, REGION_SOUND1, ROMREGION_ERASE00 )
2075   ROM_LOAD16_BYTE( "wcbosrom.0",  0x000000, 0x080000, CRC(c3821cb5) SHA1(3c2c27d1e577201cbd0d28cc48fc80ae7747faa1) )
2076   ROM_LOAD16_BYTE( "wcbosrom.1",  0x200000, 0x080000, CRC(afa24888) SHA1(169eaedd09e0214ac72c932903a11bbb2ebc5bf1) )
2083   ROM_LOAD16_BYTE( "wcbosrom.0",  0x000000, 0x080000, CRC(c3821cb5) SHA1(3c2c27d1e577201cbd0d28cc48fc80ae7747faa1) ) /* Older sound sample roms */
2084   ROM_LOAD16_BYTE( "wcbosrom.1",  0x200000, 0x080000, CRC(afa24888) SHA1(169eaedd09e0214ac72c932903a11bbb2ebc5bf1) ) /* Older sound sample roms */
20772085
20782086   ROM_REGION16_BE( 0x400000, REGION_SOUND2, ROMREGION_ERASE00 )
2079   ROM_LOAD16_BYTE( "wcbosrom.2",  0x000000, 0x080000, CRC(f82c08fd) SHA1(8f6f47f5a4b68a31df4c2eb330dc95a9963e55c1) )
2080   ROM_LOAD16_BYTE( "wcbosrom.3",  0x200000, 0x020000, CRC(1c2efdee) SHA1(d306c9e7f9c4c2662561401170439a10a9ee89ed) )
2087   ROM_LOAD16_BYTE( "wcbosrom.2",  0x000000, 0x080000, CRC(f82c08fd) SHA1(8f6f47f5a4b68a31df4c2eb330dc95a9963e55c1) ) /* Older sound sample roms */
2088   ROM_LOAD16_BYTE( "wcbosrom.3",  0x200000, 0x020000, CRC(1c2efdee) SHA1(d306c9e7f9c4c2662561401170439a10a9ee89ed) ) /* Older sound sample roms, rom is a 27C010 in this set */
20812089ROM_END
20822090
20832091
r814r815
20892097   ROM_LOAD32_BYTE( "wcbtprm3.140", 0x00003, 0x20000, CRC(c41258a4) SHA1(182e8a25bdb126a4de8a44a1c26fd8b66f06d66e) )
20902098
20912099   ROM_REGION( 0x28000, REGION_CPU2, 0 )
2092   ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) )
2100   ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) ) /* Actual version is 4.01 but may be labeled V4.0 or V4.01 */
20932101   ROM_CONTINUE(             0x08000, 0x08000 )
20942102
20952103   ROM_REGION( 0x880000, REGION_GFX1, 0 )
r814r815
21082116   ROM_FILL(                        0x500000, 0x380000, 0xff )
21092117
21102118   ROM_REGION16_BE( 0x400000, REGION_SOUND1, ROMREGION_ERASE00 )
2111   ROM_LOAD16_BYTE( "wcb_srom.0",  0x000000, 0x080000, CRC(d42dd283) SHA1(8ef75c398d1c51d2d7d299ac309a2352179864d9) )
2112   ROM_LOAD16_BYTE( "wcb_srom.1",  0x200000, 0x080000, CRC(7a69ab54) SHA1(d1f9194446e235af69c6ff28af0dccc44ab9b5d3) )
2119   ROM_LOAD16_BYTE( "wcb_srom.0",  0x000000, 0x080000, CRC(d42dd283) SHA1(8ef75c398d1c51d2d7d299ac309a2352179864d9) ) /* Newer sound sample roms */
2120   ROM_LOAD16_BYTE( "wcb_srom.1",  0x200000, 0x080000, CRC(7a69ab54) SHA1(d1f9194446e235af69c6ff28af0dccc44ab9b5d3) ) /* Newer sound sample roms */
21132121
21142122   ROM_REGION16_BE( 0x400000, REGION_SOUND2, ROMREGION_ERASE00 )
2115   ROM_LOAD16_BYTE( "wcb_srom.2",  0x000000, 0x080000, CRC(346530a2) SHA1(9951971ad6d368fb718027e18331d12f0a72970c) )
2116   ROM_LOAD16_BYTE( "wcb_srom.3",  0x200000, 0x040000, CRC(1dfe3a31) SHA1(94947f495692288fbf14fc7796a84c5548a2e8a8) )
2123   ROM_LOAD16_BYTE( "wcb_srom.2",  0x000000, 0x080000, CRC(346530a2) SHA1(9951971ad6d368fb718027e18331d12f0a72970c) ) /* Newer sound sample roms */
2124   ROM_LOAD16_BYTE( "wcb_srom.3",  0x200000, 0x040000, CRC(1dfe3a31) SHA1(94947f495692288fbf14fc7796a84c5548a2e8a8) ) /* Newer sound sample roms, rom is a 27C020 in this set */
21172125ROM_END
21182126
21192127
r814r815
38533861
38543862  GT Royal Edition Tournament is a Euro GT99
38553863  GT Supreme Edition Tournament is a Euro GT2K with slightly different GROM2_0 through GROM2_3
3856     GT Supreme (on a real PCB with tournament data) comes up with a different title screen and is (c) 2002
3864     GT Supreme (on a real PCB with actual tournament data) comes up with a different title screen and is (c) 2002
38573865     showing the title as GT Supreme Plus! and the Hole-In-One board shows an aditional course, Coconut Cove from GT99
3858     Current emulation does not reproduce this extra title screen.
3866     Current emulation does not reproduce this extra title screen due to missing tournament data.
38593867  GT Diamond Edition Tournament is a Euro GT Classic (Not currently dumped)
38603868     This would be the only known tournament version of Classic
38613869
src/mame/drivers/superdq.c
r814r815
4949{
5050   int tile = videoram[tile_index];
5151
52   SET_TILE_INFO(0,tile,superdq_color_bank,0)
52   SET_TILE_INFO(0,tile,superdq_color_bank,0);
5353}
5454
5555VIDEO_START( superdq )
5656{
57   superdq_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
57   superdq_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 32, 32);
5858
5959   add_exit_callback(machine, video_cleanup);
6060}
src/mame/drivers/bestleag.c
r814r815
3333         0,
3434         (code & 0x0fff)|0x8000,
3535         (code & 0xf000) >> 12,
36         0)
36         0);
3737}
3838
3939static TILE_GET_INFO( get_bg_tile_info )
r814r815
4444         1,
4545         (code & 0x0fff),
4646         (code & 0xf000) >> 12,
47         0)
47         0);
4848}
4949
5050static TILE_GET_INFO( get_fg_tile_info )
r814r815
5555         1,
5656         (code & 0x0fff)|0x1000,
5757         ((code & 0xf000) >> 12)|0x10,
58         0)
58         0);
5959}
6060
61static UINT32 bsb_bg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
61static TILEMAP_MAPPER( bsb_bg_scan )
6262{
6363   int offset;
6464
r814r815
7171
7272VIDEO_START(bestleag)
7373{
74   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,256, 32);
75   bg_tilemap = tilemap_create(get_bg_tile_info,bsb_bg_scan,TILEMAP_TYPE_OPAQUE,16,16,128, 64);
76   fg_tilemap = tilemap_create(get_fg_tile_info,bsb_bg_scan,TILEMAP_TYPE_TRANSPARENT,16,16,128, 64);
74   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,256, 32);
75   bg_tilemap = tilemap_create(get_bg_tile_info,bsb_bg_scan,TILEMAP_TYPE_PEN,16,16,128, 64);
76   fg_tilemap = tilemap_create(get_fg_tile_info,bsb_bg_scan,TILEMAP_TYPE_PEN,16,16,128, 64);
7777
7878   tilemap_set_transparent_pen(tx_tilemap,15);
7979   tilemap_set_transparent_pen(fg_tilemap,15);
src/mame/drivers/cowrace.c
r814r815
2727static TILE_GET_INFO( get_tile_info )
2828{
2929   UINT16 code = videoram[ tile_index ] + (colorram[ tile_index ] << 8) ;
30   SET_TILE_INFO(1, code & 0x1ff, 0, TILE_FLIPYX( 0 ));
30   SET_TILE_INFO(1, code & 0x1ff, 0, TILE_FLIPYX( 0 ));;
3131}
3232
3333VIDEO_START( cowrace )
3434{
3535   tmap = tilemap_create(   get_tile_info, tilemap_scan_rows,
36                     TILEMAP_TYPE_TRANSPARENT, 8,8, 0x20,0x20   );
36                     TILEMAP_TYPE_PEN, 8,8, 0x20,0x20   );
3737
3838   tilemap_set_transparent_pen(tmap, 0);
3939}
src/mame/drivers/koikoi.c
r814r815
5454   int color = videoram[tile_index+0x400]&0x1f;
5555   int flip  =(videoram[tile_index+0x400]&0x80)?(TILEMAP_FLIPX|TILEMAP_FLIPY):0;
5656
57   SET_TILE_INFO(   0,   code,   color, flip)
57   SET_TILE_INFO(   0,   code,   color, flip);
5858}
5959
6060static WRITE8_HANDLER(vram_w)
r814r815
211211
212212VIDEO_START(koikoi)
213213{
214   koikoi_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
214   koikoi_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
215215}
216216
217217VIDEO_UPDATE(koikoi)
src/mame/drivers/cybertnk.c
r814r815
187187         0,
188188         code & 0x1fff,
189189         (code & 0xe000) >> 13,
190         0)
190         0);
191191}
192192
193193VIDEO_START( cybertnk )
194194{
195   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,128,32);
195   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,32);
196196}
197197
198198VIDEO_UPDATE( cybertnk )
src/mame/drivers/mpu4.c
r814r815
26912691   tileno = dealem_videoram[tile_index];
26922692   colour = dealem_videoram[tile_index];
26932693
2694   SET_TILE_INFO(0,tileno,colour,0)
2694   SET_TILE_INFO(0,tileno,colour,0);
26952695}
26962696
26972697VIDEO_START(dealem)
26982698{
2699   dealem_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,32,32);
2699   dealem_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
27002700}
27012701
27022702WRITE8_HANDLER( dealem_videoram_w )
src/mame/drivers/skylncr.c
r814r815
5858#define PAGES_PER_TMAP_X   (0x2)
5959#define PAGES_PER_TMAP_Y   (0x2)
6060
61UINT32 skylncr_tilemap_scan_pages(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
61static TILEMAP_MAPPER( skylncr_tilemap_scan_pages )
6262{
6363   return   (col / TILES_PER_PAGE_X) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y +
6464         (col % TILES_PER_PAGE_X) +
r814r815
7171{
7272
7373   tmap = tilemap_create(   get_tile_info, tilemap_scan_rows,
74                     TILEMAP_TYPE_TRANSPARENT, 8,8, 0x40,0x20   );
74                     TILEMAP_TYPE_PEN, 8,8, 0x40,0x20   );
7575
7676   tmap2 = tilemap_create(   get_tile_info2, skylncr_tilemap_scan_pages,
77                     TILEMAP_TYPE_TRANSPARENT, 8,32,
77                     TILEMAP_TYPE_PEN, 8,32,
7878                     TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y );
7979
8080   tilemap_set_transparent_pen(tmap,  0);
src/mame/drivers/limenko.c
r814r815
170170{
171171   int tile  = bg_videoram[tile_index] & 0x7ffff;
172172   int color = (bg_videoram[tile_index]>>28) & 0xf;
173   SET_TILE_INFO(0,tile,color,0)
173   SET_TILE_INFO(0,tile,color,0);
174174}
175175
176176static TILE_GET_INFO( get_md_tile_info )
177177{
178178   int tile  = md_videoram[tile_index] & 0x7ffff;
179179   int color = (md_videoram[tile_index]>>28) & 0xf;
180   SET_TILE_INFO(0,tile,color,0)
180   SET_TILE_INFO(0,tile,color,0);
181181}
182182
183183static TILE_GET_INFO( get_fg_tile_info )
184184{
185185   int tile  = fg_videoram[tile_index] & 0x7ffff;
186186   int color = (fg_videoram[tile_index]>>28) & 0xf;
187   SET_TILE_INFO(0,tile,color,0)
187   SET_TILE_INFO(0,tile,color,0);
188188}
189189
190190// sprites aren't tile based (except for 8x8 ones)
r814r815
273273
274274VIDEO_START( limenko )
275275{
276   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,128,64);
277   md_tilemap = tilemap_create(get_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
278   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,128,64);
276   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,128,64);
277   md_tilemap = tilemap_create(get_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
278   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
279279
280280   tilemap_set_transparent_pen(md_tilemap,0);
281281   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/drivers/pipeline.c
r814r815
7171      0,
7272      code,
7373      0,
74      0)
74      0);
7575}
7676
7777static TILE_GET_INFO( get_tile_info2 )
r814r815
8484      code,
8585      color,
8686      0
87   )
87   );
8888}
8989
9090VIDEO_START ( pipeline )
9191{
9292   palram=auto_malloc(0x1000);
93   tilemap1 = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32 );
94   tilemap2 = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32 );
93   tilemap1 = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
94   tilemap2 = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
9595   tilemap_set_transparent_pen(tilemap2,0);
9696}
9797
src/mame/drivers/calorie.c
r814r815
9595   int color = src[bg_base + tile_index + 0x100] & 0x0f;
9696   int flag  = src[bg_base + tile_index + 0x100] & 0x40 ? TILE_FLIPX : 0;
9797
98   SET_TILE_INFO(1, code, color, flag)
98   SET_TILE_INFO(1, code, color, flag);
9999}
100100
101101static TILE_GET_INFO( get_fg_tile_info )
r814r815
103103   int code  = ((calorie_fg[tile_index + 0x400] & 0x30) << 4) | calorie_fg[tile_index];
104104   int color = calorie_fg[tile_index + 0x400] & 0x0f;
105105
106   SET_TILE_INFO(0, code, color, TILE_FLIPYX((calorie_fg[tile_index + 0x400] & 0xc0) >> 6))
106   SET_TILE_INFO(0, code, color, TILE_FLIPYX((calorie_fg[tile_index + 0x400] & 0xc0) >> 6));
107107}
108108
109109
110110VIDEO_START( calorie )
111111{
112   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,16,16);
113   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
112   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,16,16);
113   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
114114
115115   tilemap_set_transparent_pen(fg_tilemap,0);
116116}
r814r815
126126   }
127127   else
128128   {
129      tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
129      tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_OPAQUE,0);
130130   }
131131
132132
src/mame/drivers/drtomy.c
r814r815
1818{
1919   int code  = drtomy_videoram_fg[tile_index] & 0xfff;
2020   int color = (drtomy_videoram_fg[tile_index] & 0xf000) >> 12;
21   SET_TILE_INFO(2, code, color, 0)
21   SET_TILE_INFO(2, code, color, 0);
2222}
2323
2424
r814r815
2626{
2727   int code  = drtomy_videoram_bg[tile_index] & 0xfff;
2828   int color = (drtomy_videoram_bg[tile_index] & 0xf000) >> 12;
29   SET_TILE_INFO(1, code, color, 0)
29   SET_TILE_INFO(1, code, color, 0);
3030}
3131
3232
r814r815
9191
9292VIDEO_START( drtomy )
9393{
94   tilemap_bg = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,      16,16,32,32);
95   tilemap_fg = tilemap_create(get_tile_info_fg,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16,16,32,32);
94   tilemap_bg = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16,32,32);
95   tilemap_fg = tilemap_create(get_tile_info_fg,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16,16,32,32);
9696
9797   tilemap_set_transparent_pen(tilemap_fg,0);
9898}
src/mame/drivers/gdrawpkr.c
r814r815
199199//  if (attr == 0x32)   /* Is the palette wrong? */
200200//      color = 0x3a;   /* 0x3a is the best match */
201201
202   SET_TILE_INFO(bank, code, color, 0)
202   SET_TILE_INFO(bank, code, color, 0);
203203}
204204
205205VIDEO_START( gdrawpkr )
206206{
207207   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
208      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 31);
208      TILEMAP_TYPE_PEN, 8, 8, 32, 31);
209209}
210210
211211VIDEO_UPDATE( gdrawpkr )
src/mame/drivers/galaxian.c
r814r815
4747mooncrsb    bootleg of mooncrs2. ROM/RAM check erased.
4848
4949
50Stephh's additional notes (based on the games Z80 code and some tests) for "Moon Cresta" and its numerous clones :
51
52a) 'mooncrst'
53
54  - made by Nichibutsu
55  - inputs :
56      * player 1 controls are used by player 1
57      * player 2 controls are used by player 2, even in an "upright" cabinet
58  - 2 coins slots with different settings :
59      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
60      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
61  - no writes to 0xa003, so no coin counters
62  - bonus life at 30000 or 50000 based on a Dip Switch
63  - possible partial Japanese text based on a Dip Switch
64  - hi-score : 11 chars (even if only 10 will be displayed), 60 seconds to enter
65  - players bullet speed : 4 pixels - lower limit : 0x04
66  - ingame bug : if you reset the game when screen is flipped, it isn't flipped back
67  - driver possible bug (which occurs for all "Moon Cresta" sets but 'mooncrgx') :
68    when the screen is flipped, sprites are too shifted (see for example player 2
69    score which misses ending '0') while bullets shall be good
70    as a consequence, square around letters is wrong when entering player name
71    for hi-score table when screen is flipped
72
73b) 'mooncrsu'
74
75  - made by Nichibutsu
76  - very similar to 'mooncrst' with the only following differences :
77      * additional "USA" display after "Nichibutsu" (which is shifted left)
78      * writes to 0xb000 to 0xb0ff on reset ('mooncrst' only writes to 0xb000),
79        so there is no screen flipped ingame bug as in 'mooncrst'
80
81c) 'mooncrsa'
82
83  - made by Nichibutsu
84  - additional "(c)" display before "Nichibutsu"
85  - "(c) 1980 NIHON BUSSAN CO. , LTD" display replaced with "May 1980" in yellow
86  - code at 0x1f00 has been removed ! I can't determine was is was supposed to do,
87    but it's based on number of enemies left (stored at 0x823c) and possible time
88    spent on the level (stored at 0x8226). Any hint is fully welcome !
89  - this version is easier than 'mooncrst' : look at high nibbles that are stored
90    at 0x809b and 0x809c via code at 0x0cb8 (0x01 and 0x02 instead of 0x11 and 0x12).
91  - 2 coins slots, but same settings : 1C_1C / 1C_2C / 1C_3C / "Free Play"
92  - same other infos as in 'mooncrst'
93  - same ingame bug as in 'mooncrst'
94
95d) 'mooncrs2'
96
97  - bootleg (possibily based on a Gremlin version we don't have)
98  - heavily based on 'mooncrsa' with additional RAM/ROM check routine at 0x3ea1
99  - some "chars" have been erased from the GFX ROMS but some routines which
100    "prints" them are still there (but there are less than in 'mooncrsa')
101  - same other infos as in 'mooncrst'
102  - due to numerous writes in the RAM/ROM check routine, there is no screen flipped
103    ingame bug as in 'mooncrst'
104
105e) 'mooncrsb'
106
107  - bootleg (possibily based on a Gremlin version we don't have)
108  - the only difference with 'mooncrs2' is that RAM/ROM check routine at 0x3ea1
109    has completely been "noped" and the jump at address 0x0004 has been changed
110  - all "chars" from the GFX ROMS haven't been erased, so you can see the top
111    of the "Gremlin" logo as copyright and hi-scores names
112  - same ingame bug as in 'mooncrst'
113
114f) 'mooncrs3'
115
116  - bootleg
117  - very similar to 'mooncrs2' with the only following differences :
118      * checksum of ROM area 0x0000-0x3fff is computed, but the result is discarded
119        (see "xor a" operation at 0x3fc0 instead of "and a")
120      * coins stuff is different (see below)
121  - 2 coins slots with different settings (same as 'mooncrst') :
122      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
123      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
124  - there are writes to 0xa003 (check code at 0x1b8e and 0x1b9e) which occur
125    when you insert a coin, but I can't confirm it's related to coin counters
126    as the same value is written when you press COIN1 or COIN2
127
128g) 'mooncrsg'
129
130  - made by Gremlin
131  - there are MANY changes and additions, and I wonder if there's such a Nichibutsu set;
132    anyway, closest set to this one seems to be 'mooncrst'
133  - Gremin "logo" on 2 lines instead of Nichibutsu copyright messages (2 lines)
134  - additional test for IN0 bit 7 (code at 0x0174) which always adds 1 credit
135  - there are writes to 0xa003 (check code at 0x0158 and 0x0160) which occur
136    when you insert a coin, but I can't confirm it's related to coin counters
137    as the same value is written when you press COIN1 or COIN2
138  - only English text (Dip Switch has no effect due to code at 0x2f77)
139  - hi-score : 3 chars, 10 seconds to enter
140  - same difficulty as in 'monncrst' (but stored at 0x809e and 0x809f)
141  - same other infos as in 'mooncrst'
142  - same ingame bug as in 'mooncrst'
143
144h) 'fantazia'
145
146  - made by Subelectro
147  - closest set to this one seems to be 'mooncrsb'
148  - all intro texts have been changed as well as colors
149  - inputs :
150      * player 1 controls are used by player 1
151      * player 2 controls are used by player 2, only in a "cocktail" cabinet
152    look at additional routine at 0x29e0
153  - 2 coins slots with different settings (inverted coin A/B compared to 'mooncrst') :
154      * coin A : 1C_1C / 1C_2C / 1C_3C / "Free Play"
155      * coin B : 1C_1C / 2C_1C / 3C_1C / 4C_1C
156  - only English text (Dip Switch has no effect due to code at 0x2f53)
157  - hi-score : 3 chars, 60 seconds to enter
158  - same other infos as in 'mooncrst'
159  - same ingame bug as in 'mooncrst'
160
161i) 'eagle'
162
163  - made by Centuri
164  - very similar to 'mooncrsb' with the only following differences :
165      * only 3 chars for hi-score instead of 11
166      * all other changes are modified "strings" to be displayed
167        (the intro texts but copyright remains though) as well as
168        new GFX (I can't test the sound for now to check)
169  - same ingame bug as in 'mooncrst'
170
171j) 'eagle2'
172
173  - made by Centuri
174  - very similar to 'eagle' with the only following differences :
175      * only 20 seconds to enter hi-score instead of 60
176      * coins stuff is different (see below)
177      * one GFX ROM is slighlty different
178  - 2 coins slots, but same settings : 1C_1C / 2C_1C / 3C_1C / 4C_1C
179  - previous "Coin B" Dip Switch is now only tested to see if in "Freeplay" mode
180  - same ingame bug as in 'mooncrst'
181
182k) 'eagle3'
183
184  - made by Centuri
185  - PRG ROMS are the same as for 'eagle' while two GFX ROMS are slighly different
186    (so the game is having 'mooncrst' ships and 'eagle' enemies)
187  - same ingame bug as in 'mooncrst'
188
189l) 'spctbird'
190
191  - made by Fortrek
192  - very similar to 'mooncrsb' with the only following difference :
193      * coins stuff is different (same as in 'eagle2' - see below)
194  - 2 coins slots, but same settings : 1C_1C / 2C_1C / 3C_1C / 4C_1C
195  - previous "Coin B" Dip Switch is now only tested to see if in "Freeplay" mode
196  - same ingame bug as in 'mooncrst'
197
198m) 'smooncrs'
199
200  - made par Gremlin (bootleg based on a Nichibutsu version we don't have ?)
201  - same RAM/ROM check routine as in 'mooncrs2' (so there is no screen flipped
202    ingame bug as in 'mooncrst'), but LOTS of new features !
203  - only top of the Gremlin logo is displayed and it is also used for hi-scores
204  - all intro texts have been changed
205  - "2'ST" instead of "2'ND" and "RECORD" instead of "HI-SCORE"
206  - additional "PLAYER 1/2" messages when player changes
207  - inputs : player 1 controls are used by players 1 and 2, even in a "cocktail"
208    cabinet (player 2 inputs are never read due to code at 0x2b1c and 0x3313)
209  - 2 coins slots with different settings :
210      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
211      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
212    additional wrong (Spanish) text displayed when "Coin B" set to 1C_1C
213    (check additional code at 0x0fae) :
214      * if "Coin A" set to 4C_1C, "1 MONEDA 1 PARTIDA" on one line
215      * if "Coin A" set to 2C_1C, "1 MONEDA 1 PARTIDA" on one line
216        and "2 MONEDAS 3 PARTIDAS" on another line below
217    when "Coin B" set to "Free Play", "CREDIT 04" instead of "FREE PLAY" string
218    (even if this number of credits is decremented when you press a START button,
219     it is put back to 04 when the game is over for all players)
220  - additional "POR" display after the number of credits
221  - bonus life always 50000 due to code at 0x2f68
222  - only English text due to code at 0x2f53
223  - hi-score : 3 chars, 60 seconds to enter
224  - players bullet speed : 9 or 12 pixels (using previous "Language" Dip Switch) -
225    lower limit : 0x0f (see additional routine at 0x0007 and call from 0x3407)
226  - game difficulty using previous "Bonus Life" Dip Switch (code at 0x2962)
227    however, even with "Easy" difficulty, the game is much harder as in 'mooncrs2'
228    as enemies as enemies move much faster and as they shoot on some levels
229  - docking stage is harder has there are gaps of 2 pixels instead of 1
230  - when you complete the 8 stages, "O.K." "FANTASTIC" messages on 2 lines
231    instead of "FAR OUT !" message on 1 line
232  - same ingame bug as in 'mooncrst'
233  - another ingame bug : when in "cocktail mode", "PLAYER 1/2" messages are
234    displayed BEFORE the screen is flipped (back)
235  - driver other bugs :
236      * when screen is flipped, player's bullets aren't displayed
237      * when screen is flipped, enemies' bullets aren't flipped
238
239n) 'spcdrag'
240
241  - bootleg
242  - heavily based on 'smooncrs' (so there's a RAM/ROM check) but some differences though
243  - same intro texts as in 'mooncrs2'
244  - 2 coins slots with different settings :
245      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
246      * coin B : 1C_2C / 1C_3C / 1C_4C / "Free Play"
247    additional wrong (Engrish) text displayed when "Coin B" set to 1C_2C
248    (check additional code at 0x0fae) :
249      * if "Coin A" set to 4C_1C, "1 COIN   1 PLAY   " on one line
250      * if "Coin A" set to 2C_1C, "1 COIN   1 PLAY   " on one line
251        and "2 COINS   3 PLAYES  " (notice the spelling) on another line below
252    when "Coin B" set to "Free Play", "CREDIT 04" instead of "FREE PLAY" string
253    (even if this number of credits is decremented when you press a START button,
254     it is put back to 04 when the game is over for all players)
255  - "CAP 2" display instead of "POR" after the number of credits
256  - hi-score : 11 chars (even if only 10 will be displayed), 60 seconds to enter
257    (same as in 'mooncrs2')
258  - players bullet speed : 6 or 9 pixels (using previous "Language" Dip Switch) -
259    lower limit : 0x04 (instead of speed 9/12 and lower limit 0x0f)
260  - even if there's also the "Difficulty" Dip Switch, the game is a little bit easier
261    (enemies speed is slower and docking stage is back to 1 pixel to fit 'mooncrs2')
262  - when you complete the 8 stages, same "FAR OUT !" message as in 'mooncrs2'
263  - driver bug : even if player's bullets are displayed when screen is flipped as in
264    other sets, enemies' bullets are still not flipped as in 'smooncrs'
265
266o) 'spcdraga'
267
268  - bootleg ? (there's a Nichibutsu logo which is displayed in the "title" screen
269    as well as in the hi-scores)
270  - very similar to 'spcdrag' with the only following (comestical) differences :
271      * unused routine at 0x37a8 has been "noped"
272      * no text after the number of credits
273      * all texts have been translated to Spanish
274
275p) 'mooncrgx'
276
277  - bootleg on "Galaxian" hardware
278  - very similar to 'mooncrsb' with the only following differences :
279      * all unused routines have been "noped"
280      * settings are different (see below)
281  - 2 coins slots with different settings :
282      * coin A : 1C_1C / 2C_1C
283      * coin B : 1C_3C / 1C_5C
284  - there are writes to 0x6003 when you press COIN1 but not when you press COIN2
285  - there are also writes to (unmapped) 0x6804 when you press either COIN1 or COIN2 :
286      * when you press COIN1, 0x00 is written once
287      * when you press COIN2, 0x01 is written 5 times, then 0x00 is written once
288  - only English text (Dip Switch has no effect due to code at 0x2f4b)
289  - no ingame bug due to code at 0x2f77
290  - driver possible bug : while sprites are now correct when screen is flipped,
291    they are too shifted when screen is not flipped (again, see for example player 2
292    score which misses ending '0') while bullets shall be good
293    as a consequence, square around letters is wrong when entering player name
294    for hi-score table when screen not is flipped
295
296
50297Notes about 'azurian' :
51298-----------------------
52299
53300  bit 6 of IN1 is linked with bit 2 of IN2 (check code at 0x05b3) to set difficulty :
54301
55    bit 6  bit 2    contents of
56     IN1     IN2          0x40f4            consequences            difficulty
302    bit 6  bit 2        contents of
303     IN1     IN2          0x40f4            consequences                   difficulty
57304
58305     OFF     OFF             2          aliens move 2 frames out of 3       easy
59306     ON      OFF             4          aliens move 4 frames out of 5       hard
r814r815
67314    - alien 3 moves when 0x4064 != 0 else contents of 0x40f4 is stored at 0x4064
68315
69316
70Notes about 'smooncrs' :
71------------------------
72
73  Due to code at 0x2b1c and 0x3306, the game ALWAYS checks the inputs for player 1
74  (even for player 2 when "Cabinet" Dip Switch is set to "Cocktail")
75
76
77317Notes about 'scorpnmc' :
78318-----------------------
79319
r814r815
20332273   PORT_START_TAG("IN1")
20342274   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
20352275   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2036   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2037   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2038   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2276   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2277   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2278   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
20392279   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
20402280   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
20412281   PORT_DIPSETTING(    0x00, "30000" )
r814r815
20582298   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
20592299INPUT_PORTS_END
20602300
2301INPUT_PORTS_START( mooncrsa )
2302MOON_IN0
2303   PORT_START_TAG("IN1")
2304   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2305   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2306   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2307   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2308   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2309   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2310   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2311   PORT_DIPSETTING(    0x00, "30000" )
2312   PORT_DIPSETTING(    0x40, "50000" )
2313   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
2314   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2315   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2316
2317   PORT_START_TAG("DSW")
2318//  PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )           Not used due to code at 0x01c0
2319//  PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2320//  PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2321//  PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2322//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2323   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
2324   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2325   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2326   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2327   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2328   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2329INPUT_PORTS_END
2330
20612331INPUT_PORTS_START( mooncrsg )
20622332   PORT_START_TAG("IN0")
20632333   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r814r815
20742344   PORT_START_TAG("IN1")
20752345   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
20762346   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2077   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2078   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2079   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2347   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2348   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2349   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
20802350   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
20812351   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
20822352   PORT_DIPSETTING(    0x00, "30000" )
20832353   PORT_DIPSETTING(    0x40, "50000" )
2084//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always 'English' due to code at 0x2f77
2354//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always non-Japanese due to code at 0x2f77
20852355//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
20862356//  PORT_DIPSETTING(    0x00, DEF_STR( English ) )
20872357
r814r815
20992369   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
21002370INPUT_PORTS_END
21012371
2102INPUT_PORTS_START( smooncrs )
2372INPUT_PORTS_START( fantazia )
21032373MOON_IN0
21042374   PORT_START_TAG("IN1")
21052375   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
21062376   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2107   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )      /* Not read due to code at 0x2b1c and 0x3306 */
2108   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )      /* Not read due to code at 0x2b1c and 0x3306 */
2109   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )      /* Not read due to code at 0x2b1c and 0x3306 */
2377   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2378   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2379   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
21102380   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2111//  PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )   Always '50000' due to code at 0x2f68
2112//  PORT_DIPSETTING(    0x00, "30000" )
2113//  PORT_DIPSETTING(    0x40, "50000" )
2114//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always 'English' due to code at 0x2f53
2381   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2382   PORT_DIPSETTING(    0x00, "30000" )
2383   PORT_DIPSETTING(    0x40, "50000" )
2384//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always non-Japanese due to code at 0x2f53
21152385//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
21162386//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
21172387
21182388   PORT_START_TAG("DSW")
2119   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
2389   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
21202390   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
21212391   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
21222392   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
21232393   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2124   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
2394   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_A ) )
21252395   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
21262396   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
21272397   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
r814r815
21292399   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
21302400INPUT_PORTS_END
21312401
2132INPUT_PORTS_START( mooncrsa )
2402INPUT_PORTS_START( eagle )
21332403MOON_IN0
21342404   PORT_START_TAG("IN1")
21352405   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
21362406   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2137   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2138   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2139   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2407   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2408   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2409   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
21402410   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
21412411   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
21422412   PORT_DIPSETTING(    0x00, "30000" )
r814r815
21462416   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
21472417
21482418   PORT_START_TAG("DSW")
2149//  PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )       Not used due to code at 0x01c0
2419//  PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )           Not used due to code at 0x01c0
21502420//  PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
21512421//  PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
21522422//  PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
r814r815
21592429   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
21602430INPUT_PORTS_END
21612431
2162INPUT_PORTS_START( fantazia )
2432INPUT_PORTS_START( eagle2 )
21632433MOON_IN0
21642434   PORT_START_TAG("IN1")
21652435   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
21662436   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2167   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2168   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2169   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2437   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2438   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2439   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
21702440   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
21712441   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
21722442   PORT_DIPSETTING(    0x00, "30000" )
21732443   PORT_DIPSETTING(    0x40, "50000" )
2174//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always 'English' due to code at 0x2f53
2175//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2176//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2444   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
2445   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2446   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
21772447
21782448   PORT_START_TAG("DSW")
2179   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
2449   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
21802450   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
21812451   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
21822452   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
21832453   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2184   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_A ) )
2185   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2186   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2187   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2188   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2454//  PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )           Not used due to code at 0x01c0,
2455//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )            but "Free Play" is checked
2456//  PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2457//  PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2458//  PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2459   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Free_Play ) )
2460   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2461//  PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2462//  PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2463   PORT_DIPSETTING(    0x0c, DEF_STR( On ) )
21892464   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
21902465INPUT_PORTS_END
21912466
2192INPUT_PORTS_START( eagle )
2467INPUT_PORTS_START( smooncrs )
21932468MOON_IN0
21942469   PORT_START_TAG("IN1")
21952470   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
21962471   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2197   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2198   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2199   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2472   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2473   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2474   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
22002475   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2201   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2202   PORT_DIPSETTING(    0x00, "30000" )
2203   PORT_DIPSETTING(    0x40, "50000" )
2204   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
2205   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2206   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2476//  PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )       Always '50000' due to code at 0x2f68
2477//  PORT_DIPSETTING(    0x00, "30000" )
2478//  PORT_DIPSETTING(    0x40, "50000" )
2479//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always non-Japanese due to code at 0x2f53
2480//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2481//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2482   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )      /* code at 0x2962 */
2483   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
2484   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2485   PORT_DIPNAME( 0x80, 0x80, "Player's Bullet Speed" )      /* code at 0x0007 */
2486   PORT_DIPSETTING(    0x00, "Slow" )
2487   PORT_DIPSETTING(    0x80, "Fast" )
22072488
22082489   PORT_START_TAG("DSW")
2209//  PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )       Not used due to code at 0x01c0
2210//  PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2211//  PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2212//  PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2213//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2214   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
2490   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )         /* see notes */
2491   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2492   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2493   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
22152494   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2495   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
2496   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
22162497   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
22172498   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
22182499   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
22192500   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
22202501INPUT_PORTS_END
22212502
2222INPUT_PORTS_START( eagle2 )
2503INPUT_PORTS_START( spcdrag )
22232504MOON_IN0
22242505   PORT_START_TAG("IN1")
22252506   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
22262507   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2227   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2228   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2229   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2508   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2509   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2510   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
22302511   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2231   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2232   PORT_DIPSETTING(    0x00, "30000" )
2233   PORT_DIPSETTING(    0x40, "50000" )
2234   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
2235   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2236   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2512//  PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )       Always '50000' due to code at 0x2f68
2513//  PORT_DIPSETTING(    0x00, "30000" )
2514//  PORT_DIPSETTING(    0x40, "50000" )
2515//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always non-Japanese due to code at 0x2f53
2516//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2517//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2518   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )      /* code at 0x2962 */
2519   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
2520   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2521   PORT_DIPNAME( 0x80, 0x80, "Player's Bullet Speed" )      /* code at 0x0007 */
2522   PORT_DIPSETTING(    0x00, "Slow" )
2523   PORT_DIPSETTING(    0x80, "Fast" )
22372524
22382525   PORT_START_TAG("DSW")
2239   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
2526   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )         /* see notes */
22402527   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
22412528   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
22422529   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
22432530   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2244//  PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )       Not used due to code at 0x01c0,
2245//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )        but "Free Play" is checked
2246//  PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2247//  PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2248//  PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2249   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Free_Play ) )
2250   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2251//  PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2252//  PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2253   PORT_DIPSETTING(    0x0c, DEF_STR( On ) )
2531   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
2532   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2533   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
2534   PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C ) )
2535   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
22542536   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
22552537INPUT_PORTS_END
22562538
r814r815
22582540   PORT_START_TAG("IN0")
22592541   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
22602542   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2261   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
2262   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2263   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2543   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2544   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2545   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
22642546   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
22652547   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
22662548   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
r814r815
22682550   PORT_START_TAG("IN1")
22692551   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
22702552   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2271   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2272   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2273   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2553   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2554   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2555   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
22742556   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
22752557   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
22762558   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
r814r815
22862568   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
22872569   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
22882570   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
2289//  PORT_DIPNAME( 0x04, 0x04, DEF_STR( Language ) )         Always 'English' due to code removed at 0x2f4b
2571//  PORT_DIPNAME( 0x04, 0x04, DEF_STR( Language ) )         Always non-Japanese due to code removed at 0x2f4b
22902572//  PORT_DIPSETTING(    0x04, DEF_STR( English ) )
22912573//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
22922574   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
r814r815
54725754
54735755   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
54745756   ROM_LOAD( "a2.7a",  0x0000, 0x0800, CRC(38b042dd) SHA1(bd452dae4cbc22a900cf783f84d1f9d8cb1218f9) )
5475   ROM_LOAD( "a4.7a",  0x0800, 0x0800, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
5757   ROM_LOAD( "a4.7a",  0x0800, 0x0200, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
5758   ROM_CONTINUE(      0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
5759   ROM_CONTINUE(      0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
5760   ROM_CONTINUE(      0x0e00, 0x0200 )
54765761   ROM_LOAD( "a1.9a",  0x1000, 0x0800, CRC(24441ab3) SHA1(8c9d2bd062cb2360f3dd3df2d7d212e9485f91ad) )
5477   ROM_LOAD( "a3.9a",  0x1800, 0x0800, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
5762   ROM_LOAD( "a3.9a",  0x1800, 0x0200, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
5763   ROM_CONTINUE(      0x1c00, 0x0200 )
5764   ROM_CONTINUE(      0x1a00, 0x0200 )
5765   ROM_CONTINUE(      0x1e00, 0x0200 )
54785766
54795767   ROM_REGION( 0x0020, REGION_PROMS, 0 )
54805768   // not present in this set
r814r815
63776665GAME( 1980, mooncrsu, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "Nichibutsu USA", "Moon Cresta (Nichibutsu, unencrypted)", GAME_SUPPORTS_SAVE )
63786666GAME( 1980, mooncrsa, mooncrst, mooncrst, mooncrsa, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu, old rev)", GAME_SUPPORTS_SAVE )
63796667GAME( 1980, mooncrsg, mooncrst, mooncrst, mooncrsg, mooncrsu, ROT90,  "Gremlin", "Moon Cresta (Gremlin)", GAME_SUPPORTS_SAVE )
6380GAME( 1980?,smooncrs, mooncrst, mooncrst, smooncrs, mooncrsu, ROT90,  "Gremlin", "Super Moon Cresta", GAME_SUPPORTS_SAVE )
63816668GAME( 1980, mooncrsb, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Moon Cresta (bootleg set 1)", GAME_SUPPORTS_SAVE )
63826669GAME( 1980, mooncrs2, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "Nichibutsu", "Moon Cresta (bootleg set 2)", GAME_SUPPORTS_SAVE )
6383// The boards were marked 'Space Dragon' although this doesn't appear in the games.
6384GAME( 1980, spcdrag,  mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Space Dragon (Moon Cresta bootleg, set 1)", GAME_SUPPORTS_SAVE )
6385GAME( 1980, spcdraga, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Space Dragon (Moon Cresta bootleg, set 2)", GAME_SUPPORTS_SAVE )
6386GAME( 1980, mooncrs3, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Moon Cresta (bootleg set 3)", GAME_SUPPORTS_SAVE ) /* Jeutel bootleg, similar to bootleg set 2 */
6387GAME( 1980, fantazia, mooncrst, mooncrst, fantazia, mooncrsu, ROT90,  "bootleg", "Fantazia", GAME_SUPPORTS_SAVE )
6670GAME( 1980, mooncrs3, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "bootleg", "Moon Cresta (bootleg set 3)", GAME_SUPPORTS_SAVE ) /* Jeutel bootleg, similar to bootleg set 2 */
6671GAME( 1980, fantazia, mooncrst, mooncrst, fantazia, mooncrsu, ROT90,  "Subelectro", "Fantazia (bootleg?)", GAME_SUPPORTS_SAVE )
63886672GAME( 1980, eagle,    mooncrst, mooncrst, eagle,    mooncrsu, ROT90,  "Centuri", "Eagle (set 1)", GAME_SUPPORTS_SAVE )
63896673GAME( 1980, eagle2,   mooncrst, mooncrst, eagle2,   mooncrsu, ROT90,  "Centuri", "Eagle (set 2)", GAME_SUPPORTS_SAVE )
63906674GAME( 1980, eagle3,   mooncrst, mooncrst, eagle,    mooncrsu, ROT90,  "Centuri", "Eagle (set 3)", GAME_SUPPORTS_SAVE )
63916675GAME( 1981?,spctbird, mooncrst, mooncrst, eagle2,   mooncrsu, ROT90,  "Fortrek", "Space Thunderbird", GAME_SUPPORTS_SAVE )
6676GAME( 1980?,smooncrs, mooncrst, mooncrst, smooncrs, mooncrsu, ROT90,  "Gremlin", "Super Moon Cresta", GAME_SUPPORTS_SAVE )
6677// The boards were marked 'Space Dragon' although this doesn't appear in the games.
6678GAME( 1980, spcdrag,  mooncrst, mooncrst, spcdrag,  mooncrsu, ROT90,  "bootleg", "Space Dragon (Moon Cresta bootleg, set 1)", GAME_SUPPORTS_SAVE )
6679GAME( 1980, spcdraga, mooncrst, mooncrst, spcdrag,  mooncrsu, ROT90,  "bootleg", "Space Dragon (Moon Cresta bootleg, set 2)", GAME_SUPPORTS_SAVE )
63926680GAME( 1980, mooncrgx, mooncrst, mooncrgx, mooncrgx, mooncrgx, ROT270, "bootleg", "Moon Cresta (Galaxian hardware)", GAME_SUPPORTS_SAVE )
63936681GAME( 1980, moonqsr,  0,        moonqsr,  moonqsr,  moonqsr,  ROT90,  "Nichibutsu", "Moon Quasar", GAME_SUPPORTS_SAVE )
63946682GAME( 1981, mshuttle, 0,        mshuttle, mshuttle, mshuttle, ROT0,   "Nichibutsu", "Moon Shuttle (US?)", GAME_SUPPORTS_SAVE )
6395GAME( 1981, mshuttlj, mshuttle, mshuttle, mshuttle, cclimbrj, ROT0,   "Nichibutsu", "Moon Shuttle (Japan)", GAME_SUPPORTS_SAVE )
6683GAME( 1981, mshuttlj, mshuttle, mshuttle, mshuttle, cclimbrj, ROT0,   "Nichibutsu", "Moon Shuttle (Japan set 1)", GAME_SUPPORTS_SAVE )
63966684GAME( 1981, mshutlj2, mshuttle, mshuttle, mshuttle, cclimbrj, ROT0,   "Nichibutsu", "Moon Shuttle (Japan set 2)", GAME_SUPPORTS_SAVE )
63976685GAME( 1980, moonal2,  0,        mooncrst, moonal2,  0,        ROT90,  "Nichibutsu", "Moon Alien Part 2", GAME_SUPPORTS_SAVE )
63986686GAME( 1980, moonal2b, moonal2,  mooncrst, moonal2,  0,        ROT90,  "Nichibutsu", "Moon Alien Part 2 (older version)", GAME_SUPPORTS_SAVE )
src/mame/drivers/fcrash.c
r814r815
102102      case 1:
103103      case 2:
104104      case 3:
105         tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_BACK,primask);
105         tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER1,primask);
106106         break;
107107   }
108108}
r814r815
117117      case 1:
118118      case 2:
119119      case 3:
120         tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_FRONT,1);
120         tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER0,1);
121121         break;
122122   }
123123}
src/mame/drivers/gstream.c
r814r815
511511   int tileno, palette;
512512   tileno  = (gstream_vram[tile_index+0x000/4]&0x0fff0000)>>16;
513513   palette = (gstream_vram[tile_index+0x000/4]&0xc0000000)>>30;
514   SET_TILE_INFO(0,tileno,palette+0x10,0)
514   SET_TILE_INFO(0,tileno,palette+0x10,0);
515515}
516516
517517static TILE_GET_INFO( get_gs2_tile_info )
r814r815
519519   int tileno, palette;
520520   tileno = (gstream_vram[tile_index+0x400/4]&0x0fff0000)>>16;
521521   palette =(gstream_vram[tile_index+0x400/4]&0xc0000000)>>30;
522   SET_TILE_INFO(0,tileno+0x1000,palette+0x14,0)
522   SET_TILE_INFO(0,tileno+0x1000,palette+0x14,0);
523523}
524524
525525
r814r815
528528   int tileno, palette;
529529   tileno = (gstream_vram[tile_index+0x800/4]&0x0fff0000)>>16;
530530   palette =(gstream_vram[tile_index+0x800/4]&0xc0000000)>>30;
531   SET_TILE_INFO(0,tileno+0x2000,palette+0x18,0)
531   SET_TILE_INFO(0,tileno+0x2000,palette+0x18,0);
532532}
533533
534534
535535VIDEO_START(gstream)
536536{
537   gstream_tilemap1 = tilemap_create(get_gs1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 32, 32,16,16);
538   gstream_tilemap2 = tilemap_create(get_gs2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 32, 32,16,16);
539   gstream_tilemap3 = tilemap_create(get_gs3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 32, 32,16,16);
537   gstream_tilemap1 = tilemap_create(get_gs1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 32, 32,16,16);
538   gstream_tilemap2 = tilemap_create(get_gs2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 32, 32,16,16);
539   gstream_tilemap3 = tilemap_create(get_gs3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 32, 32,16,16);
540540
541541   tilemap_set_transparent_pen(gstream_tilemap1,0);
542542   tilemap_set_transparent_pen(gstream_tilemap2,0);
src/mame/drivers/magic10.c
r814r815
278278
279279static TILE_GET_INFO( get_layer0_tile_info )
280280{
281   SET_TILE_INFO(1,layer0_videoram[tile_index*2],layer0_videoram[tile_index*2+1] & 0xf,TILE_FLIPYX((layer0_videoram[tile_index*2+1] & 0xc0) >> 6))
281   SET_TILE_INFO(1,layer0_videoram[tile_index*2],layer0_videoram[tile_index*2+1] & 0xf,TILE_FLIPYX((layer0_videoram[tile_index*2+1] & 0xc0) >> 6));
282282}
283283
284284static TILE_GET_INFO( get_layer1_tile_info )
285285{
286   SET_TILE_INFO(1,layer1_videoram[tile_index*2],layer1_videoram[tile_index*2+1] & 0xf,TILE_FLIPYX((layer1_videoram[tile_index*2+1] & 0xc0) >> 6))
286   SET_TILE_INFO(1,layer1_videoram[tile_index*2],layer1_videoram[tile_index*2+1] & 0xf,TILE_FLIPYX((layer1_videoram[tile_index*2+1] & 0xc0) >> 6));
287287}
288288
289289static TILE_GET_INFO( get_layer2_tile_info )
290290{
291   SET_TILE_INFO(0,layer2_videoram[tile_index*2],layer2_videoram[tile_index*2+1] & 0xf,0)
291   SET_TILE_INFO(0,layer2_videoram[tile_index*2],layer2_videoram[tile_index*2+1] & 0xf,0);
292292}
293293
294294
295295VIDEO_START( magic10 )
296296{
297   layer0_tilemap = tilemap_create(get_layer0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     16,16,32,32);
298   layer1_tilemap = tilemap_create(get_layer1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,32,32);
299   layer2_tilemap = tilemap_create(get_layer2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,64);
297   layer0_tilemap = tilemap_create(get_layer0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
298   layer1_tilemap = tilemap_create(get_layer1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
299   layer2_tilemap = tilemap_create(get_layer2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
300300
301301   tilemap_set_transparent_pen(layer1_tilemap,0);
302302   tilemap_set_transparent_pen(layer2_tilemap,0);
src/mame/drivers/raiden2.c
r814r815
180180
181181   tile = (tile & 0xfff) | (bg_bank << 12);
182182
183   SET_TILE_INFO(1,tile+0x0000,color,0)
183   SET_TILE_INFO(1,tile+0x0000,color,0);
184184}
185185
186186static TILE_GET_INFO( get_mid_tile_info )
r814r815
191191
192192   tile = (tile & 0xfff) | (mid_bank << 12);
193193
194   SET_TILE_INFO(1,tile,color,0)
194   SET_TILE_INFO(1,tile,color,0);
195195}
196196
197197static TILE_GET_INFO( get_fore_tile_info )
r814r815
204204   tile = (tile & 0xfff) | (fg_bank << 12);
205205   //  tile = (tile & 0xfff) | (3<<12);  // 3000 intro (cliff) 1000 game (bg )
206206
207   SET_TILE_INFO(1,tile,color,0)
207   SET_TILE_INFO(1,tile,color,0);
208208}
209209
210210static TILE_GET_INFO( get_text_tile_info )
r814r815
215215
216216   tile &= 0xfff;
217217
218   SET_TILE_INFO(0,tile,color,0)
218   SET_TILE_INFO(0,tile,color,0);
219219}
220220
221221static void set_scroll(tilemap *tm, int plane)
r814r815
230230
231231VIDEO_START(raiden2)
232232{
233   text_layer       = tilemap_create( get_text_tile_info,tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT,  8, 8,64,32 );
234   background_layer = tilemap_create( get_back_tile_info,tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      16,16,32,32 );
235   midground_layer  = tilemap_create( get_mid_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16,16,32,32 );
236   foreground_layer = tilemap_create( get_fore_tile_info,tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 16,16,32,32 );
233   text_layer       = tilemap_create( get_text_tile_info,tilemap_scan_rows, TILEMAP_TYPE_PEN,  8, 8,64,32 );
234   background_layer = tilemap_create( get_back_tile_info,tilemap_scan_rows, TILEMAP_TYPE_PEN,      16,16,32,32 );
235   midground_layer  = tilemap_create( get_mid_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16,32,32 );
236   foreground_layer = tilemap_create( get_fore_tile_info,tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16,32,32 );
237237
238238   tilemap_set_transparent_pen(midground_layer,15);
239239   tilemap_set_transparent_pen(foreground_layer,15);
src/mame/drivers/mogura.c
r814r815
4949         0,
5050         code,
5151         (attr>>1)&7,
52         0)
52         0);
5353}
5454
5555
5656VIDEO_START( mogura )
5757{
58   mogura_tilemap = tilemap_create(get_mogura_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64, 32);
58   mogura_tilemap = tilemap_create(get_mogura_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64, 32);
5959}
6060
6161VIDEO_UPDATE( mogura )
src/mame/drivers/dynadice.c
r814r815
170170static TILE_GET_INFO( get_tile_info )
171171{
172172   int code=videoram[tile_index];
173   SET_TILE_INFO(1, code, 0, 0)
173   SET_TILE_INFO(1, code, 0, 0);
174174}
175175
176176VIDEO_START( dynadice )
177177{
178178   /* pacman - style videoram layout */
179   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
180   top_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,8,8,2,32);
179   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
180   top_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,2,32);
181181   tilemap_set_scrollx(bg_tilemap, 0, -16 );
182182}
183183
src/mame/drivers/dacholer.c
r814r815
185185
186186VIDEO_START( dacholer )
187187{
188   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,32,32);
189   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32,32);
188   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
189   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
190190
191191   tilemap_set_transparent_pen(fg_tilemap,0);
192192}
src/mame/drivers/skyarmy.c
r814r815
4242      case 6: attr=3; break;
4343   }
4444
45   SET_TILE_INFO( 0, code, attr, 0)
45   SET_TILE_INFO( 0, code, attr, 0);
4646}
4747
4848WRITE8_HANDLER( skyarmy_videoram_w )
r814r815
9999
100100VIDEO_START( skyarmy )
101101{
102        skyarmy_tilemap = tilemap_create(get_skyarmy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
102        skyarmy_tilemap = tilemap_create(get_skyarmy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
103103        tilemap_set_scroll_cols(skyarmy_tilemap,32);
104104}
105105
src/mame/drivers/suprgolf.c
r814r815
2828      0,
2929      code,
3030      0,
31      0)
31      0);
3232}
3333
3434/*
r814r815
6161
6262static VIDEO_START( suprgolf )
6363{
64   suprgolf_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
64   suprgolf_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
6565}
6666
6767static VIDEO_UPDATE( suprgolf )
6868{
6969   tilemap_mark_all_tiles_dirty(suprgolf_tilemap);
70   tilemap_draw(bitmap,cliprect,suprgolf_tilemap,TILEMAP_IGNORE_TRANSPARENCY,0);
70   tilemap_draw(bitmap,cliprect,suprgolf_tilemap,TILEMAP_DRAW_OPAQUE,0);
7171   return 0;
7272}
7373
src/mame/drivers/wallc.c
r814r815
122122
123123static TILE_GET_INFO( get_bg_tile_info )
124124{
125   SET_TILE_INFO(0, videoram[tile_index] + 0x100, 1, 0)
125   SET_TILE_INFO(0, videoram[tile_index] + 0x100, 1, 0);
126126}
127127
128128VIDEO_START( wallc )
129129{
130   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y,   TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
130   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y,   TILEMAP_TYPE_PEN, 8, 8, 32, 32);
131131}
132132
133133VIDEO_UPDATE( wallc )
src/mame/drivers/marinedt.c
r814r815
447447   int color = 0;
448448   int flags = TILE_FLIPX;
449449
450   SET_TILE_INFO(0, code, color, flags)
450   SET_TILE_INFO(0, code, color, flags);
451451}
452452
453453VIDEO_START( marinedt )
454454{
455   tx_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
455   tx_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,32,32);
456456
457457   tilemap_set_transparent_pen(tx_tilemap, 0);
458458   tilemap_set_scrolldx(tx_tilemap, 0, 4*8);
src/mame/drivers/couple.c
r814r815
6060   UINT16 code = ((vram_data & 0xff) | ((vram_data & 0x8000) >> 7) | ((vram_data & 0x2000) >> 4));
6161   UINT16 color = (vram_data & 0x0f00) >> 8;
6262
63   SET_TILE_INFO(region, code, color, 0)
63   SET_TILE_INFO(region, code, color, 0);
6464}
6565
6666VIDEO_START( couple )
6767{
68   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
68   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
6969}
7070
7171VIDEO_UPDATE( couple )
src/mame/drivers/lucky8.c
r814r815
9393   int code = videoram[tile_index] + ((attr & 0xf0) << 4);
9494   int color = attr & 0x0f;
9595
96   SET_TILE_INFO(0, code, color, 0)
96   SET_TILE_INFO(0, code, color, 0);
9797}
9898
9999VIDEO_START(lucky8)
100100{
101101   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
102      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
102      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
103103}
104104
105105VIDEO_UPDATE(lucky8)
src/mame/drivers/magicfly.c
r814r815
358358   colorram[0] = colorram[0] | ((colorram[0] & 0x08) << 4);   /* only for 1st offset */
359359//  colorram[tile_index] = attr | ((attr & 0x08) << 4);         /* for the whole color RAM */
360360
361   SET_TILE_INFO(bank, code, color, 0)
361   SET_TILE_INFO(bank, code, color, 0);
362362}
363363
364364VIDEO_START(magicfly)
365365{
366366   bg_tilemap = tilemap_create(get_magicfly_tile_info, tilemap_scan_rows,
367      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 29);
367      TILEMAP_TYPE_PEN, 8, 8, 32, 29);
368368}
369369
370370static TILE_GET_INFO( get_7mezzo_tile_info )
r814r815
390390   colorram[0] = colorram[0] | ((colorram[0] & 0x04) << 5);   /* only for 1st offset */
391391//  colorram[tile_index] = attr | ((attr & 0x04) << 5);         /* for the whole color RAM */
392392
393   SET_TILE_INFO(bank, code, color, 0)
393   SET_TILE_INFO(bank, code, color, 0);
394394}
395395
396396VIDEO_START( 7mezzo )
397397{
398398   bg_tilemap = tilemap_create(get_7mezzo_tile_info, tilemap_scan_rows,
399      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 29);
399      TILEMAP_TYPE_PEN, 8, 8, 32, 29);
400400}
401401
402402VIDEO_UPDATE( magicfly )
src/mame/drivers/pturn.c
r814r815
100100
101101   tileno=tile_lookup[tileno>>4]|(tileno&0xf)|(fgbank<<8);
102102
103   SET_TILE_INFO(0,tileno,fgpalette,0)
103   SET_TILE_INFO(0,tileno,fgpalette,0);
104104}
105105
106106
r814r815
114114   {
115115      palno=25;
116116   }
117   SET_TILE_INFO(1,tileno+bgbank*256,palno,0)
117   SET_TILE_INFO(1,tileno+bgbank*256,palno,0);
118118}
119119
120120VIDEO_START(pturn)
121121{
122   pturn_fgmap = tilemap_create(get_pturn_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
122   pturn_fgmap = tilemap_create(get_pturn_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
123123   tilemap_set_transparent_pen(pturn_fgmap,0);
124   pturn_bgmap = tilemap_create(get_pturn_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32*8);
124   pturn_bgmap = tilemap_create(get_pturn_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32*8);
125125   tilemap_set_transparent_pen(pturn_bgmap,0);
126126}
127127
src/mame/drivers/pmpoker.c
r814r815
1313    * Golden Poker Double Up (Mini Boy).  1981, Bonanza Enterprises, Ltd.
1414    * Golden Poker (no double up).        198?, Bootleg.
1515    * Joker-Poker.                        198?, Bootleg in Coinmaster hardware.
16    * Jack Potten's Poker.                198?, Unknown.
16    * Jack Potten's Poker (bootleg).      198?, Bootleg.
17    * Jack Potten's Poker (bootleg2).     198?, Bootleg.
1718
1819
1920*******************************************************************************
r814r815
249250*******************************************************************************
250251
251252
252    Buttons/Inputs   goldnpkr    goldnpkb    goldnpkc    pmpoker     jokerpkr    pottnpkr
253    -------------------------------------------------------------------------------------
253    Buttons/Inputs   goldnpkr    goldnpkb    goldnpkc    pmpoker     jokerpkr    pottnpkr    pottnpkc
254    -------------------------------------------------------------------------------------------------
254255
255    HOLD (5 buttons)  mapped      mapped      mapped      mapped      mapped      mapped
256    CANCEL            mapped      mapped      mapped      mapped      mapped      mapped
257    BIG               mapped      mapped       ----       mapped       ----        ----
258    SMALL             mapped      mapped       ----       mapped       ----        ----
259    DOUBLE UP         mapped      mapped       ----       mapped       ----        ----
260    TAKE SCORE        mapped      mapped       ----       mapped       ----        ----
261    DEAL/DRAW         mapped      mapped      mapped      mapped      mapped      mapped
262    BET               mapped      mapped      mapped      mapped      mapped      mapped
256    HOLD (5 buttons)  mapped      mapped      mapped      mapped      mapped      mapped      mapped
257    CANCEL            mapped      mapped      mapped      mapped      mapped      mapped      mapped
258    BIG               mapped      mapped       ----       mapped       ----        ----        ----
259    SMALL             mapped      mapped       ----       mapped       ----        ----        ----
260    DOUBLE UP         mapped      mapped       ----       mapped       ----        ----        ----
261    TAKE SCORE        mapped      mapped       ----       mapped       ----        ----        ----
262    DEAL/DRAW         mapped      mapped      mapped      mapped      mapped      mapped      mapped
263    BET               mapped      mapped      mapped      mapped      mapped      mapped      mapped
263264
264    Coin 1 (coins)    mapped      mapped      mapped      mapped      mapped      mapped
265    Coin 2 (notes)    mapped      mapped      mapped      mapped      mapped      mapped
266    Coin 3 (coupons)  mapped      mapped       ----       mapped       ----        ----
267    Payout            mapped      mapped      mapped      mapped      mapped      mapped
268    Manual Collect    mapped      mapped      mapped      mapped      mapped      mapped
265    Coin 1 (coins)    mapped      mapped      mapped      mapped      mapped      mapped      mapped
266    Coin 2 (notes)    mapped      mapped      mapped      mapped      mapped      mapped      fixed 1c-1c
267    Coin 3 (coupons)  mapped      mapped       ----       mapped       ----        ----        ----
268    Payout            mapped      mapped      mapped      mapped      mapped      mapped      mapped
269    Manual Collect    mapped      mapped      mapped      mapped      mapped      mapped      mapped
269270
270    LEARN/SETTINGS    mapped      mapped      mapped      mapped      mapped      mapped
271    METERS            mapped      mapped      mapped      mapped      mapped      mapped
271    LEARN/SETTINGS    mapped      mapped      mapped      mapped      mapped      mapped      mapped
272    METERS            mapped      mapped      mapped      mapped      mapped      mapped      mapped
272273
273274
274275    Inputs are different for some games. Normally each button has only one function.
r814r815
409410   if (attr == 0x3a)   /* Is the palette wrong? */
410411      color = 0x3b;   /* 0x3b is the best match */
411412
412   SET_TILE_INFO(bank, code, color, 0)
413   SET_TILE_INFO(bank, code, color, 0);
413414}
414415
415416VIDEO_START( pmpoker )
416417{
417418   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
418      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 29);
419      TILEMAP_TYPE_PEN, 8, 8, 32, 29);
419420}
420421
421422VIDEO_UPDATE( pmpoker )
r814r815
11661167   ROM_LOAD( "82s129.9c",      0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) )
11671168ROM_END
11681169
1170/*pottpok4.bin                                                 0xxxxxxxxxx = 0x00
1171                        517.4a                               0xxxxxxxxxx = 0x00
1172pottpok1.bin            517.8a                  IDENTICAL
1173pottpok2.bin            517.7a                  IDENTICAL
1174pottpok3.bin            517.6a                  IDENTICAL
1175pottpok4.bin            517.4a                  IDENTICAL
1176pottpok5.bin            517.16a                 69.335938%
1177pottpok6.bin            517.17a                 2.685547%
1178*/
11691179
1180ROM_START( pottnpkb )
1181   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1182   ROM_LOAD( "517.16a",   0x2000, 0x1000, CRC(8892fbd4) SHA1(22a27c0c3709ca4808a9afb8848233bc4124559f) )
1183   ROM_LOAD( "517.17a",   0x3000, 0x1000, CRC(75a72877) SHA1(9df8fd2c98526d20aa0fa056a7b71b5c5fb5206b) )
1184   ROM_RELOAD(               0xf000, 0x1000 )    /* for vectors/pointers */
1185
1186   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1187   ROM_LOAD( "517.8a",   0x0000, 0x0800, CRC(2c53493f) SHA1(9e71db51499294bb4b16e7d8013e5daf6f1f9d18) )    /* text layer */
1188
1189   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1190   ROM_LOAD( "517.4a",   0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) )    /* cards deck gfx, bitplane1 */
1191   ROM_LOAD( "517.6a",   0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) )    /* cards deck gfx, bitplane2 */
1192   ROM_LOAD( "517.7a",   0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )    /* cards deck gfx, bitplane3 */
1193
1194   ROM_REGION( 0x0100, REGION_PROMS, 0 )
1195   ROM_LOAD( "82s129.9c",      0x0000, 0x0100, BAD_DUMP CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */
1196ROM_END
1197
1198
11701199/*************************
11711200*      Driver Init       *
11721201*************************/
r814r815
11881217GAMEL( 1981, goldnpkb, pmpoker,  pmpoker,  goldnpkr, pmpoker,  ROT0,   "Bonanza Enterprises, Ltd",       "Golden Poker Double Up (Mini Boy)", GAME_NO_SOUND ,layout_goldnpkr )
11891218GAMEL( 1981, goldnpkc, pmpoker,  pmpoker,  goldnpkc, pmpoker,  ROT0,   "Bootleg",                        "Golden Poker (no double up)",       GAME_NO_SOUND ,layout_goldnpkr )
11901219GAMEL( 198?, jokerpkr, pmpoker,  jokerpkr, jokerpkr, pmpoker,  ROT0,   "Bootleg in Coinmaster hardware", "Joker-Poker",                       GAME_NO_SOUND ,layout_pottnpkr )
1191GAMEL( 198?, pottnpkr, pmpoker,  jokerpkr, pottnpkr, pmpoker,  ROT0,   "Unknown",                        "Jack Potten's Poker",               GAME_NO_SOUND ,layout_pottnpkr )
1220GAMEL( 198?, pottnpkr, pmpoker,  jokerpkr, pottnpkr, pmpoker,  ROT0,   "Bootleg",                        "Jack Potten's Poker (bootleg)",     GAME_NO_SOUND ,layout_pottnpkr )
1221GAMEL( 198?, pottnpkb, pmpoker,  jokerpkr, goldnpkc, pmpoker,  ROT0,   "Bootleg",                        "Jack Potten's Poker (bootleg2)",    GAME_NO_SOUND ,layout_pottnpkr )
11921222
src/mame/drivers/yumefuda.c
r814r815
6767         0,
6868         code + ((color & 0xf8) << 3),
6969         color & 0x7,
70         0)
70         0);
7171}
7272
7373
7474VIDEO_START( yumefuda )
7575{
76   bg_tilemap = tilemap_create(y_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
76   bg_tilemap = tilemap_create(y_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
7777}
7878
7979VIDEO_UPDATE( yumefuda )
src/mame/drivers/namcos23.c
r814r815
351351   SET_TILE_INFO( 0, data&0x03ff, data>>12, TILE_FLIPYX((data&0x0c00)>>10) );
352352   if( data&0x8000 )
353353   {
354      tileinfo->priority = 1;
354      tileinfo->category = 1;
355355   }
356356} /* TextTilemapGetInfo */
357357
r814r815
369369
370370VIDEO_START( ss23 )
371371{
372   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64 );
372   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64 );
373373   tilemap_set_transparent_pen( bgtilemap, 0xf );
374374}
375375
src/mame/drivers/tattack.c
r814r815
3737      0,
3838      code,
3939      color,
40      0)
40      0);
4141}
4242
4343VIDEO_UPDATE( tattack )
r814r815
4949
5050VIDEO_START( tattack )
5151{
52      tmap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32 );
52      tmap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
5353}
5454
5555static ADDRESS_MAP_START( mem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/dunhuang.c
r814r815
9292VIDEO_START(dunhuang)
9393{
9494   tmap = tilemap_create(   get_tile_info, tilemap_scan_rows,
95                     TILEMAP_TYPE_TRANSPARENT, 8,8, 0x40,0x20   );
95                     TILEMAP_TYPE_PEN, 8,8, 0x40,0x20   );
9696
9797   tmap2 = tilemap_create(   get_tile_info2, tilemap_scan_rows,
98                     TILEMAP_TYPE_TRANSPARENT, 8,32, 0x40,0x8   );
98                     TILEMAP_TYPE_PEN, 8,32, 0x40,0x8   );
9999
100100   tilemap_set_transparent_pen(tmap,   0);
101101   tilemap_set_transparent_pen(tmap2,  0);
r814r815
128128   switch (dunhuang_layers)
129129   {
130130      case 0x04:   // girl select: bg over fg
131         if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tmap2, TILEMAP_IGNORE_TRANSPARENCY, 0);
131         if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tmap2, TILEMAP_DRAW_OPAQUE, 0);
132132         if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tmap,  0, 0);
133133         break;
134134      case 0x05:   // dips: must hide fg
135         if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tmap,  TILEMAP_IGNORE_TRANSPARENCY, 0);
135         if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tmap,  TILEMAP_DRAW_OPAQUE, 0);
136136         break;
137137      case 0x07:   // game,demo: fg over bg
138138      default:
139         if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tmap,  TILEMAP_IGNORE_TRANSPARENCY, 0);
139         if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tmap,  TILEMAP_DRAW_OPAQUE, 0);
140140         if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tmap2, 0, 0);
141141         break;
142142   }
src/mame/drivers/onetwo.c
r814r815
4949
5050   code &= 0x7fff;
5151
52   SET_TILE_INFO(0, code, color, 0)
52   SET_TILE_INFO(0, code, color, 0);
5353}
5454
5555static WRITE8_HANDLER( onetwo_fgram_w )
r814r815
243243
244244VIDEO_START( onetwo )
245245{
246   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
246   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
247247}
248248
249249VIDEO_UPDATE( onetwo )
src/mame/drivers/laserbat.c
r814r815
523523static TILE_GET_INFO( get_tile_info )
524524{
525525   // wrong color index!
526   SET_TILE_INFO(0, videoram[tile_index], colorram[tile_index], 0)
526   SET_TILE_INFO(0, videoram[tile_index], colorram[tile_index], 0);
527527}
528528
529529VIDEO_START( laserbat )
530530{
531   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
531   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
532532
533533   videoram = (UINT8 *)auto_malloc(0x400);
534534   colorram = (UINT8 *)auto_malloc(0x400);
src/mame/drivers/powerbal.c
r814r815
332332
333333   if (magicstk_videoram[tile_index] & 0x800) code |= 0x8000;
334334
335   SET_TILE_INFO(1,code,colr >> 12,0)
335   SET_TILE_INFO(1,code,colr >> 12,0);
336336}
337337
338338static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
r814r815
364364
365365VIDEO_START( powerbal )
366366{
367   bg_tilemap = tilemap_create(powerbal_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,64,32);
367   bg_tilemap = tilemap_create(powerbal_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
368368
369369   xoffset = -20;
370370
src/mame/drivers/talbot.c
r814r815
151151   int code = videoram[tile_index];
152152   int color = colorram[tile_index] & 0x1f;
153153
154   SET_TILE_INFO(0, code, color + 0x20, 0)
154   SET_TILE_INFO(0, code, color + 0x20, 0);
155155}
156156
157157VIDEO_START( talbot )
158158{
159   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
159   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
160160}
161161
162162static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/drivers/vamphalf.c
r814r815
1414    Lup Lup Puzzle           (c) 1999 Omega System       (version 3.0 and 2.9)
1515    Puzzle Bang Bang         (c) 1999 Omega System       (version 2.8)
1616    Wyvern Wings             (c) 2001 SemiCom
17    Final Godori             (c) 2001 SemiCom
17    Final Godori             (c) 2001 SemiCom            (version 2.20.5915)
1818
1919 Games Needed:
2020
r814r815
976976|            |          | MEM6   | XPL84C   | |
977977|     PAL    +----------+        |          | |
978978|                         MEM2   +----------+ |
979|SW1 SW2                                      |
979|SW1 SW2       61L256S                        |
980980|        ROM0*  +--------+ +--------+  28MHz  |
981981|        ROM1   | ROML00 | | ROMH00 |  +-----+|
982982|               +--------+ +--------+  |93C46||
r814r815
991991CRAM are MCM6206BAEJ15
992992DRAM are KM416C1204AJ-6
993993MEM are MCM6206BAEJ15
99461L256S - 32K x 8 bit High Speed CMOS SRAM (game's so called "Backup Data")
994995
995996SW1 is the reset button
996997SW2 is the setup button
997998
998999*/
9991000
1000ROM_START( finalgdr )
1001ROM_START( finalgdr ) /* version 2.20.5915, Korea only */
10011002   ROM_REGION32_BE( 0x100000, REGION_USER1, 0 ) /* Hyperstone CPU Code */
10021003   /* rom0 empty */
10031004   ROM_LOAD( "rom1", 0x080000, 0x080000, CRC(45815931) SHA1(80ba7a366994e40a1f520ea18fad82e6b068b279) )
r814r815
12241225GAME( 1999, puzlbang, suplup, suplup,   common,   puzlbang, ROT0,   "Omega System",      "Puzzle Bang Bang (version 2.8 / 990106)", 0 )
12251226GAME( 1999, vamphalf, 0,      vamphalf, common,   vamphalf, ROT0,   "Danbi & F2 System", "Vamp 1/2 (Korea version)", 0 )
12261227GAME( 2000, misncrft, 0,      misncrft, common,   misncrft, ROT90,  "Sun",               "Mission Craft (version 2.4)", GAME_NO_SOUND )
1227GAME( 2001, finalgdr, 0,      finalgdr, common,   finalgdr, ROT0,   "SemiCom",           "Final Godori", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
1228GAME( 2001, finalgdr, 0,      finalgdr, common,   finalgdr, ROT0,   "SemiCom",           "Final Godori (Korea)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
12281229GAME( 2001, wyvernwg, 0,      wyvernwg, common,   wyvernwg, ROT270, "SemiCom (Game Vision License)", "Wyvern Wings", GAME_NO_SOUND )
src/mame/drivers/vmetal.c
r814r815
399399
400400VIDEO_START(varia)
401401{
402   vmetal_texttilemap = tilemap_create(get_vmetal_texttilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,      8, 8, 256,256);
403   vmetal_mid1tilemap = tilemap_create(get_vmetal_mid1tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,      16,16, 256,256);
404   vmetal_mid2tilemap = tilemap_create(get_vmetal_mid2tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,      16,16, 256,256);
402   vmetal_texttilemap = tilemap_create(get_vmetal_texttilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      8, 8, 256,256);
403   vmetal_mid1tilemap = tilemap_create(get_vmetal_mid1tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16, 256,256);
404   vmetal_mid2tilemap = tilemap_create(get_vmetal_mid2tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16, 256,256);
405405   tilemap_set_transparent_pen(vmetal_texttilemap,0);
406406   tilemap_set_transparent_pen(vmetal_mid1tilemap,0);
407407   tilemap_set_transparent_pen(vmetal_mid2tilemap,0);
src/mame/drivers/dreamwld.c
r814r815
120120   tileno = (tile_index&1)?(dreamwld_bg_videoram[tile_index>>1]&0xffff):((dreamwld_bg_videoram[tile_index>>1]>>16)&0xffff);
121121   colour = tileno >> 13;
122122   tileno &=0x1fff;
123   SET_TILE_INFO(1,tileno+dreamwld_tilebank[0]*0x2000,0x80+colour,0)
123   SET_TILE_INFO(1,tileno+dreamwld_tilebank[0]*0x2000,0x80+colour,0);
124124}
125125
126126
r814r815
137137   tileno = (tile_index&1)?(dreamwld_bg2_videoram[tile_index>>1]&0xffff):((dreamwld_bg2_videoram[tile_index>>1]>>16)&0xffff);
138138   colour = tileno >> 13;
139139   tileno &=0x1fff;
140   SET_TILE_INFO(1,tileno+dreamwld_tilebank[1]*0x2000,0xc0+colour,0)
140   SET_TILE_INFO(1,tileno+dreamwld_tilebank[1]*0x2000,0xc0+colour,0);
141141}
142142
143143VIDEO_START(dreamwld)
144144{
145   dreamwld_bg_tilemap = tilemap_create(get_dreamwld_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,      16, 16, 64,32);
146   dreamwld_bg2_tilemap = tilemap_create(get_dreamwld_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,      16, 16, 64,32);
145   dreamwld_bg_tilemap = tilemap_create(get_dreamwld_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16, 16, 64,32);
146   dreamwld_bg2_tilemap = tilemap_create(get_dreamwld_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16, 16, 64,32);
147147   tilemap_set_transparent_pen(dreamwld_bg2_tilemap,0);
148148   dreamwld_tilebankold[0] = dreamwld_tilebankold[1] = -1;
149149   dreamwld_tilebank[0] = dreamwld_tilebank[1] = 0;
src/mame/drivers/deco156.c
r814r815
142142
143143   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
144144
145   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_IGNORE_TRANSPARENCY,0);
145   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
146146   draw_sprites(machine,bitmap,cliprect);
147147   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
148148   return 0;
src/mame/drivers/panicr.c
r814r815
113113      1,
114114        code,
115115      (attr & 0xf0) >> 4,
116        0)
116        0);
117117}
118118
119119static TILE_GET_INFO( get_txttile_info )
r814r815
126126      0,
127127      code + ((attr & 8) << 5),
128128      attr&7,
129      0)
129      0);
130130}
131131
132132static READ8_HANDLER(t5182shared_r)
r814r815
166166
167167VIDEO_START( panicr )
168168{
169   bgtilemap = tilemap_create( get_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,16,16,1024,16 );
170   txttilemap = tilemap_create( get_txttile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT_COLOR,8,8,32,32 );
169   bgtilemap = tilemap_create( get_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,1024,16 );
170   txttilemap = tilemap_create( get_txttile_info,tilemap_scan_rows,TILEMAP_TYPE_COLORTABLE,8,8,32,32 );
171171   tilemap_set_transparent_pen(txttilemap, 0);
172172}
173173
src/mame/drivers/sbowling.c
r814r815
5656   UINT8 *rom = memory_region(REGION_USER1);
5757   int tileno = rom[tile_index + bgmap * 1024];
5858
59   SET_TILE_INFO(0, tileno, 0, 0)
59   SET_TILE_INFO(0, tileno, 0, 0);
6060}
6161
6262static void plot_pixel_sbw(int x, int y, int col)
r814r815
102102VIDEO_START(sbowling)
103103{
104104   tmpbitmap = auto_bitmap_alloc(32*8,32*8,machine->screen[0].format);
105   sb_tilemap = tilemap_create(get_sb_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
105   sb_tilemap = tilemap_create(get_sb_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
106106}
107107
108108static WRITE8_HANDLER( pix_shift_w )
src/mame/drivers/good.c
r814r815
7272
7373VIDEO_START( good )
7474{
75   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 16, 16, 32,32);
76   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 16, 16, 32,32);
75   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16, 32,32);
76   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16, 32,32);
7777   tilemap_set_transparent_pen(fg_tilemap,0xf);
7878}
7979
src/mame/drivers/igs_m027.c
r814r815
132132
133133VIDEO_START(igs_majhong)
134134{
135   igs_tx_tilemap= tilemap_create(get_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
135   igs_tx_tilemap= tilemap_create(get_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
136136   tilemap_set_transparent_pen(igs_tx_tilemap,15);
137137   igs_bg_tilemap= tilemap_create(get_bg_tilemap_tile_info,tilemap_scan_rows,0, 8, 8,64,32);
138   //igs_bg_tilemap= tilemap_create(get_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
138   //igs_bg_tilemap= tilemap_create(get_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
139139   //tilemap_set_transparent_pen(igs_bg_tilemap,15);
140140   logerror("Video START OK!\n");
141141}
src/mame/drivers/ettrivia.c
r814r815
174174
175175   code += gfx_bank * 0x100;
176176
177   SET_TILE_INFO(gfx_code,code,color,0)
177   SET_TILE_INFO(gfx_code,code,color,0);
178178}
179179
180180static TILE_GET_INFO( get_tile_info_bg )
r814r815
189189
190190VIDEO_START( ettrivia )
191191{
192   bg_tilemap = tilemap_create( get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32 );
193   fg_tilemap = tilemap_create( get_tile_info_fg,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,32 );
192   bg_tilemap = tilemap_create( get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
193   fg_tilemap = tilemap_create( get_tile_info_fg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
194194
195195   tilemap_set_transparent_pen(fg_tilemap,0);
196196}
src/mame/drivers/jalmah.c
r814r815
132132
133133static int respcount;
134134
135static UINT32 bg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
135static TILEMAP_MAPPER( bg_scan )
136136{
137137   /* logical (col,row) -> memory offset */
138138   return (row & 0x0f) + ((col & 0xff) << 4) + ((row & 0x70) << 8);
r814r815
145145         3,
146146         (code & 0xfff) + ((sc0bank & 3) << 12),
147147         code >> 12,
148         0)
148         0);
149149}
150150
151151static TILE_GET_INFO( get_sc3_tile_info )
r814r815
155155         0,
156156         code & 0xfff,
157157         code >> 12,
158         0)
158         0);
159159}
160160
161161static TILE_GET_INFO( get_sc2_tile_info )
r814r815
165165         1,
166166         code & 0xfff,
167167         code >> 12,
168         0)
168         0);
169169}
170170
171171static TILE_GET_INFO( get_sc1_tile_info )
r814r815
175175         2,
176176         code & 0xfff,
177177         code >> 12,
178         0)
178         0);
179179}
180180
181181VIDEO_START( jalmah )
182182{
183   sc0_tilemap = tilemap_create(get_sc0_tile_info,bg_scan,TILEMAP_TYPE_TRANSPARENT,16,16,256,32);
184   sc1_tilemap = tilemap_create(get_sc1_tile_info,bg_scan,TILEMAP_TYPE_TRANSPARENT,16,16,256,32);
185   sc2_tilemap = tilemap_create(get_sc2_tile_info,bg_scan,TILEMAP_TYPE_TRANSPARENT,16,16,256,32);
186   sc3_tilemap = tilemap_create(get_sc3_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,256,32);
183   sc0_tilemap = tilemap_create(get_sc0_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
184   sc1_tilemap = tilemap_create(get_sc1_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
185   sc2_tilemap = tilemap_create(get_sc2_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
186   sc3_tilemap = tilemap_create(get_sc3_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,256,32);
187187
188188   jm_scrollram = auto_malloc(0x80);
189189   jm_vregs = auto_malloc(0x40);
r814r815
327327}
328328
329329#define jalmah_tilemap_draw(_tilemap_) \
330   tilemap_draw(bitmap,cliprect,_tilemap_,(opaque & 1) ? 0 : TILEMAP_IGNORE_TRANSPARENCY,0); \
330   tilemap_draw(bitmap,cliprect,_tilemap_,(opaque & 1) ? 0 : TILEMAP_DRAW_OPAQUE,0); \
331331   if(!opaque) { opaque = 1; }
332332
333333VIDEO_UPDATE( jalmah )
src/mame/drivers/supdrapo.c
r814r815
246246{
247247   int code = videoram[tile_index] + char_bank[tile_index] * 0x100;
248248
249   SET_TILE_INFO( 0, code, 0, 0)
249   SET_TILE_INFO( 0, code, 0, 0);
250250}
251251
252252VIDEO_START( supdrapo )
253253{
254   fg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
254   fg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
255255}
256256
257257VIDEO_UPDATE( supdrapo )
src/mame/drivers/tecmosys.c
r814r815
118118         0,
119119         videoram16[2*tile_index+1],
120120         videoram16[2*tile_index]&0xf,
121         0)
121         0);
122122}
123123
124124
r814r815
402402
403403VIDEO_START(deroon)
404404{
405   txt_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32*2,32*2);
405   txt_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32*2,32*2);
406406   tilemap_set_transparent_pen(txt_tilemap,0);
407407}
408408
src/mame/drivers/merit.c
r814r815
610610   if(region == 0)
611611      code |= extra_video_bank_bit;
612612
613   SET_TILE_INFO(region, code, 0, 0)
613   SET_TILE_INFO(region, code, 0, 0);
614614}
615615
616616
617617VIDEO_START( merit )
618618{
619   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64,32);
619   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
620620}
621621
622622VIDEO_UPDATE( merit )
src/mame/drivers/madalien.c
r814r815
171171   code = madalien_videoram[tile_index];
172172   color = 2 * madalien_select_color_1;
173173
174   SET_TILE_INFO(0, code, color, 0)
174   SET_TILE_INFO(0, code, color, 0);
175175}
176176
177177static TILE_GET_INFO( get_bg_tile_info_l )
r814r815
192192
193193   color = madalien_swap_colors * 4;
194194
195   SET_TILE_INFO(1, code, color, 0)
195   SET_TILE_INFO(1, code, color, 0);
196196}
197197
198198static TILE_GET_INFO( get_bg_tile_info_r )
r814r815
213213
214214   color = madalien_swap_colors * 4;
215215
216   SET_TILE_INFO(1, code, color, 0)
216   SET_TILE_INFO(1, code, color, 0);
217217}
218218
219219
r814r815
225225   const UINT8 *headlight_rom;
226226
227227   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x,
228      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
228      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
229229
230230   bg_tilemap_l = tilemap_create(get_bg_tile_info_l, tilemap_scan_cols_flip_x,
231      TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
231      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
232232
233233   bg_tilemap_r = tilemap_create(get_bg_tile_info_r, tilemap_scan_cols_flip_x,
234      TILEMAP_TYPE_OPAQUE, 16, 16, 16, 16);
234      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
235235
236236   tilemap_set_transparent_pen( fg_tilemap, 0 );
237237
src/mame/drivers/rmhaihai.c
r814r815
5353   int code = videoram[tile_index] + (gfxbank << 12) + ((attr & 0x07) << 8) + ((attr & 0x80) << 4);
5454   int color = (gfxbank << 5) + (attr >> 3);
5555
56   SET_TILE_INFO(0, code, color, 0)
56   SET_TILE_INFO(0, code, color, 0);
5757}
5858
5959VIDEO_START( rmhaihai )
6060{
6161   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
62      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
62      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
6363}
6464
6565VIDEO_UPDATE( rmhaihai )
src/mame/drivers/midas.c
r814r815
6565VIDEO_START( livequiz )
6666{
6767   tmap = tilemap_create(   get_tile_info, tilemap_scan_cols,
68                     TILEMAP_TYPE_TRANSPARENT, 8,8, 0x80,0x20   );
68                     TILEMAP_TYPE_PEN, 8,8, 0x80,0x20   );
6969
7070   tilemap_set_transparent_pen(tmap, 0);
7171}
src/mame/drivers/ampoker.c
r814r815
5353   int color = attr;
5454   color=0;
5555
56   SET_TILE_INFO(0, code, color, 0)
56   SET_TILE_INFO(0, code, color, 0);
5757}
5858
5959VIDEO_START(ampoker2)
6060{
6161   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
62      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
62      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
6363}
6464
6565VIDEO_UPDATE(ampoker2)
src/mame/drivers/jackpool.c
r814r815
2727   tileno = jackpool_layer0_videoram[tile_index]&0x7fff;
2828   attr = jackpool_layer0_videoram[tile_index+0x800]&0x1f;
2929
30   SET_TILE_INFO(0,tileno,attr,0)
30   SET_TILE_INFO(0,tileno,attr,0);
3131}
3232
3333WRITE16_HANDLER( jackpool_layer0_videoram_w )
r814r815
4444   tileno = jackpool_layer1_videoram[tile_index]&0x7fff;
4545   attr = jackpool_layer1_videoram[tile_index+0x800]&0x1f;
4646
47   SET_TILE_INFO(0,tileno,attr,0)
47   SET_TILE_INFO(0,tileno,attr,0);
4848}
4949
5050WRITE16_HANDLER( jackpool_layer1_videoram_w )
r814r815
6161   tileno = jackpool_layer2_videoram[tile_index]&0x7fff;
6262   attr = jackpool_layer2_videoram[tile_index+0x800]&0x1f;
6363
64   SET_TILE_INFO(0,tileno,attr,0)
64   SET_TILE_INFO(0,tileno,attr,0);
6565}
6666
6767WRITE16_HANDLER( jackpool_layer2_videoram_w )
r814r815
140140
141141VIDEO_START(jackpool)
142142{
143   jackpool_layer0_tilemap = tilemap_create(get_jackpool_layer0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
144   jackpool_layer1_tilemap = tilemap_create(get_jackpool_layer1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
145   jackpool_layer2_tilemap = tilemap_create(get_jackpool_layer2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8, 8,64,32);
143   jackpool_layer0_tilemap = tilemap_create(get_jackpool_layer0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
144   jackpool_layer1_tilemap = tilemap_create(get_jackpool_layer1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
145   jackpool_layer2_tilemap = tilemap_create(get_jackpool_layer2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
146146
147147   tilemap_set_transparent_pen(jackpool_layer0_tilemap,0);
148148   tilemap_set_transparent_pen(jackpool_layer2_tilemap,0);
src/mame/drivers/nmg5.c
r814r815
790790
791791INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *vram,int color)
792792{
793   SET_TILE_INFO(0,vram[tile_index] | (gfx_bank << 16),color,0)
793   SET_TILE_INFO(0,vram[tile_index] | (gfx_bank << 16),color,0);
794794}
795795
796796static TILE_GET_INFO( fg_get_tile_info ) { get_tile_info(machine,tileinfo,tile_index,fg_videoram, 0); }
r814r815
798798
799799VIDEO_START( nmg5 )
800800{
801   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,     8,8,64,64);
802   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
801   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,64);
802   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
803803
804804   tilemap_set_transparent_pen(fg_tilemap,0);
805805}
src/mame/drivers/wink.c
r814r815
264264      code |= 0x100;
265265   }
266266
267   SET_TILE_INFO(0, code, 0, 0)
267   SET_TILE_INFO(0, code, 0, 0);
268268}
269269
270270VIDEO_START( wink )
271271{
272   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
272   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
273273}
274274
275275VIDEO_UPDATE( wink )
src/mame/drivers/olibochu.c
r814r815
8888   int color = (attr & 0x1f) + 0x20;
8989   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
9090
91   SET_TILE_INFO(0, code, color, flags)
91   SET_TILE_INFO(0, code, color, flags);
9292}
9393
9494VIDEO_START( olibochu )
9595{
9696   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
97      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
97      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9898}
9999
100100static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/drivers/lockon.c
r814r815
168168   tileno = (upper + lower);
169169   color = 0;
170170
171   SET_TILE_INFO(4,tileno,color,0)
171   SET_TILE_INFO(4,tileno,color,0);
172172}
173173
174174/* Scene tiles */
r814r815
181181   tileno = (upper + lower);
182182   color = 0;
183183
184   SET_TILE_INFO(5,tileno,color,0)
184   SET_TILE_INFO(5,tileno,color,0);
185185}
186186
187187/* HUD tiles */
r814r815
194194   tileno = (upper + lower);
195195   color = 0;
196196
197   SET_TILE_INFO(6,tileno,color,0)
197   SET_TILE_INFO(6,tileno,color,0);
198198}
199199
200200
201201VIDEO_START( lockon )
202202{
203   lockon_tilemap0 = tilemap_create(get_lockon_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8,8,64,32);
204   lockon_tilemap1 = tilemap_create(get_lockon_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8,8,64,32);
205   lockon_tilemap2 = tilemap_create(get_lockon_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT, 8,8,16,16); // HUD -> wrong
203   lockon_tilemap0 = tilemap_create(get_lockon_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,64,32);
204   lockon_tilemap1 = tilemap_create(get_lockon_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,64,32);
205   lockon_tilemap2 = tilemap_create(get_lockon_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,16,16); // HUD -> wrong
206206   tilemap_set_transparent_pen(lockon_tilemap0,0x00);
207207}
208208
src/mame/drivers/safarir.c
r814r815
136136   else
137137      color = 2;  /* green */
138138
139   SET_TILE_INFO(0, code & 0x7f, color, 0)
139   SET_TILE_INFO(0, code & 0x7f, color, 0);
140140}
141141
142142
r814r815
150150   else
151151      color = (~tile_index & 0x04) | ((tile_index >> 1) & 0x03);
152152
153   flags = ((tile_index & 0x1f) >= 0x03) ? 0 : TILE_IGNORE_TRANSPARENCY;
153   flags = ((tile_index & 0x1f) >= 0x03) ? 0 : TILE_FORCE_LAYER0;
154154
155   SET_TILE_INFO(1, code & 0x7f, color, flags)
155   SET_TILE_INFO(1, code & 0x7f, color, flags);
156156}
157157
158158
159159static VIDEO_START( safarir )
160160{
161   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
162   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
161   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
162   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
163163
164164   tilemap_set_transparent_pen(fg_tilemap, 0);
165165}
src/mame/drivers/wilytowr.c
r814r815
141141   int code = videoram[tile_index] | ((attr & 0x30) << 4);
142142   int color = (attr & 0x0f) + (pal_bank << 4);
143143
144   SET_TILE_INFO(1, code, color, 0)
144   SET_TILE_INFO(1, code, color, 0);
145145}
146146
147147static TILE_GET_INFO( get_fg_tile_info )
148148{
149149   int code = wilytowr_videoram2[tile_index];
150150
151   SET_TILE_INFO(0, code, 0, fg_flag)
151   SET_TILE_INFO(0, code, 0, fg_flag);
152152}
153153
154154VIDEO_START( wilytowr )
155155{
156156   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
157      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
157      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
158158
159159   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
160      TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
160      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
161161
162162   tilemap_set_scroll_cols(bg_tilemap, 32);
163163   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/drivers/looping.c
r814r815
174174{
175175   looping_state *state = machine->driver_data;
176176
177   state->bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8,8, 32,32);
177   state->bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
178178
179179   tilemap_set_scroll_cols(state->bg_tilemap, 0x20);
180180}
src/mame/drivers/segas32.c
r814r815
38553855GAME( 1991, radmu,    radm,     system32,     radm,     radm,     ROT0, "Sega",   "Rad Mobile (US)", GAME_IMPERFECT_GRAPHICS )
38563856GAME( 1991, radr,     0,        system32,     radr,     radr,     ROT0, "Sega",   "Rad Rally (World)", GAME_IMPERFECT_GRAPHICS )
38573857GAME( 1991, radru,    radr,     system32,     radr,     radr,     ROT0, "Sega",   "Rad Rally (US)", GAME_IMPERFECT_GRAPHICS )
3858GAME( 1995, slipstrm, 0,        system32,     slipstrm, slipstrm, ROT0, "Capcom", "Slipstream", GAME_IMPERFECT_GRAPHICS )
3858GAME( 1995, slipstrm, 0,        system32,     slipstrm, slipstrm, ROT0, "Capcom", "Slipstream (Brazil 950515)", GAME_IMPERFECT_GRAPHICS )
38593859GAME( 1992, sonic,    0,        system32,     sonic,    sonic,    ROT0, "Sega",   "SegaSonic The Hedgehog (Japan, rev. C)", GAME_IMPERFECT_GRAPHICS )
38603860GAME( 1992, sonicp,   sonic,    system32,     sonic,    sonicp,   ROT0, "Sega",   "SegaSonic The Hedgehog (Japan, prototype)", GAME_IMPERFECT_GRAPHICS )
38613861GAME( 1991, spidman,  0,        system32,     spidman,  spidman,  ROT0, "Sega",   "Spider-Man: The Videogame (World)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/1945kiii.c
r814r815
7171{
7272   int tileno;
7373   tileno = k3_bgram[tile_index];
74   SET_TILE_INFO(1,tileno,0,0)
74   SET_TILE_INFO(1,tileno,0,0);
7575}
7676
7777VIDEO_START(k3)
7878{
79   k3_bg_tilemap = tilemap_create(get_k3_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,      16, 16, 32,64);
79   k3_bg_tilemap = tilemap_create(get_k3_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16, 16, 32,64);
8080}
8181
8282static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/drivers/darkhors.c
r814r815
136136VIDEO_START( darkhors )
137137{
138138   darkhors_tmap         =   tilemap_create(   get_tile_info_0, tilemap_scan_rows,
139                                    TILEMAP_TYPE_TRANSPARENT, 16,16, 0x40,0x40   );
139                                    TILEMAP_TYPE_PEN, 16,16, 0x40,0x40   );
140140
141141   darkhors_tmap2         =   tilemap_create(   get_tile_info_1, tilemap_scan_rows,
142                                    TILEMAP_TYPE_TRANSPARENT, 16,16, 0x40,0x40   );
142                                    TILEMAP_TYPE_PEN, 16,16, 0x40,0x40   );
143143
144144   tilemap_set_transparent_pen(darkhors_tmap, 0);
145145   tilemap_set_transparent_pen(darkhors_tmap2, 0);
r814r815
166166
167167   tilemap_set_scrollx(darkhors_tmap,0, (darkhors_tmapscroll[0] >> 16) - 5);
168168   tilemap_set_scrolly(darkhors_tmap,0, (darkhors_tmapscroll[0] & 0xffff) - 0xff );
169   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, darkhors_tmap, TILEMAP_IGNORE_TRANSPARENCY, 0);
169   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, darkhors_tmap, TILEMAP_DRAW_OPAQUE, 0);
170170
171171   tilemap_set_scrollx(darkhors_tmap2,0, (darkhors_tmapscroll2[0] >> 16) - 5);
172172   tilemap_set_scrolly(darkhors_tmap2,0, (darkhors_tmapscroll2[0] & 0xffff) - 0xff );
src/mame/drivers/jollyjgr.c
r814r815
268268static TILE_GET_INFO( get_bg_tile_info )
269269{
270270   int color = colorram[((tile_index & 0x1f) << 1) | 1] & 7;
271   SET_TILE_INFO(0, videoram[tile_index], color, 0)
271   SET_TILE_INFO(0, videoram[tile_index], color, 0);
272272}
273273
274274VIDEO_START( jollyjgr )
275275{
276   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
276   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
277277
278278   tilemap_set_transparent_pen(bg_tilemap, 0);
279279   tilemap_set_scroll_cols(bg_tilemap, 32);
src/mame/drivers/namcoic.c
r814r815
4040   int tile, mask;
4141   mTilemapInfo.cb( vram[tile_index], &tile, &mask );
4242   tileinfo->mask_data = mTilemapInfo.maskBaseAddr+mask*8;
43   SET_TILE_INFO(mTilemapInfo.gfxbank,tile,0,0)
43   SET_TILE_INFO(mTilemapInfo.gfxbank,tile,0,0);
4444} /* get_tile_info */
4545
4646static TILE_GET_INFO( get_tile_info0 ) { get_tile_info(machine,tileinfo,tile_index,&mTilemapInfo.videoram[0x0000]); }
r814r815
6161   mTilemapInfo.videoram = auto_malloc( 0x10000*2 );
6262
6363      /* four scrolling tilemaps */
64      mTilemapInfo.tmap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,64,64);
65      mTilemapInfo.tmap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,64,64);
66      mTilemapInfo.tmap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,64,64);
67      mTilemapInfo.tmap[3] = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,64,64);
64      mTilemapInfo.tmap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
65      mTilemapInfo.tmap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
66      mTilemapInfo.tmap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
67      mTilemapInfo.tmap[3] = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
6868
6969      /* two non-scrolling tilemaps */
70      mTilemapInfo.tmap[4] = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,36,28);
71      mTilemapInfo.tmap[5] = tilemap_create(get_tile_info5,tilemap_scan_rows,TILEMAP_TYPE_BITMASK,8,8,36,28);
70      mTilemapInfo.tmap[4] = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,36,28);
71      mTilemapInfo.tmap[5] = tilemap_create(get_tile_info5,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,36,28);
7272
7373      /* define offsets for scrolling */
7474      for( i=0; i<4; i++ )
r814r815
10581058   roz_get_info( machine,tileinfo,tile_index,1 );
10591059} /* roz_get_info1 */
10601060
1061static UINT32
1062namco_roz_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
1061static
1062TILEMAP_MAPPER( namco_roz_scan )
10631063{
10641064   if( col>=128 )
10651065   {
r814r815
10731073namco_roz_init( int gfxbank, int maskregion )
10741074{
10751075   int i;
1076   static tile_get_info_fn roz_info[ROZ_TILEMAP_COUNT] =
1076   static tile_get_info_callback roz_info[ROZ_TILEMAP_COUNT] =
10771077   {
10781078      roz_get_info0,
10791079      roz_get_info1
r814r815
10911091         mRozTilemap[i] = tilemap_create(
10921092            roz_info[i],
10931093            namco_roz_scan,
1094            TILEMAP_TYPE_BITMASK,
1094            TILEMAP_TYPE_PEN,
10951095            16,16,
10961096            256,256 );
10971097      }
r814r815
11781178   {
11791179      UINT32 size_mask = rozInfo->size-1;
11801180      mame_bitmap *srcbitmap = tilemap_get_pixmap( tmap );
1181      mame_bitmap *transparency_bitmap = tilemap_get_transparency_bitmap( tmap );
1181      mame_bitmap *flagsbitmap = tilemap_get_flagsmap( tmap );
11821182      UINT32 startx = rozInfo->startx + clip->min_x * rozInfo->incxx + clip->min_y * rozInfo->incyx;
11831183      UINT32 starty = rozInfo->starty + clip->min_x * rozInfo->incxy + clip->min_y * rozInfo->incyy;
11841184      int sx = clip->min_x;
r814r815
11931193         {
11941194            UINT32 xpos = (((cx>>16)&size_mask) + rozInfo->left)&0xfff;
11951195            UINT32 ypos = (((cy>>16)&size_mask) + rozInfo->top)&0xfff;
1196            if( *BITMAP_ADDR8(transparency_bitmap, ypos, xpos)&TILE_FLAG_FG_OPAQUE )
1196            if( *BITMAP_ADDR8(flagsbitmap, ypos, xpos)&TILEMAP_PIXEL_LAYER0 )
11971197            {
11981198               *dest = *BITMAP_ADDR16(srcbitmap,ypos,xpos)+rozInfo->color;
11991199            }
r814r815
15081508   int tile = (data&0x3ff);
15091509   int color = (data>>10);
15101510
1511   SET_TILE_INFO( mRoadGfxBank, tile, color , 0 )
1511   SET_TILE_INFO( mRoadGfxBank, tile, color , 0 );
15121512} /* get_road_info */
15131513
15141514READ16_HANDLER( namco_road16_r )
r814r815
15831583            machine->gfx[gfxbank] = pGfx;
15841584            mpRoadTilemap = tilemap_create(
15851585               get_road_info,tilemap_scan_rows,
1586               TILEMAP_TYPE_OPAQUE,
1586               TILEMAP_TYPE_PEN,
15871587               ROAD_TILE_SIZE,ROAD_TILE_SIZE,
15881588               ROAD_COLS,ROAD_ROWS);
15891589
src/mame/drivers/ddayjlc.c
r814r815
338338{
339339   int code = bgram[tile_index]+((bgram[tile_index+0x400]&(1<<3))<<(8-3));
340340
341   SET_TILE_INFO(2, code, 0, 0)
341   SET_TILE_INFO(2, code, 0, 0);
342342}
343343
344344VIDEO_START( ddayjlc )
345345{
346   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32,32);
346   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
347347}
348348
349349VIDEO_UPDATE( ddayjlc )
src/mame/drivers/statriv2.c
r814r815
102102   int code = statriv2_videoram[0x400+tile_index];
103103   int attr = statriv2_videoram[tile_index] & 0x3f;
104104
105   SET_TILE_INFO(0, code, attr, 0)
105   SET_TILE_INFO(0, code, attr, 0);
106106}
107107
108108
r814r815
115115
116116VIDEO_START (statriv2)
117117{
118   statriv2_tilemap = tilemap_create(get_statriv2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,16,64, 16);
118   statriv2_tilemap = tilemap_create(get_statriv2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,16,64, 16);
119119}
120120
121121VIDEO_UPDATE (statriv2)
src/mame/drivers/egghunt.c
r814r815
107107//          code += 0;
108108   }
109109
110   SET_TILE_INFO(0, code, colour, 0)
110   SET_TILE_INFO(0, code, colour, 0);
111111}
112112
113113READ8_HANDLER( egghunt_bgram_r )
r814r815
144144
145145VIDEO_START(egghunt)
146146{
147   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,64, 32);
147   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64, 32);
148148   egghunt_bgram = auto_malloc(0x1000);
149149   egghunt_spram = auto_malloc(0x1000);
150150}
src/mame/drivers/acommand.c
r814r815
5959static UINT16 *ac_txvram,*ac_bgvram;
6060static UINT16 *ac_vregs;
6161
62static UINT32 bg_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
62static TILEMAP_MAPPER( bg_scan )
6363{
6464   /* logical (col,row) -> memory offset */
6565   return (row & 0x0f) + ((col & 0xff) << 4) + ((row & 0x70) << 8);
r814r815
7272         1,
7373         code & 0xfff,
7474         (code & 0xf000) >> 12,
75         0)
75         0);
7676}
7777
7878static TILE_GET_INFO( ac_get_tx_tile_info )
r814r815
8282         0,
8383         code & 0xfff,
8484         (code & 0xf000) >> 12,
85         0)
85         0);
8686}
8787
8888static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int priority, int pri_mask)
r814r815
147147
148148VIDEO_START( acommand )
149149{
150   tx_tilemap = tilemap_create(ac_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,512,32);
151   bg_tilemap = tilemap_create(ac_get_bg_tile_info,bg_scan,TILEMAP_TYPE_OPAQUE,16,16,256,16);
150   tx_tilemap = tilemap_create(ac_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,512,32);
151   bg_tilemap = tilemap_create(ac_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,16);
152152
153153   ac_vregs = auto_malloc(0x80);
154154
src/mame/drivers/ppmast93.c
r814r815
316316         0,
317317         code & 0x0fff,
318318         (code & 0xf000) >> 12,
319         0)
319         0);
320320}
321321
322322static TILE_GET_INFO( get_ppmast93_fg_tile_info )
r814r815
326326         0,
327327         (code & 0x0fff)+0x1000,
328328         (code & 0xf000) >> 12,
329         0)
329         0);
330330}
331331
332332VIDEO_START( ppmast93 )
333333{
334   ppmast93_bg_tilemap = tilemap_create(get_ppmast93_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE,8,8,32, 32);
335   ppmast93_fg_tilemap = tilemap_create(get_ppmast93_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,32, 32);
334   ppmast93_bg_tilemap = tilemap_create(get_ppmast93_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
335   ppmast93_fg_tilemap = tilemap_create(get_ppmast93_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
336336
337337   tilemap_set_transparent_pen(ppmast93_fg_tilemap,0);
338338}
src/mame/drivers/nwk-tr.c
r814r815
9797};
9898
9999
100static UINT32 K001604_scan_layer_8x8_0( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
100static TILEMAP_MAPPER( K001604_scan_layer_8x8_0 )
101101{
102102   /* logical (col,row) -> memory offset */
103103   int width = K001604_layer_size ? 256 : 128;
104104   return K001604_tilemap_offset + (row * width) + col;
105105}
106106
107static UINT32 K001604_scan_layer_8x8_1( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
107static TILEMAP_MAPPER( K001604_scan_layer_8x8_1 )
108108{
109109   /* logical (col,row) -> memory offset */
110110   int width = K001604_layer_size ? 256 : 128;
111111   return K001604_tilemap_offset + (row * width) + col + 64;
112112}
113113
114static UINT32 K001604_scan_layer_roz_0( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
114static TILEMAP_MAPPER( K001604_scan_layer_roz_0 )
115115{
116116   /* logical (col,row) -> memory offset */
117117   int width = K001604_layer_size ? 256 : 128;
118118   return (row * width) + col + (K001604_layer_size ? 128 : 0);
119119}
120120
121static UINT32 K001604_scan_layer_roz_1( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
121static TILEMAP_MAPPER( K001604_scan_layer_roz_1 )
122122{
123123   /* logical (col,row) -> memory offset */
124124   int width = K001604_layer_size ? 256 : 128;
r814r815
246246   {
247247      int roz_tile_size = K001604_roz_size[chip] ? 16 : 8;
248248      int roz_width = K001604_layer_size ? 64 : 128;
249      K001604_layer_8x8[chip][0] = tilemap_create(K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_0, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
250      K001604_layer_8x8[chip][1] = tilemap_create(K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_1, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
249      K001604_layer_8x8[chip][0] = tilemap_create(K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_0, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
250      K001604_layer_8x8[chip][1] = tilemap_create(K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_1, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
251251
252      K001604_layer_roz[chip][0] = tilemap_create(K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_0, TILEMAP_TYPE_OPAQUE, roz_tile_size, roz_tile_size, roz_width, 64);
253      K001604_layer_roz[chip][1] = tilemap_create(K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_1, TILEMAP_TYPE_OPAQUE, roz_tile_size, roz_tile_size, 64, 64);
252      K001604_layer_roz[chip][0] = tilemap_create(K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_0, TILEMAP_TYPE_PEN, roz_tile_size, roz_tile_size, roz_width, 64);
253      K001604_layer_roz[chip][1] = tilemap_create(K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_1, TILEMAP_TYPE_PEN, roz_tile_size, roz_tile_size, 64, 64);
254254   }
255255   else
256256   {
257257      int roz_tile_size = K001604_roz_size[chip] ? 16 : 8;
258258      int roz_width = K001604_layer_size ? 64 : 128;
259      K001604_layer_8x8[chip][0] = tilemap_create(K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_0, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
260      K001604_layer_8x8[chip][1] = tilemap_create(K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_1, TILEMAP_TYPE_TRANSPARENT, 8, 8, 64, 64);
259      K001604_layer_8x8[chip][0] = tilemap_create(K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_0, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
260      K001604_layer_8x8[chip][1] = tilemap_create(K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_1, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
261261
262      K001604_layer_roz[chip][0] = tilemap_create(K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_0, TILEMAP_TYPE_OPAQUE, roz_tile_size, roz_tile_size, roz_width, 64);
263      K001604_layer_roz[chip][1] = tilemap_create(K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_1, TILEMAP_TYPE_OPAQUE, roz_tile_size, roz_tile_size, 64, 64);
262      K001604_layer_roz[chip][0] = tilemap_create(K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_0, TILEMAP_TYPE_PEN, roz_tile_size, roz_tile_size, roz_width, 64);
263      K001604_layer_roz[chip][1] = tilemap_create(K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_1, TILEMAP_TYPE_PEN, roz_tile_size, roz_tile_size, 64, 64);
264264   }
265265
266266   tilemap_set_transparent_pen(K001604_layer_8x8[chip][0], 0);
src/mame/drivers/pkscram.c
r814r815
187187   int tile  = pkscramble_bgtilemap_ram[tile_index*2];
188188   int color = pkscramble_bgtilemap_ram[tile_index*2 + 1] & 0x7f;
189189
190   SET_TILE_INFO(0,tile,color,0)
190   SET_TILE_INFO(0,tile,color,0);
191191}
192192
193193static TILE_GET_INFO( get_md_tile_info )
r814r815
195195   int tile  = pkscramble_mdtilemap_ram[tile_index*2];
196196   int color = pkscramble_mdtilemap_ram[tile_index*2 + 1] & 0x7f;
197197
198   SET_TILE_INFO(0,tile,color,0)
198   SET_TILE_INFO(0,tile,color,0);
199199}
200200
201201static TILE_GET_INFO( get_fg_tile_info )
r814r815
203203   int tile  = pkscramble_fgtilemap_ram[tile_index*2];
204204   int color = pkscramble_fgtilemap_ram[tile_index*2 + 1] & 0x7f;
205205
206   SET_TILE_INFO(0,tile,color,0)
206   SET_TILE_INFO(0,tile,color,0);
207207}
208208
209209static TIMER_CALLBACK( scanline_callback )
r814r815
226226
227227VIDEO_START( pkscramble )
228228{
229   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE,      8, 8,32,32);
230   md_tilemap = tilemap_create(get_md_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
231   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8,32,32);
229   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8,32,32);
230   md_tilemap = tilemap_create(get_md_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,32,32);
231   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,32,32);
232232
233233   tilemap_set_transparent_pen(md_tilemap,15);
234234   tilemap_set_transparent_pen(fg_tilemap,15);
src/mame/drivers/cball.c
r814r815
1515{
1616   UINT8 code = cball_video_ram[tile_index];
1717
18   SET_TILE_INFO(0, code, code >> 7, 0)
18   SET_TILE_INFO(0, code, code >> 7, 0);
1919}
2020
2121
r814r815
2828
2929static VIDEO_START( cball )
3030{
31   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
31   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
3232}
3333
3434
src/mame/drivers/cherrym2.c
r814r815
4848   int code = videoram[tile_index];
4949   int color = attr;
5050
51   SET_TILE_INFO(0, code, color, 0)
51   SET_TILE_INFO(0, code, color, 0);
5252}
5353
5454VIDEO_START(cm2)
5555{
5656   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
57      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
57      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
5858}
5959
6060VIDEO_UPDATE(cm2)
src/mame/drivers/bigfghtr.c
r814r815
131131         1,
132132         (data&0x7ff),
133133         data>>11,
134         0)
134         0);
135135}
136136
137137
r814r815
142142         2,
143143         (data&0x3ff),
144144         data>>11,
145         0)
145         0);
146146}
147147
148148static TILE_GET_INFO( get_tx_tile_info )
r814r815
156156         0,
157157         tile_number + 256 * (attributes & 0x3),
158158         attributes >> 4,
159         0)
159         0);
160160}
161161
162162static VIDEO_START( bigfghtr )
163163{
164   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_OPAQUE,16,16,64,32);
165   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,16,16,64,32);
166   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_TRANSPARENT,8,8,64,32);
164   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
165   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
166   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
167167
168168   tilemap_set_transparent_pen(fg_tilemap,0xf);
169169   tilemap_set_transparent_pen(tx_tilemap,0xf);
src/mame/drivers/trvmadns.c
r814r815
253253   flag = TILE_FLIPXY((attr & 0x06) >> 1);
254254
255255   if((~attr & 0x20) || (~attr & 0x40))
256      flag |= TILE_IGNORE_TRANSPARENCY;
256      flag |= TILE_FORCE_LAYER0;
257257
258258   //0x20? tile transparent pen 1?
259259   //0x40? tile transparent pen 1?
260260
261   SET_TILE_INFO(0,tile,color,flag)
261   SET_TILE_INFO(0,tile,color,flag);
262262}
263263
264264VIDEO_START( trvmadns )
265265{
266   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_TRANSPARENT, 8, 8, 32, 32);
266   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
267267
268268   tilemap_set_transparent_pen(bg_tilemap,1);
269269}
src/mame/drivers/rabbit.c
r814r815
136136      tileno >>=(1+tilesize*2);
137137      colour&=0x0f;
138138      colour+=0x20;
139      SET_TILE_INFO(6+tilesize,tileno,colour,TILE_FLIPXY(flipxy))
139      SET_TILE_INFO(6+tilesize,tileno,colour,TILE_FLIPXY(flipxy));
140140   }
141141   else
142142   {
143143      tileno >>=(0+tilesize*2);
144144      colour+=0x200;
145145      colour ^=0xf; // ^0xf because we've inverted palette writes (see notes in driver init)
146      SET_TILE_INFO(4+tilesize,tileno,colour,TILE_FLIPXY(flipxy))
146      SET_TILE_INFO(4+tilesize,tileno,colour,TILE_FLIPXY(flipxy));
147147   }
148148}
149149
r814r815
344344   memset(rabbit_tilemap_ram[2], 0, 0x20000);
345345   memset(rabbit_tilemap_ram[3], 0, 0x20000);
346346
347   rabbit_tilemap[0] = tilemap_create(get_rabbit_tilemap0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT ,     16, 16, 128,32);
348   rabbit_tilemap[1] = tilemap_create(get_rabbit_tilemap1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT ,     16, 16, 128,32);
349   rabbit_tilemap[2] = tilemap_create(get_rabbit_tilemap2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT ,     16, 16, 128,32);
350   rabbit_tilemap[3] = tilemap_create(get_rabbit_tilemap3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT ,     8, 8, 128,32);
347   rabbit_tilemap[0] = tilemap_create(get_rabbit_tilemap0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 128,32);
348   rabbit_tilemap[1] = tilemap_create(get_rabbit_tilemap1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 128,32);
349   rabbit_tilemap[2] = tilemap_create(get_rabbit_tilemap2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 128,32);
350   rabbit_tilemap[3] = tilemap_create(get_rabbit_tilemap3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     8, 8, 128,32);
351351   tilemap_set_transparent_pen(rabbit_tilemap[0],0x0);
352352   tilemap_set_transparent_pen(rabbit_tilemap[1],0x0);
353353   tilemap_set_transparent_pen(rabbit_tilemap[2],0x0);
r814r815
401401   tilemap_draw_roz(bitmap,cliprect,rabbit_tilemap[whichtilemap],startx << 12,starty << 12,
402402         incxx << 5,incxy << 8,incyx << 8,incyy << 5,
403403         1,   /* wraparound */
404         tran ? 0 : TILEMAP_IGNORE_TRANSPARENCY,0);
404         tran ? 0 : TILEMAP_DRAW_OPAQUE,0);
405405}
406406
407407VIDEO_UPDATE(rabbit)
r814r815
11361136   memset(rabbit_tilemap_ram[2], 0, 0x20000);
11371137   memset(rabbit_tilemap_ram[3], 0, 0x20000);
11381138
1139   rabbit_tilemap[0] = tilemap_create(get_tmmjprd_tilemap0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT ,     8, 8, 64, 64);
1140   rabbit_tilemap[1] = tilemap_create(get_tmmjprd_tilemap1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT ,     16, 16, 64, 64);
1141   rabbit_tilemap[2] = tilemap_create(get_tmmjprd_tilemap2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT ,     16, 16, 64, 64);
1142   rabbit_tilemap[3] = tilemap_create(get_tmmjprd_tilemap3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT ,     16, 16, 64, 64);
1139   rabbit_tilemap[0] = tilemap_create(get_tmmjprd_tilemap0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     8, 8, 64, 64);
1140   rabbit_tilemap[1] = tilemap_create(get_tmmjprd_tilemap1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 64, 64);
1141   rabbit_tilemap[2] = tilemap_create(get_tmmjprd_tilemap2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 64, 64);
1142   rabbit_tilemap[3] = tilemap_create(get_tmmjprd_tilemap3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 64, 64);
11431143   tilemap_set_transparent_pen(rabbit_tilemap[0],0x0);
11441144   tilemap_set_transparent_pen(rabbit_tilemap[1],0x0);
11451145   tilemap_set_transparent_pen(rabbit_tilemap[2],0x0);
src/mame/drivers/cherrym.c
r814r815
6868   int code = videoram[tile_index] + ((attr & 0x0f) << 8);
6969   int color = (attr & 0xf0) >> 4;
7070
71   SET_TILE_INFO(0, code, color, 0)
71   SET_TILE_INFO(0, code, color, 0);
7272}
7373
7474#if 0
r814r815
9999VIDEO_START(cm)
100100{
101101   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
102      TILEMAP_TYPE_OPAQUE, 8, 8, 64, 32);
102      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
103103}
104104
105105VIDEO_UPDATE(cm)
src/mame/drivers/segas18.c
r814r815
15181518   ROM_LOAD16_BYTE( "mpr13789.12a", 0x400000, 0x80000, CRC(09ba8835) SHA1(72e83dd1793a7f4b2b881e71f262493e3d4992b3) )
15191519
15201520   ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* sound CPU */
1521   ROM_LOAD( "epr13793.7c",    0x010000, 0x80000, CRC(a3d31944) SHA1(44d17aa0598eacfac4b12c8955fd1067ca09abbd) )
1522   ROM_LOAD( "epr13792.6c",    0x090000, 0x80000, CRC(808f9695) SHA1(d50677d20083ad56dbf0864db05f76f93a4e9eba) )
1523   ROM_LOAD( "epr13791.5c",   0x110000, 0x80000, CRC(35c16d80) SHA1(7ed04600748c5efb63e25f066daa163e9c0d8038) )
1521   ROM_LOAD( "epr13793.7c", 0x010000, 0x80000, CRC(a3d31944) SHA1(44d17aa0598eacfac4b12c8955fd1067ca09abbd) )
1522   ROM_LOAD( "epr13792.6c", 0x090000, 0x80000, CRC(808f9695) SHA1(d50677d20083ad56dbf0864db05f76f93a4e9eba) )
1523   ROM_LOAD( "epr13791.5c", 0x110000, 0x80000, CRC(35c16d80) SHA1(7ed04600748c5efb63e25f066daa163e9c0d8038) )
15241524ROM_END
15251525
15261526/**************************************************************************************************************************
r814r815
15561556
15571557   ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* sound CPU */
15581558   /* another copy in different set is epr-13778.b7 - 9c54c038 */
1559   ROM_LOAD( "epr13778.c7",    0x010000, 0x20000, CRC(35e86146) SHA1(9be82165dc12d5f32ef26f37ea02b29e3621893f) )
1560   ROM_LOAD( "epr13777.c6",    0x090000, 0x80000, CRC(d1524782) SHA1(121c5804927ed686ea50d5d81d0226e041f50f6f) )
1561   ROM_LOAD( "epr13776.c5",   0x110000, 0x80000, CRC(282ac9fe) SHA1(4f54d93779c35c036d7c85fce6736df80f3bbe33) )
1559   ROM_LOAD( "epr13778.c7", 0x010000, 0x20000, CRC(35e86146) SHA1(9be82165dc12d5f32ef26f37ea02b29e3621893f) )
1560   ROM_LOAD( "epr13777.c6", 0x090000, 0x80000, CRC(d1524782) SHA1(121c5804927ed686ea50d5d81d0226e041f50f6f) )
1561   ROM_LOAD( "epr13776.c5", 0x110000, 0x80000, CRC(282ac9fe) SHA1(4f54d93779c35c036d7c85fce6736df80f3bbe33) )
15621562ROM_END
15631563
15641564
r814r815
15711571*/
15721572ROM_START( ddcrew )
15731573   ROM_REGION( 0x300000, REGION_CPU1, 0 ) /* 68000 code */
1574   ROM_LOAD16_BYTE( "epr14160.a4", 0x000000, 0x40000, CRC(b9f897b7) SHA1(65cee6c8006f328eee648e144e11fa60b1433ff5) )
1575   ROM_LOAD16_BYTE( "epr14161.a6", 0x000001, 0x40000, CRC(bb03c1f0) SHA1(9e7fbd2cda448992c6cbf4b96078b57305def097) )
1574   ROM_LOAD16_BYTE( "epr-14160.a4", 0x000000, 0x40000, CRC(b9f897b7) SHA1(65cee6c8006f328eee648e144e11fa60b1433ff5) )
1575   ROM_LOAD16_BYTE( "epr-14161.a6", 0x000001, 0x40000, CRC(bb03c1f0) SHA1(9e7fbd2cda448992c6cbf4b96078b57305def097) )
15761576   ROM_LOAD16_BYTE( "mpr-14139.5a", 0x200000, 0x40000, CRC(06c31531) SHA1(d084cb72bf83578b34e959bb60a0695faf4161f8) )
15771577   ROM_LOAD16_BYTE( "mpr-14141.7a", 0x200001, 0x40000, CRC(080a494b) SHA1(64522dccbf6ed856ab80aa185454183df87d7ae9) )
15781578
r814r815
15951595   ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) )
15961596
15971597   ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* sound CPU */
1598   ROM_LOAD( "epr-14133.7c",    0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1599   ROM_LOAD( "mpr-14132.6c",    0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1600   ROM_LOAD( "mpr-14131.5c",    0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1601   ROM_LOAD( "epr-14130.4c",    0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
1598   ROM_LOAD( "epr-14133.7c", 0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1599   ROM_LOAD( "mpr-14132.6c", 0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1600   ROM_LOAD( "mpr-14131.5c", 0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1601   ROM_LOAD( "epr-14130.4c", 0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
16021602ROM_END
16031603
16041604/**************************************************************************************************************************
r814r815
16081608*/
16091609ROM_START( ddcrewu )
16101610   ROM_REGION( 0x300000, REGION_CPU1, 0 ) /* 68000 code */
1611   ROM_LOAD16_BYTE( "14152.4a", 0x000000, 0x40000, CRC(69c7b571) SHA1(9fe4815a1cff0a46a754a6bdee12abaf7beb6501) )
1612   ROM_LOAD16_BYTE( "14153.6a", 0x000001, 0x40000, CRC(e01fae0c) SHA1(7166f955324f73e94d8ae6d2a5b2f4b497e62933) )
1611   ROM_LOAD16_BYTE( "epr-14152.4a", 0x000000, 0x40000, CRC(69c7b571) SHA1(9fe4815a1cff0a46a754a6bdee12abaf7beb6501) )
1612   ROM_LOAD16_BYTE( "epr-14153.6a", 0x000001, 0x40000, CRC(e01fae0c) SHA1(7166f955324f73e94d8ae6d2a5b2f4b497e62933) )
16131613   ROM_LOAD16_BYTE( "mpr-14139.5a", 0x200000, 0x40000, CRC(06c31531) SHA1(d084cb72bf83578b34e959bb60a0695faf4161f8) )
16141614   ROM_LOAD16_BYTE( "mpr-14141.7a", 0x200001, 0x40000, CRC(080a494b) SHA1(64522dccbf6ed856ab80aa185454183df87d7ae9) )
16151615
r814r815
16321632   ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) )
16331633
16341634   ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* sound CPU */
1635   ROM_LOAD( "epr-14133.7c",    0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1636   ROM_LOAD( "mpr-14132.6c",    0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1637   ROM_LOAD( "mpr-14131.5c",    0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1638   ROM_LOAD( "epr-14130.4c",    0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
1635   ROM_LOAD( "epr-14133.7c", 0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1636   ROM_LOAD( "mpr-14132.6c", 0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1637   ROM_LOAD( "mpr-14131.5c", 0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1638   ROM_LOAD( "epr-14130.4c", 0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
16391639ROM_END
16401640
16411641/**************************************************************************************************************************
r814r815
16451645*/
16461646ROM_START( ddcrew2 )
16471647   ROM_REGION( 0x300000, REGION_CPU1, 0 ) /* 68000 code */
1648   ROM_LOAD16_BYTE( "epr14148.a4", 0x000000, 0x40000, CRC(df4cb0cf) SHA1(153993997e9ceb06a9d4c73794ea66d0c585a291) )
1649   ROM_LOAD16_BYTE( "epr14149.a6", 0x000001, 0x40000, CRC(380ff818) SHA1(7c7dd7aa825665f1a9aaebb5af4ecf5dd109b0ca) )
1648   ROM_LOAD16_BYTE( "epr-14148.a4", 0x000000, 0x40000, CRC(df4cb0cf) SHA1(153993997e9ceb06a9d4c73794ea66d0c585a291) )
1649   ROM_LOAD16_BYTE( "epr-14149.a6", 0x000001, 0x40000, CRC(380ff818) SHA1(7c7dd7aa825665f1a9aaebb5af4ecf5dd109b0ca) )
16501650   ROM_LOAD16_BYTE( "mpr-14139.5a", 0x200000, 0x40000, CRC(06c31531) SHA1(d084cb72bf83578b34e959bb60a0695faf4161f8) )
16511651   ROM_LOAD16_BYTE( "mpr-14141.7a", 0x200001, 0x40000, CRC(080a494b) SHA1(64522dccbf6ed856ab80aa185454183df87d7ae9) )
16521652
r814r815
16691669   ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) )
16701670
16711671   ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* sound CPU */
1672   ROM_LOAD( "epr-14133.7c",    0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1673   ROM_LOAD( "mpr-14132.6c",    0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1674   ROM_LOAD( "mpr-14131.5c",    0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1675   ROM_LOAD( "epr-14130.4c",    0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
1672   ROM_LOAD( "epr-14133.7c", 0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1673   ROM_LOAD( "mpr-14132.6c", 0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1674   ROM_LOAD( "mpr-14131.5c", 0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1675   ROM_LOAD( "epr-14130.4c", 0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
16761676ROM_END
16771677
16781678/**************************************************************************************************************************
16791679    D.D. Crew, Sega System 18
1680    CPU: FD1094 (317-????)
1681    ROM Board: 171-5873B
1680    CPU: FD1094 (317-0187)
1681    PCB Board: 171-5873-02B (833-8165-05)
1682    Rom Board : 171-5987A (834-8166-05)
16821683*/
16831684ROM_START( ddcrew1 )
16841685   ROM_REGION( 0x300000, REGION_CPU1, 0 ) /* 68000 code */
1685   ROM_LOAD16_BYTE( "epr14138.a4", 0x000000, 0x40000, CRC(9a0dadf0) SHA1(b55c8cdd3158607ec8203bfebc9e7aba24d6d565) )
1686   ROM_LOAD16_BYTE( "epr14140.a6", 0x000001, 0x40000, CRC(e74362f4) SHA1(a6f96d714baeb826221b712b996e99831cf25abf) )
1686   ROM_LOAD16_BYTE( "epr-14154.a4", 0x000000, 0x40000, CRC(9a0dadf0) SHA1(b55c8cdd3158607ec8203bfebc9e7aba24d6d565) )
1687   ROM_LOAD16_BYTE( "epr-14155.a6", 0x000001, 0x40000, CRC(e74362f4) SHA1(a6f96d714baeb826221b712b996e99831cf25abf) )
16871688   ROM_LOAD16_BYTE( "mpr-14139.5a", 0x200000, 0x40000, CRC(06c31531) SHA1(d084cb72bf83578b34e959bb60a0695faf4161f8) )
16881689   ROM_LOAD16_BYTE( "mpr-14141.7a", 0x200001, 0x40000, CRC(080a494b) SHA1(64522dccbf6ed856ab80aa185454183df87d7ae9) )
16891690
16901691   ROM_REGION( 0x2000, REGION_USER1, 0 )   /* decryption key */
1691   ROM_LOAD( "317-unknown_ddcrewa.key", 0x0000, 0x2000, CRC(1dfb60be) SHA1(7bd42a2e54fca574076e5ed164ab4e0cbb645a4f) )
1692   ROM_LOAD( "317-0187.key", 0x0000, 0x2000, CRC(1dfb60be) SHA1(7bd42a2e54fca574076e5ed164ab4e0cbb645a4f) )
16921693
16931694   ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
16941695   ROM_LOAD( "epr-14127.1c", 0x00000, 0x40000, CRC(2228cd88) SHA1(5774bb6a401c3da05c5f3c9d3996b20bb3713cb2) )
r814r815
17061707   ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) )
17071708
17081709   ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* sound CPU */
1709   ROM_LOAD( "epr-14133.7c",    0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1710   ROM_LOAD( "mpr-14132.6c",    0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1711   ROM_LOAD( "mpr-14131.5c",    0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1712   ROM_LOAD( "epr-14130.4c",    0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
1710   ROM_LOAD( "epr-14133.7c", 0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1711   ROM_LOAD( "mpr-14132.6c", 0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1712   ROM_LOAD( "mpr-14131.5c", 0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1713   ROM_LOAD( "epr-14130.4c", 0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
17131714ROM_END
17141715
17151716/**************************************************************************************************************************
r814r815
17431744   ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) )
17441745
17451746   ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* sound CPU */
1746   ROM_LOAD( "epr-14133.7c",    0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1747   ROM_LOAD( "mpr-14132.6c",    0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1748   ROM_LOAD( "mpr-14131.5c",    0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1749   ROM_LOAD( "epr-14130.4c",    0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
1747   ROM_LOAD( "epr-14133.7c", 0x010000, 0x20000, CRC(cff96665) SHA1(b4dc7f1a03415ebebdb99a82ae89328c345e7678) )
1748   ROM_LOAD( "mpr-14132.6c", 0x090000, 0x80000, CRC(1fae0220) SHA1(8414c74318ea915816c6b67801ac7c8c3fc905f9) )
1749   ROM_LOAD( "mpr-14131.5c", 0x110000, 0x80000, CRC(be5a7d0b) SHA1(c2c598b0cf711273fdd568f3401375e9772c1d61) )
1750   ROM_LOAD( "epr-14130.4c", 0x190000, 0x80000, CRC(948f34a1) SHA1(d4c6728d5eea06cee6ac15a34ec8cccb4cc4b982) )
17501751ROM_END
17511752
17521753
r814r815
22502251GAME( 1991, ddcrew,   0,        system18,      ddcrew,   ddcrew,       ROT0,   "Sega",    "D. D. Crew (set 4, World, 3 Player, FD1094 317-0190)", 0 )
22512252GAME( 1991, ddcrewu,  ddcrew,   system18,      ddcrew,   ddcrew,       ROT0,   "Sega",    "D. D. Crew (set 3, US, 4 Player, FD1094 317-0186)", 0 )
22522253GAME( 1991, ddcrew2,  ddcrew,   system18,      ddcrew2p, ddcrew,       ROT0,   "Sega",    "D. D. Crew (set 2, World, 2 Player, FD1094 317-0184)", 0 )
2253GAME( 1991, ddcrew1,  ddcrew,   system18,      ddcrew,   ddcrew,       ROT0,   "Sega",    "D. D. Crew (set 1, World, 4 Player, FD1094 317-?)", 0 )
2254GAME( 1991, ddcrew1,  ddcrew,   system18,      ddcrew,   ddcrew,       ROT0,   "Sega",    "D. D. Crew (set 1, World, 4 Player, FD1094 317-0187)", 0 )
22542255GAME( 1991, ddcrewj,  ddcrew,   system18,      ddcrew2p, ddcrew,       ROT0,   "Sega",    "D. D. Crew (set 5, Japan, 2 Player, FD1094 317-0182)", 0 )
22552256GAME( 1990, lghost,   0,        system18,      lghost,   lghost,       ROT0,   "Sega",    "Laser Ghost (set 2, World, 317-0166)", 0 )
22562257GAME( 1990, lghostu,  lghost,   system18,      lghost,   lghost,       ROT0,   "Sega",    "Laser Ghost (set 1, US, 317-0165)", 0 )
src/mame/drivers/ltcasino.c
r814r815
3131
3232   tileno += (colour & 0x80) << 1;
3333
34   SET_TILE_INFO(0,tileno,0,0)
34   SET_TILE_INFO(0,tileno,0,0);
3535}
3636
3737VIDEO_START(ltcasino)
3838{
39   ltcasino_tilemap = tilemap_create(get_ltcasino_tile_info,tilemap_scan_rows,TILEMAP_TYPE_OPAQUE, 8, 8,64,32);
39   ltcasino_tilemap = tilemap_create(get_ltcasino_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
4040}
4141
4242
src/mame/drivers/royalmah.c
r814r815
212187 Mahjong Diplomat         D0706088L1-0    Dynax
222287 Mahjong Studio 101       D1708228L1      Dynax
232387 Tonton                   D0908288L1-0    Dynax
2488 Mahjong Almond Pinky     D1401128L-0     Dynax
242589 Mahjong Derringer        D2203018L       Dynax               Larger palette
252690 Mahjong If..?            D29?            Dynax               Larger palette, TLCS-90 CPU
262795 Mahjong Tensinhai        D10010318L1     Dynax               Real Time Clock, TLCS-90 CPU
r814r815
2930
3031TODO:
3132
32- dip switches and inputs in dondenmj, suzume, mjderngr...
33- dip switches and inputs in dondenmj, suzume, mjapinky, mjderngr...
3334
3435- there's something fishy with the bank switching in tontonb/mjdiplob
3536
r814r815
3738
3839- mjtensin: random crashes, interrupts related
3940
41
4042Stephh's notes (based on the games Z80 code and some tests) :
4143
42441) 'royalmah'
r814r815
7375- janptr96: in service mode press in sequence N,Ron,Ron,N to access some
7476  hidden options. (thanks bnathan)
7577
78
79*** Notes by Roberto Fresca ***
80
81 - Added Mahjong Almond Pinky (Dynax, 1988).
82   Sub board: D1401128L-0
83
84   - Mapped all read/writes, but some ones need to be figured out..
85   - Updated technical notes.
86
87
7688****************************************************************************/
7789
7890#include "driver.h"
r814r815
456468   AM_RANGE(0x00, 0x00) AM_WRITE(dynax_bank_w)
457469ADDRESS_MAP_END
458470
471static ADDRESS_MAP_START( mjapinky_readport, ADDRESS_SPACE_IO, 8 )
472   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
473   AM_RANGE(0x01, 0x01) AM_READ(AY8910_read_port_0_r)
474   AM_RANGE(0x04, 0x04) AM_READNOP // input port?
475   AM_RANGE(0x10, 0x10) AM_READNOP // input port
476   AM_RANGE(0x11, 0x11) AM_READNOP // input port
477   AM_RANGE(0x00, 0x00) AM_READNOP // dsw?
478ADDRESS_MAP_END
479
480static ADDRESS_MAP_START( mjapinky_writeport, ADDRESS_SPACE_IO, 8 )
481   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
482   AM_RANGE(0x02, 0x02) AM_WRITE(AY8910_write_port_0_w)
483   AM_RANGE(0x03, 0x03) AM_WRITE(AY8910_control_port_0_w)
484   AM_RANGE(0x10, 0x10) AM_WRITE(royalmah_palbank_w)
485   AM_RANGE(0x11, 0x11) AM_WRITE(royalmah_input_port_select_w)
486   AM_RANGE(0x00, 0x00) AM_WRITE(dynax_bank_w)
487ADDRESS_MAP_END
488
459489static ADDRESS_MAP_START( mjderngr_readport, ADDRESS_SPACE_IO, 8 )
460490   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
461491   AM_RANGE(0x01, 0x01) AM_READ(AY8910_read_port_0_r)
r814r815
16001630   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16011631INPUT_PORTS_END
16021632
1633static INPUT_PORTS_START( mjapinky )
1634INPUT_PORTS_END
1635
16031636static INPUT_PORTS_START( janptr96 )
16041637   PORT_START   /* P1 IN0 */
16051638   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
r814r815
22472280   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
22482281INPUT_PORTS_END
22492282
2250
22512283static struct AY8910interface ay8910_interface =
22522284{
22532285   royalmah_player_1_port_r,
r814r815
24182450   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)
24192451MACHINE_DRIVER_END
24202452
2453static MACHINE_DRIVER_START( mjapinky )
2454   /* basic machine hardware */
2455   MDRV_IMPORT_FROM(dondenmj)
2456   MDRV_CPU_MODIFY("main")
2457   MDRV_CPU_IO_MAP(mjapinky_readport,mjapinky_writeport)
2458MACHINE_DRIVER_END
24212459
2460
24222461/***************************************************************************
24232462
24242463  Game driver(s)
r814r815
26842723   ROM_LOAD( "d100-1.6e",  0x200, 0x200, CRC(88befd59) SHA1(cbcb437f9f6b5e542dc69f5c9e85ccbae47080af) )
26852724ROM_END
26862725
2726/***************************************************************************
2727
2728Mahjong Almond Pinky
2729(c)1988 Dynax
2730Modified Royal Mahjong PCB
2731D1401128L-0 (Sub PCB)
2732
2733CPU: Z80
2734Sound: AY-3-8910
2735
2736ROMs:
2737141.4D       [0c4fb83a]
2738142.4E       [129806f0]
2739143.4F       [3d0bc452]
2740144.4H       [24509a18]
2741145.4J       [fea3375a]
2742146.4K       [be27a9b9]
2743
274418S030N.CLR  [5736d0aa]
2745
2746***************************************************************************/
2747
2748ROM_START( mjapinky )
2749   ROM_REGION( 0x90000, REGION_CPU1, 0 )
2750   ROM_LOAD( "141.4d",     0x00000, 0x10000, CRC(0c4fb83a) SHA1(5d467e8fae715ca4acf88f8e9437c7cdf9f876bd) )
2751   /* bank switched ROMs follow */
2752   ROM_RELOAD(             0x10000, 0x10000 )
2753   ROM_LOAD( "142.4e",     0x20000, 0x10000, CRC(129806f0) SHA1(d12d2c5bb0c653f2e4974c47004ada128ac30bea) )
2754   ROM_LOAD( "143.4f",     0x30000, 0x10000, CRC(3d0bc452) SHA1(ad61eaa892121f90f31a6baf83158a11e6051430) )
2755   ROM_LOAD( "144.4h",     0x40000, 0x10000, CRC(24509a18) SHA1(ab9daed2cbc72d02c2168a4c93f70ebfe3916ea2) )
2756   ROM_LOAD( "145.4j",     0x50000, 0x10000, CRC(fea3375a) SHA1(cbb89b72cfba9c0448d152dfdbedb20b9896516e) )
2757   ROM_LOAD( "146.4k",     0x60000, 0x10000, CRC(be27a9b9) SHA1(f12402182f598391e445245b345f49084a69620a) )
2758
2759   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2760   ROM_LOAD( "18s030n.clr",   0x0000, 0x0020, CRC(5736d0aa) SHA1(298b51340d2697347842cfaa5921f31c7b7f9748) )
2761ROM_END
2762
26872763static DRIVER_INIT( janptr96 )
26882764{
26892765   generic_nvram_size = 0x1000 * 9;
r814r815
26942770
26952771
26962772
2697GAME( 1982, royalmah, 0, royalmah, royalmah, 0,        ROT0, "Falcon",           "Royal Mahjong (Japan)",            0 )
2698GAME( 1986, dondenmj, 0, dondenmj, majs101b, 0,        ROT0, "Dyna Electronics", "Don Den Mahjong [BET] (Japan)",    0 )
2699GAME( 1986, suzume,   0, suzume,   suzume,   0,        ROT0, "Dyna Electronics", "Watashiha Suzumechan (Japan)",     0 )
2700GAME( 1987, mjdiplob, 0, mjdiplob, mjdiplob, 0,        ROT0, "Dynax",            "Mahjong Diplomat [BET] (Japan)",   0 )
2701GAME( 1987, tontonb,  0, tontonb,  tontonb,  0,        ROT0, "Dynax",            "Tonton [BET] (Japan)",             0 )
2702GAME( 1988, majs101b, 0, majs101b, majs101b, 0,        ROT0, "Dynax",            "Mahjong Studio 101 [BET] (Japan)", 0 )
2703GAME( 1989, mjderngr, 0, mjderngr, majs101b, 0,        ROT0, "Dynax",            "Mahjong Derringer (Japan)",        0 )
2704GAME( 1990, mjifb,    0, mjifb,    mjifb,    0,        ROT0, "Dynax",            "Mahjong If...? [BET]",             0 )
2705GAME( 1995, mjtensin, 0, mjtensin, mjtensin, 0,        ROT0, "Dynax",            "Mahjong Tensinhai (Japan)",        GAME_NOT_WORKING )
2706GAME( 1996, janptr96, 0, janptr96, janptr96, janptr96, ROT0, "Dynax",            "Janputer '96 (Japan)",             0 )
2773GAME( 1982, royalmah, 0, royalmah, royalmah, 0,        ROT0, "Falcon",           "Royal Mahjong (Japan)",              0 )
2774GAME( 1986, dondenmj, 0, dondenmj, majs101b, 0,        ROT0, "Dyna Electronics", "Don Den Mahjong [BET] (Japan)",      0 )
2775GAME( 1986, suzume,   0, suzume,   suzume,   0,        ROT0, "Dyna Electronics", "Watashiha Suzumechan (Japan)",       0 )
2776GAME( 1987, mjdiplob, 0, mjdiplob, mjdiplob, 0,        ROT0, "Dynax",            "Mahjong Diplomat [BET] (Japan)",     0 )
2777GAME( 1987, tontonb,  0, tontonb,  tontonb,  0,        ROT0, "Dynax",            "Tonton [BET] (Japan)",               0 )
2778GAME( 1988, majs101b, 0, majs101b, majs101b, 0,        ROT0, "Dynax",            "Mahjong Studio 101 [BET] (Japan)",   0 )
2779GAME( 1988, mjapinky, 0, mjapinky, mjapinky, 0,        ROT0, "Dynax",            "Mahjong Almond Pinky [BET] (Japan)", GAME_NOT_WORKING )
2780GAME( 1989, mjderngr, 0, mjderngr, majs101b, 0,        ROT0, "Dynax",            "Mahjong Derringer (Japan)",          0 )
2781GAME( 1990, mjifb,    0, mjifb,    mjifb,    0,        ROT0, "Dynax",            "Mahjong If...? [BET]",               0 )
2782GAME( 1995, mjtensin, 0, mjtensin, mjtensin, 0,        ROT0, "Dynax",            "Mahjong Tensinhai (Japan)",          GAME_NOT_WORKING )
2783GAME( 1996, janptr96, 0, janptr96, janptr96, janptr96, ROT0, "Dynax",            "Janputer '96 (Japan)",               0 )
src/mame/drivers/miniboy7.c
r814r815
162162   if (bank == 1)   /* temporary hack to point to the 3rd gfx bank */
163163      bank = 2;
164164
165   SET_TILE_INFO(bank, code, color, 0)
165   SET_TILE_INFO(bank, code, color, 0);
166166}
167167
168168VIDEO_START( miniboy7 )
169169{
170170   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
171      TILEMAP_TYPE_OPAQUE, 8, 8, 37, 37);
171      TILEMAP_TYPE_PEN, 8, 8, 37, 37);
172172}
173173
174174VIDEO_UPDATE( miniboy7 )
src/tools/chdcd.c
r814r815
4242   }   \
4343   token[j] = '\0';
4444
45#define TOKENIZETOCOLON   \
46   j = 0; \
47   while ((linebuffer[i] != ':') && (i < 512) && (j < 128))   \
48   {   \
49      token[j] = linebuffer[i];   \
50      i++;   \
51      j++;   \
52   }   \
53   token[j] = '\0';
5445
55#define TOKENIZETOCOLONINC   \
56   j = 0; \
57   while ((linebuffer[i] != ':') && (i < 512) && (j < 128))   \
58   {   \
59      token[j] = linebuffer[i];   \
60      i++;   \
61      j++;   \
62   }   \
63   token[j++] = ':';   \
64   token[j] = '\0';
6546
66
67
6847/***************************************************************************
6948    GLOBAL VARIABLES
7049***************************************************************************/
r814r815
10786chd_error cdrom_parse_toc(const char *tocfname, cdrom_toc *outtoc, cdrom_track_input_info *outinfo)
10887{
10988   FILE *infile;
110   int i, j, k, trknum, m, s, f, foundcolon;
89   int i, j, trknum, m, s, f;
11190   static char token[128];
11291
11392   infile = fopen(tocfname, "rt");
r814r815
153132
154133            /* get either the offset or the length */
155134            EATWHITESPACE
135            TOKENIZE
156136
157            if (linebuffer[i] == '#')
137            if (token[0] == '#')
158138            {
159139               /* it's a decimal offset, use it */
160               TOKENIZE
161               outinfo->offset[trknum] = strtoul(&token[1], NULL, 10);
162
163               /* we're using this token, go on */
164               EATWHITESPACE
165               TOKENIZETOCOLONINC
140               f = strtoul(&token[1], NULL, 10);
166141            }
167142            else
168143            {
169               /* no offset, just M:S:F */
170               outinfo->offset[trknum] = 0;
171               TOKENIZETOCOLONINC
172            }
144               m = 0;
145               s = 0;
146               f = 0;
173147
174            /*
175                   This is tricky: the next number can be either a raw
176                   number or an M:S:F number.  Check which it is.
177                   If a space or LF/CR/terminator occurs before a colon in the token,
178                   it's a raw number.
179                */
148               sscanf( token, "%d:%d:%d", &m, &s, &f );
180149
181trycolonagain:
182            foundcolon = 0;
183            for (k = 0; k < strlen(token); k++)
184            {
185               if ((token[k] <= ' ') && (token[k] != ':'))
186               {
187                  break;
188               }
189
190               if (token[k] == ':')
191               {
192                  foundcolon = 1;
193                  break;
194               }
195            }
196
197            if (!foundcolon)
198            {
199               // rewind to the start of the real MSF
200               while (linebuffer[i] != ' ')
201               {
202                  i--;
203               }
204
205               // check for spurious offset included by newer CDRDAOs
206               if ((token[0] == '0') && (token[1] == ' '))
207               {
208                  i++;
209                  EATWHITESPACE
210                  TOKENIZETOCOLONINC
211                  goto trycolonagain;
212               }
213
214               i++;
215               TOKENIZE
216
217
218               f = strtoul(token, NULL, 10);
219            }
220            else
221            {
222               /* now get the MSF format length (might be MSF offset too) */
223               m = strtoul(token, NULL, 10);
224               i++;   /* skip the colon */
225               TOKENIZETOCOLON
226               s = strtoul(token, NULL, 10);
227               i++;   /* skip the colon */
228               TOKENIZE
229               f = strtoul(token, NULL, 10);
230
231150               /* convert to just frames */
232151               s += (m * 60);
233152               f += (s * 75);
153
154               f *= (outtoc->tracks[trknum].datasize + outtoc->tracks[trknum].subsize);
234155            }
235156
157            outinfo->offset[trknum] = f;
158
236159            EATWHITESPACE
237            if (isdigit(linebuffer[i]))
238            {
239               f *= outtoc->tracks[trknum].datasize;
160            TOKENIZE
240161
241               outinfo->offset[trknum] += f;
242
243               EATWHITESPACE
244               TOKENIZETOCOLON
245
246               m = strtoul(token, NULL, 10);
247               i++;   /* skip the colon */
248               TOKENIZETOCOLON
249               s = strtoul(token, NULL, 10);
250               i++;   /* skip the colon */
251               TOKENIZE
252               f = strtoul(token, NULL, 10);
253
254               /* convert to just frames */
255               s += (m * 60);
256               f += (s * 75);
257            }
258            else if( trknum > 1 )
162            if (isdigit(token[0]))
259163            {
260               f *= outtoc->tracks[trknum].datasize;
164               m = 0;
165               s = 0;
166               f = 0;
261167
262               outinfo->offset[trknum] += f;
168               if( sscanf( token, "%d:%d:%d", &m, &s, &f ) == 1 )
169               {
170                  f = m;
171               }
172               else
173               {
174                  /* convert to just frames */
175                  s += (m * 60);
176                  f += (s * 75);
177               }
263178
264               f = 0;
179               outtoc->tracks[trknum].frames = f;
265180            }
266
267            if (f)
181            else if( trknum == 0 )
268182            {
269               outtoc->tracks[trknum].frames = f;
183               /* the 1st track might have a length with no offset */
184               outtoc->tracks[trknum].frames = outinfo->offset[trknum] / (outtoc->tracks[trknum].datasize + outtoc->tracks[trknum].subsize);
185               outinfo->offset[trknum] = 0;
270186            }
271            else   /* track can't be zero length, guesstimate it */
187            else
272188            {
189               /* guesstimate the track length */
273190               UINT64 tlen;
274
275191               printf("Warning: Estimating length of track %d.  If this is not the final or only track\n on the disc, the estimate may be wrong.\n", trknum+1);
276192
277193               tlen = get_file_size(outinfo->fname[trknum]) - outinfo->offset[trknum];
src/tools/chdman.c
r814r815
27172717   file_error filerr;
27182718   chd_interface_file *file;
27192719   UINT32 openflags = 0;
2720   int open_or_create = 0;
27202721
27212722   switch(*mode++)
27222723   {
r814r815
27252726         if (*mode == 'b')
27262727            mode++;
27272728         if (*mode == '+')
2728            openflags |= OPEN_FLAG_WRITE | OPEN_FLAG_CREATE;
2729         {
2730            openflags |= OPEN_FLAG_WRITE;
2731            open_or_create = 1;
2732         }
27292733         break;
27302734
27312735      case 'w':
r814r815
27452749      goto error;
27462750
27472751   /* first try to open without creating */
2748   filerr = osd_open(filename, openflags & ~OPEN_FLAG_CREATE, &file->file, &file->length);
2752   filerr = osd_open(filename, openflags, &file->file, &file->length);
27492753   if (filerr != FILERR_NONE)
27502754   {
2751      if (openflags & OPEN_FLAG_CREATE)
2752         filerr = osd_open(filename, openflags, &file->file, &file->length);
2755      if (open_or_create)
2756         filerr = osd_open(filename, openflags | OPEN_FLAG_CREATE, &file->file, &file->length);
27532757      if (filerr != FILERR_NONE)
27542758         goto error;
27552759   }
src/emu/debug/debugcpu.c
r814r815
15841584    current cpu in the specified memory space
15851585-------------------------------------------------*/
15861586
1587UINT8 debug_read_byte(int spacenum, offs_t address)
1587UINT8 debug_read_byte(int spacenum, offs_t address, int apply_translation)
15881588{
15891589   const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()];
15901590   UINT64 custom;
r814r815
15971597   memory_set_debugger_access(1);
15981598
15991599   /* translate if necessary; if not mapped, return 0xff */
1600   if (info->translate && !(*info->translate)(spacenum, &address))
1600   if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, &address))
16011601      result = 0xff;
16021602
16031603   /* if there is a custom read handler, and it returns TRUE, use that value */
r814r815
16191619    current cpu in the specified memory space
16201620-------------------------------------------------*/
16211621
1622UINT16 debug_read_word(int spacenum, offs_t address)
1622UINT16 debug_read_word(int spacenum, offs_t address, int apply_translation)
16231623{
16241624   const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()];
16251625   UINT64 custom;
r814r815
16311631   /* if this is misaligned read, or if there are no word readers, just read two bytes */
16321632   if ((address & 1) || !active_address_space[spacenum].accessors->read_word)
16331633   {
1634      UINT8 byte0 = debug_read_byte(spacenum, address + 0);
1635      UINT8 byte1 = debug_read_byte(spacenum, address + 1);
1634      UINT8 byte0 = debug_read_byte(spacenum, address + 0, apply_translation);
1635      UINT8 byte1 = debug_read_byte(spacenum, address + 1, apply_translation);
16361636
16371637      /* based on the endianness, the result is assembled differently */
16381638      if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE)
r814r815
16481648      memory_set_debugger_access(1);
16491649
16501650      /* translate if necessary; if not mapped, return 0xffff */
1651      if (info->translate && !(*info->translate)(spacenum, &address))
1651      if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, &address))
16521652         result = 0xffff;
16531653
16541654      /* if there is a custom read handler, and it returns TRUE, use that value */
r814r815
16721672    current cpu in the specified memory space
16731673-------------------------------------------------*/
16741674
1675UINT32 debug_read_dword(int spacenum, offs_t address)
1675UINT32 debug_read_dword(int spacenum, offs_t address, int apply_translation)
16761676{
16771677   const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()];
16781678   UINT64 custom;
r814r815
16841684   /* if this is misaligned read, or if there are no dword readers, just read two words */
16851685   if ((address & 3) || !active_address_space[spacenum].accessors->read_dword)
16861686   {
1687      UINT16 word0 = debug_read_word(spacenum, address + 0);
1688      UINT16 word1 = debug_read_word(spacenum, address + 2);
1687      UINT16 word0 = debug_read_word(spacenum, address + 0, apply_translation);
1688      UINT16 word1 = debug_read_word(spacenum, address + 2, apply_translation);
16891689
16901690      /* based on the endianness, the result is assembled differently */
16911691      if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE)
r814r815
17011701      memory_set_debugger_access(1);
17021702
17031703      /* translate if necessary; if not mapped, return 0xffffffff */
1704      if (info->translate && !(*info->translate)(spacenum, &address))
1704      if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, &address))
17051705         result = 0xffffffff;
17061706
17071707      /* if there is a custom read handler, and it returns TRUE, use that value */
r814r815
17251725    current cpu in the specified memory space
17261726-------------------------------------------------*/
17271727
1728UINT64 debug_read_qword(int spacenum, offs_t address)
1728UINT64 debug_read_qword(int spacenum, offs_t address, int apply_translation)
17291729{
17301730   const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()];
17311731   UINT64 custom;
r814r815
17371737   /* if this is misaligned read, or if there are no qword readers, just read two dwords */
17381738   if ((address & 7) || !active_address_space[spacenum].accessors->read_qword)
17391739   {
1740      UINT32 dword0 = debug_read_dword(spacenum, address + 0);
1741      UINT32 dword1 = debug_read_dword(spacenum, address + 4);
1740      UINT32 dword0 = debug_read_dword(spacenum, address + 0, apply_translation);
1741      UINT32 dword1 = debug_read_dword(spacenum, address + 4, apply_translation);
17421742
17431743      /* based on the endianness, the result is assembled differently */
17441744      if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE)
r814r815
17541754      memory_set_debugger_access(1);
17551755
17561756      /* translate if necessary; if not mapped, return 0xffffffffffffffff */
1757      if (info->translate && !(*info->translate)(spacenum, &address))
1757      if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, &address))
17581758         result = ~(UINT64)0;
17591759
17601760      /* if there is a custom read handler, and it returns TRUE, use that value */
r814r815
17781778    current cpu in the specified memory space
17791779-------------------------------------------------*/
17801780
1781void debug_write_byte(int spacenum, offs_t address, UINT8 data)
1781void debug_write_byte(int spacenum, offs_t address, UINT8 data, int apply_translation)
17821782{
17831783   const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()];
17841784
r814r815
17891789   memory_set_debugger_access(1);
17901790
17911791   /* translate if necessary; if not mapped, we're done */
1792   if (info->translate && !(*info->translate)(spacenum, &address))
1792   if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, &address))
17931793      ;
17941794
17951795   /* if there is a custom write handler, and it returns TRUE, use that */
r814r815
18111811    current cpu in the specified memory space
18121812-------------------------------------------------*/
18131813
1814void debug_write_word(int spacenum, offs_t address, UINT16 data)
1814void debug_write_word(int spacenum, offs_t address, UINT16 data, int apply_translation)
18151815{
18161816   const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()];
18171817
r814r815
18231823   {
18241824      if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE)
18251825      {
1826         debug_write_byte(spacenum, address + 0, data >> 0);
1827         debug_write_byte(spacenum, address + 1, data >> 8);
1826         debug_write_byte(spacenum, address + 0, data >> 0, apply_translation);
1827         debug_write_byte(spacenum, address + 1, data >> 8, apply_translation);
18281828      }
18291829      else
18301830      {
1831         debug_write_byte(spacenum, address + 0, data >> 8);
1832         debug_write_byte(spacenum, address + 1, data >> 0);
1831         debug_write_byte(spacenum, address + 0, data >> 8, apply_translation);
1832         debug_write_byte(spacenum, address + 1, data >> 0, apply_translation);
18331833      }
18341834   }
18351835
r814r815
18401840      memory_set_debugger_access(1);
18411841
18421842      /* translate if necessary; if not mapped, we're done */
1843      if (info->translate && !(*info->translate)(spacenum, &address))
1843      if (apply_translation && info->translate && !(*info->translate)(spacenum, &address))
18441844         ;
18451845
18461846      /* if there is a custom write handler, and it returns TRUE, use that */
r814r815
18631863    current cpu in the specified memory space
18641864-------------------------------------------------*/
18651865
1866void debug_write_dword(int spacenum, offs_t address, UINT32 data)
1866void debug_write_dword(int spacenum, offs_t address, UINT32 data, int apply_translation)
18671867{
18681868   const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()];
18691869
r814r815
18751875   {
18761876      if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE)
18771877      {
1878         debug_write_word(spacenum, address + 0, data >> 0);
1879         debug_write_word(spacenum, address + 2, data >> 16);
1878         debug_write_word(spacenum, address + 0, data >> 0, apply_translation);
1879         debug_write_word(spacenum, address + 2, data >> 16, apply_translation);
18801880      }
18811881      else
18821882      {
1883         debug_write_word(spacenum, address + 0, data >> 16);
1884         debug_write_word(spacenum, address + 2, data >> 0);
1883         debug_write_word(spacenum, address + 0, data >> 16, apply_translation);
1884         debug_write_word(spacenum, address + 2, data >> 0, apply_translation);
18851885      }
18861886   }
18871887
r814r815
18921892      memory_set_debugger_access(1);
18931893
18941894      /* translate if necessary; if not mapped, we're done */
1895      if (info->translate && !(*info->translate)(spacenum, &address))
1895      if (apply_translation && info->translate && !(*info->translate)(spacenum, &address))
18961896         ;
18971897
18981898      /* if there is a custom write handler, and it returns TRUE, use that */
r814r815
19151915    current cpu in the specified memory space
19161916-------------------------------------------------*/
19171917
1918void debug_write_qword(int spacenum, offs_t address, UINT64 data)
1918void debug_write_qword(int spacenum, offs_t address, UINT64 data, int apply_translation)
19191919{
19201920   const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()];
19211921
r814r815
19271927   {
19281928      if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE)
19291929      {
1930         debug_write_dword(spacenum, address + 0, data >> 0);
1931         debug_write_dword(spacenum, address + 4, data >> 32);
1930         debug_write_dword(spacenum, address + 0, data >> 0, apply_translation);
1931         debug_write_dword(spacenum, address + 4, data >> 32, apply_translation);
19321932      }
19331933      else
19341934      {
1935         debug_write_dword(spacenum, address + 0, data >> 32);
1936         debug_write_dword(spacenum, address + 4, data >> 0);
1935         debug_write_dword(spacenum, address + 0, data >> 32, apply_translation);
1936         debug_write_dword(spacenum, address + 4, data >> 0, apply_translation);
19371937      }
19381938   }
19391939   /* otherwise, this proceeds like the byte case */
r814r815
19431943      memory_set_debugger_access(1);
19441944
19451945      /* translate if necessary; if not mapped, we're done */
1946      if (info->translate && !(*info->translate)(spacenum, &address))
1946      if (apply_translation && info->translate && !(*info->translate)(spacenum, &address))
19471947         ;
19481948
19491949      /* if there is a custom write handler, and it returns TRUE, use that */
r814r815
20992099   offset = ADDR2BYTE(offset, info, space);
21002100   switch (size)
21012101   {
2102      case 1:      return debug_read_byte(space, offset);
2103      case 2:      return debug_read_word(space, offset);
2104      case 4:      return debug_read_dword(space, offset);
2105      case 8:      return debug_read_qword(space, offset);
2102      case 1:      return debug_read_byte(space, offset, TRUE);
2103      case 2:      return debug_read_word(space, offset, TRUE);
2104      case 4:      return debug_read_dword(space, offset, TRUE);
2105      case 8:      return debug_read_qword(space, offset, TRUE);
21062106   }
21072107   return ~0;
21082108}
r814r815
21232123   offset = ADDR2BYTE(offset, info, space);
21242124   switch (size)
21252125   {
2126      case 1:      debug_write_byte(space, offset, value); break;
2127      case 2:      debug_write_word(space, offset, value); break;
2128      case 4:      debug_write_dword(space, offset, value); break;
2129      case 8:      debug_write_qword(space, offset, value); break;
2126      case 1:      debug_write_byte(space, offset, value, TRUE); break;
2127      case 2:      debug_write_word(space, offset, value, TRUE); break;
2128      case 4:      debug_write_dword(space, offset, value, TRUE); break;
2129      case 8:      debug_write_qword(space, offset, value, TRUE); break;
21302130   }
21312131}
21322132
src/emu/debug/debugvw.c
r814r815
145145   UINT8         ascii_view;               /* display ASCII characters? */
146146   UINT8         live_tracking;            /* track the value of the live expression? */
147147   UINT8         byte_offset;            /* byte offset within each row */
148   UINT8         no_translation;            /* don't run addresses through the cpu translation hook */
148149   UINT64         last_result;            /* last result from the expression */
149150   parsed_expression *expression;            /* expression to compute */
150151   char *         expression_string;         /* copy of the expression string */
r814r815
22882289    memory_read_byte - generic byte reader
22892290-------------------------------------------------*/
22902291
2291static UINT8 memory_read_byte(debug_view_memory *memdata, offs_t offs)
2292static UINT8 memory_read_byte(debug_view_memory *memdata, offs_t offs, int apply_translation)
22922293{
22932294   /* if no raw data, just use the standard debug routines */
22942295   if (!memdata->raw_base)
2295      return debug_read_byte(memdata->spacenum, offs);
2296      return debug_read_byte(memdata->spacenum, offs, apply_translation);
22962297
22972298   /* all 0xff if out of bounds */
22982299   offs ^= memdata->raw_offset_xor;
r814r815
23062307    memory_read_word - generic word reader
23072308-------------------------------------------------*/
23082309
2309static UINT16 memory_read_word(debug_view_memory *memdata, offs_t offs)
2310static UINT16 memory_read_word(debug_view_memory *memdata, offs_t offs, int apply_translation)
23102311{
23112312   /* if no raw data, just use the standard debug routines */
23122313   if (!memdata->raw_base)
2313      return debug_read_word(memdata->spacenum, offs);
2314      return debug_read_word(memdata->spacenum, offs, apply_translation);
23142315
23152316   /* otherwise, decompose into bytes */
23162317   if (memdata->raw_little_endian)
2317      return memory_read_byte(memdata, offs + 0) | (memory_read_byte(memdata, offs + 1) << 8);
2318      return memory_read_byte(memdata, offs + 0, apply_translation) | (memory_read_byte(memdata, offs + 1, apply_translation) << 8);
23182319   else
2319      return memory_read_byte(memdata, offs + 1) | (memory_read_byte(memdata, offs + 0) << 8);
2320      return memory_read_byte(memdata, offs + 1, apply_translation) | (memory_read_byte(memdata, offs + 0, apply_translation) << 8);
23202321}
23212322
23222323
r814r815
23242325    memory_read_dword - generic dword reader
23252326-------------------------------------------------*/
23262327
2327static UINT32 memory_read_dword(debug_view_memory *memdata, offs_t offs)
2328static UINT32 memory_read_dword(debug_view_memory *memdata, offs_t offs, int apply_translation)
23282329{
23292330   /* if no raw data, just use the standard debug routines */
23302331   if (!memdata->raw_base)
2331      return debug_read_dword(memdata->spacenum, offs);
2332      return debug_read_dword(memdata->spacenum, offs, apply_translation);
23322333
23332334   /* otherwise, decompose into words */
23342335   if (memdata->raw_little_endian)
2335      return memory_read_word(memdata, offs + 0) | (memory_read_word(memdata, offs + 2) << 16);
2336      return memory_read_word(memdata, offs + 0, apply_translation) | (memory_read_word(memdata, offs + 2, apply_translation) << 16);
23362337   else
2337      return memory_read_word(memdata, offs + 2) | (memory_read_word(memdata, offs + 0) << 16);
2338      return memory_read_word(memdata, offs + 2, apply_translation) | (memory_read_word(memdata, offs + 0, apply_translation) << 16);
23382339}
23392340
23402341
r814r815
23422343    memory_read_qword - generic qword reader
23432344-------------------------------------------------*/
23442345
2345static UINT64 memory_read_qword(debug_view_memory *memdata, offs_t offs)
2346static UINT64 memory_read_qword(debug_view_memory *memdata, offs_t offs, int apply_translation)
23462347{
23472348   /* if no raw data, just use the standard debug routines */
23482349   if (!memdata->raw_base)
2349      return debug_read_qword(memdata->spacenum, offs);
2350      return debug_read_qword(memdata->spacenum, offs, apply_translation);
23502351
23512352   /* otherwise, decompose into dwords */
23522353   if (memdata->raw_little_endian)
2353      return memory_read_word(memdata, offs + 0) | ((UINT64)memory_read_word(memdata, offs + 4) << 32);
2354      return memory_read_word(memdata, offs + 0, apply_translation) | ((UINT64)memory_read_word(memdata, offs + 4, apply_translation) << 32);
23542355   else
2355      return memory_read_word(memdata, offs + 4) | ((UINT64)memory_read_word(memdata, offs + 0) << 32);
2356      return memory_read_word(memdata, offs + 4, apply_translation) | ((UINT64)memory_read_word(memdata, offs + 0, apply_translation) << 32);
23562357}
23572358
23582359
r814r815
23602361    memory_write_byte - generic byte writer
23612362-------------------------------------------------*/
23622363
2363static void memory_write_byte(debug_view_memory *memdata, offs_t offs, UINT8 data)
2364static void memory_write_byte(debug_view_memory *memdata, offs_t offs, UINT8 data, int apply_translation)
23642365{
23652366   /* if no raw data, just use the standard debug routines */
23662367   if (!memdata->raw_base)
23672368   {
2368      debug_write_byte(memdata->spacenum, offs, data);
2369      debug_write_byte(memdata->spacenum, offs, data, apply_translation);
23692370      return;
23702371   }
23712372
r814r815
23902391    memory_write_word - generic word writer
23912392-------------------------------------------------*/
23922393
2393static void memory_write_word(debug_view_memory *memdata, offs_t offs, UINT16 data)
2394static void memory_write_word(debug_view_memory *memdata, offs_t offs, UINT16 data, int apply_translation)
23942395{
23952396   /* if no raw data, just use the standard debug routines */
23962397   if (!memdata->raw_base)
23972398   {
2398      debug_write_word(memdata->spacenum, offs, data);
2399      debug_write_word(memdata->spacenum, offs, data, apply_translation);
23992400      return;
24002401   }
24012402
24022403   /* otherwise, decompose into bytes */
24032404   if (memdata->raw_little_endian)
24042405   {
2405      memory_write_byte(memdata, offs + 0, data);
2406      memory_write_byte(memdata, offs + 1, data >> 8);
2406      memory_write_byte(memdata, offs + 0, data, apply_translation);
2407      memory_write_byte(memdata, offs + 1, data >> 8, apply_translation);
24072408   }
24082409   else
24092410   {
2410      memory_write_byte(memdata, offs + 1, data);
2411      memory_write_byte(memdata, offs + 0, data >> 8);
2411      memory_write_byte(memdata, offs + 1, data, apply_translation);
2412      memory_write_byte(memdata, offs + 0, data >> 8, apply_translation);
24122413   }
24132414}
24142415
r814r815
24172418    memory_write_dword - generic dword writer
24182419-------------------------------------------------*/
24192420
2420static void memory_write_dword(debug_view_memory *memdata, offs_t offs, UINT32 data)
2421static void memory_write_dword(debug_view_memory *memdata, offs_t offs, UINT32 data, int apply_translation)
24212422{
24222423   /* if no raw data, just use the standard debug routines */
24232424   if (!memdata->raw_base)
24242425   {
2425      debug_write_dword(memdata->spacenum, offs, data);
2426      debug_write_dword(memdata->spacenum, offs, data, apply_translation);
24262427      return;
24272428   }
24282429
24292430   /* otherwise, decompose into words */
24302431   if (memdata->raw_little_endian)
24312432   {
2432      memory_write_word(memdata, offs + 0, data);
2433      memory_write_word(memdata, offs + 2, data >> 16);
2433      memory_write_word(memdata, offs + 0, data, apply_translation);
2434      memory_write_word(memdata, offs + 2, data >> 16, apply_translation);
24342435   }
24352436   else
24362437   {
2437      memory_write_word(memdata, offs + 2, data);
2438      memory_write_word(memdata, offs + 0, data >> 16);
2438      memory_write_word(memdata, offs + 2, data, apply_translation);
2439      memory_write_word(memdata, offs + 0, data >> 16, apply_translation);
24392440   }
24402441}
24412442
r814r815
24442445    memory_write_qword - generic qword writer
24452446-------------------------------------------------*/
24462447
2447static void memory_write_qword(debug_view_memory *memdata, offs_t offs, UINT64 data)
2448static void memory_write_qword(debug_view_memory *memdata, offs_t offs, UINT64 data, int apply_translation)
24482449{
24492450   /* if no raw data, just use the standard debug routines */
24502451   if (!memdata->raw_base)
24512452   {
2452      debug_write_qword(memdata->spacenum, offs, data);
2453      debug_write_qword(memdata->spacenum, offs, data, apply_translation);
24532454      return;
24542455   }
24552456
24562457   /* otherwise, decompose into dwords */
24572458   if (memdata->raw_little_endian)
24582459   {
2459      memory_write_dword(memdata, offs + 0, data);
2460      memory_write_dword(memdata, offs + 4, data >> 32);
2460      memory_write_dword(memdata, offs + 0, data, apply_translation);
2461      memory_write_dword(memdata, offs + 4, data >> 32, apply_translation);
24612462   }
24622463   else
24632464   {
2464      memory_write_dword(memdata, offs + 4, data);
2465      memory_write_dword(memdata, offs + 0, data >> 32);
2465      memory_write_dword(memdata, offs + 4, data, apply_translation);
2466      memory_write_dword(memdata, offs + 0, data >> 32, apply_translation);
24662467   }
24672468}
24682469
r814r815
25612562      default:
25622563      case 1:
25632564         if (hexchar)
2564            memory_write_byte(memdata, address, (memory_read_byte(memdata, address) & ~(0xf << shift)) | ((hexchar - hexvals) << shift));
2565            memory_write_byte(memdata, address, (memory_read_byte(memdata, address, !memdata->no_translation) & ~(0xf << shift)) | ((hexchar - hexvals) << shift), !memdata->no_translation);
25652566         if (hexchar || chval == DCH_RIGHT)
25662567         {
25672568            if (shift == 0) { shift = 4; if (address != maxaddr) address++; }
r814r815
25762577
25772578      case 2:
25782579         if (hexchar)
2579            memory_write_word(memdata, address, (memory_read_word(memdata, address) & ~(0xf << shift)) | ((hexchar - hexvals) << shift));
2580            memory_write_word(memdata, address, (memory_read_word(memdata, address, !memdata->no_translation) & ~(0xf << shift)) | ((hexchar - hexvals) << shift), !memdata->no_translation);
25802581         if (hexchar || chval == DCH_RIGHT)
25812582         {
25822583            if (shift == 0) { shift = 12; if (address != maxaddr) address += 2; }
r814r815
25912592
25922593      case 4:
25932594         if (hexchar)
2594            memory_write_dword(memdata, address, (memory_read_dword(memdata, address) & ~(0xf << shift)) | ((hexchar - hexvals) << shift));
2595            memory_write_dword(memdata, address, (memory_read_dword(memdata, address, !memdata->no_translation) & ~(0xf << shift)) | ((hexchar - hexvals) << shift), !memdata->no_translation);
25952596         if (hexchar || chval == DCH_RIGHT)
25962597         {
25972598            if (shift == 0) { shift = 28; if (address != maxaddr) address += 4; }
r814r815
27492750                     offs_t curaddr = addrbyte + i;
27502751                     if (curaddr > maxaddr)
27512752                        len += sprintf(&data[len], "   ");
2752                     else if (memdata->raw_base == NULL || !cpuinfo->translate || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2753                        len += sprintf(&data[len], "%02X ", memory_read_byte(memdata, addrbyte + i));
2753                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2754                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2755                        len += sprintf(&data[len], "%02X ", memory_read_byte(memdata, addrbyte + i, !memdata->no_translation));
27542756                     else
27552757                        len += sprintf(&data[len], "** ");
27562758                  }
r814r815
27622764                     offs_t curaddr = addrbyte + 2 * i;
27632765                     if (curaddr > maxaddr)
27642766                        len += sprintf(&data[len], "      ");
2765                     else if (memdata->raw_base == NULL || !cpuinfo->translate || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2766                        len += sprintf(&data[len], " %04X ", memory_read_word(memdata, addrbyte + 2 * i));
2767                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2768                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2769                        len += sprintf(&data[len], " %04X ", memory_read_word(memdata, addrbyte + 2 * i, !memdata->no_translation));
27672770                     else
27682771                        len += sprintf(&data[len], " **** ");
27692772                  }
r814r815
27752778                     offs_t curaddr = addrbyte + 4 * i;
27762779                     if (curaddr > maxaddr)
27772780                        len += sprintf(&data[len], "            ");
2778                     else if (memdata->raw_base == NULL || !cpuinfo->translate || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2779                        len += sprintf(&data[len], "  %08X  ", memory_read_dword(memdata, addrbyte + 4 * i));
2781                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2782                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2783                        len += sprintf(&data[len], "  %08X  ", memory_read_dword(memdata, addrbyte + 4 * i, !memdata->no_translation));
27802784                     else
27812785                        len += sprintf(&data[len], "  ********  ");
27822786                  }
r814r815
27892793               {
27902794                  if (addrbyte + i <= maxaddr)
27912795                  {
2792                     char c = memory_read_byte(memdata, addrbyte + i);
2796                     char c = memory_read_byte(memdata, addrbyte + i, !memdata->no_translation);
27932797                     len += sprintf(&data[len], "%c", isprint(c) ? c : '.');
27942798                  }
27952799                  else
r814r815
28072811               {
28082812                  if (addrbyte + i <= maxaddr)
28092813                  {
2810                     char c = memory_read_byte(memdata, addrbyte + i);
2814                     char c = memory_read_byte(memdata, addrbyte + i, !memdata->no_translation);
28112815                     len += sprintf(&data[len], "%c", isprint(c) ? c : '.');
28122816                  }
28132817                  else
r814r815
28252829                     offs_t curaddr = addrbyte + i;
28262830                     if (curaddr > maxaddr)
28272831                        len += sprintf(&data[len], "   ");
2828                     else if (memdata->raw_base == NULL || !cpuinfo->translate || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2829                        len += sprintf(&data[len], "%02X ", memory_read_byte(memdata, addrbyte + i));
2832                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2833                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2834                        len += sprintf(&data[len], "%02X ", memory_read_byte(memdata, addrbyte + i, !memdata->no_translation));
28302835                     else
28312836                        len += sprintf(&data[len], "** ");
28322837                  }
r814r815
28382843                     offs_t curaddr = addrbyte + 2 * i;
28392844                     if (curaddr > maxaddr)
28402845                        len += sprintf(&data[len], "      ");
2841                     else if (memdata->raw_base == NULL || !cpuinfo->translate || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2842                        len += sprintf(&data[len], " %04X ", memory_read_word(memdata, addrbyte + 2 * i));
2846                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2847                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2848                        len += sprintf(&data[len], " %04X ", memory_read_word(memdata, addrbyte + 2 * i, !memdata->no_translation));
28432849                     else
28442850                        len += sprintf(&data[len], " **** ");
28452851                  }
r814r815
28512857                     offs_t curaddr = addrbyte + 4 * i;
28522858                     if (curaddr > maxaddr)
28532859                        len += sprintf(&data[len], "            ");
2854                     else if (memdata->raw_base == NULL || !cpuinfo->translate || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2855                        len += sprintf(&data[len], "  %08X  ", memory_read_dword(memdata, addrbyte + 4 * i));
2860                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2861                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2862                        len += sprintf(&data[len], "  %08X  ", memory_read_dword(memdata, addrbyte + 4 * i, !memdata->no_translation));
28562863                     else
28572864                        len += sprintf(&data[len], "  ********  ");
28582865                  }
r814r815
29112918         value->i = memdata->live_tracking;
29122919         break;
29132920
2921      case DVP_MEM_NO_TRANSLATION:
2922         value->i = memdata->no_translation;
2923         break;
2924
29142925      case DVP_MEM_CPUNUM:
29152926         value->i = memdata->cpunum;
29162927         break;
r814r815
29842995         debug_view_end_update(view);
29852996         break;
29862997
2998      case DVP_MEM_NO_TRANSLATION:
2999         if (value.i != memdata->no_translation)
3000         {
3001            debug_view_begin_update(view);
3002            memdata->no_translation = value.i;
3003            view->update_pending = TRUE;
3004            debug_view_end_update(view);
3005         }
3006         break;
3007
29873008      case DVP_MEM_TRACK_LIVE:
29883009         if (value.i != memdata->live_tracking)
29893010         {
src/emu/debug/debugcpu.h
r814r815
218218int               debug_hotspot_track(int cpunum, int numspots, int threshhold);
219219
220220/* memory accessors */
221UINT8            debug_read_byte(int spacenum, offs_t address);
222UINT16            debug_read_word(int spacenum, offs_t address);
223UINT32            debug_read_dword(int spacenum, offs_t address);
224UINT64            debug_read_qword(int spacenum, offs_t address);
225void            debug_write_byte(int spacenum, offs_t address, UINT8 data);
226void            debug_write_word(int spacenum, offs_t address, UINT16 data);
227void            debug_write_dword(int spacenum, offs_t address, UINT32 data);
228void            debug_write_qword(int spacenum, offs_t address, UINT64 data);
221UINT8            debug_read_byte(int spacenum, offs_t address, int apply_translation);
222UINT16            debug_read_word(int spacenum, offs_t address, int apply_translation);
223UINT32            debug_read_dword(int spacenum, offs_t address, int apply_translation);
224UINT64            debug_read_qword(int spacenum, offs_t address, int apply_translation);
225void            debug_write_byte(int spacenum, offs_t address, UINT8 data, int apply_translation);
226void            debug_write_word(int spacenum, offs_t address, UINT16 data, int apply_translation);
227void            debug_write_dword(int spacenum, offs_t address, UINT32 data, int apply_translation);
228void            debug_write_qword(int spacenum, offs_t address, UINT64 data, int apply_translation);
229229UINT64            debug_read_opcode(UINT32 offset, int size, int arg);
230230
231231#endif
src/emu/debug/debugvw.h
r814r815
7171#define DVP_MEM_RAW_OFFSET_XOR            (109)   /* r/w - UINT32 */
7272#define DVP_MEM_RAW_LITTLE_ENDIAN         (110)   /* r/w - UINT32 */
7373#define DVP_MEM_WIDTH                  (111)   /* r/w - UINT32 */
74#define DVP_MEM_NO_TRANSLATION            (113)   /* r/w - UINT32 */
7475
7576/* properties available for textbuffer views */
7677#define DVP_TEXTBUF_LINE_LOCK            (100)   /* r/w - UINT32 */
src/emu/debug/debugcmd.c
r814r815
14101410   cpuintrf_push_context(cpunum);
14111411   for (i = offset; i <= endoffset; i++)
14121412   {
1413      UINT8 byte = debug_read_byte(spacenum, i);
1413      UINT8 byte = debug_read_byte(spacenum, i, TRUE);
14141414      fwrite(&byte, 1, 1, f);
14151415   }
14161416   cpuintrf_pop_context();
r814r815
14931493                  offs_t curaddr = i + j;
14941494                  if (!info->translate || (*info->translate)(spacenum, &curaddr))
14951495                  {
1496                     UINT8 byte = debug_read_byte(ref, i + j);
1496                     UINT8 byte = debug_read_byte(ref, i + j, TRUE);
14971497                     outdex += sprintf(&output[outdex], " %02X", byte);
14981498                  }
14991499                  else
r814r815
15121512                  offs_t curaddr = i + j;
15131513                  if (!info->translate || (*info->translate)(spacenum, &curaddr))
15141514                  {
1515                     UINT16 word = debug_read_word(ref, i + j);
1515                     UINT16 word = debug_read_word(ref, i + j, TRUE);
15161516                     outdex += sprintf(&output[outdex], " %04X", word);
15171517                  }
15181518                  else
r814r815
15311531                  offs_t curaddr = i + j;
15321532                  if (!info->translate || (*info->translate)(spacenum, &curaddr))
15331533                  {
1534                     UINT32 dword = debug_read_dword(ref, i + j);
1534                     UINT32 dword = debug_read_dword(ref, i + j, TRUE);
15351535                     outdex += sprintf(&output[outdex], " %08X", dword);
15361536                  }
15371537                  else
r814r815
15501550                  offs_t curaddr = i + j;
15511551                  if (!info->translate || (*info->translate)(spacenum, &curaddr))
15521552                  {
1553                     UINT64 qword = debug_read_qword(ref, i + j);
1553                     UINT64 qword = debug_read_qword(ref, i + j, TRUE);
15541554                     outdex += sprintf(&output[outdex], " %08X%08X", (UINT32)(qword >> 32), (UINT32)qword);
15551555                  }
15561556                  else
r814r815
15711571            offs_t curaddr = i + j;
15721572            if (!info->translate || (*info->translate)(spacenum, &curaddr))
15731573            {
1574               UINT8 byte = debug_read_byte(ref, i + j);
1574               UINT8 byte = debug_read_byte(ref, i + j, TRUE);
15751575               outdex += sprintf(&output[outdex], "%c", (byte >= 32 && byte < 128) ? byte : '.');
15761576            }
15771577            else
r814r815
16721672      {
16731673         switch (data_size[j])
16741674         {
1675            case 1:   match = ((UINT8)debug_read_byte(spacenum, i + suboffset) == (UINT8)data_to_find[j]);   break;
1676            case 2:   match = ((UINT16)debug_read_word(spacenum, i + suboffset) == (UINT16)data_to_find[j]);   break;
1677            case 4:   match = ((UINT32)debug_read_dword(spacenum, i + suboffset) == (UINT32)data_to_find[j]);   break;
1678            case 8:   match = ((UINT64)debug_read_qword(spacenum, i + suboffset) == (UINT64)data_to_find[j]);   break;
1675         case 1:   match = ((UINT8)debug_read_byte(spacenum, i + suboffset, TRUE) == (UINT8)data_to_find[j]);   break;
1676         case 2:   match = ((UINT16)debug_read_word(spacenum, i + suboffset, TRUE) == (UINT16)data_to_find[j]);   break;
1677         case 4:   match = ((UINT32)debug_read_dword(spacenum, i + suboffset, TRUE) == (UINT32)data_to_find[j]);   break;
1678         case 8:   match = ((UINT64)debug_read_qword(spacenum, i + suboffset, TRUE) == (UINT64)data_to_find[j]);   break;
16791679            default:   /* all other cases are wildcards */      break;
16801680         }
16811681         suboffset += data_size[j] & 0x0f;
src/emu/cpu/cop400/cop420ds.c
r814r815
6060   }
6161   else if (op >= 0x60 && op <= 0x63)
6262   {
63      addr = ((op & 0x02) << 8) | oprom[1];
63      addr = ((op & 0x03) << 8) | oprom[1];
6464      sprintf(buffer,"JMP %x",addr);
6565      cnt = 2;
6666   }
6767   else if (op >= 0x68 && op <= 0x6B)
6868   {
69      addr = ((op & 0x02) << 8) | oprom[1];
69      addr = ((op & 0x03) << 8) | oprom[1];
7070      sprintf(buffer,"JSR %x",addr);
7171      flags = DASMFLAG_STEP_OVER;
7272      cnt = 2;
r814r815
205205         {
206206            sprintf(buffer,"LBI 0,%u",op2 & 0xF);
207207         }
208         else if (op2 >= 0x91 && op2 <= 0x8)
208         else if (op2 >= 0x91 && op2 <= 0x98)
209209         {
210210            sprintf(buffer,"LBI 1,%u",op2 & 0xF);
211211         }
src/emu/cpu/cop400/410ops.c
r814r815
55 **************************************************************************/
66
77#define ROM(A)         cpu_readop(A)
8#define RAM(A)         R.RAM[A]
8#define RAM_W(A,V)      (data_write_byte_8(A,V))
9#define RAM_R(A)      (data_read_byte_8(A))
910
1011#define IN(A)         io_read_byte_8(A)
1112#define OUT(A,V)      io_write_byte_8(A,V)
r814r815
2425#define prevPC         R.PREVPC
2526#define skip         R.skip
2627#define skipLBI         R.skipLBI
27#define M            RAM(B)
2828
29#define READ_M         RAM_R(B)
30#define WRITE_M(VAL)   RAM_W(B,VAL)
31
2932#define IN_G()         IN(COP400_PORT_G)
3033#define IN_L()         IN(COP400_PORT_L)
3134#define OUT_G(A)      OUT(COP400_PORT_G, (A) & R.G_mask)
r814r815
7477   OUT_G(G);
7578}
7679
77INLINE void add(void) { A = (A + RAM(B)) & 0x0F; }
80INLINE void add(void) { A = (A + RAM_R(B)) & 0x0F; }
7881
7982INLINE void asc(void)
8083{
81   A = A + C + RAM(B);
84   A = A + C + RAM_R(B);
8285
8386   if (A > 0xF)
8487   {
r814r815
121124
122125INLINE void cab(void) { B = (B & 0x30) | A; }
123126
124INLINE void camq(void) { WRITE_Q((A << 4) | M); }
127INLINE void camq(void) { WRITE_Q((A << 4) | READ_M); }
125128
126129INLINE void cba(void) { A = B & 0xF; }
127130
r814r815
134137INLINE void inl(void)
135138{
136139   UINT8 L = IN_L();
137   RAM(B) = L >> 4;
140   RAM_W(B, L >> 4);
138141   A = L & 0xF;
139142}
140143
141144INLINE void jid(void)
142145{
143   UINT16 addr = (PC & 0x300) | (A << 4) | M;
146   UINT16 addr = (PC & 0x300) | (A << 4) | READ_M;
144147   PC = (PC & 0x300) | ROM(addr);
145148}
146149
r814r815
189192
190193INLINE void LD(UINT8 r)
191194{
192   A = RAM(B);
195   A = RAM_R(B);
193196   B = B ^ (r << 4);
194197}
195198
r814r815
299302INLINE void lqid(void)
300303{
301304   PUSH(PC + 1);
302   PC = (UINT16)((PC & 0x300) | (A << 4) | M);
305   PC = (UINT16)((PC & 0x300) | (A << 4) | READ_M);
303306   WRITE_Q(ROM(PC));
304307   POP();
305308}
r814r815
308311
309312INLINE void obd(void) { OUT_D(B); }
310313
311INLINE void omg(void) { WRITE_G(RAM(B)); }
314INLINE void omg(void) { WRITE_G(RAM_R(B)); }
312315
313316INLINE void rc(void) { C = 0; }
314317
r814r815
316319
317320INLINE void retsk(void) { POP(); skip = 1; }
318321
319INLINE void rmb0(void) { RAM(B) = RAM(B) & 0xE; }
320INLINE void rmb1(void) { RAM(B) = RAM(B) & 0xD; }
321INLINE void rmb2(void) { RAM(B) = RAM(B) & 0xB; }
322INLINE void rmb3(void) { RAM(B) = RAM(B) & 0x7; }
322INLINE void rmb0(void) { RAM_W(B, RAM_R(B) & 0xE); }
323INLINE void rmb1(void) { RAM_W(B, RAM_R(B) & 0xD); }
324INLINE void rmb2(void) { RAM_W(B, RAM_R(B) & 0xB); }
325INLINE void rmb3(void) { RAM_W(B, RAM_R(B) & 0x7); }
323326
324327INLINE void sc(void) { C = 1; }
325328
326329INLINE void skc(void) { if (C == 1) skip = 1; }
327330
328INLINE void ske(void) { if (A == RAM(B)) skip = 1; }
331INLINE void ske(void) { if (A == RAM_R(B)) skip = 1; }
329332
330INLINE void skmbz0(void) { if ((RAM(B) & 0x01) == 0 ) skip = 1; }
331INLINE void skmbz1(void) { if ((RAM(B) & 0x02) == 0 ) skip = 1; }
332INLINE void skmbz2(void) { if ((RAM(B) & 0x04) == 0 ) skip = 1; }
333INLINE void skmbz3(void) { if ((RAM(B) & 0x08) == 0 ) skip = 1; }
333INLINE void skmbz0(void) { if ((RAM_R(B) & 0x01) == 0 ) skip = 1; }
334INLINE void skmbz1(void) { if ((RAM_R(B) & 0x02) == 0 ) skip = 1; }
335INLINE void skmbz2(void) { if ((RAM_R(B) & 0x04) == 0 ) skip = 1; }
336INLINE void skmbz3(void) { if ((RAM_R(B) & 0x08) == 0 ) skip = 1; }
334337
335338INLINE void skgbz0(void) { if ((IN_G() & 0x01) == 0) skip = 1; }
336339INLINE void skgbz1(void) { if ((IN_G() & 0x02) == 0) skip = 1; }
r814r815
339342
340343INLINE void skgz(void) { if (IN_G() == 0) skip = 1; }
341344
342INLINE void smb0(void) { RAM(B) = RAM(B) | 0x1; }
343INLINE void smb1(void) { RAM(B) = RAM(B) | 0x2; }
344INLINE void smb2(void) { RAM(B) = RAM(B) | 0x4; }
345INLINE void smb3(void) { RAM(B) = RAM(B) | 0x8; }
345INLINE void smb0(void) { RAM_W(B, RAM_R(B) | 0x1); }
346INLINE void smb1(void) { RAM_W(B, RAM_R(B) | 0x2); }
347INLINE void smb2(void) { RAM_W(B, RAM_R(B) | 0x4); }
348INLINE void smb3(void) { RAM_W(B, RAM_R(B) | 0x8); }
346349
347350INLINE void STII(UINT8 y)
348351{
349352   UINT16 Bd;
350353
351   RAM(B) = y;
354   RAM_W(B, y);
352355   Bd = (B & 0x0f) + 1;
353356   if (Bd > 15) Bd = 0;
354357   B = (B & 0x30) + Bd;
r814r815
376379
377380INLINE void X(UINT8 r)
378381{
379   UINT8 t = RAM(B);
380   RAM(B) = A;
382   UINT8 t = RAM_R(B);
383   RAM_W(B, A);
381384   A = t;
382385   B = B ^ (r << 4);
383386}
r814r815
391394{
392395   UINT8 addr = ROM(PC++) & 0x3f;
393396   UINT8 t = A;
394   A = RAM(addr);
395   RAM(addr) = t;
397   A = RAM_R(addr);
398   RAM_W(addr, t);
396399}
397400
398401INLINE void xas(void)
r814r815
408411{
409412   UINT8 t, Bd, Br;
410413
411   t = RAM(B);
412   RAM(B) = A;
414   t = RAM_R(B);
415   RAM_W(B, A);
413416   A = t;
414417
415418   Br = (UINT8)((B & 0x30) ^ (r << 4));
r814r815
423426{
424427   UINT8 t, Bd, Br;
425428
426   t = RAM(B);
427   RAM(B) = A;
429   t = RAM_R(B);
430   RAM_W(B, A);
428431   A = t;
429432
430433   Br = (UINT8)((B & 0x30) ^ (r << 4));
r814r815
444447INLINE void xds2(void) { XDS(2); }
445448INLINE void xds3(void) { XDS(3); }
446449
447INLINE void xor(void) { A = RAM(B) ^ A; }
450INLINE void xor(void) { A = RAM_R(B) ^ A; }
src/emu/cpu/cop400/cop410.c
r814r815
4141   UINT4   SIO;
4242   UINT1   SKL;
4343   UINT8   skip, skipLBI;
44   UINT4   RAM[64];
4544   UINT8   G_mask;
4645   UINT8   D_mask;
4746} COP410_Regs;
r814r815
131130   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jid      }
132131};
133132
133static ADDRESS_MAP_START( cop410_RAM, ADDRESS_SPACE_DATA, 8 )
134   AM_RANGE(0x00, 0x40) AM_RAM
135ADDRESS_MAP_END
136
134137/****************************************************************************
135138 * Initialize emulation
136139 ****************************************************************************/
r814r815
166169   state_save_register_item("cop410", index, SKL);
167170   state_save_register_item("cop410", index, skip);
168171   state_save_register_item("cop410", index, skipLBI);
169   state_save_register_item_array("cop410", index, R.RAM);
170172   state_save_register_item("cop410", index, R.G_mask);
171173   state_save_register_item("cop410", index, R.D_mask);
172174}
r814r815
311313      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 9;               break;
312314      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0;               break;
313315      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 8;               break;
314      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:    info->i = 6;               break;
316      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:    info->i = 8;   /* Really 6 */   break;
315317      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:    info->i = 0;               break;
316318      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;               break;
317319      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 9;               break;
r814r815
346348      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = cop410_dasm;      break;
347349#endif /* MAME_DEBUG */
348350      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cop410_ICount;         break;
351       case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
352          info->internal_map = construct_map_cop410_RAM;                              break;
349353
350354      /* --- the following bits of info are returned as NULL-terminated strings --- */
351355      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP410");            break;
src/emu/cpu/cop400/420ops.c
r814r815
1717
1818INLINE void casc(void)
1919{
20   A = (A ^ 0xF) + RAM(B) + C;
20   A = (A ^ 0xF) + RAM_R(B) + C;
2121
2222   if (A > 0xF)
2323   {
r814r815
3333
3434INLINE void cqma(void)
3535{
36   M = Q >> 4;
36   WRITE_M(Q >> 4);
3737   A = Q & 0xF;
3838}
3939
r814r815
5454
5555INLINE void ldd(void)
5656{
57   A = RAM(ROM(PC++) & 0x3f);
57   A = RAM_R(ROM(PC++) & 0x3f);
5858}
5959
6060INLINE void ogi0(void) { WRITE_G(0); }
src/emu/cpu/cop400/cop420.c
r814r815
4545   UINT8   skip, skipLBI;
4646   UINT1   timerlatch;
4747   UINT16   counter;
48   UINT4   RAM[64];
4948   UINT8   G_mask;
5049   UINT8   D_mask;
5150} COP420_Regs;
r814r815
136135   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jid      }
137136};
138137
138static ADDRESS_MAP_START( cop420_RAM, ADDRESS_SPACE_DATA, 8 )
139   AM_RANGE(0x00, 0x40) AM_RAM
140ADDRESS_MAP_END
141
139142/****************************************************************************
140143 * Initialize emulation
141144 ****************************************************************************/
r814r815
182185   state_save_register_item("cop420", index, skipLBI);
183186   state_save_register_item("cop420", index, R.timerlatch);
184187   state_save_register_item("cop420", index, R.counter);
185   state_save_register_item_array("cop420", index, R.RAM);
186188   state_save_register_item("cop420", index, R.G_mask);
187189   state_save_register_item("cop420", index, R.D_mask);
188190}
r814r815
329331      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 10;               break;
330332      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0;               break;
331333      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 8;               break;
332      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:    info->i = 6;               break;
334      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:    info->i = 8;   /* Really 6 */   break;
333335      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:    info->i = 0;               break;
334336      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;               break;
335337      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 9;               break;
r814r815
365367      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = cop420_dasm;      break;
366368#endif /* MAME_DEBUG */
367369      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cop420_ICount;         break;
370       case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
371          info->internal_map = construct_map_cop420_RAM;                              break;
368372
369373      /* --- the following bits of info are returned as NULL-terminated strings --- */
370374      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP420");            break;
src/emu/cpu/cop400/cop410ds.c
r814r815
6060   }
6161   else if (op >= 0x60 && op <= 0x61)
6262   {
63      addr = ((op & 0x02) << 8) | oprom[1];
63      addr = ((op & 0x01) << 8) | oprom[1];
6464      sprintf(buffer,"JMP %x",addr);
6565      cnt = 2;
6666   }
6767   else if (op >= 0x68 && op <= 0x69)
6868   {
69      addr = ((op & 0x02) << 8) | oprom[1];
69      addr = ((op & 0x01) << 8) | oprom[1];
7070      sprintf(buffer,"JSR %x",addr);
7171      flags = DASMFLAG_STEP_OVER;
7272      cnt = 2;
src/emu/cpu/arm7/arm7core.c
r814r815
12381238{
12391239    UINT32 op2, sc=0, rd, rn, opcode;
12401240    UINT32 by, rdn;
1241    UINT32 oldR15 = R15;
12411242
12421243    opcode = (insn & INSN_OPCODE) >> INSN_OPCODE_SHIFT;
12431244
r814r815
12881289        }
12891290    }
12901291
1291   change_pc(R15);
1292
12931292    /* Perform the operation */
12941293
12951294    switch (opcode)
r814r815
14001399        }
14011400    }
14021401
1402    if (oldR15 != R15)
14031403   change_pc(R15);
14041404}
14051405
r814r815
15161516{
15171517    UINT32 rb = (insn & INSN_RN) >> INSN_RN_SHIFT;
15181518    UINT32 rbp = GET_REGISTER(rb);
1519    UINT32 oldR15 = R15;
15191520    int result;
15201521
15211522#if ARM7_DEBUG_CORE
r814r815
16911692        ARM7_ICOUNT -= ((result+1)+2+1);
16921693    }
16931694
1695    if (oldR15 != R15)
16941696   change_pc(R15);
16951697} /* HandleMemBlock */
16961698
src/emu/cpu/arm7/arm7exec.c
r814r815
5959      pc = R15;
6060
6161      insn = cpu_readop16(pc & (~1));
62      ARM7_ICOUNT += (3 - thumbCycles[insn >> 8]);
62      ARM7_ICOUNT -= (3 - thumbCycles[insn >> 8]);
6363      switch( ( insn & THUMB_INSN_TYPE ) >> THUMB_INSN_TYPE_SHIFT )
6464      {
6565         case 0x0: /* Logical shifting */
r814r815
395395                        rd = ( insn & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
396396                        op2=(GET_CPSR & C_MASK) ? 1 : 0;
397397                        rn=GET_REGISTER(rd) + GET_REGISTER(rs) + op2;
398                        HandleThumbALUAddFlags( rn, GET_REGISTER(rd), GET_REGISTER(rs)+op2 ); //?
398                        HandleThumbALUAddFlags( rn, GET_REGISTER(rd), ( GET_REGISTER(rs) ) ); //?
399399                        SET_REGISTER( rd, rn);
400400                        break;
401401                     case 0x6: /* SBC Rd, Rs */
r814r815
403403                        rd = ( insn & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
404404                        op2=(GET_CPSR & C_MASK) ? 0 : 1;
405405                        rn=GET_REGISTER(rd) - GET_REGISTER(rs) - op2;
406                        HandleThumbALUAddFlags( rn, GET_REGISTER(rd), GET_REGISTER(rs)+op2 ); //?
406                        HandleThumbALUSubFlags( rn, GET_REGISTER(rd), ( GET_REGISTER(rs) ) ); //?
407407                        SET_REGISTER( rd, rn);
408408                        break;
409409                     case 0x7: /* ROR Rd, Rs */
r814r815
434434                     case 0x9: /* NEG Rd, Rs - todo: check me */
435435                        rs = ( insn & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT;
436436                        rd = ( insn & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
437                        rn = 0 - GET_REGISTER(rs);
437                                rrs = GET_REGISTER(rs);
438                        rn = 0 - rrs;
438439                        SET_REGISTER( rd, rn );
439                        HandleThumbALUSubFlags( GET_REGISTER(rd), 0, rn );
440                        HandleThumbALUSubFlags( GET_REGISTER(rd), 0, rrs );
440441                        break;
441442                     case 0xa: /* CMP Rd, Rs */
442443                        rs = ( insn & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT;
r814r815
540541                              rs = GET_REGISTER( ( ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT ) );
541542                              rd = GET_REGISTER( insn & THUMB_HIREG_RD );
542543                              rn = rd - rs;
543                              HandleThumbALUSubFlags( rn, rs, rd );
544                              HandleThumbALUSubFlags( rn, rd, rs );
544545                              break;
545546                           case 0x1: /* CMP Rd, Hs */
546547                              rs = GET_REGISTER( ( ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT ) + 8 );
547548                              rd = GET_REGISTER( insn & THUMB_HIREG_RD );
548549                              rn = rd - rs;
549                              HandleThumbALUSubFlags( rn, rs, rd );
550                              HandleThumbALUSubFlags( rn, rd, rs );
550551                              break;
551552                           case 0x2: /* CMP Hd, Rs */
552553                              rs = GET_REGISTER( ( ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT ) );
553554                              rd = GET_REGISTER( (insn & THUMB_HIREG_RD) + 8 );
554555                              rn = rd - rs;
555                              HandleThumbALUSubFlags( rn, rs, rd );
556                              HandleThumbALUSubFlags( rn, rd, rs );
556557                              break;
557558                           case 0x3: /* CMP Hd, Hs */
558559                              rs = GET_REGISTER( ( ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT ) + 8 );
559560                              rd = GET_REGISTER( (insn & THUMB_HIREG_RD) + 8 );
560561                              rn = rd - rs;
561                              HandleThumbALUSubFlags( rn, rs, rd );
562                              HandleThumbALUSubFlags( rn, rd, rs );
562563                              break;
563564                           default:
564565                              fatalerror("%08x: G4-1 Undefined Thumb instruction: %04x %x\n", pc, insn, ( insn & THUMB_HIREG_H ) >> THUMB_HIREG_H_SHIFT);
r814r815
590591                              {
591592                                 R15 += 2;
592593                              }
593
594                                   if( rd == 7 )
594                              else
595595                                                       {
596596                                                              R15 &= ~1;
597597                                 change_pc(R15);
r814r815
600600                           case 0x3:   // MOV Hd, Hs
601601                              rs = ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT;
602602                              rd = insn & THUMB_HIREG_RD;
603                              if (rs == 7)
604                              {
605                                 SET_REGISTER( rd + 8, GET_REGISTER(rs+8)+4 );
606                              }
607                              else
608                              {
603609                              SET_REGISTER( rd + 8, GET_REGISTER(rs+8) );
610                              }
604611                              if( rd != 7 )
605612                              {
606613                                 R15 += 2;
607614                              }
615
608616                                   if( rd == 7 )
609617                                                       {
610618                                                              R15 &= ~1;
src/emu/cpu/m6800/m6800.c
r814r815
20022002               | (m6800.port2_data & m6800.port2_ddr);
20032003      case 0x04:
20042004         return m6800.port3_ddr;
2005      case 0x05:
2005      case 0x05:
20062006         return m6800.port4_ddr;
20072007      case 0x06:
20082008         return (io_read_byte_8(M6803_PORT3) & (m6800.port3_ddr ^ 0xff))
src/emu/uigfx.c
r814r815
862862   render_target_get_bounds(render_get_ui_target(), &targwidth, &targheight, NULL);
863863
864864   /* get the size of the tilemap itself */
865   tilemap_nb_size(state->tilemap.which, &mapwidth, &mapheight);
865   tilemap_size_by_index(state->tilemap.which, &mapwidth, &mapheight);
866866   if (state->tilemap.rotate & ORIENTATION_SWAP_XY)
867867      { UINT32 temp = mapwidth; mapwidth = mapheight; mapheight = temp; }
868868
r814r815
972972      state->tilemap.which = tilemap_count() - 1;
973973
974974   /* cache some info in locals */
975   tilemap_nb_size(state->tilemap.which, &mapwidth, &mapheight);
975   tilemap_size_by_index(state->tilemap.which, &mapwidth, &mapheight);
976976
977977   /* handle zoom (minus,plus) */
978978   if (input_ui_pressed(IPT_UI_ZOOM_OUT))
r814r815
10751075   /* handle the redraw */
10761076   if (state->bitmap_dirty)
10771077   {
1078      tilemap_nb_draw(state->bitmap, state->tilemap.which, state->tilemap.xoffs, state->tilemap.yoffs);
1078      tilemap_draw_by_index(state->bitmap, state->tilemap.which, state->tilemap.xoffs, state->tilemap.yoffs);
10791079
10801080      /* reset the texture to force an update */
10811081      render_texture_set_bitmap(state->texture, state->bitmap, NULL, 0, screen_texformat);
src/emu/tilemap.c
r814r815
99
1010***************************************************************************/
1111
12/*
13    When the videoram for a tile changes, call tilemap_mark_tile_dirty
14    with the appropriate memory offset.
12#include "driver.h"
13#include "osinline.h"
14#include "tilemap.h"
15#include "profiler.h"
1516
16    In the video driver, follow these steps:
1717
18    1)  Set each tilemap's scroll registers.
18/***************************************************************************
19    CONSTANTS
20***************************************************************************/
1921
20    2)  Call tilemap_draw to draw the tilemaps to the screen, from back to front.
22/* internal usage to mark tiles dirty */
23#define TILE_FLAG_DIRTY               0xff
2124
22    Notes:
23    -   You can currently configure a tilemap as xscroll + scrolling columns or
24        yscroll + scrolling rows, but not both types of scrolling simultaneously.
25*/
25/* invalid logical index */
26#define INVALID_LOGICAL_INDEX         ((tilemap_logical_index)~0)
2627
27#if !defined(DECLARE) && !defined(TRANSP)
2828
29#include "driver.h"
30#include "osinline.h"
31#include "tilemap.h"
32#include "profiler.h"
3329
34#define SWAP(X,Y) { UINT32 temp=X; X=Y; Y=temp; }
35#define MAX_TILESIZE 64
30/***************************************************************************
31    TYPE DEFINITIONS
32***************************************************************************/
3633
37#define TILE_FLAG_DIRTY   (0x80)
34/* logical index */
35typedef UINT32 tilemap_logical_index;
3836
39typedef enum { eWHOLLY_TRANSPARENT, eWHOLLY_OPAQUE, eMASKED } trans_t;
4037
41typedef void (*tilemap_draw_func)( tilemap *tmap, int xpos, int ypos, int mask, int value );
38/* internal set of transparency states for rendering */
39typedef enum
40{
41   WHOLLY_TRANSPARENT,
42   WHOLLY_OPAQUE,
43   MASKED
44} trans_t;
4245
46
47/* internal blitting callbacks */
48typedef void (*blitmask_t)(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
49typedef void (*blitopaque_t)(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
50
51
52/* blitting parameters for rendering */
53typedef struct _blit_parameters blit_parameters;
54struct _blit_parameters
55{
56   mame_bitmap *      bitmap;
57   rectangle         cliprect;
58   blitmask_t          draw_masked;
59   blitopaque_t       draw_opaque;
60   UINT32             tilemap_priority_code;
61   UINT8            mask;
62   UINT8            value;
63};
64
65
66/* core tilemap structure */
4367struct _tilemap
4468{
45   UINT32 (*get_memory_offset)( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
46   int *memory_offset_to_cached_indx;
47   UINT32 *cached_indx_to_memory_offset;
48   int logical_flip_to_cached_flip[4];
69   tilemap *               next;            /* pointer to next tilemap */
4970
71   /* basic tilemap metrics */
72   tilemap_type             type;            /* type of tilemap */
73   UINT32                  rows;            /* number of tile rows */
74   UINT32                  cols;            /* number of tile columns */
75   UINT32                  tilewidth;         /* width of a single tile in pixels */
76   UINT32                  tileheight;         /* height of a single tile in pixels */
77   UINT32                  width;            /* width of the full tilemap in pixels */
78   UINT32                  height;            /* height of the full tilemap in pixels */
79
80   /* logical <-> memory mappings */
81   tilemap_mapper_callback      mapper;            /* callback to map a row/column to a memory index */
82   tilemap_logical_index *      memory_to_logical;   /* map from memory index to logical index */
83   tilemap_logical_index      max_logical_index;   /* maximum valid logical index */
84   tilemap_memory_index *      logical_to_memory;   /* map from logical index to memory index */
85   tilemap_memory_index      max_memory_index;   /* maximum valid memory index */
86
5087   /* callback to interpret video RAM for the tilemap */
51   tile_get_info_fn tile_get_info;
52   void *user_data;
88   tile_get_info_callback      tile_get_info;      /* callback to get information about a tile */
89   tile_data               tileinfo;         /* structure to hold the data for a tile */
90   void *                  user_data;         /* user data value passed to the callback */
5391
54   UINT32 max_memory_offset;
55   UINT32 num_tiles;
56   UINT32 num_pens;
92   /* global tilemap states */
93   UINT8                  enable;            /* true if we are enabled */
94   UINT8                  attributes;         /* global attributes (flipx/y) */
95   UINT8                  all_tiles_dirty;   /* true if all tiles are dirty */
96   UINT8                  all_tiles_clean;   /* true if all tiles are clean */
97   UINT32                  palette_offset;      /* palette offset */
5798
58   UINT32 num_logical_rows, num_logical_cols;
59   UINT32 num_cached_rows, num_cached_cols;
99   /* scroll information */
100   UINT32                  scrollrows;         /* number of independently scrolled rows */
101   UINT32                  scrollcols;         /* number of independently scrolled colums */
102   INT32 *                  rowscroll;         /* array of rowscroll values */
103   INT32 *                  colscroll;         /* array of colscroll values */
104   INT32                   dx;               /* global horizontal scroll offset */
105   INT32                  dx_flipped;         /* global horizontal scroll offset when flipped */
106   INT32                   dy;               /* global vertical scroll offset */
107   INT32                  dy_flipped;         /* global vertical scroll offset when flipped */
60108
61   UINT32 logical_tile_width, logical_tile_height;
62   UINT32 cached_tile_width, cached_tile_height;
109   /* pixel data */
110   mame_bitmap *            pixmap;            /* cached pixel data */
63111
64   UINT32 cached_width, cached_height;
112   /* transparency mapping */
113   mame_bitmap *            flagsmap;         /* per-pixel flags */
114   UINT8 *                  tileflags;         /* per-tile flags */
115   UINT8 *                  pen_to_flags;       /* mapping of pens to flags */
116   UINT32                  max_pen_to_flags;   /* maximum index in each array */
117};
65118
66   INT32 dx, dx_if_flipped;
67   INT32 dy, dy_if_flipped;
68   INT32 scrollx_delta, scrolly_delta;
69119
70   INT32 enable;
71   INT32 attributes;
72120
73   tilemap_type type;
74   INT32 transparent_pen;
75   UINT32 fgmask[4], bgmask[4]; /* for TILEMAP_TYPE_SPLIT */
121/***************************************************************************
122    GLOBAL VARIABLES
123***************************************************************************/
76124
77   UINT32 *pPenToPixel[4];
125mame_bitmap *         priority_bitmap;
78126
79   UINT8 (*draw_tile)( tilemap *tmap, UINT32 col, UINT32 row, UINT32 flags );
127static tilemap *      tilemap_list;
128static tilemap **      tilemap_tailptr;
129static int            tilemap_instance;
80130
81   INT32 cached_scroll_rows, cached_scroll_cols;
82   INT32 *cached_rowscroll, *cached_colscroll;
131static UINT32         screen_width, screen_height;
83132
84   INT32 logical_scroll_rows, logical_scroll_cols;
85   INT32 *logical_rowscroll, *logical_colscroll;
86133
87   INT32 orientation;
88   INT32 palette_offset;
89134
90   UINT16 tile_depth, tile_granularity;
91   UINT8 all_tiles_dirty;
92   UINT8 all_tiles_clean;
135/***************************************************************************
136    FUNCTION PROTOTYPES
137***************************************************************************/
93138
94   /* cached color data */
95   mame_bitmap *pixmap;
96   UINT32 pixmap_pitch_line;
97   UINT32 pixmap_pitch_row;
139/* system management helpers */
140static void tilemap_exit(running_machine *machine);
141static void tilemap_postload(void *param);
142static void tilemap_dispose(tilemap *tmap);
98143
99   mame_bitmap *transparency_bitmap;
100   UINT32 transparency_bitmap_pitch_line;
101   UINT32 transparency_bitmap_pitch_row;
102   UINT8 *transparency_data, **transparency_data_row;
144/* logical <-> memory index mapping */
145static void mappings_create(tilemap *tmap);
146static void mappings_update(tilemap *tmap);
103147
104   struct _tilemap *next; /* resource tracking */
105};
148/* tile rendering */
149static void pixmap_update(tilemap *tmap, const rectangle *cliprect);
150static void tile_update(tilemap *tmap, tilemap_logical_index logindex, UINT32 cached_col, UINT32 cached_row);
151static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags);
152static UINT8 tile_draw_colortable(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags);
153static UINT8 tile_draw_colortrans(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags);
154static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags);
106155
107mame_bitmap *      priority_bitmap;
108UINT32               priority_bitmap_pitch_line;
109UINT32               priority_bitmap_pitch_row;
156/* drawing helpers */
157static void configure_blit_parameters(blit_parameters *blit, tilemap *tmap, mame_bitmap *dest, const rectangle *cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask);
158static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, int xpos, int ypos);
159static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
160      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound);
110161
111static tilemap *   first_tilemap; /* resource tracking */
112static UINT32         screen_width, screen_height;
113static tile_data            tile_info;
162/* scanline rasterizers for drawing to the pixmap */
163static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
164static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
165static void scanline_draw_opaque_ind16(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
166static void scanline_draw_masked_ind16(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
167static void scanline_draw_opaque_rgb16(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
168static void scanline_draw_masked_rgb16(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
169static void scanline_draw_opaque_rgb16_alpha(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
170static void scanline_draw_masked_rgb16_alpha(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
171static void scanline_draw_opaque_rgb32(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
172static void scanline_draw_masked_rgb32(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
173static void scanline_draw_opaque_rgb32_alpha(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
174static void scanline_draw_masked_rgb32_alpha(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
114175
115typedef void (*blitmask_t)( void *dest, const void *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode );
116typedef void (*blitopaque_t)( void *dest, const void *source, int count, UINT8 *pri, UINT32 pcode );
117176
118/* the following parameters are constant across tilemap_draw calls */
119static struct
177
178/***************************************************************************
179    INLINE FUNCTIONS
180***************************************************************************/
181
182/*-------------------------------------------------
183    effective_rowscroll - return the effective
184    rowscroll value for a given index, taking into
185    account tilemap flip states
186-------------------------------------------------*/
187
188INLINE INT32 effective_rowscroll(tilemap *tmap, int index)
120189{
121   blitmask_t draw_masked;
122   blitopaque_t draw_opaque;
123   int clip_left, clip_top, clip_right, clip_bottom;
124   UINT32 tilemap_priority_code;
125   mame_bitmap *   screen_bitmap;
126   UINT32            screen_bitmap_pitch_line;
127   UINT32            screen_bitmap_pitch_row;
128} blit;
190   INT32 value;
129191
130/***********************************************************************************/
192   /* if we're flipping vertically, adjust the row number */
193   if (tmap->attributes & TILEMAP_FLIPY)
194      index = tmap->scrollrows - 1 - index;
131195
132static void tilemap_exit( running_machine *machine );
133static void tilemap_dispose( tilemap *tmap );
134static void PenToPixel_Init( tilemap *tmap );
135static void PenToPixel_Term( tilemap *tmap );
136static void mappings_create( tilemap *tmap );
137static void mappings_dispose( tilemap *tmap );
138static void mappings_update( tilemap *tmap );
139static void recalculate_scroll( tilemap *tmap );
196   /* adjust final result based on the horizontal flip and dx values */
197   if (!(tmap->attributes & TILEMAP_FLIPX))
198      value = tmap->dx - tmap->rowscroll[index];
199   else
200      value = screen_width - tmap->width - tmap->dx_flipped + tmap->rowscroll[index];
140201
141static void install_draw_handlers( tilemap *tmap );
202   /* clamp to 0..width */
203   if (value < 0)
204      value = tmap->width - (-value) % tmap->width;
205   else
206      value %= tmap->width;
207   return value;
208}
142209
143static void update_tile_info( tilemap *tmap, UINT32 cached_indx, UINT32 cached_col, UINT32 cached_row );
144210
145/***********************************************************************************/
211/*-------------------------------------------------
212    effective_colscroll - return the effective
213    colscroll value for a given index, taking into
214    account tilemap flip states
215-------------------------------------------------*/
146216
147static void PenToPixel_Init( tilemap *tmap )
217INLINE INT32 effective_colscroll(tilemap *tmap, int index)
148218{
149   /*
150        Construct a table for all tile orientations in advance.
151        This simplifies drawing tiles and masks tremendously.
152        If performance is an issue, we can always (re)introduce
153        customized code for each case and forgo tables.
154    */
155   int i,x,y,tx,ty;
156   UINT32 *pPenToPixel;
219   INT32 value;
157220
158   for( i=0; i<4; i++ )
159   {
160      pPenToPixel = malloc_or_die( tmap->num_pens*sizeof(UINT32) );
221   /* if we're flipping horizontally, adjust the column number */
222   if (tmap->attributes & TILEMAP_FLIPX)
223      index = tmap->scrollcols - 1 - index;
161224
162      tmap->pPenToPixel[i] = pPenToPixel;
163      for( ty=0; ty<tmap->cached_tile_height; ty++ )
164      {
165         for( tx=0; tx<tmap->cached_tile_width; tx++ )
166         {
167            x = tx;
168            y = ty;
169            if( i&TILE_FLIPX ) x = tmap->cached_tile_width-1-x;
170            if( i&TILE_FLIPY ) y = tmap->cached_tile_height-1-y;
171            *pPenToPixel++ = x+y*MAX_TILESIZE;
172         }
173      }
174   }
175}
225   /* adjust final result based on the vertical flip and dx values */
226   if (!(tmap->attributes & TILEMAP_FLIPY))
227      value = tmap->dy - tmap->colscroll[index];
228   else
229      value = screen_height - tmap->height - tmap->dy_flipped + tmap->colscroll[index];
176230
177static void PenToPixel_Term( tilemap *tmap )
178{
179   int i;
180   for( i=0; i<4; i++ )
181   {
182      free( tmap->pPenToPixel[i] );
183   }
231   /* clamp to 0..height */
232   if (value < 0)
233      value = tmap->height - (-value) % tmap->height;
234   else
235      value %= tmap->height;
236   return value;
184237}
185238
186void tilemap_set_transparent_pen( tilemap *tmap, int pen )
187{
188   tmap->transparent_pen = pen;
189}
190239
191void tilemap_set_transmask( tilemap *tmap, int which, UINT32 fgmask, UINT32 bgmask )
240/*-------------------------------------------------
241    indexed_tilemap - return a tilemap by index
242-------------------------------------------------*/
243
244INLINE tilemap *indexed_tilemap(int index)
192245{
193   if( tmap->fgmask[which] != fgmask || tmap->bgmask[which] != bgmask )
194   {
195      tmap->fgmask[which] = fgmask;
196      tmap->bgmask[which] = bgmask;
197      tilemap_mark_all_tiles_dirty( tmap );
198   }
246   tilemap *tmap;
247
248   /* find by the tilemap index */
249   for (tmap = tilemap_list; tmap != NULL; tmap = tmap->next)
250      if (index-- == 0)
251         return tmap;
252
253   return NULL;
199254}
200255
201void tilemap_set_depth( tilemap *tmap, int tile_depth, int tile_granularity )
256
257
258/***************************************************************************
259    SYSTEM-WIDE MANAGEMENT
260***************************************************************************/
261
262/*-------------------------------------------------
263    tilemap_init - initialize the tilemap system
264-------------------------------------------------*/
265
266void tilemap_init(running_machine *machine)
202267{
203   tmap->tile_depth = tile_depth;
204   tmap->tile_granularity = tile_granularity;
268   screen_width   = Machine->screen[0].width;
269   screen_height   = Machine->screen[0].height;
270
271   tilemap_list    = NULL;
272   tilemap_tailptr  = &tilemap_list;
273   tilemap_instance = 0;
274
275   priority_bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
276   add_exit_callback(machine, tilemap_exit);
205277}
206278
207/***********************************************************************************/
208/* some common mappings */
209279
210UINT32 tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
280
281/***************************************************************************
282    TILEMAP CREATION AND CONFIGURATION
283***************************************************************************/
284
285/*-------------------------------------------------
286    tilemap_create - allocate a new tilemap
287-------------------------------------------------*/
288
289tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_callback mapper, tilemap_type type, int tilewidth, int tileheight, int cols, int rows)
211290{
212   /* logical (col,row) -> memory offset */
213   return row*num_cols + col;
291   tilemap *tmap;
292   int group;
293
294   /* allocate the tilemap itself */
295   tmap = malloc_or_die(sizeof(tilemap));
296   memset(tmap, 0, sizeof(tilemap));
297
298   /* fill in the basic metrics */
299   tmap->type = type;
300   tmap->rows = rows;
301   tmap->cols = cols;
302   tmap->tilewidth = tilewidth;
303   tmap->tileheight = tileheight;
304   tmap->width = cols * tilewidth;
305   tmap->height = rows * tileheight;
306
307   /* set up the logical <-> memory mappings */
308   tmap->mapper = mapper;
309   mappings_create(tmap);
310
311   /* set up the tile map callbacks */
312   tmap->tile_get_info = tile_get_info;
313
314   /* initialize global states */
315   tmap->enable = TRUE;
316   tmap->all_tiles_dirty = TRUE;
317
318   /* initialize scroll information */
319   tmap->scrollrows = 1;
320   tmap->scrollcols = 1;
321   tmap->rowscroll = malloc_or_die(tmap->height * sizeof(*tmap->rowscroll));
322   memset(tmap->rowscroll, 0, tmap->height * sizeof(*tmap->rowscroll));
323   tmap->colscroll = malloc_or_die(tmap->width * sizeof(*tmap->colscroll));
324   memset(tmap->colscroll, 0, tmap->width * sizeof(*tmap->colscroll));
325
326   /* allocate the pixel data cache */
327   tmap->pixmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED16);
328
329   /* allocate transparency mapping data */
330   tmap->tileflags = malloc_or_die(tmap->max_logical_index);
331   tmap->flagsmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED8);
332   tmap->max_pen_to_flags = (tmap->type != TILEMAP_TYPE_COLORTABLE) ? 256 : Machine->drv->color_table_len;
333   tmap->pen_to_flags = malloc_or_die(sizeof(tmap->pen_to_flags[0]) * tmap->max_pen_to_flags * TILEMAP_NUM_GROUPS);
334   for (group = 0; group < TILEMAP_NUM_GROUPS; group++)
335      tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0);
336
337   /* add us to the end of the list of tilemaps */
338   *tilemap_tailptr = tmap;
339   tilemap_tailptr = &tmap->next;
340
341   /* save relevant state */
342   state_save_register_item("tilemap", tilemap_instance, tmap->enable);
343   state_save_register_item("tilemap", tilemap_instance, tmap->attributes);
344   state_save_register_item("tilemap", tilemap_instance, tmap->palette_offset);
345   state_save_register_item("tilemap", tilemap_instance, tmap->scrollrows);
346   state_save_register_item("tilemap", tilemap_instance, tmap->scrollcols);
347   state_save_register_item_pointer("tilemap", tilemap_instance, tmap->rowscroll, rows * tileheight);
348   state_save_register_item_pointer("tilemap", tilemap_instance, tmap->colscroll, cols * tilewidth);
349   state_save_register_item("tilemap", tilemap_instance, tmap->dx);
350   state_save_register_item("tilemap", tilemap_instance, tmap->dx_flipped);
351   state_save_register_item("tilemap", tilemap_instance, tmap->dy);
352   state_save_register_item("tilemap", tilemap_instance, tmap->dy_flipped);
353   tilemap_instance++;
354
355   /* reset everything after a load */
356   state_save_register_func_postload_ptr(tilemap_postload, tmap);
357   return tmap;
214358}
215UINT32 tilemap_scan_rows_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
216{
217   /* logical (col,row) -> memory offset */
218   return row*num_cols + (num_cols-col-1);
219}
220UINT32 tilemap_scan_rows_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
221{
222   /* logical (col,row) -> memory offset */
223   return (num_rows-row-1)*num_cols + col;
224}
225UINT32 tilemap_scan_rows_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
226{
227   /* logical (col,row) -> memory offset */
228   return (num_rows-row-1)*num_cols + (num_cols-col-1);
229}
230359
231UINT32 tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
360
361/*-------------------------------------------------
362    tilemap_set_user_data - specify a parameter
363    to be passed into the tile_get_info callback
364-------------------------------------------------*/
365
366void tilemap_set_user_data(tilemap *tmap, void *user_data)
232367{
233   /* logical (col,row) -> memory offset */
234   return col*num_rows + row;
368   tmap->user_data = user_data;
235369}
236UINT32 tilemap_scan_cols_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
237{
238   /* logical (col,row) -> memory offset */
239   return (num_cols-col-1)*num_rows + row;
240}
241UINT32 tilemap_scan_cols_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
242{
243   /* logical (col,row) -> memory offset */
244   return col*num_rows + (num_rows-row-1);
245}
246UINT32 tilemap_scan_cols_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
247{
248   /* logical (col,row) -> memory offset */
249   return (num_cols-col-1)*num_rows + (num_rows-row-1);
250}
251370
252/***********************************************************************************/
253371
254static void mappings_create( tilemap *tmap )
372/*-------------------------------------------------
373    tilemap_set_palette_offset - specify an offset
374    to be added to each pixel before looking up
375    the palette
376-------------------------------------------------*/
377
378void tilemap_set_palette_offset(tilemap *tmap, UINT32 offset)
255379{
256   int max_memory_offset = 0;
257   UINT32 col,row;
258   UINT32 num_logical_rows = tmap->num_logical_rows;
259   UINT32 num_logical_cols = tmap->num_logical_cols;
260   /* count offsets (might be larger than num_tiles) */
261   for( row=0; row<num_logical_rows; row++ )
380   if (tmap->palette_offset != offset)
262381   {
263      for( col=0; col<num_logical_cols; col++ )
264      {
265         UINT32 memory_offset = tmap->get_memory_offset( col, row, num_logical_cols, num_logical_rows );
266         if( memory_offset>max_memory_offset ) max_memory_offset = memory_offset;
267      }
382      tmap->palette_offset = offset;
383      tilemap_mark_all_tiles_dirty(tmap);
268384   }
269   max_memory_offset++;
270   tmap->max_memory_offset = max_memory_offset;
271   /* logical to cached (tmap_mark_dirty) */
272   tmap->memory_offset_to_cached_indx = malloc_or_die( sizeof(int)*max_memory_offset );
273   /* cached to logical (get_tile_info) */
274   tmap->cached_indx_to_memory_offset = malloc_or_die( sizeof(UINT32)*tmap->num_tiles );
275385}
276386
277static void mappings_dispose( tilemap *tmap )
387
388/*-------------------------------------------------
389    tilemap_set_enable - set an enable flag for
390    the tilemap; if 0, requests to draw the
391    tilemap are ignored
392-------------------------------------------------*/
393
394void tilemap_set_enable(tilemap *tmap, int enable)
278395{
279   free( tmap->cached_indx_to_memory_offset );
280   free( tmap->memory_offset_to_cached_indx );
396   tmap->enable = (enable != 0);
281397}
282398
283static void mappings_update( tilemap *tmap )
399
400/*-------------------------------------------------
401    tilemap_set_flip - set a global flip for the
402    tilemap; ALL_TILEMAPS can be passed here as
403    well
404-------------------------------------------------*/
405
406void tilemap_set_flip(tilemap *tmap, UINT32 attributes)
284407{
285   int logical_flip;
286   UINT32 logical_indx, cached_indx;
287   UINT32 num_cached_rows = tmap->num_cached_rows;
288   UINT32 num_cached_cols = tmap->num_cached_cols;
289   UINT32 num_logical_rows = tmap->num_logical_rows;
290   UINT32 num_logical_cols = tmap->num_logical_cols;
291   for( logical_indx=0; logical_indx<tmap->max_memory_offset; logical_indx++ )
408   /* handle ALL_TILEMAPS */
409   if (tmap == ALL_TILEMAPS)
292410   {
293      tmap->memory_offset_to_cached_indx[logical_indx] = -1;
411      for (tmap = tilemap_list; tmap != NULL; tmap = tmap->next)
412         tilemap_set_flip(tmap, attributes);
294413   }
295414
296   for( logical_indx=0; logical_indx<tmap->num_tiles; logical_indx++ )
415   /* if we're changing things, force a refresh of the mappings and mark it all dirty */
416   else if (tmap->attributes != attributes)
297417   {
298      UINT32 logical_col = logical_indx%num_logical_cols;
299      UINT32 logical_row = logical_indx/num_logical_cols;
300      int memory_offset = tmap->get_memory_offset( logical_col, logical_row, num_logical_cols, num_logical_rows );
301      UINT32 cached_col = logical_col;
302      UINT32 cached_row = logical_row;
303      if( tmap->orientation & ORIENTATION_FLIP_X ) cached_col = (num_cached_cols-1)-cached_col;
304      if( tmap->orientation & ORIENTATION_FLIP_Y ) cached_row = (num_cached_rows-1)-cached_row;
305      cached_indx = cached_row*num_cached_cols+cached_col;
306      tmap->memory_offset_to_cached_indx[memory_offset] = cached_indx;
307      tmap->cached_indx_to_memory_offset[cached_indx] = memory_offset;
418      tmap->attributes = attributes;
419      mappings_update(tmap);
308420   }
309   for( logical_flip = 0; logical_flip<4; logical_flip++ )
310   {
311      int cached_flip = logical_flip;
312      if( tmap->attributes&TILEMAP_FLIPX ) cached_flip ^= TILE_FLIPX;
313      if( tmap->attributes&TILEMAP_FLIPY ) cached_flip ^= TILE_FLIPY;
314      tmap->logical_flip_to_cached_flip[logical_flip] = cached_flip;
315   }
316421}
317422
318/***********************************************************************************/
319423
320static void pio( void *dest, const void *source, int count, UINT8 *pri, UINT32 pcode )
321{
322   int i;
323424
324   if (pcode)
325      for( i=0; i<count; i++ )
326      {
327         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
328      }
329}
425/***************************************************************************
426    DIRTY TILE MARKING
427***************************************************************************/
330428
331static void pit( void *dest, const void *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
429/*-------------------------------------------------
430    tilemap_mark_tile_dirty - mark a single tile
431    dirty based on its memory index
432-------------------------------------------------*/
433
434void tilemap_mark_tile_dirty(tilemap *tmap, tilemap_memory_index memindex)
332435{
333   int i;
436   /* only mark if within range */
437   if (memindex < tmap->max_memory_index)
438   {
439      tilemap_logical_index logindex = tmap->memory_to_logical[memindex];
334440
335   if (pcode)
336      for( i=0; i<count; i++ )
441      /* there may be no logical index for a given memory index */
442      if (logindex != INVALID_LOGICAL_INDEX)
337443      {
338         if( (pMask[i]&mask)==value )
339         {
340            pri[i] = (pri[i] & (pcode >> 8)) | pcode;
341         }
444         tmap->tileflags[logindex] = TILE_FLAG_DIRTY;
445         tmap->all_tiles_clean = FALSE;
342446      }
447   }
343448}
344449
345/***********************************************************************************/
346450
347#ifndef pdo16
348static void pdo16( UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
451/*-------------------------------------------------
452    tilemap_mark_all_tiles_dirty - mark all the
453    tiles in a tilemap dirty
454-------------------------------------------------*/
455
456void tilemap_mark_all_tiles_dirty(tilemap *tmap)
349457{
350   int i;
351   memcpy( dest,source,count*sizeof(UINT16) );
352   for( i=0; i<count; i++ )
458   /* handle ALL_TILEMAPS */
459   if (tmap == ALL_TILEMAPS)
353460   {
354      pri[i] = (pri[i] & (pcode >> 8)) | pcode;
461      for (tmap = tilemap_list; tmap != NULL; tmap = tmap->next)
462         tilemap_mark_all_tiles_dirty(tmap);
355463   }
356}
357#endif
358464
359#ifndef pdo16pal
360static void pdo16pal( UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
361{
362   int pal = pcode >> 16;
363   int i;
364   for( i=0; i<count; i++ )
465   /* mark all tiles dirty and clear the clean flag */
466   else
365467   {
366      dest[i] = source[i] + pal;
367      pri[i] = (pri[i] & (pcode >> 8)) | pcode;
468      tmap->all_tiles_dirty = TRUE;
469      tmap->all_tiles_clean = FALSE;
368470   }
369471}
370#endif
371472
372static void pdo16palnp( UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
473
474
475/***************************************************************************
476    PEN-TO-LAYER MAPPING
477***************************************************************************/
478
479/*-------------------------------------------------
480    tilemap_map_pens_to_layer - specify the
481    mapping of one or more pens (where
482    (<pen> & mask) == pen) to a layer
483-------------------------------------------------*/
484
485void tilemap_map_pens_to_layer(tilemap *tmap, int group, pen_t pen, pen_t mask, UINT8 layermask)
373486{
374   int pal = pcode >> 16;
375   int i;
376   for( i=0; i<count; i++ )
377   {
378      dest[i] = source[i] + pal;
379   }
487   UINT8 *array = tmap->pen_to_flags + group * tmap->max_pen_to_flags;
488   pen_t start, stop, cur;
489   UINT8 changed = FALSE;
490
491   assert(group < TILEMAP_NUM_GROUPS);
492   assert((layermask & TILEMAP_PIXEL_CATEGORY_MASK) == 0);
493
494   /* we start at the index where (pen & mask) == pen, and all other bits are 0 */
495   start = pen & mask;
496
497   /* we stop at the index where (pen & mask) == pen, and all other bits are 1 */
498   stop = start | ~mask;
499
500   /* clamp to the number of entries actually there */
501   stop = MIN(stop, tmap->max_pen_to_flags - 1);
502
503   /* iterate and set */
504   for (cur = start; cur <= stop; cur++)
505      if ((cur & mask) == pen && array[cur] != layermask)
506      {
507         changed = TRUE;
508         array[cur] = layermask;
509      }
510
511   /* everything gets dirty if anything changed */
512   if (changed)
513      tilemap_mark_all_tiles_dirty(tmap);
380514}
381515
382#ifndef pdo16np
383static void pdo16np( UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
516
517/*-------------------------------------------------
518    tilemap_set_transparent_pen - set a single
519    transparent pen into the tilemap, mapping
520    all other pens to layer 0
521-------------------------------------------------*/
522
523void tilemap_set_transparent_pen(tilemap *tmap, pen_t pen)
384524{
385   memcpy( dest,source,count*sizeof(UINT16) );
525   /* reset the whole pen map to opaque */
526   tilemap_map_pens_to_layer(tmap, 0, 0, 0, TILEMAP_PIXEL_LAYER0);
527
528   /* set the single pen to transparent */
529    tilemap_map_pen_to_layer(tmap, 0, pen, TILEMAP_PIXEL_TRANSPARENT);
386530}
387#endif
388531
389static void pdo15( UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
532
533/*-------------------------------------------------
534    tilemap_set_transmask - set up the first 32
535    pens using a foreground mask (mapping to
536    layer 0) and a background mask (mapping to
537    layer 1)
538-------------------------------------------------*/
539
540void tilemap_set_transmask(tilemap *tmap, int group, UINT32 fgmask, UINT32 bgmask)
390541{
391   int i;
392   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
393   for( i=0; i<count; i++ )
542   pen_t pen;
543
544   /* iterate over all 32 pens specified */
545   for (pen = 0; pen < 32; pen++)
394546   {
395      dest[i] = clut[source[i]];
396      pri[i] = (pri[i] & (pcode >> 8)) | pcode;
547      UINT8 fgbits = ((fgmask >> pen) & 1) ? TILEMAP_PIXEL_TRANSPARENT : TILEMAP_PIXEL_LAYER0;
548      UINT8 bgbits = ((bgmask >> pen) & 1) ? TILEMAP_PIXEL_TRANSPARENT : TILEMAP_PIXEL_LAYER1;
549      tilemap_map_pen_to_layer(tmap, group, pen, fgbits | bgbits);
397550   }
398551}
399552
400static void pdo15np( UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
553
554
555/***************************************************************************
556    TILEMAP SCROLLING
557***************************************************************************/
558
559/*-------------------------------------------------
560    tilemap_set_scroll_rows - specify the number of
561    independently scrollable row units; each unit
562    covers height/scroll_rows pixels
563-------------------------------------------------*/
564
565void tilemap_set_scroll_rows(tilemap *tmap, UINT32 scroll_rows)
401566{
402   int i;
403   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
404   for( i=0; i<count; i++ )
405   {
406      dest[i] = clut[source[i]];
407   }
567   assert(scroll_rows <= tmap->height);
568   tmap->scrollrows = scroll_rows;
408569}
409570
410#ifndef pdo32
411static void pdo32( UINT32 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
571
572/*-------------------------------------------------
573    tilemap_set_scroll_cols - specify the number of
574    independently scrollable column units; each
575    unit covers width/scroll_cols pixels
576-------------------------------------------------*/
577
578void tilemap_set_scroll_cols(tilemap *tmap, UINT32 scroll_cols)
412579{
413   int i;
414   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
415   for( i=0; i<count; i++ )
416   {
417      dest[i] = clut[source[i]];
418      pri[i] = (pri[i] & (pcode >> 8)) | pcode;
419   }
580   assert(scroll_cols <= tmap->width);
581   tmap->scrollcols = scroll_cols;
420582}
421#endif
422583
423static void pdo32np( UINT32 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
584
585/*-------------------------------------------------
586    tilemap_set_scrolldx - specify global
587    horizontal scroll offset, for non-flipped and
588    flipped cases
589-------------------------------------------------*/
590
591void tilemap_set_scrolldx(tilemap *tmap, int dx, int dx_flipped)
424592{
425   int i;
426   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
427   for( i=0; i<count; i++ )
428   {
429      dest[i] = clut[source[i]];
430   }
593   tmap->dx = dx;
594   tmap->dx_flipped = dx_flipped;
431595}
432596
433#ifndef npdo32
434static void npdo32( UINT32 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
597
598/*-------------------------------------------------
599    tilemap_set_scrolldy - specify global
600    vertical scroll offset, for non-flipped and
601    flipped cases
602-------------------------------------------------*/
603
604void tilemap_set_scrolldy(tilemap *tmap, int dy, int dy_flipped)
435605{
436   int oddcount = count & 3;
437   int unrcount = count & ~3;
438   int i;
439   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
440   for( i=0; i<oddcount; i++ )
441   {
442      dest[i] = clut[source[i]];
443   }
444   source += count; dest += count;
445   for( i=-unrcount; i; i+=4 )
446   {
447      UINT32 eax, ebx;
448      eax = source[i  ];
449      ebx = source[i+1];
450      eax = clut[eax];
451      ebx = clut[ebx];
452      dest[i  ] = eax;
453      eax = source[i+2];
454      dest[i+1] = ebx;
455      ebx = source[i+3];
456      eax = clut[eax];
457      ebx = clut[ebx];
458      dest[i+2] = eax;
459      dest[i+3] = ebx;
460   }
606   tmap->dy = dy;
607   tmap->dy_flipped = dy_flipped;
461608}
462#endif
463609
464/***********************************************************************************/
465610
466#ifndef pdt16
467static void pdt16( UINT16 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
468{
469   int i;
611/*-------------------------------------------------
612    tilemap_get_scrolldx - return the global
613    horizontal scroll offset, based on current
614    flip state
615-------------------------------------------------*/
470616
471   for( i=0; i<count; i++ )
472   {
473      if( (pMask[i]&mask)==value )
474      {
475         dest[i] = source[i];
476         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
477      }
478   }
617int tilemap_get_scrolldx(tilemap *tmap)
618{
619   return (tmap->attributes & TILEMAP_FLIPX) ? tmap->dx_flipped : tmap->dx;
479620}
480#endif
481621
482#ifndef pdt16pal
483static void pdt16pal( UINT16 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
484{
485   int pal = pcode >> 16;
486   int i;
487622
488   for( i=0; i<count; i++ )
489   {
490      if( (pMask[i]&mask)==value )
491      {
492         dest[i] = source[i] + pal;
493         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
494      }
495   }
496}
497#endif
623/*-------------------------------------------------
624    tilemap_get_scrolldy - return the global
625    vertical scroll offset, based on current
626    flip state
627-------------------------------------------------*/
498628
499#ifndef pdt16np
500static void pdt16np( UINT16 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
629int tilemap_get_scrolldy(tilemap *tmap)
501630{
502   int i;
503
504   for( i=0; i<count; i++ )
505   {
506      if( (pMask[i]&mask)==value )
507         dest[i] = source[i];
508   }
631   return (tmap->attributes & TILEMAP_FLIPY) ? tmap->dy_flipped : tmap->dy;
509632}
510#endif
511633
512static void pdt15( UINT16 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
634
635/*-------------------------------------------------
636    tilemap_set_scrollx - specify the scroll value
637    for a row unit
638-------------------------------------------------*/
639
640void tilemap_set_scrollx(tilemap *tmap, int which, int value)
513641{
514   int i;
515   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
516   for( i=0; i<count; i++ )
517   {
518      if( (pMask[i]&mask)==value )
519      {
520         dest[i] = clut[source[i]];
521         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
522      }
523   }
642   if (which < tmap->scrollrows)
643      tmap->rowscroll[which] = value;
524644}
525645
526#ifndef pdt32
527static void pdt32( UINT32 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
646
647/*-------------------------------------------------
648    tilemap_set_scrolly - specify the scroll value
649    for a column unit
650-------------------------------------------------*/
651
652void tilemap_set_scrolly(tilemap *tmap, int which, int value)
528653{
529   int i;
530   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
531   for( i=0; i<count; i++ )
532   {
533      if( (pMask[i]&mask)==value )
534      {
535         dest[i] = clut[source[i]];
536         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
537      }
538   }
654   if (which < tmap->scrollcols)
655      tmap->colscroll[which] = value;
539656}
540#endif
541657
542#ifndef npdt32
543static void npdt32( UINT32 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
544{
545   int oddcount = count & 3;
546   int unrcount = count & ~3;
547   int i;
548   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
549658
550   for( i=0; i<oddcount; i++ )
551   {
552      if( (pMask[i]&mask)==value ) dest[i] = clut[source[i]];
553   }
554   pMask += count, source += count; dest += count;
555   for( i=-unrcount; i; i+=4 )
556   {
557      if( (pMask[i  ]&mask)==value ) dest[i  ] = clut[source[i  ]];
558      if( (pMask[i+1]&mask)==value ) dest[i+1] = clut[source[i+1]];
559      if( (pMask[i+2]&mask)==value ) dest[i+2] = clut[source[i+2]];
560      if( (pMask[i+3]&mask)==value ) dest[i+3] = clut[source[i+3]];
561   }
562}
563#endif
564659
565/***********************************************************************************/
660/***************************************************************************
661    INTERNAL MAP ACCESS
662***************************************************************************/
566663
567static void pbo15( UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
568{
569   int i;
570   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
571   for( i=0; i<count; i++ )
572   {
573      dest[i] = alpha_blend16(dest[i], clut[source[i]]);
574      pri[i] = (pri[i] & (pcode >> 8)) | pcode;
575   }
576}
664/*-------------------------------------------------
665    tilemap_get_pixmap - return a pointer to the
666    (updated) internal pixmap for a tilemap
667-------------------------------------------------*/
577668
578#ifndef pbo32
579static void pbo32( UINT32 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
669mame_bitmap *tilemap_get_pixmap(tilemap *tmap)
580670{
581   int i;
582   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
583   for( i=0; i<count; i++ )
584   {
585      dest[i] = alpha_blend32(dest[i], clut[source[i]]);
586      pri[i] = (pri[i] & (pcode >> 8)) | pcode;
587   }
671   /* ensure all the tiles are up-to-date and then return the pixmap */
672   pixmap_update(tmap, NULL);
673   return tmap->pixmap;
588674}
589#endif
590675
591#ifndef npbo32
592static void npbo32( UINT32 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode )
593{
594   int oddcount = count & 3;
595   int unrcount = count & ~3;
596   int i;
597   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
598   for( i=0; i<oddcount; i++ )
599   {
600      dest[i] = alpha_blend32(dest[i], clut[source[i]]);
601   }
602   source += count; dest += count;
603   for( i=-unrcount; i; i+=4 )
604   {
605      dest[i  ] = alpha_blend32(dest[i  ], clut[source[i  ]]);
606      dest[i+1] = alpha_blend32(dest[i+1], clut[source[i+1]]);
607      dest[i+2] = alpha_blend32(dest[i+2], clut[source[i+2]]);
608      dest[i+3] = alpha_blend32(dest[i+3], clut[source[i+3]]);
609   }
610}
611#endif
612676
613/***********************************************************************************/
677/*-------------------------------------------------
678    tilemap_get_flagsmap - return a pointer to the
679    (updated) internal flagsmap for a tilemap
680-------------------------------------------------*/
614681
615static void pbt15( UINT16 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
682mame_bitmap *tilemap_get_flagsmap(tilemap *tmap)
616683{
617   int i;
618   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
619   for( i=0; i<count; i++ )
620   {
621      if( (pMask[i]&mask)==value )
622      {
623         dest[i] = alpha_blend16(dest[i], clut[source[i]]);
624         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
625      }
626   }
684   /* ensure all the tiles are up-to-date and then return the pixmap */
685   pixmap_update(tmap, NULL);
686   return tmap->flagsmap;
627687}
628688
629#ifndef pbt32
630static void pbt32( UINT32 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
689
690/*-------------------------------------------------
691    tilemap_get_pixmap - return a pointer to the
692    (updated) internal per-tile flags for a tilemap
693-------------------------------------------------*/
694
695UINT8 *tilemap_get_tile_flags(tilemap *tmap)
631696{
632   int i;
633   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
634   for( i=0; i<count; i++ )
635   {
636      if( (pMask[i]&mask)==value )
637      {
638         dest[i] = alpha_blend32(dest[i], clut[source[i]]);
639         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
640      }
641   }
697   /* ensure all the tiles are up-to-date and then return the pixmap */
698   pixmap_update(tmap, NULL);
699   return tmap->tileflags;
642700}
643#endif
644701
645#ifndef npbt32
646static void npbt32( UINT32 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode )
702
703
704/***************************************************************************
705    TILEMAP RENDERING
706***************************************************************************/
707
708/*-------------------------------------------------
709    tilemap_draw_primask - draw a tilemap to the
710    destination with clipping; pixels apply
711    priority/priority_mask to the priority bitmap
712-------------------------------------------------*/
713
714void tilemap_draw_primask(mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask)
647715{
648   int oddcount = count & 3;
649   int unrcount = count & ~3;
650   int i;
651   pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
716   rectangle original_cliprect;
717   blit_parameters blit;
718   int xpos, ypos;
652719
653   for( i=0; i<oddcount; i++ )
720   /* skip if disabled */
721   if (!tmap->enable)
722      return;
723
724profiler_mark(PROFILER_TILEMAP_DRAW);
725   /* configure the blit parameters based on the input parameters */
726   configure_blit_parameters(&blit, tmap, dest, cliprect, flags, priority, priority_mask);
727   original_cliprect = blit.cliprect;
728
729   /* if the whole map is dirty, mark it as such */
730   if (tmap->all_tiles_dirty)
654731   {
655      if( (pMask[i]&mask)==value ) dest[i] = alpha_blend32(dest[i], clut[source[i]]);
732      memset(tmap->tileflags, TILE_FLAG_DIRTY, tmap->max_logical_index);
733      tmap->all_tiles_dirty = FALSE;
656734   }
657   pMask += count, source += count; dest += count;
658   for( i=-unrcount; i; i+=4 )
735
736   /* XY scrolling playfield */
737   if (tmap->scrollrows == 1 && tmap->scrollcols == 1)
659738   {
660      if( (pMask[i  ]&mask)==value ) dest[i  ] = alpha_blend32(dest[i  ], clut[source[i  ]]);
661      if( (pMask[i+1]&mask)==value ) dest[i+1] = alpha_blend32(dest[i+1], clut[source[i+1]]);
662      if( (pMask[i+2]&mask)==value ) dest[i+2] = alpha_blend32(dest[i+2], clut[source[i+2]]);
663      if( (pMask[i+3]&mask)==value ) dest[i+3] = alpha_blend32(dest[i+3], clut[source[i+3]]);
739      int scrollx = effective_rowscroll(tmap, 0);
740      int scrolly = effective_colscroll(tmap, 0);
741
742      /* iterate to handle wraparound */
743      for (ypos = scrolly - tmap->height; ypos <= blit.cliprect.max_y; ypos += tmap->height)
744         for (xpos = scrollx - tmap->width; xpos <= blit.cliprect.max_x; xpos += tmap->width)
745            tilemap_draw_instance(tmap, &blit, xpos, ypos);
664746   }
665}
666#endif
667747
668/***********************************************************************************/
748   /* scrolling rows + vertical scroll */
749   else if (tmap->scrollcols == 1)
750   {
751      const rectangle original_cliprect = blit.cliprect;
752      int rowheight = tmap->height / tmap->scrollrows;
753      int scrolly = effective_colscroll(tmap, 0);
754      int currow, nextrow;
669755
670#define DEPTH 16
671#define DATA_TYPE UINT16
672#define DECLARE(function,args,body) static void function##16BPP args body
673#include "tilemap.c"
756      /* iterate over rows in the tilemap */
757      for (currow = 0; currow < tmap->scrollrows; currow = nextrow)
758      {
759         int scrollx = effective_rowscroll(tmap, currow);
674760
675#define DEPTH 32
676#define DATA_TYPE UINT32
677#define DECLARE(function,args,body) static void function##32BPP args body
678#include "tilemap.c"
761         /* scan forward until we find a non-matching row */
762         for (nextrow = currow + 1; nextrow < tmap->scrollrows; nextrow++)
763            if (effective_rowscroll(tmap, nextrow) != scrollx)
764               break;
679765
680#define PAL_INIT const pen_t *pPalData = tile_info.pal_data
681#define PAL_GET(pen) pPalData[pen]
682#define TRANSP(f) f ## _ind
683#include "tilemap.c"
766          /* skip if disabled */
767         if (scrollx == TILE_LINE_DISABLED)
768            continue;
684769
685#define PAL_INIT int palBase = tile_info.pal_data - Machine->remapped_colortable
686#define PAL_GET(pen) (palBase + (pen))
687#define TRANSP(f) f ## _raw
688#include "tilemap.c"
770         /* iterate over Y to handle wraparound */
771         for (ypos = scrolly - tmap->height; ypos <= original_cliprect.max_y; ypos += tmap->height)
772         {
773            /* update the cliprect just for this set of rows */
774            blit.cliprect.min_y = currow * rowheight + ypos;
775            blit.cliprect.max_y = nextrow * rowheight - 1 + ypos;
776            sect_rect(&blit.cliprect, &original_cliprect);
689777
690/*********************************************************************************/
778            /* iterate over X to handle wraparound */
779            for (xpos = scrollx - tmap->width; xpos <= original_cliprect.max_x; xpos += tmap->width)
780               tilemap_draw_instance(tmap, &blit, xpos, ypos);
781         }
782      }
783   }
691784
692static void install_draw_handlers( tilemap *tmap )
693{
694   switch (tmap->type)
785   /* scrolling columns + horizontal scroll */
786   else if (tmap->scrollrows == 1)
695787   {
696      default:
697      case TILEMAP_TYPE_OPAQUE:
698         tmap->draw_tile = (Machine->game_colortable != NULL) ? HandleTransparencyNone_ind : HandleTransparencyNone_raw;
699         break;
788      const rectangle original_cliprect = blit.cliprect;
789      int colwidth = tmap->width / tmap->scrollcols;
790      int scrollx = effective_rowscroll(tmap, 0);
791      int curcol, nextcol;
700792
701      case TILEMAP_TYPE_TRANSPARENT:
702         tmap->draw_tile = (Machine->game_colortable != NULL) ? HandleTransparencyPen_ind : HandleTransparencyPen_raw;
703         break;
793      /* iterate over columns in the tilemap */
794      for (curcol = 0; curcol < tmap->scrollcols; curcol = nextcol)
795      {
796         int scrolly   = effective_colscroll(tmap, curcol);
704797
705      case TILEMAP_TYPE_SPLIT:
706         tmap->draw_tile = (Machine->game_colortable != NULL) ? HandleTransparencyPens_ind : HandleTransparencyPens_raw;
707         break;
798         /* scan forward until we find a non-matching column */
799         for (nextcol = curcol + 1; nextcol < tmap->scrollcols; nextcol++)
800            if (effective_colscroll(tmap, nextcol) != scrolly)
801               break;
708802
709      case TILEMAP_TYPE_BITMASK:
710         tmap->draw_tile = (Machine->game_colortable != NULL) ? HandleTransparencyBitmask_ind : HandleTransparencyBitmask_raw;
711         break;
803          /* skip if disabled */
804         if (scrolly == TILE_LINE_DISABLED)
805            continue;
712806
713      case TILEMAP_TYPE_TRANSPARENT_COLOR:
714         tmap->draw_tile = (Machine->game_colortable != NULL) ? HandleTransparencyColor_ind : HandleTransparencyColor_raw;
715         break;
807         /* iterate over X to handle wraparound */
808         for (xpos = scrollx - tmap->width; xpos <= original_cliprect.max_x; xpos += tmap->width)
809         {
810            /* update the cliprect just for this set of columns */
811            blit.cliprect.min_x = curcol * colwidth + xpos;
812            blit.cliprect.max_x = nextcol * colwidth - 1 + xpos;
813            sect_rect(&blit.cliprect, &original_cliprect);
716814
717      case TILEMAP_TYPE_SPLIT_PENBIT:
718         tmap->draw_tile = (Machine->game_colortable != NULL) ? HandleTransparencyPenBit_ind : HandleTransparencyPenBit_raw;
719         break;
815            /* iterate over Y to handle wraparound */
816            for (ypos = scrolly - tmap->height; ypos <= original_cliprect.max_y; ypos += tmap->height)
817               tilemap_draw_instance(tmap, &blit, xpos, ypos);
818         }
819      }
720820   }
821profiler_mark(PROFILER_END);
721822}
722823
723INLINE tilemap_draw_func pick_draw_func( mame_bitmap *dest )
724{
725   switch (dest ? dest->bpp : bitmap_format_to_bpp(Machine->screen[0].format))
726   {
727      case 32:
728         return draw32BPP;
729824
730      case 16:
731         return draw16BPP;
732   }
733   fatalerror("Illegal destination drawing depth");
734   return NULL;
735}
825/*-------------------------------------------------
826    tilemap_draw_primask - draw a tilemap to the
827    destination with clipping and arbitrary
828    rotate/zoom; pixels apply priority/
829    priority_mask to the priority bitmap
830-------------------------------------------------*/
736831
737
738/***********************************************************************************/
739
740void tilemap_init( running_machine *machine )
832void tilemap_draw_roz_primask(mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap,
833      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
834      int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask)
741835{
742   screen_width   = Machine->screen[0].width;
743   screen_height   = Machine->screen[0].height;
744   first_tilemap   = NULL;
836   blit_parameters blit;
745837
746   priority_bitmap = auto_bitmap_alloc( screen_width, screen_height, BITMAP_FORMAT_INDEXED8 );
747   priority_bitmap_pitch_line = priority_bitmap->rowpixels;
748   add_exit_callback(machine, tilemap_exit);
749}
838/* notes:
839   - startx and starty MUST be UINT32 for calculations to work correctly
840   - srcbitmap->width and height are assumed to be a power of 2 to speed up wraparound
841   */
750842
751static void tilemap_exit( running_machine *machine )
752{
753   tilemap *next;
843   /* skip if disabled */
844   if (!tmap->enable)
845      return;
754846
755   while( first_tilemap )
847   /* see if this is just a regular render and if so, do a regular render */
848   if (incxx == (1 << 16) && incxy == 0 && incyx == 0 && incyy == (1 << 16) && wraparound)
756849   {
757      next = first_tilemap->next;
758      tilemap_dispose( first_tilemap );
759      first_tilemap = next;
850      tilemap_set_scrollx(tmap, 0, startx >> 16);
851      tilemap_set_scrolly(tmap, 0, starty >> 16);
852      tilemap_draw(dest, cliprect, tmap, flags, priority);
853      return;
760854   }
761}
762855
763/***********************************************************************************/
856profiler_mark(PROFILER_TILEMAP_DRAW_ROZ);
857   /* configure the blit parameters */
858   configure_blit_parameters(&blit, tmap, dest, cliprect, flags, priority, priority_mask);
764859
765static void tilemap_postload(void *param)
766{
767   tilemap *tmap = param;
768   mappings_update(tmap);
769   recalculate_scroll(tmap);
770   tilemap_mark_all_tiles_dirty(tmap);
860   /* get the full pixmap for the tilemap */
861   tilemap_get_pixmap(tmap);
862
863   /* then do the roz copy */
864   tilemap_draw_roz_core(tmap, &blit, startx, starty, incxx, incxy, incyx, incyy, wraparound);
865profiler_mark(PROFILER_END);
771866}
772867
773868
774tilemap *tilemap_create(
775   tile_get_info_fn tile_get_info,
776   UINT32 (*get_memory_offset)( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ),
777   tilemap_type type,
778   int tile_width, int tile_height,
779   int num_cols, int num_rows )
869
870/***************************************************************************
871    INDEXED TILEMAP HANDLING
872***************************************************************************/
873
874/*-------------------------------------------------
875    tilemap_count - return the number of tilemaps
876-------------------------------------------------*/
877
878int tilemap_count(void)
780879{
781880   tilemap *tmap;
782   UINT32 row;
783   int num_tiles;
784   int instance = 0;
785   tilemap *tm;
881   int count = 0;
786882
787   tmap = malloc_or_die( sizeof( tilemap ) );
788   memset(tmap, 0, sizeof(tilemap));
883   /* find by the tilemap index */
884   for (tmap = tilemap_list; tmap != NULL; tmap = tmap->next)
885      count++;
886   return count;
887}
789888
790   num_tiles = num_cols*num_rows;
791   tmap->num_logical_cols = num_cols;
792   tmap->num_logical_rows = num_rows;
793   tmap->logical_tile_width = tile_width;
794   tmap->logical_tile_height = tile_height;
795   tmap->logical_colscroll = malloc_or_die(num_cols*tile_width*sizeof(INT32));
796   memset(tmap->logical_colscroll, 0, num_cols*tile_width*sizeof(INT32));
797   tmap->logical_rowscroll = malloc_or_die(num_rows*tile_height*sizeof(INT32));
798   memset(tmap->logical_rowscroll, 0, num_rows*tile_height*sizeof(INT32));
799   tmap->num_cached_cols = num_cols;
800   tmap->num_cached_rows = num_rows;
801   tmap->num_tiles = num_tiles;
802   tmap->num_pens = tile_width*tile_height;
803   tmap->cached_tile_width = tile_width;
804   tmap->cached_tile_height = tile_height;
805   tmap->cached_width = tile_width*num_cols;
806   tmap->cached_height = tile_height*num_rows;
807   tmap->tile_get_info = tile_get_info;
808   tmap->get_memory_offset = get_memory_offset;
809   tmap->orientation = ROT0;
810889
811   /* various defaults */
812   tmap->enable = 1;
813   tmap->type = type;
814   tmap->logical_scroll_rows = tmap->cached_scroll_rows = 1;
815   tmap->logical_scroll_cols = tmap->cached_scroll_cols = 1;
816   tmap->transparent_pen = -1;
817   tmap->tile_depth = 0;
818   tmap->tile_granularity = 0;
890/*-------------------------------------------------
891    tilemap_size_by_index - return the size of an
892    indexed tilemap
893-------------------------------------------------*/
819894
820   tmap->cached_rowscroll   = malloc_or_die(tmap->cached_height * sizeof(INT32));
821   memset(tmap->cached_rowscroll, 0, tmap->cached_height * sizeof(INT32));
822   tmap->cached_colscroll   = malloc_or_die(tmap->cached_width * sizeof(INT32));
823   memset(tmap->cached_colscroll, 0, tmap->cached_width * sizeof(INT32));
895void tilemap_size_by_index(int number, UINT32 *width, UINT32 *height)
896{
897   tilemap *tmap = indexed_tilemap(number);
898   *width = tmap->width;
899   *height = tmap->height;
900}
824901
825   tmap->transparency_data = malloc_or_die( num_tiles );
826   tmap->transparency_data_row = malloc_or_die( sizeof(UINT8 *)*num_rows );
827902
828   tmap->pixmap = bitmap_alloc( tmap->cached_width, tmap->cached_height, BITMAP_FORMAT_INDEXED16 );
829   tmap->transparency_bitmap = bitmap_alloc( tmap->cached_width, tmap->cached_height, BITMAP_FORMAT_INDEXED8 );
903/*-------------------------------------------------
904    tilemap_draw_by_index - render an indexed
905    tilemap with fixed characteristics (no
906    priority)
907-------------------------------------------------*/
830908
831   mappings_create( tmap );
909void tilemap_draw_by_index(mame_bitmap *dest, int number, UINT32 scrollx, UINT32 scrolly)
910{
911   tilemap *tmap = indexed_tilemap(number);
912   blit_parameters blit;
913   int xpos,ypos;
832914
833   tmap->pixmap_pitch_line = tmap->pixmap->rowpixels;
834   tmap->pixmap_pitch_row = tmap->pixmap_pitch_line*tile_height;
915   /* set up for the blit, using hard-coded parameters (no priority, etc) */
916   configure_blit_parameters(&blit, tmap, dest, NULL, TILEMAP_DRAW_OPAQUE, 0, 0xff);
835917
836   tmap->transparency_bitmap_pitch_line = tmap->transparency_bitmap->rowpixels;
837   tmap->transparency_bitmap_pitch_row = tmap->transparency_bitmap_pitch_line*tile_height;
918   /* compute the effective scroll positions */
919   scrollx = tmap->width  - scrollx % tmap->width;
920   scrolly = tmap->height - scrolly % tmap->height;
838921
839   for( row=0; row<num_rows; row++ )
922   /* if the whole map is dirty, mark it as such */
923   if (tmap->all_tiles_dirty)
840924   {
841      tmap->transparency_data_row[row] = tmap->transparency_data+num_cols*row;
925      memset(tmap->tileflags, TILE_FLAG_DIRTY, tmap->max_logical_index);
926      tmap->all_tiles_dirty = FALSE;
842927   }
843   install_draw_handlers( tmap );
844   mappings_update( tmap );
845   memset( tmap->transparency_data, TILE_FLAG_DIRTY, num_tiles );
846   tmap->next = first_tilemap;
847   first_tilemap = tmap;
848928
849   PenToPixel_Init( tmap );
929   /* iterate to handle wraparound */
930   for (ypos = scrolly - tmap->height; ypos <= blit.cliprect.max_y; ypos += tmap->height)
931      for (xpos = scrollx - tmap->width; xpos <= blit.cliprect.max_x; xpos += tmap->width)
932         tilemap_draw_instance(tmap, &blit, xpos, ypos);
933}
850934
851   recalculate_scroll(tmap);
852935
853   /* compute the index of this entry */
854   for (tm = first_tilemap; tm; tm = tm->next)
855      instance++;
856936
857   /* save relevant state */
858   state_save_register_item("tilemap", instance, tmap->enable);
859   state_save_register_item("tilemap", instance, tmap->attributes);
860   state_save_register_item("tilemap", instance, tmap->transparent_pen);
861   state_save_register_item_array("tilemap", instance, tmap->fgmask);
862   state_save_register_item_array("tilemap", instance, tmap->bgmask);
863   state_save_register_item("tilemap", instance, tmap->dx);
864   state_save_register_item("tilemap", instance, tmap->dx_if_flipped);
865   state_save_register_item("tilemap", instance, tmap->dy);
866   state_save_register_item("tilemap", instance, tmap->dy_if_flipped);
867   state_save_register_item("tilemap", instance, tmap->cached_scroll_rows);
868   state_save_register_item("tilemap", instance, tmap->cached_scroll_cols);
869   state_save_register_item_pointer("tilemap", instance, tmap->cached_rowscroll, tmap->cached_height);
870   state_save_register_item_pointer("tilemap", instance, tmap->cached_colscroll, tmap->cached_width);
871   state_save_register_item("tilemap", instance, tmap->logical_scroll_rows);
872   state_save_register_item("tilemap", instance, tmap->logical_scroll_cols);
873   state_save_register_item_pointer("tilemap", instance, tmap->logical_rowscroll, num_rows*tile_height);
874   state_save_register_item_pointer("tilemap", instance, tmap->logical_colscroll, num_cols*tile_width);
875   state_save_register_item("tilemap", instance, tmap->orientation);
876   state_save_register_item("tilemap", instance, tmap->palette_offset);
877   state_save_register_item("tilemap", instance, tmap->tile_depth);
878   state_save_register_item("tilemap", instance, tmap->tile_granularity);
937/***************************************************************************
938    COMMON LOGICAL-TO-MEMORY MAPPERS
939***************************************************************************/
879940
880   /* reset everything after a load */
881   state_save_register_func_postload_ptr(tilemap_postload, tmap);
882   return tmap;
883}
941/*-------------------------------------------------
942    tilemap_scan_rows
943    tilemap_scan_rows_flip_x
944    tilemap_scan_rows_flip_y
945    tilemap_scan_rows_flip_xy - scan in row-major
946    order with optional flipping
947-------------------------------------------------*/
884948
885static void tilemap_dispose( tilemap *tmap )
949TILEMAP_MAPPER( tilemap_scan_rows )
886950{
887   tilemap *prev;
888
889   if( tmap==first_tilemap )
890   {
891      first_tilemap = tmap->next;
892   }
893   else
894   {
895      prev = first_tilemap;
896      while( prev && prev->next != tmap ) prev = prev->next;
897      if( prev ) prev->next =tmap->next;
898   }
899   PenToPixel_Term( tmap );
900   free( tmap->logical_rowscroll );
901   free( tmap->cached_rowscroll );
902   free( tmap->logical_colscroll );
903   free( tmap->cached_colscroll );
904   free( tmap->transparency_data );
905   free( tmap->transparency_data_row );
906   bitmap_free( tmap->transparency_bitmap );
907   bitmap_free( tmap->pixmap );
908   mappings_dispose( tmap );
909   free( tmap );
951   return row * num_cols + col;
910952}
911953
912/***********************************************************************************/
913
914void tilemap_set_enable( tilemap *tmap, int enable )
954TILEMAP_MAPPER( tilemap_scan_rows_flip_x )
915955{
916   tmap->enable = enable?1:0;
956   return row * num_cols + (num_cols - 1 - col);
917957}
918958
919
920void tilemap_set_flip( tilemap *tmap, int attributes )
959TILEMAP_MAPPER( tilemap_scan_rows_flip_y )
921960{
922   if( tmap==ALL_TILEMAPS )
923   {
924      tmap = first_tilemap;
925      while( tmap )
926      {
927         tilemap_set_flip( tmap, attributes );
928         tmap = tmap->next;
929      }
930   }
931   else if( tmap->attributes!=attributes )
932   {
933      tmap->attributes = attributes;
934      tmap->orientation = ROT0;
935      if( attributes&TILEMAP_FLIPY )
936      {
937         tmap->orientation ^= ORIENTATION_FLIP_Y;
938      }
961   return (num_rows - 1 - row) * num_cols + col;
962}
939963
940      if( attributes&TILEMAP_FLIPX )
941      {
942         tmap->orientation ^= ORIENTATION_FLIP_X;
943      }
944
945      mappings_update( tmap );
946      recalculate_scroll( tmap );
947      tilemap_mark_all_tiles_dirty( tmap );
948   }
964TILEMAP_MAPPER( tilemap_scan_rows_flip_xy )
965{
966   return (num_rows - 1 - row) * num_cols + (num_cols - 1 - col);
949967}
950968
951/***********************************************************************************/
952969
953void tilemap_set_scroll_cols( tilemap *tmap, int n )
970/*-------------------------------------------------
971    tilemap_scan_cols
972    tilemap_scan_cols_flip_x
973    tilemap_scan_cols_flip_y
974    tilemap_scan_cols_flip_xy - scan in column-
975    major order with optional flipping
976-------------------------------------------------*/
977
978TILEMAP_MAPPER( tilemap_scan_cols )
954979{
955   tmap->logical_scroll_cols = n;
956   tmap->cached_scroll_cols = n;
980   return col * num_rows + row;
957981}
958982
959void tilemap_set_scroll_rows( tilemap *tmap, int n )
983TILEMAP_MAPPER( tilemap_scan_cols_flip_x )
960984{
961   tmap->logical_scroll_rows = n;
962   tmap->cached_scroll_rows = n;
985   return (num_cols - 1 - col) * num_rows + row;
963986}
964987
965/***********************************************************************************/
966
967void tilemap_mark_tile_dirty( tilemap *tmap, int memory_offset )
988TILEMAP_MAPPER( tilemap_scan_cols_flip_y )
968989{
969   if( memory_offset<tmap->max_memory_offset )
970   {
971      int cached_indx = tmap->memory_offset_to_cached_indx[memory_offset];
972      if( cached_indx>=0 )
973      {
974         tmap->transparency_data[cached_indx] = TILE_FLAG_DIRTY;
975         tmap->all_tiles_clean = 0;
976      }
977   }
990   return col * num_rows + (num_rows - 1 - row);
978991}
979992
980void tilemap_mark_all_tiles_dirty( tilemap *tmap )
993TILEMAP_MAPPER( tilemap_scan_cols_flip_xy )
981994{
982   if( tmap==ALL_TILEMAPS )
983   {
984      tmap = first_tilemap;
985      while( tmap )
986      {
987         tilemap_mark_all_tiles_dirty( tmap );
988         tmap = tmap->next;
989      }
990   }
991   else
992   {
993      tmap->all_tiles_dirty = 1;
994      tmap->all_tiles_clean = 0;
995   }
995   return (num_cols - 1 - col) * num_rows + (num_rows - 1 - row);
996996}
997997
998/***********************************************************************************/
999998
1000static void update_tile_info( tilemap *tmap, UINT32 cached_indx, UINT32 col, UINT32 row )
1001{
1002   UINT32 x0;
1003   UINT32 y0;
1004   UINT32 memory_offset;
1005   UINT32 flags;
1006999
1007profiler_mark(PROFILER_TILEMAP_UPDATE);
1000/***************************************************************************
1001    SYSTEM MANAGEMENT HELPERS
1002***************************************************************************/
10081003
1009   memory_offset = tmap->cached_indx_to_memory_offset[cached_indx];
1010   tmap->tile_get_info( Machine, &tile_info, memory_offset );
1011   flags = tile_info.flags;
1012   flags = (flags&0xfc)|tmap->logical_flip_to_cached_flip[flags&0x3];
1013   x0 = tmap->cached_tile_width*col;
1014   y0 = tmap->cached_tile_height*row;
1004/*-------------------------------------------------
1005    tilemap_exit - free memory allocated by the
1006    tilemap system
1007-------------------------------------------------*/
10151008
1016   tmap->transparency_data[cached_indx] = tmap->draw_tile(tmap,x0,y0,flags );
1017
1018profiler_mark(PROFILER_END);
1009static void tilemap_exit(running_machine *machine)
1010{
1011   /* free all the tilemaps in the list */
1012   while (tilemap_list != NULL)
1013   {
1014      tilemap *next = tilemap_list->next;
1015      tilemap_dispose(tilemap_list);
1016      tilemap_list = next;
1017   }
1018   tilemap_tailptr = NULL;
10191019}
10201020
1021mame_bitmap *tilemap_get_pixmap( tilemap * tmap )
1021
1022/*-------------------------------------------------
1023    tilemap_postload - after loading a save state
1024    invalidate everything
1025-------------------------------------------------*/
1026
1027static void tilemap_postload(void *param)
10221028{
1023   UINT32 cached_indx = 0;
1024   UINT32 row,col;
1029   /* recompute the mappings for this tilemap */
1030   tilemap *tmap = param;
1031   mappings_update(tmap);
1032}
10251033
1026   if (!tmap)
1027      return 0;
10281034
1029   if (tmap->all_tiles_clean == 0)
1030   {
1031profiler_mark(PROFILER_TILEMAP_DRAW);
1035/*-------------------------------------------------
1036    tilemap_dispose - dispose of a tilemap
1037-------------------------------------------------*/
10321038
1033      /* if the whole map is dirty, mark it as such */
1034      if (tmap->all_tiles_dirty)
1039static void tilemap_dispose(tilemap *tmap)
1040{
1041   tilemap **tmapptr;
1042
1043   /* walk the list of tilemaps; when we find ourself, remove it */
1044   for (tmapptr = &tilemap_list; *tmapptr != NULL; tmapptr = &(*tmapptr)->next)
1045      if (*tmapptr == tmap)
10351046      {
1036         memset( tmap->transparency_data, TILE_FLAG_DIRTY, tmap->num_tiles );
1037         tmap->all_tiles_dirty = 0;
1047         *tmapptr = tmap->next;
1048         break;
10381049      }
10391050
1040      memset( &tile_info, 0x00, sizeof(tile_info) ); /* initialize defaults */
1041      tile_info.user_data = tmap->user_data;
1051   /* free allocated memory */
1052   free(tmap->pen_to_flags);
1053   free(tmap->tileflags);
1054   bitmap_free(tmap->flagsmap);
1055   bitmap_free(tmap->pixmap);
1056   free(tmap->colscroll);
1057   free(tmap->rowscroll);
1058   free(tmap->logical_to_memory);
1059   free(tmap->memory_to_logical);
1060   free(tmap);
1061}
10421062
1043      /* walk over cached rows/cols (better to walk screen coords) */
1044      for( row=0; row<tmap->num_cached_rows; row++ )
1045      {
1046         for( col=0; col<tmap->num_cached_cols; col++ )
1047         {
1048            if( tmap->transparency_data[cached_indx] == TILE_FLAG_DIRTY )
1049            {
1050               update_tile_info( tmap, cached_indx, col, row );
1051            }
1052            cached_indx++;
1053         } /* next col */
1054      } /* next row */
10551063
1056      tmap->all_tiles_clean = 1;
10571064
1058profiler_mark(PROFILER_END);
1059   }
1065/***************************************************************************
1066    LOGICAL <-> MEMORY INDEX MAPPING
1067***************************************************************************/
10601068
1061   return tmap->pixmap;
1062}
1069/*-------------------------------------------------
1070    mappings_create - allocate memory for the
1071    mapping tables and compute their extents
1072-------------------------------------------------*/
10631073
1064mame_bitmap *tilemap_get_transparency_bitmap( tilemap * tmap )
1074static void mappings_create(tilemap *tmap)
10651075{
1066   return tmap->transparency_bitmap;
1067}
1076   UINT32 col, row;
10681077
1069UINT8 *tilemap_get_transparency_data( tilemap * tmap ) //*
1070{
1071   return tmap->transparency_data;
1078   /* compute the maximum logical index */
1079   tmap->max_logical_index = tmap->rows * tmap->cols;
1080
1081   /* compute the maximum memory index */
1082   tmap->max_memory_index = 0;
1083   for (row = 0; row < tmap->rows; row++)
1084      for (col = 0; col < tmap->cols; col++)
1085      {
1086         tilemap_memory_index memindex = (*tmap->mapper)(col, row, tmap->cols, tmap->rows);
1087         tmap->max_memory_index = MAX(tmap->max_memory_index, memindex);
1088      }
1089   tmap->max_memory_index++;
1090
1091   /* allocate the necessary mappings */
1092   tmap->memory_to_logical = malloc_or_die(tmap->max_memory_index * sizeof(*tmap->memory_to_logical));
1093   tmap->logical_to_memory = malloc_or_die(tmap->max_logical_index * sizeof(*tmap->logical_to_memory));
1094
1095   /* update the mappings */
1096   mappings_update(tmap);
10721097}
10731098
1074/***********************************************************************************/
10751099
1076static void
1077recalculate_scroll( tilemap *tmap )
1100/*-------------------------------------------------
1101    mappings_update - update the mappings after
1102    a major change (flip x/y changes)
1103-------------------------------------------------*/
1104
1105static void mappings_update(tilemap *tmap)
10781106{
1079   int i;
1107   tilemap_logical_index logindex;
1108   tilemap_memory_index memindex;
10801109
1081   tmap->scrollx_delta = (tmap->attributes & TILEMAP_FLIPX )?tmap->dx_if_flipped:tmap->dx;
1082   tmap->scrolly_delta = (tmap->attributes & TILEMAP_FLIPY )?tmap->dy_if_flipped:tmap->dy;
1110   /* initialize all the mappings to invalid values */
1111   for (memindex = 0; memindex < tmap->max_memory_index; memindex++)
1112      tmap->memory_to_logical[memindex] = -1;
10831113
1084   for( i=0; i<tmap->logical_scroll_rows; i++ )
1114   /* now iterate over all logical indexes and populate the memory index */
1115   for (logindex = 0; logindex < tmap->max_logical_index; logindex++)
10851116   {
1086      tilemap_set_scrollx( tmap, i, tmap->logical_rowscroll[i] );
1117      UINT32 logical_col = logindex % tmap->cols;
1118      UINT32 logical_row = logindex / tmap->cols;
1119      tilemap_memory_index memindex = (*tmap->mapper)(logical_col, logical_row, tmap->cols, tmap->rows);
1120      UINT32 flipped_logindex;
1121
1122      /* apply tilemap flip to get the final location to store */
1123      if (tmap->attributes & TILEMAP_FLIPX)
1124         logical_col = (tmap->cols - 1) - logical_col;
1125      if (tmap->attributes & TILEMAP_FLIPY)
1126         logical_row = (tmap->rows - 1) - logical_row;
1127      flipped_logindex = logical_row * tmap->cols + logical_col;
1128
1129      /* fill in entries in both arrays */
1130      tmap->memory_to_logical[memindex] = flipped_logindex;
1131      tmap->logical_to_memory[flipped_logindex] = memindex;
10871132   }
1088   for( i=0; i<tmap->logical_scroll_cols; i++ )
1089   {
1090      tilemap_set_scrolly( tmap, i, tmap->logical_colscroll[i] );
1091   }
1092}
10931133
1094void
1095tilemap_set_scrolldx( tilemap *tmap, int dx, int dx_if_flipped )
1096{
1097   tmap->dx = dx;
1098   tmap->dx_if_flipped = dx_if_flipped;
1099   recalculate_scroll( tmap );
1134   /* mark the whole tilemap dirty */
1135   tilemap_mark_all_tiles_dirty(tmap);
11001136}
11011137
1102void
1103tilemap_set_scrolldy( tilemap *tmap, int dy, int dy_if_flipped )
1104{
1105   tmap->dy = dy;
1106   tmap->dy_if_flipped = dy_if_flipped;
1107   recalculate_scroll( tmap );
1108}
11091138
1110int
1111tilemap_get_scrolldx( tilemap *tmap )
1112{
1113   return (tmap->attributes & TILEMAP_FLIPX) ? tmap->dx_if_flipped : tmap->dx;
1114}
11151139
1116int
1117tilemap_get_scrolldy( tilemap *tmap )
1118{
1119   return (tmap->attributes & TILEMAP_FLIPY) ? tmap->dy_if_flipped : tmap->dy;
1120}
1140/***************************************************************************
1141    TILE RENDERING
1142***************************************************************************/
11211143
1122void tilemap_set_scrollx( tilemap *tmap, int which, int value )
1144/*-------------------------------------------------
1145    pixmap_update - update the portion of the
1146    pixmap described by the cliprect
1147-------------------------------------------------*/
1148
1149static void pixmap_update(tilemap *tmap, const rectangle *cliprect)
11231150{
1124   tmap->logical_rowscroll[which] = value;
1125   value = tmap->scrollx_delta-value; /* adjust */
1151   int mincol, maxcol, minrow, maxrow;
1152   int row, col;
11261153
1127   if( tmap->orientation & ORIENTATION_FLIP_Y )
1154   /* if everything is clean, do nothing */
1155   if (tmap->all_tiles_clean)
1156      return;
1157
1158profiler_mark(PROFILER_TILEMAP_DRAW);
1159
1160   /* compute which columns and rows to update */
1161   if (cliprect != NULL)
11281162   {
1129      /* adjust affected row */
1130      which = tmap->cached_scroll_rows-1 - which;
1163      mincol = cliprect->min_x / tmap->tilewidth;
1164      maxcol = cliprect->max_x / tmap->tilewidth;
1165      minrow = cliprect->min_y / tmap->tileheight;
1166      maxrow = cliprect->max_y / tmap->tileheight;
11311167   }
1132   if( tmap->orientation & ORIENTATION_FLIP_X )
1168   else
11331169   {
1134      /* adjust scroll amount */
1135      value = screen_width-tmap->cached_width-value;
1170      mincol = minrow = 0;
1171      maxcol = tmap->cols - 1;
1172      maxrow = tmap->rows - 1;
11361173   }
1137   tmap->cached_rowscroll[which] = value;
1138}
11391174
1140void tilemap_set_scrolly( tilemap *tmap, int which, int value )
1141{
1142   tmap->logical_colscroll[which] = value;
1143   value = tmap->scrolly_delta - value; /* adjust */
1144
1145   if( tmap->orientation & ORIENTATION_FLIP_X )
1175   /* if the whole map is dirty, mark it as such */
1176   if (tmap->all_tiles_dirty)
11461177   {
1147      /* adjust affected col */
1148      which = tmap->cached_scroll_cols-1 - which;
1178      memset(tmap->tileflags, TILE_FLAG_DIRTY, tmap->max_logical_index);
1179      tmap->all_tiles_dirty = FALSE;
11491180   }
1150   if( tmap->orientation & ORIENTATION_FLIP_Y )
1181
1182   /* iterate over rows */
1183   for (row = minrow; row <= maxrow; row++)
11511184   {
1152      /* adjust scroll amount */
1153      value = screen_height-tmap->cached_height-value;
1185      tilemap_logical_index logindex = row * tmap->cols;
1186
1187      /* iterate over colums */
1188      for (col = mincol; col <= maxcol; col++)
1189         if (tmap->tileflags[logindex + col] == TILE_FLAG_DIRTY)
1190            tile_update(tmap, logindex + col, col, row);
11541191   }
1155   tmap->cached_colscroll[which] = value;
1156}
11571192
1158/***********************************************************************************/
1193   /* mark it all clean */
1194   if (mincol == 0 && minrow == 0 && maxcol == tmap->cols - 1 && maxcol == tmap->rows - 1)
1195      tmap->all_tiles_clean = TRUE;
11591196
1160void tilemap_set_palette_offset( tilemap *tmap, int offset )
1161{
1162   tmap->palette_offset = offset;
1197profiler_mark(PROFILER_END);
11631198}
11641199
1165/***********************************************************************************/
11661200
1167void tilemap_set_user_data( tilemap *tmap, void *user_data )
1201/*-------------------------------------------------
1202    tile_update - update a single dirty tile
1203-------------------------------------------------*/
1204
1205static void tile_update(tilemap *tmap, tilemap_logical_index logindex, UINT32 col, UINT32 row)
11681206{
1169   tmap->user_data = user_data;
1170}
1207   UINT32 x0 = tmap->tilewidth * col;
1208   UINT32 y0 = tmap->tileheight * row;
1209   tilemap_memory_index memindex;
1210   UINT32 flags;
11711211
1172/***********************************************************************************/
1212profiler_mark(PROFILER_TILEMAP_UPDATE);
11731213
1174void tilemap_draw( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority )
1175{
1176   tilemap_draw_primask( dest, cliprect, tmap, flags, priority, 0xff );
1214   /* call the get info callback for the associated memory index */
1215   memindex = tmap->logical_to_memory[logindex];
1216   (*tmap->tile_get_info)(Machine, &tmap->tileinfo, memindex, tmap->user_data);
1217
1218   /* apply the global tilemap flip to the returned flip flags */
1219   flags = tmap->tileinfo.flags ^ (tmap->attributes & 0x03);
1220
1221   /* draw the tile, using either direct or transparent */
1222   if (Machine->game_colortable != NULL)
1223   {
1224      if (tmap->type != TILEMAP_TYPE_COLORTABLE)
1225         tmap->tileflags[logindex] = tile_draw_colortable(tmap, tmap->tileinfo.pen_data, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
1226      else
1227         tmap->tileflags[logindex] = tile_draw_colortrans(tmap, tmap->tileinfo.pen_data, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
1228   }
1229   else
1230      tmap->tileflags[logindex] = tile_draw(tmap, tmap->tileinfo.pen_data, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
1231
1232   /* if mask data is specified, apply it */
1233   if ((flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2)) == 0 && tmap->tileinfo.mask_data != NULL)
1234      tmap->tileflags[logindex] = tile_apply_bitmask(tmap, tmap->tileinfo.mask_data, x0, y0, tmap->tileinfo.category, flags);
1235
1236profiler_mark(PROFILER_END);
11771237}
11781238
1179void tilemap_draw_primask( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority, UINT32 priority_mask )
1239
1240/*-------------------------------------------------
1241    tile_draw - draw a single tile to the
1242    tilemap's internal pixmap, using the pen as
1243    the pen_to_flags lookup value, and adding
1244    the palette_base
1245-------------------------------------------------*/
1246
1247static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags)
11801248{
1181   tilemap_draw_func drawfunc = pick_draw_func(dest);
1182   int xpos,ypos,mask,value;
1183   int rows, cols;
1184   const int *rowscroll, *colscroll;
1185   int left, right, top, bottom;
1249   const UINT8 *penmap = tmap->pen_to_flags + group * tmap->max_pen_to_flags;
1250   mame_bitmap *flagsmap = tmap->flagsmap;
1251   mame_bitmap *pixmap = tmap->pixmap;
1252   int height = tmap->tileheight;
1253   int width = tmap->tilewidth;
1254   UINT8 andmask = ~0, ormask = 0;
1255   int dx0 = 1, dy0 = 1;
1256   int tx, ty;
11861257
1187profiler_mark(PROFILER_TILEMAP_DRAW);
1188   if( tmap->enable )
1258   /* OR in the force layer flags */
1259   category |= flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2);
1260
1261   /* if we're vertically flipped, point to the bottom row and work backwards */
1262   if (flags & TILE_FLIPY)
11891263   {
1190      /* scroll registers */
1191      rows      = tmap->cached_scroll_rows;
1192      cols      = tmap->cached_scroll_cols;
1193      rowscroll   = tmap->cached_rowscroll;
1194      colscroll   = tmap->cached_colscroll;
1264      y0 += height - 1;
1265      dy0 = -1;
1266   }
11951267
1196      /* clipping */
1197      if( cliprect )
1198      {
1199         left   = cliprect->min_x;
1200         top      = cliprect->min_y;
1201         right   = cliprect->max_x+1;
1202         bottom   = cliprect->max_y+1;
1203      }
1204      else
1205      {
1206         left   = 0;
1207         top      = 0;
1208         right   = tmap->cached_width;
1209         bottom   = tmap->cached_height;
1210      }
1268   /* if we're horizontally flipped, point to the rightmost column and work backwards */
1269   if (flags & TILE_FLIPX)
1270   {
1271      x0 += width - 1;
1272      dx0 = -1;
1273   }
12111274
1212      /* tile priority */
1213      mask      = TILE_FLAG_TILE_PRIORITY;
1214      value      = TILE_FLAG_TILE_PRIORITY&flags;
1275   /* we draw in groups of 2 pixels, so halve the width now */
1276   width /= 2;
12151277
1216      /* initialize defaults */
1217      memset( &tile_info, 0x00, sizeof(tile_info) );
1218      tile_info.user_data = tmap->user_data;
1278   /* iterate over rows */
1279   for (ty = 0; ty < height; ty++)
1280   {
1281      UINT16 *pixptr = BITMAP_ADDR16(pixmap, y0, x0);
1282      UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
1283      int xoffs = 0;
12191284
1220      /* if the whole map is dirty, mark it as such */
1221      if (tmap->all_tiles_dirty)
1285      /* pre-advance to the next row */
1286      y0 += dy0;
1287
1288      /* 8bpp data */
1289      if (!(flags & TILE_4BPP))
12221290      {
1223         memset( tmap->transparency_data, TILE_FLAG_DIRTY, tmap->num_tiles );
1224         tmap->all_tiles_dirty = 0;
1225      }
1291         for (tx = 0; tx < width; tx++)
1292         {
1293            UINT8 pen, map;
12261294
1227      /* priority_bitmap_pitch_row is tmap-specific */
1228      priority_bitmap_pitch_row = priority_bitmap_pitch_line*tmap->cached_tile_height;
1295            pen = *pendata++;
1296            map = penmap[pen];
1297            pixptr[xoffs] = palette_base + pen;
1298            flagsptr[xoffs] = map | category;
1299            andmask &= map;
1300            ormask |= map;
1301            xoffs += dx0;
12291302
1230      blit.screen_bitmap = dest;
1231      if( dest == NULL )
1232      {
1233         blit.draw_masked = (blitmask_t)pit;
1234         blit.draw_opaque = (blitopaque_t)pio;
1303            pen = *pendata++;
1304            map = penmap[pen];
1305            pixptr[xoffs] = palette_base + pen;
1306            flagsptr[xoffs] = map | category;
1307            andmask &= map;
1308            ormask |= map;
1309            xoffs += dx0;
1310         }
12351311      }
1312
1313      /* 4bpp data */
12361314      else
12371315      {
1238         blit.screen_bitmap_pitch_line = dest->rowpixels;
1239         switch( dest->format )
1316         for (tx = 0; tx < width; tx++)
12401317         {
1241         case BITMAP_FORMAT_RGB32:
1242            if (priority)
1243            {
1244               if( flags&TILEMAP_ALPHA )
1245               {
1246                  blit.draw_masked = (blitmask_t)pbt32;
1247                  blit.draw_opaque = (blitopaque_t)pbo32;
1248               }
1249               else
1250               {
1251                  blit.draw_masked = (blitmask_t)pdt32;
1252                  blit.draw_opaque = (blitopaque_t)pdo32;
1253               }
1254            }
1255            else
1256            {
1257               //* AAT APR2003: added 32-bit no-priority counterpart
1258               if( flags&TILEMAP_ALPHA )
1259               {
1260                  blit.draw_masked = (blitmask_t)npbt32;
1261                  blit.draw_opaque = (blitopaque_t)npbo32;
1262               }
1263               else
1264               {
1265                  blit.draw_masked = (blitmask_t)npdt32;
1266                  blit.draw_opaque = (blitopaque_t)npdo32;
1267               }
1268            }
1269            break;
1270         case BITMAP_FORMAT_RGB15:
1271            if( flags&TILEMAP_ALPHA )
1272            {
1273               blit.draw_masked = (blitmask_t)pbt15;
1274               blit.draw_opaque = (blitopaque_t)pbo15;
1275            }
1276            else
1277            {
1278               blit.draw_masked = (blitmask_t)pdt15;
1279               blit.draw_opaque = (blitopaque_t)pdo15;
1280            }
1281            break;
1282         case BITMAP_FORMAT_INDEXED16:
1283            if (tmap->palette_offset)
1284            {
1285               blit.draw_masked = (blitmask_t)pdt16pal;
1286               blit.draw_opaque = (blitopaque_t)pdo16pal;
1287            }
1288            else if (priority)
1289            {
1290               blit.draw_masked = (blitmask_t)pdt16;
1291               blit.draw_opaque = (blitopaque_t)pdo16;
1292            }
1293            else
1294            {
1295               blit.draw_masked = (blitmask_t)pdt16np;
1296               blit.draw_opaque = (blitopaque_t)pdo16np;
1297            }
1298            break;
1318            UINT8 data = *pendata++;
1319            UINT8 pen, map;
12991320
1300         default:
1301            fatalerror("tilemap_draw_primask: Invalid bitmap format");
1302            break;
1303         }
1304         blit.screen_bitmap_pitch_row = blit.screen_bitmap_pitch_line*tmap->cached_tile_height;
1305      } /* dest == bitmap */
1321            pen = data & 0x0f;
1322            map = penmap[pen];
1323            pixptr[xoffs] = palette_base + pen;
1324            flagsptr[xoffs] = map | category;
1325            andmask &= map;
1326            ormask |= map;
1327            xoffs += dx0;
13061328
1307      if( !(tmap->type==TILEMAP_TYPE_OPAQUE || (flags&TILEMAP_IGNORE_TRANSPARENCY)) )
1308      {
1309         if( flags&TILEMAP_BACK )
1310         {
1311            mask   |= TILE_FLAG_BG_OPAQUE;
1312            value   |= TILE_FLAG_BG_OPAQUE;
1329            pen = data >> 4;
1330            map = penmap[pen];
1331            pixptr[xoffs] = palette_base + pen;
1332            flagsptr[xoffs] = map | category;
1333            andmask &= map;
1334            ormask |= map;
1335            xoffs += dx0;
13131336         }
1314         else
1315         {
1316            mask   |= TILE_FLAG_FG_OPAQUE;
1317            value   |= TILE_FLAG_FG_OPAQUE;
1318         }
13191337      }
1338   }
1339   return andmask ^ ormask;
1340}
13201341
1321      blit.tilemap_priority_code = (priority & 0xff) | ((priority_mask & 0xff) << 8) | (tmap->palette_offset << 16);
13221342
1323      if( rows == 1 && cols == 1 )
1324      { /* XY scrolling playfield */
1325         int scrollx = rowscroll[0];
1326         int scrolly = colscroll[0];
1343/*-------------------------------------------------
1344    tile_draw_colortable - draw a single tile to
1345    the tilemap's internal pixmap, using the pen
1346    as the pen_to_flags lookup value, and using
1347    the machine's remapped_colortable
1348-------------------------------------------------*/
13271349
1328         if( scrollx < 0 )
1329         {
1330            scrollx = tmap->cached_width - (-scrollx) % tmap->cached_width;
1331         }
1332         else
1333         {
1334            scrollx = scrollx % tmap->cached_width;
1335         }
1350static UINT8 tile_draw_colortable(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags)
1351{
1352   const UINT8 *penmap = tmap->pen_to_flags + group * tmap->max_pen_to_flags;
1353   const pen_t *palette_lookup = Machine->remapped_colortable + palette_base;
1354   mame_bitmap *flagsmap = tmap->flagsmap;
1355   mame_bitmap *pixmap = tmap->pixmap;
1356   int height = tmap->tileheight;
1357   int width = tmap->tilewidth;
1358   UINT8 andmask = ~0, ormask = 0;
1359   int dx0 = 1, dy0 = 1;
1360   int tx, ty;
13361361
1337         if( scrolly < 0 )
1338         {
1339            scrolly = tmap->cached_height - (-scrolly) % tmap->cached_height;
1340         }
1341         else
1342         {
1343            scrolly = scrolly % tmap->cached_height;
1344         }
1362   /* OR in the force layer flags */
1363   category |= flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2);
13451364
1346          blit.clip_left      = left;
1347          blit.clip_top      = top;
1348          blit.clip_right      = right;
1349          blit.clip_bottom   = bottom;
1365   /* if we're vertically flipped, point to the bottom row and work backwards */
1366   if (flags & TILE_FLIPY)
1367   {
1368      y0 += height - 1;
1369      dy0 = -1;
1370   }
13501371
1351         for(
1352            ypos = scrolly - tmap->cached_height;
1353            ypos < blit.clip_bottom;
1354            ypos += tmap->cached_height )
1355         {
1356            for(
1357               xpos = scrollx - tmap->cached_width;
1358               xpos < blit.clip_right;
1359               xpos += tmap->cached_width )
1360            {
1361               drawfunc( tmap, xpos, ypos, mask, value );
1362            }
1363         }
1364      }
1365      else if( rows == 1 )
1366      { /* scrolling columns + horizontal scroll */
1367         int col = 0;
1368         int colwidth = tmap->cached_width / cols;
1369         int scrollx = rowscroll[0];
1372   /* if we're horizontally flipped, point to the rightmost column and work backwards */
1373   if (flags & TILE_FLIPX)
1374   {
1375      x0 += width - 1;
1376      dx0 = -1;
1377   }
13701378
1371         if( scrollx < 0 )
1372         {
1373            scrollx = tmap->cached_width - (-scrollx) % tmap->cached_width;
1374         }
1375         else
1376         {
1377            scrollx = scrollx % tmap->cached_width;
1378         }
1379   /* we draw in groups of 2 pixels, so halve the width now */
1380   width /= 2;
13791381
1380         blit.clip_top      = top;
1381         blit.clip_bottom   = bottom;
1382   /* iterate over rows */
1383   for (ty = 0; ty < height; ty++)
1384   {
1385      UINT16 *pixptr = BITMAP_ADDR16(pixmap, y0, x0);
1386      UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
1387      int xoffs = 0;
13821388
1383         while( col < cols )
1389      /* pre-advance to the next row */
1390      y0 += dy0;
1391
1392      /* 8bpp data */
1393      if (!(flags & TILE_4BPP))
1394      {
1395         for (tx = 0; tx < width; tx++)
13841396         {
1385            int cons   = 1;
1386            int scrolly   = colscroll[col];
1397            pen_t pen;
1398            UINT8 map;
13871399
1388             /* count consecutive columns scrolled by the same amount */
1389            if( scrolly != TILE_LINE_DISABLED )
1390            {
1391               while( col + cons < cols &&   colscroll[col + cons] == scrolly ) cons++;
1400            pen = *pendata++;
1401            map = penmap[pen];
1402            pixptr[xoffs] = palette_lookup[pen];
1403            flagsptr[xoffs] = map | category;
1404            andmask &= map;
1405            ormask |= map;
1406            xoffs += dx0;
13921407
1393               if( scrolly < 0 )
1394               {
1395                  scrolly = tmap->cached_height - (-scrolly) % tmap->cached_height;
1396               }
1397               else
1398               {
1399                  scrolly %= tmap->cached_height;
1400               }
1408            pen = *pendata++;
1409            map = penmap[pen];
1410            pixptr[xoffs] = palette_lookup[pen];
1411            flagsptr[xoffs] = map | category;
1412            andmask &= map;
1413            ormask |= map;
1414            xoffs += dx0;
1415         }
1416      }
14011417
1402               blit.clip_left = col * colwidth + scrollx;
1403               if (blit.clip_left < left) blit.clip_left = left;
1404               blit.clip_right = (col + cons) * colwidth + scrollx;
1405               if (blit.clip_right > right) blit.clip_right = right;
1418      /* 4bpp data */
1419      else
1420      {
1421         for (tx = 0; tx < width; tx++)
1422         {
1423            UINT8 data = *pendata++;
1424            pen_t pen;
1425            UINT8 map;
14061426
1407               for(
1408                  ypos = scrolly - tmap->cached_height;
1409                  ypos < blit.clip_bottom;
1410                  ypos += tmap->cached_height )
1411               {
1412                  drawfunc( tmap, scrollx, ypos, mask, value );
1413               }
1427            pen = data & 0x0f;
1428            map = penmap[pen];
1429            pixptr[xoffs] = palette_lookup[pen];
1430            flagsptr[xoffs] = map | category;
1431            andmask &= map;
1432            ormask |= map;
1433            xoffs += dx0;
14141434
1415               blit.clip_left = col * colwidth + scrollx - tmap->cached_width;
1416               if (blit.clip_left < left) blit.clip_left = left;
1417               blit.clip_right = (col + cons) * colwidth + scrollx - tmap->cached_width;
1418               if (blit.clip_right > right) blit.clip_right = right;
1419
1420               for(
1421                  ypos = scrolly - tmap->cached_height;
1422                  ypos < blit.clip_bottom;
1423                  ypos += tmap->cached_height )
1424               {
1425                  drawfunc( tmap, scrollx - tmap->cached_width, ypos, mask, value );
1426               }
1427            }
1428            col += cons;
1435            pen = data >> 4;
1436            map = penmap[pen];
1437            pixptr[xoffs] = palette_lookup[pen];
1438            flagsptr[xoffs] = map | category;
1439            andmask &= map;
1440            ormask |= map;
1441            xoffs += dx0;
14291442         }
14301443      }
1431      else if( cols == 1 )
1432      { /* scrolling rows + vertical scroll */
1433         int row = 0;
1434         int rowheight = tmap->cached_height / rows;
1435         int scrolly = colscroll[0];
1436         if( scrolly < 0 )
1437         {
1438            scrolly = tmap->cached_height - (-scrolly) % tmap->cached_height;
1439         }
1440         else
1441         {
1442            scrolly = scrolly % tmap->cached_height;
1443         }
1444         blit.clip_left = left;
1445         blit.clip_right = right;
1446         while( row < rows )
1447         {
1448            int cons = 1;
1449            int scrollx = rowscroll[row];
1450            /* count consecutive rows scrolled by the same amount */
1451            if( scrollx != TILE_LINE_DISABLED )
1452            {
1453               while( row + cons < rows &&   rowscroll[row + cons] == scrollx ) cons++;
1454               if( scrollx < 0)
1455               {
1456                  scrollx = tmap->cached_width - (-scrollx) % tmap->cached_width;
1457               }
1458               else
1459               {
1460                  scrollx %= tmap->cached_width;
1461               }
1462               blit.clip_top = row * rowheight + scrolly;
1463               if (blit.clip_top < top) blit.clip_top = top;
1464               blit.clip_bottom = (row + cons) * rowheight + scrolly;
1465               if (blit.clip_bottom > bottom) blit.clip_bottom = bottom;
1466               for(
1467                  xpos = scrollx - tmap->cached_width;
1468                  xpos < blit.clip_right;
1469                  xpos += tmap->cached_width )
1470               {
1471                  drawfunc( tmap, xpos, scrolly, mask, value );
1472               }
1473               blit.clip_top = row * rowheight + scrolly - tmap->cached_height;
1474               if (blit.clip_top < top) blit.clip_top = top;
1475               blit.clip_bottom = (row + cons) * rowheight + scrolly - tmap->cached_height;
1476               if (blit.clip_bottom > bottom) blit.clip_bottom = bottom;
1477               for(
1478                  xpos = scrollx - tmap->cached_width;
1479                  xpos < blit.clip_right;
1480                  xpos += tmap->cached_width )
1481               {
1482                  drawfunc( tmap, xpos, scrolly - tmap->cached_height, mask, value );
1483               }
1484            }
1485            row += cons;
1486         }
1487      }
14881444   }
1489profiler_mark(PROFILER_END);
1445   return andmask ^ ormask;
14901446}
14911447
1492/* notes:
1493   - startx and starty MUST be UINT32 for calculations to work correctly
1494   - srcbitmap->width and height are assumed to be a power of 2 to speed up wraparound
1495   */
1496void tilemap_draw_roz( mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap,
1497      UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,
1498      int wraparound,
1499      UINT32 flags, UINT32 priority )
1500{
1501   tilemap_draw_roz_primask( dest,cliprect,tmap,startx,starty,incxx,incxy,incyx,incyy,wraparound,flags,priority, 0xff );
1502}
15031448
1504void tilemap_draw_roz_primask( mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap,
1505      UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,
1506      int wraparound,
1507      UINT32 flags, UINT32 priority, UINT32 priority_mask )
1449/*-------------------------------------------------
1450    tile_draw_colortrans - draw a single tile to
1451    the tilemap's internal pixmap, using the
1452    remapped pen as the pen_to_flags lookup value
1453-------------------------------------------------*/
1454
1455static UINT8 tile_draw_colortrans(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags)
15081456{
1509   if( (incxx == 1<<16) && !incxy & !incyx && (incyy == 1<<16) && wraparound )
1457   const UINT8 *penmap = tmap->pen_to_flags + group * tmap->max_pen_to_flags;
1458   const pen_t *palette_lookup = Machine->remapped_colortable + palette_base;
1459   mame_bitmap *flagsmap = tmap->flagsmap;
1460   mame_bitmap *pixmap = tmap->pixmap;
1461   int height = tmap->tileheight;
1462   int width = tmap->tilewidth;
1463   UINT8 andmask = ~0, ormask = 0;
1464   int dx0 = 1, dy0 = 1;
1465   int tx, ty;
1466
1467   /* OR in the force layer flags */
1468   category |= flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2);
1469
1470   /* if we're vertically flipped, point to the bottom row and work backwards */
1471   if (flags & TILE_FLIPY)
15101472   {
1511      tilemap_set_scrollx( tmap, 0, startx >> 16 );
1512      tilemap_set_scrolly( tmap, 0, starty >> 16 );
1513      tilemap_draw( dest, cliprect, tmap, flags, priority );
1473      y0 += height - 1;
1474      dy0 = -1;
15141475   }
1515   else
1476
1477   /* if we're horizontally flipped, point to the rightmost column and work backwards */
1478   if (flags & TILE_FLIPX)
15161479   {
1517      int mask,value;
1480      x0 += width - 1;
1481      dx0 = -1;
1482   }
15181483
1519profiler_mark(PROFILER_TILEMAP_DRAW_ROZ);
1520      if( tmap->enable )
1521      {
1522         /* tile priority */
1523         mask      = TILE_FLAG_TILE_PRIORITY;
1524         value      = TILE_FLAG_TILE_PRIORITY&flags;
1484   /* we draw in groups of 2 pixels, so halve the width now */
1485   width /= 2;
15251486
1526         tilemap_get_pixmap( tmap ); /* force update */
1487   /* iterate over rows */
1488   for (ty = 0; ty < height; ty++)
1489   {
1490      UINT16 *pixptr = BITMAP_ADDR16(pixmap, y0, x0);
1491      UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
1492      int xoffs = 0;
15271493
1528         if( !(tmap->type==TILEMAP_TYPE_OPAQUE || (flags&TILEMAP_IGNORE_TRANSPARENCY)) )
1529         {
1530            if( flags&TILEMAP_BACK )
1531            {
1532               mask   |= TILE_FLAG_BG_OPAQUE;
1533               value   |= TILE_FLAG_BG_OPAQUE;
1534            }
1535            else
1536            {
1537               mask   |= TILE_FLAG_FG_OPAQUE;
1538               value   |= TILE_FLAG_FG_OPAQUE;
1539            }
1540         }
1494      /* pre-advance to the next row */
1495      y0 += dy0;
15411496
1542         switch( dest->format )
1497      /* 8bpp data */
1498      if (!(flags & TILE_4BPP))
1499      {
1500         for (tx = 0; tx < width; tx++)
15431501         {
1544         case BITMAP_FORMAT_RGB32:
1502            pen_t pen;
1503            UINT8 map;
15451504
1546            /* Opaque drawing routines not present due to difficulty with
1547                optimization using current ROZ methods
1548                */
1549            if (priority)
1550            {
1551               if( flags&TILEMAP_ALPHA )
1552                  blit.draw_masked = (blitmask_t)pbt32;
1553               else
1554                  blit.draw_masked = (blitmask_t)pdt32;
1555            }
1556            else
1557            {
1558               if( flags&TILEMAP_ALPHA )
1559                  blit.draw_masked = (blitmask_t)npbt32;
1560               else
1561                  blit.draw_masked = (blitmask_t)npdt32;
1562            }
1505            pen = palette_lookup[*pendata++];
1506            map = penmap[pen];
1507            pixptr[xoffs] = pen;
1508            flagsptr[xoffs] = map | category;
1509            andmask &= map;
1510            ormask |= map;
1511            xoffs += dx0;
15631512
1564            copyroz_core32BPP(dest,tmap,startx,starty,incxx,incxy,incyx,incyy,
1565               wraparound,cliprect,mask,value,priority,priority_mask,tmap->palette_offset);
1566            break;
1513            pen = palette_lookup[*pendata++];
1514            map = penmap[pen];
1515            pixptr[xoffs] = pen;
1516            flagsptr[xoffs] = map | category;
1517            andmask &= map;
1518            ormask |= map;
1519            xoffs += dx0;
1520         }
1521      }
15671522
1568         case BITMAP_FORMAT_RGB15:
1569            if( flags&TILEMAP_ALPHA )
1570               blit.draw_masked = (blitmask_t)pbt15;
1571            else
1572               blit.draw_masked = (blitmask_t)pdt15;
1523      /* 4bpp data */
1524      else
1525      {
1526         for (tx = 0; tx < width; tx++)
1527         {
1528            UINT8 data = *pendata++;
1529            pen_t pen;
1530            UINT8 map;
15731531
1574            copyroz_core16BPP(dest,tmap,startx,starty,incxx,incxy,incyx,incyy,
1575               wraparound,cliprect,mask,value,priority,priority_mask,tmap->palette_offset);
1576            break;
1532            pen = palette_lookup[data & 0x0f];
1533            map = penmap[pen];
1534            pixptr[xoffs] = pen;
1535            flagsptr[xoffs] = map | category;
1536            andmask &= map;
1537            ormask |= map;
1538            xoffs += dx0;
15771539
1578         case BITMAP_FORMAT_INDEXED16:
1579            if (tmap->palette_offset)
1580               blit.draw_masked = (blitmask_t)pdt16pal;
1581            else if (priority)
1582               blit.draw_masked = (blitmask_t)pdt16;
1583            else
1584               blit.draw_masked = (blitmask_t)pdt16np;
1585
1586            copyroz_core16BPP(dest,tmap,startx,starty,incxx,incxy,incyx,incyy,
1587               wraparound,cliprect,mask,value,priority,priority_mask,tmap->palette_offset);
1588            break;
1589
1590         default:
1591            fatalerror("tilemap_draw_roz: Invalid bitmap format\n");
1592            break;
1540            pen = palette_lookup[data >> 4];
1541            map = penmap[pen];
1542            pixptr[xoffs] = pen;
1543            flagsptr[xoffs] = map | category;
1544            andmask &= map;
1545            ormask |= map;
1546            xoffs += dx0;
15931547         }
1594      } /* tmap->enable */
1595profiler_mark(PROFILER_END);
1548      }
15961549   }
1550   return andmask ^ ormask;
15971551}
15981552
1599UINT32 tilemap_count( void )
1553
1554/*-------------------------------------------------
1555    tile_apply_bitmask - apply a bitmask to an
1556    already-rendered tile by modifying the
1557    flagsmap appropriately
1558-------------------------------------------------*/
1559
1560static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags)
16001561{
1601   UINT32 count = 0;
1602   tilemap *tmap = first_tilemap;
1603   while( tmap )
1562   mame_bitmap *flagsmap = tmap->flagsmap;
1563   int height = tmap->tileheight;
1564   int width = tmap->tilewidth;
1565   UINT8 andmask = ~0, ormask = 0;
1566   int dx0 = 1, dy0 = 1;
1567   int bitoffs = 0;
1568   int tx, ty;
1569
1570   /* if we're vertically flipped, point to the bottom row and work backwards */
1571   if (flags & TILE_FLIPY)
16041572   {
1605      count++;
1606      tmap = tmap->next;
1573      y0 += height - 1;
1574      dy0 = -1;
16071575   }
1608   return count;
1609}
16101576
1611static tilemap *tilemap_nb_find( int number )
1612{
1613   int count = 0;
1614   tilemap *tmap;
1615
1616   tmap = first_tilemap;
1617   while( tmap )
1577   /* if we're horizontally flipped, point to the rightmost column and work backwards */
1578   if (flags & TILE_FLIPX)
16181579   {
1619      count++;
1620      tmap = tmap->next;
1580      x0 += width - 1;
1581      dx0 = -1;
16211582   }
16221583
1623   number = (count-1)-number;
1624
1625   tmap = first_tilemap;
1626   while( number-- )
1584   /* iterate over rows */
1585   for (ty = 0; ty < height; ty++)
16271586   {
1628      tmap = tmap->next;
1587      UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
1588      int xoffs = 0;
1589
1590      /* pre-advance to the next row */
1591      y0 += dy0;
1592
1593      /* anywhere the bitmask is 0 should be transparent */
1594      for (tx = 0; tx < width; tx++)
1595      {
1596         UINT8 map = flagsptr[xoffs];
1597
1598         if ((maskdata[bitoffs / 8] & (0x80 >> (bitoffs & 7))) == 0)
1599            map = flagsptr[xoffs] = TILEMAP_PIXEL_TRANSPARENT | category;
1600         andmask &= map;
1601         ormask |= map;
1602         xoffs += dx0;
1603         bitoffs++;
1604      }
16291605   }
1630   return tmap;
1606   return andmask ^ ormask;
16311607}
16321608
1633void tilemap_nb_size( UINT32 number, UINT32 *width, UINT32 *height )
1634{
1635   tilemap *tmap = tilemap_nb_find( number );
1636   *width  = tmap->cached_width;
1637   *height = tmap->cached_height;
1638}
16391609
1640void tilemap_nb_draw( mame_bitmap *dest, UINT32 number, UINT32 scrollx, UINT32 scrolly )
1641{
1642   tilemap_draw_func drawfunc = pick_draw_func(dest);
1643   int xpos,ypos;
1644   tilemap *tmap = tilemap_nb_find( number );
16451610
1646   blit.screen_bitmap = dest;
1647   blit.screen_bitmap_pitch_line = dest->rowpixels;
1648   switch( dest->format )
1649   {
1650   case BITMAP_FORMAT_RGB32:
1651   case BITMAP_FORMAT_ARGB32:
1652      blit.draw_opaque = (blitopaque_t)pdo32np;
1653      break;
1611/***************************************************************************
1612    DRAWING HELPERS
1613***************************************************************************/
16541614
1655   case BITMAP_FORMAT_RGB15:
1656      blit.draw_opaque = (blitopaque_t)pdo15np;
1657      break;
1615/*-------------------------------------------------
1616    configure_blit_parameters - fill in the
1617    standard blit parameters based on the input
1618    data; this code is shared by normal, roz,
1619    and indexed drawing code
1620-------------------------------------------------*/
16581621
1659   case BITMAP_FORMAT_INDEXED16:
1660      blit.draw_opaque = (blitopaque_t)pdo16palnp;
1661      break;
1622static void configure_blit_parameters(blit_parameters *blit, tilemap *tmap, mame_bitmap *dest, const rectangle *cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask)
1623{
1624   /* start with nothing */
1625   memset(blit, 0, sizeof(*blit));
16621626
1663   default:
1664      fatalerror("tilemap_nb_draw: Invalid bitmap format");
1665      break;
1627   /* set the target bitmap */
1628   blit->bitmap = dest;
1629
1630   /* if we have a cliprect, copy */
1631   if (cliprect != NULL)
1632      blit->cliprect = *cliprect;
1633
1634   /* otherwise, make one up */
1635   else
1636   {
1637      blit->cliprect.min_x = blit->cliprect.min_y = 0;
1638      blit->cliprect.max_x = dest->width - 1;
1639      blit->cliprect.max_y = dest->height - 1;
16661640   }
1667   priority_bitmap_pitch_row = priority_bitmap_pitch_line*tmap->cached_tile_height;
1668   blit.screen_bitmap_pitch_row = blit.screen_bitmap_pitch_line*tmap->cached_tile_height;
1669   blit.tilemap_priority_code = (tmap->palette_offset << 16);
1670   scrollx = tmap->cached_width  - scrollx % tmap->cached_width;
1671   scrolly = tmap->cached_height - scrolly % tmap->cached_height;
16721641
1673   blit.clip_left      = 0;
1674   blit.clip_top      = 0;
1675   blit.clip_right      = (dest->width < tmap->cached_width) ? dest->width : tmap->cached_width;
1676   blit.clip_bottom   = (dest->height < tmap->cached_height) ? dest->height : tmap->cached_height;
1642   /* set the priority code */
1643   blit->tilemap_priority_code = priority | (priority_mask << 8) | (tmap->palette_offset << 16);
16771644
1678   for(
1679      ypos = scrolly - tmap->cached_height;
1680      ypos < blit.clip_bottom;
1681      ypos += tmap->cached_height )
1645   /* if no destination, just render priority */
1646   if (dest == NULL)
16821647   {
1683      for(
1684         xpos = scrollx - tmap->cached_width;
1685         xpos < blit.clip_right;
1686         xpos += tmap->cached_width )
1648      blit->draw_masked = scanline_draw_masked_null;
1649      blit->draw_opaque = scanline_draw_opaque_null;
1650   }
1651
1652   /* otherwise get the appropriate callbacks for the format and flags */
1653   else
1654   {
1655      switch (dest->format)
16871656      {
1688         drawfunc( tmap, xpos, ypos, 0, 0 );
1657         case BITMAP_FORMAT_RGB32:
1658            blit->draw_masked = (flags & TILEMAP_DRAW_ALPHA) ? scanline_draw_masked_rgb32_alpha : scanline_draw_masked_rgb32;
1659            blit->draw_opaque = (flags & TILEMAP_DRAW_ALPHA) ? scanline_draw_opaque_rgb32_alpha : scanline_draw_opaque_rgb32;
1660            break;
1661
1662         case BITMAP_FORMAT_RGB15:
1663            blit->draw_masked = (flags & TILEMAP_DRAW_ALPHA) ? scanline_draw_masked_rgb16_alpha : scanline_draw_masked_rgb16;
1664            blit->draw_opaque = (flags & TILEMAP_DRAW_ALPHA) ? scanline_draw_opaque_rgb16_alpha : scanline_draw_opaque_rgb16;
1665            break;
1666
1667         case BITMAP_FORMAT_INDEXED16:
1668            blit->draw_masked = scanline_draw_masked_ind16;
1669            blit->draw_opaque = scanline_draw_opaque_ind16;
1670            break;
1671
1672         default:
1673            fatalerror("tilemap_draw_primask: Invalid bitmap format");
1674            break;
16891675      }
16901676   }
1691}
16921677
1678   /* tile priority; unless otherwise specified, draw anything in layer 0 */
1679   blit->mask = TILEMAP_PIXEL_CATEGORY_MASK;
1680   blit->value   = flags & TILEMAP_PIXEL_CATEGORY_MASK;
16931681
1694/***********************************************************************************/
1682   /* if no layers specified, draw layer 0 */
1683   if ((flags & (TILEMAP_DRAW_LAYER0 | TILEMAP_DRAW_LAYER1 | TILEMAP_DRAW_LAYER2)) == 0)
1684      flags |= TILEMAP_DRAW_LAYER0;
16951685
1696#endif // !DECLARE && !TRANSP
1686   /* OR in the bits from the draw masks */
1687   blit->mask |= flags & (TILEMAP_DRAW_LAYER0 | TILEMAP_DRAW_LAYER1 | TILEMAP_DRAW_LAYER2);
1688   blit->value |= flags & (TILEMAP_DRAW_LAYER0 | TILEMAP_DRAW_LAYER1 | TILEMAP_DRAW_LAYER2);
16971689
1698#define ROZ_PLOT_PIXEL(INPUT_VAL)                              \
1699   if (blit.draw_masked == (blitmask_t)pbt32)                     \
1700   {                                                   \
1701      clut = &Machine->remapped_colortable[priority >> 16] ;         \
1702      *dest = alpha_blend32(*dest, clut[INPUT_VAL]);               \
1703      *pri = (*pri & priority_mask) | priority;                  \
1704   }                                                   \
1705   else if (blit.draw_masked == (blitmask_t)pdt32)                  \
1706   {                                                   \
1707      clut = &Machine->remapped_colortable[priority >> 16] ;         \
1708      *dest = clut[INPUT_VAL] ;                              \
1709      *pri = (*pri & priority_mask) | priority;                  \
1710   }                                                   \
1711   else if (blit.draw_masked == (blitmask_t)npbt32)               \
1712   {                                                   \
1713      clut = &Machine->remapped_colortable[priority >> 16] ;         \
1714      *dest = alpha_blend32(*dest, clut[INPUT_VAL]) ;               \
1715/*      logerror("PARTIALLY IMPLEMENTED ROZ VIDEO MODE - npbt32\n") ;*/   \
1716   }                                                   \
1717   else if (blit.draw_masked == (blitmask_t)npdt32)               \
1718   {                                                   \
1719      clut = &Machine->remapped_colortable[priority >> 16] ;         \
1720      *dest = clut[INPUT_VAL] ;                              \
1721/*      logerror("PARTIALLY IMPLEMENTED ROZ VIDEO MODE - npbt32\n") ;*/   \
1722   }                                                   \
1723   else if (blit.draw_masked == (blitmask_t)pbt15)                  \
1724   {                                                   \
1725      clut = &Machine->remapped_colortable[priority >> 16] ;         \
1726      *dest = alpha_blend16(*dest, clut[INPUT_VAL]) ;               \
1727      *pri = (*pri & priority_mask) | priority;                  \
1728   }                                                   \
1729   else if (blit.draw_masked == (blitmask_t)pdt15)                  \
1730   {                                                   \
1731      clut = &Machine->remapped_colortable[priority >> 16] ;         \
1732      *dest = clut[INPUT_VAL] ;                              \
1733      *pri = (*pri & priority_mask) | priority;                  \
1734   }                                                   \
1735   else if (blit.draw_masked == (blitmask_t)pdt16pal)               \
1736   {                                                   \
1737      *dest = (INPUT_VAL) + (priority >> 16) ;                  \
1738      *pri = (*pri & priority_mask) | priority;                  \
1739   }                                                   \
1740   else if (blit.draw_masked == (blitmask_t)pdt16)                  \
1741   {                                                   \
1742      *dest = INPUT_VAL ;                                    \
1743      *pri = (*pri & priority_mask) | priority;                  \
1744   }                                                   \
1745   else if (blit.draw_masked == (blitmask_t)pdt16np)               \
1746   {                                                   \
1747      *dest = INPUT_VAL ;                                    \
1690   /* for all-opaque rendering, don't check any of the layer bits */
1691   if (flags & TILEMAP_DRAW_OPAQUE)
1692   {
1693      blit->mask &= ~(TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1 | TILEMAP_PIXEL_LAYER2);
1694      blit->value &= ~(TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1 | TILEMAP_PIXEL_LAYER2);
17481695   }
1696}
17491697
1750#ifdef DECLARE
17511698
1752DECLARE(copyroz_core,(mame_bitmap *bitmap,tilemap *tmap,
1753      UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,int wraparound,
1754      const rectangle *clip,
1755      int mask,int value,
1756      UINT32 priority,UINT32 priority_mask,UINT32 palette_offset),
1699/*-------------------------------------------------
1700    tilemap_draw_instance - draw a single
1701    instance of the tilemap to the internal
1702    pixmap at the given xpos,ypos
1703-------------------------------------------------*/
1704
1705static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, int xpos, int ypos)
17571706{
1758   UINT32 cx;
1759   UINT32 cy;
1760   int x;
1761   int sx;
1762   int sy;
1763   int ex;
1764   int ey;
1765   mame_bitmap *srcbitmap = tmap->pixmap;
1766   mame_bitmap *transparency_bitmap = tmap->transparency_bitmap;
1767   const int xmask = srcbitmap->width-1;
1768   const int ymask = srcbitmap->height-1;
1769   const int widthshifted = srcbitmap->width << 16;
1770   const int heightshifted = srcbitmap->height << 16;
1771   DATA_TYPE *dest;
1772   UINT8 *pri;
1773   const UINT16 *src;
1774   const UINT8 *pMask;
1707   mame_bitmap *dest = blit->bitmap;
1708   const UINT16 *source_baseaddr;
1709   const UINT8 *mask_baseaddr;
1710   void *dest_baseaddr = NULL;
1711   UINT8 *priority_baseaddr;
1712   int dest_line_pitch_bytes = 0;
1713   int dest_bytespp = 0;
1714   int mincol, maxcol;
1715   int x1, y1, x2, y2;
1716   int y, nexty;
17751717
1776   pen_t *clut ;
1718   /* clip destination coordinates to the tilemap */
1719   /* note that x2/y2 are exclusive, not inclusive */
1720   x1 = MAX(xpos, blit->cliprect.min_x);
1721   x2 = MIN(xpos + (int)tmap->width, blit->cliprect.max_x + 1);
1722   y1 = MAX(ypos, blit->cliprect.min_y);
1723   y2 = MIN(ypos + (int)tmap->height, blit->cliprect.max_y + 1);
17771724
1778   if (clip)
1779   {
1780      startx += clip->min_x * incxx + clip->min_y * incyx;
1781      starty += clip->min_x * incxy + clip->min_y * incyy;
1725   /* if totally clipped, stop here */
1726   if (x1 >= x2 || y1 >= y2)
1727      return;
17821728
1783      sx = clip->min_x;
1784      sy = clip->min_y;
1785      ex = clip->max_x;
1786      ey = clip->max_y;
1787   }
1788   else
1729   /* look up priority and destination base addresses for y1 */
1730   priority_baseaddr = BITMAP_ADDR8(priority_bitmap, y1, xpos);
1731   if (dest != NULL)
17891732   {
1790      sx = 0;
1791      sy = 0;
1792      ex = bitmap->width-1;
1793      ey = bitmap->height-1;
1733      dest_bytespp = dest->bpp / 8;
1734      dest_line_pitch_bytes = dest->rowpixels * dest_bytespp;
1735      dest_baseaddr = (UINT8 *)dest->base + (y1 * dest->rowpixels + xpos) * dest_bytespp;
17941736   }
17951737
1738   /* convert screen coordinates to source tilemap coordinates */
1739   x1 -= xpos;
1740   y1 -= ypos;
1741   x2 -= xpos;
1742   y2 -= ypos;
17961743
1797   if (incxy == 0 && incyx == 0 && !wraparound)
1744   /* get tilemap pixels */
1745   source_baseaddr = BITMAP_ADDR16(tmap->pixmap, y1, 0);
1746   mask_baseaddr = BITMAP_ADDR8(tmap->flagsmap, y1, 0);
1747
1748   /* get start/stop columns, rounding outward */
1749   mincol = x1 / tmap->tilewidth;
1750   maxcol = (x2 + tmap->tilewidth - 1) / tmap->tilewidth;
1751
1752   /* set up row counter */
1753   y = y1;
1754   nexty = tmap->tileheight * (y1 / tmap->tileheight) + tmap->tileheight;
1755   nexty = MIN(nexty, y2);
1756
1757   /* loop over tilemap rows */
1758   for (;;)
17981759   {
1799      /* optimized loop for the not rotated case */
1760      int row = y / tmap->tileheight;
1761      trans_t prev_trans = WHOLLY_TRANSPARENT;
1762      trans_t cur_trans;
1763      int x_start = x1;
1764      int column;
18001765
1801      if (incxx == 0x10000)
1766      /* iterate across the applicable tilemap columns */
1767      for (column = mincol; column <= maxcol; column++)
18021768      {
1803         /* optimized loop for the not zoomed case */
1769         int x_end;
18041770
1805         /* startx is unsigned */
1806         startx = ((INT32)startx) >> 16;
1771         /* we don't actually render the last column; it is always just used for flushing */
1772         if (column == maxcol)
1773            cur_trans = WHOLLY_TRANSPARENT;
18071774
1808         if (startx >= srcbitmap->width)
1775         /* for other columns we look up the transparency information */
1776         else
18091777         {
1810            sx += -startx;
1811            startx = 0;
1778            tilemap_logical_index logindex = row * tmap->cols + column;
1779
1780            /* if the current tile is dirty, fix it */
1781            if (tmap->tileflags[logindex] == TILE_FLAG_DIRTY)
1782               tile_update(tmap, logindex, column, row);
1783
1784            /* if the current summary data is non-zero, we must draw masked */
1785            if ((tmap->tileflags[logindex] & blit->mask) != 0)
1786               cur_trans = MASKED;
1787
1788            /* otherwise, our transparency state is constant across the tile; fetch it */
1789            else
1790               cur_trans = ((mask_baseaddr[column * tmap->tilewidth] & blit->mask) == blit->value) ? WHOLLY_OPAQUE : WHOLLY_TRANSPARENT;
18121791         }
18131792
1814         if (sx <= ex)
1793         /* if the transparency state is the same as last time, don't render yet */
1794         if (cur_trans == prev_trans)
1795            continue;
1796
1797         /* compute the end of this run, in pixels */
1798         x_end = column * tmap->tilewidth;
1799         x_end = MAX(x_end, x1);
1800         x_end = MIN(x_end, x2);
1801
1802         /* if we're rendering something, compute the pointers */
1803         if (prev_trans != WHOLLY_TRANSPARENT)
18151804         {
1816            while (sy <= ey)
1805            const UINT16 *source0 = source_baseaddr + x_start;
1806            void *dest0 = (UINT8 *)dest_baseaddr + x_start * dest_bytespp;
1807            UINT8 *pmap0 = priority_baseaddr + x_start;
1808            int cury;
1809
1810            /* if we were opaque, use the opaque renderer */
1811            if (prev_trans == WHOLLY_OPAQUE)
18171812            {
1818               if (starty < heightshifted)
1813               for (cury = y; cury < nexty; cury++)
18191814               {
1820                  x = sx;
1821                  cx = startx;
1822                  cy = starty >> 16;
1823                  dest = BITMAP_ADDR(bitmap, DATA_TYPE, sy, sx);
1815                  (*blit->draw_opaque)(dest0, source0, x_end - x_start, pmap0, blit->tilemap_priority_code);
18241816
1825                  pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
1826                  src = BITMAP_ADDR16(srcbitmap, cy, 0);
1827                  pMask = BITMAP_ADDR8(transparency_bitmap, cy, 0);
1828
1829                  while (x <= ex && cx < srcbitmap->width)
1830                  {
1831                     if ( (pMask[cx]&mask) == value )
1832                     {
1833                        ROZ_PLOT_PIXEL((src[cx]+palette_offset)) ;
1834                     }
1835                     cx++;
1836                     x++;
1837                     dest++;
1838                     pri++;
1839                  }
1817                  dest0 = (UINT8 *)dest0 + dest_line_pitch_bytes;
1818                  source0 += tmap->pixmap->rowpixels;
1819                  pmap0 += priority_bitmap->rowpixels;
18401820               }
1841               starty += incyy;
1842               sy++;
18431821            }
1844         }
1845      }
1846      else
1847      {
1848         while (startx >= widthshifted && sx <= ex)
1849         {
1850            startx += incxx;
1851            sx++;
1852         }
18531822
1854         if (sx <= ex)
1855         {
1856            while (sy <= ey)
1823            /* otherwise use the masked renderer */
1824            else
18571825            {
1858               if (starty < heightshifted)
1826               const UINT8 *mask0 = mask_baseaddr + x_start;
1827               for (cury = y; cury < nexty; cury++)
18591828               {
1860                  x = sx;
1861                  cx = startx;
1862                  cy = starty >> 16;
1863                  dest = BITMAP_ADDR(bitmap, DATA_TYPE, sy, sx);
1829                  (*blit->draw_masked)(dest0, source0, mask0, blit->mask, blit->value, x_end - x_start, pmap0, blit->tilemap_priority_code);
18641830
1865                  pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
1866                  src = BITMAP_ADDR16(srcbitmap, cy, 0);
1867                  pMask = BITMAP_ADDR8(transparency_bitmap, cy, 0);
1868
1869                  while (x <= ex && cx < widthshifted)
1870                  {
1871                     if ( (pMask[cx>>16]&mask) == value )
1872                     {
1873                        ROZ_PLOT_PIXEL((src[cx >> 16]+palette_offset)) ;
1874                     }
1875                     cx += incxx;
1876                     x++;
1877                     dest++;
1878                     pri++;
1879                  }
1831                  dest0 = (UINT8 *)dest0 + dest_line_pitch_bytes;
1832                  source0 += tmap->pixmap->rowpixels;
1833                  mask0 += tmap->flagsmap->rowpixels;
1834                  pmap0 += priority_bitmap->rowpixels;
18801835               }
1881               starty += incyy;
1882               sy++;
18831836            }
18841837         }
1838
1839         /* the new start is the end */
1840         x_start = x_end;
1841         prev_trans = cur_trans;
18851842      }
1843
1844      /* if this was the last row, stop */
1845      if (nexty == y2)
1846         break;
1847
1848      /* advance to the next row on all our bitmaps */
1849      priority_baseaddr += priority_bitmap->rowpixels * (nexty - y);
1850      source_baseaddr += tmap->pixmap->rowpixels * (nexty - y);
1851      mask_baseaddr += tmap->flagsmap->rowpixels * (nexty - y);
1852      dest_baseaddr = (UINT8 *)dest_baseaddr + dest_line_pitch_bytes * (nexty - y);
1853
1854      /* increment the Y counter */
1855      y = nexty;
1856      nexty += tmap->tileheight;
1857      nexty = MIN(nexty, y2);
18861858   }
1887   else
1859}
1860
1861
1862/*-------------------------------------------------
1863    tilemap_draw_roz_core - render the tilemap's
1864    pixmap to the destination with rotation
1865    and zoom
1866-------------------------------------------------*/
1867
1868#define ROZ_PLOT_PIXEL(INPUT_VAL)                                 \
1869do {                                                      \
1870   if (blit->draw_masked == scanline_draw_masked_ind16)               \
1871      *(UINT16 *)dest = (INPUT_VAL) + (priority >> 16);               \
1872   else if (blit->draw_masked == scanline_draw_masked_rgb32)            \
1873      *(UINT32 *)dest = clut[INPUT_VAL];                           \
1874   else if (blit->draw_masked == scanline_draw_masked_rgb16)            \
1875      *(UINT16 *)dest = clut[INPUT_VAL];                           \
1876   else if (blit->draw_masked == scanline_draw_masked_rgb32_alpha)         \
1877      *(UINT32 *)dest = alpha_blend32(*(UINT32 *)dest, clut[INPUT_VAL]);   \
1878   else if (blit->draw_masked == scanline_draw_masked_rgb16_alpha)         \
1879      *(UINT16 *)dest = alpha_blend16(*(UINT16 *)dest, clut[INPUT_VAL]);   \
1880} while (0)
1881
1882static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
1883      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound)
1884{
1885   const pen_t *clut = &Machine->remapped_colortable[blit->tilemap_priority_code >> 16];
1886   mame_bitmap *destbitmap = blit->bitmap;
1887   mame_bitmap *srcbitmap = tmap->pixmap;
1888   mame_bitmap *flagsmap = tmap->flagsmap;
1889   const int xmask = srcbitmap->width-1;
1890   const int ymask = srcbitmap->height-1;
1891   const int widthshifted = srcbitmap->width << 16;
1892   const int heightshifted = srcbitmap->height << 16;
1893   UINT32 priority = blit->tilemap_priority_code;
1894   UINT8 mask = blit->mask;
1895   UINT8 value = blit->value;
1896   UINT32 cx;
1897   UINT32 cy;
1898   int x;
1899   int sx;
1900   int sy;
1901   int ex;
1902   int ey;
1903   void *dest;
1904   UINT8 *pri;
1905   const UINT16 *src;
1906   const UINT8 *maskptr;
1907   int destadvance = destbitmap->bpp / 8;
1908
1909   /* pre-advance based on the cliprect */
1910   startx += blit->cliprect.min_x * incxx + blit->cliprect.min_y * incyx;
1911   starty += blit->cliprect.min_x * incxy + blit->cliprect.min_y * incyy;
1912
1913   /* extract start/end points */
1914   sx = blit->cliprect.min_x;
1915   sy = blit->cliprect.min_y;
1916   ex = blit->cliprect.max_x;
1917   ey = blit->cliprect.max_y;
1918
1919   /* optimized loop for the not rotated case */
1920   if (incxy == 0 && incyx == 0 && !wraparound)
18881921   {
1889      if (wraparound)
1922      /* skip without drawing until we are within the bitmap */
1923      while (startx >= widthshifted && sx <= ex)
18901924      {
1891         /* plot with wraparound */
1892         while (sy <= ey)
1925         startx += incxx;
1926         sx++;
1927      }
1928
1929      /* early exit if we're done already */
1930      if (sx > ex)
1931         return;
1932
1933      /* loop over rows */
1934      while (sy <= ey)
1935      {
1936         /* only draw if Y is within range */
1937         if (starty < heightshifted)
18931938         {
1939            /* initialize X counters */
18941940            x = sx;
18951941            cx = startx;
1896            cy = starty;
1897            dest = BITMAP_ADDR(bitmap, DATA_TYPE, sy, sx);
1942            cy = starty >> 16;
1943
1944            /* get source and priority pointers */
18981945            pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
1899            while (x <= ex)
1946            src = BITMAP_ADDR16(srcbitmap, cy, 0);
1947            maskptr = BITMAP_ADDR8(flagsmap, cy, 0);
1948            dest = (UINT8 *)destbitmap->base + (destbitmap->rowpixels * sy + sx) * destadvance;
1949
1950            /* loop over columns */
1951            while (x <= ex && cx < widthshifted)
19001952            {
1901               if( (*BITMAP_ADDR8(transparency_bitmap, (cy>>16)&ymask, (cx>>16)&xmask) & mask) == value )
1953               /* plot if we match the mask */
1954               if ((maskptr[cx >> 16] & mask) == value)
19021955               {
1903                  ROZ_PLOT_PIXEL((*BITMAP_ADDR16(srcbitmap, (cy >> 16) & ymask, (cx >> 16) & xmask) + palette_offset));
1956                  ROZ_PLOT_PIXEL(src[cx >> 16]);
1957                  *pri = (*pri & (priority >> 8)) | priority;
19041958               }
1959
1960               /* advance in X */
19051961               cx += incxx;
1906               cy += incxy;
19071962               x++;
1908               dest++;
1963               dest = (UINT8 *)dest + destadvance;
19091964               pri++;
19101965            }
1911            startx += incyx;
1912            starty += incyy;
1913            sy++;
19141966         }
1967
1968         /* advance in Y */
1969         starty += incyy;
1970         sy++;
19151971      }
1916      else
1972   }
1973
1974   /* wraparound case */
1975   else if (wraparound)
1976   {
1977      /* loop over rows */
1978      while (sy <= ey)
19171979      {
1918         while (sy <= ey)
1980         /* initialize X counters */
1981         x = sx;
1982         cx = startx;
1983         cy = starty;
1984
1985         /* get dest and priority pointers */
1986         dest = (UINT8 *)destbitmap->base + (destbitmap->rowpixels * sy + sx) * destadvance;
1987         pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
1988
1989         /* loop over columns */
1990         while (x <= ex)
19191991         {
1920            x = sx;
1921            cx = startx;
1922            cy = starty;
1923            dest = BITMAP_ADDR(bitmap, DATA_TYPE, sy, sx);
1924            pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
1925            while (x <= ex)
1992            /* plot if we match the mask */
1993            if ((*BITMAP_ADDR8(flagsmap, (cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value)
19261994            {
1927               if (cx < widthshifted && cy < heightshifted)
1995               ROZ_PLOT_PIXEL(*BITMAP_ADDR16(srcbitmap, (cy >> 16) & ymask, (cx >> 16) & xmask));
1996               *pri = (*pri & (priority >> 8)) | priority;
1997            }
1998
1999            /* advance in X */
2000            cx += incxx;
2001            cy += incxy;
2002            x++;
2003            dest = (UINT8 *)dest + destadvance;
2004            pri++;
2005         }
2006
2007         /* advance in Y */
2008         startx += incyx;
2009         starty += incyy;
2010         sy++;
2011      }
2012   }
2013
2014   /* non-wraparound case */
2015   else
2016   {
2017      /* loop over rows */
2018      while (sy <= ey)
2019      {
2020         /* initialize X counters */
2021         x = sx;
2022         cx = startx;
2023         cy = starty;
2024
2025         /* get dest and priority pointers */
2026         dest = (UINT8 *)destbitmap->base + (destbitmap->rowpixels * sy + sx) * destadvance;
2027         pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
2028
2029         /* loop over columns */
2030         while (x <= ex)
2031         {
2032            /* plot if we're within the bitmap and we match the mask */
2033            if (cx < widthshifted && cy < heightshifted)
2034               if ((*BITMAP_ADDR8(flagsmap, cy >> 16, cx >> 16) & mask) == value)
19282035               {
1929                  if( (*BITMAP_ADDR8(transparency_bitmap, cy>>16, cx>>16) & mask)==value )
1930                  {
1931                     ROZ_PLOT_PIXEL((*BITMAP_ADDR16(srcbitmap, cy >> 16, cx >> 16) + palette_offset));
1932                  }
2036                  ROZ_PLOT_PIXEL(*BITMAP_ADDR16(srcbitmap, cy >> 16, cx >> 16));
2037                  *pri = (*pri & (priority >> 8)) | priority;
19332038               }
1934               cx += incxx;
1935               cy += incxy;
1936               x++;
1937               dest++;
1938               pri++;
1939            }
1940            startx += incyx;
1941            starty += incyy;
1942            sy++;
2039
2040            /* advance in X */
2041            cx += incxx;
2042            cy += incxy;
2043            x++;
2044            dest = (UINT8 *)dest + destadvance;
2045            pri++;
19432046         }
2047
2048         /* advance in Y */
2049         startx += incyx;
2050         starty += incyy;
2051         sy++;
19442052      }
19452053   }
1946})
2054}
19472055
1948#ifndef osd_pend
1949#define osd_pend() do { } while (0)
1950#endif
19512056
1952DECLARE( draw, (tilemap *tmap, int xpos, int ypos, int mask, int value ),
2057
2058/***************************************************************************
2059    SCANLINE RASTERIZERS
2060***************************************************************************/
2061
2062/*-------------------------------------------------
2063    scanline_draw_opaque_null - draw to a NULL
2064    bitmap, setting priority only
2065-------------------------------------------------*/
2066
2067static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
19532068{
1954   trans_t transPrev;
1955   trans_t transCur;
1956   const UINT8 *pTrans;
1957   UINT32 cached_indx;
1958   mame_bitmap *screen = blit.screen_bitmap;
1959   int tilemap_priority_code = blit.tilemap_priority_code;
1960   int x1 = xpos;
1961   int y1 = ypos;
1962   int x2 = xpos+tmap->cached_width;
1963   int y2 = ypos+tmap->cached_height;
1964   DATA_TYPE *dest_baseaddr = NULL;
1965   DATA_TYPE *dest_next;
1966   int dy;
1967   int count;
1968   const UINT16 *source0;
1969   DATA_TYPE *dest0;
1970   UINT8 *pmap0;
19712069   int i;
1972   int row;
1973   int x_start;
1974   int x_end;
1975   int column;
1976   int c1; /* leftmost visible column in source tilemap */
1977   int c2; /* rightmost visible column in source tilemap */
1978   int y; /* current screen line to render */
1979   int y_next;
1980   UINT8 *priority_bitmap_baseaddr;
1981   UINT8 *priority_bitmap_next;
1982   const UINT16 *source_baseaddr;
1983   const UINT16 *source_next;
1984   const UINT8 *mask0;
1985   const UINT8 *mask_baseaddr;
1986   const UINT8 *mask_next;
19872070
1988   /* clip source coordinates */
1989   if( x1<blit.clip_left ) x1 = blit.clip_left;
1990   if( x2>blit.clip_right ) x2 = blit.clip_right;
1991   if( y1<blit.clip_top ) y1 = blit.clip_top;
1992   if( y2>blit.clip_bottom ) y2 = blit.clip_bottom;
1993
1994   if( x1<x2 && y1<y2 ) /* do nothing if totally clipped */
2071   /* skip entirely if not changing priority */
2072   if (pcode != 0xff00)
19952073   {
1996      priority_bitmap_baseaddr = BITMAP_ADDR8(priority_bitmap, y1, xpos);
1997      if( screen )
1998      {
1999         dest_baseaddr = BITMAP_ADDR(screen, DATA_TYPE, y1, xpos);
2000      }
2074      for (i = 0; i < count; i++)
2075         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
2076   }
2077}
20012078
2002      /* convert screen coordinates to source tilemap coordinates */
2003      x1 -= xpos;
2004      y1 -= ypos;
2005      x2 -= xpos;
2006      y2 -= ypos;
20072079
2008      source_baseaddr = BITMAP_ADDR16(tmap->pixmap, y1, 0);
2009      mask_baseaddr = BITMAP_ADDR8(tmap->transparency_bitmap, y1, 0);
2080/*-------------------------------------------------
2081    scanline_draw_masked_null - draw to a NULL
2082    bitmap using a mask, setting priority only
2083-------------------------------------------------*/
20102084
2011      c1 = x1/tmap->cached_tile_width; /* round down */
2012      c2 = (x2+tmap->cached_tile_width-1)/tmap->cached_tile_width; /* round up */
2085static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
2086{
2087   int i;
20132088
2014      y = y1;
2015      y_next = tmap->cached_tile_height*(y1/tmap->cached_tile_height) + tmap->cached_tile_height;
2016      if( y_next>y2 ) y_next = y2;
2089   /* skip entirely if not changing priority */
2090   if (pcode != 0xff00)
2091   {
2092      for (i = 0; i < count; i++)
2093         if ((maskptr[i] & mask) == value)
2094            pri[i] = (pri[i] & (pcode >> 8)) | pcode;
2095   }
2096}
20172097
2018      dy = y_next-y;
2019      dest_next = dest_baseaddr + dy*blit.screen_bitmap_pitch_line;
2020      priority_bitmap_next = priority_bitmap_baseaddr + dy*priority_bitmap_pitch_line;
2021      source_next = source_baseaddr + dy*tmap->pixmap_pitch_line;
2022      mask_next = mask_baseaddr + dy*tmap->transparency_bitmap_pitch_line;
2023      for(;;)
2024      {
2025         row = y/tmap->cached_tile_height;
2026         x_start = x1;
20272098
2028         transPrev = eWHOLLY_TRANSPARENT;
2029         pTrans = mask_baseaddr + x_start;
20302099
2031         cached_indx = row*tmap->num_cached_cols + c1;
2032         for( column=c1; column<=c2; column++ )
2033         {
2034            if( column == c2 )
2035            {
2036               transCur = eWHOLLY_TRANSPARENT;
2037               goto L_Skip;
2038            }
2100/*-------------------------------------------------
2101    scanline_draw_opaque_ind16 - draw to a 16bpp
2102    indexed bitmap
2103-------------------------------------------------*/
20392104
2040            if( tmap->transparency_data[cached_indx]==TILE_FLAG_DIRTY )
2041            {
2042               update_tile_info( tmap, cached_indx, column, row );
2043            }
2105static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
2106{
2107   UINT16 *dest = _dest;
2108   int pal = pcode >> 16;
2109   int i;
20442110
2045            if( (tmap->transparency_data[cached_indx]&mask)!=0 )
2046            {
2047               transCur = eMASKED;
2048            }
2049            else
2050            {
2051               transCur = (((*pTrans)&mask) == value)?eWHOLLY_OPAQUE:eWHOLLY_TRANSPARENT;
2052            }
2053            pTrans += tmap->cached_tile_width;
2111   /* special case for no palette offset */
2112   if (pal == 0)
2113   {
2114      memcpy(dest, source, count * 2);
20542115
2055         L_Skip:
2056            if( transCur!=transPrev )
2057            {
2058               x_end = column*tmap->cached_tile_width;
2059               if( x_end<x1 ) x_end = x1;
2060               if( x_end>x2 ) x_end = x2;
2116      /* priority if necessary */
2117      if (pcode != 0xff00)
2118      {
2119         for (i = 0; i < count; i++)
2120            pri[i] = (pri[i] & (pcode >> 8)) | pcode;
2121      }
2122   }
20612123
2062               if( transPrev != eWHOLLY_TRANSPARENT )
2063               {
2064                  count = x_end - x_start;
2065                  source0 = source_baseaddr + x_start;
2066                  dest0 = dest_baseaddr + x_start;
2067                  pmap0 = priority_bitmap_baseaddr + x_start;
2124   /* priority case */
2125   else if ((pcode & 0xffff) != 0xff00)
2126   {
2127      for (i = 0; i < count; i++)
2128      {
2129         dest[i] = source[i] + pal;
2130         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
2131      }
2132   }
20682133
2069                  if( transPrev == eWHOLLY_OPAQUE )
2070                  {
2071                     i = y;
2072                     for(;;)
2073                     {
2074                        blit.draw_opaque( dest0, source0, count, pmap0, tilemap_priority_code );
2075                        if( ++i == y_next ) break;
2134   /* no priority case */
2135   else
2136   {
2137      for (i = 0; i < count; i++)
2138         dest[i] = source[i] + pal;
2139   }
2140}
20762141
2077                        dest0 += blit.screen_bitmap_pitch_line;
2078                        source0 += tmap->pixmap_pitch_line;
2079                        pmap0 += priority_bitmap_pitch_line;
2080                     }
2081                  } /* transPrev == eWHOLLY_OPAQUE */
2082                  else /* transPrev == eMASKED */
2083                  {
2084                     mask0 = mask_baseaddr + x_start;
2085                     i = y;
2086                     for(;;)
2087                     {
2088                        blit.draw_masked( dest0, source0, mask0, mask, value, count, pmap0, tilemap_priority_code );
2089                        if( ++i == y_next ) break;
20902142
2091                        dest0 += blit.screen_bitmap_pitch_line;
2092                        source0 += tmap->pixmap_pitch_line;
2093                        mask0 += tmap->transparency_bitmap_pitch_line;
2094                        pmap0 += priority_bitmap_pitch_line;
2095                     }
2096                  } /* transPrev == eMASKED */
2097               } /* transPrev != eWHOLLY_TRANSPARENT */
2098               x_start = x_end;
2099               transPrev = transCur;
2100            }
2101            cached_indx++;
2102         }
2103         if( y_next==y2 ) break; /* we are done! */
2143/*-------------------------------------------------
2144    scanline_draw_masked_ind16 - draw to a 16bpp
2145    indexed bitmap using a mask
2146-------------------------------------------------*/
21042147
2105         priority_bitmap_baseaddr = priority_bitmap_next;
2106         dest_baseaddr = dest_next;
2107         source_baseaddr = source_next;
2108         mask_baseaddr = mask_next;
2109         y = y_next;
2110         y_next += tmap->cached_tile_height;
2148static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
2149{
2150   UINT16 *dest = _dest;
2151   int pal = pcode >> 16;
2152   int i;
21112153
2112         if( y_next>=y2 )
2154   /* priority case */
2155   if ((pcode & 0xffff) != 0xff00)
2156   {
2157      for (i = 0; i < count; i++)
2158         if ((maskptr[i] & mask) == value)
21132159         {
2114            y_next = y2;
2160            dest[i] = source[i] + pal;
2161            pri[i] = (pri[i] & (pcode >> 8)) | pcode;
21152162         }
2116         else
2117         {
2118            dest_next += blit.screen_bitmap_pitch_row;
2119            priority_bitmap_next += priority_bitmap_pitch_row;
2120            source_next += tmap->pixmap_pitch_row;
2121            mask_next += tmap->transparency_bitmap_pitch_row;
2122         }
2123      } /* process next row */
2124   } /* not totally clipped */
2163   }
21252164
2126   osd_pend();
2127})
2165   /* no priority case */
2166   else
2167   {
2168      for (i = 0; i < count; i++)
2169         if ((maskptr[i] & mask) == value)
2170            dest[i] = source[i] + pal;
2171   }
2172}
21282173
2129#undef DATA_TYPE
2130#undef DEPTH
2131#undef DECLARE
2132#endif /* DECLARE */
21332174
2134#ifdef TRANSP
2135/*************************************************************************************************/
21362175
2137/* Each of the following routines draws pixmap and transarency data for a single tile.
2138 *
2139 * This function returns a per-tile code.  Each bit of this code is 0 if the corresponding
2140 * bit is zero in every byte of transparency data in the tile, or 1 if that bit is not
2141 * consistant within the tile.
2142 *
2143 * This precomputed value allows us for any particular tile and mask, to determine if all pixels
2144 * in that tile have the same masked transparency value.
2145 */
2176/*-------------------------------------------------
2177    scanline_draw_opaque_rgb16 - draw to a 16bpp
2178    RGB bitmap
2179-------------------------------------------------*/
21462180
2147static UINT8 TRANSP(HandleTransparencyBitmask)(tilemap *tmap, UINT32 x0, UINT32 y0, UINT32 flags)
2181static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
21482182{
2149   UINT32 tile_width = tmap->cached_tile_width;
2150   UINT32 tile_height = tmap->cached_tile_height;
2151   mame_bitmap *pixmap = tmap->pixmap;
2152   mame_bitmap *transparency_bitmap = tmap->transparency_bitmap;
2153   int pitch = tile_width;
2154   PAL_INIT;
2155   UINT32 *pPenToPixel;
2156   const UINT8 *pPenData = tile_info.pen_data;
2157   const UINT8 *pSource;
2158   UINT32 code_transparent = tile_info.priority;
2159   UINT32 code_opaque = code_transparent | TILE_FLAG_FG_OPAQUE;
2160   UINT32 tx;
2161   UINT32 ty;
2162   UINT32 data;
2163   UINT32 yx;
2164   UINT32 x;
2165   UINT32 y;
2166   UINT32 pen;
2167   UINT8 *pBitmask = tile_info.mask_data;
2168   UINT32 bitoffs;
2169   int bWhollyOpaque;
2170   int bWhollyTransparent;
2171   int bDontIgnoreTransparency = !(flags&TILE_IGNORE_TRANSPARENCY);
2183   const pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
2184   UINT16 *dest = _dest;
2185   int i;
21722186
2173   bWhollyOpaque = 1;
2174   bWhollyTransparent = 1;
2175
2176   pPenToPixel = tmap->pPenToPixel[flags&(TILE_FLIPY|TILE_FLIPX)];
2177
2178   if( flags&TILE_4BPP )
2187   /* priority case */
2188   if ((pcode & 0xffff) != 0xff00)
21792189   {
2180      for( ty=tile_height; ty!=0; ty-- )
2190      for (i = 0; i < count; i++)
21812191      {
2182         pSource = pPenData;
2183         for( tx=tile_width/2; tx!=0; tx-- )
2184         {
2185            data = *pSource++;
2186
2187            pen = data&0xf;
2188            yx = *pPenToPixel++;
2189            x = x0+(yx%MAX_TILESIZE);
2190            y = y0+(yx/MAX_TILESIZE);
2191            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2192
2193            pen = data>>4;
2194            yx = *pPenToPixel++;
2195            x = x0+(yx%MAX_TILESIZE);
2196            y = y0+(yx/MAX_TILESIZE);
2197            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2198         }
2199         pPenData += pitch/2;
2192         dest[i] = clut[source[i]];
2193         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
22002194      }
22012195   }
2196
2197   /* no priority case */
22022198   else
22032199   {
2204      for( ty=tile_height; ty!=0; ty-- )
2205      {
2206         pSource = pPenData;
2207         for( tx=tile_width; tx!=0; tx-- )
2208         {
2209            pen = *pSource++;
2210            yx = *pPenToPixel++;
2211            x = x0+(yx%MAX_TILESIZE);
2212            y = y0+(yx/MAX_TILESIZE);
2213            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2214         }
2215         pPenData += pitch;
2216      }
2200      for (i = 0; i < count; i++)
2201         dest[i] = clut[source[i]];
22172202   }
2203}
22182204
2219   pPenToPixel = tmap->pPenToPixel[flags&(TILE_FLIPY|TILE_FLIPX)];
2220   bitoffs = 0;
2221   for( ty=tile_height; ty!=0; ty-- )
2205
2206/*-------------------------------------------------
2207    scanline_draw_masked_rgb16 - draw to a 16bpp
2208    RGB bitmap using a mask
2209-------------------------------------------------*/
2210
2211static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
2212{
2213   const pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
2214   UINT16 *dest = _dest;
2215   int i;
2216
2217   /* priority case */
2218   if ((pcode & 0xffff) != 0xff00)
22222219   {
2223      for( tx=tile_width; tx!=0; tx-- )
2224      {
2225         yx = *pPenToPixel++;
2226         x = x0+(yx%MAX_TILESIZE);
2227         y = y0+(yx/MAX_TILESIZE);
2228         if( bDontIgnoreTransparency && (pBitmask[bitoffs/8]&(0x80>>(bitoffs&7))) == 0 )
2220      for (i = 0; i < count; i++)
2221         if ((maskptr[i] & mask) == value)
22292222         {
2230            *BITMAP_ADDR8(transparency_bitmap, y, x) = code_transparent;
2231            bWhollyOpaque = 0;
2223            dest[i] = clut[source[i]];
2224            pri[i] = (pri[i] & (pcode >> 8)) | pcode;
22322225         }
2233         else
2234         {
2235            *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2236            bWhollyTransparent = 0;
2237         }
2238         bitoffs++;
2239      }
22402226   }
22412227
2242   return (bWhollyOpaque || bWhollyTransparent)?0:TILE_FLAG_FG_OPAQUE;
2228   /* no priority case */
2229   else
2230   {
2231      for (i = 0; i < count; i++)
2232         if ((maskptr[i] & mask) == value)
2233            dest[i] = clut[source[i]];
2234   }
22432235}
22442236
2245static UINT8 TRANSP(HandleTransparencyColor)(tilemap *tmap, UINT32 x0, UINT32 y0, UINT32 flags)
2246{
2247   UINT32 tile_width = tmap->cached_tile_width;
2248   UINT32 tile_height = tmap->cached_tile_height;
2249   mame_bitmap *pixmap = tmap->pixmap;
2250   mame_bitmap *transparency_bitmap = tmap->transparency_bitmap;
2251   int pitch = tile_width;
2252   PAL_INIT;
2253   UINT32 *pPenToPixel = tmap->pPenToPixel[flags&(TILE_FLIPY|TILE_FLIPX)];
2254   const UINT8 *pPenData = tile_info.pen_data;
2255   const UINT8 *pSource;
2256   UINT32 code_transparent = tile_info.priority;
2257   UINT32 code_opaque = code_transparent | TILE_FLAG_FG_OPAQUE;
2258   UINT32 tx;
2259   UINT32 ty;
2260   UINT32 data;
2261   UINT32 yx;
2262   UINT32 x;
2263   UINT32 y;
2264   UINT32 pen;
2265   UINT32 transparent_color = tmap->transparent_pen;
2266   int bWhollyOpaque;
2267   int bWhollyTransparent;
22682237
2269   bWhollyOpaque = 1;
2270   bWhollyTransparent = 1;
2238/*-------------------------------------------------
2239    scanline_draw_opaque_rgb16_alpha - draw to a
2240    16bpp RGB bitmap with alpha blending
2241-------------------------------------------------*/
22712242
2272   if( flags&TILE_4BPP )
2243static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
2244{
2245   const pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
2246   UINT16 *dest = _dest;
2247   int i;
2248
2249   /* priority case */
2250   if ((pcode & 0xffff) != 0xff00)
22732251   {
2274      for( ty=tile_height; ty!=0; ty-- )
2252      for (i = 0; i < count; i++)
22752253      {
2276         pSource = pPenData;
2277         for( tx=tile_width/2; tx!=0; tx-- )
2278         {
2279            data = *pSource++;
2280
2281            pen = data&0xf;
2282            yx = *pPenToPixel++;
2283            x = x0+(yx%MAX_TILESIZE);
2284            y = y0+(yx/MAX_TILESIZE);
2285            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2286            if( PAL_GET(pen)==transparent_color )
2287            {
2288               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_transparent;
2289               bWhollyOpaque = 0;
2290            }
2291            else
2292            {
2293               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2294               bWhollyTransparent = 0;
2295            }
2296
2297            pen = data>>4;
2298            yx = *pPenToPixel++;
2299            x = x0+(yx%MAX_TILESIZE);
2300            y = y0+(yx/MAX_TILESIZE);
2301            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2302            if( PAL_GET(pen)==transparent_color )
2303            {
2304               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_transparent;
2305               bWhollyOpaque = 0;
2306            }
2307            else
2308            {
2309               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2310               bWhollyTransparent = 0;
2311            }
2312         }
2313         pPenData += pitch/2;
2254         dest[i] = alpha_blend16(dest[i], clut[source[i]]);
2255         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
23142256      }
23152257   }
2258
2259   /* no priority case */
23162260   else
23172261   {
2318      for( ty=tile_height; ty!=0; ty-- )
2319      {
2320         pSource = pPenData;
2321         for( tx=tile_width; tx!=0; tx-- )
2322         {
2323            pen = *pSource++;
2324            yx = *pPenToPixel++;
2325            x = x0+(yx%MAX_TILESIZE);
2326            y = y0+(yx/MAX_TILESIZE);
2327            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2328            if( PAL_GET(pen)==transparent_color )
2329            {
2330               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_transparent;
2331               bWhollyOpaque = 0;
2332            }
2333            else
2334            {
2335               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2336               bWhollyTransparent = 0;
2337            }
2338         }
2339         pPenData += pitch;
2340      }
2262      for (i = 0; i < count; i++)
2263         dest[i] = alpha_blend16(dest[i], clut[source[i]]);
23412264   }
2342   return (bWhollyOpaque || bWhollyTransparent)?0:TILE_FLAG_FG_OPAQUE;
23432265}
23442266
2345static UINT8 TRANSP(HandleTransparencyPen)(tilemap *tmap, UINT32 x0, UINT32 y0, UINT32 flags)
2346{
2347   UINT32 tile_width = tmap->cached_tile_width;
2348   UINT32 tile_height = tmap->cached_tile_height;
2349   mame_bitmap *pixmap = tmap->pixmap;
2350   mame_bitmap *transparency_bitmap = tmap->transparency_bitmap;
2351   int pitch = tile_width;
2352   PAL_INIT;
2353   UINT32 *pPenToPixel = tmap->pPenToPixel[flags&(TILE_FLIPY|TILE_FLIPX)];
2354   const UINT8 *pPenData = tile_info.pen_data;
2355   const UINT8 *pSource;
2356   UINT32 code_transparent = tile_info.priority;
2357   UINT32 code_opaque = code_transparent | TILE_FLAG_FG_OPAQUE;
2358   UINT32 tx;
2359   UINT32 ty;
2360   UINT32 data;
2361   UINT32 yx;
2362   UINT32 x;
2363   UINT32 y;
2364   UINT32 pen;
2365   UINT32 transparent_pen = tmap->transparent_pen;
2366   int bWhollyOpaque;
2367   int bWhollyTransparent;
23682267
2369   bWhollyOpaque = 1;
2370   bWhollyTransparent = 1;
2268/*-------------------------------------------------
2269    scanline_draw_masked_rgb16_alpha - draw to a
2270    16bpp RGB bitmap using a mask and alpha
2271    blending
2272-------------------------------------------------*/
23712273
2372   if( flags&TILE_IGNORE_TRANSPARENCY )
2373   {
2374      transparent_pen = ~0;
2375   }
2274static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
2275{
2276   const pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
2277   UINT16 *dest = _dest;
2278   int i;
23762279
2377   if( flags&TILE_4BPP )
2280   /* priority case */
2281   if ((pcode & 0xffff) != 0xff00)
23782282   {
2379      for( ty=tile_height; ty!=0; ty-- )
2380      {
2381         pSource = pPenData;
2382         for( tx=tile_width/2; tx!=0; tx-- )
2283      for (i = 0; i < count; i++)
2284         if ((maskptr[i] & mask) == value)
23832285         {
2384            data = *pSource++;
2385
2386            pen = data&0xf;
2387            yx = *pPenToPixel++;
2388            x = x0+(yx%MAX_TILESIZE);
2389            y = y0+(yx/MAX_TILESIZE);
2390            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2391            if( pen==transparent_pen )
2392            {
2393               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_transparent;
2394               bWhollyOpaque = 0;
2395            }
2396            else
2397            {
2398               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2399               bWhollyTransparent = 0;
2400            }
2401
2402            pen = data>>4;
2403            yx = *pPenToPixel++;
2404            x = x0+(yx%MAX_TILESIZE);
2405            y = y0+(yx/MAX_TILESIZE);
2406            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2407            *BITMAP_ADDR8(transparency_bitmap, y, x) = (pen==transparent_pen)?code_transparent:code_opaque;
2286            dest[i] = alpha_blend16(dest[i], clut[source[i]]);
2287            pri[i] = (pri[i] & (pcode >> 8)) | pcode;
24082288         }
2409         pPenData += pitch/2;
2410      }
24112289   }
2290
2291   /* no priority case */
24122292   else
24132293   {
2414      for( ty=tile_height; ty!=0; ty-- )
2415      {
2416         pSource = pPenData;
2417         for( tx=tile_width; tx!=0; tx-- )
2418         {
2419            pen = *pSource++;
2420            yx = *pPenToPixel++;
2421            x = x0+(yx%MAX_TILESIZE);
2422            y = y0+(yx/MAX_TILESIZE);
2423            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2424            if( pen==transparent_pen )
2425            {
2426               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_transparent;
2427               bWhollyOpaque = 0;
2294      for (i = 0; i < count; i++)
2295         if ((maskptr[i] & mask) == value)
2296            dest[i] = alpha_blend16(dest[i], clut[source[i]]);
2297   }
2298}
24282299
2429            }
2430            else
2431            {
2432               *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2433               bWhollyTransparent = 0;
2434            }
2435         }
2436         pPenData += pitch;
2300
2301/*-------------------------------------------------
2302    scanline_draw_opaque_rgb32 - draw to a 32bpp
2303    RGB bitmap
2304-------------------------------------------------*/
2305
2306static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
2307{
2308   const pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
2309   UINT32 *dest = _dest;
2310   int i;
2311
2312   /* priority case */
2313   if ((pcode & 0xffff) != 0xff00)
2314   {
2315      for (i = 0; i < count; i++)
2316      {
2317         dest[i] = clut[source[i]];
2318         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
24372319      }
24382320   }
24392321
2440   return (bWhollyOpaque || bWhollyTransparent)?0:TILE_FLAG_FG_OPAQUE;
2322   /* no priority case */
2323   else
2324   {
2325      for (i = 0; i < count; i++)
2326         dest[i] = clut[source[i]];
2327   }
24412328}
24422329
2443static UINT8 TRANSP(HandleTransparencyPenBit)(tilemap *tmap, UINT32 x0, UINT32 y0, UINT32 flags)
2330
2331/*-------------------------------------------------
2332    scanline_draw_masked_rgb32 - draw to a 32bpp
2333    RGB bitmap using a mask
2334-------------------------------------------------*/
2335
2336static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
24442337{
2445   UINT32 tile_width = tmap->cached_tile_width;
2446   UINT32 tile_height = tmap->cached_tile_height;
2447   mame_bitmap *pixmap = tmap->pixmap;
2448   mame_bitmap *transparency_bitmap = tmap->transparency_bitmap;
2449   int pitch = tile_width;
2450   PAL_INIT;
2451   UINT32 *pPenToPixel = tmap->pPenToPixel[flags&(TILE_FLIPY|TILE_FLIPX)];
2452   const UINT8 *pPenData = tile_info.pen_data;
2453   const UINT8 *pSource;
2454   UINT32 tx;
2455   UINT32 ty;
2456   UINT32 data;
2457   UINT32 yx;
2458   UINT32 x;
2459   UINT32 y;
2460   UINT32 pen;
2461   UINT32 penbit = tmap->transparent_pen;
2462   UINT32 code_front = tile_info.priority | TILE_FLAG_FG_OPAQUE;
2463   UINT32 code_back = tile_info.priority | TILE_FLAG_BG_OPAQUE;
2464   int code;
2465   int and_flags = ~0;
2466   int or_flags = 0;
2338   const pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
2339   UINT32 *dest = _dest;
2340   int i;
24672341
2468   if( flags&TILE_4BPP )
2342   /* priority case */
2343   if ((pcode & 0xffff) != 0xff00)
24692344   {
2470      for( ty=tile_height; ty!=0; ty-- )
2471      {
2472         pSource = pPenData;
2473         for( tx=tile_width/2; tx!=0; tx-- )
2345      for (i = 0; i < count; i++)
2346         if ((maskptr[i] & mask) == value)
24742347         {
2475            data = *pSource++;
2476
2477            pen = data&0xf;
2478            yx = *pPenToPixel++;
2479            x = x0+(yx%MAX_TILESIZE);
2480            y = y0+(yx/MAX_TILESIZE);
2481            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2482            code = ((pen&penbit)==penbit)?code_front:code_back;
2483            and_flags &= code;
2484            or_flags |= code;
2485            *BITMAP_ADDR8(transparency_bitmap, y, x) = code;
2486
2487            pen = data>>4;
2488            yx = *pPenToPixel++;
2489            x = x0+(yx%MAX_TILESIZE);
2490            y = y0+(yx/MAX_TILESIZE);
2491            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2492            code = ((pen&penbit)==penbit)?code_front:code_back;
2493            and_flags &= code;
2494            or_flags |= code;
2495            *BITMAP_ADDR8(transparency_bitmap, y, x) = code;
2348            dest[i] = clut[source[i]];
2349            pri[i] = (pri[i] & (pcode >> 8)) | pcode;
24962350         }
2497         pPenData += pitch/2;
2498      }
24992351   }
2352
2353   /* no priority case */
25002354   else
25012355   {
2502      for( ty=tile_height; ty!=0; ty-- )
2503      {
2504         pSource = pPenData;
2505         for( tx=tile_width; tx!=0; tx-- )
2506         {
2507            pen = *pSource++;
2508            yx = *pPenToPixel++;
2509            x = x0+(yx%MAX_TILESIZE);
2510            y = y0+(yx/MAX_TILESIZE);
2511            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2512            code = ((pen&penbit)==penbit)?code_front:code_back;
2513            and_flags &= code;
2514            or_flags |= code;
2515            *BITMAP_ADDR8(transparency_bitmap, y, x) = code;
2516         }
2517         pPenData += pitch;
2518      }
2356      for (i = 0; i < count; i++)
2357         if ((maskptr[i] & mask) == value)
2358            dest[i] = clut[source[i]];
25192359   }
2520   return or_flags ^ and_flags;
25212360}
25222361
2523static UINT8 TRANSP(HandleTransparencyPens)(tilemap *tmap, UINT32 x0, UINT32 y0, UINT32 flags)
2362
2363/*-------------------------------------------------
2364    scanline_draw_opaque_rgb32_alpha - draw to a
2365    32bpp RGB bitmap with alpha blending
2366-------------------------------------------------*/
2367
2368static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
25242369{
2525   UINT32 tile_width = tmap->cached_tile_width;
2526   UINT32 tile_height = tmap->cached_tile_height;
2527   mame_bitmap *pixmap = tmap->pixmap;
2528   mame_bitmap *transparency_bitmap = tmap->transparency_bitmap;
2529   int pitch = tile_width;
2530   PAL_INIT;
2531   UINT32 *pPenToPixel = tmap->pPenToPixel[flags&(TILE_FLIPY|TILE_FLIPX)];
2532   const UINT8 *pPenData = tile_info.pen_data;
2533   const UINT8 *pSource;
2534   UINT32 code_transparent = tile_info.priority;
2535   UINT32 tx;
2536   UINT32 ty;
2537   UINT32 data;
2538   UINT32 yx;
2539   UINT32 x;
2540   UINT32 y;
2541   UINT32 pen;
2542   UINT32 fgmask = tmap->fgmask[(flags>>TILE_SPLIT_OFFSET)&3];
2543   UINT32 bgmask = tmap->bgmask[(flags>>TILE_SPLIT_OFFSET)&3];
2544   UINT32 code;
2545   int and_flags = ~0;
2546   int or_flags = 0;
2370   const pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
2371   UINT32 *dest = _dest;
2372   int i;
25472373
2548   if( flags&TILE_4BPP )
2374   /* priority case */
2375   if ((pcode & 0xffff) != 0xff00)
25492376   {
2550      for( ty=tile_height; ty!=0; ty-- )
2377      for (i = 0; i < count; i++)
25512378      {
2552         pSource = pPenData;
2553         for( tx=tile_width/2; tx!=0; tx-- )
2554         {
2555            data = *pSource++;
2556
2557            pen = data&0xf;
2558            yx = *pPenToPixel++;
2559            x = x0+(yx%MAX_TILESIZE);
2560            y = y0+(yx/MAX_TILESIZE);
2561            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2562            code = code_transparent;
2563            if( !((1<<pen)&fgmask) ) code |= TILE_FLAG_FG_OPAQUE;
2564            if( !((1<<pen)&bgmask) ) code |= TILE_FLAG_BG_OPAQUE;
2565            and_flags &= code;
2566            or_flags |= code;
2567            *BITMAP_ADDR8(transparency_bitmap, y, x) = code;
2568
2569            pen = data>>4;
2570            yx = *pPenToPixel++;
2571            x = x0+(yx%MAX_TILESIZE);
2572            y = y0+(yx/MAX_TILESIZE);
2573            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2574            code = code_transparent;
2575            if( !((1<<pen)&fgmask) ) code |= TILE_FLAG_FG_OPAQUE;
2576            if( !((1<<pen)&bgmask) ) code |= TILE_FLAG_BG_OPAQUE;
2577            and_flags &= code;
2578            or_flags |= code;
2579            *BITMAP_ADDR8(transparency_bitmap, y, x) = code;
2580         }
2581         pPenData += pitch/2;
2379         dest[i] = alpha_blend32(dest[i], clut[source[i]]);
2380         pri[i] = (pri[i] & (pcode >> 8)) | pcode;
25822381      }
25832382   }
2383
2384   /* no priority case */
25842385   else
25852386   {
2586      for( ty=tile_height; ty!=0; ty-- )
2587      {
2588         pSource = pPenData;
2589         for( tx=tile_width; tx!=0; tx-- )
2590         {
2591            pen = *pSource++;
2592            yx = *pPenToPixel++;
2593            x = x0+(yx%MAX_TILESIZE);
2594            y = y0+(yx/MAX_TILESIZE);
2595            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2596            code = code_transparent;
2597            if( !((1<<pen)&fgmask) ) code |= TILE_FLAG_FG_OPAQUE;
2598            if( !((1<<pen)&bgmask) ) code |= TILE_FLAG_BG_OPAQUE;
2599            and_flags &= code;
2600            or_flags |= code;
2601            *BITMAP_ADDR8(transparency_bitmap, y, x) = code;
2602         }
2603         pPenData += pitch;
2604      }
2387      for (i = 0; i < count; i++)
2388         dest[i] = alpha_blend32(dest[i], clut[source[i]]);
26052389   }
2606   return and_flags ^ or_flags;
26072390}
26082391
2609static UINT8 TRANSP(HandleTransparencyNone)(tilemap *tmap, UINT32 x0, UINT32 y0, UINT32 flags)
2392
2393/*-------------------------------------------------
2394    scanline_draw_masked_rgb32_alpha - draw to a
2395    32bpp RGB bitmap using a mask and alpha
2396    blending
2397-------------------------------------------------*/
2398
2399static void scanline_draw_masked_rgb32_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
26102400{
2611   UINT32 tile_width = tmap->cached_tile_width;
2612   UINT32 tile_height = tmap->cached_tile_height;
2613   mame_bitmap *pixmap = tmap->pixmap;
2614   mame_bitmap *transparency_bitmap = tmap->transparency_bitmap;
2615   int pitch = tile_width;
2616   PAL_INIT;
2617   UINT32 *pPenToPixel = tmap->pPenToPixel[flags&(TILE_FLIPY|TILE_FLIPX)];
2618   const UINT8 *pPenData = tile_info.pen_data;
2619   const UINT8 *pSource;
2620   UINT32 code_opaque = tile_info.priority;
2621   UINT32 tx;
2622   UINT32 ty;
2623   UINT32 data;
2624   UINT32 yx;
2625   UINT32 x;
2626   UINT32 y;
2627   UINT32 pen;
2401   const pen_t *clut = &Machine->remapped_colortable[pcode >> 16];
2402   UINT32 *dest = _dest;
2403   int i;
26282404
2629   if( flags&TILE_4BPP )
2405   /* priority case */
2406   if ((pcode & 0xffff) != 0xff00)
26302407   {
2631      for( ty=tile_height; ty!=0; ty-- )
2632      {
2633         pSource = pPenData;
2634         for( tx=tile_width/2; tx!=0; tx-- )
2408      for (i = 0; i < count; i++)
2409         if ((maskptr[i] & mask) == value)
26352410         {
2636            data = *pSource++;
2637
2638            pen = data&0xf;
2639            yx = *pPenToPixel++;
2640            x = x0+(yx%MAX_TILESIZE);
2641            y = y0+(yx/MAX_TILESIZE);
2642            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2643            *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2644
2645            pen = data>>4;
2646            yx = *pPenToPixel++;
2647            x = x0+(yx%MAX_TILESIZE);
2648            y = y0+(yx/MAX_TILESIZE);
2649            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2650            *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2411            dest[i] = alpha_blend32(dest[i], clut[source[i]]);
2412            pri[i] = (pri[i] & (pcode >> 8)) | pcode;
26512413         }
2652         pPenData += pitch/2;
2653      }
26542414   }
2415
2416   /* no priority case */
26552417   else
26562418   {
2657      for( ty=tile_height; ty!=0; ty-- )
2658      {
2659         pSource = pPenData;
2660         for( tx=tile_width; tx!=0; tx-- )
2661         {
2662            pen = *pSource++;
2663            yx = *pPenToPixel++;
2664            x = x0+(yx%MAX_TILESIZE);
2665            y = y0+(yx/MAX_TILESIZE);
2666            *BITMAP_ADDR16(pixmap, y, x) = PAL_GET(pen);
2667            *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque;
2668         }
2669         pPenData += pitch;
2670      }
2419      for (i = 0; i < count; i++)
2420         if ((maskptr[i] & mask) == value)
2421            dest[i] = alpha_blend32(dest[i], clut[source[i]]);
26712422   }
2672   return 0;
26732423}
2674
2675#undef TRANSP
2676#undef PAL_INIT
2677#undef PAL_GET
2678#endif // TRANSP
2679
src/emu/tilemap.h
r814r815
77    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
10****************************************************************************
11
12    Core concepts:
13
14        Tilemap = a 2-dimensional array of tiles; each tile has its own
15            independent characteristics which describe how that tile is
16            rendered. A tilemap is described by the number of rows and
17            columns in the map. Each tile in the tilemap is a fixed size
18            specified as width and height in pixels.
19
20        Tile = a single rectangular element in a tilemap; tiles can be
21            any size, but all tiles in a tilemap are the same size. Each
22            tile is described by the following parameters:
23
24            pen_data (required): pointer to an array of 8bpp pen data
25                describing the raw pixels to be rendered for a tile;
26                for example, an 8x8 tile requires 64 bytes of pen_data
27
28            palette_base (required): the base index in the global palette;
29                each pixel fetched from pen_data will have this base added
30                to it before it is stored in the pixmap
31
32            mask_data (optional): pointer to an array of 1bpp mask data
33                which controls which pixels are to be considered visible
34                or transparent (part of no layer); data is packed MSB
35                first with no padding, so an 8x8 tile requires 64 bits or
36                8 bytes data
37
38            category (optional): specifies one of 16 categories for the
39                pixels in the tile; the category controls which tiles are
40                rendered during a tilemap_draw() call
41
42            group (optional): specifies one of 256 groups for pen mapping;
43                each pen in the tile is looked up in a table to determine
44                which layer(s) it belongs to, and the group selects one of
45                256 different tables to use for this mapping
46
47            flags (optional): specifies one or more of the following bits:
48
49                TILE_FLIPX means render the tile flipped horizontally
50
51                TILE_FLIPY means render the tile flipped vertically
52
53                TILE_4BPP means pen_data is actually packed 4bpp pixels
54                    (low 4 bits first, then upper 4 bits)
55
56                TILE_FORCE_LAYERn means all pixels are forced to be in
57                    layer n, where n = 0,1,2
58
59        Pen = another name for pixel value; tilemap graphics are either
60            4 or 8 bits per pixel, meaning that pen values range from
61            0-15 (4bpp) or 0-255 (8bpp).
62
63        Logical index = index of a tile in a tilemap, assuming perfect
64            packing in row-major order; this is always equal to
65            (rownum * tilemap_columns + colnum).
66
67        Memory index = index of a tile in memory; this often does not
68            map 1:1 to the logical index (though it can). A mapper
69            function is provided when creating a new tilemap that can
70            map from (column,row) to memory index.
71
72        Layer = one of 3 categories each pixel can belong to, based on
73            the pens in a tile; traditionally, layer 0 is the only
74            one used. If a pixel does not belong to any layers, it is
75            considered transparent.
76
77        Group = one of 256 per-tile selectable means of mapping from
78            pens to layers; traditionally only group 0 is used.
79
80        Category = a 4-bit value specified per-tile which allows for
81            separating tiles into categories which can be rendered
82            independently.
83
84        Pixmap = a 16bpp bitmap containing the full tilemap with
85            all tiles rendered.
86
87        Flagsmap = an 8bpp bitmap containing per-pixel flags,
88            specifically the category (specified in bits 0-3) and
89            the layer (specified in bits 4-6).
90
91****************************************************************************
92
93    How to use a tilemap:
94
95    1. First create a new tilemap by calling tilemap_create(). The
96        parameters are as follows:
97
98        tile_get_info = pointer to a callback function which accepts a
99            memory index and in return fills in a tile_info structure
100            that describes the characteristics of a tile; this function
101            will be called whenever a dirty tile needs to be rendered
102
103        mapper = pointer to a callback function which maps the logical
104            column and row to a memory index; several standard mappers
105            are provided, with tilemap_scan_rows being the most common
106
107        type = the type of tilemap this is;
108
109            TILEMAP_TYPE_PEN - this is the most common type,
110                and means that transparency is determined by taking the
111                raw pen value and looking it up in a table to determine
112                which layer(s) each pixel belongs to
113
114            TILEMAP_TYPE_COLORTABLE - this is less common and
115                will eventually be deprecated; it means that transparency
116                is determined by taking the raw pen value, looking it up
117                in the machine's colortable, and then looking that value
118                up in a table to determine which layer(s) each pixel
119                belongs to
120
121        tilewidth = the width, in pixels, of each individual tile
122
123        tileheight = the height, in pixels, of each individual tile
124
125        cols = the number of columns in the tilemap
126
127        rows = the number of rows in the tilemap
128
129    2. Once you have created your tilemap, you need to configure it.
130        Common configuration tasks include:
131
132            * marking one of the pens as transparent via
133                tilemap_set_transparent_pen()
134
135            * performing more complex pen-to-layer mapping via
136                tilemap_map_pen_to_layer() or
137                tilemap_map_pens_to_layer()
138
139            * configuring global scroll offsets via
140                tilemap_set_scrolldx() and tilemap_set_scrolldy()
141
142            * specifying a pointer that is passed to your tile_get_info
143                callback via tilemap_set_user_data()
144
145            * setting a global palette offset via
146                tilemap_set_palette_offset()
147
148    3. In your memory write handlers for the tile memory, anytime tile
149        data is modified, you need to mark the tile dirty so that it is
150        re-rendered with the new data the next time the tilemap is drawn.
151        Use tilemap_mark_tile_dirty() and pass in the memory index.
152
153    4. In your handlers for scrolling, update the scroll values for the
154        tilemap via tilemap_set_scrollx() and tilemap_set_scrolly().
155
156    5. If any other major characteristics of the tilemap change (generally
157        any global state that is used by the tile_get_info callback but
158        which is not reported via other calls to the tilemap code), you
159        should invalidate the entire tilemap. You can do this by calling
160        tilemap_mark_all_tiles_dirty().
161
162    6. In your VIDEO_UPDATE callback, render the tiles by calling
163        tilemap_draw() or tilemap_draw_roz(). If you need to do custom
164        rendering and want access to the raw pixels, call
165        tilemap_get_pixmap() to get a pointer to the updated mame_bitmap
166        containing the tilemap graphics.
167
168****************************************************************************
169
170    The following example shows how to use the tilemap system to create
171    a simple tilemap where pen 0 is transparent. Each tile is 8x8 pixels
172    in size, and there are 32 rows and 64 columns, stored in row-major
173    order. Based on bits in the tile memory, tiles can be drawn either
174    behind or in front of sprites.
175
176        tilemap *tmap;
177        UINT16 *my_tmap_memory;
178
179        TILE_GET_INFO( my_get_info )
180        {
181            UINT8 tiledata = my_tmap_memory[tile_index];
182            UINT8 code = tiledata & 0xff;
183            UINT8 color = (tiledata >> 8) & 0x1f;
184            UINT8 flipx = (tiledata >> 13) & 1;
185            UINT8 flipy = (tiledata >> 14) & 1;
186            UINT8 category = (tiledata >> 15) & 1;
187
188            // set the common info for the tile
189            SET_TILE_INFO(
190                1,              // use machine->gfx[1] for tile graphics
191                code,           // the index of the graphics for this tile
192                color,          // the color to use for this tile
193                (flipx ? TILE_FLIPX : 0) |  // flags for this tile; also
194                (flipy ? TILE_FLIPY : 0);   // see the FLIP_YX macro
195            );
196
197            // set the category of each tile based on the high bit; this
198            // allows us to draw each category independently
199            tileinfo->category = category;
200        }
201
202        VIDEO_START( mydriver )
203        {
204            // first create the tilemap
205            tmap = tilemap_create(
206                    my_get_info,            // pointer to your get_info
207                    tilemap_scan_rows,      // standard row-major mapper
208                    TILEMAP_TYPE_PEN, // transparency from pens
209                    8,8,                    // 8x8 tiles
210                    64,32);                 // 64 columns, 32 rows
211
212            // then set the transparent pen; all other pens will default
213            // to being part of layer 0
214            tilemap_set_transparent_pen(tmap, 0);
215        }
216
217        VIDEO_UPDATE( mydriver )
218        {
219            // draw the tilemap first, fully opaque since it needs to
220            // erase all previous pixels
221            tilemap_draw(
222                bitmap,                 // destination bitmap
223                cliprect,               // clipping rectangle
224                tmap,                   // tilemap to draw
225                TILEMAP_DRAW_OPAQUE,    // flags
226                0);                     // don't use priority_bitmap
227
228            // next draw the sprites
229            my_draw_sprites();
230
231            // then draw the tiles which have priority over sprites
232            tilemap_draw(
233                bitmap,                 // destination bitmap
234                cliprect,               // clipping rectangle
235                tmap,                   // tilemap to draw
236                TILEMAP_DRAW_CATEGORY(1),// flags: draw category 1
237                0);                     // don't use priority_bitmap
238
239            return 0;
240        }
241
242****************************************************************************
243
244    Tilemap techniques:
245
246    * The previous tilemap code specified a number of different tilemap
247        types that were fundamentally similar. This has been collapsed
248        into just two types now. Here is how to replicate that
249        functionality with the new system:
250
251        TILEMAP_TYPE_PEN: If you want a tilemap with no transparency,
252            you don't need to do anything; by default all pens map to
253            layer 0 and are thus non-transparent. Note that a lot of
254            code used to create OPAQUE tilemaps and then set the
255            transparent pen for them; this no longer works.
256
257        TILEMAP_TYPE_PEN: This described a tilemap with a single
258            transparent pen. To create the same effect, make a new tilemap
259            of type TILEMAP_TYPE_PEN, and then call
260            tilemap_set_transparent_pen() to specify which pen is
261            transparent; all other pens will map to layer 0.
262
263        TILEMAP_TYPE_COLORTABLE: This works just like before and
264            even has the same type name. Create a tilemap of type
265            TILEMAP_TYPE_COLORTABLE and call
266            tilemap_set_transparent_pen() to specify which remapped pen
267            is transparent.
268
269        TILEMAP_TYPE_PEN: This type is no longer special; with the new
270            code, any tile_get_info callback can specify a bitmask which
271            will be processed after rendering to make some pixels
272            transparent.
273
274        TILEMAP_TYPE_PEN: This type used to let you map pens into two
275            layers (called "front" and "back") based on their pens. It
276            also allowed for you to choose one of 4 mappings on a per-tile
277            basis. All of this functionality is now expanded: you can
278            specify one of 3 layers and can choose from one of 256 mappings
279            on a per-tile basis. You just create a tilemap of type
280            TILEMAP_TYPE_PEN and call tilemap_set_transmask(),
281            which still exists but maps onto the new behavior. The "front"
282            layer is now "layer 0" and the "back" layer is now "layer 1".
283
284        TILEMAP_TYPE_PEN: This type was only used in one driver
285            and is not worth describing in detail how the new mapping
286            works. :)
287
288    * By far the most common usage of layers is the simplest: layer 0 is
289        the only one used and rendered. If you want a particular tile to
290        render opaque, you can set the TILE_FORCE_LAYER0 file in your
291        tile_get_info callback.
292
293    * When drawing, you can specify in the flags which classes of pixels
294        to draw. In the low 4 bits, you specify the category; this must
295        match exactly the category specified for the tile in order to
296        render. In addition, the flags TILEMAP_DRAW_LAYERn allow you to
297        control which layer pattern to draw; note that combining these
298        flags may produce interesting results. Specifying both layer 0
299        and layer 1 will render only pixels that are in *both* layers.
300        If you want to render everything, regardless of layer, specify
301        the TILEMAP_DRAW_OPAQUE flag. If you don't specify any layers,
302        TILEMAP_DRAW_LAYER0 is assumed.
303
304    * If you want to render with alpha blending, you can call
305        tilemap_draw() with the TILEMAP_DRAW_ALPHA flag. To configure the
306        amount of alpha blending, call alpha_set_level() ahead of time.
307
308    * To configure more complex pen-to-layer mapping, use the
309        tilemap_map_pens_to_layer() call. This call takes a group number
310        so that you can configure 1 of the 256 groups independently.
311        It also takes a pen and a mask; the mapping is updated for all
312        pens where ((pennum & mask) == pen). To set all the pens in a
313        group to the same value, pass a mask of 0. To set a single pen in
314        a group, pass a mask of ~0. The helper function
315        tilemap_map_pen_to_layer() does this for you.
316
10317***************************************************************************/
11318
12319#pragma once
r814r815
16323
17324#include "mamecore.h"
18325
326
327/***************************************************************************
328    CONSTANTS
329***************************************************************************/
330
331/* ALL_TILEMAPS may be used with: tilemap_set_flip, tilemap_mark_all_tiles_dirty */
332#define ALL_TILEMAPS               NULL
333
334
335/* maximum number of groups */
336#define TILEMAP_NUM_GROUPS            256
337
338
339/* these flags control tilemap_draw() behavior */
340#define TILEMAP_DRAW_CATEGORY_MASK      0x0f      /* specify the category to draw */
341#define TILEMAP_DRAW_CATEGORY(x)      (x)         /* specify category to draw */
342#define TILEMAP_DRAW_LAYER0            0x10      /* draw layer 0 */
343#define TILEMAP_DRAW_LAYER1            0x20      /* draw layer 1 */
344#define TILEMAP_DRAW_LAYER2            0x40      /* draw layer 2 */
345#define TILEMAP_DRAW_OPAQUE            0x80      /* draw everything, even transparent stuff */
346#define TILEMAP_DRAW_ALPHA            0x100      /* draw with alpha blending */
347
348
349/* per-pixel flags in the transparency_bitmap */
350#define TILEMAP_PIXEL_CATEGORY_MASK      0x0f      /* category is stored in the low 4 bits */
351#define TILEMAP_PIXEL_TRANSPARENT      0x00      /* transparent if in none of the layers below */
352#define TILEMAP_PIXEL_LAYER0         0x10      /* pixel is opaque in layer 0 */
353#define TILEMAP_PIXEL_LAYER1         0x20      /* pixel is opaque in layer 1 */
354#define TILEMAP_PIXEL_LAYER2         0x40      /* pixel is opaque in layer 2 */
355
356
357/* per-tile flags, set by get_tile_info callback */
358#define TILE_FLIPX                  0x01      /* draw this tile horizontally flipped */
359#define TILE_FLIPY                  0x02      /* draw this tile vertically flipped */
360#define TILE_4BPP                  0x04      /* tile data is packed 4bpp */
361#define TILE_FORCE_LAYER0            TILEMAP_PIXEL_LAYER0 /* force all pixels to be layer 0 (no transparency) */
362#define TILE_FORCE_LAYER1            TILEMAP_PIXEL_LAYER1 /* force all pixels to be layer 1 (no transparency) */
363#define TILE_FORCE_LAYER2            TILEMAP_PIXEL_LAYER2 /* force all pixels to be layer 2 (no transparency) */
364
365
366/* tilemap global flags, used by tilemap_set_flip() */
367#define TILEMAP_FLIPX               TILE_FLIPX   /* draw the tilemap horizontally flipped */
368#define TILEMAP_FLIPY               TILE_FLIPY   /* draw the tilemap vertically flipped */
369
370
371/* set this value for a scroll row/column to fully disable it */
372#define TILE_LINE_DISABLED            0x80000000
373
374
375
376/***************************************************************************
377    MACROS
378***************************************************************************/
379
380/* function definition for a get info callback */
381#define TILE_GET_INFO(_name)         void _name(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
382
383/* function definition for a logical-to-memory mapper */
384#define TILEMAP_MAPPER(_name)         tilemap_memory_index _name(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
385
386/* useful macro inside of a TILE_GET_INFO callback to set tile information  */
387#define SET_TILE_INFO(GFX,CODE,COLOR,FLAGS) tileinfo_set(machine, tileinfo, GFX, CODE, COLOR, FLAGS)
388
389/* Macros for setting tile attributes in the TILE_GET_INFO callback: */
390/*   TILE_FLIP_YX assumes that flipy is in bit 1 and flipx is in bit 0 */
391/*   TILE_FLIP_XY assumes that flipy is in bit 0 and flipx is in bit 1 */
392/*   TILE_GROUP shifts a split group number appropriately to OR into the tile flags */
393#define TILE_FLIPYX(YX)               ((YX) & 3)
394#define TILE_FLIPXY(XY)               ((((XY) & 2) >> 1) | (((XY) & 1) << 1))
395
396
397
398/***************************************************************************
399    TYPE DEFINITIONS
400***************************************************************************/
401
402/* memory indexes are unsigned integers */
403typedef UINT32 tilemap_memory_index;
404
405/* opaque tilemap definition */
19406typedef struct _tilemap tilemap;
20407
21#define ALL_TILEMAPS   0
22/* ALL_TILEMAPS may be used with:
23    tilemap_set_flip, tilemap_mark_all_tiles_dirty
24*/
25408
26409/* tilemap types */
27410enum _tilemap_type
28411{
29   TILEMAP_TYPE_OPAQUE,
30   TILEMAP_TYPE_TRANSPARENT,
31   TILEMAP_TYPE_SPLIT,
32   TILEMAP_TYPE_BITMASK,
33   TILEMAP_TYPE_TRANSPARENT_COLOR,
34   TILEMAP_TYPE_SPLIT_PENBIT
412   TILEMAP_TYPE_PEN,            /* pen-to-layer mapping is determined by pen lookup */
413   TILEMAP_TYPE_COLORTABLE         /* pen-to-layer mapping is determined by colortable[pen] lookup */
35414};
36415typedef enum _tilemap_type tilemap_type;
37416
38417
39/* Set transparency_pen to a mask.  pen&mask determines whether each pixel is in front or back half */
40/*
41    TILEMAP_TYPE_SPLIT should be used if the pixels from a single tile
42    can appear in more than one plane.
418/* tile_data is filled in by the get_tile_info callback */
419typedef struct _tile_data tile_data;
420struct _tile_data
421{
422   const UINT8 *   pen_data;      /* required */
423   const UINT8 *   mask_data;      /* required for TILEMAP_TYPE_PEN */
424   pen_t         palette_base;   /* defaults to 0 */
425   UINT8          category;      /* defaults to 0; range from 0..15 */
426   UINT8         group;         /* defaults to 0; range from 0..TILEMAP_NUM_GROUPS */
427   UINT8          flags;         /* defaults to 0; one or more of TILE_* flags above */
428};
43429
44    TILEMAP_TYPE_BITMASK is used by Namco System1, Namco System2, NamcoNA1/2, Namco NB1
45*/
46430
47#define TILEMAP_IGNORE_TRANSPARENCY      0x10
48#define TILEMAP_BACK               0x20
49#define TILEMAP_FRONT               0x40
50#define TILEMAP_ALPHA               0x80
431/* callback function to get info about a tile */
432typedef void (*tile_get_info_callback)(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param);
51433
52/*
53    when rendering a split layer, pass TILEMAP_FRONT or TILEMAP_BACK or'd with the
54    tile_priority value to specify the part to draw.
434/* callback function to map a column,row pair to a memory index */
435typedef tilemap_memory_index (*tilemap_mapper_callback)(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
55436
56    when rendering a layer in alpha mode, the priority parameter
57    becomes the alpha parameter (0..255).  Split mode is still
58    available in alpha mode, ignore_transparency isn't.
59*/
60437
61typedef struct _tile_data tile_data;
62struct _tile_data
63{
64   /*
65        you must set tile_info.pen_data, tile_info.pal_data and tile_info.pen_usage
66        in the callback.  You can use the SET_TILE_INFO() macro below to do this.
67        tile_info.flags and tile_info.priority will be automatically preset to 0,
68        games that don't need them don't need to explicitly set them to 0
69    */
70   const UINT8 *pen_data;
71   const pen_t *pal_data;
72   UINT32 flags;
73   UINT32 priority;      /* tile priority */
74   UINT32 transpens;      /* additional per-tile transparent pens for TILEMAP_TYPE_SPLIT */
75   UINT8 *mask_data;      /* for TILEMAP_TYPE_BITMASK */
76   void *user_data;      /* user-supplied tilemap-wide pointer */
77};
78438
79typedef void (*tile_get_info_fn)(running_machine *machine, tile_data *tileinfo, int tile_index);
439/***************************************************************************
440    GLOBAL VARIABLES
441***************************************************************************/
80442
81#define TILE_GET_INFO( _name ) void _name(running_machine *machine, tile_data *tileinfo, int tile_index)
443extern mame_bitmap *priority_bitmap;
82444
83#define SET_TILE_INFO(GFX,CODE,COLOR,FLAGS) { \
84   const gfx_element *gfx = machine->gfx[(GFX)]; \
85   int _code = (CODE) % gfx->total_elements; \
86   tileinfo->pen_data = gfx->gfxdata + _code*gfx->char_modulo; \
87   tileinfo->pal_data = &gfx->colortable[gfx->color_granularity * (COLOR)]; \
88   tileinfo->flags = FLAGS; \
89   if (gfx->flags & GFX_PACKED) tileinfo->flags |= TILE_4BPP; \
90}
91445
92/* tile flags, set by get_tile_info callback */
93/* TILE_IGNORE_TRANSPARENCY is used if you need an opaque tile in a transparent layer. */
94#define TILE_FLIPX               0x01
95#define TILE_FLIPY               0x02
96#define TILE_IGNORE_TRANSPARENCY   0x08
97#define TILE_4BPP               0x10
98/*      TILE_SPLIT                  0x60 */
99446
100/* TILE_SPLIT is for use with TILEMAP_TYPE_SPLIT layers.  It selects transparency type. */
101#define TILE_SPLIT_OFFSET         5
102#define TILE_SPLIT(T)            ((T)<<TILE_SPLIT_OFFSET)
447/***************************************************************************
448    FUNCTION PROTOTYPES
449***************************************************************************/
103450
104#define TILE_FLIPYX(YX)            (YX)
105#define TILE_FLIPXY(XY)            ((((XY)>>1)|((XY)<<1))&3)
106/*
107    TILE_FLIPYX is a shortcut that can be used by approx 80% of games,
108    since yflip frequently occurs one bit higher than xflip within a
109    tile attributes byte.
110*/
111451
112#define TILE_LINE_DISABLED 0x80000000
452/* ----- system-wide management ----- */
113453
114extern mame_bitmap *priority_bitmap;
454/* initialize the tilemap system -- not for use by drivers */
455void tilemap_init(running_machine *machine);
115456
116/* don't call these from drivers - they are called from mame.c */
117void tilemap_init( running_machine *machine );
118457
119tilemap *tilemap_create(
120   tile_get_info_fn tile_get_info,
121   UINT32 (*get_memory_offset)( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ),
122   tilemap_type type,
123   int tile_width, int tile_height,
124   int num_cols, int num_rows );
125458
126void tilemap_set_transparent_pen( tilemap *tmap, int pen );
127void tilemap_set_transmask( tilemap *tmap, int which, UINT32 fgmask, UINT32 bgmask );
128void tilemap_set_depth( tilemap *tmap, int tile_depth, int tile_granularity );
459/* ----- tilemap creation and configuration ----- */
129460
130void tilemap_mark_tile_dirty( tilemap *tmap, int memory_offset );
131void tilemap_mark_all_tiles_dirty( tilemap *tmap );
461/* create a new tilemap; note that tilemaps are tracked by the core so there is no dispose */
462tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_callback mapper, tilemap_type type, int tilewidth, int tileheight, int cols, int rows);
132463
133void tilemap_set_scroll_rows( tilemap *tmap, int scroll_rows ); /* default: 1 */
134void tilemap_set_scrolldx( tilemap *tmap, int dx, int dx_if_flipped );
135void tilemap_set_scrollx( tilemap *tmap, int row, int value );
136int tilemap_get_scrolldx( tilemap *tmap );
464/* specify a parameter to be passed into the tile_get_info callback */
465void tilemap_set_user_data(tilemap *tmap, void *user_data);
137466
138void tilemap_set_scroll_cols( tilemap *tmap, int scroll_cols ); /* default: 1 */
139void tilemap_set_scrolldy( tilemap *tmap, int dy, int dy_if_flipped );
140void tilemap_set_scrolly( tilemap *tmap, int col, int value );
141int tilemap_get_scrolldy( tilemap *tmap );
467/* specify an offset to be added to each pixel before looking up the palette */
468void tilemap_set_palette_offset(tilemap *tmap, UINT32 offset);
142469
143void tilemap_set_palette_offset( tilemap *tmap, int offset );
144void tilemap_set_user_data( tilemap *tmap, void *user_data );
470/* set an enable flag for the tilemap; if 0, requests to draw the tilemap are ignored */
471void tilemap_set_enable(tilemap *tmap, int enable);
145472
146#define TILEMAP_FLIPX 0x1
147#define TILEMAP_FLIPY 0x2
148void tilemap_set_flip( tilemap *tmap, int attributes );
149void tilemap_set_enable( tilemap *tmap, int enable );
473/* set a global flip for the tilemap; ALL_TILEMAPS can be passed here as well */
474void tilemap_set_flip(tilemap *tmap, UINT32 attributes);
150475
151void tilemap_draw( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority );
152void tilemap_draw_primask( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority, UINT32 priority_mask );
153476
154void tilemap_draw_roz(mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap,
155      UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,
156      int wraparound,
157      UINT32 flags, UINT32 priority );
158477
159void tilemap_draw_roz_primask(mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap,
160      UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,
161      int wraparound,
162      UINT32 flags, UINT32 priority, UINT32 priority_mask );
478/* ----- dirty tile marking ----- */
163479
164/* ----xxxx tile priority
165 * ---x---- opaque in foreground
166 * --x----- opaque in background
167 * -x------ reserved
168 * x------- tile-is-dirty
169 */
170#define TILE_FLAG_TILE_PRIORITY   (0x0f)
171#define TILE_FLAG_FG_OPAQUE      (0x10)
172#define TILE_FLAG_BG_OPAQUE      (0x20)
480/* mark a single tile dirty based on its memory index */
481void tilemap_mark_tile_dirty(tilemap *tmap, tilemap_memory_index memory_index);
173482
174mame_bitmap *tilemap_get_pixmap( tilemap * tmap );
175mame_bitmap *tilemap_get_transparency_bitmap( tilemap * tmap );
176UINT8 *tilemap_get_transparency_data( tilemap * tmap );  //*
483/* mark all the tiles in a tilemap dirty; ALL_TILEMAPS can be passed here as well */
484void tilemap_mark_all_tiles_dirty(tilemap *tmap);
177485
178/*********************************************************************/
179486
180UINT32 tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
181UINT32 tilemap_scan_cols_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
182UINT32 tilemap_scan_cols_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
183UINT32 tilemap_scan_cols_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
184487
185UINT32 tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
186UINT32 tilemap_scan_rows_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
187UINT32 tilemap_scan_rows_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
188UINT32 tilemap_scan_rows_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
488/* ----- pen-to-layer mapping ----- */
189489
190/* For showcharset()'s sake */
191UINT32 tilemap_count( void );
192void tilemap_nb_size( UINT32 number, UINT32 *width, UINT32 *height );
193void tilemap_nb_draw( mame_bitmap *dest, UINT32 number, UINT32 scrollx, UINT32 scrolly );
490/* specify the mapping of one or more pens (where (<pen> & mask == pen) to a layer */
491void tilemap_map_pens_to_layer(tilemap *tmap, int group, pen_t pen, pen_t mask, UINT8 layermask);
194492
493/* set a single transparent pen into the tilemap, mapping all other pens to layer 0 */
494void tilemap_set_transparent_pen(tilemap *tmap, pen_t pen);
495
496/* set up the first 32 pens using a foreground (layer 0) mask and a background (layer 1) mask */
497void tilemap_set_transmask(tilemap *tmap, int group, UINT32 fgmask, UINT32 bgmask);
498
499
500
501/* ----- tilemap scrolling ----- */
502
503/* specify the number of independently scrollable row units; each unit covers height/scroll_rows pixels */
504void tilemap_set_scroll_rows(tilemap *tmap, UINT32 scroll_rows);
505
506/* specify the number of independently scrollable column units; each unit covers width/scroll_cols pixels */
507void tilemap_set_scroll_cols(tilemap *tmap, UINT32 scroll_cols);
508
509/* specify global horizontal and vertical scroll offsets, for non-flipped and flipped cases */
510void tilemap_set_scrolldx(tilemap *tmap, int dx, int dx_if_flipped);
511void tilemap_set_scrolldy(tilemap *tmap, int dy, int dy_if_flipped);
512
513/* return the global horizontal or vertical scroll offset, based on current flip state */
514int tilemap_get_scrolldx(tilemap *tmap);
515int tilemap_get_scrolldy(tilemap *tmap);
516
517/* specify the scroll value for a row/column unit */
518void tilemap_set_scrollx(tilemap *tmap, int row, int value);
519void tilemap_set_scrolly(tilemap *tmap, int col, int value);
520
521
522
523/* ----- internal map access ----- */
524
525/* return a pointer to the (updated) internal pixmap for a tilemap */
526mame_bitmap *tilemap_get_pixmap(tilemap *tmap);
527
528/* return a pointer to the (updated) internal flagsmap for a tilemap */
529mame_bitmap *tilemap_get_flagsmap(tilemap *tmap);
530
531/* return a pointer to the (updated) internal per-tile flags for a tilemap */
532UINT8 *tilemap_get_tile_flags(tilemap *tmap);
533
534
535
536/* ----- tilemap rendering ----- */
537
538/* draw a tilemap to the destination with clipping; pixels apply priority/priority_mask to the priority bitmap */
539void tilemap_draw_primask(mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask);
540
541/* draw a tilemap to the destination with clipping and arbitrary rotate/zoom; */
542/* pixels apply priority/priority_mask to the priority bitmap */
543void tilemap_draw_roz_primask(mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap,
544      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
545      int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask);
546
547
548
549/* ----- indexed tilemap handling ----- */
550
551/* return the number of tilemaps */
552int tilemap_count(void);
553
554/* return the size of an indexed tilemap */
555void tilemap_size_by_index(int number, UINT32 *width, UINT32 *height);
556
557/* render an indexed tilemap with fixed characteristics (no priority) */
558void tilemap_draw_by_index(mame_bitmap *dest, int number, UINT32 scrollx, UINT32 scrolly);
559
560
561
562/* ----- common logical-to-memory mappers ----- */
563
564/* scan in row-major order with optional flipping */
565TILEMAP_MAPPER( tilemap_scan_rows );
566TILEMAP_MAPPER( tilemap_scan_rows_flip_x );
567TILEMAP_MAPPER( tilemap_scan_rows_flip_y );
568TILEMAP_MAPPER( tilemap_scan_rows_flip_xy );
569
570/* scan in column-major order with optional flipping */
571TILEMAP_MAPPER( tilemap_scan_cols );
572TILEMAP_MAPPER( tilemap_scan_cols_flip_x );
573TILEMAP_MAPPER( tilemap_scan_cols_flip_y );
574TILEMAP_MAPPER( tilemap_scan_cols_flip_xy );
575
576
577
578/***************************************************************************
579    INLINE FUNCTIONS
580***************************************************************************/
581
582/*-------------------------------------------------
583    tileinfo_set - set the values of a tileinfo
584    structure
585-------------------------------------------------*/
586
587INLINE void tileinfo_set(running_machine *machine, tile_data *tileinfo, int gfxnum, int rawcode, int rawcolor, int flags)
588{
589   const gfx_element *   gfx = machine->gfx[gfxnum];
590   int code = rawcode % gfx->total_elements;
591   tileinfo->pen_data = gfx->gfxdata + code * gfx->char_modulo;
592   tileinfo->palette_base = (gfx->colortable - machine->remapped_colortable) + gfx->color_granularity * rawcolor;
593   tileinfo->flags = flags;
594   if (gfx->flags & GFX_PACKED)
595      tileinfo->flags |= TILE_4BPP;
596}
597
598
599/*-------------------------------------------------
600    tilemap_map_pen_to_layer - map a single pen
601    to a layer
602-------------------------------------------------*/
603
604INLINE void tilemap_map_pen_to_layer(tilemap *tmap, int group, pen_t pen, UINT8 layermask)
605{
606   tilemap_map_pens_to_layer(tmap, group, pen, ~0, layermask);
607}
608
609
610/*-------------------------------------------------
611    tilemap_draw - shortcut to
612    tilemap_draw_primask
613-------------------------------------------------*/
614
615INLINE void tilemap_draw(mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT8 priority)
616{
617   tilemap_draw_primask(dest, cliprect, tmap, flags, priority, 0xff);
618}
619
620
621/*-------------------------------------------------
622    tilemap_draw_roz - shortcut to
623    tilemap_draw_roz_primask
624-------------------------------------------------*/
625
626INLINE void tilemap_draw_roz(mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap,
627      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
628      int wraparound, UINT32 flags, UINT8 priority)
629{
630   tilemap_draw_roz_primask(dest, cliprect, tmap, startx, starty, incxx, incxy, incyx, incyy, wraparound, flags, priority, 0xff);
631}
632
633
634
195635#endif   /* __TILEMAP_H__ */
src/emu/uimenu.c
r814r815
16511651   else
16521652   {
16531653      /* handle typeahead */
1654      recompute |= select_game_handle_key(KEYCODE_BACKSPACE, -1);
1654      recompute |= select_game_handle_key(KEYCODE_BACKSPACE, 8);
16551655      recompute |= select_game_handle_key(KEYCODE_SPACE, ' ');
16561656      for (curkey = KEYCODE_A; curkey <= KEYCODE_Z; curkey++)
16571657         recompute |= select_game_handle_key(curkey, curkey - KEYCODE_A + 'a');
r814r815
26002600      int buflen = strlen(select_game_buffer);
26012601
26022602      /* if it's a backspace and we can handle it, do so */
2603      if (value == -1)
2603      if (value == 8)
26042604      {
26052605         if (buflen > 0)
26062606         {
src/emu/rendutil.c
r814r815
5959   rectangle sbounds;
6060   UINT32 dx, dy;
6161
62   if (dwidth == 0 || dheight == 0)
63      return;
64
6265   /* compute the real source bounds */
6366   if (orig_sbounds != NULL)
6467      sbounds = *orig_sbounds;
src/mess/video/aquarius.c
r814r815
2020      0,                        /* gfx */
2121      videoram[tile_index +    40],   /* character */
2222      videoram[tile_index + 0x400],   /* color */
23      0)                        /* flags */
23      0);                        /* flags */
2424}
2525
2626VIDEO_START( aquarius )
r814r815
2828   aquarius_tilemap = tilemap_create(
2929      aquarius_gettileinfo,
3030      tilemap_scan_rows,
31      TILEMAP_TYPE_OPAQUE,
31      TILEMAP_TYPE_PEN,
3232      8, 8,
3333      40, 24);
3434}
src/mess/video/abc80.c
r814r815
4545      abc80_bank = 1;
4646   }
4747
48   SET_TILE_INFO(abc80_bank, code, color, 0)
48   SET_TILE_INFO(abc80_bank, code, color, 0);
4949}
5050
5151static UINT32 abc80_tilemap_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
r814r815
6565   mame_timer_adjust(abc80_blink_timer, time_zero, 0, MAME_TIME_IN_HZ(ABC80_XTAL/2/6/64/312/16));
6666
6767   tx_tilemap = tilemap_create(abc80_get_tile_info, abc80_tilemap_scan,
68      TILEMAP_TYPE_OPAQUE, 6, 10, 40, 24);
68      TILEMAP_TYPE_PEN, 6, 10, 40, 24);
6969
7070   tilemap_set_scrolldx(tx_tilemap, ABC80_HDSTART, ABC80_HDSTART);
7171   tilemap_set_scrolldy(tx_tilemap, ABC80_VDSTART, ABC80_VDSTART);
src/mess/video/x68k.c
r814r815
833833   int code = x68k_spriteram[0x3000+tile_index] & 0x00ff;
834834   int colour = (x68k_spriteram[0x3000+tile_index] & 0x0f00) >> 8;
835835   int flags = (x68k_spriteram[0x3000+tile_index] & 0xc000) >> 14;
836   SET_TILE_INFO(0,code,colour,flags)
836   SET_TILE_INFO(0,code,colour,flags);
837837}
838838
839839static TILE_GET_INFO(x68k_get_bg1_tile)
r814r815
841841   int code = x68k_spriteram[0x2000+tile_index] & 0x00ff;
842842   int colour = (x68k_spriteram[0x2000+tile_index] & 0x0f00) >> 8;
843843   int flags = (x68k_spriteram[0x2000+tile_index] & 0xc000) >> 14;
844   SET_TILE_INFO(0,code,colour,flags)
844   SET_TILE_INFO(0,code,colour,flags);
845845}
846846
847847static TILE_GET_INFO(x68k_get_bg0_tile_16)
r814r815
849849   int code = x68k_spriteram[0x3000+tile_index] & 0x00ff;
850850   int colour = (x68k_spriteram[0x3000+tile_index] & 0x0f00) >> 8;
851851   int flags = (x68k_spriteram[0x3000+tile_index] & 0xc000) >> 14;
852   SET_TILE_INFO(1,code,colour,flags)
852   SET_TILE_INFO(1,code,colour,flags);
853853}
854854
855855static TILE_GET_INFO(x68k_get_bg1_tile_16)
r814r815
857857   int code = x68k_spriteram[0x2000+tile_index] & 0x00ff;
858858   int colour = (x68k_spriteram[0x2000+tile_index] & 0x0f00) >> 8;
859859   int flags = (x68k_spriteram[0x2000+tile_index] & 0xc000) >> 14;
860   SET_TILE_INFO(1,code,colour,flags)
860   SET_TILE_INFO(1,code,colour,flags);
861861}
862862
863863VIDEO_START( x68000 )
r814r815
891891   Machine->gfx[gfx_index]->total_colors = 16;
892892
893893   /* Tilemaps */
894   x68k_bg0_8 = tilemap_create(x68k_get_bg0_tile,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
895   x68k_bg1_8 = tilemap_create(x68k_get_bg1_tile,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,8,8,64,64);
896   x68k_bg0_16 = tilemap_create(x68k_get_bg0_tile_16,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
897   x68k_bg1_16 = tilemap_create(x68k_get_bg1_tile_16,tilemap_scan_rows,TILEMAP_TYPE_TRANSPARENT,16,16,64,64);
894   x68k_bg0_8 = tilemap_create(x68k_get_bg0_tile,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
895   x68k_bg1_8 = tilemap_create(x68k_get_bg1_tile,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
896   x68k_bg0_16 = tilemap_create(x68k_get_bg0_tile_16,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
897   x68k_bg1_16 = tilemap_create(x68k_get_bg1_tile_16,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
898898
899899   tilemap_set_transparent_pen(x68k_bg0_8,0);
900900   tilemap_set_transparent_pen(x68k_bg1_8,0);
src/mess/video/osi.c
r814r815
1616{
1717   int code = videoram[tile_index];
1818
19   SET_TILE_INFO(0, code, 0, 0)
19   SET_TILE_INFO(0, code, 0, 0);
2020}
2121
2222VIDEO_START( sb2m600 )
2323{
2424   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
25      TILEMAP_TYPE_OPAQUE, 8, 8, 32, 32);
25      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
2626}
2727
2828VIDEO_START( uk101 )
2929{
3030   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
31      TILEMAP_TYPE_OPAQUE, 8, 16, 32, 32);
31      TILEMAP_TYPE_PEN, 8, 16, 32, 32);
3232}
3333
3434VIDEO_UPDATE( sb2m600 )
src/mess/video/abc80x.c
r814r815
4646   int code = attr & 0x7f;
4747   int color = (attr & 0x80) ? 1 : 0;
4848
49   SET_TILE_INFO(bank, code, color, 0)
49   SET_TILE_INFO(bank, code, color, 0);
5050}
5151
5252VIDEO_START( abc800m )
5353{
5454   tx_tilemap = tilemap_create(abc800_get_tile_info, tilemap_scan_rows,
55      TILEMAP_TYPE_OPAQUE, 6, 10, 80, 24);
55      TILEMAP_TYPE_PEN, 6, 10, 80, 24);
5656}
5757
5858static TILE_GET_INFO(abc800c_get_tile_info)
r814r815
6060   int code = videoram[tile_index];
6161   int color = 1;                  // WRONG!
6262
63   SET_TILE_INFO(0, code, color, 0)
63   SET_TILE_INFO(0, code, color, 0);
6464}
6565
6666VIDEO_START( abc800c )
6767{
6868   tx_tilemap = tilemap_create(abc800c_get_tile_info, tilemap_scan_rows,
69      TILEMAP_TYPE_OPAQUE, 6, 10, 40, 24);
69      TILEMAP_TYPE_PEN, 6, 10, 40, 24);
7070}
7171
7272VIDEO_UPDATE( abc800 )
r814r815
8484   int code = attr & 0x7f;
8585   int color = (attr & 0x80) ? 1 : 0;
8686
87   SET_TILE_INFO(bank, code, color, 0)
87   SET_TILE_INFO(bank, code, color, 0);
8888}
8989
9090static TILE_GET_INFO(abc802_get_tile_info_80)
r814r815
9494   int code = attr & 0x7f;
9595   int color = (attr & 0x80) ? 1 : 0;
9696
97   SET_TILE_INFO(bank, code, color, 0)
97   SET_TILE_INFO(bank, code, color, 0);
9898}
9999
100100VIDEO_START( abc802 )
101101{
102102   tx_tilemap_40 = tilemap_create(abc802_get_tile_info_40, tilemap_scan_rows,
103      TILEMAP_TYPE_OPAQUE, 12, 10, 40, 24);
103      TILEMAP_TYPE_PEN, 12, 10, 40, 24);
104104
105105   tx_tilemap = tilemap_create(abc802_get_tile_info_80, tilemap_scan_rows,
106      TILEMAP_TYPE_OPAQUE, 6, 10, 80, 24);
106      TILEMAP_TYPE_PEN, 6, 10, 80, 24);
107107
108108   abc802_columns = 80;
109109}
src/mess/video/microtan.c
r814r815
3434   int gfxn = microtan_chunky_buffer[tile_index];
3535   int code = videoram[tile_index];
3636
37   SET_TILE_INFO(gfxn, code, 0, 0)
37   SET_TILE_INFO(gfxn, code, 0, 0);
3838}
3939
4040VIDEO_START( microtan )
4141{
4242   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
43      TILEMAP_TYPE_OPAQUE, 8, 16, 32, 16);
43      TILEMAP_TYPE_PEN, 8, 16, 32, 16);
4444
4545   microtan_chunky_buffer = auto_malloc(videoram_size);
4646   memset(microtan_chunky_buffer, 0, videoram_size);
src/mess/video/trs80.c
r814r815
2929      1,                           /* gfx */
3030      translate[videoram[tile_index]],   /* character */
3131      color,                        /* color */
32      0)                           /* flags */
32      0);                           /* flags */
3333}
3434
3535static TILE_GET_INFO(normwidth_gettileinfo)
r814r815
3838      0,                           /* gfx */
3939      translate[videoram[tile_index]],   /* character */
4040      color,                        /* color */
41      0)                           /* flags */
41      0);                           /* flags */
4242}
4343
4444/***************************************************************************
r814r815
4949   dblwidth_tilemap = tilemap_create(
5050      dblwidth_gettileinfo,
5151      tilemap_scan_rows,
52      TILEMAP_TYPE_OPAQUE,
52      TILEMAP_TYPE_PEN,
5353      FW * 2, FH,
5454      64, videoram_size / 64);
5555
5656   normwidth_tilemap = tilemap_create(
5757      normwidth_gettileinfo,
5858      tilemap_scan_rows,
59      TILEMAP_TYPE_OPAQUE,
59      TILEMAP_TYPE_PEN,
6060      FW, FH,
6161      64, videoram_size / 64);
6262
src/mess/video/apple2.c
r814r815
182182
183183static TILE_GET_INFO(apple2_lores_gettileinfo)
184184{
185   static pen_t pal_data[2];   /* HACK */
186   int ch;
187
185   /* NPW 11-Aug-2007 - breaking Apple II in the short term so that the 0.117u1 update
186    * can be applied */
188187   tileinfo->pen_data = lores_tiledata;
189   tileinfo->pal_data = pal_data;
188   tileinfo->palette_base = 0;
190189   tileinfo->flags = 0;
191190
192   ch = a2_videoram[lores_videobase + tile_index];
193   pal_data[0] = (ch >> 0) & 0x0f;
194   pal_data[1] = (ch >> 4) & 0x0f;
191   /*
192      OLD CODE:
193      ---------
194
195      static pen_t pal_data[2];
196      int ch;
197
198      tileinfo->pen_data = lores_tiledata;
199      tileinfo->pal_data = pal_data;
200      tileinfo->flags = 0;
201
202      ch = a2_videoram[lores_videobase + tile_index];
203      pal_data[0] = (ch >> 0) & 0x0f;
204      pal_data[1] = (ch >> 4) & 0x0f;
205   */
195206}
196207
197208static void apple2_lores_draw(mame_bitmap *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow)
r814r815
353364   text_tilemap = tilemap_create(
354365      apple2_text_gettileinfo,
355366      apple2_text_getmemoryoffset,
356      TILEMAP_TYPE_OPAQUE,
367      TILEMAP_TYPE_PEN,
357368      7*2, 8,
358369      40, 24);
359370
360371   dbltext_tilemap = tilemap_create(
361372      apple2_dbltext_gettileinfo,
362373      apple2_dbltext_getmemoryoffset,
363      TILEMAP_TYPE_OPAQUE,
374      TILEMAP_TYPE_PEN,
364375      7, 8,
365376      80, 24);
366377
367378   lores_tilemap = tilemap_create(
368379      apple2_lores_gettileinfo,
369380      apple2_text_getmemoryoffset,
370      TILEMAP_TYPE_OPAQUE,
381      TILEMAP_TYPE_PEN,
371382      14, 8,
372383      40, 24);
373384
src/mess/mscommon.c
r814r815
4949      gfxfont,   /* gfx */
5050      code,      /* character */
5151      color,      /* color */
52      0)         /* flags */
52      0);         /* flags */
5353}
5454
5555struct terminal *terminal_create(
r814r815
6767      + (num_cols * num_rows * sizeof(termchar_t)));
6868
6969   term->tm = tilemap_create(terminal_gettileinfo, tilemap_scan_rows,
70      TILEMAP_TYPE_OPAQUE, char_width, char_height, num_cols, num_rows);
70      TILEMAP_TYPE_PEN, char_width, char_height, num_cols, num_rows);
7171
7272   term->gfx = gfx;
7373   term->blank_char = blank_char;
docs/messnew.txt
r814r815
2626
2727Source Changes:
2828----------------
29(none)
29- The core is based on MAME 0.118u1.  This incorporates all features of the
30  update to this core.  [MAME team]
3031
3132
3233

Previous 15994 Revisions Next


© 1998-2018 The MESS Team