| 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 |
| r814 | r815 | |
|---|---|---|
| 32 | 32 | READ8_HANDLER( msm6242_r ) |
| 33 | 33 | { |
| 34 | 34 | mame_system_time curtime, *systime = &curtime; |
| 35 | ||
| 35 | ||
| 36 | 36 | if ( msm6264_reg[0] & 1 ) /* if HOLD is set, use the hold time */ |
| 37 | 37 | { |
| 38 | 38 | systime = &msm6264_hold_time; |
| r814 | r815 | |
| 56 | 56 | { |
| 57 | 57 | int hour = systime->local_time.hour; |
| 58 | 58 | int pm = (hour >= 12) ? 1 : 0; |
| 59 | ||
| 59 | ||
| 60 | 60 | if ( pm ) hour -= 12; |
| 61 | 61 | if ( hour == 0 ) hour = 12; |
| 62 | ||
| 62 | ||
| 63 | 63 | if ( offset == MSM6264_REG_H1 ) |
| 64 | 64 | return hour % 10; |
| 65 | ||
| 65 | ||
| 66 | 66 | return (hour / 10) | (pm << 2); |
| 67 | 67 | } |
| 68 | ||
| 68 | ||
| 69 | 69 | if ( offset == MSM6264_REG_H1 ) |
| 70 | 70 | return systime->local_time.hour % 10; |
| 71 | ||
| 71 | ||
| 72 | 72 | return systime->local_time.hour / 10; |
| 73 | 73 | } |
| 74 | ||
| 74 | ||
| 75 | 75 | case MSM6264_REG_D1: return systime->local_time.mday % 10; |
| 76 | 76 | case MSM6264_REG_D10: return systime->local_time.mday / 10; |
| 77 | 77 | case MSM6264_REG_MO1: return (systime->local_time.month+1) % 10; |
| r814 | r815 | |
| 95 | 95 | case MSM6264_REG_CD: |
| 96 | 96 | { |
| 97 | 97 | msm6264_reg[0] = data; |
| 98 | ||
| 98 | ||
| 99 | 99 | if ( data & 1 ) /* was Hold set? */ |
| 100 | 100 | { |
| 101 | 101 | mame_get_current_datetime(Machine, &msm6264_hold_time); |
| 102 | 102 | } |
| 103 | ||
| 103 | ||
| 104 | 104 | return; |
| 105 | 105 | } |
| 106 | ||
| 106 | ||
| 107 | 107 | case MSM6264_REG_CE: msm6264_reg[1] = data; return; |
| 108 | ||
| 108 | ||
| 109 | 109 | case MSM6264_REG_CF: |
| 110 | 110 | { |
| 111 | 111 | /* the 12/24 mode bit can only be changed while REST is 1 */ |
| r814 | r815 | |
| 121 | 121 | return; |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | ||
| 124 | ||
| 125 | 125 | logerror("%04x: MSM6242 unmapped offset %02X written with %02X\n",activecpu_get_pc(),offset,data); |
| 126 | 126 | } |
| 127 | 127 |
| r814 | r815 | |
|---|---|---|
| 1597 | 1597 | temp4 = K054338_set_alpha_level(temp2); |
| 1598 | 1598 | |
| 1599 | 1599 | if (temp4 <= 0) continue; |
| 1600 | if (temp4 < 255) k = TILEMAP_ALPHA; | |
| 1600 | if (temp4 < 255) k = TILEMAP_DRAW_ALPHA; | |
| 1601 | 1601 | } |
| 1602 | 1602 | |
| 1603 | 1603 | if (mixerflags & 1<<(code+12)) k |= TILE_LINE_DISABLED; |
| r814 | r815 | |
|---|---|---|
| 6891 | 6891 | DRIVER( tontonb ) /* "09" (c) 1987 Dynax */ |
| 6892 | 6892 | DRIVER( hanamai ) /* "16" (c) 1988 Dynax */ |
| 6893 | 6893 | DRIVER( majs101b ) /* "17" (c) [1988] Dynax */ |
| 6894 | DRIVER( mjapinky ) /* 1988 Dynax */ | |
| 6894 | 6895 | DRIVER( hnkochou ) /* "20" (c) 1989 Dynax */ |
| 6895 | 6896 | DRIVER( mjderngr ) /* "22" (c) 1989 Dynax */ |
| 6896 | 6897 | DRIVER( hnoridur ) /* "23" (c) 1989 Dynax */ |
| r814 | r815 | |
| 7656 | 7657 | DRIVER( goldnpkb ) /* (c) 1981 Bonanza */ |
| 7657 | 7658 | DRIVER( goldnpkc ) /* Bootleg */ |
| 7658 | 7659 | DRIVER( jokerpkr ) /* Bootleg in Coinmaster hardware */ |
| 7659 | DRIVER( pottnpkr ) /* (c) 198? Unknown */ | |
| 7660 | DRIVER( pottnpkr ) /* Bootleg */ | |
| 7661 | DRIVER( pottnpkb ) /* Bootleg */ | |
| 7660 | 7662 | DRIVER( gdrawpkr ) /* (c) 1981 Cal Omega / Casino Electronics Inc. */ |
| 7661 | 7663 | DRIVER( altair ) /* (c) 1981 Cidelsa */ |
| 7662 | 7664 | DRIVER( destryer ) /* (c) 1981 Cidelsa */ |
| r814 | r815 | |
|---|---|---|
| 13 | 13 | tileno = sbugger_videoram[tile_index]; |
| 14 | 14 | color = sbugger_videoram_attr[tile_index]; |
| 15 | 15 | |
| 16 | SET_TILE_INFO(0,tileno,color,0) | |
| 16 | SET_TILE_INFO(0,tileno,color,0); | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | WRITE8_HANDLER( sbugger_videoram_w ) |
| r814 | r815 | |
| 30 | 30 | |
| 31 | 31 | VIDEO_START(sbugger) |
| 32 | 32 | { |
| 33 | sbugger_tilemap = tilemap_create(get_sbugger_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 33 | sbugger_tilemap = tilemap_create(get_sbugger_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | VIDEO_UPDATE(sbugger) |
| r814 | r815 | |
|---|---|---|
| 43 | 43 | int data2 = targeth_videoram[(tile_index << 1) + 1]; |
| 44 | 44 | int code = data & 0x3fff; |
| 45 | 45 | |
| 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)); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static TILE_GET_INFO( get_tile_info_targeth_screen1 ) |
| r814 | r815 | |
| 52 | 52 | int data2 = targeth_videoram[(0x2000/2) + (tile_index << 1) + 1]; |
| 53 | 53 | int code = data & 0x3fff; |
| 54 | 54 | |
| 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)); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /*************************************************************************** |
| r814 | r815 | |
| 76 | 76 | |
| 77 | 77 | VIDEO_START( targeth ) |
| 78 | 78 | { |
| 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); | |
| 81 | 81 | |
| 82 | 82 | tilemap_set_transparent_pen(pant[0],0); |
| 83 | 83 | } |
| r814 | r815 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | static TILE_GET_INFO( get_tile_info ) |
| 47 | 47 | { |
| 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; | |
| 50 | 50 | 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; | |
| 55 | 55 | #ifdef MAME_DEBUG |
| 56 | if(nycaptor_mask&(1<<tileinfo-> | |
| 56 | if(nycaptor_mask&(1<<tileinfo->categor | |
| 57 | 57 | { |
| 58 | 58 | if(nycaptor_spot())pal=0xe;else pal=4; |
| 59 | 59 | } |
| r814 | r815 | |
| 62 | 62 | SET_TILE_INFO( |
| 63 | 63 | 0, |
| 64 | 64 | videoram[tile_index*2] + ((videoram[tile_index*2+1] & 0xc0) << 2) +0x400 * char_bank, |
| 65 | pal,flags; | |
| 66 | ) | |
| 65 | pal,0 | |
| 66 | ); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | VIDEO_START( nycaptor ) |
| 71 | 71 | { |
| 72 | 72 | nycaptor_spriteram = auto_malloc (160); |
| 73 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 73 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 74 | 74 | |
| 75 | 75 | tilemap_set_transmask(bg_tilemap,0,0xf800,0x7ff); //split 0 |
| 76 | 76 | tilemap_set_transmask(bg_tilemap,1,0xfe00,0x01ff);//split 1 |
| r814 | r815 | |
| 230 | 230 | nycaptor_setmask(); |
| 231 | 231 | if(nycaptor_mask&0x1000) |
| 232 | 232 | { |
| 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); | |
| 241 | 241 | draw_sprites(machine, bitmap,cliprect,0); |
| 242 | 242 | draw_sprites(machine, bitmap,cliprect,1); |
| 243 | 243 | draw_sprites(machine, bitmap,cliprect,2); |
| r814 | r815 | |
| 252 | 252 | switch (nycaptor_spot()&3) |
| 253 | 253 | { |
| 254 | 254 | case 0: |
| 255 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 255 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0); | |
| 256 | 256 | 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); | |
| 261 | 261 | draw_sprites(machine, bitmap,cliprect,3); |
| 262 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 262 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0); | |
| 263 | 263 | draw_sprites(machine, bitmap,cliprect,0); |
| 264 | 264 | draw_sprites(machine, bitmap,cliprect,2); |
| 265 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 265 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|0,0); | |
| 266 | 266 | draw_sprites(machine, bitmap,cliprect,1); |
| 267 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 267 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|0,0); | |
| 268 | 268 | break; |
| 269 | 269 | |
| 270 | 270 | case 1: |
| 271 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 271 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0); | |
| 272 | 272 | draw_sprites(machine, bitmap,cliprect,3); |
| 273 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 273 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|3,0); | |
| 274 | 274 | 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); | |
| 277 | 277 | 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); | |
| 280 | 280 | 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); | |
| 283 | 283 | break; |
| 284 | 284 | |
| 285 | 285 | 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); | |
| 289 | 289 | 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); | |
| 293 | 293 | 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); | |
| 296 | 296 | break; |
| 297 | 297 | |
| 298 | 298 | case 3: |
| 299 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 299 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|1,0); | |
| 300 | 300 | draw_sprites(machine, bitmap,cliprect,1); |
| 301 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 301 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0|1,0); | |
| 302 | 302 | 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); | |
| 305 | 305 | break; |
| 306 | 306 | } |
| 307 | 307 | return 0; |
| r814 | r815 | |
|---|---|---|
| 35 | 35 | 0, |
| 36 | 36 | code, |
| 37 | 37 | attr & 0x7f, |
| 38 | (attr & 0x80) ? TILE_FLIPX : 0) | |
| 38 | (attr & 0x80) ? TILE_FLIPX : 0); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| r814 | r815 | |
| 52 | 52 | paletteram=NULL; |
| 53 | 53 | |
| 54 | 54 | |
| 55 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 55 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 56 | 56 | |
| 57 | 57 | tilemap_set_transparent_pen(bg_tilemap,15); |
| 58 | 58 |
| r814 | r815 | |
|---|---|---|
| 196 | 196 | 0, |
| 197 | 197 | xevious_fg_videoram[tile_index] | (flip_screen ? 0x100 : 0), |
| 198 | 198 | ((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)); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 207 | 207 | 1, |
| 208 | 208 | code + ((attr & 0x01) << 8), |
| 209 | 209 | ((attr & 0x3c) >> 2) | ((code & 0x80) >> 3) | ((attr & 0x03) << 5), |
| 210 | TILE_FLIPYX((attr & 0xc0) >> 6)) | |
| 210 | TILE_FLIPYX((attr & 0xc0) >> 6)); | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | |
| r814 | r815 | |
| 220 | 220 | |
| 221 | 221 | VIDEO_START( xevious ) |
| 222 | 222 | { |
| 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); | |
| 225 | 225 | |
| 226 | 226 | tilemap_set_scrolldx(bg_tilemap,-20,288+27); |
| 227 | 227 | tilemap_set_scrolldy(bg_tilemap,-16,-16); |
| r814 | r815 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | static | |
| 22 | static | |
| 23 | 23 | { |
| 24 | 24 | /* logical (col,row) -> memory offset */ |
| 25 | 25 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x70) << 4) + ((row & 0x30) << 7); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | static | |
| 28 | static | |
| 29 | 29 | { |
| 30 | 30 | /* logical (col,row) -> memory offset */ |
| 31 | 31 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x30) << 4) + ((row & 0x70) << 6); |
| r814 | r815 | |
| 48 | 48 | 1, |
| 49 | 49 | scroll_ram[2*tile_index] + ((attr & 0x07) << 8), |
| 50 | 50 | color, |
| 51 | TILE_SPLIT(split_table[color]) | ((attr & 0x80) ? TILE_FLIPX : 0)) | |
| 51 | (attr & 0x80) ? TILE_FLIPX : 0); | |
| 52 | tileinfo->group = split_table[color]; | |
| 52 | 53 | } |
| 53 | 54 | |
| 54 | 55 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 58 | 59 | 0, |
| 59 | 60 | blktiger_txvideoram[tile_index] + ((attr & 0xe0) << 3), |
| 60 | 61 | attr & 0x1f, |
| 61 | 0) | |
| 62 | 0); | |
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | |
| r814 | r815 | |
| 72 | 73 | { |
| 73 | 74 | scroll_ram = auto_malloc(BGRAM_BANK_SIZE * BGRAM_BANKS); |
| 74 | 75 | |
| 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); | |
| 78 | 79 | |
| 79 | 80 | tilemap_set_transparent_pen(tx_tilemap,3); |
| 80 | 81 | |
| r814 | r815 | |
| 228 | 229 | fillbitmap(bitmap,machine->pens[1023],cliprect); |
| 229 | 230 | |
| 230 | 231 | if (bgon) |
| 231 | tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_ | |
| 232 | tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_DRAW_LAYER1,0); | |
| 232 | 233 | |
| 233 | 234 | if (objon) |
| 234 | 235 | draw_sprites(machine, bitmap,cliprect); |
| 235 | 236 | |
| 236 | 237 | if (bgon) |
| 237 | tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_ | |
| 238 | tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_DRAW_LAYER0,0); | |
| 238 | 239 | |
| 239 | 240 | if (chon) |
| 240 | 241 | tilemap_draw(bitmap,cliprect,tx_tilemap,0,0); |
| r814 | r815 | |
|---|---|---|
| 18 | 18 | palette_set_color_rgb(Machine,offset/2,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8)); |
| 19 | 19 | |
| 20 | 20 | /* 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_ | |
| 21 | /* the 5th bit is actually transparency, so I should use TILEMAP_TYPE_PEN | |
| 22 | 22 | if (offset<1024) { |
| 23 | 23 | palette_set_color_rgb(Machine,((offset&0x1f)/2) | (offset&0xffe0) | 2048,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8)); |
| 24 | 24 | palette_set_color_rgb(Machine,((offset&0x1f)/2) | (offset&0xffe0) | 2048 | 16,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8)); |
| r814 | r815 | |
| 54 | 54 | 1, |
| 55 | 55 | tile+back_bankbase, |
| 56 | 56 | color+back_palbase, |
| 57 | 0) | |
| 57 | 0); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 68 | 68 | 2, |
| 69 | 69 | tile+fore_bankbase, |
| 70 | 70 | color, |
| 71 | 0) | |
| 71 | 0); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 80 | 80 | 0, |
| 81 | 81 | tile, |
| 82 | 82 | color, |
| 83 | 0) | |
| 83 | 0); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | VIDEO_START( dynduke ) |
| 87 | 87 | { |
| 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); | |
| 91 | 91 | |
| 92 | 92 | tilemap_set_transmask(bg_layer,0,0x0000ffff,0xffff0000); /* 4bpp + The rest - 1bpp */ |
| 93 | 93 | |
| r814 | r815 | |
| 175 | 175 | tilemap_set_enable( fg_layer,fore_enable); |
| 176 | 176 | |
| 177 | 177 | if (back_enable) |
| 178 | tilemap_draw(bitmap,cliprect,bg_layer,TILEMAP_ | |
| 178 | tilemap_draw(bitmap,cliprect,bg_layer,TILEMAP_DRAW_LAYER1,0); | |
| 179 | 179 | else |
| 180 | 180 | fillbitmap(bitmap,get_black_pen(machine),cliprect); |
| 181 | 181 | |
| 182 | 182 | draw_sprites(machine,bitmap,cliprect,0); // Untested: does anything use it? Could be behind background |
| 183 | 183 | draw_sprites(machine,bitmap,cliprect,1); |
| 184 | tilemap_draw(bitmap,cliprect,bg_layer,TILEMAP_ | |
| 184 | tilemap_draw(bitmap,cliprect,bg_layer,TILEMAP_DRAW_LAYER0,0); | |
| 185 | 185 | draw_sprites(machine,bitmap,cliprect,2); |
| 186 | 186 | tilemap_draw(bitmap,cliprect,fg_layer,0,0); |
| 187 | 187 | draw_sprites(machine,bitmap,cliprect,3); |
| r814 | r815 | |
|---|---|---|
| 69 | 69 | int attr = videoram[tile_index]; |
| 70 | 70 | int code = attr & 0x3f; |
| 71 | 71 | int color = attr >> 6; |
| 72 | int flags = color ? TILE_ | |
| 72 | int flags = color ? TILE_F | |
| 73 | 73 | |
| 74 | SET_TILE_INFO(0, code, color, flags) | |
| 74 | SET_TILE_INFO(0, code, color, flags); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | VIDEO_START( tunhunt ) |
| r814 | r815 | |
| 87 | 87 | tmpbitmap = auto_bitmap_alloc( 256, 64, machine->screen[0].format ); |
| 88 | 88 | |
| 89 | 89 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 90 | TILEMAP_TYPE_ | |
| 90 | TILEMAP_TYPE_ | |
| 91 | 91 | |
| 92 | 92 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 93 | 93 | tilemap_set_scrollx(fg_tilemap, 0, 64); |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | code |= ((attr & 0x03) << 8); |
| 51 | 51 | |
| 52 | SET_TILE_INFO(0, code, 6, 0) | |
| 52 | SET_TILE_INFO(0, code, 6, 0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static TILE_GET_INFO( get_bg_tile_info ) |
| 56 | 56 | { |
| 57 | SET_TILE_INFO(2, tryout_vram[tile_index] & 0x7f, 0, 0) | |
| 57 | SET_TILE_INFO(2, tryout_vram[tile_index] & 0x7f, 0, 0); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | READ8_HANDLER( tryout_vram_r ) |
| r814 | r815 | |
| 154 | 154 | flip_screen_set(data & 1); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | static | |
| 157 | static | |
| 158 | 158 | { |
| 159 | 159 | return (row ^ 0x1f) + (col << 5); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | static | |
| 162 | static | |
| 163 | 163 | { |
| 164 | 164 | int a; |
| 165 | 165 | // if (col&0x20) |
| r814 | r815 | |
| 173 | 173 | |
| 174 | 174 | VIDEO_START( tryout ) |
| 175 | 175 | { |
| 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); | |
| 178 | 178 | |
| 179 | 179 | tryout_vram=auto_malloc(8 * 0x800); |
| 180 | 180 | tryout_vram_gfx=auto_malloc(0x6000); |
| r814 | r815 | |
|---|---|---|
| 32 | 32 | SET_TILE_INFO(ttl_gfx_index, code, attr, 0); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | static 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 | ||
| 41 | 35 | static void rng_sprite_callback(int *code, int *color, int *priority_mask) |
| 42 | 36 | { |
| 43 | 37 | *color = sprite_colorbase | (*color & 0x001f); |
| r814 | r815 | |
| 70 | 64 | |
| 71 | 65 | colour = 0x10 + (rng_936_videoram[tile_index*2] & 0x000f); |
| 72 | 66 | |
| 73 | SET_TILE_INFO(0, tileno, colour, TILE_FLIPYX(flipx)) | |
| 67 | SET_TILE_INFO(0, tileno, colour, TILE_FLIPYX(flipx)); | |
| 74 | 68 | } |
| 75 | 69 | |
| 76 | 70 | |
| r814 | r815 | |
| 92 | 86 | K053936_wraparound_enable(0, 0); |
| 93 | 87 | K053936_set_offset(0, 34, 9); |
| 94 | 88 | |
| 95 | rng_936_tilemap = tilemap_create(get_rng_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 89 | rng_936_tilemap = tilemap_create(get_rng_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 96 | 90 | tilemap_set_transparent_pen(rng_936_tilemap, 0); |
| 97 | 91 | |
| 98 | 92 | /* find first empty slot to decode gfx */ |
| r814 | r815 | |
| 118 | 112 | } |
| 119 | 113 | |
| 120 | 114 | // create the tilemap |
| 121 | ttl_tilemap = tilemap_create(ttl_get_tile_info, t | |
| 115 | ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 122 | 116 | |
| 123 | 117 | tilemap_set_transparent_pen(ttl_tilemap, 0); |
| 124 | 118 |
| r814 | r815 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /* 512 by 512 playfield, 8 by 8 tiles */ |
| 25 | static | |
| 25 | static | |
| 26 | 26 | { |
| 27 | 27 | /* logical (col,row) -> memory offset */ |
| 28 | 28 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((row & 0x20) << 5) + ((col & 0x20) << 6); |
| r814 | r815 | |
| 40 | 40 | 0, |
| 41 | 41 | tile, |
| 42 | 42 | color, |
| 43 | 0) | |
| 43 | 0); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /* 512 by 512 playfield, 16 by 16 tiles */ |
| 47 | static | |
| 47 | static | |
| 48 | 48 | { |
| 49 | 49 | /* logical (col,row) -> memory offset */ |
| 50 | 50 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((row & 0x10) << 4) + ((col & 0x10) << 5); |
| r814 | r815 | |
| 62 | 62 | 1, |
| 63 | 63 | tile, |
| 64 | 64 | color, |
| 65 | 0) | |
| 65 | 0); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /* 512 by 1024 playfield, 16 by 16 tiles */ |
| 69 | static | |
| 69 | static | |
| 70 | 70 | { |
| 71 | 71 | /* logical (col,row) -> memory offset */ |
| 72 | 72 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((row & 0x30) << 4) + ((col & 0x10) << 6); |
| r814 | r815 | |
| 84 | 84 | 2, |
| 85 | 85 | tile, |
| 86 | 86 | color, |
| 87 | 0) | |
| 87 | 0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /* 2048 by 256 playfield, 16 by 16 tiles */ |
| 91 | static | |
| 91 | static | |
| 92 | 92 | { |
| 93 | 93 | /* logical (col,row) -> memory offset */ |
| 94 | 94 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x70) << 4); |
| r814 | r815 | |
| 106 | 106 | 2, |
| 107 | 107 | tile, |
| 108 | 108 | color, |
| 109 | 0) | |
| 109 | 0); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /******************************************************************************/ |
| 113 | 113 | |
| 114 | 114 | VIDEO_START( madmotor ) |
| 115 | 115 | { |
| 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); | |
| 120 | 120 | |
| 121 | 121 | tilemap_set_transparent_pen(madmotor_pf1_tilemap,0); |
| 122 | 122 | tilemap_set_transparent_pen(madmotor_pf2_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 23 | 23 | int code = data & 0x3ff; |
| 24 | 24 | int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20); |
| 25 | 25 | int opaque = data & 0x8000; |
| 26 | SET_TILE_INFO(1, code, color, opaque ? TILE_ | |
| 26 | SET_TILE_INFO(1, code, color, opaque ? TILE_F | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| r814 | r815 | |
| 84 | 84 | }; |
| 85 | 85 | |
| 86 | 86 | /* initialize the playfield */ |
| 87 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 87 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 88 | 88 | |
| 89 | 89 | /* initialize the motion objects */ |
| 90 | 90 | atarimo_init(machine, 0, &modesc); |
| 91 | 91 | |
| 92 | 92 | /* initialize the alphanumerics */ |
| 93 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 93 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 94 | 94 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 95 | 95 | } |
| 96 | 96 |
| r814 | r815 | |
|---|---|---|
| 98 | 98 | int color = attr & 0x0f; |
| 99 | 99 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x20) ? TILE_FLIPY : 0); |
| 100 | 100 | |
| 101 | SET_TILE_INFO(0, code, color, flags) | |
| 101 | SET_TILE_INFO(0, code, color, flags); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | VIDEO_START( rocnrope ) |
| 105 | 105 | { |
| 106 | 106 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 107 | TILEMAP_TYPE_ | |
| 107 | TILEMAP_TYPE_ | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r814 | r815 | |
|---|---|---|
| 30 | 30 | 0, |
| 31 | 31 | (code & 0x0fff) + (gfxbank[bank] << 12), |
| 32 | 32 | ((code & 0xe000) >> 13) + 8 * charpalettebank, |
| 33 | 0) | |
| 33 | 0); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static TILE_GET_INFO( karatblz_bg1_tile_info ) |
| r814 | r815 | |
| 40 | 40 | 0, |
| 41 | 41 | (code & 0x1fff) + (gfxbank[0] << 13), |
| 42 | 42 | (code & 0xe000) >> 13, |
| 43 | 0) | |
| 43 | 0); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /* also spinlbrk */ |
| r814 | r815 | |
| 51 | 51 | 1, |
| 52 | 52 | (code & 0x1fff) + (gfxbank[1] << 13), |
| 53 | 53 | (code & 0xe000) >> 13, |
| 54 | 0) | |
| 54 | 0); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static TILE_GET_INFO( spinlbrk_bg1_tile_info ) |
| r814 | r815 | |
| 61 | 61 | 0, |
| 62 | 62 | (code & 0x0fff) + (gfxbank[0] << 12), |
| 63 | 63 | (code & 0xf000) >> 12, |
| 64 | 0) | |
| 64 | 0); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 72 | 72 | 0, |
| 73 | 73 | (code & 0x07ff) + (gfxbank[bank] << 11), |
| 74 | 74 | (code & 0xe000) >> 13, |
| 75 | 0) | |
| 75 | 0); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static TILE_GET_INFO( get_bg2_tile_info ) |
| r814 | r815 | |
| 83 | 83 | 1, |
| 84 | 84 | (code & 0x07ff) + (gfxbank[bank] << 11), |
| 85 | 85 | (code & 0xe000) >> 13, |
| 86 | 0) | |
| 86 | 0); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| r814 | r815 | |
| 95 | 95 | |
| 96 | 96 | VIDEO_START( pspikes ) |
| 97 | 97 | { |
| 98 | bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 98 | bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 99 | 99 | /* no bg2 in this game */ |
| 100 | 100 | |
| 101 | 101 | sprite_gfx = 1; |
| r814 | r815 | |
| 104 | 104 | |
| 105 | 105 | VIDEO_START( karatblz ) |
| 106 | 106 | { |
| 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); | |
| 109 | 109 | |
| 110 | 110 | tilemap_set_transparent_pen(bg2_tilemap,15); |
| 111 | 111 | |
| r814 | r815 | |
| 118 | 118 | { |
| 119 | 119 | int i; |
| 120 | 120 | |
| 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); | |
| 123 | 123 | |
| 124 | 124 | tilemap_set_transparent_pen(bg2_tilemap,15); |
| 125 | 125 | |
| r814 | r815 | |
| 143 | 143 | |
| 144 | 144 | VIDEO_START( turbofrc ) |
| 145 | 145 | { |
| 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); | |
| 148 | 148 | |
| 149 | 149 | tilemap_set_transparent_pen(bg2_tilemap,15); |
| 150 | 150 | |
| r814 | r815 | |
| 155 | 155 | |
| 156 | 156 | VIDEO_START( wbbc97 ) |
| 157 | 157 | { |
| 158 | bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 158 | bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 159 | 159 | /* no bg2 in this game */ |
| 160 | 160 | |
| 161 | 161 | tilemap_set_transparent_pen(bg1_tilemap,15); |
| r814 | r815 | |
| 736 | 736 | } |
| 737 | 737 | else |
| 738 | 738 | { |
| 739 | tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_ | |
| 739 | tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_D | |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | 742 | turbofrc_draw_sprites(machine,bitmap,cliprect,0,-1); |
| r814 | r815 | |
|---|---|---|
| 126 | 126 | 0, |
| 127 | 127 | tile, |
| 128 | 128 | color, |
| 129 | 0) | |
| 130 | tileinfo->priority = 0; | |
| 129 | 0); | |
| 130 | tileinfo->category = 0; | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 145 | 145 | 1, |
| 146 | 146 | tile, |
| 147 | 147 | color, |
| 148 | 0) | |
| 149 | tileinfo->priority = 0; | |
| 148 | 0); | |
| 149 | tileinfo->category = 0; | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | static TILE_GET_INFO( get_bg2_tile_info ) |
| r814 | r815 | |
| 164 | 164 | 2, |
| 165 | 165 | tile, |
| 166 | 166 | color, |
| 167 | 0) | |
| 168 | tileinfo->priority = 0; | |
| 167 | 0); | |
| 168 | tileinfo->category = 0; | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static TILE_GET_INFO( robokid_get_bg0_tile_info ) |
| r814 | r815 | |
| 183 | 183 | 0, |
| 184 | 184 | tile, |
| 185 | 185 | color, |
| 186 | 0) | |
| 187 | tileinfo->priority = 0; | |
| 186 | 0); | |
| 187 | tileinfo->category = 0; | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | static TILE_GET_INFO( robokid_get_bg1_tile_info ) |
| r814 | r815 | |
| 202 | 202 | 1, |
| 203 | 203 | tile, |
| 204 | 204 | color, |
| 205 | 0) | |
| 206 | tileinfo->priority = 0; | |
| 205 | 0); | |
| 206 | tileinfo->category = 0; | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | static TILE_GET_INFO( robokid_get_bg2_tile_info ) |
| r814 | r815 | |
| 221 | 221 | 2, |
| 222 | 222 | tile, |
| 223 | 223 | color, |
| 224 | 0) | |
| 225 | tileinfo->priority = 0; | |
| 224 | 0); | |
| 225 | tileinfo->category = 0; | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 238 | 238 | 5, |
| 239 | 239 | tile, |
| 240 | 240 | color, |
| 241 | 0) | |
| 242 | tileinfo->priority = 0; | |
| 241 | 0); | |
| 242 | tileinfo->category = 0; | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
| r814 | r815 | |
| 270 | 270 | videoram_alloc(machine, 0x2000); |
| 271 | 271 | |
| 272 | 272 | /* 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); | |
| 277 | 277 | |
| 278 | 278 | tilemap_set_transparent_pen( fg_tilemap, 15 ); |
| 279 | 279 | tilemap_set_transparent_pen( bg0_tilemap, 15 ); |
| r814 | r815 | |
| 289 | 289 | videoram_alloc(machine, 0x0800); |
| 290 | 290 | |
| 291 | 291 | /* 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); | |
| 296 | 296 | |
| 297 | 297 | tilemap_set_transparent_pen( fg_tilemap, 15 ); |
| 298 | 298 | tilemap_set_transparent_pen( bg1_tilemap, 15 ); |
| r814 | r815 | |
|---|---|---|
| 183 | 183 | int code = videoram[tile_index] + 8 * (colorram[tile_index] & 0x20); |
| 184 | 184 | int color = colorram[tile_index] & 0x1f; |
| 185 | 185 | |
| 186 | SET_TILE_INFO(0, code, color, 0) | |
| 186 | SET_TILE_INFO(0, code, color, 0); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 191 | 191 | int code = videoram[tile_index] + 8 * (colorram[tile_index] & 0x20); |
| 192 | 192 | int color = (colorram[tile_index] & 0x1f) + 32; |
| 193 | 193 | |
| 194 | SET_TILE_INFO(0, code, color, 0) | |
| 194 | SET_TILE_INFO(0, code, color, 0); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | VIDEO_START( docastle ) |
| 198 | 198 | { |
| 199 | 199 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 200 | TILEMAP_TYPE_ | |
| 200 | TILEMAP_TYPE_ | |
| 201 | 201 | |
| 202 | 202 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 203 | TILEMAP_TYPE_ | |
| 203 | TILEMAP_TYPE_ | |
| 204 | 204 | |
| 205 | 205 | tilemap_set_transparent_pen(fg_tilemap, 256); |
| 206 | 206 | } |
| r814 | r815 | |
|---|---|---|
| 110 | 110 | int code = mystston_videoram2[tile_index] + ((mystston_videoram2[tile_index + 0x200] & 0x01) << 8); |
| 111 | 111 | int flags = (tile_index & 0x10) ? TILE_FLIPY : 0; |
| 112 | 112 | |
| 113 | SET_TILE_INFO(1, code, 0, flags) | |
| 113 | SET_TILE_INFO(1, code, 0, flags); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 118 | 118 | int code = videoram[tile_index] + ((videoram[tile_index + 0x400] & 0x07) << 8); |
| 119 | 119 | int color = mystston_fgcolor; |
| 120 | 120 | |
| 121 | SET_TILE_INFO(0, code, color, 0) | |
| 121 | SET_TILE_INFO(0, code, color, 0); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | VIDEO_START( mystston ) |
| 125 | 125 | { |
| 126 | 126 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x, |
| 127 | TILEMAP_TYPE_ | |
| 127 | TILEMAP_TYPE_ | |
| 128 | 128 | |
| 129 | 129 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x, |
| 130 | TILEMAP_TYPE_ | |
| 130 | TILEMAP_TYPE_ | |
| 131 | 131 | |
| 132 | 132 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 133 | 133 | } |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | 0, |
| 25 | 25 | code, |
| 26 | 26 | 0x10, |
| 27 | 0) | |
| 27 | 0); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | static void stuff_palette( running_machine *machine, int source_index, int dest_index, int num_colors ) |
| r814 | r815 | |
| 88 | 88 | 0, |
| 89 | 89 | code + ((me_gfx_ctrl<<4)&0x700), |
| 90 | 90 | 0x10, |
| 91 | 0) | |
| 91 | 0); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| r814 | r815 | |
| 104 | 104 | old_bg_color = -1; |
| 105 | 105 | stuff_palette( machine, 0, 0, 16*8 ); |
| 106 | 106 | 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_ | |
| 107 | me_fg_tilemap = tilemap_create(get_me_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 108 | 108 | tilemap_set_transparent_pen(me_fg_tilemap,15); |
| 109 | me_bg_tilemap = tilemap_create(get_me_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 109 | me_bg_tilemap = tilemap_create(get_me_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 110 | 110 | tilemap_set_scrollx( me_fg_tilemap, 0, -mainsnk_offset ); |
| 111 | 111 | tilemap_set_scrollx( me_bg_tilemap, 0, -mainsnk_offset ); |
| 112 | 112 | } |
| r814 | r815 | |
|---|---|---|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| 95 | static UINT32 get_tile_offset( UINT32 col, UINT32 row, | |
| 96 | UINT32 numcols, UINT32 numrows ) | |
| 95 | static TILEMAP_MAPPER( get_tile_offset ) | |
| 97 | 96 | { |
| 98 | 97 | // this optimisation is not much good to us, |
| 99 | 98 | // since we really need row,col in the get_tile_info() routines |
| r814 | r815 | |
| 508 | 507 | namcond1_gfxbank = 0; |
| 509 | 508 | |
| 510 | 509 | /* 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); | |
| 514 | 513 | |
| 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); | |
| 518 | 517 | |
| 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); | |
| 522 | 521 | |
| 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); | |
| 526 | 525 | |
| 527 | 526 | tilemap_A = NULL; |
| 528 | 527 | tilemap_B = NULL; |
| r814 | r815 | |
|---|---|---|
| 56 | 56 | int flags = (attr & 0x80) ? TILE_FLIPY : 0; |
| 57 | 57 | |
| 58 | 58 | if (senjyo && (tile_index & 0x1f) >= 32-8) |
| 59 | flags |= TILE_ | |
| 59 | flags |= TILE_F | |
| 60 | 60 | |
| 61 | 61 | SET_TILE_INFO( |
| 62 | 62 | 0, |
| 63 | 63 | senjyo_fgvideoram[tile_index] + ((attr & 0x10) << 4), |
| 64 | 64 | attr & 0x07, |
| 65 | flags) | |
| 65 | flags); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static TILE_GET_INFO( senjyo_bg1_tile_info ) |
| r814 | r815 | |
| 72 | 72 | 1, |
| 73 | 73 | code, |
| 74 | 74 | (code & 0x70) >> 4, |
| 75 | 0) | |
| 75 | 0); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static TILE_GET_INFO( starforc_bg1_tile_info ) |
| r814 | r815 | |
| 85 | 85 | 1, |
| 86 | 86 | code, |
| 87 | 87 | colormap[(code & 0xe0) >> 5], |
| 88 | 0) | |
| 88 | 0); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static TILE_GET_INFO( get_bg2_tile_info ) |
| r814 | r815 | |
| 95 | 95 | 2, |
| 96 | 96 | code, |
| 97 | 97 | (code & 0xe0) >> 5, |
| 98 | 0) | |
| 98 | 0); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static TILE_GET_INFO( get_bg3_tile_info ) |
| r814 | r815 | |
| 105 | 105 | 3, |
| 106 | 106 | code, |
| 107 | 107 | (code & 0xe0) >> 5, |
| 108 | 0) | |
| 108 | 0); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| r814 | r815 | |
| 118 | 118 | |
| 119 | 119 | VIDEO_START( senjyo ) |
| 120 | 120 | { |
| 121 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 121 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 122 | 122 | |
| 123 | 123 | if (senjyo) |
| 124 | 124 | { |
| 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 */ | |
| 128 | 128 | } |
| 129 | 129 | else |
| 130 | 130 | { |
| 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 */ | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | tilemap_set_transparent_pen(fg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 99 | 99 | // int color = (attr & 0xf0) >> 4; |
| 100 | 100 | int flags = ((attr & 0x80) ? TILE_FLIPX : 0) | ((attr & 0x40) ? TILE_FLIPY : 0); |
| 101 | 101 | |
| 102 | SET_TILE_INFO(0, code, 0, flags) | |
| 102 | SET_TILE_INFO(0, code, 0, flags); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | VIDEO_START( yiear ) |
| 106 | 106 | { |
| 107 | 107 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 108 | TILEMAP_TYPE_ | |
| 108 | TILEMAP_TYPE_ | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 122 | 122 | int code = videoram[tile_index] + 256 * (attr & 0x03); |
| 123 | 123 | int color = attr >> 2; |
| 124 | 124 | |
| 125 | SET_TILE_INFO(0, code, color, 0) | |
| 125 | SET_TILE_INFO(0, code, color, 0); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | VIDEO_START( sonson ) |
| 129 | 129 | { |
| 130 | 130 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 131 | TILEMAP_TYPE_ | |
| 131 | TILEMAP_TYPE_ | |
| 132 | 132 | |
| 133 | 133 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 134 | 134 | } |
| r814 | r815 | |
|---|---|---|
| 82 | 82 | int code = sslam_tx_tileram[tile_index] & 0x0fff; |
| 83 | 83 | int colr = sslam_tx_tileram[tile_index] & 0xf000; |
| 84 | 84 | |
| 85 | SET_TILE_INFO(3,code+0xc000 ,colr >> 12,0) | |
| 85 | SET_TILE_INFO(3,code+0xc000 ,colr >> 12,0); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | WRITE16_HANDLER( sslam_tx_tileram_w ) |
| r814 | r815 | |
| 98 | 98 | int code = sslam_md_tileram[tile_index] & 0x0fff; |
| 99 | 99 | int colr = sslam_md_tileram[tile_index] & 0xf000; |
| 100 | 100 | |
| 101 | SET_TILE_INFO(2,code+0x2000 ,colr >> 12,0) | |
| 101 | SET_TILE_INFO(2,code+0x2000 ,colr >> 12,0); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | WRITE16_HANDLER( sslam_md_tileram_w ) |
| r814 | r815 | |
| 114 | 114 | int code = sslam_bg_tileram[tile_index] & 0x1fff; |
| 115 | 115 | int colr = sslam_bg_tileram[tile_index] & 0xe000; |
| 116 | 116 | |
| 117 | SET_TILE_INFO(1,code ,colr >> 13,0) | |
| 117 | SET_TILE_INFO(1,code ,colr >> 13,0); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | WRITE16_HANDLER( sslam_bg_tileram_w ) |
| r814 | r815 | |
| 131 | 131 | |
| 132 | 132 | //(sslam_bg_tileram[tile_index*2] & 0x0f00) == 0xf000 ??? |
| 133 | 133 | |
| 134 | SET_TILE_INFO(1,code,colr,0) | |
| 134 | SET_TILE_INFO(1,code,colr,0); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | WRITE16_HANDLER( powerbls_bg_tileram_w ) |
| r814 | r815 | |
| 142 | 142 | |
| 143 | 143 | VIDEO_START(sslam) |
| 144 | 144 | { |
| 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); | |
| 148 | 148 | |
| 149 | 149 | tilemap_set_transparent_pen(sslam_md_tilemap,0); |
| 150 | 150 | tilemap_set_transparent_pen(sslam_tx_tilemap,0); |
| r814 | r815 | |
| 155 | 155 | |
| 156 | 156 | VIDEO_START(powerbls) |
| 157 | 157 | { |
| 158 | sslam_bg_tilemap = tilemap_create(get_powerbls_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 158 | sslam_bg_tilemap = tilemap_create(get_powerbls_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 159 | 159 | |
| 160 | 160 | sprites_x_offset = -21; |
| 161 | 161 | state_save_register_global(sprites_x_offset); |
| r814 | r815 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | static | |
| 51 | static | |
| 52 | 52 | { |
| 53 | 53 | /* logical (col,row) -> memory offset */ |
| 54 | 54 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 6); /* skip 0x400 */ |
| r814 | r815 | |
| 73 | 73 | 0, |
| 74 | 74 | tile + bank*0x100 + pf1_bankbase, |
| 75 | 75 | ((K007121_ctrlram[0][6]&0x30)*2+16) + color, |
| 76 | 0) | |
| 76 | 0); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 95 | 95 | 1, |
| 96 | 96 | tile + bank*0x100 + pf2_bankbase, |
| 97 | 97 | ((K007121_ctrlram[1][6]&0x30)*2+16) + color, |
| 98 | 0) | |
| 98 | 0); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| r814 | r815 | |
| 108 | 108 | |
| 109 | 109 | VIDEO_START( hcastle ) |
| 110 | 110 | { |
| 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); | |
| 113 | 113 | |
| 114 | 114 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 115 | 115 | } |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | /******************************************************************************/ |
| 31 | 31 | |
| 32 | static | |
| 32 | static | |
| 33 | 33 | { |
| 34 | 34 | return (col&0xf) | ((row&0xf)<<4) | ((col&0x70)<<4) | ((row&0xf0)<<7); |
| 35 | 35 | } |
| r814 | r815 | |
| 55 | 55 | int color=tile >> 12; |
| 56 | 56 | tile=tile&0xfff; |
| 57 | 57 | |
| 58 | SET_TILE_INFO(2,tile+deadangle_tilebank*0x1000,color,0) | |
| 58 | SET_TILE_INFO(2,tile+deadangle_tilebank*0x1000,color,0); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 64 | 64 | int tile=videoram[offs]+((videoram[offs+1]&0xc0)<<2); |
| 65 | 65 | int color=videoram[offs+1]&0xf; |
| 66 | 66 | |
| 67 | SET_TILE_INFO(0,tile,color,0) | |
| 67 | SET_TILE_INFO(0,tile,color,0); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | VIDEO_START( deadang ) |
| 71 | 71 | { |
| 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); | |
| 76 | 76 | |
| 77 | 77 | tilemap_set_transparent_pen(pf2_layer, 15); |
| 78 | 78 | tilemap_set_transparent_pen(pf1_layer, 15); |
| r814 | r815 | |
|---|---|---|
| 66 | 66 | 2, |
| 67 | 67 | tile_number, |
| 68 | 68 | color, |
| 69 | 0) | |
| 69 | 0); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 80 | 80 | 1, |
| 81 | 81 | tile_number, |
| 82 | 82 | color, |
| 83 | 0) | |
| 83 | 0); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 94 | 94 | 0, |
| 95 | 95 | tile_number, |
| 96 | 96 | color, |
| 97 | 0) | |
| 97 | 0); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /*************************************************************************** |
| r814 | r815 | |
| 103 | 103 | |
| 104 | 104 | static void twincobr_create_tilemaps(void) |
| 105 | 105 | { |
| 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); | |
| 109 | 109 | |
| 110 | 110 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 111 | 111 | tilemap_set_transparent_pen(tx_tilemap,0); |
| r814 | r815 | |
| 502 | 502 | |
| 503 | 503 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 504 | 504 | |
| 505 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 505 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_D | |
| 506 | 506 | draw_sprites(machine, bitmap,cliprect,0x0400); |
| 507 | 507 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); |
| 508 | 508 | draw_sprites(machine, bitmap,cliprect,0x0800); |
| r814 | r815 | |
|---|---|---|
| 20 | 20 | 0, |
| 21 | 21 | ram[tile_index] + ((ram[tile_index+1] & 0x3f) << 8), |
| 22 | 22 | ram[tile_index+2] & 0x0f, |
| 23 | 0) | |
| 23 | 0); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | static TILE_GET_INFO( get_tile_info0 ) |
| r814 | r815 | |
| 43 | 43 | |
| 44 | 44 | VIDEO_START( hexion ) |
| 45 | 45 | { |
| 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); | |
| 48 | 48 | |
| 49 | 49 | tilemap_set_transparent_pen(bg_tilemap[0],0); |
| 50 | 50 | tilemap_set_scrollx(bg_tilemap[1],0,-4); |
| r814 | r815 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | K007342_tilemap_update(); |
| 62 | 62 | |
| 63 | K007342_tilemap_draw( bitmap, cliprect, 0, TILEMAP_ | |
| 63 | K007342_tilemap_draw( bitmap, cliprect, 0, TILEMAP_D | |
| 64 | 64 | K007420_sprites_draw( bitmap, cliprect ); |
| 65 | K007342_tilemap_draw( bitmap, cliprect, 0, 1 | TILEMAP_ | |
| 65 | K007342_tilemap_draw( bitmap, cliprect, 0, 1 | TILEMAP_D | |
| 66 | 66 | return 0; |
| 67 | 67 | } |
| r814 | r815 | |
|---|---|---|
| 57 | 57 | 0, |
| 58 | 58 | code+bank*256, |
| 59 | 59 | ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7), |
| 60 | 0) | |
| 60 | 0); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static TILE_GET_INFO( get_tile_info1 ) |
| r814 | r815 | |
| 82 | 82 | 0, |
| 83 | 83 | code+bank*256, |
| 84 | 84 | ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7), |
| 85 | 0) | |
| 85 | 0); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| r814 | r815 | |
| 94 | 94 | |
| 95 | 95 | VIDEO_START( labyrunr ) |
| 96 | 96 | { |
| 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); | |
| 99 | 99 | |
| 100 | 100 | tilemap_set_transparent_pen(layer0,0); |
| 101 | 101 | tilemap_set_transparent_pen(layer1,0); |
| r814 | r815 | |
| 167 | 167 | tilemap_set_scrolly(layer0,(i+2) & 0x1f,K007121_ctrlram[0][0x02]); |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | tilemap_draw(bitmap,&finalclip0,layer0,TILEMAP_ | |
| 170 | tilemap_draw(bitmap,&finalclip0,layer0,TILEMAP_D | |
| 171 | 171 | K007121_sprites_draw(machine,0,bitmap,cliprect,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5); |
| 172 | 172 | /* 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_ | |
| 173 | tilemap_draw(bitmap,&finalclip1,layer1,TILEMAP_D | |
| 174 | 174 | } |
| 175 | 175 | else |
| 176 | 176 | { |
| r814 | r815 | |
|---|---|---|
| 70 | 70 | int code = (attr & 0x0fff) | ((ddragon3_bg_tilebase & 0x01) << 12); |
| 71 | 71 | int color = ((attr & 0xf000) >> 12) + 16; |
| 72 | 72 | |
| 73 | SET_TILE_INFO(0, code, color, 0) | |
| 73 | SET_TILE_INFO(0, code, color, 0); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 94 | 94 | state_save_register_global(ddragon3_bg_tilebase); |
| 95 | 95 | |
| 96 | 96 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 97 | TILEMAP_TYPE_ | |
| 97 | TILEMAP_TYPE_ | |
| 98 | 98 | |
| 99 | 99 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 100 | TILEMAP_TYPE_ | |
| 100 | TILEMAP_TYPE_ | |
| 101 | 101 | |
| 102 | 102 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 103 | 103 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| r814 | r815 | |
| 182 | 182 | |
| 183 | 183 | if ((ddragon3_vreg & 0x60) == 0x40) |
| 184 | 184 | { |
| 185 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 185 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_D | |
| 186 | 186 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 187 | 187 | draw_sprites(machine, bitmap, cliprect); |
| 188 | 188 | } |
| 189 | 189 | else if ((ddragon3_vreg & 0x60) == 0x60) |
| 190 | 190 | { |
| 191 | tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_ | |
| 191 | tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_D | |
| 192 | 192 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 193 | 193 | draw_sprites(machine, bitmap, cliprect); |
| 194 | 194 | } |
| 195 | 195 | else |
| 196 | 196 | { |
| 197 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 197 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_D | |
| 198 | 198 | draw_sprites(machine, bitmap, cliprect); |
| 199 | 199 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 200 | 200 | } |
| r814 | r815 | |
| 210 | 210 | |
| 211 | 211 | if(ddragon3_vreg & 8) |
| 212 | 212 | { |
| 213 | tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_ | |
| 213 | tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_D | |
| 214 | 214 | draw_sprites(machine, bitmap, cliprect); |
| 215 | 215 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 216 | 216 | } |
| 217 | 217 | else |
| 218 | 218 | { |
| 219 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 219 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_D | |
| 220 | 220 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 221 | 221 | draw_sprites(machine, bitmap, cliprect); |
| 222 | 222 | } |
| r814 | r815 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | UINT8 code = sprint2_video_ram[tile_index]; |
| 21 | 21 | |
| 22 | SET_TILE_INFO(0, code & 0x3f, code >> 7, 0) | |
| 22 | SET_TILE_INFO(0, code & 0x3f, code >> 7, 0); | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| r814 | r815 | |
| 27 | 27 | { |
| 28 | 28 | helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 29 | 29 | |
| 30 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 30 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 |
| r814 | r815 | |
|---|---|---|
| 13 | 13 | static tilemap* bg_tilemap; |
| 14 | 14 | |
| 15 | 15 | |
| 16 | static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) | |
| 17 | { | |
| 18 | return num_cols * row + col; | |
| 19 | } | |
| 20 | ||
| 21 | ||
| 22 | 16 | static TILE_GET_INFO( get_tile_info ) |
| 23 | 17 | { |
| 24 | 18 | UINT8 code = dragrace_playfield_ram[tile_index]; |
| r814 | r815 | |
| 49 | 43 | break; |
| 50 | 44 | } |
| 51 | 45 | |
| 52 | SET_TILE_INFO(((code & 0xA0) == 0x80) ? 1 : 0, num, col, 0) | |
| 46 | SET_TILE_INFO(((code & 0xA0) == 0x80) ? 1 : 0, num, col, 0); | |
| 53 | 47 | } |
| 54 | 48 | |
| 55 | 49 | |
| 56 | 50 | VIDEO_START( dragrace ) |
| 57 | 51 | { |
| 58 | 52 | bg_tilemap = tilemap_create( |
| 59 | get_tile_info, | |
| 53 | get_tile_info, | |
| 60 | 54 | } |
| 61 | 55 | |
| 62 | 56 |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) | |
| 32 | { | |
| 33 | return num_cols * row + col; | |
| 34 | } | |
| 35 | ||
| 36 | ||
| 37 | 31 | static TILE_GET_INFO( get_tile_info ) |
| 38 | 32 | { |
| 39 | 33 | UINT8 code = orbit_playfield_ram[tile_index]; |
| r814 | r815 | |
| 49 | 43 | flags |= TILE_FLIPY; |
| 50 | 44 | } |
| 51 | 45 | |
| 52 | SET_TILE_INFO(3, code & 0x3f, 0, flags) | |
| 46 | SET_TILE_INFO(3, code & 0x3f, 0, flags); | |
| 53 | 47 | } |
| 54 | 48 | |
| 55 | 49 | |
| 56 | 50 | VIDEO_START( orbit ) |
| 57 | 51 | { |
| 58 | bg_tilemap = tilemap_create(get_tile_info, | |
| 52 | bg_tilemap = tilemap_create(get_tile_info, | |
| 59 | 53 | } |
| 60 | 54 | |
| 61 | 55 |
| r814 | r815 | |
|---|---|---|
| 425 | 425 | |
| 426 | 426 | tile &= 0xfff; |
| 427 | 427 | |
| 428 | SET_TILE_INFO(0, tile, color, 0) | |
| 428 | SET_TILE_INFO(0, tile, color, 0); | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | static TILE_GET_INFO( get_back_tile_info ) |
| r814 | r815 | |
| 439 | 439 | if( rf2_layer_bank[0] ) |
| 440 | 440 | tile |= 0x4000; |
| 441 | 441 | |
| 442 | SET_TILE_INFO(1, tile, color, 0) | |
| 442 | SET_TILE_INFO(1, tile, color, 0); | |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | static TILE_GET_INFO( get_mid_tile_info ) |
| r814 | r815 | |
| 454 | 454 | if( rf2_layer_bank[1] ) |
| 455 | 455 | tile |= 0x4000; |
| 456 | 456 | |
| 457 | SET_TILE_INFO(1, tile, color + 16, 0) | |
| 457 | SET_TILE_INFO(1, tile, color + 16, 0); | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | static TILE_GET_INFO( get_fore_tile_info ) |
| r814 | r815 | |
| 471 | 471 | |
| 472 | 472 | tile |= ((layer_bank >> 27) & 0x1) << 13; |
| 473 | 473 | |
| 474 | SET_TILE_INFO(1, tile, color + 8, 0) | |
| 474 | SET_TILE_INFO(1, tile, color + 8, 0); | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | VIDEO_START( spi ) |
| r814 | r815 | |
| 479 | 479 | int i; |
| 480 | 480 | int region_length; |
| 481 | 481 | |
| 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 ); | |
| 486 | 486 | |
| 487 | 487 | tilemap_set_transparent_pen(text_layer, 31); |
| 488 | 488 | tilemap_set_transparent_pen(mid_layer, 63); |
| r814 | r815 | |
| 565 | 565 | UINT8 *t; |
| 566 | 566 | UINT32 xscroll_mask, yscroll_mask; |
| 567 | 567 | mame_bitmap *pen_bitmap; |
| 568 | mame_bitmap * | |
| 568 | mame_bitmap *flags_bitmap; | |
| 569 | 569 | |
| 570 | 570 | pen_bitmap = tilemap_get_pixmap(tile); |
| 571 | | |
| 571 | flags_bitmap = tilemap_get_flags | |
| 572 | 572 | xscroll_mask = pen_bitmap->width - 1; |
| 573 | 573 | yscroll_mask = pen_bitmap->height - 1; |
| 574 | 574 | |
| r814 | r815 | |
| 584 | 584 | |
| 585 | 585 | d = BITMAP_ADDR16(bitmap, j, 0); |
| 586 | 586 | s = BITMAP_ADDR16(pen_bitmap, (j+y) & yscroll_mask, 0); |
| 587 | t = BITMAP_ADDR8( | |
| 587 | t = BITMAP_ADDR8(flags_bitmap, (j+y) & yscroll_mask, 0); | |
| 588 | 588 | for (i=cliprect->min_x+rx; i <= cliprect->max_x+rx; i++) |
| 589 | 589 | { |
| 590 | if (opaque || (t[i & xscroll_mask] & (TILE | |
| 590 | if (opaque || (t[i & xscroll_mask] & (TILEM | |
| 591 | 591 | { |
| 592 | 592 | UINT16 pen = s[i & xscroll_mask]; |
| 593 | 593 | UINT8 alpha = alpha_table[pen]; |
| r814 | r815 | |
|---|---|---|
| 57 | 57 | int color = (tecfri_colorram[tile_index] >> 4) & 0x0f; |
| 58 | 58 | int flags = tecfri_colorram[tile_index] & 0x08 ? TILE_FLIPX : 0; |
| 59 | 59 | |
| 60 | SET_TILE_INFO(0, code, color, flags) | |
| 60 | SET_TILE_INFO(0, code, color, flags); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static TILE_GET_INFO( get_tile_info_fg ) |
| r814 | r815 | |
| 66 | 66 | int color = (tecfri_colorram2[tile_index] >> 4) & 0x0f; |
| 67 | 67 | int flags = tecfri_colorram2[tile_index] & 0x08 ? TILE_FLIPX : 0; |
| 68 | 68 | |
| 69 | SET_TILE_INFO(1, code, color, flags) | |
| 69 | SET_TILE_INFO(1, code, color, flags); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /* Sauro */ |
| r814 | r815 | |
| 85 | 85 | VIDEO_START( sauro ) |
| 86 | 86 | { |
| 87 | 87 | bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols, |
| 88 | TILEMAP_TYPE_ | |
| 88 | TILEMAP_TYPE_ | |
| 89 | 89 | |
| 90 | 90 | fg_tilemap = tilemap_create(get_tile_info_fg, tilemap_scan_cols, |
| 91 | TILEMAP_TYPE_ | |
| 91 | TILEMAP_TYPE_ | |
| 92 | 92 | |
| 93 | 93 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 94 | 94 | } |
| r814 | r815 | |
| 157 | 157 | VIDEO_START( trckydoc ) |
| 158 | 158 | { |
| 159 | 159 | bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols, |
| 160 | TILEMAP_TYPE_ | |
| 160 | TILEMAP_TYPE_ | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | static void trckydoc_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 87 | 87 | ***************************************************************************/ |
| 88 | 88 | |
| 89 | 89 | /* convert from 32x32 to 36x28 */ |
| 90 | static | |
| 90 | static | |
| 91 | 91 | { |
| 92 | 92 | int offs; |
| 93 | 93 | |
| r814 | r815 | |
| 104 | 104 | static TILE_GET_INFO( get_tile_info ) |
| 105 | 105 | { |
| 106 | 106 | UINT8 attr = gaplus_videoram[tile_index + 0x400]; |
| 107 | tileinfo-> | |
| 107 | tileinfo->categor | |
| 108 | 108 | SET_TILE_INFO( |
| 109 | 109 | 0, |
| 110 | 110 | gaplus_videoram[tile_index] + ((attr & 0x80) << 1), |
| 111 | 111 | attr & 0x3f, |
| 112 | 0) | |
| 112 | 0); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| r814 | r815 | |
| 196 | 196 | |
| 197 | 197 | VIDEO_START( gaplus ) |
| 198 | 198 | { |
| 199 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 199 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 200 | 200 | |
| 201 | 201 | tilemap_set_transparent_pen(bg_tilemap, 0xff); |
| 202 | 202 |
| r814 | r815 | |
|---|---|---|
| 51 | 51 | flags = ((col & 0x20) ? TILEMAP_FLIPY : 0) | ((col & 0x10) ? TILEMAP_FLIPX : 0); |
| 52 | 52 | col &= 0x0f; |
| 53 | 53 | |
| 54 | SET_TILE_INFO( 0, code, col, flags) | |
| 54 | SET_TILE_INFO( 0, code, col, flags); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static TILE_GET_INFO( get_bg2_tile_info ) |
| r814 | r815 | |
| 65 | 65 | flags = ((col & 0x20) ? TILEMAP_FLIPY : 0) | ((col & 0x10) ? TILEMAP_FLIPX : 0); |
| 66 | 66 | col &= 0x0f; |
| 67 | 67 | |
| 68 | SET_TILE_INFO( 1, code, col, flags) | |
| 68 | SET_TILE_INFO( 1, code, col, flags); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /****************************************************************************/ |
| r814 | r815 | |
| 103 | 103 | { |
| 104 | 104 | drmicro_videoram = auto_malloc(0x1000); |
| 105 | 105 | |
| 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); | |
| 108 | 108 | |
| 109 | 109 | tilemap_set_transparent_pen(drmicro_bg2,0); |
| 110 | 110 | } |
| r814 | r815 | |
|---|---|---|
| 94 | 94 | if (region == 1) |
| 95 | 95 | color &= 0x1f; |
| 96 | 96 | |
| 97 | SET_TILE_INFO(region, code, color, 0) | |
| 97 | SET_TILE_INFO(region, code, color, 0); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | VIDEO_START( speedatk ) |
| 101 | 101 | { |
| 102 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 102 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | VIDEO_UPDATE( speedatk ) |
| r814 | r815 | |
|---|---|---|
| 134 | 134 | 0, |
| 135 | 135 | (code & 0x07ff) + (tile_bank*0x800), |
| 136 | 136 | ((code & 0xf000) >> (16-4)) + ((code & 0x0800) >> (11-4)), |
| 137 | 0) | |
| 137 | 0); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | WRITE16_HANDLER( powerins_vram_0_w ) |
| r814 | r815 | |
| 143 | 143 | tilemap_mark_tile_dirty(tilemap_0, offset); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | ||
| 146 | static TILEMAP_MAPPER( powerins_get_memory_offset_0 | |
| 147 | 147 | { |
| 148 | 148 | return (col * TILES_PER_PAGE_Y) + |
| 149 | 149 | |
| r814 | r815 | |
| 174 | 174 | 1, |
| 175 | 175 | code & 0x0fff, |
| 176 | 176 | (code & 0xf000) >> (16-4), |
| 177 | 0) | |
| 177 | 0); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | WRITE16_HANDLER( powerins_vram_1_w ) |
| r814 | r815 | |
| 199 | 199 | { |
| 200 | 200 | tilemap_0 = tilemap_create( get_tile_info_0, |
| 201 | 201 | powerins_get_memory_offset_0, |
| 202 | TILEMAP_TYPE_ | |
| 202 | TILEMAP_TYPE_ | |
| 203 | 203 | 16,16, |
| 204 | 204 | DIM_NX_0, DIM_NY_0 ); |
| 205 | 205 | |
| 206 | 206 | tilemap_1 = tilemap_create( get_tile_info_1, |
| 207 | 207 | tilemap_scan_cols, |
| 208 | TILEMAP_TYPE_ | |
| 208 | TILEMAP_TYPE_ | |
| 209 | 209 | 8,8, |
| 210 | 210 | DIM_NX_1, DIM_NY_1 ); |
| 211 | 211 | |
| 212 | 212 | tilemap_set_scroll_rows(tilemap_0,1); |
| 213 | 213 | tilemap_set_scroll_cols(tilemap_0,1); |
| 214 | tilemap_set_transparent_pen(tilemap_0,15); | |
| 215 | 214 | |
| 216 | 215 | tilemap_set_scroll_rows(tilemap_1,1); |
| 217 | 216 | tilemap_set_scroll_cols(tilemap_1,1); |
| r814 | r815 | |
|---|---|---|
| 142 | 142 | int color = tilerom[tile_index + (8 * 8)]; |
| 143 | 143 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 144 | 144 | |
| 145 | SET_TILE_INFO(1, code, color, flags) | |
| 145 | SET_TILE_INFO(1, code, color, flags); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | static TILE_GET_INFO( get_fg_tile_info ) |
| 149 | 149 | { |
| 150 | 150 | int code = memory_region(REGION_GFX5)[tile_index]; |
| 151 | 151 | |
| 152 | SET_TILE_INFO(2, code, 0, 0) | |
| 152 | SET_TILE_INFO(2, code, 0, 0); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 157 | 157 | int code = videoram[tile_index] + 2 * (colorram[tile_index] & 0x80); |
| 158 | 158 | int color = colorram[tile_index] & 0x3f; |
| 159 | 159 | |
| 160 | SET_TILE_INFO(0, code, color, 0) | |
| 160 | SET_TILE_INFO(0, code, color, 0); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | static | |
| 163 | static | |
| 164 | 164 | { |
| 165 | 165 | /* logical (col,row) -> memory offset */ |
| 166 | 166 | return ((col * 32 & 0xe0) >> 5) + ((row * 32 & 0xe0) >> 2) + ((col * 32 & 0x3f00) >> 1) + 0x4000; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | static | |
| 169 | static | |
| 170 | 170 | { |
| 171 | 171 | /* logical (col,row) -> memory offset */ |
| 172 | 172 | return ((col * 16 & 0xf0) >> 4) + (row * 16 & 0xf0) + (col * 16 & 0x700) + ((row * 16 & 0x700) << 3); |
| r814 | r815 | |
| 175 | 175 | VIDEO_START( exedexes ) |
| 176 | 176 | { |
| 177 | 177 | bg_tilemap = tilemap_create(get_bg_tile_info, exedexes_bg_tilemap_scan, |
| 178 | TILEMAP_TYPE_ | |
| 178 | TILEMAP_TYPE_ | |
| 179 | 179 | |
| 180 | 180 | fg_tilemap = tilemap_create(get_fg_tile_info, exedexes_fg_tilemap_scan, |
| 181 | TILEMAP_TYPE_ | |
| 181 | TILEMAP_TYPE_ | |
| 182 | 182 | |
| 183 | 183 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_rows, |
| 184 | TILEMAP_TYPE_ | |
| 184 | TILEMAP_TYPE_ | |
| 185 | 185 | |
| 186 | 186 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 187 | 187 | tilemap_set_transparent_pen(tx_tilemap, 207); |
| r814 | r815 | |
|---|---|---|
| 698 | 698 | 0+depth, |
| 699 | 699 | code, |
| 700 | 700 | 0x40+colr, |
| 701 | flags) | |
| 702 | // tileinfo->priority = pri; | |
| 701 | flags); | |
| 702 | // tileinfo->category = pri; | |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | WRITE32_HANDLER ( skns_tilemapA_w ) |
| r814 | r815 | |
| 723 | 723 | 1+depth, |
| 724 | 724 | code, |
| 725 | 725 | 0x40+colr, |
| 726 | flags) | |
| 727 | // tileinfo->priority = pri; | |
| 726 | flags); | |
| 727 | // tileinfo->category = pri; | |
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | WRITE32_HANDLER ( skns_tilemapB_w ) |
| r814 | r815 | |
| 755 | 755 | |
| 756 | 756 | VIDEO_START(skns) |
| 757 | 757 | { |
| 758 | skns_tilemap_A = tilemap_create(get_tilemap_A_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 758 | skns_tilemap_A = tilemap_create(get_tilemap_A_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 759 | 759 | tilemap_set_transparent_pen(skns_tilemap_A,0); |
| 760 | 760 | |
| 761 | skns_tilemap_B = tilemap_create(get_tilemap_B_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 761 | skns_tilemap_B = tilemap_create(get_tilemap_B_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 762 | 762 | tilemap_set_transparent_pen(skns_tilemap_B,0); |
| 763 | 763 | |
| 764 | 764 | machine->gfx[2]->color_granularity=256; |
| r814 | r815 | |
| 805 | 805 | for(offs=0; offs<(0x1000/4); offs++) |
| 806 | 806 | tilemap_set_scrollx( skns_tilemap_A, offs, startx - (skns_v3slc_ram[offs]&0x3ff) ); |
| 807 | 807 | } |
| 808 | tilemap_draw(bitmap,cliprect,skns_tilemap_A,tran ? 0 : TILEMAP_ | |
| 808 | tilemap_draw(bitmap,cliprect,skns_tilemap_A,tran ? 0 : TILEMAP_D | |
| 809 | 809 | } |
| 810 | 810 | else |
| 811 | 811 | { |
| 812 | 812 | tilemap_draw_roz(bitmap,cliprect,skns_tilemap_A,startx << 8,starty << 8, |
| 813 | 813 | incxx << 8,incxy << 8,incyx << 8,incyy << 8, |
| 814 | 814 | 1, /* wraparound */ |
| 815 | tran ? 0 : TILEMAP_ | |
| 815 | tran ? 0 : TILEMAP_D | |
| 816 | 816 | } |
| 817 | 817 | } |
| 818 | 818 | } |
| r814 | r815 | |
| 857 | 857 | for(offs=0; offs<(0x1000/4); offs++) |
| 858 | 858 | tilemap_set_scrollx( skns_tilemap_B, offs, startx - (skns_v3slc_ram[offs+(0x1000/4)]&0x3ff) ); |
| 859 | 859 | } |
| 860 | tilemap_draw(bitmap,cliprect,skns_tilemap_B,tran ? 0 : TILEMAP_ | |
| 860 | tilemap_draw(bitmap,cliprect,skns_tilemap_B,tran ? 0 : TILEMAP_D | |
| 861 | 861 | } |
| 862 | 862 | else |
| 863 | 863 | { |
| 864 | 864 | tilemap_draw_roz(bitmap,cliprect,skns_tilemap_B,startx << 8,starty << 8, |
| 865 | 865 | incxx << 8,incxy << 8,incyx << 8,incyy << 8, |
| 866 | 866 | 1, /* wraparound */ |
| 867 | tran ? 0 : TILEMAP_ | |
| 867 | tran ? 0 : TILEMAP_D | |
| 868 | 868 | } |
| 869 | 869 | } |
| 870 | 870 | } |
| r814 | r815 | |
|---|---|---|
| 48 | 48 | 0, |
| 49 | 49 | code + 256*bank, |
| 50 | 50 | (attr & 0x0f) + 16, |
| 51 | (attr & 0x20) ? TILE_FLIPY : 0) | |
| 51 | (attr & 0x20) ? TILE_FLIPY : 0); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static TILE_GET_INFO( get_tile_info_B ) |
| r814 | r815 | |
| 60 | 60 | 0, |
| 61 | 61 | code, |
| 62 | 62 | (attr & 0x0f) + 16, |
| 63 | 0) | |
| 63 | 0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r814 | r815 | |
| 72 | 72 | |
| 73 | 73 | VIDEO_START( flkatck ) |
| 74 | 74 | { |
| 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); | |
| 77 | 77 | |
| 78 | 78 | k007121_clip[0] = machine->screen[0].visarea; |
| 79 | 79 | k007121_clip[0].min_x += 40; |
| r814 | r815 | |
|---|---|---|
| 48 | 48 | 2, |
| 49 | 49 | tile_number, |
| 50 | 50 | color, |
| 51 | 0) | |
| 51 | 0); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static TILE_GET_INFO( get_fg_tile_info ){ |
| r814 | r815 | |
| 59 | 59 | 0, |
| 60 | 60 | tile_number, |
| 61 | 61 | color, |
| 62 | 0) | |
| 62 | 0); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | WRITE8_HANDLER( shootout_videoram_w ){ |
| r814 | r815 | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | VIDEO_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); | |
| 77 | 77 | tilemap_set_transparent_pen( foreground, 0 ); |
| 78 | 78 | } |
| 79 | 79 |
| r814 | r815 | |
|---|---|---|
| 82 | 82 | 0, |
| 83 | 83 | contra_fg_vram[tile_index]+bank*256, |
| 84 | 84 | ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7), |
| 85 | 0) | |
| 85 | 0); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 106 | 106 | 1, |
| 107 | 107 | contra_bg_vram[tile_index]+bank*256, |
| 108 | 108 | ((K007121_ctrlram[1][6]&0x30)*2+16)+(attr&7), |
| 109 | 0) | |
| 109 | 0); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 125 | 125 | 0, |
| 126 | 126 | contra_text_vram[tile_index]+bank*256, |
| 127 | 127 | ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7), |
| 128 | 0) | |
| 128 | 0); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
| r814 | r815 | |
| 137 | 137 | |
| 138 | 138 | VIDEO_START( contra ) |
| 139 | 139 | { |
| 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); | |
| 143 | 143 | |
| 144 | 144 | private_spriteram = auto_malloc(0x800); |
| 145 | 145 | private_spriteram_2 = auto_malloc(0x800); |
| r814 | r815 | |
|---|---|---|
| 155 | 155 | VIDEO_START( paradise ) |
| 156 | 156 | { |
| 157 | 157 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 158 | TILEMAP_TYPE_ | |
| 158 | TILEMAP_TYPE_ | |
| 159 | 159 | |
| 160 | 160 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 161 | TILEMAP_TYPE_ | |
| 161 | TILEMAP_TYPE_ | |
| 162 | 162 | |
| 163 | 163 | tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 164 | TILEMAP_TYPE_ | |
| 164 | TILEMAP_TYPE_ | |
| 165 | 165 | |
| 166 | 166 | /* pixmap */ |
| 167 | 167 | tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| r814 | r815 | |
|---|---|---|
| 163 | 163 | tile += 0xc0; /* 0xc0-0xff -> 0x180-0x1bf */ |
| 164 | 164 | tile |= tile_h_bank; |
| 165 | 165 | |
| 166 | SET_TILE_INFO(1, tile, color, 0) | |
| 166 | SET_TILE_INFO(1, tile, color, 0); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
| r814 | r815 | |
| 176 | 176 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 177 | 177 | |
| 178 | 178 | /* info offset type w h col row */ |
| 179 | tx_tilemap = tilemap_create(chaknpop_get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 179 | tx_tilemap = tilemap_create(chaknpop_get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 180 | 180 | |
| 181 | tilemap_set_transparent_pen(tx_tilemap, 0); | |
| 182 | ||
| 183 | 181 | vram1 = &RAM[0x10000]; |
| 184 | 182 | vram2 = &RAM[0x12000]; |
| 185 | 183 | vram3 = &RAM[0x14000]; |
| r814 | r815 | |
|---|---|---|
| 54 | 54 | int xflip = (fof_bak_tileram[tile_index*2] & 0x0020)>>5; |
| 55 | 55 | xflip ^= 1; |
| 56 | 56 | |
| 57 | SET_TILE_INFO(2,code,colr,TILE_FLIPYX(xflip)) | |
| 57 | SET_TILE_INFO(2,code,colr,TILE_FLIPYX(xflip)); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | WRITE16_HANDLER( fof_bak_tileram_w ) |
| r814 | r815 | |
| 71 | 71 | int xflip = (fof_mid_tileram[tile_index*2] & 0x0020)>>5; |
| 72 | 72 | xflip ^= 1; |
| 73 | 73 | |
| 74 | SET_TILE_INFO(1,code,colr,TILE_FLIPYX(xflip)) | |
| 74 | SET_TILE_INFO(1,code,colr,TILE_FLIPYX(xflip)); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | WRITE16_HANDLER( fof_mid_tileram_w ) |
| r814 | r815 | |
| 88 | 88 | int xflip = (fof_txt_tileram[tile_index*2] & 0x0020)>>5; |
| 89 | 89 | xflip ^= 1; |
| 90 | 90 | |
| 91 | SET_TILE_INFO(0,code,colr,TILE_FLIPYX(xflip)) | |
| 91 | SET_TILE_INFO(0,code,colr,TILE_FLIPYX(xflip)); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | WRITE16_HANDLER( fof_txt_tileram_w ) |
| r814 | r815 | |
| 101 | 101 | |
| 102 | 102 | VIDEO_START(fitfight) |
| 103 | 103 | { |
| 104 | fof_bak_tilemap = tilemap_create(get_fof_bak_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 104 | fof_bak_tilemap = tilemap_create(get_fof_bak_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 105 | 105 | /* opaque */ |
| 106 | 106 | |
| 107 | fof_mid_tilemap = tilemap_create(get_fof_mid_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 107 | fof_mid_tilemap = tilemap_create(get_fof_mid_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 108 | 108 | tilemap_set_transparent_pen(fof_mid_tilemap,0); |
| 109 | 109 | |
| 110 | fof_txt_tilemap = tilemap_create(get_fof_txt_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 110 | fof_txt_tilemap = tilemap_create(get_fof_txt_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 111 | 111 | tilemap_set_transparent_pen(fof_txt_tilemap,0); |
| 112 | 112 | } |
| 113 | 113 |
| r814 | r815 | |
|---|---|---|
| 20 | 20 | 2, |
| 21 | 21 | code & 0xfff, |
| 22 | 22 | ((code >> 12) & 0x0f), |
| 23 | 0) | |
| 23 | 0); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | static TILE_GET_INFO( get_joe_tile_info_2 ) |
| r814 | r815 | |
| 32 | 32 | 4, |
| 33 | 33 | (code & 0x7fff), |
| 34 | 34 | ((attr >> 8) & 0x1f) + 0x40, |
| 35 | 0) | |
| 35 | 0); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | static TILE_GET_INFO( get_joe_tile_info_3 ) |
| r814 | r815 | |
| 43 | 43 | 0, |
| 44 | 44 | code & 0xfff, |
| 45 | 45 | ((code >> 12) & 0x0f) + 0x10, |
| 46 | 0) | |
| 46 | 0); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static TILE_GET_INFO( get_joe_tile_info_4 ) |
| r814 | r815 | |
| 54 | 54 | 1, |
| 55 | 55 | code & 0xfff, |
| 56 | 56 | ((code >> 12) & 0x0f) + 0x60, |
| 57 | 0) | |
| 57 | 0); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | static TILE_GET_INFO( get_joe_tile_info_5 ) |
| r814 | r815 | |
| 66 | 66 | 4, |
| 67 | 67 | (code & 0x7fff), |
| 68 | 68 | ((attr >> 8) & 0x1f) + 0x20, |
| 69 | 0) | |
| 69 | 0); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static TILE_GET_INFO( get_joe_tile_info_6 ) |
| r814 | r815 | |
| 78 | 78 | 3, |
| 79 | 79 | (code & 0x1fff), |
| 80 | 80 | ((attr >> 8) & 0x1f) + 0x70, |
| 81 | 0) | |
| 81 | 0); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| r814 | r815 | |
| 91 | 91 | 3, |
| 92 | 92 | (code & 0x1fff), |
| 93 | 93 | ((attr >> 8) & 0x1f) + 0x70, |
| 94 | 0) | |
| 94 | 0); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | WRITE16_HANDLER( ashnojoe_tileram_w ) |
| r814 | r815 | |
| 185 | 185 | |
| 186 | 186 | VIDEO_START( ashnojoe ) |
| 187 | 187 | { |
| 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); | |
| 195 | 195 | |
| 196 | 196 | tilemap_set_transparent_pen(joetilemap, 15); |
| 197 | 197 | tilemap_set_transparent_pen(joetilemap2,15); |
| r814 | r815 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | VIDEO_START( amazon ) |
| 201 | 201 | { |
| 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); | |
| 204 | 204 | tilemap_set_transparent_pen(foreground,0xf); |
| 205 | 205 | |
| 206 | 206 | /* register for saving */ |
| r814 | r815 | |
|---|---|---|
| 839 | 839 | static TILE_GET_INFO( get_pf1_tile_info ) |
| 840 | 840 | { |
| 841 | 841 | 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); | |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | static TILE_GET_INFO( get_pf1a_tile_info ) |
| 846 | 846 | { |
| 847 | 847 | |
| 848 | 848 | 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); | |
| 850 | 850 | } |
| 851 | 851 | |
| 852 | 852 | static TILE_GET_INFO( get_pf2_tile_info ) |
| r814 | r815 | |
| 866 | 866 | } |
| 867 | 867 | } |
| 868 | 868 | |
| 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); | |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | 872 | static TILE_GET_INFO( get_pf3_tile_info ) |
| r814 | r815 | |
| 886 | 886 | } |
| 887 | 887 | } |
| 888 | 888 | |
| 889 | SET_TILE_INFO(2,(tile&0xfff)|deco32_pf3_bank,colour,flags) | |
| 889 | SET_TILE_INFO(2,(tile&0xfff)|deco32_pf3_bank,colour,flags); | |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | 892 | static TILE_GET_INFO( get_pf4_tile_info ) |
| r814 | r815 | |
| 906 | 906 | } |
| 907 | 907 | } |
| 908 | 908 | |
| 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); | |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | /* Captain America tilemap chip 2 has different banking and colour from normal */ |
| 913 | 913 | static TILE_GET_INFO( get_ca_pf3_tile_info ) |
| 914 | 914 | { |
| 915 | 915 | 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); | |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | 919 | static TILE_GET_INFO( get_ll_pf3_tile_info ) |
| r814 | r815 | |
| 928 | 928 | flags|=TILE_FLIPY; |
| 929 | 929 | } |
| 930 | 930 | |
| 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); | |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | static TILE_GET_INFO( get_ll_pf4_tile_info ) |
| r814 | r815 | |
| 943 | 943 | flags|=TILE_FLIPY; |
| 944 | 944 | } |
| 945 | 945 | |
| 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); | |
| 947 | 947 | } |
| 948 | 948 | |
| 949 | 949 | VIDEO_START( captaven ) |
| 950 | 950 | { |
| 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); | |
| 955 | 955 | deco32_raster_display_list=auto_malloc(10 * 256); |
| 956 | 956 | memset(deco32_raster_display_list, 0, 10 * 256); |
| 957 | 957 | |
| r814 | r815 | |
| 967 | 967 | |
| 968 | 968 | VIDEO_START( fghthist ) |
| 969 | 969 | { |
| 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); | |
| 974 | 974 | pf1a_tilemap =0; |
| 975 | 975 | dirty_palette = auto_malloc(4096); |
| 976 | 976 | |
| r814 | r815 | |
| 979 | 979 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 980 | 980 | tilemap_set_transparent_pen(pf2_tilemap,0); |
| 981 | 981 | tilemap_set_transparent_pen(pf3_tilemap,0); |
| 982 | tilemap_set_transparent_pen(pf4_tilemap,0); | |
| 983 | 982 | |
| 984 | 983 | deco32_raster_display_list=0; |
| 985 | 984 | deco32_pf2_colourbank=deco32_pf4_colourbank=0; |
| r814 | r815 | |
| 988 | 987 | |
| 989 | 988 | VIDEO_START( dragngun ) |
| 990 | 989 | { |
| 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); | |
| 996 | 995 | dirty_palette = auto_malloc(4096); |
| 997 | 996 | deco32_raster_display_list = auto_malloc(10 * 256); |
| 998 | 997 | |
| r814 | r815 | |
| 1011 | 1010 | |
| 1012 | 1011 | VIDEO_START( lockload ) |
| 1013 | 1012 | { |
| 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); | |
| 1019 | 1018 | dirty_palette = auto_malloc(4096); |
| 1020 | 1019 | deco32_raster_display_list = auto_malloc(10 * 256); |
| 1021 | 1020 | memset(deco32_raster_display_list, 0, 10 * 256); |
| r814 | r815 | |
| 1035 | 1034 | |
| 1036 | 1035 | VIDEO_START( nslasher ) |
| 1037 | 1036 | { |
| 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); | |
| 1042 | 1041 | pf1a_tilemap =0; |
| 1043 | 1042 | dirty_palette = auto_malloc(4096); |
| 1044 | 1043 | |
| r814 | r815 | |
| 1241 | 1240 | fillbitmap(priority_bitmap,0,cliprect); |
| 1242 | 1241 | if ((deco32_pri&1)==0) { |
| 1243 | 1242 | if (pf3_enable) |
| 1244 | tilemap_draw(bitmap,cliprect,pf3_tilemap,TILEMAP_ | |
| 1243 | tilemap_draw(bitmap,cliprect,pf3_tilemap,TILEMAP_D | |
| 1245 | 1244 | else |
| 1246 | 1245 | fillbitmap(bitmap,get_black_pen(machine),cliprect); |
| 1247 | 1246 | |
| r814 | r815 | |
| 1252 | 1251 | } else { |
| 1253 | 1252 | if (pf2_enable) { |
| 1254 | 1253 | if (deco32_raster_display_position) |
| 1255 | tilemap_raster_draw(bitmap,cliprect,TILEMAP_ | |
| 1254 | tilemap_raster_draw(bitmap,cliprect,TILEMAP_D | |
| 1256 | 1255 | else |
| 1257 | 1256 | tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0); |
| 1258 | 1257 | } |
| r814 | r815 | |
|---|---|---|
| 176 | 176 | 3, |
| 177 | 177 | ((hi & 0xc0) << 2) | lo, |
| 178 | 178 | hi & 0x0f, |
| 179 | TILE_FLIPYX((hi & 0x30) >> 4)) | |
| 179 | TILE_FLIPYX((hi & 0x30) >> 4)); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | static TILE_GET_INFO( argus_get_bg0_tile_info ) |
| r814 | r815 | |
| 190 | 190 | 1, |
| 191 | 191 | ((hi & 0xc0) << 2) | lo, |
| 192 | 192 | hi & 0x0f, |
| 193 | TILE_FLIPYX((hi & 0x30) >> 4)) | |
| 193 | TILE_FLIPYX((hi & 0x30) >> 4)); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | static TILE_GET_INFO( argus_get_bg1_tile_info ) |
| r814 | r815 | |
| 204 | 204 | 2, |
| 205 | 205 | lo, |
| 206 | 206 | hi & 0x0f, |
| 207 | TILE_FLIPYX((hi & 0x30) >> 4)) | |
| 207 | TILE_FLIPYX((hi & 0x30) >> 4)); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | static TILE_GET_INFO( valtric_get_tx_tile_info ) |
| r814 | r815 | |
| 218 | 218 | 2, |
| 219 | 219 | ((hi & 0xc0) << 2) | lo, |
| 220 | 220 | hi & 0x0f, |
| 221 | TILE_FLIPYX((hi & 0x30) >> 4)) | |
| 221 | TILE_FLIPYX((hi & 0x30) >> 4)); | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | static TILE_GET_INFO( valtric_get_bg_tile_info ) |
| r814 | r815 | |
| 235 | 235 | 1, |
| 236 | 236 | tile, |
| 237 | 237 | color, |
| 238 | 0) | |
| 238 | 0); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | static TILE_GET_INFO( butasan_get_tx_tile_info ) |
| r814 | r815 | |
| 251 | 251 | 3, |
| 252 | 252 | ((hi & 0xc0) << 2) | lo, |
| 253 | 253 | hi & 0x0f, |
| 254 | TILE_FLIPYX((hi & 0x30) >> 4)) | |
| 254 | TILE_FLIPYX((hi & 0x30) >> 4)); | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | static TILE_GET_INFO( butasan_get_bg0_tile_info ) |
| r814 | r815 | |
| 270 | 270 | 1, |
| 271 | 271 | ((hi & 0xc0) << 2) | lo, |
| 272 | 272 | hi & 0x0f, |
| 273 | TILE_FLIPYX((hi & 0x30) >> 4)) | |
| 273 | TILE_FLIPYX((hi & 0x30) >> 4)); | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| r814 | r815 | |
| 294 | 294 | 2, |
| 295 | 295 | tile, |
| 296 | 296 | color, |
| 297 | 0) | |
| 297 | 0); | |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | |
| r814 | r815 | |
| 306 | 306 | { |
| 307 | 307 | lowbitscroll = 0; |
| 308 | 308 | /* 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); | |
| 312 | 312 | |
| 313 | 313 | /* dummy RAM for back ground */ |
| 314 | 314 | argus_dummy_bg0ram = auto_malloc( 0x800 ); |
| r814 | r815 | |
| 327 | 327 | VIDEO_START( valtric ) |
| 328 | 328 | { |
| 329 | 329 | /* 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); | |
| 332 | 332 | |
| 333 | 333 | tilemap_set_transparent_pen( bg1_tilemap, 15 ); |
| 334 | 334 | tilemap_set_transparent_pen( tx_tilemap, 15 ); |
| r814 | r815 | |
| 340 | 340 | VIDEO_START( butasan ) |
| 341 | 341 | { |
| 342 | 342 | /* 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); | |
| 346 | 346 | |
| 347 | 347 | butasan_txram = auto_malloc( BUTASAN_TEXT_RAMSIZE ); |
| 348 | 348 | butasan_bg0ram = auto_malloc( BUTASAN_BG0_RAMSIZE ); |
| r814 | r815 | |
| 372 | 372 | 2, |
| 373 | 373 | ((hi & 0xc0) << 2) | lo, |
| 374 | 374 | hi & 0x0f, |
| 375 | TILE_FLIPYX((hi & 0x30) >> 4)) | |
| 375 | TILE_FLIPYX((hi & 0x30) >> 4)); | |
| 376 | 376 | } |
| 377 | 377 | #endif |
| 378 | 378 | |
| r814 | r815 | |
| 388 | 388 | 1, |
| 389 | 389 | tileno, |
| 390 | 390 | col, |
| 391 | 0) | |
| 391 | 0); | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | |
| 395 | 395 | VIDEO_START( bombsa ) |
| 396 | 396 | { |
| 397 | 397 | /* 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); | |
| 400 | 400 | |
| 401 | 401 | #if 0 |
| 402 | 402 | /* this might be wrong.. but it looks like there may be a tilemap here that can change between 8x8 and 16x16 mode.. */ |
| 403 | 403 | /* 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_ | |
| 404 | tx_alt_tilemap = tilemap_create(bombsa_get_tx_alt_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 405 | 405 | #endif |
| 406 | 406 | |
| 407 | bombsa_bg_tilemap = tilemap_create(bombsa_get_bg_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 407 | bombsa_bg_tilemap = tilemap_create(bombsa_get_bg_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 408 | 408 | |
| 409 | 409 | #if 0 |
| 410 | 410 | bombsa_tx_alt_ram = auto_malloc(0x800); |
| r814 | r815 | |
|---|---|---|
| 98 | 98 | SET_TILE_INFO(3, state->centerram[tile_index], 0, 0); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | static | |
| 101 | static | |
| 102 | 102 | { |
| 103 | 103 | return (col % 32) + row * 32 + (col / 32) * 32*32; |
| 104 | 104 | } |
| r814 | r815 | |
| 111 | 111 | state->work_bitmap = auto_bitmap_alloc(32,32,machine->screen[0].format); |
| 112 | 112 | |
| 113 | 113 | /* 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); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | #if 0 |
| r814 | r815 | |
|---|---|---|
| 62 | 62 | static TILE_GET_INFO( get_bg_tile_info ) |
| 63 | 63 | { |
| 64 | 64 | 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*/ ); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static TILE_GET_INFO( get_fg_tile_info ) |
| 69 | 69 | { |
| 70 | 70 | 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*/); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static TILE_GET_INFO( get_tx_tile_info ) |
| 75 | 75 | { |
| 76 | 76 | 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*/); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | VIDEO_START( lkage ) |
| 81 | 81 | { |
| 82 | 82 | bg_tile_bank = fg_tile_bank = 0; |
| 83 | 83 | |
| 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); | |
| 87 | 87 | |
| 88 | 88 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 89 | 89 | tilemap_set_transparent_pen(tx_tilemap,0); |
| r814 | r815 | |
| 203 | 203 | } |
| 204 | 204 | else |
| 205 | 205 | { |
| 206 | tilemap_draw( bitmap,cliprect,tx_tilemap,TILEMAP_ | |
| 206 | tilemap_draw( bitmap,cliprect,tx_tilemap,TILEMAP_D | |
| 207 | 207 | } |
| 208 | 208 | draw_sprites(machine, bitmap,cliprect ); |
| 209 | 209 | return 0; |
| r814 | r815 | |
|---|---|---|
| 20 | 20 | 0, |
| 21 | 21 | tile_number, |
| 22 | 22 | (attr&0xf), |
| 23 | 0) | |
| 23 | 0); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | static TILE_GET_INFO( get_bg_tile_info ){ |
| r814 | r815 | |
| 31 | 31 | 1, |
| 32 | 32 | tile_number, |
| 33 | 33 | (attr&0xf), |
| 34 | 0) | |
| 34 | 0); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | WRITE8_HANDLER( ninjakid_fg_videoram_w ){ |
| r814 | r815 | |
| 197 | 197 | *******************************************************************************/ |
| 198 | 198 | |
| 199 | 199 | VIDEO_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 ); | |
| 202 | 202 | tilemap_set_transparent_pen( fg_tilemap,0 ); |
| 203 | 203 | |
| 204 | 204 | /* Save State Support */ |
| r814 | r815 | |
|---|---|---|
| 27 | 27 | 1, |
| 28 | 28 | videoram1[tile_index] & 0x0fff, |
| 29 | 29 | (videoram2[tile_index] & 0xf0) >> 4, |
| 30 | 0) | |
| 30 | 0); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 38 | 38 | 2, |
| 39 | 39 | videoram1[tile_index] & 0x0fff, |
| 40 | 40 | (videoram2[tile_index] & 0xf0) >> 4, |
| 41 | 0) | |
| 41 | 0); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | static TILE_GET_INFO( get_fg_tile_info_raiga ) |
| r814 | r815 | |
| 47 | 47 | UINT16 *videoram2 = gaiden_videoram2; |
| 48 | 48 | |
| 49 | 49 | /* bit 3 controls blending */ |
| 50 | tileinfo-> | |
| 50 | tileinfo->categor | |
| 51 | 51 | |
| 52 | 52 | SET_TILE_INFO( |
| 53 | 53 | 2, |
| 54 | 54 | 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); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 64 | 64 | 0, |
| 65 | 65 | videoram1[tile_index] & 0x07ff, |
| 66 | 66 | (videoram2[tile_index] & 0xf0) >> 4, |
| 67 | 0) | |
| 67 | 0); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| r814 | r815 | |
| 77 | 77 | VIDEO_START( gaiden ) |
| 78 | 78 | { |
| 79 | 79 | /* 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); | |
| 83 | 83 | |
| 84 | 84 | tilemap_set_transparent_pen(background, 0); |
| 85 | 85 | tilemap_set_transparent_pen(foreground, 0); |
| r814 | r815 | |
| 92 | 92 | tile_bitmap_bg = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16); |
| 93 | 93 | tile_bitmap_fg = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16); |
| 94 | 94 | |
| 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); | |
| 98 | 98 | |
| 99 | 99 | tilemap_set_transparent_pen(background,0); |
| 100 | 100 | tilemap_set_transparent_pen(foreground,0); |
| r814 | r815 | |
| 107 | 107 | VIDEO_START( drgnbowl ) |
| 108 | 108 | { |
| 109 | 109 | /* 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); | |
| 113 | 113 | |
| 114 | 114 | tilemap_set_transparent_pen(foreground, 15); |
| 115 | 115 | tilemap_set_transparent_pen(text_layer, 15); |
| r814 | r815 | |
|---|---|---|
| 97 | 97 | int sy = tile_index / 32; |
| 98 | 98 | int code = videoram[tile_index]; |
| 99 | 99 | 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); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
| r814 | r815 | |
| 105 | 105 | { |
| 106 | 106 | int code = videoram[tile_index]; |
| 107 | 107 | int color = color_codes[code] & 0x0f; |
| 108 | SET_TILE_INFO(0, code, color * 2, 0) | |
| 108 | SET_TILE_INFO(0, code, color * 2, 0); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| r814 | r815 | |
| 113 | 113 | { |
| 114 | 114 | int code = videoram[tile_index] + (congo_fg_bank << 8); |
| 115 | 115 | int color = colorram[tile_index] & 0x1f; |
| 116 | SET_TILE_INFO(0, code, color * 2, 0) | |
| 116 | SET_TILE_INFO(0, code, color * 2, 0); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
| r814 | r815 | |
| 124 | 124 | * |
| 125 | 125 | *************************************/ |
| 126 | 126 | |
| 127 | static void video_start_common(running_machine *machine, tile_get_info_ | |
| 127 | static void video_start_common(running_machine *machine, tile_get_info_callback fg_tile_info) | |
| 128 | 128 | { |
| 129 | 129 | /* reset globals */ |
| 130 | 130 | bg_enable = 0; |
| r814 | r815 | |
| 136 | 136 | memset(congo_custom, 0, sizeof(congo_custom)); |
| 137 | 137 | |
| 138 | 138 | /* 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); | |
| 141 | 141 | |
| 142 | 142 | /* configure the foreground tilemap */ |
| 143 | 143 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| r814 | r815 | |
|---|---|---|
| 27 | 27 | 0, |
| 28 | 28 | tile_number, |
| 29 | 29 | color, |
| 30 | (attributes&0x04)?TILE_FLIPX:0) | |
| 30 | (attributes&0x04)?TILE_FLIPX:0); | |
| 31 | 31 | } |
| 32 | 32 | else |
| 33 | 33 | { |
| r814 | r815 | |
| 41 | 41 | 0, |
| 42 | 42 | tile_number, |
| 43 | 43 | color, |
| 44 | (attributes&0x80)?TILE_FLIPX:0) | |
| 44 | (attributes&0x80)?TILE_FLIPX:0); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | tileinfo-> | |
| 47 | tileinfo->categor | |
| 48 | 48 | (memory_region( REGION_PROMS )[0x800+color*4]==2)?1:0; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | VIDEO_START( shangkid ) |
| 52 | 52 | { |
| 53 | background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 53 | background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | WRITE8_HANDLER( shangkid_videoram_w ) |
| r814 | r815 | |
|---|---|---|
| 161 | 161 | if( bg_bank ) |
| 162 | 162 | code |= 0x400; |
| 163 | 163 | |
| 164 | SET_TILE_INFO(0, code, color, flags) | |
| 164 | SET_TILE_INFO(0, code, color, flags); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | VIDEO_START( trackfld ) |
| 168 | 168 | { |
| 169 | 169 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 170 | TILEMAP_TYPE_ | |
| 170 | TILEMAP_TYPE_ | |
| 171 | 171 | |
| 172 | 172 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 173 | 173 | } |
| r814 | r815 | |
|---|---|---|
| 115 | 115 | UINT16 code = charbank | fastfred_videoram[tile_index]; |
| 116 | 116 | UINT8 color = colorbank | (fastfred_attributesram[2 * x + 1] & 0x07); |
| 117 | 117 | |
| 118 | SET_TILE_INFO(0, code, color, 0) | |
| 118 | SET_TILE_INFO(0, code, color, 0); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| r814 | r815 | |
| 128 | 128 | |
| 129 | 129 | VIDEO_START( fastfred ) |
| 130 | 130 | { |
| 131 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 131 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 132 | 132 | |
| 133 | 133 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 134 | 134 | } |
| r814 | r815 | |
| 345 | 345 | UINT16 code = charbank * 0x100 + fastfred_videoram[tile_index]; |
| 346 | 346 | UINT8 color = colorbank | (fastfred_attributesram[2 * x + 1] & 0x07); |
| 347 | 347 | |
| 348 | SET_TILE_INFO(0, code, color, 0) | |
| 348 | SET_TILE_INFO(0, code, color, 0); | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | static TILE_GET_INFO( imago_get_tile_info_fg ) |
| 352 | 352 | { |
| 353 | 353 | int code = imago_fg_videoram[tile_index]; |
| 354 | SET_TILE_INFO(2, code, 2, 0) | |
| 354 | SET_TILE_INFO(2, code, 2, 0); | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | static TILE_GET_INFO( imago_get_tile_info_web ) |
| 358 | 358 | { |
| 359 | SET_TILE_INFO(3, tile_index & 0x1ff, 0, 0) | |
| 359 | SET_TILE_INFO(3, tile_index & 0x1ff, 0, 0); | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | WRITE8_HANDLER( imago_fg_videoram_w ) |
| r814 | r815 | |
| 376 | 376 | |
| 377 | 377 | VIDEO_START( imago ) |
| 378 | 378 | { |
| 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); | |
| 382 | 382 | |
| 383 | 383 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 384 | 384 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| r814 | r815 | |
|---|---|---|
| 215 | 215 | 0, |
| 216 | 216 | tile&0xfff, |
| 217 | 217 | tile>>14, |
| 218 | 0) | |
| 218 | 0); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | WRITE16_HANDLER( karnov_videoram_w ) |
| r814 | r815 | |
| 240 | 240 | dirty_f=auto_malloc(0x800); |
| 241 | 241 | memset(dirty_f,1,0x800); |
| 242 | 242 | |
| 243 | fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 243 | fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 244 | 244 | |
| 245 | 245 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 246 | 246 | } |
| r814 | r815 | |
| 253 | 253 | dirty_f=auto_malloc(0x800); |
| 254 | 254 | memset(dirty_f,1,0x800); |
| 255 | 255 | |
| 256 | fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 256 | fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 257 | 257 | |
| 258 | 258 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 259 | 259 | } |
| r814 | r815 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | static | |
| 24 | static | |
| 25 | 25 | { |
| 26 | 26 | return (row * 0x800) | (col * 2); |
| 27 | 27 | } |
| r814 | r815 | |
| 36 | 36 | 0, |
| 37 | 37 | code + ((color & 0xc0) << 2), |
| 38 | 38 | color & 0x0f, |
| 39 | TILE_FLIPYX((color & 0x30) >> 4)) | |
| 39 | TILE_FLIPYX((color & 0x30) >> 4)); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | static TILE_GET_INFO( lwings_get_bg1_tile_info ) |
| r814 | r815 | |
| 49 | 49 | 1, |
| 50 | 50 | code + ((color & 0xe0) << 3), |
| 51 | 51 | color & 0x07, |
| 52 | TILE_FLIPYX((color & 0x18) >> 3)) | |
| 52 | TILE_FLIPYX((color & 0x18) >> 3)); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static TILE_GET_INFO( trojan_get_bg1_tile_info ) |
| r814 | r815 | |
| 63 | 63 | 1, |
| 64 | 64 | code, |
| 65 | 65 | 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; | |
| 67 | 68 | } |
| 68 | 69 | |
| 69 | 70 | static TILE_GET_INFO( get_bg2_tile_info ) |
| r814 | r815 | |
| 79 | 80 | 3, |
| 80 | 81 | code + ((color & 0x80) << 1), |
| 81 | 82 | color & 0x07, |
| 82 | TILE_FLIPYX((color & 0x30) >> 4)) | |
| 83 | TILE_FLIPYX((color & 0x30) >> 4)); | |
| 83 | 84 | } |
| 84 | 85 | |
| 85 | 86 | /*************************************************************************** |
| r814 | r815 | |
| 90 | 91 | |
| 91 | 92 | VIDEO_START( lwings ) |
| 92 | 93 | { |
| 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); | |
| 95 | 96 | |
| 96 | 97 | tilemap_set_transparent_pen(fg_tilemap,3); |
| 97 | 98 | } |
| 98 | 99 | |
| 99 | 100 | VIDEO_START( trojan ) |
| 100 | 101 | { |
| 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); | |
| 104 | 105 | |
| 105 | 106 | tilemap_set_transparent_pen(fg_tilemap,3); |
| 106 | 107 | tilemap_set_transmask(bg1_tilemap,0,0xffff,0x0001); /* split type 0 is totally transparent in front half */ |
| r814 | r815 | |
| 279 | 280 | VIDEO_UPDATE( trojan ) |
| 280 | 281 | { |
| 281 | 282 | tilemap_draw(bitmap,cliprect,bg2_tilemap,0,0); |
| 282 | tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_ | |
| 283 | tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 283 | 284 | trojan_draw_sprites(machine,bitmap,cliprect); |
| 284 | tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_ | |
| 285 | tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 285 | 286 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); |
| 286 | 287 | return 0; |
| 287 | 288 | } |
| r814 | r815 | |
|---|---|---|
| 219 | 219 | |
| 220 | 220 | VIDEO_START( punchout ) |
| 221 | 221 | { |
| 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); | |
| 224 | 224 | tilemap_set_scroll_rows(bottilemap, 32); |
| 225 | 225 | |
| 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); | |
| 228 | 228 | |
| 229 | 229 | fgtilemap = NULL; |
| 230 | 230 | } |
| r814 | r815 | |
| 247 | 247 | SET_TILE_INFO(0, code, color, flipx ? TILE_FLIPX : 0); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | static | |
| 250 | static | |
| 251 | 251 | { |
| 252 | 252 | int halfcols = num_cols/2; |
| 253 | 253 | return (col/halfcols)*(halfcols*num_rows) + row*halfcols + col%halfcols; |
| r814 | r815 | |
| 263 | 263 | |
| 264 | 264 | VIDEO_START( armwrest ) |
| 265 | 265 | { |
| 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); | |
| 268 | 268 | |
| 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); | |
| 271 | 271 | |
| 272 | fgtilemap = tilemap_create(armwrest_fg_get_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 272 | fgtilemap = tilemap_create(armwrest_fg_get_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 273 | 273 | tilemap_set_transparent_pen(fgtilemap, 7); |
| 274 | 274 | } |
| 275 | 275 |
| r814 | r815 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | int code = videoram[tile_index]; |
| 80 | 80 | |
| 81 | SET_TILE_INFO(0, code, 0, 0) | |
| 81 | SET_TILE_INFO(0, code, 0, 0); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static TILE_GET_INFO( get_fg_tile_info ) |
| 85 | 85 | { |
| 86 | 86 | int code = (kopunch_videoram2[tile_index] & 0x7f) + 128 * gfxbank; |
| 87 | 87 | |
| 88 | SET_TILE_INFO(1, code, 0, 0) | |
| 88 | SET_TILE_INFO(1, code, 0, 0); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | VIDEO_START( kopunch ) |
| 92 | 92 | { |
| 93 | 93 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 94 | TILEMAP_TYPE_ | |
| 94 | TILEMAP_TYPE_ | |
| 95 | 95 | |
| 96 | 96 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 97 | TILEMAP_TYPE_ | |
| 97 | TILEMAP_TYPE_ | |
| 98 | 98 | |
| 99 | 99 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 100 | 100 | } |
| r814 | r815 | |
|---|---|---|
| 30 | 30 | 3, |
| 31 | 31 | tecmo_bgvideoram[tile_index] + ((attr & 0x07) << 8), |
| 32 | 32 | attr >> 4, |
| 33 | 0) | |
| 33 | 0); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 40 | 40 | 2, |
| 41 | 41 | tecmo_fgvideoram[tile_index] + ((attr & 0x07) << 8), |
| 42 | 42 | attr >> 4, |
| 43 | 0) | |
| 43 | 0); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static TILE_GET_INFO( gemini_get_bg_tile_info ) |
| r814 | r815 | |
| 50 | 50 | 3, |
| 51 | 51 | tecmo_bgvideoram[tile_index] + ((attr & 0x70) << 4), |
| 52 | 52 | attr & 0x0f, |
| 53 | 0) | |
| 53 | 0); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static TILE_GET_INFO( gemini_get_fg_tile_info ) |
| r814 | r815 | |
| 60 | 60 | 2, |
| 61 | 61 | tecmo_fgvideoram[tile_index] + ((attr & 0x70) << 4), |
| 62 | 62 | attr & 0x0f, |
| 63 | 0) | |
| 63 | 0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 70 | 70 | 0, |
| 71 | 71 | tecmo_txvideoram[tile_index] + ((attr & 0x03) << 8), |
| 72 | 72 | attr >> 4, |
| 73 | 0) | |
| 73 | 0); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| r814 | r815 | |
| 85 | 85 | { |
| 86 | 86 | if (tecmo_video_type == 2) /* gemini */ |
| 87 | 87 | { |
| 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); | |
| 90 | 90 | } |
| 91 | 91 | else /* rygar, silkworm */ |
| 92 | 92 | { |
| 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); | |
| 95 | 95 | } |
| 96 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 96 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 97 | 97 | |
| 98 | 98 | tilemap_set_transparent_pen(bg_tilemap,0); |
| 99 | 99 | tilemap_set_transparent_pen(fg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 23 | 23 | 0, |
| 24 | 24 | code & 0x0fff, |
| 25 | 25 | (code & 0xf000) >> 12, |
| 26 | 0) | |
| 26 | 0); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 38 | 38 | 0, |
| 39 | 39 | code, |
| 40 | 40 | color, |
| 41 | 0) | |
| 41 | 0); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| r814 | r815 | |
| 52 | 52 | VIDEO_START( news ) |
| 53 | 53 | { |
| 54 | 54 | |
| 55 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 55 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 56 | 56 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 57 | 57 | |
| 58 | bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 58 | bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 |
| r814 | r815 | |
|---|---|---|
| 73 | 73 | }; |
| 74 | 74 | |
| 75 | 75 | /* initialize the playfield */ |
| 76 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 76 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 77 | 77 | |
| 78 | 78 | /* initialize the motion objects */ |
| 79 | 79 | atarimo_init(machine, 0, &modesc); |
| r814 | r815 | |
|---|---|---|
| 802 | 802 | |
| 803 | 803 | palette=(attr&0xf)+0x18 ; |
| 804 | 804 | |
| 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)); | |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | VIDEO_START( toprollr ) |
| 809 | 809 | { |
| 810 | bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 810 | bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | static void toprollr_draw_big_sprite(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int priority) |
| r814 | r815 | |
|---|---|---|
| 75 | 75 | VIDEO_START( xorworld ) |
| 76 | 76 | { |
| 77 | 77 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 78 | TILEMAP_TYPE_ | |
| 78 | TILEMAP_TYPE_ | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /* |
| r814 | r815 | |
|---|---|---|
| 15 | 15 | int code = speedspn_vidram[tile_index*2+1] | (speedspn_vidram[tile_index*2] << 8); |
| 16 | 16 | int attr = speedspn_attram[tile_index^0x400]; |
| 17 | 17 | |
| 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); | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | VIDEO_START(speedspn) |
| 22 | 22 | { |
| 23 | 23 | speedspn_vidram = auto_malloc(0x1000 * 2); |
| 24 | speedspn_tilemap = tilemap_create(get_speedspn_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 24 | speedspn_tilemap = tilemap_create(get_speedspn_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | WRITE8_HANDLER( speedspn_vidram_w ) |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | int tile = videoram[offs + 1] + ((videoram[offs] & 0x07) << 8) + (charbank << 11); |
| 59 | 59 | int color = (videoram[offs] & 0xf8) >> 3; |
| 60 | 60 | |
| 61 | SET_TILE_INFO(0, tile, color, 0) | |
| 61 | SET_TILE_INFO(0, tile, color, 0); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | VIDEO_START( hexa ) |
| 65 | 65 | { |
| 66 | 66 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 67 | TILEMAP_TYPE_ | |
| 67 | TILEMAP_TYPE_ | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 |
| r814 | r815 | |
|---|---|---|
| 161 | 161 | { |
| 162 | 162 | int code = videoram[tile_index]; |
| 163 | 163 | |
| 164 | SET_TILE_INFO(0, code, 0, 0) | |
| 164 | SET_TILE_INFO(0, code, 0, 0); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | static void refresh_bitmaps(void) |
| r814 | r815 | |
| 181 | 181 | VIDEO_START( cloak ) |
| 182 | 182 | { |
| 183 | 183 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 184 | TILEMAP_TYPE_ | |
| 184 | TILEMAP_TYPE_ | |
| 185 | 185 | |
| 186 | 186 | tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 187 | 187 | tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| r814 | r815 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | if( data&0x8000 ) |
| 35 | 35 | { |
| 36 | SET_TILE_INFO( 0,tile,tilemap_color,TILE_ | |
| 36 | SET_TILE_INFO( 0,tile,tilemap_color,TILE_F | |
| 37 | 37 | } |
| 38 | 38 | else |
| 39 | 39 | { |
| r814 | r815 | |
| 219 | 219 | { |
| 220 | 220 | int i; |
| 221 | 221 | gfx_element *gfx0,*gfx1; |
| 222 | static tile_get_info_ | |
| 222 | static tile_get_info_callback get_info[4] = | |
| 223 | 223 | { tilemap_get_info0, tilemap_get_info1, tilemap_get_info2, tilemap_get_info3 }; |
| 224 | 224 | |
| 225 | 225 | for( i=0; i<NAMCONA1_NUM_TILEMAPS; i++ ) |
| r814 | r815 | |
| 227 | 227 | bg_tilemap[i] = tilemap_create( |
| 228 | 228 | get_info[i], |
| 229 | 229 | tilemap_scan_rows, |
| 230 | TILEMAP_TYPE_ | |
| 230 | TILEMAP_TYPE_PEN | |
| 231 | 231 | |
| 232 | 232 | tilemap_palette_bank[i] = -1; |
| 233 | 233 | } |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | static const int resistances[3] = { 1000, 470, 220 }; |
| 43 | 43 | |
| 44 | 44 | /* initialize the playfield */ |
| 45 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 45 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 46 | 46 | tilemap_set_transparent_pen(atarigen_playfield_tilemap, 0); |
| 47 | 47 | |
| 48 | 48 | /* adjust the playfield for the 8 pixel offset */ |
| r814 | r815 | |
| 123 | 123 | int offs; |
| 124 | 124 | |
| 125 | 125 | /* first draw the playfield opaquely */ |
| 126 | tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, TILEMAP_ | |
| 126 | tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, TILEMAP_D | |
| 127 | 127 | |
| 128 | 128 | /* then draw the non-transparent parts with a priority of 1 */ |
| 129 | 129 | fillbitmap(priority_bitmap, 0, 0); |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | int color = (attr & 0x40) >> 6; |
| 25 | 25 | int flags = (attr & 0x80) ? TILE_FLIPX : 0; |
| 26 | 26 | |
| 27 | SET_TILE_INFO(0, code, color, flags) | |
| 27 | SET_TILE_INFO(0, code, color, flags); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | VIDEO_START( bsktball ) |
| 31 | 31 | { |
| 32 | 32 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 33 | TILEMAP_TYPE_ | |
| 33 | TILEMAP_TYPE_ | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | static | |
| 32 | static | |
| 33 | 33 | { /* col: 0..63; row: 0..31 */ |
| 34 | 34 | switch( scroll_type ) |
| 35 | 35 | { |
| r814 | r815 | |
| 62 | 62 | 0, |
| 63 | 63 | tile_number + 256 * (attributes & 0x3), |
| 64 | 64 | attributes >> 4, |
| 65 | 0) | |
| 65 | 0); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 72 | 72 | 1, |
| 73 | 73 | data&0x7ff, |
| 74 | 74 | data>>11, |
| 75 | 0) | |
| 75 | 0); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| r814 | r815 | |
| 83 | 83 | 2, |
| 84 | 84 | data&0x3ff, |
| 85 | 85 | data>>11, |
| 86 | 0) | |
| 86 | 0); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| r814 | r815 | |
| 107 | 107 | sprite_offy = 128; |
| 108 | 108 | } |
| 109 | 109 | |
| 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); | |
| 114 | 114 | |
| 115 | 115 | tilemap_set_transparent_pen(fg_tilemap,0xf); |
| 116 | 116 | tilemap_set_transparent_pen(armedf_tx_tilemap,0xf); |
| r814 | r815 | |
|---|---|---|
| 427 | 427 | int code = videoram[tile_index] + 256 * gfx_bank; |
| 428 | 428 | int color = (color_codes[tile_index % 32 + 32 * (tile_index / 32 / 4)] & 0x0f) + 0x10 * palette_bank; |
| 429 | 429 | |
| 430 | SET_TILE_INFO(0, code, color, 0) | |
| 430 | SET_TILE_INFO(0, code, color, 0); | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | static TILE_GET_INFO( radarsc1_bg_tile_info ) |
| r814 | r815 | |
| 436 | 436 | int color = (color_codes[tile_index % 32] & 0x0f); |
| 437 | 437 | color = color | (palette_bank<<4); |
| 438 | 438 | |
| 439 | SET_TILE_INFO(0, code, color, 0) | |
| 439 | SET_TILE_INFO(0, code, color, 0); | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /*************************************************************************** |
| r814 | r815 | |
| 807 | 807 | |
| 808 | 808 | video_start_dkong_base(machine); |
| 809 | 809 | |
| 810 | bg_tilemap = tilemap_create(dkong_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 810 | bg_tilemap = tilemap_create(dkong_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 811 | 811 | tilemap_set_scrolldx(bg_tilemap, 0, 128); |
| 812 | 812 | } |
| 813 | 813 | |
| r814 | r815 | |
| 832 | 832 | |
| 833 | 833 | vid_hw = HW_TRS01; |
| 834 | 834 | |
| 835 | bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 835 | bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 836 | 836 | tilemap_set_scrolldx(bg_tilemap, 0, 128); |
| 837 | 837 | |
| 838 | 838 | bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| r814 | r815 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | if ((code & 0x30) == 0x30) |
| 45 | 45 | { |
| 46 | SET_TILE_INFO(0, code & ~0x40, (code >> 6) ^ 3, 0) | |
| 46 | SET_TILE_INFO(0, code & ~0x40, (code >> 6) ^ 3, 0); | |
| 47 | 47 | } |
| 48 | 48 | else |
| 49 | 49 | { |
| 50 | SET_TILE_INFO(0, code, 4, 0) | |
| 50 | SET_TILE_INFO(0, code, 4, 0); | |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| r814 | r815 | |
| 56 | 56 | { |
| 57 | 57 | helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 58 | 58 | |
| 59 | playfield = tilemap_create(sprint4_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 59 | playfield = tilemap_create(sprint4_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 |
| r814 | r815 | |
|---|---|---|
| 151 | 151 | ***************************************************************************/ |
| 152 | 152 | VIDEO_START( appoooh ) |
| 153 | 153 | { |
| 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); | |
| 156 | 156 | |
| 157 | 157 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 158 | 158 | tilemap_set_scrolldy(fg_tilemap,8,8); |
| r814 | r815 | |
|---|---|---|
| 191 | 191 | UINT8 attr = travrusa_videoram[2*tile_index+1]; |
| 192 | 192 | int flags = TILE_FLIPXY((attr & 0x30) >> 4); |
| 193 | 193 | |
| 194 | if ((attr & 0x0f) == 0x0f) | |
| 194 | tileinfo->group = ((attr & 0x0f) == 0x0f) ? | |
| 195 | 195 | |
| 196 | 196 | SET_TILE_INFO( |
| 197 | 197 | 0, |
| 198 | 198 | travrusa_videoram[2*tile_index] + ((attr & 0xc0) << 2), |
| 199 | 199 | attr & 0x0f, |
| 200 | flags) | |
| 200 | flags); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| r814 | r815 | |
| 210 | 210 | |
| 211 | 211 | VIDEO_START( travrusa ) |
| 212 | 212 | { |
| 213 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 213 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 214 | 214 | |
| 215 | 215 | tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */ |
| 216 | 216 | tilemap_set_transmask(bg_tilemap,1,0x3f,0xc0); /* split type 1 has pens 6 and 7 opaque - tunnels */ |
| r814 | r815 | |
| 325 | 325 | |
| 326 | 326 | VIDEO_UPDATE( travrusa ) |
| 327 | 327 | { |
| 328 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 328 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 329 | 329 | draw_sprites(machine, bitmap,cliprect); |
| 330 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 330 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 331 | 331 | return 0; |
| 332 | 332 | } |
| r814 | r815 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | ***************************************************************************/ |
| 75 | 75 | |
| 76 | ||
| 76 | static TILEMAP_MAPPER( metlclsh_bgtilemap_scan | |
| 77 | 77 | { |
| 78 | 78 | return (row & 7) + ((row & ~7) << 4) + ((col & 0xf) << 3) + ((col & ~0xf) << 4); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static TILE_GET_INFO( get_bg_tile_info ) |
| 82 | 82 | { |
| 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); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | WRITE8_HANDLER( metlclsh_bgram_w ) |
| r814 | r815 | |
| 123 | 123 | { |
| 124 | 124 | UINT8 code = metlclsh_fgram[tile_index + 0x000]; |
| 125 | 125 | 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); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | WRITE8_HANDLER( metlclsh_fgram_w ) |
| r814 | r815 | |
| 144 | 144 | { |
| 145 | 145 | metlclsh_otherram = auto_malloc(0x800); // banked ram |
| 146 | 146 | |
| 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); | |
| 149 | 149 | |
| 150 | 150 | tilemap_set_transparent_pen( bg_tilemap, 0 ); |
| 151 | 151 | tilemap_set_transparent_pen( fg_tilemap, 0 ); |
| r814 | r815 | |
|---|---|---|
| 63 | 63 | zoom_colorbase = 48; |
| 64 | 64 | K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tile_callback); |
| 65 | 65 | K051960_vh_start(machine,REGION_GFX2,NORMAL_PLANE_ORDER,sprite_callback); |
| 66 | K051316_vh_start_0(machine,REGION_GFX3,4, | |
| 66 | K051316_vh_start_0(machine,REGION_GFX3,4,F | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| r814 | r815 | |
| 80 | 80 | |
| 81 | 81 | if (k88games_priority) |
| 82 | 82 | { |
| 83 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_ | |
| 83 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_D | |
| 84 | 84 | K051960_sprites_draw(bitmap,cliprect,1,1); |
| 85 | 85 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0); |
| 86 | 86 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0); |
| r814 | r815 | |
| 89 | 89 | } |
| 90 | 90 | else |
| 91 | 91 | { |
| 92 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_ | |
| 92 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_D | |
| 93 | 93 | K051316_zoom_draw_0(bitmap,cliprect,0,0); |
| 94 | 94 | K051960_sprites_draw(bitmap,cliprect,0,0); |
| 95 | 95 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0); |
| r814 | r815 | |
|---|---|---|
| 107 | 107 | UINT16 code_hi = kaneko16_vram_##_N_[ 2 * tile_index + 0]; \ |
| 108 | 108 | UINT16 code_lo = kaneko16_vram_##_N_[ 2 * tile_index + 1]; \ |
| 109 | 109 | SET_TILE_INFO(1 + _N_/2, code_lo, (code_hi >> 2) & 0x3f, TILE_FLIPXY( code_hi & 3 )); \ |
| 110 | tileinfo-> | |
| 110 | tileinfo->categor | |
| 111 | 111 | } \ |
| 112 | 112 | \ |
| 113 | 113 | WRITE16_HANDLER( kaneko16_vram_##_N_##_w ) \ |
| r814 | r815 | |
| 133 | 133 | video_start_kaneko16_sprites(machine); |
| 134 | 134 | |
| 135 | 135 | kaneko16_tmap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 136 | TILEMAP_TYPE_ | |
| 136 | TILEMAP_TYPE_ | |
| 137 | 137 | kaneko16_tmap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 138 | TILEMAP_TYPE_ | |
| 138 | TILEMAP_TYPE_ | |
| 139 | 139 | |
| 140 | 140 | kaneko16_tmap_2 = 0; |
| 141 | 141 | |
| r814 | r815 | |
| 179 | 179 | video_start_kaneko16_1xVIEW2(machine); |
| 180 | 180 | |
| 181 | 181 | kaneko16_tmap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 182 | TILEMAP_TYPE_ | |
| 182 | TILEMAP_TYPE_ | |
| 183 | 183 | kaneko16_tmap_3 = tilemap_create( get_tile_info_3, tilemap_scan_rows, |
| 184 | TILEMAP_TYPE_ | |
| 184 | TILEMAP_TYPE_ | |
| 185 | 185 | |
| 186 | 186 | { |
| 187 | 187 | int dx, xdim = machine->screen[0].width; |
| r814 | r815 | |
|---|---|---|
| 48 | 48 | colour = (dbz_bg2_videoram[tile_index*2] & 0x000f); |
| 49 | 49 | flag = (dbz_bg2_videoram[tile_index*2] & 0x0080) ? TILE_FLIPX : 0; |
| 50 | 50 | |
| 51 | SET_TILE_INFO(0,tileno,colour + (layer_colorbase[5] << 1),flag) | |
| 51 | SET_TILE_INFO(0,tileno,colour + (layer_colorbase[5] << 1),flag); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | WRITE16_HANDLER( dbz_bg1_videoram_w ) |
| r814 | r815 | |
| 65 | 65 | colour = (dbz_bg1_videoram[tile_index*2] & 0x000f); |
| 66 | 66 | flag = (dbz_bg1_videoram[tile_index*2] & 0x0080) ? TILE_FLIPX : 0; |
| 67 | 67 | |
| 68 | SET_TILE_INFO(1,tileno,colour + (layer_colorbase[4] << 1),flag) | |
| 68 | SET_TILE_INFO(1,tileno,colour + (layer_colorbase[4] << 1),flag); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /* useful function to sort the four tile layers by priority order */ |
| r814 | r815 | |
| 97 | 97 | K056832_vh_start(machine, REGION_GFX1, K056832_BPP_4, 1, NULL, dbz_tile_callback, 1); |
| 98 | 98 | K053247_vh_start(machine, REGION_GFX2, -52, 16, NORMAL_PLANE_ORDER, dbz_sprite_callback); |
| 99 | 99 | |
| 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); | |
| 102 | 102 | |
| 103 | 103 | tilemap_set_transparent_pen(dbz_bg1_tilemap,0); |
| 104 | 104 | tilemap_set_transparent_pen(dbz_bg2_tilemap,0); |
| r814 | r815 | |
| 165 | 165 | |
| 166 | 166 | if(plane == 0) |
| 167 | 167 | { |
| 168 | flag = TILEMAP_ | |
| 168 | flag = TILEMAP_D | |
| 169 | 169 | pri = 0; |
| 170 | 170 | } |
| 171 | 171 | else |
| r814 | r815 | |
|---|---|---|
| 32 | 32 | 2, |
| 33 | 33 | tile, |
| 34 | 34 | attr >> 4, |
| 35 | 0) | |
| 35 | 0); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 44 | 44 | 1, |
| 45 | 45 | tile, |
| 46 | 46 | attr >> 4, |
| 47 | 0) | |
| 47 | 0); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 53 | 53 | 0, |
| 54 | 54 | wc90_txvideoram[tile_index + 0x800] + ((wc90_txvideoram[tile_index] & 0x07) << 8), |
| 55 | 55 | wc90_txvideoram[tile_index] >> 4, |
| 56 | 0) | |
| 56 | 0); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static TILE_GET_INFO( track_get_bg_tile_info ) |
| r814 | r815 | |
| 65 | 65 | 2, |
| 66 | 66 | tile, |
| 67 | 67 | attr >> 4, |
| 68 | 0) | |
| 68 | 0); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static TILE_GET_INFO( track_get_fg_tile_info ) |
| r814 | r815 | |
| 77 | 77 | 1, |
| 78 | 78 | tile, |
| 79 | 79 | attr >> 4, |
| 80 | 0) | |
| 80 | 0); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| r814 | r815 | |
| 89 | 89 | |
| 90 | 90 | VIDEO_START( wc90 ) |
| 91 | 91 | { |
| 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); | |
| 95 | 95 | |
| 96 | 96 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 97 | 97 | tilemap_set_transparent_pen(tx_tilemap,0); |
| r814 | r815 | |
| 99 | 99 | |
| 100 | 100 | VIDEO_START( wc90t ) |
| 101 | 101 | { |
| 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); | |
| 105 | 105 | |
| 106 | 106 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 107 | 107 | tilemap_set_transparent_pen(tx_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 43 | 43 | int code = data & 0x3ff; |
| 44 | 44 | int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20); |
| 45 | 45 | int opaque = data & 0x8000; |
| 46 | SET_TILE_INFO(1, code, color, opaque ? TILE_ | |
| 46 | SET_TILE_INFO(1, code, color, opaque ? TILE_F | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| r814 | r815 | |
| 106 | 106 | int i, size; |
| 107 | 107 | |
| 108 | 108 | /* initialize the playfield */ |
| 109 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 109 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 110 | 110 | |
| 111 | 111 | /* initialize the motion objects */ |
| 112 | 112 | atarimo_init(machine, 0, &modesc); |
| 113 | 113 | |
| 114 | 114 | /* initialize the alphanumerics */ |
| 115 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 115 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 116 | 116 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 117 | 117 | |
| 118 | 118 | /* modify the motion object code lookup table to account for the code XOR */ |
| r814 | r815 | |
|---|---|---|
| 43 | 43 | tileno = ms32_txram[tile_index *2] & 0x0000ffff; |
| 44 | 44 | colour = ms32_txram[tile_index *2+1] & 0x000000f; |
| 45 | 45 | |
| 46 | SET_TILE_INFO(3,tileno,colour,0) | |
| 46 | SET_TILE_INFO(3,tileno,colour,0); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static TILE_GET_INFO( get_ms32_roz_tile_info ) |
| r814 | r815 | |
| 53 | 53 | tileno = ms32_rozram[tile_index *2] & 0x0000ffff; |
| 54 | 54 | colour = ms32_rozram[tile_index *2+1] & 0x000000f; |
| 55 | 55 | |
| 56 | SET_TILE_INFO(1,tileno,colour,0) | |
| 56 | SET_TILE_INFO(1,tileno,colour,0); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static TILE_GET_INFO( get_ms32_bg_tile_info ) |
| r814 | r815 | |
| 63 | 63 | tileno = ms32_bgram[tile_index *2] & 0x0000ffff; |
| 64 | 64 | colour = ms32_bgram[tile_index *2+1] & 0x000000f; |
| 65 | 65 | |
| 66 | SET_TILE_INFO(2,tileno,colour,0) | |
| 66 | SET_TILE_INFO(2,tileno,colour,0); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static UINT32 brt[4]; |
| r814 | r815 | |
| 71 | 71 | |
| 72 | 72 | VIDEO_START( ms32 ) |
| 73 | 73 | { |
| 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); | |
| 77 | 77 | |
| 78 | 78 | tilemap_set_transparent_pen(ms32_tx_tilemap,0); |
| 79 | 79 | tilemap_set_transparent_pen(ms32_bg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 99 | 99 | /***************************************************************************/ |
| 100 | 100 | |
| 101 | 101 | /* Function for all 16x16 1024x1024 layers */ |
| 102 | static | |
| 102 | static | |
| 103 | 103 | { |
| 104 | 104 | /* logical (col,row) -> memory offset */ |
| 105 | 105 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6); |
| r814 | r815 | |
| 117 | 117 | gfx_bank, |
| 118 | 118 | tile, |
| 119 | 119 | color, |
| 120 | 0) | |
| 120 | 0); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static TILE_GET_INFO( get_bg_tile_info2 ) { get_bg_tile_info(machine,tileinfo,tile_index,1,darkseal_pf2_data); } |
| r814 | r815 | |
| 133 | 133 | 0, |
| 134 | 134 | tile, |
| 135 | 135 | color, |
| 136 | 0) | |
| 136 | 0); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /******************************************************************************/ |
| r814 | r815 | |
| 267 | 267 | |
| 268 | 268 | VIDEO_START( darkseal ) |
| 269 | 269 | { |
| 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); | |
| 273 | 273 | |
| 274 | 274 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 275 | 275 | tilemap_set_transparent_pen(pf2_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 82 | 82 | int color = colorram[tile_index] & 0x0f; |
| 83 | 83 | int flags = ((colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x80) ? TILE_FLIPY : 0); |
| 84 | 84 | |
| 85 | SET_TILE_INFO(0, code, color, flags) | |
| 85 | SET_TILE_INFO(0, code, color, flags); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | VIDEO_START( seicross ) |
| 89 | 89 | { |
| 90 | 90 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 91 | TILEMAP_TYPE_ | |
| 91 | TILEMAP_TYPE_ | |
| 92 | 92 | |
| 93 | 93 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 94 | 94 | } |
| r814 | r815 | |
|---|---|---|
| 435 | 435 | |
| 436 | 436 | /***************************************************************************/ |
| 437 | 437 | |
| 438 | UINT32 sys16_bg_map( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ){ | |
| 438 | static TILEMAP_MAPPER( sys16_bg_map ) | |
| 439 | { | |
| 439 | 440 | int page = 0; |
| 440 | 441 | if( row<32 ){ /* top */ |
| 441 | 442 | if( col<64 ) page = 0; else page = 1; |
| r814 | r815 | |
| 448 | 449 | return page*64*32+row*64+col; |
| 449 | 450 | } |
| 450 | 451 | |
| 451 | UINT32 sys16_text_map( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ){ | |
| 452 | static TILEMAP_MAPPER( sys16_text_map ) | |
| 453 | { | |
| 452 | 454 | return row*64+col+(64-40); |
| 453 | 455 | } |
| 454 | 456 | |
| r814 | r815 | |
| 592 | 594 | 0, |
| 593 | 595 | tile_number, |
| 594 | 596 | (data>>6)&0x7f, |
| 595 | 0) | |
| 597 | 0); | |
| 596 | 598 | } |
| 597 | 599 | else |
| 598 | 600 | { |
| r814 | r815 | |
| 600 | 602 | 0, |
| 601 | 603 | tile_number, |
| 602 | 604 | (data>>5)&0x7f, |
| 603 | 0) | |
| 605 | 0); | |
| 604 | 606 | } |
| 605 | 607 | |
| 606 | 608 | switch(sys16_bg_priority_mode) { |
| 607 | 609 | case 1: // Alien Syndrome |
| 608 | tileinfo-> | |
| 610 | tileinfo->categor | |
| 609 | 611 | break; |
| 610 | 612 | case 2: // Body Slam / wrestwar |
| 611 | tileinfo-> | |
| 613 | tileinfo->categor | |
| 612 | 614 | break; |
| 613 | 615 | case 3: // sys18 games |
| 614 | 616 | if( data&0x8000 ){ |
| 615 | tileinfo-> | |
| 617 | tileinfo->categor | |
| 616 | 618 | } |
| 617 | 619 | else { |
| 618 | tileinfo-> | |
| 620 | tileinfo->categor | |
| 619 | 621 | } |
| 620 | 622 | break; |
| 621 | 623 | } |
| r814 | r815 | |
| 632 | 634 | 0, |
| 633 | 635 | tile_number, |
| 634 | 636 | (data>>6)&0x7f, |
| 635 | 0) | |
| 637 | 0); | |
| 636 | 638 | } |
| 637 | 639 | else |
| 638 | 640 | { |
| r814 | r815 | |
| 640 | 642 | 0, |
| 641 | 643 | tile_number, |
| 642 | 644 | (data>>5)&0x7f, |
| 643 | 0) | |
| 645 | 0); | |
| 644 | 646 | } |
| 645 | 647 | |
| 646 | 648 | switch(sys16_fg_priority_mode){ |
| 647 | 649 | case 1: // alien syndrome |
| 648 | tileinfo-> | |
| 650 | tileinfo->categor | |
| 649 | 651 | break; |
| 650 | 652 | |
| 651 | 653 | case 3: |
| 652 | tileinfo-> | |
| 654 | tileinfo->categor | |
| 653 | 655 | break; |
| 654 | 656 | |
| 655 | 657 | default: |
| 656 | 658 | if( sys16_fg_priority_mode>=0 ){ |
| 657 | tileinfo-> | |
| 659 | tileinfo->categor | |
| 658 | 660 | } |
| 659 | 661 | break; |
| 660 | 662 | } |
| r814 | r815 | |
| 669 | 671 | 0, |
| 670 | 672 | tile_number, |
| 671 | 673 | (data>>6)&0x7f, |
| 672 | 0) | |
| 674 | 0); | |
| 673 | 675 | |
| 674 | tileinfo-> | |
| 676 | tileinfo->categor | |
| 675 | 677 | } |
| 676 | 678 | |
| 677 | 679 | static TILE_GET_INFO( get_fg2_tile_info ){ |
| r814 | r815 | |
| 683 | 685 | 0, |
| 684 | 686 | tile_number, |
| 685 | 687 | (data>>6)&0x7f, |
| 686 | 0) | |
| 688 | 0); | |
| 687 | 689 | |
| 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; | |
| 690 | 692 | } |
| 691 | 693 | |
| 692 | 694 | WRITE16_HANDLER( sys16_tileram_w ){ |
| r814 | r815 | |
| 733 | 735 | 0, |
| 734 | 736 | (tile_number&0x1ff) + sys16_tile_bank0 * 0x1000, |
| 735 | 737 | (tile_number>>9)%8, |
| 736 | 0) | |
| 738 | 0); | |
| 737 | 739 | } |
| 738 | 740 | else |
| 739 | 741 | { |
| r814 | r815 | |
| 741 | 743 | 0, |
| 742 | 744 | (tile_number&0xff) + sys16_tile_bank0 * 0x1000, |
| 743 | 745 | (tile_number>>8)%8, |
| 744 | 0) | |
| 746 | 0); | |
| 745 | 747 | } |
| 746 | 748 | |
| 747 | 749 | if(pri>=sys16_textlayer_lo_min && pri<=sys16_textlayer_lo_max) |
| 748 | tileinfo-> | |
| 750 | tileinfo->categor | |
| 749 | 751 | if(pri>=sys16_textlayer_hi_min && pri<=sys16_textlayer_hi_max) |
| 750 | tileinfo-> | |
| 752 | tileinfo->categor | |
| 751 | 753 | } |
| 752 | 754 | |
| 753 | 755 | WRITE16_HANDLER( sys16_textram_w ){ |
| r814 | r815 | |
| 785 | 787 | background = tilemap_create( |
| 786 | 788 | get_bg_tile_info, |
| 787 | 789 | sys16_bg_map, |
| 788 | TILEMAP_TYPE_ | |
| 790 | TILEMAP_TYPE_ | |
| 789 | 791 | 8,8, |
| 790 | 792 | 64*2,32*2 ); |
| 791 | 793 | else |
| 792 | 794 | background = tilemap_create( |
| 793 | 795 | get_bg_tile_info, |
| 794 | 796 | sys16_bg_map, |
| 795 | TILEMAP_TYPE_ | |
| 797 | TILEMAP_TYPE_ | |
| 796 | 798 | 8,8, |
| 797 | 799 | 64*2,32*2 ); |
| 798 | 800 | |
| 799 | 801 | foreground = tilemap_create( |
| 800 | 802 | get_fg_tile_info, |
| 801 | 803 | sys16_bg_map, |
| 802 | TILEMAP_TYPE_ | |
| 804 | TILEMAP_TYPE_ | |
| 803 | 805 | 8,8, |
| 804 | 806 | 64*2,32*2 ); |
| 805 | 807 | |
| 806 | 808 | text_layer = tilemap_create( |
| 807 | 809 | get_text_tile_info, |
| 808 | 810 | sys16_text_map, |
| 809 | TILEMAP_TYPE_ | |
| 811 | TILEMAP_TYPE_ | |
| 810 | 812 | 8,8, |
| 811 | 813 | 40,28 ); |
| 812 | 814 | |
| r814 | r815 | |
| 872 | 874 | background2 = tilemap_create( |
| 873 | 875 | get_bg2_tile_info, |
| 874 | 876 | sys16_bg_map, |
| 875 | TILEMAP_TYPE_ | |
| 877 | TILEMAP_TYPE_ | |
| 876 | 878 | 8,8, |
| 877 | 879 | 64*2,32*2 ); |
| 878 | 880 | |
| 879 | 881 | foreground2 = tilemap_create( |
| 880 | 882 | get_fg2_tile_info, |
| 881 | 883 | sys16_bg_map, |
| 882 | TILEMAP_TYPE_ | |
| 884 | TILEMAP_TYPE_ | |
| 883 | 885 | 8,8, |
| 884 | 886 | 64*2,32*2 ); |
| 885 | 887 | |
| r814 | r815 | |
| 1075 | 1077 | |
| 1076 | 1078 | fillbitmap(priority_bitmap,0,cliprect); |
| 1077 | 1079 | |
| 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 ); | |
| 1080 | 1082 | // sprite_draw(sprite_list,3); // needed for Aurail |
| 1081 | 1083 | if( sys16_bg_priority_mode==2 ) tilemap_draw( bitmap,cliprect, background, 1, 0x01 );// body slam (& wrestwar??) |
| 1082 | 1084 | // sprite_draw(sprite_list,2); |
| r814 | r815 | |
| 1111 | 1113 | else |
| 1112 | 1114 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 1113 | 1115 | |
| 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 ); //?? | |
| 1117 | 1119 | |
| 1118 | 1120 | if (!strcmp(machine->gamedrv->name,"astorm")) update_system18_vdp(bitmap,cliprect); // kludge: render vdp here for astorm |
| 1119 | 1121 | /* ASTORM also draws some sprites with the vdp, needs to be higher priority..*/ |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | static | |
| 52 | static | |
| 53 | 53 | { |
| 54 | 54 | /* logical (col,row) -> memory offset */ |
| 55 | 55 | return (col & 0x3f) + ((row & 0x1f) << 6) + ((col & 0x40) << 5) + ((row & 0x20) << 7); |
| r814 | r815 | |
| 63 | 63 | 0, |
| 64 | 64 | attr, |
| 65 | 65 | (attr & 0x1fc0) >> 6, |
| 66 | 0) | |
| 66 | 0); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 74 | 74 | 0, |
| 75 | 75 | attr, |
| 76 | 76 | (attr & 0x1fc0) >> 6, |
| 77 | 0) | |
| 77 | 0); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 84 | 84 | 0, |
| 85 | 85 | attr & 0xf1ff, |
| 86 | 86 | (attr & 0x0e00) >> 9, |
| 87 | 0) | |
| 87 | 0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| r814 | r815 | |
| 97 | 97 | |
| 98 | 98 | VIDEO_START( deniam ) |
| 99 | 99 | { |
| 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); | |
| 103 | 103 | |
| 104 | 104 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 105 | 105 | tilemap_set_transparent_pen(tx_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | static | |
| 63 | static | |
| 64 | 64 | { |
| 65 | 65 | /* logical (col,row) -> memory offset */ |
| 66 | 66 | return (row & 0x0f) | ((col & 0x3f) << 4) | ((row & 0x10) << 6); |
| r814 | r815 | |
| 108 | 108 | VIDEO_START( mcr3 ) |
| 109 | 109 | { |
| 110 | 110 | /* initialize the background tilemap */ |
| 111 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 111 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
| 115 | 115 | VIDEO_START( mcrmono ) |
| 116 | 116 | { |
| 117 | 117 | /* initialize the background tilemap */ |
| 118 | bg_tilemap = tilemap_create(mcrmono_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 118 | bg_tilemap = tilemap_create(mcrmono_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | VIDEO_START( spyhunt ) |
| 123 | 123 | { |
| 124 | 124 | /* initialize the background tilemap */ |
| 125 | bg_tilemap = tilemap_create(spyhunt_get_bg_tile_info, spyhunt_bg_scan, TILEMAP_TYPE_ | |
| 125 | bg_tilemap = tilemap_create(spyhunt_get_bg_tile_info, spyhunt_bg_scan, TILEMAP_TYPE_ | |
| 126 | 126 | |
| 127 | 127 | /* initialize the text tilemap */ |
| 128 | alpha_tilemap = tilemap_create(spyhunt_get_alpha_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 128 | alpha_tilemap = tilemap_create(spyhunt_get_alpha_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 129 | 129 | tilemap_set_transparent_pen(alpha_tilemap, 0); |
| 130 | 130 | tilemap_set_scrollx(alpha_tilemap, 0, 16); |
| 131 | 131 |
| r814 | r815 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | /******************************************************************************/ |
| 126 | 126 | |
| 127 | static | |
| 127 | static | |
| 128 | 128 | { |
| 129 | 129 | /* logical (col,row) -> memory offset */ |
| 130 | 130 | return (col & 0xf) + ((row & 0xf) << 4) + ((row & 0x30) << 4) + ((col & 0x30) << 6); |
| r814 | r815 | |
| 142 | 142 | 1, |
| 143 | 143 | tile, |
| 144 | 144 | color, |
| 145 | 0) | |
| 145 | 0); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | static TILE_GET_INFO( get_pf1_tile_info ) |
| r814 | r815 | |
| 155 | 155 | 0, |
| 156 | 156 | tile, |
| 157 | 157 | color, |
| 158 | 0) | |
| 158 | 0); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | VIDEO_START( stadhero ) |
| 162 | 162 | { |
| 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); | |
| 165 | 165 | |
| 166 | 166 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 167 | 167 | } |
| r814 | r815 | |
|---|---|---|
| 70 | 70 | int color = attr >> 12; |
| 71 | 71 | int flags = (attr & 0x800) ? TILE_FLIPX : 0; |
| 72 | 72 | |
| 73 | SET_TILE_INFO(1, code, color, flags) | |
| 73 | SET_TILE_INFO(1, code, color, flags); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 80 | 80 | int color = attr >> 12; |
| 81 | 81 | int flags = (attr & 0x800) ? TILE_FLIPY : 0; |
| 82 | 82 | |
| 83 | SET_TILE_INFO(2, code, color, flags) | |
| 83 | SET_TILE_INFO(2, code, color, flags); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 89 | 89 | int code = attr & 0xfff; |
| 90 | 90 | int color = attr >> 12; |
| 91 | 91 | |
| 92 | SET_TILE_INFO(0, code, color, 0) | |
| 92 | SET_TILE_INFO(0, code, color, 0); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | VIDEO_START( prehisle ) |
| 96 | 96 | { |
| 97 | 97 | bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_cols, |
| 98 | TILEMAP_TYPE_ | |
| 98 | TILEMAP_TYPE_ | |
| 99 | 99 | |
| 100 | 100 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 101 | TILEMAP_TYPE_ | |
| 101 | TILEMAP_TYPE_ | |
| 102 | 102 | |
| 103 | 103 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 104 | TILEMAP_TYPE_ | |
| 104 | TILEMAP_TYPE_ | |
| 105 | 105 | |
| 106 | 106 | tilemap_set_transparent_pen(bg_tilemap, 15); |
| 107 | 107 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| r814 | r815 | |
|---|---|---|
| 124 | 124 | 2, |
| 125 | 125 | spriteram_3[tile_index], |
| 126 | 126 | 0, |
| 127 | 0) | |
| 127 | 0); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | static TILE_GET_INFO( get_fg_tilemap_info ) |
| r814 | r815 | |
| 133 | 133 | 1, |
| 134 | 134 | spriteram_2[tile_index], |
| 135 | 135 | 0, |
| 136 | 0) | |
| 136 | 0); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | static TILE_GET_INFO( get_tx_tilemap_info ) |
| r814 | r815 | |
| 143 | 143 | 0, |
| 144 | 144 | tile_number, |
| 145 | 145 | (tile_number>>5), |
| 146 | 0) | |
| 146 | 0); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /*************************************************************************** |
| r814 | r815 | |
| 159 | 159 | stuff_palette( machine, 0, 0, 16*8 ); /* load sprite colors */ |
| 160 | 160 | stuff_palette( machine, 16*8*3, 16*8, 16*8 ); /* load text colors */ |
| 161 | 161 | |
| 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); | |
| 165 | 165 | |
| 166 | 166 | { |
| 167 | 167 | tilemap_clip = machine->screen[0].visarea; |
| r814 | r815 | |
| 357 | 357 | tilemap_set_scrollx( tx_tilemap, 0, 0 ); |
| 358 | 358 | tilemap_set_scrolly( tx_tilemap, 0, 0 ); |
| 359 | 359 | |
| 360 | tilemap_draw( bitmap,&finalclip,fg_tilemap,TILEMAP_ | |
| 360 | tilemap_draw( bitmap,&finalclip,fg_tilemap,TILEMAP_D | |
| 361 | 361 | draw_sprites( machine,bitmap,cliprect, sprite_scrollx+29+1, sprite_scrolly+16, 0, sprite_partition ); |
| 362 | 362 | tilemap_draw( bitmap,&finalclip,bg_tilemap,0 ,0); |
| 363 | 363 | draw_sprites( machine,bitmap,cliprect, sprite_scrollx+29+1, sprite_scrolly+16, 1, sprite_partition ); |
| r814 | r815 | |
| 420 | 420 | tilemap_set_scrollx( tx_tilemap, 0, 0 ); |
| 421 | 421 | tilemap_set_scrolly( tx_tilemap, 0, 0 ); |
| 422 | 422 | |
| 423 | tilemap_draw( bitmap,&finalclip,bg_tilemap,TILEMAP_ | |
| 423 | tilemap_draw( bitmap,&finalclip,bg_tilemap,TILEMAP_D | |
| 424 | 424 | draw_sprites( machine,bitmap,cliprect, sprite_scrollx+29, sprite_scrolly+17, 0, sprite_partition ); |
| 425 | 425 | tilemap_draw( bitmap,&finalclip,fg_tilemap,0 ,0); |
| 426 | 426 | draw_sprites( machine,bitmap,cliprect, sprite_scrollx+29, sprite_scrolly+17, 1, sprite_partition ); |
| r814 | r815 | |
|---|---|---|
| 61 | 61 | 0, |
| 62 | 62 | tileno, |
| 63 | 63 | colbank, |
| 64 | 0) | |
| 64 | 0); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | static | |
| 67 | static | |
| 68 | 68 | { |
| 69 | 69 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5); |
| 70 | 70 | } |
| r814 | r815 | |
| 97 | 97 | 2, |
| 98 | 98 | tileno, |
| 99 | 99 | colbank, |
| 100 | flipx ? TILE_FLIPX : 0) | |
| 100 | flipx ? TILE_FLIPX : 0); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /******************************************************************************* |
| r814 | r815 | |
| 205 | 205 | |
| 206 | 206 | VIDEO_START( wwfsstar ) |
| 207 | 207 | { |
| 208 | fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 208 | fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 209 | 209 | tilemap_set_transparent_pen(fg0_tilemap,0); |
| 210 | 210 | |
| 211 | bg0_tilemap = tilemap_create(get_bg0_tile_info,bg0_scan,TILEMAP_TYPE_ | |
| 211 | bg0_tilemap = tilemap_create(get_bg0_tile_info,bg0_scan,TILEMAP_TYPE_ | |
| 212 | 212 | tilemap_set_transparent_pen(fg0_tilemap,0); |
| 213 | 213 | } |
| 214 | 214 |
| r814 | r815 | |
|---|---|---|
| 159 | 159 | 1, |
| 160 | 160 | code, |
| 161 | 161 | color, |
| 162 | 0) | |
| 162 | 0); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | static TILE_GET_INFO( tx_get_tile_info ) |
| r814 | r815 | |
| 184 | 184 | 0, |
| 185 | 185 | code, |
| 186 | 186 | color, |
| 187 | 0) | |
| 187 | 0); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | |
| r814 | r815 | |
| 197 | 197 | |
| 198 | 198 | VIDEO_START( polepos ) |
| 199 | 199 | { |
| 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); | |
| 202 | 202 | |
| 203 | 203 | tilemap_set_transparent_pen(tx_tilemap, 0x2f); |
| 204 | 204 | } |
| r814 | r815 | |
|---|---|---|
| 12 | 12 | static tilemap *pf1_tilemap,*pf1_alt_tilemap,*pf2_tilemap; |
| 13 | 13 | static int flipscreen; |
| 14 | 14 | |
| 15 | static | |
| 15 | static | |
| 16 | 16 | { |
| 17 | 17 | /* logical (col,row) -> memory offset */ |
| 18 | 18 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0xf0) << 4); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | static | |
| 21 | static | |
| 22 | 22 | { |
| 23 | 23 | /* logical (col,row) -> memory offset */ |
| 24 | 24 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((row & 0x10) << 4) + ((col & 0x70) << 5); |
| r814 | r815 | |
| 36 | 36 | 2, |
| 37 | 37 | tile, |
| 38 | 38 | color, |
| 39 | 0) | |
| 39 | 0); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | static | |
| 42 | static | |
| 43 | 43 | { |
| 44 | 44 | /* logical (col,row) -> memory offset */ |
| 45 | 45 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((row & 0x10) << 4) + ((col & 0x10) << 5); |
| r814 | r815 | |
| 57 | 57 | 2, |
| 58 | 58 | tile, |
| 59 | 59 | color, |
| 60 | 0) | |
| 60 | 0); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static TILE_GET_INFO( get_pf2_tile_info ) |
| r814 | r815 | |
| 73 | 73 | 0, |
| 74 | 74 | tile, |
| 75 | 75 | color, |
| 76 | 0) | |
| 76 | 0); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /******************************************************************************/ |
| r814 | r815 | |
| 86 | 86 | |
| 87 | 87 | VIDEO_START( actfancr ) |
| 88 | 88 | { |
| 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); | |
| 92 | 92 | |
| 93 | 93 | tilemap_set_transparent_pen(pf2_tilemap,0); |
| 94 | 94 | |
| r814 | r815 | |
| 97 | 97 | |
| 98 | 98 | VIDEO_START( triothep ) |
| 99 | 99 | { |
| 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); | |
| 102 | 102 | |
| 103 | 103 | tilemap_set_transparent_pen(pf2_tilemap,0); |
| 104 | 104 |
| r814 | r815 | |
|---|---|---|
| 174 | 174 | 1, |
| 175 | 175 | tile, |
| 176 | 176 | b_bg_color_base + (color&0x3f), |
| 177 | TILE_FLIPYX((color & 0x00c0)>>6)) | |
| 177 | TILE_FLIPYX((color & 0x00c0)>>6)); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 186 | 186 | 1, |
| 187 | 187 | tile, |
| 188 | 188 | b_fg_color_base + (color&0x3f), |
| 189 | TILE_FLIPYX((color & 0x00c0)>>6)) | |
| 189 | TILE_FLIPYX((color & 0x00c0)>>6)); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 197 | 197 | 0, |
| 198 | 198 | (tile & 0x07ff) | ((TC0180VCU_ctrl[4 + ((tile & 0x800) >> 11)]>>8) << 11), |
| 199 | 199 | b_tx_color_base + ((tile >> 12) & 0x0f), |
| 200 | 0) | |
| 200 | 0); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| r814 | r815 | |
| 207 | 207 | framebuffer[1] = auto_bitmap_alloc(512,256,machine->screen[0].format); |
| 208 | 208 | pixel_bitmap = NULL; /* only hitice needs this */ |
| 209 | 209 | |
| 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); | |
| 213 | 213 | |
| 214 | 214 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 215 | 215 | tilemap_set_transparent_pen(tx_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 56 | 56 | int color = attr & 0x0f; |
| 57 | 57 | int flags = ((attr & 0x10) ? TILE_FLIPX : 0) | ((attr & 0x20) ? TILE_FLIPY : 0); |
| 58 | 58 | |
| 59 | SET_TILE_INFO(0, code, color, flags) | |
| 59 | SET_TILE_INFO(0, code, color, flags); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | VIDEO_START( jackal ) |
| 63 | 63 | { |
| 64 | 64 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 65 | TILEMAP_TYPE_ | |
| 65 | TILEMAP_TYPE_ | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static void draw_background( mame_bitmap *bitmap, const rectangle *cliprect ) |
| r814 | r815 | |
|---|---|---|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 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); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| r814 | r815 | |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| 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); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
| r814 | r815 | |
| 89 | 89 | helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 90 | 90 | helper3 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 91 | 91 | |
| 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); | |
| 94 | 94 | |
| 95 | 95 | /* VBLANK starts on scanline #256 and ends on scanline #24 */ |
| 96 | 96 |
| r814 | r815 | |
|---|---|---|
| 709 | 709 | gfxnum, |
| 710 | 710 | code, |
| 711 | 711 | (attr & 0x1ff), |
| 712 | TILE_FLIPYX((attr & 0xc000) >> 14)) | |
| 712 | TILE_FLIPYX((attr & 0xc000) >> 14)); | |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | INLINE void common_get_PC080SN_fg_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *ram,int gfxnum) |
| r814 | r815 | |
| 731 | 731 | gfxnum, |
| 732 | 732 | code, |
| 733 | 733 | (attr & 0x1ff), |
| 734 | TILE_FLIPYX((attr & 0xc000) >> 14)) | |
| 734 | TILE_FLIPYX((attr & 0xc000) >> 14)); | |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | 737 | static TILE_GET_INFO( PC080SN_get_bg_tile_info_0 ) |
| r814 | r815 | |
| 754 | 754 | common_get_PC080SN_fg_tile_info(machine,tileinfo,tile_index,PC080SN_bg_ram[1][1],PC080SN_bg_gfx[1]); |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | tile_get_info_ | |
| 757 | tile_get_info_callback PC080SN_get_tile_info[PC080SN_MAX_CHIPS][2] = | |
| 758 | 758 | { |
| 759 | 759 | { PC080SN_get_bg_tile_info_0, PC080SN_get_fg_tile_info_0 }, |
| 760 | 760 | { PC080SN_get_bg_tile_info_1, PC080SN_get_fg_tile_info_1 } |
| r814 | r815 | |
| 796 | 796 | |
| 797 | 797 | if (!PC080SN_dblwidth) /* standard tilemaps */ |
| 798 | 798 | { |
| 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); | |
| 801 | 801 | } |
| 802 | 802 | else /* double width tilemaps */ |
| 803 | 803 | { |
| 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); | |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | PC080SN_ram[i] = auto_malloc(PC080SN_RAM_SIZE); |
| r814 | r815 | |
| 1076 | 1076 | UINT16 scanline[1024]; /* won't be called by a wide-screen game, but just in case... */ |
| 1077 | 1077 | |
| 1078 | 1078 | mame_bitmap *srcbitmap = tilemap_get_pixmap(PC080SN_tilemap[chip][layer]); |
| 1079 | mame_bitmap * | |
| 1079 | mame_bitmap *flagsbitmap = tilemap_get_flags | |
| 1080 | 1080 | |
| 1081 | 1081 | UINT16 a,color; |
| 1082 | 1082 | int sx,x_index; |
| r814 | r815 | |
| 1114 | 1114 | x_index = sx - (PC080SN_bgscroll_ram[chip][layer][row_index]); |
| 1115 | 1115 | |
| 1116 | 1116 | src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0); |
| 1117 | tsrc = BITMAP_ADDR8( | |
| 1117 | tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0); | |
| 1118 | 1118 | dst16 = scanline; |
| 1119 | 1119 | |
| 1120 | if (flags & TILEMAP_ | |
| 1120 | if (flags & TILEMAP_D | |
| 1121 | 1121 | { |
| 1122 | 1122 | for (i=0; i<screen_width; i++) |
| 1123 | 1123 | { |
| r814 | r815 | |
| 1147 | 1147 | } |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | if (flags & TILEMAP_ | |
| 1150 | if (flags & TILEMAP_D | |
| 1151 | 1151 | taitoic_drawscanline(bitmap,0,y,scanline,0,ROT0,priority,cliprect); |
| 1152 | 1152 | else |
| 1153 | 1153 | taitoic_drawscanline(bitmap,0,y,scanline,1,ROT0,priority,cliprect); |
| r814 | r815 | |
| 1395 | 1395 | color = TC0080VCO_bg0_ram_1[ tile_index ] & 0x001f; |
| 1396 | 1396 | tile = TC0080VCO_bg0_ram_0[ tile_index ] & 0x7fff; |
| 1397 | 1397 | |
| 1398 | tileinfo-> | |
| 1398 | tileinfo->categor | |
| 1399 | 1399 | |
| 1400 | 1400 | SET_TILE_INFO( |
| 1401 | 1401 | TC0080VCO_bg_gfx, |
| 1402 | 1402 | tile, |
| 1403 | 1403 | color, |
| 1404 | TILE_FLIPYX((TC0080VCO_bg0_ram_1[tile_index] & 0x00c0) >> 6)) | |
| 1404 | TILE_FLIPYX((TC0080VCO_bg0_ram_1[tile_index] & 0x00c0) >> 6)); | |
| 1405 | 1405 | } |
| 1406 | 1406 | |
| 1407 | 1407 | static TILE_GET_INFO( TC0080VCO_get_bg1_tile_info_0 ) |
| r814 | r815 | |
| 1411 | 1411 | color = TC0080VCO_bg1_ram_1[ tile_index ] & 0x001f; |
| 1412 | 1412 | tile = TC0080VCO_bg1_ram_0[ tile_index ] & 0x7fff; |
| 1413 | 1413 | |
| 1414 | tileinfo-> | |
| 1414 | tileinfo->categor | |
| 1415 | 1415 | |
| 1416 | 1416 | SET_TILE_INFO( |
| 1417 | 1417 | TC0080VCO_bg_gfx, |
| 1418 | 1418 | tile, |
| 1419 | 1419 | color, |
| 1420 | TILE_FLIPYX((TC0080VCO_bg1_ram_1[tile_index] & 0x00c0) >> 6)) | |
| 1420 | TILE_FLIPYX((TC0080VCO_bg1_ram_1[tile_index] & 0x00c0) >> 6)); | |
| 1421 | 1421 | } |
| 1422 | 1422 | |
| 1423 | 1423 | static TILE_GET_INFO( TC0080VCO_get_tx_tile_info ) |
| r814 | r815 | |
| 1430 | 1430 | tile = (TC0080VCO_tx_ram_0[tile_index >> 1] & 0x00ff); |
| 1431 | 1431 | else |
| 1432 | 1432 | tile = (TC0080VCO_tx_ram_0[tile_index >> 1] & 0xff00) >> 8; |
| 1433 | tileinfo-> | |
| 1433 | tileinfo->categor | |
| 1434 | 1434 | } |
| 1435 | 1435 | else |
| 1436 | 1436 | { |
| r814 | r815 | |
| 1438 | 1438 | tile = (TC0080VCO_tx_ram_0[tile_index >> 1] & 0xff00) >> 8; |
| 1439 | 1439 | else |
| 1440 | 1440 | tile = (TC0080VCO_tx_ram_0[tile_index >> 1] & 0x00ff); |
| 1441 | tileinfo-> | |
| 1441 | tileinfo->categor | |
| 1442 | 1442 | } |
| 1443 | 1443 | |
| 1444 | 1444 | SET_TILE_INFO( |
| 1445 | 1445 | TC0080VCO_tx_gfx, |
| 1446 | 1446 | tile, |
| 1447 | 1447 | 0x40, |
| 1448 | 0) /* 0x20<<1 as 3bpp */ | |
| 1448 | 0); /* 0x20<<1 as 3bpp */ | |
| 1449 | 1449 | } |
| 1450 | 1450 | |
| 1451 | 1451 | |
| r814 | r815 | |
| 1532 | 1532 | TC0080VCO_bg_flip_yoffs = bg_flip_yoffs; /* usually -2 */ |
| 1533 | 1533 | TC0080VCO_has_tx = has_fg0; /* for debugging only */ |
| 1534 | 1534 | |
| 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); | |
| 1537 | 1537 | TC0080VCO_ram = auto_malloc(TC0080VCO_RAM_SIZE); |
| 1538 | 1538 | |
| 1539 | 1539 | memset( TC0080VCO_ram,0,TC0080VCO_RAM_SIZE ); |
| r814 | r815 | |
| 1556 | 1556 | |
| 1557 | 1557 | /* Perform extra initialisations for text layer */ |
| 1558 | 1558 | { |
| 1559 | TC0080VCO_tilemap[2] = tilemap_create(TC0080VCO_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 1559 | TC0080VCO_tilemap[2] = tilemap_create(TC0080VCO_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 1560 | 1560 | TC0080VCO_char_dirty = auto_malloc(TC0080VCO_TOTAL_CHARS); |
| 1561 | 1561 | |
| 1562 | 1562 | TC0080VCO_dirty_chars(); |
| r814 | r815 | |
| 1777 | 1777 | UINT8 *tsrc; |
| 1778 | 1778 | UINT16 scanline[512]; |
| 1779 | 1779 | mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0080VCO_tilemap[0]); |
| 1780 | mame_bitmap * | |
| 1780 | mame_bitmap *flagsbitmap = tilemap_get_flags | |
| 1781 | 1781 | |
| 1782 | 1782 | int sx,zoomx,zoomy; |
| 1783 | 1783 | int dx,ex,dy,ey; |
| r814 | r815 | |
| 1861 | 1861 | x_index = sx - ((TC0080VCO_bgscroll_ram[row_index] << 16)); |
| 1862 | 1862 | |
| 1863 | 1863 | src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0); |
| 1864 | tsrc = BITMAP_ADDR8( | |
| 1864 | tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0); | |
| 1865 | 1865 | dst16 = scanline; |
| 1866 | 1866 | |
| 1867 | 1867 | x_step = zoomx; |
| 1868 | 1868 | |
| 1869 | 1869 | /*** NEW ***/ |
| 1870 | if (flags & TILEMAP_ | |
| 1870 | if (flags & TILEMAP_D | |
| 1871 | 1871 | { |
| 1872 | 1872 | for (i=0; i<screen_width; i++) |
| 1873 | 1873 | { |
| r814 | r815 | |
| 1898 | 1898 | // scanline,0,0,rot,priority); |
| 1899 | 1899 | |
| 1900 | 1900 | /*** NEW ***/ |
| 1901 | if (flags & TILEMAP_ | |
| 1901 | if (flags & TILEMAP_D | |
| 1902 | 1902 | taitoic_drawscanline(bitmap,0,y,scanline,0,ROT0,priority,cliprect); |
| 1903 | 1903 | else |
| 1904 | 1904 | taitoic_drawscanline(bitmap,0,y,scanline,1,ROT0,priority,cliprect); |
| r814 | r815 | |
| 2072 | 2072 | gfxnum, |
| 2073 | 2073 | code, |
| 2074 | 2074 | (((attr * TC0100SCN_bg_col_mult) + TC0100SCN_colbank[0]) & 0xff) + colbank, |
| 2075 | TILE_FLIPYX((attr & 0xc000) >> 14)) | |
| 2075 | TILE_FLIPYX((attr & 0xc000) >> 14)); | |
| 2076 | 2076 | } |
| 2077 | 2077 | |
| 2078 | 2078 | INLINE void common_get_bg1_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *ram,int gfxnum,int colbank,int dblwidth) |
| r814 | r815 | |
| 2094 | 2094 | gfxnum, |
| 2095 | 2095 | code, |
| 2096 | 2096 | (((attr * TC0100SCN_bg_col_mult) + TC0100SCN_colbank[1]) & 0xff) + colbank, |
| 2097 | TILE_FLIPYX((attr & 0xc000) >> 14)) | |
| 2097 | TILE_FLIPYX((attr & 0xc000) >> 14)); | |
| 2098 | 2098 | } |
| 2099 | 2099 | |
| 2100 | 2100 | INLINE void common_get_tx_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *ram,int gfxnum,int colbank,int dblwidth) |
| r814 | r815 | |
| 2105 | 2105 | gfxnum, |
| 2106 | 2106 | attr & 0xff, |
| 2107 | 2107 | ((((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)); | |
| 2109 | 2109 | } |
| 2110 | 2110 | |
| 2111 | 2111 | static TILE_GET_INFO( TC0100SCN_get_bg_tile_info_0 ) |
| r814 | r815 | |
| 2164 | 2164 | |
| 2165 | 2165 | /* This array changes with TC0100SCN_MAX_CHIPS */ |
| 2166 | 2166 | |
| 2167 | tile_get_info_ | |
| 2167 | tile_get_info_callback TC0100SCN_get_tile_info[TC0100SCN_MAX_CHIPS][3] = | |
| 2168 | 2168 | { |
| 2169 | 2169 | { TC0100SCN_get_bg_tile_info_0, TC0100SCN_get_fg_tile_info_0, TC0100SCN_get_tx_tile_info_0 }, |
| 2170 | 2170 | { TC0100SCN_get_bg_tile_info_1, TC0100SCN_get_fg_tile_info_1, TC0100SCN_get_tx_tile_info_1 }, |
| r814 | r815 | |
| 2291 | 2291 | TC0100SCN_dblwidth[i]=0; |
| 2292 | 2292 | |
| 2293 | 2293 | /* 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); | |
| 2297 | 2297 | |
| 2298 | 2298 | /* 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); | |
| 2302 | 2302 | |
| 2303 | 2303 | /* Set up clipping for multi-TC0100SCN games. We assume |
| 2304 | 2304 | this code won't ever affect single screen games: |
| r814 | r815 | |
| 2715 | 2715 | column_offset=TC0100SCN_colscroll_ram[chip][(src_x&0x3ff) / 8]; |
| 2716 | 2716 | p=*BITMAP_ADDR16(src_bitmap, (src_y - column_offset)&height_mask, src_x); |
| 2717 | 2717 | |
| 2718 | if ((p&0xf)!=0 || (flags & TILEMAP_ | |
| 2718 | if ((p&0xf)!=0 || (flags & TILEMAP_D | |
| 2719 | 2719 | { |
| 2720 | 2720 | *BITMAP_ADDR16(bitmap, y, x + cliprect->min_x) = machine->pens[p]; |
| 2721 | 2721 | if (priority_bitmap) |
| r814 | r815 | |
| 2781 | 2781 | TC0280GRD_gfxnum, |
| 2782 | 2782 | attr & 0x3fff, |
| 2783 | 2783 | ((attr & 0xc000) >> 14) + TC0280GRD_base_color, |
| 2784 | 0) | |
| 2784 | 0); | |
| 2785 | 2785 | } |
| 2786 | 2786 | |
| 2787 | 2787 | |
| 2788 | 2788 | void TC0280GRD_vh_start(int gfxnum) |
| 2789 | 2789 | { |
| 2790 | 2790 | TC0280GRD_ram = auto_malloc(TC0280GRD_RAM_SIZE); |
| 2791 | TC0280GRD_tilemap = tilemap_create(TC0280GRD_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 2791 | TC0280GRD_tilemap = tilemap_create(TC0280GRD_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 2792 | 2792 | |
| 2793 | 2793 | state_save_register_global_pointer(TC0280GRD_ram, TC0280GRD_RAM_SIZE/2); |
| 2794 | 2794 | state_save_register_global_array(TC0280GRD_ctrl); |
| r814 | r815 | |
| 2975 | 2975 | gfxnum, |
| 2976 | 2976 | code, |
| 2977 | 2977 | (attr & 0xff) + TC0480SCP_tile_colbase, |
| 2978 | TILE_FLIPYX((attr & 0xc000) >> 14)) | |
| 2978 | TILE_FLIPYX((attr & 0xc000) >> 14)); | |
| 2979 | 2979 | } |
| 2980 | 2980 | |
| 2981 | 2981 | INLINE void common_get_tc0480tx_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *ram,int gfxnum) |
| r814 | r815 | |
| 2985 | 2985 | gfxnum, |
| 2986 | 2986 | attr & 0xff, |
| 2987 | 2987 | ((attr & 0x3f00) >> 8) + TC0480SCP_tile_colbase, |
| 2988 | TILE_FLIPYX((attr & 0xc000) >> 14)) | |
| 2988 | TILE_FLIPYX((attr & 0xc000) >> 14)); | |
| 2989 | 2989 | } |
| 2990 | 2990 | |
| 2991 | 2991 | static TILE_GET_INFO( TC0480SCP_get_bg0_tile_info ) |
| r814 | r815 | |
| 3013 | 3013 | common_get_tc0480tx_tile_info(machine,tileinfo,tile_index,TC0480SCP_tx_ram,TC0480SCP_tx_gfx); |
| 3014 | 3014 | } |
| 3015 | 3015 | |
| 3016 | tile_get_info_ | |
| 3016 | tile_get_info_callback tc480_get_tile_info[5] = | |
| 3017 | 3017 | { |
| 3018 | 3018 | TC0480SCP_get_bg0_tile_info, TC0480SCP_get_bg1_tile_info, |
| 3019 | 3019 | TC0480SCP_get_bg2_tile_info, TC0480SCP_get_bg3_tile_info, |
| r814 | r815 | |
| 3166 | 3166 | TC0480SCP_dblwidth=0; |
| 3167 | 3167 | |
| 3168 | 3168 | /* 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); | |
| 3174 | 3174 | |
| 3175 | 3175 | /* 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); | |
| 3181 | 3181 | |
| 3182 | 3182 | TC0480SCP_ram = auto_malloc(TC0480SCP_RAM_SIZE); |
| 3183 | 3183 | TC0480SCP_char_dirty = auto_malloc(TC0480SCP_TOTAL_CHARS); |
| r814 | r815 | |
| 3613 | 3613 | UINT16 scanline[512]; |
| 3614 | 3614 | UINT32 sx; |
| 3615 | 3615 | mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); |
| 3616 | mame_bitmap * | |
| 3616 | mame_bitmap *flagsbitmap = tilemap_get_flags | |
| 3617 | 3617 | (TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); |
| 3618 | 3618 | int flip = TC0480SCP_pri_reg & 0x40; |
| 3619 | 3619 | int i,y,y_index,src_y_index,row_index; |
| r814 | r815 | |
| 3664 | 3664 | - ((TC0480SCP_bgscroll_ram[layer][row_index+0x800] << 8) &0xffff); |
| 3665 | 3665 | |
| 3666 | 3666 | src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0); |
| 3667 | tsrc = BITMAP_ADDR8( | |
| 3667 | tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0); | |
| 3668 | 3668 | dst16 = scanline; |
| 3669 | 3669 | |
| 3670 | 3670 | x_step = zoomx; |
| 3671 | 3671 | |
| 3672 | if (flags & TILEMAP_ | |
| 3672 | if (flags & TILEMAP_D | |
| 3673 | 3673 | { |
| 3674 | 3674 | for (i=0; i<screen_width; i++) |
| 3675 | 3675 | { |
| r814 | r815 | |
| 3689 | 3689 | } |
| 3690 | 3690 | } |
| 3691 | 3691 | |
| 3692 | if (flags & TILEMAP_ | |
| 3692 | if (flags & TILEMAP_D | |
| 3693 | 3693 | taitoic_drawscanline(bitmap,0,y,scanline,0,ROT0,priority,cliprect); |
| 3694 | 3694 | else |
| 3695 | 3695 | taitoic_drawscanline(bitmap,0,y,scanline,1,ROT0,priority,cliprect); |
| r814 | r815 | |
| 3746 | 3746 | static void TC0480SCP_bg23_draw(mame_bitmap *bitmap,const rectangle *cliprect,int layer,int flags,UINT32 priority) |
| 3747 | 3747 | { |
| 3748 | 3748 | mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); |
| 3749 | mame_bitmap * | |
| 3749 | mame_bitmap *flagsbitmap = tilemap_get_flags | |
| 3750 | 3750 | (TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); |
| 3751 | 3751 | |
| 3752 | 3752 | UINT16 *dst16,*src16; |
| r814 | r815 | |
| 3832 | 3832 | } |
| 3833 | 3833 | |
| 3834 | 3834 | src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0); |
| 3835 | tsrc = BITMAP_ADDR8( | |
| 3835 | tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0); | |
| 3836 | 3836 | dst16 = scanline; |
| 3837 | 3837 | |
| 3838 | if (flags & TILEMAP_ | |
| 3838 | if (flags & TILEMAP_D | |
| 3839 | 3839 | { |
| 3840 | 3840 | for (i=0; i<screen_width; i++) |
| 3841 | 3841 | { |
| r814 | r815 | |
| 3855 | 3855 | } |
| 3856 | 3856 | } |
| 3857 | 3857 | |
| 3858 | if (flags & TILEMAP_ | |
| 3858 | if (flags & TILEMAP_D | |
| 3859 | 3859 | taitoic_drawscanline(bitmap,0,y,scanline,0,ROT0,priority,cliprect); |
| 3860 | 3860 | else |
| 3861 | 3861 | taitoic_drawscanline(bitmap,0,y,scanline,1,ROT0,priority,cliprect); |
| r814 | r815 | |
|---|---|---|
| 114 | 114 | (layer & 2) ? 1 : 0, |
| 115 | 115 | vram[2*tile_index] + tile_offs, |
| 116 | 116 | attr, |
| 117 | 0) | |
| 117 | 0); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | static TILE_GET_INFO( get_tile_info0 ) { get_tile_info(machine,tileinfo,tile_index,0,&rthunder_videoram1[0x0000]); } |
| r814 | r815 | |
| 131 | 131 | |
| 132 | 132 | VIDEO_START( namcos86 ) |
| 133 | 133 | { |
| 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); | |
| 138 | 138 | |
| 139 | 139 | tilemap_set_transparent_pen(bg_tilemap[0],7); |
| 140 | 140 | tilemap_set_transparent_pen(bg_tilemap[1],7); |
| r814 | r815 | |
|---|---|---|
| 108 | 108 | 0, |
| 109 | 109 | ( (attr & 0x03) << 8 ) + code + tiles*0x400, |
| 110 | 110 | (attr >> 2) & 0xf, |
| 111 | TILE_FLIPYX( (attr >> 6) & 3 )) | |
| 111 | TILE_FLIPYX( (attr >> 6) & 3 )); | |
| 112 | 112 | } |
| 113 | 113 | #endif |
| 114 | 114 | |
| r814 | r815 | |
| 183 | 183 | |
| 184 | 184 | #if TILEMAPS |
| 185 | 185 | bg_tilemap = tilemap_create( get_tile_info, tilemap_scan_cols, |
| 186 | TILEMAP_TYPE_ | |
| 186 | TILEMAP_TYPE_ | |
| 187 | 187 | 8,8,0x20*((suna8_text_dim > 0)?4:8),0x20); |
| 188 | 188 | |
| 189 | 189 | tilemap_set_transparent_pen(bg_tilemap,15); |
| r814 | r815 | |
|---|---|---|
| 157 | 157 | |
| 158 | 158 | /* Draw playfields */ |
| 159 | 159 | if (pri==0) { |
| 160 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 160 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 161 | 161 | deco16_tilemap_3_draw(bitmap,cliprect,0,0); |
| 162 | 162 | draw_sprites(machine, bitmap,cliprect,0); |
| 163 | 163 | deco16_tilemap_2_draw(bitmap,cliprect,0,0); |
| 164 | 164 | } |
| 165 | 165 | else if (pri==1) { |
| 166 | deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_ | |
| 166 | deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_D | |
| 167 | 167 | deco16_tilemap_4_draw(bitmap,cliprect,0,0); |
| 168 | 168 | draw_sprites(machine, bitmap,cliprect,0); |
| 169 | 169 | deco16_tilemap_2_draw(bitmap,cliprect,0,0); |
| 170 | 170 | } |
| 171 | 171 | else if (pri==2) { |
| 172 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 172 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 173 | 173 | deco16_tilemap_2_draw(bitmap,cliprect,0,0); |
| 174 | 174 | draw_sprites(machine, bitmap,cliprect,0); |
| 175 | 175 | deco16_tilemap_3_draw(bitmap,cliprect,0,0); |
| 176 | 176 | } |
| 177 | 177 | else { |
| 178 | deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_ | |
| 178 | deco16_tilemap_3_draw(bitmap,cliprect,TILEMAP_D | |
| 179 | 179 | deco16_tilemap_2_draw(bitmap,cliprect,0,0); |
| 180 | 180 | draw_sprites(machine, bitmap,cliprect,0); |
| 181 | 181 | deco16_tilemap_4_draw(bitmap,cliprect,0,0); |
| r814 | r815 | |
|---|---|---|
| 135 | 135 | int code = videoram[tile_index]; |
| 136 | 136 | int color = colorram[tile_index] & 0x0f; |
| 137 | 137 | |
| 138 | SET_TILE_INFO(1, code, color, 0) | |
| 138 | SET_TILE_INFO(1, code, color, 0); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 143 | 143 | int code = nova2001_videoram2[tile_index]; |
| 144 | 144 | int color = nova2001_colorram2[tile_index] & 0x0f; |
| 145 | 145 | |
| 146 | SET_TILE_INFO(0, code, color, 0) | |
| 146 | SET_TILE_INFO(0, code, color, 0); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | VIDEO_START( nova2001 ) |
| 150 | 150 | { |
| 151 | 151 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 152 | TILEMAP_TYPE_ | |
| 152 | TILEMAP_TYPE_ | |
| 153 | 153 | |
| 154 | 154 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 155 | TILEMAP_TYPE_ | |
| 155 | TILEMAP_TYPE_ | |
| 156 | 156 | |
| 157 | 157 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 158 | 158 | } |
| r814 | r815 | |
|---|---|---|
| 982 | 982 | |
| 983 | 983 | ***************************************************************************/ |
| 984 | 984 | |
| 985 | static | |
| 985 | static | |
| 986 | 986 | { |
| 987 | 987 | /* logical (col,row) -> memory offset */ |
| 988 | 988 | return (row & 0x1f) + ((col & 0x3f) << 5) + ((row & 0x20) << 6); |
| 989 | 989 | } |
| 990 | 990 | |
| 991 | static | |
| 991 | static | |
| 992 | 992 | { |
| 993 | 993 | /* logical (col,row) -> memory offset */ |
| 994 | 994 | return (row & 0x0f) + ((col & 0x3f) << 4) + ((row & 0x30) << 6); |
| 995 | 995 | } |
| 996 | 996 | |
| 997 | static | |
| 997 | static | |
| 998 | 998 | { |
| 999 | 999 | /* logical (col,row) -> memory offset */ |
| 1000 | 1000 | return (row & 0x07) + ((col & 0x3f) << 3) + ((row & 0x38) << 6); |
| r814 | r815 | |
| 1026 | 1026 | gfxset, |
| 1027 | 1027 | code + base, |
| 1028 | 1028 | (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; | |
| 1030 | 1031 | } |
| 1031 | 1032 | |
| 1032 | 1033 | static TILE_GET_INFO( get_tile1_info ) |
| r814 | r815 | |
| 1041 | 1042 | 2, |
| 1042 | 1043 | code + base, |
| 1043 | 1044 | (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; | |
| 1045 | 1047 | |
| 1046 | 1048 | if (code < startcode || code > endcode |
| 1047 | 1049 | /* |
| r814 | r815 | |
| 1079 | 1081 | 3, |
| 1080 | 1082 | code + base, |
| 1081 | 1083 | (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; | |
| 1083 | 1086 | |
| 1084 | 1087 | if (code < startcode || code > endcode) |
| 1085 | 1088 | { |
| r814 | r815 | |
| 1135 | 1138 | |
| 1136 | 1139 | machine_reset_cps(machine); |
| 1137 | 1140 | |
| 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); | |
| 1141 | 1144 | |
| 1142 | 1145 | /* front masks will change at runtime to handle sprite occluding */ |
| 1143 | 1146 | cps1_update_transmasks(); |
| r814 | r815 | |
| 1762 | 1765 | case 1: |
| 1763 | 1766 | case 2: |
| 1764 | 1767 | case 3: |
| 1765 | tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_ | |
| 1768 | tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER1,primask); | |
| 1766 | 1769 | break; |
| 1767 | 1770 | } |
| 1768 | 1771 | } |
| r814 | r815 | |
| 1777 | 1780 | case 1: |
| 1778 | 1781 | case 2: |
| 1779 | 1782 | case 3: |
| 1780 | tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_ | |
| 1783 | tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER0,1); | |
| 1781 | 1784 | break; |
| 1782 | 1785 | } |
| 1783 | 1786 | } |
| r814 | r815 | |
|---|---|---|
| 45 | 45 | #define PAGES_PER_TMAP_X (0x4) |
| 46 | 46 | #define PAGES_PER_TMAP_Y (0x4) |
| 47 | 47 | |
| 48 | ||
| 48 | static TILEMAP_MAPPER( yunsun16_tilemap_scan_pages | |
| 49 | 49 | { |
| 50 | 50 | return (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y * PAGES_PER_TMAP_X + |
| 51 | 51 | (row % TILES_PER_PAGE_Y) + |
| r814 | r815 | |
| 62 | 62 | TMAP_GFX, |
| 63 | 63 | code, |
| 64 | 64 | attr & 0xf, |
| 65 | (attr & 0x20) ? TILE_FLIPX : 0) | |
| 65 | (attr & 0x20) ? TILE_FLIPX : 0); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static TILE_GET_INFO( get_tile_info_1 ) |
| r814 | r815 | |
| 73 | 73 | TMAP_GFX, |
| 74 | 74 | code, |
| 75 | 75 | attr & 0xf, |
| 76 | (attr & 0x20) ? TILE_FLIPX : 0) | |
| 76 | (attr & 0x20) ? TILE_FLIPX : 0); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | WRITE16_HANDLER( yunsun16_vram_0_w ) |
| r814 | r815 | |
| 102 | 102 | VIDEO_START( yunsun16 ) |
| 103 | 103 | { |
| 104 | 104 | tilemap_0 = tilemap_create( get_tile_info_0,yunsun16_tilemap_scan_pages, |
| 105 | TILEMAP_TYPE_ | |
| 105 | TILEMAP_TYPE_ | |
| 106 | 106 | 16,16, |
| 107 | 107 | TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y); |
| 108 | 108 | |
| 109 | 109 | tilemap_1 = tilemap_create( get_tile_info_1,yunsun16_tilemap_scan_pages, |
| 110 | TILEMAP_TYPE_ | |
| 110 | TILEMAP_TYPE_ | |
| 111 | 111 | 16,16, |
| 112 | 112 | TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y); |
| 113 | 113 | |
| r814 | r815 | |
| 216 | 216 | if((*yunsun16_priority & 0x0c) == 4) |
| 217 | 217 | { |
| 218 | 218 | /* The color of the this layer's transparent pen goes below everything */ |
| 219 | tilemap_draw(bitmap,cliprect,tilemap_0, TILEMAP_ | |
| 219 | tilemap_draw(bitmap,cliprect,tilemap_0, TILEMAP_D | |
| 220 | 220 | |
| 221 | 221 | tilemap_draw(bitmap,cliprect,tilemap_0, 0, 1); |
| 222 | 222 | |
| r814 | r815 | |
| 225 | 225 | else if((*yunsun16_priority & 0x0c) == 8) |
| 226 | 226 | { |
| 227 | 227 | /* The color of the this layer's transparent pen goes below everything */ |
| 228 | tilemap_draw(bitmap,cliprect,tilemap_1, TILEMAP_ | |
| 228 | tilemap_draw(bitmap,cliprect,tilemap_1, TILEMAP_D | |
| 229 | 229 | |
| 230 | 230 | tilemap_draw(bitmap,cliprect,tilemap_1, 0, 1); |
| 231 | 231 |
| r814 | r815 | |
|---|---|---|
| 123 | 123 | int sx = tile_index % 32; |
| 124 | 124 | int color = (sx >= 26) ? 0 : 1; |
| 125 | 125 | |
| 126 | SET_TILE_INFO(2, code, color, 0) | |
| 126 | SET_TILE_INFO(2, code, color, 0); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 136 | 136 | code |= rougien_gfxbank1 * 0x2800; |
| 137 | 137 | code |= rougien_gfxbank2 * 0x2400; |
| 138 | 138 | |
| 139 | SET_TILE_INFO(0, code, color, flags) | |
| 139 | SET_TILE_INFO(0, code, color, flags); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | VIDEO_START( mermaid ) |
| 143 | 143 | { |
| 144 | 144 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 145 | TILEMAP_TYPE_ | |
| 145 | TILEMAP_TYPE_ | |
| 146 | 146 | |
| 147 | 147 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 148 | TILEMAP_TYPE_ | |
| 148 | TILEMAP_TYPE_ | |
| 149 | 149 | |
| 150 | 150 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 151 | 151 | tilemap_set_scroll_cols(fg_tilemap, 32); |
| r814 | r815 | |
|---|---|---|
| 84 | 84 | 1, |
| 85 | 85 | tile, |
| 86 | 86 | color, |
| 87 | 0) | |
| 87 | 0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static TILE_GET_INFO( get_fore_tile_info ) |
| r814 | r815 | |
| 98 | 98 | 2, |
| 99 | 99 | tile, |
| 100 | 100 | color, |
| 101 | 0) | |
| 101 | 0); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | static TILE_GET_INFO( get_mid_tile_info ) |
| r814 | r815 | |
| 112 | 112 | 3, |
| 113 | 113 | tile|dcon_gfx_bank_select, |
| 114 | 114 | color, |
| 115 | 0) | |
| 115 | 0); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 126 | 126 | 0, |
| 127 | 127 | tile, |
| 128 | 128 | color, |
| 129 | 0) | |
| 129 | 0); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | VIDEO_START( dcon ) |
| 133 | 133 | { |
| 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); | |
| 138 | 138 | |
| 139 | 139 | tilemap_set_transparent_pen(midground_layer,15); |
| 140 | 140 | tilemap_set_transparent_pen(foreground_layer,15); |
| r814 | r815 | |
|---|---|---|
| 11 | 11 | int tileno = kickgoal_fgram[tile_index*2] & 0x0fff; |
| 12 | 12 | int color = kickgoal_fgram[tile_index*2+1] & 0x000f; |
| 13 | 13 | |
| 14 | SET_TILE_INFO(0,tileno + 0x7000,color + 0x00,0) | |
| 14 | SET_TILE_INFO(0,tileno + 0x7000,color + 0x00,0); | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /* BG */ |
| r814 | r815 | |
| 20 | 20 | int tileno = kickgoal_bgram[tile_index*2] & 0x0fff; |
| 21 | 21 | int color = kickgoal_bgram[tile_index*2+1] & 0x000f; |
| 22 | 22 | |
| 23 | SET_TILE_INFO(1,tileno + 0x1000,color + 0x10,0) | |
| 23 | SET_TILE_INFO(1,tileno + 0x1000,color + 0x10,0); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /* BG 2 */ |
| r814 | r815 | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | static | |
| 37 | static | |
| 38 | 38 | { |
| 39 | 39 | /* logical (col,row) -> memory offset */ |
| 40 | 40 | return col*8 + (row & 0x7) + ((row & 0x3c) >> 3) * 0x200; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | static | |
| 43 | static | |
| 44 | 44 | { |
| 45 | 45 | /* logical (col,row) -> memory offset */ |
| 46 | 46 | return col*16 + (row & 0xf) + ((row & 0x70) >> 4) * 0x400; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | static | |
| 49 | static | |
| 50 | 50 | { |
| 51 | 51 | /* logical (col,row) -> memory offset */ |
| 52 | 52 | return col*32 + (row & 0x1f) + ((row & 0x20) >> 5) * 0x800; |
| r814 | r815 | |
| 55 | 55 | |
| 56 | 56 | VIDEO_START( kickgoal ) |
| 57 | 57 | { |
| 58 | kickgoal_fgtm = tilemap_create(get_kickgoal_fg_tile_info,tilemap_scan_kicksfg,TILEMAP_TYPE_ | |
| 58 | kickgoal_fgtm = tilemap_create(get_kickgoal_fg_tile_info,tilemap_scan_kicksfg,TILEMAP_TYPE_ | |
| 59 | 59 | tilemap_set_transparent_pen(kickgoal_fgtm,15); |
| 60 | kickgoal_bgtm = tilemap_create(get_kickgoal_bg_tile_info,tilemap_scan_kicksbg,TILEMAP_TYPE_ | |
| 60 | kickgoal_bgtm = tilemap_create(get_kickgoal_bg_tile_info,tilemap_scan_kicksbg,TILEMAP_TYPE_ | |
| 61 | 61 | tilemap_set_transparent_pen(kickgoal_bgtm,15); |
| 62 | kickgoal_bg2tm = tilemap_create(get_kickgoal_bg2_tile_info,tilemap_scan_kicksbg2,TILEMAP_TYPE_ | |
| 62 | kickgoal_bg2tm = tilemap_create(get_kickgoal_bg2_tile_info,tilemap_scan_kicksbg2,TILEMAP_TYPE_ | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| r814 | r815 | |
| 153 | 153 | int tileno = kickgoal_fgram[tile_index*2] & 0x0fff; |
| 154 | 154 | int color = kickgoal_fgram[tile_index*2+1] & 0x000f; |
| 155 | 155 | |
| 156 | SET_TILE_INFO(0,tileno + 0x7000*2,color + 0x00,0) | |
| 156 | SET_TILE_INFO(0,tileno + 0x7000*2,color + 0x00,0); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /* BG */ |
| r814 | r815 | |
| 164 | 164 | int flipx = kickgoal_bgram[tile_index*2+1] & 0x0020; |
| 165 | 165 | int flipy = kickgoal_bgram[tile_index*2+1] & 0x0040; |
| 166 | 166 | |
| 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)); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /* BG 2 */ |
| r814 | r815 | |
| 175 | 175 | int flipx = kickgoal_bg2ram[tile_index*2+1] & 0x0020; |
| 176 | 176 | int flipy = kickgoal_bg2ram[tile_index*2+1] & 0x0040; |
| 177 | 177 | |
| 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)); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| 182 | static | |
| 182 | static | |
| 183 | 183 | { |
| 184 | 184 | /* logical (col,row) -> memory offset */ |
| 185 | 185 | return col*16 + (row & 0xf) + ((row & 0x70) >> 4) * 0x400; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | static | |
| 188 | static | |
| 189 | 189 | { |
| 190 | 190 | /* logical (col,row) -> memory offset */ |
| 191 | 191 | return col*16 + (row & 0xf) + ((row & 0x70) >> 4) * 0x400; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | static | |
| 194 | static | |
| 195 | 195 | { |
| 196 | 196 | /* logical (col,row) -> memory offset */ |
| 197 | 197 | return col*32 + (row & 0x1f) + ((row & 0x20) >> 5) * 0x800; |
| r814 | r815 | |
| 200 | 200 | |
| 201 | 201 | VIDEO_START( actionhw ) |
| 202 | 202 | { |
| 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); | |
| 206 | 206 | |
| 207 | 207 | tilemap_set_transparent_pen(kickgoal_fgtm,15); |
| 208 | 208 | tilemap_set_transparent_pen(kickgoal_bgtm,15); |
| r814 | r815 | |
|---|---|---|
| 512 | 512 | state_save_register_global(background_blue); |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | static void video_start_common(running_machine *machine, | |
| 515 | static void video_start_common(running_machine *machine, tilemap_mapper_callback | |
| 516 | 516 | { |
| 517 | bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,TILEMAP_TYPE_ | |
| 517 | bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,TILEMAP_TYPE_ | |
| 518 | 518 | tilemap_set_scrolldx(bg_tilemap, 0, -128); |
| 519 | 519 | |
| 520 | 520 | tilemap_set_transparent_pen(bg_tilemap,0); |
| r814 | r815 | |
| 813 | 813 | VIDEO_START( rockclim ) |
| 814 | 814 | { |
| 815 | 815 | video_start_galaxian(machine); |
| 816 | rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 816 | rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 817 | 817 | draw_background = rockclim_draw_background; |
| 818 | 818 | modify_charcode = mooncrst_modify_charcode; |
| 819 | 819 | modify_spritecode = rockclim_modify_spritecode; |
| r814 | r815 | |
| 832 | 832 | code |= (bank << 4); |
| 833 | 833 | color |= ((galaxian_attributesram[(x << 1) | 1] & 0x40) >> 3); |
| 834 | 834 | |
| 835 | SET_TILE_INFO(0, code, color, 0) | |
| 835 | SET_TILE_INFO(0, code, color, 0); | |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | VIDEO_START( drivfrcg ) |
| 839 | 839 | { |
| 840 | bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 840 | bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 841 | 841 | |
| 842 | 842 | tilemap_set_transparent_pen(bg_tilemap,0); |
| 843 | 843 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| r814 | r815 | |
| 875 | 875 | |
| 876 | 876 | VIDEO_START( ad2083 ) |
| 877 | 877 | { |
| 878 | bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 878 | bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 879 | 879 | |
| 880 | 880 | tilemap_set_transparent_pen(bg_tilemap,0); |
| 881 | 881 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| r814 | r815 | |
| 928 | 928 | |
| 929 | 929 | code |= (bank << 8); |
| 930 | 930 | |
| 931 | SET_TILE_INFO(0, code, color, 0) | |
| 931 | SET_TILE_INFO(0, code, color, 0); | |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | VIDEO_START( racknrol ) |
| 935 | 935 | { |
| 936 | bg_tilemap = tilemap_create(racknrol_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 936 | bg_tilemap = tilemap_create(racknrol_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 937 | 937 | |
| 938 | 938 | tilemap_set_transparent_pen(bg_tilemap,0); |
| 939 | 939 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| r814 | r815 | |
| 993 | 993 | modify_color(&color); |
| 994 | 994 | } |
| 995 | 995 | |
| 996 | SET_TILE_INFO(0, code, color, 0) | |
| 996 | SET_TILE_INFO(0, code, color, 0); | |
| 997 | 997 | } |
| 998 | 998 | |
| 999 | 999 | VIDEO_START( dambustr ) |
| r814 | r815 | |
| 1018 | 1018 | |
| 1019 | 1019 | /* make a copy of the tilemap to emulate background priority */ |
| 1020 | 1020 | dambustr_videoram2 = auto_malloc(0x0400); |
| 1021 | dambustr_tilemap2 = tilemap_create(dambustr_get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 1021 | dambustr_tilemap2 = tilemap_create(dambustr_get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 1022 | 1022 | |
| 1023 | 1023 | tilemap_set_transparent_pen(dambustr_tilemap2,0); |
| 1024 | 1024 | } |
| r814 | r815 | |
| 2068 | 2068 | modify_color(&color); |
| 2069 | 2069 | } |
| 2070 | 2070 | |
| 2071 | SET_TILE_INFO(0, code, color, 0) | |
| 2071 | SET_TILE_INFO(0, code, color, 0); | |
| 2072 | 2072 | } |
| 2073 | 2073 | |
| 2074 | 2074 | static TILE_GET_INFO( rockclim_get_tile_info ) |
| 2075 | 2075 | { |
| 2076 | 2076 | UINT16 code = rockclim_videoram[tile_index]; |
| 2077 | SET_TILE_INFO(2, code, 0, 0) | |
| 2077 | SET_TILE_INFO(2, code, 0, 0); | |
| 2078 | 2078 | } |
| 2079 | 2079 | |
| 2080 | 2080 | static void draw_bullets_common(running_machine *machine, mame_bitmap *bitmap) |
| r814 | r815 | |
|---|---|---|
| 30 | 30 | 1, |
| 31 | 31 | vram[tile_index+1], |
| 32 | 32 | attr & 0x7f, |
| 33 | 0) | |
| 34 | tileinfo->priority = (attr & 0x0600) >> 9; | |
| 33 | 0); | |
| 34 | tileinfo->category = (attr & 0x0600) >> 9; | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | static TILE_GET_INFO( get_tile_info0 ) |
| r814 | r815 | |
| 59 | 59 | |
| 60 | 60 | VIDEO_START( othldrby ) |
| 61 | 61 | { |
| 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); | |
| 65 | 65 | |
| 66 | 66 | vram = auto_malloc(VIDEORAM_SIZE * sizeof(vram[0])); |
| 67 | 67 | buf_spriteram = auto_malloc(2*SPRITERAM_SIZE * sizeof(buf_spriteram[0])); |
| r814 | r815 | |
|---|---|---|
| 34 | 34 | static TILE_GET_INFO( get_bbuster_tile_info ) |
| 35 | 35 | { |
| 36 | 36 | 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); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | static TILE_GET_INFO( get_pf1_tile_info ) |
| 41 | 41 | { |
| 42 | 42 | 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); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static TILE_GET_INFO( get_pf2_tile_info ) |
| 47 | 47 | { |
| 48 | 48 | 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); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | WRITE16_HANDLER( bbuster_video_w ) |
| r814 | r815 | |
| 71 | 71 | |
| 72 | 72 | VIDEO_START( bbuster ) |
| 73 | 73 | { |
| 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); | |
| 77 | 77 | |
| 78 | 78 | tilemap_set_transparent_pen(pf1_tilemap, 15); |
| 79 | 79 | tilemap_set_transparent_pen(fix_tilemap, 15); |
| r814 | r815 | |
| 81 | 81 | |
| 82 | 82 | VIDEO_START( mechatt ) |
| 83 | 83 | { |
| 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); | |
| 87 | 87 | |
| 88 | 88 | tilemap_set_transparent_pen(pf1_tilemap, 15); |
| 89 | 89 | tilemap_set_transparent_pen(fix_tilemap, 15); |
| r814 | r815 | |
|---|---|---|
| 43 | 43 | tileno = data & 0xFFF; |
| 44 | 44 | pal = (data >> 12) & 0xF; |
| 45 | 45 | |
| 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); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | WRITE16_HANDLER( VS920A_0_vram_w ) |
| r814 | r815 | |
| 67 | 67 | |
| 68 | 68 | for (i=0;i<numchips;i++) |
| 69 | 69 | { |
| 70 | VS920A[i].tmap = tilemap_create(VS920A_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 70 | VS920A[i].tmap = tilemap_create(VS920A_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 71 | 71 | |
| 72 | 72 | tilemap_set_transparent_pen(VS920A[i].tmap, 0); |
| 73 | 73 | } |
| r814 | r815 | |
| 158 | 158 | pal = (data >> 12) & 0xF; |
| 159 | 159 | bankno = (data >> 9) & 0x7; |
| 160 | 160 | |
| 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); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | static void MB60553_reg_written(int numchip, int num_reg) |
| r814 | r815 | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /* twc94 has the tilemap made of 2 pages .. it needs this */ |
| 213 | ||
| 213 | static TILEMAP_MAPPER( twc94_scan | |
| 214 | 214 | { |
| 215 | 215 | /* logical (col,row) -> memory offset */ |
| 216 | 216 | return (row*64) + (col&63) + ((col&64)<<6); |
| r814 | r815 | |
| 225 | 225 | |
| 226 | 226 | for (i=0;i<numchips;i++) |
| 227 | 227 | { |
| 228 | MB60553[i].tmap = tilemap_create(MB60553_get_tile_info,twc94_scan,TILEMAP_TYPE_ | |
| 228 | MB60553[i].tmap = tilemap_create(MB60553_get_tile_info,twc94_scan,TILEMAP_TYPE_ | |
| 229 | 229 | |
| 230 | 230 | tilemap_set_transparent_pen(MB60553[i].tmap, 0); |
| 231 | 231 | } |
| r814 | r815 | |
|---|---|---|
| 148 | 148 | { |
| 149 | 149 | int _code = code & 0x000f; |
| 150 | 150 | tileinfo->pen_data = empty_tiles + _code*16*16; |
| 151 | tileinfo->pal | |
| 151 | tileinfo->pale | |
| 152 | 152 | tileinfo->flags = 0; |
| 153 | 153 | } |
| 154 | 154 | else |
| r814 | r815 | |
| 156 | 156 | 0, |
| 157 | 157 | (tile & 0xfffff) + (code & 0xf), |
| 158 | 158 | (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100, |
| 159 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 159 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| r814 | r815 | |
| 184 | 184 | { |
| 185 | 185 | int _code = code & 0x000f; |
| 186 | 186 | tileinfo->pen_data = empty_tiles + _code*16*16; |
| 187 | tileinfo->pal | |
| 187 | tileinfo->pale | |
| 188 | 188 | tileinfo->flags = 0; |
| 189 | 189 | } |
| 190 | 190 | else if ((tile & 0x00f00000)==0x00f00000) /* draw tile as 8bpp */ |
| r814 | r815 | |
| 192 | 192 | 1, |
| 193 | 193 | (tile & 0xfffff) + 2*(code & 0xf), |
| 194 | 194 | ((tile & 0x0f000000) >> 24) + 0x10, |
| 195 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 195 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 196 | 196 | else |
| 197 | 197 | SET_TILE_INFO( |
| 198 | 198 | 0, |
| 199 | 199 | (tile & 0xfffff) + (code & 0xf), |
| 200 | 200 | (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100, |
| 201 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 201 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /* 16x16x4 or 16x16x8 tiles. It's the tile's color that decides: if its low 4 |
| r814 | r815 | |
| 225 | 225 | { |
| 226 | 226 | int _code = code & 0x000f; |
| 227 | 227 | tileinfo->pen_data = empty_tiles + _code*16*16; |
| 228 | tileinfo->pal | |
| 228 | tileinfo->pale | |
| 229 | 229 | tileinfo->flags = 0; |
| 230 | 230 | } |
| 231 | 231 | else if ((tile & 0x00f00000)==0x00f00000) /* draw tile as 8bpp */ |
| r814 | r815 | |
| 233 | 233 | 3, |
| 234 | 234 | (tile & 0xfffff) + 8*(code & 0xf), |
| 235 | 235 | ((tile & 0x0f000000) >> 24) + 0x10, |
| 236 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 236 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 237 | 237 | else |
| 238 | 238 | SET_TILE_INFO( |
| 239 | 239 | 2, |
| 240 | 240 | (tile & 0xfffff) + 4*(code & 0xf), |
| 241 | 241 | (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100, |
| 242 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 242 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
| r814 | r815 | |
| 317 | 317 | hypr_tiletable_old = auto_malloc(hyprduel_tiletable_size); |
| 318 | 318 | dirtyindex = auto_malloc(hyprduel_tiletable_size/4); |
| 319 | 319 | |
| 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); | |
| 323 | 323 | |
| 324 | 324 | tilemap_set_transparent_pen(bg_tilemap[0],0); |
| 325 | 325 | tilemap_set_transparent_pen(bg_tilemap[1],0); |
| r814 | r815 | |
|---|---|---|
| 19 | 19 | int code = videoram[tile_index*2]; |
| 20 | 20 | int attr = videoram[tile_index*2+1]; |
| 21 | 21 | 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; | |
| 24 | 25 | SET_TILE_INFO( |
| 25 | 26 | 0, |
| 26 | 27 | tile_number, |
| 27 | 28 | attr & 0x0f, |
| 28 | flags) | |
| 29 | flags); | |
| 29 | 30 | } |
| 30 | 31 | |
| 31 | 32 | static TILE_GET_INFO( victnine_get_tile_info ) |
| r814 | r815 | |
| 39 | 40 | 0, |
| 40 | 41 | tile_number, |
| 41 | 42 | attr & 0x07, |
| 42 | flags) | |
| 43 | flags); | |
| 43 | 44 | } |
| 44 | 45 | |
| 45 | 46 | |
| 46 | 47 | VIDEO_START( flstory ) |
| 47 | 48 | { |
| 48 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 49 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 49 | 50 | // tilemap_set_transparent_pen( bg_tilemap,15 ); |
| 50 | 51 | tilemap_set_transmask(bg_tilemap,0,0x3fff,0xc000); /* split type 0 has pens 0-13 transparent in front half */ |
| 51 | 52 | tilemap_set_transmask(bg_tilemap,1,0x8000,0x7fff); /* split type 1 has pen 15 transparent in front half */ |
| r814 | r815 | |
| 58 | 59 | |
| 59 | 60 | VIDEO_START( victnine ) |
| 60 | 61 | { |
| 61 | bg_tilemap = tilemap_create( victnine_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 62 | bg_tilemap = tilemap_create( victnine_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 62 | 63 | tilemap_set_scroll_cols(bg_tilemap,32); |
| 63 | 64 | |
| 64 | 65 | paletteram = auto_malloc(0x200); |
| r814 | r815 | |
| 186 | 187 | |
| 187 | 188 | VIDEO_UPDATE( flstory ) |
| 188 | 189 | { |
| 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); | |
| 191 | 192 | flstory_draw_sprites(machine,bitmap,cliprect,0x00); |
| 192 | tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_ | |
| 193 | tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_LAYER0,0); | |
| 193 | 194 | flstory_draw_sprites(machine,bitmap,cliprect,0x80); |
| 194 | tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_ | |
| 195 | tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_LAYER0,0); | |
| 195 | 196 | return 0; |
| 196 | 197 | } |
| 197 | 198 |
| r814 | r815 | |
|---|---|---|
| 111 | 111 | tileno += screen_bank; |
| 112 | 112 | colour = colour >> 12; |
| 113 | 113 | |
| 114 | SET_TILE_INFO(0,tileno,colour,0) | |
| 114 | SET_TILE_INFO(0,tileno,colour,0); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| r814 | r815 | |
| 133 | 133 | tileno += bg_bank; |
| 134 | 134 | colour = colour >> 12; |
| 135 | 135 | |
| 136 | SET_TILE_INFO(2,tileno,colour,0) | |
| 136 | SET_TILE_INFO(2,tileno,colour,0); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | VIDEO_START( suprslam ) |
| 141 | 141 | { |
| 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); | |
| 144 | 144 | |
| 145 | 145 | K053936_wraparound_enable(0, 1); |
| 146 | 146 | K053936_set_offset(0, -45, -21); |
| r814 | r815 | |
|---|---|---|
| 71 | 71 | int code = videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3); |
| 72 | 72 | int color = (attr & 0x1f) | ((attr & 0x80) >> 2); |
| 73 | 73 | |
| 74 | SET_TILE_INFO(0, code, color, 0) | |
| 74 | SET_TILE_INFO(0, code, color, 0); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | VIDEO_START( strnskil ) |
| 78 | 78 | { |
| 79 | 79 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 80 | TILEMAP_TYPE_ | |
| 80 | TILEMAP_TYPE_ | |
| 81 | 81 | |
| 82 | 82 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 83 | 83 | } |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | VIDEO_START( atetris ) |
| 51 | 51 | { |
| 52 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 52 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 |
| r814 | r815 | |
|---|---|---|
| 142 | 142 | int color = (attr & 0x0f) + 16 * palettebank; |
| 143 | 143 | int flags = (attr & 0x20) ? TILE_FLIPY : 0; |
| 144 | 144 | |
| 145 | SET_TILE_INFO(0, code, color, flags) | |
| 145 | SET_TILE_INFO(0, code, color, flags); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | VIDEO_START( shaolins ) |
| 149 | 149 | { |
| 150 | 150 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 151 | TILEMAP_TYPE_ | |
| 151 | TILEMAP_TYPE_ | |
| 152 | 152 | |
| 153 | 153 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 154 | 154 | } |
| r814 | r815 | |
|---|---|---|
| 155 | 155 | static TILE_GET_INFO( get_pf2_tile_info ) |
| 156 | 156 | { |
| 157 | 157 | 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); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static TILE_GET_INFO( get_pf1_16x16_tile_info ) |
| 162 | 162 | { |
| 163 | 163 | 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); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | static TILE_GET_INFO( get_pf1_8x8_tile_info ) |
| 168 | 168 | { |
| 169 | 169 | 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); | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | VIDEO_START( sshangha ) |
| 174 | 174 | { |
| 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); | |
| 178 | 178 | |
| 179 | 179 | tilemap_set_transparent_pen(pf1_8x8_tilemap,0); |
| 180 | 180 | tilemap_set_transparent_pen(pf1_16x16_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 37 | 37 | SET_TILE_INFO(0, |
| 38 | 38 | code, |
| 39 | 39 | 2*color_codes[code >> 3] + fgcolor, |
| 40 | 0) | |
| 40 | 0); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| r814 | r815 | |
| 48 | 48 | SET_TILE_INFO(1, |
| 49 | 49 | code | ((attr & 0x03) << 8), |
| 50 | 50 | (attr >> 4) | (bgpalbank << 4), |
| 51 | TILE_FLIPYX((attr & 0x0c) >> 2)) | |
| 51 | TILE_FLIPYX((attr & 0x0c) >> 2)); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| r814 | r815 | |
| 63 | 63 | color_codes = memory_region(REGION_PROMS) + 0x300; |
| 64 | 64 | |
| 65 | 65 | |
| 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); | |
| 68 | 68 | |
| 69 | 69 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 70 | 70 |
| r814 | r815 | |
|---|---|---|
| 102 | 102 | static TILE_GET_INFO( sys24_tile_info_0s ) |
| 103 | 103 | { |
| 104 | 104 | UINT16 val = sys24_tile_ram[tile_index]; |
| 105 | tileinfo-> | |
| 105 | tileinfo->categor | |
| 106 | 106 | SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static TILE_GET_INFO( sys24_tile_info_0w ) |
| 110 | 110 | { |
| 111 | 111 | UINT16 val = sys24_tile_ram[tile_index|0x1000]; |
| 112 | tileinfo-> | |
| 112 | tileinfo->categor | |
| 113 | 113 | SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | static TILE_GET_INFO( sys24_tile_info_1s ) |
| 117 | 117 | { |
| 118 | 118 | UINT16 val = sys24_tile_ram[tile_index|0x2000]; |
| 119 | tileinfo-> | |
| 119 | tileinfo->categor | |
| 120 | 120 | SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static TILE_GET_INFO( sys24_tile_info_1w ) |
| 124 | 124 | { |
| 125 | 125 | UINT16 val = sys24_tile_ram[tile_index|0x3000]; |
| 126 | tileinfo-> | |
| 126 | tileinfo->categor | |
| 127 | 127 | SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0); |
| 128 | 128 | } |
| 129 | 129 | |
| r814 | r815 | |
| 148 | 148 | |
| 149 | 149 | sys24_char_dirtymap = auto_malloc(SYS24_TILES); |
| 150 | 150 | |
| 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); | |
| 155 | 155 | |
| 156 | 156 | tilemap_set_transparent_pen(sys24_tile_layer[0], 0); |
| 157 | 157 | tilemap_set_transparent_pen(sys24_tile_layer[1], 0); |
| r814 | r815 | |
| 208 | 208 | UINT8 *prib = priority_bitmap->base; |
| 209 | 209 | UINT16 *dest = dm->base; |
| 210 | 210 | |
| 211 | tpri |= TILE | |
| 211 | tpri |= TILEM | |
| 212 | 212 | |
| 213 | 213 | dest += yy1*dm->rowpixels + xx1; |
| 214 | 214 | prib += yy1*priority_bitmap->rowpixels + xx1; |
| r814 | r815 | |
| 342 | 342 | UINT16 *dest = dm->base; |
| 343 | 343 | pen_t *pens = machine->pens; |
| 344 | 344 | |
| 345 | tpri |= TILE | |
| 345 | tpri |= TILEM | |
| 346 | 346 | |
| 347 | 347 | dest += yy1*dm->rowpixels + xx1; |
| 348 | 348 | mask += yy1*4; |
| r814 | r815 | |
| 530 | 530 | draw = sys24_tile_draw_rect; |
| 531 | 531 | |
| 532 | 532 | bm = tilemap_get_pixmap(sys24_tile_layer[layer]); |
| 533 | tm = tilemap_get_ | |
| 533 | tm = tilemap_get_flags | |
| 534 | 534 | |
| 535 | 535 | if(hscr & 0x8000) { |
| 536 | 536 | int y; |
| r814 | r815 | |
|---|---|---|
| 256 | 256 | int code = videoram[tile_index]; |
| 257 | 257 | int color = colorram[tile_index] & 0x0f; |
| 258 | 258 | |
| 259 | SET_TILE_INFO(0, code, color, 0) | |
| 259 | SET_TILE_INFO(0, code, color, 0); | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | VIDEO_START( skyskipr ) |
| r814 | r815 | |
| 268 | 268 | bitmap_type = TYPE_SKYSKIPR; |
| 269 | 269 | |
| 270 | 270 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 271 | TILEMAP_TYPE_ | |
| 271 | TILEMAP_TYPE_ | |
| 272 | 272 | |
| 273 | 273 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 274 | 274 | } |
| r814 | r815 | |
| 282 | 282 | bitmap_type = TYPE_POPEYE; |
| 283 | 283 | |
| 284 | 284 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 285 | TILEMAP_TYPE_ | |
| 285 | TILEMAP_TYPE_ | |
| 286 | 286 | |
| 287 | 287 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 288 | 288 | } |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | 0, |
| 25 | 25 | code, |
| 26 | 26 | 0, |
| 27 | 0) | |
| 27 | 0); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | VIDEO_START( 4enraya ) |
| 31 | 31 | { |
| 32 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 32 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 33 | 33 | video_start_generic(machine); |
| 34 | 34 | } |
| 35 | 35 |
| r814 | r815 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | int code = videoram[tile_index]; |
| 21 | 21 | |
| 22 | SET_TILE_INFO(0, code, 0, 0) | |
| 22 | SET_TILE_INFO(0, code, 0, 0); | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | VIDEO_START( blockade ) |
| 26 | 26 | { |
| 27 | 27 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 28 | TILEMAP_TYPE_ | |
| 28 | TILEMAP_TYPE_ | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | VIDEO_UPDATE( blockade ) |
| r814 | r815 | |
|---|---|---|
| 51 | 51 | static TILE_GET_INFO( get_text_info ) |
| 52 | 52 | { |
| 53 | 53 | 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); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | static | |
| 57 | static | |
| 58 | 58 | { |
| 59 | 59 | /* logical (col,row) -> memory offset */ |
| 60 | 60 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5); |
| r814 | r815 | |
| 66 | 66 | int code = compgolf_bg_ram[tile_index*2+1] + ((attr & 1) << 8); |
| 67 | 67 | int color = (attr & 0x3e) >> 1; |
| 68 | 68 | |
| 69 | SET_TILE_INFO(1,code,color,0) | |
| 69 | SET_TILE_INFO(1,code,color,0); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | VIDEO_START( compgolf ) |
| 73 | 73 | { |
| 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); | |
| 76 | 76 | |
| 77 | 77 | tilemap_set_transparent_pen(text_tilemap,0); |
| 78 | 78 | } |
| r814 | r815 | |
|---|---|---|
| 66 | 66 | { |
| 67 | 67 | UINT16 attr = lordgun_vram_0[ tile_index * 2 + 0 ]; |
| 68 | 68 | 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)); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static TILE_GET_INFO( get_tile_info_1 ) |
| 73 | 73 | { |
| 74 | 74 | UINT16 attr = lordgun_vram_1[ tile_index * 2 + 0 ]; |
| 75 | 75 | 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)); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | static TILE_GET_INFO( get_tile_info_2 ) |
| 80 | 80 | { |
| 81 | 81 | UINT16 attr = lordgun_vram_2[ tile_index * 2 + 0 ]; |
| 82 | 82 | 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)); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static TILE_GET_INFO( get_tile_info_3 ) |
| 87 | 87 | { |
| 88 | 88 | UINT16 attr = lordgun_vram_3[ tile_index * 2 + 0 ]; |
| 89 | 89 | 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)); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | WRITE16_HANDLER( lordgun_vram_0_w ) |
| r814 | r815 | |
| 123 | 123 | VIDEO_START( lordgun ) |
| 124 | 124 | { |
| 125 | 125 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 126 | TILEMAP_TYPE_ | |
| 126 | TILEMAP_TYPE_ | |
| 127 | 127 | |
| 128 | 128 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 129 | TILEMAP_TYPE_ | |
| 129 | TILEMAP_TYPE_ | |
| 130 | 130 | |
| 131 | 131 | tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 132 | TILEMAP_TYPE_ | |
| 132 | TILEMAP_TYPE_ | |
| 133 | 133 | |
| 134 | 134 | tilemap_3 = tilemap_create( get_tile_info_3, tilemap_scan_rows, |
| 135 | TILEMAP_TYPE_ | |
| 135 | TILEMAP_TYPE_ | |
| 136 | 136 | |
| 137 | 137 | tilemap_set_scroll_rows(tilemap_0,1); |
| 138 | 138 | tilemap_set_scroll_cols(tilemap_0,1); |
| r814 | r815 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | static | |
| 13 | static | |
| 14 | 14 | { |
| 15 | 15 | /* logical (col,row) -> memory offset */ |
| 16 | 16 | return ((col & 0x7)) + ((7-(row & 0x7)) << 3) + ((col & 0x78) <<3) + ((0x38-(row&0x38))<<7); |
| r814 | r815 | |
| 26 | 26 | 2, |
| 27 | 27 | (tile&0xff)|((tile&0x4000)>>6), |
| 28 | 28 | (tile>>8)&0xf, |
| 29 | (tile&0x2000)?TILE_FLIPX:0) | |
| 29 | (tile&0x2000)?TILE_FLIPX:0); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 36 | 36 | 0, |
| 37 | 37 | (tile&0xff)|((tile&0xc000)>>6)|((tile&0x2000)>>3), |
| 38 | 38 | (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 */ | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| r814 | r815 | |
| 49 | 49 | |
| 50 | 50 | VIDEO_START( pushman ) |
| 51 | 51 | { |
| 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); | |
| 54 | 54 | |
| 55 | 55 | tilemap_set_transparent_pen(tx_tilemap,3); |
| 56 | 56 | } |
| r814 | r815 | |
|---|---|---|
| 88 | 88 | 2, |
| 89 | 89 | tile&0x7ff, |
| 90 | 90 | (tile>>12)&0xf, |
| 91 | 0) | |
| 91 | 0); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | VIDEO_START( lemmings ) |
| 95 | 95 | { |
| 96 | 96 | bitmap0 = auto_bitmap_alloc(2048,256,machine->screen[0].format); |
| 97 | vram_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 97 | vram_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 98 | 98 | |
| 99 | 99 | vram_buffer = (UINT8*)auto_malloc(2048*64); /* 64 bytes per VRAM character */ |
| 100 | 100 | vram_dirty = (UINT8*)auto_malloc(2048); |
| r814 | r815 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | if (zerozone_videoram[tile_index] & 0x0800) tileno += zerozone_tilebank * 0x800; |
| 35 | 35 | |
| 36 | SET_TILE_INFO(0,tileno,colour>>12,0) | |
| 36 | SET_TILE_INFO(0,tileno,colour>>12,0); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | VIDEO_START( zerozone ) |
| 40 | 40 | { |
| 41 | 41 | // i'm not 100% sure it should be opaque, pink title screen looks strange in las vegas girls |
| 42 | 42 | // but if its transparent other things look incorrect |
| 43 | zerozone_tilemap = tilemap_create(get_zerozone_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 43 | zerozone_tilemap = tilemap_create(get_zerozone_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | VIDEO_UPDATE( zerozone ) |
| r814 | r815 | |
|---|---|---|
| 87 | 87 | SET_TILE_INFO(0, |
| 88 | 88 | code | ((attr & 0x03) << 8), |
| 89 | 89 | col & 0x3f, |
| 90 | TILE_FLIPYX(attr >> 2)) | |
| 90 | TILE_FLIPYX(attr >> 2)); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| r814 | r815 | |
| 100 | 100 | |
| 101 | 101 | VIDEO_START( espial ) |
| 102 | 102 | { |
| 103 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 103 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 104 | 104 | |
| 105 | 105 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 106 | 106 | } |
| r814 | r815 | |
| 108 | 108 | VIDEO_START( netwars ) |
| 109 | 109 | { |
| 110 | 110 | /* 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_ | |
| 111 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 112 | 112 | |
| 113 | 113 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 114 | 114 | tilemap_set_scrolldy(bg_tilemap, 0, 0x100); |
| r814 | r815 | |
|---|---|---|
| 100 | 100 | int color = colorram[tile_index] & 0x0f; |
| 101 | 101 | int flags = ((colorram[tile_index] & 0x10) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x20) ? TILE_FLIPY : 0); |
| 102 | 102 | |
| 103 | SET_TILE_INFO(0, code, color, flags) | |
| 103 | SET_TILE_INFO(0, code, color, flags); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | VIDEO_START( hyperspt ) |
| 107 | 107 | { |
| 108 | 108 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 109 | TILEMAP_TYPE_ | |
| 109 | TILEMAP_TYPE_ | |
| 110 | 110 | |
| 111 | 111 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 112 | 112 | } |
| r814 | r815 | |
| 177 | 177 | int color = colorram[tile_index] & 0x0f; |
| 178 | 178 | int flags = (colorram[tile_index] & 0x10) ? TILE_FLIPX : 0; |
| 179 | 179 | |
| 180 | SET_TILE_INFO(0, code, color, flags) | |
| 180 | SET_TILE_INFO(0, code, color, flags); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | VIDEO_START( roadf ) |
| 184 | 184 | { |
| 185 | 185 | bg_tilemap = tilemap_create(roadf_get_bg_tile_info, tilemap_scan_rows, |
| 186 | TILEMAP_TYPE_ | |
| 186 | TILEMAP_TYPE_ | |
| 187 | 187 | |
| 188 | 188 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 189 | 189 | } |
| r814 | r815 | |
|---|---|---|
| 126 | 126 | decodechar(machine->gfx[0], code, tiamc1_charram, |
| 127 | 127 | machine->drv->gfxdecodeinfo[0].gfxlayout); |
| 128 | 128 | |
| 129 | SET_TILE_INFO(0, code, 0, 0) | |
| 129 | SET_TILE_INFO(0, code, 0, 0); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | static TILE_GET_INFO( get_bg2_tile_info ) |
| r814 | r815 | |
| 136 | 136 | decodechar(machine->gfx[0], code, tiamc1_charram, |
| 137 | 137 | machine->drv->gfxdecodeinfo[0].gfxlayout); |
| 138 | 138 | |
| 139 | SET_TILE_INFO(0, code, 0, 0) | |
| 139 | SET_TILE_INFO(0, code, 0, 0); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | VIDEO_START( tiamc1 ) |
| 143 | 143 | { |
| 144 | 144 | bg_tilemap1 = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, |
| 145 | TILEMAP_TYPE_ | |
| 145 | TILEMAP_TYPE_ | |
| 146 | 146 | |
| 147 | 147 | bg_tilemap2 = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, |
| 148 | TILEMAP_TYPE_ | |
| 148 | TILEMAP_TYPE_ | |
| 149 | 149 | |
| 150 | 150 | tiamc1_bg_vshift = 0; |
| 151 | 151 | tiamc1_bg_hshift = 0; |
| r814 | r815 | |
|---|---|---|
| 194 | 194 | 0, |
| 195 | 195 | tile_number, |
| 196 | 196 | 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; | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | static TILE_GET_INFO( get_pf2_tile_info ) |
| r814 | r815 | |
| 210 | 210 | 0, |
| 211 | 211 | tile_number, |
| 212 | 212 | 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; | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | static TILE_GET_INFO( get_pf3_tile_info ) |
| r814 | r815 | |
| 226 | 226 | 0, |
| 227 | 227 | tile_number, |
| 228 | 228 | 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; | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | static TILE_GET_INFO( get_pf4_tile_info ) |
| r814 | r815 | |
| 242 | 242 | 0, |
| 243 | 243 | tile_number, |
| 244 | 244 | 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; | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /*************************************************************************** |
| r814 | r815 | |
| 255 | 255 | |
| 256 | 256 | static void toaplan1_create_tilemaps(void) |
| 257 | 257 | { |
| 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); | |
| 262 | 262 | |
| 263 | 263 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 264 | 264 | tilemap_set_transparent_pen(pf2_tilemap,0); |
| r814 | r815 | |
| 1153 | 1153 | |
| 1154 | 1154 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 1155 | 1155 | |
| 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); | |
| 1158 | 1158 | |
| 1159 | 1159 | for (priority = 1; priority < 16; priority++) |
| 1160 | 1160 | { |
| r814 | r815 | |
| 1178 | 1178 | fillbitmap(priority_bitmap,0,cliprect); |
| 1179 | 1179 | fillbitmap(bitmap,machine->pens[0x120],cliprect); |
| 1180 | 1180 | |
| 1181 | tilemap_draw(bitmap,cliprect,pf4_tilemap,TILEMAP_ | |
| 1181 | tilemap_draw(bitmap,cliprect,pf4_tilemap,TILEMAP_D | |
| 1182 | 1182 | for (priority = 8; priority < 16; priority++) |
| 1183 | tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_ | |
| 1183 | tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_D | |
| 1184 | 1184 | |
| 1185 | 1185 | for (priority = 1; priority < 16; priority++) |
| 1186 | 1186 | { |
| r814 | r815 | |
| 1205 | 1205 | fillbitmap(priority_bitmap,0,cliprect); |
| 1206 | 1206 | fillbitmap(bitmap,machine->pens[0x120],cliprect); |
| 1207 | 1207 | |
| 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); | |
| 1210 | 1210 | |
| 1211 | 1211 | for (priority = 1; priority < 16; priority++) |
| 1212 | 1212 | { |
| r814 | r815 | |
|---|---|---|
| 172 | 172 | static TILE_GET_INFO( spaceod_get_tile_info ) |
| 173 | 173 | { |
| 174 | 174 | 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); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| 179 | static | |
| 179 | static | |
| 180 | 180 | { |
| 181 | 181 | /* this works for both horizontal and vertical tilemaps */ |
| 182 | 182 | /* which are 4 32x32 sections */ |
| r814 | r815 | |
| 187 | 187 | static TILE_GET_INFO( bg_get_tile_info ) |
| 188 | 188 | { |
| 189 | 189 | 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); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | |
| r814 | r815 | |
| 227 | 227 | /* and one vertically scrolling */ |
| 228 | 228 | case G80_BACKGROUND_SPACEOD: |
| 229 | 229 | 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); | |
| 232 | 232 | break; |
| 233 | 233 | |
| 234 | 234 | /* background tilemap is effectively 1 screen x n screens */ |
| 235 | 235 | case G80_BACKGROUND_MONSTERB: |
| 236 | bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 236 | bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 237 | 237 | break; |
| 238 | 238 | |
| 239 | 239 | /* background tilemap is effectively 4 screens x n screens */ |
| 240 | 240 | case G80_BACKGROUND_PIGNEWT: |
| 241 | 241 | case G80_BACKGROUND_SINDBADM: |
| 242 | bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 242 | bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 243 | 243 | break; |
| 244 | 244 | } |
| 245 | 245 |
| r814 | r815 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | code = rom[tile_index+0x80000] + 256*rom[tile_index] + 256*256*((rom[tile_index/4+0x100000]>>(2*(tile_index&3)))&3); |
| 27 | 27 | |
| 28 | SET_TILE_INFO(0,code & 0x3fff,code >> 14,0) | |
| 28 | SET_TILE_INFO(0,code & 0x3fff,code >> 14,0); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | static TILE_GET_INFO( prmrsocr_get_roz_tile_info ) |
| r814 | r815 | |
| 33 | 33 | UINT8 *rom = memory_region(REGION_USER1); |
| 34 | 34 | int code = rom[tile_index+0x20000] + 256*rom[tile_index]; |
| 35 | 35 | |
| 36 | SET_TILE_INFO(0,code & 0x1fff,code >> 13,0) | |
| 36 | SET_TILE_INFO(0,code & 0x1fff,code >> 13,0); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| r814 | r815 | |
| 279 | 279 | K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tmnt_tile_callback); |
| 280 | 280 | K053245_vh_start(machine,0, REGION_GFX2,NORMAL_PLANE_ORDER,lgtnfght_sprite_callback); |
| 281 | 281 | |
| 282 | roz_tilemap = tilemap_create(glfgreat_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 282 | roz_tilemap = tilemap_create(glfgreat_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 283 | 283 | |
| 284 | 284 | tilemap_set_transparent_pen(roz_tilemap,0); |
| 285 | 285 | |
| r814 | r815 | |
| 300 | 300 | K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tmnt_tile_callback); |
| 301 | 301 | K053245_vh_start(machine,0, REGION_GFX2,NORMAL_PLANE_ORDER,prmrsocr_sprite_callback); |
| 302 | 302 | |
| 303 | roz_tilemap = tilemap_create(prmrsocr_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 303 | roz_tilemap = tilemap_create(prmrsocr_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 304 | 304 | |
| 305 | 305 | tilemap_set_transparent_pen(roz_tilemap,0); |
| 306 | 306 | |
| r814 | r815 | |
| 573 | 573 | { |
| 574 | 574 | K052109_tilemap_update(); |
| 575 | 575 | |
| 576 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_ | |
| 576 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_D | |
| 577 | 577 | if ((priorityflag & 1) == 1) K051960_sprites_draw(bitmap,cliprect,0,0); |
| 578 | 578 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0); |
| 579 | 579 | if ((priorityflag & 1) == 0) K051960_sprites_draw(bitmap,cliprect,0,0); |
| r814 | r815 | |
| 585 | 585 | { |
| 586 | 586 | K052109_tilemap_update(); |
| 587 | 587 | |
| 588 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_ | |
| 588 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_D | |
| 589 | 589 | if ((priorityflag & 1) == 1) K051960_sprites_draw(bitmap,cliprect,0,0); |
| 590 | 590 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0); |
| 591 | 591 | if ((priorityflag & 1) == 0) K051960_sprites_draw(bitmap,cliprect,0,0); |
| r814 | r815 | |
| 614 | 614 | sortlayers(sorted_layer,layerpri); |
| 615 | 615 | |
| 616 | 616 | fillbitmap(priority_bitmap,0,cliprect); |
| 617 | tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[0]],TILEMAP_ | |
| 617 | tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[0]],TILEMAP_D | |
| 618 | 618 | tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[1]],0,2); |
| 619 | 619 | tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[2]],0,4); |
| 620 | 620 |
| r814 | r815 | |
|---|---|---|
| 119 | 119 | int code = zodiack_videoram2[tile_index]; |
| 120 | 120 | int color = (zodiack_attributesram[2 * (tile_index % 32) + 1] >> 4) & 0x07; |
| 121 | 121 | |
| 122 | SET_TILE_INFO(0, code, color, 0) | |
| 122 | SET_TILE_INFO(0, code, color, 0); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 127 | 127 | int code = videoram[tile_index]; |
| 128 | 128 | int color = zodiack_attributesram[2 * (tile_index % 32) + 1] & 0x07; |
| 129 | 129 | |
| 130 | SET_TILE_INFO(3, code, color, 0) | |
| 130 | SET_TILE_INFO(3, code, color, 0); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | VIDEO_START( zodiack ) |
| 134 | 134 | { |
| 135 | 135 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 136 | TILEMAP_TYPE_ | |
| 136 | TILEMAP_TYPE_ | |
| 137 | 137 | |
| 138 | 138 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 139 | TILEMAP_TYPE_ | |
| 139 | TILEMAP_TYPE_ | |
| 140 | 140 | |
| 141 | 141 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 142 | 142 | tilemap_set_scroll_cols(fg_tilemap, 32); |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | static TILE_GET_INFO( get_bg_tile_info ) |
| 25 | 25 | { |
| 26 | 26 | 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); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | VIDEO_START( mole ) |
| r814 | r815 | |
| 32 | 32 | tileram = (UINT16 *)auto_malloc(0x400 * sizeof(UINT16)); |
| 33 | 33 | |
| 34 | 34 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 35 | TILEMAP_TYPE_ | |
| 35 | TILEMAP_TYPE_ | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | WRITE8_HANDLER( mole_videoram_w ) |
| r814 | r815 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | assert(taitojc_gfx_index != MAX_GFX_ELEMENTS); |
| 191 | 191 | |
| 192 | taitojc_tilemap = tilemap_create(taitojc_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 192 | taitojc_tilemap = tilemap_create(taitojc_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 193 | 193 | taitojc_dirty_map = auto_malloc(TAITOJC_NUM_TILES); |
| 194 | 194 | |
| 195 | 195 | tilemap_set_transparent_pen(taitojc_tilemap, 0); |
| r814 | r815 | |
|---|---|---|
| 37 | 37 | 0, |
| 38 | 38 | code, |
| 39 | 39 | 0, |
| 40 | 0) | |
| 40 | 0); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | static TILE_GET_INFO( get_tile_info2 ) |
| r814 | r815 | |
| 48 | 48 | 1, |
| 49 | 49 | code + (pitnrun_char_bank<<8), |
| 50 | 50 | pitnrun_color_select&1, |
| 51 | 0) | |
| 51 | 0); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | WRITE8_HANDLER( pitnrun_videoram_w ) |
| r814 | r815 | |
| 177 | 177 | |
| 178 | 178 | VIDEO_START(pitnrun) |
| 179 | 179 | { |
| 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 ); | |
| 182 | 182 | tilemap_set_transparent_pen( fg, 0 ); |
| 183 | 183 | tmp_bitmap[0] = auto_bitmap_alloc(128,128,machine->screen[0].format); |
| 184 | 184 | tmp_bitmap[1] = auto_bitmap_alloc(128,128,machine->screen[0].format); |
| r814 | r815 | |
|---|---|---|
| 805 | 805 | |
| 806 | 806 | static TILE_GET_INFO( segaic16_tilemap_16a_tile_info ) |
| 807 | 807 | { |
| 808 | const struct tilemap_callback_info *info = | |
| 808 | const struct tilemap_callback_info *info = pa | |
| 809 | 809 | UINT16 data = info->rambase[tile_index]; |
| 810 | 810 | int code = ((data >> 1) & 0x1000) | (data & 0xfff); |
| 811 | 811 | int color = (data >> 5) & 0x7f; |
| 812 | 812 | |
| 813 | 813 | SET_TILE_INFO(0, code, color, 0); |
| 814 | tileinfo-> | |
| 814 | tileinfo->categor | |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | |
| 818 | 818 | static TILE_GET_INFO( segaic16_tilemap_16a_text_info ) |
| 819 | 819 | { |
| 820 | const struct tilemap_callback_info *info = | |
| 820 | const struct tilemap_callback_info *info = pa | |
| 821 | 821 | UINT16 data = info->rambase[tile_index]; |
| 822 | 822 | int color = (data >> 8) & 0x07; |
| 823 | 823 | int code = data & 0xff; |
| 824 | 824 | |
| 825 | 825 | SET_TILE_INFO(0, code, color, 0); |
| 826 | tileinfo-> | |
| 826 | tileinfo->categor | |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | |
| r814 | r815 | |
| 1017 | 1017 | |
| 1018 | 1018 | static TILE_GET_INFO( segaic16_tilemap_16b_tile_info ) |
| 1019 | 1019 | { |
| 1020 | const struct tilemap_callback_info *info = | |
| 1020 | const struct tilemap_callback_info *info = pa | |
| 1021 | 1021 | UINT16 data = info->rambase[tile_index]; |
| 1022 | 1022 | int color = (data >> 6) & 0x7f; |
| 1023 | 1023 | int code = data & 0x1fff; |
| r814 | r815 | |
| 1025 | 1025 | code = info->bank[code / info->banksize] * info->banksize + code % info->banksize; |
| 1026 | 1026 | |
| 1027 | 1027 | SET_TILE_INFO(0, code, color, 0); |
| 1028 | tileinfo-> | |
| 1028 | tileinfo->categor | |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | |
| 1032 | 1032 | static TILE_GET_INFO( segaic16_tilemap_16b_text_info ) |
| 1033 | 1033 | { |
| 1034 | const struct tilemap_callback_info *info = | |
| 1034 | const struct tilemap_callback_info *info = pa | |
| 1035 | 1035 | UINT16 data = info->rambase[tile_index]; |
| 1036 | 1036 | int bank = info->bank[0]; |
| 1037 | 1037 | int color = (data >> 9) & 0x07; |
| 1038 | 1038 | int code = data & 0x1ff; |
| 1039 | 1039 | |
| 1040 | 1040 | SET_TILE_INFO(0, bank * info->banksize + code, color, 0); |
| 1041 | tileinfo-> | |
| 1041 | tileinfo->categor | |
| 1042 | 1042 | } |
| 1043 | 1043 | |
| 1044 | 1044 | |
| 1045 | 1045 | static TILE_GET_INFO( segaic16_tilemap_16b_alt_tile_info ) |
| 1046 | 1046 | { |
| 1047 | const struct tilemap_callback_info *info = | |
| 1047 | const struct tilemap_callback_info *info = pa | |
| 1048 | 1048 | UINT16 data = info->rambase[tile_index]; |
| 1049 | 1049 | int color = (data >> 5) & 0x7f; |
| 1050 | 1050 | int code = data & 0x1fff; |
| r814 | r815 | |
| 1052 | 1052 | code = info->bank[code / info->banksize] * info->banksize + code % info->banksize; |
| 1053 | 1053 | |
| 1054 | 1054 | SET_TILE_INFO(0, code, color, 0); |
| 1055 | tileinfo-> | |
| 1055 | tileinfo->categor | |
| 1056 | 1056 | } |
| 1057 | 1057 | |
| 1058 | 1058 | |
| 1059 | 1059 | static TILE_GET_INFO( segaic16_tilemap_16b_alt_text_info ) |
| 1060 | 1060 | { |
| 1061 | const struct tilemap_callback_info *info = | |
| 1061 | const struct tilemap_callback_info *info = pa | |
| 1062 | 1062 | UINT16 data = info->rambase[tile_index]; |
| 1063 | 1063 | int bank = info->bank[0]; |
| 1064 | 1064 | int color = (data >> 8) & 0x07; |
| 1065 | 1065 | int code = data & 0xff; |
| 1066 | 1066 | |
| 1067 | 1067 | SET_TILE_INFO(0, bank * info->banksize + code, color, 0); |
| 1068 | tileinfo-> | |
| 1068 | tileinfo->categor | |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | |
| r814 | r815 | |
| 1199 | 1199 | void segaic16_tilemap_init(int which, int type, int colorbase, int xoffs, int numbanks) |
| 1200 | 1200 | { |
| 1201 | 1201 | 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; | |
| 1204 | 1204 | int pagenum; |
| 1205 | 1205 | int i; |
| 1206 | 1206 | |
| r814 | r815 | |
| 1265 | 1265 | } |
| 1266 | 1266 | |
| 1267 | 1267 | /* create the tilemap for the text layer */ |
| 1268 | info->textmap = tilemap_create(get_text_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 1268 | info->textmap = tilemap_create(get_text_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 1269 | 1269 | |
| 1270 | 1270 | /* configure it */ |
| 1271 | 1271 | info->textmap_info.rambase = info->textram; |
| r814 | r815 | |
| 1281 | 1281 | for (pagenum = 0; pagenum < info->numpages; pagenum++) |
| 1282 | 1282 | { |
| 1283 | 1283 | /* each page is 64x32 */ |
| 1284 | info->tilemaps[pagenum] = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 1284 | info->tilemaps[pagenum] = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 1285 | 1285 | |
| 1286 | 1286 | /* configure the tilemap */ |
| 1287 | 1287 | info->tilemap_info[pagenum].rambase = info->tileram + pagenum * 64*32; |
| r814 | r815 | |
|---|---|---|
| 74 | 74 | int color = attr & 0x0f; |
| 75 | 75 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 76 | 76 | |
| 77 | SET_TILE_INFO(2, code, color, flags) | |
| 77 | SET_TILE_INFO(2, code, color, flags); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 84 | 84 | int color = attr & 0x0f; |
| 85 | 85 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 86 | 86 | |
| 87 | tileinfo-> | |
| 87 | tileinfo->categor | |
| 88 | 88 | |
| 89 | SET_TILE_INFO(0, code, color, flags) | |
| 89 | SET_TILE_INFO(0, code, color, flags); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | VIDEO_START( tehkanwc ) |
| 93 | 93 | { |
| 94 | 94 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 95 | TILEMAP_TYPE_ | |
| 95 | TILEMAP_TYPE_ | |
| 96 | 96 | |
| 97 | 97 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 98 | TILEMAP_TYPE_ | |
| 98 | TILEMAP_TYPE_ | |
| 99 | 99 | |
| 100 | 100 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 101 | 101 | } |
| r814 | r815 | |
|---|---|---|
| 45 | 45 | 1, |
| 46 | 46 | (bionicc_bgvideoram[2*tile_index] & 0xff) + ((attr & 0x07) << 8), |
| 47 | 47 | (attr & 0x18) >> 3, |
| 48 | TILE_FLIPXY((attr & 0xc0) >> 6)) | |
| 48 | TILE_FLIPXY((attr & 0xc0) >> 6)); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 55 | 55 | |
| 56 | 56 | if ((attr & 0xc0) == 0xc0) |
| 57 | 57 | { |
| 58 | tileinfo->priority = 1; | |
| 59 | flags = TILE_SPLIT(0); | |
| 58 | tileinfo->category = 1; | |
| 59 | tileinfo->group = 0; | |
| 60 | flags = 0; | |
| 60 | 61 | } |
| 61 | 62 | else |
| 62 | 63 | { |
| 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); | |
| 65 | 67 | } |
| 66 | 68 | |
| 67 | 69 | SET_TILE_INFO( |
| 68 | 70 | 2, |
| 69 | 71 | (bionicc_fgvideoram[2*tile_index] & 0xff) + ((attr & 0x07) << 8), |
| 70 | 72 | (attr & 0x18) >> 3, |
| 71 | flags) | |
| 73 | flags); | |
| 72 | 74 | } |
| 73 | 75 | |
| 74 | 76 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 78 | 80 | 0, |
| 79 | 81 | (bionicc_txvideoram[tile_index] & 0xff) + ((attr & 0x00c0) << 2), |
| 80 | 82 | attr & 0x3f, |
| 81 | 0) | |
| 83 | 0); | |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | 86 | |
| r814 | r815 | |
| 91 | 93 | |
| 92 | 94 | VIDEO_START( bionicc ) |
| 93 | 95 | { |
| 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); | |
| 97 | 99 | |
| 98 | 100 | tilemap_set_transparent_pen(tx_tilemap,3); |
| 99 | 101 | tilemap_set_transmask(fg_tilemap,0,0xffff,0x8000); /* split type 0 is completely transparent in front half */ |
| r814 | r815 | |
| 215 | 217 | VIDEO_UPDATE( bionicc ) |
| 216 | 218 | { |
| 217 | 219 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 218 | tilemap_draw(bitmap,cliprect,fg_tilemap,1|TILEMAP_ | |
| 220 | tilemap_draw(bitmap,cliprect,fg_tilemap,1|TILEMAP_DRAW_LAYER1,0); /* nothing in FRONT */ | |
| 219 | 221 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); |
| 220 | tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_ | |
| 222 | tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_DRAW_LAYER1,0); | |
| 221 | 223 | draw_sprites(machine,bitmap,cliprect); |
| 222 | tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_ | |
| 224 | tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_DRAW_LAYER0,0); | |
| 223 | 225 | tilemap_draw(bitmap,cliprect,tx_tilemap,0,0); |
| 224 | 226 | return 0; |
| 225 | 227 | } |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | ***************************************************************************/ |
| 26 | 26 | |
| 27 | static | |
| 27 | static | |
| 28 | 28 | { |
| 29 | 29 | /* logical (col,row) -> memory offset */ |
| 30 | 30 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5); |
| r814 | r815 | |
| 36 | 36 | 0, |
| 37 | 37 | citycon_videoram[tile_index], |
| 38 | 38 | (tile_index & 0x03e0) >> 5, /* color depends on scanline only */ |
| 39 | 0) | |
| 39 | 0); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 47 | 47 | 3 + bg_image, |
| 48 | 48 | code, |
| 49 | 49 | rom[0xc000 + 0x100 * bg_image + code], |
| 50 | 0) | |
| 50 | 0); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| r814 | r815 | |
| 60 | 60 | |
| 61 | 61 | VIDEO_START( citycon ) |
| 62 | 62 | { |
| 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); | |
| 65 | 65 | |
| 66 | 66 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 67 | 67 | tilemap_set_scroll_rows(fg_tilemap,32); |
| r814 | r815 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | VIDEO_START( suprridr ) |
| 49 | 49 | { |
| 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); | |
| 53 | 53 | |
| 54 | 54 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 55 | 55 | } |
| r814 | r815 | |
|---|---|---|
| 76 | 76 | return 0; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_ | |
| 79 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_D | |
| 80 | 80 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,2); |
| 81 | 81 | K051960_sprites_draw(bitmap,cliprect,-1,-1); |
| 82 | 82 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,0); |
| r814 | r815 | |
|---|---|---|
| 88 | 88 | 1, |
| 89 | 89 | (code & 0x1fff) + 0x2000*tilemap_0_bank, |
| 90 | 90 | (code >> 13) & 7, |
| 91 | 0) | |
| 91 | 0); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static TILE_GET_INFO( get_tile_info_1 ) |
| r814 | r815 | |
| 98 | 98 | 1, |
| 99 | 99 | (code & 0x1fff) + 0x2000*tilemap_1_bank, |
| 100 | 100 | ((code >> 13) & 7) + 0x40, // So we only have to decode the gfx once. |
| 101 | 0) | |
| 101 | 0); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| r814 | r815 | |
| 170 | 170 | |
| 171 | 171 | tilemap_0_size0 = tilemap_create( get_tile_info_0, |
| 172 | 172 | tilemap_scan_rows, |
| 173 | TILEMAP_TYPE_ | |
| 173 | TILEMAP_TYPE_ | |
| 174 | 174 | 16,16, |
| 175 | 175 | 0x20, 0x80 ); |
| 176 | 176 | tilemap_0_size1 = tilemap_create( get_tile_info_0, |
| 177 | 177 | tilemap_scan_rows, |
| 178 | TILEMAP_TYPE_ | |
| 178 | TILEMAP_TYPE_ | |
| 179 | 179 | 16,16, |
| 180 | 180 | 0x40, 0x40 ); |
| 181 | 181 | |
| 182 | 182 | tilemap_0_size2 = tilemap_create( get_tile_info_0, |
| 183 | 183 | tilemap_scan_rows, |
| 184 | TILEMAP_TYPE_ | |
| 184 | TILEMAP_TYPE_ | |
| 185 | 185 | 16,16, |
| 186 | 186 | 0x80, 0x20 ); |
| 187 | 187 | |
| 188 | 188 | tilemap_0_size3 = tilemap_create( get_tile_info_0, |
| 189 | 189 | tilemap_scan_rows, |
| 190 | TILEMAP_TYPE_ | |
| 190 | TILEMAP_TYPE_ | |
| 191 | 191 | 16,16, |
| 192 | 192 | 0x100, 0x10 ); |
| 193 | 193 | |
| 194 | 194 | tilemap_1_size0 = tilemap_create( get_tile_info_1, |
| 195 | 195 | tilemap_scan_rows, |
| 196 | TILEMAP_TYPE_ | |
| 196 | TILEMAP_TYPE_ | |
| 197 | 197 | 16,16, |
| 198 | 198 | 0x20, 0x80 ); |
| 199 | 199 | |
| 200 | 200 | tilemap_1_size1 = tilemap_create( get_tile_info_1, |
| 201 | 201 | tilemap_scan_rows, |
| 202 | TILEMAP_TYPE_ | |
| 202 | TILEMAP_TYPE_ | |
| 203 | 203 | 16,16, |
| 204 | 204 | 0x40, 0x40 ); |
| 205 | 205 | |
| 206 | 206 | tilemap_1_size2 = tilemap_create( get_tile_info_1, |
| 207 | 207 | tilemap_scan_rows, |
| 208 | TILEMAP_TYPE_ | |
| 208 | TILEMAP_TYPE_ | |
| 209 | 209 | 16,16, |
| 210 | 210 | 0x80, 0x20 ); |
| 211 | 211 | |
| 212 | 212 | tilemap_1_size3 = tilemap_create( get_tile_info_1, |
| 213 | 213 | tilemap_scan_rows, |
| 214 | TILEMAP_TYPE_ | |
| 214 | TILEMAP_TYPE_ | |
| 215 | 215 | 16,16, |
| 216 | 216 | 0x100, 0x10 ); |
| 217 | 217 | |
| r814 | r815 | |
| 581 | 581 | fillbitmap(priority_bitmap,0,cliprect); |
| 582 | 582 | |
| 583 | 583 | if (layers_ctrl & 1) |
| 584 | tilemap_draw(bitmap,cliprect,tmptilemap0, layer0_ctrl & 2 ? TILEMAP_ | |
| 584 | tilemap_draw(bitmap,cliprect,tmptilemap0, layer0_ctrl & 2 ? TILEMAP_D | |
| 585 | 585 | |
| 586 | 586 | if (layers_ctrl & 2) |
| 587 | tilemap_draw(bitmap,cliprect,tmptilemap1, layer1_ctrl & 2 ? TILEMAP_ | |
| 587 | tilemap_draw(bitmap,cliprect,tmptilemap1, layer1_ctrl & 2 ? TILEMAP_D | |
| 588 | 588 | |
| 589 | 589 | if (layers_ctrl & 4) |
| 590 | 590 | draw_sprites(machine, bitmap,cliprect,(spr_ctrl & 4 ? 0 : 15)); |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | 2, |
| 30 | 30 | code, |
| 31 | 31 | color, |
| 32 | 0) | |
| 32 | 0); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TILE_GET_INFO( bigtwin_get_fg_tile_info ) |
| r814 | r815 | |
| 40 | 40 | 1, |
| 41 | 41 | code, |
| 42 | 42 | color, |
| 43 | 0) | |
| 43 | 0); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static TILE_GET_INFO( wbeachvl_get_tx_tile_info ) |
| r814 | r815 | |
| 52 | 52 | 2, |
| 53 | 53 | code, |
| 54 | 54 | color / 4, |
| 55 | 0) | |
| 55 | 0); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static TILE_GET_INFO( wbeachvl_get_fg_tile_info ) |
| r814 | r815 | |
| 64 | 64 | 1, |
| 65 | 65 | code & 0x7fff, |
| 66 | 66 | color / 4 + 8, |
| 67 | (code & 0x8000) ? TILE_FLIPX : 0) | |
| 67 | (code & 0x8000) ? TILE_FLIPX : 0); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static TILE_GET_INFO( wbeachvl_get_bg_tile_info ) |
| r814 | r815 | |
| 76 | 76 | 1, |
| 77 | 77 | code & 0x7fff, |
| 78 | 78 | color / 4, |
| 79 | (code & 0x8000) ? TILE_FLIPX : 0) | |
| 79 | (code & 0x8000) ? TILE_FLIPX : 0); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static TILE_GET_INFO( hrdtimes_get_tx_tile_info ) |
| r814 | r815 | |
| 84 | 84 | int code = wbeachvl_videoram1[tile_index] & 0x03ff; |
| 85 | 85 | int colr = wbeachvl_videoram1[tile_index] & 0xe000; |
| 86 | 86 | |
| 87 | SET_TILE_INFO(2,code + txt_tile_offset,colr >> 13,0) | |
| 87 | SET_TILE_INFO(2,code + txt_tile_offset,colr >> 13,0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static TILE_GET_INFO( hrdtimes_get_fg_tile_info ) |
| r814 | r815 | |
| 92 | 92 | int code = wbeachvl_videoram2[tile_index] & 0x1fff; |
| 93 | 93 | int colr = wbeachvl_videoram2[tile_index] & 0xe000; |
| 94 | 94 | |
| 95 | SET_TILE_INFO(1,code + 0x2000,(colr >> 13) + 8,0) | |
| 95 | SET_TILE_INFO(1,code + 0x2000,(colr >> 13) + 8,0); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | static TILE_GET_INFO( hrdtimes_get_bg_tile_info ) |
| r814 | r815 | |
| 100 | 100 | int code = wbeachvl_videoram3[tile_index] & 0x1fff; |
| 101 | 101 | int colr = wbeachvl_videoram3[tile_index] & 0xe000; |
| 102 | 102 | |
| 103 | SET_TILE_INFO(1,code,colr >> 13,0) | |
| 103 | SET_TILE_INFO(1,code,colr >> 13,0); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /*************************************************************************** |
| r814 | r815 | |
| 111 | 111 | |
| 112 | 112 | VIDEO_START( bigtwin ) |
| 113 | 113 | { |
| 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); | |
| 116 | 116 | |
| 117 | 117 | tilemap_set_transparent_pen(tx_tilemap,0); |
| 118 | 118 | |
| r814 | r815 | |
| 124 | 124 | |
| 125 | 125 | VIDEO_START( wbeachvl ) |
| 126 | 126 | { |
| 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); | |
| 130 | 130 | |
| 131 | 131 | tilemap_set_transparent_pen(tx_tilemap,0); |
| 132 | 132 | tilemap_set_transparent_pen(fg_tilemap,0); |
| r814 | r815 | |
| 138 | 138 | |
| 139 | 139 | VIDEO_START( excelsr ) |
| 140 | 140 | { |
| 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); | |
| 143 | 143 | |
| 144 | 144 | tilemap_set_transparent_pen(tx_tilemap,0); |
| 145 | 145 | |
| r814 | r815 | |
| 150 | 150 | |
| 151 | 151 | VIDEO_START( hotmind ) |
| 152 | 152 | { |
| 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); | |
| 156 | 156 | |
| 157 | 157 | tilemap_set_transparent_pen(tx_tilemap,0); |
| 158 | 158 | tilemap_set_transparent_pen(fg_tilemap,0); |
| r814 | r815 | |
| 172 | 172 | |
| 173 | 173 | VIDEO_START( hrdtimes ) |
| 174 | 174 | { |
| 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); | |
| 178 | 178 | |
| 179 | 179 | tilemap_set_transparent_pen(tx_tilemap,0); |
| 180 | 180 | tilemap_set_transparent_pen(fg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 74 | 74 | 1, |
| 75 | 75 | code, |
| 76 | 76 | esd16_tilemap0_color, |
| 77 | 0) | |
| 77 | 0); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static TILE_GET_INFO( get_tile_info_1 ) |
| r814 | r815 | |
| 84 | 84 | 1, |
| 85 | 85 | code, |
| 86 | 86 | 0, |
| 87 | 0) | |
| 87 | 0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static TILE_GET_INFO( get_tile_info_1_16x16 ) |
| r814 | r815 | |
| 94 | 94 | 2, |
| 95 | 95 | code, |
| 96 | 96 | 0, |
| 97 | 0) | |
| 97 | 0); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | WRITE16_HANDLER( esd16_vram_0_w ) |
| r814 | r815 | |
| 131 | 131 | VIDEO_START( esd16 ) |
| 132 | 132 | { |
| 133 | 133 | esdtilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 134 | TILEMAP_TYPE_ | |
| 134 | TILEMAP_TYPE_ | |
| 135 | 135 | |
| 136 | 136 | esdtilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 137 | TILEMAP_TYPE_ | |
| 137 | TILEMAP_TYPE_ | |
| 138 | 138 | |
| 139 | 139 | /* hedpanic changes tilemap 1 to 16x16 at various times */ |
| 140 | 140 | esdtilemap_1_16x16 = tilemap_create( get_tile_info_1_16x16, tilemap_scan_rows, |
| 141 | TILEMAP_TYPE_ | |
| 141 | TILEMAP_TYPE_ | |
| 142 | 142 | |
| 143 | 143 | tilemap_set_scrolldx(esdtilemap_0, -0x60 + 2, -0x60 ); |
| 144 | 144 | tilemap_set_scrolldx(esdtilemap_1, -0x60 , -0x60 + 2 ); |
| 145 | 145 | tilemap_set_scrolldx(esdtilemap_1_16x16, -0x60 , -0x60 + 2 ); |
| 146 | 146 | |
| 147 | tilemap_set_transparent_pen(esdtilemap_0,0x00); | |
| 148 | 147 | tilemap_set_transparent_pen(esdtilemap_1,0x00); |
| 149 | 148 | tilemap_set_transparent_pen(esdtilemap_1_16x16,0x00); |
| 150 | 149 | } |
| r814 | r815 | |
|---|---|---|
| 276 | 276 | |
| 277 | 277 | if (tileno > 0xbfff) { tileno -= 0xc000 ; tileno += 0x20000; } /* not sure about this */ |
| 278 | 278 | |
| 279 | SET_TILE_INFO(0,tileno,colour,TILE_FLIPYX(flipyx)) | |
| 279 | SET_TILE_INFO(0,tileno,colour,TILE_FLIPYX(flipyx)); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | /* BG Layer */ |
| r814 | r815 | |
| 298 | 298 | colour = (pgm_bg_videoram[tile_index*2+1] & 0x3e) >> 1; |
| 299 | 299 | flipyx = (pgm_bg_videoram[tile_index*2+1] & 0xc0) >> 6; |
| 300 | 300 | |
| 301 | SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(flipyx)) | |
| 301 | SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(flipyx)); | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
| r814 | r815 | |
| 307 | 307 | |
| 308 | 308 | VIDEO_START( pgm ) |
| 309 | 309 | { |
| 310 | pgm_tx_tilemap= tilemap_create(get_pgm_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 310 | pgm_tx_tilemap= tilemap_create(get_pgm_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 311 | 311 | tilemap_set_transparent_pen(pgm_tx_tilemap,15); |
| 312 | 312 | |
| 313 | pgm_bg_tilemap = tilemap_create(get_pgm_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 313 | pgm_bg_tilemap = tilemap_create(get_pgm_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 314 | 314 | tilemap_set_transparent_pen(pgm_bg_tilemap,31); |
| 315 | 315 | tilemap_set_scroll_rows(pgm_bg_tilemap,64*32); |
| 316 | 316 |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | 0, |
| 25 | 25 | code &(iqblock_video_type ? 0x1fff : 0x3fff), |
| 26 | 26 | iqblock_video_type? (2*(code >> 13)+1) : (4*(code >> 14)+3), |
| 27 | 0) | |
| 27 | 0); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 34 | 34 | 1, |
| 35 | 35 | code & 0x7f, |
| 36 | 36 | (code & 0x80) ? 3 : 0, |
| 37 | 0) | |
| 37 | 0); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| r814 | r815 | |
| 47 | 47 | |
| 48 | 48 | VIDEO_START( iqblock ) |
| 49 | 49 | { |
| 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); | |
| 52 | 52 | |
| 53 | 53 | tilemap_set_transparent_pen(bg_tilemap,0); |
| 54 | 54 | tilemap_set_scroll_cols(fg_tilemap,64); |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | gfxnum, |
| 29 | 29 | code, |
| 30 | 30 | ((attr & 0xff) << 2), |
| 31 | TILE_FLIPYX((attr & 0xc000) >> 14)) | |
| 31 | TILE_FLIPYX((attr & 0xc000) >> 14)); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 45 | 45 | |
| 46 | 46 | VIDEO_START( darius ) |
| 47 | 47 | { |
| 48 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 48 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 49 | 49 | |
| 50 | 50 | spritelist = auto_malloc(0x800 * sizeof(*spritelist)); |
| 51 | 51 | |
| r814 | r815 | |
| 137 | 137 | PC080SN_tilemap_update(); |
| 138 | 138 | |
| 139 | 139 | // draw bottom layer(always active) |
| 140 | PC080SN_tilemap_draw_offset(bitmap,cliprect,0,0,TILEMAP_ | |
| 140 | PC080SN_tilemap_draw_offset(bitmap,cliprect,0,0,TILEMAP_D | |
| 141 | 141 | |
| 142 | 142 | /* Sprites can be under/over the layer below text layer */ |
| 143 | 143 | draw_sprites(machine,bitmap,cliprect,0,xoffs,-8); // draw sprites with priority 0 which are under the mid layer |
| r814 | r815 | |
|---|---|---|
| 22 | 22 | 1, |
| 23 | 23 | cbasebal_scrollram[2*tile_index] + ((attr & 0x07) << 8) + 0x800 * tilebank, |
| 24 | 24 | (attr & 0xf0) >> 4, |
| 25 | (attr & 0x08) ? TILE_FLIPX : 0) | |
| 25 | (attr & 0x08) ? TILE_FLIPX : 0); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 32 | 32 | 0, |
| 33 | 33 | cbasebal_textram[tile_index] + ((attr & 0xf0) << 4), |
| 34 | 34 | attr & 0x07, |
| 35 | (attr & 0x08) ? TILE_FLIPX : 0) | |
| 35 | (attr & 0x08) ? TILE_FLIPX : 0); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| r814 | r815 | |
| 48 | 48 | cbasebal_textram = auto_malloc(0x1000); |
| 49 | 49 | cbasebal_scrollram = auto_malloc(0x1000); |
| 50 | 50 | |
| 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); | |
| 53 | 53 | |
| 54 | 54 | tilemap_set_transparent_pen(fg_tilemap,3); |
| 55 | 55 | } |
| r814 | r815 | |
|---|---|---|
| 119 | 119 | int color = colorram[tile_index] & 0x0f; |
| 120 | 120 | int flags = ((colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x80) ? TILE_FLIPY : 0); |
| 121 | 121 | |
| 122 | SET_TILE_INFO(0, code, color, flags) | |
| 122 | SET_TILE_INFO(0, code, color, flags); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | VIDEO_START( sbasketb ) |
| 126 | 126 | { |
| 127 | 127 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 128 | TILEMAP_TYPE_ | |
| 128 | TILEMAP_TYPE_ | |
| 129 | 129 | |
| 130 | 130 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 131 | 131 | } |
| r814 | r815 | |
|---|---|---|
| 83 | 83 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 84 | 84 | |
| 85 | 85 | fillbitmap(bitmap,machine->pens[768],cliprect); |
| 86 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_ | |
| 86 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_D | |
| 87 | 87 | deco16_tilemap_1_draw(bitmap,cliprect,0,0); |
| 88 | 88 | draw_sprites(machine,bitmap,cliprect); |
| 89 | 89 | return 0; |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | int code = memory_region(REGION_USER1)[tile_index]; |
| 50 | 50 | int attr = memory_region(REGION_USER1)[tile_index+0x2000]; |
| 51 | 51 | 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); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 60 | 60 | |
| 61 | 61 | code|=(attr&3)<<8; |
| 62 | 62 | |
| 63 | SET_TILE_INFO(0,code,((attr>>2)&7),flags) | |
| 63 | SET_TILE_INFO(0,code,((attr>>2)&7),flags); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r814 | r815 | |
| 100 | 100 | |
| 101 | 101 | VIDEO_START(ksayakyu) |
| 102 | 102 | { |
| 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); | |
| 105 | 105 | tilemap_set_transparent_pen(ksayakyu_textmap,0); |
| 106 | 106 | } |
| 107 | 107 |
| r814 | r815 | |
|---|---|---|
| 134 | 134 | |
| 135 | 135 | if (alpha > 0) |
| 136 | 136 | { |
| 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); | |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 |
| r814 | r815 | |
|---|---|---|
| 149 | 149 | int flags = ((colorram[tile_index] & 0x10) ? TILE_FLIPX : 0) | |
| 150 | 150 | ((colorram[tile_index] & 0x20) ? TILE_FLIPY : 0); |
| 151 | 151 | |
| 152 | SET_TILE_INFO(0, code, color, flags) | |
| 152 | SET_TILE_INFO(0, code, color, flags); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | VIDEO_START( ironhors ) |
| 156 | 156 | { |
| 157 | 157 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 158 | TILEMAP_TYPE_ | |
| 158 | TILEMAP_TYPE_ | |
| 159 | 159 | |
| 160 | 160 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 161 | 161 | } |
| r814 | r815 | |
|---|---|---|
| 72 | 72 | int tile = videoram[tile_index*2] | (((videoram[tile_index*2+1] & 0x01)) << 8); |
| 73 | 73 | int color = (videoram[tile_index*2+1] & 0x0e) >> 1; |
| 74 | 74 | |
| 75 | SET_TILE_INFO(0,tile,color,0) | |
| 75 | SET_TILE_INFO(0,tile,color,0); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | VIDEO_START( battlex ) |
| 79 | 79 | { |
| 80 | 80 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 81 | TILEMAP_TYPE_ | |
| 81 | TILEMAP_TYPE_ | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r814 | r815 | |
|---|---|---|
| 22 | 22 | int code = (data ^ 0x400) & 0x7ff; |
| 23 | 23 | int color = (data >> 11) & 0x0f; |
| 24 | 24 | int opaque = data & 0x8000; |
| 25 | SET_TILE_INFO(2, code, color, opaque ? TILE_ | |
| 25 | SET_TILE_INFO(2, code, color, opaque ? TILE_F | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| r814 | r815 | |
| 83 | 83 | }; |
| 84 | 84 | |
| 85 | 85 | /* initialize the playfield */ |
| 86 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 86 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 87 | 87 | |
| 88 | 88 | /* initialize the motion objects */ |
| 89 | 89 | atarimo_init(machine, 0, &modesc); |
| 90 | 90 | |
| 91 | 91 | /* initialize the alphanumerics */ |
| 92 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 92 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 93 | 93 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 94 | 94 | } |
| 95 | 95 |
| r814 | r815 | |
|---|---|---|
| 47 | 47 | int data2 = glass_videoram[(tile_index << 1) + 1]; |
| 48 | 48 | int code = ((data & 0x03) << 14) | ((data & 0x0fffc) >> 2); |
| 49 | 49 | |
| 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)); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| r814 | r815 | |
| 57 | 57 | int data2 = glass_videoram[(0x1000/2) + (tile_index << 1) + 1]; |
| 58 | 58 | int code = ((data & 0x03) << 14) | ((data & 0x0fffc) >> 2); |
| 59 | 59 | |
| 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)); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /*************************************************************************** |
| r814 | r815 | |
| 131 | 131 | |
| 132 | 132 | VIDEO_START( glass ) |
| 133 | 133 | { |
| 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); | |
| 136 | 136 | screen_bitmap = auto_bitmap_alloc (320, 200, machine->screen[0].format); |
| 137 | 137 | |
| 138 | 138 | tilemap_set_transparent_pen(pant[0],0); |
| r814 | r815 | |
|---|---|---|
| 31 | 31 | colour = (mcatadv_videoram1[tile_index*2] & 0x3f00)>>8; |
| 32 | 32 | pri = (mcatadv_videoram1[tile_index*2] & 0xc000)>>14; |
| 33 | 33 | |
| 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; | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | WRITE16_HANDLER( mcatadv_videoram1_w ) |
| r814 | r815 | |
| 49 | 49 | colour = (mcatadv_videoram2[tile_index*2] & 0x3f00)>>8; |
| 50 | 50 | pri = (mcatadv_videoram2[tile_index*2] & 0xc000)>>14; |
| 51 | 51 | |
| 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; | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | WRITE16_HANDLER( mcatadv_videoram2_w ) |
| r814 | r815 | |
| 251 | 251 | |
| 252 | 252 | VIDEO_START( mcatadv ) |
| 253 | 253 | { |
| 254 | mcatadv_tilemap1 = tilemap_create(get_mcatadv_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 254 | mcatadv_tilemap1 = tilemap_create(get_mcatadv_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 255 | 255 | tilemap_set_transparent_pen(mcatadv_tilemap1,0); |
| 256 | 256 | |
| 257 | mcatadv_tilemap2 = tilemap_create(get_mcatadv_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 257 | mcatadv_tilemap2 = tilemap_create(get_mcatadv_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 258 | 258 | tilemap_set_transparent_pen(mcatadv_tilemap2,0); |
| 259 | 259 | |
| 260 | 260 | spriteram_old = auto_malloc(spriteram_size); |
| r814 | r815 | |
|---|---|---|
| 255 | 255 | 0, |
| 256 | 256 | tile_number, |
| 257 | 257 | color, |
| 258 | 0) | |
| 259 | tileinfo->priority = (attrib & 0x0f00) >> 8; | |
| 258 | 0); | |
| 259 | tileinfo->category = (attrib & 0x0f00) >> 8; | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | static TILE_GET_INFO( get_fg0_tile_info ) |
| r814 | r815 | |
| 270 | 270 | 0, |
| 271 | 271 | tile_number, |
| 272 | 272 | color, |
| 273 | 0) | |
| 274 | tileinfo->priority = (attrib & 0x0f00) >> 8; | |
| 273 | 0); | |
| 274 | tileinfo->category = (attrib & 0x0f00) >> 8; | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | static TILE_GET_INFO( get_bg0_tile_info ) |
| r814 | r815 | |
| 285 | 285 | 0, |
| 286 | 286 | tile_number, |
| 287 | 287 | 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; | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static TILE_GET_INFO( get_top1_tile_info ) |
| r814 | r815 | |
| 301 | 301 | 2, |
| 302 | 302 | tile_number, |
| 303 | 303 | color, |
| 304 | 0) | |
| 305 | tileinfo->priority = (attrib & 0x0f00) >> 8; | |
| 304 | 0); | |
| 305 | tileinfo->category = (attrib & 0x0f00) >> 8; | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | static TILE_GET_INFO( get_fg1_tile_info ) |
| r814 | r815 | |
| 316 | 316 | 2, |
| 317 | 317 | tile_number, |
| 318 | 318 | color, |
| 319 | 0) | |
| 320 | tileinfo->priority = (attrib & 0x0f00) >> 8; | |
| 319 | 0); | |
| 320 | tileinfo->category = (attrib & 0x0f00) >> 8; | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 331 | 331 | 2, |
| 332 | 332 | tile_number, |
| 333 | 333 | color, |
| 334 | 0) | |
| 335 | tileinfo->priority = (attrib & 0x0f00) >> 8; | |
| 334 | 0); | |
| 335 | tileinfo->category = (attrib & 0x0f00) >> 8; | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | static TILE_GET_INFO( batrider_get_top0_tile_info ) |
| r814 | r815 | |
| 347 | 347 | 0, |
| 348 | 348 | tile_number, |
| 349 | 349 | color, |
| 350 | 0) | |
| 351 | tileinfo->priority = (attrib & 0x0f00) >> 8; | |
| 350 | 0); | |
| 351 | tileinfo->category = (attrib & 0x0f00) >> 8; | |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | static TILE_GET_INFO( batrider_get_fg0_tile_info ) |
| r814 | r815 | |
| 363 | 363 | 0, |
| 364 | 364 | tile_number, |
| 365 | 365 | color, |
| 366 | 0) | |
| 367 | tileinfo->priority = (attrib & 0x0f00) >> 8; | |
| 366 | 0); | |
| 367 | tileinfo->category = (attrib & 0x0f00) >> 8; | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | static TILE_GET_INFO( batrider_get_bg0_tile_info ) |
| r814 | r815 | |
| 379 | 379 | 0, |
| 380 | 380 | tile_number, |
| 381 | 381 | color, |
| 382 | 0) | |
| 383 | tileinfo->priority = (attrib & 0x0f00) >> 8; | |
| 382 | 0); | |
| 383 | tileinfo->category = (attrib & 0x0f00) >> 8; | |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 394 | 394 | 2, |
| 395 | 395 | tile_number, |
| 396 | 396 | color, |
| 397 | 0) | |
| 398 | tileinfo->priority = 0; | |
| 397 | 0); | |
| 398 | tileinfo->category = 0; | |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | /*************************************************************************** |
| r814 | r815 | |
| 405 | 405 | ***************************************************************************/ |
| 406 | 406 | static void create_tilemaps_0(void) |
| 407 | 407 | { |
| 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); | |
| 411 | 411 | |
| 412 | 412 | tilemap_set_transparent_pen(top_tilemap[0],0); |
| 413 | 413 | tilemap_set_transparent_pen(fg_tilemap[0],0); |
| r814 | r815 | |
| 416 | 416 | |
| 417 | 417 | static void create_tilemaps_1(void) |
| 418 | 418 | { |
| 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); | |
| 422 | 422 | |
| 423 | 423 | tilemap_set_transparent_pen(top_tilemap[1],0); |
| 424 | 424 | tilemap_set_transparent_pen(fg_tilemap[1],0); |
| r814 | r815 | |
| 427 | 427 | |
| 428 | 428 | static void truxton2_create_tilemaps_0(void) |
| 429 | 429 | { |
| 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); | |
| 434 | 434 | |
| 435 | 435 | tilemap_set_scroll_rows(tx_tilemap,8*32); /* line scrolling */ |
| 436 | 436 | tilemap_set_scroll_cols(tx_tilemap,1); |
| r814 | r815 | |
| 443 | 443 | |
| 444 | 444 | static void batrider_create_tilemaps_0(void) |
| 445 | 445 | { |
| 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); | |
| 450 | 450 | |
| 451 | 451 | tilemap_set_scroll_rows(tx_tilemap,8*32); /* line scrolling */ |
| 452 | 452 | tilemap_set_scroll_cols(tx_tilemap,1); |
| r814 | r815 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | VIDEO_START( mjkjidai ) |
| 34 | 34 | { |
| 35 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 35 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 |
| r814 | r815 | |
|---|---|---|
| 65 | 65 | int code = videoram[tile_index] + ((attr & 0xc0) << 2); |
| 66 | 66 | int color = attr & 0x0f; |
| 67 | 67 | |
| 68 | SET_TILE_INFO(0, code, color, 0) | |
| 68 | SET_TILE_INFO(0, code, color, 0); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | VIDEO_START( jailbrek ) |
| 72 | 72 | { |
| 73 | 73 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 74 | TILEMAP_TYPE_ | |
| 74 | TILEMAP_TYPE_ | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r814 | r815 | |
|---|---|---|
| 44 | 44 | int data2 = gaelco_videoram[(tile_index << 1) + 1]; |
| 45 | 45 | int code = ((data & 0xfffc) >> 2); |
| 46 | 46 | |
| 47 | tileinfo-> | |
| 47 | tileinfo->categor | |
| 48 | 48 | |
| 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)); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r814 | r815 | |
| 56 | 56 | int data2 = gaelco_videoram[(0x1000/2) + (tile_index << 1) + 1]; |
| 57 | 57 | int code = ((data & 0xfffc) >> 2); |
| 58 | 58 | |
| 59 | tileinfo-> | |
| 59 | tileinfo->categor | |
| 60 | 60 | |
| 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)); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /*************************************************************************** |
| r814 | r815 | |
| 81 | 81 | |
| 82 | 82 | VIDEO_START( bigkarnk ) |
| 83 | 83 | { |
| 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); | |
| 86 | 86 | |
| 87 | 87 | tilemap_set_transmask(pant[0],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */ |
| 88 | 88 | tilemap_set_transmask(pant[1],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */ |
| r814 | r815 | |
| 90 | 90 | |
| 91 | 91 | VIDEO_START( maniacsq ) |
| 92 | 92 | { |
| 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); | |
| 95 | 95 | |
| 96 | 96 | tilemap_set_transparent_pen(pant[0],0); |
| 97 | 97 | tilemap_set_transparent_pen(pant[1],0); |
| r814 | r815 | |
| 225 | 225 | fillbitmap(priority_bitmap,0,cliprect); |
| 226 | 226 | fillbitmap( bitmap, machine->pens[0], cliprect ); |
| 227 | 227 | |
| 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); | |
| 230 | 230 | |
| 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); | |
| 233 | 233 | |
| 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); | |
| 236 | 236 | |
| 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); | |
| 239 | 239 | |
| 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); | |
| 242 | 242 | |
| 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); | |
| 245 | 245 | |
| 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); | |
| 248 | 248 | |
| 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); | |
| 251 | 251 | |
| 252 | 252 | draw_sprites(machine,bitmap,cliprect); |
| 253 | 253 | return 0; |
| r814 | r815 | |
|---|---|---|
| 138 | 138 | int color = bankp_colorram2[tile_index] >> 4; |
| 139 | 139 | int flags = (bankp_colorram2[tile_index] & 0x08) ? TILE_FLIPX : 0; |
| 140 | 140 | |
| 141 | SET_TILE_INFO(1, code, color, flags) | |
| 141 | SET_TILE_INFO(1, code, color, flags); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 147 | 147 | int color = colorram[tile_index] >> 3; |
| 148 | 148 | int flags = (colorram[tile_index] & 0x04) ? TILE_FLIPX : 0; |
| 149 | 149 | |
| 150 | SET_TILE_INFO(0, code, color, flags) | |
| 150 | SET_TILE_INFO(0, code, color, flags); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | VIDEO_START( bankp ) |
| 154 | 154 | { |
| 155 | 155 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 156 | TILEMAP_TYPE_ | |
| 156 | TILEMAP_TYPE_ | |
| 157 | 157 | |
| 158 | 158 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 159 | TILEMAP_TYPE_ | |
| 159 | TILEMAP_TYPE_ | |
| 160 | 160 | |
| 161 | 161 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 162 | 162 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| r814 | r815 | |
| 180 | 180 | switch (priority) |
| 181 | 181 | { |
| 182 | 182 | case 0: // combat hawk uses this |
| 183 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 183 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_D | |
| 184 | 184 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 185 | 185 | break; |
| 186 | 186 | case 1: |
| 187 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 187 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_D | |
| 188 | 188 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 189 | 189 | break; |
| 190 | 190 | case 2: |
| 191 | tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_ | |
| 191 | tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_D | |
| 192 | 192 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 193 | 193 | break; |
| 194 | 194 | case 3: |
| 195 | tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_ | |
| 195 | tilemap_draw(bitmap, cliprect, fg_tilemap, TILEMAP_D | |
| 196 | 196 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 197 | 197 | break; |
| 198 | 198 | } |
| r814 | r815 | |
|---|---|---|
| 54 | 54 | #endif |
| 55 | 55 | |
| 56 | 56 | /* priority bg/sprites (1 = this bg tile on top of sprites) */ |
| 57 | tileinfo-> | |
| 57 | tileinfo->categor | |
| 58 | 58 | |
| 59 | 59 | SET_TILE_INFO( 1, |
| 60 | 60 | code, |
| 61 | 61 | (color&4) | ((color&2)>>1) | ((color&1)<<1), |
| 62 | 0) | |
| 62 | 0); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static TILE_GET_INFO( get_txt_tile_info ) |
| r814 | r815 | |
| 70 | 70 | SET_TILE_INFO( 2, |
| 71 | 71 | code & 0x3f, |
| 72 | 72 | ((color&2)>>1) | ((color&1)<<1), |
| 73 | 0) | |
| 73 | 0); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| r814 | r815 | |
| 83 | 83 | VIDEO_START( tankbust ) |
| 84 | 84 | { |
| 85 | 85 | /* not scrollable */ |
| 86 | txt_tilemap = tilemap_create(get_txt_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 86 | txt_tilemap = tilemap_create(get_txt_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 87 | 87 | |
| 88 | 88 | /* scrollable */ |
| 89 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 89 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | tilemap_set_transparent_pen(txt_tilemap, 0); |
| r814 | r815 | |
|---|---|---|
| 419 | 419 | TILE_GET_INFO( wecleman_get_txt_tile_info ) |
| 420 | 420 | { |
| 421 | 421 | 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); | |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | WRITE16_HANDLER( wecleman_txtram_w ) |
| r814 | r815 | |
| 467 | 467 | int page = wecleman_bgpage[((tile_index&0x7f)>>6) + ((tile_index>>12)<<1)]; |
| 468 | 468 | int code = wecleman_pageram[(tile_index&0x3f) + ((tile_index>>7&0x1f)<<6) + (page<<11)]; |
| 469 | 469 | |
| 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); | |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | /*------------------------------------------------------------------------ |
| r814 | r815 | |
| 480 | 480 | int code = wecleman_pageram[(tile_index&0x3f) + ((tile_index>>7&0x1f)<<6) + (page<<11)]; |
| 481 | 481 | |
| 482 | 482 | 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); | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /*------------------------------------------------------------------------ |
| r814 | r815 | |
| 920 | 920 | |
| 921 | 921 | bg_tilemap = tilemap_create(wecleman_get_bg_tile_info, |
| 922 | 922 | tilemap_scan_rows, |
| 923 | TILEMAP_TYPE_ | |
| 923 | TILEMAP_TYPE_ | |
| 924 | 924 | 8,8, |
| 925 | 925 | PAGE_NX * 2, PAGE_NY * 2 ); |
| 926 | 926 | |
| 927 | 927 | fg_tilemap = tilemap_create(wecleman_get_fg_tile_info, |
| 928 | 928 | tilemap_scan_rows, |
| 929 | TILEMAP_TYPE_ | |
| 929 | TILEMAP_TYPE_ | |
| 930 | 930 | 8,8, |
| 931 | 931 | PAGE_NX * 2, PAGE_NY * 2); |
| 932 | 932 | |
| 933 | 933 | txt_tilemap = tilemap_create(wecleman_get_txt_tile_info, |
| 934 | 934 | tilemap_scan_rows, |
| 935 | TILEMAP_TYPE_ | |
| 935 | TILEMAP_TYPE_ | |
| 936 | 936 | 8,8, |
| 937 | 937 | PAGE_NX * 1, PAGE_NY * 1); |
| 938 | 938 | |
| r814 | r815 | |
| 998 | 998 | |
| 999 | 999 | sprite_list = sprite_list_create(NUM_SPRITES); |
| 1000 | 1000 | |
| 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); | |
| 1003 | 1003 | |
| 1004 | 1004 | K051316_wraparound_enable(0,1); |
| 1005 | 1005 | // K051316_wraparound_enable(1,1); |
| r814 | r815 | |
|---|---|---|
| 88 | 88 | int code = videoram[tile_index]; |
| 89 | 89 | int color = colorram[tile_index] & 0x0f; |
| 90 | 90 | |
| 91 | SET_TILE_INFO(0, code, color, 0) | |
| 91 | SET_TILE_INFO(0, code, color, 0); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | VIDEO_START( crbaloon ) |
| 95 | 95 | { |
| 96 | 96 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy, |
| 97 | TILEMAP_TYPE_ | |
| 97 | TILEMAP_TYPE_ | |
| 98 | 98 | |
| 99 | 99 | tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 100 | 100 |
| r814 | r815 | |
|---|---|---|
| 46 | 46 | break; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | SET_TILE_INFO( 0, tilenum, color, flags ) | |
| 49 | SET_TILE_INFO( 0, tilenum, color, flags ); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 61 | 61 | |
| 62 | 62 | VIDEO_START( portrait ) |
| 63 | 63 | { |
| 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 ); | |
| 66 | 66 | |
| 67 | 67 | tilemap_set_transparent_pen( foreground, 0 ); |
| 68 | 68 | } |
| r814 | r815 | |
|---|---|---|
| 97 | 97 | ***************************************************************************/ |
| 98 | 98 | |
| 99 | 99 | /* the video RAM has space for 32x32 tiles and is only partially used for the radar */ |
| 100 | static | |
| 100 | static | |
| 101 | 101 | { |
| 102 | 102 | return col + (row << 5); |
| 103 | 103 | } |
| r814 | r815 | |
| 106 | 106 | INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int ram_offs) |
| 107 | 107 | { |
| 108 | 108 | UINT8 attr = bosco_videoram[ram_offs + tile_index + 0x800]; |
| 109 | tileinfo-> | |
| 109 | tileinfo->categor | |
| 110 | 110 | SET_TILE_INFO( |
| 111 | 111 | 0, |
| 112 | 112 | bosco_videoram[ram_offs + tile_index], |
| 113 | 113 | attr & 0x3f, |
| 114 | TILE_FLIPYX(attr >> 6) ^ TILE_FLIPX) | |
| 114 | TILE_FLIPYX(attr >> 6) ^ TILE_FLIPX); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | static TILE_GET_INFO( bg_get_tile_info ) |
| r814 | r815 | |
| 135 | 135 | VIDEO_START( bosco ) |
| 136 | 136 | { |
| 137 | 137 | |
| 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); | |
| 140 | 140 | |
| 141 | 141 | tilemap_set_scrolldx(bg_tilemap,3,3); |
| 142 | 142 |
| r814 | r815 | |
|---|---|---|
| 78 | 78 | int code = videoram[tile_index] + ((colorram[tile_index] & 0x80) << 1); |
| 79 | 79 | int color = colorram[tile_index] & 0x03; |
| 80 | 80 | |
| 81 | SET_TILE_INFO(gfx_bank, code, color, 0) | |
| 81 | SET_TILE_INFO(gfx_bank, code, color, 0); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | static | |
| 84 | static | |
| 85 | 85 | { |
| 86 | 86 | /* logical (col,row) -> memory offset */ |
| 87 | 87 | return 256 * row + col; |
| r814 | r815 | |
| 90 | 90 | VIDEO_START( funkybee ) |
| 91 | 91 | { |
| 92 | 92 | bg_tilemap = tilemap_create(get_bg_tile_info, funkybee_tilemap_scan, |
| 93 | TILEMAP_TYPE_ | |
| 93 | TILEMAP_TYPE_ | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 159 | 159 | 1, |
| 160 | 160 | code_hi, |
| 161 | 161 | code_lo & 0xf, |
| 162 | 0) | |
| 162 | 0); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | WRITE16_HANDLER( tetrisp2_vram_bg_w ) |
| r814 | r815 | |
| 181 | 181 | 3, |
| 182 | 182 | code_hi, |
| 183 | 183 | code_lo & 0xf, |
| 184 | 0) | |
| 184 | 0); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | WRITE16_HANDLER( tetrisp2_vram_fg_w ) |
| r814 | r815 | |
| 199 | 199 | 2, |
| 200 | 200 | code_hi, |
| 201 | 201 | code_lo & 0xf, |
| 202 | 0) | |
| 202 | 0); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | WRITE16_HANDLER( tetrisp2_vram_rot_w ) |
| r814 | r815 | |
| 216 | 216 | 5, |
| 217 | 217 | code_hi, |
| 218 | 218 | code_lo & 0xf, |
| 219 | 0) | |
| 219 | 0); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | WRITE16_HANDLER( rocknms_sub_vram_bg_w ) |
| r814 | r815 | |
| 234 | 234 | 7, |
| 235 | 235 | code_hi, |
| 236 | 236 | code_lo & 0xf, |
| 237 | 0) | |
| 237 | 0); | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | WRITE16_HANDLER( rocknms_sub_vram_fg_w ) |
| r814 | r815 | |
| 252 | 252 | 6, |
| 253 | 253 | code_hi, |
| 254 | 254 | code_lo & 0xf, |
| 255 | 0) | |
| 255 | 0); | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | WRITE16_HANDLER( rocknms_sub_vram_rot_w ) |
| r814 | r815 | |
| 267 | 267 | VIDEO_START( tetrisp2 ) |
| 268 | 268 | { |
| 269 | 269 | tilemap_bg = tilemap_create( get_tile_info_bg,tilemap_scan_rows, |
| 270 | TILEMAP_TYPE_ | |
| 270 | TILEMAP_TYPE_ | |
| 271 | 271 | 16,16,NX_0,NY_0); |
| 272 | 272 | |
| 273 | 273 | tilemap_fg = tilemap_create( get_tile_info_fg,tilemap_scan_rows, |
| 274 | TILEMAP_TYPE_ | |
| 274 | TILEMAP_TYPE_ | |
| 275 | 275 | 8,8,NX_1,NY_1); |
| 276 | 276 | |
| 277 | 277 | tilemap_rot = tilemap_create( get_tile_info_rot,tilemap_scan_rows, |
| 278 | TILEMAP_TYPE_ | |
| 278 | TILEMAP_TYPE_ | |
| 279 | 279 | 16,16,NX_0*2,NY_0*2); |
| 280 | 280 | |
| 281 | 281 | tilemap_set_transparent_pen(tilemap_bg,0); |
| r814 | r815 | |
| 286 | 286 | VIDEO_START( rockntread ) |
| 287 | 287 | { |
| 288 | 288 | tilemap_bg = tilemap_create( get_tile_info_bg,tilemap_scan_rows, |
| 289 | TILEMAP_TYPE_ | |
| 289 | TILEMAP_TYPE_ | |
| 290 | 290 | 16, 16, 256, 16); // rockn ms(main),1,2,3,4 |
| 291 | 291 | |
| 292 | 292 | tilemap_fg = tilemap_create( get_tile_info_fg,tilemap_scan_rows, |
| 293 | TILEMAP_TYPE_ | |
| 293 | TILEMAP_TYPE_ | |
| 294 | 294 | 8, 8, 64, 64); |
| 295 | 295 | |
| 296 | 296 | tilemap_rot = tilemap_create( get_tile_info_rot,tilemap_scan_rows, |
| 297 | TILEMAP_TYPE_ | |
| 297 | TILEMAP_TYPE_ | |
| 298 | 298 | 16, 16, 128, 128); |
| 299 | 299 | |
| 300 | 300 | tilemap_set_transparent_pen(tilemap_bg, 0); |
| r814 | r815 | |
| 306 | 306 | VIDEO_START( rocknms ) |
| 307 | 307 | { |
| 308 | 308 | tilemap_bg = tilemap_create(get_tile_info_bg,tilemap_scan_rows, |
| 309 | TILEMAP_TYPE_ | |
| 309 | TILEMAP_TYPE_ | |
| 310 | 310 | 16, 16, 256, 16); // rockn ms(main),1,2,3,4 |
| 311 | 311 | |
| 312 | 312 | tilemap_fg = tilemap_create(get_tile_info_fg,tilemap_scan_rows, |
| 313 | TILEMAP_TYPE_ | |
| 313 | TILEMAP_TYPE_ | |
| 314 | 314 | 8, 8, 64, 64); |
| 315 | 315 | |
| 316 | 316 | tilemap_rot = tilemap_create(get_tile_info_rot,tilemap_scan_rows, |
| 317 | TILEMAP_TYPE_ | |
| 317 | TILEMAP_TYPE_ | |
| 318 | 318 | 16, 16, 128, 128); |
| 319 | 319 | |
| 320 | 320 | tilemap_sub_bg = tilemap_create(get_tile_info_rocknms_sub_bg,tilemap_scan_rows, |
| 321 | TILEMAP_TYPE_ | |
| 321 | TILEMAP_TYPE_ | |
| 322 | 322 | 16, 16, 32, 256); // rockn ms(sub) |
| 323 | 323 | |
| 324 | 324 | tilemap_sub_fg = tilemap_create(get_tile_info_rocknms_sub_fg,tilemap_scan_rows, |
| 325 | TILEMAP_TYPE_ | |
| 325 | TILEMAP_TYPE_ | |
| 326 | 326 | 8, 8, 64, 64); |
| 327 | 327 | |
| 328 | 328 | tilemap_sub_rot = tilemap_create( get_tile_info_rocknms_sub_rot,tilemap_scan_rows, |
| 329 | TILEMAP_TYPE_ | |
| 329 | TILEMAP_TYPE_ | |
| 330 | 330 | 16, 16, 128, 128); |
| 331 | 331 | |
| 332 | 332 | tilemap_set_transparent_pen(tilemap_bg, 0); |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | SET_TILE_INFO( |
| 30 | 30 | 2, |
| 31 | 31 | tile,color & 0xf, |
| 32 | TILE_FLIPYX((color & 0x60) >> 5)) | |
| 32 | TILE_FLIPYX((color & 0x60) >> 5)); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TILE_GET_INFO( ld_get_fg_tile_info ) |
| r814 | r815 | |
| 40 | 40 | 3, |
| 41 | 41 | tile, |
| 42 | 42 | 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; | |
| 44 | 45 | } |
| 45 | 46 | |
| 46 | 47 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 51 | 52 | 2, |
| 52 | 53 | tile, |
| 53 | 54 | color & 0xf, |
| 54 | TILE_FLIPYX((color & 0x60) >> 5)) | |
| 55 | TILE_FLIPYX((color & 0x60) >> 5)); | |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 62 | 63 | 3, |
| 63 | 64 | tile, |
| 64 | 65 | 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; | |
| 66 | 68 | } |
| 67 | 69 | |
| 68 | 70 | static TILE_GET_INFO( get_fix_info ) |
| r814 | r815 | |
| 72 | 74 | 1, |
| 73 | 75 | tile & 0x7ff, |
| 74 | 76 | tile>>12, |
| 75 | (tile & 0x800) ? TILE_FLIPY : 0) | |
| 77 | (tile & 0x800) ? TILE_FLIPY : 0); | |
| 76 | 78 | } |
| 77 | 79 | |
| 78 | 80 | |
| r814 | r815 | |
| 85 | 87 | |
| 86 | 88 | VIDEO_START( lastduel ) |
| 87 | 89 | { |
| 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); | |
| 91 | 93 | |
| 92 | 94 | tilemap_set_transmask(fg_tilemap,0,0xffff,0x0001); |
| 93 | 95 | tilemap_set_transmask(fg_tilemap,1,0xf07f,0x0f81); |
| r814 | r815 | |
| 99 | 101 | |
| 100 | 102 | VIDEO_START( madgear ) |
| 101 | 103 | { |
| 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); | |
| 105 | 107 | |
| 106 | 108 | tilemap_set_transmask(fg_tilemap,0,0xffff,0x8000); |
| 107 | 109 | tilemap_set_transmask(fg_tilemap,1,0x80ff,0xff00); |
| r814 | r815 | |
| 233 | 235 | VIDEO_UPDATE( lastduel ) |
| 234 | 236 | { |
| 235 | 237 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); |
| 236 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_ | |
| 238 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 237 | 239 | draw_sprites(machine,bitmap,cliprect,0); |
| 238 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_ | |
| 240 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 239 | 241 | draw_sprites(machine,bitmap,cliprect,1); |
| 240 | 242 | tilemap_draw(bitmap,cliprect,tx_tilemap,0,0); |
| 241 | 243 | return 0; |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | tile=tile | (bank_base<<8); |
| 51 | 51 | |
| 52 | SET_TILE_INFO( | |
| 53 | 0, | |
| 54 | tile, | |
| 55 | color, | |
| 56 | 0) | |
| 52 | SET_TILE_INFO(0, tile, color, 0); | |
| 57 | 53 | } |
| 58 | 54 | |
| 59 | 55 | WRITE16_HANDLER( alpha68k_videoram_w ) |
| r814 | r815 | |
| 72 | 68 | |
| 73 | 69 | VIDEO_START( alpha68k ) |
| 74 | 70 | { |
| 75 | fix_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 71 | fix_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 76 | 72 | |
| 77 | 73 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 78 | 74 | } |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | colour = drgnmst_fg_videoram[tile_index*2+1] & 0x1f; |
| 25 | 25 | flipyx = (drgnmst_fg_videoram[tile_index*2+1] & 0x60)>>5; |
| 26 | 26 | |
| 27 | SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(flipyx)) | |
| 27 | SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(flipyx)); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | WRITE16_HANDLER( drgnmst_fg_videoram_w ) |
| r814 | r815 | |
| 42 | 42 | colour = drgnmst_bg_videoram[tile_index*2+1] & 0x1f; |
| 43 | 43 | flipyx = (drgnmst_bg_videoram[tile_index*2+1] & 0x60)>>5; |
| 44 | 44 | |
| 45 | SET_TILE_INFO(3,tileno,colour,TILE_FLIPYX(flipyx)) | |
| 45 | SET_TILE_INFO(3,tileno,colour,TILE_FLIPYX(flipyx)); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | WRITE16_HANDLER( drgnmst_bg_videoram_w ) |
| r814 | r815 | |
| 59 | 59 | colour = drgnmst_md_videoram[tile_index*2+1] & 0x1f; |
| 60 | 60 | flipyx = (drgnmst_md_videoram[tile_index*2+1] & 0x60)>>5; |
| 61 | 61 | |
| 62 | SET_TILE_INFO(2,tileno,colour,TILE_FLIPYX(flipyx)) | |
| 62 | SET_TILE_INFO(2,tileno,colour,TILE_FLIPYX(flipyx)); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | WRITE16_HANDLER( drgnmst_md_videoram_w ) |
| r814 | r815 | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
| 119 | ||
| 119 | static TILEMAP_MAPPER( drgnmst_fg_tilemap_scan_col | |
| 120 | 120 | { |
| 121 | 121 | return (col*32)+(row&0x1f)+((row&0xe0)>>5)*2048; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | ||
| 124 | static TILEMAP_MAPPER( drgnmst_md_tilemap_scan_col | |
| 125 | 125 | { |
| 126 | 126 | return (col*16)+(row&0x0f)+((row&0xf0)>>4)*1024; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | ||
| 129 | static TILEMAP_MAPPER( drgnmst_bg_tilemap_scan_col | |
| 130 | 130 | { |
| 131 | 131 | return (col*8)+(row&0x07)+((row&0xf8)>>3)*512; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | VIDEO_START(drgnmst) |
| 135 | 135 | { |
| 136 | drgnmst_fg_tilemap = tilemap_create(get_drgnmst_fg_tile_info,drgnmst_fg_tilemap_scan_cols,TILEMAP_TYPE_ | |
| 136 | drgnmst_fg_tilemap = tilemap_create(get_drgnmst_fg_tile_info,drgnmst_fg_tilemap_scan_cols,TILEMAP_TYPE_ | |
| 137 | 137 | tilemap_set_transparent_pen(drgnmst_fg_tilemap,15); |
| 138 | 138 | |
| 139 | drgnmst_md_tilemap = tilemap_create(get_drgnmst_md_tile_info,drgnmst_md_tilemap_scan_cols,TILEMAP_TYPE_ | |
| 139 | drgnmst_md_tilemap = tilemap_create(get_drgnmst_md_tile_info,drgnmst_md_tilemap_scan_cols,TILEMAP_TYPE_ | |
| 140 | 140 | tilemap_set_transparent_pen(drgnmst_md_tilemap,15); |
| 141 | 141 | |
| 142 | drgnmst_bg_tilemap = tilemap_create(get_drgnmst_bg_tile_info,drgnmst_bg_tilemap_scan_cols,TILEMAP_TYPE_ | |
| 142 | drgnmst_bg_tilemap = tilemap_create(get_drgnmst_bg_tile_info,drgnmst_bg_tilemap_scan_cols,TILEMAP_TYPE_ | |
| 143 | 143 | tilemap_set_transparent_pen(drgnmst_bg_tilemap,15); |
| 144 | 144 | |
| 145 | 145 | // do the other tilemaps have rowscroll too? probably not .. |
| r814 | r815 | |
| 171 | 171 | case 0x2d9a: // fg unsure |
| 172 | 172 | case 0x2440: // all ok |
| 173 | 173 | case 0x245a: // fg unsure, title screen |
| 174 | tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,TILEMAP_ | |
| 174 | tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,TILEMAP_D | |
| 175 | 175 | tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,0,0); |
| 176 | 176 | tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,0,0); |
| 177 | 177 | break; |
| 178 | 178 | case 0x23c0: // all ok |
| 179 | tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,TILEMAP_ | |
| 179 | tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,TILEMAP_D | |
| 180 | 180 | tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,0,0); |
| 181 | 181 | tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,0,0); |
| 182 | 182 | break; |
| 183 | 183 | case 0x38da: // fg unsure |
| 184 | 184 | case 0x215a: // fg unsure |
| 185 | 185 | case 0x2140: // all ok |
| 186 | tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,TILEMAP_ | |
| 186 | tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,TILEMAP_D | |
| 187 | 187 | tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,0,0); |
| 188 | 188 | tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,0,0); |
| 189 | 189 | break; |
| 190 | 190 | case 0x2d80: // all ok |
| 191 | tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,TILEMAP_ | |
| 191 | tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,TILEMAP_D | |
| 192 | 192 | tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,0,0); |
| 193 | 193 | tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,0,0); |
| 194 | 194 | break; |
| 195 | 195 | default: |
| 196 | tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,TILEMAP_ | |
| 196 | tilemap_draw(bitmap,cliprect,drgnmst_bg_tilemap,TILEMAP_D | |
| 197 | 197 | tilemap_draw(bitmap,cliprect,drgnmst_fg_tilemap,0,0); |
| 198 | 198 | tilemap_draw(bitmap,cliprect,drgnmst_md_tilemap,0,0); |
| 199 | 199 | logerror ("unknown video priority regs %04x\n", drgnmst_vidregs2[0]); |
| r814 | r815 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | tileno = freek_videoram[tile_index]+((freek_videoram[tile_index+0x400]&0xe0)<<3); |
| 14 | 14 | palno=freek_videoram[tile_index+0x400]&0x1f; |
| 15 | SET_TILE_INFO(0,tileno,palno,0) | |
| 15 | SET_TILE_INFO(0,tileno,palno,0); | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | VIDEO_START(freekick) |
| 21 | 21 | { |
| 22 | freek_tilemap = tilemap_create(get_freek_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 22 | freek_tilemap = tilemap_create(get_freek_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 |
| r814 | r815 | |
|---|---|---|
| 1825 | 1825 | SET_TILE_INFO( GFX_CHAR,data&0x03ff,data>>12,TILE_FLIPYX((data&0x0c00)>>10) ); |
| 1826 | 1826 | if( data&0x8000 ) |
| 1827 | 1827 | { |
| 1828 | tileinfo-> | |
| 1828 | tileinfo->categor | |
| 1829 | 1829 | } |
| 1830 | 1830 | } /* TextTilemapGetInfo */ |
| 1831 | 1831 | |
| r814 | r815 | |
| 1845 | 1845 | DrawTranslucentCharacters( mame_bitmap *bitmap, const rectangle *cliprect ) |
| 1846 | 1846 | { |
| 1847 | 1847 | 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 ); | |
| 1849 | 1849 | } |
| 1850 | 1850 | |
| 1851 | 1851 | static void DrawCharacterLayer(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r814 | r815 | |
| 2542 | 2542 | |
| 2543 | 2543 | static void video_start_common(running_machine *machine) |
| 2544 | 2544 | { |
| 2545 | bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 2545 | bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 2546 | 2546 | tilemap_set_transparent_pen( bgtilemap, 0xf ); |
| 2547 | 2547 | |
| 2548 | 2548 | mbDSPisActive = 0; |
| r814 | r815 | |
|---|---|---|
| 149 | 149 | int code = videoram[tile_index]; |
| 150 | 150 | int color = (videoram[tile_index] & 0x70) >> 4; // ?? |
| 151 | 151 | |
| 152 | SET_TILE_INFO(0, code, color, 0) | |
| 152 | SET_TILE_INFO(0, code, color, 0); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | VIDEO_START( redclash ) |
| 156 | 156 | { |
| 157 | 157 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 158 | TILEMAP_TYPE_ | |
| 158 | TILEMAP_TYPE_ | |
| 159 | 159 | |
| 160 | 160 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 161 | 161 | } |
| r814 | r815 | |
|---|---|---|
| 17 | 17 | UINT8* flyball_playfield_ram; |
| 18 | 18 | |
| 19 | 19 | |
| 20 | static | |
| 20 | static | |
| 21 | 21 | { |
| 22 | 22 | if (col == 0) |
| 23 | 23 | { |
| r814 | r815 | |
| 43 | 43 | code += 64; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | SET_TILE_INFO(0, code, 0, flags) | |
| 46 | SET_TILE_INFO(0, code, 0, flags); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | VIDEO_START( flyball ) |
| 51 | 51 | { |
| 52 | 52 | flyball_tilemap = tilemap_create(flyball_get_tile_info, |
| 53 | flyball_get_memory_offset, TILEMAP_TYPE_ | |
| 53 | flyball_get_memory_offset, TILEMAP_TYPE_ | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 |
| r814 | r815 | |
|---|---|---|
| 22 | 22 | int code = data & 0x3ff; |
| 23 | 23 | int color = (data >> 12) & 7; |
| 24 | 24 | int opaque = data & 0x8000; |
| 25 | SET_TILE_INFO(2, code, color, opaque ? TILE_ | |
| 25 | SET_TILE_INFO(2, code, color, opaque ? TILE_F | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| r814 | r815 | |
| 82 | 82 | }; |
| 83 | 83 | |
| 84 | 84 | /* initialize the playfield */ |
| 85 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 85 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 86 | 86 | |
| 87 | 87 | /* initialize the motion objects */ |
| 88 | 88 | atarimo_init(machine, 0, &modesc); |
| 89 | 89 | |
| 90 | 90 | /* initialize the alphanumerics */ |
| 91 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 91 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 92 | 92 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 93 | 93 | } |
| 94 | 94 |
| r814 | r815 | |
|---|---|---|
| 158 | 158 | int code = videoram[tile_index] + 256 * charbank; |
| 159 | 159 | int color = (colorram[tile_index] & 0x38) >> 3; |
| 160 | 160 | |
| 161 | SET_TILE_INFO(1, code, color, 0) | |
| 161 | SET_TILE_INFO(1, code, color, 0); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 169 | 169 | decodechar(machine->gfx[0], code, rockola_charram, |
| 170 | 170 | machine->drv->gfxdecodeinfo[0].gfxlayout); |
| 171 | 171 | |
| 172 | SET_TILE_INFO(0, code, color, 0) | |
| 172 | SET_TILE_INFO(0, code, color, 0); | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | VIDEO_START( rockola ) |
| 176 | 176 | { |
| 177 | 177 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 178 | TILEMAP_TYPE_ | |
| 178 | TILEMAP_TYPE_ | |
| 179 | 179 | |
| 180 | 180 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 181 | TILEMAP_TYPE_ | |
| 181 | TILEMAP_TYPE_ | |
| 182 | 182 | |
| 183 | 183 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 184 | 184 | } |
| r814 | r815 | |
| 287 | 287 | int code = videoram[tile_index]; |
| 288 | 288 | int color = (colorram[tile_index] & 0x0c) >> 2; |
| 289 | 289 | |
| 290 | SET_TILE_INFO(1, code, color, 0) | |
| 290 | SET_TILE_INFO(1, code, color, 0); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static TILE_GET_INFO( satansat_get_fg_tile_info ) |
| r814 | r815 | |
| 298 | 298 | decodechar(machine->gfx[0], code, rockola_charram, |
| 299 | 299 | machine->drv->gfxdecodeinfo[0].gfxlayout); |
| 300 | 300 | |
| 301 | SET_TILE_INFO(0, code, color, 0) | |
| 301 | SET_TILE_INFO(0, code, color, 0); | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | VIDEO_START( satansat ) |
| 305 | 305 | { |
| 306 | 306 | bg_tilemap = tilemap_create(satansat_get_bg_tile_info, tilemap_scan_rows, |
| 307 | TILEMAP_TYPE_ | |
| 307 | TILEMAP_TYPE_ | |
| 308 | 308 | |
| 309 | 309 | fg_tilemap = tilemap_create(satansat_get_fg_tile_info, tilemap_scan_rows, |
| 310 | TILEMAP_TYPE_ | |
| 310 | TILEMAP_TYPE_ | |
| 311 | 311 | |
| 312 | 312 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 313 | 313 | } |
| r814 | r815 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | VIDEO_START( centiped ) |
| 66 | 66 | { |
| 67 | bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 67 | bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 68 | 68 | |
| 69 | 69 | centiped_flipscreen = 0; |
| 70 | 70 | |
| r814 | r815 | |
| 75 | 75 | |
| 76 | 76 | VIDEO_START( warlords ) |
| 77 | 77 | { |
| 78 | bg_tilemap = tilemap_create(warlords_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 78 | bg_tilemap = tilemap_create(warlords_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 79 | 79 | |
| 80 | 80 | /* we overload centiped_flipscreen here to track the cocktail/upright state */ |
| 81 | 81 | centiped_flipscreen = readinputport(0) & 0x80; |
| r814 | r815 | |
| 85 | 85 | |
| 86 | 86 | VIDEO_START( milliped ) |
| 87 | 87 | { |
| 88 | bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 88 | bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 89 | 89 | |
| 90 | 90 | centiped_flipscreen = 0; |
| 91 | 91 | state_save_register_global(centiped_flipscreen); |
| r814 | r815 | |
| 94 | 94 | |
| 95 | 95 | VIDEO_START( bullsdrt ) |
| 96 | 96 | { |
| 97 | bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 97 | bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 98 | 98 | |
| 99 | 99 | centiped_flipscreen = 0; |
| 100 | 100 | } |
| r814 | r815 | |
|---|---|---|
| 105 | 105 | int code = data & 0x3ff; |
| 106 | 106 | int color = (data >> 10) & 0x07; |
| 107 | 107 | int opaque = data & 0x2000; |
| 108 | SET_TILE_INFO(0, code, color, opaque ? TILE_ | |
| 108 | SET_TILE_INFO(0, code, color, opaque ? TILE_F | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| r814 | r815 | |
| 175 | 175 | decode_gfx(machine, playfield_lookup, motable); |
| 176 | 176 | |
| 177 | 177 | /* initialize the playfield */ |
| 178 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 178 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 179 | 179 | |
| 180 | 180 | /* initialize the motion objects */ |
| 181 | 181 | atarimo_init(machine, 0, &modesc); |
| 182 | 182 | |
| 183 | 183 | /* initialize the alphanumerics */ |
| 184 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 184 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 185 | 185 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 186 | 186 | |
| 187 | 187 | /* modify the motion object code lookup */ |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | 2, |
| 29 | 29 | tilenum & 0x3fff, |
| 30 | 30 | (attr & 0x3f), /* attr &0x1 ?? */ |
| 31 | TILE_FLIPYX( (attr & 0xc0) >> 6)) | |
| 31 | TILE_FLIPYX( (attr & 0xc0) >> 6)); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | static TILE_GET_INFO( get_piv0_tile_info ) |
| r814 | r815 | |
| 56 | 56 | |
| 57 | 57 | static void wgp_core_vh_start(running_machine *machine, int x_offs,int y_offs,int piv_xoffs,int piv_yoffs) |
| 58 | 58 | { |
| 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); | |
| 62 | 62 | |
| 63 | 63 | TC0100SCN_vh_start(machine,1,TC0100SCN_GFX_NUM,x_offs,y_offs,0,0,0,0,0); |
| 64 | 64 | |
| r814 | r815 | |
| 535 | 535 | static void wgp_piv_layer_draw(mame_bitmap *bitmap,const rectangle *cliprect,int layer,int flags,UINT32 priority) |
| 536 | 536 | { |
| 537 | 537 | mame_bitmap *srcbitmap = tilemap_get_pixmap(wgp_piv_tilemap[layer]); |
| 538 | mame_bitmap * | |
| 538 | mame_bitmap *flagsbitmap = tilemap_get_flags | |
| 539 | 539 | |
| 540 | 540 | UINT16 *dst16,*src16; |
| 541 | 541 | UINT8 *tsrc; |
| r814 | r815 | |
| 617 | 617 | |
| 618 | 618 | x_max = x_index + screen_width * x_step; |
| 619 | 619 | src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0); |
| 620 | tsrc = BITMAP_ADDR8( | |
| 620 | tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0); | |
| 621 | 621 | dst16 = scanline; |
| 622 | 622 | |
| 623 | if (flags & TILEMAP_ | |
| 623 | if (flags & TILEMAP_D | |
| 624 | 624 | { |
| 625 | 625 | for (i=0; i<screen_width; i++) |
| 626 | 626 | { |
| r814 | r815 | |
| 640 | 640 | } |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | if (flags & TILEMAP_ | |
| 643 | if (flags & TILEMAP_D | |
| 644 | 644 | bryan2_drawscanline(bitmap,0,y,screen_width,scanline,0,ROT0,priority); |
| 645 | 645 | else |
| 646 | 646 | bryan2_drawscanline(bitmap,0,y,screen_width,scanline,1,ROT0,priority); |
| r814 | r815 | |
| 718 | 718 | #ifdef MAME_DEBUG |
| 719 | 719 | if (dislayer[layer[0]]==0) |
| 720 | 720 | #endif |
| 721 | wgp_piv_layer_draw(bitmap,cliprect,layer[0],TILEMAP_ | |
| 721 | wgp_piv_layer_draw(bitmap,cliprect,layer[0],TILEMAP_D | |
| 722 | 722 | |
| 723 | 723 | #ifdef MAME_DEBUG |
| 724 | 724 | if (dislayer[layer[1]]==0) |
| r814 | r815 | |
|---|---|---|
| 205 | 205 | 0, |
| 206 | 206 | (code & 0x0fff) + (gfxbank[bank] << 12), |
| 207 | 207 | ((code & 0xe000) >> 13) + (8 * charpalettebank), |
| 208 | 0) | |
| 208 | 0); | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | WRITE16_HANDLER( welltris_charvideoram_w ) |
| r814 | r815 | |
| 216 | 216 | |
| 217 | 217 | VIDEO_START( welltris ) |
| 218 | 218 | { |
| 219 | char_tilemap = tilemap_create(get_welltris_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 219 | char_tilemap = tilemap_create(get_welltris_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 220 | 220 | |
| 221 | 221 | tilemap_set_transparent_pen(char_tilemap, 15); |
| 222 | 222 | } |
| r814 | r815 | |
|---|---|---|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 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); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| r814 | r815 | |
| 64 | 64 | color = 17; |
| 65 | 65 | } |
| 66 | 66 | |
| 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); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| r814 | r815 | |
| 81 | 81 | helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 82 | 82 | helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 83 | 83 | |
| 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); | |
| 86 | 86 | |
| 87 | 87 | tilemap_set_scrolly(tilemap1, 0, +24); |
| 88 | 88 | tilemap_set_scrolly(tilemap2, 0, +24); |
| r814 | r815 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | int tileno; |
| 20 | 20 | tileno = gumbo_bg_videoram[tile_index]; |
| 21 | SET_TILE_INFO(0,tileno,0,0) | |
| 21 | SET_TILE_INFO(0,tileno,0,0); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
| r814 | r815 | |
| 32 | 32 | { |
| 33 | 33 | int tileno; |
| 34 | 34 | tileno = gumbo_fg_videoram[tile_index]; |
| 35 | SET_TILE_INFO(1,tileno,1,0) | |
| 35 | SET_TILE_INFO(1,tileno,1,0); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | VIDEO_START( gumbo ) |
| 40 | 40 | { |
| 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); | |
| 43 | 43 | tilemap_set_transparent_pen(gumbo_fg_tilemap,0xff); |
| 44 | 44 | } |
| 45 | 45 |
| r814 | r815 | |
|---|---|---|
| 277 | 277 | p = *BITMAP_ADDR16(src_bitmap, (src_y + column_offset)&height_mask, src_x&width_mask); |
| 278 | 278 | |
| 279 | 279 | src_x++; |
| 280 | if ((flags&TILEMAP_ | |
| 280 | if ((flags&TILEMAP_D | |
| 281 | 281 | { |
| 282 | if( flags & TILEMAP_ | |
| 282 | if( flags & TILEMAP_DRAW_LAYER0 ) | |
| 283 | 283 | { |
| 284 | 284 | /* Top 8 pens of top 8 palettes only */ |
| 285 | 285 | if ((p&0x88)==0x88) |
| r814 | r815 | |
| 351 | 351 | { |
| 352 | 352 | flip_screen_set(dec0_pf1_control_0[0]&0x80); |
| 353 | 353 | |
| 354 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 354 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 355 | 355 | draw_sprites(machine,bitmap,cliprect,0x08,0x08); |
| 356 | 356 | dec0_pf2_draw(machine,bitmap,cliprect,0); |
| 357 | 357 | |
| r814 | r815 | |
| 371 | 371 | /* WARNING: inverted wrt Midnight Resistance */ |
| 372 | 372 | if ((dec0_pri & 0x01) == 0) |
| 373 | 373 | { |
| 374 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 374 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 375 | 375 | dec0_pf3_draw(machine,bitmap,cliprect,0); |
| 376 | 376 | |
| 377 | 377 | if (dec0_pri & 2) |
| 378 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 378 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 379 | 379 | |
| 380 | 380 | draw_sprites(machine,bitmap,cliprect,0x00,0x00); |
| 381 | 381 | |
| 382 | 382 | if (dec0_pri & 4) |
| 383 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 383 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 384 | 384 | } |
| 385 | 385 | else |
| 386 | 386 | { |
| 387 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 387 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 388 | 388 | dec0_pf2_draw(machine,bitmap,cliprect,0); |
| 389 | 389 | |
| 390 | 390 | if (dec0_pri & 2) |
| 391 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 391 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 392 | 392 | |
| 393 | 393 | draw_sprites(machine,bitmap,cliprect,0x00,0x00); |
| 394 | 394 | |
| 395 | 395 | if (dec0_pri & 4) |
| 396 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 396 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | dec0_pf1_draw(machine,bitmap,cliprect,0); |
| r814 | r815 | |
| 419 | 419 | /* Robocop uses it only for the title screen, so this might be just */ |
| 420 | 420 | /* completely wrong. The top 8 bits of the register might mean */ |
| 421 | 421 | /* something (they are 0x80 in midres, 0x00 here) */ |
| 422 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 422 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER1|TILEMAP_D | |
| 423 | 423 | |
| 424 | 424 | if (dec0_pri & 0x02) |
| 425 | 425 | draw_sprites(machine,bitmap,cliprect,0x08,trans); |
| r814 | r815 | |
| 428 | 428 | } |
| 429 | 429 | else |
| 430 | 430 | { |
| 431 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 431 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 432 | 432 | |
| 433 | 433 | if (dec0_pri & 0x02) |
| 434 | 434 | draw_sprites(machine,bitmap,cliprect,0x08,trans); |
| r814 | r815 | |
| 468 | 468 | |
| 469 | 469 | if (dec0_pri & 0x01) |
| 470 | 470 | { |
| 471 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 471 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 472 | 472 | dec0_pf3_draw(machine,bitmap,cliprect,0); |
| 473 | 473 | } |
| 474 | 474 | else |
| 475 | 475 | { |
| 476 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 476 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 477 | 477 | dec0_pf2_draw(machine,bitmap,cliprect,0); |
| 478 | 478 | } |
| 479 | 479 | |
| r814 | r815 | |
| 488 | 488 | { |
| 489 | 489 | flip_screen_set(dec0_pf1_control_0[0]&0x80); |
| 490 | 490 | |
| 491 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 491 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 492 | 492 | dec0_pf2_draw(machine,bitmap,cliprect,0); |
| 493 | 493 | |
| 494 | 494 | draw_sprites(machine,bitmap,cliprect,0x00,0x00); |
| 495 | 495 | |
| 496 | 496 | /* Redraw top 8 pens of top 8 palettes over sprites */ |
| 497 | 497 | if (dec0_pri&0x80) |
| 498 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 498 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); | |
| 499 | 499 | |
| 500 | 500 | dec0_pf1_draw(machine,bitmap,cliprect,0); |
| 501 | 501 | return 0; |
| r814 | r815 | |
| 515 | 515 | |
| 516 | 516 | if (dec0_pri & 0x01) |
| 517 | 517 | { |
| 518 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 518 | dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 519 | 519 | |
| 520 | 520 | if (dec0_pri & 0x02) |
| 521 | 521 | draw_sprites(machine,bitmap,cliprect,0x08,trans); |
| r814 | r815 | |
| 524 | 524 | } |
| 525 | 525 | else |
| 526 | 526 | { |
| 527 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_ | |
| 527 | dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_D | |
| 528 | 528 | |
| 529 | 529 | if (dec0_pri & 0x02) |
| 530 | 530 | draw_sprites(machine,bitmap,cliprect,0x08,trans); |
| r814 | r815 | |
| 644 | 644 | |
| 645 | 645 | /******************************************************************************/ |
| 646 | 646 | |
| 647 | static | |
| 647 | static | |
| 648 | 648 | { |
| 649 | 649 | return (col & 0xf) + ((row & 0xf) << 4) + ((col & 0x30) << 4); |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | static | |
| 652 | static | |
| 653 | 653 | { |
| 654 | 654 | return (col & 0xf) + ((row & 0xf) << 4) + ((row & 0x10) << 4) + ((col & 0x10) << 5); |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | static | |
| 657 | static | |
| 658 | 658 | { |
| 659 | 659 | return (col & 0xf) + ((row & 0x3f) << 4); |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | static | |
| 662 | static | |
| 663 | 663 | { |
| 664 | 664 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5); |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | static | |
| 667 | static | |
| 668 | 668 | { |
| 669 | 669 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((row & 0x20) << 5) + ((col & 0x20) << 6); |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | static | |
| 672 | static | |
| 673 | 673 | { |
| 674 | 674 | return (col & 0x1f) + ((row & 0x7f) << 5); |
| 675 | 675 | } |
| r814 | r815 | |
| 677 | 677 | static TILE_GET_INFO( get_pf1_tile_info ) |
| 678 | 678 | { |
| 679 | 679 | 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); | |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | static TILE_GET_INFO( get_pf2_tile_info ) |
| 684 | 684 | { |
| 685 | 685 | int tile=dec0_pf2_data[tile_index]; |
| 686 | 686 | 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; | |
| 688 | 689 | } |
| 689 | 690 | |
| 690 | 691 | static TILE_GET_INFO( get_pf3_tile_info ) |
| 691 | 692 | { |
| 692 | 693 | int tile=dec0_pf3_data[tile_index]; |
| 693 | 694 | 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; | |
| 695 | 697 | } |
| 696 | 698 | |
| 697 | 699 | VIDEO_START( dec0_nodma ) |
| 698 | 700 | { |
| 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); | |
| 708 | 710 | |
| 709 | 711 | dec0_spriteram=spriteram16; |
| 710 | 712 | } |
| r814 | r815 | |
|---|---|---|
| 229 | 229 | eaglshot_dirty_tile = (char*)auto_malloc(4 * 0x100000 / (16*8)); |
| 230 | 230 | |
| 231 | 231 | gdfs_tmap = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 232 | TILEMAP_TYPE_ | |
| 232 | TILEMAP_TYPE_ | |
| 233 | 233 | |
| 234 | 234 | tilemap_set_transparent_pen(gdfs_tmap, 0); |
| 235 | 235 | } |
| r814 | r815 | |
|---|---|---|
| 63 | 63 | int code = data & 0xfff; |
| 64 | 64 | int color = (data >> 12) & 0x0f; |
| 65 | 65 | int opaque = data & 0x8000; |
| 66 | SET_TILE_INFO(1, code, color, opaque ? TILE_ | |
| 66 | SET_TILE_INFO(1, code, color, opaque ? TILE_F | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| r814 | r815 | |
| 73 | 73 | int code = (playfield_tile_bank << 12) | (data & 0xfff); |
| 74 | 74 | int color = (atarig42_playfield_base >> 5) + ((playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7); |
| 75 | 75 | SET_TILE_INFO(0, code, color, (data >> 15) & 1); |
| 76 | tileinfo-> | |
| 76 | tileinfo->categor | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| 80 | static | |
| 80 | static | |
| 81 | 81 | { |
| 82 | 82 | int bank = 1 - (col / (num_cols / 2)); |
| 83 | 83 | return bank * (num_rows * num_cols / 2) + row * (num_cols / 2) + (col % (num_cols / 2)); |
| r814 | r815 | |
| 120 | 120 | atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30); |
| 121 | 121 | |
| 122 | 122 | /* initialize the playfield */ |
| 123 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarig42_playfield_scan, TILEMAP_TYPE_ | |
| 123 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarig42_playfield_scan, TILEMAP_TYPE_ | |
| 124 | 124 | |
| 125 | 125 | /* initialize the motion objects */ |
| 126 | 126 | adjusted_modesc.palettebase = atarig42_motion_object_base; |
| r814 | r815 | |
| 129 | 129 | atarirle_init(0, &adjusted_modesc); |
| 130 | 130 | |
| 131 | 131 | /* initialize the alphanumerics */ |
| 132 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 132 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 133 | 133 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 134 | 134 | |
| 135 | 135 | /* reset statics */ |
| r814 | r815 | |
|---|---|---|
| 445 | 445 | |
| 446 | 446 | namco_road_set_transparent_color(machine->remapped_colortable[0xfff]); |
| 447 | 447 | |
| 448 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 448 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 449 | 449 | |
| 450 | 450 | tilemap_set_scrollx(tx_tilemap, 0, -2*8); |
| 451 | 451 | tilemap_set_scrolly(tx_tilemap, 0, 0); |
| 452 | 452 | tilemap_set_transparent_pen(tx_tilemap, 7); |
| 453 | 453 | |
| 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); | |
| 456 | 456 | |
| 457 | tilemap_set_transparent_pen(bg1_tilemap, 0); | |
| 458 | tilemap_set_transparent_pen(bg2_tilemap, 0); | |
| 459 | ||
| 460 | 457 | state_save_register_global(bg1_scroll_x); |
| 461 | 458 | state_save_register_global(bg1_scroll_y); |
| 462 | 459 | state_save_register_global(bg2_scroll_x); |
| r814 | r815 | |
|---|---|---|
| 92 | 92 | */ |
| 93 | 93 | if (attr & 0x10) pri = 0; |
| 94 | 94 | |
| 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; | |
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 111 | 112 | |
| 112 | 113 | VIDEO_START( cop01 ) |
| 113 | 114 | { |
| 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); | |
| 116 | 117 | |
| 117 | 118 | tilemap_set_transparent_pen(fg_tilemap,15); |
| 118 | 119 | |
| r814 | r815 | |
| 217 | 218 | tilemap_set_scrollx(bg_tilemap,0,mightguy_vreg[1] + 256 * (mightguy_vreg[2] & 1)); |
| 218 | 219 | tilemap_set_scrolly(bg_tilemap,0,mightguy_vreg[3]); |
| 219 | 220 | |
| 220 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 221 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 221 | 222 | draw_sprites(machine, bitmap,cliprect); |
| 222 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 223 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 223 | 224 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0 ); |
| 224 | 225 | return 0; |
| 225 | 226 | } |
| r814 | r815 | |
|---|---|---|
| 35 | 35 | int code = data & 0x3ff; |
| 36 | 36 | int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20); |
| 37 | 37 | int opaque = data & 0x8000; |
| 38 | SET_TILE_INFO(1, code, color, opaque ? TILE_ | |
| 38 | SET_TILE_INFO(1, code, color, opaque ? TILE_F | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| r814 | r815 | |
| 95 | 95 | }; |
| 96 | 96 | |
| 97 | 97 | /* initialize the playfield */ |
| 98 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 98 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 99 | 99 | |
| 100 | 100 | /* initialize the motion objects */ |
| 101 | 101 | atarimo_init(machine, 0, &modesc); |
| 102 | 102 | |
| 103 | 103 | /* initialize the alphanumerics */ |
| 104 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 104 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 105 | 105 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 106 | 106 | } |
| 107 | 107 |
| r814 | r815 | |
|---|---|---|
| 102 | 102 | int code = videoram[tile_index] + ((attr & 0x20) << 3); |
| 103 | 103 | int color = colorram[tile_index] & 0x1f; |
| 104 | 104 | |
| 105 | SET_TILE_INFO(gfxbank, code, color, 0) | |
| 105 | SET_TILE_INFO(gfxbank, code, color, 0); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | VIDEO_START( hanaawas ) |
| 109 | 109 | { |
| 110 | 110 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 111 | TILEMAP_TYPE_ | |
| 111 | TILEMAP_TYPE_ | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | VIDEO_UPDATE( hanaawas ) |
| r814 | r815 | |
|---|---|---|
| 100 | 100 | |
| 101 | 101 | tileno = (aquarium_txt_videoram[tile_index] & 0x0fff); |
| 102 | 102 | colour = (aquarium_txt_videoram[tile_index] & 0xf000) >> 12; |
| 103 | SET_TILE_INFO(2,tileno,colour,0) | |
| 103 | SET_TILE_INFO(2,tileno,colour,0); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | WRITE16_HANDLER( aquarium_txt_videoram_w ) |
| r814 | r815 | |
| 119 | 119 | colour = (aquarium_mid_videoram[tile_index*2+1] & 0x001f); |
| 120 | 120 | flag = TILE_FLIPYX((aquarium_mid_videoram[tile_index*2+1] & 0x300) >> 8); |
| 121 | 121 | |
| 122 | SET_TILE_INFO(1,tileno,colour,flag) | |
| 122 | SET_TILE_INFO(1,tileno,colour,flag); | |
| 123 | 123 | |
| 124 | tileinfo-> | |
| 124 | tileinfo->categor | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | WRITE16_HANDLER( aquarium_mid_videoram_w ) |
| r814 | r815 | |
| 140 | 140 | colour = (aquarium_bak_videoram[tile_index*2+1] & 0x001f); |
| 141 | 141 | flag = TILE_FLIPYX((aquarium_bak_videoram[tile_index*2+1] & 0x300) >> 8); |
| 142 | 142 | |
| 143 | SET_TILE_INFO(3,tileno,colour,flag) | |
| 143 | SET_TILE_INFO(3,tileno,colour,flag); | |
| 144 | 144 | |
| 145 | tileinfo-> | |
| 145 | tileinfo->categor | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | WRITE16_HANDLER( aquarium_bak_videoram_w ) |
| r814 | r815 | |
| 153 | 153 | |
| 154 | 154 | VIDEO_START(aquarium) |
| 155 | 155 | { |
| 156 | aquarium_txt_tilemap = tilemap_create(get_aquarium_txt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 156 | aquarium_txt_tilemap = tilemap_create(get_aquarium_txt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 157 | 157 | tilemap_set_transparent_pen(aquarium_txt_tilemap,0); |
| 158 | 158 | |
| 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); | |
| 161 | 161 | tilemap_set_transparent_pen(aquarium_mid_tilemap,0); |
| 162 | 162 | } |
| 163 | 163 |
| r814 | r815 | |
|---|---|---|
| 83 | 83 | 2, |
| 84 | 84 | code & 0x7fff, |
| 85 | 85 | 0x1e, |
| 86 | 0) | |
| 86 | 0); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static TILE_GET_INFO( metro_K053936_gstrik2_get_tile_info ) |
| r814 | r815 | |
| 94 | 94 | 2, |
| 95 | 95 | (code & 0x7fff)>>2, |
| 96 | 96 | 0x1e, |
| 97 | 0) | |
| 97 | 0); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | WRITE16_HANDLER( metro_K053936_w ) |
| r814 | r815 | |
| 103 | 103 | tilemap_mark_tile_dirty(metro_K053936_tilemap,offset); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | ||
| 106 | static TILEMAP_MAPPER( tilemap_scan_gstrik2 | |
| 107 | 107 | { |
| 108 | 108 | /* logical (col,row) -> memory offset */ |
| 109 | 109 | int val; |
| r814 | r815 | |
| 202 | 202 | { |
| 203 | 203 | int _code = code & 0x000f; |
| 204 | 204 | tileinfo->pen_data = empty_tiles + _code*16*16; |
| 205 | tileinfo->pal | |
| 205 | tileinfo->pale | |
| 206 | 206 | tileinfo->flags = 0; |
| 207 | 207 | } |
| 208 | 208 | else |
| r814 | r815 | |
| 210 | 210 | 0, |
| 211 | 211 | (tile & 0xfffff) + (code & 0xf), |
| 212 | 212 | (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100, |
| 213 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 213 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| r814 | r815 | |
| 238 | 238 | { |
| 239 | 239 | int _code = code & 0x000f; |
| 240 | 240 | tileinfo->pen_data = empty_tiles + _code*16*16; |
| 241 | tileinfo->pal | |
| 241 | tileinfo->pale | |
| 242 | 242 | tileinfo->flags = 0; |
| 243 | 243 | } |
| 244 | 244 | else if ((tile & 0x00f00000)==0x00f00000) /* draw tile as 8bpp */ |
| r814 | r815 | |
| 246 | 246 | 1, |
| 247 | 247 | (tile & 0xfffff) + 2*(code & 0xf), |
| 248 | 248 | ((tile & 0x0f000000) >> 24) + 0x10, |
| 249 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 249 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 250 | 250 | else |
| 251 | 251 | SET_TILE_INFO( |
| 252 | 252 | 0, |
| 253 | 253 | (tile & 0xfffff) + (code & 0xf), |
| 254 | 254 | (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100, |
| 255 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 255 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /* 16x16x4 or 16x16x8 tiles. It's the tile's color that decides: if its low 4 |
| r814 | r815 | |
| 279 | 279 | { |
| 280 | 280 | int _code = code & 0x000f; |
| 281 | 281 | tileinfo->pen_data = empty_tiles + _code*16*16; |
| 282 | tileinfo->pal | |
| 282 | tileinfo->pale | |
| 283 | 283 | tileinfo->flags = 0; |
| 284 | 284 | } |
| 285 | 285 | else if ((tile & 0x00f00000)==0x00f00000) /* draw tile as 8bpp */ |
| r814 | r815 | |
| 287 | 287 | 3, |
| 288 | 288 | (tile & 0xfffff) + 8*(code & 0xf), |
| 289 | 289 | ((tile & 0x0f000000) >> 24) + 0x10, |
| 290 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 290 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 291 | 291 | else |
| 292 | 292 | SET_TILE_INFO( |
| 293 | 293 | 2, |
| 294 | 294 | (tile & 0xfffff) + 4*(code & 0xf), |
| 295 | 295 | (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100, |
| 296 | TILE_FLIPXY((code & 0x6000) >> 13)) | |
| 296 | TILE_FLIPXY((code & 0x6000) >> 13)); | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | |
| r814 | r815 | |
| 391 | 391 | metro_tiletable_old = auto_malloc(metro_tiletable_size); |
| 392 | 392 | dirtyindex = auto_malloc(metro_tiletable_size/4); |
| 393 | 393 | |
| 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); | |
| 397 | 397 | |
| 398 | 398 | tilemap_16x16[0] = NULL; |
| 399 | 399 | tilemap_16x16[1] = NULL; |
| r814 | r815 | |
| 414 | 414 | metro_tiletable_old = auto_malloc(metro_tiletable_size); |
| 415 | 415 | dirtyindex = auto_malloc(metro_tiletable_size/4); |
| 416 | 416 | |
| 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); | |
| 420 | 420 | |
| 421 | 421 | tilemap_16x16[0] = NULL; |
| 422 | 422 | tilemap_16x16[1] = NULL; |
| r814 | r815 | |
| 441 | 441 | metro_tiletable_old = auto_malloc(metro_tiletable_size); |
| 442 | 442 | dirtyindex = auto_malloc(metro_tiletable_size/4); |
| 443 | 443 | |
| 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); | |
| 447 | 447 | |
| 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); | |
| 451 | 451 | |
| 452 | 452 | tilemap_set_transparent_pen(bg_tilemap[0],0); |
| 453 | 453 | tilemap_set_transparent_pen(bg_tilemap[1],0); |
| r814 | r815 | |
| 464 | 464 | has_zoom = 1; |
| 465 | 465 | |
| 466 | 466 | metro_K053936_tilemap = tilemap_create(metro_K053936_get_tile_info, tilemap_scan_rows, |
| 467 | TILEMAP_TYPE_ | |
| 467 | TILEMAP_TYPE_ | |
| 468 | 468 | |
| 469 | 469 | K053936_wraparound_enable(0, 0); |
| 470 | 470 | K053936_set_offset(0, -69, -21); |
| r814 | r815 | |
| 481 | 481 | has_zoom = 1; |
| 482 | 482 | |
| 483 | 483 | metro_K053936_tilemap = tilemap_create(metro_K053936_gstrik2_get_tile_info, tilemap_scan_gstrik2, |
| 484 | TILEMAP_TYPE_ | |
| 484 | TILEMAP_TYPE_ | |
| 485 | 485 | |
| 486 | 486 | K053936_wraparound_enable(0, 0); |
| 487 | 487 | K053936_set_offset(0, -69, -19); |
| r814 | r815 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | tileno = angelkds_txvideoram[tile_index] + (angelkds_txbank * 0x100); |
| 28 | 28 | |
| 29 | SET_TILE_INFO(0,tileno,0,0) | |
| 29 | SET_TILE_INFO(0,tileno,0,0); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | WRITE8_HANDLER( angelkds_txvideoram_w ) |
| r814 | r815 | |
| 60 | 60 | tileno = angelkds_bgtopvideoram[tile_index]; |
| 61 | 61 | |
| 62 | 62 | tileno += angelkds_bgtopbank*0x100 ; |
| 63 | SET_TILE_INFO(1,tileno,0,0) | |
| 63 | SET_TILE_INFO(1,tileno,0,0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | WRITE8_HANDLER( angelkds_bgtopvideoram_w ) |
| r814 | r815 | |
| 98 | 98 | tileno = angelkds_bgbotvideoram[tile_index]; |
| 99 | 99 | |
| 100 | 100 | tileno += angelkds_bgbotbank * 0x100 ; |
| 101 | SET_TILE_INFO(2,tileno,1,0) | |
| 101 | SET_TILE_INFO(2,tileno,1,0); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | WRITE8_HANDLER( angelkds_bgbotvideoram_w ) |
| r814 | r815 | |
| 263 | 263 | VIDEO_START( angelkds ) |
| 264 | 264 | { |
| 265 | 265 | |
| 266 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 266 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 267 | 267 | tilemap_set_transparent_pen(tx_tilemap,0); |
| 268 | 268 | |
| 269 | bgbot_tilemap = tilemap_create(get_bgbot_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 269 | bgbot_tilemap = tilemap_create(get_bgbot_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 270 | 270 | tilemap_set_transparent_pen(bgbot_tilemap,15); |
| 271 | 271 | |
| 272 | bgtop_tilemap = tilemap_create(get_bgtop_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 272 | bgtop_tilemap = tilemap_create(get_bgtop_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 273 | 273 | tilemap_set_transparent_pen(bgtop_tilemap,15); |
| 274 | 274 | } |
| 275 | 275 |
| r814 | r815 | |
|---|---|---|
| 89 | 89 | static TILE_GET_INFO( get_tile_info ) |
| 90 | 90 | { |
| 91 | 91 | UINT8 attr = circusc_colorram[tile_index]; |
| 92 | tileinfo-> | |
| 92 | tileinfo->categor | |
| 93 | 93 | SET_TILE_INFO( |
| 94 | 94 | 0, |
| 95 | 95 | circusc_videoram[tile_index] + ((attr & 0x20) << 3), |
| 96 | 96 | attr & 0x0f, |
| 97 | TILE_FLIPYX((attr & 0xc0) >> 6)) | |
| 97 | TILE_FLIPYX((attr & 0xc0) >> 6)); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| r814 | r815 | |
| 107 | 107 | |
| 108 | 108 | VIDEO_START( circusc ) |
| 109 | 109 | { |
| 110 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 110 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 111 | 111 | |
| 112 | 112 | tilemap_set_scroll_cols(bg_tilemap,32); |
| 113 | 113 | } |
| r814 | r815 | |
|---|---|---|
| 125 | 125 | int color = (colorram[tile_index] & 0x0f) + 16 * palettebank; |
| 126 | 126 | int flags = ((colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x80) ? TILE_FLIPY : 0); |
| 127 | 127 | |
| 128 | SET_TILE_INFO(0, code, color, flags) | |
| 128 | SET_TILE_INFO(0, code, color, flags); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | VIDEO_START( mikie ) |
| 132 | 132 | { |
| 133 | 133 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 134 | TILEMAP_TYPE_ | |
| 134 | TILEMAP_TYPE_ | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 41 | 41 | tileno = usg_videoram[tile_index*2]; |
| 42 | 42 | colour = usg_videoram[tile_index*2+1]; |
| 43 | 43 | |
| 44 | SET_TILE_INFO(0,tileno,colour,0) | |
| 44 | SET_TILE_INFO(0,tileno,colour,0); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | VIDEO_START(usg) |
| 48 | 48 | { |
| 49 | usg_tilemap = tilemap_create(get_usg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 49 | usg_tilemap = tilemap_create(get_usg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 |
| r814 | r815 | |
|---|---|---|
| 136 | 136 | 0, |
| 137 | 137 | zaccaria_videoram[tile_index] + ((attr & 0x03) << 8), |
| 138 | 138 | ((attr & 0x0c) >> 2) + ((zaccaria_attributesram[2 * (tile_index % 32) + 1] & 0x07) << 2), |
| 139 | 0) | |
| 139 | 0); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| r814 | r815 | |
| 149 | 149 | |
| 150 | 150 | VIDEO_START( zaccaria ) |
| 151 | 151 | { |
| 152 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 152 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 153 | 153 | |
| 154 | 154 | tilemap_set_scroll_cols(bg_tilemap,32); |
| 155 | 155 | } |
| r814 | r815 | |
|---|---|---|
| 16 | 16 | tileno = (shadfrce_fgvideoram[tile_index *2] & 0x00ff) | ((shadfrce_fgvideoram[tile_index *2+1] & 0x000f) << 8); |
| 17 | 17 | colour = (shadfrce_fgvideoram[tile_index *2+1] & 0x00f0) >>4; |
| 18 | 18 | |
| 19 | SET_TILE_INFO(0,tileno,colour*4,0) | |
| 19 | SET_TILE_INFO(0,tileno,colour*4,0); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | WRITE16_HANDLER( shadfrce_fgvideoram_w ) |
| r814 | r815 | |
| 36 | 36 | if (colour & 0x10) colour ^= 0x30; /* skip hole */ |
| 37 | 37 | fyx = (shadfrce_bg0videoram[tile_index *2] & 0x00c0) >>6; |
| 38 | 38 | |
| 39 | SET_TILE_INFO(2,tileno,colour,TILE_FLIPYX(fyx)) | |
| 39 | SET_TILE_INFO(2,tileno,colour,TILE_FLIPYX(fyx)); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | WRITE16_HANDLER( shadfrce_bg0videoram_w ) |
| r814 | r815 | |
| 52 | 52 | tileno = (shadfrce_bg1videoram[tile_index] & 0x0fff); |
| 53 | 53 | colour = (shadfrce_bg1videoram[tile_index] & 0xf000) >> 12; |
| 54 | 54 | |
| 55 | SET_TILE_INFO(2,tileno,colour+64,0) | |
| 55 | SET_TILE_INFO(2,tileno,colour+64,0); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | WRITE16_HANDLER( shadfrce_bg1videoram_w ) |
| r814 | r815 | |
| 66 | 66 | |
| 67 | 67 | VIDEO_START( shadfrce ) |
| 68 | 68 | { |
| 69 | shadfrce_fgtilemap = tilemap_create(get_shadfrce_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 69 | shadfrce_fgtilemap = tilemap_create(get_shadfrce_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 70 | 70 | tilemap_set_transparent_pen(shadfrce_fgtilemap,0); |
| 71 | 71 | |
| 72 | shadfrce_bg0tilemap = tilemap_create(get_shadfrce_bg0tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 72 | shadfrce_bg0tilemap = tilemap_create(get_shadfrce_bg0tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 73 | 73 | tilemap_set_transparent_pen(shadfrce_bg0tilemap,0); |
| 74 | 74 | |
| 75 | shadfrce_bg1tilemap = tilemap_create(get_shadfrce_bg1tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 75 | shadfrce_bg1tilemap = tilemap_create(get_shadfrce_bg1tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 76 | 76 | |
| 77 | 77 | shadfrce_spvideoram_old = auto_malloc(spriteram_size); |
| 78 | 78 | } |
| r814 | r815 | |
|---|---|---|
| 18 | 18 | int code = speedbal_background_videoram[tile_index*2] + ((speedbal_background_videoram[tile_index*2+1] & 0x30) << 4); |
| 19 | 19 | int color = speedbal_background_videoram[tile_index*2+1] & 0x0f; |
| 20 | 20 | |
| 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); | |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | 25 | static TILE_GET_INFO( get_tile_info_fg ) |
| r814 | r815 | |
| 26 | 27 | int code = speedbal_foreground_videoram[tile_index*2] + ((speedbal_foreground_videoram[tile_index*2+1] & 0x30) << 4); |
| 27 | 28 | int color = speedbal_foreground_videoram[tile_index*2+1] & 0x0f; |
| 28 | 29 | |
| 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); | |
| 30 | 32 | } |
| 31 | 33 | |
| 32 | 34 | /************************************* |
| r814 | r815 | |
| 37 | 39 | |
| 38 | 40 | VIDEO_START( speedbal ) |
| 39 | 41 | { |
| 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); | |
| 42 | 44 | |
| 43 | 45 | tilemap_set_transmask(bg_tilemap,0,0xffff,0x0000); /* split type 0 is totally transparent in front half */ |
| 44 | 46 | tilemap_set_transmask(bg_tilemap,1,0x00f7,0x0000); /* split type 1 has pen 0-2, 4-7 transparent in front half */ |
| r814 | r815 | |
| 124 | 126 | |
| 125 | 127 | VIDEO_UPDATE( speedbal ) |
| 126 | 128 | { |
| 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); | |
| 129 | 131 | 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); | |
| 132 | 134 | return 0; |
| 133 | 135 | } |
| r814 | r815 | |
|---|---|---|
| 124 | 124 | int code = videoram[tile_index] + 256 * colorram[tile_index]; |
| 125 | 125 | int color = palettebank * 2; // GUESS |
| 126 | 126 | |
| 127 | SET_TILE_INFO(0, code, color, 0) | |
| 127 | SET_TILE_INFO(0, code, color, 0); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | VIDEO_START( tagteam ) |
| 131 | 131 | { |
| 132 | 132 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_x, |
| 133 | TILEMAP_TYPE_ | |
| 133 | TILEMAP_TYPE_ | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 98 | 98 | int code = videoram[tile_index] + 8 * (colorram[tile_index] & 0x20); |
| 99 | 99 | int color = colorram[tile_index] & 0x0f; |
| 100 | 100 | |
| 101 | SET_TILE_INFO(gfxbank, code, color, 0) | |
| 101 | SET_TILE_INFO(gfxbank, code, color, 0); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | VIDEO_START( bagman ) |
| 105 | 105 | { |
| 106 | 106 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 107 | TILEMAP_TYPE_ | |
| 107 | TILEMAP_TYPE_ | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 179 | 179 | 0, |
| 180 | 180 | inufuku_bg_videoram[tile_index], |
| 181 | 181 | inufuku_bg_palettebank, |
| 182 | 0) | |
| 182 | 0); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | static TILE_GET_INFO( get_inufuku_text_tile_info ) |
| r814 | r815 | |
| 188 | 188 | 1, |
| 189 | 189 | inufuku_text_videoram[tile_index], |
| 190 | 190 | inufuku_text_palettebank, |
| 191 | 0) | |
| 191 | 0); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | READ16_HANDLER( inufuku_bg_videoram_r ) |
| r814 | r815 | |
| 222 | 222 | |
| 223 | 223 | VIDEO_START( inufuku ) |
| 224 | 224 | { |
| 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); | |
| 227 | 227 | |
| 228 | 228 | tilemap_set_transparent_pen(inufuku_bg_tilemap, 255); |
| 229 | 229 | tilemap_set_transparent_pen(inufuku_text_tilemap, 255); |
| r814 | r815 | |
|---|---|---|
| 72 | 72 | int color = attr & 0x0f; |
| 73 | 73 | int flags = TILE_FLIPYX((attr & 0x30) >> 4); |
| 74 | 74 | |
| 75 | SET_TILE_INFO(1, code, color, flags) | |
| 75 | SET_TILE_INFO(1, code, color, flags); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 82 | 82 | int color = attr & 0x0f; |
| 83 | 83 | int flags = TILE_FLIPYX((attr & 0x30) >> 4); |
| 84 | 84 | |
| 85 | SET_TILE_INFO(0, code, color, flags) | |
| 85 | SET_TILE_INFO(0, code, color, flags); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | VIDEO_START( commando ) |
| 89 | 89 | { |
| 90 | 90 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 91 | TILEMAP_TYPE_ | |
| 91 | TILEMAP_TYPE_ | |
| 92 | 92 | |
| 93 | 93 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 94 | TILEMAP_TYPE_ | |
| 94 | TILEMAP_TYPE_ | |
| 95 | 95 | |
| 96 | 96 | tilemap_set_transparent_pen(fg_tilemap, 3); |
| 97 | 97 | } |
| r814 | r815 | |
|---|---|---|
| 65 | 65 | int code = playfield_tile_bank[(data >> 10) & 1] + (data & 0x3ff); |
| 66 | 66 | int color = (data >> 11) & 7; |
| 67 | 67 | SET_TILE_INFO(0, code, color, 0); |
| 68 | tileinfo-> | |
| 68 | tileinfo->categor | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| r814 | r815 | |
| 123 | 123 | atarigen_playfield = &vram[0x2000]; |
| 124 | 124 | |
| 125 | 125 | /* initialize the playfield */ |
| 126 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 126 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 127 | 127 | |
| 128 | 128 | /* initialize the motion objects */ |
| 129 | 129 | atarimo_init(machine, 0, &modesc); |
| 130 | 130 | |
| 131 | 131 | /* initialize the alphanumerics */ |
| 132 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 132 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 133 | 133 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 134 | 134 | |
| 135 | 135 | /* reset the statics */ |
| r814 | r815 | |
|---|---|---|
| 11 | 11 | { |
| 12 | 12 | int code = ((ninjakd2_bg_videoram[tile_index*2 + 1] & 0xc0) << 2) | ninjakd2_bg_videoram[tile_index*2]; |
| 13 | 13 | 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)); | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | static TILE_GET_INFO( get_fg_tile_info ) |
| 18 | 18 | { |
| 19 | 19 | int code = ((ninjakd2_fg_videoram[tile_index*2 + 1] & 0xc0) << 2) | ninjakd2_fg_videoram[tile_index*2]; |
| 20 | 20 | 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)); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | VIDEO_START( ninjakd2 ) |
| 25 | 25 | { |
| 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); | |
| 28 | 28 | |
| 29 | 29 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| 30 | 30 |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | static TILE_GET_INFO( get_tile_info ) |
| 43 | 43 | { |
| 44 | 44 | 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); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| r814 | r815 | |
| 55 | 55 | |
| 56 | 56 | VIDEO_START( skydiver ) |
| 57 | 57 | { |
| 58 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 58 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 |
| r814 | r815 | |
|---|---|---|
| 133 | 133 | 0, |
| 134 | 134 | code, |
| 135 | 135 | color, |
| 136 | 0) | |
| 136 | 0); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /* Text Plane */ |
| r814 | r815 | |
| 149 | 149 | 1, |
| 150 | 150 | code, |
| 151 | 151 | color, |
| 152 | 0) | |
| 152 | 0); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| r814 | r815 | |
| 166 | 166 | VIDEO_START( yunsung8 ) |
| 167 | 167 | { |
| 168 | 168 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 169 | TILEMAP_TYPE_ | |
| 169 | TILEMAP_TYPE_ | |
| 170 | 170 | |
| 171 | 171 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 172 | TILEMAP_TYPE_ | |
| 172 | TILEMAP_TYPE_ | |
| 173 | 173 | |
| 174 | 174 | tilemap_set_transparent_pen(tilemap_1,0); |
| 175 | 175 | } |
| r814 | r815 | |
|---|---|---|
| 148 | 148 | 0, |
| 149 | 149 | code, |
| 150 | 150 | color, |
| 151 | 0) | |
| 151 | 0); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | static TILE_GET_INFO( navarone_get_tile_info ) |
| r814 | r815 | |
| 159 | 159 | 0, |
| 160 | 160 | code, |
| 161 | 161 | color, |
| 162 | 0) | |
| 162 | 0); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | static TILE_GET_INFO( warpwarp_get_tile_info ) |
| r814 | r815 | |
| 168 | 168 | 0, |
| 169 | 169 | warpwarp_videoram[tile_index], |
| 170 | 170 | warpwarp_videoram[tile_index + 0x400], |
| 171 | 0) | |
| 171 | 0); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| r814 | r815 | |
| 181 | 181 | |
| 182 | 182 | VIDEO_START( geebee ) |
| 183 | 183 | { |
| 184 | bg_tilemap = tilemap_create(geebee_get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 184 | bg_tilemap = tilemap_create(geebee_get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | VIDEO_START( navarone ) |
| 188 | 188 | { |
| 189 | bg_tilemap = tilemap_create(navarone_get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 189 | bg_tilemap = tilemap_create(navarone_get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | VIDEO_START( warpwarp ) |
| 193 | 193 | { |
| 194 | bg_tilemap = tilemap_create(warpwarp_get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 194 | bg_tilemap = tilemap_create(warpwarp_get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 |
| r814 | r815 | |
|---|---|---|
| 143 | 143 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 144 | 144 | |
| 145 | 145 | /* Draw playfields & sprites */ |
| 146 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 146 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 147 | 147 | draw_sprites(machine,bitmap,cliprect,0); |
| 148 | 148 | |
| 149 | 149 | if (twocrude_pri) { |
| r814 | r815 | |
|---|---|---|
| 31 | 31 | 0, |
| 32 | 32 | gng_fgvideoram[tile_index] + ((attr & 0xc0) << 2), |
| 33 | 33 | attr & 0x0f, |
| 34 | TILE_FLIPYX((attr & 0x30) >> 4)) | |
| 34 | TILE_FLIPYX((attr & 0x30) >> 4)); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 41 | 41 | 1, |
| 42 | 42 | gng_bgvideoram[tile_index] + ((attr & 0xc0) << 2), |
| 43 | 43 | 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; | |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | |
| r814 | r815 | |
| 54 | 55 | |
| 55 | 56 | VIDEO_START( gng ) |
| 56 | 57 | { |
| 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); | |
| 59 | 60 | |
| 60 | 61 | tilemap_set_transparent_pen(fg_tilemap,3); |
| 61 | 62 | |
| r814 | r815 | |
| 146 | 147 | |
| 147 | 148 | VIDEO_UPDATE( gng ) |
| 148 | 149 | { |
| 149 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 150 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 150 | 151 | draw_sprites(machine,bitmap,cliprect); |
| 151 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 152 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 152 | 153 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); |
| 153 | 154 | return 0; |
| 154 | 155 | } |
| r814 | r815 | |
|---|---|---|
| 186 | 186 | color |= (ojankohs_gfxreg & 0xe0) >> 2; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | SET_TILE_INFO(0, tile, color, 0) | |
| 189 | SET_TILE_INFO(0, tile, color, 0); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | static TILE_GET_INFO( ojankoy_get_tile_info ) |
| r814 | r815 | |
| 198 | 198 | flipx = ((ojankohs_colorram[tile_index] & 0x40) >> 6) ? TILEMAP_FLIPX : 0; |
| 199 | 199 | flipy = ((ojankohs_colorram[tile_index] & 0x80) >> 7) ? TILEMAP_FLIPY : 0; |
| 200 | 200 | |
| 201 | SET_TILE_INFO(0, tile, color, (flipx | flipy)) | |
| 201 | SET_TILE_INFO(0, tile, color, (flipx | flipy)); | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| r814 | r815 | |
| 278 | 278 | |
| 279 | 279 | VIDEO_START( ojankohs ) |
| 280 | 280 | { |
| 281 | ojankohs_tilemap = tilemap_create(ojankohs_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 281 | ojankohs_tilemap = tilemap_create(ojankohs_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 282 | 282 | ojankohs_videoram = auto_malloc(0x2000); |
| 283 | 283 | ojankohs_colorram = auto_malloc(0x1000); |
| 284 | 284 | ojankohs_paletteram = auto_malloc(0x800); |
| r814 | r815 | |
| 286 | 286 | |
| 287 | 287 | VIDEO_START( ojankoy ) |
| 288 | 288 | { |
| 289 | ojankohs_tilemap = tilemap_create(ojankoy_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 289 | ojankohs_tilemap = tilemap_create(ojankoy_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 290 | 290 | ojankohs_videoram = auto_malloc(0x2000); |
| 291 | 291 | ojankohs_colorram = auto_malloc(0x1000); |
| 292 | 292 | ojankohs_paletteram = auto_malloc(0x800); |
| r814 | r815 | |
|---|---|---|
| 145 | 145 | flags = ((data & 0x4000)?TILE_FLIPY:0) | |
| 146 | 146 | ((data & 0x2000)?TILE_FLIPX:0); |
| 147 | 147 | |
| 148 | SET_TILE_INFO(0, code, color, flags) | |
| 148 | SET_TILE_INFO(0, code, color, flags); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /////////////////////////////////////////////////////////////////////////// |
| r814 | r815 | |
| 168 | 168 | flags = ((data & 0x4000)?TILE_FLIPY:0) | |
| 169 | 169 | ((data & 0x2000)?TILE_FLIPX:0); |
| 170 | 170 | |
| 171 | SET_TILE_INFO(0, code, color, flags) | |
| 171 | SET_TILE_INFO(0, code, color, flags); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // video initialisation /////////////////////////////////////////////////// |
| r814 | r815 | |
| 206 | 206 | state_save_register_item_array("Adder", 0, adder_ram); |
| 207 | 207 | state_save_register_item_2d_array("Adder", 0, adder_screen_ram); |
| 208 | 208 | |
| 209 | tilemap0 = tilemap_create(get_tile0_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 209 | tilemap0 = tilemap_create(get_tile0_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 210 | 210 | |
| 211 | tilemap1 = tilemap_create(get_tile1_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 211 | tilemap1 = tilemap_create(get_tile1_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | // video update /////////////////////////////////////////////////////////// |
| r814 | r815 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | UINT8 color = raiders5_background_colorram[tile_index] >> 4; |
| 45 | 45 | |
| 46 | SET_TILE_INFO(bank, code, color, 0) | |
| 46 | SET_TILE_INFO(bank, code, color, 0); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| r814 | r815 | |
| 53 | 53 | |
| 54 | 54 | UINT8 color = raiders5_foreground_colorram[tile_index] >> 4; |
| 55 | 55 | |
| 56 | SET_TILE_INFO(2, code, color, 0) | |
| 56 | SET_TILE_INFO(2, code, color, 0); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
| r814 | r815 | |
| 66 | 66 | |
| 67 | 67 | VIDEO_START( raiders5 ) |
| 68 | 68 | { |
| 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); | |
| 71 | 71 | |
| 72 | 72 | tilemap_set_scrolldx(background_tilemap, 7, 0); |
| 73 | 73 |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | 9 + ((attr & 3) + ((attr >> 1) & 4)), |
| 30 | 30 | tile, |
| 31 | 31 | attr >> 4, |
| 32 | 0) | |
| 32 | 0); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 40 | 40 | 1 + ((attr & 3) + ((attr >> 1) & 4)), |
| 41 | 41 | tile, |
| 42 | 42 | attr >> 4, |
| 43 | 0) | |
| 43 | 0); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 49 | 49 | 0, |
| 50 | 50 | wc90b_txvideoram[tile_index + 0x800] + ((wc90b_txvideoram[tile_index] & 0x07) << 8), |
| 51 | 51 | wc90b_txvideoram[tile_index] >> 4, |
| 52 | 0) | |
| 52 | 0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| r814 | r815 | |
| 62 | 62 | |
| 63 | 63 | VIDEO_START( wc90b ) |
| 64 | 64 | { |
| 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); | |
| 68 | 68 | |
| 69 | 69 | tilemap_set_transparent_pen(fg_tilemap,15); |
| 70 | 70 | tilemap_set_transparent_pen(tx_tilemap,15); |
| r814 | r815 | |
|---|---|---|
| 99 | 99 | 0, |
| 100 | 100 | code, |
| 101 | 101 | attr & 0xf, |
| 102 | TILE_FLIPXY((attr & 0x30) >> 4)) | |
| 102 | TILE_FLIPXY((attr & 0x30) >> 4)); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| r814 | r815 | |
| 112 | 112 | |
| 113 | 113 | VIDEO_START( kncljoe ) |
| 114 | 114 | { |
| 115 | bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 115 | bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 116 | 116 | |
| 117 | 117 | tilemap_set_scroll_rows(bg_tilemap,4); |
| 118 | 118 |
| r814 | r815 | |
|---|---|---|
| 31 | 31 | 0, |
| 32 | 32 | tile_number, |
| 33 | 33 | 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; | |
| 35 | 36 | } |
| 36 | 37 | |
| 37 | 38 | static TILE_GET_INFO( crzrally_get_tile_info ) |
| r814 | r815 | |
| 43 | 44 | 0, |
| 44 | 45 | tile_number, |
| 45 | 46 | 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; | |
| 47 | 49 | } |
| 48 | 50 | |
| 49 | 51 | /*************************************************************************** |
| r814 | r815 | |
| 54 | 56 | |
| 55 | 57 | VIDEO_START( holeland ) |
| 56 | 58 | { |
| 57 | bg_tilemap = tilemap_create(holeland_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 59 | bg_tilemap = tilemap_create(holeland_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 58 | 60 | |
| 59 | 61 | tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */ |
| 60 | 62 | tilemap_set_transmask(bg_tilemap,1,0x01,0xfe); /* split type 1 has pen 0? transparent in front half */ |
| r814 | r815 | |
| 62 | 64 | |
| 63 | 65 | VIDEO_START( crzrally ) |
| 64 | 66 | { |
| 65 | bg_tilemap = tilemap_create(crzrally_get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 67 | bg_tilemap = tilemap_create(crzrally_get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 66 | 68 | } |
| 67 | 69 | |
| 68 | 70 | WRITE8_HANDLER( holeland_videoram_w ) |
| r814 | r815 | |
| 180 | 182 | VIDEO_UPDATE( holeland ) |
| 181 | 183 | { |
| 182 | 184 | /*tilemap_mark_all_tiles_dirty(bg_tilemap); */ |
| 183 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 185 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 184 | 186 | holeland_draw_sprites(machine, bitmap,cliprect); |
| 185 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 187 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 186 | 188 | return 0; |
| 187 | 189 | } |
| 188 | 190 |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | } |
| 29 | 29 | #endif |
| 30 | 30 | |
| 31 | static | |
| 31 | static | |
| 32 | 32 | { |
| 33 | 33 | /* logical (col,row) -> memory offset */ |
| 34 | 34 | return ((row & 0xf)) + ((15-(col &0xf))<<4) + ((row&0x10)<<5) + ((col&0x10)<<4); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | static | |
| 37 | static | |
| 38 | 38 | { |
| 39 | 39 | /* logical (col,row) -> memory offset */ |
| 40 | 40 | return (row & 0x1f) + ((31-(col &0x1f))<<5); |
| r814 | r815 | |
| 60 | 60 | |
| 61 | 61 | tile=RAM[tile_index]; |
| 62 | 62 | 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); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static TILE_GET_INFO( get_fix_tile_info ) |
| r814 | r815 | |
| 75 | 75 | //else if (tile&0x100) tile-=0x100; |
| 76 | 76 | //else tile+=0x200; |
| 77 | 77 | |
| 78 | SET_TILE_INFO(0,tile,color,0) | |
| 78 | SET_TILE_INFO(0,tile,color,0); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /***************************************************************************/ |
| r814 | r815 | |
| 118 | 118 | |
| 119 | 119 | VIDEO_START( prosoccr ) |
| 120 | 120 | { |
| 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); | |
| 123 | 123 | |
| 124 | 124 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | VIDEO_START( boomrang ) |
| 128 | 128 | { |
| 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); | |
| 131 | 131 | |
| 132 | 132 | tilemap_set_transmask(background_tilemap,0,0x0001,0x007e); /* Bottom 1 pen/Top 7 pens */ |
| 133 | 133 | tilemap_set_transparent_pen(fix_tilemap,0); |
| r814 | r815 | |
| 135 | 135 | |
| 136 | 136 | VIDEO_START( liberate ) |
| 137 | 137 | { |
| 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); | |
| 140 | 140 | |
| 141 | 141 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 142 | 142 | } |
| r814 | r815 | |
| 393 | 393 | if (background_disable) |
| 394 | 394 | fillbitmap(bitmap,machine->pens[32],cliprect); |
| 395 | 395 | else |
| 396 | tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_ | |
| 396 | tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 397 | 397 | |
| 398 | 398 | boomrang_draw_sprites(machine,bitmap,cliprect,8); |
| 399 | 399 | if (!background_disable) |
| 400 | tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_ | |
| 400 | tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 401 | 401 | boomrang_draw_sprites(machine,bitmap,cliprect,0); |
| 402 | 402 | tilemap_draw(bitmap,cliprect,fix_tilemap,0,0); |
| 403 | 403 | return 0; |
| r814 | r815 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | ***************************************************************************/ |
| 55 | 55 | |
| 56 | static | |
| 56 | static | |
| 57 | 57 | { |
| 58 | 58 | /* logical (col,row) -> memory offset */ |
| 59 | 59 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5); |
| r814 | r815 | |
| 67 | 67 | 0, |
| 68 | 68 | code + ((attr & 0x1f) << 8), |
| 69 | 69 | ((attr & 0xe0) >> 5) + 8 * tile_palbank, |
| 70 | 0) | |
| 70 | 0); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| r814 | r815 | |
| 79 | 79 | |
| 80 | 80 | VIDEO_START( spdodgeb ) |
| 81 | 81 | { |
| 82 | bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_ | |
| 82 | bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_ | |
| 83 | 83 | |
| 84 | 84 | tilemap_set_scroll_rows(bg_tilemap,32); |
| 85 | 85 | } |
| r814 | r815 | |
|---|---|---|
| 135 | 135 | int color = (attr & 0x3c) >> 2; |
| 136 | 136 | int flags = TILE_FLIPYX((attr & 0xc0) >> 6); |
| 137 | 137 | |
| 138 | SET_TILE_INFO(1, code, color, flags) | |
| 138 | SET_TILE_INFO(1, code, color, flags); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 144 | 144 | int code = videoram[tile_index] + ((attr & 0xe0) << 2); |
| 145 | 145 | int color = attr & 0x1f; |
| 146 | 146 | |
| 147 | SET_TILE_INFO(0, code, color, 0) | |
| 147 | SET_TILE_INFO(0, code, color, 0); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | VIDEO_START( gunsmoke ) |
| r814 | r815 | |
| 155 | 155 | |
| 156 | 156 | /* create tilemaps */ |
| 157 | 157 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 158 | TILEMAP_TYPE_ | |
| 158 | TILEMAP_TYPE_ | |
| 159 | 159 | |
| 160 | 160 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 161 | TILEMAP_TYPE_ | |
| 161 | TILEMAP_TYPE_ | |
| 162 | 162 | |
| 163 | 163 | tilemap_set_transparent_pen(fg_tilemap, 0x4f); |
| 164 | 164 |
| r814 | r815 | |
|---|---|---|
| 170 | 170 | { |
| 171 | 171 | turbo_state *state = Machine->driver_data; |
| 172 | 172 | int code = state->videoram[tile_index]; |
| 173 | SET_TILE_INFO(0, code, code >> 2, 0) | |
| 173 | SET_TILE_INFO(0, code, code >> 2, 0); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| r814 | r815 | |
| 179 | 179 | turbo_state *state = machine->driver_data; |
| 180 | 180 | |
| 181 | 181 | /* initialize the foreground tilemap */ |
| 182 | state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 182 | state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| r814 | r815 | |
| 188 | 188 | turbo_state *state = machine->driver_data; |
| 189 | 189 | |
| 190 | 190 | /* initialize the foreground tilemap */ |
| 191 | state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 191 | state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 192 | 192 | |
| 193 | 193 | /* allocate the bitmap RAM */ |
| 194 | 194 | state->buckrog_bitmap_ram = auto_malloc(0xe000); |
| r814 | r815 | |
|---|---|---|
| 377 | 377 | UINT16 attr = vram[ tile_index + 0x800 ]; |
| 378 | 378 | if ((code & 0x3e00) == 0x3e00) |
| 379 | 379 | 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) ); | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | static TILE_GET_INFO( twineagl_get_tile_info_0 ) { twineagl_tile_info( machine, tileinfo, tile_index, seta_vram_0 + 0x0000 ); } |
| r814 | r815 | |
| 388 | 388 | { |
| 389 | 389 | UINT16 code = vram[ tile_index ]; |
| 390 | 390 | 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) ); | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | static TILE_GET_INFO( get_tile_info_0 ) { get_tile_info( machine, tileinfo, tile_index, 0, seta_vram_0 + 0x0000 ); } |
| r814 | r815 | |
| 445 | 445 | |
| 446 | 446 | /* layer 0 */ |
| 447 | 447 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 448 | TILEMAP_TYPE_ | |
| 448 | TILEMAP_TYPE_ | |
| 449 | 449 | |
| 450 | 450 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 451 | TILEMAP_TYPE_ | |
| 451 | TILEMAP_TYPE_ | |
| 452 | 452 | |
| 453 | 453 | |
| 454 | 454 | /* layer 1 */ |
| 455 | 455 | tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 456 | TILEMAP_TYPE_ | |
| 456 | TILEMAP_TYPE_ | |
| 457 | 457 | |
| 458 | 458 | tilemap_3 = tilemap_create( get_tile_info_3, tilemap_scan_rows, |
| 459 | TILEMAP_TYPE_ | |
| 459 | TILEMAP_TYPE_ | |
| 460 | 460 | |
| 461 | 461 | tilemaps_flip = 0; |
| 462 | 462 | |
| r814 | r815 | |
| 478 | 478 | |
| 479 | 479 | /* layer 0 */ |
| 480 | 480 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 481 | TILEMAP_TYPE_ | |
| 481 | TILEMAP_TYPE_ | |
| 482 | 482 | |
| 483 | 483 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 484 | TILEMAP_TYPE_ | |
| 484 | TILEMAP_TYPE_ | |
| 485 | 485 | |
| 486 | 486 | |
| 487 | 487 | /* NO layer 1 */ |
| r814 | r815 | |
| 504 | 504 | |
| 505 | 505 | /* layer 0 */ |
| 506 | 506 | tilemap_0 = tilemap_create( twineagl_get_tile_info_0, tilemap_scan_rows, |
| 507 | TILEMAP_TYPE_ | |
| 507 | TILEMAP_TYPE_ | |
| 508 | 508 | |
| 509 | 509 | tilemap_1 = tilemap_create( twineagl_get_tile_info_1, tilemap_scan_rows, |
| 510 | TILEMAP_TYPE_ | |
| 510 | TILEMAP_TYPE_ | |
| 511 | 511 | |
| 512 | 512 | |
| 513 | 513 | /* NO layer 1 */ |
| r814 | r815 | |
| 918 | 918 | { |
| 919 | 919 | if (tilemap_2) |
| 920 | 920 | { |
| 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); | |
| 923 | 923 | } |
| 924 | 924 | |
| 925 | 925 | if (order & 2) // layer-sprite priority? |
| r814 | r815 | |
| 937 | 937 | } |
| 938 | 938 | else |
| 939 | 939 | { |
| 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); | |
| 942 | 942 | |
| 943 | 943 | if (order & 2) // layer-sprite priority? |
| 944 | 944 | { |
| r814 | r815 | |
|---|---|---|
| 186 | 186 | int color = (attr & 0x0f) + coloffs; |
| 187 | 187 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 188 | 188 | |
| 189 | SET_TILE_INFO(0, code, color, flags) | |
| 189 | SET_TILE_INFO(0, code, color, flags); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 195 | 195 | int attr = tp84_colorram2[tile_index]; |
| 196 | 196 | int code = tp84_videoram2[tile_index]+ ((attr & 0x30) << 4); |
| 197 | 197 | int color = (attr & 0x0f) + coloffs; |
| 198 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0) | TILE_ | |
| 198 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0) | TILE_F | |
| 199 | 199 | |
| 200 | SET_TILE_INFO(0, code, color, flags) | |
| 200 | SET_TILE_INFO(0, code, color, flags); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | VIDEO_START( tp84 ) |
| 204 | 204 | { |
| 205 | 205 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 206 | TILEMAP_TYPE_ | |
| 206 | TILEMAP_TYPE_ | |
| 207 | 207 | |
| 208 | 208 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 209 | TILEMAP_TYPE_ | |
| 209 | TILEMAP_TYPE_ | |
| 210 | 210 | |
| 211 | 211 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 212 | 212 |
| r814 | r815 | |
|---|---|---|
| 452 | 452 | if (deco16_priority&4) |
| 453 | 453 | { |
| 454 | 454 | // Draw as 1 8BPP layer |
| 455 | deco16_tilemap_34_combine_draw(bitmap,cliprect,TILEMAP_ | |
| 455 | deco16_tilemap_34_combine_draw(bitmap,cliprect,TILEMAP_D | |
| 456 | 456 | } |
| 457 | 457 | else |
| 458 | 458 | { |
| 459 | 459 | // Draw as 2 4BPP layers |
| 460 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 460 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 461 | 461 | deco16_tilemap_3_draw(bitmap,cliprect,0,2); |
| 462 | 462 | } |
| 463 | 463 | deco16_tilemap_2_draw(bitmap,cliprect,0,4); |
| 464 | 464 | break; |
| 465 | 465 | case 1: |
| 466 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 466 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 467 | 467 | deco16_tilemap_2_draw(bitmap,cliprect,0,2); |
| 468 | 468 | deco16_tilemap_3_draw(bitmap,cliprect,0,4); |
| 469 | 469 | break; |
| 470 | 470 | case 2: |
| 471 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_ | |
| 471 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_D | |
| 472 | 472 | deco16_tilemap_4_draw(bitmap,cliprect,0,2); |
| 473 | 473 | deco16_tilemap_3_draw(bitmap,cliprect,0,4); |
| 474 | 474 | break; |
| r814 | r815 | |
| 502 | 502 | /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ |
| 503 | 503 | fillbitmap(bitmap,machine->pens[512],&machine->screen[0].visarea); |
| 504 | 504 | |
| 505 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 505 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 506 | 506 | wizdfire_draw_sprites(machine,bitmap,cliprect,buffered_spriteram16,4,3); |
| 507 | 507 | deco16_tilemap_2_draw(bitmap,cliprect,0,0); |
| 508 | 508 | wizdfire_draw_sprites(machine,bitmap,cliprect,buffered_spriteram16,3,3); |
| 509 | 509 | |
| 510 | 510 | 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); | |
| 512 | 512 | else |
| 513 | 513 | deco16_tilemap_3_draw(bitmap,cliprect,0,0); |
| 514 | 514 | |
| r814 | r815 | |
| 534 | 534 | deco16_clear_sprite_priority_bitmap(); |
| 535 | 535 | |
| 536 | 536 | /* pf3 and pf4 are combined into a single 8bpp bitmap */ |
| 537 | deco16_tilemap_34_combine_draw(bitmap,cliprect,TILEMAP_ | |
| 537 | deco16_tilemap_34_combine_draw(bitmap,cliprect,TILEMAP_D | |
| 538 | 538 | |
| 539 | 539 | deco16_tilemap_2_draw(bitmap,cliprect,0,16); |
| 540 | 540 | nitrobal_draw_sprites(machine,bitmap,cliprect,buffered_spriteram16,3); |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | static | |
| 32 | static | |
| 33 | 33 | { |
| 34 | 34 | /* logical (col,row) -> memory offset */ |
| 35 | 35 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) <<6); |
| r814 | r815 | |
| 43 | 43 | 0, |
| 44 | 44 | code + ((attr & 0x1f) << 8) + (vball_gfxset<<8), |
| 45 | 45 | (attr >> 5) & 0x7, |
| 46 | 0) | |
| 46 | 0); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | VIDEO_START( vb ) |
| 51 | 51 | { |
| 52 | bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_ | |
| 52 | bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_ | |
| 53 | 53 | |
| 54 | 54 | tilemap_set_scroll_rows(bg_tilemap,32); |
| 55 | 55 | } |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | SET_TILE_INFO(ttl_gfx_index, code, attr, 0); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | static 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 | ||
| 38 | 31 | READ32_HANDLER( polygonet_ttl_ram_r ) |
| 39 | 32 | { |
| 40 | 33 | UINT32 *vram = (UINT32 *)ttl_vram; |
| r814 | r815 | |
| 88 | 81 | } |
| 89 | 82 | |
| 90 | 83 | // create the tilemap |
| 91 | ttl_tilemap = tilemap_create(ttl_get_tile_info, t | |
| 84 | ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 92 | 85 | |
| 93 | 86 | tilemap_set_transparent_pen(ttl_tilemap, 0); |
| 94 | 87 |
| r814 | r815 | |
|---|---|---|
| 84 | 84 | int code = videoram[tile_index] + ((colorram[tile_index] & 0x80) << 1); |
| 85 | 85 | int color = colorram[tile_index] & 0x1f; |
| 86 | 86 | |
| 87 | SET_TILE_INFO(0, code, color, 0) | |
| 87 | SET_TILE_INFO(0, code, color, 0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | VIDEO_START( higemaru ) |
| 91 | 91 | { |
| 92 | 92 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 93 | TILEMAP_TYPE_ | |
| 93 | TILEMAP_TYPE_ | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 33 | 33 | int code = ((data & 0x400) ? (batman_alpha_tile_bank * 0x400) : 0) + (data & 0x3ff); |
| 34 | 34 | int color = (data >> 11) & 0x0f; |
| 35 | 35 | int opaque = data & 0x8000; |
| 36 | SET_TILE_INFO(2, code, color, opaque ? TILE_ | |
| 36 | SET_TILE_INFO(2, code, color, opaque ? TILE_F | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| r814 | r815 | |
| 44 | 44 | int code = data1 & 0x7fff; |
| 45 | 45 | int color = 0x10 + (data2 & 0x0f); |
| 46 | 46 | SET_TILE_INFO(0, code, color, (data1 >> 15) & 1); |
| 47 | tileinfo-> | |
| 47 | tileinfo->categor | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| r814 | r815 | |
| 55 | 55 | int code = data1 & 0x7fff; |
| 56 | 56 | int color = data2 & 0x0f; |
| 57 | 57 | SET_TILE_INFO(0, code, color, (data1 >> 15) & 1); |
| 58 | tileinfo-> | |
| 58 | tileinfo->categor | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| r814 | r815 | |
| 106 | 106 | }; |
| 107 | 107 | |
| 108 | 108 | /* initialize the playfield */ |
| 109 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 109 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 110 | 110 | |
| 111 | 111 | /* initialize the second playfield */ |
| 112 | atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 112 | atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 113 | 113 | tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0); |
| 114 | 114 | |
| 115 | 115 | /* initialize the motion objects */ |
| 116 | 116 | atarimo_init(machine, 0, &modesc); |
| 117 | 117 | |
| 118 | 118 | /* initialize the alphanumerics */ |
| 119 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 119 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 120 | 120 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 121 | 121 | } |
| 122 | 122 |
| r814 | r815 | |
|---|---|---|
| 52 | 52 | if ( color & 0x80) flags |= TILE_FLIPX; |
| 53 | 53 | if ( code & 0x0800) flags |= TILE_FLIPY; |
| 54 | 54 | if ((~code & 0x2000) || ((code & 0xc000) == 0x4000)) |
| 55 | flags |= TILE_ | |
| 55 | flags |= TILE_F | |
| 56 | 56 | if (code & 0xf800) { |
| 57 | 57 | SET_TILE_INFO( 0, code&0x7ff, color&0x7f, flags ); |
| 58 | 58 | } else { |
| 59 | 59 | SET_TILE_INFO( 0, 0x800, 0x00, 0 ); |
| 60 | 60 | } |
| 61 | tileinfo-> | |
| 61 | tileinfo->categor | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 70 | 70 | if ( color & 0x80) flags |= TILE_FLIPX; |
| 71 | 71 | if ( code & 0x0800) flags |= TILE_FLIPY; |
| 72 | 72 | if ((~code & 0x2000) || ((code & 0xc000) == 0x4000)) |
| 73 | flags |= TILE_ | |
| 73 | flags |= TILE_F | |
| 74 | 74 | if (code & 0xf800) { |
| 75 | 75 | SET_TILE_INFO( 0, code&0x7ff, color&0x7f, flags ); |
| 76 | 76 | } else { |
| 77 | 77 | SET_TILE_INFO( 0, 0x800, 0x00, 0 ); |
| 78 | 78 | } |
| 79 | tileinfo-> | |
| 79 | tileinfo->categor | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | WRITE16_HANDLER( nemesis_gfx_flipx_w ) |
| r814 | r815 | |
| 213 | 213 | spriteram_words = spriteram_size / 2; |
| 214 | 214 | |
| 215 | 215 | background = tilemap_create( |
| 216 | get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 216 | get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 217 | 217 | |
| 218 | 218 | foreground = tilemap_create( |
| 219 | get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 219 | get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 220 | 220 | |
| 221 | 221 | tilemap_set_transparent_pen( background, 0 ); |
| 222 | 222 | tilemap_set_transparent_pen( foreground, 0 ); |
| r814 | r815 | |
|---|---|---|
| 101 | 101 | #define TWINACTN_PAGES_PER_TMAP_Y (0x1) |
| 102 | 102 | |
| 103 | 103 | |
| 104 | ||
| 104 | static TILEMAP_MAPPER( afega_tilemap_scan_pages | |
| 105 | 105 | { |
| 106 | 106 | return (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y * PAGES_PER_TMAP_X + |
| 107 | 107 | (row % TILES_PER_PAGE_Y) + |
| r814 | r815 | |
| 110 | 110 | (col % TILES_PER_PAGE_X) * TILES_PER_PAGE_Y; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | ||
| 113 | static TILEMAP_MAPPER( twinactn_tilemap_scan_pages | |
| 114 | 114 | { |
| 115 | 115 | return (row / TWINACTN_TILES_PER_PAGE_Y) * TWINACTN_TILES_PER_PAGE_X * TWINACTN_TILES_PER_PAGE_Y * TWINACTN_PAGES_PER_TMAP_X + |
| 116 | 116 | (row % TWINACTN_TILES_PER_PAGE_Y) + |
| r814 | r815 | |
| 119 | 119 | (col % TWINACTN_TILES_PER_PAGE_X) * TWINACTN_TILES_PER_PAGE_Y; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | ||
| 122 | static TILEMAP_MAPPER( firehawk_tilemap_scan_pages | |
| 123 | 123 | { |
| 124 | 124 | return (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y * FIREHAWK_PAGES_PER_TMAP_X + |
| 125 | 125 | (row % TILES_PER_PAGE_Y) + |
| r814 | r815 | |
| 137 | 137 | 1, |
| 138 | 138 | code, |
| 139 | 139 | (code & 0xf000) >> 12, |
| 140 | 0) | |
| 140 | 0); | |
| 141 | 141 | } |
| 142 | 142 | static TILE_GET_INFO( get_tile_info_1 ) |
| 143 | 143 | { |
| r814 | r815 | |
| 146 | 146 | 2, |
| 147 | 147 | code, |
| 148 | 148 | (code & 0xf000) >> 12, |
| 149 | 0) | |
| 149 | 0); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | WRITE16_HANDLER( afega_vram_0_w ) |
| r814 | r815 | |
| 172 | 172 | VIDEO_START( afega ) |
| 173 | 173 | { |
| 174 | 174 | tilemap_0 = tilemap_create( get_tile_info_0, afega_tilemap_scan_pages, |
| 175 | TILEMAP_TYPE_ | |
| 175 | TILEMAP_TYPE_ | |
| 176 | 176 | 16,16, |
| 177 | 177 | TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y); |
| 178 | 178 | |
| 179 | 179 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_cols, |
| 180 | TILEMAP_TYPE_ | |
| 180 | TILEMAP_TYPE_ | |
| 181 | 181 | 8,8, |
| 182 | 182 | 32,32); |
| 183 | 183 | |
| 184 | tilemap_set_transparent_pen(tilemap_0,0x0); | |
| 185 | 184 | tilemap_set_transparent_pen(tilemap_1,0xf); |
| 186 | 185 | } |
| 187 | 186 | |
| 188 | 187 | VIDEO_START( twinactn ) |
| 189 | 188 | { |
| 190 | 189 | tilemap_0 = tilemap_create( get_tile_info_0, afega_tilemap_scan_pages, |
| 191 | TILEMAP_TYPE_ | |
| 190 | TILEMAP_TYPE_ | |
| 192 | 191 | 16,16, |
| 193 | 192 | TWINACTN_TILES_PER_PAGE_X*TWINACTN_PAGES_PER_TMAP_X,TWINACTN_TILES_PER_PAGE_Y*TWINACTN_PAGES_PER_TMAP_Y); |
| 194 | 193 | |
| 195 | 194 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_cols, |
| 196 | TILEMAP_TYPE_ | |
| 195 | TILEMAP_TYPE_ | |
| 197 | 196 | 8,8, |
| 198 | 197 | 32,32); |
| 199 | 198 | |
| 200 | tilemap_set_transparent_pen(tilemap_0,0x0); | |
| 201 | 199 | tilemap_set_transparent_pen(tilemap_1,0xf); |
| 202 | 200 | } |
| 203 | 201 | |
| 204 | 202 | VIDEO_START( firehawk ) |
| 205 | 203 | { |
| 206 | 204 | tilemap_0 = tilemap_create( get_tile_info_0, firehawk_tilemap_scan_pages, |
| 207 | TILEMAP_TYPE_ | |
| 205 | TILEMAP_TYPE_ | |
| 208 | 206 | 16,16, |
| 209 | 207 | TILES_PER_PAGE_X*FIREHAWK_PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*FIREHAWK_PAGES_PER_TMAP_Y); |
| 210 | 208 | |
| 211 | 209 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_cols, |
| 212 | TILEMAP_TYPE_ | |
| 210 | TILEMAP_TYPE_ | |
| 213 | 211 | 8,8, |
| 214 | 212 | 32,32); |
| 215 | 213 | |
| 216 | tilemap_set_transparent_pen(tilemap_0,0x0); | |
| 217 | 214 | tilemap_set_transparent_pen(tilemap_1,0xf); |
| 218 | 215 | } |
| 219 | 216 |
| r814 | r815 | |
|---|---|---|
| 73 | 73 | VIDEO_START( timelimt ) |
| 74 | 74 | { |
| 75 | 75 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 76 | TILEMAP_TYPE_ | |
| 76 | TILEMAP_TYPE_ | |
| 77 | 77 | |
| 78 | 78 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 79 | TILEMAP_TYPE_ | |
| 79 | TILEMAP_TYPE_ | |
| 80 | 80 | |
| 81 | 81 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 82 | 82 | } |
| r814 | r815 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | /* chip 0 does tilemaps on the left, chip 1 does the ones on the right */ |
| 123 | 123 | // draw bottom layer |
| 124 | nodraw = TC0100SCN_tilemap_draw(machine,bitmap,cliprect,screen,layer[0],TILEMAP_ | |
| 124 | nodraw = TC0100SCN_tilemap_draw(machine,bitmap,cliprect,screen,layer[0],TILEMAP_D | |
| 125 | 125 | |
| 126 | 126 | /* Ensure screen blanked even when bottom layers not drawn due to disable bit */ |
| 127 | 127 | if(nodraw) fillbitmap(bitmap, get_black_pen(machine), cliprect); |
| r814 | r815 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | /*****************************************************************************************/ |
| 238 | 238 | |
| 239 | static | |
| 239 | static | |
| 240 | 240 | { |
| 241 | 241 | /* logical (col,row) -> memory offset */ |
| 242 | 242 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6); |
| r814 | r815 | |
| 263 | 263 | deco16_pf34_16x16_gfx_bank, |
| 264 | 264 | (tile&0xfff)|deco16_pf4_bank, |
| 265 | 265 | (colour&deco16_pf4_colourmask)+deco16_pf4_colour_bank, |
| 266 | flags) | |
| 266 | flags); | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | static TILE_GET_INFO( get_pf3_tile_info ) |
| r814 | r815 | |
| 287 | 287 | deco16_pf34_16x16_gfx_bank, |
| 288 | 288 | (tile&0xfff)|deco16_pf3_bank, |
| 289 | 289 | (colour&deco16_pf3_colourmask)+deco16_pf3_colour_bank, |
| 290 | flags) | |
| 290 | flags); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static TILE_GET_INFO( get_pf2_tile_info ) |
| r814 | r815 | |
| 311 | 311 | deco16_pf12_16x16_gfx_bank, |
| 312 | 312 | (tile&0xfff)|deco16_pf2_bank, |
| 313 | 313 | (colour&deco16_pf2_colourmask)+deco16_pf2_colour_bank, |
| 314 | flags) | |
| 314 | flags); | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | static TILE_GET_INFO( get_pf1_tile_info ) |
| r814 | r815 | |
| 335 | 335 | deco16_pf12_16x16_gfx_bank, |
| 336 | 336 | (tile&0xfff)|deco16_pf1_bank, |
| 337 | 337 | (colour&deco16_pf1_colourmask)+deco16_pf1_colour_bank, |
| 338 | flags) | |
| 338 | flags); | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | static TILE_GET_INFO( get_pf2_tile_info_b ) |
| r814 | r815 | |
| 359 | 359 | deco16_pf12_8x8_gfx_bank, |
| 360 | 360 | (tile&0xfff)|deco16_pf2_bank, |
| 361 | 361 | (colour&deco16_pf2_colourmask)+deco16_pf2_colour_bank, |
| 362 | flags) | |
| 362 | flags); | |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | static TILE_GET_INFO( get_pf1_tile_info_b ) |
| r814 | r815 | |
| 383 | 383 | deco16_pf12_8x8_gfx_bank, |
| 384 | 384 | (tile&0xfff)|deco16_pf1_bank, |
| 385 | 385 | (colour&deco16_pf1_colourmask)+deco16_pf1_colour_bank, |
| 386 | flags) | |
| 386 | flags); | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | /******************************************************************************/ |
| r814 | r815 | |
| 519 | 519 | { |
| 520 | 520 | sprite_priority_bitmap = auto_bitmap_alloc( Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED8 ); |
| 521 | 521 | |
| 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); | |
| 524 | 524 | |
| 525 | 525 | if (split) |
| 526 | pf2_tilemap_16x16 = tilemap_create(get_pf2_tile_info, deco16_scan_rows, TILEMAP_TYPE_ | |
| 526 | pf2_tilemap_16x16 = tilemap_create(get_pf2_tile_info, deco16_scan_rows, TILEMAP_TYPE_ | |
| 527 | 527 | 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); | |
| 530 | 530 | |
| 531 | 531 | dirty_palette = auto_malloc(4096); |
| 532 | 532 | deco16_raster_display_list=auto_malloc(20 * 256); |
| 533 | 533 | |
| 534 | 534 | if (!pf12_only) |
| 535 | 535 | { |
| 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); | |
| 538 | 538 | } |
| 539 | 539 | else |
| 540 | 540 | { |
| r814 | r815 | |
| 965 | 965 | int flags, |
| 966 | 966 | UINT32 priority) |
| 967 | 967 | { |
| 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; | |
| 970 | 972 | int width_mask, height_mask, x, y, p; |
| 971 | 973 | int column_offset, src_x=0, src_y=0; |
| 972 | 974 | int row_type=1 << ((control0>>3)&0xf); |
| r814 | r815 | |
| 1002 | 1004 | p|=(*BITMAP_ADDR16(src_bitmap1, (src_y + column_offset)&height_mask, src_x)&combine_mask)<<combine_shift; |
| 1003 | 1005 | |
| 1004 | 1006 | src_x=(src_x+1)&width_mask; |
| 1005 | if ((flags&TILEMAP_ | |
| 1007 | if ((flags&TILEMAP_D | |
| 1006 | 1008 | { |
| 1007 | 1009 | *BITMAP_ADDR16(bitmap, y, x) = Machine->pens[p]; |
| 1008 | 1010 | if (priority_bitmap) |
| r814 | r815 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | tile |= 0xc000; |
| 56 | 56 | |
| 57 | SET_TILE_INFO(1,tile,color,0) | |
| 57 | SET_TILE_INFO(1,tile,color,0); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | static TILE_GET_INFO( get_back_tile_info ) |
| r814 | r815 | |
| 64 | 64 | |
| 65 | 65 | tile &= 0xfff; |
| 66 | 66 | |
| 67 | SET_TILE_INFO(2,tile,color,0) | |
| 67 | SET_TILE_INFO(2,tile,color,0); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static TILE_GET_INFO( get_fore_tile_info ) |
| r814 | r815 | |
| 86 | 86 | tile |= 0x2000; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | SET_TILE_INFO(region,tile,color,0) | |
| 89 | SET_TILE_INFO(region,tile,color,0); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static void draw_sprites(running_machine *machine,mame_bitmap *bitmap,const rectangle *cliprect,int pri) |
| r814 | r815 | |
| 135 | 135 | |
| 136 | 136 | VIDEO_START( goal92 ) |
| 137 | 137 | { |
| 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); | |
| 141 | 141 | |
| 142 | 142 | buffered_spriteram16 = auto_malloc(0x400*2); |
| 143 | 143 |
| r814 | r815 | |
|---|---|---|
| 105 | 105 | 0, |
| 106 | 106 | code + ((color & 0x80) << 1), |
| 107 | 107 | color & 0x3f, |
| 108 | 0) | |
| 108 | 0); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 120 | 120 | 1, |
| 121 | 121 | code + ((color & 0x80) << 1), |
| 122 | 122 | (color & 0x1f) + (0x20 * c1942_palette_bank), |
| 123 | TILE_FLIPYX((color & 0x60) >> 5)) | |
| 123 | TILE_FLIPYX((color & 0x60) >> 5)); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| r814 | r815 | |
| 131 | 131 | ***************************************************************************/ |
| 132 | 132 | VIDEO_START( 1942 ) |
| 133 | 133 | { |
| 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); | |
| 136 | 136 | |
| 137 | 137 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 138 | 138 |
| r814 | r815 | |
|---|---|---|
| 14 | 14 | static tilemap* bg_tilemap; |
| 15 | 15 | |
| 16 | 16 | |
| 17 | static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) | |
| 18 | { | |
| 19 | return num_cols * row + col; | |
| 20 | } | |
| 21 | ||
| 22 | ||
| 23 | 17 | static TILE_GET_INFO( get_tile_info ) |
| 24 | 18 | { |
| 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); | |
| 26 | 20 | } |
| 27 | 21 | |
| 28 | 22 | |
| 29 | 23 | VIDEO_START( poolshrk ) |
| 30 | 24 | { |
| 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); | |
| 33 | 27 | |
| 34 | 28 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 35 | 29 | } |
| r814 | r815 | |
|---|---|---|
| 17 | 17 | int code = mayumi_videoram[tile_index] + (mayumi_videoram[tile_index+0x800] & 0x1f)*0x100 ; |
| 18 | 18 | int col = (mayumi_videoram[tile_index+0x1000] >> 3) & 0x1f; |
| 19 | 19 | |
| 20 | SET_TILE_INFO(0, code, col, 0) | |
| 20 | SET_TILE_INFO(0, code, col, 0); | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | VIDEO_START( mayumi ) |
| 24 | 24 | { |
| 25 | 25 | mayumi_videoram = auto_malloc(0x1800); |
| 26 | 26 | |
| 27 | mayumi_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 27 | mayumi_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | WRITE8_HANDLER( mayumi_videoram_w ) |
| r814 | r815 | |
|---|---|---|
| 53 | 53 | 1, |
| 54 | 54 | tile, |
| 55 | 55 | color, |
| 56 | 0) | |
| 56 | 0); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static TILE_GET_INFO( get_fore_tile_info ) |
| r814 | r815 | |
| 67 | 67 | 2, |
| 68 | 68 | tile, |
| 69 | 69 | color, |
| 70 | 0) | |
| 70 | 0); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 79 | 79 | 0, |
| 80 | 80 | tile, |
| 81 | 81 | color, |
| 82 | 0) | |
| 82 | 0); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | VIDEO_START( raiden ) |
| 86 | 86 | { |
| 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); | |
| 90 | 90 | ALTERNATE=0; |
| 91 | 91 | |
| 92 | 92 | tilemap_set_transparent_pen(fg_layer,15); |
| r814 | r815 | |
| 95 | 95 | |
| 96 | 96 | VIDEO_START( raidena ) |
| 97 | 97 | { |
| 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); | |
| 101 | 101 | ALTERNATE=1; |
| 102 | 102 | |
| 103 | 103 | tilemap_set_transparent_pen(fg_layer,15); |
| r814 | r815 | |
|---|---|---|
| 26 | 26 | 1, |
| 27 | 27 | code & 0xfff, |
| 28 | 28 | code >> 12, |
| 29 | 0) | |
| 29 | 0); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 36 | 36 | 2, |
| 37 | 37 | code & 0xfff, |
| 38 | 38 | code >> 12, |
| 39 | 0) | |
| 39 | 0); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 46 | 46 | 0, |
| 47 | 47 | code & 0xfff, |
| 48 | 48 | code >> 12, |
| 49 | 0) | |
| 49 | 0); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r814 | r815 | |
| 59 | 59 | |
| 60 | 60 | VIDEO_START( bloodbro ) |
| 61 | 61 | { |
| 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); | |
| 65 | 65 | |
| 66 | 66 | tilemap_set_transparent_pen(fg_tilemap,15); |
| 67 | 67 | tilemap_set_transparent_pen(tx_tilemap,15); |
| r814 | r815 | |
|---|---|---|
| 27 | 27 | tile = (fromanc2_videoram[vram][layer][tile_index] & 0x3fff) | (fromanc2_gfxbank[vram][layer] << 14); |
| 28 | 28 | color = ((fromanc2_videoram[vram][layer][tile_index] & 0xc000) >> 14) | (0x10 * vram); |
| 29 | 29 | |
| 30 | SET_TILE_INFO(layer, tile, color, 0) | |
| 30 | SET_TILE_INFO(layer, tile, color, 0); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static TILE_GET_INFO( fromanc2_get_v0_l0_tile_info ) { fromanc2_get_tile_info(machine, tileinfo, tile_index, 0, 0); } |
| r814 | r815 | |
| 47 | 47 | tile = fromanc2_videoram[vram][layer][tile_index] | (fromanc2_gfxbank[vram][layer] << 16); |
| 48 | 48 | color = vram; |
| 49 | 49 | |
| 50 | SET_TILE_INFO(layer, tile, color, 0) | |
| 50 | SET_TILE_INFO(layer, tile, color, 0); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static TILE_GET_INFO( fromancr_get_v0_l0_tile_info ) { fromancr_get_tile_info(machine, tileinfo, tile_index, 0, 0); } |
| r814 | r815 | |
| 370 | 370 | |
| 371 | 371 | VIDEO_START( fromanc2 ) |
| 372 | 372 | { |
| 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); | |
| 381 | 381 | |
| 382 | 382 | fromanc2_videoram[0][0] = auto_malloc((64 * 64) * sizeof(UINT16)); |
| 383 | 383 | fromanc2_videoram[0][1] = auto_malloc((64 * 64) * sizeof(UINT16)); |
| r814 | r815 | |
| 401 | 401 | |
| 402 | 402 | VIDEO_START( fromancr ) |
| 403 | 403 | { |
| 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); | |
| 407 | 407 | 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); | |
| 411 | 411 | fromanc2_tilemap[1][3] = 0; |
| 412 | 412 | |
| 413 | 413 | fromanc2_videoram[0][0] = auto_malloc((64 * 64) * sizeof(UINT16)); |
| r814 | r815 | |
| 429 | 429 | |
| 430 | 430 | VIDEO_START( fromanc4 ) |
| 431 | 431 | { |
| 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); | |
| 435 | 435 | 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); | |
| 439 | 439 | fromanc2_tilemap[1][3] = 0; |
| 440 | 440 | |
| 441 | 441 | fromanc2_videoram[0][0] = auto_malloc((256 * 64) * sizeof(UINT16)); |
| r814 | r815 | |
|---|---|---|
| 52 | 52 | int color = attr & 0x0f; |
| 53 | 53 | int flags = (attr & 0x80) ? TILE_FLIPY : 0; |
| 54 | 54 | |
| 55 | SET_TILE_INFO(1, code, color, flags) | |
| 55 | SET_TILE_INFO(1, code, color, flags); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 60 | 60 | int code = videoram[tile_index] + 16 * (colorram[tile_index] & 0x10); |
| 61 | 61 | int color = colorram[tile_index] & 0x0f; |
| 62 | 62 | |
| 63 | SET_TILE_INFO(0, code, color, 0) | |
| 63 | SET_TILE_INFO(0, code, color, 0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | VIDEO_START( bombjack ) |
| 67 | 67 | { |
| 68 | 68 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 69 | TILEMAP_TYPE_ | |
| 69 | TILEMAP_TYPE_ | |
| 70 | 70 | |
| 71 | 71 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 72 | TILEMAP_TYPE_ | |
| 72 | TILEMAP_TYPE_ | |
| 73 | 73 | |
| 74 | 74 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 75 | 75 |
| r814 | r815 | |
|---|---|---|
| 192 | 192 | ***************************************************************************/ |
| 193 | 193 | |
| 194 | 194 | /* the video RAM has space for 32x32 tiles and is only partially used for the radar */ |
| 195 | static | |
| 195 | static | |
| 196 | 196 | { |
| 197 | 197 | return col + (row << 5); |
| 198 | 198 | } |
| r814 | r815 | |
| 201 | 201 | INLINE void rallyx_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int ram_offs) |
| 202 | 202 | { |
| 203 | 203 | UINT8 attr = rallyx_videoram[ram_offs + tile_index + 0x800]; |
| 204 | tileinfo-> | |
| 204 | tileinfo->categor | |
| 205 | 205 | SET_TILE_INFO( |
| 206 | 206 | 0, |
| 207 | 207 | rallyx_videoram[ram_offs + tile_index], |
| 208 | 208 | attr & 0x3f, |
| 209 | TILE_FLIPYX(attr >> 6) ^ TILE_FLIPX) | |
| 209 | TILE_FLIPYX(attr >> 6) ^ TILE_FLIPX); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | static TILE_GET_INFO( rallyx_bg_get_tile_info ) |
| r814 | r815 | |
| 225 | 225 | UINT8 attr = rallyx_videoram[ram_offs + tile_index + 0x800]; |
| 226 | 226 | int code = rallyx_videoram[ram_offs + tile_index]; |
| 227 | 227 | code = (code & 0x7f) + 2*(attr & 0x40) + 2*(code & 0x80); |
| 228 | tileinfo-> | |
| 228 | tileinfo->categor | |
| 229 | 229 | SET_TILE_INFO( |
| 230 | 230 | 0, |
| 231 | 231 | code, |
| 232 | 232 | attr & 0x3f, |
| 233 | (attr & 0x80) ? (TILE_FLIPX | TILE_FLIPY) : 0) | |
| 233 | (attr & 0x80) ? (TILE_FLIPX | TILE_FLIPY) : 0); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | static TILE_GET_INFO( locomotn_bg_get_tile_info ) |
| r814 | r815 | |
| 257 | 257 | |
| 258 | 258 | if (video_type == TYPE_RALLYX || video_type == TYPE_JUNGLER) |
| 259 | 259 | { |
| 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); | |
| 262 | 262 | } |
| 263 | 263 | else |
| 264 | 264 | { |
| 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); | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /* the scrolling tilemap is slightly misplaced in Rally X */ |
| r814 | r815 | |
|---|---|---|
| 67 | 67 | code |= ( bank & 2 ) << 8; |
| 68 | 68 | code += ( bank & 4 ) << 6; |
| 69 | 69 | |
| 70 | SET_TILE_INFO(gfxsel,code,colour,0) | |
| 70 | SET_TILE_INFO(gfxsel,code,colour,0); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | VIDEO_START( trucocl ) |
| 74 | 74 | { |
| 75 | bg_tilemap = tilemap_create( get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 75 | bg_tilemap = tilemap_create( get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | VIDEO_UPDATE( trucocl ) |
| r814 | r815 | |
|---|---|---|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
| 231 | static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) | |
| 232 | { | |
| 233 | return num_cols * row + col; | |
| 234 | } | |
| 235 | ||
| 236 | ||
| 237 | 231 | static TILE_GET_INFO( get_tile_info ) |
| 238 | 232 | { |
| 239 | 233 | UINT8 code0 = bking2_playfield_ram[2 * tile_index + 0]; |
| r814 | r815 | |
| 244 | 238 | if (code1 & 4) flags |= TILE_FLIPX; |
| 245 | 239 | if (code1 & 8) flags |= TILE_FLIPY; |
| 246 | 240 | |
| 247 | SET_TILE_INFO(0, code0 + 256 * code1, palette_bank, flags) | |
| 241 | SET_TILE_INFO(0, code0 + 256 * code1, palette_bank, flags); | |
| 248 | 242 | } |
| 249 | 243 | |
| 250 | 244 | |
| 251 | 245 | VIDEO_START( bking2 ) |
| 252 | 246 | { |
| 253 | bg_tilemap = tilemap_create(get_tile_info, | |
| 247 | bg_tilemap = tilemap_create(get_tile_info, | |
| 254 | 248 | helper0 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 255 | 249 | helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 256 | 250 | } |
| r814 | r815 | |
|---|---|---|
| 101 | 101 | { \ |
| 102 | 102 | UINT16 code = unico_vram_##_N_[ 2 * tile_index + 0 ]; \ |
| 103 | 103 | 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 )); \ | |
| 105 | 105 | } \ |
| 106 | 106 | \ |
| 107 | 107 | static TILE_GET_INFO( get_tile_info32_##_N_ ) \ |
| 108 | 108 | { \ |
| 109 | 109 | 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 )); \ | |
| 111 | 111 | } \ |
| 112 | 112 | \ |
| 113 | 113 | WRITE16_HANDLER( unico_vram_##_N_##_w ) \ |
| r814 | r815 | |
| 141 | 141 | VIDEO_START( unico ) |
| 142 | 142 | { |
| 143 | 143 | tilemap_0 = tilemap_create( get_tile_info_0,tilemap_scan_rows, |
| 144 | TILEMAP_TYPE_ | |
| 144 | TILEMAP_TYPE_ | |
| 145 | 145 | |
| 146 | 146 | tilemap_1 = tilemap_create( get_tile_info_1,tilemap_scan_rows, |
| 147 | TILEMAP_TYPE_ | |
| 147 | TILEMAP_TYPE_ | |
| 148 | 148 | |
| 149 | 149 | tilemap_2 = tilemap_create( get_tile_info_2,tilemap_scan_rows, |
| 150 | TILEMAP_TYPE_ | |
| 150 | TILEMAP_TYPE_ | |
| 151 | 151 | |
| 152 | 152 | sprites_scrolldx = -0x3f; |
| 153 | 153 | sprites_scrolldy = -0x0e; |
| r814 | r815 | |
| 168 | 168 | VIDEO_START( zeropnt2 ) |
| 169 | 169 | { |
| 170 | 170 | tilemap_0 = tilemap_create( get_tile_info32_0,tilemap_scan_rows, |
| 171 | TILEMAP_TYPE_ | |
| 171 | TILEMAP_TYPE_ | |
| 172 | 172 | |
| 173 | 173 | tilemap_1 = tilemap_create( get_tile_info32_1,tilemap_scan_rows, |
| 174 | TILEMAP_TYPE_ | |
| 174 | TILEMAP_TYPE_ | |
| 175 | 175 | |
| 176 | 176 | tilemap_2 = tilemap_create( get_tile_info32_2,tilemap_scan_rows, |
| 177 | TILEMAP_TYPE_ | |
| 177 | TILEMAP_TYPE_ | |
| 178 | 178 | |
| 179 | 179 | sprites_scrolldx = -0x3f; |
| 180 | 180 | sprites_scrolldy = -0x0e; |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | |
| 59 | 59 | K052109_tilemap_update(); |
| 60 | 60 | |
| 61 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_ | |
| 61 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_D | |
| 62 | 62 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,1); |
| 63 | 63 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,2); |
| 64 | 64 |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | 1, |
| 30 | 30 | (tilenum & 0xfff) + bg0_gfxset, |
| 31 | 31 | (attr & 0x1f), |
| 32 | TILE_FLIPYX( (attr & 0x300) >> 8)) | |
| 32 | TILE_FLIPYX( (attr & 0x300) >> 8)); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 41 | 41 | 1, |
| 42 | 42 | (tilenum & 0xfff) + 0x2000 + bg1_gfxset, |
| 43 | 43 | (attr & 0x1f) + 0x30, |
| 44 | TILE_FLIPYX( (attr & 0x300) >> 8)) | |
| 44 | TILE_FLIPYX( (attr & 0x300) >> 8)); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 52 | 52 | 2, |
| 53 | 53 | (tilenum & 0xfff), |
| 54 | 54 | (tilenum >> 12) | 0x70, |
| 55 | 0) | |
| 55 | 0); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | #if 0 |
| r814 | r815 | |
| 69 | 69 | int xoffs = 0; |
| 70 | 70 | int yoffs = 0; |
| 71 | 71 | |
| 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); | |
| 75 | 75 | |
| 76 | 76 | tilemap_set_transparent_pen( gcpinbal_tilemap[0],0 ); |
| 77 | 77 | tilemap_set_transparent_pen( gcpinbal_tilemap[1],0 ); |
| r814 | r815 | |
| 328 | 328 | #ifdef MAME_DEBUG |
| 329 | 329 | if (dislayer[layer[0]]==0) |
| 330 | 330 | #endif |
| 331 | tilemap_draw(bitmap,cliprect,gcpinbal_tilemap[layer[0]],TILEMAP_ | |
| 331 | tilemap_draw(bitmap,cliprect,gcpinbal_tilemap[layer[0]],TILEMAP_D | |
| 332 | 332 | |
| 333 | 333 | #ifdef MAME_DEBUG |
| 334 | 334 | if (dislayer[layer[1]]==0) |
| r814 | r815 | |
|---|---|---|
| 84 | 84 | 0, |
| 85 | 85 | code, |
| 86 | 86 | attr & 0x7f, |
| 87 | TILE_FLIPYX( attr >> 14 )) | |
| 87 | TILE_FLIPYX( attr >> 14 )); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static TILE_GET_INFO( get_tile_info_1 ) |
| r814 | r815 | |
| 95 | 95 | 0, |
| 96 | 96 | code, |
| 97 | 97 | attr & 0x7f, |
| 98 | TILE_FLIPYX( attr >> 14 )) | |
| 98 | TILE_FLIPYX( attr >> 14 )); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | WRITE16_HANDLER( realbrk_vram_0_w ) |
| r814 | r815 | |
| 131 | 131 | 1, |
| 132 | 132 | code & 0x0fff, |
| 133 | 133 | ((code & 0xf000) >> 12) | ((realbrk_vregs[0xa/2] & 0x7f) << 4), |
| 134 | 0) | |
| 134 | 0); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | WRITE16_HANDLER( realbrk_vram_2_w ) |
| r814 | r815 | |
| 154 | 154 | { |
| 155 | 155 | /* Backgrounds */ |
| 156 | 156 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 157 | TILEMAP_TYPE_ | |
| 157 | TILEMAP_TYPE_ | |
| 158 | 158 | 16,16, |
| 159 | 159 | 0x40, 0x20); |
| 160 | 160 | |
| 161 | 161 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 162 | TILEMAP_TYPE_ | |
| 162 | TILEMAP_TYPE_ | |
| 163 | 163 | 16,16, |
| 164 | 164 | 0x40, 0x20); |
| 165 | 165 | |
| 166 | 166 | /* Text */ |
| 167 | 167 | tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 168 | TILEMAP_TYPE_ | |
| 168 | TILEMAP_TYPE_ | |
| 169 | 169 | 8,8, |
| 170 | 170 | 0x40, 0x20); |
| 171 | 171 |
| r814 | r815 | |
|---|---|---|
| 69 | 69 | 0, |
| 70 | 70 | tile_number, |
| 71 | 71 | (attr&0x7), |
| 72 | 0) | |
| 72 | 0); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | WRITE8_HANDLER( carjmbre_videoram_w ){ |
| r814 | r815 | |
| 82 | 82 | VIDEO_START( carjmbre ) |
| 83 | 83 | { |
| 84 | 84 | |
| 85 | carjmbre_tilemap = tilemap_create( get_carjmbre_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 85 | carjmbre_tilemap = tilemap_create( get_carjmbre_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 86 | 86 | |
| 87 | 87 | state_save_register_global(carjmbre_flipscreen); |
| 88 | 88 | state_save_register_global(carjmbre_bgcolor); |
| r814 | r815 | |
|---|---|---|
| 233 | 233 | sprites as pdrawgfx cannot yet cope with more than 4 layers */ |
| 234 | 234 | |
| 235 | 235 | #ifdef MAME_DEBUG |
| 236 | if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_ | |
| 236 | if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_D | |
| 237 | 237 | if (!input_code_pressed (KEYCODE_X)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,1); |
| 238 | 238 | if (!input_code_pressed (KEYCODE_C)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,2); |
| 239 | 239 | if (!input_code_pressed (KEYCODE_V)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,4); |
| 240 | 240 | if (!input_code_pressed (KEYCODE_B)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[4],0,8); |
| 241 | 241 | if (!input_code_pressed (KEYCODE_N)) draw_sprites(machine,bitmap,cliprect,primasks,48,-116); |
| 242 | 242 | #else |
| 243 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_ | |
| 243 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_D | |
| 244 | 244 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,1); |
| 245 | 245 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,2); |
| 246 | 246 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,4); |
| r814 | r815 | |
|---|---|---|
| 65 | 65 | zoom_colorbase = 48; |
| 66 | 66 | K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tile_callback); |
| 67 | 67 | K051960_vh_start(machine,REGION_GFX2,NORMAL_PLANE_ORDER,sprite_callback); |
| 68 | K051316_vh_start_0(machine,REGION_GFX3,4, | |
| 68 | K051316_vh_start_0(machine,REGION_GFX3,4,F | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 |
| r814 | r815 | |
|---|---|---|
| 115 | 115 | int color = flower_bg0ram[tile_index+0x100]; |
| 116 | 116 | /* Todo - may be tile flip bits? */ |
| 117 | 117 | |
| 118 | SET_TILE_INFO(2, code, color>>4, 0) | |
| 118 | SET_TILE_INFO(2, code, color>>4, 0); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 124 | 124 | int color = flower_bg1ram[tile_index+0x100]; |
| 125 | 125 | /* Todo - may be tile flip bits? */ |
| 126 | 126 | |
| 127 | SET_TILE_INFO(2, code, color>>4, 0) | |
| 127 | SET_TILE_INFO(2, code, color>>4, 0); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 133 | 133 | int color = flower_textram[tile_index+0x400]; |
| 134 | 134 | /* Todo - may be tile flip bits? */ |
| 135 | 135 | |
| 136 | SET_TILE_INFO(0, code, color>>2, 0) | |
| 136 | SET_TILE_INFO(0, code, color>>2, 0); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | VIDEO_START(flower) |
| 140 | 140 | { |
| 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); | |
| 145 | 145 | |
| 146 | 146 | tilemap_set_transparent_pen(flower_bg1_tilemap,15); |
| 147 | 147 | tilemap_set_transparent_pen(flower_text_tilemap,3); |
| r814 | r815 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | ***************************************************************************/ |
| 45 | 45 | |
| 46 | static | |
| 46 | static | |
| 47 | 47 | { |
| 48 | 48 | /* logical (col,row) -> memory offset */ |
| 49 | 49 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5); |
| r814 | r815 | |
| 56 | 56 | 2, |
| 57 | 57 | xain_bgram0[tile_index] | ((attr & 7) << 8), |
| 58 | 58 | (attr & 0x70) >> 4, |
| 59 | (attr & 0x80) ? TILE_FLIPX : 0) | |
| 59 | (attr & 0x80) ? TILE_FLIPX : 0); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static TILE_GET_INFO( get_bgram1_tile_info ) |
| r814 | r815 | |
| 66 | 66 | 1, |
| 67 | 67 | xain_bgram1[tile_index] | ((attr & 7) << 8), |
| 68 | 68 | (attr & 0x70) >> 4, |
| 69 | (attr & 0x80) ? TILE_FLIPX : 0) | |
| 69 | (attr & 0x80) ? TILE_FLIPX : 0); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static TILE_GET_INFO( get_char_tile_info ) |
| r814 | r815 | |
| 76 | 76 | 0, |
| 77 | 77 | xain_charram[tile_index] | ((attr & 3) << 8), |
| 78 | 78 | (attr & 0xe0) >> 5, |
| 79 | 0) | |
| 79 | 0); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| r814 | r815 | |
| 88 | 88 | |
| 89 | 89 | VIDEO_START( xain ) |
| 90 | 90 | { |
| 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); | |
| 94 | 94 | |
| 95 | 95 | tilemap_set_transparent_pen(bgram0_tilemap,0); |
| 96 | 96 | tilemap_set_transparent_pen(bgram1_tilemap,0); |
| r814 | r815 | |
| 223 | 223 | switch (xain_pri&0x7) |
| 224 | 224 | { |
| 225 | 225 | case 0: |
| 226 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_ | |
| 226 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_D | |
| 227 | 227 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0); |
| 228 | 228 | draw_sprites(machine, bitmap,cliprect); |
| 229 | 229 | tilemap_draw(bitmap,cliprect,char_tilemap,0,0); |
| 230 | 230 | break; |
| 231 | 231 | case 1: |
| 232 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_ | |
| 232 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_D | |
| 233 | 233 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0); |
| 234 | 234 | draw_sprites(machine, bitmap,cliprect); |
| 235 | 235 | tilemap_draw(bitmap,cliprect,char_tilemap,0,0); |
| 236 | 236 | break; |
| 237 | 237 | case 2: |
| 238 | tilemap_draw(bitmap,cliprect,char_tilemap,TILEMAP_ | |
| 238 | tilemap_draw(bitmap,cliprect,char_tilemap,TILEMAP_D | |
| 239 | 239 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0); |
| 240 | 240 | draw_sprites(machine, bitmap,cliprect); |
| 241 | 241 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0); |
| 242 | 242 | break; |
| 243 | 243 | case 3: |
| 244 | tilemap_draw(bitmap,cliprect,char_tilemap,TILEMAP_ | |
| 244 | tilemap_draw(bitmap,cliprect,char_tilemap,TILEMAP_D | |
| 245 | 245 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0); |
| 246 | 246 | draw_sprites(machine, bitmap,cliprect); |
| 247 | 247 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0); |
| 248 | 248 | break; |
| 249 | 249 | case 4: |
| 250 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_ | |
| 250 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_D | |
| 251 | 251 | tilemap_draw(bitmap,cliprect,char_tilemap,0,0); |
| 252 | 252 | draw_sprites(machine, bitmap,cliprect); |
| 253 | 253 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0); |
| 254 | 254 | break; |
| 255 | 255 | case 5: |
| 256 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_ | |
| 256 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_D | |
| 257 | 257 | tilemap_draw(bitmap,cliprect,char_tilemap,0,0); |
| 258 | 258 | draw_sprites(machine, bitmap,cliprect); |
| 259 | 259 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0); |
| 260 | 260 | break; |
| 261 | 261 | case 6: |
| 262 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_ | |
| 262 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,TILEMAP_D | |
| 263 | 263 | draw_sprites(machine, bitmap,cliprect); |
| 264 | 264 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,0,0); |
| 265 | 265 | tilemap_draw(bitmap,cliprect,char_tilemap,0,0); |
| 266 | 266 | break; |
| 267 | 267 | case 7: |
| 268 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_ | |
| 268 | tilemap_draw(bitmap,cliprect,bgram1_tilemap,TILEMAP_D | |
| 269 | 269 | draw_sprites(machine, bitmap,cliprect); |
| 270 | 270 | tilemap_draw(bitmap,cliprect,bgram0_tilemap,0,0); |
| 271 | 271 | tilemap_draw(bitmap,cliprect,char_tilemap,0,0); |
| r814 | r815 | |
|---|---|---|
| 106 | 106 | namcos1_spriteram = auto_malloc(0x1000); |
| 107 | 107 | |
| 108 | 108 | /* 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); | |
| 115 | 115 | |
| 116 | 116 | tilemap_set_scrolldx(bg_tilemap[4],73,512-73); |
| 117 | 117 | tilemap_set_scrolldx(bg_tilemap[5],73,512-73); |
| r814 | r815 | |
|---|---|---|
| 130 | 130 | 1, |
| 131 | 131 | mrdo_bgvideoram[tile_index+0x400] + ((attr & 0x80) << 1), |
| 132 | 132 | attr & 0x3f, |
| 133 | (attr & 0x40) ? TILE_ | |
| 133 | (attr & 0x40) ? TILE_F | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 140 | 140 | 0, |
| 141 | 141 | mrdo_fgvideoram[tile_index+0x400] + ((attr & 0x80) << 1), |
| 142 | 142 | attr & 0x3f, |
| 143 | (attr & 0x40) ? TILE_ | |
| 143 | (attr & 0x40) ? TILE_F | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
| r814 | r815 | |
| 153 | 153 | |
| 154 | 154 | VIDEO_START( mrdo ) |
| 155 | 155 | { |
| 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); | |
| 158 | 158 | |
| 159 | 159 | tilemap_set_transparent_pen(bg_tilemap,0); |
| 160 | 160 | tilemap_set_transparent_pen(fg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 30 | 30 | 0, |
| 31 | 31 | gundealr_bg_videoram[2*tile_index] + ((attr & 0x07) << 8), |
| 32 | 32 | (attr & 0xf0) >> 4, |
| 33 | 0) | |
| 33 | 0); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | static | |
| 36 | static | |
| 37 | 37 | { |
| 38 | 38 | /* logical (col,row) -> memory offset */ |
| 39 | 39 | return (row & 0x0f) + ((col & 0x3f) << 4) + ((row & 0x10) << 6); |
| r814 | r815 | |
| 46 | 46 | 1, |
| 47 | 47 | gundealr_fg_videoram[2*tile_index] + ((attr & 0x03) << 8), |
| 48 | 48 | (attr & 0xf0) >> 4, |
| 49 | 0) | |
| 49 | 0); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r814 | r815 | |
| 59 | 59 | |
| 60 | 60 | VIDEO_START( gundealr ) |
| 61 | 61 | { |
| 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); | |
| 64 | 64 | |
| 65 | 65 | tilemap_set_transparent_pen(fg_tilemap,15); |
| 66 | 66 | } |
| r814 | r815 | |
|---|---|---|
| 94 | 94 | K052109_tilemap_update(); |
| 95 | 95 | |
| 96 | 96 | fillbitmap(priority_bitmap,0,cliprect); |
| 97 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_ | |
| 97 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_D | |
| 98 | 98 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],1,2); /* low priority part of layer */ |
| 99 | 99 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4); /* high priority part of layer */ |
| 100 | 100 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,8); |
| r814 | r815 | |
| 107 | 107 | { |
| 108 | 108 | K052109_tilemap_update(); |
| 109 | 109 | |
| 110 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_ | |
| 110 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_D | |
| 111 | 111 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0); |
| 112 | 112 | K051960_sprites_draw(bitmap,cliprect,0,0); |
| 113 | 113 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,0); |
| r814 | r815 | |
|---|---|---|
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | void m62_start( tile_get_info_ | |
| 367 | void m62_start( tile_get_info_callback tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 ) | |
| 368 | 368 | { |
| 369 | m62_background = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 369 | m62_background = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 370 | 370 | |
| 371 | 371 | m62_background_hscroll = 0; |
| 372 | 372 | m62_background_vscroll = 0; |
| r814 | r815 | |
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | void m62_textlayer( tile_get_info_ | |
| 386 | void m62_textlayer( tile_get_info_callback tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 ) | |
| 387 | 387 | { |
| 388 | m62_foreground = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 388 | m62_foreground = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 389 | 389 | |
| 390 | 390 | if( rows != 0 ) |
| 391 | 391 | { |
| r814 | r815 | |
| 420 | 420 | /* is the following right? */ |
| 421 | 421 | if( ( tile_index / 64 ) < 6 || ( ( color & 0x1f ) >> 1 ) > 0x0c ) |
| 422 | 422 | { |
| 423 | tileinfo-> | |
| 423 | tileinfo->categor | |
| 424 | 424 | } |
| 425 | 425 | else |
| 426 | 426 | { |
| 427 | tileinfo-> | |
| 427 | tileinfo->categor | |
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | |
| r814 | r815 | |
| 466 | 466 | SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, flags ); |
| 467 | 467 | if( ( ( color & 0x1f ) >> 1 ) >= 0x0c ) |
| 468 | 468 | { |
| 469 | tileinfo-> | |
| 469 | tileinfo->categor | |
| 470 | 470 | } |
| 471 | 471 | else |
| 472 | 472 | { |
| 473 | tileinfo-> | |
| 473 | tileinfo->categor | |
| 474 | 474 | } |
| 475 | 475 | } |
| 476 | 476 | |
| r814 | r815 | |
| 506 | 506 | SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, flags ); |
| 507 | 507 | if( ( ( color & 0x1f ) >> 1 ) >= 0x04 ) |
| 508 | 508 | { |
| 509 | tileinfo-> | |
| 509 | tileinfo->categor | |
| 510 | 510 | } |
| 511 | 511 | else |
| 512 | 512 | { |
| 513 | tileinfo-> | |
| 513 | tileinfo->categor | |
| 514 | 514 | } |
| 515 | 515 | } |
| 516 | 516 | |
| r814 | r815 | |
| 534 | 534 | SET_TILE_INFO( 0, code | ( ( color & 0x40 ) << 3 ) | ( ( color & 0x10 ) << 4 ), color & 0x0f, flags ); |
| 535 | 535 | if( ( ( color & 0x1f ) >> 1 ) >= 0x04 ) |
| 536 | 536 | { |
| 537 | tileinfo-> | |
| 537 | tileinfo->categor | |
| 538 | 538 | } |
| 539 | 539 | else |
| 540 | 540 | { |
| 541 | tileinfo-> | |
| 541 | tileinfo->categor | |
| 542 | 542 | } |
| 543 | 543 | } |
| 544 | 544 | |
| r814 | r815 | |
| 670 | 670 | int color; |
| 671 | 671 | code = m62_tileram[ tile_index << 1 ]; |
| 672 | 672 | 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; | |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | static TILE_GET_INFO( get_kidniki_fg_tile_info ) |
| r814 | r815 | |
| 690 | 690 | tilemap_set_scrolly( m62_foreground, 0, kidniki_text_vscroll + 128 ); |
| 691 | 691 | tilemap_set_transparent_pen( m62_foreground, 0 ); |
| 692 | 692 | |
| 693 | tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_ | |
| 693 | tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 ); | |
| 694 | 694 | draw_sprites( machine, bitmap, cliprect, 0x1f, 0x00, 0x00 ); |
| 695 | tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_ | |
| 695 | tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 ); | |
| 696 | 696 | tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 ); |
| 697 | 697 | return 0; |
| 698 | 698 | } |
| 699 | 699 | |
| 700 | 700 | VIDEO_START( kidniki ) |
| 701 | 701 | { |
| 702 | m62_background = tilemap_create( get_kidniki_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 702 | m62_background = tilemap_create( get_kidniki_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 703 | 703 | |
| 704 | 704 | m62_background_hscroll = 0; |
| 705 | 705 | m62_background_vscroll = 0; |
| r814 | r815 | |
| 814 | 814 | SET_TILE_INFO( 0, code | ( ( color & 0x60 ) << 3 ), color & 0x1f, 0 ); |
| 815 | 815 | if( ( ( color & 0x1f ) >> 1 ) >= 0x08 ) |
| 816 | 816 | { |
| 817 | tileinfo-> | |
| 817 | tileinfo->categor | |
| 818 | 818 | } |
| 819 | 819 | else |
| 820 | 820 | { |
| 821 | tileinfo-> | |
| 821 | tileinfo->categor | |
| 822 | 822 | } |
| 823 | 823 | } |
| 824 | 824 | |
| r814 | r815 | |
| 866 | 866 | SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ) | ( ( color & 0x20 ) << 5 ), color & 0x1f, 0 ); |
| 867 | 867 | if( ( ( color & 0x1f ) >> 1 ) >= 0x08 ) |
| 868 | 868 | { |
| 869 | tileinfo-> | |
| 869 | tileinfo->categor | |
| 870 | 870 | } |
| 871 | 871 | else |
| 872 | 872 | { |
| 873 | tileinfo-> | |
| 873 | tileinfo->categor | |
| 874 | 874 | } |
| 875 | 875 | } |
| 876 | 876 |
| r814 | r815 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | tileno = pass_bg_videoram[tile_index] & 0x1fff; |
| 20 | 20 | 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)); | |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
| r814 | r815 | |
| 59 | 59 | |
| 60 | 60 | VIDEO_START( pass ) |
| 61 | 61 | { |
| 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); | |
| 64 | 64 | |
| 65 | 65 | tilemap_set_transparent_pen(pass_fg_tilemap,255); |
| 66 | 66 | } |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | 0, |
| 59 | 59 | tile, |
| 60 | 60 | color, |
| 61 | 0) | |
| 61 | 0); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | static TILE_GET_INFO( get_back_tile_info ) |
| r814 | r815 | |
| 72 | 72 | 2, |
| 73 | 73 | tile, |
| 74 | 74 | color, |
| 75 | 0) | |
| 75 | 0); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static TILE_GET_INFO( get_fore_tile_info ) |
| r814 | r815 | |
| 86 | 86 | 3, |
| 87 | 87 | tile, |
| 88 | 88 | color, |
| 89 | 0) | |
| 89 | 0); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| r814 | r815 | |
| 98 | 98 | |
| 99 | 99 | VIDEO_START( toki ) |
| 100 | 100 | { |
| 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); | |
| 104 | 104 | |
| 105 | 105 | tilemap_set_transparent_pen(text_layer,15); |
| 106 | 106 | tilemap_set_transparent_pen(background_layer,15); |
| r814 | r815 | |
| 287 | 287 | flip_screen_set((toki_scrollram16[0x28]&0x8000)==0); |
| 288 | 288 | |
| 289 | 289 | if (toki_scrollram16[0x28]&0x100) { |
| 290 | tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_ | |
| 290 | tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_D | |
| 291 | 291 | tilemap_draw(bitmap,cliprect,foreground_layer,0,0); |
| 292 | 292 | } else { |
| 293 | tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_ | |
| 293 | tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_D | |
| 294 | 294 | tilemap_draw(bitmap,cliprect,background_layer,0,0); |
| 295 | 295 | } |
| 296 | 296 | toki_draw_sprites(machine, bitmap,cliprect); |
| r814 | r815 | |
| 308 | 308 | tilemap_set_scrollx( foreground_layer, 0, toki_scrollram16[3]-0x101 ); |
| 309 | 309 | |
| 310 | 310 | if (toki_scrollram16[3]&0x2000) { |
| 311 | tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_ | |
| 311 | tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_D | |
| 312 | 312 | tilemap_draw(bitmap,cliprect,foreground_layer,0,0); |
| 313 | 313 | } else { |
| 314 | tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_ | |
| 314 | tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_D | |
| 315 | 315 | tilemap_draw(bitmap,cliprect,background_layer,0,0); |
| 316 | 316 | } |
| 317 | 317 |
| r814 | r815 | |
|---|---|---|
| 93 | 93 | SET_TILE_INFO( 0, |
| 94 | 94 | code, |
| 95 | 95 | tile_attrib & 0x07, |
| 96 | 0) | |
| 96 | 0); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /*************************************************************************** |
| r814 | r815 | |
| 110 | 110 | pixel_bitmap1 = auto_bitmap_alloc(256,256,machine->screen[0].format); |
| 111 | 111 | pixel_bitmap2 = auto_bitmap_alloc(256,256,machine->screen[0].format); |
| 112 | 112 | |
| 113 | background = tilemap_create(get_bg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_ | |
| 113 | background = tilemap_create(get_bg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_ | |
| 114 | 114 | |
| 115 | 115 | tilemap_set_scroll_rows(background,32); |
| 116 | 116 | tilemap_set_transparent_pen(background,0); |
| r814 | r815 | |
|---|---|---|
| 48 | 48 | 1 + (attributes & 0x7), |
| 49 | 49 | source[0], |
| 50 | 50 | attributes >> 5, |
| 51 | 0) | |
| 51 | 0); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static TILE_GET_INFO( get_fg_tilemap_info ) |
| r814 | r815 | |
| 59 | 59 | 0, |
| 60 | 60 | (attributes & 3) * 256 + source[0], |
| 61 | 61 | attributes >> 6, |
| 62 | 0) | |
| 62 | 0); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static void all_tiles_dirty(void) |
| r814 | r815 | |
| 70 | 70 | |
| 71 | 71 | VIDEO_START( renegade ) |
| 72 | 72 | { |
| 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); | |
| 75 | 75 | |
| 76 | 76 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 77 | 77 | tilemap_set_scrolldx(bg_tilemap, 256, 0); |
| r814 | r815 | |
|---|---|---|
| 395 | 395 | ***************************************************************************/ |
| 396 | 396 | |
| 397 | 397 | /* convert from 32x32 to 36x28 */ |
| 398 | static | |
| 398 | static | |
| 399 | 399 | { |
| 400 | 400 | int offs; |
| 401 | 401 | |
| r814 | r815 | |
| 421 | 421 | 0, |
| 422 | 422 | (galaga_videoram[tile_index] & 0x7f) | (flip_screen ? 0x80 : 0) | (galaga_gfxbank << 8), |
| 423 | 423 | galaga_videoram[tile_index + 0x400] & 0x3f, |
| 424 | flip_screen ? TILE_FLIPX : 0) | |
| 424 | flip_screen ? TILE_FLIPX : 0); | |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | |
| r814 | r815 | |
| 434 | 434 | |
| 435 | 435 | VIDEO_START( galaga ) |
| 436 | 436 | { |
| 437 | tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 437 | tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 438 | 438 | |
| 439 | 439 | tilemap_set_transparent_pen(tx_tilemap, 0x1f); |
| 440 | 440 |
| r814 | r815 | |
|---|---|---|
| 111 | 111 | SET_TILE_INFO(0, |
| 112 | 112 | code + ((UINT16)gfxbank << 8), |
| 113 | 113 | color & 0x0f, |
| 114 | 0) | |
| 114 | 0); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | static TILE_GET_INFO( wwjgtin_get_track_tile_info ) |
| r814 | r815 | |
| 122 | 122 | SET_TILE_INFO(2, |
| 123 | 123 | code, |
| 124 | 124 | color & 0x0f, |
| 125 | 0) | |
| 125 | 0); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | static TILE_GET_INFO( pinbo_get_bg_tile_info ) |
| r814 | r815 | |
| 132 | 132 | SET_TILE_INFO(0, |
| 133 | 133 | code + ((color & 0x30) << 4), |
| 134 | 134 | color & 0x0f, |
| 135 | 0) | |
| 135 | 0); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| r814 | r815 | |
| 145 | 145 | VIDEO_START( lasso ) |
| 146 | 146 | { |
| 147 | 147 | /* create tilemap */ |
| 148 | bg_tilemap = tilemap_create(lasso_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 148 | bg_tilemap = tilemap_create(lasso_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 149 | 149 | |
| 150 | 150 | /* register for saving */ |
| 151 | 151 | state_save_register_global(gfxbank); |
| r814 | r815 | |
| 154 | 154 | VIDEO_START( wwjgtin ) |
| 155 | 155 | { |
| 156 | 156 | /* 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); | |
| 159 | 159 | |
| 160 | 160 | tilemap_set_transparent_pen(bg_tilemap,0); |
| 161 | 161 | |
| r814 | r815 | |
| 167 | 167 | VIDEO_START( pinbo ) |
| 168 | 168 | { |
| 169 | 169 | /* create tilemap */ |
| 170 | bg_tilemap = tilemap_create(pinbo_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 170 | bg_tilemap = tilemap_create(pinbo_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 171 | 171 | |
| 172 | 172 | /* register for saving */ |
| 173 | 173 | state_save_register_global(gfxbank); |
| r814 | r815 | |
|---|---|---|
| 251 | 251 | int color = attr & 0x0f; |
| 252 | 252 | int flags = ((attr & 0x10) ? TILE_FLIPX : 0) + ((attr & 0x20) ? TILE_FLIPY : 0); |
| 253 | 253 | |
| 254 | SET_TILE_INFO(1, code, color, flags) | |
| 254 | SET_TILE_INFO(1, code, color, flags); | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 262 | 262 | int color = attr & 0x0f; |
| 263 | 263 | int flags = ((attr & 0x10) ? TILE_FLIPX : 0) + ((attr & 0x20) ? TILE_FLIPY : 0); |
| 264 | 264 | |
| 265 | SET_TILE_INFO(2, code, color, flags) | |
| 265 | SET_TILE_INFO(2, code, color, flags); | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | VIDEO_START( psychic5 ) |
| r814 | r815 | |
| 282 | 282 | memset(jal_blend_table,0,0xc00) ; |
| 283 | 283 | |
| 284 | 284 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 285 | TILEMAP_TYPE_ | |
| 285 | TILEMAP_TYPE_ | |
| 286 | 286 | |
| 287 | 287 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 288 | TILEMAP_TYPE_ | |
| 288 | TILEMAP_TYPE_ | |
| 289 | 289 | |
| 290 | 290 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| 291 | 291 | } |
| r814 | r815 | |
|---|---|---|
| 431 | 431 | |
| 432 | 432 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 433 | 433 | |
| 434 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_ | |
| 434 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_D | |
| 435 | 435 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,1,0,0); |
| 436 | 436 | syvalion_draw_sprites (bitmap,cliprect); |
| 437 | 437 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,2,0,0); |
| r814 | r815 | |
| 451 | 451 | |
| 452 | 452 | #ifdef MAME_DEBUG |
| 453 | 453 | if ( !input_code_pressed(KEYCODE_A) ) |
| 454 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_ | |
| 454 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_D | |
| 455 | 455 | if ( !input_code_pressed(KEYCODE_S) ) |
| 456 | 456 | recordbr_draw_sprites(bitmap,cliprect,0); |
| 457 | 457 | if ( !input_code_pressed(KEYCODE_D) ) |
| r814 | r815 | |
| 459 | 459 | if ( !input_code_pressed(KEYCODE_F) ) |
| 460 | 460 | recordbr_draw_sprites(bitmap,cliprect,1); |
| 461 | 461 | #else |
| 462 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_ | |
| 462 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_D | |
| 463 | 463 | recordbr_draw_sprites (bitmap,cliprect,0); |
| 464 | 464 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,1,0,0); |
| 465 | 465 | recordbr_draw_sprites (bitmap,cliprect,1); |
| r814 | r815 | |
| 482 | 482 | |
| 483 | 483 | #ifdef MAME_DEBUG |
| 484 | 484 | if ( !input_code_pressed(KEYCODE_A) ) |
| 485 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_ | |
| 485 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_D | |
| 486 | 486 | if ( !input_code_pressed(KEYCODE_S) ) |
| 487 | 487 | dleague_draw_sprites(bitmap,cliprect,0); |
| 488 | 488 | if ( !input_code_pressed(KEYCODE_D) ) |
| r814 | r815 | |
| 490 | 490 | if ( !input_code_pressed(KEYCODE_F) ) |
| 491 | 491 | dleague_draw_sprites(bitmap,cliprect,1); |
| 492 | 492 | #else |
| 493 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_ | |
| 493 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_D | |
| 494 | 494 | dleague_draw_sprites (bitmap,cliprect,0); |
| 495 | 495 | TC0080VCO_tilemap_draw(machine,bitmap,cliprect,1,0,0); |
| 496 | 496 | dleague_draw_sprites (bitmap,cliprect,1); |
| r814 | r815 | |
|---|---|---|
| 247 | 247 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 248 | 248 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 249 | 249 | |
| 250 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 250 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 251 | 251 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2); |
| 252 | 252 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4); |
| 253 | 253 |
| r814 | r815 | |
|---|---|---|
| 89 | 89 | BG_GFX, |
| 90 | 90 | code, |
| 91 | 91 | code >> 12, |
| 92 | 0) | |
| 92 | 0); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
| r814 | r815 | |
| 106 | 106 | FG_GFX, |
| 107 | 107 | code, |
| 108 | 108 | code >> 12, |
| 109 | 0) | |
| 109 | 0); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | WRITE16_HANDLER( ginganin_fgram16_w ) |
| r814 | r815 | |
| 129 | 129 | TXT_GFX, |
| 130 | 130 | code, |
| 131 | 131 | code >> 12, |
| 132 | 0) | |
| 132 | 0); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | WRITE16_HANDLER( ginganin_txtram16_w ) |
| r814 | r815 | |
| 141 | 141 | |
| 142 | 142 | VIDEO_START( ginganin ) |
| 143 | 143 | { |
| 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); | |
| 147 | 147 | |
| 148 | 148 | tilemap_set_transparent_pen(fg_tilemap,15); |
| 149 | 149 | tilemap_set_transparent_pen(tx_tilemap,15); |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | 0, |
| 29 | 29 | (code & 0x1fff) + (charbank << 13), |
| 30 | 30 | ((code & 0xe000) >> 13) + charpalette * 16, |
| 31 | 0) | |
| 31 | 0); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| r814 | r815 | |
| 52 | 52 | |
| 53 | 53 | VIDEO_START( tail2nos ) |
| 54 | 54 | { |
| 55 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 55 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 56 | 56 | |
| 57 | K051316_vh_start_0(machine,REGION_GFX3,4,T | |
| 57 | K051316_vh_start_0(machine,REGION_GFX3,4,TR | |
| 58 | 58 | |
| 59 | 59 | dirtychar = auto_malloc(TOTAL_CHARS); |
| 60 | 60 | memset(dirtychar,1,TOTAL_CHARS); |
| r814 | r815 | |
|---|---|---|
| 87 | 87 | int color = colorram[tile_index] & 0x1f; |
| 88 | 88 | int flags = ((colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x80) ? TILE_FLIPY : 0); |
| 89 | 89 | |
| 90 | SET_TILE_INFO(0, code, color, flags) | |
| 90 | SET_TILE_INFO(0, code, color, flags); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | VIDEO_START( mrjong ) |
| 94 | 94 | { |
| 95 | 95 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy, |
| 96 | TILEMAP_TYPE_ | |
| 96 | TILEMAP_TYPE_ | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | |
| 43 | 43 | tileno = (xyonix_vidram[tile_index+1] << 0) | ((attr & 0x0f) << 8); |
| 44 | 44 | |
| 45 | SET_TILE_INFO(0,tileno,attr >> 4,0) | |
| 45 | SET_TILE_INFO(0,tileno,attr >> 4,0); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | WRITE8_HANDLER( xyonix_vidram_w ) |
| r814 | r815 | |
| 53 | 53 | |
| 54 | 54 | VIDEO_START(xyonix) |
| 55 | 55 | { |
| 56 | xyonix_tilemap = tilemap_create(get_xyonix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 56 | xyonix_tilemap = tilemap_create(get_xyonix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | VIDEO_UPDATE(xyonix) |
| r814 | r815 | |
|---|---|---|
| 152 | 152 | int color = (attr & 0x3c) >> 2; |
| 153 | 153 | int flags = TILE_FLIPYX((attr & 0xc0) >> 6); |
| 154 | 154 | |
| 155 | SET_TILE_INFO(2, code, color, flags) | |
| 155 | SET_TILE_INFO(2, code, color, flags); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | static TILE_GET_INFO( c1943_get_bg_tile_info ) |
| r814 | r815 | |
| 165 | 165 | int color = (attr & 0x3c) >> 2; |
| 166 | 166 | int flags = TILE_FLIPYX((attr & 0xc0) >> 6); |
| 167 | 167 | |
| 168 | SET_TILE_INFO(1, code, color, flags) | |
| 168 | SET_TILE_INFO(1, code, color, flags); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static TILE_GET_INFO( c1943_get_fg_tile_info ) |
| r814 | r815 | |
| 174 | 174 | int code = videoram[tile_index] + ((attr & 0xe0) << 3); |
| 175 | 175 | int color = attr & 0x1f; |
| 176 | 176 | |
| 177 | SET_TILE_INFO(0, code, color, 0) | |
| 177 | SET_TILE_INFO(0, code, color, 0); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | VIDEO_START( 1943 ) |
| 181 | 181 | { |
| 182 | 182 | bg2_tilemap = tilemap_create(c1943_get_bg2_tile_info, tilemap_scan_cols, |
| 183 | TILEMAP_TYPE_ | |
| 183 | TILEMAP_TYPE_ | |
| 184 | 184 | |
| 185 | 185 | bg_tilemap = tilemap_create(c1943_get_bg_tile_info, tilemap_scan_cols, |
| 186 | TILEMAP_TYPE_ | |
| 186 | TILEMAP_TYPE_ | |
| 187 | 187 | |
| 188 | 188 | fg_tilemap = tilemap_create(c1943_get_fg_tile_info, tilemap_scan_rows, |
| 189 | TILEMAP_TYPE_ | |
| 189 | TILEMAP_TYPE_ | |
| 190 | 190 | |
| 191 | 191 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 192 | 192 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| r814 | r815 | |
|---|---|---|
| 142 | 142 | int color = ((attr & 0x3e) >> 1) + ((code & 0x1c0) >> 1); |
| 143 | 143 | int flags = TILE_FLIPYX(attr >> 6); |
| 144 | 144 | |
| 145 | SET_TILE_INFO(1, code, color, flags) | |
| 145 | SET_TILE_INFO(1, code, color, flags); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 153 | 153 | int color = ((attr & 0x1e) >> 1) + ((code & 0x1e0) >> 1); |
| 154 | 154 | int flags = TILE_FLIPYX(attr >> 6); |
| 155 | 155 | |
| 156 | tileinfo-> | |
| 156 | tileinfo->categor | |
| 157 | 157 | |
| 158 | SET_TILE_INFO(0, code, color, flags) | |
| 158 | SET_TILE_INFO(0, code, color, flags); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| r814 | r815 | |
| 171 | 171 | fg_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 172 | 172 | sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 173 | 173 | |
| 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); | |
| 176 | 176 | |
| 177 | 177 | tilemap_set_scroll_rows(fg_tilemap, 32); |
| 178 | 178 | tilemap_set_transparent_pen(fg_tilemap, 0xff); |
| r814 | r815 | |
|---|---|---|
| 404 | 404 | /* Draw playfields */ |
| 405 | 405 | fillbitmap(priority_bitmap,0,cliprect); |
| 406 | 406 | fillbitmap(bitmap,machine->pens[512],cliprect); |
| 407 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 407 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 408 | 408 | 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); | |
| 411 | 411 | cninja_draw_sprites(machine,bitmap,cliprect); |
| 412 | 412 | deco16_tilemap_1_draw(bitmap,cliprect,0,0); |
| 413 | 413 | return 0; |
| r814 | r815 | |
| 421 | 421 | |
| 422 | 422 | fillbitmap(priority_bitmap,0,cliprect); |
| 423 | 423 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 424 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 424 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 425 | 425 | if (deco16_raster_display_position) |
| 426 | 426 | raster_pf3_draw(bitmap,cliprect,0,2); |
| 427 | 427 | else |
| r814 | r815 | |
| 454 | 454 | fillbitmap(priority_bitmap,0,cliprect); |
| 455 | 455 | fillbitmap(bitmap,machine->pens[0x200],cliprect); |
| 456 | 456 | if ((deco16_priority&4)==0) |
| 457 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 457 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 458 | 458 | |
| 459 | 459 | /* Switchable priority */ |
| 460 | 460 | switch (deco16_priority&0x8) { |
| r814 | r815 | |
| 500 | 500 | The other bits may control alpha blend on the 2nd sprite chip, or |
| 501 | 501 | layer order. |
| 502 | 502 | */ |
| 503 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 503 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 504 | 504 | deco16_tilemap_2_draw(bitmap,cliprect,0,0); |
| 505 | 505 | deco16_tilemap_3_draw(bitmap,cliprect,0,0); |
| 506 | 506 |
| r814 | r815 | |
|---|---|---|
| 76 | 76 | 1, |
| 77 | 77 | videoram[tile_index], |
| 78 | 78 | 0, |
| 79 | 0) | |
| 79 | 0); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static TILE_GET_INFO( get_tx_tilemap_info ) |
| r814 | r815 | |
| 86 | 86 | 0, |
| 87 | 87 | tile_number, |
| 88 | 88 | 0, |
| 89 | 0) | |
| 89 | 0); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | VIDEO_START( jcross ) |
| r814 | r815 | |
| 96 | 96 | stuff_palette( machine, 0, 0, 16*8 ); |
| 97 | 97 | stuff_palette( machine, 16*8*3, 16*8, 16*8 ); |
| 98 | 98 | |
| 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); | |
| 101 | 101 | |
| 102 | tilemap_set_transparent_pen(bg_tilemap,0x0f); | |
| 103 | 102 | tilemap_set_transparent_pen(tx_tilemap,0xf); |
| 104 | 103 | tilemap_set_scrolldx( bg_tilemap, 16, 22 ); |
| 105 | 104 | } |
| r814 | r815 | |
|---|---|---|
| 103 | 103 | 0, |
| 104 | 104 | tile_number, |
| 105 | 105 | (attr&0xf), |
| 106 | TILE_SPLIT((attr & 0x80)>>7)) | |
| 106 | 0); | |
| 107 | tileinfo->group = (attr & 0x80)>>7; | |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | static TILE_GET_INFO( get_popper_p0_tile_info ) |
| 110 | 111 | { |
| 111 | 112 | UINT32 tile_number = popper_videoram[tile_index]; |
| 112 | 113 | UINT8 attr = popper_attribram[tile_index]; |
| 113 | UINT32 flags = 0; | |
| 114 | 114 | tile_number += popper_gfx_bank << 8; |
| 115 | 115 | |
| 116 | 116 | //pen 0 only in front if colour set as well |
| 117 | if (attr&0x70) | |
| 117 | tileinfo->group = (attr&0x70) ? | |
| 118 | 118 | |
| 119 | 119 | SET_TILE_INFO( |
| 120 | 120 | 0, |
| 121 | 121 | tile_number, |
| 122 | 122 | ((attr&0x70)>>4)+8, |
| 123 | | |
| 123 | 0 | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | static TILE_GET_INFO( get_popper_ol_p123_tile_info ) |
| r814 | r815 | |
| 133 | 133 | 0, |
| 134 | 134 | tile_number, |
| 135 | 135 | (attr&0xf), |
| 136 | TILE_SPLIT((attr & 0x80)>>7)) | |
| 136 | 0); | |
| 137 | tileinfo->group = (attr & 0x80)>>7; | |
| 137 | 138 | } |
| 138 | 139 | |
| 139 | 140 | static TILE_GET_INFO( get_popper_ol_p0_tile_info ) |
| 140 | 141 | { |
| 141 | 142 | UINT32 tile_number = popper_ol_videoram[tile_index]; |
| 142 | 143 | UINT8 attr = popper_ol_attribram[tile_index]; |
| 143 | UINT32 flags = 0; | |
| 144 | 144 | tile_number += popper_gfx_bank << 8; |
| 145 | 145 | |
| 146 | 146 | //pen 0 only in front if colour set as well |
| 147 | if (attr&0x70) | |
| 147 | tileinfo->group = (attr&0x70) ? | |
| 148 | 148 | |
| 149 | 149 | SET_TILE_INFO( |
| 150 | 150 | 0, |
| 151 | 151 | tile_number, |
| 152 | 152 | ((attr&0x70)>>4)+8, |
| 153 | | |
| 153 | 0 | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | VIDEO_START( popper ) |
| 157 | 157 | { |
| 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 ); | |
| 162 | 162 | |
| 163 | 163 | tilemap_set_transmask(popper_p123_tilemap, 0,0x0f,0x01); |
| 164 | 164 | tilemap_set_transmask(popper_p123_tilemap, 1,0x01,0x0f); |
| r814 | r815 | |
| 229 | 229 | //-xxx---- colour for pen 0 (from second prom?) |
| 230 | 230 | //----xxxx colour for pens 1,2,3 |
| 231 | 231 | |
| 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 ); | |
| 236 | 236 | |
| 237 | 237 | draw_sprites(machine, bitmap,cliprect); |
| 238 | 238 | |
| 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 ); | |
| 243 | 243 | return 0; |
| 244 | 244 | } |
| r814 | r815 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | ***************************************************************************/ |
| 76 | 76 | |
| 77 | static | |
| 77 | static | |
| 78 | 78 | { |
| 79 | 79 | /* logical (col,row) -> memory offset */ |
| 80 | 80 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 6); /* skip 0x400 */ |
| r814 | r815 | |
| 89 | 89 | 0, |
| 90 | 90 | num, |
| 91 | 91 | 0, |
| 92 | TILE_FLIPYX((attr & 0x30) >> 4)) | |
| 92 | TILE_FLIPYX((attr & 0x30) >> 4)); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 101 | 101 | 1, |
| 102 | 102 | num, |
| 103 | 103 | 0, |
| 104 | TILE_FLIPYX((attr & 0x30) >> 4)) | |
| 104 | TILE_FLIPYX((attr & 0x30) >> 4)); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /*************************************************************************** |
| r814 | r815 | |
| 112 | 112 | |
| 113 | 113 | VIDEO_START( ddrible ) |
| 114 | 114 | { |
| 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); | |
| 117 | 117 | |
| 118 | 118 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 119 | 119 | } |
| r814 | r815 | |
|---|---|---|
| 34 | 34 | SET_TILE_INFO( |
| 35 | 35 | 0, |
| 36 | 36 | tile +0x1000 * tilebank, |
| 37 | pal,TILE_FLIPY; | |
| 38 | ) | |
| 37 | pal,TILE_FLIPY | |
| 38 | ); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | WRITE8_HANDLER( ladyfrog_videoram_w ) |
| r814 | r815 | |
| 134 | 134 | VIDEO_START( ladyfrog ) |
| 135 | 135 | { |
| 136 | 136 | ladyfrog_spriteram = auto_malloc (160); |
| 137 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 137 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 138 | 138 | |
| 139 | 139 | paletteram = auto_malloc(0x200); |
| 140 | 140 | paletteram_2 = auto_malloc(0x200); |
| r814 | r815 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | VIDEO_START( djboy ) |
| 46 | 46 | { |
| 47 | background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 47 | background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 48 | 48 | pandora_start(0,0,0); |
| 49 | 49 | } |
| 50 | 50 |
| r814 | r815 | |
|---|---|---|
| 110 | 110 | color = attr>>3 & 0x1f; |
| 111 | 111 | flags = attr>>1 & 0x03; |
| 112 | 112 | |
| 113 | SET_TILE_INFO(1, code, color, flags) | |
| 113 | SET_TILE_INFO(1, code, color, flags); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | static TILE_GET_INFO( get_philko_bg_tile_info ) |
| r814 | r815 | |
| 123 | 123 | color = attr>>3 & 0x0f; |
| 124 | 124 | flags = attr>>1 & 0x03; |
| 125 | 125 | |
| 126 | SET_TILE_INFO(1, code, color, flags) | |
| 126 | SET_TILE_INFO(1, code, color, flags); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 132 | 132 | int code = videoram[tile_index] + (attr<<2 & 0x300); |
| 133 | 133 | int color = attr & 0x3f; |
| 134 | 134 | |
| 135 | SET_TILE_INFO(0, code, color, 0) | |
| 135 | SET_TILE_INFO(0, code, color, 0); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | static | |
| 138 | static | |
| 139 | 139 | { |
| 140 | 140 | /* logical (col,row) -> memory offset */ |
| 141 | 141 | int offset = ((row << 7) + col) << 1; |
| r814 | r815 | |
| 151 | 151 | if (!sidearms_gameid) |
| 152 | 152 | { |
| 153 | 153 | bg_tilemap = tilemap_create(get_sidearms_bg_tile_info, sidearms_tilemap_scan, |
| 154 | TILEMAP_TYPE_ | |
| 154 | TILEMAP_TYPE_ | |
| 155 | 155 | |
| 156 | 156 | tilemap_set_transparent_pen(bg_tilemap, 15); |
| 157 | 157 | } |
| 158 | 158 | else |
| 159 | 159 | { |
| 160 | bg_tilemap = tilemap_create(get_philko_bg_tile_info, sidearms_tilemap_scan,TILEMAP_TYPE_ | |
| 160 | bg_tilemap = tilemap_create(get_philko_bg_tile_info, sidearms_tilemap_scan,TILEMAP_TYPE_ | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 164 | TILEMAP_TYPE_ | |
| 164 | TILEMAP_TYPE_ | |
| 165 | 165 | |
| 166 | 166 | tilemap_set_transparent_pen(fg_tilemap, 3); |
| 167 | 167 |
| r814 | r815 | |
|---|---|---|
| 44 | 44 | int code = videoram[tile_index] + ((colorram[tile_index] & 0x18) << 5); |
| 45 | 45 | int color = colorram[tile_index] & 0x07; |
| 46 | 46 | |
| 47 | SET_TILE_INFO(0, code, color, 0) | |
| 47 | SET_TILE_INFO(0, code, color, 0); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static UINT32 tilemap_scan_cols_flipy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ) |
| r814 | r815 | |
| 55 | 55 | |
| 56 | 56 | VIDEO_START( jack ) |
| 57 | 57 | { |
| 58 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_ | |
| 58 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_ | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static void jack_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
| 131 | 131 | int code = videoram[tile_index] + ((colorram[tile_index] & 0x01) << 8); |
| 132 | 132 | int color = (colorram[tile_index] & 0x38) >> 3; |
| 133 | 133 | |
| 134 | SET_TILE_INFO(0, code, color, 0) | |
| 134 | SET_TILE_INFO(0, code, color, 0); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | VIDEO_START( joinem ) |
| 138 | 138 | { |
| 139 | bg_tilemap = tilemap_create(joinem_get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_ | |
| 139 | bg_tilemap = tilemap_create(joinem_get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_ | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | static void joinem_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | fillbitmap(bitmap,machine->pens[256],cliprect); /* not verified */ |
| 94 | 94 | |
| 95 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_ | |
| 95 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_D | |
| 96 | 96 | deco16_tilemap_1_draw(bitmap,cliprect,0,0); |
| 97 | 97 | |
| 98 | 98 | draw_sprites(machine,bitmap,cliprect); |
| r814 | r815 | |
|---|---|---|
| 69 | 69 | 0, |
| 70 | 70 | dogfgt_bgvideoram[tile_index], |
| 71 | 71 | dogfgt_bgvideoram[tile_index + 0x400] & 0x03, |
| 72 | 0) | |
| 72 | 0); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| r814 | r815 | |
| 81 | 81 | |
| 82 | 82 | VIDEO_START( dogfgt ) |
| 83 | 83 | { |
| 84 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 84 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 85 | 85 | |
| 86 | 86 | bitmapram = auto_malloc(BITMAPRAM_SIZE); |
| 87 | 87 |
| r814 | r815 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | fillbitmap(bitmap,machine->pens[256],cliprect); /* not verified */ |
| 87 | 87 | |
| 88 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_ | |
| 88 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_D | |
| 89 | 89 | deco16_tilemap_1_draw(bitmap,cliprect,0,0); |
| 90 | 90 | |
| 91 | 91 | draw_sprites(machine,bitmap,cliprect); |
| r814 | r815 | |
|---|---|---|
| 173 | 173 | int code = (tile_index / 16) ? videoram[tile_index] + ((attr & 0x03) << 8) : 0; |
| 174 | 174 | int color = ((attr & 0x70) >> 4) + 8 * palette_bank; |
| 175 | 175 | |
| 176 | SET_TILE_INFO(bank, code, color, 0) | |
| 176 | SET_TILE_INFO(bank, code, color, 0); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 183 | 183 | int code = kingofb_videoram2[tile_index] + ((attr & 0x01) << 8); |
| 184 | 184 | int color = (attr & 0x38) >> 3; |
| 185 | 185 | |
| 186 | SET_TILE_INFO(bank, code, color, 0) | |
| 186 | SET_TILE_INFO(bank, code, color, 0); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | VIDEO_START( kingofb ) |
| 190 | 190 | { |
| 191 | 191 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y, |
| 192 | TILEMAP_TYPE_ | |
| 192 | TILEMAP_TYPE_ | |
| 193 | 193 | |
| 194 | 194 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_y, |
| 195 | TILEMAP_TYPE_ | |
| 195 | TILEMAP_TYPE_ | |
| 196 | 196 | |
| 197 | 197 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 198 | 198 | } |
| r814 | r815 | |
| 243 | 243 | int code = (tile_index / 16) ? videoram[tile_index] : 0; |
| 244 | 244 | int color = ((colorram[tile_index] & 0x70) >> 4) + 8 * palette_bank; |
| 245 | 245 | |
| 246 | SET_TILE_INFO(4, code, color, 0) | |
| 246 | SET_TILE_INFO(4, code, color, 0); | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | VIDEO_START( ringking ) |
| 250 | 250 | { |
| 251 | 251 | bg_tilemap = tilemap_create(ringking_get_bg_tile_info, tilemap_scan_cols_flip_y, |
| 252 | TILEMAP_TYPE_ | |
| 252 | TILEMAP_TYPE_ | |
| 253 | 253 | |
| 254 | 254 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_y, |
| 255 | TILEMAP_TYPE_ | |
| 255 | TILEMAP_TYPE_ | |
| 256 | 256 | |
| 257 | 257 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 258 | 258 | } |
| r814 | r815 | |
|---|---|---|
| 151 | 151 | 1, |
| 152 | 152 | code, |
| 153 | 153 | (attr & 0x78) >> 3, /* seems correct */ |
| 154 | 0) | |
| 154 | 0); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 162 | 162 | 0, |
| 163 | 163 | code, |
| 164 | 164 | (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 */ | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | static TILE_GET_INFO( ninjemak_get_bg_tile_info ) |
| r814 | r815 | |
| 175 | 175 | 1, |
| 176 | 176 | code, |
| 177 | 177 | ((attr & 0x60) >> 3) | ((attr & 0x0c) >> 2), /* seems correct */ |
| 178 | 0) | |
| 178 | 0); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | static TILE_GET_INFO( ninjemak_get_tx_tile_info ) |
| r814 | r815 | |
| 186 | 186 | 0, |
| 187 | 187 | code, |
| 188 | 188 | (attr & 0x1c) >> 2, /* seems correct ? */ |
| 189 | 0) | |
| 189 | 0); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
| r814 | r815 | |
| 203 | 203 | UINT8 *rombase = memory_region(REGION_CPU1); |
| 204 | 204 | memory_configure_bank(1, 0, 2, &rombase[0x10000], 0x2000); |
| 205 | 205 | |
| 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); | |
| 208 | 208 | |
| 209 | 209 | tilemap_set_transparent_pen(tx_tilemap,15); |
| 210 | 210 | |
| r814 | r815 | |
| 222 | 222 | UINT8 *rombase = memory_region(REGION_CPU1); |
| 223 | 223 | memory_configure_bank(1, 0, 4, &rombase[0x10000], 0x2000); |
| 224 | 224 | |
| 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); | |
| 227 | 227 | |
| 228 | 228 | tilemap_set_transparent_pen(tx_tilemap,15); |
| 229 | 229 |
| r814 | r815 | |
|---|---|---|
| 31 | 31 | 0, |
| 32 | 32 | tile_number, |
| 33 | 33 | attributes & 0x1f, |
| 34 | 0) | |
| 34 | 0); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 43 | 43 | 1, |
| 44 | 44 | tile_number, |
| 45 | 45 | colorram[((tile_index&0x1f)*2)+1] & 0x1f, |
| 46 | 0) | |
| 46 | 0); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| r814 | r815 | |
| 55 | 55 | |
| 56 | 56 | VIDEO_START( tsamurai ) |
| 57 | 57 | { |
| 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); | |
| 60 | 60 | |
| 61 | 61 | tilemap_set_transparent_pen(background,0); |
| 62 | 62 | tilemap_set_transparent_pen(foreground,0); |
| r814 | r815 | |
| 250 | 250 | 1, |
| 251 | 251 | tile_number, |
| 252 | 252 | color, |
| 253 | 0) | |
| 253 | 0); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | VIDEO_START( vsgongf ) |
| 257 | 257 | { |
| 258 | foreground = tilemap_create(get_vsgongf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 258 | foreground = tilemap_create(get_vsgongf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | VIDEO_UPDATE( vsgongf ) |
| r814 | r815 | |
|---|---|---|
| 23 | 23 | { |
| 24 | 24 | UINT8 code = canyon_videoram[tile_index]; |
| 25 | 25 | |
| 26 | SET_TILE_INFO(0, code & 0x3f, code >> 7, 0) | |
| 26 | SET_TILE_INFO(0, code & 0x3f, code >> 7, 0); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | VIDEO_START( canyon ) |
| 31 | 31 | { |
| 32 | 32 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 33 | TILEMAP_TYPE_ | |
| 33 | TILEMAP_TYPE_ | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 |
| r814 | r815 | |
|---|---|---|
| 56 | 56 | 0, |
| 57 | 57 | code + ((0x20 + (attr & 0x0f)) << 8), |
| 58 | 58 | (attr & 0xf0) >> 4, |
| 59 | 0) | |
| 59 | 0); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static TILE_GET_INFO( get_tile_info_splash_tilemap1 ) |
| r814 | r815 | |
| 69 | 69 | 1, |
| 70 | 70 | (code >> 2) + ((0x30 + (attr & 0x0f)) << 6), |
| 71 | 71 | (attr & 0xf0) >> 4, |
| 72 | TILE_FLIPXY(code & 0x03)) | |
| 72 | TILE_FLIPXY(code & 0x03)); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /*************************************************************************** |
| r814 | r815 | |
| 177 | 177 | |
| 178 | 178 | VIDEO_START( splash ) |
| 179 | 179 | { |
| 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); | |
| 182 | 182 | |
| 183 | 183 | tilemap_set_transparent_pen(bg_tilemap[0],0); |
| 184 | 184 | tilemap_set_transparent_pen(bg_tilemap[1],0); |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | { |
| 29 | 29 | int code = f1gp_rozvideoram[tile_index]; |
| 30 | 30 | |
| 31 | SET_TILE_INFO(3,code & 0x7ff,code >> 12,0) | |
| 31 | SET_TILE_INFO(3,code & 0x7ff,code >> 12,0); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | static TILE_GET_INFO( f1gp2_get_roz_tile_info ) |
| 35 | 35 | { |
| 36 | 36 | int code = f1gp_rozvideoram[tile_index]; |
| 37 | 37 | |
| 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); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static TILE_GET_INFO( get_fg_tile_info ) |
| 42 | 42 | { |
| 43 | 43 | int code = f1gp_fgvideoram[tile_index]; |
| 44 | 44 | |
| 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); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| r814 | r815 | |
| 54 | 54 | |
| 55 | 55 | VIDEO_START( f1gp ) |
| 56 | 56 | { |
| 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); | |
| 59 | 59 | |
| 60 | 60 | K053936_wraparound_enable(0, 1); |
| 61 | 61 | K053936_set_offset(0, -58, -2); |
| r814 | r815 | |
| 70 | 70 | |
| 71 | 71 | VIDEO_START( f1gp2 ) |
| 72 | 72 | { |
| 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); | |
| 75 | 75 | |
| 76 | 76 | K053936_wraparound_enable(0, 1); |
| 77 | 77 | K053936_set_offset(0, -48, -21); |
| r814 | r815 | |
| 395 | 395 | switch (gfxctrl & 3) |
| 396 | 396 | { |
| 397 | 397 | case 0: |
| 398 | K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_ | |
| 398 | K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_D | |
| 399 | 399 | f1gp2_draw_sprites(machine,bitmap,cliprect); |
| 400 | 400 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); |
| 401 | 401 | break; |
| 402 | 402 | case 1: |
| 403 | K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_ | |
| 403 | K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_D | |
| 404 | 404 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); |
| 405 | 405 | f1gp2_draw_sprites(machine,bitmap,cliprect); |
| 406 | 406 | break; |
| 407 | 407 | case 2: |
| 408 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_ | |
| 408 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_D | |
| 409 | 409 | K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,0,0); |
| 410 | 410 | f1gp2_draw_sprites(machine,bitmap,cliprect); |
| 411 | 411 | break; |
| r814 | r815 | |
|---|---|---|
| 99 | 99 | int color = attr & 0x0f; |
| 100 | 100 | int flags = (attr & 0x40) ? TILE_FLIPX : 0; |
| 101 | 101 | |
| 102 | SET_TILE_INFO(0, code, color, flags) | |
| 102 | SET_TILE_INFO(0, code, color, flags); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | VIDEO_START( lvcards ) |
| 106 | 106 | { |
| 107 | 107 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 108 | TILEMAP_TYPE_ | |
| 108 | TILEMAP_TYPE_ | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | VIDEO_UPDATE( lvcards ) |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | static TILE_GET_INFO( get_tile_info_roz ) |
| 59 | 59 | { |
| 60 | 60 | 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); | |
| 62 | 62 | } /* get_tile_info_roz */ |
| 63 | 63 | |
| 64 | 64 | struct RozParam |
| r814 | r815 | |
| 83 | 83 | { |
| 84 | 84 | UINT32 size_mask = rozInfo->size-1; |
| 85 | 85 | mame_bitmap *srcbitmap = tilemap_get_pixmap( tmap ); |
| 86 | mame_bitmap * | |
| 86 | mame_bitmap *flags | |
| 87 | 87 | UINT32 startx = rozInfo->startx + clip->min_x * rozInfo->incxx + clip->min_y * rozInfo->incyx; |
| 88 | 88 | UINT32 starty = rozInfo->starty + clip->min_x * rozInfo->incxy + clip->min_y * rozInfo->incyy; |
| 89 | 89 | int sx = clip->min_x; |
| r814 | r815 | |
| 108 | 108 | goto L_SkipPixel; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | if( *BITMAP_ADDR8( | |
| 111 | if( *BITMAP_ADDR8(flags | |
| 112 | 112 | { |
| 113 | 113 | *dest = *BITMAP_ADDR16(srcbitmap, ypos, xpos)+rozInfo->color; |
| 114 | 114 | } |
| r814 | r815 | |
| 322 | 322 | VIDEO_START( namcos2 ) |
| 323 | 323 | { |
| 324 | 324 | namco_tilemap_init(2,memory_region(REGION_GFX4),TilemapCB); |
| 325 | tilemap_roz = tilemap_create(get_tile_info_roz,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 325 | tilemap_roz = tilemap_create(get_tile_info_roz,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 326 | 326 | tilemap_set_transparent_pen(tilemap_roz,0xff); |
| 327 | 327 | DrawSpriteInit(); |
| 328 | 328 | } |
| r814 | r815 | |
|---|---|---|
| 43 | 43 | lower = (tx1_vram[tile_index]<<3); |
| 44 | 44 | tileno = (bit15 | upper | lower)/8; |
| 45 | 45 | |
| 46 | SET_TILE_INFO(0,tileno,0,0) | |
| 46 | SET_TILE_INFO(0,tileno,0,0); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | VIDEO_START( tx1 ) |
| 50 | 50 | { |
| 51 | tx1_tilemap = tilemap_create(get_tx1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 51 | tx1_tilemap = tilemap_create(get_tx1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 52 | 52 | tilemap_set_transparent_pen(tx1_tilemap,0xff); |
| 53 | 53 | } |
| 54 | 54 | |
| r814 | r815 | |
| 199 | 199 | lower = (buggyboy_vram[tile_index]<<3); |
| 200 | 200 | tileno = (bit15 | upper | lower)/8; |
| 201 | 201 | |
| 202 | SET_TILE_INFO(0,tileno,color,0) | |
| 202 | SET_TILE_INFO(0,tileno,color,0); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
| r814 | r815 | |
| 344 | 344 | |
| 345 | 345 | VIDEO_START( buggyb1 ) |
| 346 | 346 | { |
| 347 | buggyb1_tilemap = tilemap_create(get_buggyb1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 347 | buggyb1_tilemap = tilemap_create(get_buggyb1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 348 | 348 | tilemap_set_transparent_pen(buggyb1_tilemap, 0); |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | |
| 352 | 352 | VIDEO_START( buggyboy ) |
| 353 | 353 | { |
| 354 | buggyboy_tilemap = tilemap_create(get_buggyboy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 354 | buggyboy_tilemap = tilemap_create(get_buggyboy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 355 | 355 | tilemap_set_transparent_pen(buggyboy_tilemap, 0); |
| 356 | 356 | } |
| 357 | 357 | |
| r814 | r815 | |
| 393 | 393 | } |
| 394 | 394 | else |
| 395 | 395 | { |
| 396 | tilemap_draw(bitmap,cliprect,buggyb1_tilemap,TILEMAP_ | |
| 396 | tilemap_draw(bitmap,cliprect,buggyb1_tilemap,TILEMAP_D | |
| 397 | 397 | draw_objects(machine, bitmap,cliprect,0); |
| 398 | 398 | } |
| 399 | 399 | return 0; |
| r814 | r815 | |
| 413 | 413 | } |
| 414 | 414 | else |
| 415 | 415 | { |
| 416 | tilemap_draw(bitmap,cliprect,buggyboy_tilemap,TILEMAP_ | |
| 416 | tilemap_draw(bitmap,cliprect,buggyboy_tilemap,TILEMAP_D | |
| 417 | 417 | draw_objects(machine, bitmap,cliprect,xscrollamount); |
| 418 | 418 | } |
| 419 | 419 | return 0; |
| r814 | r815 | |
|---|---|---|
| 173 | 173 | deco16_clear_sprite_priority_bitmap(); |
| 174 | 174 | fillbitmap(priority_bitmap,0,cliprect); |
| 175 | 175 | fillbitmap(bitmap,machine->pens[3072],cliprect); |
| 176 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 176 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 177 | 177 | |
| 178 | 178 | /* The middle playfields can be swapped priority-wise */ |
| 179 | 179 | if ((deco16_priority&3)==0) { |
| r814 | r815 | |
|---|---|---|
| 113 | 113 | int color = attr & 0x1f; |
| 114 | 114 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 115 | 115 | |
| 116 | SET_TILE_INFO(0, code, color, flags) | |
| 116 | SET_TILE_INFO(0, code, color, flags); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | VIDEO_START( pingpong ) |
| 120 | 120 | { |
| 121 | 121 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 122 | TILEMAP_TYPE_ | |
| 122 | TILEMAP_TYPE_ | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | 0, |
| 25 | 25 | code&1023, |
| 26 | 26 | (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) ); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /* tilemap 2 */ |
| r814 | r815 | |
| 48 | 48 | 0, |
| 49 | 49 | code&1023, |
| 50 | 50 | ((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) ); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /* tilemap 4 */ |
| r814 | r815 | |
| 72 | 72 | 0, |
| 73 | 73 | code&1023, |
| 74 | 74 | ((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) ); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| r814 | r815 | |
| 232 | 232 | |
| 233 | 233 | VIDEO_START( ssrj ) |
| 234 | 234 | { |
| 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 ); | |
| 238 | 238 | tilemap_set_transparent_pen(tilemap2,0); |
| 239 | 239 | tilemap_set_transparent_pen(tilemap4,0); |
| 240 | 240 | } |
| r814 | r815 | |
|---|---|---|
| 82 | 82 | }; |
| 83 | 83 | |
| 84 | 84 | /* initialize the playfield */ |
| 85 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 85 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 86 | 86 | |
| 87 | 87 | /* initialize the motion objects */ |
| 88 | 88 | atarimo_init(machine, 0, &modesc); |
| r814 | r815 | |
|---|---|---|
| 98 | 98 | int code = videoram[tile_index]; |
| 99 | 99 | int color = colorram[tile_index] & 0x0f; |
| 100 | 100 | |
| 101 | SET_TILE_INFO(0, code, color, 0) | |
| 101 | SET_TILE_INFO(0, code, color, 0); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | ||
| 104 | static TILEMAP_MAPPER( tilemap_scan_rows_thehand | |
| 105 | 105 | { |
| 106 | 106 | /* logical (col,row) -> memory offset */ |
| 107 | 107 | row = 31-row; |
| r814 | r815 | |
| 112 | 112 | VIDEO_START( gotya ) |
| 113 | 113 | { |
| 114 | 114 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_thehand, |
| 115 | TILEMAP_TYPE_ | |
| 115 | TILEMAP_TYPE_ | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static void draw_status_row(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int sx, int col) |
| r814 | r815 | |
|---|---|---|
| 169 | 169 | 1, |
| 170 | 170 | tile, |
| 171 | 171 | color, |
| 172 | 0) | |
| 172 | 0); | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | static TILE_GET_INFO( get_bg_tile_info_cyclwarr ) |
| r814 | r815 | |
| 183 | 183 | 1, |
| 184 | 184 | tile, |
| 185 | 185 | color, |
| 186 | 0) | |
| 186 | 0); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | static TILE_GET_INFO( get_text_tile_info_cyclwarr ) |
| r814 | r815 | |
| 197 | 197 | 1, |
| 198 | 198 | tile, |
| 199 | 199 | color, |
| 200 | 0) | |
| 200 | 0); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /********************************************************************/ |
| 204 | 204 | |
| 205 | 205 | VIDEO_START( apache3 ) |
| 206 | 206 | { |
| 207 | tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 207 | tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 208 | 208 | shadow_pen_array = auto_malloc(8192); |
| 209 | 209 | temp_bitmap = auto_bitmap_alloc(512, 512, BITMAP_FORMAT_RGB32); |
| 210 | 210 | |
| r814 | r815 | |
| 214 | 214 | |
| 215 | 215 | VIDEO_START( roundup5 ) |
| 216 | 216 | { |
| 217 | tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 217 | tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 218 | 218 | shadow_pen_array = auto_malloc(8192); |
| 219 | 219 | roundup5_vram = auto_malloc(0x48000 * 4); |
| 220 | 220 | |
| r814 | r815 | |
| 224 | 224 | |
| 225 | 225 | VIDEO_START( cyclwarr ) |
| 226 | 226 | { |
| 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); | |
| 229 | 229 | shadow_pen_array = auto_malloc(8192); |
| 230 | 230 | |
| 231 | 231 | memset(shadow_pen_array, 0, 8192); |
| r814 | r815 | |
|---|---|---|
| 1467 | 1467 | color RAM ----xxxx depends on external connections (usually color and banking) |
| 1468 | 1468 | */ |
| 1469 | 1469 | |
| 1470 | static | |
| 1470 | static | |
| 1471 | 1471 | { |
| 1472 | 1472 | /* logical (col,row) -> memory offset */ |
| 1473 | 1473 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5); |
| r814 | r815 | |
| 1481 | 1481 | code = vram[tile_index]; |
| 1482 | 1482 | flags = TILE_FLIPYX((color & 0x30) >> 4); |
| 1483 | 1483 | |
| 1484 | tileinfo-> | |
| 1484 | tileinfo->categor | |
| 1485 | 1485 | |
| 1486 | 1486 | (*K007342_callback)(layer, K007342_regs[1], &code, &color, &flags); |
| 1487 | 1487 | |
| r814 | r815 | |
| 1489 | 1489 | K007342_gfxnum, |
| 1490 | 1490 | code, |
| 1491 | 1491 | color, |
| 1492 | flags) | |
| 1492 | flags); | |
| 1493 | 1493 | } |
| 1494 | 1494 | |
| 1495 | 1495 | static TILE_GET_INFO( K007342_get_tile_info0 ) { K007342_get_tile_info(machine,tileinfo,tile_index,0,K007342_colorram_0,K007342_videoram_0); } |
| r814 | r815 | |
| 1502 | 1502 | K007342_gfxnum = gfx_index; |
| 1503 | 1503 | K007342_callback = callback; |
| 1504 | 1504 | |
| 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); | |
| 1507 | 1507 | |
| 1508 | 1508 | K007342_ram = auto_malloc(0x2000); |
| 1509 | 1509 | K007342_scroll_ram = auto_malloc(0x0200); |
| r814 | r815 | |
| 1928 | 1928 | color, |
| 1929 | 1929 | flags); |
| 1930 | 1930 | |
| 1931 | tileinfo-> | |
| 1931 | tileinfo->categor | |
| 1932 | 1932 | } |
| 1933 | 1933 | |
| 1934 | 1934 | static 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); } |
| r814 | r815 | |
| 1999 | 1999 | |
| 2000 | 2000 | has_extra_video_ram = 0; |
| 2001 | 2001 | |
| 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); | |
| 2005 | 2005 | |
| 2006 | 2006 | K052109_ram = auto_malloc(0x6000); |
| 2007 | 2007 | |
| r814 | r815 | |
| 4542 | 4542 | K051316_gfxnum[chip], |
| 4543 | 4543 | code, |
| 4544 | 4544 | color, |
| 4545 | flags) | |
| 4545 | flags); | |
| 4546 | 4546 | } |
| 4547 | 4547 | |
| 4548 | 4548 | static TILE_GET_INFO( K051316_get_tile_info0 ) { K051316_get_tile_info(machine,tileinfo,tile_index,0); } |
| r814 | r815 | |
| 4551 | 4551 | |
| 4552 | 4552 | |
| 4553 | 4553 | void K051316_vh_start(running_machine *machine,int chip, int gfx_memory_region,int bpp, |
| 4554 | int | |
| 4554 | int p | |
| 4555 | 4555 | void (*callback)(int *code,int *color,int *flags)) |
| 4556 | 4556 | { |
| 4557 | 4557 | int gfx_index; |
| 4558 | static tile_get_info_ | |
| 4558 | static tile_get_info_callback get_tile_info[3] = { K051316_get_tile_info0,K051316_get_tile_info1,K051316_get_tile_info2 }; | |
| 4559 | 4559 | |
| 4560 | 4560 | /* find first empty slot to decode gfx */ |
| 4561 | 4561 | for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) |
| r814 | r815 | |
| 4635 | 4635 | K051316_bpp[chip] = bpp; |
| 4636 | 4636 | K051316_callback[chip] = callback; |
| 4637 | 4637 | |
| 4638 | K051316_tilemap[chip] = tilemap_create(get_tile_info[chip],tilemap_scan_rows, | |
| 4638 | K051316_tilemap[chip] = tilemap_create(get_tile_info[chip],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32); | |
| 4639 | 4639 | |
| 4640 | 4640 | K051316_ram[chip] = auto_malloc(0x800); |
| 4641 | 4641 | |
| 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 | } | |
| 4643 | 4649 | |
| 4644 | 4650 | K051316_wraparound[chip] = 0; /* default = no wraparound */ |
| 4645 | 4651 | K051316_offset[chip][0] = K051316_offset[chip][1] = 0; |
| 4646 | 4652 | } |
| 4647 | 4653 | |
| 4648 | 4654 | void K051316_vh_start_0(running_machine *machine,int gfx_memory_region,int bpp, |
| 4649 | int | |
| 4655 | int p | |
| 4650 | 4656 | void (*callback)(int *code,int *color,int *flags)) |
| 4651 | 4657 | { |
| 4652 | K051316_vh_start(machine,0,gfx_memory_region,bpp, | |
| 4658 | K051316_vh_start(machine,0,gfx_memory_region,bpp,p | |
| 4653 | 4659 | } |
| 4654 | 4660 | |
| 4655 | 4661 | void K051316_vh_start_1(running_machine *machine,int gfx_memory_region,int bpp, |
| 4656 | int | |
| 4662 | int p | |
| 4657 | 4663 | void (*callback)(int *code,int *color,int *flags)) |
| 4658 | 4664 | { |
| 4659 | K051316_vh_start(machine,1,gfx_memory_region,bpp, | |
| 4665 | K051316_vh_start(machine,1,gfx_memory_region,bpp,p | |
| 4660 | 4666 | } |
| 4661 | 4667 | |
| 4662 | 4668 | void K051316_vh_start_2(running_machine *machine,int gfx_memory_region,int bpp, |
| 4663 | int | |
| 4669 | int p | |
| 4664 | 4670 | void (*callback)(int *code,int *color,int *flags)) |
| 4665 | 4671 | { |
| 4666 | K051316_vh_start(machine,2,gfx_memory_region,bpp, | |
| 4672 | K051316_vh_start(machine,2,gfx_memory_region,bpp,p | |
| 4667 | 4673 | } |
| 4668 | 4674 | |
| 4669 | 4675 | |
| r814 | r815 | |
| 5417 | 5423 | |
| 5418 | 5424 | static void (*K056832_callback)(int layer, int *code, int *color, int *flags); |
| 5419 | 5425 | |
| 5420 | static UINT32 K056832_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows) | |
| 5421 | { | |
| 5422 | return (row<<6) + col; | |
| 5423 | } | |
| 5424 | ||
| 5425 | 5426 | INLINE void K056832_get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int pageIndex ) |
| 5426 | 5427 | { |
| 5427 | 5428 | static struct K056832_SHIFTMASKS |
| r814 | r815 | |
| 5462 | 5463 | SET_TILE_INFO(K056832_gfxnum, |
| 5463 | 5464 | code, |
| 5464 | 5465 | color, |
| 5465 | flags) | |
| 5466 | flags); | |
| 5466 | 5467 | } |
| 5467 | 5468 | |
| 5468 | 5469 | static TILE_GET_INFO( K056832_get_tile_info0 ) { K056832_get_tile_info(machine,tileinfo,tile_index,0x0); } |
| r814 | r815 | |
| 5738 | 5739 | |
| 5739 | 5740 | K056832_videoram = auto_malloc(0x2000 * (K056832_PAGE_COUNT+1)); |
| 5740 | 5741 | |
| 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); | |
| 5757 | 5758 | |
| 5758 | 5759 | for (i=0; i<K056832_PAGE_COUNT; i++) |
| 5759 | 5760 | { |
| r814 | r815 | |
| 6401 | 6402 | |
| 6402 | 6403 | #define DRAW_PIX(N) \ |
| 6403 | 6404 | if ((pen = src_ptr[N])) \ |
| 6404 | { pen += basepen; xpr_ptr[count+N] = TILE | |
| 6405 | { pen += basepen; xpr_ptr[count+N] = TILEM | |
| 6405 | 6406 | { xpr_ptr[count+N] = 0; } |
| 6406 | 6407 | |
| 6407 | 6408 | rectangle zerorect; |
| r814 | r815 | |
| 6429 | 6430 | |
| 6430 | 6431 | tmap = K056832_tilemap[page]; |
| 6431 | 6432 | 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); | |
| 6434 | 6435 | |
| 6435 | 6436 | dirty = K056832_LineDirty[page]; |
| 6436 | 6437 | all_dirty = K056832_AllLinesDirty[page]; |
| r814 | r815 | |
| 6445 | 6446 | memset (&zerorect, 0, sizeof(rectangle)); // zero dimension |
| 6446 | 6447 | tilemap_draw(bitmap, &zerorect, tmap, 0, 0); // dummy call to reset tile_dirty_map |
| 6447 | 6448 | fillbitmap(xprmap, 0, 0); // reset pixel transparency_bitmap; |
| 6448 | memset(xprdata, TILE | |
| 6449 | memset(xprdata, TILEM | |
| 6449 | 6450 | } |
| 6450 | 6451 | else |
| 6451 | 6452 | { |
| r814 | r815 | |
| 6474 | 6475 | |
| 6475 | 6476 | K056832_get_tile_info(machine, tileinfo, line, page); |
| 6476 | 6477 | 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; | |
| 6480 | 6481 | count = -LINE_WIDTH; |
| 6481 | 6482 | |
| 6482 | 6483 | do |
| r814 | r815 | |
|---|---|---|
| 83 | 83 | 0, |
| 84 | 84 | code, |
| 85 | 85 | attr & 0x1f, |
| 86 | TILE_FLIPYX((attr >> 6) & 3)) | |
| 86 | TILE_FLIPYX((attr >> 6) & 3)); | |
| 87 | 87 | |
| 88 | tileinfo-> | |
| 88 | tileinfo->categor | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static TILE_GET_INFO( get_tile_info_1 ) |
| r814 | r815 | |
| 96 | 96 | 0, |
| 97 | 97 | code, |
| 98 | 98 | attr & 0x1f, |
| 99 | TILE_FLIPYX((attr >> 6) & 3)) | |
| 99 | TILE_FLIPYX((attr >> 6) & 3)); | |
| 100 | 100 | |
| 101 | tileinfo-> | |
| 101 | tileinfo->categor | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| r814 | r815 | |
| 126 | 126 | VIDEO_START( blmbycar ) |
| 127 | 127 | { |
| 128 | 128 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 129 | TILEMAP_TYPE_ | |
| 129 | TILEMAP_TYPE_ | |
| 130 | 130 | |
| 131 | 131 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 132 | TILEMAP_TYPE_ | |
| 132 | TILEMAP_TYPE_ | |
| 133 | 133 | |
| 134 | 134 | tilemap_set_scroll_rows(tilemap_0,1); |
| 135 | 135 | tilemap_set_scroll_cols(tilemap_0,1); |
| 136 | tilemap_set_transparent_pen(tilemap_0,0); | |
| 137 | 136 | |
| 138 | 137 | tilemap_set_scroll_rows(tilemap_1,1); |
| 139 | 138 | tilemap_set_scroll_cols(tilemap_1,1); |
| r814 | r815 | |
|---|---|---|
| 79 | 79 | ***************************************************************************/ |
| 80 | 80 | |
| 81 | 81 | /* convert from 32x32 to 36x28 */ |
| 82 | static | |
| 82 | static | |
| 83 | 83 | { |
| 84 | 84 | row += 2; |
| 85 | 85 | col -= 2; |
| r814 | r815 | |
| 95 | 95 | 1, |
| 96 | 96 | retofinv_bg_videoram[tile_index] + 256 * bg_bank, |
| 97 | 97 | retofinv_bg_videoram[0x400 + tile_index] & 0x3f, |
| 98 | 0) | |
| 98 | 0); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static TILE_GET_INFO( fg_get_tile_info ) |
| r814 | r815 | |
| 105 | 105 | 0, |
| 106 | 106 | retofinv_fg_videoram[tile_index] + 256 * fg_bank, |
| 107 | 107 | retofinv_fg_videoram[0x400 + tile_index], |
| 108 | (tile_index < 0x40 || tile_index >= 0x3c0) ? TILE_ | |
| 108 | (tile_index < 0x40 || tile_index >= 0x3c0) ? TILE_F | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| r814 | r815 | |
| 118 | 118 | |
| 119 | 119 | VIDEO_START( retofinv ) |
| 120 | 120 | { |
| 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); | |
| 123 | 123 | |
| 124 | 124 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 125 | 125 |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | if (gbusters_priority) |
| 59 | 59 | { |
| 60 | 60 | // K051960_sprites_draw(bitmap,cliprect,1,1); /* are these used? */ |
| 61 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_ | |
| 61 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_D | |
| 62 | 62 | K051960_sprites_draw(bitmap,cliprect,2,2); |
| 63 | 63 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0); |
| 64 | 64 | K051960_sprites_draw(bitmap,cliprect,0,0); |
| r814 | r815 | |
| 67 | 67 | else |
| 68 | 68 | { |
| 69 | 69 | // K051960_sprites_draw(bitmap,cliprect,1,1); /* are these used? */ |
| 70 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_ | |
| 70 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_D | |
| 71 | 71 | K051960_sprites_draw(bitmap,cliprect,2,2); |
| 72 | 72 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0); |
| 73 | 73 | K051960_sprites_draw(bitmap,cliprect,0,0); |
| r814 | r815 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | VIDEO_START( meadows ) |
| 38 | 38 | { |
| 39 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 39 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 |
| r814 | r815 | |
|---|---|---|
| 74 | 74 | int code = videoram[tile_index] & 0x7f; |
| 75 | 75 | int color = (attr >> 1) & 0x07; |
| 76 | 76 | |
| 77 | SET_TILE_INFO(gfxbank, code, color, 0) | |
| 77 | SET_TILE_INFO(gfxbank, code, color, 0); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 84 | 84 | int gfxbank = tile / 0x200; |
| 85 | 85 | int code = tile & 0x1ff; |
| 86 | 86 | |
| 87 | SET_TILE_INFO(gfxbank, code, 0, 0) | |
| 87 | SET_TILE_INFO(gfxbank, code, 0, 0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | VIDEO_START( bogeyman ) |
| 91 | 91 | { |
| 92 | 92 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 93 | TILEMAP_TYPE_ | |
| 93 | TILEMAP_TYPE_ | |
| 94 | 94 | |
| 95 | 95 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 96 | TILEMAP_TYPE_ | |
| 96 | TILEMAP_TYPE_ | |
| 97 | 97 | |
| 98 | 98 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 99 | 99 | } |
| r814 | r815 | |
|---|---|---|
| 84 | 84 | gfxnum, |
| 85 | 85 | code + ((attr & 0x3f) << 8), |
| 86 | 86 | color & 0x0f, |
| 87 | TILE_FLIPYX((attr & 0xc0) >> 6) | TILE_SPLIT(pri)) | |
| 87 | TILE_FLIPYX((attr & 0xc0) >> 6)); | |
| 88 | tileinfo->group = pri; | |
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | INLINE void rtype2_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT8 *vram,int gfxnum) |
| r814 | r815 | |
| 108 | 109 | gfxnum, |
| 109 | 110 | code, |
| 110 | 111 | color & 0x0f, |
| 111 | TILE_FLIPYX((color & 0x60) >> 5) | TILE_SPLIT(pri)) | |
| 112 | TILE_FLIPYX((color & 0x60) >> 5)); | |
| 113 | tileinfo->group = pri; | |
| 112 | 114 | } |
| 113 | 115 | |
| 114 | 116 | |
| r814 | r815 | |
| 138 | 140 | } |
| 139 | 141 | |
| 140 | 142 | |
| 141 | static | |
| 143 | static | |
| 142 | 144 | { |
| 143 | 145 | /* logical (col,row) -> memory offset */ |
| 144 | 146 | return row*256 + col; |
| r814 | r815 | |
| 165 | 167 | |
| 166 | 168 | VIDEO_START( m72 ) |
| 167 | 169 | { |
| 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); | |
| 170 | 172 | |
| 171 | 173 | m72_spriteram = auto_malloc(spriteram_size); |
| 172 | 174 | |
| r814 | r815 | |
| 188 | 190 | |
| 189 | 191 | VIDEO_START( rtype2 ) |
| 190 | 192 | { |
| 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); | |
| 193 | 195 | |
| 194 | 196 | m72_spriteram = auto_malloc(spriteram_size); |
| 195 | 197 | |
| r814 | r815 | |
| 222 | 224 | { |
| 223 | 225 | // The tilemap can be 256x64, but seems to be used at 128x64 (scroll wraparound). |
| 224 | 226 | // 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); | |
| 228 | 230 | |
| 229 | 231 | m72_spriteram = auto_malloc(spriteram_size); |
| 230 | 232 | |
| r814 | r815 | |
| 246 | 248 | |
| 247 | 249 | VIDEO_START( hharry ) |
| 248 | 250 | { |
| 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); | |
| 251 | 253 | |
| 252 | 254 | m72_spriteram = auto_malloc(spriteram_size); |
| 253 | 255 | |
| r814 | r815 | |
| 581 | 583 | tilemap_set_scrollx(bg_tilemap,0,scrollx2 + xadjust + bgadjust); |
| 582 | 584 | tilemap_set_scrolly(bg_tilemap,0,scrolly2); |
| 583 | 585 | |
| 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); | |
| 586 | 588 | 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); | |
| 589 | 591 | return 0; |
| 590 | 592 | } |
| 591 | 593 | |
| r814 | r815 | |
| 617 | 619 | } |
| 618 | 620 | tilemap_set_scrolly(bg_tilemap,0,scrolly2); |
| 619 | 621 | |
| 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); | |
| 622 | 624 | majtitle_draw_sprites(machine, bitmap,cliprect); |
| 623 | 625 | 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); | |
| 626 | 628 | return 0; |
| 627 | 629 | } |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | int code = videoram[tile_index*2+1] + ((videoram[tile_index*2] & 0x3f) << 8); |
| 25 | 25 | int color = videoram[tile_index*2] >> 6; |
| 26 | 26 | |
| 27 | SET_TILE_INFO(0, code, color, 0) | |
| 27 | SET_TILE_INFO(0, code, color, 0); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | VIDEO_START( pokechmp ) |
| 31 | 31 | { |
| 32 | 32 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 33 | TILEMAP_TYPE_ | |
| 33 | TILEMAP_TYPE_ | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 22 | 22 | 0, |
| 23 | 23 | code, |
| 24 | 24 | (attr & 0x0f00) >> 8, |
| 25 | 0) | |
| 25 | 0); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| r814 | r815 | |
| 35 | 35 | |
| 36 | 36 | VIDEO_START( ohmygod ) |
| 37 | 37 | { |
| 38 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 38 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 |
| r814 | r815 | |
|---|---|---|
| 35 | 35 | 0, |
| 36 | 36 | tile, |
| 37 | 37 | color, |
| 38 | 0) | |
| 38 | 0); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static TILE_GET_INFO( get_sar_tile_info ) |
| r814 | r815 | |
| 49 | 49 | 0, |
| 50 | 50 | tile, |
| 51 | 51 | color, |
| 52 | 0) | |
| 52 | 0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static TILE_GET_INFO( get_ikari3_tile_info ) |
| r814 | r815 | |
| 68 | 68 | 0, |
| 69 | 69 | tile, |
| 70 | 70 | color, |
| 71 | 0) | |
| 71 | 0); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /*************************************************************************** |
| r814 | r815 | |
| 79 | 79 | |
| 80 | 80 | VIDEO_START( pow ) |
| 81 | 81 | { |
| 82 | fix_tilemap = tilemap_create(get_pow_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 82 | fix_tilemap = tilemap_create(get_pow_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 83 | 83 | |
| 84 | 84 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | VIDEO_START( searchar ) |
| 88 | 88 | { |
| 89 | fix_tilemap = tilemap_create(get_sar_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 89 | fix_tilemap = tilemap_create(get_sar_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 90 | 90 | |
| 91 | 91 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | VIDEO_START( ikari3 ) |
| 95 | 95 | { |
| 96 | fix_tilemap = tilemap_create(get_ikari3_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 96 | fix_tilemap = tilemap_create(get_ikari3_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 97 | 97 | |
| 98 | 98 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 99 | 99 | } |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | 0, |
| 30 | 30 | code + (aeroboto_charbank << 8), |
| 31 | 31 | aeroboto_tilecolor[code], |
| 32 | (aeroboto_tilecolor[code] >= 0x33) ? 0 : TILE_ | |
| 32 | (aeroboto_tilecolor[code] >= 0x33) ? 0 : TILE_F | |
| 33 | 33 | } |
| 34 | 34 | // transparency should only affect tiles with color 0x33 or higher |
| 35 | 35 | |
| r814 | r815 | |
| 42 | 42 | |
| 43 | 43 | VIDEO_START( aeroboto ) |
| 44 | 44 | { |
| 45 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 45 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 46 | 46 | |
| 47 | 47 | tilemap_set_transparent_pen(bg_tilemap,0); |
| 48 | 48 |
| r814 | r815 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | ***************************************************************************/ |
| 81 | 81 | |
| 82 | static | |
| 82 | static | |
| 83 | 83 | { |
| 84 | 84 | return (row ^ 0x1f) + (col << 5); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | static | |
| 87 | static | |
| 88 | 88 | { |
| 89 | 89 | return ((row & 0x0f) ^ 0x0f) | ((col & 0x0f) << 4) | |
| 90 | 90 | /* hole at bit 8 */ |
| r814 | r815 | |
| 101 | 101 | 0, |
| 102 | 102 | code | ((color & 0x01) << 8), |
| 103 | 103 | color >> 4, |
| 104 | 0) | |
| 104 | 0); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | INLINE void get_bg_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index, UINT8 *bgvideoram, int gfx_region) |
| r814 | r815 | |
| 114 | 114 | gfx_region, |
| 115 | 115 | code + ((color & 0x03) << 8), |
| 116 | 116 | (color & 0x30) >> 4, |
| 117 | TILE_FLIPXY((color & 0x0c) >> 2)) | |
| 117 | TILE_FLIPXY((color & 0x0c) >> 2)); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 136 | 136 | |
| 137 | 137 | VIDEO_START( firetrap ) |
| 138 | 138 | { |
| 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); | |
| 142 | 142 | |
| 143 | 143 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 144 | 144 | tilemap_set_transparent_pen(bg1_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | ***************************************************************************/ |
| 49 | 49 | |
| 50 | static | |
| 50 | static | |
| 51 | 51 | { |
| 52 | 52 | return (col & 0x0f) + ((col & 0x10) << 5) + (row << 4); |
| 53 | 53 | } |
| r814 | r815 | |
| 60 | 60 | 1, |
| 61 | 61 | code + (color << 8), |
| 62 | 62 | (color & 0xf0) >> 4, |
| 63 | TILE_FLIPX ) // why? | |
| 63 | TILE_FLIPX ); // why? | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static TILE_GET_INFO( get_tile_info_1 ) |
| r814 | r815 | |
| 71 | 71 | 2, |
| 72 | 72 | code + (color << 8), |
| 73 | 73 | (color & 0xf0) >> 4, |
| 74 | 0) | |
| 74 | 0); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | WRITE8_HANDLER( thedeep_vram_0_w ) |
| r814 | r815 | |
| 108 | 108 | |
| 109 | 109 | VIDEO_START( thedeep ) |
| 110 | 110 | { |
| 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); | |
| 113 | 113 | |
| 114 | 114 | tilemap_set_transparent_pen( tilemap_0, 0 ); |
| 115 | 115 | tilemap_set_transparent_pen( tilemap_1, 0 ); |
| r814 | r815 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | tileno = oneshot_bg_videoram[tile_index*2+1]; |
| 25 | 25 | |
| 26 | SET_TILE_INFO(0,tileno,0,0) | |
| 26 | SET_TILE_INFO(0,tileno,0,0); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | WRITE16_HANDLER( oneshot_bg_videoram_w ) |
| r814 | r815 | |
| 39 | 39 | |
| 40 | 40 | tileno = oneshot_mid_videoram[tile_index*2+1]; |
| 41 | 41 | |
| 42 | SET_TILE_INFO(0,tileno,2,0) | |
| 42 | SET_TILE_INFO(0,tileno,2,0); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | WRITE16_HANDLER( oneshot_mid_videoram_w ) |
| r814 | r815 | |
| 56 | 56 | |
| 57 | 57 | tileno = oneshot_fg_videoram[tile_index*2+1]; |
| 58 | 58 | |
| 59 | SET_TILE_INFO(0,tileno,3,0) | |
| 59 | SET_TILE_INFO(0,tileno,3,0); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | WRITE16_HANDLER( oneshot_fg_videoram_w ) |
| r814 | r815 | |
| 67 | 67 | |
| 68 | 68 | VIDEO_START( oneshot ) |
| 69 | 69 | { |
| 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); | |
| 73 | 73 | |
| 74 | 74 | tilemap_set_transparent_pen(oneshot_bg_tilemap,0); |
| 75 | 75 | tilemap_set_transparent_pen(oneshot_mid_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 20 | 20 | tileno = stlforce_bg_videoram[tile_index] & 0x0fff; |
| 21 | 21 | colour = stlforce_bg_videoram[tile_index] & 0xe000; |
| 22 | 22 | colour = colour >> 13; |
| 23 | SET_TILE_INFO(0,tileno,colour,0) | |
| 23 | SET_TILE_INFO(0,tileno,colour,0); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | WRITE16_HANDLER( stlforce_bg_videoram_w ) |
| r814 | r815 | |
| 41 | 41 | colour += 8; |
| 42 | 42 | tileno += 0x1000; |
| 43 | 43 | |
| 44 | SET_TILE_INFO(0,tileno,colour,0) | |
| 44 | SET_TILE_INFO(0,tileno,colour,0); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | WRITE16_HANDLER( stlforce_mlow_videoram_w ) |
| r814 | r815 | |
| 62 | 62 | colour += 16; |
| 63 | 63 | tileno += 0x2000; |
| 64 | 64 | |
| 65 | SET_TILE_INFO(0,tileno,colour,0) | |
| 65 | SET_TILE_INFO(0,tileno,colour,0); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | WRITE16_HANDLER( stlforce_mhigh_videoram_w ) |
| r814 | r815 | |
| 84 | 84 | tileno += 0xc000; |
| 85 | 85 | |
| 86 | 86 | colour += 24; |
| 87 | SET_TILE_INFO(1,tileno,colour,0) | |
| 87 | SET_TILE_INFO(1,tileno,colour,0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | WRITE16_HANDLER( stlforce_tx_videoram_w ) |
| r814 | r815 | |
| 181 | 181 | |
| 182 | 182 | VIDEO_START( stlforce ) |
| 183 | 183 | { |
| 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); | |
| 188 | 188 | |
| 189 | 189 | tilemap_set_transparent_pen(stlforce_mlow_tilemap,0); |
| 190 | 190 | tilemap_set_transparent_pen(stlforce_mhigh_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 171 | 171 | #ifdef MAME_DEBUG |
| 172 | 172 | if (dislayer[3]==0) |
| 173 | 173 | #endif |
| 174 | PC080SN_tilemap_draw(bitmap,cliprect,1,layer[0],TILEMAP_ | |
| 174 | PC080SN_tilemap_draw(bitmap,cliprect,1,layer[0],TILEMAP_D | |
| 175 | 175 | |
| 176 | 176 | #ifdef MAME_DEBUG |
| 177 | 177 | if (dislayer[2]==0) |
| r814 | r815 | |
|---|---|---|
| 53 | 53 | 0, |
| 54 | 54 | code + ((color & 0x18)<<5), |
| 55 | 55 | color & 0x07, |
| 56 | 0) | |
| 56 | 0); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | WRITE8_HANDLER( amspdwy_videoram_w ) |
| r814 | r815 | |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | /* logical (col,row) -> memory offset */ |
| 73 | ||
| 73 | static TILEMAP_MAPPER( tilemap_scan_cols_back | |
| 74 | 74 | { |
| 75 | 75 | return col*num_rows + (num_rows - row - 1); |
| 76 | 76 | } |
| r814 | r815 | |
| 79 | 79 | VIDEO_START( amspdwy ) |
| 80 | 80 | { |
| 81 | 81 | bg_tilemap = tilemap_create( get_tile_info, tilemap_scan_cols_back, |
| 82 | TILEMAP_TYPE_ | |
| 82 | TILEMAP_TYPE_ | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 |
| r814 | r815 | |
|---|---|---|
| 46 | 46 | int code = data & 0xfff; |
| 47 | 47 | int color = (data >> 12) & 0x0f; |
| 48 | 48 | int opaque = data & 0x8000; |
| 49 | SET_TILE_INFO(1, code, color, opaque ? TILE_ | |
| 49 | SET_TILE_INFO(1, code, color, opaque ? TILE_F | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r814 | r815 | |
| 114 | 114 | atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x10); |
| 115 | 115 | |
| 116 | 116 | /* initialize the playfield */ |
| 117 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 117 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 118 | 118 | |
| 119 | 119 | /* initialize the motion objects */ |
| 120 | 120 | atarirle_init(0, atarig1_pitfight ? &modesc_pitfight : &modesc_hydra); |
| 121 | 121 | |
| 122 | 122 | /* initialize the alphanumerics */ |
| 123 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 123 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 124 | 124 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 125 | 125 | |
| 126 | 126 | /* reset statics */ |
| r814 | r815 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | int code = (videoram[tile_index] & 0x80) ? videoram[tile_index] : 0; |
| 24 | 24 | |
| 25 | SET_TILE_INFO(0, code, 0, 0) | |
| 25 | SET_TILE_INFO(0, code, 0, 0); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | VIDEO_START( sbrkout ) |
| 29 | 29 | { |
| 30 | 30 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 31 | TILEMAP_TYPE_ | |
| 31 | TILEMAP_TYPE_ | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | static void draw_balls(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 66 | 66 | { |
| 67 | 67 | K007342_tilemap_update(); |
| 68 | 68 | |
| 69 | K007342_tilemap_draw( bitmap, cliprect, 1, TILEMAP_ | |
| 69 | K007342_tilemap_draw( bitmap, cliprect, 1, TILEMAP_D | |
| 70 | 70 | K007420_sprites_draw( bitmap, cliprect ); |
| 71 | K007342_tilemap_draw( bitmap, cliprect, 1, 1 | TILEMAP_ | |
| 71 | K007342_tilemap_draw( bitmap, cliprect, 1, 1 | TILEMAP_D | |
| 72 | 72 | K007342_tilemap_draw( bitmap, cliprect, 0, 0 ,0); |
| 73 | 73 | K007342_tilemap_draw( bitmap, cliprect, 0, 1 ,0); |
| 74 | 74 | return 0; |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | int code = data2 & 0x3fff; |
| 43 | 43 | int color = data1 & 0x0f; |
| 44 | 44 | SET_TILE_INFO(0, code, color, TILE_FLIPYX(data2 >> 14)); |
| 45 | tileinfo-> | |
| 45 | tileinfo->categor | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| r814 | r815 | |
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | 95 | /* initialize the playfield */ |
| 96 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 96 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 97 | 97 | |
| 98 | 98 | /* initialize the motion objects */ |
| 99 | 99 | atarimo_init(machine, 0, &modesc); |
| 100 | 100 | |
| 101 | 101 | /* initialize the alphanumerics */ |
| 102 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 102 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 103 | 103 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 104 | 104 | } |
| 105 | 105 |
| r814 | r815 | |
|---|---|---|
| 27 | 27 | 0, |
| 28 | 28 | srumbler_foregroundram[2*tile_index + 1] + ((attr & 0x03) << 8), |
| 29 | 29 | (attr & 0x3c) >> 2, |
| 30 | (attr & 0x40) ? TILE_ | |
| 30 | (attr & 0x40) ? TILE_F | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 37 | 37 | 1, |
| 38 | 38 | srumbler_backgroundram[2*tile_index + 1] + ((attr & 0x07) << 8), |
| 39 | 39 | (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; | |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | |
| r814 | r815 | |
| 50 | 51 | |
| 51 | 52 | VIDEO_START( srumbler ) |
| 52 | 53 | { |
| 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); | |
| 55 | 56 | |
| 56 | 57 | tilemap_set_transparent_pen(fg_tilemap,3); |
| 57 | 58 | |
| r814 | r815 | |
| 160 | 161 | |
| 161 | 162 | VIDEO_UPDATE( srumbler ) |
| 162 | 163 | { |
| 163 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 164 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 164 | 165 | draw_sprites(machine, bitmap,cliprect); |
| 165 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 166 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 166 | 167 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); |
| 167 | 168 | return 0; |
| 168 | 169 | } |
| r814 | r815 | |
|---|---|---|
| 85 | 85 | tile &= 0xfff; |
| 86 | 86 | tile |= back_gfx_bank; /* Heatbrl uses banking */ |
| 87 | 87 | |
| 88 | SET_TILE_INFO(1,tile,color,0) | |
| 88 | SET_TILE_INFO(1,tile,color,0); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static TILE_GET_INFO( get_mid_tile_info ) |
| r814 | r815 | |
| 95 | 95 | |
| 96 | 96 | tile &= 0xfff; |
| 97 | 97 | |
| 98 | SET_TILE_INFO(5,tile,color,0) | |
| 98 | SET_TILE_INFO(5,tile,color,0); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static TILE_GET_INFO( get_mid_tile_info_denji ) |
| r814 | r815 | |
| 106 | 106 | tile &= 0xfff; |
| 107 | 107 | tile |= mid_gfx_bank; |
| 108 | 108 | |
| 109 | SET_TILE_INFO(5,tile,color,0) | |
| 109 | SET_TILE_INFO(5,tile,color,0); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static TILE_GET_INFO( get_mid_tile_info_cupsoc ) |
| r814 | r815 | |
| 118 | 118 | |
| 119 | 119 | tile |= 0x1000; |
| 120 | 120 | |
| 121 | SET_TILE_INFO(1,tile,color,0) | |
| 121 | SET_TILE_INFO(1,tile,color,0); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | static TILE_GET_INFO( get_fore_tile_info ) /* this is giving bad tiles... */ |
| r814 | r815 | |
| 129 | 129 | // legionnaire tile numbers / gfx set wrong, see screen after coin insertion |
| 130 | 130 | tile &= 0xfff; |
| 131 | 131 | |
| 132 | SET_TILE_INFO(4,tile,color,0) | |
| 132 | SET_TILE_INFO(4,tile,color,0); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static TILE_GET_INFO( get_fore_tile_info_denji ) |
| r814 | r815 | |
| 140 | 140 | tile &= 0xfff; |
| 141 | 141 | tile |= fore_gfx_bank; |
| 142 | 142 | |
| 143 | SET_TILE_INFO(4,tile,color,0) | |
| 143 | SET_TILE_INFO(4,tile,color,0); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 150 | 150 | |
| 151 | 151 | tile &= 0xfff; |
| 152 | 152 | |
| 153 | SET_TILE_INFO(0,tile,color,0) | |
| 153 | SET_TILE_INFO(0,tile,color,0); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | VIDEO_START( legionna ) |
| 157 | 157 | { |
| 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); | |
| 162 | 162 | |
| 163 | 163 | legionna_scrollram16 = auto_malloc(0x60); |
| 164 | 164 | |
| r814 | r815 | |
| 170 | 170 | |
| 171 | 171 | VIDEO_START( denjinmk ) |
| 172 | 172 | { |
| 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); | |
| 177 | 177 | |
| 178 | 178 | legionna_scrollram16 = auto_malloc(0x60); |
| 179 | 179 | |
| r814 | r815 | |
| 185 | 185 | |
| 186 | 186 | VIDEO_START( cupsoc ) |
| 187 | 187 | { |
| 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); | |
| 192 | 192 | |
| 193 | 193 | legionna_scrollram16 = auto_malloc(0x60); |
| 194 | 194 | |
| r814 | r815 | |
| 362 | 362 | #if LAYER_DB |
| 363 | 363 | if (dislayer[2]==0) |
| 364 | 364 | #endif |
| 365 | tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_ | |
| 365 | tilemap_draw(bitmap,cliprect,foreground_layer,TILEMAP_D | |
| 366 | 366 | |
| 367 | 367 | #if LAYER_DB |
| 368 | 368 | if (dislayer[1]==0) |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | int color = attr & 0x0f; |
| 59 | 59 | int flags = (attr & 0x80) ? TILE_FLIPY : 0; |
| 60 | 60 | |
| 61 | SET_TILE_INFO(1, code, color, flags) | |
| 61 | SET_TILE_INFO(1, code, color, flags); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 68 | 68 | int color = attr & 0x0f; |
| 69 | 69 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 70 | 70 | |
| 71 | SET_TILE_INFO(0, code, color, flags) | |
| 71 | SET_TILE_INFO(0, code, color, flags); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | VIDEO_START( pbaction ) |
| 75 | 75 | { |
| 76 | 76 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 77 | TILEMAP_TYPE_ | |
| 77 | TILEMAP_TYPE_ | |
| 78 | 78 | |
| 79 | 79 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 80 | TILEMAP_TYPE_ | |
| 80 | TILEMAP_TYPE_ | |
| 81 | 81 | |
| 82 | 82 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 83 | 83 | } |
| r814 | r815 | |
|---|---|---|
| 32 | 32 | int color = (~data >> 12) & 3; |
| 33 | 33 | SET_TILE_INFO(0, code, color, TILE_FLIPYX((data >> 10) & 3)); |
| 34 | 34 | if (machine->gfx[0]->total_elements < 0x1000) |
| 35 | tileinfo-> | |
| 35 | tileinfo->categor | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| r814 | r815 | |
| 49 | 49 | int data = videoram16[tile_index]; |
| 50 | 50 | int color = (data >> 13) & 7; |
| 51 | 51 | SET_TILE_INFO(2, data & 0x3ff, color, TILE_FLIPYX((data >> 11) & 3)); |
| 52 | tileinfo-> | |
| 52 | tileinfo->categor | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| r814 | r815 | |
| 63 | 63 | VIDEO_START( mcr68 ) |
| 64 | 64 | { |
| 65 | 65 | /* initialize the background tilemap */ |
| 66 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 66 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 67 | 67 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 68 | 68 | } |
| 69 | 69 | |
| r814 | r815 | |
| 76 | 76 | int code, y, x; |
| 77 | 77 | |
| 78 | 78 | /* initialize the background tilemap */ |
| 79 | bg_tilemap = tilemap_create(zwackery_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 79 | bg_tilemap = tilemap_create(zwackery_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 80 | 80 | |
| 81 | 81 | /* initialize the foreground tilemap */ |
| 82 | fg_tilemap = tilemap_create(zwackery_get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 82 | fg_tilemap = tilemap_create(zwackery_get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 83 | 83 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 84 | 84 | |
| 85 | 85 | /* "colorize" each code */ |
| r814 | r815 | |
| 303 | 303 | VIDEO_UPDATE( mcr68 ) |
| 304 | 304 | { |
| 305 | 305 | /* 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); | |
| 308 | 308 | |
| 309 | 309 | /* draw the low-priority sprites */ |
| 310 | 310 | mcr68_update_sprites(machine, bitmap, cliprect, 0); |
| r814 | r815 | |
|---|---|---|
| 52 | 52 | VIDEO_START( overdriv ) |
| 53 | 53 | { |
| 54 | 54 | 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); | |
| 57 | 57 | K053247_vh_start(machine, REGION_GFX1,77,22,NORMAL_PLANE_ORDER,overdriv_sprite_callback); |
| 58 | 58 | |
| 59 | 59 | K051316_wraparound_enable(0,1); |
| r814 | r815 | |
|---|---|---|
| 99 | 99 | int code = attr & 0xfff; |
| 100 | 100 | int color = colorram[offs] >> 4; // 4 bits for color. |
| 101 | 101 | |
| 102 | SET_TILE_INFO(0, code, color, 0) | |
| 102 | SET_TILE_INFO(0, code, color, 0); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | VIDEO_START(funworld) |
| 106 | 106 | { |
| 107 | 107 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 108 | TILEMAP_TYPE_ | |
| 108 | TILEMAP_TYPE_ | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | VIDEO_START(magiccrd) |
| 112 | 112 | { |
| 113 | 113 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 114 | TILEMAP_TYPE_ | |
| 114 | TILEMAP_TYPE_ | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | VIDEO_UPDATE(funworld) |
| r814 | r815 | |
|---|---|---|
| 76 | 76 | // fillbitmap(bitmap,machine->pens[16 * layer_colorbase[1]],cliprect); |
| 77 | 77 | if (scontra_priority) |
| 78 | 78 | { |
| 79 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_ | |
| 79 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_D | |
| 80 | 80 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,2); |
| 81 | 81 | } |
| 82 | 82 | else |
| 83 | 83 | { |
| 84 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_ | |
| 84 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_D | |
| 85 | 85 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,2); |
| 86 | 86 | } |
| 87 | 87 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,4); |
| r814 | r815 | |
|---|---|---|
| 161 | 161 | int color = ((code & 0x3c0) >> 6) + 16 * charpalbank; |
| 162 | 162 | int flags = flipscreen ? (TILE_FLIPX | TILE_FLIPY) : 0; |
| 163 | 163 | |
| 164 | SET_TILE_INFO(0, code, color, flags) | |
| 164 | SET_TILE_INFO(0, code, color, flags); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | VIDEO_START( gsword ) |
| 168 | 168 | { |
| 169 | 169 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 170 | TILEMAP_TYPE_ | |
| 170 | TILEMAP_TYPE_ | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 119 | 119 | int code = videoram[tile_index] + 256 * gfx_bank; |
| 120 | 120 | int color = (videoram[tile_index] >> 5) + 8 * palette_bank; |
| 121 | 121 | |
| 122 | SET_TILE_INFO(0, code, color, 0) | |
| 122 | SET_TILE_INFO(0, code, color, 0); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | VIDEO_START( mario ) |
| 126 | 126 | { |
| 127 | 127 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 128 | TILEMAP_TYPE_ | |
| 128 | TILEMAP_TYPE_ | |
| 129 | 129 | |
| 130 | 130 | state_save_register_global(gfx_bank); |
| 131 | 131 | state_save_register_global(palette_bank); |
| r814 | r815 | |
|---|---|---|
| 80 | 80 | 0, |
| 81 | 81 | code, |
| 82 | 82 | color, |
| 83 | TILE_FLIPYX(flipx)) | |
| 83 | TILE_FLIPYX(flipx)); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| r814 | r815 | |
| 101 | 101 | 0, |
| 102 | 102 | code, |
| 103 | 103 | color, |
| 104 | TILE_FLIPYX(flipx)) | |
| 104 | TILE_FLIPYX(flipx)); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r814 | r815 | |
| 122 | 122 | 0, |
| 123 | 123 | code, |
| 124 | 124 | color, |
| 125 | TILE_FLIPYX(flipx)) | |
| 125 | TILE_FLIPYX(flipx)); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| r814 | r815 | |
| 137 | 137 | |
| 138 | 138 | VIDEO_START(silkroad) |
| 139 | 139 | { |
| 140 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 140 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 141 | 141 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 142 | 142 | |
| 143 | fg2_tilemap = tilemap_create(get_fg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 143 | fg2_tilemap = tilemap_create(get_fg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 144 | 144 | tilemap_set_transparent_pen(fg2_tilemap,0); |
| 145 | 145 | |
| 146 | fg3_tilemap = tilemap_create(get_fg3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 146 | fg3_tilemap = tilemap_create(get_fg3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 147 | 147 | tilemap_set_transparent_pen(fg3_tilemap,0); |
| 148 | 148 | } |
| 149 | 149 |
| r814 | r815 | |
|---|---|---|
| 15 | 15 | static tilemap* bg_tilemap; |
| 16 | 16 | |
| 17 | 17 | |
| 18 | static | |
| 18 | static | |
| 19 | 19 | { |
| 20 | 20 | return num_rows * ((col + 16) % 48) + row; |
| 21 | 21 | } |
| r814 | r815 | |
| 25 | 25 | { |
| 26 | 26 | UINT8 code = videopin_video_ram[tile_index]; |
| 27 | 27 | |
| 28 | SET_TILE_INFO(0, code, 0, (code & 0x40) ? TILE_FLIPY : 0) | |
| 28 | SET_TILE_INFO(0, code, 0, (code & 0x40) ? TILE_FLIPY : 0); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | VIDEO_START( videopin ) |
| 33 | 33 | { |
| 34 | bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, TILEMAP_TYPE_ | |
| 34 | bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, TILEMAP_TYPE_ | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 |
| r814 | r815 | |
|---|---|---|
| 66 | 66 | color = (attr & 0x18) >> 3; |
| 67 | 67 | flags = (attr & 0x04) ? TILE_FLIPX : 0; |
| 68 | 68 | |
| 69 | tileinfo-> | |
| 69 | tileinfo->categor | |
| 70 | 70 | |
| 71 | SET_TILE_INFO(bank, code, color, flags) | |
| 71 | SET_TILE_INFO(bank, code, color, flags); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 77 | 77 | int code = videoram[tile_index] + ((attr & 0x07) << 8); |
| 78 | 78 | int color = (attr & 0x10) >> 4; |
| 79 | 79 | |
| 80 | SET_TILE_INFO(0, code, color, 0) | |
| 80 | SET_TILE_INFO(0, code, color, 0); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | VIDEO_START( exprraid ) |
| 84 | 84 | { |
| 85 | 85 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 86 | TILEMAP_TYPE_ | |
| 86 | TILEMAP_TYPE_ | |
| 87 | 87 | |
| 88 | 88 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 89 | TILEMAP_TYPE_ | |
| 89 | TILEMAP_TYPE_ | |
| 90 | 90 | |
| 91 | 91 | tilemap_set_scroll_rows(bg_tilemap, 2); |
| 92 | 92 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | int color = tecmo16_colorram[tile_index] & 0x0f; |
| 30 | 30 | |
| 31 | 31 | /* bit 4 controls blending */ |
| 32 | tileinfo-> | |
| 32 | tileinfo->categor | |
| 33 | 33 | |
| 34 | 34 | SET_TILE_INFO( |
| 35 | 35 | 1, |
| 36 | 36 | tile, |
| 37 | color | (tileinfo->priority ? 0x70 : 0x00), | |
| 38 | 0) | |
| 37 | color | (tileinfo->category ? 0x70 : 0x00), | |
| 38 | 0); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static TILE_GET_INFO( bg_get_tile_info ) |
| r814 | r815 | |
| 47 | 47 | 1, |
| 48 | 48 | tile, |
| 49 | 49 | color, |
| 50 | 0) | |
| 50 | 0); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static TILE_GET_INFO( tx_get_tile_info ) |
| r814 | r815 | |
| 57 | 57 | 0, |
| 58 | 58 | tile & 0x0fff, |
| 59 | 59 | tile >> 12, |
| 60 | 0) | |
| 60 | 0); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /******************************************************************************/ |
| r814 | r815 | |
| 71 | 71 | /* set up sprites */ |
| 72 | 72 | sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16); |
| 73 | 73 | |
| 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); | |
| 77 | 77 | |
| 78 | 78 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 79 | 79 | tilemap_set_transparent_pen(bg_tilemap,0); |
| r814 | r815 | |
| 93 | 93 | /* set up sprites */ |
| 94 | 94 | sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16); |
| 95 | 95 | |
| 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); | |
| 99 | 99 | |
| 100 | 100 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 101 | 101 | tilemap_set_transparent_pen(bg_tilemap,0); |
| r814 | r815 | |
| 113 | 113 | /* set up sprites */ |
| 114 | 114 | sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16); |
| 115 | 115 | |
| 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); | |
| 119 | 119 | |
| 120 | 120 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 121 | 121 | tilemap_set_transparent_pen(bg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | VIDEO_START( runaway ) |
| 78 | 78 | { |
| 79 | bg_tilemap = tilemap_create(runaway_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 79 | bg_tilemap = tilemap_create(runaway_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | VIDEO_START( qwak ) |
| 84 | 84 | { |
| 85 | bg_tilemap = tilemap_create(qwak_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 85 | bg_tilemap = tilemap_create(qwak_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 |
| r814 | r815 | |
|---|---|---|
| 92 | 92 | ***************************************************************************/ |
| 93 | 93 | |
| 94 | 94 | /* convert from 32x32 to 36x28 */ |
| 95 | static | |
| 95 | static | |
| 96 | 96 | { |
| 97 | 97 | int offs; |
| 98 | 98 | |
| r814 | r815 | |
| 113 | 113 | 0, |
| 114 | 114 | toypop_videoram[tile_index], |
| 115 | 115 | (attr & 0x3f) + 0x40 * palettebank, |
| 116 | 0) | |
| 116 | 0); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
| r814 | r815 | |
| 126 | 126 | |
| 127 | 127 | VIDEO_START( toypop ) |
| 128 | 128 | { |
| 129 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 129 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_ | |
| 130 | 130 | |
| 131 | 131 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 132 | 132 | } |
| r814 | r815 | |
|---|---|---|
| 291 | 291 | |
| 292 | 292 | /******************************************************************************/ |
| 293 | 293 | |
| 294 | static | |
| 294 | static | |
| 295 | 295 | { |
| 296 | 296 | /* logical (col,row) -> memory offset */ |
| 297 | 297 | return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5); |
| r814 | r815 | |
| 305 | 305 | gfx_bank, |
| 306 | 306 | (data & 0x0fff)|(bcstory_tilebank>>2), |
| 307 | 307 | data >> 12, |
| 308 | 0) | |
| 308 | 0); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | static TILE_GET_INFO( get_bg1_tile_info ) { get_bg_tile_info(machine,tileinfo,tile_index,2,tumblepb_pf1_data); } |
| r814 | r815 | |
| 319 | 319 | 0, |
| 320 | 320 | (data & 0x0fff)|bcstory_tilebank, |
| 321 | 321 | data >> 12, |
| 322 | 0) | |
| 322 | 0); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | INLINE void get_fncywld_bg_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int gfx_bank,UINT16 *gfx_base) |
| r814 | r815 | |
| 331 | 331 | gfx_bank, |
| 332 | 332 | data & 0x1fff, |
| 333 | 333 | attr & 0x1f, |
| 334 | 0) | |
| 334 | 0); | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | static TILE_GET_INFO( get_fncywld_bg1_tile_info ) { get_fncywld_bg_tile_info(machine,tileinfo,tile_index,2,tumblepb_pf1_data); } |
| r814 | r815 | |
| 346 | 346 | 0, |
| 347 | 347 | data & 0x1fff, |
| 348 | 348 | attr & 0x1f, |
| 349 | 0) | |
| 349 | 0); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| r814 | r815 | |
| 359 | 359 | 2, |
| 360 | 360 | data & 0x3fff, |
| 361 | 361 | 0, |
| 362 | 0) | |
| 362 | 0); | |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | static TILE_GET_INFO( get_jumppop_bg2_tile_info ) |
| r814 | r815 | |
| 370 | 370 | 1, |
| 371 | 371 | data & 0x1fff, |
| 372 | 372 | 1, |
| 373 | 0) | |
| 373 | 0); | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | static TILE_GET_INFO( get_jumppop_bg2_alt_tile_info ) |
| r814 | r815 | |
| 381 | 381 | 0, |
| 382 | 382 | data & 0x7fff, |
| 383 | 383 | 1, |
| 384 | 0) | |
| 384 | 0); | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
| r814 | r815 | |
| 393 | 393 | 0, |
| 394 | 394 | data & 0x7fff, |
| 395 | 395 | 0, |
| 396 | 0) | |
| 396 | 0); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | |
| r814 | r815 | |
| 424 | 424 | gfx_bank, |
| 425 | 425 | data & 0x1fff, |
| 426 | 426 | (attr >>12) & 0xf, |
| 427 | 0) | |
| 427 | 0); | |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | INLINE void pangpang_get_bg2x_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index,int gfx_bank,UINT16 *gfx_base) |
| r814 | r815 | |
| 436 | 436 | gfx_bank, |
| 437 | 437 | (data & 0xfff)+0x1000, |
| 438 | 438 | (attr >>12) & 0xf, |
| 439 | 0) | |
| 439 | 0); | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
| r814 | r815 | |
| 452 | 452 | 0, |
| 453 | 453 | data & 0x1fff, |
| 454 | 454 | (attr >> 12)& 0x1f, |
| 455 | 0) | |
| 455 | 0); | |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | |
| 459 | 459 | VIDEO_START( pangpang ) |
| 460 | 460 | { |
| 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); | |
| 464 | 464 | |
| 465 | 465 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 466 | 466 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); |
| r814 | r815 | |
| 473 | 473 | |
| 474 | 474 | VIDEO_START( tumblepb ) |
| 475 | 475 | { |
| 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); | |
| 479 | 479 | |
| 480 | 480 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 481 | 481 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); |
| r814 | r815 | |
| 487 | 487 | |
| 488 | 488 | VIDEO_START( sdfight ) |
| 489 | 489 | { |
| 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); | |
| 493 | 493 | |
| 494 | 494 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 495 | 495 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); |
| r814 | r815 | |
| 502 | 502 | |
| 503 | 503 | VIDEO_START( fncywld ) |
| 504 | 504 | { |
| 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); | |
| 508 | 508 | |
| 509 | 509 | tilemap_set_transparent_pen(pf1_tilemap,15); |
| 510 | 510 | tilemap_set_transparent_pen(pf1_alt_tilemap,15); |
| r814 | r815 | |
| 516 | 516 | |
| 517 | 517 | VIDEO_START( jumppop ) |
| 518 | 518 | { |
| 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); | |
| 523 | 523 | |
| 524 | 524 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 525 | 525 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); |
| r814 | r815 | |
| 829 | 829 | |
| 830 | 830 | VIDEO_START( suprtrio ) |
| 831 | 831 | { |
| 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); | |
| 835 | 835 | |
| 836 | 836 | tilemap_set_transparent_pen(pf1_alt_tilemap,0); |
| 837 | 837 | bcstory_tilebank = 0; |
| r814 | r815 | |
|---|---|---|
| 48 | 48 | int code = videoram[tile_index] + ((colorram[tile_index] & 7) << 8); |
| 49 | 49 | int color = (colorram[tile_index] >> 3) & 0x1f; |
| 50 | 50 | |
| 51 | SET_TILE_INFO(0, code, color, 0) | |
| 51 | SET_TILE_INFO(0, code, color, 0); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | VIDEO_START( kchamp ) |
| 55 | 55 | { |
| 56 | 56 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 57 | TILEMAP_TYPE_ | |
| 57 | TILEMAP_TYPE_ | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /* |
| r814 | r815 | |
|---|---|---|
| 78 | 78 | ***************************************************************************/ |
| 79 | 79 | |
| 80 | 80 | /* convert from 32x32 to 36x28 */ |
| 81 | static | |
| 81 | static | |
| 82 | 82 | { |
| 83 | 83 | int offs; |
| 84 | 84 | |
| r814 | r815 | |
| 107 | 107 | 2, |
| 108 | 108 | code, |
| 109 | 109 | color | bg_color_bank, |
| 110 | 0) | |
| 110 | 0); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | static TILE_GET_INFO( tx_get_tile_info ) |
| r814 | r815 | |
| 134 | 134 | 0, |
| 135 | 135 | (code & 0x7f) | (flip_screen ? 0x80 : 0), |
| 136 | 136 | color, |
| 137 | flip_screen ? TILE_FLIPX : 0) | |
| 137 | flip_screen ? TILE_FLIPX : 0); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| r814 | r815 | |
| 147 | 147 | |
| 148 | 148 | VIDEO_START( digdug ) |
| 149 | 149 | { |
| 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); | |
| 152 | 152 | |
| 153 | 153 | tilemap_set_transparent_pen(tx_tilemap, 0); |
| 154 | 154 |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | |
| 43 | 43 | if (code & 0x20) |
| 44 | 44 | { |
| 45 | SET_TILE_INFO(0, code, code >> 6, 0) | |
| 45 | SET_TILE_INFO(0, code, code >> 6, 0); | |
| 46 | 46 | } |
| 47 | 47 | else |
| 48 | 48 | { |
| 49 | SET_TILE_INFO(0, code, 4, 0) | |
| 49 | SET_TILE_INFO(0, code, 4, 0); | |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| r814 | r815 | |
| 55 | 55 | { |
| 56 | 56 | helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 57 | 57 | |
| 58 | playfield = tilemap_create(ultratnk_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 58 | playfield = tilemap_create(ultratnk_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | 0, |
| 43 | 43 | tile, |
| 44 | 44 | 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; | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| r814 | r815 | |
| 55 | 55 | |
| 56 | 56 | VIDEO_START( m90 ) |
| 57 | 57 | { |
| 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); | |
| 62 | 62 | |
| 63 | 63 | tilemap_set_transparent_pen(pf1_layer,0); |
| 64 | 64 | tilemap_set_transparent_pen(pf1_wide_layer,0); |
| r814 | r815 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | // data & 0x80 -> tile priority? |
| 120 | 120 | |
| 121 | SET_TILE_INFO(0, code, color, flag) | |
| 121 | SET_TILE_INFO(0, code, color, flag); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /* Same as Jailbreak + palette bank */ |
| r814 | r815 | |
| 151 | 151 | |
| 152 | 152 | VIDEO_START( scotrsht ) |
| 153 | 153 | { |
| 154 | bg_tilemap = tilemap_create(scotrsht_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 154 | bg_tilemap = tilemap_create(scotrsht_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 155 | 155 | |
| 156 | 156 | tilemap_set_scroll_cols(bg_tilemap, 64); |
| 157 | 157 | } |
| r814 | r815 | |
|---|---|---|
| 236 | 236 | sprites as pdrawgfx cannot yet cope with more than 4 layers */ |
| 237 | 237 | |
| 238 | 238 | #ifdef MAME_DEBUG |
| 239 | if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_ | |
| 239 | if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_D | |
| 240 | 240 | if (!input_code_pressed (KEYCODE_X)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,1); |
| 241 | 241 | if (!input_code_pressed (KEYCODE_C)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,2); |
| 242 | 242 | if (!input_code_pressed (KEYCODE_V)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,4); |
| 243 | 243 | if (!input_code_pressed (KEYCODE_B)) TC0480SCP_tilemap_draw(bitmap,cliprect,layer[4],0,8); |
| 244 | 244 | if (!input_code_pressed (KEYCODE_N)) draw_sprites(machine,bitmap,cliprect,primasks,48,-116); |
| 245 | 245 | #else |
| 246 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_ | |
| 246 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_D | |
| 247 | 247 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,1); |
| 248 | 248 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,2); |
| 249 | 249 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,4); |
| r814 | r815 | |
|---|---|---|
| 885 | 885 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 886 | 886 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 887 | 887 | |
| 888 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 888 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 889 | 889 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1); |
| 890 | 890 | TC0150ROD_draw(bitmap,cliprect,-1,0xc0,0,0,1,2); |
| 891 | 891 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4); |
| r814 | r815 | |
| 910 | 910 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 911 | 911 | fillbitmap(bitmap, machine->pens[0],cliprect); |
| 912 | 912 | |
| 913 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 913 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 914 | 914 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1); |
| 915 | 915 | TC0150ROD_draw(bitmap,cliprect,-1,0xc0,0,1,1,2); |
| 916 | 916 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4); |
| r814 | r815 | |
| 935 | 935 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 936 | 936 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 937 | 937 | |
| 938 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 938 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 939 | 939 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1); |
| 940 | 940 | TC0150ROD_draw(bitmap,cliprect,-1,0xc0,0,0,1,2); |
| 941 | 941 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4); |
| r814 | r815 | |
| 960 | 960 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 961 | 961 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 962 | 962 | |
| 963 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 963 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 964 | 964 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1); |
| 965 | 965 | TC0150ROD_draw(bitmap,cliprect,-1,0,2,1,1,2); |
| 966 | 966 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4); |
| r814 | r815 | |
| 985 | 985 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 986 | 986 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 987 | 987 | |
| 988 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 988 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 989 | 989 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2); |
| 990 | 990 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4); |
| 991 | 991 | |
| r814 | r815 | |
| 1015 | 1015 | /* Ensure screen blanked - this shouldn't be necessary! */ |
| 1016 | 1016 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 1017 | 1017 | |
| 1018 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_ | |
| 1018 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_D | |
| 1019 | 1019 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,0); |
| 1020 | 1020 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,1); |
| 1021 | 1021 |
| r814 | r815 | |
|---|---|---|
| 135 | 135 | 1, |
| 136 | 136 | code, |
| 137 | 137 | (code >> 5) | (palette_bank << 3), |
| 138 | (tile_index & 0x1f) ? 0 : TILE_ | |
| 138 | (tile_index & 0x1f) ? 0 : TILE_F | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 147 | 147 | 0, |
| 148 | 148 | code, |
| 149 | 149 | (code >> 5) | (palette_bank << 3), |
| 150 | 0) | |
| 150 | 0); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| r814 | r815 | |
| 170 | 170 | current_videoram_pg = videoram_pg1; /* otherwise, hiscore loading crashes */ |
| 171 | 171 | |
| 172 | 172 | |
| 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); | |
| 175 | 175 | |
| 176 | 176 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 177 | 177 | tilemap_set_scrolldx(fg_tilemap,0,8); |
| r814 | r815 | |
|---|---|---|
| 27 | 27 | SET_TILE_INFO( 0, |
| 28 | 28 | tile_number, |
| 29 | 29 | 0x10, |
| 30 | 0) | |
| 30 | 0); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static TILE_GET_INFO( get_bg2_tile_info ) |
| r814 | r815 | |
| 40 | 40 | SET_TILE_INFO( gfx_b, |
| 41 | 41 | tile_number, |
| 42 | 42 | 0x20, |
| 43 | 0) | |
| 43 | 0); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 49 | 49 | SET_TILE_INFO( 1, |
| 50 | 50 | 0x100+tile_number, |
| 51 | 51 | 0x30, |
| 52 | 0) | |
| 52 | 0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /*************************************************************************** |
| r814 | r815 | |
| 60 | 60 | |
| 61 | 61 | VIDEO_START( msisaac ) |
| 62 | 62 | { |
| 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); | |
| 66 | 66 | |
| 67 | 67 | tilemap_set_transparent_pen(background2,0); |
| 68 | 68 | tilemap_set_transparent_pen(foreground,0); |
| r814 | r815 | |
|---|---|---|
| 68 | 68 | int code = videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3); |
| 69 | 69 | int color = (attr & 0x1f) | ((attr & 0x80) >> 2); |
| 70 | 70 | |
| 71 | SET_TILE_INFO(0, code, color, 0) | |
| 71 | SET_TILE_INFO(0, code, color, 0); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | VIDEO_START( markham ) |
| 75 | 75 | { |
| 76 | 76 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 77 | TILEMAP_TYPE_ | |
| 77 | TILEMAP_TYPE_ | |
| 78 | 78 | |
| 79 | 79 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 80 | 80 | } |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | int attr = superqix_videoram[tile_index + 0x400]; |
| 30 | 30 | int code = superqix_videoram[tile_index] + 256 * (attr & 0x7); |
| 31 | 31 | int color = (attr & 0xf0) >> 4; |
| 32 | SET_TILE_INFO(0, code, color, 0) | |
| 32 | SET_TILE_INFO(0, code, color, 0); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TILE_GET_INFO( sqix_get_bg_tile_info ) |
| r814 | r815 | |
| 41 | 41 | |
| 42 | 42 | if (bank) code += 1024 * gfxbank; |
| 43 | 43 | |
| 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; | |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | |
| r814 | r815 | |
| 54 | 55 | |
| 55 | 56 | VIDEO_START( pbillian ) |
| 56 | 57 | { |
| 57 | bg_tilemap = tilemap_create(pb_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 58 | bg_tilemap = tilemap_create(pb_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 58 | 59 | } |
| 59 | 60 | |
| 60 | 61 | VIDEO_START( superqix ) |
| 61 | 62 | { |
| 62 | 63 | fg_bitmap[0] = auto_bitmap_alloc(256, 256, machine->screen[0].format); |
| 63 | 64 | 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_ | |
| 65 | bg_tilemap = tilemap_create(sqix_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 65 | 66 | |
| 66 | 67 | tilemap_set_transmask(bg_tilemap,0,0xffff,0x0000); /* split type 0 is totally transparent in front half */ |
| 67 | 68 | tilemap_set_transmask(bg_tilemap,1,0x0001,0xfffe); /* split type 1 has pen 0 transparent in front half */ |
| r814 | r815 | |
| 251 | 252 | |
| 252 | 253 | VIDEO_UPDATE( superqix ) |
| 253 | 254 | { |
| 254 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 255 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0); | |
| 255 | 256 | copybitmap(bitmap,fg_bitmap[show_bitmap],flip_screen,flip_screen,0,0,cliprect,TRANSPARENCY_PEN,0); |
| 256 | 257 | superqix_draw_sprites(machine, bitmap,cliprect); |
| 257 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 258 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER0, 0); | |
| 258 | 259 | return 0; |
| 259 | 260 | } |
| r814 | r815 | |
|---|---|---|
| 92 | 92 | int code = videoram[offs] + ((videoram[offs + 1] & 0x07) << 8); |
| 93 | 93 | int color = (videoram[offs + 1] >> 3) & 0x1f; |
| 94 | 94 | |
| 95 | SET_TILE_INFO(0, code, color, 0) | |
| 95 | SET_TILE_INFO(0, code, color, 0); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | VIDEO_START( playch10 ) |
| 99 | 99 | { |
| 100 | 100 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 101 | TILEMAP_TYPE_ | |
| 101 | TILEMAP_TYPE_ | |
| 102 | 102 | |
| 103 | 103 | ppu2c0x_init(machine, &ppu_interface ); |
| 104 | 104 | } |
| r814 | r815 | |
|---|---|---|
| 198 | 198 | int code; |
| 199 | 199 | |
| 200 | 200 | code = dday_textvideoram[tile_index]; |
| 201 | SET_TILE_INFO(1, code, code >> 5, 0) | |
| 201 | SET_TILE_INFO(1, code, code >> 5, 0); | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | static TILE_GET_INFO( get_sl_tile_info ) |
| r814 | r815 | |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | SET_TILE_INFO(3, code & 0x3f, 0, flipx ? TILE_FLIPX : 0) | |
| 228 | SET_TILE_INFO(3, code & 0x3f, 0, flipx ? TILE_FLIPX : 0); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| r814 | r815 | |
| 237 | 237 | |
| 238 | 238 | VIDEO_START( dday ) |
| 239 | 239 | { |
| 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); | |
| 244 | 244 | |
| 245 | 245 | main_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 246 | 246 | |
| r814 | r815 | |
| 338 | 338 | |
| 339 | 339 | VIDEO_UPDATE( dday ) |
| 340 | 340 | { |
| 341 | tilemap_draw(main_bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 341 | tilemap_draw(main_bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 342 | 342 | tilemap_draw(main_bitmap,cliprect,fg_tilemap,0,0); |
| 343 | tilemap_draw(main_bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 343 | tilemap_draw(main_bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 344 | 344 | tilemap_draw(main_bitmap,cliprect,text_tilemap,0,0); |
| 345 | 345 | |
| 346 | 346 | if (sl_enable) |
| r814 | r815 | |
|---|---|---|
| 169 | 169 | atarimo_1_slipram = ¤t_slip[1]; |
| 170 | 170 | |
| 171 | 171 | /* initialize the playfield */ |
| 172 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 172 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 173 | 173 | |
| 174 | 174 | /* initialize the motion objects */ |
| 175 | 175 | atarimo_init(machine, 0, &mo0desc); |
| 176 | 176 | |
| 177 | 177 | /* initialize the alphanumerics */ |
| 178 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 178 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 179 | 179 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 180 | 180 | |
| 181 | 181 | /* allocate the second screen if necessary */ |
| 182 | 182 | if (screens == 2) |
| 183 | 183 | { |
| 184 | 184 | /* initialize the playfield */ |
| 185 | atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 185 | atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 186 | 186 | tilemap_set_scrollx(atarigen_playfield2_tilemap, 0, 0); |
| 187 | 187 | |
| 188 | 188 | /* initialize the motion objects */ |
| 189 | 189 | atarimo_init(machine, 1, &mo1desc); |
| 190 | 190 | |
| 191 | 191 | /* initialize the alphanumerics */ |
| 192 | atarigen_alpha2_tilemap = tilemap_create(get_alpha2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 192 | atarigen_alpha2_tilemap = tilemap_create(get_alpha2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 193 | 193 | tilemap_set_scrollx(atarigen_alpha2_tilemap, 0, 0); |
| 194 | 194 | tilemap_set_transparent_pen(atarigen_alpha2_tilemap, 0); |
| 195 | 195 | } |
| r814 | r815 | |
|---|---|---|
| 260 | 260 | ***************************************************************************/ |
| 261 | 261 | |
| 262 | 262 | /* convert from 32x32 to 36x28 */ |
| 263 | static | |
| 263 | static | |
| 264 | 264 | { |
| 265 | 265 | int offs; |
| 266 | 266 | |
| r814 | r815 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /* tilemap is a composition of a 32x60 scrolling portion and two 2x28 fixed portions on the sides */ |
| 278 | static | |
| 278 | static | |
| 279 | 279 | { |
| 280 | 280 | int offs; |
| 281 | 281 | |
| r814 | r815 | |
| 299 | 299 | static TILE_GET_INFO( superpac_get_tile_info ) |
| 300 | 300 | { |
| 301 | 301 | UINT8 attr = mappy_videoram[tile_index + 0x400]; |
| 302 | tileinfo-> | |
| 302 | tileinfo->categor | |
| 303 | 303 | SET_TILE_INFO( |
| 304 | 304 | 0, |
| 305 | 305 | mappy_videoram[tile_index], |
| 306 | 306 | attr & 0x3f, |
| 307 | 0) | |
| 307 | 0); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | static TILE_GET_INFO( phozon_get_tile_info ) |
| 311 | 311 | { |
| 312 | 312 | UINT8 attr = mappy_videoram[tile_index + 0x400]; |
| 313 | tileinfo-> | |
| 313 | tileinfo->categor | |
| 314 | 314 | SET_TILE_INFO( |
| 315 | 315 | 0, |
| 316 | 316 | mappy_videoram[tile_index] + ((attr & 0x80) << 1), |
| 317 | 317 | attr & 0x3f, |
| 318 | 0) | |
| 318 | 0); | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | static TILE_GET_INFO( mappy_get_tile_info ) |
| 322 | 322 | { |
| 323 | 323 | UINT8 attr = mappy_videoram[tile_index + 0x800]; |
| 324 | tileinfo-> | |
| 324 | tileinfo->categor | |
| 325 | 325 | SET_TILE_INFO( |
| 326 | 326 | 0, |
| 327 | 327 | mappy_videoram[tile_index], |
| 328 | 328 | attr & 0x3f, |
| 329 | 0) | |
| 329 | 0); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | |
| r814 | r815 | |
| 339 | 339 | |
| 340 | 340 | VIDEO_START( superpac ) |
| 341 | 341 | { |
| 342 | bg_tilemap = tilemap_create(superpac_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_ | |
| 342 | bg_tilemap = tilemap_create(superpac_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_ | |
| 343 | 343 | sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 344 | 344 | |
| 345 | 345 | tilemap_set_transparent_pen(bg_tilemap, 31); |
| r814 | r815 | |
| 351 | 351 | |
| 352 | 352 | VIDEO_START( phozon ) |
| 353 | 353 | { |
| 354 | bg_tilemap = tilemap_create(phozon_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_ | |
| 354 | bg_tilemap = tilemap_create(phozon_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_ | |
| 355 | 355 | |
| 356 | 356 | tilemap_set_transparent_pen(bg_tilemap, 15); |
| 357 | 357 | |
| r814 | r815 | |
| 362 | 362 | |
| 363 | 363 | VIDEO_START( mappy ) |
| 364 | 364 | { |
| 365 | bg_tilemap = tilemap_create(mappy_get_tile_info,mappy_tilemap_scan,TILEMAP_TYPE_ | |
| 365 | bg_tilemap = tilemap_create(mappy_get_tile_info,mappy_tilemap_scan,TILEMAP_TYPE_ | |
| 366 | 366 | |
| 367 | 367 | tilemap_set_transparent_pen(bg_tilemap, 31); |
| 368 | 368 | tilemap_set_scroll_cols(bg_tilemap, 36); |
| r814 | r815 | |
| 548 | 548 | { |
| 549 | 549 | int x,y; |
| 550 | 550 | |
| 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); | |
| 553 | 553 | |
| 554 | 554 | fillbitmap(sprite_bitmap,15,cliprect); |
| 555 | 555 | mappy_draw_sprites(machine,sprite_bitmap,cliprect,0,0,transmask); |
| r814 | r815 | |
| 575 | 575 | /* flip screen control is embedded in RAM */ |
| 576 | 576 | flip_screen_set(mappy_spriteram[0x1f7f-0x800] & 1); |
| 577 | 577 | |
| 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); | |
| 580 | 580 | |
| 581 | 581 | phozon_draw_sprites(machine,bitmap,cliprect); |
| 582 | 582 | |
| r814 | r815 | |
| 592 | 592 | for (offs = 2;offs < 34;offs++) |
| 593 | 593 | tilemap_set_scrolly(bg_tilemap,offs,mappy_scroll); |
| 594 | 594 | |
| 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); | |
| 597 | 597 | |
| 598 | 598 | mappy_draw_sprites(machine,bitmap,cliprect,0,0,transmask); |
| 599 | 599 |
| r814 | r815 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | fillbitmap(priority_bitmap,0,cliprect); |
| 106 | 106 | |
| 107 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 107 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 108 | 108 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[1],0,2); |
| 109 | 109 | |
| 110 | 110 | PC090OJ_draw_sprites(machine,bitmap,cliprect,0); |
| r814 | r815 | |
| 124 | 124 | |
| 125 | 125 | fillbitmap(priority_bitmap,0,cliprect); |
| 126 | 126 | |
| 127 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 127 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 128 | 128 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[1],0,2); |
| 129 | 129 | |
| 130 | 130 | PC090OJ_draw_sprites(machine,bitmap,cliprect,1); |
| r814 | r815 | |
| 149 | 149 | |
| 150 | 150 | fillbitmap(priority_bitmap,0,cliprect); |
| 151 | 151 | |
| 152 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 152 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 153 | 153 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[1],0,2); |
| 154 | 154 | |
| 155 | 155 | PC090OJ_draw_sprites(machine,bitmap,cliprect,1); |
| r814 | r815 | |
| 181 | 181 | |
| 182 | 182 | fillbitmap(priority_bitmap,0,cliprect); |
| 183 | 183 | |
| 184 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 184 | PC080SN_tilemap_draw(bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 185 | 185 | |
| 186 | 186 | /* Draw the sprites. 128 sprites in total */ |
| 187 | 187 | for (offs = spriteram_size/2-8; offs >= 0; offs -= 8) |
| r814 | r815 | |
|---|---|---|
| 117 | 117 | int attr = tilerom[tile_index + 1]; |
| 118 | 118 | int code = data + ((attr & 0xc0) << 2) + (bgcharbank << 10); |
| 119 | 119 | int color = attr & 0x0f; |
| 120 | int flags = ( | |
| 120 | int flags = ( | |
| 121 | 121 | |
| 122 | SET_TILE_INFO(1, code, color, flags) | |
| 122 | SET_TILE_INFO(1, code, color, flags); | |
| 123 | tileinfo->group = (attr & 0x10) ? 1 : 0; | |
| 123 | 124 | } |
| 124 | 125 | |
| 125 | 126 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 130 | 131 | int color = attr & 0x0f; |
| 131 | 132 | int flags = (attr & 0x10) ? TILE_FLIPY : 0; |
| 132 | 133 | |
| 133 | SET_TILE_INFO(0, code, color, flags) | |
| 134 | SET_TILE_INFO(0, code, color, flags); | |
| 134 | 135 | } |
| 135 | 136 | |
| 136 | static | |
| 137 | static | |
| 137 | 138 | { |
| 138 | 139 | /* logical (col,row) -> memory offset */ |
| 139 | 140 | return 2 * (col % 8) + 16 * ((127 - row) % 8) + 128 * (col / 8) + 2048 * ((127 - row) / 8); |
| r814 | r815 | |
| 142 | 143 | VIDEO_START( tigeroad ) |
| 143 | 144 | { |
| 144 | 145 | bg_tilemap = tilemap_create(get_bg_tile_info, tigeroad_tilemap_scan, |
| 145 | TILEMAP_TYPE_ | |
| 146 | TILEMAP_TYPE_ | |
| 146 | 147 | |
| 147 | 148 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 148 | TILEMAP_TYPE_ | |
| 149 | TILEMAP_TYPE_ | |
| 149 | 150 | |
| 150 | 151 | tilemap_set_transmask(bg_tilemap, 0, 0xffff, 0); |
| 151 | 152 | tilemap_set_transmask(bg_tilemap, 1, 0x1ff, 0xfe00); |
| r814 | r815 | |
| 155 | 156 | |
| 156 | 157 | VIDEO_UPDATE( tigeroad ) |
| 157 | 158 | { |
| 158 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 159 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0); | |
| 159 | 160 | draw_sprites(machine, bitmap, cliprect, 0); |
| 160 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 161 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER0, 1); | |
| 161 | 162 | //draw_sprites(machine, bitmap, cliprect, 1); draw priority sprites? |
| 162 | 163 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 2); |
| 163 | 164 | return 0; |
| r814 | r815 | |
|---|---|---|
| 302 | 302 | { |
| 303 | 303 | struct cache_entry *entry = auto_malloc(sizeof(struct cache_entry)); |
| 304 | 304 | |
| 305 | entry->tmap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 305 | entry->tmap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 306 | 306 | entry->page = 0xff; |
| 307 | 307 | entry->bank = 0; |
| 308 | 308 | entry->next = cache_head; |
| r814 | r815 | |
| 797 | 797 | |
| 798 | 798 | static TILE_GET_INFO( get_tile_info ) |
| 799 | 799 | { |
| 800 | struct cache_entry *entry = | |
| 800 | struct cache_entry *entry = pa | |
| 801 | 801 | UINT16 data = system32_videoram[(entry->page & 0x7f) * 0x200 + tile_index]; |
| 802 | 802 | SET_TILE_INFO(0, (entry->bank << 13) + (data & 0x1fff), (data >> 4) & 0x1ff, (data >> 14) & 3); |
| 803 | 803 | } |
| r814 | r815 | |
|---|---|---|
| 82 | 82 | }; |
| 83 | 83 | |
| 84 | 84 | /* initialize the playfield */ |
| 85 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 85 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 86 | 86 | |
| 87 | 87 | /* initialize the motion objects */ |
| 88 | 88 | atarimo_init(machine, 0, &modesc); |
| r814 | r815 | |
|---|---|---|
| 35 | 35 | 0, |
| 36 | 36 | tile, |
| 37 | 37 | color, |
| 38 | 0) | |
| 38 | 0); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static TILE_GET_INFO( get_pf1_tile_info ) |
| r814 | r815 | |
| 49 | 49 | 1, |
| 50 | 50 | tile, |
| 51 | 51 | color, |
| 52 | 0) | |
| 52 | 0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static TILE_GET_INFO( get_fix_tile_info ) |
| r814 | r815 | |
| 63 | 63 | 0, |
| 64 | 64 | tile, |
| 65 | 65 | color, |
| 66 | 0) | |
| 66 | 0); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| r814 | r815 | |
| 75 | 75 | |
| 76 | 76 | VIDEO_START( perfrman ) |
| 77 | 77 | { |
| 78 | pf1_tilemap = tilemap_create(get_pf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 78 | pf1_tilemap = tilemap_create(get_pf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 79 | 79 | |
| 80 | 80 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | VIDEO_START( slapfight ) |
| 84 | 84 | { |
| 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); | |
| 87 | 87 | |
| 88 | 88 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 89 | 89 | } |
| r814 | r815 | |
| 194 | 194 | tilemap_set_scrollx( pf1_tilemap ,0 , -16 ); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_ | |
| 197 | tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_D | |
| 198 | 198 | draw_sprites(machine, bitmap,cliprect,0); |
| 199 | 199 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); |
| 200 | 200 | draw_sprites(machine, bitmap,cliprect,0x80); |
| r814 | r815 | |
|---|---|---|
| 31 | 31 | if (code>0x7fff) |
| 32 | 32 | code &= 0x83ff; |
| 33 | 33 | |
| 34 | SET_TILE_INFO(1, code, col, 0) | |
| 34 | SET_TILE_INFO(1, code, col, 0); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 50 | 50 | col >>= 5; |
| 51 | 51 | col = (col & 3) | ((col & 4) << 1); |
| 52 | 52 | |
| 53 | SET_TILE_INFO(0, code, col, 0) | |
| 53 | SET_TILE_INFO(0, code, col, 0); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| r814 | r815 | |
| 59 | 59 | quizdna_bg_ram = auto_malloc(0x2000); |
| 60 | 60 | quizdna_fg_ram = auto_malloc(0x1000); |
| 61 | 61 | |
| 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 ); | |
| 64 | 64 | |
| 65 | 65 | tilemap_set_transparent_pen( quizdna_fg_tilemap,0 ); |
| 66 | 66 | } |
| r814 | r815 | |
|---|---|---|
| 170 | 170 | // bit&0x4 combines playfields |
| 171 | 171 | if ((deco16_priority&0x7)==0x5) |
| 172 | 172 | { |
| 173 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_ | |
| 173 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_D | |
| 174 | 174 | deco16_tilemap_34_combine_draw(bitmap,cliprect,0,32); |
| 175 | 175 | } |
| 176 | 176 | else if ((deco16_priority&0x7)==0x1 || (deco16_priority&0x7)==0x2) |
| 177 | 177 | { |
| 178 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 178 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 179 | 179 | deco16_tilemap_2_draw(bitmap,cliprect,0,8); |
| 180 | 180 | deco16_tilemap_3_draw(bitmap,cliprect,0,32); |
| 181 | 181 | } |
| 182 | 182 | else if ((deco16_priority&0x7)==0x3) |
| 183 | 183 | { |
| 184 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 184 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 185 | 185 | deco16_tilemap_2_draw(bitmap,cliprect,0,8); |
| 186 | 186 | |
| 187 | 187 | // This mode uses playfield 3 to shadow sprites & playfield 2 (instead of |
| 188 | 188 | // 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); | |
| 190 | 190 | } |
| 191 | 191 | else |
| 192 | 192 | { |
| 193 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_ | |
| 193 | deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_D | |
| 194 | 194 | deco16_tilemap_3_draw(bitmap,cliprect,0,8); |
| 195 | 195 | deco16_tilemap_2_draw(bitmap,cliprect,0,32); |
| 196 | 196 | } |
| r814 | r815 | |
|---|---|---|
| 73 | 73 | }; |
| 74 | 74 | |
| 75 | 75 | /* initialize the playfield */ |
| 76 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 76 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 77 | 77 | |
| 78 | 78 | /* initialize the motion objects */ |
| 79 | 79 | atarimo_init(machine, 0, &modesc); |
| r814 | r815 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | if (tile_index / 32 <= 6) |
| 190 | 190 | { |
| 191 | flag |= TILE_ | |
| 191 | flag |= TILE_F | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | SET_TILE_INFO(0, code, color & 0x3f, flag) | |
| 194 | SET_TILE_INFO(0, code, color & 0x3f, flag); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | |
| r814 | r815 | |
| 200 | 200 | { |
| 201 | 201 | int y; |
| 202 | 202 | |
| 203 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 203 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 204 | 204 | |
| 205 | 205 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 206 | 206 |
| r814 | r815 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | VIDEO_START( equites ) |
| 108 | 108 | { |
| 109 | charmap0 = tilemap_create(equites_charinfo, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 109 | charmap0 = tilemap_create(equites_charinfo, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 110 | 110 | tilemap_set_transparent_pen(charmap0, 0); |
| 111 | 111 | tilemap_set_scrolldx(charmap0, BMPAD, BMPAD); |
| 112 | 112 | tilemap_set_scrolldy(charmap0, BMPAD, BMPAD); |
| r814 | r815 | |
| 224 | 224 | |
| 225 | 225 | tmpbitmap = auto_bitmap_alloc(BMW, BMW, machine->screen[0].format); |
| 226 | 226 | |
| 227 | charmap0 = tilemap_create(splndrbt_char0info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 227 | charmap0 = tilemap_create(splndrbt_char0info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 228 | 228 | tilemap_set_transparent_pen(charmap0, 0); |
| 229 | 229 | tilemap_set_scrolldx(charmap0, 8, 8); |
| 230 | 230 | tilemap_set_scrolldy(charmap0, 32, 32); |
| 231 | 231 | |
| 232 | charmap1 = tilemap_create(splndrbt_char1info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 232 | charmap1 = tilemap_create(splndrbt_char1info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 233 | 233 | tilemap_set_transparent_pen(charmap1, 0); |
| 234 | 234 | tilemap_set_scrolldx(charmap1, 8, 8); |
| 235 | 235 | tilemap_set_scrolldy(charmap1, 32, 32); |
| r814 | r815 | |
|---|---|---|
| 179 | 179 | fillbitmap(priority_bitmap,0,cliprect); |
| 180 | 180 | if (gradius3_priority == 0) |
| 181 | 181 | { |
| 182 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_ | |
| 182 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_D | |
| 183 | 183 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4); |
| 184 | 184 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,1); |
| 185 | 185 | } |
| 186 | 186 | else |
| 187 | 187 | { |
| 188 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_ | |
| 188 | tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_D | |
| 189 | 189 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,2); |
| 190 | 190 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4); |
| 191 | 191 | } |
| r814 | r815 | |
|---|---|---|
| 101 | 101 | tilemap callbacks |
| 102 | 102 | ********************************************/ |
| 103 | 103 | |
| 104 | static | |
| 104 | static | |
| 105 | 105 | { |
| 106 | 106 | /* logical (col,row) -> memory offset */ |
| 107 | 107 | return (num_cols - 1 - col) * num_rows + row; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | static | |
| 110 | static | |
| 111 | 111 | { |
| 112 | 112 | /* logical (col,row) -> memory offset */ |
| 113 | 113 | return tile_offset[col * num_rows + row]; |
| r814 | r815 | |
| 120 | 120 | 2, |
| 121 | 121 | (0x80 == (tile_index & 0x80)) ? 16 : decocass_bgvideoram[tile_index] >> 4, |
| 122 | 122 | color, |
| 123 | 0) | |
| 123 | 0); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | static TILE_GET_INFO( get_bg_r_tile_info ) |
| r814 | r815 | |
| 130 | 130 | 2, |
| 131 | 131 | (0x00 == (tile_index & 0x80)) ? 16 : decocass_bgvideoram[tile_index] >> 4, |
| 132 | 132 | color, |
| 133 | TILE_FLIPY) | |
| 133 | TILE_FLIPY); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 141 | 141 | 0, |
| 142 | 142 | 256 * (attr & 3) + code, |
| 143 | 143 | color_center_bot & 1, |
| 144 | 0) | |
| 144 | 0); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /******************************************** |
| r814 | r815 | |
| 583 | 583 | char_dirty = auto_malloc(1024); |
| 584 | 584 | tile_dirty = auto_malloc(16); |
| 585 | 585 | |
| 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 ); | |
| 589 | 589 | |
| 590 | 590 | tilemap_set_transparent_pen( bg_tilemap_l, 0 ); |
| 591 | 591 | tilemap_set_transparent_pen( bg_tilemap_r, 0 ); |
| r814 | r815 | |
| 679 | 679 | { |
| 680 | 680 | clip = bg_tilemap_l_clip; |
| 681 | 681 | sect_rect(&clip,cliprect); |
| 682 | tilemap_draw(bitmap,&clip, bg_tilemap_l, TILEMAP_ | |
| 682 | tilemap_draw(bitmap,&clip, bg_tilemap_l, TILEMAP_D | |
| 683 | 683 | |
| 684 | 684 | clip = bg_tilemap_r_clip; |
| 685 | 685 | sect_rect(&clip,cliprect); |
| 686 | tilemap_draw(bitmap,&clip, bg_tilemap_r, TILEMAP_ | |
| 686 | tilemap_draw(bitmap,&clip, bg_tilemap_r, TILEMAP_D | |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | if (mode_set & 0x20) |
| r814 | r815 | |
|---|---|---|
| 152 | 152 | |
| 153 | 153 | colour |= sub1_colorbase << 4; |
| 154 | 154 | |
| 155 | SET_TILE_INFO(0, tileno, colour, 0) | |
| 155 | SET_TILE_INFO(0, tileno, colour, 0); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | VIDEO_START(gaiapols) |
| r814 | r815 | |
| 180 | 180 | K053936_wraparound_enable(0, 1); |
| 181 | 181 | K053936GP_set_offset(0, -10, 0); // floor tiles in demo loop2 (Elaine vs. boss) |
| 182 | 182 | |
| 183 | ult_936_tilemap = tilemap_create(get_gai_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 183 | ult_936_tilemap = tilemap_create(get_gai_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 184 | 184 | tilemap_set_transparent_pen(ult_936_tilemap, 0); |
| 185 | 185 | } |
| 186 | 186 | |
| r814 | r815 | |
| 194 | 194 | |
| 195 | 195 | colour = sub1_colorbase; |
| 196 | 196 | |
| 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); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | VIDEO_START(dadandrn) |
| r814 | r815 | |
| 224 | 224 | K053936_wraparound_enable(0, 1); |
| 225 | 225 | K053936GP_set_offset(0, -8, 0); // Brainy's laser |
| 226 | 226 | |
| 227 | ult_936_tilemap = tilemap_create(get_ult_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 227 | ult_936_tilemap = tilemap_create(get_ult_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 228 | 228 | tilemap_set_transparent_pen(ult_936_tilemap, 0); |
| 229 | 229 | } |
| 230 | 230 |
| r814 | r815 | |
|---|---|---|
| 76 | 76 | VIDEO_START( fromance ) |
| 77 | 77 | { |
| 78 | 78 | /* 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); | |
| 81 | 81 | |
| 82 | 82 | /* allocate local videoram */ |
| 83 | 83 | local_videoram[0] = auto_malloc(0x1000 * 3); |
| r814 | r815 | |
| 115 | 115 | VIDEO_START( nekkyoku ) |
| 116 | 116 | { |
| 117 | 117 | /* 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); | |
| 120 | 120 | |
| 121 | 121 | /* allocate local videoram */ |
| 122 | 122 | local_videoram[0] = auto_malloc(0x1000 * 3); |
| r814 | r815 | |
|---|---|---|
| 77 | 77 | ***************************************************************************/ |
| 78 | 78 | |
| 79 | 79 | /* convert from 32x32 to 36x28 */ |
| 80 | static | |
| 80 | static | |
| 81 | 81 | { |
| 82 | 82 | int offs; |
| 83 | 83 | |
| r814 | r815 | |
| 101 | 101 | 0, |
| 102 | 102 | skykid_textram[tile_index] | (flip_screen ? 0x100 : 0), |
| 103 | 103 | skykid_textram[tile_index + 0x400] & 0x3f, |
| 104 | flip_screen ? (TILE_FLIPY | TILE_FLIPX) : 0) | |
| 104 | flip_screen ? (TILE_FLIPY | TILE_FLIPX) : 0); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r814 | r815 | |
| 114 | 114 | 1, |
| 115 | 115 | code + ((attr & 0x01) << 8), |
| 116 | 116 | ((attr & 0x7e) >> 1) | ((attr & 0x01) << 6), |
| 117 | 0) | |
| 117 | 0); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| r814 | r815 | |
| 127 | 127 | |
| 128 | 128 | VIDEO_START( skykid ) |
| 129 | 129 | { |
| 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); | |
| 132 | 132 | |
| 133 | 133 | tilemap_set_transparent_pen(tx_tilemap, 0); |
| 134 | 134 |
| r814 | r815 | |
|---|---|---|
| 73 | 73 | }; |
| 74 | 74 | |
| 75 | 75 | /* initialize the playfield */ |
| 76 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 76 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 77 | 77 | |
| 78 | 78 | /* initialize the motion objects */ |
| 79 | 79 | atarimo_init(machine, 0, &modesc); |
| r814 | r815 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | static int quizpani_bgbank = 0, quizpani_txtbank = 0; |
| 15 | 15 | |
| 16 | static | |
| 16 | static | |
| 17 | 17 | { |
| 18 | 18 | /* logical (col,row) -> memory offset */ |
| 19 | 19 | return (row & 0x0f) + ((col & 0xff) << 4) + ((row & 0x70) << 8); |
| r814 | r815 | |
| 27 | 27 | 1, |
| 28 | 28 | (code & 0xfff) + (0x1000 * quizpani_bgbank), |
| 29 | 29 | code >> 12, |
| 30 | 0) | |
| 30 | 0); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static TILE_GET_INFO( txt_tile_info ) |
| r814 | r815 | |
| 38 | 38 | 0, |
| 39 | 39 | (code & 0xfff) + (0x1000 * quizpani_txtbank), |
| 40 | 40 | code >> 12, |
| 41 | 0) | |
| 41 | 0); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | WRITE16_HANDLER( quizpani_bg_videoram_w ) |
| r814 | r815 | |
| 73 | 73 | |
| 74 | 74 | VIDEO_START( quizpani ) |
| 75 | 75 | { |
| 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); | |
| 78 | 78 | tilemap_set_transparent_pen(txt_tilemap,15); |
| 79 | 79 | } |
| 80 | 80 |
| r814 | r815 | |
|---|---|---|
| 73 | 73 | 0, |
| 74 | 74 | code, |
| 75 | 75 | color, |
| 76 | TILE_FLIPYX(flipyx)) | |
| 76 | TILE_FLIPYX(flipyx)); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | WRITE8_HANDLER( gomoku_videoram_w ) |
| r814 | r815 | |
| 121 | 121 | |
| 122 | 122 | gomoku_bg_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 123 | 123 | |
| 124 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 124 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 125 | 125 | |
| 126 | 126 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 127 | 127 |
| r814 | r815 | |
|---|---|---|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| 97 | static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) | |
| 98 | { | |
| 99 | return num_cols * row + col; | |
| 100 | } | |
| 101 | ||
| 102 | ||
| 103 | 97 | static TILE_GET_INFO( get_tile_info1 ) |
| 104 | 98 | { |
| 105 | 99 | UINT8 code = firetrk_playfield_ram[tile_index]; |
| r814 | r815 | |
| 115 | 109 | color |= 4; |
| 116 | 110 | } |
| 117 | 111 | |
| 118 | SET_TILE_INFO(1, code & 0x3f, color, 0) | |
| 112 | SET_TILE_INFO(1, code & 0x3f, color, 0); | |
| 119 | 113 | } |
| 120 | 114 | |
| 121 | 115 | |
| r814 | r815 | |
| 171 | 165 | } |
| 172 | 166 | } |
| 173 | 167 | |
| 174 | SET_TILE_INFO(2, code & 0x3f, color, 0) | |
| 168 | SET_TILE_INFO(2, code & 0x3f, color, 0); | |
| 175 | 169 | } |
| 176 | 170 | |
| 177 | 171 | |
| r814 | r815 | |
| 296 | 290 | helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 297 | 291 | helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 298 | 292 | |
| 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); | |
| 301 | 295 | |
| 302 | 296 | memset(&car[0], 0, sizeof (struct sprite_data)); |
| 303 | 297 | memset(&car[1], 0, sizeof (struct sprite_data)); |
| r814 | r815 | |
|---|---|---|
| 81 | 81 | int code = videoram[2 * tile_index] + ((attr & 0x60) << 3) + ((control_byte & 0x08) << 7); |
| 82 | 82 | int color = attr & 0x0f; |
| 83 | 83 | |
| 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) ); | |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | } |
| r814 | r815 | |
| 89 | 89 | VIDEO_START( mustache ) |
| 90 | 90 | { |
| 91 | 91 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_x, |
| 92 | TILEMAP_TYPE_ | |
| 92 | TILEMAP_TYPE_ | |
| 93 | 93 | |
| 94 | 94 | tilemap_set_scroll_rows(bg_tilemap, 4); |
| 95 | 95 | } |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | fillbitmap(priority_bitmap, 0, cliprect); |
| 50 | 50 | |
| 51 | 51 | /* 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); | |
| 54 | 54 | |
| 55 | 55 | /* draw background again, just to set the priorities on non-transparent pixels */ |
| 56 | 56 | segaic16_tilemap_draw(machine, 0, NULL, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01); |
| r814 | r815 | |
|---|---|---|
| 27 | 27 | colour = (psac_colorbase << 4); |
| 28 | 28 | flipx = 0; |
| 29 | 29 | |
| 30 | SET_TILE_INFO(0, tileno, colour, TILE_FLIPYX(flipx)) | |
| 30 | SET_TILE_INFO(0, tileno, colour, TILE_FLIPYX(flipx)); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /* Soccer Superstars (tile and flip bits now TRUSTED) */ |
| r814 | r815 | |
| 43 | 43 | if (tmap[(tile_index*2)+1] & 0x20) flip |= TILE_FLIPX; |
| 44 | 44 | if (tmap[(tile_index*2)+1] & 0x10) flip |= TILE_FLIPY; |
| 45 | 45 | |
| 46 | SET_TILE_INFO(0, tileno, colour, flip) | |
| 46 | SET_TILE_INFO(0, tileno, colour, flip); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /* PSAC4 */ |
| r814 | r815 | |
| 63 | 63 | if (flipx) flip |= TILE_FLIPX; |
| 64 | 64 | if (flipy) flip |= TILE_FLIPY; |
| 65 | 65 | |
| 66 | SET_TILE_INFO(1, tileno, colour, flip) | |
| 66 | SET_TILE_INFO(1, tileno, colour, flip); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static TILE_GET_INFO( get_gx_psac1b_tile_info ) |
| r814 | r815 | |
| 80 | 80 | if (flipx) flip |= TILE_FLIPX; |
| 81 | 81 | if (flipy) flip |= TILE_FLIPY; |
| 82 | 82 | |
| 83 | SET_TILE_INFO(0, tileno, colour, flip) | |
| 83 | SET_TILE_INFO(0, tileno, colour, flip); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static void konamigx_type2_tile_callback(int layer, int *code, int *color, int *flags) |
| r814 | r815 | |
| 273 | 273 | |
| 274 | 274 | _gxcommoninit(machine); |
| 275 | 275 | |
| 276 | gx_psac_tilemap = tilemap_create(get_gx_psac3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 276 | gx_psac_tilemap = tilemap_create(get_gx_psac3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 277 | 277 | gx_rozenable = 1; |
| 278 | 278 | |
| 279 | 279 | K053936_wraparound_enable(0, 1); |
| r814 | r815 | |
| 286 | 286 | |
| 287 | 287 | _gxcommoninit(machine); |
| 288 | 288 | |
| 289 | gx_psac_tilemap = tilemap_create(get_gx_psac_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 289 | gx_psac_tilemap = tilemap_create(get_gx_psac_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 290 | 290 | gx_rozenable = 1; |
| 291 | 291 | |
| 292 | 292 | K053936_wraparound_enable(0, 0); |
| r814 | r815 | |
| 321 | 321 | K056832_set_LayerOffset(2, 2+1, 0); |
| 322 | 322 | K056832_set_LayerOffset(3, 3+1, 0); |
| 323 | 323 | |
| 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); | |
| 326 | 326 | tilemap_set_transparent_pen(gx_psac_tilemap, 0); |
| 327 | 327 | tilemap_set_transparent_pen(gx_psac_tilemap2, 0); |
| 328 | 328 | |
| r814 | r815 | |
| 341 | 341 | K056832_set_LayerOffset(2, 2+1, 0); |
| 342 | 342 | K056832_set_LayerOffset(3, 3+1, 0); |
| 343 | 343 | |
| 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); | |
| 346 | 346 | tilemap_set_transparent_pen(gx_psac_tilemap, 0); |
| 347 | 347 | tilemap_set_transparent_pen(gx_psac_tilemap2, 0); |
| 348 | 348 |
| r814 | r815 | |
|---|---|---|
| 84 | 84 | 0, |
| 85 | 85 | tile_number, |
| 86 | 86 | (attr&0xf0)>>4, |
| 87 | (attr&0x08)?TILE_FLIPX:0) | |
| 87 | (attr&0x08)?TILE_FLIPX:0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static TILE_GET_INFO( get_sprcros2_fgtile_info ) |
| r814 | r815 | |
| 103 | 103 | 2, |
| 104 | 104 | tile_number, |
| 105 | 105 | (attr&0xfc)>>2, |
| 106 | 0) | |
| 106 | 0); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | VIDEO_START( sprcros2 ) |
| 110 | 110 | { |
| 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 ); | |
| 113 | 113 | |
| 114 | 114 | tilemap_set_transparent_pen(sprcros2_fgtilemap,0); |
| 115 | 115 | } |
| r814 | r815 | |
|---|---|---|
| 32 | 32 | int code = ((data & 0x200) ? (thunderj_alpha_tile_bank * 0x200) : 0) + (data & 0x1ff); |
| 33 | 33 | int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20); |
| 34 | 34 | int opaque = data & 0x8000; |
| 35 | SET_TILE_INFO(2, code, color, opaque ? TILE_ | |
| 35 | SET_TILE_INFO(2, code, color, opaque ? TILE_F | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| r814 | r815 | |
| 43 | 43 | int code = data1 & 0x7fff; |
| 44 | 44 | int color = 0x10 + (data2 & 0x0f); |
| 45 | 45 | SET_TILE_INFO(0, code, color, (data1 >> 15) & 1); |
| 46 | tileinfo-> | |
| 46 | tileinfo->categor | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| r814 | r815 | |
| 54 | 54 | int code = data1 & 0x7fff; |
| 55 | 55 | int color = data2 & 0x0f; |
| 56 | 56 | SET_TILE_INFO(0, code, color, (data1 >> 15) & 1); |
| 57 | tileinfo-> | |
| 57 | tileinfo->categor | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| r814 | r815 | |
| 105 | 105 | }; |
| 106 | 106 | |
| 107 | 107 | /* initialize the playfield */ |
| 108 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 108 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 109 | 109 | |
| 110 | 110 | /* initialize the second playfield */ |
| 111 | atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 111 | atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 112 | 112 | tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0); |
| 113 | 113 | |
| 114 | 114 | /* initialize the motion objects */ |
| 115 | 115 | atarimo_init(machine, 0, &modesc); |
| 116 | 116 | |
| 117 | 117 | /* initialize the alphanumerics */ |
| 118 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 118 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 119 | 119 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 120 | 120 | } |
| 121 | 121 |
| r814 | r815 | |
|---|---|---|
| 64 | 64 | zoom_colorbase[2] = 128; |
| 65 | 65 | |
| 66 | 66 | 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); | |
| 70 | 70 | |
| 71 | 71 | K051316_set_offset(0, 8, 0); |
| 72 | 72 | K051316_set_offset(1, 8, 0); |
| r814 | r815 | |
|---|---|---|
| 308 | 308 | int code = videoram[tile_index] + 32 * (colorram[tile_index] & 0x08); |
| 309 | 309 | int color = colorram[tile_index] & 0x07; |
| 310 | 310 | |
| 311 | SET_TILE_INFO(0, code, color, 0) | |
| 311 | SET_TILE_INFO(0, code, color, 0); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static TILE_GET_INFO( get_grid_tile_info ) |
| 315 | 315 | { |
| 316 | 316 | if (tile_index < 512) |
| 317 | SET_TILE_INFO(3, tile_index, 0, 0) | |
| 317 | SET_TILE_INFO(3, tile_index, 0, 0); | |
| 318 | 318 | else |
| 319 | 319 | { |
| 320 | 320 | int temp = tile_index/32; |
| 321 | 321 | 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); | |
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | VIDEO_START( ladybug ) |
| 327 | 327 | { |
| 328 | 328 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 329 | TILEMAP_TYPE_ | |
| 329 | TILEMAP_TYPE_ | |
| 330 | 330 | |
| 331 | 331 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 332 | 332 | } |
| r814 | r815 | |
| 334 | 334 | VIDEO_START( sraider ) |
| 335 | 335 | { |
| 336 | 336 | grid_tilemap = tilemap_create(get_grid_tile_info, tilemap_scan_rows, |
| 337 | TILEMAP_TYPE_ | |
| 337 | TILEMAP_TYPE_ | |
| 338 | 338 | |
| 339 | 339 | tilemap_set_scroll_rows(grid_tilemap, 32); |
| 340 | 340 | |
| 341 | 341 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 342 | TILEMAP_TYPE_ | |
| 342 | TILEMAP_TYPE_ | |
| 343 | 343 | |
| 344 | 344 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 345 | 345 |
| r814 | r815 | |
|---|---|---|
| 110 | 110 | 0, |
| 111 | 111 | number, |
| 112 | 112 | color, |
| 113 | 0) | |
| 114 | tileinfo->priority = (attributes & 0x40) >> 6; | |
| 113 | 0); | |
| 114 | tileinfo->category = (attributes & 0x40) >> 6; | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | static TILE_GET_INFO( get_tile_info1 ) |
| r814 | r815 | |
| 135 | 135 | 1, |
| 136 | 136 | number, |
| 137 | 137 | color, |
| 138 | 0) | |
| 139 | tileinfo->priority = (attributes & 0x40) >> 6; | |
| 138 | 0); | |
| 139 | tileinfo->category = (attributes & 0x40) >> 6; | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | static TILE_GET_INFO( get_text_info ) |
| r814 | r815 | |
| 149 | 149 | 0, |
| 150 | 150 | number, |
| 151 | 151 | color, |
| 152 | 0) | |
| 152 | 0); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| r814 | r815 | |
| 174 | 174 | 0, |
| 175 | 175 | number, |
| 176 | 176 | color, |
| 177 | 0) | |
| 177 | 0); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | static TILE_GET_INFO( get_tile_info1_bootleg ) |
| r814 | r815 | |
| 198 | 198 | 1, |
| 199 | 199 | number, |
| 200 | 200 | color, |
| 201 | 0) | |
| 201 | 0); | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | static TILE_GET_INFO( get_text_info_bootleg ) |
| r814 | r815 | |
| 211 | 211 | 1, |
| 212 | 212 | number, |
| 213 | 213 | color, |
| 214 | 0) | |
| 214 | 0); | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | /*************************************************************************** |
| r814 | r815 | |
| 224 | 224 | { |
| 225 | 225 | combasc_vreg = -1; |
| 226 | 226 | |
| 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); | |
| 230 | 230 | |
| 231 | 231 | private_spriteram[0] = auto_malloc(0x800); |
| 232 | 232 | private_spriteram[1] = auto_malloc(0x800); |
| r814 | r815 | |
| 244 | 244 | { |
| 245 | 245 | combasc_vreg = -1; |
| 246 | 246 | |
| 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); | |
| 250 | 250 | |
| 251 | 251 | private_spriteram[0] = auto_malloc(0x800); |
| 252 | 252 | private_spriteram[1] = auto_malloc(0x800); |
| r814 | r815 | |
| 255 | 255 | |
| 256 | 256 | tilemap_set_transparent_pen(bg_tilemap[0],0); |
| 257 | 257 | tilemap_set_transparent_pen(bg_tilemap[1],0); |
| 258 | tilemap_set_transparent_pen(textlayer,0); | |
| 259 | 258 | |
| 260 | 259 | tilemap_set_scroll_rows(bg_tilemap[0],32); |
| 261 | 260 | tilemap_set_scroll_rows(bg_tilemap[1],32); |
| r814 | r815 | |
| 490 | 489 | |
| 491 | 490 | if (priority == 0) |
| 492 | 491 | { |
| 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); | |
| 495 | 494 | tilemap_draw(bitmap,cliprect,bg_tilemap[0],0,1); |
| 496 | 495 | tilemap_draw(bitmap,cliprect,bg_tilemap[0],1,2); |
| 497 | 496 | |
| r814 | r815 | |
| 501 | 500 | } |
| 502 | 501 | else |
| 503 | 502 | { |
| 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); | |
| 506 | 505 | tilemap_draw(bitmap,cliprect,bg_tilemap[1],1,4); |
| 507 | 506 | tilemap_draw(bitmap,cliprect,bg_tilemap[1],0,8); |
| 508 | 507 | |
| r814 | r815 | |
| 623 | 622 | |
| 624 | 623 | if (priority == 0) |
| 625 | 624 | { |
| 626 | tilemap_draw( bitmap,cliprect,bg_tilemap[1],TILEMAP_ | |
| 625 | tilemap_draw( bitmap,cliprect,bg_tilemap[1],TILEMAP_D | |
| 627 | 626 | bootleg_draw_sprites(machine, bitmap,cliprect, combasc_page[0], 0 ); |
| 628 | 627 | tilemap_draw( bitmap,cliprect,bg_tilemap[0],0 ,0); |
| 629 | 628 | bootleg_draw_sprites(machine, bitmap,cliprect, combasc_page[1], 1 ); |
| 630 | 629 | } |
| 631 | 630 | else |
| 632 | 631 | { |
| 633 | tilemap_draw( bitmap,cliprect,bg_tilemap[0],TILEMAP_ | |
| 632 | tilemap_draw( bitmap,cliprect,bg_tilemap[0],TILEMAP_D | |
| 634 | 633 | bootleg_draw_sprites(machine, bitmap,cliprect, combasc_page[0], 0 ); |
| 635 | 634 | tilemap_draw( bitmap,cliprect,bg_tilemap[1],0 ,0); |
| 636 | 635 | bootleg_draw_sprites(machine, bitmap,cliprect, combasc_page[1], 1 ); |
| r814 | r815 | |
|---|---|---|
| 74 | 74 | int code = videoram[tile_index] + 256 * gfx_bank; |
| 75 | 75 | int color = attr & 0x7f; |
| 76 | 76 | |
| 77 | tileinfo-> | |
| 77 | tileinfo->categor | |
| 78 | 78 | |
| 79 | SET_TILE_INFO(0, code, color, 0) | |
| 79 | SET_TILE_INFO(0, code, color, 0); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | VIDEO_START( blueprnt ) |
| 83 | 83 | { |
| 84 | 84 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x, |
| 85 | TILEMAP_TYPE_ | |
| 85 | TILEMAP_TYPE_ | |
| 86 | 86 | |
| 87 | 87 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 88 | 88 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| r814 | r815 | |
|---|---|---|
| 86 | 86 | { |
| 87 | 87 | K007342_tilemap_update(); |
| 88 | 88 | |
| 89 | K007342_tilemap_draw( bitmap,cliprect, 0, TILEMAP_ | |
| 89 | K007342_tilemap_draw( bitmap,cliprect, 0, TILEMAP_D | |
| 90 | 90 | K007420_sprites_draw( bitmap,cliprect ); |
| 91 | K007342_tilemap_draw( bitmap,cliprect, 0, 1 | TILEMAP_ | |
| 91 | K007342_tilemap_draw( bitmap,cliprect, 0, 1 | TILEMAP_D | |
| 92 | 92 | K007342_tilemap_draw( bitmap,cliprect, 1, 0 ,0); |
| 93 | 93 | K007342_tilemap_draw( bitmap,cliprect, 1, 1 ,0); |
| 94 | 94 | return 0; |
| r814 | r815 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | ||
| 16 | static TILEMAP_MAPPER( gotcha_tilemap_scan | |
| 17 | 17 | { |
| 18 | 18 | return (col & 0x1f) | (row << 5) | ((col & 0x20) << 5); |
| 19 | 19 | } |
| r814 | r815 | |
| 23 | 23 | UINT16 data = vram[tile_index]; |
| 24 | 24 | int code = (data & 0x3ff) | (gfxbank[(data & 0x0c00) >> 10] << 10); |
| 25 | 25 | |
| 26 | SET_TILE_INFO(0,code,(data >> 12) + color_offs,0) | |
| 26 | SET_TILE_INFO(0,code,(data >> 12) + color_offs,0); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | static TILE_GET_INFO( fg_get_tile_info ) { get_tile_info(machine,tileinfo,tile_index,gotcha_fgvideoram, 0); } |
| r814 | r815 | |
| 39 | 39 | |
| 40 | 40 | VIDEO_START( gotcha ) |
| 41 | 41 | { |
| 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); | |
| 44 | 44 | |
| 45 | 45 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 46 | 46 |
| r814 | r815 | |
|---|---|---|
| 37 | 37 | static tilemap* bg_tilemap; |
| 38 | 38 | |
| 39 | 39 | |
| 40 | static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) | |
| 41 | { | |
| 42 | return num_cols * row + col; | |
| 43 | } | |
| 44 | ||
| 45 | ||
| 46 | 40 | static TILE_GET_INFO( get_tile_info ) |
| 47 | 41 | { |
| 48 | 42 | UINT8 code = starshp1_playfield_ram[tile_index]; |
| 49 | 43 | |
| 50 | SET_TILE_INFO(0, code & 0x3f, 0, 0) | |
| 44 | SET_TILE_INFO(0, code & 0x3f, 0, 0); | |
| 51 | 45 | } |
| 52 | 46 | |
| 53 | 47 | |
| r814 | r815 | |
| 57 | 51 | |
| 58 | 52 | int i; |
| 59 | 53 | |
| 60 | bg_tilemap = tilemap_create(get_tile_info, | |
| 54 | bg_tilemap = tilemap_create(get_tile_info, | |
| 61 | 55 | |
| 62 | 56 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 63 | 57 |
| r814 | r815 | |
|---|---|---|
| 78 | 78 | 0, |
| 79 | 79 | videoram[tile_index] + ((attr & 0x10) << 4), |
| 80 | 80 | 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; | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /*************************************************************************** |
| r814 | r815 | |
| 90 | 90 | |
| 91 | 91 | VIDEO_START( pandoras ) |
| 92 | 92 | { |
| 93 | layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 93 | layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /*************************************************************************** |
| r814 | r815 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | /* Tilemaps */ |
| 53 | 53 | |
| 54 | static | |
| 54 | static | |
| 55 | 55 | { |
| 56 | 56 | int offset; |
| 57 | 57 | |
| r814 | r815 | |
| 69 | 69 | tileno = bsb_videoram[tile_index] & 0x0fff; |
| 70 | 70 | col= bsb_videoram[tile_index] & 0xf000; |
| 71 | 71 | |
| 72 | SET_TILE_INFO(0,tileno,col>>12,0) | |
| 72 | SET_TILE_INFO(0,tileno,col>>12,0); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | WRITE16_HANDLER( bsb_videoram_w ) |
| r814 | r815 | |
| 85 | 85 | tileno = bsb_videoram2[tile_index] & 0x0fff; |
| 86 | 86 | col= bsb_videoram2[tile_index] & 0xf000; |
| 87 | 87 | |
| 88 | SET_TILE_INFO(1,tileno,col>>12,0) | |
| 88 | SET_TILE_INFO(1,tileno,col>>12,0); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | WRITE16_HANDLER( bsb_videoram2_w ) |
| r814 | r815 | |
| 102 | 102 | tileno = bsb_videoram3[tile_index] & 0x0fff; |
| 103 | 103 | col= bsb_videoram3[tile_index] & 0xf000; |
| 104 | 104 | |
| 105 | SET_TILE_INFO(1,tileno+0x2000,(col>>12)+(0x100/16),0) | |
| 105 | SET_TILE_INFO(1,tileno+0x2000,(col>>12)+(0x100/16),0); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | WRITE16_HANDLER( bsb_videoram3_w ) |
| r814 | r815 | |
| 115 | 115 | |
| 116 | 116 | VIDEO_START(bigstrkb) |
| 117 | 117 | { |
| 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); | |
| 121 | 121 | |
| 122 | 122 | tilemap_set_transparent_pen(bsb_tilemap,15); |
| 123 | 123 | // tilemap_set_transparent_pen(bsb_tilemap2,15); |
| r814 | r815 | |
|---|---|---|
| 100 | 100 | int color = attr & 0x0f; |
| 101 | 101 | int flags = TILE_FLIPYX((attr & 0x30) >> 4); |
| 102 | 102 | |
| 103 | tileinfo-> | |
| 103 | tileinfo->categor | |
| 104 | 104 | |
| 105 | 105 | SET_TILE_INFO(0, code, color, flags); |
| 106 | 106 | } |
| r814 | r815 | |
| 108 | 108 | VIDEO_START( gberet ) |
| 109 | 109 | { |
| 110 | 110 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 111 | TILEMAP_TYPE_ | |
| 111 | TILEMAP_TYPE_ | |
| 112 | 112 | |
| 113 | 113 | tilemap_set_transparent_pen(bg_tilemap, 0x10); |
| 114 | 114 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| r814 | r815 | |
| 152 | 152 | |
| 153 | 153 | VIDEO_UPDATE( gberet ) |
| 154 | 154 | { |
| 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); | |
| 157 | 157 | gberet_draw_sprites(machine, bitmap, cliprect); |
| 158 | 158 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 159 | 159 | return 0; |
| r814 | r815 | |
| 204 | 204 | |
| 205 | 205 | VIDEO_UPDATE( gberetb ) |
| 206 | 206 | { |
| 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); | |
| 209 | 209 | gberetb_draw_sprites(machine, bitmap, cliprect); |
| 210 | 210 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 211 | 211 | return 0; |
| r814 | r815 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | ***************************************************************************/ |
| 89 | 89 | |
| 90 | static | |
| 90 | static | |
| 91 | 91 | { |
| 92 | 92 | /* logical (col,row) -> memory offset */ |
| 93 | 93 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x70) << 4) + ((row & 0xf0) << 7); |
| r814 | r815 | |
| 105 | 105 | 1, |
| 106 | 106 | tile_base + fgMap[tile_index], |
| 107 | 107 | attr & 0x07, |
| 108 | 0) | |
| 108 | 0); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | static | |
| 111 | static | |
| 112 | 112 | { |
| 113 | 113 | /* logical (col,row) -> memory offset */ |
| 114 | 114 | return ((col & 0x0e) >> 1) + ((row & 0x0f) << 3) + ((col & 0x70) << 3) + |
| r814 | r815 | |
| 129 | 129 | 2+tile_bank, |
| 130 | 130 | tile_base + bgMap[tile_index], |
| 131 | 131 | attr & 0x07, |
| 132 | 0) | |
| 132 | 0); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 140 | 140 | 0, |
| 141 | 141 | stfight_text_char_ram[tile_index] + ((attr & 0x80) << 1), |
| 142 | 142 | attr & 0x0f, |
| 143 | TILE_FLIPYX((attr & 0x60) >> 5)) | |
| 143 | TILE_FLIPYX((attr & 0x60) >> 5)); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
| r814 | r815 | |
| 152 | 152 | |
| 153 | 153 | VIDEO_START( stfight ) |
| 154 | 154 | { |
| 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); | |
| 157 | 157 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, |
| 158 | TILEMAP_TYPE_ | |
| 158 | TILEMAP_TYPE_ | |
| 159 | 159 | |
| 160 | 160 | tilemap_set_transparent_pen(fg_tilemap,0x0F); |
| 161 | 161 | tilemap_set_transparent_pen(tx_tilemap,256); |
| r814 | r815 | |
|---|---|---|
| 152 | 152 | { |
| 153 | 153 | int code = videoram[tile_index]; |
| 154 | 154 | |
| 155 | SET_TILE_INFO(0, code^swap_bg_ramrom, 0, 0) | |
| 155 | SET_TILE_INFO(0, code^swap_bg_ramrom, 0, 0); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | static void gottlieb_video_start_common(void) |
| 159 | 159 | { |
| 160 | 160 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 161 | TILEMAP_TYPE_ | |
| 161 | TILEMAP_TYPE_ | |
| 162 | 162 | |
| 163 | 163 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 164 | 164 | } |
| r814 | r815 | |
| 204 | 204 | { |
| 205 | 205 | if (!background_priority) |
| 206 | 206 | { |
| 207 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_ | |
| 207 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_D | |
| 208 | 208 | } |
| 209 | 209 | else |
| 210 | 210 | { |
| r814 | r815 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | ***************************************************************************/ |
| 62 | 62 | |
| 63 | static | |
| 63 | static | |
| 64 | 64 | { |
| 65 | 65 | /* logical (col,row) -> memory offset */ |
| 66 | 66 | return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5); |
| r814 | r815 | |
| 73 | 73 | 2, |
| 74 | 74 | ddragon_bgvideoram[2*tile_index+1] + ((attr & 0x07) << 8), |
| 75 | 75 | (attr >> 3) & 0x07, |
| 76 | TILE_FLIPYX((attr & 0xc0) >> 6)) | |
| 76 | TILE_FLIPYX((attr & 0xc0) >> 6)); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 83 | 83 | 0, |
| 84 | 84 | ddragon_fgvideoram[2*tile_index+1] + ((attr & 0x07) << 8), |
| 85 | 85 | attr >> 5, |
| 86 | 0) | |
| 86 | 0); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static TILE_GET_INFO( get_fg_16color_tile_info ) |
| r814 | r815 | |
| 93 | 93 | 0, |
| 94 | 94 | ddragon_fgvideoram[2*tile_index+1] + ((attr & 0x0f) << 8), |
| 95 | 95 | attr >> 4, |
| 96 | 0) | |
| 96 | 0); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| r814 | r815 | |
| 105 | 105 | |
| 106 | 106 | VIDEO_START( ddragon ) |
| 107 | 107 | { |
| 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); | |
| 110 | 110 | |
| 111 | 111 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | VIDEO_START( chinagat ) |
| 115 | 115 | { |
| 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); | |
| 118 | 118 | |
| 119 | 119 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 120 | 120 | } |
| r814 | r815 | |
|---|---|---|
| 502 | 502 | |
| 503 | 503 | VIDEO_START( mrokumei ) |
| 504 | 504 | { |
| 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 ); | |
| 509 | 509 | |
| 510 | 510 | tilemap_set_transparent_pen(bg_tilemap[0][1],0); |
| 511 | 511 | tilemap_set_transparent_pen(bg_tilemap[1][1],0); |
| r814 | r815 | |
| 513 | 513 | |
| 514 | 514 | VIDEO_START( reikaids ) |
| 515 | 515 | { |
| 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 ); | |
| 524 | 524 | |
| 525 | 525 | tilemap_set_transparent_pen(bg_tilemap[0][0],0xff); |
| 526 | 526 | tilemap_set_transparent_pen(bg_tilemap[0][1],0xff); |
| r814 | r815 | |
| 534 | 534 | |
| 535 | 535 | VIDEO_START( pteacher ) |
| 536 | 536 | { |
| 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 ); | |
| 541 | 541 | |
| 542 | 542 | tilemap_set_transparent_pen(bg_tilemap[0][1],0xff); |
| 543 | 543 | tilemap_set_transparent_pen(bg_tilemap[1][1],0xff); |
| r814 | r815 | |
| 545 | 545 | |
| 546 | 546 | VIDEO_START( lemnangl ) |
| 547 | 547 | { |
| 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 ); | |
| 552 | 552 | |
| 553 | 553 | tilemap_set_transparent_pen(bg_tilemap[0][1],0x0f); |
| 554 | 554 | tilemap_set_transparent_pen(bg_tilemap[1][1],0x0f); |
| r814 | r815 | |
|---|---|---|
| 80 | 80 | colour = mugsmash_videoram1[tile_index *2] & 0x000f; |
| 81 | 81 | fx = (mugsmash_videoram1[tile_index *2] & 0xc0) >>6; |
| 82 | 82 | |
| 83 | SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(fx)) | |
| 83 | SET_TILE_INFO(1,tileno,colour,TILE_FLIPYX(fx)); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | WRITE16_HANDLER( mugsmash_videoram1_w ) |
| r814 | r815 | |
| 106 | 106 | colour = mugsmash_videoram2[tile_index *2] & 0x000f; |
| 107 | 107 | fx = (mugsmash_videoram2[tile_index *2] & 0xc0) >>6; |
| 108 | 108 | |
| 109 | SET_TILE_INFO(1,tileno,16+colour,TILE_FLIPYX(fx)) | |
| 109 | SET_TILE_INFO(1,tileno,16+colour,TILE_FLIPYX(fx)); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | WRITE16_HANDLER( mugsmash_videoram2_w ) |
| r814 | r815 | |
| 140 | 140 | VIDEO_START( mugsmash ) |
| 141 | 141 | { |
| 142 | 142 | |
| 143 | mugsmash_tilemap1 = tilemap_create(get_mugsmash_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 143 | mugsmash_tilemap1 = tilemap_create(get_mugsmash_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 144 | 144 | tilemap_set_transparent_pen(mugsmash_tilemap1,0); |
| 145 | 145 | |
| 146 | mugsmash_tilemap2 = tilemap_create(get_mugsmash_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 146 | mugsmash_tilemap2 = tilemap_create(get_mugsmash_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | VIDEO_UPDATE( mugsmash ) |
| r814 | r815 | |
|---|---|---|
| 50 | 50 | int code = videoram[tile_index*2+1] + ((videoram[tile_index*2] & 0x0f) << 8); |
| 51 | 51 | int color = videoram[tile_index*2] >> 4; |
| 52 | 52 | |
| 53 | SET_TILE_INFO(0, code, color, 0) | |
| 53 | SET_TILE_INFO(0, code, color, 0); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | VIDEO_START( pcktgal ) |
| 57 | 57 | { |
| 58 | 58 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 59 | TILEMAP_TYPE_ | |
| 59 | TILEMAP_TYPE_ | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 942 | 942 | int tileno,pal; |
| 943 | 943 | tileno = hng64_videoram[tile_index]; |
| 944 | 944 | 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)); | |
| 946 | 946 | } |
| 947 | 947 | |
| 948 | 948 | /* 16x16 tiles, 8bpp layer */ |
| r814 | r815 | |
| 952 | 952 | tileno = hng64_videoram[tile_index+(0x10000/4)]; |
| 953 | 953 | pal = hng64_videoram[tile_index+(0x10000/4)]>>24; |
| 954 | 954 | |
| 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) ); | |
| 956 | 956 | } |
| 957 | 957 | |
| 958 | 958 | /* 16x16 tiles, 8bpp layer */ |
| r814 | r815 | |
| 961 | 961 | int tileno,pal; |
| 962 | 962 | tileno = hng64_videoram[tile_index+(0x20000/4)]; |
| 963 | 963 | 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)); | |
| 965 | 965 | } |
| 966 | 966 | |
| 967 | 967 | /* 16x16 tiles, 8bpp layer */ |
| r814 | r815 | |
| 970 | 970 | int tileno,pal; |
| 971 | 971 | tileno = hng64_videoram[tile_index+(0x30000/4)]; |
| 972 | 972 | 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)); | |
| 974 | 974 | } |
| 975 | 975 | |
| 976 | 976 | |
| r814 | r815 | |
| 1253 | 1253 | tilemap2Offset = hng64_videoregs[0xc] ; |
| 1254 | 1254 | |
| 1255 | 1255 | tilemap_dispose(hng64_tilemap1) ; |
| 1256 | hng64_tilemap1 = tilemap_create(get_hng64_tile2_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 1256 | hng64_tilemap1 = tilemap_create(get_hng64_tile2_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 1257 | 1257 | } |
| 1258 | 1258 | */ |
| 1259 | 1259 | |
| r814 | r815 | |
| 1296 | 1296 | |
| 1297 | 1297 | VIDEO_START( hng64 ) |
| 1298 | 1298 | { |
| 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 */ | |
| 1303 | 1303 | tilemap_set_transparent_pen(hng64_tilemap0,0); |
| 1304 | 1304 | tilemap_set_transparent_pen(hng64_tilemap1,0); |
| 1305 | 1305 | tilemap_set_transparent_pen(hng64_tilemap2,0); |
| r814 | r815 | |
|---|---|---|
| 45 | 45 | int color = ((attr & 0x70) >> 4); |
| 46 | 46 | int flags = ((attr & 0x80) ? TILE_FLIPX : 0) | ((attr & 0x08) ? TILE_FLIPY : 0); |
| 47 | 47 | |
| 48 | SET_TILE_INFO(1, code, color, flags) | |
| 48 | SET_TILE_INFO(1, code, color, flags); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 54 | 54 | int code = videoram[tile_index] + 256 * (attr & 0x07); |
| 55 | 55 | int color = (attr & 0x70) >> 4; |
| 56 | 56 | |
| 57 | SET_TILE_INFO(0, code, color, 0) | |
| 57 | SET_TILE_INFO(0, code, color, 0); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | VIDEO_START( solomon ) |
| 61 | 61 | { |
| 62 | 62 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 63 | TILEMAP_TYPE_ | |
| 63 | TILEMAP_TYPE_ | |
| 64 | 64 | |
| 65 | 65 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 66 | TILEMAP_TYPE_ | |
| 66 | TILEMAP_TYPE_ | |
| 67 | 67 | |
| 68 | 68 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 69 | 69 | } |
| r814 | r815 | |
|---|---|---|
| 47 | 47 | break; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | SET_TILE_INFO(1,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)) | |
| 50 | SET_TILE_INFO(1,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /*** SCR B LAYER ***/ |
| r814 | r815 | |
| 82 | 82 | break; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | SET_TILE_INFO(2,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)) | |
| 85 | SET_TILE_INFO(2,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /*** SCR C LAYER ***/ |
| r814 | r815 | |
| 117 | 117 | break; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | SET_TILE_INFO(3,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)) | |
| 120 | SET_TILE_INFO(3,tileno,color,TILE_FLIPYX((attr & 0xc0000000) >> 30)); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /*** TEXT LAYER ***/ |
| r814 | r815 | |
| 137 | 137 | tileno = macrossp_text_videoram[tile_index] & 0x0000ffff; |
| 138 | 138 | colour = (macrossp_text_videoram[tile_index] & 0x00fe0000) >> 17; |
| 139 | 139 | |
| 140 | SET_TILE_INFO(4,tileno,colour,0) | |
| 140 | SET_TILE_INFO(4,tileno,colour,0); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| r814 | r815 | |
| 152 | 152 | memset(spriteram_old,0,spriteram_size); |
| 153 | 153 | memset(spriteram_old2,0,spriteram_size); |
| 154 | 154 | |
| 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); | |
| 159 | 159 | |
| 160 | 160 | tilemap_set_transparent_pen(macrossp_text_tilemap,0); |
| 161 | 161 | tilemap_set_transparent_pen(macrossp_scra_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 31 | 31 | 1, |
| 32 | 32 | gladiatr_videoram[tile_index] + ((attr & 0x07) << 8) + (bg_tile_bank << 11), |
| 33 | 33 | (attr >> 3) ^ 0x1f, |
| 34 | 0) | |
| 34 | 0); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | static TILE_GET_INFO( fg_get_tile_info ) |
| r814 | r815 | |
| 40 | 40 | 0, |
| 41 | 41 | gladiatr_textram[tile_index] + (fg_tile_bank << 8), |
| 42 | 42 | 0, |
| 43 | 0) | |
| 43 | 0); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| r814 | r815 | |
| 53 | 53 | |
| 54 | 54 | VIDEO_START( ppking ) |
| 55 | 55 | { |
| 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); | |
| 58 | 58 | |
| 59 | 59 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 60 | 60 | |
| r814 | r815 | |
| 65 | 65 | |
| 66 | 66 | VIDEO_START( gladiatr ) |
| 67 | 67 | { |
| 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); | |
| 70 | 70 | |
| 71 | 71 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 72 | 72 | |
| r814 | r815 | |
| 256 | 256 | |
| 257 | 257 | /* the fg layer just selects the upper palette bank on underlying pixels */ |
| 258 | 258 | { |
| 259 | mame_bitmap * | |
| 259 | mame_bitmap *flags | |
| 260 | 260 | int sx = cliprect->min_x; |
| 261 | 261 | int sy = cliprect->min_y; |
| 262 | 262 | |
| 263 | 263 | tilemap_get_pixmap( fg_tilemap ); |
| 264 | | |
| 264 | flags | |
| 265 | 265 | |
| 266 | 266 | while( sy <= cliprect->max_y ) |
| 267 | 267 | { |
| r814 | r815 | |
| 271 | 271 | UINT16 *dest = BITMAP_ADDR16(bitmap, sy, sx); |
| 272 | 272 | while( x <= cliprect->max_x ) |
| 273 | 273 | { |
| 274 | if( *BITMAP_ADDR8( | |
| 274 | if( *BITMAP_ADDR8(flags | |
| 275 | 275 | { |
| 276 | 276 | *dest += 512; |
| 277 | 277 | } |
| r814 | r815 | |
|---|---|---|
| 158 | 158 | alpha = (alpha_enabled) ? K054338_set_alpha_level(1) : 255; |
| 159 | 159 | |
| 160 | 160 | 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); | |
| 162 | 162 | |
| 163 | 163 | K053247_sprites_draw(machine, bitmap,cliprect); |
| 164 | 164 |
| r814 | r815 | |
|---|---|---|
| 34 | 34 | 0, |
| 35 | 35 | code | ((attr & 0x7) << 8) | (goindol_char_bank << 11), |
| 36 | 36 | (attr & 0xf8) >> 3, |
| 37 | 0) | |
| 37 | 0); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 45 | 45 | 1, |
| 46 | 46 | code | ((attr & 0x7) << 8) | (goindol_char_bank << 11), |
| 47 | 47 | (attr & 0xf8) >> 3, |
| 48 | 0) | |
| 48 | 0); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| r814 | r815 | |
| 58 | 58 | |
| 59 | 59 | VIDEO_START( goindol ) |
| 60 | 60 | { |
| 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); | |
| 63 | 63 | |
| 64 | 64 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 65 | 65 | } |
| r814 | r815 | |
|---|---|---|
| 33 | 33 | 0, |
| 34 | 34 | code, |
| 35 | 35 | (attr & 0xf0) >> 4, |
| 36 | 0) | |
| 36 | 0); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | static TILE_GET_INFO( get_bg19_tile_info ) |
| r814 | r815 | |
| 48 | 48 | 0, |
| 49 | 49 | code, |
| 50 | 50 | (attr & 0xf0) >> 4, |
| 51 | 0) | |
| 51 | 0); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static TILE_GET_INFO( get_ch1a_tile_info ) |
| r814 | r815 | |
| 60 | 60 | 2, |
| 61 | 61 | code, |
| 62 | 62 | (attr & 0xf0) >> 4, |
| 63 | 0) | |
| 63 | 0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r814 | r815 | |
| 75 | 75 | { |
| 76 | 76 | int i; |
| 77 | 77 | |
| 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); | |
| 81 | 81 | |
| 82 | 82 | bankc[0] = bankc[1] = bankc[2] = bankc[3] = 0; |
| 83 | 83 | horshoes_gfxbank = 0; |
| r814 | r815 | |
|---|---|---|
| 47 | 47 | 0, |
| 48 | 48 | code+bank*256, |
| 49 | 49 | 1 + 64 * (attr & 0x0f), |
| 50 | 0) | |
| 50 | 0); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static TILE_GET_INFO( get_tile_info1 ) |
| r814 | r815 | |
| 72 | 72 | 0, |
| 73 | 73 | code+bank*256, |
| 74 | 74 | 0 + 64 * (attr & 0x0f), |
| 75 | 0) | |
| 75 | 0); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /*************************************************************************** |
| r814 | r815 | |
| 83 | 83 | |
| 84 | 84 | VIDEO_START( fastlane ) |
| 85 | 85 | { |
| 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); | |
| 88 | 88 | |
| 89 | 89 | tilemap_set_scroll_rows( layer0, 32 ); |
| 90 | 90 |
| r814 | r815 | |
|---|---|---|
| 22 | 22 | 1, |
| 23 | 23 | tile, |
| 24 | 24 | color, |
| 25 | 0) | |
| 25 | 0); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 36 | 36 | 0, |
| 37 | 37 | tile, |
| 38 | 38 | color, |
| 39 | 0) | |
| 39 | 0); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | VIDEO_START( cabal ) |
| 44 | 44 | { |
| 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); | |
| 47 | 47 | |
| 48 | 48 | tilemap_set_transparent_pen(text_layer,3); |
| 49 | 49 | tilemap_set_transparent_pen(background_layer,15); |
| r814 | r815 | |
| 140 | 140 | |
| 141 | 141 | VIDEO_UPDATE( cabal ) |
| 142 | 142 | { |
| 143 | tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_ | |
| 143 | tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_D | |
| 144 | 144 | draw_sprites(machine,bitmap,cliprect); |
| 145 | 145 | tilemap_draw(bitmap,cliprect,text_layer,0,0); |
| 146 | 146 | return 0; |
| r814 | r815 | |
|---|---|---|
| 83 | 83 | 0, |
| 84 | 84 | suprloco_videoram[2*tile_index] | ((attr & 0x03) << 8), |
| 85 | 85 | (attr & 0x1c) >> 2, |
| 86 | 0) | |
| 87 | tileinfo->priority = (attr & 0x20) >> 5; | |
| 86 | 0); | |
| 87 | tileinfo->category = (attr & 0x20) >> 5; | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| r814 | r815 | |
| 97 | 97 | |
| 98 | 98 | VIDEO_START( suprloco ) |
| 99 | 99 | { |
| 100 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 100 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 101 | 101 | |
| 102 | 102 | tilemap_set_scroll_rows(bg_tilemap,32); |
| 103 | 103 | } |
| r814 | r815 | |
|---|---|---|
| 150 | 150 | 0, |
| 151 | 151 | tile, |
| 152 | 152 | 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; | |
| 154 | 155 | } |
| 155 | 156 | |
| 156 | 157 | static TILE_GET_INFO( get_pf2_tile_info ) |
| r814 | r815 | |
| 168 | 169 | 0, |
| 169 | 170 | tile, |
| 170 | 171 | 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; | |
| 172 | 174 | } |
| 173 | 175 | |
| 174 | 176 | static TILE_GET_INFO( get_pf3_tile_info ) |
| r814 | r815 | |
| 185 | 187 | 0, |
| 186 | 188 | tile, |
| 187 | 189 | 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; | |
| 189 | 192 | } |
| 190 | 193 | |
| 191 | 194 | static TILE_GET_INFO( get_pf1_wide_tile_info ) |
| r814 | r815 | |
| 203 | 206 | 0, |
| 204 | 207 | tile, |
| 205 | 208 | 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; | |
| 207 | 211 | } |
| 208 | 212 | |
| 209 | 213 | static TILE_GET_INFO( get_pf3_wide_tile_info ) |
| r814 | r815 | |
| 221 | 225 | 0, |
| 222 | 226 | tile, |
| 223 | 227 | 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; | |
| 225 | 230 | } |
| 226 | 231 | |
| 227 | 232 | /*****************************************************************************/ |
| r814 | r815 | |
| 349 | 354 | { |
| 350 | 355 | pf1_layer = tilemap_create( |
| 351 | 356 | get_pf1_tile_info,tilemap_scan_rows, |
| 352 | TILEMAP_TYPE_ | |
| 357 | TILEMAP_TYPE_ | |
| 353 | 358 | 8,8, |
| 354 | 359 | 64,64 |
| 355 | 360 | ); |
| 356 | 361 | |
| 357 | 362 | pf2_layer = tilemap_create( |
| 358 | 363 | get_pf2_tile_info,tilemap_scan_rows, |
| 359 | TILEMAP_TYPE_ | |
| 364 | TILEMAP_TYPE_ | |
| 360 | 365 | 8,8, |
| 361 | 366 | 64,64 |
| 362 | 367 | ); |
| 363 | 368 | |
| 364 | 369 | pf3_layer = tilemap_create( |
| 365 | 370 | get_pf3_tile_info,tilemap_scan_rows, |
| 366 | TILEMAP_TYPE_ | |
| 371 | TILEMAP_TYPE_ | |
| 367 | 372 | 8,8, |
| 368 | 373 | 64,64 |
| 369 | 374 | ); |
| 370 | 375 | |
| 371 | 376 | pf1_wide_layer = tilemap_create( |
| 372 | 377 | get_pf1_wide_tile_info,tilemap_scan_rows, |
| 373 | TILEMAP_TYPE_ | |
| 378 | TILEMAP_TYPE_ | |
| 374 | 379 | 8,8, |
| 375 | 380 | 128,64 |
| 376 | 381 | ); |
| 377 | 382 | |
| 378 | 383 | pf3_wide_layer = tilemap_create( |
| 379 | 384 | get_pf3_wide_tile_info,tilemap_scan_rows, |
| 380 | TILEMAP_TYPE_ | |
| 385 | TILEMAP_TYPE_ | |
| 381 | 386 | 8,8, |
| 382 | 387 | 128,64 |
| 383 | 388 | ); |
| r814 | r815 | |
| 600 | 605 | fillbitmap(priority_bitmap,0,cliprect); |
| 601 | 606 | |
| 602 | 607 | 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); | |
| 605 | 610 | } |
| 606 | 611 | else |
| 607 | 612 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 608 | 613 | |
| 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); | |
| 611 | 616 | |
| 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); | |
| 614 | 619 | |
| 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); | |
| 619 | 624 | |
| 620 | 625 | draw_sprites(machine,bitmap,cliprect); |
| 621 | 626 | } |
| r814 | r815 | |
|---|---|---|
| 115 | 115 | sortlayers(layer,layerpri); |
| 116 | 116 | |
| 117 | 117 | fillbitmap(priority_bitmap,0,cliprect); |
| 118 | tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],TILEMAP_ | |
| 118 | tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],TILEMAP_D | |
| 119 | 119 | tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[1]],0,2); |
| 120 | 120 | tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[2]],0,4); |
| 121 | 121 |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | tileno = memory_region(REGION_USER1)[tile_index]; |
| 31 | 31 | 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); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | UINT8 fcombat_cocktail_flip; |
| r814 | r815 | |
| 115 | 115 | |
| 116 | 116 | VIDEO_START( fcombat ) |
| 117 | 117 | { |
| 118 | bgmap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 118 | bgmap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 119 | 119 | video_start_generic(machine); |
| 120 | 120 | } |
| 121 | 121 |
| r814 | r815 | |
|---|---|---|
| 61 | 61 | fillbitmap(priority_bitmap, 0, cliprect); |
| 62 | 62 | |
| 63 | 63 | /* 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); | |
| 66 | 66 | |
| 67 | 67 | /* draw background again, just to set the priorities on non-transparent pixels */ |
| 68 | 68 | segaic16_tilemap_draw(machine, 0, NULL, cliprect, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01); |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | int data2 = thoop2_videoram[(tile_index << 1) + 1]; |
| 50 | 50 | int code = ((data & 0xfffc) >> 2) | ((data & 0x0003) << 14); |
| 51 | 51 | |
| 52 | tileinfo-> | |
| 52 | tileinfo->categor | |
| 53 | 53 | |
| 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)); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| r814 | r815 | |
| 61 | 61 | int data2 = thoop2_videoram[(0x1000/2) + (tile_index << 1) + 1]; |
| 62 | 62 | int code = ((data & 0xfffc) >> 2) | ((data & 0x0003) << 14); |
| 63 | 63 | |
| 64 | tileinfo-> | |
| 64 | tileinfo->categor | |
| 65 | 65 | |
| 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)); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /*************************************************************************** |
| r814 | r815 | |
| 88 | 88 | { |
| 89 | 89 | int i; |
| 90 | 90 | |
| 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); | |
| 93 | 93 | |
| 94 | 94 | tilemap_set_transmask(pant[0],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */ |
| 95 | 95 | tilemap_set_transmask(pant[1],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */ |
| r814 | r815 | |
| 213 | 213 | |
| 214 | 214 | fillbitmap( bitmap, machine->pens[0], cliprect ); |
| 215 | 215 | |
| 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); | |
| 218 | 218 | 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); | |
| 221 | 221 | |
| 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); | |
| 224 | 224 | 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); | |
| 227 | 227 | |
| 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); | |
| 230 | 230 | 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); | |
| 233 | 233 | |
| 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); | |
| 236 | 236 | 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); | |
| 239 | 239 | |
| 240 | 240 | draw_sprites(machine, bitmap,cliprect,4); |
| 241 | 241 | return 0; |
| r814 | r815 | |
|---|---|---|
| 78 | 78 | 0, |
| 79 | 79 | tileno, |
| 80 | 80 | colbank, |
| 81 | 0) | |
| 81 | 0); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static TILE_GET_INFO( get_bg0_tile_info ) |
| r814 | r815 | |
| 108 | 108 | 2, |
| 109 | 109 | tileno, |
| 110 | 110 | colbank, |
| 111 | TILE_FLIPYX((tilebase[0] & 0x00c0) >> 6)) | |
| 111 | TILE_FLIPYX((tilebase[0] & 0x00c0) >> 6)); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 134 | 134 | 3, |
| 135 | 135 | tileno, |
| 136 | 136 | colbank, |
| 137 | 0) | |
| 137 | 0); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /******************************************************************************* |
| r814 | r815 | |
| 224 | 224 | |
| 225 | 225 | VIDEO_START( wwfwfest ) |
| 226 | 226 | { |
| 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); | |
| 230 | 230 | |
| 231 | 231 | tilemap_set_transparent_pen(fg0_tilemap,0); |
| 232 | 232 | tilemap_set_transparent_pen(bg1_tilemap,0); |
| r814 | r815 | |
| 261 | 261 | /* todo : which bits of pri are significant to the order */ |
| 262 | 262 | |
| 263 | 263 | if (wwfwfest_pri == 0x007b) { |
| 264 | tilemap_draw(bitmap,cliprect,bg0_tilemap,TILEMAP_ | |
| 264 | tilemap_draw(bitmap,cliprect,bg0_tilemap,TILEMAP_D | |
| 265 | 265 | tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0); |
| 266 | 266 | draw_sprites(machine, bitmap,cliprect); |
| 267 | 267 | tilemap_draw(bitmap,cliprect,fg0_tilemap,0,0); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | if (wwfwfest_pri == 0x007c) { |
| 271 | tilemap_draw(bitmap,cliprect,bg0_tilemap,TILEMAP_ | |
| 271 | tilemap_draw(bitmap,cliprect,bg0_tilemap,TILEMAP_D | |
| 272 | 272 | draw_sprites(machine, bitmap,cliprect); |
| 273 | 273 | tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0); |
| 274 | 274 | tilemap_draw(bitmap,cliprect,fg0_tilemap,0,0); |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | if (wwfwfest_pri == 0x0078) { |
| 278 | tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_ | |
| 278 | tilemap_draw(bitmap,cliprect,bg1_tilemap,TILEMAP_D | |
| 279 | 279 | tilemap_draw(bitmap,cliprect,bg0_tilemap,0,0); |
| 280 | 280 | draw_sprites(machine, bitmap,cliprect); |
| 281 | 281 | tilemap_draw(bitmap,cliprect,fg0_tilemap,0,0); |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | VIDEO_START( marineb ) |
| 51 | 51 | { |
| 52 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 52 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 53 | 53 | |
| 54 | 54 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 55 | 55 | } |
| r814 | r815 | |
|---|---|---|
| 96 | 96 | static TILE_GET_INFO( get_tile_info ) |
| 97 | 97 | { |
| 98 | 98 | UINT8 attr = timeplt_colorram[tile_index]; |
| 99 | tileinfo-> | |
| 99 | tileinfo->categor | |
| 100 | 100 | SET_TILE_INFO( |
| 101 | 101 | 0, |
| 102 | 102 | timeplt_videoram[tile_index] + ((attr & 0x20) << 3), |
| 103 | 103 | attr & 0x1f, |
| 104 | TILE_FLIPYX((attr & 0xc0) >> 6)) | |
| 104 | TILE_FLIPYX((attr & 0xc0) >> 6)); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r814 | r815 | |
| 114 | 114 | |
| 115 | 115 | VIDEO_START( timeplt ) |
| 116 | 116 | { |
| 117 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 117 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 118 | 118 | |
| 119 | 119 | sprite_mux_buffer = auto_malloc(256 * spriteram_size); |
| 120 | 120 | sprite_mux_buffer_2 = auto_malloc(256 * spriteram_size); |
| r814 | r815 | |
|---|---|---|
| 63 | 63 | int code = data & 0xfff; |
| 64 | 64 | int color = (data >> 12) & 0x0f; |
| 65 | 65 | int opaque = data & 0x8000; |
| 66 | SET_TILE_INFO(1, code, color, opaque ? TILE_ | |
| 66 | SET_TILE_INFO(1, code, color, opaque ? TILE_F | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| r814 | r815 | |
| 73 | 73 | int code = (playfield_tile_bank << 12) | (data & 0xfff); |
| 74 | 74 | int color = (atarigx2_playfield_base >> 5) + ((playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7); |
| 75 | 75 | SET_TILE_INFO(0, code, color, (data >> 15) & 1); |
| 76 | tileinfo-> | |
| 76 | tileinfo->categor | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| 80 | static | |
| 80 | static | |
| 81 | 81 | { |
| 82 | 82 | int bank = 1 - (col / (num_cols / 2)); |
| 83 | 83 | return bank * (num_rows * num_cols / 2) + row * (num_cols / 2) + (col % (num_cols / 2)); |
| r814 | r815 | |
| 120 | 120 | atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30); |
| 121 | 121 | |
| 122 | 122 | /* initialize the playfield */ |
| 123 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigx2_playfield_scan, TILEMAP_TYPE_ | |
| 123 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigx2_playfield_scan, TILEMAP_TYPE_ | |
| 124 | 124 | |
| 125 | 125 | /* initialize the motion objects */ |
| 126 | 126 | adjusted_modesc.palettebase = atarigx2_motion_object_base; |
| r814 | r815 | |
| 129 | 129 | atarirle_init(0, &adjusted_modesc); |
| 130 | 130 | |
| 131 | 131 | /* initialize the alphanumerics */ |
| 132 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 132 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 133 | 133 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 134 | 134 | |
| 135 | 135 | /* reset statics */ |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | { \ |
| 59 | 59 | UINT16 code = fuuki16_vram_##_N_[ 2 * tile_index + 0 ]; \ |
| 60 | 60 | 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 )); \ | |
| 62 | 62 | } \ |
| 63 | 63 | \ |
| 64 | 64 | WRITE16_HANDLER( fuuki16_vram_##_N_##_w ) \ |
| r814 | r815 | |
| 97 | 97 | VIDEO_START( fuuki16 ) |
| 98 | 98 | { |
| 99 | 99 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 100 | TILEMAP_TYPE_ | |
| 100 | TILEMAP_TYPE_ | |
| 101 | 101 | |
| 102 | 102 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 103 | TILEMAP_TYPE_ | |
| 103 | TILEMAP_TYPE_ | |
| 104 | 104 | |
| 105 | 105 | tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 106 | TILEMAP_TYPE_ | |
| 106 | TILEMAP_TYPE_ | |
| 107 | 107 | |
| 108 | 108 | tilemap_3 = tilemap_create( get_tile_info_3, tilemap_scan_rows, |
| 109 | TILEMAP_TYPE_ | |
| 109 | TILEMAP_TYPE_ | |
| 110 | 110 | |
| 111 | 111 | tilemap_set_transparent_pen(tilemap_0,0x0f); // 4 bits |
| 112 | 112 | tilemap_set_transparent_pen(tilemap_1,0xff); // 8 bits |
| r814 | r815 | |
| 337 | 337 | /* The backmost tilemap decides the background color(s) but sprites can |
| 338 | 338 | go below the opaque pixels of that tilemap. We thus need to mark the |
| 339 | 339 | transparent pixels of this layer with a different priority value */ |
| 340 | // fuuki16_draw_layer(bitmap,cliprect, tm_back, TILEMAP_ | |
| 340 | // fuuki16_draw_layer(bitmap,cliprect, tm_back, TILEMAP_D | |
| 341 | 341 | |
| 342 | 342 | /* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */ |
| 343 | 343 | fillbitmap(bitmap,(0x800*4)-1,cliprect); |
| r814 | r815 | |
|---|---|---|
| 95 | 95 | 0, |
| 96 | 96 | code + ((color & 0x80) << 1), |
| 97 | 97 | color & 0x3f, |
| 98 | 0) | |
| 98 | 0); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 108 | 108 | 1, |
| 109 | 109 | code + ((color & 0x80) << 1), |
| 110 | 110 | (color & 0x1f) + (0x20 * vulgus_palette_bank), |
| 111 | TILE_FLIPYX((color & 0x60) >> 5)) | |
| 111 | TILE_FLIPYX((color & 0x60) >> 5)); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
| r814 | r815 | |
| 120 | 120 | |
| 121 | 121 | VIDEO_START( vulgus ) |
| 122 | 122 | { |
| 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); | |
| 125 | 125 | |
| 126 | 126 | tilemap_set_transparent_pen(fg_tilemap,47); |
| 127 | 127 | } |
| r814 | r815 | |
|---|---|---|
| 18 | 18 | tileno = sderby_videoram[tile_index*2]; |
| 19 | 19 | colour = sderby_videoram[tile_index*2+1] & 0x0f; |
| 20 | 20 | |
| 21 | SET_TILE_INFO(1,tileno,colour,0) | |
| 21 | SET_TILE_INFO(1,tileno,colour,0); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | WRITE16_HANDLER( sderby_videoram_w ) |
| r814 | r815 | |
| 36 | 36 | tileno = sderby_md_videoram[tile_index*2]; |
| 37 | 37 | colour = sderby_md_videoram[tile_index*2+1] & 0x0f; |
| 38 | 38 | |
| 39 | SET_TILE_INFO(1,tileno,colour+16,0) | |
| 39 | SET_TILE_INFO(1,tileno,colour+16,0); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | WRITE16_HANDLER( sderby_md_videoram_w ) |
| r814 | r815 | |
| 54 | 54 | tileno = sderby_fg_videoram[tile_index*2]; |
| 55 | 55 | colour = sderby_fg_videoram[tile_index*2+1] & 0x0f; |
| 56 | 56 | |
| 57 | SET_TILE_INFO(0,tileno,colour+32,0) | |
| 57 | SET_TILE_INFO(0,tileno,colour+32,0); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | WRITE16_HANDLER( sderby_fg_videoram_w ) |
| r814 | r815 | |
| 95 | 95 | |
| 96 | 96 | VIDEO_START( sderby ) |
| 97 | 97 | { |
| 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); | |
| 100 | 100 | |
| 101 | 101 | tilemap_set_transparent_pen(sderby_md_tilemap,0); |
| 102 | 102 | |
| 103 | sderby_fg_tilemap = tilemap_create(get_sderby_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 103 | sderby_fg_tilemap = tilemap_create(get_sderby_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 104 | 104 | tilemap_set_transparent_pen(sderby_fg_tilemap,0); |
| 105 | 105 | } |
| 106 | 106 |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | { |
| 43 | 43 | int code = videoram[tile_index]; |
| 44 | 44 | |
| 45 | SET_TILE_INFO(0, code, 0, 0) | |
| 45 | SET_TILE_INFO(0, code, 0, 0); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | VIDEO_START( circus ) |
| 49 | 49 | { |
| 50 | 50 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 51 | TILEMAP_TYPE_ | |
| 51 | TILEMAP_TYPE_ | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static void draw_line(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int x1, int y1, int x2, int y2, int dotted) |
| r814 | r815 | |
|---|---|---|
| 134 | 134 | { |
| 135 | 135 | int code = videoram[tile_index]; |
| 136 | 136 | |
| 137 | SET_TILE_INFO(0, code, 0, 0) | |
| 137 | SET_TILE_INFO(0, code, 0, 0); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | VIDEO_START( tinvader ) |
| 141 | 141 | { |
| 142 | 142 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 143 | TILEMAP_TYPE_ | |
| 143 | TILEMAP_TYPE_ | |
| 144 | 144 | |
| 145 | 145 | spritebitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 146 | 146 | tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| r814 | r815 | |
|---|---|---|
| 34 | 34 | 0, |
| 35 | 35 | code, |
| 36 | 36 | color & 0x3f, |
| 37 | 0) | |
| 37 | 0); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 47 | 47 | 4, |
| 48 | 48 | code, |
| 49 | 49 | color & 0x3f, |
| 50 | 0) | |
| 50 | 0); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static TILE_GET_INFO( get_bg2_tile_info ) |
| r814 | r815 | |
| 60 | 60 | 3, |
| 61 | 61 | code, |
| 62 | 62 | color & 0x3f, |
| 63 | 0) | |
| 63 | 0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r814 | r815 | |
| 72 | 72 | |
| 73 | 73 | VIDEO_START( vastar ) |
| 74 | 74 | { |
| 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); | |
| 78 | 78 | |
| 79 | 79 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 80 | 80 | tilemap_set_transparent_pen(bg1_tilemap,0); |
| r814 | r815 | |
| 200 | 200 | switch (*vastar_sprite_priority) |
| 201 | 201 | { |
| 202 | 202 | case 0: |
| 203 | tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_ | |
| 203 | tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_D | |
| 204 | 204 | draw_sprites(machine, bitmap,cliprect); |
| 205 | 205 | tilemap_draw(bitmap,cliprect, bg2_tilemap, 0,0); |
| 206 | 206 | tilemap_draw(bitmap,cliprect, fg_tilemap, 0,0); |
| 207 | 207 | break; |
| 208 | 208 | |
| 209 | 209 | case 2: |
| 210 | tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_ | |
| 210 | tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_D | |
| 211 | 211 | draw_sprites(machine, bitmap,cliprect); |
| 212 | 212 | tilemap_draw(bitmap,cliprect, bg1_tilemap, 0,0); |
| 213 | 213 | tilemap_draw(bitmap,cliprect, bg2_tilemap, 0,0); |
| r814 | r815 | |
| 215 | 215 | break; |
| 216 | 216 | |
| 217 | 217 | case 3: |
| 218 | tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_ | |
| 218 | tilemap_draw(bitmap,cliprect, bg1_tilemap, TILEMAP_D | |
| 219 | 219 | tilemap_draw(bitmap,cliprect, bg2_tilemap, 0,0); |
| 220 | 220 | tilemap_draw(bitmap,cliprect, fg_tilemap, 0,0); |
| 221 | 221 | draw_sprites(machine, bitmap,cliprect); |
| r814 | r815 | |
|---|---|---|
| 180 | 180 | 1, |
| 181 | 181 | code, |
| 182 | 182 | col, |
| 183 | 0) | |
| 183 | 0); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | ||
| 186 | static TILEMAP_MAPPER( taotaido_tilemap_scan | |
| 187 | 187 | { |
| 188 | 188 | /* logical (col,row) -> memory offset */ |
| 189 | 189 | return row*0x40 + (col&0x3f) + ((col&0x40)<<6); |
| r814 | r815 | |
| 191 | 191 | |
| 192 | 192 | VIDEO_START(taotaido) |
| 193 | 193 | { |
| 194 | bg_tilemap = tilemap_create(taotaido_bg_tile_info,taotaido_tilemap_scan_rows,TILEMAP_TYPE_ | |
| 194 | bg_tilemap = tilemap_create(taotaido_bg_tile_info,taotaido_tilemap_scan_rows,TILEMAP_TYPE_ | |
| 195 | 195 | |
| 196 | 196 | taotaido_spriteram_old = auto_malloc(0x2000); |
| 197 | 197 | taotaido_spriteram_older = auto_malloc(0x2000); |
| r814 | r815 | |
|---|---|---|
| 86 | 86 | atarigen_blend_gfx(machine, 1, 2, 0x0f, 0x10); |
| 87 | 87 | |
| 88 | 88 | /* initialize the playfield */ |
| 89 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 89 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 90 | 90 | |
| 91 | 91 | /* initialize the second playfield */ |
| 92 | atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 92 | atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 93 | 93 | tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0); |
| 94 | 94 | |
| 95 | 95 | /* initialize the motion objects */ |
| r814 | r815 | |
|---|---|---|
| 447 | 447 | 1, |
| 448 | 448 | tile&0xffff, |
| 449 | 449 | (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 */ | |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | static TILE_GET_INFO( get_tile_info1 ) |
| r814 | r815 | |
| 488 | 488 | 0, |
| 489 | 489 | vram_tile&0xff, |
| 490 | 490 | (vram_tile>>9)&0x3f, |
| 491 | flags) | |
| 491 | flags); | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | static TILE_GET_INFO( get_tile_info_pixel ) |
| r814 | r815 | |
| 516 | 516 | 3, |
| 517 | 517 | tile_index, |
| 518 | 518 | (vram_tile>>9)&0x3f, |
| 519 | flags) | |
| 519 | flags); | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | /******************************************************************************/ |
| r814 | r815 | |
| 565 | 565 | f3_game_config=pCFG; |
| 566 | 566 | |
| 567 | 567 | 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); | |
| 572 | 572 | |
| 573 | 573 | f3_pf_data_1=f3_pf_data+0x0000; |
| 574 | 574 | f3_pf_data_2=f3_pf_data+0x0800; |
| r814 | r815 | |
| 580 | 580 | twidth_mask_bit=6; |
| 581 | 581 | |
| 582 | 582 | } 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); | |
| 587 | 587 | |
| 588 | 588 | f3_pf_data_1=f3_pf_data+0x0000; |
| 589 | 589 | f3_pf_data_2=f3_pf_data+0x0400; |
| r814 | r815 | |
| 598 | 598 | spriteram32_buffered = (UINT32 *)auto_malloc(0x10000); |
| 599 | 599 | spritelist = auto_malloc(0x400 * sizeof(*spritelist)); |
| 600 | 600 | 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); | |
| 603 | 603 | pivot_dirty = (UINT8 *)auto_malloc(2048); |
| 604 | 604 | pf_line_inf = auto_malloc(5 * sizeof(struct f3_playfield_line_inf)); |
| 605 | 605 | sa_line_inf = auto_malloc(1 * sizeof(struct f3_spritealpha_line_inf)); |
| r814 | r815 | |
| 1869 | 1869 | { |
| 1870 | 1870 | struct f3_playfield_line_inf *line_t=&pf_line_inf[pos]; |
| 1871 | 1871 | const mame_bitmap *srcbitmap; |
| 1872 | const mame_bitmap * | |
| 1872 | const mame_bitmap *flagsbitmap; | |
| 1873 | 1873 | |
| 1874 | 1874 | int y,y_start,y_end,y_inc; |
| 1875 | 1875 | int line_base,zoom_base,col_base,pri_base,inc; |
| r814 | r815 | |
| 2047 | 2047 | |
| 2048 | 2048 | /* set pixmap pointer */ |
| 2049 | 2049 | srcbitmap = tilemap_get_pixmap(tmap); |
| 2050 | | |
| 2050 | flagsbitmap = tilemap_get_flags | |
| 2051 | 2051 | |
| 2052 | 2052 | y=y_start; |
| 2053 | 2053 | while(y!=y_end) |
| r814 | r815 | |
| 2076 | 2076 | line_t->src_e[y]=&src_s[width_mask+1]; |
| 2077 | 2077 | line_t->src[y]=&src_s[x_index_fx>>16]; |
| 2078 | 2078 | |
| 2079 | line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8( | |
| 2079 | line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap, y_index, 0); | |
| 2080 | 2080 | line_t->tsrc[y]=&tsrc_s[x_index_fx>>16]; |
| 2081 | 2081 | } |
| 2082 | 2082 | |
| r814 | r815 | |
| 2090 | 2090 | const struct f3_spritealpha_line_inf *sprite_alpha_line_t=&sa_line_inf[0]; |
| 2091 | 2091 | struct f3_playfield_line_inf *line_t=&pf_line_inf[4]; |
| 2092 | 2092 | const mame_bitmap *srcbitmap_pixel, *srcbitmap_vram; |
| 2093 | const mame_bitmap * | |
| 2093 | const mame_bitmap *flagsbitmap_pixel, *flagsbitmap_vram; | |
| 2094 | 2094 | |
| 2095 | 2095 | int y,y_start,y_end,y_inc; |
| 2096 | 2096 | int pri_base,inc; |
| r814 | r815 | |
| 2174 | 2174 | |
| 2175 | 2175 | /* set pixmap pointer */ |
| 2176 | 2176 | srcbitmap_pixel = tilemap_get_pixmap(pixel_tilemap); |
| 2177 | | |
| 2177 | flagsbitmap_pixel = tilemap_get_flags | |
| 2178 | 2178 | srcbitmap_vram = tilemap_get_pixmap(vram_tilemap); |
| 2179 | | |
| 2179 | flagsbitmap_vram = tilemap_get_flags | |
| 2180 | 2180 | |
| 2181 | 2181 | y=y_start; |
| 2182 | 2182 | while(y!=y_end) |
| r814 | r815 | |
| 2200 | 2200 | line_t->src[y]=&src_s[sx]; |
| 2201 | 2201 | |
| 2202 | 2202 | if (usePixelLayer) |
| 2203 | line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8( | |
| 2203 | line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap_pixel, sy&0xff, 0); | |
| 2204 | 2204 | else |
| 2205 | line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8( | |
| 2205 | line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap_vram, sy&0x1ff, 0); | |
| 2206 | 2206 | line_t->tsrc[y]=&tsrc_s[sx]; |
| 2207 | 2207 | } |
| 2208 | 2208 |
| r814 | r815 | |
|---|---|---|
| 113 | 113 | int data2 = gaelco2_videoram[(((gaelco2_vregs[0] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)]; |
| 114 | 114 | int code = ((data & 0x07) << 16) | (data2 & 0xffff); |
| 115 | 115 | |
| 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)); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | static TILE_GET_INFO( get_tile_info_gaelco2_screen1 ) |
| r814 | r815 | |
| 122 | 122 | int data2 = gaelco2_videoram[(((gaelco2_vregs[1] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)]; |
| 123 | 123 | int code = ((data & 0x07) << 16) | (data2 & 0xffff); |
| 124 | 124 | |
| 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)); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| r814 | r815 | |
| 154 | 154 | int data2 = gaelco2_videoram[(((gaelco2_vregs[0] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)]; |
| 155 | 155 | int code = ((data & 0x07) << 16) | (data2 & 0xffff); |
| 156 | 156 | |
| 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)); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | static TILE_GET_INFO( get_tile_info_gaelco2_screen1_dual ) |
| r814 | r815 | |
| 163 | 163 | int data2 = gaelco2_videoram[(((gaelco2_vregs[1] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)]; |
| 164 | 164 | int code = ((data & 0x07) << 16) | (data2 & 0xffff); |
| 165 | 165 | |
| 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)); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
| r814 | r815 | |
| 267 | 267 | gaelco2_videoram = spriteram16; |
| 268 | 268 | |
| 269 | 269 | /* 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); | |
| 272 | 272 | |
| 273 | 273 | /* set tilemap properties */ |
| 274 | 274 | tilemap_set_transparent_pen(pant[0],0); |
| r814 | r815 | |
| 287 | 287 | gaelco2_videoram = spriteram16; |
| 288 | 288 | |
| 289 | 289 | /* 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); | |
| 292 | 292 | |
| 293 | 293 | /* set tilemap properties */ |
| 294 | 294 | tilemap_set_transparent_pen(pant[0],0); |
| r814 | r815 | |
|---|---|---|
| 55 | 55 | int tileno,palno; |
| 56 | 56 | tileno = (homerun_videoram[tile_index])+((homerun_videoram[tile_index+0x1000]&0x38)<<5)+ ((homerun_gfx_ctrl&1)<<11); |
| 57 | 57 | palno=(homerun_videoram[tile_index+0x1000]&0x7); |
| 58 | SET_TILE_INFO(0,tileno,palno,0) | |
| 58 | SET_TILE_INFO(0,tileno,palno,0); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | VIDEO_START(homerun) |
| 64 | 64 | { |
| 65 | homerun_tilemap = tilemap_create(get_homerun_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 65 | homerun_tilemap = tilemap_create(get_homerun_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r814 | r815 | |
|---|---|---|
| 111 | 111 | int code = videoram[tile_index]; |
| 112 | 112 | int color = (colorram[tile_index] & 0x1f) + 32; |
| 113 | 113 | |
| 114 | SET_TILE_INFO(gfxbank, code, color, 0) | |
| 114 | SET_TILE_INFO(gfxbank, code, color, 0); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | VIDEO_START( champbas ) |
| 118 | 118 | { |
| 119 | 119 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 120 | TILEMAP_TYPE_ | |
| 120 | TILEMAP_TYPE_ | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 62 | 62 | ***************************************************************************/ |
| 63 | 63 | |
| 64 | 64 | /* convert from 32x32 to 36x28 */ |
| 65 | static | |
| 65 | static | |
| 66 | 66 | { |
| 67 | 67 | int offs; |
| 68 | 68 | |
| r814 | r815 | |
| 82 | 82 | 0, |
| 83 | 83 | baraduke_textram[tile_index], |
| 84 | 84 | (baraduke_textram[tile_index+0x400] << 2) & 0x1ff, |
| 85 | 0) | |
| 85 | 0); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static TILE_GET_INFO( get_tile_info0 ) |
| r814 | r815 | |
| 94 | 94 | 1, |
| 95 | 95 | code + ((attr & 0x03) << 8), |
| 96 | 96 | attr, |
| 97 | 0) | |
| 97 | 0); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static TILE_GET_INFO( get_tile_info1 ) |
| r814 | r815 | |
| 106 | 106 | 2, |
| 107 | 107 | code + ((attr & 0x03) << 8), |
| 108 | 108 | attr, |
| 109 | 0) | |
| 109 | 0); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| r814 | r815 | |
| 119 | 119 | |
| 120 | 120 | VIDEO_START( baraduke ) |
| 121 | 121 | { |
| 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); | |
| 125 | 125 | |
| 126 | 126 | tilemap_set_transparent_pen(tx_tilemap,3); |
| 127 | 127 | tilemap_set_transparent_pen(bg_tilemap[0],7); |
| r814 | r815 | |
| 323 | 323 | else |
| 324 | 324 | back = 0; |
| 325 | 325 | |
| 326 | tilemap_draw(bitmap,cliprect,bg_tilemap[back],TILEMAP_ | |
| 326 | tilemap_draw(bitmap,cliprect,bg_tilemap[back],TILEMAP_D | |
| 327 | 327 | draw_sprites(machine, bitmap,cliprect,0); |
| 328 | 328 | tilemap_draw(bitmap,cliprect,bg_tilemap[back ^ 1],0,0); |
| 329 | 329 | draw_sprites(machine, bitmap,cliprect,1); |
| r814 | r815 | |
|---|---|---|
| 117 | 117 | int color = (colorram[tile_index] & 0x30) >> 4; |
| 118 | 118 | int flags = ((tile_index % 32) >= 16) ? TILE_FLIPY : 0; |
| 119 | 119 | |
| 120 | SET_TILE_INFO(1, code, color, flags) | |
| 120 | SET_TILE_INFO(1, code, color, flags); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 125 | 125 | int code = ssozumo_videoram2[tile_index] + 256 * (ssozumo_colorram2[tile_index] & 0x07); |
| 126 | 126 | int color = (ssozumo_colorram2[tile_index] & 0x30) >> 4; |
| 127 | 127 | |
| 128 | SET_TILE_INFO(0, code, color, 0) | |
| 128 | SET_TILE_INFO(0, code, color, 0); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | VIDEO_START( ssozumo ) |
| 132 | 132 | { |
| 133 | 133 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x, |
| 134 | TILEMAP_TYPE_ | |
| 134 | TILEMAP_TYPE_ | |
| 135 | 135 | |
| 136 | 136 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x, |
| 137 | TILEMAP_TYPE_ | |
| 137 | TILEMAP_TYPE_ | |
| 138 | 138 | |
| 139 | 139 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 140 | 140 | } |
| r814 | r815 | |
|---|---|---|
| 31 | 31 | SET_TILE_INFO(0, videoram[tile_index], 0, 0); |
| 32 | 32 | |
| 33 | 33 | /* sprite color base is constant 0x10 */ |
| 34 | tileinfo-> | |
| 34 | tileinfo->categor | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| r814 | r815 | |
| 56 | 56 | SET_TILE_INFO(0, code, color, TILE_FLIPYX((data >> 9) & 3)); |
| 57 | 57 | |
| 58 | 58 | /* sprite color base comes from the top 2 bits */ |
| 59 | tileinfo-> | |
| 59 | tileinfo->categor | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| r814 | r815 | |
| 81 | 81 | SET_TILE_INFO(0, code, color, TILE_FLIPYX((data >> 10) & 3)); |
| 82 | 82 | |
| 83 | 83 | /* sprite color base might come from the top 2 bits */ |
| 84 | tileinfo-> | |
| 84 | tileinfo->categor | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
| r814 | r815 | |
| 98 | 98 | switch (mcr_cpu_board) |
| 99 | 99 | { |
| 100 | 100 | case 90009: |
| 101 | bg_tilemap = tilemap_create(mcr_90009_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 101 | bg_tilemap = tilemap_create(mcr_90009_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 102 | 102 | break; |
| 103 | 103 | |
| 104 | 104 | case 90010: |
| 105 | bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 105 | bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 106 | 106 | break; |
| 107 | 107 | |
| 108 | 108 | case 91475: |
| 109 | bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 109 | bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 110 | 110 | break; |
| 111 | 111 | |
| 112 | 112 | case 91490: |
| 113 | bg_tilemap = tilemap_create(mcr_91490_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 113 | bg_tilemap = tilemap_create(mcr_91490_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 114 | 114 | break; |
| 115 | 115 | |
| 116 | 116 | default: |
| r814 | r815 | |
|---|---|---|
| 62 | 62 | 0, |
| 63 | 63 | tile, |
| 64 | 64 | color&0x7f, |
| 65 | TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2)) | |
| 65 | TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2)); | |
| 66 | 66 | |
| 67 | 67 | /* Priority 1 = tile appears above sprites */ |
| 68 | tileinfo-> | |
| 68 | tileinfo->categor | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static TILE_GET_INFO( get_pf2_tile_info ) |
| r814 | r815 | |
| 81 | 81 | 0, |
| 82 | 82 | tile, |
| 83 | 83 | color&0x7f, |
| 84 | TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2)) | |
| 84 | TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2)); | |
| 85 | 85 | |
| 86 | tileinfo-> | |
| 86 | tileinfo->categor | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static TILE_GET_INFO( get_pf3_tile_info ) |
| r814 | r815 | |
| 99 | 99 | 0, |
| 100 | 100 | tile, |
| 101 | 101 | color&0x7f, |
| 102 | TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2)) | |
| 102 | TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2)); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static TILE_GET_INFO( get_pf4_tile_info ) |
| r814 | r815 | |
| 115 | 115 | 0, |
| 116 | 116 | tile, |
| 117 | 117 | color&0x7f, |
| 118 | TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2)) | |
| 118 | TILE_FLIPYX((m107_vram_data[tile_index+3] & 0xc)>>2)); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /*****************************************************************************/ |
| r814 | r815 | |
| 218 | 218 | { |
| 219 | 219 | pf1_layer = tilemap_create( |
| 220 | 220 | get_pf1_tile_info,tilemap_scan_rows, |
| 221 | TILEMAP_TYPE_ | |
| 221 | TILEMAP_TYPE_ | |
| 222 | 222 | 8,8, |
| 223 | 223 | 64,64 |
| 224 | 224 | ); |
| 225 | 225 | |
| 226 | 226 | pf2_layer = tilemap_create( |
| 227 | 227 | get_pf2_tile_info,tilemap_scan_rows, |
| 228 | TILEMAP_TYPE_ | |
| 228 | TILEMAP_TYPE_ | |
| 229 | 229 | 8,8, |
| 230 | 230 | 64,64 |
| 231 | 231 | ); |
| 232 | 232 | |
| 233 | 233 | pf3_layer = tilemap_create( |
| 234 | 234 | get_pf3_tile_info,tilemap_scan_rows, |
| 235 | TILEMAP_TYPE_ | |
| 235 | TILEMAP_TYPE_ | |
| 236 | 236 | 8,8, |
| 237 | 237 | 64,64 |
| 238 | 238 | ); |
| r814 | r815 | |
|---|---|---|
| 150 | 150 | |
| 151 | 151 | /* chip 0 does tilemaps on the left, chip 1 center, chip 2 the right */ |
| 152 | 152 | // draw bottom layer |
| 153 | nodraw = TC0100SCN_tilemap_draw(machine,bitmap,cliprect,screen,layer[0],TILEMAP_ | |
| 153 | nodraw = TC0100SCN_tilemap_draw(machine,bitmap,cliprect,screen,layer[0],TILEMAP_D | |
| 154 | 154 | |
| 155 | 155 | /* Ensure screen blanked even when bottom layers not drawn due to disable bit */ |
| 156 | 156 | if (nodraw) fillbitmap(bitmap, get_black_pen(machine), cliprect); |
| r814 | r815 | |
|---|---|---|
| 69 | 69 | int code = videoram[offs + 1] + ((videoram[offs] & 0x07) << 8) + 2048 * gfxbank; |
| 70 | 70 | int color = ((videoram[offs] & 0xf8) >> 3) + 32 * palettebank; |
| 71 | 71 | |
| 72 | SET_TILE_INFO(0, code, color, 0) | |
| 72 | SET_TILE_INFO(0, code, color, 0); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | VIDEO_START( arkanoid ) |
| 76 | 76 | { |
| 77 | 77 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 78 | TILEMAP_TYPE_ | |
| 78 | TILEMAP_TYPE_ | |
| 79 | 79 | |
| 80 | 80 | state_save_register_global(gfxbank); |
| 81 | 81 | state_save_register_global(palettebank); |
| r814 | r815 | |
|---|---|---|
| 497 | 497 | int code = attr & 0x1ff; |
| 498 | 498 | int color = (attr >> 9) & 0x0f; |
| 499 | 499 | |
| 500 | SET_TILE_INFO(0, code, color, 0) | |
| 500 | SET_TILE_INFO(0, code, color, 0); | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | VIDEO_START( twin16 ) |
| 504 | 504 | { |
| 505 | 505 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows_flip_y, |
| 506 | TILEMAP_TYPE_ | |
| 506 | TILEMAP_TYPE_ | |
| 507 | 507 | |
| 508 | 508 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 509 | 509 | } |
| r814 | r815 | |
| 511 | 511 | VIDEO_START( fround ) |
| 512 | 512 | { |
| 513 | 513 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 514 | TILEMAP_TYPE_ | |
| 514 | TILEMAP_TYPE_ | |
| 515 | 515 | |
| 516 | 516 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 517 | 517 | } |
| r814 | r815 | |
|---|---|---|
| 349 | 349 | 3 2 x 16 2 x 4 |
| 350 | 350 | */ |
| 351 | 351 | |
| 352 | static | |
| 352 | static | |
| 353 | 353 | { |
| 354 | 354 | return (col * TILES_PER_PAGE_Y) + |
| 355 | 355 | (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE * (num_cols / TILES_PER_PAGE_X) + |
| 356 | 356 | (row % TILES_PER_PAGE_Y); |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | static | |
| 359 | static | |
| 360 | 360 | { |
| 361 | 361 | return ( ((col / 2) * (TILES_PER_PAGE_Y / 2)) + |
| 362 | 362 | ((row / 2) / (TILES_PER_PAGE_Y / 2)) * (TILES_PER_PAGE / 4) * (num_cols / TILES_PER_PAGE_X) + |
| r814 | r815 | |
| 365 | 365 | |
| 366 | 366 | static TILE_GET_INFO( megasys1_get_scroll_tile_info_8x8 ) |
| 367 | 367 | { |
| 368 | int tmap = (FPTR) | |
| 368 | int tmap = (FPTR)pa | |
| 369 | 369 | UINT16 code = megasys1_scrollram[tmap][tile_index]; |
| 370 | 370 | SET_TILE_INFO(tmap, (code & 0xfff) * megasys1_8x8_scroll_factor[tmap], code >> (16 - megasys1_bits_per_color_code), 0); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | static TILE_GET_INFO( megasys1_get_scroll_tile_info_16x16 ) |
| 374 | 374 | { |
| 375 | int tmap = (FPTR) | |
| 375 | int tmap = (FPTR)pa | |
| 376 | 376 | UINT16 code = megasys1_scrollram[tmap][tile_index/4]; |
| 377 | 377 | SET_TILE_INFO(tmap, (code & 0xfff) * megasys1_16x16_scroll_factor[tmap] + (tile_index & 3), code >> (16 - megasys1_bits_per_color_code), 0); |
| 378 | 378 | } |
| r814 | r815 | |
| 385 | 385 | { |
| 386 | 386 | /* 16x16 tilemaps */ |
| 387 | 387 | megasys1_tilemap[layer][0][0] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16, |
| 388 | TILEMAP_TYPE_ | |
| 388 | TILEMAP_TYPE_ | |
| 389 | 389 | megasys1_tilemap[layer][0][1] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16, |
| 390 | TILEMAP_TYPE_ | |
| 390 | TILEMAP_TYPE_ | |
| 391 | 391 | megasys1_tilemap[layer][0][2] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16, |
| 392 | TILEMAP_TYPE_ | |
| 392 | TILEMAP_TYPE_ | |
| 393 | 393 | megasys1_tilemap[layer][0][3] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16, |
| 394 | TILEMAP_TYPE_ | |
| 394 | TILEMAP_TYPE_ | |
| 395 | 395 | |
| 396 | 396 | /* 8x8 tilemaps */ |
| 397 | 397 | megasys1_tilemap[layer][1][0] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8, |
| 398 | TILEMAP_TYPE_ | |
| 398 | TILEMAP_TYPE_ | |
| 399 | 399 | megasys1_tilemap[layer][1][1] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8, |
| 400 | TILEMAP_TYPE_ | |
| 400 | TILEMAP_TYPE_ | |
| 401 | 401 | megasys1_tilemap[layer][1][2] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8, |
| 402 | TILEMAP_TYPE_ | |
| 402 | TILEMAP_TYPE_ | |
| 403 | 403 | megasys1_tilemap[layer][1][3] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8, |
| 404 | TILEMAP_TYPE_ | |
| 404 | TILEMAP_TYPE_ | |
| 405 | 405 | |
| 406 | 406 | /* set user data and transparency */ |
| 407 | 407 | for (i = 0; i < 8; i++) |
| r814 | r815 | |
| 976 | 976 | |
| 977 | 977 | fillbitmap(priority_bitmap,0,cliprect); |
| 978 | 978 | |
| 979 | flag = TILEMAP_ | |
| 979 | flag = TILEMAP_D | |
| 980 | 980 | primask = 0; |
| 981 | 981 | |
| 982 | 982 | for (i = 0;i < 5;i++) |
| r814 | r815 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | int code = crshrace_videoram1[tile_index]; |
| 24 | 24 | |
| 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); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | static TILE_GET_INFO( get_tile_info2 ) |
| 29 | 29 | { |
| 30 | 30 | int code = crshrace_videoram2[tile_index]; |
| 31 | 31 | |
| 32 | SET_TILE_INFO(0,code,0,0) | |
| 32 | SET_TILE_INFO(0,code,0,0); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
| r814 | r815 | |
| 41 | 41 | |
| 42 | 42 | VIDEO_START( crshrace ) |
| 43 | 43 | { |
| 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); | |
| 46 | 46 | |
| 47 | 47 | K053936_wraparound_enable(0, 1); |
| 48 | 48 | K053936_set_offset(0, -48, -21); |
| r814 | r815 | |
|---|---|---|
| 101 | 101 | int code = airbustr_videoram2[tile_index] + ((attr & 0x0f) << 8); |
| 102 | 102 | int color = attr >> 4; |
| 103 | 103 | |
| 104 | SET_TILE_INFO(0, code, color, 0) | |
| 104 | SET_TILE_INFO(0, code, color, 0); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 110 | 110 | int code = videoram[tile_index] + ((attr & 0x0f) << 8); |
| 111 | 111 | int color = (attr >> 4) + 16; |
| 112 | 112 | |
| 113 | SET_TILE_INFO(0, code, color, 0) | |
| 113 | SET_TILE_INFO(0, code, color, 0); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | VIDEO_START( airbustr ) |
| 117 | 117 | { |
| 118 | 118 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 119 | TILEMAP_TYPE_ | |
| 119 | TILEMAP_TYPE_ | |
| 120 | 120 | |
| 121 | 121 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 122 | TILEMAP_TYPE_ | |
| 122 | TILEMAP_TYPE_ | |
| 123 | 123 | |
| 124 | 124 | sprites_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 125 | 125 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| r814 | r815 | |
|---|---|---|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | static | |
| 146 | static | |
| 147 | 147 | { |
| 148 | 148 | int offs; |
| 149 | 149 | |
| r814 | r815 | |
| 162 | 162 | int code = videoram[tile_index] | (charbank << 8); |
| 163 | 163 | int attr = (colorram[tile_index] & 0x1f) | (colortablebank << 5) | (palettebank << 6 ); |
| 164 | 164 | |
| 165 | SET_TILE_INFO(0,code,attr,0) | |
| 165 | SET_TILE_INFO(0,code,attr,0); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /*************************************************************************** |
| r814 | r815 | |
| 197 | 197 | /* one pixel to the left to get a more correct placement */ |
| 198 | 198 | xoffsethack = 1; |
| 199 | 199 | |
| 200 | bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_ | |
| 200 | bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_ | |
| 201 | 201 | |
| 202 | 202 | tilemap_set_scrolldx( bg_tilemap, 0, 384 - 288 ); |
| 203 | 203 | tilemap_set_scrolldy( bg_tilemap, 0, 264 - 224 ); |
| r814 | r815 | |
| 227 | 227 | if (bgpriority != 0) |
| 228 | 228 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 229 | 229 | else |
| 230 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 230 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_D | |
| 231 | 231 | |
| 232 | 232 | if( spriteram_size ) |
| 233 | 233 | { |
| r814 | r815 | |
| 315 | 315 | |
| 316 | 316 | xoffsethack = 0; |
| 317 | 317 | |
| 318 | bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_ | |
| 318 | bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_ | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | WRITE8_HANDLER( pengo_palettebank_w ) |
| r814 | r815 | |
| 375 | 375 | code = videoram[tile_index] + (colbank << 8); |
| 376 | 376 | attr = colorram[tile_index & 0x1f]; |
| 377 | 377 | |
| 378 | SET_TILE_INFO(0,code,attr & 0x1f,0) | |
| 378 | SET_TILE_INFO(0,code,attr & 0x1f,0); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | VIDEO_START( s2650games ) |
| r814 | r815 | |
| 391 | 391 | |
| 392 | 392 | xoffsethack = 1; |
| 393 | 393 | |
| 394 | bg_tilemap = tilemap_create( s2650_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 394 | bg_tilemap = tilemap_create( s2650_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 395 | 395 | |
| 396 | 396 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 397 | 397 | } |
| r814 | r815 | |
| 488 | 488 | 2018 - 2045 = column 1 attr (28 rows) |
| 489 | 489 | */ |
| 490 | 490 | |
| 491 | static | |
| 491 | static | |
| 492 | 492 | { |
| 493 | 493 | int offs; |
| 494 | 494 | |
| r814 | r815 | |
| 518 | 518 | code = videoram[tile_index] | (charbank << 8); |
| 519 | 519 | attr = (videoram[color_index] & 0x1f) | (colortablebank << 5) | (palettebank << 6 ); |
| 520 | 520 | |
| 521 | SET_TILE_INFO(0,code,attr,0) | |
| 521 | SET_TILE_INFO(0,code,attr,0); | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | static void jrpacman_mark_tile_dirty( int offset ) |
| r814 | r815 | |
| 562 | 562 | |
| 563 | 563 | xoffsethack = 1; |
| 564 | 564 | |
| 565 | bg_tilemap = tilemap_create( jrpacman_get_tile_info,jrpacman_scan_rows,TILEMAP_TYPE_ | |
| 565 | bg_tilemap = tilemap_create( jrpacman_get_tile_info,jrpacman_scan_rows,TILEMAP_TYPE_ | |
| 566 | 566 | |
| 567 | 567 | tilemap_set_transparent_pen( bg_tilemap, 0 ); |
| 568 | 568 | tilemap_set_scroll_cols( bg_tilemap, 36 ); |
| r814 | r815 | |
|---|---|---|
| 137 | 137 | 1, |
| 138 | 138 | code, |
| 139 | 139 | 0, |
| 140 | 0) | |
| 140 | 0); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static TILE_GET_INFO( get_tile_info_0b ) |
| r814 | r815 | |
| 150 | 150 | 1, |
| 151 | 151 | code, |
| 152 | 152 | 0, |
| 153 | 0) | |
| 153 | 0); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | WRITE8_HANDLER( clshroad_vram_0_w ) |
| r814 | r815 | |
| 181 | 181 | ***************************************************************************/ |
| 182 | 182 | |
| 183 | 183 | /* logical (col,row) -> memory offset */ |
| 184 | static | |
| 184 | static | |
| 185 | 185 | { |
| 186 | 186 | // The leftmost columns come from the bottom rows |
| 187 | 187 | if (col <= 0x01) return row + (col + 0x1e) * 0x20; |
| r814 | r815 | |
| 205 | 205 | 2, |
| 206 | 206 | code, |
| 207 | 207 | color & 0x3f, |
| 208 | 0) | |
| 208 | 0); | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | static TILE_GET_INFO( get_tile_info_1 ) |
| r814 | r815 | |
| 216 | 216 | 2, |
| 217 | 217 | code + ((color & 0xf0)<<4), |
| 218 | 218 | color & 0x0f, |
| 219 | 0) | |
| 219 | 0); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | WRITE8_HANDLER( clshroad_vram_1_w ) |
| r814 | r815 | |
| 229 | 229 | VIDEO_START( firebatl ) |
| 230 | 230 | { |
| 231 | 231 | /* 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); | |
| 234 | 234 | /* Text (No scrolling) */ |
| 235 | tilemap_1 = tilemap_create(get_tile_info_fb1,tilemap_scan_rows_extra,TILEMAP_TYPE_ | |
| 235 | tilemap_1 = tilemap_create(get_tile_info_fb1,tilemap_scan_rows_extra,TILEMAP_TYPE_ | |
| 236 | 236 | |
| 237 | 237 | tilemap_set_scroll_rows( tilemap_0a, 1); |
| 238 | 238 | tilemap_set_scroll_rows( tilemap_0b, 1); |
| r814 | r815 | |
| 245 | 245 | tilemap_set_scrolldx( tilemap_0a, -0x30, -0xb5); |
| 246 | 246 | tilemap_set_scrolldx( tilemap_0b, -0x30, -0xb5); |
| 247 | 247 | |
| 248 | tilemap_set_transparent_pen( tilemap_0a, 0 ); | |
| 249 | 248 | tilemap_set_transparent_pen( tilemap_0b, 0 ); |
| 250 | 249 | tilemap_set_transparent_pen( tilemap_1, 0x0f ); |
| 251 | 250 | } |
| r814 | r815 | |
| 253 | 252 | VIDEO_START( clshroad ) |
| 254 | 253 | { |
| 255 | 254 | /* 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); | |
| 258 | 257 | /* Text (No scrolling) */ |
| 259 | tilemap_1 = tilemap_create(get_tile_info_1,tilemap_scan_rows_extra,TILEMAP_TYPE_ | |
| 258 | tilemap_1 = tilemap_create(get_tile_info_1,tilemap_scan_rows_extra,TILEMAP_TYPE_ | |
| 260 | 259 | |
| 261 | 260 | tilemap_set_scroll_rows( tilemap_0a, 1); |
| 262 | 261 | tilemap_set_scroll_rows( tilemap_0b, 1); |
| r814 | r815 | |
| 269 | 268 | tilemap_set_scrolldx( tilemap_0a, -0x30, -0xb5); |
| 270 | 269 | tilemap_set_scrolldx( tilemap_0b, -0x30, -0xb5); |
| 271 | 270 | |
| 272 | tilemap_set_transparent_pen( tilemap_0a, 0x0f ); | |
| 273 | 271 | tilemap_set_transparent_pen( tilemap_0b, 0x0f ); |
| 274 | 272 | tilemap_set_transparent_pen( tilemap_1, 0x0f ); |
| 275 | 273 | } |
| r814 | r815 | |
|---|---|---|
| 61 | 61 | zoom_colorbase[1] = 0x02; |
| 62 | 62 | |
| 63 | 63 | 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); | |
| 66 | 66 | |
| 67 | 67 | K051316_set_offset(0,7,0); |
| 68 | 68 | K051316_wraparound_enable(1,1); |
| r814 | r815 | |
| 78 | 78 | { |
| 79 | 79 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 80 | 80 | |
| 81 | K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_ | |
| 81 | K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_DRAW_LAYER1,0); | |
| 82 | 82 | K051960_sprites_draw(bitmap,cliprect,0,0); |
| 83 | K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_ | |
| 83 | K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_DRAW_LAYER0,0); | |
| 84 | 84 | K051960_sprites_draw(bitmap,cliprect,1,1); |
| 85 | 85 | K051316_zoom_draw_0(bitmap,cliprect,0,0); |
| 86 | 86 | return 0; |
| r814 | r815 | |
|---|---|---|
| 165 | 165 | |
| 166 | 166 | #define BW_SET_TILE_INFO(GFX, CODE, COLOR) { \ |
| 167 | 167 | tileinfo->pen_data = GFX->gfxdata + (CODE) * GFX->char_modulo; \ |
| 168 | tileinfo->pal_ | |
| 168 | tileinfo->palette_base = (GFX->colortable - Machine->remapped_colortable) + ((COLOR) << 3); \ | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static TILE_GET_INFO( get_fgtileinfo ) |
| 172 | 172 | { |
| 173 | 173 | 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); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | static TILE_GET_INFO( get_bgtileinfo ) |
| 178 | 178 | { |
| 179 | 179 | 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); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static TILE_GET_INFO( get_charinfo ) |
| 184 | 184 | { |
| 185 | SET_TILE_INFO(0, videoram[tile_index], 0, 0) | |
| 185 | SET_TILE_INFO(0, videoram[tile_index], 0, 0); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | static | |
| 188 | static | |
| 189 | 189 | { |
| 190 | 190 | return((col<<6) + row); |
| 191 | 191 | } |
| r814 | r815 | |
| 196 | 196 | UINT32 *dwptr; |
| 197 | 197 | int i; |
| 198 | 198 | |
| 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); | |
| 202 | 202 | srxlat = auto_malloc(0x8000); |
| 203 | 203 | |
| 204 | 204 | scrollmap[0] = fgmap; |
| r814 | r815 | |
|---|---|---|
| 24 | 24 | 0, |
| 25 | 25 | code, |
| 26 | 26 | color, |
| 27 | TILE_FLIPYX(attr & 3)) | |
| 27 | TILE_FLIPYX(attr & 3)); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 37 | 37 | 1, |
| 38 | 38 | code, |
| 39 | 39 | color, |
| 40 | TILE_FLIPYX(attr & 3)) | |
| 40 | TILE_FLIPYX(attr & 3)); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 47 | 47 | 3, |
| 48 | 48 | code & 0x3ff, |
| 49 | 49 | code>>12, |
| 50 | TILE_FLIPYX((code & 0xc00)>>10)) | |
| 50 | TILE_FLIPYX((code & 0xc00)>>10)); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| r814 | r815 | |
| 60 | 60 | |
| 61 | 61 | VIDEO_START( sf ) |
| 62 | 62 | { |
| 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); | |
| 66 | 66 | |
| 67 | 67 | tilemap_set_transparent_pen(fg_tilemap,15); |
| 68 | 68 | tilemap_set_transparent_pen(tx_tilemap,3); |
| r814 | r815 | |
|---|---|---|
| 37 | 37 | { |
| 38 | 38 | int tile = sengokmj_bgvram[tile_index*2] + (sengokmj_bgvram[2*tile_index+1] << 8); |
| 39 | 39 | int color = (tile >> 12) & 0x0f; |
| 40 | SET_TILE_INFO(1, tile & 0xfff, color, 0) | |
| 40 | SET_TILE_INFO(1, tile & 0xfff, color, 0); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | static TILE_GET_INFO( sengoku_md_tile_info ) |
| 44 | 44 | { |
| 45 | 45 | int tile = sengokmj_mdvram[tile_index*2] + (sengokmj_mdvram[2*tile_index+1] << 8); |
| 46 | 46 | 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); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static TILE_GET_INFO( sengoku_fg_tile_info ) |
| 51 | 51 | { |
| 52 | 52 | int tile = sengokmj_fgvram[tile_index*2] + (sengokmj_fgvram[2*tile_index+1] << 8); |
| 53 | 53 | 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); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static TILE_GET_INFO( sengoku_tx_tile_info ) |
| 58 | 58 | { |
| 59 | 59 | int tile = sengokmj_txvram[tile_index*2] + (sengokmj_txvram[2*tile_index+1] << 8); |
| 60 | 60 | 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); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int pri) |
| r814 | r815 | |
| 105 | 105 | |
| 106 | 106 | VIDEO_START( sengokmj ) |
| 107 | 107 | { |
| 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); | |
| 112 | 112 | |
| 113 | 113 | tilemap_set_transparent_pen(md_tilemap,15); |
| 114 | 114 | tilemap_set_transparent_pen(fg_tilemap,15); |
| r814 | r815 | |
|---|---|---|
| 269 | 269 | code, |
| 270 | 270 | color, |
| 271 | 271 | 0 ); |
| 272 | tileinfo-> | |
| 272 | tileinfo->categor | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /* Sailormn: the lower 2 Megabytes of tiles banked */ |
| r814 | r815 | |
| 320 | 320 | code, |
| 321 | 321 | color, |
| 322 | 322 | 0 ); |
| 323 | tileinfo-> | |
| 323 | tileinfo->categor | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
| r814 | r815 | |
| 410 | 410 | { |
| 411 | 411 | case 4: |
| 412 | 412 | tilemap_3 = tilemap_create( get_tile_info_3, tilemap_scan_rows, |
| 413 | TILEMAP_TYPE_ | |
| 413 | TILEMAP_TYPE_ | |
| 414 | 414 | tilemap_set_transparent_pen(tilemap_3, 0); |
| 415 | 415 | tilemap_set_scroll_rows(tilemap_3, 1); |
| 416 | 416 | tilemap_set_scroll_cols(tilemap_3, 1); |
| 417 | 417 | |
| 418 | 418 | case 3: |
| 419 | 419 | tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 420 | TILEMAP_TYPE_ | |
| 420 | TILEMAP_TYPE_ | |
| 421 | 421 | tilemap_set_transparent_pen(tilemap_2, 0); |
| 422 | 422 | tilemap_set_scroll_rows(tilemap_2, 1); |
| 423 | 423 | tilemap_set_scroll_cols(tilemap_2, 1); |
| 424 | 424 | |
| 425 | 425 | case 2: |
| 426 | 426 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 427 | TILEMAP_TYPE_ | |
| 427 | TILEMAP_TYPE_ | |
| 428 | 428 | tilemap_set_transparent_pen(tilemap_1, 0); |
| 429 | 429 | tilemap_set_scroll_rows(tilemap_1, 1); |
| 430 | 430 | tilemap_set_scroll_cols(tilemap_1, 1); |
| 431 | 431 | |
| 432 | 432 | case 1: |
| 433 | 433 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 434 | TILEMAP_TYPE_ | |
| 434 | TILEMAP_TYPE_ | |
| 435 | 435 | tilemap_set_transparent_pen(tilemap_0, 0); |
| 436 | 436 | tilemap_set_scroll_rows(tilemap_0, 1); |
| 437 | 437 | tilemap_set_scroll_cols(tilemap_0, 1); |
| r814 | r815 | |
| 479 | 479 | |
| 480 | 480 | /* Layer 2 (8x8) needs to be handled differently */ |
| 481 | 481 | tilemap_2 = tilemap_create( sailormn_get_tile_info_2, tilemap_scan_rows, |
| 482 | TILEMAP_TYPE_ | |
| 482 | TILEMAP_TYPE_ | |
| 483 | 483 | tilemap_set_transparent_pen(tilemap_2, 0); |
| 484 | 484 | tilemap_set_scroll_rows(tilemap_2, 1); |
| 485 | 485 | tilemap_set_scroll_cols(tilemap_2, 1); |
| r814 | r815 | |
|---|---|---|
| 630 | 630 | |
| 631 | 631 | /* Create tilemaps */ |
| 632 | 632 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 633 | TILEMAP_TYPE_ | |
| 633 | TILEMAP_TYPE_ | |
| 634 | 634 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 635 | TILEMAP_TYPE_ | |
| 635 | TILEMAP_TYPE_ | |
| 636 | 636 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, |
| 637 | TILEMAP_TYPE_ | |
| 637 | TILEMAP_TYPE_ | |
| 638 | 638 | |
| 639 | 639 | /* Configure tilemap transparency */ |
| 640 | 640 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| r814 | r815 | |
| 662 | 662 | |
| 663 | 663 | /* Create tilemaps */ |
| 664 | 664 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 665 | TILEMAP_TYPE_ | |
| 665 | TILEMAP_TYPE_ | |
| 666 | 666 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 667 | TILEMAP_TYPE_ | |
| 667 | TILEMAP_TYPE_ | |
| 668 | 668 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, |
| 669 | TILEMAP_TYPE_ | |
| 669 | TILEMAP_TYPE_ | |
| 670 | 670 | |
| 671 | 671 | /* Configure tilemap transparency */ |
| 672 | 672 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| r814 | r815 | |
| 693 | 693 | |
| 694 | 694 | /* Create tilemaps */ |
| 695 | 695 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 696 | TILEMAP_TYPE_ | |
| 696 | TILEMAP_TYPE_ | |
| 697 | 697 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 698 | TILEMAP_TYPE_ | |
| 698 | TILEMAP_TYPE_ | |
| 699 | 699 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, |
| 700 | TILEMAP_TYPE_ | |
| 700 | TILEMAP_TYPE_ | |
| 701 | 701 | |
| 702 | 702 | /* Configure tilemap transparency */ |
| 703 | 703 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| r814 | r815 | |
| 724 | 724 | |
| 725 | 725 | /* Create tilemaps */ |
| 726 | 726 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 727 | TILEMAP_TYPE_ | |
| 727 | TILEMAP_TYPE_ | |
| 728 | 728 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 729 | TILEMAP_TYPE_ | |
| 729 | TILEMAP_TYPE_ | |
| 730 | 730 | fg2_tilemap = tilemap_create(get_fg2_tile_info, tilemap_scan_cols, |
| 731 | TILEMAP_TYPE_ | |
| 731 | TILEMAP_TYPE_ | |
| 732 | 732 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, |
| 733 | TILEMAP_TYPE_ | |
| 733 | TILEMAP_TYPE_ | |
| 734 | 734 | |
| 735 | 735 | /* Configure tilemap transparency */ |
| 736 | 736 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| r814 | r815 | |
| 756 | 756 | |
| 757 | 757 | /* Create tilemaps */ |
| 758 | 758 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 759 | TILEMAP_TYPE_ | |
| 759 | TILEMAP_TYPE_ | |
| 760 | 760 | fg_tilemap = tilemap_create(flytiger_get_fg_tile_info, tilemap_scan_cols, |
| 761 | TILEMAP_TYPE_ | |
| 761 | TILEMAP_TYPE_ | |
| 762 | 762 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, |
| 763 | TILEMAP_TYPE_ | |
| 763 | TILEMAP_TYPE_ | |
| 764 | 764 | |
| 765 | 765 | /* Configure tilemap transparency */ |
| 766 | 766 | tilemap_set_transparent_pen(bg_tilemap, 15); |
| r814 | r815 | |
| 789 | 789 | |
| 790 | 790 | /* Create tilemaps */ |
| 791 | 791 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 792 | TILEMAP_TYPE_ | |
| 792 | TILEMAP_TYPE_ | |
| 793 | 793 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 794 | TILEMAP_TYPE_ | |
| 794 | TILEMAP_TYPE_ | |
| 795 | 795 | tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, |
| 796 | TILEMAP_TYPE_ | |
| 796 | TILEMAP_TYPE_ | |
| 797 | 797 | |
| 798 | 798 | /* Configure tilemap transparency */ |
| 799 | 799 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| r814 | r815 | |
| 823 | 823 | |
| 824 | 824 | /* Create tilemaps */ |
| 825 | 825 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 826 | TILEMAP_TYPE_ | |
| 826 | TILEMAP_TYPE_ | |
| 827 | 827 | bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_cols, |
| 828 | TILEMAP_TYPE_ | |
| 828 | TILEMAP_TYPE_ | |
| 829 | 829 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 830 | TILEMAP_TYPE_ | |
| 830 | TILEMAP_TYPE_ | |
| 831 | 831 | fg2_tilemap = tilemap_create(get_fg2_tile_info, tilemap_scan_cols, |
| 832 | TILEMAP_TYPE_ | |
| 832 | TILEMAP_TYPE_ | |
| 833 | 833 | |
| 834 | 834 | /* Configure tilemap transparency */ |
| 835 | 835 | tilemap_set_transparent_pen(bg2_tilemap, 15); |
| r814 | r815 | |
| 852 | 852 | |
| 853 | 853 | /* Create tilemaps */ |
| 854 | 854 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 855 | TILEMAP_TYPE_ | |
| 855 | TILEMAP_TYPE_ | |
| 856 | 856 | bg2_tilemap = fg_tilemap = fg2_tilemap = NULL; /* Stop scroll handler from crashing on these */ |
| 857 | 857 | |
| 858 | 858 | /* Register for save/restore */ |
| r814 | r815 | |
|---|---|---|
| 93 | 93 | int region = 1 + (code >> 7); |
| 94 | 94 | int colour = bgbasecolor + ((videoram[tile_index*2+1] & 0x04) >> 2); |
| 95 | 95 | |
| 96 | SET_TILE_INFO(region, code & 0x7f,colour,0) | |
| 96 | SET_TILE_INFO(region, code & 0x7f,colour,0); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | WRITE8_HANDLER( brkthru_bgram_w ) |
| r814 | r815 | |
| 106 | 106 | static TILE_GET_INFO( get_fg_tile_info ) |
| 107 | 107 | { |
| 108 | 108 | UINT8 code = brkthru_videoram[tile_index]; |
| 109 | SET_TILE_INFO(0, code, 0, 0) | |
| 109 | SET_TILE_INFO(0, code, 0, 0); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | WRITE8_HANDLER( brkthru_fgram_w ) |
| r814 | r815 | |
| 117 | 117 | |
| 118 | 118 | VIDEO_START( brkthru ) |
| 119 | 119 | { |
| 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); | |
| 122 | 122 | |
| 123 | 123 | tilemap_set_transparent_pen( fg_tilemap, 0 ); |
| 124 | 124 | tilemap_set_transparent_pen( bg_tilemap, 0 ); |
| r814 | r815 | |
| 263 | 263 | VIDEO_UPDATE( brkthru ) |
| 264 | 264 | { |
| 265 | 265 | tilemap_set_scrollx(bg_tilemap,0, bgscroll); |
| 266 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 266 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_D | |
| 267 | 267 | |
| 268 | 268 | /* low priority sprites */ |
| 269 | 269 | draw_sprites(machine, bitmap, cliprect, 0x01 ); |
| r814 | r815 | |
|---|---|---|
| 209 | 209 | state_save_register_global_pointer(williams2_paletteram, 0x400 * 2); |
| 210 | 210 | |
| 211 | 211 | /* create the tilemap */ |
| 212 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 212 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_ | |
| 213 | 213 | tilemap_set_scrolldx(bg_tilemap, 2, 0); |
| 214 | 214 | |
| 215 | 215 | state_save_register(); |
| r814 | r815 | |
|---|---|---|
| 462 | 462 | |
| 463 | 463 | tile=(dec8_pf0_data[offs]<<8) | dec8_pf0_data[offs+1]; |
| 464 | 464 | color=tile >> 12; |
| 465 | if (color>7 && game_uses_priority) tileinfo-> | |
| 465 | if (color>7 && game_uses_priority) tileinfo->categor | |
| 466 | 466 | |
| 467 | 467 | SET_TILE_INFO( |
| 468 | 468 | 2, |
| 469 | 469 | tile&0xfff, |
| 470 | 470 | color&gfx_mask, |
| 471 | 0) | |
| 471 | 0); | |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | static TILE_GET_INFO( get_bac1_tile_info ) |
| r814 | r815 | |
| 477 | 477 | |
| 478 | 478 | tile=(dec8_pf1_data[offs]<<8) | dec8_pf1_data[offs+1]; |
| 479 | 479 | color=tile >> 12; |
| 480 | if (color>7 && game_uses_priority) tileinfo-> | |
| 480 | if (color>7 && game_uses_priority) tileinfo->categor | |
| 481 | 481 | |
| 482 | 482 | SET_TILE_INFO( |
| 483 | 483 | 3, |
| 484 | 484 | tile&0xfff, |
| 485 | 485 | color&3, |
| 486 | 0) | |
| 486 | 0); | |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | static | |
| 489 | static | |
| 490 | 490 | { |
| 491 | 491 | /* logical (col,row) -> memory offset */ |
| 492 | 492 | return ((col & 0x0f) + ((row & 0x0f) << 4)) + ((col & 0x10) << 5) + ((row & 0x10) << 4); |
| r814 | r815 | |
| 502 | 502 | 0, |
| 503 | 503 | tile&0xfff, |
| 504 | 504 | color, |
| 505 | 0) | |
| 505 | 0); | |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | VIDEO_START( cobracom ) |
| 509 | 509 | { |
| 510 | 510 | 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); | |
| 513 | 513 | |
| 514 | 514 | tilemap_set_transparent_pen(dec8_pf1_tilemap,0); |
| 515 | 515 | tilemap_set_transparent_pen(dec8_fix_tilemap,0); |
| r814 | r815 | |
| 550 | 550 | 0, |
| 551 | 551 | tile&0x3ff, |
| 552 | 552 | color, |
| 553 | 0) | |
| 553 | 0); | |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | VIDEO_START( ghostb ) |
| 557 | 557 | { |
| 558 | 558 | 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_ | |
| 559 | dec8_fix_tilemap = tilemap_create(get_ghostb_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 560 | 560 | tilemap_set_transparent_pen(dec8_fix_tilemap,0); |
| 561 | 561 | |
| 562 | 562 | game_uses_priority=0; |
| r814 | r815 | |
| 571 | 571 | tilemap_set_scrolly( dec8_pf0_tilemap,0, (dec8_pf0_control[0x12]<<8)+dec8_pf0_control[0x13] ); |
| 572 | 572 | flip_screen_set(dec8_pf0_control[1]>>7); |
| 573 | 573 | |
| 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); | |
| 577 | 577 | draw_sprites2(machine,bitmap,cliprect,0); |
| 578 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_ | |
| 578 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0 | 1,0); | |
| 579 | 579 | tilemap_draw(bitmap,cliprect,dec8_fix_tilemap,0,0); |
| 580 | 580 | return 0; |
| 581 | 581 | } |
| r814 | r815 | |
| 590 | 590 | 0, |
| 591 | 591 | tile&0xfff, |
| 592 | 592 | color, |
| 593 | 0) | |
| 593 | 0); | |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | VIDEO_START( oscar ) |
| 597 | 597 | { |
| 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); | |
| 600 | 600 | |
| 601 | 601 | tilemap_set_transparent_pen(dec8_fix_tilemap,0); |
| 602 | 602 | tilemap_set_transmask(dec8_pf0_tilemap,0,0x00ff,0xff00); /* Bottom 8 pens */ |
| r814 | r815 | |
| 623 | 623 | tilemap_set_scrollx( dec8_pf0_tilemap,0, ((scroll2[0]<<8)+scroll2[1]) ); |
| 624 | 624 | tilemap_set_scrolly( dec8_pf0_tilemap,0, ((scroll2[2]<<8)+scroll2[3]) ); |
| 625 | 625 | |
| 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); | |
| 629 | 629 | draw_sprites1(machine,bitmap,cliprect,0); |
| 630 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_ | |
| 630 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0 | 1,0); | |
| 631 | 631 | tilemap_draw(bitmap,cliprect,dec8_fix_tilemap,0,0); |
| 632 | 632 | return 0; |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | static | |
| 635 | static | |
| 636 | 636 | { |
| 637 | 637 | /* logical (col,row) -> memory offset */ |
| 638 | 638 | return ((col & 0x0f) + ((row & 0x0f) << 4)) + ((col & 0x10) << 4) + ((row & 0x10) << 5); |
| r814 | r815 | |
| 644 | 644 | int tile=dec8_pf0_data[offs+1]+(dec8_pf0_data[offs]<<8); |
| 645 | 645 | int color=tile >> 12; |
| 646 | 646 | |
| 647 | if (color>7 && game_uses_priority) tileinfo-> | |
| 647 | if (color>7 && game_uses_priority) tileinfo->categor | |
| 648 | 648 | |
| 649 | 649 | SET_TILE_INFO( |
| 650 | 650 | 2, |
| 651 | 651 | tile&0xfff, |
| 652 | 652 | color, |
| 653 | 0) | |
| 653 | 0); | |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | static TILE_GET_INFO( get_lastmiss_fix_tile_info ) |
| r814 | r815 | |
| 663 | 663 | 0, |
| 664 | 664 | tile&0xfff, |
| 665 | 665 | color, |
| 666 | 0) | |
| 666 | 0); | |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | VIDEO_START( lastmiss ) |
| 670 | 670 | { |
| 671 | 671 | 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_ | |
| 672 | dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 673 | 673 | |
| 674 | 674 | tilemap_set_transparent_pen(dec8_fix_tilemap,0); |
| 675 | 675 | game_uses_priority=0; |
| r814 | r815 | |
| 677 | 677 | |
| 678 | 678 | VIDEO_START( shackled ) |
| 679 | 679 | { |
| 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); | |
| 682 | 682 | |
| 683 | 683 | tilemap_set_transparent_pen(dec8_fix_tilemap,0); |
| 684 | 684 | tilemap_set_transmask(dec8_pf0_tilemap,0,0x000f,0xfff0); /* Bottom 12 pens */ |
| r814 | r815 | |
| 691 | 691 | { |
| 692 | 692 | tilemap_set_scrollx( dec8_pf0_tilemap,0, (scroll2[0]<<8)+scroll2[1] ); |
| 693 | 693 | |
| 694 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_ | |
| 694 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 695 | 695 | srdarwin_draw_sprites(machine,bitmap,cliprect,0); //* (srdarwin37b5gre) |
| 696 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_ | |
| 696 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 697 | 697 | srdarwin_draw_sprites(machine,bitmap,cliprect,1); |
| 698 | 698 | tilemap_draw(bitmap,cliprect,dec8_fix_tilemap,0,0); |
| 699 | 699 | return 0; |
| r814 | r815 | |
| 704 | 704 | int tile=videoram[tile_index]; |
| 705 | 705 | int color=0; /* ? */ |
| 706 | 706 | |
| 707 | if (color>1) tileinfo-> | |
| 707 | if (color>1) tileinfo->categor | |
| 708 | 708 | |
| 709 | 709 | SET_TILE_INFO( |
| 710 | 710 | 0, |
| 711 | 711 | tile, |
| 712 | 712 | color, |
| 713 | 0) | |
| 713 | 0); | |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | //AT: improved priority and fixed stage 4+ crashes caused by bank overflow |
| r814 | r815 | |
| 718 | 718 | { |
| 719 | 719 | int tile=dec8_pf0_data[2*tile_index+1]+(dec8_pf0_data[2*tile_index]<<8); |
| 720 | 720 | int color=tile >> 12 & 3; |
| 721 | int flag = TILE_SPLIT(color); | |
| 722 | 721 | int bank; |
| 723 | 722 | |
| 724 | 723 | tile=tile&0x3ff; |
| r814 | r815 | |
| 728 | 727 | bank, |
| 729 | 728 | tile, |
| 730 | 729 | color, |
| 731 | flag) | |
| 730 | 0); | |
| 731 | tileinfo->group = color; | |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | VIDEO_START( srdarwin ) |
| 735 | 735 | { |
| 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); | |
| 738 | 738 | |
| 739 | 739 | tilemap_set_transparent_pen(dec8_fix_tilemap,0); |
| 740 | 740 | tilemap_set_transmask(dec8_pf0_tilemap,0,0xffff,0x0000); //* draw as background only |
| r814 | r815 | |
| 750 | 750 | tilemap_set_scrollx( dec8_pf0_tilemap,0, ((scroll2[0]<<8)+scroll2[1]) ); |
| 751 | 751 | tilemap_set_scrolly( dec8_pf0_tilemap,0, ((scroll2[2]<<8)+scroll2[3]) ); |
| 752 | 752 | |
| 753 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_ | |
| 753 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 754 | 754 | draw_sprites1(machine,bitmap,cliprect,2); |
| 755 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_ | |
| 755 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 756 | 756 | draw_sprites1(machine,bitmap,cliprect,1); |
| 757 | 757 | tilemap_draw(bitmap,cliprect,dec8_fix_tilemap,0,0); |
| 758 | 758 | return 0; |
| r814 | r815 | |
| 780 | 780 | 0, |
| 781 | 781 | tile&0xfff, |
| 782 | 782 | color, |
| 783 | 0) | |
| 783 | 0); | |
| 784 | 784 | } |
| 785 | 785 | |
| 786 | 786 | static TILE_GET_INFO( get_gondo_tile_info ) |
| r814 | r815 | |
| 789 | 789 | int tile=dec8_pf0_data[offs+1]+(dec8_pf0_data[offs]<<8); |
| 790 | 790 | int color=tile>> 12; |
| 791 | 791 | |
| 792 | if (color>7 && game_uses_priority) tileinfo-> | |
| 792 | if (color>7 && game_uses_priority) tileinfo->categor | |
| 793 | 793 | |
| 794 | 794 | SET_TILE_INFO( |
| 795 | 795 | 2, |
| 796 | 796 | tile&0xfff, |
| 797 | 797 | color, |
| 798 | 0) | |
| 798 | 0); | |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | VIDEO_START( gondo ) |
| 802 | 802 | { |
| 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); | |
| 805 | 805 | |
| 806 | 806 | tilemap_set_transparent_pen(dec8_fix_tilemap,0); |
| 807 | 807 | tilemap_set_transmask(dec8_pf0_tilemap,0,0x00ff,0xff00); /* Bottom 8 pens */ |
| r814 | r815 | |
| 810 | 810 | |
| 811 | 811 | VIDEO_START( garyoret ) |
| 812 | 812 | { |
| 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); | |
| 815 | 815 | |
| 816 | 816 | tilemap_set_transparent_pen(dec8_fix_tilemap,0); |
| 817 | 817 | game_uses_priority=1; |
| r814 | r815 | |
|---|---|---|
| 63 | 63 | { \ |
| 64 | 64 | UINT16 code = (fuuki32_vram_##_N_[tile_index]&0xffff0000)>>16; \ |
| 65 | 65 | 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 )); \ | |
| 67 | 67 | } \ |
| 68 | 68 | \ |
| 69 | 69 | WRITE32_HANDLER( fuuki32_vram_##_N_##_w ) \ |
| r814 | r815 | |
| 80 | 80 | { \ |
| 81 | 81 | UINT16 code = (fuuki32_vram_##_N_[tile_index]&0xffff0000)>>16; \ |
| 82 | 82 | 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 )); \ | |
| 84 | 84 | } \ |
| 85 | 85 | \ |
| 86 | 86 | WRITE32_HANDLER( fuuki32_vram_##_N_##_w ) \ |
| r814 | r815 | |
| 110 | 110 | buffered_spriteram32_2 = auto_malloc(spriteram_size); |
| 111 | 111 | |
| 112 | 112 | tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 113 | TILEMAP_TYPE_ | |
| 113 | TILEMAP_TYPE_ | |
| 114 | 114 | |
| 115 | 115 | tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 116 | TILEMAP_TYPE_ | |
| 116 | TILEMAP_TYPE_ | |
| 117 | 117 | |
| 118 | 118 | tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 119 | TILEMAP_TYPE_ | |
| 119 | TILEMAP_TYPE_ | |
| 120 | 120 | |
| 121 | 121 | tilemap_3 = tilemap_create( get_tile_info_3, tilemap_scan_rows, |
| 122 | TILEMAP_TYPE_ | |
| 122 | TILEMAP_TYPE_ | |
| 123 | 123 | |
| 124 | 124 | tilemap_set_transparent_pen(tilemap_0,0xff); // 8 bits |
| 125 | 125 | tilemap_set_transparent_pen(tilemap_1,0xff); // 8 bits |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | tileno = tbowl_txvideoram[tile_index] | ((tbowl_txvideoram[tile_index+0x800] & 0x07) << 8); |
| 29 | 29 | col = (tbowl_txvideoram[tile_index+0x800] & 0xf0) >> 4; |
| 30 | 30 | |
| 31 | SET_TILE_INFO(0,tileno,col,0) | |
| 31 | SET_TILE_INFO(0,tileno,col,0); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | WRITE8_HANDLER( tbowl_txvideoram_w ) |
| r814 | r815 | |
| 47 | 47 | tileno = tbowl_bgvideoram[tile_index] | ((tbowl_bgvideoram[tile_index+0x1000] & 0x0f) << 8); |
| 48 | 48 | col = (tbowl_bgvideoram[tile_index+0x1000] & 0xf0) >> 4; |
| 49 | 49 | |
| 50 | SET_TILE_INFO(1,tileno,col,0) | |
| 50 | SET_TILE_INFO(1,tileno,col,0); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | WRITE8_HANDLER( tbowl_bg2videoram_w ) |
| r814 | r815 | |
| 87 | 87 | tileno ^= 0x400; |
| 88 | 88 | col = (tbowl_bg2videoram[tile_index+0x1000] & 0xf0) >> 4; |
| 89 | 89 | |
| 90 | SET_TILE_INFO(2,tileno,col,0) | |
| 90 | SET_TILE_INFO(2,tileno,col,0); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | WRITE8_HANDLER( tbowl_bgvideoram_w ) |
| r814 | r815 | |
| 204 | 204 | |
| 205 | 205 | VIDEO_START( tbowl ) |
| 206 | 206 | { |
| 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); | |
| 210 | 210 | |
| 211 | 211 | tilemap_set_transparent_pen(tx_tilemap,0); |
| 212 | 212 | tilemap_set_transparent_pen(bg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 108 | 108 | int gfxn = (attr & 0x01) + 1; |
| 109 | 109 | int color = (attr >> 1) & 0x03; |
| 110 | 110 | |
| 111 | SET_TILE_INFO(gfxn, code, color, 0) | |
| 111 | SET_TILE_INFO(gfxn, code, color, 0); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | static | |
| 114 | static | |
| 115 | 115 | { |
| 116 | 116 | /* |
| 117 | 117 | Tilemap Memory Organization |
| r814 | r815 | |
| 144 | 144 | VIDEO_START( battlane ) |
| 145 | 145 | { |
| 146 | 146 | bg_tilemap = tilemap_create(get_tile_info_bg, battlane_tilemap_scan_rows_2x2, |
| 147 | TILEMAP_TYPE_ | |
| 147 | TILEMAP_TYPE_ | |
| 148 | 148 | |
| 149 | 149 | screen_bitmap = auto_bitmap_alloc(32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED8); |
| 150 | 150 | } |
| r814 | r815 | |
|---|---|---|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | static | |
| 98 | static | |
| 99 | 99 | { |
| 100 | 100 | int bank = 1 - (col / (num_cols / 2)); |
| 101 | 101 | return bank * (num_rows * num_cols / 2) + row * (num_cols / 2) + (col % (num_cols / 2)); |
| r814 | r815 | |
| 138 | 138 | atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30); |
| 139 | 139 | |
| 140 | 140 | /* initialize the playfield */ |
| 141 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigt_playfield_scan, TILEMAP_TYPE_ | |
| 141 | atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigt_playfield_scan, TILEMAP_TYPE_ | |
| 142 | 142 | |
| 143 | 143 | /* initialize the motion objects */ |
| 144 | 144 | atarirle_init(0, &adjusted_modesc); |
| 145 | 145 | |
| 146 | 146 | /* initialize the alphanumerics */ |
| 147 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 147 | atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 148 | 148 | |
| 149 | 149 | /* allocate temp bitmaps */ |
| 150 | 150 | pf_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16); |
| r814 | r815 | |
|---|---|---|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | SET_TILE_INFO(2 * graphics_bank, code, fore_color, 0); |
| 181 | tileinfo-> | |
| 181 | tileinfo->categor | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | |
| r814 | r815 | |
| 191 | 191 | |
| 192 | 192 | static void video_start_common(UINT8 _color_count, int _color_granularity) |
| 193 | 193 | { |
| 194 | thepit_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 194 | thepit_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 195 | 195 | |
| 196 | 196 | tilemap_set_scroll_cols(thepit_tilemap, 32); |
| 197 | 197 |
| r814 | r815 | |
|---|---|---|
| 50 | 50 | 0, |
| 51 | 51 | code, |
| 52 | 52 | ((videoflags & 0x0010) >> 1) | ((data >> 13) & 7), |
| 53 | 0) | |
| 53 | 0); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static TILE_GET_INFO( get_bg1_tile_info ) |
| r814 | r815 | |
| 64 | 64 | 1, |
| 65 | 65 | code, |
| 66 | 66 | ((videoflags & 0x0020) >> 2) | ((data >> 13) & 7), |
| 67 | 0) | |
| 67 | 0); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| r814 | r815 | |
| 85 | 85 | VIDEO_START( rpunch ) |
| 86 | 86 | { |
| 87 | 87 | /* 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); | |
| 90 | 90 | |
| 91 | 91 | /* configure the tilemaps */ |
| 92 | 92 | tilemap_set_transparent_pen(background[1],15); |
| r814 | r815 | |
|---|---|---|
| 191 | 191 | int color = attr & 0x1f; |
| 192 | 192 | int flags = (attr & 0x20) ? TILE_FLIPX : 0; |
| 193 | 193 | |
| 194 | SET_TILE_INFO(0, code, color, flags) | |
| 194 | SET_TILE_INFO(0, code, color, flags); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | static UINT32 yard_tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ) |
| r814 | r815 | |
| 206 | 206 | VIDEO_START( yard ) |
| 207 | 207 | { |
| 208 | 208 | bg_tilemap = tilemap_create(yard_get_bg_tile_info, yard_tilemap_scan_rows, |
| 209 | TILEMAP_TYPE_ | |
| 209 | TILEMAP_TYPE_ | |
| 210 | 210 | |
| 211 | 211 | scroll_panel_bitmap = auto_bitmap_alloc(SCROLL_PANEL_WIDTH, machine->screen[0].height, machine->screen[0].format); |
| 212 | 212 | } |
| r814 | r815 | |
|---|---|---|
| 76 | 76 | { |
| 77 | 77 | K052109_tilemap_update(); |
| 78 | 78 | |
| 79 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_ | |
| 79 | tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_D | |
| 80 | 80 | K051960_sprites_draw(bitmap,cliprect,2,2); |
| 81 | 81 | tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0); |
| 82 | 82 | K051960_sprites_draw(bitmap,cliprect,1,1); |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 59 | 59 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 60 | 60 | |
| 61 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 61 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 62 | 62 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2); |
| 63 | 63 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4); |
| 64 | 64 | |
| r814 | r815 | |
| 83 | 83 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 84 | 84 | fillbitmap(bitmap, machine->pens[0], cliprect); |
| 85 | 85 | |
| 86 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_ | |
| 86 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_D | |
| 87 | 87 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2); |
| 88 | 88 | TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[2],0,4); |
| 89 | 89 |
| r814 | r815 | |
|---|---|---|
| 21 | 21 | static tilemap* bg_tilemap; |
| 22 | 22 | |
| 23 | 23 | |
| 24 | static UINT32 get_memory_offset(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) | |
| 25 | { | |
| 26 | return num_cols * row + col; | |
| 27 | } | |
| 28 | ||
| 29 | ||
| 30 | 24 | static TILE_GET_INFO( get_tile_info ) |
| 31 | 25 | { |
| 32 | 26 | int code = triplhnt_playfield_ram[tile_index] & 0x3f; |
| 33 | 27 | |
| 34 | SET_TILE_INFO(2, code, code == 0x3f ? 1 : 0, 0) | |
| 28 | SET_TILE_INFO(2, code, code == 0x3f ? 1 : 0, 0); | |
| 35 | 29 | } |
| 36 | 30 | |
| 37 | 31 | |
| r814 | r815 | |
| 39 | 33 | { |
| 40 | 34 | helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 41 | 35 | |
| 42 | bg_tilemap = tilemap_create(get_tile_info, | |
| 36 | bg_tilemap = tilemap_create(get_tile_info, | |
| 43 | 37 | } |
| 44 | 38 | |
| 45 | 39 |
| r814 | r815 | |
|---|---|---|
| 99 | 99 | int color = attr & 0x0f; |
| 100 | 100 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 101 | 101 | |
| 102 | SET_TILE_INFO(0, code, color, flags) | |
| 102 | SET_TILE_INFO(0, code, color, flags); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | VIDEO_START( pooyan ) |
| 106 | 106 | { |
| 107 | 107 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 108 | TILEMAP_TYPE_ | |
| 108 | TILEMAP_TYPE_ | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 53 | 53 | zoom_colorbase = 0; |
| 54 | 54 | |
| 55 | 55 | K053245_vh_start(machine,0,REGION_GFX1,NORMAL_PLANE_ORDER,sprite_callback); |
| 56 | K051316_vh_start_0(machine,REGION_GFX2,4, | |
| 56 | K051316_vh_start_0(machine,REGION_GFX2,4,F | |
| 57 | 57 | |
| 58 | 58 | K051316_set_offset(0, 22, 1); |
| 59 | 59 | } |
| r814 | r815 | |
|---|---|---|
| 51 | 51 | 0, |
| 52 | 52 | videoram[tile_index] + ((attr & 0x07) << 8), |
| 53 | 53 | ((attr & 0x10) >> 3) | ((attr & 0x20) >> 5), |
| 54 | TILE_FLIPX | TILE_SPLIT((attr & 0x80) >> 7)) | |
| 54 | TILE_FLIPX); | |
| 55 | tileinfo->group = (attr & 0x80) >> 7; | |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | |
| r814 | r815 | |
| 64 | 65 | |
| 65 | 66 | VIDEO_START( sidepckt ) |
| 66 | 67 | { |
| 67 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 68 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 68 | 69 | |
| 69 | 70 | tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */ |
| 70 | 71 | tilemap_set_transmask(bg_tilemap,1,0x01,0xfe); /* split type 1 has pen 0 transparent in front half */ |
| r814 | r815 | |
| 141 | 142 | |
| 142 | 143 | VIDEO_UPDATE( sidepckt ) |
| 143 | 144 | { |
| 144 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 145 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1,0); | |
| 145 | 146 | draw_sprites(machine, bitmap,cliprect); |
| 146 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_ | |
| 147 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER0,0); | |
| 147 | 148 | return 0; |
| 148 | 149 | } |
| r814 | r815 | |
|---|---|---|
| 16 | 16 | int code = pirates_tx_tileram[tile_index*2]; |
| 17 | 17 | int colr = pirates_tx_tileram[tile_index*2+1]; |
| 18 | 18 | |
| 19 | SET_TILE_INFO(0,code,colr,0) | |
| 19 | SET_TILE_INFO(0,code,colr,0); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 24 | 24 | int code = pirates_fg_tileram[tile_index*2]; |
| 25 | 25 | int colr = pirates_fg_tileram[tile_index*2+1]+0x80; |
| 26 | 26 | |
| 27 | SET_TILE_INFO(0,code,colr,0) | |
| 27 | SET_TILE_INFO(0,code,colr,0); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 32 | 32 | int code = pirates_bg_tileram[tile_index*2]; |
| 33 | 33 | int colr = pirates_bg_tileram[tile_index*2+1]+ 0x100; |
| 34 | 34 | |
| 35 | SET_TILE_INFO(0,code,colr,0) | |
| 35 | SET_TILE_INFO(0,code,colr,0); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| r814 | r815 | |
| 40 | 40 | |
| 41 | 41 | VIDEO_START(pirates) |
| 42 | 42 | { |
| 43 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 43 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 44 | 44 | |
| 45 | 45 | /* 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); | |
| 48 | 48 | |
| 49 | 49 | tilemap_set_transparent_pen(tx_tilemap,0); |
| 50 | 50 | tilemap_set_transparent_pen(fg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 74 | 74 | int code = videoram[tile_index]; |
| 75 | 75 | int color = videoram[tile_index] >> 2; |
| 76 | 76 | |
| 77 | SET_TILE_INFO(0, code, color, 0) | |
| 77 | SET_TILE_INFO(0, code, color, 0); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | VIDEO_START( tankbatt ) |
| 81 | 81 | { |
| 82 | 82 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 83 | TILEMAP_TYPE_ | |
| 83 | TILEMAP_TYPE_ | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static void draw_bullets(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 45 | 45 | int data2 = wrally_videoram[(tile_index << 1) + 1]; |
| 46 | 46 | int code = data & 0x3fff; |
| 47 | 47 | |
| 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)); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static TILE_GET_INFO( get_tile_info_wrally_screen1 ) |
| r814 | r815 | |
| 54 | 54 | int data2 = wrally_videoram[(0x2000/2) + (tile_index << 1) + 1]; |
| 55 | 55 | int code = data & 0x3fff; |
| 56 | 56 | |
| 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)); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /*************************************************************************** |
| r814 | r815 | |
| 79 | 79 | |
| 80 | 80 | VIDEO_START( wrally ) |
| 81 | 81 | { |
| 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); | |
| 84 | 84 | |
| 85 | 85 | tilemap_set_transparent_pen(pant[0],0); |
| 86 | 86 | tilemap_set_transparent_pen(pant[1],0); |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | 0, |
| 30 | 30 | mosaic_fgvideoram[tile_index] + (mosaic_fgvideoram[tile_index+1] << 8), |
| 31 | 31 | 0, |
| 32 | 0) | |
| 32 | 0); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 39 | 39 | 1, |
| 40 | 40 | mosaic_bgvideoram[tile_index] + (mosaic_bgvideoram[tile_index+1] << 8), |
| 41 | 41 | 0, |
| 42 | 0) | |
| 42 | 0); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| r814 | r815 | |
| 52 | 52 | |
| 53 | 53 | VIDEO_START( mosaic ) |
| 54 | 54 | { |
| 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); | |
| 57 | 57 | |
| 58 | 58 | tilemap_set_transparent_pen(fg_tilemap,0xff); |
| 59 | 59 | } |
| r814 | r815 | |
|---|---|---|
| 218 | 218 | fillbitmap(priority_bitmap, 0, cliprect); |
| 219 | 219 | |
| 220 | 220 | /* 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); | |
| 223 | 223 | if (vdp_enable && vdplayer == 0) draw_vdp(bitmap, cliprect, vdppri); |
| 224 | 224 | |
| 225 | 225 | /* draw background again to draw non-transparent pixels over the VDP and set the priority */ |
| r814 | r815 | |
|---|---|---|
| 91 | 91 | int tile = data & 0xfff; |
| 92 | 92 | int color = (data >> 12) & 0x0f; |
| 93 | 93 | |
| 94 | SET_TILE_INFO(1,tile+ bestri_tilebank * 0x1000,color + 0x20,0) | |
| 94 | SET_TILE_INFO(1,tile+ bestri_tilebank * 0x1000,color + 0x20,0); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 100 | 100 | int tile = data & 0xfff; |
| 101 | 101 | int color = (data >> 12) & 0x0f; |
| 102 | 102 | |
| 103 | SET_TILE_INFO(1,tile+ bestri_tilebank * 0x1000,color + 0x10,0) | |
| 103 | SET_TILE_INFO(1,tile+ bestri_tilebank * 0x1000,color + 0x10,0); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /* |
| r814 | r815 | |
| 190 | 190 | |
| 191 | 191 | VIDEO_START( crospang ) |
| 192 | 192 | { |
| 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); | |
| 195 | 195 | |
| 196 | 196 | tilemap_set_transparent_pen(fg_layer,0); |
| 197 | 197 | bestri_tilebank = 0; |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | 1, |
| 30 | 30 | code, |
| 31 | 31 | pal, |
| 32 | 0) | |
| 32 | 0); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TILE_GET_INFO( get_fgtile_info ) |
| r814 | r815 | |
| 50 | 50 | 1, |
| 51 | 51 | code, |
| 52 | 52 | pal, |
| 53 | 0) | |
| 53 | 0); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static TILE_GET_INFO( get_txttile_info ) |
| r814 | r815 | |
| 69 | 69 | 0, |
| 70 | 70 | code, |
| 71 | 71 | pal, |
| 72 | 0) | |
| 72 | 0); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | PALETTE_INIT(darkmist) |
| r814 | r815 | |
| 137 | 137 | |
| 138 | 138 | VIDEO_START(darkmist) |
| 139 | 139 | { |
| 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 ); | |
| 143 | 143 | tilemap_set_transparent_pen(fgtilemap, 0); |
| 144 | 144 | tilemap_set_transparent_pen(txtilemap, 0); |
| 145 | 145 | } |
| r814 | r815 | |
|---|---|---|
| 135 | 135 | int code = videoram[tile_index]; |
| 136 | 136 | int color = colorram[tile_index] & 0x1f; |
| 137 | 137 | |
| 138 | SET_TILE_INFO(gfx_bank, code, color, 0) | |
| 138 | SET_TILE_INFO(gfx_bank, code, color, 0); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | VIDEO_START( exctsccr ) |
| 142 | 142 | { |
| 143 | 143 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 144 | TILEMAP_TYPE_ | |
| 144 | TILEMAP_TYPE_ | |
| 145 | 145 | |
| 146 | 146 | mame_timer_pulse(MAME_TIME_IN_HZ(75), 0, exctsccr_fm_callback); /* updates fm */ |
| 147 | 147 | } |
| r814 | r815 | |
|---|---|---|
| 77 | 77 | zoom_colorbase = 6; /* == 48 since it's 7-bit graphics */ |
| 78 | 78 | K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tile_callback); |
| 79 | 79 | K051960_vh_start(machine,REGION_GFX2,NORMAL_PLANE_ORDER,sprite_callback); |
| 80 | K051316_vh_start_0(machine,REGION_GFX3,7, | |
| 80 | K051316_vh_start_0(machine,REGION_GFX3,7,F | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | int code = videoram[offs] + ((videoram[offs + 1] & 0x0f) << 8) + (gfxbank << 12); |
| 50 | 50 | int color = (videoram[offs + 1] & 0xf0) >> 4; |
| 51 | 51 | |
| 52 | SET_TILE_INFO(0, code, color, 0) | |
| 52 | SET_TILE_INFO(0, code, color, 0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | VIDEO_START( sichuan2 ) |
| 56 | 56 | { |
| 57 | 57 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 58 | TILEMAP_TYPE_ | |
| 58 | TILEMAP_TYPE_ | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | VIDEO_UPDATE( sichuan2 ) |
| r814 | r815 | |
|---|---|---|
| 23 | 23 | ***************************************************************************/ |
| 24 | 24 | |
| 25 | 25 | //not 100% right yet (check attract mode in raphero) |
| 26 | static | |
| 26 | static | |
| 27 | 27 | { |
| 28 | 28 | /* logical (col,row) -> memory offset */ |
| 29 | 29 | |
| r814 | r815 | |
| 32 | 32 | return (row & 0x0f) + ((col & 0x6ff) << 4) + ((row & 0x70) << 8); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | static | |
| 35 | static | |
| 36 | 36 | { |
| 37 | 37 | /* logical (col,row) -> memory offset */ |
| 38 | 38 | return (row & 0x0f) + ((col & 0x3ff) << 4) + ((row & 0x70) << 10); |
| r814 | r815 | |
| 46 | 46 | 1, |
| 47 | 47 | (code & 0xfff) + (bgbank << 12), |
| 48 | 48 | code >> 12, |
| 49 | 0) | |
| 49 | 0); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static TILE_GET_INFO( strahl_get_fg_tile_info ) |
| r814 | r815 | |
| 56 | 56 | 3, |
| 57 | 57 | (code & 0xfff), |
| 58 | 58 | code >> 12, |
| 59 | 0) | |
| 59 | 0); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static TILE_GET_INFO( macross_get_tx_tile_info ) |
| r814 | r815 | |
| 66 | 66 | 0, |
| 67 | 67 | code & 0xfff, |
| 68 | 68 | code >> 12, |
| 69 | 0) | |
| 69 | 0); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static TILE_GET_INFO( bjtwin_get_bg_tile_info ) |
| r814 | r815 | |
| 77 | 77 | bank, |
| 78 | 78 | (code & 0x7ff) + ((bank) ? (bgbank << 11) : 0), |
| 79 | 79 | code >> 12, |
| 80 | 0) | |
| 80 | 0); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| r814 | r815 | |
| 90 | 90 | |
| 91 | 91 | VIDEO_START( bioship ) |
| 92 | 92 | { |
| 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); | |
| 95 | 95 | spriteram_old = auto_malloc(spriteram_size); |
| 96 | 96 | spriteram_old2 = auto_malloc(spriteram_size); |
| 97 | 97 | background_bitmap = auto_bitmap_alloc(8192,512,machine->screen[0].format); |
| r814 | r815 | |
| 109 | 109 | |
| 110 | 110 | VIDEO_START( strahl ) |
| 111 | 111 | { |
| 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); | |
| 115 | 115 | spriteram_old = auto_malloc(spriteram_size); |
| 116 | 116 | spriteram_old2 = auto_malloc(spriteram_size); |
| 117 | 117 | |
| r814 | r815 | |
| 127 | 127 | |
| 128 | 128 | VIDEO_START( macross ) |
| 129 | 129 | { |
| 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); | |
| 132 | 132 | spriteram_old = auto_malloc(spriteram_size); |
| 133 | 133 | spriteram_old2 = auto_malloc(spriteram_size); |
| 134 | 134 | |
| r814 | r815 | |
| 143 | 143 | |
| 144 | 144 | VIDEO_START( gunnail ) |
| 145 | 145 | { |
| 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); | |
| 148 | 148 | spriteram_old = auto_malloc(spriteram_size); |
| 149 | 149 | spriteram_old2 = auto_malloc(spriteram_size); |
| 150 | 150 | |
| r814 | r815 | |
| 161 | 161 | |
| 162 | 162 | VIDEO_START( macross2 ) |
| 163 | 163 | { |
| 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); | |
| 166 | 166 | spriteram_old = auto_malloc(spriteram_size); |
| 167 | 167 | spriteram_old2 = auto_malloc(spriteram_size); |
| 168 | 168 | |
| r814 | r815 | |
| 178 | 178 | |
| 179 | 179 | VIDEO_START( tdragon2 ) |
| 180 | 180 | { |
| 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); | |
| 183 | 183 | spriteram_old = auto_malloc(spriteram_size); |
| 184 | 184 | spriteram_old2 = auto_malloc(spriteram_size); |
| 185 | 185 | |
| r814 | r815 | |
| 195 | 195 | |
| 196 | 196 | VIDEO_START( bjtwin ) |
| 197 | 197 | { |
| 198 | bg_tilemap = tilemap_create(bjtwin_get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 198 | bg_tilemap = tilemap_create(bjtwin_get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_ | |
| 199 | 199 | spriteram_old = auto_malloc(spriteram_size); |
| 200 | 200 | spriteram_old2 = auto_malloc(spriteram_size); |
| 201 | 201 |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | { |
| 30 | 30 | int code = videoram[tile_index] & 0x3f; |
| 31 | 31 | |
| 32 | SET_TILE_INFO(0, code, 0, 0) | |
| 32 | SET_TILE_INFO(0, code, 0, 0); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
| r814 | r815 | |
| 37 | 37 | VIDEO_START( nitedrvr ) |
| 38 | 38 | { |
| 39 | 39 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 40 | TILEMAP_TYPE_ | |
| 40 | TILEMAP_TYPE_ | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | static void draw_box(running_machine *machine, mame_bitmap *bitmap, int bx, int by, int ex, int ey ) |
| r814 | r815 | |
|---|---|---|
| 97 | 97 | int code = videoram[tile_index] + ((attr & 0x30) << 4); |
| 98 | 98 | int color = attr & 0x0f; |
| 99 | 99 | |
| 100 | SET_TILE_INFO(bank, code, color, 0) | |
| 100 | SET_TILE_INFO(bank, code, color, 0); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | VIDEO_START(rcasino) |
| 104 | 104 | { |
| 105 | 105 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 106 | TILEMAP_TYPE_ | |
| 106 | TILEMAP_TYPE_ | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | VIDEO_UPDATE(rcasino) |
| r814 | r815 | |
|---|---|---|
| 21 | 21 | { |
| 22 | 22 | UINT8 code = mgolf_video_ram[tile_index]; |
| 23 | 23 | |
| 24 | SET_TILE_INFO(0, code, code >> 7, 0) | |
| 24 | SET_TILE_INFO(0, code, code >> 7, 0); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| r814 | r815 | |
| 34 | 34 | |
| 35 | 35 | static VIDEO_START( mgolf ) |
| 36 | 36 | { |
| 37 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 37 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 |
| r814 | r815 | |
|---|---|---|
| 127 | 127 | rg, |
| 128 | 128 | (code & 0x1ff), |
| 129 | 129 | 0x2c+(attr&0x1f), //test |
| 130 | 0) | |
| 130 | 0); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | WRITE8_HANDLER(cshooter_txram_w) |
| r814 | r815 | |
| 138 | 138 | |
| 139 | 139 | VIDEO_START(cshooter) |
| 140 | 140 | { |
| 141 | cshooter_txtilemap = tilemap_create(get_cstx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 141 | cshooter_txtilemap = tilemap_create(get_cstx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 142 | 142 | tilemap_set_transparent_pen(cshooter_txtilemap, 3); |
| 143 | 143 | } |
| 144 | 144 |
| r814 | r815 | |
|---|---|---|
| 530 | 530 | tile |= (attr_ram1[tile_index + 0x0240] & 0x80) << 1; |
| 531 | 531 | tile |= (attr_ram2[tile_index + 0x0240] & 0x80) << 2; |
| 532 | 532 | |
| 533 | SET_TILE_INFO(0,tile,color,0) | |
| 533 | SET_TILE_INFO(0,tile,color,0); | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | VIDEO_START( coinmstr ) |
| 537 | 537 | { |
| 538 | bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 538 | bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | VIDEO_UPDATE( coinmstr ) |
| r814 | r815 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static VIDEO_START(hitme) |
| 57 | 57 | { |
| 58 | hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 58 | hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | static VIDEO_START(barricad) |
| 63 | 63 | { |
| 64 | hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 64 | hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 |
| r814 | r815 | |
|---|---|---|
| 68 | 68 | { |
| 69 | 69 | int code = videoram2[tile_index]; |
| 70 | 70 | |
| 71 | SET_TILE_INFO(2, code + bg_bank, 0/*colo*/, 0) | |
| 71 | SET_TILE_INFO(2, code + bg_bank, 0/*colo*/, 0); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 76 | 76 | int code = videoram[tile_index]; |
| 77 | 77 | int attr = videoram[tile_index + 0x400]; |
| 78 | 78 | |
| 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); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | VIDEO_START( zerotrgt ) |
| 83 | 83 | { |
| 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); | |
| 86 | 86 | |
| 87 | 87 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 88 | 88 |
| r814 | r815 | |
|---|---|---|
| 323 | 323 | |
| 324 | 324 | if (chip == 0) |
| 325 | 325 | { |
| 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); | |
| 328 | 328 | } |
| 329 | 329 | else |
| 330 | 330 | { |
| 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); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | tilemap_set_transparent_pen(K037122_layer[chip][0], 0); |
| r814 | r815 | |
|---|---|---|
| 276 | 276 | tileno = bg_videoram[tile_index] & 0x1fff; |
| 277 | 277 | colour = (bg_videoram[tile_index] & 0xe000) >> 13; |
| 278 | 278 | |
| 279 | SET_TILE_INFO(4,tileno,colour,0) | |
| 279 | SET_TILE_INFO(4,tileno,colour,0); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | static TILE_GET_INFO( get_mlow_tile_info ) |
| r814 | r815 | |
| 286 | 286 | tileno = mlow_videoram[tile_index] & 0x1fff; |
| 287 | 287 | colour = (mlow_videoram[tile_index] & 0xe000) >> 13; |
| 288 | 288 | |
| 289 | SET_TILE_INFO(3,tileno,colour,0) | |
| 289 | SET_TILE_INFO(3,tileno,colour,0); | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | static TILE_GET_INFO( get_mhigh_tile_info ) |
| r814 | r815 | |
| 296 | 296 | tileno = mhigh_videoram[tile_index] & 0x1fff; |
| 297 | 297 | colour = (mhigh_videoram[tile_index] & 0xe000) >> 13; |
| 298 | 298 | |
| 299 | SET_TILE_INFO(2,tileno,colour,0) | |
| 299 | SET_TILE_INFO(2,tileno,colour,0); | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 306 | 306 | tileno = tx_videoram[tile_index] & 0x1fff; |
| 307 | 307 | colour = (tx_videoram[tile_index] & 0xe000) >> 13; |
| 308 | 308 | |
| 309 | SET_TILE_INFO(1,tileno,colour,0) | |
| 309 | SET_TILE_INFO(1,tileno,colour,0); | |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | VIDEO_START( mwarr ) |
| 313 | 313 | { |
| 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); | |
| 318 | 318 | |
| 319 | 319 | sprites_buffer = auto_malloc(sizeof(UINT16) * 0x800); |
| 320 | 320 |
| r814 | r815 | |
|---|---|---|
| 81 | 81 | int code = videoram[tile_index] + ((attr & 0xc0) << 2); |
| 82 | 82 | int color = attr & 0x1f; |
| 83 | 83 | |
| 84 | SET_TILE_INFO(0, code, color, 0) | |
| 84 | SET_TILE_INFO(0, code, color, 0); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | VIDEO_START(vroulet) |
| 88 | 88 | { |
| 89 | 89 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 90 | TILEMAP_TYPE_ | |
| 90 | TILEMAP_TYPE_ | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | VIDEO_UPDATE(vroulet) |
| r814 | r815 | |
|---|---|---|
| 456 | 456 | { |
| 457 | 457 | mame_timer_pulse(MAME_TIME_IN_MSEC(2), 15, interrupt_callback); |
| 458 | 458 | mame_timer_pulse(MAME_TIME_IN_MSEC(8), 11, interrupt_callback); |
| 459 | mame_timer_pulse(MAME_TIME_IN_CYCLES( | |
| 459 | mame_timer_pulse(MAME_TIME_IN_CYCLES( | |
| 460 | 460 | |
| 461 | 461 | memory_set_bankptr(1,memory_region(REGION_USER1)); |
| 462 | 462 | } |
| r814 | r815 | |
|---|---|---|
| 229 | 229 | 1, |
| 230 | 230 | code,//tiles beyond 0x7ff only for sprites? |
| 231 | 231 | color & 0x0f, |
| 232 | 0) | |
| 232 | 0); | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | static TILE_GET_INFO( get_gfx0a_tile_info ) |
| r814 | r815 | |
| 248 | 248 | 1, |
| 249 | 249 | code,//tiles beyond 0x7ff only for sprites? |
| 250 | 250 | color & 0x0f, |
| 251 | 0) | |
| 251 | 0); | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | static TILE_GET_INFO( get_gfx1_tile_info ) |
| r814 | r815 | |
| 260 | 260 | 0, |
| 261 | 261 | code | ((color & 0xf0) << 4), |
| 262 | 262 | (color>>0) & 0x0f, |
| 263 | 0) | |
| 263 | 0); | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | static WRITE8_HANDLER( gfx0_vram_w ) |
| r814 | r815 | |
| 681 | 681 | |
| 682 | 682 | VIDEO_START(witch) |
| 683 | 683 | { |
| 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); | |
| 687 | 687 | |
| 688 | 688 | tilemap_set_transparent_pen(gfx0a_tilemap,0); |
| 689 | 689 | tilemap_set_transparent_pen(gfx0b_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | GT Classic was the last chipset for this platform and was sold mainly as an upgrade for GT99/GT2K |
| 62 | 62 | |
| 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 | ||
| 69 | 63 | Later versions of games (Golden Tee Golf, Shuffle Shot & World Class |
| 70 | 64 | Bowling) converged to a single platform, the large single PCB |
| 71 | 65 | (P/N 1082 Rev 2). With the correct jumpers setting (surface mounted) |
| 72 | 66 | and chipset this board can run any of the 3 listed programs. |
| 73 | 67 | |
| 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 | ||
| 74 | 82 | **************************************************************************** |
| 75 | 83 | |
| 76 | 84 | Memory map TBD |
| r814 | r815 | |
| 1957 | 1965 | ROM_LOAD32_BYTE( "wcbdprm3.200", 0x00003, 0x20000, CRC(43ecad0b) SHA1(890a843c162c052a790e432db10f968875be835c) ) |
| 1958 | 1966 | |
| 1959 | 1967 | 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 */ | |
| 1961 | 1969 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 1962 | 1970 | |
| 1963 | 1971 | ROM_REGION( 0x880000, REGION_GFX1, 0 ) |
| r814 | r815 | |
| 1976 | 1984 | ROM_FILL( 0x500000, 0x380000, 0xff ) |
| 1977 | 1985 | |
| 1978 | 1986 | 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 */ | |
| 1981 | 1989 | |
| 1982 | 1990 | 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 */ | |
| 1985 | 1993 | ROM_END |
| 1986 | 1994 | |
| 1987 | 1995 | |
| r814 | r815 | |
| 1993 | 2001 | ROM_LOAD32_BYTE( "wcb_prm3.166", 0x00003, 0x20000, CRC(dd72c796) SHA1(4c1542c51848a88a663e56ae0b47bf9d2d9f7d54) ) |
| 1994 | 2002 | |
| 1995 | 2003 | 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 */ | |
| 1997 | 2005 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 1998 | 2006 | |
| 1999 | 2007 | ROM_REGION( 0x880000, REGION_GFX1, 0 ) |
| r814 | r815 | |
| 2008 | 2016 | ROM_FILL( 0x400000, 0x480000, 0xff ) |
| 2009 | 2017 | |
| 2010 | 2018 | 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 */ | |
| 2013 | 2021 | |
| 2014 | 2022 | 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 */ | |
| 2017 | 2025 | ROM_END |
| 2018 | 2026 | |
| 2019 | 2027 | |
| r814 | r815 | |
| 2025 | 2033 | ROM_LOAD32_BYTE( "wcb_prm3.165", 0x00003, 0x20000, CRC(4c6b4e4f) SHA1(77f5f4b632dd1919ae210bbdc75042bdbebf6660) ) |
| 2026 | 2034 | |
| 2027 | 2035 | 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 */ | |
| 2029 | 2037 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2030 | 2038 | |
| 2031 | 2039 | ROM_REGION( 0x880000, REGION_GFX1, 0 ) |
| r814 | r815 | |
| 2040 | 2048 | ROM_FILL( 0x400000, 0x480000, 0xff ) |
| 2041 | 2049 | |
| 2042 | 2050 | 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 */ | |
| 2045 | 2053 | |
| 2046 | 2054 | 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 */ | |
| 2049 | 2057 | ROM_END |
| 2050 | 2058 | |
| 2051 | 2059 | |
| r814 | r815 | |
| 2057 | 2065 | ROM_LOAD32_BYTE( "wcb_prm3.161", 0x00003, 0x20000, CRC(e5081f85) SHA1(a5513b8dd917a35f1c8b7f833c2d5622353d39f0) ) |
| 2058 | 2066 | |
| 2059 | 2067 | 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 */ | |
| 2061 | 2069 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2062 | 2070 | |
| 2063 | 2071 | ROM_REGION( 0x880000, REGION_GFX1, 0 ) |
| r814 | r815 | |
| 2072 | 2080 | ROM_FILL( 0x400000, 0x480000, 0xff ) |
| 2073 | 2081 | |
| 2074 | 2082 | 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 */ | |
| 2077 | 2085 | |
| 2078 | 2086 | 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 */ | |
| 2081 | 2089 | ROM_END |
| 2082 | 2090 | |
| 2083 | 2091 | |
| r814 | r815 | |
| 2089 | 2097 | ROM_LOAD32_BYTE( "wcbtprm3.140", 0x00003, 0x20000, CRC(c41258a4) SHA1(182e8a25bdb126a4de8a44a1c26fd8b66f06d66e) ) |
| 2090 | 2098 | |
| 2091 | 2099 | 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 */ | |
| 2093 | 2101 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2094 | 2102 | |
| 2095 | 2103 | ROM_REGION( 0x880000, REGION_GFX1, 0 ) |
| r814 | r815 | |
| 2108 | 2116 | ROM_FILL( 0x500000, 0x380000, 0xff ) |
| 2109 | 2117 | |
| 2110 | 2118 | 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 */ | |
| 2113 | 2121 | |
| 2114 | 2122 | 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 */ | |
| 2117 | 2125 | ROM_END |
| 2118 | 2126 | |
| 2119 | 2127 | |
| r814 | r815 | |
| 3853 | 3861 | |
| 3854 | 3862 | GT Royal Edition Tournament is a Euro GT99 |
| 3855 | 3863 | 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 | |
| 3857 | 3865 | 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. | |
| 3859 | 3867 | GT Diamond Edition Tournament is a Euro GT Classic (Not currently dumped) |
| 3860 | 3868 | This would be the only known tournament version of Classic |
| 3861 | 3869 |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | int tile = videoram[tile_index]; |
| 51 | 51 | |
| 52 | SET_TILE_INFO(0,tile,superdq_color_bank,0) | |
| 52 | SET_TILE_INFO(0,tile,superdq_color_bank,0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | VIDEO_START( superdq ) |
| 56 | 56 | { |
| 57 | superdq_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 57 | superdq_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 58 | 58 | |
| 59 | 59 | add_exit_callback(machine, video_cleanup); |
| 60 | 60 | } |
| r814 | r815 | |
|---|---|---|
| 33 | 33 | 0, |
| 34 | 34 | (code & 0x0fff)|0x8000, |
| 35 | 35 | (code & 0xf000) >> 12, |
| 36 | 0) | |
| 36 | 0); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | static TILE_GET_INFO( get_bg_tile_info ) |
| r814 | r815 | |
| 44 | 44 | 1, |
| 45 | 45 | (code & 0x0fff), |
| 46 | 46 | (code & 0xf000) >> 12, |
| 47 | 0) | |
| 47 | 0); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 55 | 55 | 1, |
| 56 | 56 | (code & 0x0fff)|0x1000, |
| 57 | 57 | ((code & 0xf000) >> 12)|0x10, |
| 58 | 0) | |
| 58 | 0); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | static | |
| 61 | static | |
| 62 | 62 | { |
| 63 | 63 | int offset; |
| 64 | 64 | |
| r814 | r815 | |
| 71 | 71 | |
| 72 | 72 | VIDEO_START(bestleag) |
| 73 | 73 | { |
| 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); | |
| 77 | 77 | |
| 78 | 78 | tilemap_set_transparent_pen(tx_tilemap,15); |
| 79 | 79 | tilemap_set_transparent_pen(fg_tilemap,15); |
| r814 | r815 | |
|---|---|---|
| 27 | 27 | static TILE_GET_INFO( get_tile_info ) |
| 28 | 28 | { |
| 29 | 29 | 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 ));; | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | VIDEO_START( cowrace ) |
| 34 | 34 | { |
| 35 | 35 | tmap = tilemap_create( get_tile_info, tilemap_scan_rows, |
| 36 | TILEMAP_TYPE_ | |
| 36 | TILEMAP_TYPE_ | |
| 37 | 37 | |
| 38 | 38 | tilemap_set_transparent_pen(tmap, 0); |
| 39 | 39 | } |
| r814 | r815 | |
|---|---|---|
| 54 | 54 | int color = videoram[tile_index+0x400]&0x1f; |
| 55 | 55 | int flip =(videoram[tile_index+0x400]&0x80)?(TILEMAP_FLIPX|TILEMAP_FLIPY):0; |
| 56 | 56 | |
| 57 | SET_TILE_INFO( 0, code, color, flip) | |
| 57 | SET_TILE_INFO( 0, code, color, flip); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | static WRITE8_HANDLER(vram_w) |
| r814 | r815 | |
| 211 | 211 | |
| 212 | 212 | VIDEO_START(koikoi) |
| 213 | 213 | { |
| 214 | koikoi_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 214 | koikoi_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | VIDEO_UPDATE(koikoi) |
| r814 | r815 | |
|---|---|---|
| 187 | 187 | 0, |
| 188 | 188 | code & 0x1fff, |
| 189 | 189 | (code & 0xe000) >> 13, |
| 190 | 0) | |
| 190 | 0); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | VIDEO_START( cybertnk ) |
| 194 | 194 | { |
| 195 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 195 | tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | VIDEO_UPDATE( cybertnk ) |
| r814 | r815 | |
|---|---|---|
| 2691 | 2691 | tileno = dealem_videoram[tile_index]; |
| 2692 | 2692 | colour = dealem_videoram[tile_index]; |
| 2693 | 2693 | |
| 2694 | SET_TILE_INFO(0,tileno,colour,0) | |
| 2694 | SET_TILE_INFO(0,tileno,colour,0); | |
| 2695 | 2695 | } |
| 2696 | 2696 | |
| 2697 | 2697 | VIDEO_START(dealem) |
| 2698 | 2698 | { |
| 2699 | dealem_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 2699 | dealem_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 2700 | 2700 | } |
| 2701 | 2701 | |
| 2702 | 2702 | WRITE8_HANDLER( dealem_videoram_w ) |
| r814 | r815 | |
|---|---|---|
| 58 | 58 | #define PAGES_PER_TMAP_X (0x2) |
| 59 | 59 | #define PAGES_PER_TMAP_Y (0x2) |
| 60 | 60 | |
| 61 | ||
| 61 | static TILEMAP_MAPPER( skylncr_tilemap_scan_pages | |
| 62 | 62 | { |
| 63 | 63 | return (col / TILES_PER_PAGE_X) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y + |
| 64 | 64 | (col % TILES_PER_PAGE_X) + |
| r814 | r815 | |
| 71 | 71 | { |
| 72 | 72 | |
| 73 | 73 | tmap = tilemap_create( get_tile_info, tilemap_scan_rows, |
| 74 | TILEMAP_TYPE_ | |
| 74 | TILEMAP_TYPE_ | |
| 75 | 75 | |
| 76 | 76 | tmap2 = tilemap_create( get_tile_info2, skylncr_tilemap_scan_pages, |
| 77 | TILEMAP_TYPE_ | |
| 77 | TILEMAP_TYPE_ | |
| 78 | 78 | TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y ); |
| 79 | 79 | |
| 80 | 80 | tilemap_set_transparent_pen(tmap, 0); |
| r814 | r815 | |
|---|---|---|
| 170 | 170 | { |
| 171 | 171 | int tile = bg_videoram[tile_index] & 0x7ffff; |
| 172 | 172 | int color = (bg_videoram[tile_index]>>28) & 0xf; |
| 173 | SET_TILE_INFO(0,tile,color,0) | |
| 173 | SET_TILE_INFO(0,tile,color,0); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | static TILE_GET_INFO( get_md_tile_info ) |
| 177 | 177 | { |
| 178 | 178 | int tile = md_videoram[tile_index] & 0x7ffff; |
| 179 | 179 | int color = (md_videoram[tile_index]>>28) & 0xf; |
| 180 | SET_TILE_INFO(0,tile,color,0) | |
| 180 | SET_TILE_INFO(0,tile,color,0); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static TILE_GET_INFO( get_fg_tile_info ) |
| 184 | 184 | { |
| 185 | 185 | int tile = fg_videoram[tile_index] & 0x7ffff; |
| 186 | 186 | int color = (fg_videoram[tile_index]>>28) & 0xf; |
| 187 | SET_TILE_INFO(0,tile,color,0) | |
| 187 | SET_TILE_INFO(0,tile,color,0); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | // sprites aren't tile based (except for 8x8 ones) |
| r814 | r815 | |
| 273 | 273 | |
| 274 | 274 | VIDEO_START( limenko ) |
| 275 | 275 | { |
| 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); | |
| 279 | 279 | |
| 280 | 280 | tilemap_set_transparent_pen(md_tilemap,0); |
| 281 | 281 | tilemap_set_transparent_pen(fg_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 71 | 71 | 0, |
| 72 | 72 | code, |
| 73 | 73 | 0, |
| 74 | 0) | |
| 74 | 0); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | static TILE_GET_INFO( get_tile_info2 ) |
| r814 | r815 | |
| 84 | 84 | code, |
| 85 | 85 | color, |
| 86 | 86 | 0 |
| 87 | ) | |
| 87 | ); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | VIDEO_START ( pipeline ) |
| 91 | 91 | { |
| 92 | 92 | 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 ); | |
| 95 | 95 | tilemap_set_transparent_pen(tilemap2,0); |
| 96 | 96 | } |
| 97 | 97 |
| r814 | r815 | |
|---|---|---|
| 95 | 95 | int color = src[bg_base + tile_index + 0x100] & 0x0f; |
| 96 | 96 | int flag = src[bg_base + tile_index + 0x100] & 0x40 ? TILE_FLIPX : 0; |
| 97 | 97 | |
| 98 | SET_TILE_INFO(1, code, color, flag) | |
| 98 | SET_TILE_INFO(1, code, color, flag); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 103 | 103 | int code = ((calorie_fg[tile_index + 0x400] & 0x30) << 4) | calorie_fg[tile_index]; |
| 104 | 104 | int color = calorie_fg[tile_index + 0x400] & 0x0f; |
| 105 | 105 | |
| 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)); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | VIDEO_START( calorie ) |
| 111 | 111 | { |
| 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); | |
| 114 | 114 | |
| 115 | 115 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 116 | 116 | } |
| r814 | r815 | |
| 126 | 126 | } |
| 127 | 127 | else |
| 128 | 128 | { |
| 129 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_ | |
| 129 | tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_D | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 |
| r814 | r815 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | int code = drtomy_videoram_fg[tile_index] & 0xfff; |
| 20 | 20 | 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); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
| r814 | r815 | |
| 26 | 26 | { |
| 27 | 27 | int code = drtomy_videoram_bg[tile_index] & 0xfff; |
| 28 | 28 | 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); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| r814 | r815 | |
| 91 | 91 | |
| 92 | 92 | VIDEO_START( drtomy ) |
| 93 | 93 | { |
| 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); | |
| 96 | 96 | |
| 97 | 97 | tilemap_set_transparent_pen(tilemap_fg,0); |
| 98 | 98 | } |
| r814 | r815 | |
|---|---|---|
| 199 | 199 | // if (attr == 0x32) /* Is the palette wrong? */ |
| 200 | 200 | // color = 0x3a; /* 0x3a is the best match */ |
| 201 | 201 | |
| 202 | SET_TILE_INFO(bank, code, color, 0) | |
| 202 | SET_TILE_INFO(bank, code, color, 0); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | VIDEO_START( gdrawpkr ) |
| 206 | 206 | { |
| 207 | 207 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 208 | TILEMAP_TYPE_ | |
| 208 | TILEMAP_TYPE_ | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | VIDEO_UPDATE( gdrawpkr ) |
| r814 | r815 | |
|---|---|---|
| 47 | 47 | mooncrsb bootleg of mooncrs2. ROM/RAM check erased. |
| 48 | 48 | |
| 49 | 49 | |
| 50 | Stephh's additional notes (based on the games Z80 code and some tests) for "Moon Cresta" and its numerous clones : | |
| 51 | ||
| 52 | a) '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 | ||
| 73 | b) '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 | ||
| 81 | c) '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 | ||
| 95 | d) '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 | ||
| 105 | e) '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 | ||
| 114 | f) '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 | ||
| 128 | g) '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 | ||
| 144 | h) '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 | ||
| 161 | i) '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 | ||
| 171 | j) '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 | ||
| 182 | k) '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 | ||
| 189 | l) '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 | ||
| 198 | m) '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 | ||
| 239 | n) '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 | ||
| 266 | o) '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 | ||
| 275 | p) '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 | ||
| 50 | 297 | Notes about 'azurian' : |
| 51 | 298 | ----------------------- |
| 52 | 299 | |
| 53 | 300 | bit 6 of IN1 is linked with bit 2 of IN2 (check code at 0x05b3) to set difficulty : |
| 54 | 301 | |
| 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 | |
| 57 | 304 | |
| 58 | 305 | OFF OFF 2 aliens move 2 frames out of 3 easy |
| 59 | 306 | ON OFF 4 aliens move 4 frames out of 5 hard |
| r814 | r815 | |
| 67 | 314 | - alien 3 moves when 0x4064 != 0 else contents of 0x40f4 is stored at 0x4064 |
| 68 | 315 | |
| 69 | 316 | |
| 70 | Notes 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 | ||
| 77 | 317 | Notes about 'scorpnmc' : |
| 78 | 318 | ----------------------- |
| 79 | 319 | |
| r814 | r815 | |
| 2033 | 2273 | PORT_START_TAG("IN1") |
| 2034 | 2274 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 2035 | 2275 | 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) | |
| 2039 | 2279 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2040 | 2280 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) ) |
| 2041 | 2281 | PORT_DIPSETTING( 0x00, "30000" ) |
| r814 | r815 | |
| 2058 | 2298 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2059 | 2299 | INPUT_PORTS_END |
| 2060 | 2300 | |
| 2301 | INPUT_PORTS_START( mooncrsa ) | |
| 2302 | MOON_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 ) | |
| 2329 | INPUT_PORTS_END | |
| 2330 | ||
| 2061 | 2331 | INPUT_PORTS_START( mooncrsg ) |
| 2062 | 2332 | PORT_START_TAG("IN0") |
| 2063 | 2333 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| r814 | r815 | |
| 2074 | 2344 | PORT_START_TAG("IN1") |
| 2075 | 2345 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 2076 | 2346 | 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) | |
| 2080 | 2350 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2081 | 2351 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) ) |
| 2082 | 2352 | PORT_DIPSETTING( 0x00, "30000" ) |
| 2083 | 2353 | PORT_DIPSETTING( 0x40, "50000" ) |
| 2084 | // PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) Always | |
| 2354 | // PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) Always | |
| 2085 | 2355 | // PORT_DIPSETTING( 0x80, DEF_STR( English ) ) |
| 2086 | 2356 | // PORT_DIPSETTING( 0x00, DEF_STR( English ) ) |
| 2087 | 2357 | |
| r814 | r815 | |
| 2099 | 2369 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2100 | 2370 | INPUT_PORTS_END |
| 2101 | 2371 | |
| 2102 | INPUT_PORTS_START( | |
| 2372 | INPUT_PORTS_START( fa | |
| 2103 | 2373 | MOON_IN0 |
| 2104 | 2374 | PORT_START_TAG("IN1") |
| 2105 | 2375 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 2106 | 2376 | 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 | |
| 2110 | 2380 | 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 | |
| 2115 | 2385 | // PORT_DIPSETTING( 0x80, DEF_STR( English ) ) |
| 2116 | 2386 | // PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) ) |
| 2117 | 2387 | |
| 2118 | 2388 | PORT_START_TAG("DSW") |
| 2119 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_ | |
| 2389 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) ) | |
| 2120 | 2390 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 2121 | 2391 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) |
| 2122 | 2392 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 2123 | 2393 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 2124 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_ | |
| 2394 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_A ) ) | |
| 2125 | 2395 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 2126 | 2396 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 2127 | 2397 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) |
| r814 | r815 | |
| 2129 | 2399 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2130 | 2400 | INPUT_PORTS_END |
| 2131 | 2401 | |
| 2132 | INPUT_PORTS_START( | |
| 2402 | INPUT_PORTS_START( e | |
| 2133 | 2403 | MOON_IN0 |
| 2134 | 2404 | PORT_START_TAG("IN1") |
| 2135 | 2405 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 2136 | 2406 | 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) | |
| 2140 | 2410 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2141 | 2411 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) ) |
| 2142 | 2412 | PORT_DIPSETTING( 0x00, "30000" ) |
| r814 | r815 | |
| 2146 | 2416 | PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) ) |
| 2147 | 2417 | |
| 2148 | 2418 | 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 | |
| 2150 | 2420 | // PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 2151 | 2421 | // PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) |
| 2152 | 2422 | // PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r814 | r815 | |
| 2159 | 2429 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2160 | 2430 | INPUT_PORTS_END |
| 2161 | 2431 | |
| 2162 | INPUT_PORTS_START( | |
| 2432 | INPUT_PORTS_START( eagle2 | |
| 2163 | 2433 | MOON_IN0 |
| 2164 | 2434 | PORT_START_TAG("IN1") |
| 2165 | 2435 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 2166 | 2436 | 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) | |
| 2170 | 2440 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2171 | 2441 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) ) |
| 2172 | 2442 | PORT_DIPSETTING( 0x00, "30000" ) |
| 2173 | 2443 | 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 ) ) | |
| 2177 | 2447 | |
| 2178 | 2448 | PORT_START_TAG("DSW") |
| 2179 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin | |
| 2449 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 2180 | 2450 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 2181 | 2451 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) |
| 2182 | 2452 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 2183 | 2453 | 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 ) ) | |
| 2189 | 2464 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2190 | 2465 | INPUT_PORTS_END |
| 2191 | 2466 | |
| 2192 | INPUT_PORTS_START( | |
| 2467 | INPUT_PORTS_START( smooncrs ) | |
| 2193 | 2468 | MOON_IN0 |
| 2194 | 2469 | PORT_START_TAG("IN1") |
| 2195 | 2470 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 2196 | 2471 | 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 */ | |
| 2200 | 2475 | 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" ) | |
| 2207 | 2488 | |
| 2208 | 2489 | 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 ) ) | |
| 2215 | 2494 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 2495 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) ) | |
| 2496 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 2216 | 2497 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 2217 | 2498 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) |
| 2218 | 2499 | PORT_DIPSETTING( 0x0c, DEF_STR( Free_Play ) ) |
| 2219 | 2500 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2220 | 2501 | INPUT_PORTS_END |
| 2221 | 2502 | |
| 2222 | INPUT_PORTS_START( | |
| 2503 | INPUT_PORTS_START( spcdrag | |
| 2223 | 2504 | MOON_IN0 |
| 2224 | 2505 | PORT_START_TAG("IN1") |
| 2225 | 2506 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 2226 | 2507 | 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 */ | |
| 2230 | 2511 | 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" ) | |
| 2237 | 2524 | |
| 2238 | 2525 | PORT_START_TAG("DSW") |
| 2239 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin | |
| 2526 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A | |
| 2240 | 2527 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 2241 | 2528 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) |
| 2242 | 2529 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 2243 | 2530 | 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 ) ) | |
| 2254 | 2536 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2255 | 2537 | INPUT_PORTS_END |
| 2256 | 2538 | |
| r814 | r815 | |
| 2258 | 2540 | PORT_START_TAG("IN0") |
| 2259 | 2541 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2260 | 2542 | 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) | |
| 2264 | 2546 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2265 | 2547 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2266 | 2548 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| r814 | r815 | |
| 2268 | 2550 | PORT_START_TAG("IN1") |
| 2269 | 2551 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 2270 | 2552 | 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) | |
| 2274 | 2556 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2275 | 2557 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) ) |
| 2276 | 2558 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) |
| r814 | r815 | |
| 2286 | 2568 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) |
| 2287 | 2569 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2288 | 2570 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 2289 | // PORT_DIPNAME( 0x04, 0x04, DEF_STR( Language ) ) Always | |
| 2571 | // PORT_DIPNAME( 0x04, 0x04, DEF_STR( Language ) ) Always | |
| 2290 | 2572 | // PORT_DIPSETTING( 0x04, DEF_STR( English ) ) |
| 2291 | 2573 | // PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) ) |
| 2292 | 2574 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) |
| r814 | r815 | |
| 5472 | 5754 | |
| 5473 | 5755 | ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 5474 | 5756 | 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 ) | |
| 5476 | 5761 | 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 ) | |
| 5478 | 5766 | |
| 5479 | 5767 | ROM_REGION( 0x0020, REGION_PROMS, 0 ) |
| 5480 | 5768 | // not present in this set |
| r814 | r815 | |
| 6377 | 6665 | GAME( 1980, mooncrsu, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90, "Nichibutsu USA", "Moon Cresta (Nichibutsu, unencrypted)", GAME_SUPPORTS_SAVE ) |
| 6378 | 6666 | GAME( 1980, mooncrsa, mooncrst, mooncrst, mooncrsa, mooncrst, ROT90, "Nichibutsu", "Moon Cresta (Nichibutsu, old rev)", GAME_SUPPORTS_SAVE ) |
| 6379 | 6667 | GAME( 1980, mooncrsg, mooncrst, mooncrst, mooncrsg, mooncrsu, ROT90, "Gremlin", "Moon Cresta (Gremlin)", GAME_SUPPORTS_SAVE ) |
| 6380 | GAME( 1980?,smooncrs, mooncrst, mooncrst, smooncrs, mooncrsu, ROT90, "Gremlin", "Super Moon Cresta", GAME_SUPPORTS_SAVE ) | |
| 6381 | 6668 | GAME( 1980, mooncrsb, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90, "bootleg", "Moon Cresta (bootleg set 1)", GAME_SUPPORTS_SAVE ) |
| 6382 | 6669 | GAME( 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. | |
| 6384 | GAME( 1980, spcdrag, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90, "bootleg", "Space Dragon (Moon Cresta bootleg, set 1)", GAME_SUPPORTS_SAVE ) | |
| 6385 | GAME( 1980, spcdraga, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90, "bootleg", "Space Dragon (Moon Cresta bootleg, set 2)", GAME_SUPPORTS_SAVE ) | |
| 6386 | GAME( 1980, mooncrs3, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90, "bootleg", "Moon Cresta (bootleg set 3)", GAME_SUPPORTS_SAVE ) /* Jeutel bootleg, similar to bootleg set 2 */ | |
| 6387 | GAME( 1980, fantazia, mooncrst, mooncrst, fantazia, mooncrsu, ROT90, "bootleg", "Fantazia", GAME_SUPPORTS_SAVE ) | |
| 6670 | GAME( 1980, mooncrs3, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90, "bootleg", "Moon Cresta (bootleg set 3)", GAME_SUPPORTS_SAVE ) /* Jeutel bootleg, similar to bootleg set 2 */ | |
| 6671 | GAME( 1980, fantazia, mooncrst, mooncrst, fantazia, mooncrsu, ROT90, "Subelectro", "Fantazia (bootleg?)", GAME_SUPPORTS_SAVE ) | |
| 6388 | 6672 | GAME( 1980, eagle, mooncrst, mooncrst, eagle, mooncrsu, ROT90, "Centuri", "Eagle (set 1)", GAME_SUPPORTS_SAVE ) |
| 6389 | 6673 | GAME( 1980, eagle2, mooncrst, mooncrst, eagle2, mooncrsu, ROT90, "Centuri", "Eagle (set 2)", GAME_SUPPORTS_SAVE ) |
| 6390 | 6674 | GAME( 1980, eagle3, mooncrst, mooncrst, eagle, mooncrsu, ROT90, "Centuri", "Eagle (set 3)", GAME_SUPPORTS_SAVE ) |
| 6391 | 6675 | GAME( 1981?,spctbird, mooncrst, mooncrst, eagle2, mooncrsu, ROT90, "Fortrek", "Space Thunderbird", GAME_SUPPORTS_SAVE ) |
| 6676 | GAME( 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. | |
| 6678 | GAME( 1980, spcdrag, mooncrst, mooncrst, spcdrag, mooncrsu, ROT90, "bootleg", "Space Dragon (Moon Cresta bootleg, set 1)", GAME_SUPPORTS_SAVE ) | |
| 6679 | GAME( 1980, spcdraga, mooncrst, mooncrst, spcdrag, mooncrsu, ROT90, "bootleg", "Space Dragon (Moon Cresta bootleg, set 2)", GAME_SUPPORTS_SAVE ) | |
| 6392 | 6680 | GAME( 1980, mooncrgx, mooncrst, mooncrgx, mooncrgx, mooncrgx, ROT270, "bootleg", "Moon Cresta (Galaxian hardware)", GAME_SUPPORTS_SAVE ) |
| 6393 | 6681 | GAME( 1980, moonqsr, 0, moonqsr, moonqsr, moonqsr, ROT90, "Nichibutsu", "Moon Quasar", GAME_SUPPORTS_SAVE ) |
| 6394 | 6682 | GAME( 1981, mshuttle, 0, mshuttle, mshuttle, mshuttle, ROT0, "Nichibutsu", "Moon Shuttle (US?)", GAME_SUPPORTS_SAVE ) |
| 6395 | GAME( 1981, mshuttlj, mshuttle, mshuttle, mshuttle, cclimbrj, ROT0, "Nichibutsu", "Moon Shuttle (Japan)", GAME_SUPPORTS_SAVE ) | |
| 6683 | GAME( 1981, mshuttlj, mshuttle, mshuttle, mshuttle, cclimbrj, ROT0, "Nichibutsu", "Moon Shuttle (Japan set 1)", GAME_SUPPORTS_SAVE ) | |
| 6396 | 6684 | GAME( 1981, mshutlj2, mshuttle, mshuttle, mshuttle, cclimbrj, ROT0, "Nichibutsu", "Moon Shuttle (Japan set 2)", GAME_SUPPORTS_SAVE ) |
| 6397 | 6685 | GAME( 1980, moonal2, 0, mooncrst, moonal2, 0, ROT90, "Nichibutsu", "Moon Alien Part 2", GAME_SUPPORTS_SAVE ) |
| 6398 | 6686 | GAME( 1980, moonal2b, moonal2, mooncrst, moonal2, 0, ROT90, "Nichibutsu", "Moon Alien Part 2 (older version)", GAME_SUPPORTS_SAVE ) |
| r814 | r815 | |
|---|---|---|
| 102 | 102 | case 1: |
| 103 | 103 | case 2: |
| 104 | 104 | case 3: |
| 105 | tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_ | |
| 105 | tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER1,primask); | |
| 106 | 106 | break; |
| 107 | 107 | } |
| 108 | 108 | } |
| r814 | r815 | |
| 117 | 117 | case 1: |
| 118 | 118 | case 2: |
| 119 | 119 | case 3: |
| 120 | tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_ | |
| 120 | tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER0,1); | |
| 121 | 121 | break; |
| 122 | 122 | } |
| 123 | 123 | } |
| r814 | r815 | |
|---|---|---|
| 511 | 511 | int tileno, palette; |
| 512 | 512 | tileno = (gstream_vram[tile_index+0x000/4]&0x0fff0000)>>16; |
| 513 | 513 | 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); | |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | static TILE_GET_INFO( get_gs2_tile_info ) |
| r814 | r815 | |
| 519 | 519 | int tileno, palette; |
| 520 | 520 | tileno = (gstream_vram[tile_index+0x400/4]&0x0fff0000)>>16; |
| 521 | 521 | 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); | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | |
| r814 | r815 | |
| 528 | 528 | int tileno, palette; |
| 529 | 529 | tileno = (gstream_vram[tile_index+0x800/4]&0x0fff0000)>>16; |
| 530 | 530 | 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); | |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | |
| 535 | 535 | VIDEO_START(gstream) |
| 536 | 536 | { |
| 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); | |
| 540 | 540 | |
| 541 | 541 | tilemap_set_transparent_pen(gstream_tilemap1,0); |
| 542 | 542 | tilemap_set_transparent_pen(gstream_tilemap2,0); |
| r814 | r815 | |
|---|---|---|
| 278 | 278 | |
| 279 | 279 | static TILE_GET_INFO( get_layer0_tile_info ) |
| 280 | 280 | { |
| 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)); | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | static TILE_GET_INFO( get_layer1_tile_info ) |
| 285 | 285 | { |
| 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)); | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | static TILE_GET_INFO( get_layer2_tile_info ) |
| 290 | 290 | { |
| 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); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | |
| 295 | 295 | VIDEO_START( magic10 ) |
| 296 | 296 | { |
| 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); | |
| 300 | 300 | |
| 301 | 301 | tilemap_set_transparent_pen(layer1_tilemap,0); |
| 302 | 302 | tilemap_set_transparent_pen(layer2_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | tile = (tile & 0xfff) | (bg_bank << 12); |
| 182 | 182 | |
| 183 | SET_TILE_INFO(1,tile+0x0000,color,0) | |
| 183 | SET_TILE_INFO(1,tile+0x0000,color,0); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | static TILE_GET_INFO( get_mid_tile_info ) |
| r814 | r815 | |
| 191 | 191 | |
| 192 | 192 | tile = (tile & 0xfff) | (mid_bank << 12); |
| 193 | 193 | |
| 194 | SET_TILE_INFO(1,tile,color,0) | |
| 194 | SET_TILE_INFO(1,tile,color,0); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | static TILE_GET_INFO( get_fore_tile_info ) |
| r814 | r815 | |
| 204 | 204 | tile = (tile & 0xfff) | (fg_bank << 12); |
| 205 | 205 | // tile = (tile & 0xfff) | (3<<12); // 3000 intro (cliff) 1000 game (bg ) |
| 206 | 206 | |
| 207 | SET_TILE_INFO(1,tile,color,0) | |
| 207 | SET_TILE_INFO(1,tile,color,0); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | static TILE_GET_INFO( get_text_tile_info ) |
| r814 | r815 | |
| 215 | 215 | |
| 216 | 216 | tile &= 0xfff; |
| 217 | 217 | |
| 218 | SET_TILE_INFO(0,tile,color,0) | |
| 218 | SET_TILE_INFO(0,tile,color,0); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | static void set_scroll(tilemap *tm, int plane) |
| r814 | r815 | |
| 230 | 230 | |
| 231 | 231 | VIDEO_START(raiden2) |
| 232 | 232 | { |
| 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 ); | |
| 237 | 237 | |
| 238 | 238 | tilemap_set_transparent_pen(midground_layer,15); |
| 239 | 239 | tilemap_set_transparent_pen(foreground_layer,15); |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | 0, |
| 50 | 50 | code, |
| 51 | 51 | (attr>>1)&7, |
| 52 | 0) | |
| 52 | 0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | VIDEO_START( mogura ) |
| 57 | 57 | { |
| 58 | mogura_tilemap = tilemap_create(get_mogura_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 58 | mogura_tilemap = tilemap_create(get_mogura_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | VIDEO_UPDATE( mogura ) |
| r814 | r815 | |
|---|---|---|
| 170 | 170 | static TILE_GET_INFO( get_tile_info ) |
| 171 | 171 | { |
| 172 | 172 | int code=videoram[tile_index]; |
| 173 | SET_TILE_INFO(1, code, 0, 0) | |
| 173 | SET_TILE_INFO(1, code, 0, 0); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | VIDEO_START( dynadice ) |
| 177 | 177 | { |
| 178 | 178 | /* 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); | |
| 181 | 181 | tilemap_set_scrollx(bg_tilemap, 0, -16 ); |
| 182 | 182 | } |
| 183 | 183 |
| r814 | r815 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | VIDEO_START( dacholer ) |
| 187 | 187 | { |
| 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); | |
| 190 | 190 | |
| 191 | 191 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 192 | 192 | } |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | case 6: attr=3; break; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | SET_TILE_INFO( 0, code, attr, 0) | |
| 45 | SET_TILE_INFO( 0, code, attr, 0); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | WRITE8_HANDLER( skyarmy_videoram_w ) |
| r814 | r815 | |
| 99 | 99 | |
| 100 | 100 | VIDEO_START( skyarmy ) |
| 101 | 101 | { |
| 102 | skyarmy_tilemap = tilemap_create(get_skyarmy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 102 | skyarmy_tilemap = tilemap_create(get_skyarmy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 103 | 103 | tilemap_set_scroll_cols(skyarmy_tilemap,32); |
| 104 | 104 | } |
| 105 | 105 |
| r814 | r815 | |
|---|---|---|
| 28 | 28 | 0, |
| 29 | 29 | code, |
| 30 | 30 | 0, |
| 31 | 0) | |
| 31 | 0); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /* |
| r814 | r815 | |
| 61 | 61 | |
| 62 | 62 | static VIDEO_START( suprgolf ) |
| 63 | 63 | { |
| 64 | suprgolf_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 64 | suprgolf_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static VIDEO_UPDATE( suprgolf ) |
| 68 | 68 | { |
| 69 | 69 | tilemap_mark_all_tiles_dirty(suprgolf_tilemap); |
| 70 | tilemap_draw(bitmap,cliprect,suprgolf_tilemap,TILEMAP_ | |
| 70 | tilemap_draw(bitmap,cliprect,suprgolf_tilemap,TILEMAP_D | |
| 71 | 71 | return 0; |
| 72 | 72 | } |
| 73 | 73 |
| r814 | r815 | |
|---|---|---|
| 122 | 122 | |
| 123 | 123 | static TILE_GET_INFO( get_bg_tile_info ) |
| 124 | 124 | { |
| 125 | SET_TILE_INFO(0, videoram[tile_index] + 0x100, 1, 0) | |
| 125 | SET_TILE_INFO(0, videoram[tile_index] + 0x100, 1, 0); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | VIDEO_START( wallc ) |
| 129 | 129 | { |
| 130 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y, TILEMAP_TYPE_ | |
| 130 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y, TILEMAP_TYPE_ | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | VIDEO_UPDATE( wallc ) |
| r814 | r815 | |
|---|---|---|
| 447 | 447 | int color = 0; |
| 448 | 448 | int flags = TILE_FLIPX; |
| 449 | 449 | |
| 450 | SET_TILE_INFO(0, code, color, flags) | |
| 450 | SET_TILE_INFO(0, code, color, flags); | |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | VIDEO_START( marinedt ) |
| 454 | 454 | { |
| 455 | tx_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 455 | tx_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 456 | 456 | |
| 457 | 457 | tilemap_set_transparent_pen(tx_tilemap, 0); |
| 458 | 458 | tilemap_set_scrolldx(tx_tilemap, 0, 4*8); |
| r814 | r815 | |
|---|---|---|
| 60 | 60 | UINT16 code = ((vram_data & 0xff) | ((vram_data & 0x8000) >> 7) | ((vram_data & 0x2000) >> 4)); |
| 61 | 61 | UINT16 color = (vram_data & 0x0f00) >> 8; |
| 62 | 62 | |
| 63 | SET_TILE_INFO(region, code, color, 0) | |
| 63 | SET_TILE_INFO(region, code, color, 0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | VIDEO_START( couple ) |
| 67 | 67 | { |
| 68 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 68 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | VIDEO_UPDATE( couple ) |
| r814 | r815 | |
|---|---|---|
| 93 | 93 | int code = videoram[tile_index] + ((attr & 0xf0) << 4); |
| 94 | 94 | int color = attr & 0x0f; |
| 95 | 95 | |
| 96 | SET_TILE_INFO(0, code, color, 0) | |
| 96 | SET_TILE_INFO(0, code, color, 0); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | VIDEO_START(lucky8) |
| 100 | 100 | { |
| 101 | 101 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 102 | TILEMAP_TYPE_ | |
| 102 | TILEMAP_TYPE_ | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | VIDEO_UPDATE(lucky8) |
| r814 | r815 | |
|---|---|---|
| 358 | 358 | colorram[0] = colorram[0] | ((colorram[0] & 0x08) << 4); /* only for 1st offset */ |
| 359 | 359 | // colorram[tile_index] = attr | ((attr & 0x08) << 4); /* for the whole color RAM */ |
| 360 | 360 | |
| 361 | SET_TILE_INFO(bank, code, color, 0) | |
| 361 | SET_TILE_INFO(bank, code, color, 0); | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | VIDEO_START(magicfly) |
| 365 | 365 | { |
| 366 | 366 | bg_tilemap = tilemap_create(get_magicfly_tile_info, tilemap_scan_rows, |
| 367 | TILEMAP_TYPE_ | |
| 367 | TILEMAP_TYPE_ | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | static TILE_GET_INFO( get_7mezzo_tile_info ) |
| r814 | r815 | |
| 390 | 390 | colorram[0] = colorram[0] | ((colorram[0] & 0x04) << 5); /* only for 1st offset */ |
| 391 | 391 | // colorram[tile_index] = attr | ((attr & 0x04) << 5); /* for the whole color RAM */ |
| 392 | 392 | |
| 393 | SET_TILE_INFO(bank, code, color, 0) | |
| 393 | SET_TILE_INFO(bank, code, color, 0); | |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | VIDEO_START( 7mezzo ) |
| 397 | 397 | { |
| 398 | 398 | bg_tilemap = tilemap_create(get_7mezzo_tile_info, tilemap_scan_rows, |
| 399 | TILEMAP_TYPE_ | |
| 399 | TILEMAP_TYPE_ | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | VIDEO_UPDATE( magicfly ) |
| r814 | r815 | |
|---|---|---|
| 100 | 100 | |
| 101 | 101 | tileno=tile_lookup[tileno>>4]|(tileno&0xf)|(fgbank<<8); |
| 102 | 102 | |
| 103 | SET_TILE_INFO(0,tileno,fgpalette,0) | |
| 103 | SET_TILE_INFO(0,tileno,fgpalette,0); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| r814 | r815 | |
| 114 | 114 | { |
| 115 | 115 | palno=25; |
| 116 | 116 | } |
| 117 | SET_TILE_INFO(1,tileno+bgbank*256,palno,0) | |
| 117 | SET_TILE_INFO(1,tileno+bgbank*256,palno,0); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | VIDEO_START(pturn) |
| 121 | 121 | { |
| 122 | pturn_fgmap = tilemap_create(get_pturn_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 122 | pturn_fgmap = tilemap_create(get_pturn_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 123 | 123 | tilemap_set_transparent_pen(pturn_fgmap,0); |
| 124 | pturn_bgmap = tilemap_create(get_pturn_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 124 | pturn_bgmap = tilemap_create(get_pturn_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 125 | 125 | tilemap_set_transparent_pen(pturn_bgmap,0); |
| 126 | 126 | } |
| 127 | 127 |
| r814 | r815 | |
|---|---|---|
| 13 | 13 | * Golden Poker Double Up (Mini Boy). 1981, Bonanza Enterprises, Ltd. |
| 14 | 14 | * Golden Poker (no double up). 198?, Bootleg. |
| 15 | 15 | * 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. | |
| 17 | 18 | |
| 18 | 19 | |
| 19 | 20 | ******************************************************************************* |
| r814 | r815 | |
| 249 | 250 | ******************************************************************************* |
| 250 | 251 | |
| 251 | 252 | |
| 252 | Buttons/Inputs goldnpkr goldnpkb goldnpkc pmpoker jokerpkr pottnpkr | |
| 253 | ------------------------------------------------------------------------------------- | |
| 253 | Buttons/Inputs goldnpkr goldnpkb goldnpkc pmpoker jokerpkr pottnpkr pottnpkc | |
| 254 | ------------------------------------------------------------------------------------------------- | |
| 254 | 255 | |
| 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 | |
| 263 | 264 | |
| 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 | |
| 269 | 270 | |
| 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 | |
| 272 | 273 | |
| 273 | 274 | |
| 274 | 275 | Inputs are different for some games. Normally each button has only one function. |
| r814 | r815 | |
| 409 | 410 | if (attr == 0x3a) /* Is the palette wrong? */ |
| 410 | 411 | color = 0x3b; /* 0x3b is the best match */ |
| 411 | 412 | |
| 412 | SET_TILE_INFO(bank, code, color, 0) | |
| 413 | SET_TILE_INFO(bank, code, color, 0); | |
| 413 | 414 | } |
| 414 | 415 | |
| 415 | 416 | VIDEO_START( pmpoker ) |
| 416 | 417 | { |
| 417 | 418 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 418 | TILEMAP_TYPE_ | |
| 419 | TILEMAP_TYPE_ | |
| 419 | 420 | } |
| 420 | 421 | |
| 421 | 422 | VIDEO_UPDATE( pmpoker ) |
| r814 | r815 | |
| 1166 | 1167 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) |
| 1167 | 1168 | ROM_END |
| 1168 | 1169 | |
| 1170 | /*pottpok4.bin 0xxxxxxxxxx = 0x00 | |
| 1171 | 517.4a 0xxxxxxxxxx = 0x00 | |
| 1172 | pottpok1.bin 517.8a IDENTICAL | |
| 1173 | pottpok2.bin 517.7a IDENTICAL | |
| 1174 | pottpok3.bin 517.6a IDENTICAL | |
| 1175 | pottpok4.bin 517.4a IDENTICAL | |
| 1176 | pottpok5.bin 517.16a 69.335938% | |
| 1177 | pottpok6.bin 517.17a 2.685547% | |
| 1178 | */ | |
| 1169 | 1179 | |
| 1180 | ROM_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 */ | |
| 1196 | ROM_END | |
| 1197 | ||
| 1198 | ||
| 1170 | 1199 | /************************* |
| 1171 | 1200 | * Driver Init * |
| 1172 | 1201 | *************************/ |
| r814 | r815 | |
| 1188 | 1217 | GAMEL( 1981, goldnpkb, pmpoker, pmpoker, goldnpkr, pmpoker, ROT0, "Bonanza Enterprises, Ltd", "Golden Poker Double Up (Mini Boy)", GAME_NO_SOUND ,layout_goldnpkr ) |
| 1189 | 1218 | GAMEL( 1981, goldnpkc, pmpoker, pmpoker, goldnpkc, pmpoker, ROT0, "Bootleg", "Golden Poker (no double up)", GAME_NO_SOUND ,layout_goldnpkr ) |
| 1190 | 1219 | GAMEL( 198?, jokerpkr, pmpoker, jokerpkr, jokerpkr, pmpoker, ROT0, "Bootleg in Coinmaster hardware", "Joker-Poker", GAME_NO_SOUND ,layout_pottnpkr ) |
| 1191 | GAMEL( 198?, pottnpkr, pmpoker, jokerpkr, pottnpkr, pmpoker, ROT0, "Unknown", "Jack Potten's Poker", GAME_NO_SOUND ,layout_pottnpkr ) | |
| 1220 | GAMEL( 198?, pottnpkr, pmpoker, jokerpkr, pottnpkr, pmpoker, ROT0, "Bootleg", "Jack Potten's Poker (bootleg)", GAME_NO_SOUND ,layout_pottnpkr ) | |
| 1221 | GAMEL( 198?, pottnpkb, pmpoker, jokerpkr, goldnpkc, pmpoker, ROT0, "Bootleg", "Jack Potten's Poker (bootleg2)", GAME_NO_SOUND ,layout_pottnpkr ) | |
| 1192 | 1222 |
| r814 | r815 | |
|---|---|---|
| 67 | 67 | 0, |
| 68 | 68 | code + ((color & 0xf8) << 3), |
| 69 | 69 | color & 0x7, |
| 70 | 0) | |
| 70 | 0); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | VIDEO_START( yumefuda ) |
| 75 | 75 | { |
| 76 | bg_tilemap = tilemap_create(y_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 76 | bg_tilemap = tilemap_create(y_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | VIDEO_UPDATE( yumefuda ) |
| r814 | r815 | |
|---|---|---|
| 351 | 351 | SET_TILE_INFO( 0, data&0x03ff, data>>12, TILE_FLIPYX((data&0x0c00)>>10) ); |
| 352 | 352 | if( data&0x8000 ) |
| 353 | 353 | { |
| 354 | tileinfo-> | |
| 354 | tileinfo->categor | |
| 355 | 355 | } |
| 356 | 356 | } /* TextTilemapGetInfo */ |
| 357 | 357 | |
| r814 | r815 | |
| 369 | 369 | |
| 370 | 370 | VIDEO_START( ss23 ) |
| 371 | 371 | { |
| 372 | bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 372 | bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 373 | 373 | tilemap_set_transparent_pen( bgtilemap, 0xf ); |
| 374 | 374 | } |
| 375 | 375 |
| r814 | r815 | |
|---|---|---|
| 37 | 37 | 0, |
| 38 | 38 | code, |
| 39 | 39 | color, |
| 40 | 0) | |
| 40 | 0); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | VIDEO_UPDATE( tattack ) |
| r814 | r815 | |
| 49 | 49 | |
| 50 | 50 | VIDEO_START( tattack ) |
| 51 | 51 | { |
| 52 | tmap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 52 | tmap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static ADDRESS_MAP_START( mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r814 | r815 | |
|---|---|---|
| 92 | 92 | VIDEO_START(dunhuang) |
| 93 | 93 | { |
| 94 | 94 | tmap = tilemap_create( get_tile_info, tilemap_scan_rows, |
| 95 | TILEMAP_TYPE_ | |
| 95 | TILEMAP_TYPE_ | |
| 96 | 96 | |
| 97 | 97 | tmap2 = tilemap_create( get_tile_info2, tilemap_scan_rows, |
| 98 | TILEMAP_TYPE_ | |
| 98 | TILEMAP_TYPE_ | |
| 99 | 99 | |
| 100 | 100 | tilemap_set_transparent_pen(tmap, 0); |
| 101 | 101 | tilemap_set_transparent_pen(tmap2, 0); |
| r814 | r815 | |
| 128 | 128 | switch (dunhuang_layers) |
| 129 | 129 | { |
| 130 | 130 | case 0x04: // girl select: bg over fg |
| 131 | if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, tmap2, TILEMAP_ | |
| 131 | if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, tmap2, TILEMAP_D | |
| 132 | 132 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, tmap, 0, 0); |
| 133 | 133 | break; |
| 134 | 134 | case 0x05: // dips: must hide fg |
| 135 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, tmap, TILEMAP_ | |
| 135 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, tmap, TILEMAP_D | |
| 136 | 136 | break; |
| 137 | 137 | case 0x07: // game,demo: fg over bg |
| 138 | 138 | default: |
| 139 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, tmap, TILEMAP_ | |
| 139 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, tmap, TILEMAP_D | |
| 140 | 140 | if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, tmap2, 0, 0); |
| 141 | 141 | break; |
| 142 | 142 | } |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | code &= 0x7fff; |
| 51 | 51 | |
| 52 | SET_TILE_INFO(0, code, color, 0) | |
| 52 | SET_TILE_INFO(0, code, color, 0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static WRITE8_HANDLER( onetwo_fgram_w ) |
| r814 | r815 | |
| 243 | 243 | |
| 244 | 244 | VIDEO_START( onetwo ) |
| 245 | 245 | { |
| 246 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 246 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | VIDEO_UPDATE( onetwo ) |
| r814 | r815 | |
|---|---|---|
| 523 | 523 | static TILE_GET_INFO( get_tile_info ) |
| 524 | 524 | { |
| 525 | 525 | // 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); | |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | VIDEO_START( laserbat ) |
| 530 | 530 | { |
| 531 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 531 | bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 532 | 532 | |
| 533 | 533 | videoram = (UINT8 *)auto_malloc(0x400); |
| 534 | 534 | colorram = (UINT8 *)auto_malloc(0x400); |
| r814 | r815 | |
|---|---|---|
| 332 | 332 | |
| 333 | 333 | if (magicstk_videoram[tile_index] & 0x800) code |= 0x8000; |
| 334 | 334 | |
| 335 | SET_TILE_INFO(1,code,colr >> 12,0) | |
| 335 | SET_TILE_INFO(1,code,colr >> 12,0); | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect) |
| r814 | r815 | |
| 364 | 364 | |
| 365 | 365 | VIDEO_START( powerbal ) |
| 366 | 366 | { |
| 367 | bg_tilemap = tilemap_create(powerbal_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 367 | bg_tilemap = tilemap_create(powerbal_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 368 | 368 | |
| 369 | 369 | xoffset = -20; |
| 370 | 370 |
| r814 | r815 | |
|---|---|---|
| 151 | 151 | int code = videoram[tile_index]; |
| 152 | 152 | int color = colorram[tile_index] & 0x1f; |
| 153 | 153 | |
| 154 | SET_TILE_INFO(0, code, color + 0x20, 0) | |
| 154 | SET_TILE_INFO(0, code, color + 0x20, 0); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | VIDEO_START( talbot ) |
| 158 | 158 | { |
| 159 | bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 159 | bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 14 | 14 | Lup Lup Puzzle (c) 1999 Omega System (version 3.0 and 2.9) |
| 15 | 15 | Puzzle Bang Bang (c) 1999 Omega System (version 2.8) |
| 16 | 16 | Wyvern Wings (c) 2001 SemiCom |
| 17 | Final Godori (c) 2001 SemiCom | |
| 17 | Final Godori (c) 2001 SemiCom (version 2.20.5915) | |
| 18 | 18 | |
| 19 | 19 | Games Needed: |
| 20 | 20 | |
| r814 | r815 | |
| 976 | 976 | | | | MEM6 | XPL84C | | |
| 977 | 977 | | PAL +----------+ | | | |
| 978 | 978 | | MEM2 +----------+ | |
| 979 | |SW1 SW2 | |
| 979 | |SW1 SW2 61L256S | | |
| 980 | 980 | | ROM0* +--------+ +--------+ 28MHz | |
| 981 | 981 | | ROM1 | ROML00 | | ROMH00 | +-----+| |
| 982 | 982 | | +--------+ +--------+ |93C46|| |
| r814 | r815 | |
| 991 | 991 | CRAM are MCM6206BAEJ15 |
| 992 | 992 | DRAM are KM416C1204AJ-6 |
| 993 | 993 | MEM are MCM6206BAEJ15 |
| 994 | 61L256S - 32K x 8 bit High Speed CMOS SRAM (game's so called "Backup Data") | |
| 994 | 995 | |
| 995 | 996 | SW1 is the reset button |
| 996 | 997 | SW2 is the setup button |
| 997 | 998 | |
| 998 | 999 | */ |
| 999 | 1000 | |
| 1000 | ROM_START( finalgdr ) | |
| 1001 | ROM_START( finalgdr ) /* version 2.20.5915, Korea only */ | |
| 1001 | 1002 | ROM_REGION32_BE( 0x100000, REGION_USER1, 0 ) /* Hyperstone CPU Code */ |
| 1002 | 1003 | /* rom0 empty */ |
| 1003 | 1004 | ROM_LOAD( "rom1", 0x080000, 0x080000, CRC(45815931) SHA1(80ba7a366994e40a1f520ea18fad82e6b068b279) ) |
| r814 | r815 | |
| 1224 | 1225 | GAME( 1999, puzlbang, suplup, suplup, common, puzlbang, ROT0, "Omega System", "Puzzle Bang Bang (version 2.8 / 990106)", 0 ) |
| 1225 | 1226 | GAME( 1999, vamphalf, 0, vamphalf, common, vamphalf, ROT0, "Danbi & F2 System", "Vamp 1/2 (Korea version)", 0 ) |
| 1226 | 1227 | GAME( 2000, misncrft, 0, misncrft, common, misncrft, ROT90, "Sun", "Mission Craft (version 2.4)", GAME_NO_SOUND ) |
| 1227 | GAME( 2001, finalgdr, 0, finalgdr, common, finalgdr, ROT0, "SemiCom", "Final Godori", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 1228 | GAME( 2001, finalgdr, 0, finalgdr, common, finalgdr, ROT0, "SemiCom", "Final Godori (Korea)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 1228 | 1229 | GAME( 2001, wyvernwg, 0, wyvernwg, common, wyvernwg, ROT270, "SemiCom (Game Vision License)", "Wyvern Wings", GAME_NO_SOUND ) |
| r814 | r815 | |
|---|---|---|
| 399 | 399 | |
| 400 | 400 | VIDEO_START(varia) |
| 401 | 401 | { |
| 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); | |
| 405 | 405 | tilemap_set_transparent_pen(vmetal_texttilemap,0); |
| 406 | 406 | tilemap_set_transparent_pen(vmetal_mid1tilemap,0); |
| 407 | 407 | tilemap_set_transparent_pen(vmetal_mid2tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 120 | 120 | tileno = (tile_index&1)?(dreamwld_bg_videoram[tile_index>>1]&0xffff):((dreamwld_bg_videoram[tile_index>>1]>>16)&0xffff); |
| 121 | 121 | colour = tileno >> 13; |
| 122 | 122 | 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); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| r814 | r815 | |
| 137 | 137 | tileno = (tile_index&1)?(dreamwld_bg2_videoram[tile_index>>1]&0xffff):((dreamwld_bg2_videoram[tile_index>>1]>>16)&0xffff); |
| 138 | 138 | colour = tileno >> 13; |
| 139 | 139 | 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); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | VIDEO_START(dreamwld) |
| 144 | 144 | { |
| 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); | |
| 147 | 147 | tilemap_set_transparent_pen(dreamwld_bg2_tilemap,0); |
| 148 | 148 | dreamwld_tilebankold[0] = dreamwld_tilebankold[1] = -1; |
| 149 | 149 | dreamwld_tilebank[0] = dreamwld_tilebank[1] = 0; |
| r814 | r815 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 144 | 144 | |
| 145 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_ | |
| 145 | deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_D | |
| 146 | 146 | draw_sprites(machine,bitmap,cliprect); |
| 147 | 147 | deco16_tilemap_1_draw(bitmap,cliprect,0,0); |
| 148 | 148 | return 0; |
| r814 | r815 | |
|---|---|---|
| 113 | 113 | 1, |
| 114 | 114 | code, |
| 115 | 115 | (attr & 0xf0) >> 4, |
| 116 | 0) | |
| 116 | 0); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | static TILE_GET_INFO( get_txttile_info ) |
| r814 | r815 | |
| 126 | 126 | 0, |
| 127 | 127 | code + ((attr & 8) << 5), |
| 128 | 128 | attr&7, |
| 129 | 0) | |
| 129 | 0); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | static READ8_HANDLER(t5182shared_r) |
| r814 | r815 | |
| 166 | 166 | |
| 167 | 167 | VIDEO_START( panicr ) |
| 168 | 168 | { |
| 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 ); | |
| 171 | 171 | tilemap_set_transparent_pen(txttilemap, 0); |
| 172 | 172 | } |
| 173 | 173 |
| r814 | r815 | |
|---|---|---|
| 56 | 56 | UINT8 *rom = memory_region(REGION_USER1); |
| 57 | 57 | int tileno = rom[tile_index + bgmap * 1024]; |
| 58 | 58 | |
| 59 | SET_TILE_INFO(0, tileno, 0, 0) | |
| 59 | SET_TILE_INFO(0, tileno, 0, 0); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static void plot_pixel_sbw(int x, int y, int col) |
| r814 | r815 | |
| 102 | 102 | VIDEO_START(sbowling) |
| 103 | 103 | { |
| 104 | 104 | 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_ | |
| 105 | sb_tilemap = tilemap_create(get_sb_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | static WRITE8_HANDLER( pix_shift_w ) |
| r814 | r815 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | VIDEO_START( good ) |
| 74 | 74 | { |
| 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); | |
| 77 | 77 | tilemap_set_transparent_pen(fg_tilemap,0xf); |
| 78 | 78 | } |
| 79 | 79 |
| r814 | r815 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | VIDEO_START(igs_majhong) |
| 134 | 134 | { |
| 135 | igs_tx_tilemap= tilemap_create(get_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 135 | igs_tx_tilemap= tilemap_create(get_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 136 | 136 | tilemap_set_transparent_pen(igs_tx_tilemap,15); |
| 137 | 137 | 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_ | |
| 138 | //igs_bg_tilemap= tilemap_create(get_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 139 | 139 | //tilemap_set_transparent_pen(igs_bg_tilemap,15); |
| 140 | 140 | logerror("Video START OK!\n"); |
| 141 | 141 | } |
| r814 | r815 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | code += gfx_bank * 0x100; |
| 176 | 176 | |
| 177 | SET_TILE_INFO(gfx_code,code,color,0) | |
| 177 | SET_TILE_INFO(gfx_code,code,color,0); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | static TILE_GET_INFO( get_tile_info_bg ) |
| r814 | r815 | |
| 189 | 189 | |
| 190 | 190 | VIDEO_START( ettrivia ) |
| 191 | 191 | { |
| 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 ); | |
| 194 | 194 | |
| 195 | 195 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 196 | 196 | } |
| r814 | r815 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | static int respcount; |
| 134 | 134 | |
| 135 | static | |
| 135 | static | |
| 136 | 136 | { |
| 137 | 137 | /* logical (col,row) -> memory offset */ |
| 138 | 138 | return (row & 0x0f) + ((col & 0xff) << 4) + ((row & 0x70) << 8); |
| r814 | r815 | |
| 145 | 145 | 3, |
| 146 | 146 | (code & 0xfff) + ((sc0bank & 3) << 12), |
| 147 | 147 | code >> 12, |
| 148 | 0) | |
| 148 | 0); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | static TILE_GET_INFO( get_sc3_tile_info ) |
| r814 | r815 | |
| 155 | 155 | 0, |
| 156 | 156 | code & 0xfff, |
| 157 | 157 | code >> 12, |
| 158 | 0) | |
| 158 | 0); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static TILE_GET_INFO( get_sc2_tile_info ) |
| r814 | r815 | |
| 165 | 165 | 1, |
| 166 | 166 | code & 0xfff, |
| 167 | 167 | code >> 12, |
| 168 | 0) | |
| 168 | 0); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static TILE_GET_INFO( get_sc1_tile_info ) |
| r814 | r815 | |
| 175 | 175 | 2, |
| 176 | 176 | code & 0xfff, |
| 177 | 177 | code >> 12, |
| 178 | 0) | |
| 178 | 0); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | VIDEO_START( jalmah ) |
| 182 | 182 | { |
| 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); | |
| 187 | 187 | |
| 188 | 188 | jm_scrollram = auto_malloc(0x80); |
| 189 | 189 | jm_vregs = auto_malloc(0x40); |
| r814 | r815 | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | #define jalmah_tilemap_draw(_tilemap_) \ |
| 330 | tilemap_draw(bitmap,cliprect,_tilemap_,(opaque & 1) ? 0 : TILEMAP_ | |
| 330 | tilemap_draw(bitmap,cliprect,_tilemap_,(opaque & 1) ? 0 : TILEMAP_D | |
| 331 | 331 | if(!opaque) { opaque = 1; } |
| 332 | 332 | |
| 333 | 333 | VIDEO_UPDATE( jalmah ) |
| r814 | r815 | |
|---|---|---|
| 246 | 246 | { |
| 247 | 247 | int code = videoram[tile_index] + char_bank[tile_index] * 0x100; |
| 248 | 248 | |
| 249 | SET_TILE_INFO( 0, code, 0, 0) | |
| 249 | SET_TILE_INFO( 0, code, 0, 0); | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | VIDEO_START( supdrapo ) |
| 253 | 253 | { |
| 254 | fg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 254 | fg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | VIDEO_UPDATE( supdrapo ) |
| r814 | r815 | |
|---|---|---|
| 118 | 118 | 0, |
| 119 | 119 | videoram16[2*tile_index+1], |
| 120 | 120 | videoram16[2*tile_index]&0xf, |
| 121 | 0) | |
| 121 | 0); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| r814 | r815 | |
| 402 | 402 | |
| 403 | 403 | VIDEO_START(deroon) |
| 404 | 404 | { |
| 405 | txt_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 405 | txt_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 406 | 406 | tilemap_set_transparent_pen(txt_tilemap,0); |
| 407 | 407 | } |
| 408 | 408 |
| r814 | r815 | |
|---|---|---|
| 610 | 610 | if(region == 0) |
| 611 | 611 | code |= extra_video_bank_bit; |
| 612 | 612 | |
| 613 | SET_TILE_INFO(region, code, 0, 0) | |
| 613 | SET_TILE_INFO(region, code, 0, 0); | |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | |
| 617 | 617 | VIDEO_START( merit ) |
| 618 | 618 | { |
| 619 | bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 619 | bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | VIDEO_UPDATE( merit ) |
| r814 | r815 | |
|---|---|---|
| 171 | 171 | code = madalien_videoram[tile_index]; |
| 172 | 172 | color = 2 * madalien_select_color_1; |
| 173 | 173 | |
| 174 | SET_TILE_INFO(0, code, color, 0) | |
| 174 | SET_TILE_INFO(0, code, color, 0); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | static TILE_GET_INFO( get_bg_tile_info_l ) |
| r814 | r815 | |
| 192 | 192 | |
| 193 | 193 | color = madalien_swap_colors * 4; |
| 194 | 194 | |
| 195 | SET_TILE_INFO(1, code, color, 0) | |
| 195 | SET_TILE_INFO(1, code, color, 0); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | static TILE_GET_INFO( get_bg_tile_info_r ) |
| r814 | r815 | |
| 213 | 213 | |
| 214 | 214 | color = madalien_swap_colors * 4; |
| 215 | 215 | |
| 216 | SET_TILE_INFO(1, code, color, 0) | |
| 216 | SET_TILE_INFO(1, code, color, 0); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | |
| r814 | r815 | |
| 225 | 225 | const UINT8 *headlight_rom; |
| 226 | 226 | |
| 227 | 227 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x, |
| 228 | TILEMAP_TYPE_ | |
| 228 | TILEMAP_TYPE_ | |
| 229 | 229 | |
| 230 | 230 | bg_tilemap_l = tilemap_create(get_bg_tile_info_l, tilemap_scan_cols_flip_x, |
| 231 | TILEMAP_TYPE_ | |
| 231 | TILEMAP_TYPE_ | |
| 232 | 232 | |
| 233 | 233 | bg_tilemap_r = tilemap_create(get_bg_tile_info_r, tilemap_scan_cols_flip_x, |
| 234 | TILEMAP_TYPE_ | |
| 234 | TILEMAP_TYPE_ | |
| 235 | 235 | |
| 236 | 236 | tilemap_set_transparent_pen( fg_tilemap, 0 ); |
| 237 | 237 |
| r814 | r815 | |
|---|---|---|
| 53 | 53 | int code = videoram[tile_index] + (gfxbank << 12) + ((attr & 0x07) << 8) + ((attr & 0x80) << 4); |
| 54 | 54 | int color = (gfxbank << 5) + (attr >> 3); |
| 55 | 55 | |
| 56 | SET_TILE_INFO(0, code, color, 0) | |
| 56 | SET_TILE_INFO(0, code, color, 0); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | VIDEO_START( rmhaihai ) |
| 60 | 60 | { |
| 61 | 61 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 62 | TILEMAP_TYPE_ | |
| 62 | TILEMAP_TYPE_ | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | VIDEO_UPDATE( rmhaihai ) |
| r814 | r815 | |
|---|---|---|
| 65 | 65 | VIDEO_START( livequiz ) |
| 66 | 66 | { |
| 67 | 67 | tmap = tilemap_create( get_tile_info, tilemap_scan_cols, |
| 68 | TILEMAP_TYPE_ | |
| 68 | TILEMAP_TYPE_ | |
| 69 | 69 | |
| 70 | 70 | tilemap_set_transparent_pen(tmap, 0); |
| 71 | 71 | } |
| r814 | r815 | |
|---|---|---|
| 53 | 53 | int color = attr; |
| 54 | 54 | color=0; |
| 55 | 55 | |
| 56 | SET_TILE_INFO(0, code, color, 0) | |
| 56 | SET_TILE_INFO(0, code, color, 0); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | VIDEO_START(ampoker2) |
| 60 | 60 | { |
| 61 | 61 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 62 | TILEMAP_TYPE_ | |
| 62 | TILEMAP_TYPE_ | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | VIDEO_UPDATE(ampoker2) |
| r814 | r815 | |
|---|---|---|
| 27 | 27 | tileno = jackpool_layer0_videoram[tile_index]&0x7fff; |
| 28 | 28 | attr = jackpool_layer0_videoram[tile_index+0x800]&0x1f; |
| 29 | 29 | |
| 30 | SET_TILE_INFO(0,tileno,attr,0) | |
| 30 | SET_TILE_INFO(0,tileno,attr,0); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | WRITE16_HANDLER( jackpool_layer0_videoram_w ) |
| r814 | r815 | |
| 44 | 44 | tileno = jackpool_layer1_videoram[tile_index]&0x7fff; |
| 45 | 45 | attr = jackpool_layer1_videoram[tile_index+0x800]&0x1f; |
| 46 | 46 | |
| 47 | SET_TILE_INFO(0,tileno,attr,0) | |
| 47 | SET_TILE_INFO(0,tileno,attr,0); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | WRITE16_HANDLER( jackpool_layer1_videoram_w ) |
| r814 | r815 | |
| 61 | 61 | tileno = jackpool_layer2_videoram[tile_index]&0x7fff; |
| 62 | 62 | attr = jackpool_layer2_videoram[tile_index+0x800]&0x1f; |
| 63 | 63 | |
| 64 | SET_TILE_INFO(0,tileno,attr,0) | |
| 64 | SET_TILE_INFO(0,tileno,attr,0); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | WRITE16_HANDLER( jackpool_layer2_videoram_w ) |
| r814 | r815 | |
| 140 | 140 | |
| 141 | 141 | VIDEO_START(jackpool) |
| 142 | 142 | { |
| 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); | |
| 146 | 146 | |
| 147 | 147 | tilemap_set_transparent_pen(jackpool_layer0_tilemap,0); |
| 148 | 148 | tilemap_set_transparent_pen(jackpool_layer2_tilemap,0); |
| r814 | r815 | |
|---|---|---|
| 790 | 790 | |
| 791 | 791 | INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *vram,int color) |
| 792 | 792 | { |
| 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); | |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | static TILE_GET_INFO( fg_get_tile_info ) { get_tile_info(machine,tileinfo,tile_index,fg_videoram, 0); } |
| r814 | r815 | |
| 798 | 798 | |
| 799 | 799 | VIDEO_START( nmg5 ) |
| 800 | 800 | { |
| 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); | |
| 803 | 803 | |
| 804 | 804 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 805 | 805 | } |
| r814 | r815 | |
|---|---|---|
| 264 | 264 | code |= 0x100; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | SET_TILE_INFO(0, code, 0, 0) | |
| 267 | SET_TILE_INFO(0, code, 0, 0); | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | VIDEO_START( wink ) |
| 271 | 271 | { |
| 272 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 272 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | VIDEO_UPDATE( wink ) |
| r814 | r815 | |
|---|---|---|
| 88 | 88 | int color = (attr & 0x1f) + 0x20; |
| 89 | 89 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 90 | 90 | |
| 91 | SET_TILE_INFO(0, code, color, flags) | |
| 91 | SET_TILE_INFO(0, code, color, flags); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | VIDEO_START( olibochu ) |
| 95 | 95 | { |
| 96 | 96 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 97 | TILEMAP_TYPE_ | |
| 97 | TILEMAP_TYPE_ | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 168 | 168 | tileno = (upper + lower); |
| 169 | 169 | color = 0; |
| 170 | 170 | |
| 171 | SET_TILE_INFO(4,tileno,color,0) | |
| 171 | SET_TILE_INFO(4,tileno,color,0); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /* Scene tiles */ |
| r814 | r815 | |
| 181 | 181 | tileno = (upper + lower); |
| 182 | 182 | color = 0; |
| 183 | 183 | |
| 184 | SET_TILE_INFO(5,tileno,color,0) | |
| 184 | SET_TILE_INFO(5,tileno,color,0); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | /* HUD tiles */ |
| r814 | r815 | |
| 194 | 194 | tileno = (upper + lower); |
| 195 | 195 | color = 0; |
| 196 | 196 | |
| 197 | SET_TILE_INFO(6,tileno,color,0) | |
| 197 | SET_TILE_INFO(6,tileno,color,0); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | |
| 201 | 201 | VIDEO_START( lockon ) |
| 202 | 202 | { |
| 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 | |
| 206 | 206 | tilemap_set_transparent_pen(lockon_tilemap0,0x00); |
| 207 | 207 | } |
| 208 | 208 |
| r814 | r815 | |
|---|---|---|
| 136 | 136 | else |
| 137 | 137 | color = 2; /* green */ |
| 138 | 138 | |
| 139 | SET_TILE_INFO(0, code & 0x7f, color, 0) | |
| 139 | SET_TILE_INFO(0, code & 0x7f, color, 0); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| r814 | r815 | |
| 150 | 150 | else |
| 151 | 151 | color = (~tile_index & 0x04) | ((tile_index >> 1) & 0x03); |
| 152 | 152 | |
| 153 | flags = ((tile_index & 0x1f) >= 0x03) ? 0 : TILE_ | |
| 153 | flags = ((tile_index & 0x1f) >= 0x03) ? 0 : TILE_F | |
| 154 | 154 | |
| 155 | SET_TILE_INFO(1, code & 0x7f, color, flags) | |
| 155 | SET_TILE_INFO(1, code & 0x7f, color, flags); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| 159 | 159 | static VIDEO_START( safarir ) |
| 160 | 160 | { |
| 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); | |
| 163 | 163 | |
| 164 | 164 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 165 | 165 | } |
| r814 | r815 | |
|---|---|---|
| 141 | 141 | int code = videoram[tile_index] | ((attr & 0x30) << 4); |
| 142 | 142 | int color = (attr & 0x0f) + (pal_bank << 4); |
| 143 | 143 | |
| 144 | SET_TILE_INFO(1, code, color, 0) | |
| 144 | SET_TILE_INFO(1, code, color, 0); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | static TILE_GET_INFO( get_fg_tile_info ) |
| 148 | 148 | { |
| 149 | 149 | int code = wilytowr_videoram2[tile_index]; |
| 150 | 150 | |
| 151 | SET_TILE_INFO(0, code, 0, fg_flag) | |
| 151 | SET_TILE_INFO(0, code, 0, fg_flag); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | VIDEO_START( wilytowr ) |
| 155 | 155 | { |
| 156 | 156 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 157 | TILEMAP_TYPE_ | |
| 157 | TILEMAP_TYPE_ | |
| 158 | 158 | |
| 159 | 159 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, |
| 160 | TILEMAP_TYPE_ | |
| 160 | TILEMAP_TYPE_ | |
| 161 | 161 | |
| 162 | 162 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 163 | 163 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| r814 | r815 | |
|---|---|---|
| 174 | 174 | { |
| 175 | 175 | looping_state *state = machine->driver_data; |
| 176 | 176 | |
| 177 | state->bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 177 | state->bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 178 | 178 | |
| 179 | 179 | tilemap_set_scroll_cols(state->bg_tilemap, 0x20); |
| 180 | 180 | } |
| r814 | r815 | |
|---|---|---|
| 3855 | 3855 | GAME( 1991, radmu, radm, system32, radm, radm, ROT0, "Sega", "Rad Mobile (US)", GAME_IMPERFECT_GRAPHICS ) |
| 3856 | 3856 | GAME( 1991, radr, 0, system32, radr, radr, ROT0, "Sega", "Rad Rally (World)", GAME_IMPERFECT_GRAPHICS ) |
| 3857 | 3857 | GAME( 1991, radru, radr, system32, radr, radr, ROT0, "Sega", "Rad Rally (US)", GAME_IMPERFECT_GRAPHICS ) |
| 3858 | GAME( 1995, slipstrm, 0, system32, slipstrm, slipstrm, ROT0, "Capcom", "Slipstream", GAME_IMPERFECT_GRAPHICS ) | |
| 3858 | GAME( 1995, slipstrm, 0, system32, slipstrm, slipstrm, ROT0, "Capcom", "Slipstream (Brazil 950515)", GAME_IMPERFECT_GRAPHICS ) | |
| 3859 | 3859 | GAME( 1992, sonic, 0, system32, sonic, sonic, ROT0, "Sega", "SegaSonic The Hedgehog (Japan, rev. C)", GAME_IMPERFECT_GRAPHICS ) |
| 3860 | 3860 | GAME( 1992, sonicp, sonic, system32, sonic, sonicp, ROT0, "Sega", "SegaSonic The Hedgehog (Japan, prototype)", GAME_IMPERFECT_GRAPHICS ) |
| 3861 | 3861 | GAME( 1991, spidman, 0, system32, spidman, spidman, ROT0, "Sega", "Spider-Man: The Videogame (World)", GAME_IMPERFECT_GRAPHICS ) |
| r814 | r815 | |
|---|---|---|
| 71 | 71 | { |
| 72 | 72 | int tileno; |
| 73 | 73 | tileno = k3_bgram[tile_index]; |
| 74 | SET_TILE_INFO(1,tileno,0,0) | |
| 74 | SET_TILE_INFO(1,tileno,0,0); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | VIDEO_START(k3) |
| 78 | 78 | { |
| 79 | k3_bg_tilemap = tilemap_create(get_k3_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 79 | k3_bg_tilemap = tilemap_create(get_k3_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r814 | r815 | |
|---|---|---|
| 136 | 136 | VIDEO_START( darkhors ) |
| 137 | 137 | { |
| 138 | 138 | darkhors_tmap = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 139 | TILEMAP_TYPE_ | |
| 139 | TILEMAP_TYPE_ | |
| 140 | 140 | |
| 141 | 141 | darkhors_tmap2 = tilemap_create( get_tile_info_1, tilemap_scan_rows, |
| 142 | TILEMAP_TYPE_ | |
| 142 | TILEMAP_TYPE_ | |
| 143 | 143 | |
| 144 | 144 | tilemap_set_transparent_pen(darkhors_tmap, 0); |
| 145 | 145 | tilemap_set_transparent_pen(darkhors_tmap2, 0); |
| r814 | r815 | |
| 166 | 166 | |
| 167 | 167 | tilemap_set_scrollx(darkhors_tmap,0, (darkhors_tmapscroll[0] >> 16) - 5); |
| 168 | 168 | tilemap_set_scrolly(darkhors_tmap,0, (darkhors_tmapscroll[0] & 0xffff) - 0xff ); |
| 169 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, darkhors_tmap, TILEMAP_ | |
| 169 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, darkhors_tmap, TILEMAP_D | |
| 170 | 170 | |
| 171 | 171 | tilemap_set_scrollx(darkhors_tmap2,0, (darkhors_tmapscroll2[0] >> 16) - 5); |
| 172 | 172 | tilemap_set_scrolly(darkhors_tmap2,0, (darkhors_tmapscroll2[0] & 0xffff) - 0xff ); |
| r814 | r815 | |
|---|---|---|
| 268 | 268 | static TILE_GET_INFO( get_bg_tile_info ) |
| 269 | 269 | { |
| 270 | 270 | 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); | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | VIDEO_START( jollyjgr ) |
| 275 | 275 | { |
| 276 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 276 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 277 | 277 | |
| 278 | 278 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 279 | 279 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| r814 | r815 | |
|---|---|---|
| 40 | 40 | int tile, mask; |
| 41 | 41 | mTilemapInfo.cb( vram[tile_index], &tile, &mask ); |
| 42 | 42 | 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); | |
| 44 | 44 | } /* get_tile_info */ |
| 45 | 45 | |
| 46 | 46 | static TILE_GET_INFO( get_tile_info0 ) { get_tile_info(machine,tileinfo,tile_index,&mTilemapInfo.videoram[0x0000]); } |
| r814 | r815 | |
| 61 | 61 | mTilemapInfo.videoram = auto_malloc( 0x10000*2 ); |
| 62 | 62 | |
| 63 | 63 | /* 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); | |
| 68 | 68 | |
| 69 | 69 | /* 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); | |
| 72 | 72 | |
| 73 | 73 | /* define offsets for scrolling */ |
| 74 | 74 | for( i=0; i<4; i++ ) |
| r814 | r815 | |
| 1058 | 1058 | roz_get_info( machine,tileinfo,tile_index,1 ); |
| 1059 | 1059 | } /* roz_get_info1 */ |
| 1060 | 1060 | |
| 1061 | static UINT32 | |
| 1062 | namco_roz_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ) | |
| 1061 | static | |
| 1062 | TILEMAP_MAPPER( namco_roz_scan ) | |
| 1063 | 1063 | { |
| 1064 | 1064 | if( col>=128 ) |
| 1065 | 1065 | { |
| r814 | r815 | |
| 1073 | 1073 | namco_roz_init( int gfxbank, int maskregion ) |
| 1074 | 1074 | { |
| 1075 | 1075 | int i; |
| 1076 | static tile_get_info_ | |
| 1076 | static tile_get_info_callback roz_info[ROZ_TILEMAP_COUNT] = | |
| 1077 | 1077 | { |
| 1078 | 1078 | roz_get_info0, |
| 1079 | 1079 | roz_get_info1 |
| r814 | r815 | |
| 1091 | 1091 | mRozTilemap[i] = tilemap_create( |
| 1092 | 1092 | roz_info[i], |
| 1093 | 1093 | namco_roz_scan, |
| 1094 | TILEMAP_TYPE_ | |
| 1094 | TILEMAP_TYPE_PEN | |
| 1095 | 1095 | 16,16, |
| 1096 | 1096 | 256,256 ); |
| 1097 | 1097 | } |
| r814 | r815 | |
| 1178 | 1178 | { |
| 1179 | 1179 | UINT32 size_mask = rozInfo->size-1; |
| 1180 | 1180 | mame_bitmap *srcbitmap = tilemap_get_pixmap( tmap ); |
| 1181 | mame_bitmap * | |
| 1181 | mame_bitmap *flags | |
| 1182 | 1182 | UINT32 startx = rozInfo->startx + clip->min_x * rozInfo->incxx + clip->min_y * rozInfo->incyx; |
| 1183 | 1183 | UINT32 starty = rozInfo->starty + clip->min_x * rozInfo->incxy + clip->min_y * rozInfo->incyy; |
| 1184 | 1184 | int sx = clip->min_x; |
| r814 | r815 | |
| 1193 | 1193 | { |
| 1194 | 1194 | UINT32 xpos = (((cx>>16)&size_mask) + rozInfo->left)&0xfff; |
| 1195 | 1195 | UINT32 ypos = (((cy>>16)&size_mask) + rozInfo->top)&0xfff; |
| 1196 | if( *BITMAP_ADDR8( | |
| 1196 | if( *BITMAP_ADDR8(flags | |
| 1197 | 1197 | { |
| 1198 | 1198 | *dest = *BITMAP_ADDR16(srcbitmap,ypos,xpos)+rozInfo->color; |
| 1199 | 1199 | } |
| r814 | r815 | |
| 1508 | 1508 | int tile = (data&0x3ff); |
| 1509 | 1509 | int color = (data>>10); |
| 1510 | 1510 | |
| 1511 | SET_TILE_INFO( mRoadGfxBank, tile, color , 0 ) | |
| 1511 | SET_TILE_INFO( mRoadGfxBank, tile, color , 0 ); | |
| 1512 | 1512 | } /* get_road_info */ |
| 1513 | 1513 | |
| 1514 | 1514 | READ16_HANDLER( namco_road16_r ) |
| r814 | r815 | |
| 1583 | 1583 | machine->gfx[gfxbank] = pGfx; |
| 1584 | 1584 | mpRoadTilemap = tilemap_create( |
| 1585 | 1585 | get_road_info,tilemap_scan_rows, |
| 1586 | TILEMAP_TYPE_ | |
| 1586 | TILEMAP_TYPE_ | |
| 1587 | 1587 | ROAD_TILE_SIZE,ROAD_TILE_SIZE, |
| 1588 | 1588 | ROAD_COLS,ROAD_ROWS); |
| 1589 | 1589 |
| r814 | r815 | |
|---|---|---|
| 338 | 338 | { |
| 339 | 339 | int code = bgram[tile_index]+((bgram[tile_index+0x400]&(1<<3))<<(8-3)); |
| 340 | 340 | |
| 341 | SET_TILE_INFO(2, code, 0, 0) | |
| 341 | SET_TILE_INFO(2, code, 0, 0); | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | VIDEO_START( ddayjlc ) |
| 345 | 345 | { |
| 346 | bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 346 | bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | VIDEO_UPDATE( ddayjlc ) |
| r814 | r815 | |
|---|---|---|
| 102 | 102 | int code = statriv2_videoram[0x400+tile_index]; |
| 103 | 103 | int attr = statriv2_videoram[tile_index] & 0x3f; |
| 104 | 104 | |
| 105 | SET_TILE_INFO(0, code, attr, 0) | |
| 105 | SET_TILE_INFO(0, code, attr, 0); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| r814 | r815 | |
| 115 | 115 | |
| 116 | 116 | VIDEO_START (statriv2) |
| 117 | 117 | { |
| 118 | statriv2_tilemap = tilemap_create(get_statriv2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 118 | statriv2_tilemap = tilemap_create(get_statriv2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | VIDEO_UPDATE (statriv2) |
| r814 | r815 | |
|---|---|---|
| 107 | 107 | // code += 0; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | SET_TILE_INFO(0, code, colour, 0) | |
| 110 | SET_TILE_INFO(0, code, colour, 0); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | READ8_HANDLER( egghunt_bgram_r ) |
| r814 | r815 | |
| 144 | 144 | |
| 145 | 145 | VIDEO_START(egghunt) |
| 146 | 146 | { |
| 147 | bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 147 | bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 148 | 148 | egghunt_bgram = auto_malloc(0x1000); |
| 149 | 149 | egghunt_spram = auto_malloc(0x1000); |
| 150 | 150 | } |
| r814 | r815 | |
|---|---|---|
| 59 | 59 | static UINT16 *ac_txvram,*ac_bgvram; |
| 60 | 60 | static UINT16 *ac_vregs; |
| 61 | 61 | |
| 62 | static | |
| 62 | static | |
| 63 | 63 | { |
| 64 | 64 | /* logical (col,row) -> memory offset */ |
| 65 | 65 | return (row & 0x0f) + ((col & 0xff) << 4) + ((row & 0x70) << 8); |
| r814 | r815 | |
| 72 | 72 | 1, |
| 73 | 73 | code & 0xfff, |
| 74 | 74 | (code & 0xf000) >> 12, |
| 75 | 0) | |
| 75 | 0); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static TILE_GET_INFO( ac_get_tx_tile_info ) |
| r814 | r815 | |
| 82 | 82 | 0, |
| 83 | 83 | code & 0xfff, |
| 84 | 84 | (code & 0xf000) >> 12, |
| 85 | 0) | |
| 85 | 0); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int priority, int pri_mask) |
| r814 | r815 | |
| 147 | 147 | |
| 148 | 148 | VIDEO_START( acommand ) |
| 149 | 149 | { |
| 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); | |
| 152 | 152 | |
| 153 | 153 | ac_vregs = auto_malloc(0x80); |
| 154 | 154 |
| r814 | r815 | |
|---|---|---|
| 316 | 316 | 0, |
| 317 | 317 | code & 0x0fff, |
| 318 | 318 | (code & 0xf000) >> 12, |
| 319 | 0) | |
| 319 | 0); | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | static TILE_GET_INFO( get_ppmast93_fg_tile_info ) |
| r814 | r815 | |
| 326 | 326 | 0, |
| 327 | 327 | (code & 0x0fff)+0x1000, |
| 328 | 328 | (code & 0xf000) >> 12, |
| 329 | 0) | |
| 329 | 0); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | VIDEO_START( ppmast93 ) |
| 333 | 333 | { |
| 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); | |
| 336 | 336 | |
| 337 | 337 | tilemap_set_transparent_pen(ppmast93_fg_tilemap,0); |
| 338 | 338 | } |
| r814 | r815 | |
|---|---|---|
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | 99 | |
| 100 | static | |
| 100 | static | |
| 101 | 101 | { |
| 102 | 102 | /* logical (col,row) -> memory offset */ |
| 103 | 103 | int width = K001604_layer_size ? 256 : 128; |
| 104 | 104 | return K001604_tilemap_offset + (row * width) + col; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | static | |
| 107 | static | |
| 108 | 108 | { |
| 109 | 109 | /* logical (col,row) -> memory offset */ |
| 110 | 110 | int width = K001604_layer_size ? 256 : 128; |
| 111 | 111 | return K001604_tilemap_offset + (row * width) + col + 64; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | static | |
| 114 | static | |
| 115 | 115 | { |
| 116 | 116 | /* logical (col,row) -> memory offset */ |
| 117 | 117 | int width = K001604_layer_size ? 256 : 128; |
| 118 | 118 | return (row * width) + col + (K001604_layer_size ? 128 : 0); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | static | |
| 121 | static | |
| 122 | 122 | { |
| 123 | 123 | /* logical (col,row) -> memory offset */ |
| 124 | 124 | int width = K001604_layer_size ? 256 : 128; |
| r814 | r815 | |
| 246 | 246 | { |
| 247 | 247 | int roz_tile_size = K001604_roz_size[chip] ? 16 : 8; |
| 248 | 248 | 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); | |
| 251 | 251 | |
| 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); | |
| 254 | 254 | } |
| 255 | 255 | else |
| 256 | 256 | { |
| 257 | 257 | int roz_tile_size = K001604_roz_size[chip] ? 16 : 8; |
| 258 | 258 | 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); | |
| 261 | 261 | |
| 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); | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | tilemap_set_transparent_pen(K001604_layer_8x8[chip][0], 0); |
| r814 | r815 | |
|---|---|---|
| 187 | 187 | int tile = pkscramble_bgtilemap_ram[tile_index*2]; |
| 188 | 188 | int color = pkscramble_bgtilemap_ram[tile_index*2 + 1] & 0x7f; |
| 189 | 189 | |
| 190 | SET_TILE_INFO(0,tile,color,0) | |
| 190 | SET_TILE_INFO(0,tile,color,0); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | static TILE_GET_INFO( get_md_tile_info ) |
| r814 | r815 | |
| 195 | 195 | int tile = pkscramble_mdtilemap_ram[tile_index*2]; |
| 196 | 196 | int color = pkscramble_mdtilemap_ram[tile_index*2 + 1] & 0x7f; |
| 197 | 197 | |
| 198 | SET_TILE_INFO(0,tile,color,0) | |
| 198 | SET_TILE_INFO(0,tile,color,0); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | static TILE_GET_INFO( get_fg_tile_info ) |
| r814 | r815 | |
| 203 | 203 | int tile = pkscramble_fgtilemap_ram[tile_index*2]; |
| 204 | 204 | int color = pkscramble_fgtilemap_ram[tile_index*2 + 1] & 0x7f; |
| 205 | 205 | |
| 206 | SET_TILE_INFO(0,tile,color,0) | |
| 206 | SET_TILE_INFO(0,tile,color,0); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | static TIMER_CALLBACK( scanline_callback ) |
| r814 | r815 | |
| 226 | 226 | |
| 227 | 227 | VIDEO_START( pkscramble ) |
| 228 | 228 | { |
| 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); | |
| 232 | 232 | |
| 233 | 233 | tilemap_set_transparent_pen(md_tilemap,15); |
| 234 | 234 | tilemap_set_transparent_pen(fg_tilemap,15); |
| r814 | r815 | |
|---|---|---|
| 15 | 15 | { |
| 16 | 16 | UINT8 code = cball_video_ram[tile_index]; |
| 17 | 17 | |
| 18 | SET_TILE_INFO(0, code, code >> 7, 0) | |
| 18 | SET_TILE_INFO(0, code, code >> 7, 0); | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | |
| r814 | r815 | |
| 28 | 28 | |
| 29 | 29 | static VIDEO_START( cball ) |
| 30 | 30 | { |
| 31 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 31 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 |
| r814 | r815 | |
|---|---|---|
| 48 | 48 | int code = videoram[tile_index]; |
| 49 | 49 | int color = attr; |
| 50 | 50 | |
| 51 | SET_TILE_INFO(0, code, color, 0) | |
| 51 | SET_TILE_INFO(0, code, color, 0); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | VIDEO_START(cm2) |
| 55 | 55 | { |
| 56 | 56 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 57 | TILEMAP_TYPE_ | |
| 57 | TILEMAP_TYPE_ | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | VIDEO_UPDATE(cm2) |
| r814 | r815 | |
|---|---|---|
| 131 | 131 | 1, |
| 132 | 132 | (data&0x7ff), |
| 133 | 133 | data>>11, |
| 134 | 0) | |
| 134 | 0); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| r814 | r815 | |
| 142 | 142 | 2, |
| 143 | 143 | (data&0x3ff), |
| 144 | 144 | data>>11, |
| 145 | 0) | |
| 145 | 0); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | static TILE_GET_INFO( get_tx_tile_info ) |
| r814 | r815 | |
| 156 | 156 | 0, |
| 157 | 157 | tile_number + 256 * (attributes & 0x3), |
| 158 | 158 | attributes >> 4, |
| 159 | 0) | |
| 159 | 0); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | static VIDEO_START( bigfghtr ) |
| 163 | 163 | { |
| 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); | |
| 167 | 167 | |
| 168 | 168 | tilemap_set_transparent_pen(fg_tilemap,0xf); |
| 169 | 169 | tilemap_set_transparent_pen(tx_tilemap,0xf); |
| r814 | r815 | |
|---|---|---|
| 253 | 253 | flag = TILE_FLIPXY((attr & 0x06) >> 1); |
| 254 | 254 | |
| 255 | 255 | if((~attr & 0x20) || (~attr & 0x40)) |
| 256 | flag |= TILE_ | |
| 256 | flag |= TILE_F | |
| 257 | 257 | |
| 258 | 258 | //0x20? tile transparent pen 1? |
| 259 | 259 | //0x40? tile transparent pen 1? |
| 260 | 260 | |
| 261 | SET_TILE_INFO(0,tile,color,flag) | |
| 261 | SET_TILE_INFO(0,tile,color,flag); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | VIDEO_START( trvmadns ) |
| 265 | 265 | { |
| 266 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 266 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_ | |
| 267 | 267 | |
| 268 | 268 | tilemap_set_transparent_pen(bg_tilemap,1); |
| 269 | 269 | } |
| r814 | r815 | |
|---|---|---|
| 136 | 136 | tileno >>=(1+tilesize*2); |
| 137 | 137 | colour&=0x0f; |
| 138 | 138 | colour+=0x20; |
| 139 | SET_TILE_INFO(6+tilesize,tileno,colour,TILE_FLIPXY(flipxy)) | |
| 139 | SET_TILE_INFO(6+tilesize,tileno,colour,TILE_FLIPXY(flipxy)); | |
| 140 | 140 | } |
| 141 | 141 | else |
| 142 | 142 | { |
| 143 | 143 | tileno >>=(0+tilesize*2); |
| 144 | 144 | colour+=0x200; |
| 145 | 145 | 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)); | |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| r814 | r815 | |
| 344 | 344 | memset(rabbit_tilemap_ram[2], 0, 0x20000); |
| 345 | 345 | memset(rabbit_tilemap_ram[3], 0, 0x20000); |
| 346 | 346 | |
| 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); | |
| 351 | 351 | tilemap_set_transparent_pen(rabbit_tilemap[0],0x0); |
| 352 | 352 | tilemap_set_transparent_pen(rabbit_tilemap[1],0x0); |
| 353 | 353 | tilemap_set_transparent_pen(rabbit_tilemap[2],0x0); |
| r814 | r815 | |
| 401 | 401 | tilemap_draw_roz(bitmap,cliprect,rabbit_tilemap[whichtilemap],startx << 12,starty << 12, |
| 402 | 402 | incxx << 5,incxy << 8,incyx << 8,incyy << 5, |
| 403 | 403 | 1, /* wraparound */ |
| 404 | tran ? 0 : TILEMAP_ | |
| 404 | tran ? 0 : TILEMAP_D | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | VIDEO_UPDATE(rabbit) |
| r814 | r815 | |
| 1136 | 1136 | memset(rabbit_tilemap_ram[2], 0, 0x20000); |
| 1137 | 1137 | memset(rabbit_tilemap_ram[3], 0, 0x20000); |
| 1138 | 1138 | |
| 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); | |
| 1143 | 1143 | tilemap_set_transparent_pen(rabbit_tilemap[0],0x0); |
| 1144 | 1144 | tilemap_set_transparent_pen(rabbit_tilemap[1],0x0); |
| 1145 | 1145 | tilemap_set_transparent_pen(rabbit_tilemap[2],0x0); |
| r814 | r815 | |
|---|---|---|
| 68 | 68 | int code = videoram[tile_index] + ((attr & 0x0f) << 8); |
| 69 | 69 | int color = (attr & 0xf0) >> 4; |
| 70 | 70 | |
| 71 | SET_TILE_INFO(0, code, color, 0) | |
| 71 | SET_TILE_INFO(0, code, color, 0); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | #if 0 |
| r814 | r815 | |
| 99 | 99 | VIDEO_START(cm) |
| 100 | 100 | { |
| 101 | 101 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 102 | TILEMAP_TYPE_ | |
| 102 | TILEMAP_TYPE_ | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | VIDEO_UPDATE(cm) |
| r814 | r815 | |
|---|---|---|
| 1518 | 1518 | ROM_LOAD16_BYTE( "mpr13789.12a", 0x400000, 0x80000, CRC(09ba8835) SHA1(72e83dd1793a7f4b2b881e71f262493e3d4992b3) ) |
| 1519 | 1519 | |
| 1520 | 1520 | 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) ) | |
| 1524 | 1524 | ROM_END |
| 1525 | 1525 | |
| 1526 | 1526 | /************************************************************************************************************************** |
| r814 | r815 | |
| 1556 | 1556 | |
| 1557 | 1557 | ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* sound CPU */ |
| 1558 | 1558 | /* 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) ) | |
| 1562 | 1562 | ROM_END |
| 1563 | 1563 | |
| 1564 | 1564 | |
| r814 | r815 | |
| 1571 | 1571 | */ |
| 1572 | 1572 | ROM_START( ddcrew ) |
| 1573 | 1573 | 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) ) | |
| 1576 | 1576 | ROM_LOAD16_BYTE( "mpr-14139.5a", 0x200000, 0x40000, CRC(06c31531) SHA1(d084cb72bf83578b34e959bb60a0695faf4161f8) ) |
| 1577 | 1577 | ROM_LOAD16_BYTE( "mpr-14141.7a", 0x200001, 0x40000, CRC(080a494b) SHA1(64522dccbf6ed856ab80aa185454183df87d7ae9) ) |
| 1578 | 1578 | |
| r814 | r815 | |
| 1595 | 1595 | ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) ) |
| 1596 | 1596 | |
| 1597 | 1597 | 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) ) | |
| 1602 | 1602 | ROM_END |
| 1603 | 1603 | |
| 1604 | 1604 | /************************************************************************************************************************** |
| r814 | r815 | |
| 1608 | 1608 | */ |
| 1609 | 1609 | ROM_START( ddcrewu ) |
| 1610 | 1610 | 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) ) | |
| 1613 | 1613 | ROM_LOAD16_BYTE( "mpr-14139.5a", 0x200000, 0x40000, CRC(06c31531) SHA1(d084cb72bf83578b34e959bb60a0695faf4161f8) ) |
| 1614 | 1614 | ROM_LOAD16_BYTE( "mpr-14141.7a", 0x200001, 0x40000, CRC(080a494b) SHA1(64522dccbf6ed856ab80aa185454183df87d7ae9) ) |
| 1615 | 1615 | |
| r814 | r815 | |
| 1632 | 1632 | ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) ) |
| 1633 | 1633 | |
| 1634 | 1634 | 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) ) | |
| 1639 | 1639 | ROM_END |
| 1640 | 1640 | |
| 1641 | 1641 | /************************************************************************************************************************** |
| r814 | r815 | |
| 1645 | 1645 | */ |
| 1646 | 1646 | ROM_START( ddcrew2 ) |
| 1647 | 1647 | 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) ) | |
| 1650 | 1650 | ROM_LOAD16_BYTE( "mpr-14139.5a", 0x200000, 0x40000, CRC(06c31531) SHA1(d084cb72bf83578b34e959bb60a0695faf4161f8) ) |
| 1651 | 1651 | ROM_LOAD16_BYTE( "mpr-14141.7a", 0x200001, 0x40000, CRC(080a494b) SHA1(64522dccbf6ed856ab80aa185454183df87d7ae9) ) |
| 1652 | 1652 | |
| r814 | r815 | |
| 1669 | 1669 | ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) ) |
| 1670 | 1670 | |
| 1671 | 1671 | 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) ) | |
| 1676 | 1676 | ROM_END |
| 1677 | 1677 | |
| 1678 | 1678 | /************************************************************************************************************************** |
| 1679 | 1679 | 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) | |
| 1682 | 1683 | */ |
| 1683 | 1684 | ROM_START( ddcrew1 ) |
| 1684 | 1685 | 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) ) | |
| 1687 | 1688 | ROM_LOAD16_BYTE( "mpr-14139.5a", 0x200000, 0x40000, CRC(06c31531) SHA1(d084cb72bf83578b34e959bb60a0695faf4161f8) ) |
| 1688 | 1689 | ROM_LOAD16_BYTE( "mpr-14141.7a", 0x200001, 0x40000, CRC(080a494b) SHA1(64522dccbf6ed856ab80aa185454183df87d7ae9) ) |
| 1689 | 1690 | |
| 1690 | 1691 | ROM_REGION( 0x2000, REGION_USER1, 0 ) /* decryption key */ |
| 1691 | ROM_LOAD( "317- | |
| 1692 | ROM_LOAD( "317-0187 | |
| 1692 | 1693 | |
| 1693 | 1694 | ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */ |
| 1694 | 1695 | ROM_LOAD( "epr-14127.1c", 0x00000, 0x40000, CRC(2228cd88) SHA1(5774bb6a401c3da05c5f3c9d3996b20bb3713cb2) ) |
| r814 | r815 | |
| 1706 | 1707 | ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) ) |
| 1707 | 1708 | |
| 1708 | 1709 | 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) ) | |
| 1713 | 1714 | ROM_END |
| 1714 | 1715 | |
| 1715 | 1716 | /************************************************************************************************************************** |
| r814 | r815 | |
| 1743 | 1744 | ROM_LOAD16_BYTE( "epr-14145.13a", 0x600000, 0x80000, CRC(0e76c797) SHA1(9a44dc948e84e5acac36e80105c2349ee78e6cfa) ) |
| 1744 | 1745 | |
| 1745 | 1746 | 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) ) | |
| 1750 | 1751 | ROM_END |
| 1751 | 1752 | |
| 1752 | 1753 | |
| r814 | r815 | |
| 2250 | 2251 | GAME( 1991, ddcrew, 0, system18, ddcrew, ddcrew, ROT0, "Sega", "D. D. Crew (set 4, World, 3 Player, FD1094 317-0190)", 0 ) |
| 2251 | 2252 | GAME( 1991, ddcrewu, ddcrew, system18, ddcrew, ddcrew, ROT0, "Sega", "D. D. Crew (set 3, US, 4 Player, FD1094 317-0186)", 0 ) |
| 2252 | 2253 | GAME( 1991, ddcrew2, ddcrew, system18, ddcrew2p, ddcrew, ROT0, "Sega", "D. D. Crew (set 2, World, 2 Player, FD1094 317-0184)", 0 ) |
| 2253 | GAME( 1991, ddcrew1, ddcrew, system18, ddcrew, ddcrew, ROT0, "Sega", "D. D. Crew (set 1, World, 4 Player, FD1094 317- | |
| 2254 | GAME( 1991, ddcrew1, ddcrew, system18, ddcrew, ddcrew, ROT0, "Sega", "D. D. Crew (set 1, World, 4 Player, FD1094 317-0187)", 0 ) | |
| 2254 | 2255 | GAME( 1991, ddcrewj, ddcrew, system18, ddcrew2p, ddcrew, ROT0, "Sega", "D. D. Crew (set 5, Japan, 2 Player, FD1094 317-0182)", 0 ) |
| 2255 | 2256 | GAME( 1990, lghost, 0, system18, lghost, lghost, ROT0, "Sega", "Laser Ghost (set 2, World, 317-0166)", 0 ) |
| 2256 | 2257 | GAME( 1990, lghostu, lghost, system18, lghost, lghost, ROT0, "Sega", "Laser Ghost (set 1, US, 317-0165)", 0 ) |
| r814 | r815 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | tileno += (colour & 0x80) << 1; |
| 33 | 33 | |
| 34 | SET_TILE_INFO(0,tileno,0,0) | |
| 34 | SET_TILE_INFO(0,tileno,0,0); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | VIDEO_START(ltcasino) |
| 38 | 38 | { |
| 39 | ltcasino_tilemap = tilemap_create(get_ltcasino_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 39 | ltcasino_tilemap = tilemap_create(get_ltcasino_tile_info,tilemap_scan_rows,TILEMAP_TYPE_ | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 |
| r814 | r815 | |
|---|---|---|
| 21 | 21 | 87 Mahjong Diplomat D0706088L1-0 Dynax |
| 22 | 22 | 87 Mahjong Studio 101 D1708228L1 Dynax |
| 23 | 23 | 87 Tonton D0908288L1-0 Dynax |
| 24 | 88 Mahjong Almond Pinky D1401128L-0 Dynax | |
| 24 | 25 | 89 Mahjong Derringer D2203018L Dynax Larger palette |
| 25 | 26 | 90 Mahjong If..? D29? Dynax Larger palette, TLCS-90 CPU |
| 26 | 27 | 95 Mahjong Tensinhai D10010318L1 Dynax Real Time Clock, TLCS-90 CPU |
| r814 | r815 | |
| 29 | 30 | |
| 30 | 31 | TODO: |
| 31 | 32 | |
| 32 | - dip switches and inputs in dondenmj, suzume, mjderngr... | |
| 33 | - dip switches and inputs in dondenmj, suzume, mjapinky, mjderngr... | |
| 33 | 34 | |
| 34 | 35 | - there's something fishy with the bank switching in tontonb/mjdiplob |
| 35 | 36 | |
| r814 | r815 | |
| 37 | 38 | |
| 38 | 39 | - mjtensin: random crashes, interrupts related |
| 39 | 40 | |
| 41 | ||
| 40 | 42 | Stephh's notes (based on the games Z80 code and some tests) : |
| 41 | 43 | |
| 42 | 44 | 1) 'royalmah' |
| r814 | r815 | |
| 73 | 75 | - janptr96: in service mode press in sequence N,Ron,Ron,N to access some |
| 74 | 76 | hidden options. (thanks bnathan) |
| 75 | 77 | |
| 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 | ||
| 76 | 88 | ****************************************************************************/ |
| 77 | 89 | |
| 78 | 90 | #include "driver.h" |
| r814 | r815 | |
| 456 | 468 | AM_RANGE(0x00, 0x00) AM_WRITE(dynax_bank_w) |
| 457 | 469 | ADDRESS_MAP_END |
| 458 | 470 | |
| 471 | static 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? | |
| 478 | ADDRESS_MAP_END | |
| 479 | ||
| 480 | static 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) | |
| 487 | ADDRESS_MAP_END | |
| 488 | ||
| 459 | 489 | static ADDRESS_MAP_START( mjderngr_readport, ADDRESS_SPACE_IO, 8 ) |
| 460 | 490 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 461 | 491 | AM_RANGE(0x01, 0x01) AM_READ(AY8910_read_port_0_r) |
| r814 | r815 | |
| 1600 | 1630 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1601 | 1631 | INPUT_PORTS_END |
| 1602 | 1632 | |
| 1633 | static INPUT_PORTS_START( mjapinky ) | |
| 1634 | INPUT_PORTS_END | |
| 1635 | ||
| 1603 | 1636 | static INPUT_PORTS_START( janptr96 ) |
| 1604 | 1637 | PORT_START /* P1 IN0 */ |
| 1605 | 1638 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) |
| r814 | r815 | |
| 2247 | 2280 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 2248 | 2281 | INPUT_PORTS_END |
| 2249 | 2282 | |
| 2250 | ||
| 2251 | 2283 | static struct AY8910interface ay8910_interface = |
| 2252 | 2284 | { |
| 2253 | 2285 | royalmah_player_1_port_r, |
| r814 | r815 | |
| 2418 | 2450 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) |
| 2419 | 2451 | MACHINE_DRIVER_END |
| 2420 | 2452 | |
| 2453 | static 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) | |
| 2458 | MACHINE_DRIVER_END | |
| 2421 | 2459 | |
| 2460 | ||
| 2422 | 2461 | /*************************************************************************** |
| 2423 | 2462 | |
| 2424 | 2463 | Game driver(s) |
| r814 | r815 | |
| 2684 | 2723 | ROM_LOAD( "d100-1.6e", 0x200, 0x200, CRC(88befd59) SHA1(cbcb437f9f6b5e542dc69f5c9e85ccbae47080af) ) |
| 2685 | 2724 | ROM_END |
| 2686 | 2725 | |
| 2726 | /*************************************************************************** | |
| 2727 | ||
| 2728 | Mahjong Almond Pinky | |
| 2729 | (c)1988 Dynax | |
| 2730 | Modified Royal Mahjong PCB | |
| 2731 | D1401128L-0 (Sub PCB) | |
| 2732 | ||
| 2733 | CPU: Z80 | |
| 2734 | Sound: AY-3-8910 | |
| 2735 | ||
| 2736 | ROMs: | |
| 2737 | 141.4D [0c4fb83a] | |
| 2738 | 142.4E [129806f0] | |
| 2739 | 143.4F [3d0bc452] | |
| 2740 | 144.4H [24509a18] | |
| 2741 | 145.4J [fea3375a] | |
| 2742 | 146.4K [be27a9b9] | |
| 2743 | ||
| 2744 | 18S030N.CLR [5736d0aa] | |
| 2745 | ||
| 2746 | ***************************************************************************/ | |
| 2747 | ||
| 2748 | ROM_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) ) | |
| 2761 | ROM_END | |
| 2762 | ||
| 2687 | 2763 | static DRIVER_INIT( janptr96 ) |
| 2688 | 2764 | { |
| 2689 | 2765 | generic_nvram_size = 0x1000 * 9; |
| r814 | r815 | |
| 2694 | 2770 | |
| 2695 | 2771 | |
| 2696 | 2772 | |
| 2697 | GAME( 1982, royalmah, 0, royalmah, royalmah, 0, ROT0, "Falcon", "Royal Mahjong (Japan)", 0 ) | |
| 2698 | GAME( 1986, dondenmj, 0, dondenmj, majs101b, 0, ROT0, "Dyna Electronics", "Don Den Mahjong [BET] (Japan)", 0 ) | |
| 2699 | GAME( 1986, suzume, 0, suzume, suzume, 0, ROT0, "Dyna Electronics", "Watashiha Suzumechan (Japan)", 0 ) | |
| 2700 | GAME( 1987, mjdiplob, 0, mjdiplob, mjdiplob, 0, ROT0, "Dynax", "Mahjong Diplomat [BET] (Japan)", 0 ) | |
| 2701 | GAME( 1987, tontonb, 0, tontonb, tontonb, 0, ROT0, "Dynax", "Tonton [BET] (Japan)", 0 ) | |
| 2702 | GAME( 1988, majs101b, 0, majs101b, majs101b, 0, ROT0, "Dynax", "Mahjong Studio 101 [BET] (Japan)", 0 ) | |
| 2703 | GAME( 1989, mjderngr, 0, mjderngr, majs101b, 0, ROT0, "Dynax", "Mahjong Derringer (Japan)", 0 ) | |
| 2704 | GAME( 1990, mjifb, 0, mjifb, mjifb, 0, ROT0, "Dynax", "Mahjong If...? [BET]", 0 ) | |
| 2705 | GAME( 1995, mjtensin, 0, mjtensin, mjtensin, 0, ROT0, "Dynax", "Mahjong Tensinhai (Japan)", GAME_NOT_WORKING ) | |
| 2706 | GAME( 1996, janptr96, 0, janptr96, janptr96, janptr96, ROT0, "Dynax", "Janputer '96 (Japan)", 0 ) | |
| 2773 | GAME( 1982, royalmah, 0, royalmah, royalmah, 0, ROT0, "Falcon", "Royal Mahjong (Japan)", 0 ) | |
| 2774 | GAME( 1986, dondenmj, 0, dondenmj, majs101b, 0, ROT0, "Dyna Electronics", "Don Den Mahjong [BET] (Japan)", 0 ) | |
| 2775 | GAME( 1986, suzume, 0, suzume, suzume, 0, ROT0, "Dyna Electronics", "Watashiha Suzumechan (Japan)", 0 ) | |
| 2776 | GAME( 1987, mjdiplob, 0, mjdiplob, mjdiplob, 0, ROT0, "Dynax", "Mahjong Diplomat [BET] (Japan)", 0 ) | |
| 2777 | GAME( 1987, tontonb, 0, tontonb, tontonb, 0, ROT0, "Dynax", "Tonton [BET] (Japan)", 0 ) | |
| 2778 | GAME( 1988, majs101b, 0, majs101b, majs101b, 0, ROT0, "Dynax", "Mahjong Studio 101 [BET] (Japan)", 0 ) | |
| 2779 | GAME( 1988, mjapinky, 0, mjapinky, mjapinky, 0, ROT0, "Dynax", "Mahjong Almond Pinky [BET] (Japan)", GAME_NOT_WORKING ) | |
| 2780 | GAME( 1989, mjderngr, 0, mjderngr, majs101b, 0, ROT0, "Dynax", "Mahjong Derringer (Japan)", 0 ) | |
| 2781 | GAME( 1990, mjifb, 0, mjifb, mjifb, 0, ROT0, "Dynax", "Mahjong If...? [BET]", 0 ) | |
| 2782 | GAME( 1995, mjtensin, 0, mjtensin, mjtensin, 0, ROT0, "Dynax", "Mahjong Tensinhai (Japan)", GAME_NOT_WORKING ) | |
| 2783 | GAME( 1996, janptr96, 0, janptr96, janptr96, janptr96, ROT0, "Dynax", "Janputer '96 (Japan)", 0 ) |
| r814 | r815 | |
|---|---|---|
| 162 | 162 | if (bank == 1) /* temporary hack to point to the 3rd gfx bank */ |
| 163 | 163 | bank = 2; |
| 164 | 164 | |
| 165 | SET_TILE_INFO(bank, code, color, 0) | |
| 165 | SET_TILE_INFO(bank, code, color, 0); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | VIDEO_START( miniboy7 ) |
| 169 | 169 | { |
| 170 | 170 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 171 | TILEMAP_TYPE_ | |
| 171 | TILEMAP_TYPE_ | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | VIDEO_UPDATE( miniboy7 ) |
| r814 | r815 | |
|---|---|---|
| 42 | 42 | } \ |
| 43 | 43 | token[j] = '\0'; |
| 44 | 44 | |
| 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'; | |
| 54 | 45 | |
| 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'; | |
| 65 | 46 | |
| 66 | ||
| 67 | ||
| 68 | 47 | /*************************************************************************** |
| 69 | 48 | GLOBAL VARIABLES |
| 70 | 49 | ***************************************************************************/ |
| r814 | r815 | |
| 107 | 86 | chd_error cdrom_parse_toc(const char *tocfname, cdrom_toc *outtoc, cdrom_track_input_info *outinfo) |
| 108 | 87 | { |
| 109 | 88 | FILE *infile; |
| 110 | int i, j, | |
| 89 | int i, j, | |
| 111 | 90 | static char token[128]; |
| 112 | 91 | |
| 113 | 92 | infile = fopen(tocfname, "rt"); |
| r814 | r815 | |
| 153 | 132 | |
| 154 | 133 | /* get either the offset or the length */ |
| 155 | 134 | EATWHITESPACE |
| 135 | TOKENIZE | |
| 156 | 136 | |
| 157 | if ( | |
| 137 | if (token | |
| 158 | 138 | { |
| 159 | 139 | /* 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); | |
| 166 | 141 | } |
| 167 | 142 | else |
| 168 | 143 | { |
| 169 | /* no offset, just M:S:F */ | |
| 170 | outinfo->offset[trknum] = 0; | |
| 171 | TOKENIZETOCOLONINC | |
| 172 | } | |
| 144 | m = 0; | |
| 145 | s = 0; | |
| 146 | f = 0; | |
| 173 | 147 | |
| 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 ); | |
| 180 | 149 | |
| 181 | trycolonagain: | |
| 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 | ||
| 231 | 150 | /* convert to just frames */ |
| 232 | 151 | s += (m * 60); |
| 233 | 152 | f += (s * 75); |
| 153 | ||
| 154 | f *= (outtoc->tracks[trknum].datasize + outtoc->tracks[trknum].subsize); | |
| 234 | 155 | } |
| 235 | 156 | |
| 157 | outinfo->offset[trknum] = f; | |
| 158 | ||
| 236 | 159 | EATWHITESPACE |
| 237 | if (isdigit(linebuffer[i])) | |
| 238 | { | |
| 239 | f *= outtoc->tracks[trknum].datasize; | |
| 160 | TOKENIZE | |
| 240 | 161 | |
| 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])) | |
| 259 | 163 | { |
| 260 | f *= outtoc->tracks[trknum].datasize; | |
| 164 | m = 0; | |
| 165 | s = 0; | |
| 166 | f = 0; | |
| 261 | 167 | |
| 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 | } | |
| 263 | 178 | |
| 264 | f = | |
| 179 | outtoc->tracks[trknum].frames = f; | |
| 265 | 180 | } |
| 266 | ||
| 267 | if (f) | |
| 181 | else if( trknum == 0 ) | |
| 268 | 182 | { |
| 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; | |
| 270 | 186 | } |
| 271 | else | |
| 187 | else | |
| 272 | 188 | { |
| 189 | /* guesstimate the track length */ | |
| 273 | 190 | UINT64 tlen; |
| 274 | ||
| 275 | 191 | 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); |
| 276 | 192 | |
| 277 | 193 | tlen = get_file_size(outinfo->fname[trknum]) - outinfo->offset[trknum]; |
| r814 | r815 | |
|---|---|---|
| 2717 | 2717 | file_error filerr; |
| 2718 | 2718 | chd_interface_file *file; |
| 2719 | 2719 | UINT32 openflags = 0; |
| 2720 | int open_or_create = 0; | |
| 2720 | 2721 | |
| 2721 | 2722 | switch(*mode++) |
| 2722 | 2723 | { |
| r814 | r815 | |
| 2725 | 2726 | if (*mode == 'b') |
| 2726 | 2727 | mode++; |
| 2727 | 2728 | if (*mode == '+') |
| 2728 | openflags |= OPEN_FLAG_WRITE | OPEN_FLAG_CREATE; | |
| 2729 | { | |
| 2730 | openflags |= OPEN_FLAG_WRITE; | |
| 2731 | open_or_create = 1; | |
| 2732 | } | |
| 2729 | 2733 | break; |
| 2730 | 2734 | |
| 2731 | 2735 | case 'w': |
| r814 | r815 | |
| 2745 | 2749 | goto error; |
| 2746 | 2750 | |
| 2747 | 2751 | /* first try to open without creating */ |
| 2748 | filerr = osd_open(filename, openflags | |
| 2752 | filerr = osd_open(filename, openflags | |
| 2749 | 2753 | if (filerr != FILERR_NONE) |
| 2750 | 2754 | { |
| 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); | |
| 2753 | 2757 | if (filerr != FILERR_NONE) |
| 2754 | 2758 | goto error; |
| 2755 | 2759 | } |
| r814 | r815 | |
|---|---|---|
| 1584 | 1584 | current cpu in the specified memory space |
| 1585 | 1585 | -------------------------------------------------*/ |
| 1586 | 1586 | |
| 1587 | UINT8 debug_read_byte(int spacenum, offs_t address) | |
| 1587 | UINT8 debug_read_byte(int spacenum, offs_t address, int apply_translation) | |
| 1588 | 1588 | { |
| 1589 | 1589 | const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()]; |
| 1590 | 1590 | UINT64 custom; |
| r814 | r815 | |
| 1597 | 1597 | memory_set_debugger_access(1); |
| 1598 | 1598 | |
| 1599 | 1599 | /* 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)) | |
| 1601 | 1601 | result = 0xff; |
| 1602 | 1602 | |
| 1603 | 1603 | /* if there is a custom read handler, and it returns TRUE, use that value */ |
| r814 | r815 | |
| 1619 | 1619 | current cpu in the specified memory space |
| 1620 | 1620 | -------------------------------------------------*/ |
| 1621 | 1621 | |
| 1622 | UINT16 debug_read_word(int spacenum, offs_t address) | |
| 1622 | UINT16 debug_read_word(int spacenum, offs_t address, int apply_translation) | |
| 1623 | 1623 | { |
| 1624 | 1624 | const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()]; |
| 1625 | 1625 | UINT64 custom; |
| r814 | r815 | |
| 1631 | 1631 | /* if this is misaligned read, or if there are no word readers, just read two bytes */ |
| 1632 | 1632 | if ((address & 1) || !active_address_space[spacenum].accessors->read_word) |
| 1633 | 1633 | { |
| 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); | |
| 1636 | 1636 | |
| 1637 | 1637 | /* based on the endianness, the result is assembled differently */ |
| 1638 | 1638 | if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) |
| r814 | r815 | |
| 1648 | 1648 | memory_set_debugger_access(1); |
| 1649 | 1649 | |
| 1650 | 1650 | /* 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)) | |
| 1652 | 1652 | result = 0xffff; |
| 1653 | 1653 | |
| 1654 | 1654 | /* if there is a custom read handler, and it returns TRUE, use that value */ |
| r814 | r815 | |
| 1672 | 1672 | current cpu in the specified memory space |
| 1673 | 1673 | -------------------------------------------------*/ |
| 1674 | 1674 | |
| 1675 | UINT32 debug_read_dword(int spacenum, offs_t address) | |
| 1675 | UINT32 debug_read_dword(int spacenum, offs_t address, int apply_translation) | |
| 1676 | 1676 | { |
| 1677 | 1677 | const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()]; |
| 1678 | 1678 | UINT64 custom; |
| r814 | r815 | |
| 1684 | 1684 | /* if this is misaligned read, or if there are no dword readers, just read two words */ |
| 1685 | 1685 | if ((address & 3) || !active_address_space[spacenum].accessors->read_dword) |
| 1686 | 1686 | { |
| 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); | |
| 1689 | 1689 | |
| 1690 | 1690 | /* based on the endianness, the result is assembled differently */ |
| 1691 | 1691 | if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) |
| r814 | r815 | |
| 1701 | 1701 | memory_set_debugger_access(1); |
| 1702 | 1702 | |
| 1703 | 1703 | /* 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)) | |
| 1705 | 1705 | result = 0xffffffff; |
| 1706 | 1706 | |
| 1707 | 1707 | /* if there is a custom read handler, and it returns TRUE, use that value */ |
| r814 | r815 | |
| 1725 | 1725 | current cpu in the specified memory space |
| 1726 | 1726 | -------------------------------------------------*/ |
| 1727 | 1727 | |
| 1728 | UINT64 debug_read_qword(int spacenum, offs_t address) | |
| 1728 | UINT64 debug_read_qword(int spacenum, offs_t address, int apply_translation) | |
| 1729 | 1729 | { |
| 1730 | 1730 | const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()]; |
| 1731 | 1731 | UINT64 custom; |
| r814 | r815 | |
| 1737 | 1737 | /* if this is misaligned read, or if there are no qword readers, just read two dwords */ |
| 1738 | 1738 | if ((address & 7) || !active_address_space[spacenum].accessors->read_qword) |
| 1739 | 1739 | { |
| 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); | |
| 1742 | 1742 | |
| 1743 | 1743 | /* based on the endianness, the result is assembled differently */ |
| 1744 | 1744 | if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) |
| r814 | r815 | |
| 1754 | 1754 | memory_set_debugger_access(1); |
| 1755 | 1755 | |
| 1756 | 1756 | /* 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)) | |
| 1758 | 1758 | result = ~(UINT64)0; |
| 1759 | 1759 | |
| 1760 | 1760 | /* if there is a custom read handler, and it returns TRUE, use that value */ |
| r814 | r815 | |
| 1778 | 1778 | current cpu in the specified memory space |
| 1779 | 1779 | -------------------------------------------------*/ |
| 1780 | 1780 | |
| 1781 | void debug_write_byte(int spacenum, offs_t address, UINT8 data) | |
| 1781 | void debug_write_byte(int spacenum, offs_t address, UINT8 data, int apply_translation) | |
| 1782 | 1782 | { |
| 1783 | 1783 | const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()]; |
| 1784 | 1784 | |
| r814 | r815 | |
| 1789 | 1789 | memory_set_debugger_access(1); |
| 1790 | 1790 | |
| 1791 | 1791 | /* 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)) | |
| 1793 | 1793 | ; |
| 1794 | 1794 | |
| 1795 | 1795 | /* if there is a custom write handler, and it returns TRUE, use that */ |
| r814 | r815 | |
| 1811 | 1811 | current cpu in the specified memory space |
| 1812 | 1812 | -------------------------------------------------*/ |
| 1813 | 1813 | |
| 1814 | void debug_write_word(int spacenum, offs_t address, UINT16 data) | |
| 1814 | void debug_write_word(int spacenum, offs_t address, UINT16 data, int apply_translation) | |
| 1815 | 1815 | { |
| 1816 | 1816 | const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()]; |
| 1817 | 1817 | |
| r814 | r815 | |
| 1823 | 1823 | { |
| 1824 | 1824 | if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) |
| 1825 | 1825 | { |
| 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); | |
| 1828 | 1828 | } |
| 1829 | 1829 | else |
| 1830 | 1830 | { |
| 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); | |
| 1833 | 1833 | } |
| 1834 | 1834 | } |
| 1835 | 1835 | |
| r814 | r815 | |
| 1840 | 1840 | memory_set_debugger_access(1); |
| 1841 | 1841 | |
| 1842 | 1842 | /* 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)) | |
| 1844 | 1844 | ; |
| 1845 | 1845 | |
| 1846 | 1846 | /* if there is a custom write handler, and it returns TRUE, use that */ |
| r814 | r815 | |
| 1863 | 1863 | current cpu in the specified memory space |
| 1864 | 1864 | -------------------------------------------------*/ |
| 1865 | 1865 | |
| 1866 | void debug_write_dword(int spacenum, offs_t address, UINT32 data) | |
| 1866 | void debug_write_dword(int spacenum, offs_t address, UINT32 data, int apply_translation) | |
| 1867 | 1867 | { |
| 1868 | 1868 | const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()]; |
| 1869 | 1869 | |
| r814 | r815 | |
| 1875 | 1875 | { |
| 1876 | 1876 | if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) |
| 1877 | 1877 | { |
| 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); | |
| 1880 | 1880 | } |
| 1881 | 1881 | else |
| 1882 | 1882 | { |
| 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); | |
| 1885 | 1885 | } |
| 1886 | 1886 | } |
| 1887 | 1887 | |
| r814 | r815 | |
| 1892 | 1892 | memory_set_debugger_access(1); |
| 1893 | 1893 | |
| 1894 | 1894 | /* 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)) | |
| 1896 | 1896 | ; |
| 1897 | 1897 | |
| 1898 | 1898 | /* if there is a custom write handler, and it returns TRUE, use that */ |
| r814 | r815 | |
| 1915 | 1915 | current cpu in the specified memory space |
| 1916 | 1916 | -------------------------------------------------*/ |
| 1917 | 1917 | |
| 1918 | void debug_write_qword(int spacenum, offs_t address, UINT64 data) | |
| 1918 | void debug_write_qword(int spacenum, offs_t address, UINT64 data, int apply_translation) | |
| 1919 | 1919 | { |
| 1920 | 1920 | const debug_cpu_info *info = &debug_cpuinfo[cpu_getactivecpu()]; |
| 1921 | 1921 | |
| r814 | r815 | |
| 1927 | 1927 | { |
| 1928 | 1928 | if (debug_cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) |
| 1929 | 1929 | { |
| 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); | |
| 1932 | 1932 | } |
| 1933 | 1933 | else |
| 1934 | 1934 | { |
| 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); | |
| 1937 | 1937 | } |
| 1938 | 1938 | } |
| 1939 | 1939 | /* otherwise, this proceeds like the byte case */ |
| r814 | r815 | |
| 1943 | 1943 | memory_set_debugger_access(1); |
| 1944 | 1944 | |
| 1945 | 1945 | /* 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)) | |
| 1947 | 1947 | ; |
| 1948 | 1948 | |
| 1949 | 1949 | /* if there is a custom write handler, and it returns TRUE, use that */ |
| r814 | r815 | |
| 2099 | 2099 | offset = ADDR2BYTE(offset, info, space); |
| 2100 | 2100 | switch (size) |
| 2101 | 2101 | { |
| 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); | |
| 2106 | 2106 | } |
| 2107 | 2107 | return ~0; |
| 2108 | 2108 | } |
| r814 | r815 | |
| 2123 | 2123 | offset = ADDR2BYTE(offset, info, space); |
| 2124 | 2124 | switch (size) |
| 2125 | 2125 | { |
| 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; | |
| 2130 | 2130 | } |
| 2131 | 2131 | } |
| 2132 | 2132 |
| r814 | r815 | |
|---|---|---|
| 145 | 145 | UINT8 ascii_view; /* display ASCII characters? */ |
| 146 | 146 | UINT8 live_tracking; /* track the value of the live expression? */ |
| 147 | 147 | UINT8 byte_offset; /* byte offset within each row */ |
| 148 | UINT8 no_translation; /* don't run addresses through the cpu translation hook */ | |
| 148 | 149 | UINT64 last_result; /* last result from the expression */ |
| 149 | 150 | parsed_expression *expression; /* expression to compute */ |
| 150 | 151 | char * expression_string; /* copy of the expression string */ |
| r814 | r815 | |
| 2288 | 2289 | memory_read_byte - generic byte reader |
| 2289 | 2290 | -------------------------------------------------*/ |
| 2290 | 2291 | |
| 2291 | static UINT8 memory_read_byte(debug_view_memory *memdata, offs_t offs) | |
| 2292 | static UINT8 memory_read_byte(debug_view_memory *memdata, offs_t offs, int apply_translation) | |
| 2292 | 2293 | { |
| 2293 | 2294 | /* if no raw data, just use the standard debug routines */ |
| 2294 | 2295 | if (!memdata->raw_base) |
| 2295 | return debug_read_byte(memdata->spacenum, offs); | |
| 2296 | return debug_read_byte(memdata->spacenum, offs, apply_translation); | |
| 2296 | 2297 | |
| 2297 | 2298 | /* all 0xff if out of bounds */ |
| 2298 | 2299 | offs ^= memdata->raw_offset_xor; |
| r814 | r815 | |
| 2306 | 2307 | memory_read_word - generic word reader |
| 2307 | 2308 | -------------------------------------------------*/ |
| 2308 | 2309 | |
| 2309 | static UINT16 memory_read_word(debug_view_memory *memdata, offs_t offs) | |
| 2310 | static UINT16 memory_read_word(debug_view_memory *memdata, offs_t offs, int apply_translation) | |
| 2310 | 2311 | { |
| 2311 | 2312 | /* if no raw data, just use the standard debug routines */ |
| 2312 | 2313 | if (!memdata->raw_base) |
| 2313 | return debug_read_word(memdata->spacenum, offs); | |
| 2314 | return debug_read_word(memdata->spacenum, offs, apply_translation); | |
| 2314 | 2315 | |
| 2315 | 2316 | /* otherwise, decompose into bytes */ |
| 2316 | 2317 | 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); | |
| 2318 | 2319 | 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); | |
| 2320 | 2321 | } |
| 2321 | 2322 | |
| 2322 | 2323 | |
| r814 | r815 | |
| 2324 | 2325 | memory_read_dword - generic dword reader |
| 2325 | 2326 | -------------------------------------------------*/ |
| 2326 | 2327 | |
| 2327 | static UINT32 memory_read_dword(debug_view_memory *memdata, offs_t offs) | |
| 2328 | static UINT32 memory_read_dword(debug_view_memory *memdata, offs_t offs, int apply_translation) | |
| 2328 | 2329 | { |
| 2329 | 2330 | /* if no raw data, just use the standard debug routines */ |
| 2330 | 2331 | if (!memdata->raw_base) |
| 2331 | return debug_read_dword(memdata->spacenum, offs); | |
| 2332 | return debug_read_dword(memdata->spacenum, offs, apply_translation); | |
| 2332 | 2333 | |
| 2333 | 2334 | /* otherwise, decompose into words */ |
| 2334 | 2335 | 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); | |
| 2336 | 2337 | 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); | |
| 2338 | 2339 | } |
| 2339 | 2340 | |
| 2340 | 2341 | |
| r814 | r815 | |
| 2342 | 2343 | memory_read_qword - generic qword reader |
| 2343 | 2344 | -------------------------------------------------*/ |
| 2344 | 2345 | |
| 2345 | static UINT64 memory_read_qword(debug_view_memory *memdata, offs_t offs) | |
| 2346 | static UINT64 memory_read_qword(debug_view_memory *memdata, offs_t offs, int apply_translation) | |
| 2346 | 2347 | { |
| 2347 | 2348 | /* if no raw data, just use the standard debug routines */ |
| 2348 | 2349 | if (!memdata->raw_base) |
| 2349 | return debug_read_qword(memdata->spacenum, offs); | |
| 2350 | return debug_read_qword(memdata->spacenum, offs, apply_translation); | |
| 2350 | 2351 | |
| 2351 | 2352 | /* otherwise, decompose into dwords */ |
| 2352 | 2353 | 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); | |
| 2354 | 2355 | 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); | |
| 2356 | 2357 | } |
| 2357 | 2358 | |
| 2358 | 2359 | |
| r814 | r815 | |
| 2360 | 2361 | memory_write_byte - generic byte writer |
| 2361 | 2362 | -------------------------------------------------*/ |
| 2362 | 2363 | |
| 2363 | static void memory_write_byte(debug_view_memory *memdata, offs_t offs, UINT8 data) | |
| 2364 | static void memory_write_byte(debug_view_memory *memdata, offs_t offs, UINT8 data, int apply_translation) | |
| 2364 | 2365 | { |
| 2365 | 2366 | /* if no raw data, just use the standard debug routines */ |
| 2366 | 2367 | if (!memdata->raw_base) |
| 2367 | 2368 | { |
| 2368 | debug_write_byte(memdata->spacenum, offs, data); | |
| 2369 | debug_write_byte(memdata->spacenum, offs, data, apply_translation); | |
| 2369 | 2370 | return; |
| 2370 | 2371 | } |
| 2371 | 2372 | |
| r814 | r815 | |
| 2390 | 2391 | memory_write_word - generic word writer |
| 2391 | 2392 | -------------------------------------------------*/ |
| 2392 | 2393 | |
| 2393 | static void memory_write_word(debug_view_memory *memdata, offs_t offs, UINT16 data) | |
| 2394 | static void memory_write_word(debug_view_memory *memdata, offs_t offs, UINT16 data, int apply_translation) | |
| 2394 | 2395 | { |
| 2395 | 2396 | /* if no raw data, just use the standard debug routines */ |
| 2396 | 2397 | if (!memdata->raw_base) |
| 2397 | 2398 | { |
| 2398 | debug_write_word(memdata->spacenum, offs, data); | |
| 2399 | debug_write_word(memdata->spacenum, offs, data, apply_translation); | |
| 2399 | 2400 | return; |
| 2400 | 2401 | } |
| 2401 | 2402 | |
| 2402 | 2403 | /* otherwise, decompose into bytes */ |
| 2403 | 2404 | if (memdata->raw_little_endian) |
| 2404 | 2405 | { |
| 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); | |
| 2407 | 2408 | } |
| 2408 | 2409 | else |
| 2409 | 2410 | { |
| 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); | |
| 2412 | 2413 | } |
| 2413 | 2414 | } |
| 2414 | 2415 | |
| r814 | r815 | |
| 2417 | 2418 | memory_write_dword - generic dword writer |
| 2418 | 2419 | -------------------------------------------------*/ |
| 2419 | 2420 | |
| 2420 | static void memory_write_dword(debug_view_memory *memdata, offs_t offs, UINT32 data) | |
| 2421 | static void memory_write_dword(debug_view_memory *memdata, offs_t offs, UINT32 data, int apply_translation) | |
| 2421 | 2422 | { |
| 2422 | 2423 | /* if no raw data, just use the standard debug routines */ |
| 2423 | 2424 | if (!memdata->raw_base) |
| 2424 | 2425 | { |
| 2425 | debug_write_dword(memdata->spacenum, offs, data); | |
| 2426 | debug_write_dword(memdata->spacenum, offs, data, apply_translation); | |
| 2426 | 2427 | return; |
| 2427 | 2428 | } |
| 2428 | 2429 | |
| 2429 | 2430 | /* otherwise, decompose into words */ |
| 2430 | 2431 | if (memdata->raw_little_endian) |
| 2431 | 2432 | { |
| 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); | |
| 2434 | 2435 | } |
| 2435 | 2436 | else |
| 2436 | 2437 | { |
| 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); | |
| 2439 | 2440 | } |
| 2440 | 2441 | } |
| 2441 | 2442 | |
| r814 | r815 | |
| 2444 | 2445 | memory_write_qword - generic qword writer |
| 2445 | 2446 | -------------------------------------------------*/ |
| 2446 | 2447 | |
| 2447 | static void memory_write_qword(debug_view_memory *memdata, offs_t offs, UINT64 data) | |
| 2448 | static void memory_write_qword(debug_view_memory *memdata, offs_t offs, UINT64 data, int apply_translation) | |
| 2448 | 2449 | { |
| 2449 | 2450 | /* if no raw data, just use the standard debug routines */ |
| 2450 | 2451 | if (!memdata->raw_base) |
| 2451 | 2452 | { |
| 2452 | debug_write_qword(memdata->spacenum, offs, data); | |
| 2453 | debug_write_qword(memdata->spacenum, offs, data, apply_translation); | |
| 2453 | 2454 | return; |
| 2454 | 2455 | } |
| 2455 | 2456 | |
| 2456 | 2457 | /* otherwise, decompose into dwords */ |
| 2457 | 2458 | if (memdata->raw_little_endian) |
| 2458 | 2459 | { |
| 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); | |
| 2461 | 2462 | } |
| 2462 | 2463 | else |
| 2463 | 2464 | { |
| 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); | |
| 2466 | 2467 | } |
| 2467 | 2468 | } |
| 2468 | 2469 | |
| r814 | r815 | |
| 2561 | 2562 | default: |
| 2562 | 2563 | case 1: |
| 2563 | 2564 | 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); | |
| 2565 | 2566 | if (hexchar || chval == DCH_RIGHT) |
| 2566 | 2567 | { |
| 2567 | 2568 | if (shift == 0) { shift = 4; if (address != maxaddr) address++; } |
| r814 | r815 | |
| 2576 | 2577 | |
| 2577 | 2578 | case 2: |
| 2578 | 2579 | 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); | |
| 2580 | 2581 | if (hexchar || chval == DCH_RIGHT) |
| 2581 | 2582 | { |
| 2582 | 2583 | if (shift == 0) { shift = 12; if (address != maxaddr) address += 2; } |
| r814 | r815 | |
| 2591 | 2592 | |
| 2592 | 2593 | case 4: |
| 2593 | 2594 | 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); | |
| 2595 | 2596 | if (hexchar || chval == DCH_RIGHT) |
| 2596 | 2597 | { |
| 2597 | 2598 | if (shift == 0) { shift = 28; if (address != maxaddr) address += 4; } |
| r814 | r815 | |
| 2749 | 2750 | offs_t curaddr = addrbyte + i; |
| 2750 | 2751 | if (curaddr > maxaddr) |
| 2751 | 2752 | 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)); | |
| 2754 | 2756 | else |
| 2755 | 2757 | len += sprintf(&data[len], "** "); |
| 2756 | 2758 | } |
| r814 | r815 | |
| 2762 | 2764 | offs_t curaddr = addrbyte + 2 * i; |
| 2763 | 2765 | if (curaddr > maxaddr) |
| 2764 | 2766 | 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)); | |
| 2767 | 2770 | else |
| 2768 | 2771 | len += sprintf(&data[len], " **** "); |
| 2769 | 2772 | } |
| r814 | r815 | |
| 2775 | 2778 | offs_t curaddr = addrbyte + 4 * i; |
| 2776 | 2779 | if (curaddr > maxaddr) |
| 2777 | 2780 | 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)); | |
| 2780 | 2784 | else |
| 2781 | 2785 | len += sprintf(&data[len], " ******** "); |
| 2782 | 2786 | } |
| r814 | r815 | |
| 2789 | 2793 | { |
| 2790 | 2794 | if (addrbyte + i <= maxaddr) |
| 2791 | 2795 | { |
| 2792 | char c = memory_read_byte(memdata, addrbyte + i); | |
| 2796 | char c = memory_read_byte(memdata, addrbyte + i, !memdata->no_translation); | |
| 2793 | 2797 | len += sprintf(&data[len], "%c", isprint(c) ? c : '.'); |
| 2794 | 2798 | } |
| 2795 | 2799 | else |
| r814 | r815 | |
| 2807 | 2811 | { |
| 2808 | 2812 | if (addrbyte + i <= maxaddr) |
| 2809 | 2813 | { |
| 2810 | char c = memory_read_byte(memdata, addrbyte + i); | |
| 2814 | char c = memory_read_byte(memdata, addrbyte + i, !memdata->no_translation); | |
| 2811 | 2815 | len += sprintf(&data[len], "%c", isprint(c) ? c : '.'); |
| 2812 | 2816 | } |
| 2813 | 2817 | else |
| r814 | r815 | |
| 2825 | 2829 | offs_t curaddr = addrbyte + i; |
| 2826 | 2830 | if (curaddr > maxaddr) |
| 2827 | 2831 | 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)); | |
| 2830 | 2835 | else |
| 2831 | 2836 | len += sprintf(&data[len], "** "); |
| 2832 | 2837 | } |
| r814 | r815 | |
| 2838 | 2843 | offs_t curaddr = addrbyte + 2 * i; |
| 2839 | 2844 | if (curaddr > maxaddr) |
| 2840 | 2845 | 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)); | |
| 2843 | 2849 | else |
| 2844 | 2850 | len += sprintf(&data[len], " **** "); |
| 2845 | 2851 | } |
| r814 | r815 | |
| 2851 | 2857 | offs_t curaddr = addrbyte + 4 * i; |
| 2852 | 2858 | if (curaddr > maxaddr) |
| 2853 | 2859 | 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)); | |
| 2856 | 2863 | else |
| 2857 | 2864 | len += sprintf(&data[len], " ******** "); |
| 2858 | 2865 | } |
| r814 | r815 | |
| 2911 | 2918 | value->i = memdata->live_tracking; |
| 2912 | 2919 | break; |
| 2913 | 2920 | |
| 2921 | case DVP_MEM_NO_TRANSLATION: | |
| 2922 | value->i = memdata->no_translation; | |
| 2923 | break; | |
| 2924 | ||
| 2914 | 2925 | case DVP_MEM_CPUNUM: |
| 2915 | 2926 | value->i = memdata->cpunum; |
| 2916 | 2927 | break; |
| r814 | r815 | |
| 2984 | 2995 | debug_view_end_update(view); |
| 2985 | 2996 | break; |
| 2986 | 2997 | |
| 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 | ||
| 2987 | 3008 | case DVP_MEM_TRACK_LIVE: |
| 2988 | 3009 | if (value.i != memdata->live_tracking) |
| 2989 | 3010 | { |
| r814 | r815 | |
|---|---|---|
| 218 | 218 | int debug_hotspot_track(int cpunum, int numspots, int threshhold); |
| 219 | 219 | |
| 220 | 220 | /* memory accessors */ |
| 221 | UINT8 debug_read_byte(int spacenum, offs_t address); | |
| 222 | UINT16 debug_read_word(int spacenum, offs_t address); | |
| 223 | UINT32 debug_read_dword(int spacenum, offs_t address); | |
| 224 | UINT64 debug_read_qword(int spacenum, offs_t address); | |
| 225 | void debug_write_byte(int spacenum, offs_t address, UINT8 data); | |
| 226 | void debug_write_word(int spacenum, offs_t address, UINT16 data); | |
| 227 | void debug_write_dword(int spacenum, offs_t address, UINT32 data); | |
| 228 | void debug_write_qword(int spacenum, offs_t address, UINT64 data); | |
| 221 | UINT8 debug_read_byte(int spacenum, offs_t address, int apply_translation); | |
| 222 | UINT16 debug_read_word(int spacenum, offs_t address, int apply_translation); | |
| 223 | UINT32 debug_read_dword(int spacenum, offs_t address, int apply_translation); | |
| 224 | UINT64 debug_read_qword(int spacenum, offs_t address, int apply_translation); | |
| 225 | void debug_write_byte(int spacenum, offs_t address, UINT8 data, int apply_translation); | |
| 226 | void debug_write_word(int spacenum, offs_t address, UINT16 data, int apply_translation); | |
| 227 | void debug_write_dword(int spacenum, offs_t address, UINT32 data, int apply_translation); | |
| 228 | void debug_write_qword(int spacenum, offs_t address, UINT64 data, int apply_translation); | |
| 229 | 229 | UINT64 debug_read_opcode(UINT32 offset, int size, int arg); |
| 230 | 230 | |
| 231 | 231 | #endif |
| r814 | r815 | |
|---|---|---|
| 71 | 71 | #define DVP_MEM_RAW_OFFSET_XOR (109) /* r/w - UINT32 */ |
| 72 | 72 | #define DVP_MEM_RAW_LITTLE_ENDIAN (110) /* r/w - UINT32 */ |
| 73 | 73 | #define DVP_MEM_WIDTH (111) /* r/w - UINT32 */ |
| 74 | #define DVP_MEM_NO_TRANSLATION (113) /* r/w - UINT32 */ | |
| 74 | 75 | |
| 75 | 76 | /* properties available for textbuffer views */ |
| 76 | 77 | #define DVP_TEXTBUF_LINE_LOCK (100) /* r/w - UINT32 */ |
| r814 | r815 | |
|---|---|---|
| 1410 | 1410 | cpuintrf_push_context(cpunum); |
| 1411 | 1411 | for (i = offset; i <= endoffset; i++) |
| 1412 | 1412 | { |
| 1413 | UINT8 byte = debug_read_byte(spacenum, i); | |
| 1413 | UINT8 byte = debug_read_byte(spacenum, i, TRUE); | |
| 1414 | 1414 | fwrite(&byte, 1, 1, f); |
| 1415 | 1415 | } |
| 1416 | 1416 | cpuintrf_pop_context(); |
| r814 | r815 | |
| 1493 | 1493 | offs_t curaddr = i + j; |
| 1494 | 1494 | if (!info->translate || (*info->translate)(spacenum, &curaddr)) |
| 1495 | 1495 | { |
| 1496 | UINT8 byte = debug_read_byte(ref, i + j); | |
| 1496 | UINT8 byte = debug_read_byte(ref, i + j, TRUE); | |
| 1497 | 1497 | outdex += sprintf(&output[outdex], " %02X", byte); |
| 1498 | 1498 | } |
| 1499 | 1499 | else |
| r814 | r815 | |
| 1512 | 1512 | offs_t curaddr = i + j; |
| 1513 | 1513 | if (!info->translate || (*info->translate)(spacenum, &curaddr)) |
| 1514 | 1514 | { |
| 1515 | UINT16 word = debug_read_word(ref, i + j); | |
| 1515 | UINT16 word = debug_read_word(ref, i + j, TRUE); | |
| 1516 | 1516 | outdex += sprintf(&output[outdex], " %04X", word); |
| 1517 | 1517 | } |
| 1518 | 1518 | else |
| r814 | r815 | |
| 1531 | 1531 | offs_t curaddr = i + j; |
| 1532 | 1532 | if (!info->translate || (*info->translate)(spacenum, &curaddr)) |
| 1533 | 1533 | { |
| 1534 | UINT32 dword = debug_read_dword(ref, i + j); | |
| 1534 | UINT32 dword = debug_read_dword(ref, i + j, TRUE); | |
| 1535 | 1535 | outdex += sprintf(&output[outdex], " %08X", dword); |
| 1536 | 1536 | } |
| 1537 | 1537 | else |
| r814 | r815 | |
| 1550 | 1550 | offs_t curaddr = i + j; |
| 1551 | 1551 | if (!info->translate || (*info->translate)(spacenum, &curaddr)) |
| 1552 | 1552 | { |
| 1553 | UINT64 qword = debug_read_qword(ref, i + j); | |
| 1553 | UINT64 qword = debug_read_qword(ref, i + j, TRUE); | |
| 1554 | 1554 | outdex += sprintf(&output[outdex], " %08X%08X", (UINT32)(qword >> 32), (UINT32)qword); |
| 1555 | 1555 | } |
| 1556 | 1556 | else |
| r814 | r815 | |
| 1571 | 1571 | offs_t curaddr = i + j; |
| 1572 | 1572 | if (!info->translate || (*info->translate)(spacenum, &curaddr)) |
| 1573 | 1573 | { |
| 1574 | UINT8 byte = debug_read_byte(ref, i + j); | |
| 1574 | UINT8 byte = debug_read_byte(ref, i + j, TRUE); | |
| 1575 | 1575 | outdex += sprintf(&output[outdex], "%c", (byte >= 32 && byte < 128) ? byte : '.'); |
| 1576 | 1576 | } |
| 1577 | 1577 | else |
| r814 | r815 | |
| 1672 | 1672 | { |
| 1673 | 1673 | switch (data_size[j]) |
| 1674 | 1674 | { |
| 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; | |
| 1679 | 1679 | default: /* all other cases are wildcards */ break; |
| 1680 | 1680 | } |
| 1681 | 1681 | suboffset += data_size[j] & 0x0f; |
| r814 | r815 | |
|---|---|---|
| 60 | 60 | } |
| 61 | 61 | else if (op >= 0x60 && op <= 0x63) |
| 62 | 62 | { |
| 63 | addr = ((op & 0x0 | |
| 63 | addr = ((op & 0x03) << 8) | oprom[1]; | |
| 64 | 64 | sprintf(buffer,"JMP %x",addr); |
| 65 | 65 | cnt = 2; |
| 66 | 66 | } |
| 67 | 67 | else if (op >= 0x68 && op <= 0x6B) |
| 68 | 68 | { |
| 69 | addr = ((op & 0x0 | |
| 69 | addr = ((op & 0x03) << 8) | oprom[1]; | |
| 70 | 70 | sprintf(buffer,"JSR %x",addr); |
| 71 | 71 | flags = DASMFLAG_STEP_OVER; |
| 72 | 72 | cnt = 2; |
| r814 | r815 | |
| 205 | 205 | { |
| 206 | 206 | sprintf(buffer,"LBI 0,%u",op2 & 0xF); |
| 207 | 207 | } |
| 208 | else if (op2 >= 0x91 && op2 <= 0x8) | |
| 208 | else if (op2 >= 0x91 && op2 <= 0x98) | |
| 209 | 209 | { |
| 210 | 210 | sprintf(buffer,"LBI 1,%u",op2 & 0xF); |
| 211 | 211 | } |
| r814 | r815 | |
|---|---|---|
| 5 | 5 | **************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #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)) | |
| 9 | 10 | |
| 10 | 11 | #define IN(A) io_read_byte_8(A) |
| 11 | 12 | #define OUT(A,V) io_write_byte_8(A,V) |
| r814 | r815 | |
| 24 | 25 | #define prevPC R.PREVPC |
| 25 | 26 | #define skip R.skip |
| 26 | 27 | #define skipLBI R.skipLBI |
| 27 | #define M RAM(B) | |
| 28 | 28 | |
| 29 | #define READ_M RAM_R(B) | |
| 30 | #define WRITE_M(VAL) RAM_W(B,VAL) | |
| 31 | ||
| 29 | 32 | #define IN_G() IN(COP400_PORT_G) |
| 30 | 33 | #define IN_L() IN(COP400_PORT_L) |
| 31 | 34 | #define OUT_G(A) OUT(COP400_PORT_G, (A) & R.G_mask) |
| r814 | r815 | |
| 74 | 77 | OUT_G(G); |
| 75 | 78 | } |
| 76 | 79 | |
| 77 | INLINE void add(void) { A = (A + RAM(B)) & 0x0F; } | |
| 80 | INLINE void add(void) { A = (A + RAM_R(B)) & 0x0F; } | |
| 78 | 81 | |
| 79 | 82 | INLINE void asc(void) |
| 80 | 83 | { |
| 81 | A = A + C + RAM(B); | |
| 84 | A = A + C + RAM_R(B); | |
| 82 | 85 | |
| 83 | 86 | if (A > 0xF) |
| 84 | 87 | { |
| r814 | r815 | |
| 121 | 124 | |
| 122 | 125 | INLINE void cab(void) { B = (B & 0x30) | A; } |
| 123 | 126 | |
| 124 | INLINE void camq(void) { WRITE_Q((A << 4) | M); } | |
| 127 | INLINE void camq(void) { WRITE_Q((A << 4) | READ_M); } | |
| 125 | 128 | |
| 126 | 129 | INLINE void cba(void) { A = B & 0xF; } |
| 127 | 130 | |
| r814 | r815 | |
| 134 | 137 | INLINE void inl(void) |
| 135 | 138 | { |
| 136 | 139 | UINT8 L = IN_L(); |
| 137 | RAM(B | |
| 140 | RAM_W(B, | |
| 138 | 141 | A = L & 0xF; |
| 139 | 142 | } |
| 140 | 143 | |
| 141 | 144 | INLINE void jid(void) |
| 142 | 145 | { |
| 143 | UINT16 addr = (PC & 0x300) | (A << 4) | M; | |
| 146 | UINT16 addr = (PC & 0x300) | (A << 4) | READ_M; | |
| 144 | 147 | PC = (PC & 0x300) | ROM(addr); |
| 145 | 148 | } |
| 146 | 149 | |
| r814 | r815 | |
| 189 | 192 | |
| 190 | 193 | INLINE void LD(UINT8 r) |
| 191 | 194 | { |
| 192 | A = RAM(B); | |
| 195 | A = RAM_R(B); | |
| 193 | 196 | B = B ^ (r << 4); |
| 194 | 197 | } |
| 195 | 198 | |
| r814 | r815 | |
| 299 | 302 | INLINE void lqid(void) |
| 300 | 303 | { |
| 301 | 304 | PUSH(PC + 1); |
| 302 | PC = (UINT16)((PC & 0x300) | (A << 4) | M); | |
| 305 | PC = (UINT16)((PC & 0x300) | (A << 4) | READ_M); | |
| 303 | 306 | WRITE_Q(ROM(PC)); |
| 304 | 307 | POP(); |
| 305 | 308 | } |
| r814 | r815 | |
| 308 | 311 | |
| 309 | 312 | INLINE void obd(void) { OUT_D(B); } |
| 310 | 313 | |
| 311 | INLINE void omg(void) { WRITE_G(RAM(B)); } | |
| 314 | INLINE void omg(void) { WRITE_G(RAM_R(B)); } | |
| 312 | 315 | |
| 313 | 316 | INLINE void rc(void) { C = 0; } |
| 314 | 317 | |
| r814 | r815 | |
| 316 | 319 | |
| 317 | 320 | INLINE void retsk(void) { POP(); skip = 1; } |
| 318 | 321 | |
| 319 | INLINE void rmb0(void) { RAM(B) = RAM(B) & 0xE; } | |
| 320 | INLINE void rmb1(void) { RAM(B) = RAM(B) & 0xD; } | |
| 321 | INLINE void rmb2(void) { RAM(B) = RAM(B) & 0xB; } | |
| 322 | INLINE void rmb3(void) { RAM(B) = RAM(B) & 0x7; } | |
| 322 | INLINE void rmb0(void) { RAM_W(B, RAM_R(B) & 0xE); } | |
| 323 | INLINE void rmb1(void) { RAM_W(B, RAM_R(B) & 0xD); } | |
| 324 | INLINE void rmb2(void) { RAM_W(B, RAM_R(B) & 0xB); } | |
| 325 | INLINE void rmb3(void) { RAM_W(B, RAM_R(B) & 0x7); } | |
| 323 | 326 | |
| 324 | 327 | INLINE void sc(void) { C = 1; } |
| 325 | 328 | |
| 326 | 329 | INLINE void skc(void) { if (C == 1) skip = 1; } |
| 327 | 330 | |
| 328 | INLINE void ske(void) { if (A == RAM(B)) skip = 1; } | |
| 331 | INLINE void ske(void) { if (A == RAM_R(B)) skip = 1; } | |
| 329 | 332 | |
| 330 | INLINE void skmbz0(void) { if ((RAM(B) & 0x01) == 0 ) skip = 1; } | |
| 331 | INLINE void skmbz1(void) { if ((RAM(B) & 0x02) == 0 ) skip = 1; } | |
| 332 | INLINE void skmbz2(void) { if ((RAM(B) & 0x04) == 0 ) skip = 1; } | |
| 333 | INLINE void skmbz3(void) { if ((RAM(B) & 0x08) == 0 ) skip = 1; } | |
| 333 | INLINE void skmbz0(void) { if ((RAM_R(B) & 0x01) == 0 ) skip = 1; } | |
| 334 | INLINE void skmbz1(void) { if ((RAM_R(B) & 0x02) == 0 ) skip = 1; } | |
| 335 | INLINE void skmbz2(void) { if ((RAM_R(B) & 0x04) == 0 ) skip = 1; } | |
| 336 | INLINE void skmbz3(void) { if ((RAM_R(B) & 0x08) == 0 ) skip = 1; } | |
| 334 | 337 | |
| 335 | 338 | INLINE void skgbz0(void) { if ((IN_G() & 0x01) == 0) skip = 1; } |
| 336 | 339 | INLINE void skgbz1(void) { if ((IN_G() & 0x02) == 0) skip = 1; } |
| r814 | r815 | |
| 339 | 342 | |
| 340 | 343 | INLINE void skgz(void) { if (IN_G() == 0) skip = 1; } |
| 341 | 344 | |
| 342 | INLINE void smb0(void) { RAM(B) = RAM(B) | 0x1; } | |
| 343 | INLINE void smb1(void) { RAM(B) = RAM(B) | 0x2; } | |
| 344 | INLINE void smb2(void) { RAM(B) = RAM(B) | 0x4; } | |
| 345 | INLINE void smb3(void) { RAM(B) = RAM(B) | 0x8; } | |
| 345 | INLINE void smb0(void) { RAM_W(B, RAM_R(B) | 0x1); } | |
| 346 | INLINE void smb1(void) { RAM_W(B, RAM_R(B) | 0x2); } | |
| 347 | INLINE void smb2(void) { RAM_W(B, RAM_R(B) | 0x4); } | |
| 348 | INLINE void smb3(void) { RAM_W(B, RAM_R(B) | 0x8); } | |
| 346 | 349 | |
| 347 | 350 | INLINE void STII(UINT8 y) |
| 348 | 351 | { |
| 349 | 352 | UINT16 Bd; |
| 350 | 353 | |
| 351 | RAM(B | |
| 354 | RAM_W(B, | |
| 352 | 355 | Bd = (B & 0x0f) + 1; |
| 353 | 356 | if (Bd > 15) Bd = 0; |
| 354 | 357 | B = (B & 0x30) + Bd; |
| r814 | r815 | |
| 376 | 379 | |
| 377 | 380 | INLINE void X(UINT8 r) |
| 378 | 381 | { |
| 379 | UINT8 t = RAM(B); | |
| 380 | RAM(B) = A; | |
| 382 | UINT8 t = RAM_R(B); | |
| 383 | RAM_W(B, A); | |
| 381 | 384 | A = t; |
| 382 | 385 | B = B ^ (r << 4); |
| 383 | 386 | } |
| r814 | r815 | |
| 391 | 394 | { |
| 392 | 395 | UINT8 addr = ROM(PC++) & 0x3f; |
| 393 | 396 | UINT8 t = A; |
| 394 | A = RAM(addr); | |
| 395 | RAM(addr) = t; | |
| 397 | A = RAM_R(addr); | |
| 398 | RAM_W(addr, t); | |
| 396 | 399 | } |
| 397 | 400 | |
| 398 | 401 | INLINE void xas(void) |
| r814 | r815 | |
| 408 | 411 | { |
| 409 | 412 | UINT8 t, Bd, Br; |
| 410 | 413 | |
| 411 | t = RAM(B); | |
| 412 | RAM(B) = A; | |
| 414 | t = RAM_R(B); | |
| 415 | RAM_W(B, A); | |
| 413 | 416 | A = t; |
| 414 | 417 | |
| 415 | 418 | Br = (UINT8)((B & 0x30) ^ (r << 4)); |
| r814 | r815 | |
| 423 | 426 | { |
| 424 | 427 | UINT8 t, Bd, Br; |
| 425 | 428 | |
| 426 | t = RAM(B); | |
| 427 | RAM(B) = A; | |
| 429 | t = RAM_R(B); | |
| 430 | RAM_W(B, A); | |
| 428 | 431 | A = t; |
| 429 | 432 | |
| 430 | 433 | Br = (UINT8)((B & 0x30) ^ (r << 4)); |
| r814 | r815 | |
| 444 | 447 | INLINE void xds2(void) { XDS(2); } |
| 445 | 448 | INLINE void xds3(void) { XDS(3); } |
| 446 | 449 | |
| 447 | INLINE void xor(void) { A = RAM(B) ^ A; } | |
| 450 | INLINE void xor(void) { A = RAM_R(B) ^ A; } |
| r814 | r815 | |
|---|---|---|
| 41 | 41 | UINT4 SIO; |
| 42 | 42 | UINT1 SKL; |
| 43 | 43 | UINT8 skip, skipLBI; |
| 44 | UINT4 RAM[64]; | |
| 45 | 44 | UINT8 G_mask; |
| 46 | 45 | UINT8 D_mask; |
| 47 | 46 | } COP410_Regs; |
| r814 | r815 | |
| 131 | 130 | {1, jp },{1, jp },{1, jp },{1, jp },{1, jp },{1, jp },{1, jp },{1, jid } |
| 132 | 131 | }; |
| 133 | 132 | |
| 133 | static ADDRESS_MAP_START( cop410_RAM, ADDRESS_SPACE_DATA, 8 ) | |
| 134 | AM_RANGE(0x00, 0x40) AM_RAM | |
| 135 | ADDRESS_MAP_END | |
| 136 | ||
| 134 | 137 | /**************************************************************************** |
| 135 | 138 | * Initialize emulation |
| 136 | 139 | ****************************************************************************/ |
| r814 | r815 | |
| 166 | 169 | state_save_register_item("cop410", index, SKL); |
| 167 | 170 | state_save_register_item("cop410", index, skip); |
| 168 | 171 | state_save_register_item("cop410", index, skipLBI); |
| 169 | state_save_register_item_array("cop410", index, R.RAM); | |
| 170 | 172 | state_save_register_item("cop410", index, R.G_mask); |
| 171 | 173 | state_save_register_item("cop410", index, R.D_mask); |
| 172 | 174 | } |
| r814 | r815 | |
| 311 | 313 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 9; break; |
| 312 | 314 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; |
| 313 | 315 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; |
| 314 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = | |
| 316 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; /* Really 6 */ break; | |
| 315 | 317 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; |
| 316 | 318 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; |
| 317 | 319 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; |
| r814 | r815 | |
| 346 | 348 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = cop410_dasm; break; |
| 347 | 349 | #endif /* MAME_DEBUG */ |
| 348 | 350 | 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; | |
| 349 | 353 | |
| 350 | 354 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 351 | 355 | case CPUINFO_STR_NAME: strcpy(info->s, "COP410"); break; |
| r814 | r815 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | INLINE void casc(void) |
| 19 | 19 | { |
| 20 | A = (A ^ 0xF) + RAM(B) + C; | |
| 20 | A = (A ^ 0xF) + RAM_R(B) + C; | |
| 21 | 21 | |
| 22 | 22 | if (A > 0xF) |
| 23 | 23 | { |
| r814 | r815 | |
| 33 | 33 | |
| 34 | 34 | INLINE void cqma(void) |
| 35 | 35 | { |
| 36 | M | |
| 36 | WRITE_M( | |
| 37 | 37 | A = Q & 0xF; |
| 38 | 38 | } |
| 39 | 39 | |
| r814 | r815 | |
| 54 | 54 | |
| 55 | 55 | INLINE void ldd(void) |
| 56 | 56 | { |
| 57 | A = RAM(ROM(PC++) & 0x3f); | |
| 57 | A = RAM_R(ROM(PC++) & 0x3f); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | INLINE void ogi0(void) { WRITE_G(0); } |
| r814 | r815 | |
|---|---|---|
| 45 | 45 | UINT8 skip, skipLBI; |
| 46 | 46 | UINT1 timerlatch; |
| 47 | 47 | UINT16 counter; |
| 48 | UINT4 RAM[64]; | |
| 49 | 48 | UINT8 G_mask; |
| 50 | 49 | UINT8 D_mask; |
| 51 | 50 | } COP420_Regs; |
| r814 | r815 | |
| 136 | 135 | {1, jp },{1, jp },{1, jp },{1, jp },{1, jp },{1, jp },{1, jp },{1, jid } |
| 137 | 136 | }; |
| 138 | 137 | |
| 138 | static ADDRESS_MAP_START( cop420_RAM, ADDRESS_SPACE_DATA, 8 ) | |
| 139 | AM_RANGE(0x00, 0x40) AM_RAM | |
| 140 | ADDRESS_MAP_END | |
| 141 | ||
| 139 | 142 | /**************************************************************************** |
| 140 | 143 | * Initialize emulation |
| 141 | 144 | ****************************************************************************/ |
| r814 | r815 | |
| 182 | 185 | state_save_register_item("cop420", index, skipLBI); |
| 183 | 186 | state_save_register_item("cop420", index, R.timerlatch); |
| 184 | 187 | state_save_register_item("cop420", index, R.counter); |
| 185 | state_save_register_item_array("cop420", index, R.RAM); | |
| 186 | 188 | state_save_register_item("cop420", index, R.G_mask); |
| 187 | 189 | state_save_register_item("cop420", index, R.D_mask); |
| 188 | 190 | } |
| r814 | r815 | |
| 329 | 331 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 10; break; |
| 330 | 332 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; |
| 331 | 333 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; |
| 332 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = | |
| 334 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; /* Really 6 */ break; | |
| 333 | 335 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; |
| 334 | 336 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; |
| 335 | 337 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; |
| r814 | r815 | |
| 365 | 367 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = cop420_dasm; break; |
| 366 | 368 | #endif /* MAME_DEBUG */ |
| 367 | 369 | 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; | |
| 368 | 372 | |
| 369 | 373 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 370 | 374 | case CPUINFO_STR_NAME: strcpy(info->s, "COP420"); break; |
| r814 | r815 | |
|---|---|---|
| 60 | 60 | } |
| 61 | 61 | else if (op >= 0x60 && op <= 0x61) |
| 62 | 62 | { |
| 63 | addr = ((op & 0x0 | |
| 63 | addr = ((op & 0x01) << 8) | oprom[1]; | |
| 64 | 64 | sprintf(buffer,"JMP %x",addr); |
| 65 | 65 | cnt = 2; |
| 66 | 66 | } |
| 67 | 67 | else if (op >= 0x68 && op <= 0x69) |
| 68 | 68 | { |
| 69 | addr = ((op & 0x0 | |
| 69 | addr = ((op & 0x01) << 8) | oprom[1]; | |
| 70 | 70 | sprintf(buffer,"JSR %x",addr); |
| 71 | 71 | flags = DASMFLAG_STEP_OVER; |
| 72 | 72 | cnt = 2; |
| r814 | r815 | |
|---|---|---|
| 1238 | 1238 | { |
| 1239 | 1239 | UINT32 op2, sc=0, rd, rn, opcode; |
| 1240 | 1240 | UINT32 by, rdn; |
| 1241 | UINT32 oldR15 = R15; | |
| 1241 | 1242 | |
| 1242 | 1243 | opcode = (insn & INSN_OPCODE) >> INSN_OPCODE_SHIFT; |
| 1243 | 1244 | |
| r814 | r815 | |
| 1288 | 1289 | } |
| 1289 | 1290 | } |
| 1290 | 1291 | |
| 1291 | change_pc(R15); | |
| 1292 | ||
| 1293 | 1292 | /* Perform the operation */ |
| 1294 | 1293 | |
| 1295 | 1294 | switch (opcode) |
| r814 | r815 | |
| 1400 | 1399 | } |
| 1401 | 1400 | } |
| 1402 | 1401 | |
| 1402 | if (oldR15 != R15) | |
| 1403 | 1403 | change_pc(R15); |
| 1404 | 1404 | } |
| 1405 | 1405 | |
| r814 | r815 | |
| 1516 | 1516 | { |
| 1517 | 1517 | UINT32 rb = (insn & INSN_RN) >> INSN_RN_SHIFT; |
| 1518 | 1518 | UINT32 rbp = GET_REGISTER(rb); |
| 1519 | UINT32 oldR15 = R15; | |
| 1519 | 1520 | int result; |
| 1520 | 1521 | |
| 1521 | 1522 | #if ARM7_DEBUG_CORE |
| r814 | r815 | |
| 1691 | 1692 | ARM7_ICOUNT -= ((result+1)+2+1); |
| 1692 | 1693 | } |
| 1693 | 1694 | |
| 1695 | if (oldR15 != R15) | |
| 1694 | 1696 | change_pc(R15); |
| 1695 | 1697 | } /* HandleMemBlock */ |
| 1696 | 1698 |
| r814 | r815 | |
|---|---|---|
| 59 | 59 | pc = R15; |
| 60 | 60 | |
| 61 | 61 | insn = cpu_readop16(pc & (~1)); |
| 62 | ARM7_ICOUNT | |
| 62 | ARM7_ICOUNT -= (3 - thumbCycles[insn >> 8]); | |
| 63 | 63 | switch( ( insn & THUMB_INSN_TYPE ) >> THUMB_INSN_TYPE_SHIFT ) |
| 64 | 64 | { |
| 65 | 65 | case 0x0: /* Logical shifting */ |
| r814 | r815 | |
| 395 | 395 | rd = ( insn & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT; |
| 396 | 396 | op2=(GET_CPSR & C_MASK) ? 1 : 0; |
| 397 | 397 | rn=GET_REGISTER(rd) + GET_REGISTER(rs) + op2; |
| 398 | HandleThumbALUAddFlags( rn, GET_REGISTER(rd), GET_REGISTER(rs) | |
| 398 | HandleThumbALUAddFlags( rn, GET_REGISTER(rd), ( GET_REGISTER(rs) ) | |
| 399 | 399 | SET_REGISTER( rd, rn); |
| 400 | 400 | break; |
| 401 | 401 | case 0x6: /* SBC Rd, Rs */ |
| r814 | r815 | |
| 403 | 403 | rd = ( insn & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT; |
| 404 | 404 | op2=(GET_CPSR & C_MASK) ? 0 : 1; |
| 405 | 405 | rn=GET_REGISTER(rd) - GET_REGISTER(rs) - op2; |
| 406 | HandleThumbALU | |
| 406 | HandleThumbALUSubFlags( rn, GET_REGISTER(rd), ( GET_REGISTER(rs) ) | |
| 407 | 407 | SET_REGISTER( rd, rn); |
| 408 | 408 | break; |
| 409 | 409 | case 0x7: /* ROR Rd, Rs */ |
| r814 | r815 | |
| 434 | 434 | case 0x9: /* NEG Rd, Rs - todo: check me */ |
| 435 | 435 | rs = ( insn & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT; |
| 436 | 436 | rd = ( insn & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT; |
| 437 | rn = 0 - GET_REGISTER(rs); | |
| 437 | rrs = GET_REGISTER(rs); | |
| 438 | rn = 0 - rrs; | |
| 438 | 439 | SET_REGISTER( rd, rn ); |
| 439 | HandleThumbALUSubFlags( GET_REGISTER(rd), 0, r | |
| 440 | HandleThumbALUSubFlags( GET_REGISTER(rd), 0, rrs ); | |
| 440 | 441 | break; |
| 441 | 442 | case 0xa: /* CMP Rd, Rs */ |
| 442 | 443 | rs = ( insn & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT; |
| r814 | r815 | |
| 540 | 541 | rs = GET_REGISTER( ( ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT ) ); |
| 541 | 542 | rd = GET_REGISTER( insn & THUMB_HIREG_RD ); |
| 542 | 543 | rn = rd - rs; |
| 543 | HandleThumbALUSubFlags( rn, r | |
| 544 | HandleThumbALUSubFlags( rn, rd, rs ); | |
| 544 | 545 | break; |
| 545 | 546 | case 0x1: /* CMP Rd, Hs */ |
| 546 | 547 | rs = GET_REGISTER( ( ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT ) + 8 ); |
| 547 | 548 | rd = GET_REGISTER( insn & THUMB_HIREG_RD ); |
| 548 | 549 | rn = rd - rs; |
| 549 | HandleThumbALUSubFlags( rn, r | |
| 550 | HandleThumbALUSubFlags( rn, rd, rs ); | |
| 550 | 551 | break; |
| 551 | 552 | case 0x2: /* CMP Hd, Rs */ |
| 552 | 553 | rs = GET_REGISTER( ( ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT ) ); |
| 553 | 554 | rd = GET_REGISTER( (insn & THUMB_HIREG_RD) + 8 ); |
| 554 | 555 | rn = rd - rs; |
| 555 | HandleThumbALUSubFlags( rn, r | |
| 556 | HandleThumbALUSubFlags( rn, rd, rs ); | |
| 556 | 557 | break; |
| 557 | 558 | case 0x3: /* CMP Hd, Hs */ |
| 558 | 559 | rs = GET_REGISTER( ( ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT ) + 8 ); |
| 559 | 560 | rd = GET_REGISTER( (insn & THUMB_HIREG_RD) + 8 ); |
| 560 | 561 | rn = rd - rs; |
| 561 | HandleThumbALUSubFlags( rn, r | |
| 562 | HandleThumbALUSubFlags( rn, rd, rs ); | |
| 562 | 563 | break; |
| 563 | 564 | default: |
| 564 | 565 | fatalerror("%08x: G4-1 Undefined Thumb instruction: %04x %x\n", pc, insn, ( insn & THUMB_HIREG_H ) >> THUMB_HIREG_H_SHIFT); |
| r814 | r815 | |
| 590 | 591 | { |
| 591 | 592 | R15 += 2; |
| 592 | 593 | } |
| 593 | ||
| 594 | if( rd == 7 ) | |
| 594 | else | |
| 595 | 595 | { |
| 596 | 596 | R15 &= ~1; |
| 597 | 597 | change_pc(R15); |
| r814 | r815 | |
| 600 | 600 | case 0x3: // MOV Hd, Hs |
| 601 | 601 | rs = ( insn & THUMB_HIREG_RS ) >> THUMB_HIREG_RS_SHIFT; |
| 602 | 602 | rd = insn & THUMB_HIREG_RD; |
| 603 | if (rs == 7) | |
| 604 | { | |
| 605 | SET_REGISTER( rd + 8, GET_REGISTER(rs+8)+4 ); | |
| 606 | } | |
| 607 | else | |
| 608 | { | |
| 603 | 609 | SET_REGISTER( rd + 8, GET_REGISTER(rs+8) ); |
| 610 | } | |
| 604 | 611 | if( rd != 7 ) |
| 605 | 612 | { |
| 606 | 613 | R15 += 2; |
| 607 | 614 | } |
| 615 | ||
| 608 | 616 | if( rd == 7 ) |
| 609 | 617 | { |
| 610 | 618 | R15 &= ~1; |
| r814 | r815 | |
|---|---|---|
| 2002 | 2002 | | (m6800.port2_data & m6800.port2_ddr); |
| 2003 | 2003 | case 0x04: |
| 2004 | 2004 | return m6800.port3_ddr; |
| 2005 | case 0x05: | |
| 2005 | case 0x05: | |
| 2006 | 2006 | return m6800.port4_ddr; |
| 2007 | 2007 | case 0x06: |
| 2008 | 2008 | return (io_read_byte_8(M6803_PORT3) & (m6800.port3_ddr ^ 0xff)) |
| r814 | r815 | |
|---|---|---|
| 862 | 862 | render_target_get_bounds(render_get_ui_target(), &targwidth, &targheight, NULL); |
| 863 | 863 | |
| 864 | 864 | /* get the size of the tilemap itself */ |
| 865 | tilemap_ | |
| 865 | tilemap_ | |
| 866 | 866 | if (state->tilemap.rotate & ORIENTATION_SWAP_XY) |
| 867 | 867 | { UINT32 temp = mapwidth; mapwidth = mapheight; mapheight = temp; } |
| 868 | 868 | |
| r814 | r815 | |
| 972 | 972 | state->tilemap.which = tilemap_count() - 1; |
| 973 | 973 | |
| 974 | 974 | /* cache some info in locals */ |
| 975 | tilemap_ | |
| 975 | tilemap_ | |
| 976 | 976 | |
| 977 | 977 | /* handle zoom (minus,plus) */ |
| 978 | 978 | if (input_ui_pressed(IPT_UI_ZOOM_OUT)) |
| r814 | r815 | |
| 1075 | 1075 | /* handle the redraw */ |
| 1076 | 1076 | if (state->bitmap_dirty) |
| 1077 | 1077 | { |
| 1078 | tilemap_ | |
| 1078 | tilemap_ | |
| 1079 | 1079 | |
| 1080 | 1080 | /* reset the texture to force an update */ |
| 1081 | 1081 | render_texture_set_bitmap(state->texture, state->bitmap, NULL, 0, screen_texformat); |
| r814 | r815 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 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" | |
| 15 | 16 | |
| 16 | In the video driver, follow these steps: | |
| 17 | 17 | |
| 18 | 1) Set each tilemap's scroll registers. | |
| 18 | /*************************************************************************** | |
| 19 | CONSTANTS | |
| 20 | ***************************************************************************/ | |
| 19 | 21 | |
| 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 | |
| 21 | 24 | |
| 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) | |
| 26 | 27 | |
| 27 | #if !defined(DECLARE) && !defined(TRANSP) | |
| 28 | 28 | |
| 29 | #include "driver.h" | |
| 30 | #include "osinline.h" | |
| 31 | #include "tilemap.h" | |
| 32 | #include "profiler.h" | |
| 33 | 29 | |
| 34 | #define SWAP(X,Y) { UINT32 temp=X; X=Y; Y=temp; } | |
| 35 | #define MAX_TILESIZE 64 | |
| 30 | /*************************************************************************** | |
| 31 | TYPE DEFINITIONS | |
| 32 | ***************************************************************************/ | |
| 36 | 33 | |
| 37 | #define TILE_FLAG_DIRTY (0x80) | |
| 34 | /* logical index */ | |
| 35 | typedef UINT32 tilemap_logical_index; | |
| 38 | 36 | |
| 39 | typedef enum { eWHOLLY_TRANSPARENT, eWHOLLY_OPAQUE, eMASKED } trans_t; | |
| 40 | 37 | |
| 41 | typedef void (*tilemap_draw_func)( tilemap *tmap, int xpos, int ypos, int mask, int value ); | |
| 38 | /* internal set of transparency states for rendering */ | |
| 39 | typedef enum | |
| 40 | { | |
| 41 | WHOLLY_TRANSPARENT, | |
| 42 | WHOLLY_OPAQUE, | |
| 43 | MASKED | |
| 44 | } trans_t; | |
| 42 | 45 | |
| 46 | ||
| 47 | /* internal blitting callbacks */ | |
| 48 | typedef void (*blitmask_t)(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 49 | typedef void (*blitopaque_t)(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 50 | ||
| 51 | ||
| 52 | /* blitting parameters for rendering */ | |
| 53 | typedef struct _blit_parameters blit_parameters; | |
| 54 | struct _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 */ | |
| 43 | 67 | struct _tilemap |
| 44 | 68 | { |
| 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 */ | |
| 49 | 70 | |
| 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 | ||
| 50 | 87 | /* 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 */ | |
| 53 | 91 | |
| 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 */ | |
| 57 | 98 | |
| 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 */ | |
| 60 | 108 | |
| 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 */ | |
| 63 | 111 | |
| 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 | }; | |
| 65 | 118 | |
| 66 | INT32 dx, dx_if_flipped; | |
| 67 | INT32 dy, dy_if_flipped; | |
| 68 | INT32 scrollx_delta, scrolly_delta; | |
| 69 | 119 | |
| 70 | INT32 enable; | |
| 71 | INT32 attributes; | |
| 72 | 120 | |
| 73 | tilemap_type type; | |
| 74 | INT32 transparent_pen; | |
| 75 | UINT32 fgmask[4], bgmask[4]; /* for TILEMAP_TYPE_SPLIT */ | |
| 121 | /*************************************************************************** | |
| 122 | GLOBAL VARIABLES | |
| 123 | ***************************************************************************/ | |
| 76 | 124 | |
| 77 | ||
| 125 | mame_bitmap * pri | |
| 78 | 126 | |
| 79 | UINT8 (*draw_tile)( tilemap *tmap, UINT32 col, UINT32 row, UINT32 flags ); | |
| 127 | static tilemap * tilemap_list; | |
| 128 | static tilemap ** tilemap_tailptr; | |
| 129 | static int tilemap_instance; | |
| 80 | 130 | |
| 81 | INT32 cached_scroll_rows, cached_scroll_cols; | |
| 82 | INT32 *cached_rowscroll, *cached_colscroll; | |
| 131 | static UINT32 screen_width, screen_height; | |
| 83 | 132 | |
| 84 | INT32 logical_scroll_rows, logical_scroll_cols; | |
| 85 | INT32 *logical_rowscroll, *logical_colscroll; | |
| 86 | 133 | |
| 87 | INT32 orientation; | |
| 88 | INT32 palette_offset; | |
| 89 | 134 | |
| 90 | UINT16 tile_depth, tile_granularity; | |
| 91 | UINT8 all_tiles_dirty; | |
| 92 | UINT8 all_tiles_clean; | |
| 135 | /*************************************************************************** | |
| 136 | FUNCTION PROTOTYPES | |
| 137 | ***************************************************************************/ | |
| 93 | 138 | |
| 94 | /* cached color data */ | |
| 95 | mame_bitmap *pixmap; | |
| 96 | UINT32 pixmap_pitch_line; | |
| 97 | UINT32 pixmap_pitch_row; | |
| 139 | /* system management helpers */ | |
| 140 | static void tilemap_exit(running_machine *machine); | |
| 141 | static void tilemap_postload(void *param); | |
| 142 | static void tilemap_dispose(tilemap *tmap); | |
| 98 | 143 | |
| 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 */ | |
| 145 | static void mappings_create(tilemap *tmap); | |
| 146 | static void mappings_update(tilemap *tmap); | |
| 103 | 147 | |
| 104 | struct _tilemap *next; /* resource tracking */ | |
| 105 | }; | |
| 148 | /* tile rendering */ | |
| 149 | static void pixmap_update(tilemap *tmap, const rectangle *cliprect); | |
| 150 | static void tile_update(tilemap *tmap, tilemap_logical_index logindex, UINT32 cached_col, UINT32 cached_row); | |
| 151 | static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags); | |
| 152 | static UINT8 tile_draw_colortable(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags); | |
| 153 | static UINT8 tile_draw_colortrans(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags); | |
| 154 | static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags); | |
| 106 | 155 | |
| 107 | mame_bitmap * priority_bitmap; | |
| 108 | UINT32 priority_bitmap_pitch_line; | |
| 109 | UINT32 priority_bitmap_pitch_row; | |
| 156 | /* drawing helpers */ | |
| 157 | static void configure_blit_parameters(blit_parameters *blit, tilemap *tmap, mame_bitmap *dest, const rectangle *cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask); | |
| 158 | static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, int xpos, int ypos); | |
| 159 | static 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); | |
| 110 | 161 | |
| 111 | static tilemap * first_tilemap; /* resource tracking */ | |
| 112 | static UINT32 screen_width, screen_height; | |
| 113 | static tile_data tile_info; | |
| 162 | /* scanline rasterizers for drawing to the pixmap */ | |
| 163 | static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 164 | static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 165 | static void scanline_draw_opaque_ind16(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 166 | static void scanline_draw_masked_ind16(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 167 | static void scanline_draw_opaque_rgb16(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 168 | static void scanline_draw_masked_rgb16(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 169 | static void scanline_draw_opaque_rgb16_alpha(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 170 | static void scanline_draw_masked_rgb16_alpha(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 171 | static void scanline_draw_opaque_rgb32(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 172 | static void scanline_draw_masked_rgb32(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 173 | static void scanline_draw_opaque_rgb32_alpha(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 174 | static void scanline_draw_masked_rgb32_alpha(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 114 | 175 | |
| 115 | typedef void (*blitmask_t)( void *dest, const void *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode ); | |
| 116 | typedef void (*blitopaque_t)( void *dest, const void *source, int count, UINT8 *pri, UINT32 pcode ); | |
| 117 | 176 | |
| 118 | /* the following parameters are constant across tilemap_draw calls */ | |
| 119 | static 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 | ||
| 188 | INLINE INT32 effective_rowscroll(tilemap *tmap, int index) | |
| 120 | 189 | { |
| 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; | |
| 129 | 191 | |
| 130 | /***********************************************************************************/ | |
| 192 | /* if we're flipping vertically, adjust the row number */ | |
| 193 | if (tmap->attributes & TILEMAP_FLIPY) | |
| 194 | index = tmap->scrollrows - 1 - index; | |
| 131 | 195 | |
| 132 | static void tilemap_exit( running_machine *machine ); | |
| 133 | static void tilemap_dispose( tilemap *tmap ); | |
| 134 | static void PenToPixel_Init( tilemap *tmap ); | |
| 135 | static void PenToPixel_Term( tilemap *tmap ); | |
| 136 | static void mappings_create( tilemap *tmap ); | |
| 137 | static void mappings_dispose( tilemap *tmap ); | |
| 138 | static void mappings_update( tilemap *tmap ); | |
| 139 | static 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]; | |
| 140 | 201 | |
| 141 | static 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 | } | |
| 142 | 209 | |
| 143 | static void update_tile_info( tilemap *tmap, UINT32 cached_indx, UINT32 cached_col, UINT32 cached_row ); | |
| 144 | 210 | |
| 145 | /***********************************************************************************/ | |
| 211 | /*------------------------------------------------- | |
| 212 | effective_colscroll - return the effective | |
| 213 | colscroll value for a given index, taking into | |
| 214 | account tilemap flip states | |
| 215 | -------------------------------------------------*/ | |
| 146 | 216 | |
| 147 | ||
| 217 | INLINE INT32 | |
| 148 | 218 | { |
| 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; | |
| 157 | 220 | |
| 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; | |
| 161 | 224 | |
| 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]; | |
| 176 | 230 | |
| 177 | static 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; | |
| 184 | 237 | } |
| 185 | 238 | |
| 186 | void tilemap_set_transparent_pen( tilemap *tmap, int pen ) | |
| 187 | { | |
| 188 | tmap->transparent_pen = pen; | |
| 189 | } | |
| 190 | 239 | |
| 191 | void tilemap_set_transmask( tilemap *tmap, int which, UINT32 fgmask, UINT32 bgmask ) | |
| 240 | /*------------------------------------------------- | |
| 241 | indexed_tilemap - return a tilemap by index | |
| 242 | -------------------------------------------------*/ | |
| 243 | ||
| 244 | INLINE tilemap *indexed_tilemap(int index) | |
| 192 | 245 | { |
| 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; | |
| 199 | 254 | } |
| 200 | 255 | |
| 201 | void 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 | ||
| 266 | void tilemap_init(running_machine *machine) | |
| 202 | 267 | { |
| 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); | |
| 205 | 277 | } |
| 206 | 278 | |
| 207 | /***********************************************************************************/ | |
| 208 | /* some common mappings */ | |
| 209 | 279 | |
| 210 | UINT32 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 | ||
| 289 | tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_callback mapper, tilemap_type type, int tilewidth, int tileheight, int cols, int rows) | |
| 211 | 290 | { |
| 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; | |
| 214 | 358 | } |
| 215 | UINT32 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 | } | |
| 220 | UINT32 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 | } | |
| 225 | UINT32 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 | } | |
| 230 | 359 | |
| 231 | UINT32 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 | ||
| 366 | void tilemap_set_user_data(tilemap *tmap, void *user_data) | |
| 232 | 367 | { |
| 233 | /* logical (col,row) -> memory offset */ | |
| 234 | return col*num_rows + row; | |
| 368 | tmap->user_data = user_data; | |
| 235 | 369 | } |
| 236 | UINT32 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 | } | |
| 241 | UINT32 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 | } | |
| 246 | UINT32 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 | } | |
| 251 | 370 | |
| 252 | /***********************************************************************************/ | |
| 253 | 371 | |
| 254 | static 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 | ||
| 378 | void tilemap_set_palette_offset(tilemap *tmap, UINT32 offset) | |
| 255 | 379 | { |
| 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) | |
| 262 | 381 | { |
| 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); | |
| 268 | 384 | } |
| 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 ); | |
| 275 | 385 | } |
| 276 | 386 | |
| 277 | static 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 | ||
| 394 | void tilemap_set_enable(tilemap *tmap, int enable) | |
| 278 | 395 | { |
| 279 | free( tmap->cached_indx_to_memory_offset ); | |
| 280 | free( tmap->memory_offset_to_cached_indx ); | |
| 396 | tmap->enable = (enable != 0); | |
| 281 | 397 | } |
| 282 | 398 | |
| 283 | static 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 | ||
| 406 | void tilemap_set_flip(tilemap *tmap, UINT32 attributes) | |
| 284 | 407 | { |
| 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) | |
| 292 | 410 | { |
| 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); | |
| 294 | 413 | } |
| 295 | 414 | |
| 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) | |
| 297 | 417 | { |
| 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); | |
| 308 | 420 | } |
| 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 | } | |
| 316 | 421 | } |
| 317 | 422 | |
| 318 | /***********************************************************************************/ | |
| 319 | 423 | |
| 320 | static void pio( void *dest, const void *source, int count, UINT8 *pri, UINT32 pcode ) | |
| 321 | { | |
| 322 | int i; | |
| 323 | 424 | |
| 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 | ***************************************************************************/ | |
| 330 | 428 | |
| 331 | static 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 | ||
| 434 | void tilemap_mark_tile_dirty(tilemap *tmap, tilemap_memory_index memindex) | |
| 332 | 435 | { |
| 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]; | |
| 334 | 440 | |
| 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) | |
| 337 | 443 | { |
| 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; | |
| 342 | 446 | } |
| 447 | } | |
| 343 | 448 | } |
| 344 | 449 | |
| 345 | /***********************************************************************************/ | |
| 346 | 450 | |
| 347 | #ifndef pdo16 | |
| 348 | static 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 | ||
| 456 | void tilemap_mark_all_tiles_dirty(tilemap *tmap) | |
| 349 | 457 | { |
| 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) | |
| 353 | 460 | { |
| 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); | |
| 355 | 463 | } |
| 356 | } | |
| 357 | #endif | |
| 358 | 464 | |
| 359 | #ifndef pdo16pal | |
| 360 | static 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 | |
| 365 | 467 | { |
| 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; | |
| 368 | 470 | } |
| 369 | 471 | } |
| 370 | #endif | |
| 371 | 472 | |
| 372 | static 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 | ||
| 485 | void tilemap_map_pens_to_layer(tilemap *tmap, int group, pen_t pen, pen_t mask, UINT8 layermask) | |
| 373 | 486 | { |
| 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); | |
| 380 | 514 | } |
| 381 | 515 | |
| 382 | #ifndef pdo16np | |
| 383 | static 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 | ||
| 523 | void tilemap_set_transparent_pen(tilemap *tmap, pen_t pen) | |
| 384 | 524 | { |
| 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); | |
| 386 | 530 | } |
| 387 | #endif | |
| 388 | 531 | |
| 389 | static 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 | ||
| 540 | void tilemap_set_transmask(tilemap *tmap, int group, UINT32 fgmask, UINT32 bgmask) | |
| 390 | 541 | { |
| 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++) | |
| 394 | 546 | { |
| 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); | |
| 397 | 550 | } |
| 398 | 551 | } |
| 399 | 552 | |
| 400 | static 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 | ||
| 565 | void tilemap_set_scroll_rows(tilemap *tmap, UINT32 scroll_rows) | |
| 401 | 566 | { |
| 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; | |
| 408 | 569 | } |
| 409 | 570 | |
| 410 | #ifndef pdo32 | |
| 411 | static 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 | ||
| 578 | void tilemap_set_scroll_cols(tilemap *tmap, UINT32 scroll_cols) | |
| 412 | 579 | { |
| 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; | |
| 420 | 582 | } |
| 421 | #endif | |
| 422 | 583 | |
| 423 | static 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 | ||
| 591 | void tilemap_set_scrolldx(tilemap *tmap, int dx, int dx_flipped) | |
| 424 | 592 | { |
| 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; | |
| 431 | 595 | } |
| 432 | 596 | |
| 433 | #ifndef npdo32 | |
| 434 | static 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 | ||
| 604 | void tilemap_set_scrolldy(tilemap *tmap, int dy, int dy_flipped) | |
| 435 | 605 | { |
| 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; | |
| 461 | 608 | } |
| 462 | #endif | |
| 463 | 609 | |
| 464 | /***********************************************************************************/ | |
| 465 | 610 | |
| 466 | #ifndef pdt16 | |
| 467 | static 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 | -------------------------------------------------*/ | |
| 470 | 616 | |
| 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 | } | |
| 617 | int tilemap_get_scrolldx(tilemap *tmap) | |
| 618 | { | |
| 619 | return (tmap->attributes & TILEMAP_FLIPX) ? tmap->dx_flipped : tmap->dx; | |
| 479 | 620 | } |
| 480 | #endif | |
| 481 | 621 | |
| 482 | #ifndef pdt16pal | |
| 483 | static 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; | |
| 487 | 622 | |
| 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 | -------------------------------------------------*/ | |
| 498 | 628 | |
| 499 | #ifndef pdt16np | |
| 500 | static void pdt16np( UINT16 *dest, const UINT16 *source, const UINT8 *pMask, int mask, int value, int count, UINT8 *pri, UINT32 pcode ) | |
| 629 | int tilemap_get_scrolldy(tilemap *tmap) | |
| 501 | 630 | { |
| 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; | |
| 509 | 632 | } |
| 510 | #endif | |
| 511 | 633 | |
| 512 | static 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 | ||
| 640 | void tilemap_set_scrollx(tilemap *tmap, int which, int value) | |
| 513 | 641 | { |
| 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; | |
| 524 | 644 | } |
| 525 | 645 | |
| 526 | #ifndef pdt32 | |
| 527 | static 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 | ||
| 652 | void tilemap_set_scrolly(tilemap *tmap, int which, int value) | |
| 528 | 653 | { |
| 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; | |
| 539 | 656 | } |
| 540 | #endif | |
| 541 | 657 | |
| 542 | #ifndef npdt32 | |
| 543 | static 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]; | |
| 549 | 658 | |
| 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 | |
| 564 | 659 | |
| 565 | /***********************************************************************************/ | |
| 660 | /*************************************************************************** | |
| 661 | INTERNAL MAP ACCESS | |
| 662 | ***************************************************************************/ | |
| 566 | 663 | |
| 567 | static 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 | -------------------------------------------------*/ | |
| 577 | 668 | |
| 578 | #ifndef pbo32 | |
| 579 | static void pbo32( UINT32 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode ) | |
| 669 | mame_bitmap *tilemap_get_pixmap(tilemap *tmap) | |
| 580 | 670 | { |
| 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; | |
| 588 | 674 | } |
| 589 | #endif | |
| 590 | 675 | |
| 591 | #ifndef npbo32 | |
| 592 | static 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 | |
| 612 | 676 | |
| 613 | /***********************************************************************************/ | |
| 677 | /*------------------------------------------------- | |
| 678 | tilemap_get_flagsmap - return a pointer to the | |
| 679 | (updated) internal flagsmap for a tilemap | |
| 680 | -------------------------------------------------*/ | |
| 614 | 681 | |
| 615 | ||
| 682 | m | |
| 616 | 683 | { |
| 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; | |
| 627 | 687 | } |
| 628 | 688 | |
| 629 | #ifndef pbt32 | |
| 630 | static 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 | ||
| 695 | UINT8 *tilemap_get_tile_flags(tilemap *tmap) | |
| 631 | 696 | { |
| 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; | |
| 642 | 700 | } |
| 643 | #endif | |
| 644 | 701 | |
| 645 | #ifndef npbt32 | |
| 646 | static 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 | ||
| 714 | void tilemap_draw_primask(mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask) | |
| 647 | 715 | { |
| 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; | |
| 652 | 719 | |
| 653 | for( i=0; i<oddcount; i++ ) | |
| 720 | /* skip if disabled */ | |
| 721 | if (!tmap->enable) | |
| 722 | return; | |
| 723 | ||
| 724 | profiler_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) | |
| 654 | 731 | { |
| 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; | |
| 656 | 734 | } |
| 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) | |
| 659 | 738 | { |
| 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); | |
| 664 | 746 | } |
| 665 | } | |
| 666 | #endif | |
| 667 | 747 | |
| 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; | |
| 669 | 755 | |
| 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); | |
| 674 | 760 | |
| 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; | |
| 679 | 765 | |
| 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; | |
| 684 | 769 | |
| 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); | |
| 689 | 777 | |
| 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 | } | |
| 691 | 784 | |
| 692 | static void install_draw_handlers( tilemap *tmap ) | |
| 693 | { | |
| 694 | switch (tmap->type) | |
| 785 | /* scrolling columns + horizontal scroll */ | |
| 786 | else if (tmap->scrollrows == 1) | |
| 695 | 787 | { |
| 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; | |
| 700 | 792 | |
| 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); | |
| 704 | 797 | |
| 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; | |
| 708 | 802 | |
| 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; | |
| 712 | 806 | |
| 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); | |
| 716 | 814 | |
| 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 | } | |
| 720 | 820 | } |
| 821 | profiler_mark(PROFILER_END); | |
| 721 | 822 | } |
| 722 | 823 | |
| 723 | INLINE 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; | |
| 729 | 824 | |
| 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 | -------------------------------------------------*/ | |
| 736 | 831 | |
| 737 | ||
| 738 | /***********************************************************************************/ | |
| 739 | ||
| 740 | void tilemap_init( running_machine *machine ) | |
| 832 | void 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) | |
| 741 | 835 | { |
| 742 | screen_width = Machine->screen[0].width; | |
| 743 | screen_height = Machine->screen[0].height; | |
| 744 | first_tilemap = NULL; | |
| 836 | blit_parameters blit; | |
| 745 | 837 | |
| 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 | */ | |
| 750 | 842 | |
| 751 | static void tilemap_exit( running_machine *machine ) | |
| 752 | { | |
| 753 | tilemap *next; | |
| 843 | /* skip if disabled */ | |
| 844 | if (!tmap->enable) | |
| 845 | return; | |
| 754 | 846 | |
| 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) | |
| 756 | 849 | { |
| 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; | |
| 760 | 854 | } |
| 761 | } | |
| 762 | 855 | |
| 763 | /***********************************************************************************/ | |
| 856 | profiler_mark(PROFILER_TILEMAP_DRAW_ROZ); | |
| 857 | /* configure the blit parameters */ | |
| 858 | configure_blit_parameters(&blit, tmap, dest, cliprect, flags, priority, priority_mask); | |
| 764 | 859 | |
| 765 | static 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); | |
| 865 | profiler_mark(PROFILER_END); | |
| 771 | 866 | } |
| 772 | 867 | |
| 773 | 868 | |
| 774 | tilemap *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 | ||
| 878 | int tilemap_count(void) | |
| 780 | 879 | { |
| 781 | 880 | tilemap *tmap; |
| 782 | UINT32 row; | |
| 783 | int num_tiles; | |
| 784 | int instance = 0; | |
| 785 | tilemap *tm; | |
| 881 | int count = 0; | |
| 786 | 882 | |
| 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 | } | |
| 789 | 888 | |
| 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; | |
| 810 | 889 | |
| 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 | -------------------------------------------------*/ | |
| 819 | 894 | |
| 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)); | |
| 895 | void 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 | } | |
| 824 | 901 | |
| 825 | tmap->transparency_data = malloc_or_die( num_tiles ); | |
| 826 | tmap->transparency_data_row = malloc_or_die( sizeof(UINT8 *)*num_rows ); | |
| 827 | 902 | |
| 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 | -------------------------------------------------*/ | |
| 830 | 908 | |
| 831 | mappings_create( tmap ); | |
| 909 | void 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; | |
| 832 | 914 | |
| 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); | |
| 835 | 917 | |
| 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; | |
| 838 | 921 | |
| 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) | |
| 840 | 924 | { |
| 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; | |
| 842 | 927 | } |
| 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; | |
| 848 | 928 | |
| 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 | } | |
| 850 | 934 | |
| 851 | recalculate_scroll(tmap); | |
| 852 | 935 | |
| 853 | /* compute the index of this entry */ | |
| 854 | for (tm = first_tilemap; tm; tm = tm->next) | |
| 855 | instance++; | |
| 856 | 936 | |
| 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 | ***************************************************************************/ | |
| 879 | 940 | |
| 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 | -------------------------------------------------*/ | |
| 884 | 948 | |
| 885 | ||
| 949 | TILEMAP_MAPPER( | |
| 886 | 950 | { |
| 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; | |
| 910 | 952 | } |
| 911 | 953 | |
| 912 | /***********************************************************************************/ | |
| 913 | ||
| 914 | void tilemap_set_enable( tilemap *tmap, int enable ) | |
| 954 | TILEMAP_MAPPER( tilemap_scan_rows_flip_x ) | |
| 915 | 955 | { |
| 916 | | |
| 956 | r | |
| 917 | 957 | } |
| 918 | 958 | |
| 919 | ||
| 920 | void tilemap_set_flip( tilemap *tmap, int attributes ) | |
| 959 | TILEMAP_MAPPER( tilemap_scan_rows_flip_y ) | |
| 921 | 960 | { |
| 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 | } | |
| 939 | 963 | |
| 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 | } | |
| 964 | TILEMAP_MAPPER( tilemap_scan_rows_flip_xy ) | |
| 965 | { | |
| 966 | return (num_rows - 1 - row) * num_cols + (num_cols - 1 - col); | |
| 949 | 967 | } |
| 950 | 968 | |
| 951 | /***********************************************************************************/ | |
| 952 | 969 | |
| 953 | void 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 | ||
| 978 | TILEMAP_MAPPER( tilemap_scan_cols ) | |
| 954 | 979 | { |
| 955 | tmap->logical_scroll_cols = n; | |
| 956 | tmap->cached_scroll_cols = n; | |
| 980 | return col * num_rows + row; | |
| 957 | 981 | } |
| 958 | 982 | |
| 959 | ||
| 983 | TILEMAP_MAPPER( tilemap_scan_ | |
| 960 | 984 | { |
| 961 | tmap->logical_scroll_rows = n; | |
| 962 | tmap->cached_scroll_rows = n; | |
| 985 | return (num_cols - 1 - col) * num_rows + row; | |
| 963 | 986 | } |
| 964 | 987 | |
| 965 | /***********************************************************************************/ | |
| 966 | ||
| 967 | void tilemap_mark_tile_dirty( tilemap *tmap, int memory_offset ) | |
| 988 | TILEMAP_MAPPER( tilemap_scan_cols_flip_y ) | |
| 968 | 989 | { |
| 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); | |
| 978 | 991 | } |
| 979 | 992 | |
| 980 | ||
| 993 | TILEMAP_MAPPER( tilemap_scan | |
| 981 | 994 | { |
| 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); | |
| 996 | 996 | } |
| 997 | 997 | |
| 998 | /***********************************************************************************/ | |
| 999 | 998 | |
| 1000 | static 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; | |
| 1006 | 999 | |
| 1007 | profiler_mark(PROFILER_TILEMAP_UPDATE); | |
| 1000 | /*************************************************************************** | |
| 1001 | SYSTEM MANAGEMENT HELPERS | |
| 1002 | ***************************************************************************/ | |
| 1008 | 1003 | |
| 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 | -------------------------------------------------*/ | |
| 1015 | 1008 | |
| 1016 | tmap->transparency_data[cached_indx] = tmap->draw_tile(tmap,x0,y0,flags ); | |
| 1017 | ||
| 1018 | profiler_mark(PROFILER_END); | |
| 1009 | static 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; | |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | mame_bitmap *tilemap_get_pixmap( tilemap * tmap ) | |
| 1021 | ||
| 1022 | /*------------------------------------------------- | |
| 1023 | tilemap_postload - after loading a save state | |
| 1024 | invalidate everything | |
| 1025 | -------------------------------------------------*/ | |
| 1026 | ||
| 1027 | static void tilemap_postload(void *param) | |
| 1022 | 1028 | { |
| 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 | } | |
| 1025 | 1033 | |
| 1026 | if (!tmap) | |
| 1027 | return 0; | |
| 1028 | 1034 | |
| 1029 | if (tmap->all_tiles_clean == 0) | |
| 1030 | { | |
| 1031 | profiler_mark(PROFILER_TILEMAP_DRAW); | |
| 1035 | /*------------------------------------------------- | |
| 1036 | tilemap_dispose - dispose of a tilemap | |
| 1037 | -------------------------------------------------*/ | |
| 1032 | 1038 | |
| 1033 | /* if the whole map is dirty, mark it as such */ | |
| 1034 | if (tmap->all_tiles_dirty) | |
| 1039 | static 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) | |
| 1035 | 1046 | { |
| 1036 | memset( tmap->transparency_data, TILE_FLAG_DIRTY, tmap->num_tiles ); | |
| 1037 | tmap->all_tiles_dirty = 0; | |
| 1047 | *tmapptr = tmap->next; | |
| 1048 | break; | |
| 1038 | 1049 | } |
| 1039 | 1050 | |
| 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 | } | |
| 1042 | 1062 | |
| 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 */ | |
| 1055 | 1063 | |
| 1056 | tmap->all_tiles_clean = 1; | |
| 1057 | 1064 | |
| 1058 | profiler_mark(PROFILER_END); | |
| 1059 | } | |
| 1065 | /*************************************************************************** | |
| 1066 | LOGICAL <-> MEMORY INDEX MAPPING | |
| 1067 | ***************************************************************************/ | |
| 1060 | 1068 | |
| 1061 | return tmap->pixmap; | |
| 1062 | } | |
| 1069 | /*------------------------------------------------- | |
| 1070 | mappings_create - allocate memory for the | |
| 1071 | mapping tables and compute their extents | |
| 1072 | -------------------------------------------------*/ | |
| 1063 | 1073 | |
| 1064 | ||
| 1074 | s | |
| 1065 | 1075 | { |
| 1066 | return tmap->transparency_bitmap; | |
| 1067 | } | |
| 1076 | UINT32 col, row; | |
| 1068 | 1077 | |
| 1069 | UINT8 *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); | |
| 1072 | 1097 | } |
| 1073 | 1098 | |
| 1074 | /***********************************************************************************/ | |
| 1075 | 1099 | |
| 1076 | static void | |
| 1077 | recalculate_scroll( tilemap *tmap ) | |
| 1100 | /*------------------------------------------------- | |
| 1101 | mappings_update - update the mappings after | |
| 1102 | a major change (flip x/y changes) | |
| 1103 | -------------------------------------------------*/ | |
| 1104 | ||
| 1105 | static void mappings_update(tilemap *tmap) | |
| 1078 | 1106 | { |
| 1079 | int i; | |
| 1107 | tilemap_logical_index logindex; | |
| 1108 | tilemap_memory_index memindex; | |
| 1080 | 1109 | |
| 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; | |
| 1083 | 1113 | |
| 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++) | |
| 1085 | 1116 | { |
| 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; | |
| 1087 | 1132 | } |
| 1088 | for( i=0; i<tmap->logical_scroll_cols; i++ ) | |
| 1089 | { | |
| 1090 | tilemap_set_scrolly( tmap, i, tmap->logical_colscroll[i] ); | |
| 1091 | } | |
| 1092 | } | |
| 1093 | 1133 | |
| 1094 | void | |
| 1095 | tilemap_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); | |
| 1100 | 1136 | } |
| 1101 | 1137 | |
| 1102 | void | |
| 1103 | tilemap_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 | } | |
| 1109 | 1138 | |
| 1110 | int | |
| 1111 | tilemap_get_scrolldx( tilemap *tmap ) | |
| 1112 | { | |
| 1113 | return (tmap->attributes & TILEMAP_FLIPX) ? tmap->dx_if_flipped : tmap->dx; | |
| 1114 | } | |
| 1115 | 1139 | |
| 1116 | int | |
| 1117 | tilemap_get_scrolldy( tilemap *tmap ) | |
| 1118 | { | |
| 1119 | return (tmap->attributes & TILEMAP_FLIPY) ? tmap->dy_if_flipped : tmap->dy; | |
| 1120 | } | |
| 1140 | /*************************************************************************** | |
| 1141 | TILE RENDERING | |
| 1142 | ***************************************************************************/ | |
| 1121 | 1143 | |
| 1122 | void 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 | ||
| 1149 | static void pixmap_update(tilemap *tmap, const rectangle *cliprect) | |
| 1123 | 1150 | { |
| 1124 | tmap->logical_rowscroll[which] = value; | |
| 1125 | value = tmap->scrollx_delta-value; /* adjust */ | |
| 1151 | int mincol, maxcol, minrow, maxrow; | |
| 1152 | int row, col; | |
| 1126 | 1153 | |
| 1127 | if( tmap->orientation & ORIENTATION_FLIP_Y ) | |
| 1154 | /* if everything is clean, do nothing */ | |
| 1155 | if (tmap->all_tiles_clean) | |
| 1156 | return; | |
| 1157 | ||
| 1158 | profiler_mark(PROFILER_TILEMAP_DRAW); | |
| 1159 | ||
| 1160 | /* compute which columns and rows to update */ | |
| 1161 | if (cliprect != NULL) | |
| 1128 | 1162 | { |
| 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; | |
| 1131 | 1167 | } |
| 1132 | | |
| 1168 | | |
| 1133 | 1169 | { |
| 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; | |
| 1136 | 1173 | } |
| 1137 | tmap->cached_rowscroll[which] = value; | |
| 1138 | } | |
| 1139 | 1174 | |
| 1140 | void 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) | |
| 1146 | 1177 | { |
| 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; | |
| 1149 | 1180 | } |
| 1150 | if( tmap->orientation & ORIENTATION_FLIP_Y ) | |
| 1181 | ||
| 1182 | /* iterate over rows */ | |
| 1183 | for (row = minrow; row <= maxrow; row++) | |
| 1151 | 1184 | { |
| 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); | |
| 1154 | 1191 | } |
| 1155 | tmap->cached_colscroll[which] = value; | |
| 1156 | } | |
| 1157 | 1192 | |
| 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; | |
| 1159 | 1196 | |
| 1160 | void tilemap_set_palette_offset( tilemap *tmap, int offset ) | |
| 1161 | { | |
| 1162 | tmap->palette_offset = offset; | |
| 1197 | profiler_mark(PROFILER_END); | |
| 1163 | 1198 | } |
| 1164 | 1199 | |
| 1165 | /***********************************************************************************/ | |
| 1166 | 1200 | |
| 1167 | void tilemap_set_user_data( tilemap *tmap, void *user_data ) | |
| 1201 | /*------------------------------------------------- | |
| 1202 | tile_update - update a single dirty tile | |
| 1203 | -------------------------------------------------*/ | |
| 1204 | ||
| 1205 | static void tile_update(tilemap *tmap, tilemap_logical_index logindex, UINT32 col, UINT32 row) | |
| 1168 | 1206 | { |
| 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; | |
| 1171 | 1211 | |
| 1172 | ||
| 1212 | profiler_mark(PROFILER_TILEMAP_UPDATE); | |
| 1173 | 1213 | |
| 1174 | void 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 | ||
| 1236 | profiler_mark(PROFILER_END); | |
| 1177 | 1237 | } |
| 1178 | 1238 | |
| 1179 | void 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 | ||
| 1247 | static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags) | |
| 1180 | 1248 | { |
| 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; | |
| 1186 | 1257 | |
| 1187 | profiler_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) | |
| 1189 | 1263 | { |
| 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 | } | |
| 1195 | 1267 | |
| 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 | } | |
| 1211 | 1274 | |
| 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; | |
| 1215 | 1277 | |
| 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; | |
| 1219 | 1284 | |
| 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)) | |
| 1222 | 1290 | { |
| 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; | |
| 1226 | 1294 | |
| 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; | |
| 1229 | 1302 | |
| 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 | } | |
| 1235 | 1311 | } |
| 1312 | ||
| 1313 | /* 4bpp data */ | |
| 1236 | 1314 | else |
| 1237 | 1315 | { |
| 1238 | blit.screen_bitmap_pitch_line = dest->rowpixels; | |
| 1239 | switch( dest->format ) | |
| 1316 | for (tx = 0; tx < width; tx++) | |
| 1240 | 1317 | { |
| 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; | |
| 1299 | 1320 | |
| 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; | |
| 1306 | 1328 | |
| 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; | |
| 1313 | 1336 | } |
| 1314 | else | |
| 1315 | { | |
| 1316 | mask |= TILE_FLAG_FG_OPAQUE; | |
| 1317 | value |= TILE_FLAG_FG_OPAQUE; | |
| 1318 | } | |
| 1319 | 1337 | } |
| 1338 | } | |
| 1339 | return andmask ^ ormask; | |
| 1340 | } | |
| 1320 | 1341 | |
| 1321 | blit.tilemap_priority_code = (priority & 0xff) | ((priority_mask & 0xff) << 8) | (tmap->palette_offset << 16); | |
| 1322 | 1342 | |
| 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 | -------------------------------------------------*/ | |
| 1327 | 1349 | |
| 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 | } | |
| 1350 | static 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; | |
| 1336 | 1361 | |
| 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); | |
| 1345 | 1364 | |
| 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 | } | |
| 1350 | 1371 | |
| 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 | } | |
| 1370 | 1378 | |
| 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; | |
| 1379 | 1381 | |
| 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; | |
| 1382 | 1388 | |
| 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++) | |
| 1384 | 1396 | { |
| 1385 | int cons = 1; | |
| 1386 | int scrolly = colscroll[col]; | |
| 1397 | pen_t pen; | |
| 1398 | UINT8 map; | |
| 1387 | 1399 | |
| 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; | |
| 1392 | 1407 | |
| 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 | } | |
| 1401 | 1417 | |
| 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; | |
| 1406 | 1426 | |
| 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; | |
| 1414 | 1434 | |
| 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; | |
| 1429 | 1442 | } |
| 1430 | 1443 | } |
| 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 | } | |
| 1488 | 1444 | } |
| 1489 | ||
| 1445 | r | |
| 1490 | 1446 | } |
| 1491 | 1447 | |
| 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 | */ | |
| 1496 | void 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 | } | |
| 1503 | 1448 | |
| 1504 | void 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 | ||
| 1455 | static UINT8 tile_draw_colortrans(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags) | |
| 1508 | 1456 | { |
| 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) | |
| 1510 | 1472 | { |
| 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; | |
| 1514 | 1475 | } |
| 1515 | else | |
| 1476 | ||
| 1477 | /* if we're horizontally flipped, point to the rightmost column and work backwards */ | |
| 1478 | if (flags & TILE_FLIPX) | |
| 1516 | 1479 | { |
| 1517 | int mask,value; | |
| 1480 | x0 += width - 1; | |
| 1481 | dx0 = -1; | |
| 1482 | } | |
| 1518 | 1483 | |
| 1519 | profiler_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; | |
| 1525 | 1486 | |
| 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; | |
| 1527 | 1493 | |
| 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; | |
| 1541 | 1496 | |
| 1542 | switch( dest->format ) | |
| 1497 | /* 8bpp data */ | |
| 1498 | if (!(flags & TILE_4BPP)) | |
| 1499 | { | |
| 1500 | for (tx = 0; tx < width; tx++) | |
| 1543 | 1501 | { |
| 1544 | case BITMAP_FORMAT_RGB32: | |
| 1502 | pen_t pen; | |
| 1503 | UINT8 map; | |
| 1545 | 1504 | |
| 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; | |
| 1563 | 1512 | |
| 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 | } | |
| 1567 | 1522 | |
| 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; | |
| 1573 | 1531 | |
| 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; | |
| 1577 | 1539 | |
| 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; | |
| 1593 | 1547 | } |
| 1594 | } /* tmap->enable */ | |
| 1595 | profiler_mark(PROFILER_END); | |
| 1548 | } | |
| 1596 | 1549 | } |
| 1550 | return andmask ^ ormask; | |
| 1597 | 1551 | } |
| 1598 | 1552 | |
| 1599 | UINT32 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 | ||
| 1560 | static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags) | |
| 1600 | 1561 | { |
| 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) | |
| 1604 | 1572 | { |
| 1605 | count++; | |
| 1606 | tmap = tmap->next; | |
| 1573 | y0 += height - 1; | |
| 1574 | dy0 = -1; | |
| 1607 | 1575 | } |
| 1608 | return count; | |
| 1609 | } | |
| 1610 | 1576 | |
| 1611 | static 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) | |
| 1618 | 1579 | { |
| 1619 | count++; | |
| 1620 | tmap = tmap->next; | |
| 1580 | x0 += width - 1; | |
| 1581 | dx0 = -1; | |
| 1621 | 1582 | } |
| 1622 | 1583 | |
| 1623 | number = (count-1)-number; | |
| 1624 | ||
| 1625 | tmap = first_tilemap; | |
| 1626 | while( number-- ) | |
| 1584 | /* iterate over rows */ | |
| 1585 | for (ty = 0; ty < height; ty++) | |
| 1627 | 1586 | { |
| 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 | } | |
| 1629 | 1605 | } |
| 1630 | return | |
| 1606 | return andmask ^ ormask; | |
| 1631 | 1607 | } |
| 1632 | 1608 | |
| 1633 | void 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 | } | |
| 1639 | 1609 | |
| 1640 | void 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 ); | |
| 1645 | 1610 | |
| 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 | ***************************************************************************/ | |
| 1654 | 1614 | |
| 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 | -------------------------------------------------*/ | |
| 1658 | 1621 | |
| 1659 | case BITMAP_FORMAT_INDEXED16: | |
| 1660 | blit.draw_opaque = (blitopaque_t)pdo16palnp; | |
| 1661 | break; | |
| 1622 | static 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)); | |
| 1662 | 1626 | |
| 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; | |
| 1666 | 1640 | } |
| 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; | |
| 1672 | 1641 | |
| 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); | |
| 1677 | 1644 | |
| 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) | |
| 1682 | 1647 | { |
| 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) | |
| 1687 | 1656 | { |
| 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; | |
| 1689 | 1675 | } |
| 1690 | 1676 | } |
| 1691 | } | |
| 1692 | 1677 | |
| 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; | |
| 1693 | 1681 | |
| 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; | |
| 1695 | 1685 | |
| 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); | |
| 1697 | 1689 | |
| 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); | |
| 1748 | 1695 | } |
| 1696 | } | |
| 1749 | 1697 | |
| 1750 | #ifdef DECLARE | |
| 1751 | 1698 | |
| 1752 | DECLARE(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 | ||
| 1705 | static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, int xpos, int ypos) | |
| 1757 | 1706 | { |
| 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; | |
| 1775 | 1717 | |
| 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); | |
| 1777 | 1724 | |
| 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; | |
| 1782 | 1728 | |
| 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) | |
| 1789 | 1732 | { |
| 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; | |
| 1794 | 1736 | } |
| 1795 | 1737 | |
| 1738 | /* convert screen coordinates to source tilemap coordinates */ | |
| 1739 | x1 -= xpos; | |
| 1740 | y1 -= ypos; | |
| 1741 | x2 -= xpos; | |
| 1742 | y2 -= ypos; | |
| 1796 | 1743 | |
| 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 (;;) | |
| 1798 | 1759 | { |
| 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; | |
| 1800 | 1765 | |
| 1801 | if (incxx == 0x10000) | |
| 1766 | /* iterate across the applicable tilemap columns */ | |
| 1767 | for (column = mincol; column <= maxcol; column++) | |
| 1802 | 1768 | { |
| 1803 | | |
| 1769 | | |
| 1804 | 1770 | |
| 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; | |
| 1807 | 1774 | |
| 1808 | if (startx >= srcbitmap->width) | |
| 1775 | /* for other columns we look up the transparency information */ | |
| 1776 | else | |
| 1809 | 1777 | { |
| 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; | |
| 1812 | 1791 | } |
| 1813 | 1792 | |
| 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) | |
| 1815 | 1804 | { |
| 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) | |
| 1817 | 1812 | { |
| 1818 | | |
| 1813 | | |
| 1819 | 1814 | { |
| 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); | |
| 1824 | 1816 | |
| 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; | |
| 1840 | 1820 | } |
| 1841 | starty += incyy; | |
| 1842 | sy++; | |
| 1843 | 1821 | } |
| 1844 | } | |
| 1845 | } | |
| 1846 | else | |
| 1847 | { | |
| 1848 | while (startx >= widthshifted && sx <= ex) | |
| 1849 | { | |
| 1850 | startx += incxx; | |
| 1851 | sx++; | |
| 1852 | } | |
| 1853 | 1822 | |
| 1854 | if (sx <= ex) | |
| 1855 | { | |
| 1856 | while (sy <= ey) | |
| 1823 | /* otherwise use the masked renderer */ | |
| 1824 | else | |
| 1857 | 1825 | { |
| 1858 | if (starty < heightshifted) | |
| 1826 | const UINT8 *mask0 = mask_baseaddr + x_start; | |
| 1827 | for (cury = y; cury < nexty; cury++) | |
| 1859 | 1828 | { |
| 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); | |
| 1864 | 1830 | |
| 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; | |
| 1880 | 1835 | } |
| 1881 | starty += incyy; | |
| 1882 | sy++; | |
| 1883 | 1836 | } |
| 1884 | 1837 | } |
| 1838 | ||
| 1839 | /* the new start is the end */ | |
| 1840 | x_start = x_end; | |
| 1841 | prev_trans = cur_trans; | |
| 1885 | 1842 | } |
| 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); | |
| 1886 | 1858 | } |
| 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) \ | |
| 1869 | do { \ | |
| 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 | ||
| 1882 | static 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) | |
| 1888 | 1921 | { |
| 1889 | if (wraparound) | |
| 1922 | /* skip without drawing until we are within the bitmap */ | |
| 1923 | while (startx >= widthshifted && sx <= ex) | |
| 1890 | 1924 | { |
| 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) | |
| 1893 | 1938 | { |
| 1939 | /* initialize X counters */ | |
| 1894 | 1940 | x = sx; |
| 1895 | 1941 | 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 */ | |
| 1898 | 1945 | 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) | |
| 1900 | 1952 | { |
| 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) | |
| 1902 | 1955 | { |
| 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; | |
| 1904 | 1958 | } |
| 1959 | ||
| 1960 | /* advance in X */ | |
| 1905 | 1961 | cx += incxx; |
| 1906 | cy += incxy; | |
| 1907 | 1962 | x++; |
| 1908 | dest+ | |
| 1963 | dest = (UINT8 *)dest + destadvance; | |
| 1909 | 1964 | pri++; |
| 1910 | 1965 | } |
| 1911 | startx += incyx; | |
| 1912 | starty += incyy; | |
| 1913 | sy++; | |
| 1914 | 1966 | } |
| 1967 | ||
| 1968 | /* advance in Y */ | |
| 1969 | starty += incyy; | |
| 1970 | sy++; | |
| 1915 | 1971 | } |
| 1916 | else | |
| 1972 | } | |
| 1973 | ||
| 1974 | /* wraparound case */ | |
| 1975 | else if (wraparound) | |
| 1976 | { | |
| 1977 | /* loop over rows */ | |
| 1978 | while (sy <= ey) | |
| 1917 | 1979 | { |
| 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) | |
| 1919 | 1991 | { |
| 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) | |
| 1926 | 1994 | { |
| 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) | |
| 1928 | 2035 | { |
| 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; | |
| 1933 | 2038 | } |
| 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++; | |
| 1943 | 2046 | } |
| 2047 | ||
| 2048 | /* advance in Y */ | |
| 2049 | startx += incyx; | |
| 2050 | starty += incyy; | |
| 2051 | sy++; | |
| 1944 | 2052 | } |
| 1945 | 2053 | } |
| 1946 | } | |
| 2054 | } | |
| 1947 | 2055 | |
| 1948 | #ifndef osd_pend | |
| 1949 | #define osd_pend() do { } while (0) | |
| 1950 | #endif | |
| 1951 | 2056 | |
| 1952 | DECLARE( 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 | ||
| 2067 | static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode) | |
| 1953 | 2068 | { |
| 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; | |
| 1971 | 2069 | 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; | |
| 1987 | 2070 | |
| 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) | |
| 1995 | 2073 | { |
| 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 | } | |
| 2001 | 2078 | |
| 2002 | /* convert screen coordinates to source tilemap coordinates */ | |
| 2003 | x1 -= xpos; | |
| 2004 | y1 -= ypos; | |
| 2005 | x2 -= xpos; | |
| 2006 | y2 -= ypos; | |
| 2007 | 2079 | |
| 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 | -------------------------------------------------*/ | |
| 2010 | 2084 | |
| 2011 | c1 = x1/tmap->cached_tile_width; /* round down */ | |
| 2012 | c2 = (x2+tmap->cached_tile_width-1)/tmap->cached_tile_width; /* round up */ | |
| 2085 | static 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; | |
| 2013 | 2088 | |
| 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 | } | |
| 2017 | 2097 | |
| 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; | |
| 2027 | 2098 | |
| 2028 | transPrev = eWHOLLY_TRANSPARENT; | |
| 2029 | pTrans = mask_baseaddr + x_start; | |
| 2030 | 2099 | |
| 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 | -------------------------------------------------*/ | |
| 2039 | 2104 | |
| 2040 | if( tmap->transparency_data[cached_indx]==TILE_FLAG_DIRTY ) | |
| 2041 | { | |
| 2042 | update_tile_info( tmap, cached_indx, column, row ); | |
| 2043 | } | |
| 2105 | static 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; | |
| 2044 | 2110 | |
| 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); | |
| 2054 | 2115 | |
| 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 | } | |
| 2061 | 2123 | |
| 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 | } | |
| 2068 | 2133 | |
| 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 | } | |
| 2076 | 2141 | |
| 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; | |
| 2090 | 2142 | |
| 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 | -------------------------------------------------*/ | |
| 2104 | 2147 | |
| 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; | |
| 2148 | static 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; | |
| 2111 | 2153 | |
| 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) | |
| 2113 | 2159 | { |
| 2114 | y_next = y2; | |
| 2160 | dest[i] = source[i] + pal; | |
| 2161 | pri[i] = (pri[i] & (pcode >> 8)) | pcode; | |
| 2115 | 2162 | } |
| 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 | } | |
| 2125 | 2164 | |
| 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 | } | |
| 2128 | 2173 | |
| 2129 | #undef DATA_TYPE | |
| 2130 | #undef DEPTH | |
| 2131 | #undef DECLARE | |
| 2132 | #endif /* DECLARE */ | |
| 2133 | 2174 | |
| 2134 | #ifdef TRANSP | |
| 2135 | /*************************************************************************************************/ | |
| 2136 | 2175 | |
| 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 | -------------------------------------------------*/ | |
| 2146 | 2180 | |
| 2147 | static | |
| 2181 | static void | |
| 2148 | 2182 | { |
| 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; | |
| 2172 | 2186 | |
| 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) | |
| 2179 | 2189 | { |
| 2180 | for | |
| 2190 | for | |
| 2181 | 2191 | { |
| 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; | |
| 2200 | 2194 | } |
| 2201 | 2195 | } |
| 2196 | ||
| 2197 | /* no priority case */ | |
| 2202 | 2198 | else |
| 2203 | 2199 | { |
| 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]]; | |
| 2217 | 2202 | } |
| 2203 | } | |
| 2218 | 2204 | |
| 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 | ||
| 2211 | static 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) | |
| 2222 | 2219 | { |
| 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) | |
| 2229 | 2222 | { |
| 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; | |
| 2232 | 2225 | } |
| 2233 | else | |
| 2234 | { | |
| 2235 | *BITMAP_ADDR8(transparency_bitmap, y, x) = code_opaque; | |
| 2236 | bWhollyTransparent = 0; | |
| 2237 | } | |
| 2238 | bitoffs++; | |
| 2239 | } | |
| 2240 | 2226 | } |
| 2241 | 2227 | |
| 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 | } | |
| 2243 | 2235 | } |
| 2244 | 2236 | |
| 2245 | static 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; | |
| 2268 | 2237 | |
| 2269 | bWhollyOpaque = 1; | |
| 2270 | bWhollyTransparent = 1; | |
| 2238 | /*------------------------------------------------- | |
| 2239 | scanline_draw_opaque_rgb16_alpha - draw to a | |
| 2240 | 16bpp RGB bitmap with alpha blending | |
| 2241 | -------------------------------------------------*/ | |
| 2271 | 2242 | |
| 2272 | if( flags&TILE_4BPP ) | |
| 2243 | static 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) | |
| 2273 | 2251 | { |
| 2274 | for | |
| 2252 | for | |
| 2275 | 2253 | { |
| 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; | |
| 2314 | 2256 | } |
| 2315 | 2257 | } |
| 2258 | ||
| 2259 | /* no priority case */ | |
| 2316 | 2260 | else |
| 2317 | 2261 | { |
| 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]]); | |
| 2341 | 2264 | } |
| 2342 | return (bWhollyOpaque || bWhollyTransparent)?0:TILE_FLAG_FG_OPAQUE; | |
| 2343 | 2265 | } |
| 2344 | 2266 | |
| 2345 | static 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; | |
| 2368 | 2267 | |
| 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 | -------------------------------------------------*/ | |
| 2371 | 2273 | |
| 2372 | if( flags&TILE_IGNORE_TRANSPARENCY ) | |
| 2373 | { | |
| 2374 | transparent_pen = ~0; | |
| 2375 | } | |
| 2274 | static 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; | |
| 2376 | 2279 | |
| 2377 | if( flags&TILE_4BPP ) | |
| 2280 | /* priority case */ | |
| 2281 | if ((pcode & 0xffff) != 0xff00) | |
| 2378 | 2282 | { |
| 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) | |
| 2383 | 2285 | { |
| 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; | |
| 2408 | 2288 | } |
| 2409 | pPenData += pitch/2; | |
| 2410 | } | |
| 2411 | 2289 | } |
| 2290 | ||
| 2291 | /* no priority case */ | |
| 2412 | 2292 | else |
| 2413 | 2293 | { |
| 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 | } | |
| 2428 | 2299 | |
| 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 | ||
| 2306 | static 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; | |
| 2437 | 2319 | } |
| 2438 | 2320 | } |
| 2439 | 2321 | |
| 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 | } | |
| 2441 | 2328 | } |
| 2442 | 2329 | |
| 2443 | static 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 | ||
| 2336 | static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode) | |
| 2444 | 2337 | { |
| 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; | |
| 2467 | 2341 | |
| 2468 | if( flags&TILE_4BPP ) | |
| 2342 | /* priority case */ | |
| 2343 | if ((pcode & 0xffff) != 0xff00) | |
| 2469 | 2344 | { |
| 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) | |
| 2474 | 2347 | { |
| 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; | |
| 2496 | 2350 | } |
| 2497 | pPenData += pitch/2; | |
| 2498 | } | |
| 2499 | 2351 | } |
| 2352 | ||
| 2353 | /* no priority case */ | |
| 2500 | 2354 | else |
| 2501 | 2355 | { |
| 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]]; | |
| 2519 | 2359 | } |
| 2520 | return or_flags ^ and_flags; | |
| 2521 | 2360 | } |
| 2522 | 2361 | |
| 2523 | static 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 | ||
| 2368 | static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode) | |
| 2524 | 2369 | { |
| 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; | |
| 2547 | 2373 | |
| 2548 | if( flags&TILE_4BPP ) | |
| 2374 | /* priority case */ | |
| 2375 | if ((pcode & 0xffff) != 0xff00) | |
| 2549 | 2376 | { |
| 2550 | for | |
| 2377 | for | |
| 2551 | 2378 | { |
| 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; | |
| 2582 | 2381 | } |
| 2583 | 2382 | } |
| 2383 | ||
| 2384 | /* no priority case */ | |
| 2584 | 2385 | else |
| 2585 | 2386 | { |
| 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]]); | |
| 2605 | 2389 | } |
| 2606 | return and_flags ^ or_flags; | |
| 2607 | 2390 | } |
| 2608 | 2391 | |
| 2609 | static 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 | ||
| 2399 | static void scanline_draw_masked_rgb32_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode) | |
| 2610 | 2400 | { |
| 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; | |
| 2628 | 2404 | |
| 2629 | if( flags&TILE_4BPP ) | |
| 2405 | /* priority case */ | |
| 2406 | if ((pcode & 0xffff) != 0xff00) | |
| 2630 | 2407 | { |
| 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) | |
| 2635 | 2410 | { |
| 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; | |
| 2651 | 2413 | } |
| 2652 | pPenData += pitch/2; | |
| 2653 | } | |
| 2654 | 2414 | } |
| 2415 | ||
| 2416 | /* no priority case */ | |
| 2655 | 2417 | else |
| 2656 | 2418 | { |
| 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]]); | |
| 2671 | 2422 | } |
| 2672 | return 0; | |
| 2673 | 2423 | } |
| 2674 | ||
| 2675 | #undef TRANSP | |
| 2676 | #undef PAL_INIT | |
| 2677 | #undef PAL_GET | |
| 2678 | #endif // TRANSP | |
| 2679 |
| r814 | r815 | |
|---|---|---|
| 7 | 7 | Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. |
| 8 | 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | 9 | |
| 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 | ||
| 10 | 317 | ***************************************************************************/ |
| 11 | 318 | |
| 12 | 319 | #pragma once |
| r814 | r815 | |
| 16 | 323 | |
| 17 | 324 | #include "mamecore.h" |
| 18 | 325 | |
| 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 */ | |
| 403 | typedef UINT32 tilemap_memory_index; | |
| 404 | ||
| 405 | /* opaque tilemap definition */ | |
| 19 | 406 | typedef struct _tilemap tilemap; |
| 20 | 407 | |
| 21 | #define ALL_TILEMAPS 0 | |
| 22 | /* ALL_TILEMAPS may be used with: | |
| 23 | tilemap_set_flip, tilemap_mark_all_tiles_dirty | |
| 24 | */ | |
| 25 | 408 | |
| 26 | 409 | /* tilemap types */ |
| 27 | 410 | enum _tilemap_type |
| 28 | 411 | { |
| 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 */ | |
| 35 | 414 | }; |
| 36 | 415 | typedef enum _tilemap_type tilemap_type; |
| 37 | 416 | |
| 38 | 417 | |
| 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 */ | |
| 419 | typedef struct _tile_data tile_data; | |
| 420 | struct _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 | }; | |
| 43 | 429 | |
| 44 | TILEMAP_TYPE_BITMASK is used by Namco System1, Namco System2, NamcoNA1/2, Namco NB1 | |
| 45 | */ | |
| 46 | 430 | |
| 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 */ | |
| 432 | typedef void (*tile_get_info_callback)(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param); | |
| 51 | 433 | |
| 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 */ | |
| 435 | typedef tilemap_memory_index (*tilemap_mapper_callback)(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); | |
| 55 | 436 | |
| 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 | */ | |
| 60 | 437 | |
| 61 | typedef struct _tile_data tile_data; | |
| 62 | struct _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 | }; | |
| 78 | 438 | |
| 79 | typedef void (*tile_get_info_fn)(running_machine *machine, tile_data *tileinfo, int tile_index); | |
| 439 | /*************************************************************************** | |
| 440 | GLOBAL VARIABLES | |
| 441 | ***************************************************************************/ | |
| 80 | 442 | |
| 81 | ||
| 443 | ||
| 82 | 444 | |
| 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 | } | |
| 91 | 445 | |
| 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 */ | |
| 99 | 446 | |
| 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 | ***************************************************************************/ | |
| 103 | 450 | |
| 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 | */ | |
| 111 | 451 | |
| 112 | ||
| 452 | /* ----- system-wide management ----- | |
| 113 | 453 | |
| 114 | extern mame_bitmap *priority_bitmap; | |
| 454 | /* initialize the tilemap system -- not for use by drivers */ | |
| 455 | void tilemap_init(running_machine *machine); | |
| 115 | 456 | |
| 116 | /* don't call these from drivers - they are called from mame.c */ | |
| 117 | void tilemap_init( running_machine *machine ); | |
| 118 | 457 | |
| 119 | tilemap *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 ); | |
| 125 | 458 | |
| 126 | void tilemap_set_transparent_pen( tilemap *tmap, int pen ); | |
| 127 | void tilemap_set_transmask( tilemap *tmap, int which, UINT32 fgmask, UINT32 bgmask ); | |
| 128 | void tilemap_set_depth( tilemap *tmap, int tile_depth, int tile_granularity ); | |
| 459 | /* ----- tilemap creation and configuration ----- */ | |
| 129 | 460 | |
| 130 | void tilemap_mark_tile_dirty( tilemap *tmap, int memory_offset ); | |
| 131 | void 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 */ | |
| 462 | tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_callback mapper, tilemap_type type, int tilewidth, int tileheight, int cols, int rows); | |
| 132 | 463 | |
| 133 | void tilemap_set_scroll_rows( tilemap *tmap, int scroll_rows ); /* default: 1 */ | |
| 134 | void tilemap_set_scrolldx( tilemap *tmap, int dx, int dx_if_flipped ); | |
| 135 | void tilemap_set_scrollx( tilemap *tmap, int row, int value ); | |
| 136 | int tilemap_get_scrolldx( tilemap *tmap ); | |
| 464 | /* specify a parameter to be passed into the tile_get_info callback */ | |
| 465 | void tilemap_set_user_data(tilemap *tmap, void *user_data); | |
| 137 | 466 | |
| 138 | void tilemap_set_scroll_cols( tilemap *tmap, int scroll_cols ); /* default: 1 */ | |
| 139 | void tilemap_set_scrolldy( tilemap *tmap, int dy, int dy_if_flipped ); | |
| 140 | void tilemap_set_scrolly( tilemap *tmap, int col, int value ); | |
| 141 | int tilemap_get_scrolldy( tilemap *tmap ); | |
| 467 | /* specify an offset to be added to each pixel before looking up the palette */ | |
| 468 | void tilemap_set_palette_offset(tilemap *tmap, UINT32 offset); | |
| 142 | 469 | |
| 143 | void tilemap_set_palette_offset( tilemap *tmap, int offset ); | |
| 144 | void 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 */ | |
| 471 | void tilemap_set_enable(tilemap *tmap, int enable); | |
| 145 | 472 | |
| 146 | #define TILEMAP_FLIPX 0x1 | |
| 147 | #define TILEMAP_FLIPY 0x2 | |
| 148 | void tilemap_set_flip( tilemap *tmap, int attributes ); | |
| 149 | void tilemap_set_enable( tilemap *tmap, int enable ); | |
| 473 | /* set a global flip for the tilemap; ALL_TILEMAPS can be passed here as well */ | |
| 474 | void tilemap_set_flip(tilemap *tmap, UINT32 attributes); | |
| 150 | 475 | |
| 151 | void tilemap_draw( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority ); | |
| 152 | void tilemap_draw_primask( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority, UINT32 priority_mask ); | |
| 153 | 476 | |
| 154 | void 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 ); | |
| 158 | 477 | |
| 159 | void 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 ----- */ | |
| 163 | 479 | |
| 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 */ | |
| 481 | void tilemap_mark_tile_dirty(tilemap *tmap, tilemap_memory_index memory_index); | |
| 173 | 482 | |
| 174 | mame_bitmap *tilemap_get_pixmap( tilemap * tmap ); | |
| 175 | mame_bitmap *tilemap_get_transparency_bitmap( tilemap * tmap ); | |
| 176 | UINT8 *tilemap_get_transparency_data( tilemap * tmap ); //* | |
| 483 | /* mark all the tiles in a tilemap dirty; ALL_TILEMAPS can be passed here as well */ | |
| 484 | void tilemap_mark_all_tiles_dirty(tilemap *tmap); | |
| 177 | 485 | |
| 178 | /*********************************************************************/ | |
| 179 | 486 | |
| 180 | UINT32 tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); | |
| 181 | UINT32 tilemap_scan_cols_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); | |
| 182 | UINT32 tilemap_scan_cols_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); | |
| 183 | UINT32 tilemap_scan_cols_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); | |
| 184 | 487 | |
| 185 | UINT32 tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); | |
| 186 | UINT32 tilemap_scan_rows_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); | |
| 187 | UINT32 tilemap_scan_rows_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); | |
| 188 | UINT32 tilemap_scan_rows_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); | |
| 488 | /* ----- pen-to-layer mapping ----- */ | |
| 189 | 489 | |
| 190 | /* For showcharset()'s sake */ | |
| 191 | UINT32 tilemap_count( void ); | |
| 192 | void tilemap_nb_size( UINT32 number, UINT32 *width, UINT32 *height ); | |
| 193 | void 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 */ | |
| 491 | void tilemap_map_pens_to_layer(tilemap *tmap, int group, pen_t pen, pen_t mask, UINT8 layermask); | |
| 194 | 492 | |
| 493 | /* set a single transparent pen into the tilemap, mapping all other pens to layer 0 */ | |
| 494 | void 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 */ | |
| 497 | void 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 */ | |
| 504 | void 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 */ | |
| 507 | void tilemap_set_scroll_cols(tilemap *tmap, UINT32 scroll_cols); | |
| 508 | ||
| 509 | /* specify global horizontal and vertical scroll offsets, for non-flipped and flipped cases */ | |
| 510 | void tilemap_set_scrolldx(tilemap *tmap, int dx, int dx_if_flipped); | |
| 511 | void 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 */ | |
| 514 | int tilemap_get_scrolldx(tilemap *tmap); | |
| 515 | int tilemap_get_scrolldy(tilemap *tmap); | |
| 516 | ||
| 517 | /* specify the scroll value for a row/column unit */ | |
| 518 | void tilemap_set_scrollx(tilemap *tmap, int row, int value); | |
| 519 | void 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 */ | |
| 526 | mame_bitmap *tilemap_get_pixmap(tilemap *tmap); | |
| 527 | ||
| 528 | /* return a pointer to the (updated) internal flagsmap for a tilemap */ | |
| 529 | mame_bitmap *tilemap_get_flagsmap(tilemap *tmap); | |
| 530 | ||
| 531 | /* return a pointer to the (updated) internal per-tile flags for a tilemap */ | |
| 532 | UINT8 *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 */ | |
| 539 | void 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 */ | |
| 543 | void 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 */ | |
| 552 | int tilemap_count(void); | |
| 553 | ||
| 554 | /* return the size of an indexed tilemap */ | |
| 555 | void tilemap_size_by_index(int number, UINT32 *width, UINT32 *height); | |
| 556 | ||
| 557 | /* render an indexed tilemap with fixed characteristics (no priority) */ | |
| 558 | void 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 */ | |
| 565 | TILEMAP_MAPPER( tilemap_scan_rows ); | |
| 566 | TILEMAP_MAPPER( tilemap_scan_rows_flip_x ); | |
| 567 | TILEMAP_MAPPER( tilemap_scan_rows_flip_y ); | |
| 568 | TILEMAP_MAPPER( tilemap_scan_rows_flip_xy ); | |
| 569 | ||
| 570 | /* scan in column-major order with optional flipping */ | |
| 571 | TILEMAP_MAPPER( tilemap_scan_cols ); | |
| 572 | TILEMAP_MAPPER( tilemap_scan_cols_flip_x ); | |
| 573 | TILEMAP_MAPPER( tilemap_scan_cols_flip_y ); | |
| 574 | TILEMAP_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 | ||
| 587 | INLINE 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 | ||
| 604 | INLINE 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 | ||
| 615 | INLINE 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 | ||
| 626 | INLINE 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 | ||
| 195 | 635 | #endif /* __TILEMAP_H__ */ |
| r814 | r815 | |
|---|---|---|
| 1651 | 1651 | else |
| 1652 | 1652 | { |
| 1653 | 1653 | /* handle typeahead */ |
| 1654 | recompute |= select_game_handle_key(KEYCODE_BACKSPACE, | |
| 1654 | recompute |= select_game_handle_key(KEYCODE_BACKSPACE, 8 | |
| 1655 | 1655 | recompute |= select_game_handle_key(KEYCODE_SPACE, ' '); |
| 1656 | 1656 | for (curkey = KEYCODE_A; curkey <= KEYCODE_Z; curkey++) |
| 1657 | 1657 | recompute |= select_game_handle_key(curkey, curkey - KEYCODE_A + 'a'); |
| r814 | r815 | |
| 2600 | 2600 | int buflen = strlen(select_game_buffer); |
| 2601 | 2601 | |
| 2602 | 2602 | /* if it's a backspace and we can handle it, do so */ |
| 2603 | if (value == | |
| 2603 | if (value == 8 | |
| 2604 | 2604 | { |
| 2605 | 2605 | if (buflen > 0) |
| 2606 | 2606 | { |
| r814 | r815 | |
|---|---|---|
| 59 | 59 | rectangle sbounds; |
| 60 | 60 | UINT32 dx, dy; |
| 61 | 61 | |
| 62 | if (dwidth == 0 || dheight == 0) | |
| 63 | return; | |
| 64 | ||
| 62 | 65 | /* compute the real source bounds */ |
| 63 | 66 | if (orig_sbounds != NULL) |
| 64 | 67 | sbounds = *orig_sbounds; |
| r814 | r815 | |
|---|---|---|
| 20 | 20 | 0, /* gfx */ |
| 21 | 21 | videoram[tile_index + 40], /* character */ |
| 22 | 22 | videoram[tile_index + 0x400], /* color */ |
| 23 | 0) /* flags */ | |
| 23 | 0); /* flags */ | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | VIDEO_START( aquarius ) |
| r814 | r815 | |
| 28 | 28 | aquarius_tilemap = tilemap_create( |
| 29 | 29 | aquarius_gettileinfo, |
| 30 | 30 | tilemap_scan_rows, |
| 31 | TILEMAP_TYPE_ | |
| 31 | TILEMAP_TYPE_ | |
| 32 | 32 | 8, 8, |
| 33 | 33 | 40, 24); |
| 34 | 34 | } |
| r814 | r815 | |
|---|---|---|
| 45 | 45 | abc80_bank = 1; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | SET_TILE_INFO(abc80_bank, code, color, 0) | |
| 48 | SET_TILE_INFO(abc80_bank, code, color, 0); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static UINT32 abc80_tilemap_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ) |
| r814 | r815 | |
| 65 | 65 | mame_timer_adjust(abc80_blink_timer, time_zero, 0, MAME_TIME_IN_HZ(ABC80_XTAL/2/6/64/312/16)); |
| 66 | 66 | |
| 67 | 67 | tx_tilemap = tilemap_create(abc80_get_tile_info, abc80_tilemap_scan, |
| 68 | TILEMAP_TYPE_ | |
| 68 | TILEMAP_TYPE_ | |
| 69 | 69 | |
| 70 | 70 | tilemap_set_scrolldx(tx_tilemap, ABC80_HDSTART, ABC80_HDSTART); |
| 71 | 71 | tilemap_set_scrolldy(tx_tilemap, ABC80_VDSTART, ABC80_VDSTART); |
| r814 | r815 | |
|---|---|---|
| 833 | 833 | int code = x68k_spriteram[0x3000+tile_index] & 0x00ff; |
| 834 | 834 | int colour = (x68k_spriteram[0x3000+tile_index] & 0x0f00) >> 8; |
| 835 | 835 | 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); | |
| 837 | 837 | } |
| 838 | 838 | |
| 839 | 839 | static TILE_GET_INFO(x68k_get_bg1_tile) |
| r814 | r815 | |
| 841 | 841 | int code = x68k_spriteram[0x2000+tile_index] & 0x00ff; |
| 842 | 842 | int colour = (x68k_spriteram[0x2000+tile_index] & 0x0f00) >> 8; |
| 843 | 843 | 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); | |
| 845 | 845 | } |
| 846 | 846 | |
| 847 | 847 | static TILE_GET_INFO(x68k_get_bg0_tile_16) |
| r814 | r815 | |
| 849 | 849 | int code = x68k_spriteram[0x3000+tile_index] & 0x00ff; |
| 850 | 850 | int colour = (x68k_spriteram[0x3000+tile_index] & 0x0f00) >> 8; |
| 851 | 851 | 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); | |
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | static TILE_GET_INFO(x68k_get_bg1_tile_16) |
| r814 | r815 | |
| 857 | 857 | int code = x68k_spriteram[0x2000+tile_index] & 0x00ff; |
| 858 | 858 | int colour = (x68k_spriteram[0x2000+tile_index] & 0x0f00) >> 8; |
| 859 | 859 | 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); | |
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | VIDEO_START( x68000 ) |
| r814 | r815 | |
| 891 | 891 | Machine->gfx[gfx_index]->total_colors = 16; |
| 892 | 892 | |
| 893 | 893 | /* 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); | |
| 898 | 898 | |
| 899 | 899 | tilemap_set_transparent_pen(x68k_bg0_8,0); |
| 900 | 900 | tilemap_set_transparent_pen(x68k_bg1_8,0); |
| r814 | r815 | |
|---|---|---|
| 16 | 16 | { |
| 17 | 17 | int code = videoram[tile_index]; |
| 18 | 18 | |
| 19 | SET_TILE_INFO(0, code, 0, 0) | |
| 19 | SET_TILE_INFO(0, code, 0, 0); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | VIDEO_START( sb2m600 ) |
| 23 | 23 | { |
| 24 | 24 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 25 | TILEMAP_TYPE_ | |
| 25 | TILEMAP_TYPE_ | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | VIDEO_START( uk101 ) |
| 29 | 29 | { |
| 30 | 30 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 31 | TILEMAP_TYPE_ | |
| 31 | TILEMAP_TYPE_ | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | VIDEO_UPDATE( sb2m600 ) |
| r814 | r815 | |
|---|---|---|
| 46 | 46 | int code = attr & 0x7f; |
| 47 | 47 | int color = (attr & 0x80) ? 1 : 0; |
| 48 | 48 | |
| 49 | SET_TILE_INFO(bank, code, color, 0) | |
| 49 | SET_TILE_INFO(bank, code, color, 0); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | VIDEO_START( abc800m ) |
| 53 | 53 | { |
| 54 | 54 | tx_tilemap = tilemap_create(abc800_get_tile_info, tilemap_scan_rows, |
| 55 | TILEMAP_TYPE_ | |
| 55 | TILEMAP_TYPE_ | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static TILE_GET_INFO(abc800c_get_tile_info) |
| r814 | r815 | |
| 60 | 60 | int code = videoram[tile_index]; |
| 61 | 61 | int color = 1; // WRONG! |
| 62 | 62 | |
| 63 | SET_TILE_INFO(0, code, color, 0) | |
| 63 | SET_TILE_INFO(0, code, color, 0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | VIDEO_START( abc800c ) |
| 67 | 67 | { |
| 68 | 68 | tx_tilemap = tilemap_create(abc800c_get_tile_info, tilemap_scan_rows, |
| 69 | TILEMAP_TYPE_ | |
| 69 | TILEMAP_TYPE_ | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | VIDEO_UPDATE( abc800 ) |
| r814 | r815 | |
| 84 | 84 | int code = attr & 0x7f; |
| 85 | 85 | int color = (attr & 0x80) ? 1 : 0; |
| 86 | 86 | |
| 87 | SET_TILE_INFO(bank, code, color, 0) | |
| 87 | SET_TILE_INFO(bank, code, color, 0); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static TILE_GET_INFO(abc802_get_tile_info_80) |
| r814 | r815 | |
| 94 | 94 | int code = attr & 0x7f; |
| 95 | 95 | int color = (attr & 0x80) ? 1 : 0; |
| 96 | 96 | |
| 97 | SET_TILE_INFO(bank, code, color, 0) | |
| 97 | SET_TILE_INFO(bank, code, color, 0); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | VIDEO_START( abc802 ) |
| 101 | 101 | { |
| 102 | 102 | tx_tilemap_40 = tilemap_create(abc802_get_tile_info_40, tilemap_scan_rows, |
| 103 | TILEMAP_TYPE_ | |
| 103 | TILEMAP_TYPE_ | |
| 104 | 104 | |
| 105 | 105 | tx_tilemap = tilemap_create(abc802_get_tile_info_80, tilemap_scan_rows, |
| 106 | TILEMAP_TYPE_ | |
| 106 | TILEMAP_TYPE_ | |
| 107 | 107 | |
| 108 | 108 | abc802_columns = 80; |
| 109 | 109 | } |
| r814 | r815 | |
|---|---|---|
| 34 | 34 | int gfxn = microtan_chunky_buffer[tile_index]; |
| 35 | 35 | int code = videoram[tile_index]; |
| 36 | 36 | |
| 37 | SET_TILE_INFO(gfxn, code, 0, 0) | |
| 37 | SET_TILE_INFO(gfxn, code, 0, 0); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | VIDEO_START( microtan ) |
| 41 | 41 | { |
| 42 | 42 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 43 | TILEMAP_TYPE_ | |
| 43 | TILEMAP_TYPE_ | |
| 44 | 44 | |
| 45 | 45 | microtan_chunky_buffer = auto_malloc(videoram_size); |
| 46 | 46 | memset(microtan_chunky_buffer, 0, videoram_size); |
| r814 | r815 | |
|---|---|---|
| 29 | 29 | 1, /* gfx */ |
| 30 | 30 | translate[videoram[tile_index]], /* character */ |
| 31 | 31 | color, /* color */ |
| 32 | 0) /* flags */ | |
| 32 | 0); /* flags */ | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TILE_GET_INFO(normwidth_gettileinfo) |
| r814 | r815 | |
| 38 | 38 | 0, /* gfx */ |
| 39 | 39 | translate[videoram[tile_index]], /* character */ |
| 40 | 40 | color, /* color */ |
| 41 | 0) /* flags */ | |
| 41 | 0); /* flags */ | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /*************************************************************************** |
| r814 | r815 | |
| 49 | 49 | dblwidth_tilemap = tilemap_create( |
| 50 | 50 | dblwidth_gettileinfo, |
| 51 | 51 | tilemap_scan_rows, |
| 52 | TILEMAP_TYPE_ | |
| 52 | TILEMAP_TYPE_ | |
| 53 | 53 | FW * 2, FH, |
| 54 | 54 | 64, videoram_size / 64); |
| 55 | 55 | |
| 56 | 56 | normwidth_tilemap = tilemap_create( |
| 57 | 57 | normwidth_gettileinfo, |
| 58 | 58 | tilemap_scan_rows, |
| 59 | TILEMAP_TYPE_ | |
| 59 | TILEMAP_TYPE_ | |
| 60 | 60 | FW, FH, |
| 61 | 61 | 64, videoram_size / 64); |
| 62 | 62 |
| r814 | r815 | |
|---|---|---|
| 182 | 182 | |
| 183 | 183 | static TILE_GET_INFO(apple2_lores_gettileinfo) |
| 184 | 184 | { |
| 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 */ | |
| 188 | 187 | tileinfo->pen_data = lores_tiledata; |
| 189 | tileinfo->pal_ | |
| 188 | tileinfo->palette_base = 0 | |
| 190 | 189 | tileinfo->flags = 0; |
| 191 | 190 | |
| 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 | */ | |
| 195 | 206 | } |
| 196 | 207 | |
| 197 | 208 | static void apple2_lores_draw(mame_bitmap *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow) |
| r814 | r815 | |
| 353 | 364 | text_tilemap = tilemap_create( |
| 354 | 365 | apple2_text_gettileinfo, |
| 355 | 366 | apple2_text_getmemoryoffset, |
| 356 | TILEMAP_TYPE_ | |
| 367 | TILEMAP_TYPE_ | |
| 357 | 368 | 7*2, 8, |
| 358 | 369 | 40, 24); |
| 359 | 370 | |
| 360 | 371 | dbltext_tilemap = tilemap_create( |
| 361 | 372 | apple2_dbltext_gettileinfo, |
| 362 | 373 | apple2_dbltext_getmemoryoffset, |
| 363 | TILEMAP_TYPE_ | |
| 374 | TILEMAP_TYPE_ | |
| 364 | 375 | 7, 8, |
| 365 | 376 | 80, 24); |
| 366 | 377 | |
| 367 | 378 | lores_tilemap = tilemap_create( |
| 368 | 379 | apple2_lores_gettileinfo, |
| 369 | 380 | apple2_text_getmemoryoffset, |
| 370 | TILEMAP_TYPE_ | |
| 381 | TILEMAP_TYPE_ | |
| 371 | 382 | 14, 8, |
| 372 | 383 | 40, 24); |
| 373 | 384 |
| r814 | r815 | |
|---|---|---|
| 49 | 49 | gfxfont, /* gfx */ |
| 50 | 50 | code, /* character */ |
| 51 | 51 | color, /* color */ |
| 52 | 0) /* flags */ | |
| 52 | 0); /* flags */ | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | struct terminal *terminal_create( |
| r814 | r815 | |
| 67 | 67 | + (num_cols * num_rows * sizeof(termchar_t))); |
| 68 | 68 | |
| 69 | 69 | term->tm = tilemap_create(terminal_gettileinfo, tilemap_scan_rows, |
| 70 | TILEMAP_TYPE_ | |
| 70 | TILEMAP_TYPE_ | |
| 71 | 71 | |
| 72 | 72 | term->gfx = gfx; |
| 73 | 73 | term->blank_char = blank_char; |
| r814 | r815 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | Source Changes: |
| 28 | 28 | ---------------- |
| 29 | (none) | |
| 29 | - The core is based on MAME 0.118u1. This incorporates all features of the | |
| 30 | update to this core. [MAME team] | |
| 30 | 31 | |
| 31 | 32 | |
| 32 | 33 |
| Previous | 15994 Revisions | Next |