Previous 15994 Revisions Next

r5078 Thursday 25th June, 2009 at 11:29:09 UTC by Nathan Woods
Updated to MAME 0.132u2 core
[ROOT]whatsnew.txt
[docs]messnew.txt
[src/build]verinfo.c
[src/emu]cheat.c driver.c hash.c inputseq.c uimenu.c validity.c
[src/emu/cpu]cpu.mak
[src/emu/cpu/alph8201]8201dasm.c
[src/emu/cpu/mc68hc11]hc11dasm.c hc11ops.c hc11ops.h mc68hc11.c mc68hc11.h
[src/emu/cpu/pic16c5x]16c5xdsm.c
[src/emu/cpu/powerpc]ppcdrc.c
[src/emu/cpu/tms32010]32010dsm.c
[src/emu/cpu/tms32025]32025dsm.c
[src/emu/cpu/tms9900]99xxcore.h
[src/emu/debug]debugcmd.c debugcon.c debugcpu.c debughlp.c debugvw.c express.c
[src/lib/util]astring.c corefile.c corestr.c options.c xmlfile.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]8080bw.c
[src/mame/drivers]1945kiii.c 2mindril.c 8080bw.c 86lions.c ace.c acefruit.c acommand.c albazc.c arabian.c aristmk4.c asteroid.c astrocorp.c backfire.c balsente.c bestleag.c bigfghtr.c blackt96.c bnstars.c buster.c calorie.c carrera.c cball.c chanbara.c chinsan.c chsuper.c cntsteer.c cps3.c cshooter.c cubocd32.c dacholer.c darkhors.c dblewing.c ddayjlc.c ddealer.c deco156.c discoboy.c dlair.c dmndrby.c dominob.c dreamwld.c drtomy.c dwarfd.c egghunt.c esh.c fcrash.c feversoc.c firefox.c fortecar.c gaelco2.c galaxia.c go2000.c gottlieb.c gpworld.c gstream.c hitpoker.c* igs017.c intrscti.c istellar.c jackpool.c jollyjgr.c kaneko16.c kingdrby.c klax.c laserbat.c lgp.c liberate.c limenko.c looping.c m63.c marinedt.c mastboy.c mediagx.c metro.c mgolf.c midas.c midyunit.c midzeus.c mirage.c mirax.c missb2.c mlanding.c mpoker.c mpu4drvr.c murogem.c murogmbl.c mwarr.c namcoic.c naomi.c nmg5.c nmk16.c norautp.c olibochu.c pachifev.c panicr.c pcat_nit.c powerbal.c progolf.c pturn.c pzletime.c rabbit.c raiden2.c rbmk.c sangho.c sbrkout.c segald.c skyarmy.c supdrapo.c system1.c system16.c taitojc.c vamphalf.c vroulet.c witch.c
[src/mame/includes]8080bw.h amiga.h deco16ic.h
[src/mame/machine]archimds.c kaneko16.c konamigx.c
[src/mame/video]1942.c 1943.c 40love.c 8080bw.c actfancr.c aeroboto.c aerofgt.c alpha68k.c ambush.c amigaaga.c amspdwy.c angelkds.c appoooh.c aquarium.c argus.c arkanoid.c armedf.c atarifb.c bagman.c baraduke.c battlane.c battlera.c battlex.c bigevglf.c bigstrkb.c bionicc.c bking.c blktiger.c blmbycar.c bloodbro.c blueprnt.c bogeyman.c bombjack.c boogwing.c bosco.c boxer.c brkthru.c bsktball.c btime.c bublbobl.c buggychl.c bwing.c cabal.c canyon.c carjmbre.c carpolo.c cbasebal.c cbuster.c ccastles.c cclimber.c centiped.c chaknpop.c champbas.c cheekyms.c circus.c circusc.c citycon.c cloak.c cloud9.c clshroad.c cninja.c combatsc.c commando.c compgolf.c contra.c cop01.c copsnrob.c cosmic.c cps1.c crospang.c crshrace.c cvs.c darius.c darkmist.c darkseal.c dassault.c dcon.c ddragon.c ddragon3.c ddrible.c deadang.c dec0.c dec8.c deco16ic.c deco32.c deco_mlc.c decocass.c destroyr.c dietgo.c digdug.c djmain.c dkong.c docastle.c dogfgt.c dooyong.c drgnmst.c drmicro.c dynduke.c equites.c esd16.c espial.c exedexes.c exerion.c exidy.c exprraid.c exzisus.c f1gp.c fantland.c fastfred.c fastlane.c fcombat.c fgoal.c finalizr.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c flyball.c foodf.c freekick.c fromance.c funkybee.c funkyjet.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c galaga.c galastrm.c galaxian.c galaxold.c galivan.c galpanic.c galspnbl.c gaplus.c gberet.c gcpinbal.c ginganin.c gladiatr.c glass.c gng.c goal92.c goindol.c goldstar.c gotcha.c gottlieb.c gotya.c grchamp.c groundfx.c gstriker.c gsword.c gunbustr.c gunsmoke.c gyruss.c hcastle.c higemaru.c himesiki.c hng64.c holeland.c homerun.c hyperspt.c hyprduel.c ikki.c inufuku.c irobot.c ironhors.c jack.c jackal.c jailbrek.c jalblend.c jalblend.h kan_panb.c kan_pand.c kaneko16.c karnov.c kchamp.c kickgoal.c kingobox.c kncljoe.c konamiic.c konamiic.h ksayakyu.c kyugo.c labyrunr.c ladybug.c ladyfrog.c lasso.c lastduel.c lazercmd.c legionna.c lemmings.c liberate.c lkage.c lordgun.c lsasquad.c lwings.c m10.c m107.c m52.c m57.c m58.c m62.c m72.c m90.c m92.c madalien.c madmotor.c magmax.c mainsnk.c malzak.c mappy.c marineb.c mario.c markham.c matmania.c mcr3.c mcr68.c meadows.c megasys1.c megazone.c mermaid.c metlclsh.c metro.c mexico86.c mikie.c mitchell.c mjkjidai.c momoko.c mouser.c mrdo.c mrflea.c mrjong.c ms32.c msisaac.c mugsmash.c munchmo.c mustache.c mystston.c namcos22.c namcos86.c naughtyb.c nemesis.c ninjakd2.c ninjaw.c nmk16.c nova2001.c nycaptor.c ohmygod.c oneshot.c orbit.c othldrby.c othunder.c pacland.c pacman.c pandoras.c paradise.c pbaction.c pcktgal.c pingpong.c pirates.c pitnrun.c pktgaldx.c playmark.c pokechmp.c polyplay.c poolshrk.c pooyan.c popeye.c popper.c portrait.c powerins.c prehisle.c psikyo.c psikyo4.c psikyosh.c psychic5.c pushman.c quasar.c quizdna.c raiden.c rallyx.c rastan.c realbrk.c redclash.c renegade.c retofinv.c rocnrope.c rohga.c rollrace.c rpunch.c runaway.c sauro.c sbasketb.c scotrsht.c sderby.c segag80r.c sei_crtc.c seibuspi.c seicross.c senjyo.c seta.c seta2.c sf.c shadfrce.c shangha3.c shangkid.c shaolins.c shootout.c sidearms.c sidepckt.c silkroad.c simpl156.c skydiver.c skyfox.c skykid.c skyraid.c slapfght.c slapshot.c snk68.c solomon.c sonson.c spcforce.c spdodgeb.c speedbal.c speedspn.c splash.c sprcros2.c sprint2.c sprint4.c sprint8.c srmp2.c srumbler.c sshangha.c sslam.c ssozumo.c sspeedr.c ssrj.c ssv.c st0016.c stadhero.c starcrus.c starshp1.c stfight.c stlforce.c strnskil.c stvvdp2.c subs.c suna16.c suna8.c supbtime.c superchs.c superqix.c suprridr.c suprslam.c tagteam.c tail2nos.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_o.c taito_z.c taitoair.c taitoic.c taitosj.c tank8.c tankbatt.c tankbust.c taotaido.c targeth.c tatsumi.c taxidrvr.c tbowl.c tceptor.c tecmo.c tehkanwc.c terracre.c tetrisp2.c thedeep.c thepit.c thoop2.c tiamc1.c tigeroad.c timelimt.c timeplt.c tnzs.c toaplan1.c toaplan2.c toki.c topspeed.c tp84.c trackfld.c travrusa.c triplhnt.c tryout.c tsamurai.c tumbleb.c tumblep.c tunhunt.c twincobr.c ultratnk.c undrfire.c unico.c vaportra.c vastar.c vball.c videopin.c vigilant.c vulgus.c warriorb.c wc90b.c wecleman.c welltris.c wgp.c wiping.c wiz.c wolfpack.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c xorworld.c xxmissio.c ygv608.c yiear.c yunsun16.c zac2650.c zaccaria.c zaxxon.c zodiack.c
[src/tools]chdcd.c chdman.c jedutil.c ldverify.c regrep.c

src/build/verinfo.c
r5077r5078
1313#include <string.h>
1414#include <stdlib.h>
1515
16typedef unsigned char UINT8;
17
1618#define ARRAY_LENGTH(x)      (sizeof(x) / sizeof(x[0]))
1719#define BUILD_WINDOWS      (0)
1820#define BUILD_WINUI         (1)
r5077r5078
123125{
124126   int value = 0;
125127
126   while (str[*position] != 0 && !isspace(str[*position]) && !isdigit(str[*position]))
128   while (str[*position] != 0 && !isspace((UINT8)str[*position]) && !isdigit((UINT8)str[*position]))
127129      (*position)++;
128130
129   if (str[*position] != 0 && isdigit(str[*position]))
131   if (str[*position] != 0 && isdigit((UINT8)str[*position]))
130132   {
131133      sscanf(&str[*position], "%d", &value);
132      while (isdigit(str[*position]))
134      while (isdigit((UINT8)str[*position]))
133135         (*position)++;
134136   }
135137   return value;
src/mame/audio/8080bw.c
r5077r5078
10571057   if (rising_bits & 0x08) sample_start(samples, 3, 0, 0);      /* start intermission, end game */
10581058   //if (rising_bits & 0x10) sample_start(samples, 3, 9, 0);        /* Dog barking */
10591059
1060   c8080bw_flip_screen_w(space, data & 0x20);
1060   lupin3_flip_screen_w(space, data & 0x60);
10611061
10621062   port_2_last_extra = data;
10631063}
src/mame/machine/konamigx.c
r5077r5078
305305    pri     : 0 = topmost, 255 = backmost (pixel priority)
306306*/
307307
308INLINE void zdrawgfxzoom32GP( running_machine *machine,
309      bitmap_t *bitmap, const gfx_element *gfx, const rectangle *cliprect,
308INLINE void zdrawgfxzoom32GP(
309      bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx,
310310      UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy,
311311      int scalex, int scaley, int alpha, int drawmode, int zcode, int pri)
312312{
r5077r5078
371371   src_fh    = 16;
372372   src_base  = gfx_element_get_data(gfx, code % gfx->total_elements);
373373
374   pal_base  = machine->pens + gfx->color_base + (color % gfx->total_colors) * granularity;
375   shd_base  = machine->shadow_table;
374   pal_base  = gfx->machine->pens + gfx->color_base + (color % gfx->total_colors) * granularity;
375   shd_base  = gfx->machine->shadow_table;
376376
377377   dst_ptr   = (UINT32 *)bitmap->base;
378378   dst_pitch = bitmap->rowpixels;
r5077r5078
16621662
16631663            if (nozoom) { scaley = scalex = 0x10000; } else { scalex = zw << 12; scaley = zh << 12; };
16641664
1665            zdrawgfxzoom32GP(machine,
1666                  bitmap, K053247_gfx, cliprect,
1665            zdrawgfxzoom32GP(
1666                  bitmap, cliprect, K053247_gfx,
16671667                  temp,
16681668                  color,
16691669                  temp1,temp2,
src/mame/machine/archimds.c
r5077r5078
113113
114114static void a310_set_timer(int tmr)
115115{
116   double freq = 2000000.0 / (double)ioc_timercnt[tmr];
116   double freq;
117117
118//  logerror("IOC: starting timer %d, %d ticks, freq %f Hz\n", tmr, ioc_timercnt[tmr], freq);
119
120   timer_adjust_oneshot(timer[tmr], ATTOTIME_IN_HZ(freq), tmr);
118   if((double)ioc_timercnt[tmr] != 0) // FIXME: dmdtouch does a divide by zero?
119   {
120      freq = 2000000.0 / (double)ioc_timercnt[tmr];
121   //  logerror("IOC: starting timer %d, %d ticks, freq %f Hz\n", tmr, ioc_timercnt[tmr], freq);
122      timer_adjust_oneshot(timer[tmr], ATTOTIME_IN_HZ(freq), tmr);
123   }
121124}
122125
123126// param
r5077r5078
366369   #ifdef MESS
367370   const device_config *fdc = (const device_config *)devtag_get_device(space->machine, "wd1772");
368371   #endif
372
369373   if (offset >= 0x80000 && offset < 0xc0000)
370374   {
371375//      logerror("IOC: W %02x @ reg %s (PC=%x)\n", data&0xff, ioc_regnames[offset&0x1f], cpu_get_pc( space->cpu ));
src/mame/machine/kaneko16.c
r5077r5078
313313*/
314314UINT32 writeaddress;
315315extern UINT16 calc3_mcu_crc;
316extern UINT16* kaneko16_calc3_fakeram;
316317
317// todo: change this to get it from the decrypted rom, it's block 0x19, and we have decrypted it (as specified in the parameters)
318static const UINT16 shogwarr_snip_[] = {
319   0x48E7,0xFFFE,            // movem.l D0-D7/A0-A6, -(A7)
318extern int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, int dstoffset);
320319
321   0x3039,0x00A8,0x0000,      // move.w  $a80000.l, D0
322   0x4279,0x0020,0xFFFE,      // clr.w   $20fffe.l
323320
324   0x41F9,0x0020,0x0000,      // lea     $200000.l, A0
325   0x7000,                  // moveq   #$0, D0
326
327   0x43E8,0x01C6,            // lea     ($1c6,A0), A1
328   0x7E02,                  // moveq   #$2, D7
329   0xD059,                  // add.w   (A1)+, D0
330   0x51CF,0xFFFC,            // dbra    D7, 207ffe
331
332   0x43E9,0x0002,            // lea     ($2,A1), A1
333   0x7E04,                  // moveq   #$4, D7
334   0xD059,                  // add.w   (A1)+, D0
335   0x51CF,0xFFFC,            // dbra    D7, 20800a
336
337   0x4640,                  // not.w   D0
338   0x5340,                  // subq.w  #1, D0
339   0x0068,0x0030,0x0216,      // ori.w   #$30, ($216,A0)
340
341   0xB07A,0x009A,            // cmp.w   ($9a,PC), D0; ($2080b6)
342   0x670A,                  // beq     20802a
343
344   0x0268,0x000F,0x0216,      // andi.w  #$f, ($216,A0)
345   0x4268,0x0218,            // clr.w   ($218,A0)
346
347   0x5468,0x0216,            // addq.w  #2, ($216,A0)
348   0x42A8,0x030C,            // clr.l   ($30c,A0)
349   0x117C,0x0020,0x030C,      // move.b  #$20, ($30c,A0)
350
351   0x3E3C,0x0001,            // move.w  #$1, D7
352
353   0x0C68,0x0008,0x0218,      // cmpi.w  #$8, ($218,A0)
354   0x6C00,0x0068,            // bge     2080ac
355
356   0x117C,0x0080,0x0310,      // move.b  #$80, ($310,A0)
357   0x117C,0x0008,0x0311,      // move.b  #$8, ($311,A0)
358   0x317C,0x7800,0x0312,      // move.w  #$7800, ($312,A0)
359   0x5247,                  // addq.w  #1, D7
360   0x0C68,0x0040,0x0216,      // cmpi.w  #$40, ($216,A0)
361   0x6D08,                  // blt     20806a
362
363   0x5468,0x0218,            // addq.w  #2, ($218,A0)
364   0x6000,0x0044,            // bra     2080ac
365
366   0x117C,0x0041,0x0314,      // move.b  #$41, ($314,A0)
367
368   0x0C39,0x0001,0x0010,0x2E12,// cmpi.b  #$1, $102e12.l
369   0x6606,                  // bne     208080
370
371   0x117C,0x0040,0x0314,      // move.b  #$40, ($314,A0)
372
373   0x117C,0x000C,0x0315,      // move.b  #$c, ($315,A0)
374   0x317C,0x7000,0x0316,      // move.w  #$7000, ($316,A0)
375   0x5247,                  // addq.w  #1, D7
376
377   0x0839,0x0001,0x0010,0x2E15,// btst    #$1, $102e15.l ; service mode
378   0x6714,                  // beq     2080ac
379
380   0x117C,0x0058,0x0318,      // move.b  #$58, ($318,A0)
381   0x117C,0x0006,0x0319,      // move.b  #$6, ($319,A0)
382   0x317C,0x6800,0x031A,      // move.w  #$6800, ($31a,A0)
383   0x5247,                  // addq.w  #1, D7
384
385   0x3147,0x030A,            // move.w  D7, ($30a,A0)
386   0x4CDF,0x7FFF,            // movem.l (A7)+, D0-D7/A0-A6
387   0x4E73,                  // rte
388   0xC747,
389};
390
391
392321static void calc3_mcu_run(running_machine *machine)
393322{
394323   UINT16 mcu_command;
r5077r5078
443372
444373         // clear old command (handshake to main cpu)
445374         kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+0] = 0x0000;
446         kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+1] = 0x0000;
447         kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+2] = 0x0000;
448         kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+3] = 0x0000;
449         kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+4] = 0x0000;
450         kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+5] = 0x0000;
451         kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+6] = 0x0000;
452         kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+7] = 0x0000;
453
375         /*
376            kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+1] = 0x0000;
377            kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+2] = 0x0000;
378            kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+3] = 0x0000;
379            kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+4] = 0x0000;
380            kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+5] = 0x0000;
381            kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+6] = 0x0000;
382            kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+7] = 0x0000;
383            */
454384         calc3_mcu_command_offset = param3;   // where next command will be written?
455385
456386
457387      }
458388      break;
459389
390      case 0x0001:
391      case 0x0002:
392      case 0x0003:
393      case 0x0004:
394      case 0x0005:
395      case 0x0006:
396      case 0x0007:
460397      // the 'case' seems to be the number of commands in the list
461398      // there are parts of the code where i've seen up to '5' specified, and the game uploads 5 transfer commands
462399      //
463
464      case 0x0001:
465400      {
401         int num_transfers = mcu_command;
466402         int i;
467         int param1 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 1];
468         int param2 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 2];
469         int param3 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 3];
470         int param4 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 4];
471         int param5 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 5];
472         int param6 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 6];
473         int param7 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+ 7];
474403
475         UINT32 writebackaddress = (param1&0x00ff) | (param2&0xff00);
476         UINT8  command1tabl = (param1&0xff00) >> 8;
477         UINT16 command1addr = (param1&0x00ff) | (param2&0xff00);
404         logerror("Calc3 transfer request, %d transfers\n", num_transfers);
478405
406         for (i=0;i<num_transfers;i++)
407         {
408            int param1 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 1 + (2*i)];
409            int param2 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 2 + (2*i)];
410            UINT8  commandtabl = (param1&0xff00) >> 8;
411            UINT16 commandaddr = (param1&0x00ff) | (param2&0xff00);
412            UINT32 fakeoffs;
479413
480         logerror("params %04x %04x %04x %04x %04x %04x %04x\n",
481         param1,param2,param3,param4,param5,param6,param7);
482         logerror("command 1 addr %04x command 1 table %02x\n", command1addr, command1tabl);
414            logerror("transfer %d table %02x writeback address %04x\n", i, commandtabl, commandaddr);
483415
484         // clear old command (handshake to main cpu)
485         kaneko16_mcu_ram[calc3_mcu_command_offset>>1] = 0x0000;
416            // the data SHOULD be written somewhere to main ram, probably related to the writeaddress set in command 0xff
417            // but I'm not sure how, for now write it back to a FAKE region instead
418            fakeoffs = 0x1e00*commandtabl;
486419
420            calc3_decompress_table(machine, commandtabl, (UINT8*)kaneko16_calc3_fakeram, fakeoffs);
487421
422            // write back WHERE we wrote the data to the address specified so that the code can jump to it etc.
423            fakeoffs+=0xf00000;
424            fakeoffs+=2;// the first 2 bytes don't seem to be the offset it expects to jump to..
488425
489         // execute the command:
426            printf("writing back fake address %08x to %08x\n", fakeoffs, commandaddr);
427            kaneko16_mcu_ram[(commandaddr>>1)+0] = (fakeoffs>>16)&0xffff;
428            kaneko16_mcu_ram[(commandaddr>>1)+1] = (fakeoffs&0xffff);
490429
491         // param1 ?
492         //kaneko16_mcu_ram[param2/2 + 0] = 0x0000;      // ?
493         //kaneko16_mcu_ram[param2/2 + 1] = 0x0000;      // ?
494         //kaneko16_mcu_ram[param2/2 + 2] = 0x0000;      // ?
495         //kaneko16_mcu_ram[param2/2 + 3] = 0x0000;      // ? addr.l
496         //kaneko16_mcu_ram[param2/2 + 4] = 0x00e0;      // 0000e0: 4e73 rte
497
498         //UINT32 writeaddress = (param2);
499
500
501
502         writeaddress&=0xffff;
503
504
505         for(i=0;i<sizeof(shogwarr_snip_) / 2;i++)
506         {
507      //      printf("writes\n %08x", (writeaddress+i)*2);
508            kaneko16_mcu_ram[(writeaddress/2)+i] = shogwarr_snip_[i];
509430         }
510431
511         kaneko16_mcu_ram[(writebackaddress/2)+0] = 0x0020;
512         kaneko16_mcu_ram[(writebackaddress/2)+1] = writeaddress;
513
514      //  calc3_mcu_command_offset = param3;  // where next command will be written?
515      //  calc3_mcu_status  =0;
516
432         // reset 'number of commands' to 0 to indicate processing complete to the main cpu.
433         kaneko16_mcu_ram[calc3_mcu_command_offset>>1] = 0x0000;;
517434      }
518435      break;
519
520      case 0x0002:
521      {
522
523
524         int param1 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 1];
525         int param2 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 2];
526         int param3 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 3];
527         int param4 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 4];
528         int param5 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 5];
529         int param6 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 6];
530         int param7 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+ 7];
531
532
533         UINT8  command1tabl = (param1&0xff00) >> 8;
534         UINT16 command1addr = (param1&0x00ff) | (param2&0xff00);
535         UINT8  command2tabl = (param3&0xff00) >> 8;
536         UINT16 command2addr = (param3&0x00ff) | (param4&0xff00);
537
538         logerror("params %04x %04x %04x %04x %04x %04x %04x\n",
539         param1,param2,param3,param4,param5,param6,param7);
540         logerror("command 1 addr %04x command 1 table %02x | command 2 addr %04x command 2 table %02x\n", command1addr, command1tabl, command2addr, command2tabl);
541
542         // clear old command (handshake to main cpu)
543         kaneko16_mcu_ram[calc3_mcu_command_offset>>1] = 0x0000;
544
545         // execute the command:
546;
547      }
548      break;
549
550      case 0x0003:
551      {
552
553         int param1 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 1];
554         int param2 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 2];
555         int param3 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 3];
556         int param4 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 4];
557         int param5 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 5];
558         int param6 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1) + 6];
559         int param7 = kaneko16_mcu_ram[(calc3_mcu_command_offset>>1)+ 7];
560
561
562         UINT8  command1tabl = (param1&0xff00) >> 8;
563         UINT16 command1addr = (param1&0x00ff) | (param2&0xff00);
564         UINT8  command2tabl = (param3&0xff00) >> 8;
565         UINT16 command2addr = (param3&0x00ff) | (param4&0xff00);
566         UINT8  command3tabl = (param5&0xff00) >> 8;
567         UINT16 command3addr = (param5&0x00ff) | (param6&0xff00);
568
569         logerror("params %04x %04x %04x %04x %04x %04x %04x\n",
570         param1,param2,param3,param4,param5,param6,param7);
571         logerror("command 1 addr %04x command 1 table %02x | command 2 addr %04x command 2 table %02x | command 3 addr %04x command 3 table %02x\n", command1addr, command1tabl, command2addr, command2tabl, command3addr, command3tabl);
572
573         // clear old command (handshake to main cpu)
574         kaneko16_mcu_ram[calc3_mcu_command_offset>>1] = 0x0000;
575
576         // execute the command:
577      }
578      break;
579
580436   }
581437
582438}
src/mame/mamedriv.c
r5077r5078
12161216   DRIVER( schaser )   /* RT  Taito */
12171217   DRIVER( schasrcv )   /* RT  Taito */
12181218   DRIVER( lupin3 )   /* LP  (c) 1980 Taito */
1219   DRIVER( lupin3a )   /* LP  (c) 1980 Taito */
12191220   DRIVER( intruder )   /* (c) 1980 GamePlan (Taito) */
12201221   DRIVER( spclaser )   /* (c) 1980 GamePlan (Taito) */
12211222   DRIVER( laser )      /* (c) 1980 Leisure Time Electronics Inc. */
r5077r5078
35473548   DRIVER( myherok )   /* 834-5755 (c) 1985 Coreland / Sega (S1) */
35483549   DRIVER( shtngmst )   /* 834-5719/5720 (c) 1985 (S2) */
35493550   DRIVER( shtngmste )   /* 834-5719/5720 (c) 1985 (S2) */
3550    DRIVER( shtngmstu )   /* 834-5719/5720 (c) 1985 (S2) */
35513551   DRIVER( choplift )   /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */
35523552   DRIVER( chopliftu )   /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */
35533553   DRIVER( chopliftbl )/* bootleg (S2) */
r5077r5078
56225622   DRIVER( llander )   /* 0345xx           no copyright notice */
56235623   DRIVER( llander1 )   /* 0345xx           no copyright notice */
56245624   DRIVER( asteroid )   /* 035127-035145    (c) 1979 */
5625   DRIVER( asteroi2 )   /* 035127-035145    (c) 1979 */
56255626   DRIVER( asteroi1 )   /* 035127-035145    no copyright notice */
56265627   DRIVER( asteroib )   /* (bootleg) */
56275628   DRIVER( asterock )   /* Sidam bootleg    (c) 1979 */
r5077r5078
66706671   DRIVER( hiimpact )   /* (c) 1990 Williams */
66716672   DRIVER( hiimpac4 )   /* (c) 1990 Williams */
66726673   DRIVER( hiimpac3 )   /* (c) 1990 Williams */
6674   DRIVER( hiimpac1 )   /* (c) 1990 Williams */
66736675   DRIVER( hiimpacp )   /* (c) 1990 Williams */
66746676   DRIVER( shimpact )   /* (c) 1991 Midway */
66756677   DRIVER( shimpap6 )   /* (c) 1991 Midway */
r5077r5078
95379539
95389540   DRIVER( roul )
95399541
9542   /* Accept LTD. */
9543   DRIVER( hitpoker ) /* (c) 1997 */
9544
95409545#endif   /* DRIVER_RECURSIVE */
src/mame/includes/deco16ic.h
r5077r5078
3737void deco16_tilemap_34_combine_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
3838
3939void deco16_clear_sprite_priority_bitmap(void);
40void deco16_pdrawgfx(running_machine *machine,
41      bitmap_t *dest,const gfx_element *gfx,
40void deco16_pdrawgfx(
41      bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
4242      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
43      const rectangle *clip,int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha);
43      int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha);
4444
4545tilemap *deco16_get_tilemap(int pf, int size);
4646
src/mame/includes/8080bw.h
r5077r5078
7676MACHINE_START( extra_8080bw_vh );
7777
7878void c8080bw_flip_screen_w(const address_space *space, int data);
79void lupin3_flip_screen_w(const address_space *space, int data);
7980void c8080bw_screen_red_w(int data);
8081void schaser_background_control_w(int data);
8182
src/mame/includes/amiga.h
r5077r5078
144144#define REG_BPLCON3      (0x106/2)   /* W    D    Bit plane control reg (enhanced features) */
145145#define REG_BPL1MOD      (0x108/2)   /* W  A      Bit plane modulo (odd planes) */
146146#define REG_BPL2MOD      (0x10A/2)   /* W  A      Bit Plane modulo (even planes) */
147#define REG_BPLCON4      (0x10C/2)   /* W    D    Bit plane control reg. (display masks) */
147148#define REG_BPL1DAT      (0x110/2)   /* W    D    Bit plane 1 data (parallel-to-serial convert) */
148149#define REG_BPL2DAT      (0x112/2)   /* W    D    Bit plane 2 data (parallel-to-serial convert) */
149150#define REG_BPL3DAT      (0x114/2)   /* W    D    Bit plane 3 data (parallel-to-serial convert) */
src/mame/mame.mak
r5077r5078
111111CPUS += SM8500
112112CPUS += MINX
113113CPUS += SSEM
114CPUS += AVR8
114115
115116
116117#-------------------------------------------------
r5077r5078
15181519   $(DRIVERS)/hexa.o $(VIDEO)/hexa.o \
15191520   $(DRIVERS)/highvdeo.o \
15201521   $(DRIVERS)/himesiki.o $(VIDEO)/himesiki.o \
1522   $(DRIVERS)/hitpoker.o \
15211523   $(DRIVERS)/homedata.o $(VIDEO)/homedata.o \
15221524   $(DRIVERS)/hotblock.o \
15231525   $(DRIVERS)/ilpag.o \
src/mame/video/targeth.c
r5077r5078
121121      int xflip = attr & 0x20;
122122      int yflip = attr & 0x40;
123123
124      drawgfx(bitmap,gfx,number,
124      drawgfx_transpen(bitmap,cliprect,gfx,number,
125125            0x20 + color,xflip,yflip,
126            sx - 0x0f,sy,
127            cliprect,TRANSPARENCY_PEN,0);
126            sx - 0x0f,sy,0);
128127   }
129128}
130129
src/mame/video/nycaptor.c
r5077r5078
166166         flipx = ((nycaptor_spriteram[offs+1]&0x40)>>6);
167167         flipy = ((nycaptor_spriteram[offs+1]&0x80)>>7);
168168
169         drawgfx(bitmap,machine->gfx[1],
169         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
170170               code,
171171               pal,
172172               flipx,flipy,
173               sx,sy,
174               cliprect,TRANSPARENCY_PEN,15);
173               sx,sy,15);
175174
176175         if(nycaptor_spriteram[offs+3]>240)
177176         {
178177            sx = (nycaptor_spriteram[offs+3]-256);
179            drawgfx(bitmap,machine->gfx[1],
178            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
180179                    code,
181180                    pal,
182181                    flipx,flipy,
183                     sx,sy,
184                     cliprect,TRANSPARENCY_PEN,15);
182                     sx,sy,15);
185183               }
186184            }
187185      }
src/mame/video/mitchell.c
r5077r5078
271271         sx = 496 - sx;
272272         sy = 240 - sy;
273273      }
274      drawgfx(bitmap,machine->gfx[1],
274      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
275275             code,
276276             color,
277277             flipscreen,flipscreen,
278             sx,sy,
279             cliprect,TRANSPARENCY_PEN,15);
278             sx,sy,15);
280279   }
281280}
282281
src/mame/video/galspnbl.c
r5077r5078
7575            {
7676               int x = sx + 8*(flipx?(size-1-col):col);
7777               int y = sy + 8*(flipy?(size-1-row):row);
78               drawgfx(bitmap,machine->gfx[1],
78               drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
7979                  code + layout[row][col],
8080                  color,
8181                  flipx,flipy,
82                  x,y,
83                  cliprect,TRANSPARENCY_PEN,0);
82                  x,y,0);
8483            }
8584         }
8685      }
r5077r5078
125124      /* What is this? A priority/half transparency marker? */
126125      if (!(attr & 0x0008))
127126      {
128         drawgfx(bitmap,screen->machine->gfx[0],
127         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
129128               code,
130129               color,
131130               0,0,
132131//                  16*sx + screenscroll,8*sy,
133               16*sx,8*sy,
134               cliprect,TRANSPARENCY_PEN,0);
132               16*sx,8*sy,0);
135133      }
136134   }
137135
src/mame/video/xevious.c
r5077r5078
468468            if (spriteram_3[offs] & 1)  /* double width, double height */
469469            {
470470               code &= ~3;
471               drawgfx(bitmap,machine->gfx[bank],
471               drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
472472                     code+3,color,flipx,flipy,
473                     flipx ? sx : sx+16,flipy ? sy-16 : sy,
474                     cliprect,TRANSPARENCY_PENS,transmask);
475               drawgfx(bitmap,machine->gfx[bank],
473                     flipx ? sx : sx+16,flipy ? sy-16 : sy,transmask);
474               drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
476475                     code+1,color,flipx,flipy,
477                     flipx ? sx : sx+16,flipy ? sy : sy-16,
478                     cliprect,TRANSPARENCY_PENS,transmask);
476                     flipx ? sx : sx+16,flipy ? sy : sy-16,transmask);
479477            }
480478            code &= ~2;
481            drawgfx(bitmap,machine->gfx[bank],
479            drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
482480                  code+2,color,flipx,flipy,
483                  flipx ? sx+16 : sx,flipy ? sy-16 : sy,
484                  cliprect,TRANSPARENCY_PENS,transmask);
485            drawgfx(bitmap,machine->gfx[bank],
481                  flipx ? sx+16 : sx,flipy ? sy-16 : sy,transmask);
482            drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
486483                  code,color,flipx,flipy,
487                  flipx ? sx+16 : sx,flipy ? sy : sy-16,
488                  cliprect,TRANSPARENCY_PENS,transmask);
484                  flipx ? sx+16 : sx,flipy ? sy : sy-16,transmask);
489485         }
490486         else if (spriteram_3[offs] & 1) /* double width */
491487         {
492488            code &= ~1;
493            drawgfx(bitmap,machine->gfx[bank],
489            drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
494490                  code,color,flipx,flipy,
495                  flipx ? sx+16 : sx,flipy ? sy-16 : sy,
496                  cliprect,TRANSPARENCY_PENS,transmask);
497            drawgfx(bitmap,machine->gfx[bank],
491                  flipx ? sx+16 : sx,flipy ? sy-16 : sy,transmask);
492            drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
498493                  code+1,color,flipx,flipy,
499                  flipx ? sx : sx+16,flipy ? sy-16 : sy,
500                  cliprect,TRANSPARENCY_PENS,transmask);
494                  flipx ? sx : sx+16,flipy ? sy-16 : sy,transmask);
501495         }
502496         else   /* normal */
503497         {
504            drawgfx(bitmap,machine->gfx[bank],
505                  code,color,flipx,flipy,sx,sy,
506                  cliprect,TRANSPARENCY_PENS,transmask);
498            drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
499                  code,color,flipx,flipy,sx,sy,transmask);
507500         }
508501      }
509502   }
src/mame/video/blktiger.c
r5077r5078
215215         flipx = !flipx;
216216      }
217217
218      drawgfx(bitmap,machine->gfx[2],
218      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
219219            code,
220220            color,
221221            flipx,flip_screen_get(machine),
222            sx,sy,
223            cliprect,TRANSPARENCY_PEN,15);
222            sx,sy,15);
224223   }
225224}
226225
src/mame/video/dynduke.c
r5077r5078
161161         if (fy) fy=0; else fy=1;
162162      }
163163
164      drawgfx(bitmap,machine->gfx[3],
164      drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
165165            sprite,
166            color,fx,fy,x,y,
167            cliprect,TRANSPARENCY_PEN,15);
166            color,fx,fy,x,y,15);
168167   }
169168}
170169
src/mame/video/deco_mlc.c
r5077r5078
6060}
6161#endif
6262
63static void mlc_drawgfxzoom(running_machine *machine,
64      bitmap_t *dest_bmp,const gfx_element *gfx,
63static void mlc_drawgfxzoom(
64      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
6565      UINT32 code1,UINT32 code2, UINT32 color,int flipx,int flipy,int sx,int sy,
66      const rectangle *clip,int transparent_color,int use8bpp,
66      int transparent_color,int use8bpp,
6767      int scalex, int scaley,int alpha)
6868{
6969   rectangle myclip;
r5077r5078
9696   {
9797      if( gfx )
9898      {
99         const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
99         const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
100100         const UINT8 *code_base1 = gfx_element_get_data(gfx, code1 % gfx->total_elements);
101101         const UINT8 *code_base2 = gfx_element_get_data(gfx, code2 % gfx->total_elements);
102102
r5077r5078
482482//              if (rasterMode)
483483//                  rasterDirty=1;
484484
485            mlc_drawgfxzoom(machine,
486                        /*rasterMode ? temp_bitmap : */bitmap,machine->gfx[0],
485            mlc_drawgfxzoom(
486                        /*rasterMode ? temp_bitmap : */bitmap,&user_clip,machine->gfx[0],
487487                        tile,tile2,
488488                        color + colorOffset,fx,fy,xbase,ybase,
489                        &user_clip,0,
489                        0,
490490                        use8bppMode,(xscale<<8),(yscale<<8),alpha);
491491
492492            sprite++;
src/mame/video/tunhunt.c
r5077r5078
332332      {
333333         for( sy=0; sy<256; sy+=16 )
334334         {
335            drawgfx( bitmap, machine->gfx[1],
335            drawgfx_transpen( bitmap, cliprect,
336               machine->gfx[1],
336337               picture_code,
337338               0, /* color */
338339               0,0, /* flip */
339               sx,sy,
340               cliprect,
341               TRANSPARENCY_PEN,0 );
340               sx,sy,0 );
342341         }
343342      }
344343   }
r5077r5078
358357            vstop       = 0x00
359358
360359    */
361   drawgfx( bitmap, machine->gfx[1],
360   drawgfx_transpen( bitmap, cliprect,
361         machine->gfx[1],
362362         picture_code,
363363         0, /* color */
364364         0,0, /* flip */
365         255-hposition-16,vstart-32,
366         cliprect,
367         TRANSPARENCY_PEN,0 );
365         255-hposition-16,vstart-32,0 );
368366}
369367
370368VIDEO_UPDATE( tunhunt )
src/mame/video/tryout.c
r5077r5078
207207      /* Double Height */
208208      if(spriteram[offs] & 0x10)
209209      {
210         drawgfx(bitmap,machine->gfx[1],
210         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
211211            sprite,
212            color,fx,fy,x,y + inc,
213            cliprect,TRANSPARENCY_PEN,0);
212            color,fx,fy,x,y + inc,0);
214213
215         drawgfx(bitmap,machine->gfx[1],
214         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
216215            sprite+1,
217            color,fx,fy,x,y,
218            cliprect,TRANSPARENCY_PEN,0);
216            color,fx,fy,x,y,0);
219217      }
220218      else
221219      {
222         drawgfx(bitmap,machine->gfx[1],
220         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
223221            sprite,
224            color,fx,fy,x,y,
225            cliprect,TRANSPARENCY_PEN,0);
222            color,fx,fy,x,y,0);
226223      }
227224   }
228225}
src/mame/video/madmotor.c
r5077r5078
204204         {
205205            if ((color & pri_mask) == pri_val &&
206206                     (!flash || (video_screen_get_frame_number(machine->primary_screen) & 1)))
207               drawgfx(bitmap,machine->gfx[3],
207               drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
208208                     code - y * incy + h * x,
209209                     color,
210210                     flipx,flipy,
211                     sx + mult * x,sy + mult * y,
212                     cliprect,TRANSPARENCY_PEN,0);
211                     sx + mult * x,sy + mult * y,0);
213212         }
214213
215214         offs += 4;
src/mame/video/skyfox.c
r5077r5078
199199      }
200200
201201#define DRAW_SPRITE(DX,DY,CODE) \
202      drawgfx(bitmap,machine->gfx[0], \
202      drawgfx_transpen(bitmap,\
203            cliprect,machine->gfx[0], \
203204            (CODE), \
204205            0, \
205206            flipx,flipy, \
206            x + (DX),y + (DY), \
207            cliprect,TRANSPARENCY_PEN, 0xff); \
207            x + (DX),y + (DY), 0xff); \
208208
209209      if (skyfox_bg_ctrl & 1)   // flipscreen
210210      {
src/mame/video/bublbobl.c
r5077r5078
8686               flipy = !flipy;
8787            }
8888
89            drawgfx(bitmap,screen->machine->gfx[0],
89            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
9090                  code,
9191                  color,
9292                  flipx,flipy,
93                  x,y,
94                  cliprect,TRANSPARENCY_PEN,15);
93                  x,y,15);
9594         }
9695      }
9796
src/mame/video/aerofgt.c
r5077r5078
383383               else
384384                  code = aerofgt_spriteram2[map_start & 0x1fff] & 0x1fff;
385385
386               drawgfxzoom(bitmap,machine->gfx[sprite_gfx + (map_start >= 0x2000 ? 1 : 0)],
386               drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + (map_start >= 0x2000 ? 1 : 0)],
387387                     code,
388388                     color,
389389                     flipx,flipy,
390390                     sx,sy,
391                     cliprect,TRANSPARENCY_PEN,15,
392                     zoomx << 11, zoomy << 11);
391                     zoomx << 11, zoomy << 11,15);
393392               map_start++;
394393            }
395394         }
r5077r5078
455454            else
456455               code = aerofgt_spriteram2[map_start % (aerofgt_spriteram2_size/2)];
457456
458            pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + chip],
457            pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + chip],
459458                      code,
460459                      color,
461460                      flipx,flipy,
462461                      sx,sy,
463                      cliprect,TRANSPARENCY_PEN,15,
464462                      zoomx << 11, zoomy << 11,
465                      pri ? 0 : 2);
463                      priority_bitmap,pri ? 0 : 2,15);
466464            map_start++;
467465         }
468466
r5077r5078
530528            else
531529               code = aerofgt_spriteram2[map_start % (aerofgt_spriteram2_size/2)];
532530
533            pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + chip],
531            pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + chip],
534532                      code,
535533                      color,
536534                      flipx,flipy,
537535                      sx,sy,
538                      cliprect,TRANSPARENCY_PEN,15,
539536                      zoomx << 11, zoomy << 11,
540                      pri ? 2 : 0);
537                      priority_bitmap,pri ? 2 : 0,15);
541538            map_start++;
542539         }
543540
r5077r5078
606603            else
607604               code = aerofgt_spriteram2[map_start % (aerofgt_spriteram2_size/2)];
608605
609            pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + chip],
606            pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + chip],
610607                      code,
611608                      color,
612609                      flipx,flipy,
613610                      sx,sy,
614                      cliprect,TRANSPARENCY_PEN,15,
615611                      zoomx << 11, zoomy << 11,
616                      pri ? 0 : 2);
612                      priority_bitmap,pri ? 0 : 2,15);
617613            map_start++;
618614         }
619615
r5077r5078
642638      flipx = aerofgt_spriteram3[i + 1] & 0x0800;
643639      color = aerofgt_spriteram3[i + 1] & 0x000f;
644640
645      drawgfx(bitmap,machine->gfx[sprite_gfx],
641      drawgfx_transpen(bitmap,cliprect,machine->gfx[sprite_gfx],
646642            code,
647643            color,
648644            flipx,flipy,
649            xpos,ypos,
650            cliprect,TRANSPARENCY_PEN,15);
645            xpos,ypos,15);
651646
652647      /* wrap around y */
653      drawgfx(bitmap,machine->gfx[sprite_gfx],
648      drawgfx_transpen(bitmap,cliprect,machine->gfx[sprite_gfx],
654649            code,
655650            color,
656651            flipx,flipy,
657            xpos,ypos + 512,
658            cliprect,TRANSPARENCY_PEN,15);
652            xpos,ypos + 512,15);
659653
660654   }
661655}
r5077r5078
685679
686680      realcode = (lookup[code] << 8) + lookup[0x10000 + code];
687681
688      drawgfx(bitmap,machine->gfx[sprite_gfx],
682      drawgfx_transpen(bitmap,cliprect,machine->gfx[sprite_gfx],
689683            realcode,
690684            color,
691685            flipx,flipy,
692            xpos,ypos,
693            cliprect,TRANSPARENCY_PEN,15);
686            xpos,ypos,15);
694687
695688      /* wrap around y */
696      drawgfx(bitmap,machine->gfx[sprite_gfx],
689      drawgfx_transpen(bitmap,cliprect,machine->gfx[sprite_gfx],
697690            realcode,
698691            color,
699692            flipx,flipy,
700            xpos,ypos + 512,
701            cliprect,TRANSPARENCY_PEN,15);
693            xpos,ypos + 512,15);
702694   }
703695}
704696
r5077r5078
733725
734726      sx = ((ox + 16 + 3) & 0x1ff) - 16;
735727
736      pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)],
728      pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)],
737729            code,
738730            color,
739731            flipx,flipy,
740732            sx,sy,
741            cliprect,TRANSPARENCY_PEN,15,
742733            zoomx << 11,zoomy << 11,
743            pri ? 0 : 2);
734            priority_bitmap,pri ? 0 : 2,15);
744735
745736   }
746737
r5077r5078
771762
772763      sx = ((ox + 16 + 3) & 0x1ff) - 16;
773764
774      pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)],
765      pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)],
775766            code,
776767            color,
777768            flipx,flipy,
778769            sx,sy,
779            cliprect,TRANSPARENCY_PEN,15,
780770            zoomx << 11,zoomy << 11,
781            pri ? 0 : 2);
771            priority_bitmap,pri ? 0 : 2,15);
782772
783773   }
784774}
r5077r5078
861851      {
862852         UINT16 tileno = spikes91_tx_tilemap_ram[count]&0x1fff;
863853         UINT16 colour = spikes91_tx_tilemap_ram[count]&0xe000;
864         drawgfx(bitmap,gfx,
854         drawgfx_transpen(bitmap,cliprect,gfx,
865855               tileno,
866856               colour>>13,
867857               0,0,
868               (x*8)+24,(y*8)+8,
869               cliprect,TRANSPARENCY_PEN,15);
858               (x*8)+24,(y*8)+8,15);
870859
871860         count++;
872861
src/mame/video/rocnrope.c
r5077r5078
126126   {
127127      int color = spriteram_2[offs] & 0x0f;
128128
129      drawgfx(bitmap,machine->gfx[0],
129      drawgfx_transmask(bitmap,cliprect,machine->gfx[0],
130130            spriteram[offs + 1],
131131            color,
132132            spriteram_2[offs] & 0x40,~spriteram_2[offs] & 0x80,
133133            240-spriteram[offs],spriteram_2[offs + 1],
134            cliprect,TRANSPARENCY_PENS,
135134            colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
136135   }
137136}
src/mame/video/fgoal.c
r5077r5078
5353
5454   if (fgoal_player == 1 && (input_port_read(screen->machine, "IN1") & 0x40))
5555   {
56      drawgfxzoom(fgbitmap, screen->machine->gfx[0],
56      drawgfxzoom_opaque(fgbitmap, cliprect, screen->machine->gfx[0],
5757         0, (fgoal_player << 2) | current_color,
5858         1, 1,
5959         0, 16,
60         cliprect, TRANSPARENCY_NONE, 0,
6160         0x40000,
6261         0x40000);
6362
64      drawgfxzoom(bgbitmap, screen->machine->gfx[1],
63      drawgfxzoom_opaque(bgbitmap, cliprect, screen->machine->gfx[1],
6564         0, 0,
6665         1, 1,
6766         0, 16,
68         cliprect, TRANSPARENCY_NONE, 0,
6967         0x40000,
7068         0x40000);
7169   }
7270   else
7371   {
74      drawgfxzoom(fgbitmap, screen->machine->gfx[0],
72      drawgfxzoom_opaque(fgbitmap, cliprect, screen->machine->gfx[0],
7573         0, (fgoal_player << 2) | current_color,
7674         0, 0,
7775         0, 0,
78         cliprect, TRANSPARENCY_NONE, 0,
7976         0x40000,
8077         0x40000);
8178
82      drawgfxzoom(bgbitmap, screen->machine->gfx[1],
79      drawgfxzoom_opaque(bgbitmap, cliprect, screen->machine->gfx[1],
8380         0, 0,
8481         0, 0,
8582         0, 0,
86         cliprect, TRANSPARENCY_NONE, 0,
8783         0x40000,
8884         0x40000);
8985   }
src/mame/video/docastle.c
r5077r5078
197197      }
198198
199199      /* first draw the sprite, visible */
200      pdrawgfx(bitmap,machine->gfx[1],
200      pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1],
201201            code,
202202            color,
203203            flipx,flipy,
204204            sx,sy,
205            cliprect,TRANSPARENCY_PENS,0x80ff,
206            0x00);
205            priority_bitmap,
206            0x00,0x80ff);
207207
208208      /* then draw the mask, behind the background but obscuring following sprites */
209      pdrawgfx(bitmap,machine->gfx[1],
209      pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1],
210210            code,
211211            color,
212212            flipx,flipy,
213213            sx,sy,
214            cliprect,TRANSPARENCY_PENS,0x7fff,
215            0x02);
214            priority_bitmap,
215            0x02,0x7fff);
216216   }
217217}
218218
src/mame/video/mainsnk.c
r5077r5078
121121         flipy = !flipy;
122122      }
123123
124      drawgfx( bitmap,gfx,
124      drawgfx_transpen( bitmap,cliprect,gfx,
125125         tile_number,
126126         color,
127127         flipx,flipy,
128         sx,sy,
129         cliprect,TRANSPARENCY_PEN,7);
128         sx,sy,7);
130129
131130      source+=4;
132131   }
src/mame/video/mystston.c
r5077r5078
179179 *
180180 *************************************/
181181
182static void draw_sprites(mystston_state *state, gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int flip)
182static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int flip)
183183{
184   mystston_state *state = (mystston_state *)gfx->machine->driver_data;
184185   int offs;
185186
186187   for (offs = 0; offs < 0x60; offs += 4)
r5077r5078
204205            flipy = !flipy;
205206         }
206207
207         drawgfx(bitmap, gfx[2],   code, color, flipx, flipy, x, y, cliprect, TRANSPARENCY_PEN, 0);
208         drawgfx_transpen(bitmap, cliprect, gfx, code, color, flipx, flipy, x, y, 0);
208209      }
209210   }
210211}
r5077r5078
266267   tilemap_set_flip(ALL_TILEMAPS, flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
267268
268269   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
269   draw_sprites(state, screen->machine->gfx, bitmap, cliprect, flip);
270   draw_sprites(bitmap, cliprect, screen->machine->gfx[2], flip);
270271   tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
271272
272273   return 0;
src/mame/video/ygv608.c
r5077r5078
590590       logerror( "SZ_8X8: sprite=%d\n", code );
591591       code = 0;
592592      }
593      drawgfx( bitmap, machine->gfx[GFX_8X8_4BIT],
593      drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT],
594594          code+namcond1_gfxbank*0x10000,
595595          color,
596596          flipx,flipy,
597          sx,sy,
598          &spriteClip,TRANSPARENCY_PEN,0x00);
597          sx,sy,0x00);
599598      // redraw with wrap-around
600599      if( sx > 512-8 )
601        drawgfx( bitmap, machine->gfx[GFX_8X8_4BIT],
600        drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT],
602601           code+namcond1_gfxbank*0x10000,
603602           color,
604603           flipx,flipy,
605           sx-512,sy,
606           &spriteClip,TRANSPARENCY_PEN,0x00);
604           sx-512,sy,0x00);
607605      if( sy > 512-8 )
608        drawgfx( bitmap, machine->gfx[GFX_8X8_4BIT],
606        drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT],
609607           code+namcond1_gfxbank*0x10000,
610608           color,
611609           flipx,flipy,
612           sx,sy-512,
613           &spriteClip,TRANSPARENCY_PEN,0x00);
610           sx,sy-512,0x00);
614611      // really should draw again for both wrapped!
615612      // - ignore until someone thinks it's required
616613      break;
r5077r5078
623620       logerror( "SZ_8X8: sprite=%d\n", code );
624621       code = 0;
625622      }
626      drawgfx( bitmap, machine->gfx[GFX_16X16_4BIT],
623      drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT],
627624          code+namcond1_gfxbank*0x4000,
628625          color,
629626          flipx,flipy,
630          sx,sy,
631          &spriteClip,TRANSPARENCY_PEN,0x00);
627          sx,sy,0x00);
632628      // redraw with wrap-around
633629      if( sx > 512-16 )
634        drawgfx( bitmap, machine->gfx[GFX_16X16_4BIT],
630        drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT],
635631           code+namcond1_gfxbank*0x4000,
636632           color,
637633           flipx,flipy,
638           sx-512,sy,
639           &spriteClip,TRANSPARENCY_PEN,0x00);
634           sx-512,sy,0x00);
640635      if( sy > 512-16 )
641        drawgfx( bitmap, machine->gfx[GFX_16X16_4BIT],
636        drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT],
642637           code+namcond1_gfxbank*0x4000,
643638           color,
644639           flipx,flipy,
645           sx,sy-512,
646           &spriteClip,TRANSPARENCY_PEN,0x00);
640           sx,sy-512,0x00);
647641      // really should draw again for both wrapped!
648642      // - ignore until someone thinks it's required
649643      break;
r5077r5078
656650     logerror( "SZ_32X32: sprite=%d\n", code );
657651   code = 0;
658652      }
659      drawgfx( bitmap, machine->gfx[GFX_32X32_4BIT],
653      drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT],
660654          code+namcond1_gfxbank*0x1000,
661655          color,
662656          flipx,flipy,
663          sx,sy,
664          &spriteClip,TRANSPARENCY_PEN,0x00);
657          sx,sy,0x00);
665658      // redraw with wrap-around
666659      if( sx > 512-32 )
667        drawgfx( bitmap, machine->gfx[GFX_32X32_4BIT],
660        drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT],
668661           code+namcond1_gfxbank*0x1000,
669662           color,
670663           flipx,flipy,
671           sx-512,sy,
672           &spriteClip,TRANSPARENCY_PEN,0x00);
664           sx-512,sy,0x00);
673665      if( sy > 512-32 )
674        drawgfx( bitmap, machine->gfx[GFX_32X32_4BIT],
666        drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT],
675667           code+namcond1_gfxbank*0x1000,
676668           color,
677669           flipx,flipy,
678           sx,sy-512,
679           &spriteClip,TRANSPARENCY_PEN,0x00);
670           sx,sy-512,0x00);
680671      // really should draw again for both wrapped!
681672      // - ignore until someone thinks it's required
682673      break;
r5077r5078
689680       logerror( "SZ_64X64: sprite=%d\n", code );
690681       code = 0;
691682      }
692      drawgfx( bitmap, machine->gfx[GFX_64X64_4BIT],
683      drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT],
693684          code+namcond1_gfxbank*0x400,
694685          color,
695686          flipx,flipy,
696          sx,sy,
697          &spriteClip,TRANSPARENCY_PEN,0x00);
687          sx,sy,0x00);
698688      // redraw with wrap-around
699689      if( sx > 512-64 )
700        drawgfx( bitmap, machine->gfx[GFX_64X64_4BIT],
690        drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT],
701691           code+namcond1_gfxbank*0x400,
702692           color,
703693           flipx,flipy,
704           sx-512,sy,
705           &spriteClip,TRANSPARENCY_PEN,0x00);
694           sx-512,sy,0x00);
706695      if( sy > 512-64 )
707        drawgfx( bitmap, machine->gfx[GFX_64X64_4BIT],
696        drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT],
708697           code+namcond1_gfxbank*0x400,
709698           color,
710699           flipx,flipy,
711           sx,sy-512,
712           &spriteClip,TRANSPARENCY_PEN,0x00);
700           sx,sy-512,0x00);
713701      // really should draw again for both wrapped!
714702      // - ignore until someone thinks it's required
715703      break;
src/mame/video/senjyo.c
r5077r5078
268268         }
269269
270270
271         drawgfx(bitmap,machine->gfx[big ? 5 : 4],
271         drawgfx_transpen(bitmap,cliprect,machine->gfx[big ? 5 : 4],
272272               spriteram[offs],
273273               spriteram[offs + 1] & 0x07,
274274               flipx,flipy,
275               sx,sy,
276               cliprect,TRANSPARENCY_PEN,0);
275               sx,sy,0);
277276      }
278277   }
279278}
src/mame/video/yiear.c
r5077r5078
133133         sy++;   /* fix title screen & garbage at the bottom of the screen */
134134      }
135135
136      drawgfx(bitmap, machine->gfx[1],
136      drawgfx_transpen(bitmap, cliprect,
137         machine->gfx[1],
137138         code, color,
138139         flipx, flipy,
139         sx, sy,
140         cliprect,
141         TRANSPARENCY_PEN, 0);
140         sx, sy, 0);
142141   }
143142}
144143
src/mame/video/sonson.c
r5077r5078
156156         flipy = !flipy;
157157      }
158158
159      drawgfx(bitmap, machine->gfx[1],
159      drawgfx_transpen(bitmap, cliprect,
160         machine->gfx[1],
160161         code, color,
161162         flipx, flipy,
162         sx, sy,
163         cliprect,
164         TRANSPARENCY_PEN, 0);
163         sx, sy, 0);
165164   }
166165}
167166
src/mame/video/sslam.c
r5077r5078
4444      {
4545         if (flipx)
4646         {
47            drawgfx(bitmap,gfx,number,  colr,1,0,xpos+8,ypos,  cliprect,TRANSPARENCY_PEN,0);
48            drawgfx(bitmap,gfx,number+1,colr,1,0,xpos+8,ypos+8,cliprect,TRANSPARENCY_PEN,0);
49            drawgfx(bitmap,gfx,number+2,colr,1,0,xpos,  ypos,  cliprect,TRANSPARENCY_PEN,0);
50            drawgfx(bitmap,gfx,number+3,colr,1,0,xpos,  ypos+8,cliprect,TRANSPARENCY_PEN,0);
47            drawgfx_transpen(bitmap,cliprect,gfx,number,  colr,1,0,xpos+8,ypos,0);
48            drawgfx_transpen(bitmap,cliprect,gfx,number+1,colr,1,0,xpos+8,ypos+8,0);
49            drawgfx_transpen(bitmap,cliprect,gfx,number+2,colr,1,0,xpos,  ypos,0);
50            drawgfx_transpen(bitmap,cliprect,gfx,number+3,colr,1,0,xpos,  ypos+8,0);
5151         }
5252         else
5353         {
54            drawgfx(bitmap,gfx,number,  colr,0,0,xpos,  ypos,  cliprect,TRANSPARENCY_PEN,0);
55            drawgfx(bitmap,gfx,number+1,colr,0,0,xpos,  ypos+8,cliprect,TRANSPARENCY_PEN,0);
56            drawgfx(bitmap,gfx,number+2,colr,0,0,xpos+8,ypos,  cliprect,TRANSPARENCY_PEN,0);
57            drawgfx(bitmap,gfx,number+3,colr,0,0,xpos+8,ypos+8,cliprect,TRANSPARENCY_PEN,0);
54            drawgfx_transpen(bitmap,cliprect,gfx,number,  colr,0,0,xpos,  ypos,0);
55            drawgfx_transpen(bitmap,cliprect,gfx,number+1,colr,0,0,xpos,  ypos+8,0);
56            drawgfx_transpen(bitmap,cliprect,gfx,number+2,colr,0,0,xpos+8,ypos,0);
57            drawgfx_transpen(bitmap,cliprect,gfx,number+3,colr,0,0,xpos+8,ypos+8,0);
5858         }
5959      }
6060      else
6161      {
6262         if (flipx)
6363         {
64            drawgfx(bitmap,gfx,number ^ 2,colr,1,0,xpos,ypos,cliprect,TRANSPARENCY_PEN,0);
64            drawgfx_transpen(bitmap,cliprect,gfx,number ^ 2,colr,1,0,xpos,ypos,0);
6565         }
6666         else
6767         {
68            drawgfx(bitmap,gfx,number,colr,0,0,xpos,ypos,cliprect,TRANSPARENCY_PEN,0);
68            drawgfx_transpen(bitmap,cliprect,gfx,number,colr,0,0,xpos,ypos,0);
6969         }
7070      }
7171
src/mame/video/simpl156.c
r5077r5078
9898
9999      while (multi >= 0)
100100      {
101         pdrawgfx(bitmap,machine->gfx[2],
101         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],
102102               sprite - multi * inc,
103103               colour,
104104               fx,fy,
105105               x,y + mult * multi,
106               cliprect,TRANSPARENCY_PEN,0,pri);
106               priority_bitmap,pri,0);
107107
108108         multi--;
109109      }
src/mame/video/hcastle.c
r5077r5078
201201static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sbank, int bank )
202202{
203203   int bank_base = (bank == 0) ? 0x4000 * (gfx_bank & 1) : 0;
204   K007121_sprites_draw(bank,bitmap,machine->gfx,machine->colortable,cliprect,sbank,(K007121_ctrlram[bank][6]&0x30)*2,0,bank_base,-1);
204   K007121_sprites_draw(bank,bitmap,cliprect,machine->gfx,machine->colortable,sbank,(K007121_ctrlram[bank][6]&0x30)*2,0,bank_base,-1);
205205}
206206
207207/*****************************************************************************/
src/mame/video/deadang.c
r5077r5078
115115         if (fy) fy=0; else fy=1;
116116      }
117117
118      pdrawgfx(bitmap,machine->gfx[1],
118      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
119119            sprite,
120120            color,fx,fy,x,y,
121            cliprect,TRANSPARENCY_PEN,15,pri);
121            priority_bitmap,pri,15);
122122   }
123123}
124124
src/mame/video/copsnrob.c
r5077r5078
2828      sx = 31 - (offs % 32);
2929      sy = offs / 32;
3030
31      drawgfx(bitmap,screen->machine->gfx[0],
31      drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
3232            videoram[offs] & 0x3f,0,
3333            0,0,
34            8*sx,8*sy,
35            cliprect,TRANSPARENCY_NONE,0);
34            8*sx,8*sy);
3635    }
3736
3837
3938    /* Draw the cars. Positioning was based on a screen shot */
4039    if (copsnrob_cary[0])
41        drawgfx(bitmap,screen->machine->gfx[1],
40        drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
4241                copsnrob_carimage[0],0,
4342                1,0,
44                0xe4,256-copsnrob_cary[0],
45                cliprect,TRANSPARENCY_PEN,0);
43                0xe4,256-copsnrob_cary[0],0);
4644
4745    if (copsnrob_cary[1])
48        drawgfx(bitmap,screen->machine->gfx[1],
46        drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
4947                copsnrob_carimage[1],0,
5048                1,0,
51                0xc4,256-copsnrob_cary[1],
52                cliprect,TRANSPARENCY_PEN,0);
49                0xc4,256-copsnrob_cary[1],0);
5350
5451    if (copsnrob_cary[2])
55        drawgfx(bitmap,screen->machine->gfx[1],
52        drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
5653                copsnrob_carimage[2],0,
5754                0,0,
58                0x24,256-copsnrob_cary[2],
59                cliprect,TRANSPARENCY_PEN,0);
55                0x24,256-copsnrob_cary[2],0);
6056
6157    if (copsnrob_cary[3])
62        drawgfx(bitmap,screen->machine->gfx[1],
58        drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
6359                copsnrob_carimage[3],0,
6460                0,0,
65                0x04,256-copsnrob_cary[3],
66                cliprect,TRANSPARENCY_PEN,0);
61                0x04,256-copsnrob_cary[3],0);
6762
6863
6964    /* Draw the beer truck. Positioning was based on a screen shot.
r5077r5078
8984         {
9085            /* We've hit a truck's back end, so draw the truck.  The front
9186                   end may be off the top of the screen, but we don't care. */
92            drawgfx(bitmap,screen->machine->gfx[2],
87            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
9388                  0,0,
9489                  0,0,
95                  0x80,256-(y+31),
96                  cliprect,TRANSPARENCY_PEN,0);
90                  0x80,256-(y+31),0);
9791            /* Skip past this truck's front end so we don't draw this
9892                truck twice. */
9993            y += 31;
r5077r5078
10296         {
10397            /* We missed a truck's back end (it was off the bottom of the
10498                   screen) but have hit its front end, so draw the truck. */
105            drawgfx(bitmap,screen->machine->gfx[2],
99            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
106100                  0,0,
107101                  0,0,
108                  0x80,256-y,
109                  cliprect,TRANSPARENCY_PEN,0);
102                  0x80,256-y,0);
110103         }
111104      }
112105    }
src/mame/video/twincobr.c
r5077r5078
470470               flipx = attribute & 0x100;
471471               if (flipx) sx -= 14;      /* should really be 15 */
472472               flipy = attribute & 0x200;
473               drawgfx(bitmap,machine->gfx[3],
473               drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
474474                  sprite,
475475                  color,
476476                  flipx,flipy,
477                  sx-32,sy-16,
478                  cliprect,TRANSPARENCY_PEN,0);
477                  sx-32,sy-16,0);
479478            }
480479         }
481480      }
src/mame/video/bking.c
r5077r5078
258258
259259   /* draw the balls */
260260
261   drawgfx(bitmap, screen->machine->gfx[2],
261   drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2],
262262      ball1_pic,
263263      palette_bank,
264264      0, 0,
265      xld1, yld1,
266      cliprect, TRANSPARENCY_PEN, 0);
265      xld1, yld1, 0);
267266
268   drawgfx(bitmap, screen->machine->gfx[3],
267   drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[3],
269268      ball2_pic,
270269      palette_bank,
271270      0, 0,
272      xld2, yld2,
273      cliprect, TRANSPARENCY_PEN, 0);
271      xld2, yld2, 0);
274272
275273   /* draw the crow */
276274
277   drawgfx(bitmap, screen->machine->gfx[1],
275   drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
278276      crow_pic,
279277      palette_bank,
280278      crow_flip, crow_flip,
281      crow_flip ? xld3 - 16 : 256 - xld3, crow_flip ? yld3 - 16 : 256 - yld3,
282      cliprect, TRANSPARENCY_PEN, 0);
279      crow_flip ? xld3 - 16 : 256 - xld3, crow_flip ? yld3 - 16 : 256 - yld3, 0);
283280   return 0;
284281}
285282
r5077r5078
298295      xld = xld1;
299296      yld = yld1;
300297
301      drawgfx(helper1, machine->gfx[2],
298      drawgfx_opaque(helper1, &rect, machine->gfx[2],
302299         ball1_pic,
303300         0,
304301         0, 0,
305         0, 0,
306         &rect, TRANSPARENCY_NONE, 0);
302         0, 0);
307303
308304      latch = 0x0C00;
309305   }
r5077r5078
313309      xld = xld2;
314310      yld = yld2;
315311
316      drawgfx(helper1, machine->gfx[3],
312      drawgfx_opaque(helper1, &rect, machine->gfx[3],
317313         ball2_pic,
318314         0,
319315         0, 0,
320         0, 0,
321         &rect, TRANSPARENCY_NONE, 0);
316         0, 0);
322317
323318      latch = 0x0400;
324319   }
src/mame/video/labyrunr.c
r5077r5078
201201      }
202202
203203      tilemap_draw(bitmap,&finalclip0,layer0,TILEMAP_DRAW_OPAQUE,0);
204      K007121_sprites_draw(0,bitmap,screen->machine->gfx,screen->machine->colortable,cliprect,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
204      K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
205205      /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */
206206      tilemap_draw(bitmap,&finalclip1,layer1,TILEMAP_DRAW_OPAQUE,0);
207207   }
r5077r5078
269269      tilemap_draw(bitmap,&finalclip1,layer1,0,1);
270270      if(use_clip3[1]) tilemap_draw(bitmap,&finalclip3,layer1,0,1);
271271
272      K007121_sprites_draw(0,bitmap,screen->machine->gfx,screen->machine->colortable,cliprect,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
272      K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
273273   }
274274   return 0;
275275}
src/mame/video/taito_o.c
r5077r5078
122122                     flipy ^= 0x0080;
123123                  }
124124
125                  drawgfxzoom( bitmap, machine -> gfx[0],
125                  drawgfxzoom_transpen( bitmap, cliprect,
126                         machine -> gfx[0],
126127                         tile,
127128                         color,
128129                         flipx, flipy,
129130                         x, y,
130                         cliprect,
131                         TRANSPARENCY_PEN, 0,
132                         zx, zy
131                         zx, zy, 0
133132                  );
134133               }
135134               tile_offs ++;
src/mame/video/ccastles.c
r5077r5078
288288      int which = spriteaddr[offs];
289289      int color = spriteaddr[offs+2] >> 7;
290290
291      drawgfx(spritebitmap, screen->machine->gfx[0], which, color, flip, flip, x, y, cliprect, TRANSPARENCY_PEN, 7);
291      drawgfx_transpen(spritebitmap, cliprect, screen->machine->gfx[0], which, color, flip, flip, x, y, 7);
292292   }
293293
294294   /* draw the bitmap to the screen, looping over Y */
src/mame/video/ddragon3.c
r5077r5078
163163
164164         for (i = 0; i <= height; i++)
165165         {
166            drawgfx(bitmap, machine->gfx[1], code + i, color, flipx, flipy,
167               sx, sy + (flip_screen_get(machine) ? (i * 16) : (-i * 16)), cliprect,
168               TRANSPARENCY_PEN, 0);
166            drawgfx_transpen(bitmap, cliprect,
167               machine->gfx[1], code + i, color, flipx, flipy,
168               sx, sy + (flip_screen_get(machine) ? (i * 16) : (-i * 16)), 0);
169169         }
170170      }
171171
src/mame/video/sprint2.c
r5077r5078
131131
132132   for (i = 0; i < 4; i++)
133133   {
134      drawgfx(bitmap, screen->machine->gfx[1],
134      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
135135         get_sprite_code(i),
136136         i,
137137         0, 0,
138138         get_sprite_x(i),
139         get_sprite_y(i),
140         cliprect, TRANSPARENCY_PEN, 0);
139         get_sprite_y(i), 0);
141140   }
142141   return 0;
143142}
r5077r5078
179178
180179      tilemap_draw(helper, &rect, bg_tilemap, 0, 0);
181180
182      drawgfx(helper, machine->gfx[1],
181      drawgfx_transpen(helper, &rect, machine->gfx[1],
183182         get_sprite_code(i),
184183         0,
185184         0, 0,
186185         get_sprite_x(i),
187         get_sprite_y(i),
188         &rect, TRANSPARENCY_PEN, 1);
186         get_sprite_y(i), 1);
189187
190188      collision[i] |= collision_check(machine->colortable, &rect);
191189
r5077r5078
194192      for (j = 0; j < 4; j++)
195193         if (j != i)
196194         {
197            drawgfx(helper, machine->gfx[1],
195            drawgfx_transpen(helper, &rect, machine->gfx[1],
198196               get_sprite_code(j),
199197               1,
200198               0, 0,
201199               get_sprite_x(j),
202               get_sprite_y(j),
203               &rect, TRANSPARENCY_PEN, 0);
200               get_sprite_y(j), 0);
204201         }
205202
206      drawgfx(helper, machine->gfx[1],
203      drawgfx_transpen(helper, &rect, machine->gfx[1],
207204         get_sprite_code(i),
208205         0,
209206         0, 0,
210207         get_sprite_x(i),
211         get_sprite_y(i),
212         &rect, TRANSPARENCY_PEN, 1);
208         get_sprite_y(i), 1);
213209
214210      collision[i] |= collision_check(machine->colortable, &rect);
215211   }
src/mame/video/orbit.c
r5077r5078
7878      hpos <<= 1;
7979      vpos <<= 1;
8080
81      drawgfxzoom(bitmap, machine->gfx[layout], code, 0, flip_x, flip_y,
82         hpos, vpos, cliprect, TRANSPARENCY_PEN, 0, zoom_x, zoom_y);
81      drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[layout], code, 0, flip_x, flip_y,
82         hpos, vpos, zoom_x, zoom_y, 0);
8383   }
8484}
8585
src/mame/video/ambush.c
r5077r5078
159159         flipy = !flipy;
160160      }
161161
162      drawgfx(bitmap,screen->machine->gfx[gfx],
162      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx],
163163            code, col | ((*ambush_colorbank & 0x03) << 4),
164164            flipx, flipy,
165            sx,sy,
166            cliprect,TRANSPARENCY_PEN,0);
165            sx,sy,0);
167166   }
168167
169168
src/mame/video/seibuspi.c
r5077r5078
234234   COMBINE_DATA( &video_dma_address );
235235}
236236
237static void draw_blend_gfx(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
237static void drawgfx_blend(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
238238{
239   const pen_t *pens = &machine->pens[gfx->color_base];
239   const pen_t *pens = &gfx->machine->pens[gfx->color_base];
240240   const UINT8 *dp;
241241   int i, j;
242242   int x1, x2;
r5077r5078
410410
411411      for( x=x1; x < width; x++ ) {
412412         for( y=y1; y < height; y++ ) {
413            draw_blend_gfx(machine, bitmap, cliprect, gfx, tile_num, color, flip_x, flip_y, xpos + sprite_xtable[flip_x][x], ypos + sprite_ytable[flip_y][y]);
413            drawgfx_blend(bitmap, cliprect, gfx, tile_num, color, flip_x, flip_y, xpos + sprite_xtable[flip_x][x], ypos + sprite_ytable[flip_y][y]);
414414
415415            /* xpos seems to wrap-around to 0 at 512 */
416416            if( (xpos + (16 * x) + 16) >= 512 ) {
417               draw_blend_gfx(machine, bitmap, cliprect, gfx, tile_num, color, flip_x, flip_y, xpos - 512 + sprite_xtable[flip_x][x], ypos + sprite_ytable[flip_y][y]);
417               drawgfx_blend(bitmap, cliprect, gfx, tile_num, color, flip_x, flip_y, xpos - 512 + sprite_xtable[flip_x][x], ypos + sprite_ytable[flip_y][y]);
418418            }
419419
420420            tile_num++;
src/mame/video/sauro.c
r5077r5078
133133         sy = 240 - sy;
134134      }
135135
136      drawgfx(bitmap, machine->gfx[2],
136      drawgfx_transpen(bitmap, cliprect,machine->gfx[2],
137137            code,
138138            color,
139139            flipx,flip_screen_get(machine),
140            sx,sy,
141            cliprect,TRANSPARENCY_PEN,0);
140            sx,sy,0);
142141   }
143142}
144143
r5077r5078
203202         sy = 240 - sy;
204203      }
205204
206      drawgfx(bitmap, machine->gfx[1],
205      drawgfx_transpen(bitmap, cliprect,machine->gfx[1],
207206            code,
208207            color,
209208            flipx,flip_screen_get(machine),
210            sx,sy,
211            cliprect,TRANSPARENCY_PEN,0);
209            sx,sy,0);
212210   }
213211}
214212
src/mame/video/gaplus.c
r5077r5078
303303         {
304304            for (x = 0;x <= sizex;x++)
305305            {
306               drawgfx(bitmap,machine->gfx[1],
306               drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
307307                  sprite + (duplicate ? 0 : (gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)])),
308308                  color,
309309                  flipx,flipy,
310310                  sx + 16*x,sy + 16*y,
311                  cliprect,TRANSPARENCY_PENS,
312311                  colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0xff));
313312            }
314313         }
src/mame/video/drmicro.c
r5077r5078
154154         else
155155            x = (240-x) & 0xff;
156156
157         drawgfx(bitmap,screen->machine->gfx[3-g],
157         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3-g],
158158               chr,
159159               col,
160160               fx,fy,
161               x,y,
162               cliprect,TRANSPARENCY_PEN,0);
161               x,y,0);
163162
164163         if (x>240)
165164         {
166            drawgfx(bitmap,screen->machine->gfx[3-g],
165            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3-g],
167166                  chr,
168167                  col,
169168                  fx,fy,
170                  x-256,y,
171                  cliprect,TRANSPARENCY_PEN,0);
169                  x-256,y,0);
172170         }
173171      }
174172   }
src/mame/video/carpolo.c
r5077r5078
196196      code = carpolo_alpharam[alpha_line * 32 + x] >> 2;
197197      col  = carpolo_alpharam[alpha_line * 32 + x] & 0x03;
198198
199      drawgfx(bitmap,machine->gfx[2],
199      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
200200            code,col,
201201            0,0,
202            x*8,video_line*8,
203            cliprect,TRANSPARENCY_PEN,0);
202            x*8,video_line*8,0);
204203   }
205204}
206205
r5077r5078
225224   x = 240 - x;
226225   y = 240 - y;
227226
228   drawgfx(bitmap,machine->gfx[0],
227   drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
229228         remapped_code, col,
230229         0, flipy,
231         x, y,
232         cliprect,TRANSPARENCY_PEN,0);
230         x, y,0);
233231
234232   /* draw with wrap around */
235   drawgfx(bitmap,machine->gfx[0],
233   drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
236234         remapped_code, col,
237235         0, flipy,
238         (INT16)x - 256, y,
239         cliprect,TRANSPARENCY_PEN,0);
236         (INT16)x - 256, y,0);
240237}
241238
242239
r5077r5078
283280
284281   /* left goal - position determined by bit 6 of the
285282       horizontal and vertical timing PROMs */
286   drawgfxzoom(bitmap,screen->machine->gfx[1],
283   drawgfxzoom_transpen(bitmap,cliprect,screen->machine->gfx[1],
287284            0,0,
288285            0,0,
289286            LEFT_GOAL_X,GOAL_Y,
290            cliprect,TRANSPARENCY_PEN,0,
291            0x20000,0x20000);
287            0x20000,0x20000,0);
292288
293289   /* right goal */
294   drawgfxzoom(bitmap,screen->machine->gfx[1],
290   drawgfxzoom_transpen(bitmap,cliprect,screen->machine->gfx[1],
295291            0,1,
296292            1,0,
297293            RIGHT_GOAL_X,GOAL_Y,
298            cliprect,TRANSPARENCY_PEN,0,
299            0x20000,0x20000);
294            0x20000,0x20000,0);
300295
301296   /* special char - bit 0 of 0x0f enables it,
302297                      bit 1 marked as WIDE, but never appears to be set */
r5077r5078
382377      bitmap_fill(sprite_sprite_collision_bitmap1, 0, 0);
383378      bitmap_fill(sprite_sprite_collision_bitmap2, 0, 0);
384379
385      drawgfx(sprite_sprite_collision_bitmap1,machine->gfx[0],
380      drawgfx_opaque(sprite_sprite_collision_bitmap1,0,machine->gfx[0],
386381            code1,0,
387382            0,flipy1,
388            x1,y1,
389            0,TRANSPARENCY_NONE,0);
383            x1,y1);
390384
391      drawgfx(sprite_sprite_collision_bitmap2,machine->gfx[0],
385      drawgfx_opaque(sprite_sprite_collision_bitmap2,0,machine->gfx[0],
392386            code2,0,
393387            0,flipy2,
394            x2,y2,
395            0,TRANSPARENCY_NONE,0);
388            x2,y2);
396389
397390      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
398391         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
r5077r5078
437430      bitmap_fill(sprite_goal_collision_bitmap1, 0, 0);
438431      bitmap_fill(sprite_goal_collision_bitmap2, 0, 0);
439432
440      drawgfx(sprite_goal_collision_bitmap1,machine->gfx[0],
433      drawgfx_opaque(sprite_goal_collision_bitmap1,0,machine->gfx[0],
441434            code1,0,
442435            0,flipy1,
443            x1,y1,
444            0,TRANSPARENCY_NONE,0);
436            x1,y1);
445437
446      drawgfxzoom(sprite_goal_collision_bitmap2,machine->gfx[1],
438      drawgfxzoom_transpen(sprite_goal_collision_bitmap2,0,machine->gfx[1],
447439               0,0,
448440               0,0,
449441               x2,y2,
450               0,TRANSPARENCY_PEN,0,
451               0x20000,0x20000);
442               0x20000,0x20000,0);
452443
453444      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
454445         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
r5077r5078
496487      bitmap_fill(sprite_goal_collision_bitmap1, 0, 0);
497488      bitmap_fill(sprite_goal_collision_bitmap2, 0, 0);
498489
499      drawgfx(sprite_goal_collision_bitmap1,machine->gfx[0],
490      drawgfx_opaque(sprite_goal_collision_bitmap1,0,machine->gfx[0],
500491            code1,0,
501492            0,flipy1,
502            x1,y1,
503            0,TRANSPARENCY_NONE,0);
493            x1,y1);
504494
505      drawgfxzoom(sprite_goal_collision_bitmap2,machine->gfx[1],
495      drawgfxzoom_transpen(sprite_goal_collision_bitmap2,0,machine->gfx[1],
506496               0,1,
507497               1,0,
508498               x2,y2,
509               0,TRANSPARENCY_PEN,0,
510               0x20000,0x20000);
499               0x20000,0x20000,0);
511500
512501      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
513502         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
r5077r5078
543532   x1 = 240 - x1;
544533   y1 = 240 - y1;
545534
546   drawgfx(sprite_border_collision_bitmap,machine->gfx[0],
535   drawgfx_opaque(sprite_border_collision_bitmap,0,machine->gfx[0],
547536         code1,0,
548537         0,flipy1,
549         0,0,
550         0,TRANSPARENCY_NONE,0);
538         0,0);
551539
552540   for (x = 0; x < SPRITE_WIDTH; x++)
553541      for (y = 0; y < SPRITE_HEIGHT; y++)
src/mame/video/powerins.c
r5077r5078
311311      {
312312         for (y = 0 ; y < dimy ; y++)
313313         {
314            drawgfx(bitmap,machine->gfx[2],
314            drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
315315                  code,
316316                  color,
317317                  flipx, flipy,
318318                  sx + x*16,
319                  sy + y*16,
320                  cliprect,TRANSPARENCY_PEN,15);
319                  sy + y*16,15);
321320
322321            code += inc;
323322         }
src/mame/video/stvvdp2.c
r5077r5078
23922392
23932393}
23942394
2395static void stv_vdp2_drawgfxzoom( running_machine *machine,
2396      bitmap_t *dest_bmp,const gfx_element *gfx,
2395static void stv_vdp2_drawgfxzoom(
2396      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
23972397      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
2398      const rectangle *clip,int transparency,int transparent_color,int scalex, int scaley,
2398      int transparency,int transparent_color,int scalex, int scaley,
23992399      int sprite_screen_width, int sprite_screen_height, int alpha)
24002400{
24012401   rectangle myclip;
r5077r5078
24492449
24502450   if( gfx )
24512451   {
2452      const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
2452      const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
24532453      const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
24542454
24552455      //int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
r5077r5078
27262726   *rgb = (_r << 10) |  (_g << 5) | _b;
27272727}
27282728
2729static void stv_vdp2_drawgfx_rgb555( bitmap_t *dest_bmp, UINT32 code, int flipx, int flipy,
2730                            int sx, int sy, const rectangle *clip, int transparency, int alpha)
2729static void stv_vdp2_drawgfx_rgb555( bitmap_t *dest_bmp, const rectangle *clip, UINT32 code, int flipx, int flipy,
2730                            int sx, int sy, int transparency, int alpha)
27312731{
27322732   rectangle myclip;
27332733   UINT8* gfxdata;
r5077r5078
37113711            if (stv2_current_tilemap.tile_size==1)
37123712            {
37133713               /* normal */
3714               stv_vdp2_drawgfxzoom(machine,bitmap,machine->gfx[gfx],tilecode+(0+(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos >> 16, drawypos >> 16,cliprect,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X, SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
3715               stv_vdp2_drawgfxzoom(machine,bitmap,machine->gfx[gfx],tilecode+(1-(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,(drawxpos+tilesizex) >> 16,drawypos >> 16,cliprect,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X1(tilesizex), SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
3716               stv_vdp2_drawgfxzoom(machine,bitmap,machine->gfx[gfx],tilecode+(2+(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos >> 16,(drawypos+tilesizey) >> 16,cliprect,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X, SCR_TILESIZE_Y1(tilesizey),stv2_current_tilemap.alpha);
3717               stv_vdp2_drawgfxzoom(machine,bitmap,machine->gfx[gfx],tilecode+(3-(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,(drawxpos+tilesizex)>> 16,(drawypos+tilesizey) >> 16,cliprect,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X1(tilesizex), SCR_TILESIZE_Y1(tilesizey),stv2_current_tilemap.alpha);
3714               stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode+(0+(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos >> 16, drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X, SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
3715               stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode+(1-(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,(drawxpos+tilesizex) >> 16,drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X1(tilesizex), SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
3716               stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode+(2+(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos >> 16,(drawypos+tilesizey) >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X, SCR_TILESIZE_Y1(tilesizey),stv2_current_tilemap.alpha);
3717               stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode+(3-(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,(drawxpos+tilesizex)>> 16,(drawypos+tilesizey) >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X1(tilesizex), SCR_TILESIZE_Y1(tilesizey),stv2_current_tilemap.alpha);
37183718
37193719            }
37203720            else
37213721            {
3722               stv_vdp2_drawgfxzoom(machine,bitmap,machine->gfx[gfx],tilecode,pal,flipyx&1,flipyx&2, drawxpos >> 16, drawypos >> 16,cliprect,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X,SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
3722               stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode,pal,flipyx&1,flipyx&2, drawxpos >> 16, drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X,SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
37233723            }
37243724         }
37253725         else
r5077r5078
37323732               if ( stv2_current_tilemap.colour_depth == 3 )
37333733               {
37343734                  /* normal */
3735                  stv_vdp2_drawgfx_rgb555(bitmap,tilecode+(0+(flipyx&1)+(flipyx&2))*4,flipyx&1,flipyx&2,drawxpos, drawypos,cliprect,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
3736                  stv_vdp2_drawgfx_rgb555(bitmap,tilecode+(1-(flipyx&1)+(flipyx&2))*4,flipyx&1,flipyx&2,drawxpos+8,drawypos,cliprect,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
3737                  stv_vdp2_drawgfx_rgb555(bitmap,tilecode+(2+(flipyx&1)-(flipyx&2))*4,flipyx&1,flipyx&2,drawxpos,drawypos+8,cliprect,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
3738                  stv_vdp2_drawgfx_rgb555(bitmap,tilecode+(3-(flipyx&1)-(flipyx&2))*4,flipyx&1,flipyx&2,drawxpos+8,drawypos+8,cliprect,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
3735                  stv_vdp2_drawgfx_rgb555(bitmap,cliprect,tilecode+(0+(flipyx&1)+(flipyx&2))*4,flipyx&1,flipyx&2,drawxpos, drawypos,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
3736                  stv_vdp2_drawgfx_rgb555(bitmap,cliprect,tilecode+(1-(flipyx&1)+(flipyx&2))*4,flipyx&1,flipyx&2,drawxpos+8,drawypos,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
3737                  stv_vdp2_drawgfx_rgb555(bitmap,cliprect,tilecode+(2+(flipyx&1)-(flipyx&2))*4,flipyx&1,flipyx&2,drawxpos,drawypos+8,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
3738                  stv_vdp2_drawgfx_rgb555(bitmap,cliprect,tilecode+(3-(flipyx&1)-(flipyx&2))*4,flipyx&1,flipyx&2,drawxpos+8,drawypos+8,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
37393739
37403740               }
37413741               else if (stv2_current_tilemap.transparency == STV_TRANSPARENCY_ALPHA)
r5077r5078
37613761            {
37623762               if ( stv2_current_tilemap.colour_depth == 3 )
37633763               {
3764                  stv_vdp2_drawgfx_rgb555(bitmap,tilecode,flipyx&1,flipyx&2,drawxpos,drawypos,cliprect,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
3764                  stv_vdp2_drawgfx_rgb555(bitmap,cliprect,tilecode,flipyx&1,flipyx&2,drawxpos,drawypos,stv2_current_tilemap.transparency,stv2_current_tilemap.alpha);
37653765               }
37663766               else
37673767               {
src/mame/video/exedexes.c
r5077r5078
204204         sx = buffered_spriteram[offs + 3] - ((buffered_spriteram[offs + 1] & 0x80) << 1);
205205         sy = buffered_spriteram[offs + 2];
206206
207         drawgfx(bitmap,machine->gfx[3],
207         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
208208               code,
209209               color,
210210               flipx,flipy,
211               sx,sy,
212               cliprect,TRANSPARENCY_PEN,0);
211               sx,sy,0);
213212      }
214213   }
215214}
src/mame/video/seta2.c
r5077r5078
285285                  {
286286                     for (tx = 0; tx <= tilesize; tx++)
287287                     {
288                        drawgfx(bitmap, machine->gfx[gfx],
288                        drawgfx_transpen(bitmap, cliprect,machine->gfx[gfx],
289289                              code ^ tx ^ (ty<<1),
290290                              color,
291291                              flipx, flipy,
292                              px + (flipx ? tilesize-tx : tx) * 8, py + (flipy ? tilesize-ty : ty) * 8,
293                              cliprect,TRANSPARENCY_PEN,0 );
292                              px + (flipx ? tilesize-tx : tx) * 8, py + (flipy ? tilesize-ty : ty) * 8,0 );
294293                     }
295294                  }
296295
r5077r5078
328327            {
329328               for (x = 0; x <= sizex; x++)
330329               {
331                  drawgfx(bitmap, machine->gfx[gfx],
330                  drawgfx_transpen(bitmap, cliprect,machine->gfx[gfx],
332331                        code++,
333332                        color,
334333                        flipx, flipy,
335                        sx + (flipx ? sizex-x : x) * 8, sy + (flipy ? sizey-y : y) * 8,
336                        cliprect,TRANSPARENCY_PEN,0 );
334                        sx + (flipx ? sizex-x : x) * 8, sy + (flipy ? sizey-y : y) * 8,0 );
337335               }
338336            }
339337         }
src/mame/video/flkatck.c
r5077r5078
173173
174174   /* draw the graphics */
175175   tilemap_draw(bitmap,&final_clip[0],k007121_tilemap[0],0,0);
176   K007121_sprites_draw(0,bitmap,screen->machine->gfx,NULL,cliprect,&k007121_ram[0x1000],0,40,0,-1);
176   K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,NULL,&k007121_ram[0x1000],0,40,0,-1);
177177   tilemap_draw(bitmap,&final_clip[1],k007121_tilemap[1],0,0);
178178   return 0;
179179}
src/mame/video/shootout.c
r5077r5078
122122                  vy = 240 - vy;
123123               }
124124
125               pdrawgfx(bitmap,gfx,
125               pdrawgfx_transpen(bitmap,cliprect,gfx,
126126                  number,
127127                  0 /*color*/,
128128                  flipx,flipy,
129129                  vx,vy,
130                  cliprect,TRANSPARENCY_PEN,0,
131                  priority_mask);
130                  priority_bitmap,
131                  priority_mask,0);
132132
133133               number++;
134134               sy += 16;
r5077r5078
141141               vy = 240 - vy;
142142            }
143143
144            pdrawgfx(bitmap,gfx,
144            pdrawgfx_transpen(bitmap,cliprect,gfx,
145145                  number,
146146                  0 /*color*/,
147147                  flipx,flipy,
148148                  vx,vy,
149                  cliprect,TRANSPARENCY_PEN,0,
150                  priority_mask);
149                  priority_bitmap,
150                  priority_mask,0);
151151            }
152152      }
153153      source -= 4;
src/mame/video/contra.c
r5077r5078
275275   if (bank==0) source=private_spriteram;
276276   else source=private_spriteram_2;
277277
278   K007121_sprites_draw(bank,bitmap,machine->gfx,machine->colortable,cliprect,source,base_color,40,0,-1);
278   K007121_sprites_draw(bank,bitmap,cliprect,machine->gfx,machine->colortable,source,base_color,40,0,-1);
279279}
280280
281281VIDEO_UPDATE( contra )
src/mame/video/paradise.c
r5077r5078
195195      if (flip_screen_get(machine))   {   x = 0xf0 - x;   flipx = !flipx;
196196                        y = 0xf0 - y;   flipy = !flipy;   }
197197
198      drawgfx(bitmap,machine->gfx[0],
198      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
199199            code + (attr << 8),
200200            0,
201201            flipx, flipy,
202            x,y,
203            cliprect,TRANSPARENCY_PEN, 0xff );
202            x,y, 0xff );
204203
205204      /* wrap around x */
206      drawgfx(bitmap,machine->gfx[0],
205      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
207206            code + (attr << 8),
208207            0,
209208            flipx, flipy,
210            x - 256,y,
211            cliprect,TRANSPARENCY_PEN, 0xff );
209            x - 256,y, 0xff );
212210
213      drawgfx(bitmap,machine->gfx[0],
211      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
214212            code + (attr << 8),
215213            0,
216214            flipx, flipy,
217            x + 256,y,
218            cliprect,TRANSPARENCY_PEN, 0xff );
215            x + 256,y, 0xff );
219216   }
220217}
221218
src/mame/video/mexico86.c
r5077r5078
8888            x = (sx + xc * 8) & 0xff;
8989            y = (sy + yc * 8) & 0xff;
9090
91            drawgfx(bitmap,screen->machine->gfx[0],
91            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
9292                  code,
9393                  color,
9494                  flipx,flipy,
95                  x,y,
96                  cliprect,TRANSPARENCY_PEN,15);
95                  x,y,15);
9796         }
9897      }
9998   }
r5077r5078
145144         color = (mexico86_videoram[goffs + 1] & 0xe0) >> 5;
146145         goffs += 0x40;
147146
148         drawgfx(bitmap,screen->machine->gfx[0],
147         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
149148               code,
150149               color,
151150               0,0,
152               sx&0xff,y,
153               cliprect,TRANSPARENCY_PEN,15);
151               sx&0xff,y,15);
154152
155153         code = mexico86_videoram[goffs] + ((mexico86_videoram[goffs + 1] & 0x1f) << 8);
156154         color = (mexico86_videoram[goffs + 1] & 0xe0) >> 5;
157155
158         drawgfx(bitmap,screen->machine->gfx[0],
156         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
159157               code,
160158               color,
161159               0,0,
162               (sx+8)&0xff,y,
163               cliprect,TRANSPARENCY_PEN,15);
160               (sx+8)&0xff,y,15);
164161      }
165162   }
166163   return 0;
src/mame/video/chaknpop.c
r5077r5078
235235         flipy = !flipy;
236236      }
237237
238      drawgfx(bitmap,machine->gfx[0],
238      drawgfx_transpen(bitmap,cliprect,
239            machine->gfx[0],
239240            tile,
240241            color,
241242            flipx, flipy,
242            sx, sy,
243            cliprect,
244            TRANSPARENCY_PEN, 0);
243            sx, sy, 0);
245244   }
246245}
247246
src/mame/video/fitfight.c
r5077r5078
3434
3535      if (end) break;
3636      if (prio == layer)
37        drawgfx(bitmap,gfx,number,colr,xflip,yflip,xpos,ypos,cliprect,TRANSPARENCY_PEN,0);
37        drawgfx_transpen(bitmap,cliprect,gfx,number,colr,xflip,yflip,xpos,ypos,0);
3838
3939      source+=4;
4040   }
src/mame/video/sspeedr.c
r5077r5078
211211
212212      y = 0xf0 - drones_vert[i >> 1];
213213
214      drawgfx(bitmap, machine->gfx[1],
214      drawgfx_transpen(bitmap, cliprect,
215         machine->gfx[1],
215216         code[i] ^ toggle,
216217         0,
217218         0, 0,
218219         x,
219         y,
220         cliprect,
221         TRANSPARENCY_PEN, 0);
220         y, 0);
222221   }
223222}
224223
r5077r5078
242241
243242   y = 0xf0 - driver_vert;
244243
245   drawgfx(bitmap, machine->gfx[0],
244   drawgfx_transpen(bitmap, cliprect,
245      machine->gfx[0],
246246      driver_pic,
247247      0,
248248      0, 0,
249249      x,
250      y,
251      cliprect,
252      TRANSPARENCY_PEN, 0);
250      y, 0);
253251}
254252
255253
src/mame/video/terracre.c
r5077r5078
8686            flipy = !flipy;
8787      }
8888
89      drawgfx(
90         bitmap,pGfx,tile, color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,transparent_pen );
89      drawgfx_transpen(
90         bitmap,cliprect,pGfx,tile, color,flipx,flipy,sx,sy,transparent_pen );
9191
9292      pSource += 4;
9393   }
src/mame/video/mouser.c
r5077r5078
8787      /* Note: this is _not_ dependant on flipping */
8888      color_offs = offs%32 + ((256 + 8*(offs/32) - spriteram[offs%32])%256)/8*32;
8989
90      drawgfx(bitmap,screen->machine->gfx[0],
90      drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
9191            videoram[offs] | (colorram[color_offs]>>5)*256 | ((colorram[color_offs]>>4)&1)*512,
9292            colorram[color_offs]%16,
9393            flip_screen_x_get(screen->machine),flip_screen_y_get(screen->machine),
94            8*sx,scrolled_y_position,
95            cliprect,TRANSPARENCY_NONE,0);
94            8*sx,scrolled_y_position);
9695   }
9796
9897   /* There seem to be two sets of sprites, each decoded identically */
r5077r5078
119118      }
120119
121120      if ((spriteram[offs+1]&0x10)>>4)
122         drawgfx(bitmap,screen->machine->gfx[1+((spriteram[offs+1]&0x20)>>5)],
121         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1+((spriteram[offs+1]&0x20)>>5)],
123122               spriteram[offs]&0x3f,
124123               spriteram[offs+1]%16,
125124               flipx,flipy,
126               sx,sy,
127               cliprect,TRANSPARENCY_PEN,0);
125               sx,sy,0);
128126   }
129127
130128   /* This is the second set of 8 sprites */
r5077r5078
149147      }
150148
151149      if ((spriteram[offs+1]&0x10)>>4)
152         drawgfx(bitmap,screen->machine->gfx[1+((spriteram[offs+1]&0x20)>>5)],
150         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1+((spriteram[offs+1]&0x20)>>5)],
153151               spriteram[offs]&0x3f,
154152               spriteram[offs+1]%16,
155153               flipx,flipy,
156               sx,sy,
157               cliprect,TRANSPARENCY_PEN,0);
154               sx,sy,0);
158155   }
159156
160157   return 0;
src/mame/video/undrfire.c
r5077r5078
192192            }
193193            else
194194            {
195               drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
195               drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
196196                     sprite_ptr->code,
197197                     sprite_ptr->color,
198198                     sprite_ptr->flipx,sprite_ptr->flipy,
199199                     sprite_ptr->x,sprite_ptr->y,
200                     cliprect,TRANSPARENCY_PEN,0,
201                     sprite_ptr->zoomx,sprite_ptr->zoomy);
200                     sprite_ptr->zoomx,sprite_ptr->zoomy,0);
202201            }
203202         }
204203      }
r5077r5078
212211   {
213212      sprite_ptr--;
214213
215      pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
214      pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
216215            sprite_ptr->code,
217216            sprite_ptr->color,
218217            sprite_ptr->flipx,sprite_ptr->flipy,
219218            sprite_ptr->x,sprite_ptr->y,
220            cliprect,TRANSPARENCY_PEN,0,
221219            sprite_ptr->zoomx,sprite_ptr->zoomy,
222            sprite_ptr->primask);
220            priority_bitmap,sprite_ptr->primask,0);
223221   }
224222}
225223
r5077r5078
331329         }
332330         else
333331         {
334            drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
332            drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
335333                  sprite_ptr->code,
336334                  sprite_ptr->color,
337335                  sprite_ptr->flipx,sprite_ptr->flipy,
338336                  sprite_ptr->x,sprite_ptr->y,
339                  cliprect,TRANSPARENCY_PEN,0,
340                  sprite_ptr->zoomx,sprite_ptr->zoomy);
337                  sprite_ptr->zoomx,sprite_ptr->zoomy,0);
341338         }
342339      }
343340   }
r5077r5078
347344   {
348345      sprite_ptr--;
349346
350      pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
347      pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
351348            sprite_ptr->code,
352349            sprite_ptr->color,
353350            sprite_ptr->flipx,sprite_ptr->flipy,
354351            sprite_ptr->x,sprite_ptr->y,
355            cliprect,TRANSPARENCY_PEN,0,
356352            sprite_ptr->zoomx,sprite_ptr->zoomy,
357            sprite_ptr->primask);
353            priority_bitmap,sprite_ptr->primask,0);
358354   }
359355}
360356
src/mame/video/deco32.c
r5077r5078
279279
280280      for (x=0; x<w; x++) {
281281         for (y=0; y<h; y++) {
282            pdrawgfx(bitmap,machine->gfx[gfxbank],
282            pdrawgfx_transpen(bitmap,cliprect,machine->gfx[gfxbank],
283283                  sprite + y + h * x,
284284                  colour,
285285                  fx,fy,
286286                  sx + x_mult * (w-x),sy + y_mult * (h-y),
287                  cliprect,TRANSPARENCY_PEN,0,prival);
287                  priority_bitmap,prival,0);
288288
289289            // wrap-around y
290            pdrawgfx(bitmap,machine->gfx[gfxbank],
290            pdrawgfx_transpen(bitmap,cliprect,machine->gfx[gfxbank],
291291                  sprite + y + h * x,
292292                  colour,
293293                  fx,fy,
294294                  sx + x_mult * (w-x),sy + y_mult * (h-y) - 512,
295                  cliprect,TRANSPARENCY_PEN,0,prival);
295                  priority_bitmap,prival,0);
296296         }
297297      }
298298   }
r5077r5078
346346
347347      while (multi >= 0)
348348      {
349         deco16_pdrawgfx(machine,
350               bitmap,machine->gfx[gfxbank],
349         deco16_pdrawgfx(
350               bitmap,cliprect,machine->gfx[gfxbank],
351351               sprite - multi * inc,
352352               colour,
353353               fx,fy,
354354               x,y + mult * multi,
355               cliprect,0,pri,1<<gfxbank, 1, alpha);
355               0,pri,1<<gfxbank, 1, alpha);
356356
357357         multi--;
358358      }
r5077r5078
364364    Bottom 8 bits per pixel is palettised sprite data, top 8 is
365365    colour/alpha/priority.
366366*/
367static void deco32_draw_sprite(bitmap_t *dest,const gfx_element *gfx,
368      UINT32 code,UINT32 priority,int flipx,int flipy,int sx,int sy,
369      const rectangle *clip)
367static void deco32_draw_sprite(bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
368      UINT32 code,UINT32 priority,int flipx,int flipy,int sx,int sy)
370369{
371370   const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
372371   int ox,oy,cx,cy;
r5077r5078
462461
463462      while (multi >= 0)
464463      {
465         deco32_draw_sprite(bitmap,machine->gfx[gfxbank],
464         deco32_draw_sprite(bitmap,cliprect,machine->gfx[gfxbank],
466465               sprite - multi * inc,
467466               colour,
468467               fx,fy,
469               x,y + mult * multi,
470               cliprect);
468               x,y + mult * multi);
471469
472470         multi--;
473471      }
474472   }
475473}
476474
477INLINE void dragngun_drawgfxzoom( running_machine *machine,
478      bitmap_t *dest_bmp,const gfx_element *gfx,
475INLINE void dragngun_drawgfxzoom(
476      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
479477      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
480      const rectangle *clip,int transparent_color,
478      int transparent_color,
481479      int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask, int sprite_screen_width, int  sprite_screen_height, UINT8 alpha )
482480{
483481   rectangle myclip;
r5077r5078
510508   {
511509      if( gfx )
512510      {
513         const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
511         const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
514512         const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
515513
516514         if (sprite_screen_width && sprite_screen_height)
r5077r5078
821819            sprite&=0x7fff;
822820
823821            if (zoomx!=0x10000 || zoomy!=0x10000)
824               dragngun_drawgfxzoom(machine,
825                  bitmap,machine->gfx[bank],
822               dragngun_drawgfxzoom(
823                  bitmap,cliprect,machine->gfx[bank],
826824                  sprite,
827825                  colour,
828826                  fx,fy,
829827                  xpos>>16,ypos>>16,
830                  cliprect,15,zoomx,zoomy,NULL,0,
828                  15,zoomx,zoomy,NULL,0,
831829                  ((xpos+(zoomx<<4))>>16) - (xpos>>16), ((ypos+(zoomy<<4))>>16) - (ypos>>16), alpha );
832830            else
833831               drawgfx_alpha(bitmap,cliprect,machine->gfx[bank],
r5077r5078
14431441    blending support - it can't be done in-place on the final framebuffer
14441442    without a lot of support bitmaps.
14451443*/
1446static void mixDualAlphaSprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap)
1444static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap)
14471445{
1448   const pen_t *pal0 = &machine->pens[gfx0->color_base];
1449   const pen_t *pal1 = &machine->pens[gfx1->color_base];
1450   const pen_t *pal2 = &machine->pens[(deco32_pri&1) ? machine->gfx[1]->color_base : machine->gfx[2]->color_base];
1446   const pen_t *pens = gfx0->machine->pens;
1447   const pen_t *pal0 = &pens[gfx0->color_base];
1448   const pen_t *pal1 = &pens[gfx1->color_base];
1449   const pen_t *pal2 = &pens[gfx0->machine->gfx[(deco32_pri&1) ? 1 : 2]->color_base];
14511450   int x,y;
14521451
14531452   /* Mix sprites into main bitmap, based on priority & alpha */
r5077r5078
16531652      }
16541653   }
16551654
1656   mixDualAlphaSprites(screen->machine, bitmap, cliprect, screen->machine->gfx[3], screen->machine->gfx[4], alphaTilemap);
1655   mixDualAlphaSprites(bitmap, cliprect, screen->machine->gfx[3], screen->machine->gfx[4], alphaTilemap);
16571656
16581657   tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0);
16591658   return 0;
src/mame/video/malzak.c
r5077r5078
178178         {
179179            if (saa5050_state.saa5050_flags & SAA5050_DBLHI)
180180            {
181               drawgfx (bitmap, screen->machine->gfx[2], code, colour, 0, 0,
182                  sx * 6, sy * 10, cliprect, TRANSPARENCY_NONE, 0);
183               drawgfx (bitmap, screen->machine->gfx[3], code, colour, 0, 0,
184                  sx * 6, (sy + 1) * 10, cliprect, TRANSPARENCY_NONE, 0);
181               drawgfx_opaque (bitmap, cliprect, screen->machine->gfx[2], code, colour, 0, 0,
182                  sx * 6, sy * 10);
183               drawgfx_opaque (bitmap, cliprect, screen->machine->gfx[3], code, colour, 0, 0,
184                  sx * 6, (sy + 1) * 10);
185185            }
186186            else
187187            {
188               drawgfx (bitmap, screen->machine->gfx[1], code, colour, 0, 0,
189                  sx * 6, sy * 10, cliprect, TRANSPARENCY_NONE, 0);
188               drawgfx_opaque (bitmap, cliprect, screen->machine->gfx[1], code, colour, 0, 0,
189                  sx * 6, sy * 10);
190190            }
191191         }
192192      }
r5077r5078
213213         if(sx < -15)
214214            sx+=256;
215215
216         drawgfx(bitmap,screen->machine->gfx[0],field[x*16 + y].code,7,0,0,
217            sx, sy, cliprect, TRANSPARENCY_PEN, 0);
216         drawgfx_transpen(bitmap,cliprect, screen->machine->gfx[0],field[x*16 + y].code,7,0,0,
217            sx, sy, 0);
218218      }
219219
220220    /* update the S2636 chips */
src/mame/video/grchamp.c
r5077r5078
131131   if( which==0 )
132132   {
133133      /* draw the current player sprite into a work bitmap */
134      drawgfx( state->work_bitmap,
134      drawgfx_opaque( state->work_bitmap,
135         0,
135136         machine->gfx[4],
136137         state->cpu0_out[4]&0xf,
137138         1, /* color */
138139         0,0,
139         0,0,
140         0,
141         TRANSPARENCY_NONE, 0 );
140         0,0 );
142141   }
143142
144143   for( y = 0; y <32; y++ )
r5077r5078
199198      int sy = 240-source[0];
200199      int color = source[2];
201200      int code = source[1];
202      drawgfx(bitmap, gfx,
201      drawgfx_transpen(bitmap, cliprect,
202         gfx,
203203         bank + (code & 0x3f),
204204         color,
205205         code & 0x40,
206206         code & 0x80,
207         sx,sy,
208         cliprect,
209         TRANSPARENCY_PEN, 0);
207         sx,sy, 0);
210208      source += 4;
211209   }
212210}
src/mame/video/argus.c
r5077r5078
900900         }
901901
902902         if (priority != pri)
903            jal_blend_drawgfx(machine,
904                     bitmap,machine->gfx[0],
903            jal_blend_drawgfx(
904                     bitmap,cliprect,machine->gfx[0],
905905                     tile,
906906                     color,
907907                     flipx, flipy,
908908                     sx, sy,
909                     cliprect,
910909                     TRANSPARENCY_PEN, 15);
911910      }
912911   }
r5077r5078
10331032            flipy = !flipy;
10341033         }
10351034
1036         jal_blend_drawgfx(machine,
1037                  bitmap,machine->gfx[0],
1035         jal_blend_drawgfx(
1036                  bitmap,cliprect,machine->gfx[0],
10381037                  tile,
10391038                  color,
10401039                  flipx, flipy,
10411040                  sx, sy,
1042                  cliprect,
10431041                  TRANSPARENCY_PEN, 15);
10441042      }
10451043   }
r5077r5078
10841082
10851083         if ((offs >= 0x100 && offs <= 0x2ff) || (offs >= 0x400 && offs <= 0x57f))
10861084         {
1087            jal_blend_drawgfx(machine,
1088                     bitmap,machine->gfx[0],
1085            jal_blend_drawgfx(
1086                     bitmap,cliprect,machine->gfx[0],
10891087                     tile,
10901088                     color,
10911089                     flipx, flipy,
10921090                     sx, sy,
1093                     cliprect,
10941091                     TRANSPARENCY_PEN, 7);
10951092         }
10961093         else if ((offs >= 0x000 && offs <= 0x0ff) || (offs >= 0x300 && offs <= 0x3ff))
r5077r5078
10991096            {
11001097               td = (fx) ? (1 - i) : i;
11011098
1102               jal_blend_drawgfx(machine,
1103                        bitmap,machine->gfx[0],
1099               jal_blend_drawgfx(
1100                        bitmap,cliprect,machine->gfx[0],
11041101                        tile + td,
11051102                        color,
11061103                        flipx, flipy,
11071104                        sx + i * 16, sy,
1108                        cliprect,
11091105                        TRANSPARENCY_PEN, 7);
11101106            }
11111107         }
r5077r5078
11201116                  else
11211117                     td = (fx) ? (i * 2) + 1 - j : i * 2 + j;
11221118
1123                  jal_blend_drawgfx(machine,
1124                           bitmap,machine->gfx[0],
1119                  jal_blend_drawgfx(
1120                           bitmap,cliprect,machine->gfx[0],
11251121                           tile + td,
11261122                           color,
11271123                           flipx, flipy,
11281124                           sx + j * 16, sy - i * 16,
1129                           cliprect,
11301125                           TRANSPARENCY_PEN, 7);
11311126               }
11321127            }
r5077r5078
11421137                  else
11431138                     td = (fx) ? (i * 4) + 3 - j : i * 4 + j;
11441139
1145                  jal_blend_drawgfx(machine,
1146                           bitmap,machine->gfx[0],
1140                  jal_blend_drawgfx(
1141                           bitmap,cliprect,machine->gfx[0],
11471142                           tile + td,
11481143                           color,
11491144                           flipx, flipy,
11501145                           sx + j * 16, sy - i * 16,
1151                           cliprect,
11521146                           TRANSPARENCY_PEN, 7);
11531147               }
11541148            }
src/mame/video/lkage.c
r5077r5078
145145
146146      for (y = 0;y < height;y++)
147147      {
148         pdrawgfx(
148         pdrawgfx_transpen(
149149            bitmap,
150            cliprect,
150151            machine->gfx[1],
151152            sprite_number ^ y,
152153            color,
153154            flipx,flipy,
154155            sx&0xff,
155156            sy + 16*y,
156            cliprect,
157            TRANSPARENCY_PEN,0,
158            priority_mask );
157            priority_bitmap,
158            priority_mask,0 );
159159      }
160160      source+=4;
161161   }
src/mame/video/zaxxon.c
r5077r5078
437437      int sx = find_minimum_x(spriteram[offs + 3], flip);
438438
439439      /* draw with 256 pixel offsets to ensure we wrap properly */
440      drawgfx(bitmap, machine->gfx[2], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
441      drawgfx(bitmap, machine->gfx[2], code, color, flipx, flipy, sx, sy - 0x100, cliprect, TRANSPARENCY_PEN, 0);
442      drawgfx(bitmap, machine->gfx[2], code, color, flipx, flipy, sx - 0x100, sy, cliprect, TRANSPARENCY_PEN, 0);
443      drawgfx(bitmap, machine->gfx[2], code, color, flipx, flipy, sx - 0x100, sy - 0x100, cliprect, TRANSPARENCY_PEN, 0);
440      drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx, sy, 0);
441      drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx, sy - 0x100, 0);
442      drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx - 0x100, sy, 0);
443      drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx - 0x100, sy - 0x100, 0);
444444   }
445445}
446446
src/mame/video/shangkid.c
r5077r5078
138138      {
139139         sx = xpos+(c^xflip)*width;
140140         sy = ypos+(r^yflip)*height;
141         drawgfxzoom(
141         drawgfxzoom_transpen(
142142            bitmap,
143            cliprect,
143144            gfx,
144145            tile+c*8+r,
145146            color,
146147            xflip,yflip,
147148            sx,sy,
148            cliprect,
149            TRANSPARENCY_PEN,transparent_pen,
150            (width<<16)/16, (height<<16)/16 );
149            (width<<16)/16, (height<<16)/16,transparent_pen );
151150      }
152151   }
153152}
r5077r5078
286285      sx = videoram[0x1381+i]-64+8+16;
287286      if( attr&1 ) sx += 0x100;
288287
289      drawgfx(
288      drawgfx_transpen(
290289            bitmap,
290            cliprect,
291291            machine->gfx[1],
292292            bank*0x40 + (tile&0x3f),
293293            color,
294294            tile&0x80,tile&0x40, /* flipx,flipy */
295            sx,sy,
296            cliprect,
297            TRANSPARENCY_PEN,3 );
295            sx,sy,3 );
298296   }
299297}
300298
src/mame/video/trackfld.c
r5077r5078
213213      /* proving that this is a hardware related "feature" */
214214      sy += 1;
215215
216      drawgfx(bitmap, machine->gfx[0],
216      drawgfx_transmask(bitmap, cliprect,
217         machine->gfx[0],
217218         code + sprite_bank1 + sprite_bank2, color,
218219         flipx, flipy,
219220         sx, sy,
220         cliprect,
221         TRANSPARENCY_PENS,
222221         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
223222
224223      /* redraw with wraparound */
225      drawgfx(bitmap,machine->gfx[0],
224      drawgfx_transmask(bitmap,cliprect,
225         machine->gfx[0],
226226         code + sprite_bank1 + sprite_bank2, color,
227227         flipx, flipy,
228228         sx - 256, sy,
229         cliprect,
230         TRANSPARENCY_PENS,
231229         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
232230   }
233231}
src/mame/video/fastfred.c
r5077r5078
298298         flipy = !flipy;
299299      }
300300
301      drawgfx(bitmap,machine->gfx[1],
301      drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,machine->gfx[1],
302302            code,
303303            colorbank | (fastfred_spriteram[offs + 2] & 0x07),
304304            flipx,flipy,
305            sx,sy,
306            flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0);
305            sx,sy,0);
307306   }
308307}
309308
src/mame/video/karnov.c
r5077r5078
9090      color = tile >> 12;
9191      tile = tile&0x7ff;
9292      if (flipscreen)
93         drawgfx(bitmap_f,machine->gfx[1],tile,
94            color, fx, fy, 496-16*mx,496-16*my,
95             0,TRANSPARENCY_NONE,0);
93         drawgfx_opaque(bitmap_f,0,machine->gfx[1],tile,
94            color, fx, fy, 496-16*mx,496-16*my);
9695      else
97         drawgfx(bitmap_f,machine->gfx[1],tile,
98            color, fx, fy, 16*mx,16*my,
99             0,TRANSPARENCY_NONE,0);
96         drawgfx_opaque(bitmap_f,0,machine->gfx[1],tile,
97            color, fx, fy, 16*mx,16*my);
10098   }
10199
102100   if (!flipscreen) {
r5077r5078
152150      }
153151      else sprite2=sprite+1;
154152
155      drawgfx(bitmap,machine->gfx[2],
153      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
156154            sprite,
157            colour,fx,fy,x,y,
158            cliprect,TRANSPARENCY_PEN,0);
155            colour,fx,fy,x,y,0);
159156
160157       /* 1 more sprite drawn underneath */
161158       if (extra)
162          drawgfx(bitmap,machine->gfx[2],
159          drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
163160            sprite2,
164            colour,fx,fy,x,y+16,
165            cliprect,TRANSPARENCY_PEN,0);
161            colour,fx,fy,x,y+16,0);
166162   }
167163}
168164
src/mame/video/lwings.c
r5077r5078
211211            flipy = !flipy;
212212         }
213213
214         drawgfx(bitmap,machine->gfx[2],
214         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
215215               code,color,
216216               flipx,flipy,
217               sx,sy,
218               cliprect,TRANSPARENCY_PEN,15);
217               sx,sy,15);
219218      }
220219   }
221220}
r5077r5078
260259            flipy = !flipy;
261260         }
262261
263         drawgfx(bitmap,machine->gfx[2],
262         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
264263               code,color,
265264               flipx,flipy,
266               sx,sy,
267               cliprect,TRANSPARENCY_PEN,15);
265               sx,sy,15);
268266      }
269267   }
270268}
src/mame/video/tecmo.c
r5077r5078
225225            {
226226               int sx = xpos + 8*(flipx?(size-1-x):x);
227227               int sy = ypos + 8*(flipy?(size-1-y):y);
228               pdrawgfx(bitmap,machine->gfx[1],
228               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
229229                     code + layout[y][x],
230230                     flags & 0xf,
231231                     flipx,flipy,
232232                     sx,sy,
233                     cliprect,TRANSPARENCY_PEN,0,
234                     priority_mask);
233                     priority_bitmap,
234                     priority_mask,0);
235235            }
236236         }
237237      }
src/mame/video/galpanic.c
r5077r5078
7676      sx = (sx&0x1ff) - (sx&0x200);
7777      sy = (sy&0x1ff) - (sy&0x200);
7878
79      drawgfx(bitmap,machine->gfx[0],
79      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
8080            code,
8181            color,
8282            flipx,flipy,
83            sx,sy,
84            cliprect,TRANSPARENCY_PEN,0);
83            sx,sy,0);
8584   }
8685}
8786
src/mame/video/finalizr.c
r5077r5078
135135               flipy = !flipy;
136136            }
137137
138            drawgfx(bitmap,gfx1,
138            drawgfx_transpen(bitmap,cliprect,gfx1,
139139                  code,
140140                  color,
141141                  flipx,flipy,
142                  flipx?sx+16:sx,flipy?sy+16:sy,
143                  cliprect,TRANSPARENCY_PEN,0);
144            drawgfx(bitmap,gfx1,
142                  flipx?sx+16:sx,flipy?sy+16:sy,0);
143            drawgfx_transpen(bitmap,cliprect,gfx1,
145144                  code + 1,
146145                  color,
147146                  flipx,flipy,
148                  flipx?sx:sx+16,flipy?sy+16:sy,
149                  cliprect,TRANSPARENCY_PEN,0);
150            drawgfx(bitmap,gfx1,
147                  flipx?sx:sx+16,flipy?sy+16:sy,0);
148            drawgfx_transpen(bitmap,cliprect,gfx1,
151149                  code + 2,
152150                  color,
153151                  flipx,flipy,
154                  flipx?sx+16:sx,flipy?sy:sy+16,
155                  cliprect,TRANSPARENCY_PEN,0);
156            drawgfx(bitmap,gfx1,
152                  flipx?sx+16:sx,flipy?sy:sy+16,0);
153            drawgfx_transpen(bitmap,cliprect,gfx1,
157154                  code + 3,
158155                  color,
159156                  flipx,flipy,
160                  flipx?sx:sx+16,flipy?sy:sy+16,
161                  cliprect,TRANSPARENCY_PEN,0);
157                  flipx?sx:sx+16,flipy?sy:sy+16,0);
162158         }
163159         else
164160         {
r5077r5078
172168
173169            if (size == 0x00)   /* 16x16 */
174170            {
175               drawgfx(bitmap,gfx1,
171               drawgfx_transpen(bitmap,cliprect,gfx1,
176172                     code,
177173                     color,
178174                     flipx,flipy,
179                     sx,sy,
180                     cliprect,TRANSPARENCY_PEN,0);
175                     sx,sy,0);
181176            }
182177            else
183178            {
r5077r5078
185180
186181               if (size == 0x04)   /* 16x8 */
187182               {
188                  drawgfx(bitmap,gfx2,
183                  drawgfx_transpen(bitmap,cliprect,gfx2,
189184                        code & ~1,
190185                        color,
191186                        flipx,flipy,
192                        flipx?sx+8:sx,sy,
193                        cliprect,TRANSPARENCY_PEN,0);
194                  drawgfx(bitmap,gfx2,
187                        flipx?sx+8:sx,sy,0);
188                  drawgfx_transpen(bitmap,cliprect,gfx2,
195189                        code | 1,
196190                        color,
197191                        flipx,flipy,
198                        flipx?sx:sx+8,sy,
199                        cliprect,TRANSPARENCY_PEN,0);
192                        flipx?sx:sx+8,sy,0);
200193               }
201194               else if (size == 0x08)   /* 8x16 */
202195               {
203                  drawgfx(bitmap,gfx2,
196                  drawgfx_transpen(bitmap,cliprect,gfx2,
204197                        code & ~2,
205198                        color,
206199                        flipx,flipy,
207                        sx,flipy?sy+8:sy,
208                        cliprect,TRANSPARENCY_PEN,0);
209                  drawgfx(bitmap,gfx2,
200                        sx,flipy?sy+8:sy,0);
201                  drawgfx_transpen(bitmap,cliprect,gfx2,
210202                        code | 2,
211203                        color,
212204                        flipx,flipy,
213                        sx,flipy?sy:sy+8,
214                        cliprect,TRANSPARENCY_PEN,0);
205                        sx,flipy?sy:sy+8,0);
215206               }
216207               else if (size == 0x0c)   /* 8x8 */
217208               {
218                  drawgfx(bitmap,gfx2,
209                  drawgfx_transpen(bitmap,cliprect,gfx2,
219210                        code,
220211                        color,
221212                        flipx,flipy,
222                        sx,sy,
223                        cliprect,TRANSPARENCY_PEN,0);
213                        sx,sy,0);
224214               }
225215            }
226216         }
src/mame/video/xorworld.c
r5077r5078
102102      int code = (spriteram16[i+1] & 0x0ffc) >> 2;
103103      int color = (spriteram16[i+1] & 0xf000) >> 12;
104104
105      drawgfx(bitmap, machine->gfx[1], code, color, 0, 0, sx, sy,
106         cliprect, TRANSPARENCY_PEN, 0);
105      drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 0, sx, sy, 0);
107106   }
108107}
109108
src/mame/video/cclimber.c
r5077r5078
550550}
551551
552552
553static void cclimber_draw_sprites(bitmap_t *bitmap, gfx_element **gfx, const rectangle *cliprect)
553static void cclimber_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
554554{
555555   int offs;
556556
r5077r5078
582582         flipy = !flipy;
583583      }
584584
585      drawgfx(bitmap, gfx[1], code, color, flipx, flipy, x, y, cliprect, TRANSPARENCY_PEN, 0);
585      drawgfx_transpen(bitmap, cliprect, gfx, code, color, flipx, flipy, x, y, 0);
586586   }
587587}
588588
589589
590static void swimmer_draw_sprites(bitmap_t *bitmap, gfx_element **gfx, const rectangle *cliprect)
590static void swimmer_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
591591{
592592   int offs;
593593
r5077r5078
619619         flipy = !flipy;
620620      }
621621
622      drawgfx(bitmap, gfx[1], code, color, flipx, flipy, x, y, cliprect, TRANSPARENCY_PEN, 0);
622      drawgfx_transpen(bitmap, cliprect, gfx, code, color, flipx, flipy, x, y, 0);
623623   }
624624}
625625
r5077r5078
633633   if ((cclimber_bigsprite_control[0] & 0x01))
634634   {
635635      cclimber_draw_bigsprite(bitmap, cliprect);
636      cclimber_draw_sprites(bitmap, screen->machine->gfx, cliprect);
636      cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
637637   }
638638
639639   /* draw the "big sprite" over the regular sprites */
640640   else
641641   {
642      cclimber_draw_sprites(bitmap, screen->machine->gfx, cliprect);
642      cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
643643      cclimber_draw_bigsprite(bitmap, cliprect);
644644   }
645645
r5077r5078
667667   if ((cclimber_bigsprite_control[0] & 0x01))
668668   {
669669      cclimber_draw_bigsprite(bitmap, cliprect);
670      cclimber_draw_sprites(bitmap, screen->machine->gfx, cliprect);
670      cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
671671   }
672672
673673   /* draw the "big sprite" over the regular sprites */
674674   else
675675   {
676      cclimber_draw_sprites(bitmap, screen->machine->gfx, cliprect);
676      cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
677677      cclimber_draw_bigsprite(bitmap, cliprect);
678678   }
679679
r5077r5078
719719   if ((cclimber_bigsprite_control[0] & 0x01))
720720   {
721721      cclimber_draw_bigsprite(bitmap, cliprect);
722      swimmer_draw_sprites(bitmap, screen->machine->gfx, cliprect);
722      swimmer_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
723723   }
724724
725725   /* draw the "big sprite" over the regular sprites */
726726   else
727727   {
728      swimmer_draw_sprites(bitmap, screen->machine->gfx, cliprect);
728      swimmer_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
729729      cclimber_draw_bigsprite(bitmap, cliprect);
730730   }
731731
r5077r5078
750750   /* draw the "big sprite" over the regular sprites */
751751   if ((cclimber_bigsprite_control[1] & 0x20))
752752   {
753      cclimber_draw_sprites(bitmap, screen->machine->gfx, &scroll_area_clip);
753      cclimber_draw_sprites(bitmap, &scroll_area_clip, screen->machine->gfx[1]);
754754      toprollr_draw_bigsprite(bitmap, &scroll_area_clip);
755755   }
756756
r5077r5078
758758   else
759759   {
760760      toprollr_draw_bigsprite(bitmap, &scroll_area_clip);
761      cclimber_draw_sprites(bitmap, screen->machine->gfx, &scroll_area_clip);
761      cclimber_draw_sprites(bitmap, &scroll_area_clip, screen->machine->gfx[1]);
762762   }
763763
764764   tilemap_mark_all_tiles_dirty(pf_tilemap);
src/mame/video/speedspn.c
r5077r5078
7878      tileno += ((attr & 0xe0) >> 5) * 0x100;
7979      color = attr & 0x0f;
8080
81      drawgfx(bitmap,gfx,
81      drawgfx_transpen(bitmap,cliprect,gfx,
8282            tileno,
8383            color,
8484            0,0,
85            xpos,ypos,
86            cliprect,TRANSPARENCY_PEN,15);
85            xpos,ypos,15);
8786
8887      source +=4;
8988   }
src/mame/video/amigaaga.c
r5077r5078
11/***************************************************************************
22
3    Amiga hardware
3    Amiga AGA hardware
44
55    Driver by: Ernesto Corvi, Mariusz Wojcieszek, Aaron Giles
66
r5077r5078
99    - bitplane data fetching
1010    - support for up to 8 standard bitplanes
1111    - HAM8 mode
12    - preliminary sprites
1213
1314To do:
14    - sprites (current implementation is incomplete - see CD32 logo)
1515    - incorrect hstart/hstop values in CD32 logo, lsrquiz & lsrquiz2
16    - sprite collisions
1617
1718***************************************************************************/
1819
r5077r5078
5960static UINT8 sprite_comparitor_enable_mask;
6061static UINT8 sprite_dma_reload_mask;
6162static UINT8 sprite_dma_live_mask;
63static UINT8 sprite_ctl_written;
6264static UINT32 sprite_shiftreg[8];
6365static UINT8 sprite_remain[8];
6466static UINT16 aga_sprdata[8][4];
r5077r5078
208210
209211   /* reset the genlock color */
210212   genlock_color = 0xffff;
213
214   sprite_ctl_written = 0;
211215}
212216
213217
r5077r5078
398402
399403void amiga_aga_sprite_dma_reset(int which)
400404{
405   if (LOG_SPRITE_DMA) logerror("sprite %d dma reset\n", which );
401406   sprite_dma_reload_mask |= 1 << which;
402407   sprite_dma_live_mask |= 1 << which;
403408}
r5077r5078
405410
406411void amiga_aga_sprite_enable_comparitor(int which, int enable)
407412{
413   if (LOG_SPRITE_DMA) logerror("sprite %d comparitor %sable\n", which, enable ? "en" : "dis" );
408414   if (enable)
409415   {
410416      sprite_comparitor_enable_mask |= 1 << which;
411417      sprite_dma_live_mask &= ~(1 << which);
412418   }
413419   else
420   {
414421      sprite_comparitor_enable_mask &= ~(1 << which);
422      sprite_ctl_written |= (1 << which);
423   }
415424}
416425
417426
r5077r5078
422431 *
423432 *************************************/
424433
425INLINE void fetch_sprite_data(int sprite)
434INLINE void fetch_sprite_data(int scanline, int sprite)
426435{
427436   switch((CUSTOM_REG(REG_FMODE) >> 2) & 0x03)
428437   {
r5077r5078
431440         aga_sprdatb[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
432441         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4;
433442         aga_sprite_fetched_words = 1;
443         if (LOG_SPRITE_DMA) logerror("%3d:sprite %d fetch: data=%04X-%04X\n", scanline, sprite, aga_sprdata[sprite][0], aga_sprdatb[sprite][0]);
434444         break;
435445      case 1:
436446      case 2:
437447         aga_sprdata[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
438         aga_sprdatb[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
448         aga_sprdata[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
439449         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4;
440         aga_sprdata[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
450         aga_sprdatb[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
441451         aga_sprdatb[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
442452         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4;
443453         aga_sprite_fetched_words = 2;
454         if (LOG_SPRITE_DMA) logerror("%3d:sprite %d fetch: data=%04X-%04X %04X-%04X\n", scanline, sprite, aga_sprdata[sprite][0], aga_sprdatb[sprite][0], aga_sprdata[sprite][1], aga_sprdatb[sprite][1] );
444455         break;
445456      case 3:
446457         aga_sprdata[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
447         aga_sprdatb[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
458         aga_sprdata[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
448459         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4;
449         aga_sprdata[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
460         aga_sprdata[sprite][2] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
461         aga_sprdata[sprite][3] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
462         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4;
463         aga_sprdatb[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
450464         aga_sprdatb[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
451465         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4;
452         aga_sprdata[sprite][2] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
453         aga_sprdatb[sprite][2] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
454         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4;
455         aga_sprdata[sprite][3] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
466         aga_sprdatb[sprite][2] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0);
456467         aga_sprdatb[sprite][3] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2);
457468         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4;
458469         aga_sprite_fetched_words = 4;
470         if (LOG_SPRITE_DMA) logerror("%3d:sprite %d fetch: data=%04X-%04X %04X-%04X %04X-%04X %04X-%04X\n",
471                              scanline, sprite,
472                              aga_sprdata[sprite][0], aga_sprdatb[sprite][0],
473                              aga_sprdata[sprite][1], aga_sprdatb[sprite][1],
474                              aga_sprdata[sprite][2], aga_sprdatb[sprite][2],
475                              aga_sprdata[sprite][3], aga_sprdatb[sprite][3]);
459476         break;
460477   }
461478   aga_sprite_dma_used_words[sprite] = 0;
r5077r5078
478495      int vstart, vstop;
479496
480497      /* if we are == VSTOP, fetch new control words */
481      if (dmaenable && (sprite_dma_live_mask & bitmask) && (sprite_dma_reload_mask & bitmask))
498      if (dmaenable && (sprite_dma_live_mask & bitmask) && (sprite_dma_reload_mask & bitmask) && !(sprite_ctl_written & bitmask))
482499      {
483500         /* disable the sprite */
484501         sprite_comparitor_enable_mask &= ~bitmask;
r5077r5078
488505         CUSTOM_REG(REG_SPR0POS + 4 * num) = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) + 0);
489506         CUSTOM_REG(REG_SPR0CTL + 4 * num) = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) + 2);
490507         CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) += 4;
508         /* fetch additional words */
509         switch((CUSTOM_REG(REG_FMODE) >> 2) & 0x03)
510         {
511            case 0:
512               break;
513            case 1:
514            case 2:
515               CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) += 4;
516               break;
517            case 3:
518               CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) += 3*4;
519               break;
520         }
491521         if (LOG_SPRITE_DMA) logerror("%3d:sprite %d fetch: pos=%04X ctl=%04X\n", scanline, num, CUSTOM_REG(REG_SPR0POS + 4 * num), CUSTOM_REG(REG_SPR0CTL + 4 * num));
492522      }
493523
r5077r5078
505535      /* if we hit vstop, disable the comparitor and trigger a reload for the next scanline */
506536      if (scanline == vstop)
507537      {
538         sprite_ctl_written &= ~bitmask;
508539         sprite_comparitor_enable_mask &= ~bitmask;
509540         sprite_dma_reload_mask |= 1 << num;
510541         CUSTOM_REG(REG_SPR0DATA + 4 * num) = 0;      /* just a guess */
r5077r5078
518549         //CUSTOM_REG(REG_SPR0DATA + 4 * num) = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) + 0);
519550         //CUSTOM_REG(REG_SPR0DATB + 4 * num) = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) + 2);
520551         //CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) += 4;
521         fetch_sprite_data(num);
522         if (LOG_SPRITE_DMA) logerror("%3d:sprite %d fetch: data=%04X-%04X\n", scanline, num, CUSTOM_REG(REG_SPR0DATA + 4 * num), CUSTOM_REG(REG_SPR0DATB + 4 * num));
552         fetch_sprite_data(scanline, num);
523553      }
524554   }
525555}
r5077r5078
573603               if (aga_sprite_dma_used_words[num] < aga_sprite_fetched_words)
574604               {
575605                  sprite_remain[num] = 16;
576                  sprite_shiftreg[num] = interleave_sprite_data(aga_sprdata[aga_sprite_dma_used_words[num]][0], aga_sprdatb[aga_sprite_dma_used_words[num]][0]);
606                  sprite_shiftreg[num] = interleave_sprite_data(aga_sprdata[num][aga_sprite_dma_used_words[num]], aga_sprdatb[num][aga_sprite_dma_used_words[num]]);
577607                  aga_sprite_dma_used_words[num]++;
578608               }
579609            }
r5077r5078
594624         0x0000, 0x0800, 0x2000, 0x2a00, 0x4000, 0x4c00, 0x7000, 0x7e00
595625      };
596626      int collide;
627      int esprm, osprm;
597628
629      esprm = CUSTOM_REG(REG_BPLCON4) & 0x00f0;
630      osprm = (CUSTOM_REG(REG_BPLCON4) & 0x000f) << 4;
631
598632      /* OR the two sprite bits together so we only have 1 bit per sprite */
599633      collide = pixels | (pixels >> 1);
600634
r5077r5078
612646         if (pixels & 0x0f)
613647         {
614648            /* final result is:
615                    topmost sprite color in bits 0-5
616                    sprite present bitmask in bits 6-9
617                    topmost sprite pair index in bits 10-11
649                    topmost sprite color in bits 0-7
650                    sprite present bitmask in bits 8-9
651                    topmost sprite pair index in bits 12-11
618652                */
619653
620654            /* attached case */
621655            if (CUSTOM_REG(REG_SPR1CTL + 8 * pair) & 0x0080)
622               return (pixels & 0xf) | 0x10 | (collide << 6) | (pair << 10);
656               return (pixels & 0xf) | osprm | (collide << 8) | (pair << 12);
623657
624658            /* lower-numbered sprite of pair */
625659            else if (pixels & 3)
626               return (pixels & 3) | 0x10 | (pair << 2) | (collide << 6) | (pair << 10);
660               return (pixels & 3) | esprm | (pair << 2) | (collide << 8) | (pair << 12);
627661
628662            /* higher-numbered sprite of pair */
629663            else
630               return ((pixels >> 2) & 3) | 0x10 | (pair << 2) | (collide << 6) | (pair << 10);
664               return ((pixels >> 2) & 3) | osprm | (pair << 2) | (collide << 8) | (pair << 12);
631665         }
632666   }
633667
r5077r5078
10141048               if (sprpix && pf1pri > (sprpix >> 10))
10151049               {
10161050                  dst[x*2+0] =
1017                  dst[x*2+1] = aga_palette[sprpix & 0x1f];
1051                  dst[x*2+1] = aga_palette[sprpix & 0xff];
10181052               }
10191053
10201054               /* playfield has priority */
r5077r5078
10341068               pix = sprpix & 0x1f;
10351069               if (pix)
10361070               {
1037                  if ((pfpix0 & 0x15) && pf1pri <= (sprpix >> 10))
1071                  if ((pfpix0 & 0x15) && pf1pri <= (sprpix >> 12))
10381072                     pix = 0;
1039                  if ((pfpix0 & 0x2a) && pf2pri <= (sprpix >> 10))
1073                  if ((pfpix0 & 0x2a) && pf2pri <= (sprpix >> 12))
10401074                     pix = 0;
10411075               }
10421076
r5077r5078
10471081                  dst[x*2+0] = aga_palette[separate_bitplanes[(CUSTOM_REG(REG_BPLCON2) >> 6) & 1][pfpix0]];
10481082
10491083               /* mask out the sprite if it doesn't have priority */
1050               pix = sprpix & 0x1f;
1084               pix = sprpix & 0xff;
10511085               if (pix)
10521086               {
1053                  if ((pfpix1 & 0x15) && pf1pri <= (sprpix >> 10))
1087                  if ((pfpix1 & 0x15) && pf1pri <= (sprpix >> 12))
10541088                     pix = 0;
1055                  if ((pfpix1 & 0x2a) && pf2pri <= (sprpix >> 10))
1089                  if ((pfpix1 & 0x2a) && pf2pri <= (sprpix >> 12))
10561090                     pix = 0;
10571091               }
10581092
r5077r5078
10671101            else
10681102            {
10691103               /* sprite has priority */
1070               if (sprpix && pf1pri > (sprpix >> 10))
1104               if (sprpix && pf1pri > (sprpix >> 12))
10711105               {
10721106                  dst[x*2+0] =
1073                  dst[x*2+1] = aga_palette[(sprpix & 0x1f)];
1107                  dst[x*2+1] = aga_palette[(sprpix & 0xff)];
10741108               }
10751109
10761110               /* playfield has priority */
src/mame/video/cloak.c
r5077r5078
223223         flipy = !flipy;
224224      }
225225
226      drawgfx(bitmap, machine->gfx[1], code, 0, flipx, flipy,   sx, sy,   cliprect, TRANSPARENCY_PEN, 0);
226      drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, 0, flipx, flipy,   sx, sy, 0);
227227   }
228228}
229229
src/mame/video/foodf.c
r5077r5078
143143      int vflip = (data1 >> 14) & 1;
144144      int pri = (data1 >> 13) & 1;
145145
146      pdrawgfx(bitmap, screen->machine->gfx[1], pict, color, hflip, vflip,
147            xpos, ypos, cliprect, TRANSPARENCY_PEN, 0, pri * 2);
146      pdrawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], pict, color, hflip, vflip,
147            xpos, ypos, priority_bitmap, pri * 2, 0);
148148
149149      /* draw again with wraparound (needed to get the end of level animation right) */
150      pdrawgfx(bitmap, screen->machine->gfx[1], pict, color, hflip, vflip,
151            xpos - 256, ypos, cliprect, TRANSPARENCY_PEN, 0, pri * 2);
150      pdrawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], pict, color, hflip, vflip,
151            xpos - 256, ypos, priority_bitmap, pri * 2, 0);
152152   }
153153
154154   return 0;
src/mame/video/bsktball.c
r5077r5078
4848      pic = (pic & 0x3F);
4949        color = (color & 0x3F);
5050
51        drawgfx(bitmap,machine->gfx[1],
51        drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
5252            pic, color,
53         flipx,0,sx,sy,
54         cliprect,TRANSPARENCY_PEN,0);
53         flipx,0,sx,sy,0);
5554   }
5655}
5756
src/mame/video/armedf.c
r5077r5078
251251
252252      if (((buffered_spriteram16[offs+0] & 0x3000) >> 12) == priority)
253253      {
254         drawgfx(bitmap,machine->gfx[3],
254         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
255255            code & 0xfff,
256256            color,
257257             flipx,flipy,
258            sx,sy,
259            cliprect,TRANSPARENCY_PEN,15);
258            sx,sy,15);
260259      }
261260   }
262261}
src/mame/video/dkong.c
r5077r5078
649649
650650         if (state->flip)
651651         {
652            drawgfx(bitmap,machine->gfx[1],
652            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
653653                  (state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits),
654654                  (state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank,
655655                  !(state->sprite_ram[offs + 2] & 0x80),(state->sprite_ram[offs + 1] & 0x80),
656                  x-15, scanline-y,
657                  cliprect,TRANSPARENCY_PEN,0);
656                  x-15, scanline-y,0);
658657         }
659658         else
660659         {
661            drawgfx(bitmap,machine->gfx[1],
660            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
662661                  (state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits),
663662                  (state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank,
664663                  (state->sprite_ram[offs + 2] & 0x80),(state->sprite_ram[offs + 1] & 0x80),
665                  x, scanline-y,
666                  cliprect,TRANSPARENCY_PEN,0);
664                  x, scanline-y,0);
667665         }
668666
669667         num_sprt++;
r5077r5078
10161014   {
10171015      if (state->sprite_ram[offs])
10181016      {
1019         drawgfx(bitmap,screen->machine->gfx[1],
1017         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
10201018               state->sprite_ram[offs + 2],
10211019               (state->sprite_ram[offs + 1] & 0x0f) + 16 * state->palette_bank,
10221020               state->sprite_ram[offs + 1] & 0x80,state->sprite_ram[offs + 1] & 0x40,
1023               state->sprite_ram[offs + 3] - 8,240 - state->sprite_ram[offs] + 8,
1024               cliprect,TRANSPARENCY_PEN,0);
1021               state->sprite_ram[offs + 3] - 8,240 - state->sprite_ram[offs] + 8,0);
10251022      }
10261023   }
10271024   return 0;
src/mame/video/sprint4.c
r5077r5078
7777      if (i & 1)
7878         bank = 32;
7979
80      drawgfx(bitmap, screen->machine->gfx[1],
80      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
8181         (code >> 3) | bank,
8282         (attr & 0x80) ? 4 : i,
8383         0, 0,
8484         horz - 15,
85         vert - 15,
86         cliprect, TRANSPARENCY_PEN, 0);
85         vert - 15, 0);
8786   }
8887   return 0;
8988}
r5077r5078
122121      if (i & 1)
123122         bank = 32;
124123
125      drawgfx(helper, machine->gfx[1],
124      drawgfx_transpen(helper, &rect, machine->gfx[1],
126125         (code >> 3) | bank,
127126         4,
128127         0, 0,
129128         horz - 15,
130         vert - 15,
131         &rect, TRANSPARENCY_PEN, 1);
129         vert - 15, 1);
132130
133131      for (y = rect.min_y; y <= rect.max_y; y++)
134132         for (x = rect.min_x; x <= rect.max_x; x++)
src/mame/video/appoooh.c
r5077r5078
206206   /* bit 7 unknown (used) */
207207}
208208
209static void appoooh_draw_sprites(running_machine *machine,
209static void appoooh_draw_sprites(
210210      bitmap_t *dest_bmp,
211211      const rectangle *cliprect,
212212        const gfx_element *gfx,
213213        UINT8 *sprite)
214214{
215215   int offs;
216   int flipy = flip_screen_get(gfx->machine);
216217
217218   for (offs = 0x20 - 4;offs >= 0;offs -= 4)
218219   {
r5077r5078
224225
225226      if(sx>=248) sx -= 256;
226227
227      if (flip_screen_get(machine))
228      if (flipy)
228229      {
229230         sx = 239 - sx;
230231         sy = 239 - sy;
231232         flipx = !flipx;
232233      }
233      drawgfx( dest_bmp, gfx,
234      drawgfx_transpen( dest_bmp, cliprect,
235            gfx,
234236            code,
235237            color,
236            flipx,flip_screen_get(machine),
237            sx, sy,
238            cliprect,
239            TRANSPARENCY_PEN , 0);
238            flipx,flipy,
239            sx, sy, 0);
240240    }
241241}
242242
243static void robowres_draw_sprites(running_machine *machine,
243static void robowres_draw_sprites(
244244      bitmap_t *dest_bmp,
245245      const rectangle *cliprect,
246246        const gfx_element *gfx,
247247        UINT8 *sprite)
248248{
249249   int offs;
250   int flipy = flip_screen_get(gfx->machine);
250251
251252   for (offs = 0x20 - 4;offs >= 0;offs -= 4)
252253   {
r5077r5078
258259
259260      if(sx>=248) sx -= 256;
260261
261      if (flip_screen_get(machine))
262      if (flipy)
262263      {
263264         sx = 239 - sx;
264265         sy = 239 - sy;
265266         flipx = !flipx;
266267      }
267      drawgfx( dest_bmp, gfx,
268      drawgfx_transpen( dest_bmp, cliprect,
269            gfx,
268270            code,
269271            color,
270            flipx,flip_screen_get(machine),
271            sx, sy,
272            cliprect,
273            TRANSPARENCY_PEN , 0);
272            flipx,flipy,
273            sx, sy, 0);
274274    }
275275}
276276
r5077r5078
286286   if (priority == 1)
287287   {
288288      /* sprite set #1 */
289      appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram);
289      appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram);
290290      /* sprite set #2 */
291      appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
291      appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
292292   }
293293   else
294294   {
295295      /* sprite set #2 */
296      appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
296      appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
297297      /* sprite set #1 */
298      appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram);
298      appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram);
299299   }
300300
301301   if (priority != 0)   /* fg in front of sprites */
r5077r5078
314314   if (priority == 1)
315315   {
316316      /* sprite set #1 */
317      robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram);
317      robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram);
318318      /* sprite set #2 */
319      robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
319      robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
320320   }
321321   else
322322   {
323323      /* sprite set #2 */
324      robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
324      robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
325325      /* sprite set #1 */
326      robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram);
326      robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram);
327327   }
328328
329329   if (priority != 0)   /* fg in front of sprites */
src/mame/video/skyraid.c
r5077r5078
3535      y = 136 + 16 * (i ^ 1);
3636
3737      for (x = 0; x < bitmap->width; x += 16)
38         drawgfx(bitmap, machine->gfx[0], *p++, 0, 0, 0,    x, y, cliprect, TRANSPARENCY_PEN, 0);
38         drawgfx_transpen(bitmap, cliprect, machine->gfx[0], *p++, 0, 0, 0,    x, y, 0);
3939   }
4040}
4141
r5077r5078
8989      vert -= 31;
9090
9191      if (flag & 1)
92         drawgfx(bitmap, machine->gfx[1],
92         drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
9393            code ^ 15, code >> 3, 0, 0,
94            horz / 2, vert, cliprect, TRANSPARENCY_PEN, 2);
94            horz / 2, vert, 2);
9595   }
9696}
9797
r5077r5078
111111      vert -= 15;
112112      horz -= 31;
113113
114      drawgfx(bitmap, machine->gfx[2],
114      drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
115115         code ^ 15, 0, 0, 0,
116         horz / 2, vert, cliprect, TRANSPARENCY_PEN, 0);
116         horz / 2, vert, 0);
117117   }
118118}
119119
src/mame/video/travrusa.c
r5077r5078
327327         flipy = !flipy;
328328      }
329329
330      drawgfx(bitmap,machine->gfx[1],
330      drawgfx_transpen(bitmap,&clip,machine->gfx[1],
331331            code,
332332            attr & 0x0f,
333333            flipx,flipy,
334            sx,sy,
335            &clip,TRANSPARENCY_PEN,0);
334            sx,sy,0);
336335   }
337336}
338337
src/mame/video/metlclsh.c
r5077r5078
206206      {
207207         if (sizey)
208208         {
209            drawgfx(bitmap,gfx, code & ~1, color, flipx,flipy,
210                  sx, sy + (flipy ? 0 : -16) + wrapy, cliprect,TRANSPARENCY_PEN,0);
209            drawgfx_transpen(bitmap,cliprect,gfx, code & ~1, color, flipx,flipy,
210                  sx, sy + (flipy ? 0 : -16) + wrapy,0);
211211
212            drawgfx(bitmap,gfx, code |  1, color, flipx,flipy,
213                  sx,sy + (flipy ? -16 : 0) + wrapy, cliprect,TRANSPARENCY_PEN,0);
212            drawgfx_transpen(bitmap,cliprect,gfx, code |  1, color, flipx,flipy,
213                  sx,sy + (flipy ? -16 : 0) + wrapy,0);
214214         }
215215         else
216216         {
217            drawgfx(bitmap,gfx, code, color, flipx,flipy,
218                  sx,sy + wrapy, cliprect,TRANSPARENCY_PEN,0);
217            drawgfx_transpen(bitmap,cliprect,gfx, code, color, flipx,flipy,
218                  sx,sy + wrapy,0);
219219         }
220220      }
221221   }
src/mame/video/kaneko16.c
r5077r5078
432432}
433433
434434// custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities
435static void kaneko16_draw_sprites_custom(running_machine *machine, bitmap_t *dest_bmp,const gfx_element *gfx,
435static void kaneko16_draw_sprites_custom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
436436      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
437      const rectangle *clip,int priority)
437      int priority)
438438{
439439   pen_t pen_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
440440   const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
r5077r5078
635635
636636      UINT32 primask = kaneko16_priority.sprite[curr_pri];
637637
638      kaneko16_draw_sprites_custom(   machine,
639                              bitmap,machine->gfx[0],
638      kaneko16_draw_sprites_custom(
639                              bitmap,cliprect,machine->gfx[0],
640640                              s->code,
641641                              s->color,
642642                              s->flipx, s->flipy,
643643                              s->x, s->y,
644                              cliprect,
645644                              primask );
646645   }
647646}
src/mame/video/goldstar.c
r5077r5078
289289         int girlyscroll = (INT8)((cm_girl_scroll & 0xf0));
290290         int girlxscroll = (INT8)((cm_girl_scroll & 0x0f)<<4);
291291
292         drawgfxzoom(bitmap,gfx,cmaster_girl_num,cmaster_girl_pal,0,0,-(girlxscroll*2),-(girlyscroll),cliprect,TRANSPARENCY_PEN,0, 0x20000, 0x10000);
292         drawgfxzoom_transpen(bitmap,cliprect,gfx,cmaster_girl_num,cmaster_girl_pal,0,0,-(girlxscroll*2),-(girlyscroll), 0x20000, 0x10000,0);
293293      }
294294   }
295295
src/mame/video/ms32.c
r5077r5078
281281
282282   int tx, ty, sx, sy, flipx, flipy;
283283   int xsize, ysize, xzoom, yzoom;
284   int code, attr, color, size, pri, pri_mask, trans;
284   int code, attr, color, size, pri, pri_mask;
285285   gfx_element *gfx = machine->gfx[0];
286286
287287   UINT32      *source   = sprram_top;
r5077r5078
335335      yzoom = 0x1000000/yzoom;
336336      xzoom = 0x1000000/xzoom;
337337
338      trans = TRANSPARENCY_PEN; // there are surely also shadows (see gametngk) but how they're enabled we don't know
338      //trans = TRANSPARENCY_PEN; // there are surely also shadows (see gametngk) but how they're enabled we don't know
339339
340340      if (flipscreen)
341341      {
r5077r5078
363363         pri_mask = 0xfe;
364364
365365      gfx_element_set_source_clip(gfx, tx, xsize, ty, ysize);
366      pdrawgfxzoom(bitmap, gfx,
366      pdrawgfxzoom_transpen(bitmap, cliprect, gfx,
367367            code,
368368            color,
369369            flipx, flipy,
370370            sx,sy,
371            cliprect, trans, 0,
372            xzoom, yzoom, pri_mask);
371            xzoom, yzoom, priority_bitmap,pri_mask, 0);
373372   }   /* end sprite loop */
374373}
375374
src/mame/video/darkseal.c
r5077r5078
216216
217217      while (multi >= 0)
218218      {
219         drawgfx(bitmap,machine->gfx[3],
219         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
220220               sprite - multi * inc,
221221               colour,
222222               fx,fy,
223               x,y + mult * multi,
224               cliprect,TRANSPARENCY_PEN,0);
223               x,y + mult * multi,0);
225224
226225         multi--;
227226      }
src/mame/video/seicross.c
r5077r5078
100100   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
101101   {
102102      int x = spriteram[offs + 3];
103      drawgfx(bitmap,machine->gfx[1],
103      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
104104            (spriteram[offs] & 0x3f) + ((spriteram[offs + 1] & 0x10) << 2) + 128,
105105            spriteram[offs + 1] & 0x0f,
106106            spriteram[offs] & 0x40,spriteram[offs] & 0x80,
107            x,240-spriteram[offs + 2],
108            cliprect,TRANSPARENCY_PEN,0);
107            x,240-spriteram[offs + 2],0);
109108      if(x>0xf0)
110         drawgfx(bitmap,machine->gfx[1],
109         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
111110               (spriteram[offs] & 0x3f) + ((spriteram[offs + 1] & 0x10) << 2) + 128,
112111               spriteram[offs + 1] & 0x0f,
113112               spriteram[offs] & 0x40,spriteram[offs] & 0x80,
114               x-256,240-spriteram[offs + 2],
115               cliprect,TRANSPARENCY_PEN,0);
113               x-256,240-spriteram[offs + 2],0);
116114   }
117115
118116   for (offs = spriteram_2_size - 4;offs >= 0;offs -= 4)
119117   {
120118      int x = spriteram_2[offs + 3];
121      drawgfx(bitmap,machine->gfx[1],
119      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
122120            (spriteram_2[offs] & 0x3f) + ((spriteram_2[offs + 1] & 0x10) << 2),
123121            spriteram_2[offs + 1] & 0x0f,
124122            spriteram_2[offs] & 0x40,spriteram_2[offs] & 0x80,
125            x,240-spriteram_2[offs + 2],
126            cliprect,TRANSPARENCY_PEN,0);
123            x,240-spriteram_2[offs + 2],0);
127124      if(x>0xf0)
128         drawgfx(bitmap,machine->gfx[1],
125         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
129126               (spriteram_2[offs] & 0x3f) + ((spriteram_2[offs + 1] & 0x10) << 2),
130127               spriteram_2[offs + 1] & 0x0f,
131128               spriteram_2[offs] & 0x40,spriteram_2[offs] & 0x80,
132               x-256,240-spriteram_2[offs + 2],
133               cliprect,TRANSPARENCY_PEN,0);
129               x-256,240-spriteram_2[offs + 2],0);
134130   }
135131}
136132
src/mame/video/mcr3.c
r5077r5078
233233      if (!mcr_cocktail_flip)
234234      {
235235         /* first draw the sprite, visible */
236         pdrawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
237               cliprect, TRANSPARENCY_PENS, 0x0101, 0x00);
236         pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy,
237               priority_bitmap, 0x00, 0x0101);
238238
239239         /* then draw the mask, behind the background but obscuring following sprites */
240         pdrawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
241               cliprect, TRANSPARENCY_PENS, 0xfeff, 0x02);
240         pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy,
241               priority_bitmap, 0x02, 0xfeff);
242242      }
243243      else
244244      {
245245         /* first draw the sprite, visible */
246         pdrawgfx(bitmap, machine->gfx[1], code, color, !flipx, !flipy, 480 - sx, 452 - sy,
247               cliprect, TRANSPARENCY_PENS, 0x0101, 0x00);
246         pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, !flipx, !flipy, 480 - sx, 452 - sy,
247               priority_bitmap, 0x00, 0x0101);
248248
249249         /* then draw the mask, behind the background but obscuring following sprites */
250         pdrawgfx(bitmap, machine->gfx[1], code, color, !flipx, !flipy, 480 - sx, 452 - sy,
251               cliprect, TRANSPARENCY_PENS, 0xfeff, 0x02);
250         pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, !flipx, !flipy, 480 - sx, 452 - sy,
251               priority_bitmap, 0x02, 0xfeff);
252252      }
253253   }
254254}
src/mame/video/stadhero.c
r5077r5078
7272
7373      while (multi >= 0)
7474      {
75         drawgfx(bitmap,machine->gfx[2],
75         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
7676               sprite - multi * inc,
7777               colour,
7878               fx,fy,
79               x,y + mult * multi,
80               cliprect,TRANSPARENCY_PEN,0);
79               x,y + mult * multi,0);
8180         multi--;
8281      }
8382   }
src/mame/video/prehisle.c
r5077r5078
137137
138138      if ((foreground && priority) || (!foreground && !priority))
139139      {
140         drawgfx(bitmap, machine->gfx[3], code, color, flipx, flipy, sx, sy,
141            cliprect, TRANSPARENCY_PEN, 15);
140         drawgfx_transpen(bitmap, cliprect, machine->gfx[3], code, color, flipx, flipy, sx, sy, 15);
142141      }
143142   }
144143}
src/mame/video/wwfsstar.c
r5077r5078
168168            {
169169               if (!flipy)
170170               {
171                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+16*count,cliprect,TRANSPARENCY_PEN,0);
171                  drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+16*count,0);
172172               }
173173               else
174174               {
175                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),cliprect,TRANSPARENCY_PEN,0);
175                  drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),0);
176176               }
177177            }
178178            else
179179            {
180180               if (!flipy)
181181               {
182                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count),cliprect,TRANSPARENCY_PEN,0);
182                  drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count),0);
183183               }
184184               else
185185               {
186                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-16*count,cliprect,TRANSPARENCY_PEN,0);
186                  drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-16*count,0);
187187               }
188188            }
189189         }
src/mame/video/actfancr.c
r5077r5078
211211
212212      while (multi >= 0)
213213      {
214         drawgfx(bitmap,screen->machine->gfx[1],
214         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
215215               sprite - multi * inc,
216216               colour,
217217               fx,fy,
218               x,y + mult * multi,
219               cliprect,TRANSPARENCY_PEN,0);
218               x,y + mult * multi,0);
220219         multi--;
221220      }
222221   }
r5077r5078
296295
297296      while (multi >= 0)
298297      {
299         drawgfx(bitmap,screen->machine->gfx[1],
298         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
300299               sprite - multi * inc,
301300               colour,
302301               fx,fy,
303               x,y + mult * multi,
304               cliprect,TRANSPARENCY_PEN,0);
302               x,y + mult * multi,0);
305303         multi--;
306304      }
307305   }
src/mame/video/jackal.c
r5077r5078
118118   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
119119}
120120
121#define DRAW_SPRITE(bank, code, sx, sy) drawgfx(bitmap, machine->gfx[bank], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
121#define DRAW_SPRITE(bank, code, sx, sy) drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], code, color, flipx, flipy, sx, sy, 0);
122122
123123static void draw_sprites_region(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *sram, int length, int bank )
124124{
src/mame/video/tank8.c
r5077r5078
150150      int x = get_x_pos(i);
151151      int y = get_y_pos(i);
152152
153      drawgfx(bitmap, machine->gfx[(code & 0x04) ? 2 : 3],
153      drawgfx_transpen(bitmap, cliprect, machine->gfx[(code & 0x04) ? 2 : 3],
154154         code & 0x03,
155155         i,
156156         code & 0x10,
157157         code & 0x08,
158158         x,
159         y,
160         cliprect, TRANSPARENCY_PEN, 0);
159         y, 0);
161160   }
162161}
163162
src/mame/video/taitoic.c
r5077r5078
13201320      x += PC090OJ_xoffs;
13211321      y += PC090OJ_yoffs;
13221322
1323      pdrawgfx(bitmap,machine->gfx[PC090OJ_gfxnum],
1323      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[PC090OJ_gfxnum],
13241324            code,
13251325            color,
13261326            flipx,flipy,
13271327            x,y,
1328            cliprect,TRANSPARENCY_PEN,0,
1329            priority ? 0xfc : 0xf0);
1328            priority_bitmap,
1329            priority ? 0xfc : 0xf0,0);
13301330   }
13311331}
13321332
src/mame/video/namcos86.c
r5077r5078
310310      sy++;   /* sprites are buffered and delayed by one scanline */
311311
312312      gfx_element_set_source_clip(gfx, tx, sizex, ty, sizey);
313      pdrawgfx( bitmap, gfx,
313      pdrawgfx_transpen( bitmap, cliprect,gfx,
314314            sprite,
315315            color,
316316            flipx,flipy,
317317            sx & 0x1ff,
318318            ((sy + 16) & 0xff) - 16,
319            cliprect,TRANSPARENCY_PEN,0xf, pri_mask);
319            priority_bitmap, pri_mask,0xf);
320320
321321      source -= 0x10;
322322   }
src/mame/video/suna8.c
r5077r5078
322322            {   sx = max_x - sx;   tile_flipx = !tile_flipx;
323323               sy = max_y - sy;   tile_flipy = !tile_flipy;   }
324324
325            drawgfx(   bitmap,machine->gfx[0],
325            drawgfx_transpen(   bitmap,cliprect,machine->gfx[0],
326326                     tile + (attr & 0x3)*0x100 + gfxbank,
327327                     ((attr >> 2) & 0xf) | colorbank,   // hardhea2 player2
328328                     tile_flipx, tile_flipy,
329                     sx, sy,
330                     cliprect,TRANSPARENCY_PEN,15);
329                     sx, sy,15);
331330         }
332331      }
333332
r5077r5078
387386            {   sx = max_x - sx;   flipx = !flipx;
388387               sy = max_y - sy;   flipy = !flipy;   }
389388
390            drawgfx(   bitmap,machine->gfx[0],
389            drawgfx_transpen(   bitmap,cliprect,machine->gfx[0],
391390                     tile + (attr & 0x3)*0x100 + bank,
392391                     (attr >> 2) & 0xf,
393392                     flipx, flipy,
394                     sx, sy,
395                     cliprect,TRANSPARENCY_PEN,15);
393                     sx, sy,15);
396394         }
397395      }
398396
src/mame/video/vaportra.c
r5077r5078
133133
134134      while (multi >= 0)
135135      {
136         drawgfx(bitmap,machine->gfx[3],
136         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
137137               sprite - multi * inc,
138138               colour,
139139               fx,fy,
140               x,y + mult * multi,
141               cliprect,TRANSPARENCY_PEN,0);
140               x,y + mult * multi,0);
142141
143142         multi--;
144143      }
src/mame/video/btime.c
r5077r5078
371371
372372        y = y - sprite_y_adjust;
373373
374        drawgfx(bitmap,machine->gfx[1],
374        drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
375375                sprite_ram[offs + interleave],
376376                color,
377377                flipx,flipy,
378                x, y,
379                cliprect,TRANSPARENCY_PEN,0);
378                x, y,0);
380379
381380        y = y + (flip_screen_get(machine) ? -256 : 256);
382381
383382        // Wrap around
384        drawgfx(bitmap,machine->gfx[1],
383        drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
385384                sprite_ram[offs + interleave],
386385                color,
387386                flipx,flipy,
388                x,y,
389                cliprect,TRANSPARENCY_PEN,0);
387                x,y,0);
390388    }
391389}
392390
r5077r5078
418416                y = 256 - y;
419417            }
420418
421            drawgfx(bitmap, machine->gfx[2],
419            drawgfx_opaque(bitmap, cliprect,machine->gfx[2],
422420                    gfx[tileoffset + offs],
423421                    color,
424422                    flip_screen_get(machine),flip_screen_get(machine),
425                    x,y,
426                    cliprect,TRANSPARENCY_NONE,0);
423                    x,y);
427424        }
428425    }
429426}
r5077r5078
517514                sy = 256 - sy;
518515            }
519516
520            drawgfx(background_bitmap, screen->machine->gfx[2],
517            drawgfx_opaque(background_bitmap, 0, screen->machine->gfx[2],
521518                    (bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32,
522519                    0,
523520                    flip_screen_get(screen->machine), flip_screen_get(screen->machine),
524                    sx, sy,
525                    0, TRANSPARENCY_NONE, 0);
521                    sx, sy);
526522        }
527523
528524        /* copy the background bitmap to the screen */
r5077r5078
564560            sy = 33 - sy;
565561        }
566562
567        drawgfx(bitmap, screen->machine->gfx[2],
563        drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[2],
568564                bnj_backgroundram[offs],
569565                0,
570566                flip_screen_get(screen->machine), flip_screen_get(screen->machine),
571                8*sx,8*sy,
572                cliprect, TRANSPARENCY_NONE, 0);
567                8*sx,8*sy);
573568    }
574569
575570    draw_chars(screen->machine, bitmap, cliprect, TRANSPARENCY_PEN, 0, -1);
src/mame/video/nova2001.c
r5077r5078
285285         flipy = !flipy;
286286      }
287287
288      drawgfx(bitmap, gfx,
288      drawgfx_transpen(bitmap, cliprect, gfx,
289289            tile,
290290            color,
291291            flipx, flipy,
292            sx, sy,
293            cliprect, TRANSPARENCY_PEN, 0);
292            sx, sy, 0);
294293   }
295294}
296295
r5077r5078
322321         flipy = !flipy;
323322      }
324323
325      drawgfx(bitmap, gfx,
324      drawgfx_transpen(bitmap, cliprect, gfx,
326325            tile,
327326            color,
328327            flipx, flipy,
329            sx, sy,
330            cliprect, TRANSPARENCY_PEN, 0);
328            sx, sy, 0);
331329
332330      // there's no X MSB, so draw with wraparound (fixes title screen)
333      drawgfx(bitmap, gfx,
331      drawgfx_transpen(bitmap, cliprect, gfx,
334332            tile,
335333            color,
336334            flipx, flipy,
337            sx - 256, sy,
338            cliprect, TRANSPARENCY_PEN, 0);
335            sx - 256, sy, 0);
339336   }
340337}
341338
src/mame/video/cps1.c
r5077r5078
22102210#define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY)               \
22112211{                                                   \
22122212   if (flip_screen_get(machine))                                 \
2213      pdrawgfx(bitmap,machine->gfx[2],                     \
2213      pdrawgfx_transpen(bitmap,\
2214            cliprect,machine->gfx[2],                     \
22142215            CODE,                                    \
22152216            COLOR,                                    \
22162217            !(FLIPX),!(FLIPY),                           \
2217            511-16-(SX),255-16-(SY),                     \
2218            cliprect,TRANSPARENCY_PEN,15,0x02);               \
2218            511-16-(SX),255-16-(SY),                     priority_bitmap,0x02,15);               \
22192219   else                                             \
2220      pdrawgfx(bitmap,machine->gfx[2],                     \
2220      pdrawgfx_transpen(bitmap,\
2221            cliprect,machine->gfx[2],                     \
22212222            CODE,                                    \
22222223            COLOR,                                    \
22232224            FLIPX,FLIPY,                              \
2224            SX,SY,                                    \
2225            cliprect,TRANSPARENCY_PEN,15,0x02);               \
2225            SX,SY,                                    priority_bitmap,0x02,15);               \
22262226}
22272227
22282228
r5077r5078
24462446#define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY)                           \
24472447{                                                               \
24482448   if (flip_screen_get(machine))                                             \
2449      pdrawgfx(bitmap,machine->gfx[2],                                 \
2449      pdrawgfx_transpen(bitmap,\
2450            cliprect,machine->gfx[2],                                 \
24502451            CODE,                                                \
24512452            COLOR,                                                \
24522453            !(FLIPX),!(FLIPY),                                       \
2453            511-16-(SX),255-16-(SY),                                 \
2454            cliprect,TRANSPARENCY_PEN,15,primasks[priority]);               \
2454            511-16-(SX),255-16-(SY),                                 priority_bitmap,primasks[priority],15);               \
24552455   else                                                         \
2456      pdrawgfx(bitmap,machine->gfx[2],                                 \
2456      pdrawgfx_transpen(bitmap,\
2457            cliprect,machine->gfx[2],                                 \
24572458            CODE,                                                \
24582459            COLOR,                                                \
24592460            FLIPX,FLIPY,                                          \
2460            SX,SY,                                                \
2461            cliprect,TRANSPARENCY_PEN,15,primasks[priority]);               \
2461            SX,SY,                                                priority_bitmap,primasks[priority],15);               \
24622462}
24632463
24642464   int i;
src/mame/video/starcrus.c
r5077r5078
214214   org_y = s1_y;
215215
216216   /* Draw ship 1 */
217    drawgfx(ship1_vid,
217    drawgfx_opaque(ship1_vid,
218            &clip,
218219            machine->gfx[8+((s1_sprite&0x04)>>2)],
219220            (s1_sprite&0x03)^0x03,
220221            0,
221222            (s1_sprite&0x08)>>3,(s1_sprite&0x10)>>4,
222            s1_x-org_x,s1_y-org_y,
223            &clip,
224            TRANSPARENCY_NONE,
225            0);
223            s1_x-org_x,s1_y-org_y);
226224
227225   /* Draw ship 2 */
228    drawgfx(ship2_vid,
226    drawgfx_opaque(ship2_vid,
227            &clip,
229228            machine->gfx[10+((s2_sprite&0x04)>>2)],
230229            (s2_sprite&0x03)^0x03,
231230            0,
232231            (s2_sprite&0x08)>>3,(s2_sprite&0x10)>>4,
233            s2_x-org_x,s2_y-org_y,
234            &clip,
235            TRANSPARENCY_NONE,
236            0);
232            s2_x-org_x,s2_y-org_y);
237233
238234    /* Now check for collisions */
239235    for (sy=0;sy<16;sy++)
r5077r5078
274270   if (p1_sprite & 0x08)   /* if p1 is a projectile */
275271   {
276272      /* Draw score/projectile 1 */
277      drawgfx(proj1_vid,
273      drawgfx_opaque(proj1_vid,
274            &clip,
278275            machine->gfx[(p1_sprite&0x0c)>>2],
279276            (p1_sprite&0x03)^0x03,
280277            0,
281278            0,0,
282            p1_x-org_x,p1_y-org_y,
283            &clip,
284            TRANSPARENCY_NONE,
285            0);
279            p1_x-org_x,p1_y-org_y);
286280   }
287281
288282   if (p2_sprite & 0x08)   /* if p2 is a projectile */
289283   {
290284      /* Draw score/projectile 2 */
291      drawgfx(proj2_vid,
285      drawgfx_opaque(proj2_vid,
286            &clip,
292287            machine->gfx[4+((p2_sprite&0x0c)>>2)],
293288            (p2_sprite&0x03)^0x03,
294289            0,
295290            0,0,
296            p2_x-org_x,p2_y-org_y,
297            &clip,
298            TRANSPARENCY_NONE,
299            0);
291            p2_x-org_x,p2_y-org_y);
300292   }
301293
302294    /* Now check for collisions */
r5077r5078
337329   org_y = s1_y;
338330
339331   /* Draw ship 1 */
340    drawgfx(ship1_vid,
332    drawgfx_opaque(ship1_vid,
333            &clip,
341334            machine->gfx[8+((s1_sprite&0x04)>>2)],
342335            (s1_sprite&0x03)^0x03,
343336            0,
344337            (s1_sprite&0x08)>>3,(s1_sprite&0x10)>>4,
345            s1_x-org_x,s1_y-org_y,
346            &clip,
347            TRANSPARENCY_NONE,
348            0);
338            s1_x-org_x,s1_y-org_y);
349339
350340   if (p1_sprite & 0x08)   /* if p1 is a projectile */
351341   {
352342      /* Draw projectile 1 */
353      drawgfx(proj1_vid,
343      drawgfx_opaque(proj1_vid,
344            &clip,
354345            machine->gfx[(p1_sprite&0x0c)>>2],
355346            (p1_sprite&0x03)^0x03,
356347            0,
357348            0,0,
358            p1_x-org_x,p1_y-org_y,
359            &clip,
360            TRANSPARENCY_NONE,
361            0);
349            p1_x-org_x,p1_y-org_y);
362350   }
363351
364352   if (p2_sprite & 0x08)   /* if p2 is a projectile */
365353   {
366354      /* Draw projectile 2 */
367      drawgfx(proj2_vid,
355      drawgfx_opaque(proj2_vid,
356            &clip,
368357            machine->gfx[4+((p2_sprite&0x0c)>>2)],
369358            (p2_sprite&0x03)^0x03,
370359            0,
371360            0,0,
372            p2_x-org_x,p2_y-org_y,
373            &clip,
374            TRANSPARENCY_NONE,
375            0);
361            p2_x-org_x,p2_y-org_y);
376362   }
377363
378364    /* Now check for collisions */
r5077r5078
419405   org_y = s2_y;
420406
421407   /* Draw ship 2 */
422    drawgfx(ship2_vid,
408    drawgfx_opaque(ship2_vid,
409            &clip,
423410            machine->gfx[10+((s2_sprite&0x04)>>2)],
424411            (s2_sprite&0x03)^0x03,
425412            0,
426413            (s2_sprite&0x08)>>3,(s2_sprite&0x10)>>4,
427            s2_x-org_x,s2_y-org_y,
428            &clip,
429            TRANSPARENCY_NONE,
430            0);
414            s2_x-org_x,s2_y-org_y);
431415
432416   if (p1_sprite & 0x08)   /* if p1 is a projectile */
433417   {
434418      /* Draw projectile 1 */
435      drawgfx(proj1_vid,
419      drawgfx_opaque(proj1_vid,
420            &clip,
436421            machine->gfx[(p1_sprite&0x0c)>>2],
437422            (p1_sprite&0x03)^0x03,
438423            0,
439424            0,0,
440            p1_x-org_x,p1_y-org_y,
441            &clip,
442            TRANSPARENCY_NONE,
443            0);
425            p1_x-org_x,p1_y-org_y);
444426   }
445427
446428   if (p2_sprite & 0x08)   /* if p2 is a projectile */
447429   {
448430      /* Draw projectile 2 */
449      drawgfx(proj2_vid,
431      drawgfx_opaque(proj2_vid,
432            &clip,
450433            machine->gfx[4+((p2_sprite&0x0c)>>2)],
451434            (p2_sprite&0x03)^0x03,
452435            0,
453436            0,0,
454            p2_x-org_x,p2_y-org_y,
455            &clip,
456            TRANSPARENCY_NONE,
457            0);
437            p2_x-org_x,p2_y-org_y);
458438   }
459439
460440    /* Now check for collisions */
r5077r5078
478458    bitmap_fill(bitmap,cliprect,0);
479459
480460   /* Draw ship 1 */
481    drawgfx(bitmap,
461    drawgfx_transpen(bitmap,
462            cliprect,
482463            screen->machine->gfx[8+((s1_sprite&0x04)>>2)],
483464            (s1_sprite&0x03)^0x03,
484465            0,
485466            (s1_sprite&0x08)>>3,(s1_sprite&0x10)>>4,
486467            s1_x,s1_y,
487            cliprect,
488            TRANSPARENCY_PEN,
489468            0);
490469
491470   /* Draw ship 2 */
492    drawgfx(bitmap,
471    drawgfx_transpen(bitmap,
472            cliprect,
493473            screen->machine->gfx[10+((s2_sprite&0x04)>>2)],
494474            (s2_sprite&0x03)^0x03,
495475            0,
496476            (s2_sprite&0x08)>>3,(s2_sprite&0x10)>>4,
497477            s2_x,s2_y,
498            cliprect,
499            TRANSPARENCY_PEN,
500478            0);
501479
502480   /* Draw score/projectile 1 */
503   drawgfx(bitmap,
481   drawgfx_transpen(bitmap,
482            cliprect,
504483            screen->machine->gfx[(p1_sprite&0x0c)>>2],
505484            (p1_sprite&0x03)^0x03,
506485            0,
507486            0,0,
508487            p1_x,p1_y,
509            cliprect,
510            TRANSPARENCY_PEN,
511488            0);
512489
513490   /* Draw score/projectile 2 */
514   drawgfx(bitmap,
491   drawgfx_transpen(bitmap,
492            cliprect,
515493            screen->machine->gfx[4+((p2_sprite&0x0c)>>2)],
516494            (p2_sprite&0x03)^0x03,
517495            0,
518496            0,0,
519497            p2_x,p2_y,
520            cliprect,
521            TRANSPARENCY_PEN,
522498            0);
523499
524500    /* Collision detection */
src/mame/video/yunsun16.c
r5077r5078
182182         flipy = !flipy;      y = max_y - y - 16;
183183      }
184184
185      pdrawgfx(   bitmap,machine->gfx[1],
185      pdrawgfx_transpen(   bitmap,cliprect,machine->gfx[1],
186186               code,
187187               attr & 0x1f,
188188               flipx, flipy,
189189               x,y,
190               cliprect,TRANSPARENCY_PEN,15,
191               pri_mask   );
190               priority_bitmap,
191               pri_mask,15   );
192192   }
193193}
194194
src/mame/video/wiz.c
r5077r5078
147147      if (flipx) sx = 31 - sx;
148148
149149
150      drawgfx(bitmap,machine->gfx[bank],
150      drawgfx_transpen(bitmap,cliprect,machine->gfx[bank],
151151         videoram[offs],
152152         col + 8 * palette_bank,
153153         flipx,flipy,
154         8*sx,scroll,
155         cliprect,TRANSPARENCY_PEN,0);
154         8*sx,scroll,0);
156155   }
157156}
158157
r5077r5078
186185      if (flipx) sx = 31 - sx;
187186
188187
189      drawgfx(bitmap,machine->gfx[char_bank[1]],
188      drawgfx_transpen(bitmap,cliprect,machine->gfx[char_bank[1]],
190189         wiz_videoram2[offs],
191190         col + 8 * palette_bank,
192191         flipx,flipy,
193         8*sx,scroll,
194         cliprect,TRANSPARENCY_PEN,0);
192         8*sx,scroll,0);
195193   }
196194}
197195
r5077r5078
214212      if ( flipx) sx = 240 - sx;
215213      if (!flipy) sy = 240 - sy;
216214
217      drawgfx(bitmap,machine->gfx[bank],
215      drawgfx_transpen(bitmap,cliprect,machine->gfx[bank],
218216            sprite_ram[offs + 1],
219217            (sprite_ram[offs + 2] & 0x07) + 8 * palette_bank,
220218            flipx,flipy,
221            sx,sy,
222            cliprect,TRANSPARENCY_PEN,0);
219            sx,sy,0);
223220   }
224221}
225222
src/mame/video/mermaid.c
r5077r5078
199199         sy = 240 - sy;
200200      }
201201
202      drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
203         (flip_screen_x_get(machine) ? &flip_spritevisiblearea : &spritevisiblearea),
204         TRANSPARENCY_PEN, 0);
202      drawgfx_transpen(bitmap, (flip_screen_x_get(machine) ? &flip_spritevisiblearea : &spritevisiblearea),
203         machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
205204   }
206205}
207206
r5077r5078
299298
300299      tilemap_draw(helper, &rect, bg_tilemap, 0, 0);
301300
302      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
303         &rect,TRANSPARENCY_PEN, 0);
301      drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
304302
305303      coll_bit2 |= collision_check(machine->colortable, &rect);
306304
r5077r5078
311309
312310      tilemap_draw(helper, &rect, fg_tilemap, 0, 0);
313311
314      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
315         &rect,TRANSPARENCY_PEN, 0);
312      drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
316313
317314      coll_bit1 |= collision_check(machine->colortable, &rect);
318315
r5077r5078
350347               sy2 = 240 - sy2;
351348            }
352349
353            drawgfx(helper, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2,
354               &rect,TRANSPARENCY_PEN, 0);
350            drawgfx_transpen(helper, &rect,machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
355351         }
356352
357      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
358            &rect,TRANSPARENCY_PEN, 0);
353      drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
359354
360355      coll_bit0 |= collision_check(machine->colortable, &rect);
361356   }
r5077r5078
440435               sy2 = 240 - sy2;
441436            }
442437
443            drawgfx(helper, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2,
444               &rect,TRANSPARENCY_PEN, 0);
438            drawgfx_transpen(helper, &rect,machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
445439         }
446440
447      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
448            &rect,TRANSPARENCY_PEN, 0);
441      drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
449442
450443      coll_bit3 |= collision_check(machine->colortable, &rect);
451444   }
r5077r5078
530523               sy2 = 240 - sy2;
531524            }
532525
533            drawgfx(helper, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2,
534               &rect,TRANSPARENCY_PEN, 0);
526            drawgfx_transpen(helper, &rect,machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
535527         }
536528
537      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
538            &rect,TRANSPARENCY_PEN, 0);
529      drawgfx_transpen(helper2, &rect,machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
539530
540531      coll_bit6 |= collision_check(machine->colortable, &rect);
541532   }
src/mame/video/dcon.c
r5077r5078
187187         for (ay=0; ay<dy; ay++) {
188188            if (!fx && !fy)
189189            {
190               pdrawgfx(bitmap,machine->gfx[4],
190               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
191191                  sprite + inc,
192192                  color,fx,fy,x+ax*16,y+ay*16,
193                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
193                  priority_bitmap,pri_mask,15);
194194
195195               // wrap around y
196               pdrawgfx(bitmap,machine->gfx[4],
196               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
197197                  sprite + inc,
198198                  color,fx,fy,x+ax*16,y+ay*16 + 512,
199                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
199                  priority_bitmap,pri_mask,15);
200200
201201               // wrap around y
202               pdrawgfx(bitmap,machine->gfx[4],
202               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
203203                  sprite + inc,
204204                  color,fx,fy,x+ax*16,y+ay*16 - 512,
205                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
205                  priority_bitmap,pri_mask,15);
206206            }
207207            else if (fx && !fy)
208208            {
209               pdrawgfx(bitmap,machine->gfx[4],
209               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
210210                  sprite + inc,
211211                  color,fx,fy,x+(dx-1-ax)*16,y+ay*16,
212                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
212                  priority_bitmap,pri_mask,15);
213213
214214               // wrap around y
215               pdrawgfx(bitmap,machine->gfx[4],
215               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
216216                  sprite + inc,
217217                  color,fx,fy,x+(dx-1-ax)*16,y+ay*16 + 512,
218                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
218                  priority_bitmap,pri_mask,15);
219219
220220               // wrap around y
221               pdrawgfx(bitmap,machine->gfx[4],
221               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
222222                  sprite + inc,
223223                  color,fx,fy,x+(dx-1-ax)*16,y+ay*16 - 512,
224                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
224                  priority_bitmap,pri_mask,15);
225225            }
226226            else if (!fx && fy)
227227            {
228               pdrawgfx(bitmap,machine->gfx[4],
228               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
229229                  sprite + inc,
230230                  color,fx,fy,x+ax*16,y+(dy-1-ay)*16,
231                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
231                  priority_bitmap,pri_mask,15);
232232
233233               // wrap around y
234               pdrawgfx(bitmap,machine->gfx[4],
234               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
235235                  sprite + inc,
236236                  color,fx,fy,x+ax*16,y+(dy-1-ay)*16 + 512,
237                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
237                  priority_bitmap,pri_mask,15);
238238
239239               // wrap around y
240               pdrawgfx(bitmap,machine->gfx[4],
240               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
241241                  sprite + inc,
242242                  color,fx,fy,x+ax*16,y+(dy-1-ay)*16 - 512,
243                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
243                  priority_bitmap,pri_mask,15);
244244            }
245245            else
246246            {
247               pdrawgfx(bitmap,machine->gfx[4],
247               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
248248                  sprite + inc,
249249                  color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16,
250                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
250                  priority_bitmap,pri_mask,15);
251251
252252               // wrap around y
253               pdrawgfx(bitmap,machine->gfx[4],
253               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
254254                  sprite + inc,
255255                  color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16 + 512,
256                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
256                  priority_bitmap,pri_mask,15);
257257
258258               // wrap around y
259               pdrawgfx(bitmap,machine->gfx[4],
259               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
260260                  sprite + inc,
261261                  color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16 - 512,
262                  cliprect,TRANSPARENCY_PEN,15,pri_mask);
262                  priority_bitmap,pri_mask,15);
263263            }
264264
265265            inc++;
src/mame/video/kickgoal.c
r5077r5078
103103
104104      ypos = 0x200-ypos;
105105
106      drawgfx(bitmap,gfx,
106      drawgfx_transpen(bitmap,cliprect,gfx,
107107            tileno,
108108            0x30 + color,
109109            flipx,0,
110            xpos-16+4,ypos-32,
111            cliprect,TRANSPARENCY_PEN,15);
110            xpos-16+4,ypos-32,15);
112111   }
113112}
114113
r5077r5078
226225
227226      ypos = 0x110-ypos;
228227
229      drawgfx(bitmap,gfx,
228      drawgfx_transpen(bitmap,cliprect,gfx,
230229            tileno+0x4000,
231230            0x30 + color,
232231            flipx,0,
233            xpos-16+4,ypos-32,
234            cliprect,TRANSPARENCY_PEN,15);
232            xpos-16+4,ypos-32,15);
235233   }
236234}
237235
src/mame/video/galaxian.c
r5077r5078
640640      }
641641
642642      /* draw */
643      drawgfx(bitmap, machine->gfx[1],
643      drawgfx_transpen(bitmap, &clip,
644            machine->gfx[1],
644645            code, color,
645646            flipx, flipy,
646            GALAXIAN_H0START + GALAXIAN_XSCALE * sx, sy,
647            &clip,
648            TRANSPARENCY_PEN, 0);
647            GALAXIAN_H0START + GALAXIAN_XSCALE * sx, sy, 0);
649648   }
650649}
651650
src/mame/video/othldrby.c
r5077r5078
165165      {
166166         for (x = 0;x < sizex;x++)
167167         {
168            drawgfx(bitmap,machine->gfx[0],
168            drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
169169                  code + x + sizex * y,
170170                  color,
171171                  flipx,flipy,
172                  (sx + (flipx ? (-8*(x+1)+1) : 8*x) - vreg[6]+44) & 0x1ff,(sy + (flipy ? (-8*(y+1)+1) : 8*y) - vreg[7]-9) & 0x1ff,
173                  cliprect,TRANSPARENCY_PEN,0);
172                  (sx + (flipx ? (-8*(x+1)+1) : 8*x) - vreg[6]+44) & 0x1ff,(sy + (flipy ? (-8*(y+1)+1) : 8*y) - vreg[7]-9) & 0x1ff,0);
174173         }
175174      }
176175   }
src/mame/video/gstriker.c
r5077r5078
449449      for (x=0;x<xnum;x++)
450450      {
451451         // Hack to handle horizontal wrapping
452         drawgfxzoom(screen, machine->gfx[CG10103_cur_chip->gfx_region], tile, color+CG10103_cur_chip->pal_base, flipx, flipy, xp>>16, ypos>>16, cliprect, TRANSPARENCY_PEN, CG10103_cur_chip->transpen, xfact, yfact);
453         drawgfxzoom(screen, machine->gfx[CG10103_cur_chip->gfx_region], tile, color+CG10103_cur_chip->pal_base, flipx, flipy, (xp>>16) - 0x200, ypos>>16, cliprect, TRANSPARENCY_PEN, CG10103_cur_chip->transpen, xfact, yfact);
452         drawgfxzoom_transpen(screen, cliprect, machine->gfx[CG10103_cur_chip->gfx_region], tile, color+CG10103_cur_chip->pal_base, flipx, flipy, xp>>16, ypos>>16, xfact, yfact, CG10103_cur_chip->transpen);
453         drawgfxzoom_transpen(screen, cliprect, machine->gfx[CG10103_cur_chip->gfx_region], tile, color+CG10103_cur_chip->pal_base, flipx, flipy, (xp>>16) - 0x200, ypos>>16, xfact, yfact, CG10103_cur_chip->transpen);
454454         xp += xstep;
455455         tile++;
456456      }
src/mame/video/hyprduel.c
r5077r5078
530530
531531            gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width, 0, 256, 0);
532532
533            pdrawgfxzoom(   bitmap,&gfx,
533            pdrawgfxzoom_transpen(   bitmap,cliprect, &gfx,
534534                        0,
535535                        color_start >> 4,
536536                        flipx, flipy,
537537                        x, y,
538                        cliprect, TRANSPARENCY_PEN, 255,
539538                        zoom, zoom,
540                        primask[pri]);
539                        priority_bitmap,primask[pri], 255);
541540         }
542541         else
543542         {
r5077r5078
547546
548547            gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width/2, 0, 16, GFX_ELEMENT_PACKED);
549548
550            pdrawgfxzoom(   bitmap,&gfx,
549            pdrawgfxzoom_transpen(   bitmap,cliprect, &gfx,
551550                        0,
552551                        color + color_start,
553552                        flipx, flipy,
554553                        x, y,
555                        cliprect, TRANSPARENCY_PEN, 15,
556554                        zoom, zoom,
557                        primask[pri]);
555                        priority_bitmap,primask[pri], 15);
558556         }
559557#if 0
560558{   /* Display priority + zoom on each sprite */
src/mame/video/flstory.c
r5077r5078
166166         flipx = ((spriteram[offs+1]&0x40)>>6)^flipscreen;
167167         flipy = ((spriteram[offs+1]&0x80)>>7)^flipscreen;
168168
169         drawgfx(bitmap,machine->gfx[1],
169         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
170170               code,
171171               spriteram[offs+1] & 0x0f,
172172               flipx,flipy,
173               sx,sy,
174               cliprect,TRANSPARENCY_PEN,15);
173               sx,sy,15);
175174         /* wrap around */
176175         if (sx > 240)
177            drawgfx(bitmap,machine->gfx[1],
176            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
178177                  code,
179178                  spriteram[offs+1] & 0x0f,
180179                  flipx,flipy,
181                  sx-256,sy,
182                  cliprect,TRANSPARENCY_PEN,15);
180                  sx-256,sy,15);
183181      }
184182   }
185183}
r5077r5078
223221         flipx = ((spriteram[offs+1]&0x40)>>6)^flipscreen;
224222         flipy = ((spriteram[offs+1]&0x80)>>7)^flipscreen;
225223
226         drawgfx(bitmap,machine->gfx[1],
224         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
227225               code,
228226               spriteram[offs+1] & 0x0f,
229227               flipx,flipy,
230               sx,sy,
231               cliprect,TRANSPARENCY_PEN,15);
228               sx,sy,15);
232229         /* wrap around */
233230         if (sx > 240)
234            drawgfx(bitmap,machine->gfx[1],
231            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
235232                  code,
236233                  spriteram[offs+1] & 0x0f,
237234                  flipx,flipy,
238                  sx-256,sy,
239                  cliprect,TRANSPARENCY_PEN,15);
235                  sx-256,sy,15);
240236      }
241237   }
242238}
src/mame/video/suprslam.c
r5077r5078
7575            if (!flipx) {
7676               for (xcnt = 0; xcnt < wide+1; xcnt ++)   {
7777                  int tileno = suprslam_sp_videoram[word_offset+loopno];
78                  drawgfxzoom(bitmap, gfx, tileno, col, 0, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2, cliprect, TRANSPARENCY_PEN, 15,xzoom << 11, yzoom << 11);
79                  drawgfxzoom(bitmap, gfx, tileno, col, 0, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2, cliprect, TRANSPARENCY_PEN, 15,xzoom << 11, yzoom << 11);
78                  drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 0, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15);
79                  drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 0, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15);
8080                  loopno ++;
8181               }
8282            } else {
8383               for (xcnt = wide; xcnt >= 0; xcnt --)   {
8484                  int tileno = suprslam_sp_videoram[word_offset+loopno];
85                  drawgfxzoom(bitmap, gfx, tileno, col, 1, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2, cliprect, TRANSPARENCY_PEN, 15,xzoom << 11, yzoom << 11);
86                  drawgfxzoom(bitmap, gfx, tileno, col, 1, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2, cliprect, TRANSPARENCY_PEN, 15,xzoom << 11, yzoom << 11);
85                  drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 1, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15);
86                  drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 1, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15);
8787                  loopno ++;
8888               }
8989            }
src/mame/video/strnskil.c
r5077r5078
111111      if (sx > 248)
112112         sx = sx - 256;
113113
114      drawgfx(bitmap, machine->gfx[1],
114      drawgfx_transmask(bitmap, cliprect,
115         machine->gfx[1],
115116         code, color,
116117         flipx, flipy,
117118         px, py,
118         cliprect,
119         TRANSPARENCY_PENS,
120119         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
121120   }
122121}
src/mame/video/cosmic.c
r5077r5078
297297
298298            if (spriteram[offs] & 0x80)
299299                /* 16x16 sprite */
300             drawgfx(bitmap,machine->gfx[0],
300             drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
301301                   code, color,
302302                   0, ~spriteram[offs] & 0x40,
303                   256-spriteram[offs+2],spriteram[offs+1],
304                    cliprect,TRANSPARENCY_PEN,0);
303                   256-spriteram[offs+2],spriteram[offs+1],0);
305304            else
306305                /* 32x32 sprite */
307             drawgfx(bitmap,machine->gfx[1],
306             drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
308307                   code >> 2, color,
309308                   0, ~spriteram[offs] & 0x40,
310                   256-spriteram[offs+2],spriteram[offs+1],
311                    cliprect,TRANSPARENCY_PEN,0);
309                   256-spriteram[offs+2],spriteram[offs+1],0);
312310        }
313311   }
314312}
src/mame/video/shaolins.c
r5077r5078
172172            flipy = !flipy;
173173         }
174174
175         drawgfx(bitmap, machine->gfx[1],
175         drawgfx_transmask(bitmap, cliprect,machine->gfx[1],
176176            code, color,
177177            flipx, flipy,
178178            sx, sy,
179            cliprect,TRANSPARENCY_PENS,
180179            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, palettebank << 5));
181180      }
182181   }
src/mame/video/sshangha.c
r5077r5078
9696
9797      while (multi >= 0)
9898      {
99         drawgfx(bitmap,machine->gfx[2],
99         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
100100               sprite - multi * inc,
101101               colour,
102102               fx,fy,
103               x,y + mult * multi,
104               cliprect,TRANSPARENCY_PEN,0);
103               x,y + mult * multi,0);
105104
106105         multi--;
107106      }
src/mame/video/wiping.c
r5077r5078
121121         sy = 27 - sy;
122122      }
123123
124      drawgfx(bitmap,screen->machine->gfx[0],
124      drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
125125            videoram[offs],
126126            colorram[offs] & 0x3f,
127127            flipscreen,flipscreen,
128            sx*8,sy*8,
129            cliprect,TRANSPARENCY_NONE,0);
128            sx*8,sy*8);
130129   }
131130
132131   /* Note, we're counting up on purpose ! */
r5077r5078
150149         flipy = !flipy;
151150      }
152151
153      drawgfx(bitmap,screen->machine->gfx[1],
152      drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1],
154153         (spriteram[offs] & 0x3f) + 64 * otherbank,
155154         color,
156155         flipx,flipy,
157156         sx,sy,
158         cliprect,TRANSPARENCY_PENS,
159157         colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 0x1f));
160158   }
161159
r5077r5078
191189            sy = 27 - sy;
192190         }
193191
194         drawgfx(bitmap,screen->machine->gfx[0],
192         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
195193               videoram[offs],
196194               colorram[offs] & 0x3f,
197195               flipscreen,flipscreen,
198               sx*8,sy*8,
199               cliprect,TRANSPARENCY_NONE,0);
196               sx*8,sy*8);
200197           }
201198   }
202199
src/mame/video/kyugo.c
r5077r5078
207207         }
208208
209209
210         drawgfx( bitmap, machine->gfx[2],
210         drawgfx_transpen( bitmap, cliprect,machine->gfx[2],
211211                code,
212212                color,
213213                flipx,flipy,
214                sx,flipscreen ? sy - 16*y : sy + 16*y,
215                cliprect,TRANSPARENCY_PEN, 0 );
214                sx,flipscreen ? sy - 16*y : sy + 16*y, 0 );
216215       }
217216   }
218217}
src/mame/video/popeye.c
r5077r5078
357357      }
358358
359359      if (spriteram[offs] != 0)
360         drawgfx(bitmap,machine->gfx[1],
360         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
361361               code ^ 0x1ff,
362362               color,
363363               flipx,flipy,
364               sx,sy,
365               cliprect,TRANSPARENCY_PEN,0);
364               sx,sy,0);
366365   }
367366}
368367
src/mame/video/lazercmd.c
r5077r5078
7070      sx *= HORZ_CHR;
7171      sy *= VERT_CHR;
7272
73      drawgfx(bitmap, screen->machine->gfx[0],
73      drawgfx_opaque(bitmap, cliprect,screen->machine->gfx[0],
7474            videoram[i], video_inverted ? 1 : 0,
7575            0,0,
76            sx,sy,
77            cliprect,TRANSPARENCY_NONE,0);
76            sx,sy);
7877   }
7978
8079   x = marker_x - 1;             /* normal video lags marker by 1 pixel */
src/mame/video/taxidrvr.c
r5077r5078
3838         sx = offs % 32;
3939         sy = offs / 32;
4040
41         drawgfx(bitmap,screen->machine->gfx[3],
41         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[3],
4242               taxidrvr_vram3[offs],
4343               0,
4444               0,0,
45               (sx*8-taxidrvr_scroll[0])&0xff,(sy*8-taxidrvr_scroll[1])&0xff,
46               cliprect,TRANSPARENCY_NONE,0);
45               (sx*8-taxidrvr_scroll[0])&0xff,(sy*8-taxidrvr_scroll[1])&0xff);
4746      }
4847
4948      for (offs = 0;offs < 0x400;offs++)
r5077r5078
5150         sx = offs % 32;
5251         sy = offs / 32;
5352
54         drawgfx(bitmap,screen->machine->gfx[2],
53         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
5554               taxidrvr_vram2[offs]+256*taxidrvr_vram2[offs+0x400],
5655               0,
5756               0,0,
58               (sx*8-taxidrvr_scroll[2])&0xff,(sy*8-taxidrvr_scroll[3])&0xff,
59               cliprect,TRANSPARENCY_PEN,0);
57               (sx*8-taxidrvr_scroll[2])&0xff,(sy*8-taxidrvr_scroll[3])&0xff,0);
6058      }
6159
6260      if (spritectrl[2] & 4)
r5077r5078
118116         sx = offs % 32;
119117         sy = offs / 32;
120118
121         drawgfx(bitmap,screen->machine->gfx[1],
119         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
122120               taxidrvr_vram1[offs],
123121               0,
124122               0,0,
125               sx*8,sy*8,
126               cliprect,TRANSPARENCY_PEN,0);
123               sx*8,sy*8,0);
127124      }
128125
129126      for (offs = 0;offs < 0x2000;offs++)
r5077r5078
146143      sx = offs % 32;
147144      sy = offs / 32;
148145
149      drawgfx(bitmap,screen->machine->gfx[0],
146      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
150147            taxidrvr_vram0[offs],
151148            0,
152149            0,0,
153            sx*8,sy*8,
154            cliprect,TRANSPARENCY_PEN,0);
150            sx*8,sy*8,0);
155151   }
156152   return 0;
157153}
src/mame/video/compgolf.c
r5077r5078
101101      fx = spriteram[offs]&4;
102102      fy = 0; /* ? */
103103
104      drawgfx(bitmap,machine->gfx[0],
104      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
105105            sprite,
106            color,fx,fy,x,y,
107            cliprect,TRANSPARENCY_PEN,0);
106            color,fx,fy,x,y,0);
108107
109108      /* Double Height */
110109      if(spriteram[offs] & 0x10)
111110      {
112         drawgfx(bitmap,machine->gfx[0],
111         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
113112            sprite+1,
114            color,fx,fy,x,y+16,
115            cliprect,TRANSPARENCY_PEN,0);
113            color,fx,fy,x,y+16,0);
116114      }
117115   }
118116}
src/mame/video/lordgun.c
r5077r5078
245245      sx   -=   0x18;
246246      sy   =   (sy & 0x7ff) - (sy & 0x800);
247247
248      drawgfx(   bitmap,   machine->gfx[0],
248      drawgfx_transpen(   bitmap,   cliprect, machine->gfx[0],
249249               code,   color,
250               flipx,   flipy,   sx,   sy,
251               cliprect, TRANSPARENCY_PEN, 0x3f);
250               flipx,   flipy,   sx,   sy, 0x3f);
252251   }
253252}
254253
src/mame/video/pushman.c
r5077r5078
107107         flipy = !flipy;
108108      }
109109
110      drawgfx(bitmap,machine->gfx[1],
110      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
111111            sprite,
112                color,flipx,flipy,x,y,
113            cliprect,TRANSPARENCY_PEN,15);
112                color,flipx,flipy,x,y,15);
114113   }
115114}
116115
src/mame/video/lemmings.c
r5077r5078
6666
6767      while (multi >= 0)
6868      {
69         drawgfx(bitmap,machine->gfx[gfxbank],
69         drawgfx_transpen(bitmap,cliprect,machine->gfx[gfxbank],
7070               sprite - multi * inc,
7171               colour,
7272               fx,fy,
73               x,y + mult * multi,
74               cliprect,TRANSPARENCY_PEN,0);
73               x,y + mult * multi,0);
7574
7675         multi--;
7776      }
src/mame/video/espial.c
r5077r5078
200200      {
201201         if (flipscreen)
202202         {
203            drawgfx(bitmap,machine->gfx[1],
203            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
204204                  code,color,
205205                  flipx,flipy,
206                  sx,sy + 16,
207                  cliprect,TRANSPARENCY_PEN,0);
208            drawgfx(bitmap,machine->gfx[1],
206                  sx,sy + 16,0);
207            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
209208                  code + 1,
210209                  color,
211210                  flipx,flipy,
212                  sx,sy,
213                  cliprect,TRANSPARENCY_PEN,0);
211                  sx,sy,0);
214212         }
215213         else
216214         {
217            drawgfx(bitmap,machine->gfx[1],
215            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
218216                  code,color,
219217                  flipx,flipy,
220                  sx,sy - 16,
221                  cliprect,TRANSPARENCY_PEN,0);
222            drawgfx(bitmap,machine->gfx[1],
218                  sx,sy - 16,0);
219            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
223220                  code + 1,color,
224221                  flipx,flipy,
225                  sx,sy,
226                  cliprect,TRANSPARENCY_PEN,0);
222                  sx,sy,0);
227223         }
228224      }
229225      else
230226      {
231         drawgfx(bitmap,machine->gfx[1],
227         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
232228               code,color,
233229               flipx,flipy,
234               sx,sy,
235               cliprect,TRANSPARENCY_PEN,0);
230               sx,sy,0);
236231      }
237232   }
238233}
src/mame/video/hyperspt.c
r5077r5078
152152
153153      sy += 1;
154154
155      drawgfx(bitmap,machine->gfx[0],
155      drawgfx_transmask(bitmap,cliprect,
156         machine->gfx[0],
156157         code, color,
157158         flipx, flipy,
158159         sx, sy,
159         cliprect,
160         TRANSPARENCY_PENS,
161160         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
162161
163162      /* redraw with wraparound */
164163
165      drawgfx(bitmap,machine->gfx[0],
164      drawgfx_transmask(bitmap,cliprect,
165         machine->gfx[0],
166166         code, color,
167167         flipx, flipy,
168168         sx - 256, sy,
169         cliprect,
170         TRANSPARENCY_PENS,
171169         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
172170   }
173171}
src/mame/video/tiamc1.c
r5077r5078
177177      spritecode = tiamc1_spriteram_n[offs] ^ 0xff;
178178
179179      if (!(tiamc1_spriteram_a[offs] & 0x01))
180         drawgfx(bitmap, machine->gfx[1],
180         drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
181181            spritecode,
182182            0,
183183            flipx, flipy,
184            sx, sy,
185            cliprect, TRANSPARENCY_PEN, 15);
184            sx, sy, 15);
186185   }
187186}
188187
src/mame/video/toaplan1.c
r5077r5078
929929***************************************************************************/
930930
931931// custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities
932static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const gfx_element *gfx,
932static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
933933      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
934      const rectangle *clip,int priority)
934      int priority)
935935{
936936   int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
937937   const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
r5077r5078
10801080               if (fcu_flipscreen) sx = sx_base - dim_x;
10811081               else                sx = sx_base + dim_x;
10821082
1083               toaplan1_draw_sprite_custom(bitmap,machine->gfx[1],
1083               toaplan1_draw_sprite_custom(bitmap,cliprect,machine->gfx[1],
10841084                                        sprite,color,
10851085                                        fcu_flipscreen,fcu_flipscreen,
10861086                                        sx,sy,
1087                                        cliprect,priority);
1087                                        priority);
10881088
10891089               sprite++ ;
10901090            }
r5077r5078
11151115            flipx = attrib & 0x100;
11161116            if (flipx) sx -= 15;
11171117            flipy = attrib & 0x200;
1118            drawgfx(bitmap,machine->gfx[1],
1118            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
11191119               sprite,
11201120               color,
11211121               flipx,flipy,
1122               sx-31,sy-16,
1123               cliprect,TRANSPARENCY_PEN,0);
1122               sx-31,sy-16,0);
11241123         }
11251124      }
11261125   }
src/mame/video/segag80r.c
r5077r5078
656656         UINT8 tile = videoram[offs];
657657
658658         /* draw the tile */
659         drawgfx(bitmap, machine->gfx[0], tile, tile >> 4, video_flip, video_flip, x*8, y*8, cliprect, TRANSPARENCY_PENS, transparent_pens[tile >> 4]);
659         drawgfx_transmask(bitmap, cliprect, machine->gfx[0], tile, tile >> 4, video_flip, video_flip, x*8, y*8, transparent_pens[tile >> 4]);
660660      }
661661   }
662662}
src/mame/video/zodiack.c
r5077r5078
150150         y = 255 - y;
151151      }
152152
153      drawgfx(
153      drawgfx_transpen(
154154         bitmap,
155         machine->gfx[2],
155         cliprect,machine->gfx[2],
156156         0,   /* this is just a dot, generated by the hardware */
157157         0,
158158         0,0,
159         x,y,
160         cliprect,TRANSPARENCY_PEN,0);
159         x,y,0);
161160   }
162161}
163162
r5077r5078
181180         flipy = !flipy;
182181      }
183182
184      drawgfx(bitmap, machine->gfx[1],
183      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
185184         spritecode,
186185         spriteram[offs + 2] & 0x07,
187186         flipx, flipy,
188187         sx, sy,
189         //flip_screen[0] ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0);
190         //&spritevisiblearea,TRANSPARENCY_PEN,0);
191         cliprect, TRANSPARENCY_PEN, 0);
188         0);
192189   }
193190}
194191
src/mame/video/pitnrun.c
r5077r5078
202202         flipy = !flipy;
203203      }
204204
205      drawgfx(bitmap,machine->gfx[2],
205      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
206206          (spriteram[offs+1]&0x3f)+((spriteram[offs+2]&0x80)>>1)+((spriteram[offs+2]&0x40)<<1),
207207         pal,
208208         flipx,flipy,
209         sx,sy,
210         cliprect,TRANSPARENCY_PEN,0);
209         sx,sy,0);
211210   }
212211}
213212
src/mame/video/tehkanwc.c
r5077r5078
151151         flipy = !flipy;
152152      }
153153
154      drawgfx(bitmap, machine->gfx[1],
155         code, color, flipx, flipy, sx, sy,
156         cliprect, TRANSPARENCY_PEN, 0);
154      drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
155         code, color, flipx, flipy, sx, sy, 0);
157156   }
158157}
159158
src/mame/video/bionicc.c
r5077r5078
219219            flipy = !flipy;
220220         }
221221
222         drawgfx( bitmap, gfx,
222         drawgfx_transpen( bitmap, cliprect,gfx,
223223            tile_number,
224224            color,
225225            flipx,flipy,
226            sx,sy,
227            cliprect,TRANSPARENCY_PEN,15);
226            sx,sy,15);
228227      }
229228   }
230229}
src/mame/video/citycon.c
r5077r5078
126126         flipx = !flipx;
127127      }
128128
129      drawgfx(bitmap,machine->gfx[spriteram[offs + 1] & 0x80 ? 2 : 1],
129      drawgfx_transpen(bitmap,cliprect,machine->gfx[spriteram[offs + 1] & 0x80 ? 2 : 1],
130130            spriteram[offs + 1] & 0x7f,
131131            spriteram[offs + 2] & 0x0f,
132132            flipx,flip_screen_get(machine),
133            sx,sy,
134            cliprect,TRANSPARENCY_PEN,0);
133            sx,sy,0);
135134   }
136135}
137136
src/mame/video/suprridr.c
r5077r5078
213213         fy = !fy;
214214         y = 240 - y;
215215      }
216      drawgfx(bitmap, screen->machine->gfx[2], code, color, fx, fy, x, y, cliprect, TRANSPARENCY_PEN, 0);
216      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, fx, fy, x, y, 0);
217217   }
218218   return 0;
219219}
src/mame/video/psikyo.c
r5077r5078
380380            int addr   =   (code*2) & (TILES_LEN-1);
381381
382382            if (zoomx == 32 && zoomy == 32)
383               pdrawgfx(bitmap,machine->gfx[0],
383               pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0],
384384                     TILES[addr+1] * 256 + TILES[addr],
385385                     attr >> 8,
386386                     flipx, flipy,
387387                     x + dx * 16, y + dy * 16,
388                     cliprect,TRANSPARENCY_PEN,trans_pen,
389                     pri[(attr & 0xc0) >> 6]);
388                     priority_bitmap,
389                     pri[(attr & 0xc0) >> 6],trans_pen);
390390            else
391               pdrawgfxzoom(bitmap,machine->gfx[0],
391               pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
392392                        TILES[addr+1] * 256 + TILES[addr],
393393                        attr >> 8,
394394                        flipx, flipy,
395395                        x + (dx * zoomx) / 2, y + (dy * zoomy) / 2,
396                        cliprect,TRANSPARENCY_PEN,trans_pen,
397396                        zoomx << 11,zoomy << 11,
398                        pri[(attr & 0xc0) >> 6]);
397                        priority_bitmap,pri[(attr & 0xc0) >> 6],trans_pen);
399398
400399            code++;
401400         }
src/mame/video/playmark.c
r5077r5078
361361      if(!pri && (color & 0x0c) == 0x0c)
362362         pri = 2;
363363
364      pdrawgfx(bitmap,machine->gfx[0],
364      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0],
365365              code,
366366             color,
367367             flipx,0,
368368             sx + xoffset,sy + yoffset,
369             cliprect,TRANSPARENCY_PEN,0,pri_masks[pri]);
369             priority_bitmap,pri_masks[pri],0);
370370   }
371371}
372372
src/mame/video/esd16.c
r5077r5078
247247
248248      for (y = starty ; y != endy ; y += incy)
249249      {
250         pdrawgfx(   bitmap, machine->gfx[0],
250         pdrawgfx_transpen(   bitmap, cliprect, machine->gfx[0],
251251                  code++,
252252                  color,
253253                  flipx, flipy,
254254                  sx, y,
255                  cliprect, TRANSPARENCY_PEN, 0, pri_mask   );
255                  priority_bitmap, pri_mask, 0   );
256256      }
257257   }
258258}
r5077r5078
310310
311311      for (y = starty ; y != endy ; y += incy)
312312      {
313         pdrawgfx(   bitmap, machine->gfx[0],
313         pdrawgfx_transpen(   bitmap, cliprect, machine->gfx[0],
314314                  code++,
315315                  color,
316316                  flipx, flipy,
317317                  sx, y,
318                  cliprect, TRANSPARENCY_PEN, 0, pri_mask   );
318                  priority_bitmap, pri_mask, 0   );
319319      }
320320   }
321321}
src/mame/video/darius.c
r5077r5078
105105         sprite_ptr->x = curx;
106106         sprite_ptr->y = cury;
107107
108         drawgfx(bitmap,machine->gfx[0],
108         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
109109               sprite_ptr->code,
110110               sprite_ptr->color,
111111               sprite_ptr->flipx,sprite_ptr->flipy,
112               sprite_ptr->x,sprite_ptr->y,
113               cliprect,TRANSPARENCY_PEN,0);
112               sprite_ptr->x,sprite_ptr->y,0);
114113      }
115114   }
116115}
src/mame/video/ikki.c
r5077r5078
9494      if (y > 240)
9595         y = y - 256;
9696
97      drawgfx(sprite_bitmap,machine->gfx[1],
97      drawgfx_transmask(sprite_bitmap,cliprect, machine->gfx[1],
9898            code, color,
9999            ikki_flipscreen,ikki_flipscreen,
100100            x,y,
101            cliprect, TRANSPARENCY_PENS,
102101            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
103102   }
104103
r5077r5078
177176      bank = (color & 0xe0) << 3;
178177      color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2);
179178
180      drawgfx(bitmap,screen->machine->gfx[0],
179      drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
181180         videoram[offs*2+1] + bank,
182181         color,
183182         ikki_flipscreen,ikki_flipscreen,
184         x,y,
185         cliprect,TRANSPARENCY_NONE,0);
183         x,y);
186184   }
187185
188186   draw_sprites(screen->machine, bitmap, cliprect);
r5077r5078
213211         bank = (color & 0xe0) << 3;
214212         color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2);
215213
216         drawgfx(bitmap,screen->machine->gfx[0],
214         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
217215            videoram[offs*2+1] + bank,
218216            color,
219217            ikki_flipscreen,ikki_flipscreen,
220            x,y,
221            cliprect,TRANSPARENCY_NONE,0);
218            x,y);
222219      }
223220   }
224221
src/mame/video/cbasebal.c
r5077r5078
162162         flipx = !flipx;
163163      }
164164
165      drawgfx(bitmap,machine->gfx[2],
165      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
166166            code,
167167            color,
168168            flipx,flipscreen,
169            sx,sy,
170            cliprect,TRANSPARENCY_PEN,15);
169            sx,sy,15);
171170   }
172171}
173172
src/mame/video/st0016.c
r5077r5078
511511
512512                if(priority)
513513                {
514                   drawgfx(bitmap,gfx,
514                   drawgfx_transpen(bitmap,cliprect,gfx,
515515                              code,
516516                              color,
517517                              flipx,flipy,
518                              x*8+spr_dx,y*8+spr_dy,
519                              cliprect,TRANSPARENCY_PEN,0);
518                              x*8+spr_dx,y*8+spr_dy,0);
520519               }
521520               else
522521               {
src/mame/video/sbasketb.c
r5077r5078
160160            flipy = !flipy;
161161         }
162162
163         drawgfx(bitmap,machine->gfx[1],
163         drawgfx_transpen(bitmap,cliprect,
164            machine->gfx[1],
164165            code, color,
165166            flipx, flipy,
166            sx, sy,
167            cliprect,
168            TRANSPARENCY_PEN, 0);
167            sx, sy, 0);
169168      }
170169   }
171170}
src/mame/video/funkyjet.c
r5077r5078
6565
6666      while (multi >= 0)
6767      {
68         drawgfx(bitmap,machine->gfx[2],
68         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
6969               sprite - multi * inc,
7070               colour,
7171               fx,fy,
72               x,y + mult * multi,
73               cliprect,TRANSPARENCY_PEN,0);
72               x,y + mult * multi,0);
7473
7574         multi--;
7675      }
src/mame/video/ksayakyu.c
r5077r5078
8989         flipy^=1;
9090      }
9191
92         drawgfx(bitmap,gfx,
92         drawgfx_transpen(bitmap,cliprect,gfx,
9393            tile&0x7f,
9494            (attributes) & 7,
9595            flipx,flipy,
96            sx,sy,
97            cliprect,TRANSPARENCY_PEN,0 );
96            sx,sy,0 );
9897
9998      source -= 4;
10099   }
src/mame/video/himesiki.c
r5077r5078
8585            y -= 0x100;
8686      }
8787
88      drawgfx(bitmap,machine->gfx[1],code,col,fx,fy,x,y,cliprect,TRANSPARENCY_PEN,15);
88      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,col,fx,fy,x,y,15);
8989   }
9090
9191   for (offs = 0; offs<0x100; offs+=4)
r5077r5078
114114      if (y > 0xf0)
115115         y -= 0x100;
116116
117      drawgfx(bitmap,machine->gfx[2],code,col,f,f,x,y,cliprect,TRANSPARENCY_PEN,15);
117      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],code,col,f,f,x,y,15);
118118   }
119119}
120120
src/mame/video/battlex.c
r5077r5078
104104         flipy = !flipy;
105105      }
106106
107      drawgfx(bitmap,gfx,tile,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
107      drawgfx_transpen(bitmap,cliprect,gfx,tile,color,flipx,flipy,sx,sy,0);
108108
109109      source += 4;
110110   }
src/mame/video/ironhors.c
r5077r5078
183183      switch (sr[offs+4] & 0x0c)
184184      {
185185         case 0x00:   /* 16x16 */
186            drawgfx(bitmap,machine->gfx[1],
186            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
187187                  code/4,
188188                  color,
189189                  flipx,flipy,
190                  sx,sy,
191                  cliprect,TRANSPARENCY_PEN,0);
190                  sx,sy,0);
192191            break;
193192
194193         case 0x04:   /* 16x8 */
195194            {
196195               if (flip_screen_get(machine)) sy += 8; // this fixes the train wheels' position
197196
198               drawgfx(bitmap,machine->gfx[2],
197               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
199198                     code & ~1,
200199                     color,
201200                     flipx,flipy,
202                     flipx?sx+8:sx,sy,
203                     cliprect,TRANSPARENCY_PEN,0);
204               drawgfx(bitmap,machine->gfx[2],
201                     flipx?sx+8:sx,sy,0);
202               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
205203                     code | 1,
206204                     color,
207205                     flipx,flipy,
208                     flipx?sx:sx+8,sy,
209                     cliprect,TRANSPARENCY_PEN,0);
206                     flipx?sx:sx+8,sy,0);
210207            }
211208            break;
212209
213210         case 0x08:   /* 8x16 */
214211            {
215               drawgfx(bitmap,machine->gfx[2],
212               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
216213                     code & ~2,
217214                     color,
218215                     flipx,flipy,
219                     sx,flipy?sy+8:sy,
220                     cliprect,TRANSPARENCY_PEN,0);
221               drawgfx(bitmap,machine->gfx[2],
216                     sx,flipy?sy+8:sy,0);
217               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
222218                     code | 2,
223219                     color,
224220                     flipx,flipy,
225                     sx,flipy?sy:sy+8,
226                     cliprect,TRANSPARENCY_PEN,0);
221                     sx,flipy?sy:sy+8,0);
227222            }
228223            break;
229224
230225         case 0x0c:   /* 8x8 */
231226            {
232               drawgfx(bitmap,machine->gfx[2],
227               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
233228                     code,
234229                     color,
235230                     flipx,flipy,
236                     sx,sy,
237                     cliprect,TRANSPARENCY_PEN,0);
231                     sx,sy,0);
238232            }
239233            break;
240234      }
r5077r5078
306300      switch (sr[offs+3] & 0x0c)
307301      {
308302         case 0x00:   /* 16x16 */
309            drawgfx(bitmap,machine->gfx[1],
303            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
310304                  code/4,
311305                  color,
312306                  flipx,flipy,
313                  sx,sy,
314                  cliprect,TRANSPARENCY_PEN,0);
307                  sx,sy,0);
315308            break;
316309
317310         case 0x04:   /* 16x8 */
318311            {
319312               if (flip_screen_get(machine)) sy += 8; // this fixes the train wheels' position
320313
321               drawgfx(bitmap,machine->gfx[2],
314               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
322315                     code & ~1,
323316                     color,
324317                     flipx,flipy,
325                     flipx?sx+8:sx,sy,
326                     cliprect,TRANSPARENCY_PEN,0);
327               drawgfx(bitmap,machine->gfx[2],
318                     flipx?sx+8:sx,sy,0);
319               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
328320                     code | 1,
329321                     color,
330322                     flipx,flipy,
331                     flipx?sx:sx+8,sy,
332                     cliprect,TRANSPARENCY_PEN,0);
323                     flipx?sx:sx+8,sy,0);
333324            }
334325            break;
335326
336327         case 0x08:   /* 8x16 */
337328            {
338               drawgfx(bitmap,machine->gfx[2],
329               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
339330                     code & ~2,
340331                     color,
341332                     flipx,flipy,
342                     sx,flipy?sy+8:sy,
343                     cliprect,TRANSPARENCY_PEN,0);
344               drawgfx(bitmap,machine->gfx[2],
333                     sx,flipy?sy+8:sy,0);
334               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
345335                     code | 2,
346336                     color,
347337                     flipx,flipy,
348                     sx,flipy?sy:sy+8,
349                     cliprect,TRANSPARENCY_PEN,0);
338                     sx,flipy?sy:sy+8,0);
350339            }
351340            break;
352341
353342         case 0x0c:   /* 8x8 */
354343            {
355               drawgfx(bitmap,machine->gfx[2],
344               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
356345                     code,
357346                     color,
358347                     flipx,flipy,
359                     sx,sy,
360                     cliprect,TRANSPARENCY_PEN,0);
348                     sx,sy,0);
361349            }
362350            break;
363351      }
src/mame/video/mrflea.c
r5077r5078
4747      int ypos = source[0]-16+3;
4848      int tile_number = source[2]+source[3]*0x100;
4949
50      drawgfx( bitmap, gfx,
50      drawgfx_transpen( bitmap, &clip,gfx,
5151         tile_number,
5252         0, /* color */
5353         0,0, /* no flip */
54         xpos,ypos,
55         &clip,TRANSPARENCY_PEN,0 );
56      drawgfx( bitmap, gfx,
54         xpos,ypos,0 );
55      drawgfx_transpen( bitmap, &clip,gfx,
5756         tile_number,
5857         0, /* color */
5958         0,0, /* no flip */
60         xpos,256+ypos,
61         &clip,TRANSPARENCY_PEN,0 );
59         xpos,256+ypos,0 );
6260      source+=4;
6361   }
6462}
r5077r5078
7573      for( sx=0; sx<256; sx+=8 ){
7674         int tile_number = base+source[0]+source[0x400]*0x100;
7775         source++;
78         drawgfx( bitmap, gfx,
76         drawgfx_opaque( bitmap, cliprect,
77            gfx,
7978            tile_number,
8079            0, /* color */
8180            0,0, /* no flip */
82            sx,sy,
83            cliprect,
84            TRANSPARENCY_NONE,0 );
81            sx,sy );
8582      }
8683   }
8784}
src/mame/video/glass.c
r5077r5078
180180
181181      number = ((number & 0x03) << 14) | ((number & 0x0fffc) >> 2);
182182
183      drawgfx(bitmap,gfx,number,
183      drawgfx_transpen(bitmap,cliprect,gfx,number,
184184            0x10 + (color & 0x0f),xflip,yflip,
185            sx-0x0f,sy,
186            cliprect,TRANSPARENCY_PEN,0);
185            sx-0x0f,sy,0);
187186   }
188187}
189188
src/mame/video/toaplan2.c
r5077r5078
14161416               if (flipx) sx = sx_base - dim_x;
14171417               else       sx = sx_base + dim_x;
14181418
1419               drawgfx(bitmap,gfx,sprite,
1419               drawgfx_transpen(bitmap,cliprect,gfx,sprite,
14201420                  color,
14211421                  flipx,flipy,
1422                  sx,sy,
1423                  cliprect,TRANSPARENCY_PEN,0);
1422                  sx,sy,0);
14241423
14251424               sprite++ ;
14261425            }
src/mame/video/mjkjidai.c
r5077r5078
115115      sx += 16;
116116      sy += 1;
117117
118      drawgfx(bitmap,machine->gfx[1],
118      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
119119            code,
120120            color,
121121            flipx,flipy,
122            sx,sy,
123            cliprect,TRANSPARENCY_PEN,0);
122            sx,sy,0);
124123   }
125124}
126125
src/mame/video/jailbrek.c
r5077r5078
8888         flipy = !flipy;
8989      }
9090
91      drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy,
92         sx, sy, cliprect, TRANSPARENCY_PENS,
91      drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy,
92         sx, sy,
9393         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
9494   }
9595}
src/mame/video/gaelco.c
r5077r5078
172172            ex = xflip ? (spr_size-1-x) : x;
173173            ey = yflip ? (spr_size-1-y) : y;
174174
175            pdrawgfx(bitmap,gfx,number + x_offset[ex] + y_offset[ey],
175            pdrawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey],
176176                  color,xflip,yflip,
177177                  sx-0x0f+x*8,sy+y*8,
178                  cliprect,TRANSPARENCY_PEN,0,pri_mask);
178                  priority_bitmap,pri_mask,0);
179179         }
180180      }
181181   }
src/mame/video/wecleman.c
r5077r5078
670670------------------------------------------------------------------------*/
671671
672672// blends two 8x8x16bpp direct RGB tilemaps
673static void draw_cloud(running_machine *machine, bitmap_t *bitmap,
674             gfx_element *gfx,
673static void draw_cloud(bitmap_t *bitmap,
674             const gfx_element *gfx,
675675             UINT16 *tm_base,
676676             int x0, int y0,            // target coordinate
677677             int xcount, int ycount,      // number of tiles to draw in x and y
r5077r5078
707707
708708   dst_base = BITMAP_ADDR32(bitmap, y0+dy, x0+dx);
709709
710   pal_base = machine->pens + pal_offset * gfx->color_granularity;
710   pal_base = gfx->machine->pens + pal_offset * gfx->color_granularity;
711711
712712   alpha <<= 6;
713713
r5077r5078
827827
828828      for (sx=0; sx<2*XSIZE; sx+=64)
829829      {
830         drawgfx(bitmap,machine->gfx[0],
830         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
831831               code++,
832832               color,
833833               0,0,
834               ((sx-scrollx)&0x3ff)-(384-32),sy,
835               cliprect,TRANSPARENCY_PEN,0);
834               ((sx-scrollx)&0x3ff)-(384-32),sy,0);
836835      }
837836   }
838837
r5077r5078
10981097      ((pen_t *)mrct)[0] = ((pen_t *)mrct)[0x40] = ((pen_t *)mrct)[0x200] = ((pen_t *)mrct)[0x205];
10991098
11001099      if (video_on)
1101         draw_cloud(screen->machine,
1100         draw_cloud(
11021101         bitmap,
11031102         screen->machine->gfx[0],
11041103         wecleman_pageram+0x1800,
src/mame/video/tankbust.c
r5077r5078
218218      if ((spriteram[offs+1]!=4))   //otherwise - ghost sprites
219219      {
220220
221         drawgfx(bitmap,machine->gfx[0],
221         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
222222            code, color,
223223            flipx,flipy,
224            sx,sy,
225            cliprect,TRANSPARENCY_PEN,0);
224            sx,sy,0);
226225      }
227226   }
228227}
src/mame/video/portrait.c
r5077r5078
137137
138138      }
139139
140      drawgfx(bitmap,machine->gfx[0],
140      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
141141            tilenum,color,
142142            0,fy,
143            sx,sy,
144            cliprect,TRANSPARENCY_PEN,0);
143            sx,sy,0);
145144
146145      source += 0x10;
147146   }
src/mame/video/bosco.c
r5077r5078
224224      int color = spriteram_2[offs + 1] & 0x3f;
225225      if (flip_screen_get(machine)) sx += 32-2;
226226
227      drawgfx(bitmap,machine->gfx[1],
227      drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
228228            (spriteram[offs] & 0xfc) >> 2,
229229            color,
230230            flipx,flipy,
231231            sx,sy,
232            cliprect,TRANSPARENCY_PENS,
233232            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x0f));
234233   }
235234}
r5077r5078
247246      y = 253 - bosco_radary[offs];
248247      if (flip_screen_get(machine)) x -= 3;
249248
250      drawgfx(bitmap,machine->gfx[2],
249      drawgfx_transmask(bitmap,cliprect,machine->gfx[2],
251250            ((bosco_radarattr[offs] & 0x0e) >> 1) ^ 0x07,
252251            0,
253252            0,0,
254            x,y,
255            cliprect,TRANSPARENCY_PENS,0xf0);
253            x,y,0xf0);
256254   }
257255}
258256
src/mame/video/munchmo.c
r5077r5078
6969      }
7070      for( sy=0; sy<256; sy+=8 )
7171      {
72         drawgfx( bitmap, gfx,
72         drawgfx_opaque( bitmap, cliprect,
73            gfx,
7374            *source++,
7475            0, /* color */
7576            0,0, /* no flip */
76            sx,sy,
77            cliprect,
78            TRANSPARENCY_NONE, 0 );
77            sx,sy );
7978      }
8079   }
8180}
r5077r5078
101100      {
102101         for( col=0; col<4; col++ )
103102         {
104            drawgfx( tmpbitmap,gfx,
103            drawgfx_opaque( tmpbitmap,0, gfx,
105104               rom[col+tile_number*4+row*0x400],
106105               mnchmobl_palette_bank,
107106               0,0, /* flip */
108               sx+col*8, sy+row*8,
109               0, TRANSPARENCY_NONE, 0 );
107               sx+col*8, sy+row*8 );
110108         }
111109      }
112110   }
r5077r5078
143141         {
144142            sx = (sx >> 1) | (tile_number & 0x80);
145143            sx = 2 * ((- 32 - scroll - sx) & 0xff) + xadjust;
146            drawgfx( bitmap, gfx,
144            drawgfx_transpen( bitmap, cliprect, gfx,
147145               0x7f - (tile_number & 0x7f),
148146               color_base - (attributes & 0x03),
149147               0,0,                      /* no flip */
150               sx,sy,
151               cliprect, TRANSPARENCY_PEN, 7 );
148               sx,sy, 7 );
152149         }
153150      }
154151   }
src/mame/video/funkybee.c
r5077r5078
113113         flipx = !flipx;
114114      }
115115
116      drawgfx(bitmap,machine->gfx[2+gfx_bank],
116      drawgfx_transpen(bitmap,cliprect, machine->gfx[2+gfx_bank],
117117         code, color,
118118         flipx, flipy,
119         sx, sy,
120         cliprect, TRANSPARENCY_PEN, 0);
119         sx, sy, 0);
121120   }
122121}
123122
r5077r5078
136135      if (flip)
137136         sy = 248 - sy;
138137
139      drawgfx(bitmap,machine->gfx[gfx_bank],
138      drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_bank],
140139            code, color,
141140            flip, flip,
142            sx, sy,
143            cliprect,TRANSPARENCY_PEN,0);
141            sx, sy,0);
144142
145143      code = videoram[0x1d00 + offs];
146144      color = colorram[0x1f11] & 0x03;
r5077r5078
150148      if (flip)
151149         sy = 248 - sy;
152150
153      drawgfx(bitmap,machine->gfx[gfx_bank],
151      drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_bank],
154152            code, color,
155153            flip, flip,
156            sx, sy,
157            cliprect,TRANSPARENCY_PEN,0);
154            sx, sy,0);
158155   }
159156}
160157
src/mame/video/galastrm.c
r5077r5078
221221      if ((priority != 0 && sprite_ptr->primask != 0) ||
222222         (priority == 0 && sprite_ptr->primask == 0))
223223      {
224         pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
224         pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
225225            sprite_ptr->code,
226226            sprite_ptr->color,
227227            sprite_ptr->flipx,sprite_ptr->flipy,
228228            sprite_ptr->x,sprite_ptr->y,
229            cliprect,TRANSPARENCY_PEN,0,
230229            sprite_ptr->zoomx,sprite_ptr->zoomy,
231            primasks[sprite_ptr->primask]);
230            priority_bitmap,primasks[sprite_ptr->primask],0);
232231      }
233232   }
234233}
src/mame/video/tetrisp2.c
r5077r5078
473473      {
474474         for (x = xstart; x != xend; x += xinc)
475475         {
476            pdrawgfx(bitmap, machine->gfx[gfxnum],
476            pdrawgfx_transpen(bitmap, &clip,
477                  machine->gfx[gfxnum],
477478                  code++,
478479                  color,
479480                  flipx, flipy,
480481                  sx + x * 8, sy + y * 8,
481                  &clip,
482                  TRANSPARENCY_PEN, 0, primask);
482                  priority_bitmap, primask, 0);
483483         }
484484         code   +=   (0x100/8) - xnum;
485485      }
src/mame/video/lastduel.c
r5077r5078
242242         flipy = !flipy;
243243      }
244244
245      drawgfx(bitmap,machine->gfx[0],
245      drawgfx_transpen(bitmap,cliprect,
246            machine->gfx[0],
246247            code,
247248            color,
248249            flipx,flipy,
249            sx,sy,
250            cliprect,
251            TRANSPARENCY_PEN,15);
250            sx,sy,15);
252251   }
253252}
254253
src/mame/video/drgnmst.c
r5077r5078
9999            realy = ypos+incy*y;
100100            realnumber = number+x+y*16;
101101
102            drawgfx(bitmap,gfx,realnumber,colr,flipx,flipy,realx,realy,cliprect,TRANSPARENCY_PEN,15);
102            drawgfx_transpen(bitmap,cliprect,gfx,realnumber,colr,flipx,flipy,realx,realy,15);
103103
104104         }
105105      }
src/mame/video/alpha68k.c
r5077r5078
116116         }
117117
118118         if (color)
119            drawgfx(bitmap,machine->gfx[1],
119            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
120120               tile,
121121               color,
122122               fx,fy,
123               mx,my,
124               cliprect,TRANSPARENCY_PEN,0);
123               mx,my,0);
125124
126125         if (flipscreen)
127126            my=(my-16)&0x1ff;
r5077r5078
257256         }
258257
259258         if (color)
260            drawgfx(bitmap,machine->gfx[1],
259            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
261260               tile,
262261               color,
263262               fx,fy,
264               mx,my,
265               cliprect,TRANSPARENCY_PEN,0);
263               mx,my,0);
266264
267265         if (flipscreen)
268266            my=(my-16)&0x1ff;
r5077r5078
350348         fy = data & 0x4000;
351349         color = color_prom[tile<<1|data>>15];
352350
353         drawgfx(bitmap, gfx, tile, color, 0, fy, mx, my,
354               cliprect, TRANSPARENCY_PEN, 0);
351         drawgfx_transpen(bitmap, cliprect, gfx, tile, color, 0, fy, mx, my, 0);
355352
356353         my = (my + 8) & 0xff;
357354      }
r5077r5078
473470
474471               tile = (data>>3 & 0x400) | (data & 0x3ff);
475472               alpha68k_video_banking(&bank, data);
476               drawgfx(bitmap, machine->gfx[bank], tile, color, fx, fy, mx, my,
477                     cliprect, TRANSPARENCY_PEN, 0);
473               drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], tile, color, fx, fy, mx, my, 0);
478474            }
479475         }
480476//ZT
r5077r5078
532528            color = (data>>7 & 0x18) | (data>>13 & 7);
533529            tile = data & 0x3ff;
534530            bank = data>>10 & 3;
535            drawgfx(bitmap, machine->gfx[bank], tile, color, fx, fy, mx, my,
536                  cliprect, TRANSPARENCY_PEN, 0);
531            drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], tile, color, fx, fy, mx, my, 0);
537532         }
538533//ZT
539534         if(flipscreen)
src/mame/video/boxer.c
r5077r5078
3535
3636            code = p[32 * l + 4 * i + j];
3737
38            drawgfx(bitmap, machine->gfx[n],
38            drawgfx_transpen(bitmap, cliprect,
39               machine->gfx[n],
3940               code,
4041               0,
4142               code & 0x80, 0,
4243               x + 8 * j,
43               y + 8 * i,
44               cliprect,
45               TRANSPARENCY_PEN, 1);
44               y + 8 * i, 1);
4645
4746            code = p[32 * r + 4 * i - j + 3];
4847
49            drawgfx(bitmap, machine->gfx[n],
48            drawgfx_transpen(bitmap, cliprect,
49               machine->gfx[n],
5050               code,
5151               0,
5252               !(code & 0x80), 0,
5353               x + 8 * j + 32,
54               y + 8 * i,
55               cliprect,
56               TRANSPARENCY_PEN, 1);
54               y + 8 * i, 1);
5755         }
5856      }
5957   }
r5077r5078
7371      {
7472         UINT8 code = boxer_tile_ram[32 * i + j];
7573
76         drawgfx(bitmap, screen->machine->gfx[2],
74         drawgfx_transpen(bitmap, cliprect,
75            screen->machine->gfx[2],
7776            code,
7877            0,
7978            code & 0x40, code & 0x40,
8079            8 * j + 4,
81            8 * (i % 2) + 32 * (i / 2),
82            cliprect,
83            TRANSPARENCY_PEN, 0);
80            8 * (i % 2) + 32 * (i / 2), 0);
8481      }
8582   }
8683
src/mame/video/freekick.c
r5077r5078
5555         flipy = !flipy;
5656      }
5757
58      drawgfx(bitmap,machine->gfx[1],
58      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
5959            code,
6060            color,
6161            flipx,flipy,
62            xpos,240-ypos,
63            cliprect,TRANSPARENCY_PEN,0);
62            xpos,240-ypos,0);
6463   }
6564}
6665
r5077r5078
9089         flipy = !flipy;
9190      }
9291
93      drawgfx(bitmap,machine->gfx[1],
92      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
9493            code,
9594            color,
9695            flipx,flipy,
97            xpos,240-ypos,
98            cliprect,TRANSPARENCY_PEN,0);
96            xpos,240-ypos,0);
9997   }
10098}
10199
r5077r5078
126124         flipy = !flipy;
127125      }
128126
129      drawgfx(bitmap,machine->gfx[1],
127      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
130128            code,
131129            color,
132130            flipx,flipy,
133            xpos,248-ypos,
134            cliprect,TRANSPARENCY_PEN,0);
131            xpos,248-ypos,0);
135132   }
136133}
137134
src/mame/video/namcos22.c
r5077r5078
556556
557557static void
558558mydrawgfxzoom(
559   bitmap_t *dest_bmp,const gfx_element *gfx,
559   bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
560560   UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
561   const rectangle *clip,
562561   int scalex, int scaley, int z, int prioverchar, int alpha )
563562{
564563   int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
r5077r5078
650649} /* ApplyGamma */
651650
652651static void
653poly3d_Draw3dSprite( bitmap_t *bitmap, gfx_element *gfx, int tileNumber, int color, int sx, int sy, int width, int height, int translucency, int zc, UINT32 pri )
652poly3d_Draw3dSprite( bitmap_t *bitmap, const gfx_element *gfx, int tileNumber, int color, int sx, int sy, int width, int height, int translucency, int zc, UINT32 pri )
654653{
655654   int flipx = 0;
656655   int flipy = 0;
r5077r5078
661660   clip.max_y = 480-1;
662661   mydrawgfxzoom(
663662      bitmap,
663      &clip,
664664      gfx,
665665      tileNumber,
666666      color,
667667      flipx, flipy,
668668      sx, sy,
669      &clip,
670669      (width<<16)/32,
671670      (height<<16)/32,
672671      zc, pri, 0xff - translucency );
src/mame/video/flyball.c
r5077r5078
7373
7474   /* draw pitcher */
7575
76   drawgfx(bitmap, screen->machine->gfx[1], flyball_pitcher_pic ^ 0xf,
77      0, 1, 0, pitcherx, pitchery, cliprect, TRANSPARENCY_PEN, 1);
76   drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], flyball_pitcher_pic ^ 0xf,
77      0, 1, 0, pitcherx, pitchery, 1);
7878
7979   /* draw ball */
8080
src/mame/video/redclash.c
r5077r5078
200200               {
201201                  int code = ((spriteram[offs + i + 1] & 0xf0) >> 4) + ((gfxbank & 1) << 4);
202202
203                  drawgfx(bitmap,machine->gfx[3],
203                  drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
204204                        code,
205205                        color,
206206                        0,0,
207                        sx,sy - 16,
208                        cliprect,TRANSPARENCY_PEN,0);
207                        sx,sy - 16,0);
209208                  /* wraparound */
210                  drawgfx(bitmap,machine->gfx[3],
209                  drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
211210                        code,
212211                        color,
213212                        0,0,
214                        sx - 256,sy - 16,
215                        cliprect,TRANSPARENCY_PEN,0);
213                        sx - 256,sy - 16,0);
216214                  break;
217215               }
218216
r5077r5078
222220                     int code = ((spriteram[offs + i + 1] & 0xf8) >> 3) + ((gfxbank & 1) << 5);
223221                     int bank = (spriteram[offs + i + 1] & 0x02) >> 1;
224222
225                     drawgfx(bitmap,machine->gfx[4+bank],
223                     drawgfx_transpen(bitmap,cliprect,machine->gfx[4+bank],
226224                           code,
227225                           color,
228226                           0,0,
229                           sx,sy - 16,
230                           cliprect,TRANSPARENCY_PEN,0);
227                           sx,sy - 16,0);
231228                  }
232229                  else
233230                  {
234231                     int code = ((spriteram[offs + i + 1] & 0xf0) >> 4) + ((gfxbank & 1) << 4);
235232
236                     drawgfx(bitmap,machine->gfx[2],
233                     drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
237234                           code,
238235                           color,
239236                           0,0,
240                           sx,sy - 16,
241                           cliprect,TRANSPARENCY_PEN,0);
237                           sx,sy - 16,0);
242238                  }
243239                  break;
244240
245241               case 1:   /* 8x8 */
246                  drawgfx(bitmap,machine->gfx[1],
242                  drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
247243                        spriteram[offs + i + 1],// + 4 * (spriteram[offs + i + 2] & 0x10),
248244                        color,
249245                        0,0,
250                        sx,sy - 16,
251                        cliprect,TRANSPARENCY_PEN,0);
246                        sx,sy - 16,0);
252247                  break;
253248
254249               case 0:
src/mame/video/galaxold.c
r5077r5078
18571857      if (offs < 3*4)  sy++;
18581858
18591859
1860      drawgfx(bitmap,machine->gfx[1],
1860      drawgfx_transpen(bitmap,flipscreen_x ? spritevisibleareaflipx : spritevisiblearea,machine->gfx[1],
18611861            code,color,
18621862            flipx,flipy,
1863            sx,sy,
1864            flipscreen_x ? spritevisibleareaflipx : spritevisiblearea,TRANSPARENCY_PEN,0);
1863            sx,sy,0);
18651864   }
18661865}
18671866
src/mame/video/centiped.c
r5077r5078
431431      int x = spriteram[offs + 0x20];
432432      int y = 240 - spriteram[offs + 0x10];
433433
434      drawgfx(bitmap, screen->machine->gfx[1], code, color, flipx, flipy, x, y,
435            &spriteclip, TRANSPARENCY_PENS, penmask[color & 0x3f]);
434      drawgfx_transmask(bitmap, &spriteclip, screen->machine->gfx[1], code, color, flipx, flipy, x, y, penmask[color & 0x3f]);
436435   }
437436   return 0;
438437}
r5077r5078
476475         flipx = !flipx;
477476      }
478477
479      drawgfx(bitmap, screen->machine->gfx[1], code, color, flipx, flipy, x, y,
480            cliprect, TRANSPARENCY_PEN, 0);
478      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], code, color, flipx, flipy, x, y, 0);
481479   }
482480   return 0;
483481}
r5077r5078
507505      int x = spriteram[offs + 0x20];
508506      int y = 240 - spriteram[offs + 0x10];
509507
510      drawgfx(bitmap, screen->machine->gfx[1], code, color & 0x3f, 1, flipy, x, y,
511            &spriteclip, TRANSPARENCY_PEN, 0);
508      drawgfx_transpen(bitmap, &spriteclip, screen->machine->gfx[1], code, color & 0x3f, 1, flipy, x, y, 0);
512509   }
513510   return 0;
514511}
r5077r5078
544541         flipy = !flipy;
545542      }
546543
547      drawgfx(bitmap, screen->machine->gfx[1], code, color, flipx, flipy, x, y,
548            &spriteclip, TRANSPARENCY_PENS, penmask[color & 0x3f]);
544      drawgfx_transmask(bitmap, &spriteclip, screen->machine->gfx[1], code, color, flipx, flipy, x, y, penmask[color & 0x3f]);
549545   }
550546   return 0;
551547}
src/mame/video/wgp.c
r5077r5078
435435               zx = x + (((k+1)*zoomx)/2) - curx;
436436               zy = y + (((j+1)*zoomy)/2) - cury;
437437
438               pdrawgfxzoom(bitmap, machine->gfx[0],
438               pdrawgfxzoom_transpen(bitmap, cliprect,machine->gfx[0],
439439                     code,
440440                     col,
441441                     flipx, flipy,
442442                     curx,cury,
443                     cliprect,TRANSPARENCY_PEN,0,
444443                     zx << 12, zy << 12,
445                     primasks[((priority >> 1) &1)]);   /* maybe >> 2 or 0...? */
444                     priority_bitmap,primasks[((priority >> 1) &1)],0);   /* maybe >> 2 or 0...? */
446445            }
447446         }
448447         else
r5077r5078
467466               zx = x + (((k+1)*zoomx)/4) - curx;
468467               zy = y + (((j+1)*zoomy)/4) - cury;
469468
470               pdrawgfxzoom(bitmap, machine->gfx[0],
469               pdrawgfxzoom_transpen(bitmap, cliprect,machine->gfx[0],
471470                     code,
472471                     col,
473472                     flipx, flipy,
474473                     curx,cury,
475                     cliprect,TRANSPARENCY_PEN,0,
476474                     zx << 12, zy << 12,
477                     primasks[((priority >> 1) &1)]);   /* maybe >> 2 or 0...? */
475                     priority_bitmap,primasks[((priority >> 1) &1)],0);   /* maybe >> 2 or 0...? */
478476            }
479477         }
480478      }
src/mame/video/welltris.c
r5077r5078
8080         for (yt = 0; yt < ytiles; yt++) {
8181            for (xt = 0; xt < xtiles; xt++, code++) {
8282               if (!zoomed)
83                  drawgfx(bitmap, machine->gfx[1], code, color, 0, 0,
84                        x + xt * 16, y + yt * 16, cliprect, TRANSPARENCY_PEN, 15);
83                  drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 0,
84                        x + xt * 16, y + yt * 16, 15);
8585               else
86                  drawgfxzoom(bitmap, machine->gfx[1], code, color, 0, 0,
87                        x + xt * xzoom, y + yt * yzoom, cliprect, TRANSPARENCY_PEN, 15,
88                        0x1000 * xzoom, 0x1000 * yzoom);
86                  drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 0,
87                        x + xt * xzoom, y + yt * yzoom,
88                        0x1000 * xzoom, 0x1000 * yzoom, 15);
8989            }
9090            if (xtiles == 3) code += 1;
9191            if (xtiles == 5) code += 3;
r5077r5078
9999         for (yt = 0; yt < ytiles; yt++) {
100100            for (xt = 0; xt < xtiles; xt++, code++) {
101101               if (!zoomed)
102                  drawgfx(bitmap, machine->gfx[1], code, color, 1, 0,
103                        x + (xtiles - 1 - xt) * 16, y + yt * 16, cliprect, TRANSPARENCY_PEN, 15);
102                  drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 1, 0,
103                        x + (xtiles - 1 - xt) * 16, y + yt * 16, 15);
104104               else
105                  drawgfxzoom(bitmap, machine->gfx[1], code, color, 1, 0,
106                        x + (xtiles - 1 - xt) * xzoom, y + yt * yzoom, cliprect, TRANSPARENCY_PEN, 15,
107                        0x1000 * xzoom, 0x1000 * yzoom);
105                  drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[1], code, color, 1, 0,
106                        x + (xtiles - 1 - xt) * xzoom, y + yt * yzoom,
107                        0x1000 * xzoom, 0x1000 * yzoom, 15);
108108            }
109109            if (xtiles == 3) code += 1;
110110            if (xtiles == 5) code += 3;
r5077r5078
118118         for (yt = 0; yt < ytiles; yt++) {
119119            for (xt = 0; xt < xtiles; xt++, code++) {
120120               if (!zoomed)
121                  drawgfx(bitmap, machine->gfx[1], code, color, 0, 1,
122                        x + xt * 16, y + (ytiles - 1 - yt) * 16, cliprect, TRANSPARENCY_PEN, 15);
121                  drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 1,
122                        x + xt * 16, y + (ytiles - 1 - yt) * 16, 15);
123123               else
124                  drawgfxzoom(bitmap, machine->gfx[1], code, color, 0, 1,
125                        x + xt * xzoom, y + (ytiles - 1 - yt) * yzoom, cliprect, TRANSPARENCY_PEN, 15,
126                        0x1000 * xzoom, 0x1000 * yzoom);
124                  drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 1,
125                        x + xt * xzoom, y + (ytiles - 1 - yt) * yzoom,
126                        0x1000 * xzoom, 0x1000 * yzoom, 15);
127127            }
128128            if (xtiles == 3) code += 1;
129129            if (xtiles == 5) code += 3;
r5077r5078
137137         for (yt = 0; yt < ytiles; yt++) {
138138            for (xt = 0; xt < xtiles; xt++, code++) {
139139               if (!zoomed)
140                  drawgfx(bitmap, machine->gfx[1], code, color, 1, 1,
141                        x + (xtiles - 1 - xt) * 16, y + (ytiles - 1 - yt) * 16, cliprect, TRANSPARENCY_PEN, 15);
140                  drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 1, 1,
141                        x + (xtiles - 1 - xt) * 16, y + (ytiles - 1 - yt) * 16, 15);
142142               else
143                  drawgfxzoom(bitmap, machine->gfx[1], code, color, 1, 1,
144                        x + (xtiles - 1 - xt) * xzoom, y + (ytiles - 1 - yt) * yzoom, cliprect, TRANSPARENCY_PEN, 15,
145                        0x1000 * xzoom, 0x1000 * yzoom);
143                  drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[1], code, color, 1, 1,
144                        x + (xtiles - 1 - xt) * xzoom, y + (ytiles - 1 - yt) * yzoom,
145                        0x1000 * xzoom, 0x1000 * yzoom, 15);
146146            }
147147            if (xtiles == 3) code += 1;
148148            if (xtiles == 5) code += 3;
src/mame/video/sprint8.c
r5077r5078
150150      if (code & 0x80)
151151         x |= 0x100;
152152
153      drawgfx(bitmap, machine->gfx[2],
153      drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
154154         code ^ 7,
155155         i,
156156         !(code & 0x10), !(code & 0x08),
157         496 - x, y - 31,
158         cliprect, TRANSPARENCY_PEN, 0);
157         496 - x, y - 31, 0);
159158   }
160159}
161160
src/mame/video/ssv.c
r5077r5078
143143
144144static int shadow_pen_mask, shadow_pen_shift;
145145
146static void ssv_drawgfx(   bitmap_t *bitmap, const gfx_element *gfx,
146static void ssv_drawgfx(   bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx,
147147               UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0,
148               const rectangle *cliprect, int shadow   )
148               int shadow )
149149{
150150   const UINT8 *addr, *source;
151151   UINT8 pen;
r5077r5078
701701         {
702702            for (ty = ystart; ty != yend; ty += yinc)
703703            {
704               ssv_drawgfx( bitmap,   machine->gfx[gfx],
704               ssv_drawgfx( bitmap, &clip, machine->gfx[gfx],
705705                                 code++,
706706                                 color,
707707                                 flipx, flipy,
708708                                 sx + tx * 16, sy + ty * 8,
709                                 &clip, shadow   );
709                                 shadow   );
710710            } /* ty */
711711         } /* tx */
712712
r5077r5078
890890            {
891891               for (y = ystart; y != yend; y += yinc)
892892               {
893                  ssv_drawgfx( bitmap,   machine->gfx[gfx],
893                  ssv_drawgfx( bitmap, cliprect, machine->gfx[gfx],
894894                                    code++,
895895                                    color,
896896                                    flipx, flipy,
897897                                    sx + x * 16, sy + y * 8,
898                                    cliprect, shadow   );
898                                    shadow   );
899899               }
900900            }
901901
r5077r5078
10671067         {
10681068            for (y = ystart; y != yend; y += yinc)
10691069            {
1070               drawgfxzoom(   bitmap,   machine->gfx[2],
1070               drawgfxzoom_transpen( bitmap, cliprect, machine->gfx[2],
10711071                           code++,
10721072                           color,
10731073                           flipx, flipy,
10741074                           (sx + x * xdim) / 0x10000, (sy + y * ydim) / 0x10000,
1075                           cliprect, TRANSPARENCY_PEN, 0,
1076                           xscale, yscale
1075                           xscale, yscale, 0
10771076               );
10781077            }
10791078         }
src/mame/video/dec0.c
r5077r5078
201201
202202      while (multi >= 0)
203203      {
204         drawgfx(bitmap,machine->gfx[3],
204         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
205205               sprite - multi * inc,
206206               colour,
207207               fx,fy,
208               x,y + mult * multi,
209               cliprect,TRANSPARENCY_PEN,0);
208               x,y + mult * multi,0);
210209
211210         multi--;
212211      }
src/mame/video/taitoair.c
r5077r5078
173173                     flipy ^= 0x0080;
174174                  }
175175
176                  drawgfxzoom( bitmap, machine -> gfx[0],
176                  drawgfxzoom_transpen( bitmap, cliprect,
177                         machine -> gfx[0],
177178                         tile,
178179                         color,
179180                         flipx, flipy,
180181                         x, y,
181                         cliprect,
182                         TRANSPARENCY_PEN, 0,
183                         zx, zy
182                         zx, zy, 0
184183                  );
185184               }
186185               tile_offs ++;
src/mame/video/tceptor.c
r5077r5078
501501         x -= 64;
502502         y -= 78;
503503
504         drawgfxzoom(bitmap,
504         drawgfxzoom_transmask(bitmap,
505                     cliprect,
505506                     machine->gfx[gfx],
506507                     code,
507508                     color,
508509                     flipx, flipy,
509510                     x, y,
510                     cliprect,
511                     TRANSPARENCY_PENS,
512                     colortable_get_transpen_mask(machine->colortable, machine->gfx[gfx], color, SPR_TRANS_COLOR),
513511                     scalex,
514                     scaley);
512                     scaley,
513                     colortable_get_transpen_mask(machine->colortable, machine->gfx[gfx], color, SPR_TRANS_COLOR));
515514      }
516515   }
517516
src/mame/video/cop01.c
r5077r5078
196196      if (code&0x80)
197197         code += (mightguy_vreg[0]&0x30)<<3;
198198
199      drawgfx(bitmap,machine->gfx[2],
199      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
200200         code,
201201         color,
202202         flipx,flipy,
203         sx,sy,
204         cliprect,TRANSPARENCY_PEN,0 );
203         sx,sy,0 );
205204   }
206205}
207206
src/mame/video/aquarium.c
r5077r5078
4646
4747         for (chain_pos = chain;chain_pos >= 0;chain_pos--)
4848         {
49            drawgfx(bitmap, machine->gfx[0],
49            drawgfx_transpen(bitmap, cliprect,machine->gfx[0],
5050                  code,
5151                  col,
5252                  flipx, flipy,
53                  curx,cury,
54                  cliprect,TRANSPARENCY_PEN,0);
53                  curx,cury,0);
5554
5655            /* wrap around y */
57            drawgfx(bitmap, machine->gfx[0],
56            drawgfx_transpen(bitmap, cliprect,machine->gfx[0],
5857                  code,
5958                  col,
6059                  flipx, flipy,
61                  curx,cury+256,
62                  cliprect,TRANSPARENCY_PEN,0);
60                  curx,cury+256,0);
6361
6462            code++;
6563
src/mame/video/metro.c
r5077r5078
697697
698698            gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width, 0, 256, 0);
699699
700            pdrawgfxzoom(   bitmap,&gfx,
700            pdrawgfxzoom_transpen(   bitmap,cliprect, &gfx,
701701                        0,
702702                        color_start >> 4,
703703                        flipx, flipy,
704704                        x, y,
705                        cliprect, TRANSPARENCY_PEN, 255,
706705                        zoom, zoom,
707                        primask[pri]);
706                        priority_bitmap,primask[pri], 255);
708707         }
709708         else
710709         {
r5077r5078
714713
715714            gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width/2, 0, 16, GFX_ELEMENT_PACKED);
716715
717            pdrawgfxzoom(   bitmap,&gfx,
716            pdrawgfxzoom_transpen(   bitmap,cliprect, &gfx,
718717                        0,
719718                        color + color_start,
720719                        flipx, flipy,
721720                        x, y,
722                        cliprect, TRANSPARENCY_PEN, 15,
723721                        zoom, zoom,
724                        primask[pri]);
722                        priority_bitmap,primask[pri], 15);
725723         }
726724#if 0
727725{   /* Display priority + zoom on each sprite */
src/mame/video/angelkds.c
r5077r5078
177177
178178   if (enable & enable_n)
179179   {
180         drawgfx(
180         drawgfx_transpen(
181181               bitmap,
182               cliprect,
182183               gfx,
183184               tile_no,
184185               color*4,
185186               flipx,flipy,
186               xpos,ypos,
187               cliprect,
188               TRANSPARENCY_PEN,15
187               xpos,ypos,15
189188               );
190189         /* wraparound */
191190         if (xpos > 240)
192            drawgfx(
191            drawgfx_transpen(
193192                  bitmap,
193                  cliprect,
194194                  gfx,
195195                  tile_no,
196196                  color*4,
197197                  flipx,flipy,
198                  xpos-256,ypos,
199                  cliprect,
200                  TRANSPARENCY_PEN,15
198                  xpos-256,ypos,15
201199                  );
202200         /* wraparound */
203201         if (ypos > 240)
204202         {
205            drawgfx(
203            drawgfx_transpen(
206204                  bitmap,
205                  cliprect,
207206                  gfx,
208207                  tile_no,
209208                  color*4,
210209                  flipx,flipy,
211                  xpos,ypos-256,
212                  cliprect,
213                  TRANSPARENCY_PEN,15
210                  xpos,ypos-256,15
214211                  );
215212            /* wraparound */
216213            if (xpos > 240)
217                     drawgfx(
214                     drawgfx_transpen(
218215                           bitmap,
216                           cliprect,
219217                           gfx,
220218                           tile_no,
221219                           color*4,
222220                           flipx,flipy,
223                           xpos-256,ypos-256,
224                           cliprect,
225                           TRANSPARENCY_PEN,15
221                           xpos-256,ypos-256,15
226222                           );
227223         }
228224
src/mame/video/circusc.c
r5077r5078
194194      }
195195
196196
197      drawgfx(bitmap,machine->gfx[1],
197      drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
198198            code, color,
199199            flipx,flipy,
200200            sx,sy,
201            cliprect,TRANSPARENCY_PENS,
202201            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
203202   }
204203}
src/mame/video/mikie.c
r5077r5078
155155         flipy = !flipy;
156156      }
157157
158      drawgfx(bitmap, machine->gfx[gfxbank],
158      drawgfx_transpen(bitmap, cliprect,
159         machine->gfx[gfxbank],
159160         code, color,
160161         flipx,flipy,
161         sx,sy,
162         cliprect,
163         TRANSPARENCY_PEN, 0);
162         sx,sy, 0);
164163   }
165164}
166165
src/mame/video/zaccaria.c
r5077r5078
246246         flipy = !flipy;
247247      }
248248
249      drawgfx(bitmap,machine->gfx[1],
249      drawgfx_transpen(bitmap,&clip,machine->gfx[1],
250250            (spriteram_2[offs + 2] & 0x3f) + (spriteram_2[offs + 1] & 0xc0),
251251            4 * (spriteram_2[offs + 1] & 0x07),
252252            flipx,flipy,
253            sx,sy,
254            &clip,TRANSPARENCY_PEN,0);
253            sx,sy,0);
255254   }
256255
257256   for (offs = 0;offs < spriteram_size;offs += 4)
r5077r5078
272271         flipy = !flipy;
273272      }
274273
275      drawgfx(bitmap,machine->gfx[1],
274      drawgfx_transpen(bitmap,&clip,machine->gfx[1],
276275            (spriteram[offs + 1] & 0x3f) + (spriteram[offs + 2] & 0xc0),
277276            4 * (spriteram[offs + 2] & 0x07),
278277            flipx,flipy,
279            sx,sy,
280            &clip,TRANSPARENCY_PEN,0);
278            sx,sy,0);
281279   }
282280}
283281
src/mame/video/suna16.c
r5077r5078
190190               tile_flipy = !tile_flipy;
191191            }
192192
193            drawgfx(   bitmap, machine->gfx[gfx],
193            drawgfx_transpen(   bitmap, cliprect,machine->gfx[gfx],
194194                     (tile & 0x3fff) + bank*0x4000,
195195                     attr + (color_bank << 4),
196196                     tile_flipx, tile_flipy,
197                     sx, sy,
198                     cliprect,TRANSPARENCY_PEN,15   );
197                     sx, sy,15   );
199198
200199            tile_x += tile_xinc;
201200         }
src/mame/video/speedbal.c
r5077r5078
109109         flipx = flipy = 1;
110110      }
111111
112      drawgfx (bitmap,machine->gfx[2],
112      drawgfx_transpen (bitmap,cliprect,machine->gfx[2],
113113            code,
114114            color,
115115            flipx,flipy,
116            x,y,
117            cliprect,TRANSPARENCY_PEN,0);
116            x,y,0);
118117   }
119118}
120119
src/mame/video/shadfrce.c
r5077r5078
139139      height++;
140140      if (enable)   {
141141         for (hcount=0;hcount<height;hcount++) {
142            pdrawgfx(bitmap,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16,cliprect,TRANSPARENCY_PEN,0,pri_mask);
143            pdrawgfx(bitmap,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16,cliprect,TRANSPARENCY_PEN,0,pri_mask);
144            pdrawgfx(bitmap,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16+0x200,cliprect,TRANSPARENCY_PEN,0,pri_mask);
145            pdrawgfx(bitmap,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16+0x200,cliprect,TRANSPARENCY_PEN,0,pri_mask);
142            pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16,priority_bitmap,pri_mask,0);
143            pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16,priority_bitmap,pri_mask,0);
144            pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16+0x200,priority_bitmap,pri_mask,0);
145            pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16+0x200,priority_bitmap,pri_mask,0);
146146         }
147147      }
148148      source-=8;
src/mame/video/tagteam.c
r5077r5078
157157         flipy = !flipy;
158158      }
159159
160      drawgfx(bitmap, machine->gfx[1],
160      drawgfx_transpen(bitmap, cliprect,
161         machine->gfx[1],
161162         code, color,
162163         flipx, flipy,
163         sx, sy,
164         cliprect,
165         TRANSPARENCY_PEN, 0);
164         sx, sy, 0);
166165
167166      /* Wrap around */
168167
r5077r5078
170169      color = palettebank;
171170      sy += (flip_screen_get(machine) ? -256 : 256);
172171
173      drawgfx(bitmap, machine->gfx[1],
172      drawgfx_transpen(bitmap, cliprect,
173         machine->gfx[1],
174174         code, color,
175175         flipx, flipy,
176         sx, sy,
177         cliprect,
178         TRANSPARENCY_PEN, 0);
176         sx, sy, 0);
179177   }
180178}
181179
src/mame/video/bagman.c
r5077r5078
133133      }
134134
135135      if (spriteram[offs + 2] && spriteram[offs + 3])
136         drawgfx(bitmap,machine->gfx[1],
136         drawgfx_transpen(bitmap,/* compensate misplacement */
137               cliprect,machine->gfx[1],
137138               (spriteram[offs] & 0x3f) + 2 * (spriteram[offs + 1] & 0x20),
138139               spriteram[offs + 1] & 0x1f,
139140               flipx,flipy,
140               sx,sy+1,   /* compensate misplacement */
141               cliprect,TRANSPARENCY_PEN,0);
141               sx,sy+1,0);
142142   }
143143}
144144
src/mame/video/bigevglf.c
r5077r5078
7979      sx = bigevglf_spriteram2[i+3];
8080      sy = 200-bigevglf_spriteram2[i];
8181      for(j=0;j<16;j++)
82         drawgfx(bitmap,machine->gfx[0],
82         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
8383            bigevglf_spriteram1[(code<<4)+j]+((bigevglf_spriteram1[0x400+(code<<4)+j]&0xf)<<8),
8484            bigevglf_spriteram2[i+2] & 0xf,
8585            0,0,
86            sx+((j&1)<<3),sy+((j>>1)<<3),
87            cliprect,TRANSPARENCY_PEN,0);
86            sx+((j&1)<<3),sy+((j>>1)<<3),0);
8887   }
8988}
9089
src/mame/video/inufuku.c
r5077r5078
143143
144144               code  = ((inufuku_spriteram2[map_start] & 0x0007) << 16) + inufuku_spriteram2[map_start + 1];
145145
146               pdrawgfxzoom(bitmap, machine->gfx[2],
146               pdrawgfxzoom_transpen(bitmap, cliprect, machine->gfx[2],
147147                     code,
148148                     color,
149149                     flipx, flipy,
150150                     sx - 16, sy - 16,
151                     cliprect, TRANSPARENCY_PEN, 15,
152151                     zoomx << 11, zoomy << 11,
153                     priority_mask);
152                     priority_bitmap,priority_mask, 15);
154153
155154               map_start += 2;
156155            }
src/mame/video/commando.c
r5077r5078
121121      }
122122
123123      if (bank < 3)
124         drawgfx(bitmap,machine->gfx[2], code, color, flipx, flipy, sx, sy,
125            cliprect, TRANSPARENCY_PEN, 15);
124         drawgfx_transpen(bitmap,cliprect, machine->gfx[2], code, color, flipx, flipy, sx, sy, 15);
126125   }
127126}
128127
src/mame/video/skydiver.c
r5077r5078
197197         sx -= 8;
198198      }
199199
200      drawgfxzoom(bitmap,machine->gfx[1],
200      drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1],
201201         charcode, color,
202202         xflip,yflip,sx,sy,
203         cliprect,TRANSPARENCY_PEN,0,
204         wide ? 0x20000 : 0x10000, 0x10000);
203         wide ? 0x20000 : 0x10000, 0x10000,0);
205204   }
206205}
207206
src/mame/video/ninjakd2.c
r5077r5078
410410               {
411411                  int const tile = code ^ (x << big_xshift) ^ (y << big_yshift);
412412
413                  drawgfx(bitmap, gfx,
413                  drawgfx_transpen(bitmap, 0, gfx,
414414                        tile,
415415                        color,
416416                        flipx,flipy,
417                        sx + 16*x, sy + 16*y,
418                        0, TRANSPARENCY_PEN, 15);
417                        sx + 16*x, sy + 16*y, 15);
419418
420419                  ++sprites_drawn;
421420                  if (sprites_drawn >= 96)
src/mame/video/m52.c
r5077r5078
314314   /* this may not be correct */
315315   ypos = ypos + (22 - 8);
316316
317   drawgfx(bitmap, machine->gfx[image],
317   drawgfx_transpen(bitmap, cliprect,
318      machine->gfx[image],
318319      0, 0,
319320      flip_screen_get(machine),
320321      flip_screen_get(machine),
321322      xpos,
322      ypos,
323      cliprect,
324      TRANSPARENCY_PEN, 0);
323      ypos, 0);
325324
326   drawgfx(bitmap, machine->gfx[image],
325   drawgfx_transpen(bitmap, cliprect,
326      machine->gfx[image],
327327      0, 0,
328328      flip_screen_get(machine),
329329      flip_screen_get(machine),
330330      xpos - 256,
331      ypos,
332      cliprect,
333      TRANSPARENCY_PEN, 0);
331      ypos, 0);
334332
335333   rect.min_x = visarea->min_x;
336334   rect.max_x = visarea->max_x;
r5077r5078
419417      clip = *cliprect;
420418#endif
421419
422      drawgfx(bitmap, screen->machine->gfx[1],
420      drawgfx_transmask(bitmap, &clip, screen->machine->gfx[1],
423421         code, color, flipx, flipy, sx, sy,
424         &clip, TRANSPARENCY_PENS,
425422         colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 512+32));
426423   }
427424   return 0;
src/mame/video/cbuster.c
r5077r5078
121121
122122      while (multi >= 0)
123123      {
124         drawgfx(bitmap,machine->gfx[3],
124         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
125125               sprite - multi * inc,
126126               colour,
127127               fx,fy,
128               x,y + mult * multi,
129               cliprect,TRANSPARENCY_PEN,0);
128               x,y + mult * multi,0);
130129
131130         multi--;
132131      }
src/mame/video/gng.c
r5077r5078
136136         flipy = !flipy;
137137      }
138138
139      drawgfx(bitmap,gfx,
139      drawgfx_transpen(bitmap,cliprect,gfx,
140140            buffered_spriteram[offs] + ((attributes<<2) & 0x300),
141141            (attributes >> 4) & 3,
142142            flipx,flipy,
143            sx,sy,
144            cliprect,TRANSPARENCY_PEN,15);
143            sx,sy,15);
145144   }
146145}
147146
src/mame/video/jalblend.c
r5077r5078
6060   return MAKE_RGB(r,g,b);
6161}
6262
63void jal_blend_drawgfx(running_machine *machine,bitmap_t *dest_bmp,const gfx_element *gfx,
63void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
6464                     UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
65                     const rectangle *clip,int transparency,int transparent_color)
65                     int transparency,int transparent_color)
6666{
6767   if (jal_blend_table == NULL)
6868   {
r5077r5078
7373   /* Start drawing */
7474   if (gfx)
7575   {
76      const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
76      const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
7777      const UINT8 *alpha = &jal_blend_table[gfx->color_granularity * (color % gfx->total_colors)];
7878      const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
7979      int x_index_base, y_index, sx, sy, ex, ey;
src/mame/video/jalblend.h
r5077r5078
11extern UINT8 *jal_blend_table;
22rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha);
3void jal_blend_drawgfx(running_machine *machine,bitmap_t *dest_bmp,const gfx_element *gfx,
3void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
44                     UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
5                     const rectangle *clip,int transparency,int transparent_color);
5                     int transparency,int transparent_color);
src/mame/video/wc90b.c
r5077r5078
127127
128128         sy = 240 - spriteram[offs + 1];
129129
130         drawgfx( bitmap, machine->gfx[17], code,
130         drawgfx_transpen( bitmap, cliprect,machine->gfx[17], code,
131131               flags >> 4, /* color */
132132               bank & 1,   /* flipx */
133133               bank & 2,   /* flipy */
134134               sx,
135               sy,
136               cliprect,TRANSPARENCY_PEN,15 );
135               sy,15 );
137136      }
138137   }
139138}
src/mame/video/kncljoe.c
r5077r5078
226226
227227      if (sx >= 256-8) sx -= 256;
228228
229      drawgfx(bitmap,gfx,
229      drawgfx_transpen(bitmap,&clip,gfx,
230230            code,
231231            color,
232232            flipx,flipy,
233            sx,sy,
234            &clip,TRANSPARENCY_PEN,0);
233            sx,sy,0);
235234   }
236235}
237236
src/mame/video/holeland.c
r5077r5078
132132         sy = 240 - sy;
133133      }
134134
135      drawgfx(bitmap,machine->gfx[1],
135      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
136136            code,
137137            color,
138138            flipx,flipy,
139            2*sx,2*sy,
140            cliprect,TRANSPARENCY_PEN,0);
139            2*sx,2*sy,0);
141140   }
142141}
143142
r5077r5078
170169         sy = 240 - sy;
171170      }
172171
173      drawgfx(bitmap,machine->gfx[1],
172      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
174173            code,
175174            color,
176175            flipx,flipy,
177            sx,sy,
178            cliprect,TRANSPARENCY_PEN,0);
176            sx,sy,0);
179177   }
180178}
181179
src/mame/video/spdodgeb.c
r5077r5078
151151
152152***************************************************************************/
153153
154#define DRAW_SPRITE( order, sx, sy ) drawgfx( bitmap, gfx, \
155               (which+order),color+ 8 * sprite_palbank,flipx,flipy,sx,sy, \
156               cliprect,TRANSPARENCY_PEN,0);
154#define DRAW_SPRITE( order, sx, sy ) drawgfx_transpen( bitmap, \
155               cliprect,gfx, \
156               (which+order),color+ 8 * sprite_palbank,flipx,flipy,sx,sy,0);
157157
158158static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
159159{
src/mame/video/liberate.c
r5077r5078
7575   tile = videoram[tile_index] + ((colorram[tile_index] & 0x7) << 8);
7676   color = (colorram[tile_index] & 0x70) >> 4;
7777
78//if (tile & 0x300) tile -= 0x000;
79//else if(tile & 0x200) tile -= 0x100;
80//else if (tile & 0x100) tile -= 0x100;
81//else tile += 0x200;
82
8378   SET_TILE_INFO(0, tile, color, 0);
8479}
8580
81static TILE_GET_INFO( prosport_get_back_tile_info )
82{
83   int tile;
84
85   /* TODO: bits 0-3 are used and there's an unimplemented per-tile flip y / +0x10 tile banking, understand where. */
86
87   tile = (prosport_bg_vram[tile_index] & 0xf0)>>4;
88//  if(!(tile & 0x08)) { tile+=0x10; }
89   tile+= deco16_io_ram[0]&0x20; //Pro Bowling bg tiles banking bit
90
91   SET_TILE_INFO(8, tile, 0, 0);
92}
93
8694/***************************************************************************/
8795
8896WRITE8_HANDLER( deco16_io_w )
r5077r5078
152160   {
153161      case 0:
154162         //background_disable = ~data & 0x80;
163         flip_screen_set(space->machine, data & 0x80);
164         tilemap_mark_all_tiles_dirty(background_tilemap);
155165         break;
156166      case 2: /* Sound */
157167         soundlatch_w(space, 0, data);
r5077r5078
175185   tilemap_mark_tile_dirty(fix_tilemap, offset);
176186}
177187
188WRITE8_HANDLER( prosport_bg_vram_w )
189{
190   prosport_bg_vram[offset] = data;
191   tilemap_mark_tile_dirty(background_tilemap, offset);
192}
193
178194/***************************************************************************/
179195
180196VIDEO_START( prosoccr )
r5077r5078
185201   tilemap_set_transparent_pen(fix_tilemap,0);
186202
187203   prosoccr_charram = auto_alloc_array(machine, UINT8, 0x1800*2);
188
189204}
190205
191206VIDEO_START( boomrang )
r5077r5078
205220   tilemap_set_transparent_pen(fix_tilemap,0);
206221}
207222
223VIDEO_START( prosport )
224{
225   background_tilemap = tilemap_create(machine, prosport_get_back_tile_info,back_scan,16,16,32,32);
226   fix_tilemap = tilemap_create(machine, get_fix_tile_info,fix_scan,8,8,32,32);
227
228   tilemap_set_transparent_pen(fix_tilemap,0);
229}
230
208231/***************************************************************************/
209232
210233WRITE8_HANDLER( prosport_paletteram_w )
r5077r5078
299322            sy2=sy+16;
300323      }
301324
302          drawgfx(bitmap,machine->gfx[1],
325          drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
303326                 code,
304327               color,
305328               fx,fy,
306               sx,sy,
307               cliprect,TRANSPARENCY_PEN,0);
329               sx,sy,0);
308330           if (multi)
309             drawgfx(bitmap,machine->gfx[1],
331             drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
310332               code+1,
311333               color,
312334               fx,fy,
313               sx,sy2,
314               cliprect,TRANSPARENCY_PEN,0);
335               sx,sy2,0);
315336   }
316337}
317338
r5077r5078
342363
343364      color = 1;//(deco16_io_ram[4] & 2)+1;//(spriteram[offs+0]&0x4)>>2;
344365
345      fx = spriteram[offs+0] & 0x02;
346      fy = spriteram[offs+0] & 0x04;
366      fy = spriteram[offs+0] & 0x02;
367      fx = spriteram[offs+0] & 0x04;
347368      multi = 0;// spriteram[offs+0] & 0x10;
348369
349370//      if (multi) sy-=16;
r5077r5078
362383         sy2=sy+16;
363384      }
364385
365       drawgfx(bitmap,machine->gfx[gfx_region],
386       drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region],
366387              code,
367388            color,
368389            fx,fy,
369            sx,sy,
370            cliprect,TRANSPARENCY_PEN,0);
390            sx,sy,0);
371391        if (multi)
372          drawgfx(bitmap,machine->gfx[gfx_region],
392          drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region],
373393            code2,
374394            color,
375395            fx,fy,
376            sx,sy2,
377            cliprect,TRANSPARENCY_PEN,0);
396            sx,sy2,0);
378397   }
379398}
380399
r5077r5078
420439         sy2=sy+16;
421440      }
422441
423       drawgfx(bitmap,machine->gfx[1],
442       drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
424443              code,
425444            color,
426445            fx,fy,
427            sx,sy,
428            cliprect,TRANSPARENCY_PEN,0);
446            sx,sy,0);
429447        if (multi)
430          drawgfx(bitmap,machine->gfx[1],
448          drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
431449            code2,
432450            color,
433451            fx,fy,
434            sx,sy2,
435            cliprect,TRANSPARENCY_PEN,0);
452            sx,sy2,0);
436453   }
437454}
438455
r5077r5078
450467      fx = spriteram[offs+0] & 4;
451468      fy = spriteram[offs+0] & 2;
452469
453       drawgfx(bitmap,machine->gfx[1],
470       drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
454471              code,
455472            0,
456473            fx,fy,
457            sx,sy,
458            cliprect,TRANSPARENCY_PEN,0);
474            sx,sy,0);
459475   }
460476}
461477
r5077r5078
480496VIDEO_UPDATE( prosport )
481497{
482498   int mx,my,tile,offs,gfx_region;
483   int scrollx;
499   int scrollx,scrolly;
484500
485501   bitmap_fill(bitmap,cliprect,0);
486502
487//  popmessage("%d",scrollx);
488
489503   offs = 0;
490//  scrollx = ((deco16_io_ram[0] & 0xf)<<8)+deco16_io_ram[1];
491   scrollx = 0;//((deco16_io_ram[0] & 0x3)<<8)+deco16_io_ram[1];
504   /* TODO: what's bits 0 and 2 for? Internal scrolling state? */
505    scrolly = ((deco16_io_ram[0] & 0x8)<<5);
506   scrollx = ((deco16_io_ram[0] & 0x2)<<7) | (deco16_io_ram[1]);
492507
493   /* TODO: enough for showing something for Pro Bowling, not enough yet for Pro Golf...*/
494   for(mx = 0;mx < 32;mx++)
495   {
496      for(my = 0;my < 16;my++)
497      {
498         tile = (prosport_bg_vram[offs] & 0xf0)>>4;
508   tilemap_set_scrolly(background_tilemap,0,scrolly);
509   tilemap_set_scrollx(background_tilemap,0,-scrollx);
499510
500         if(deco16_io_ram[0]&0x20)
501            tile+=0x20;
511   tilemap_draw(bitmap,cliprect,background_tilemap,0,0);
502512
503         drawgfx(bitmap,screen->machine->gfx[8],
504            tile,0,0,0,256-16*(mx+0)+scrollx,16*(my+0),
505            cliprect,TRANSPARENCY_NONE,0);
506         drawgfx(bitmap,screen->machine->gfx[8],
507            tile,0,0,0,256-16*(mx+0)+scrollx+512,16*(my+0),
508            cliprect,TRANSPARENCY_NONE,0);
509
510         offs++;
511      }
512   }
513
514//  #if 0
515   for(mx = 0;mx < 32;mx++)
516   {
517      for(my = 16;my < 32;my++)
518      {
519         tile = (prosport_bg_vram[offs] & 0xf0)>>4;
520
521         if(deco16_io_ram[4] & 0x80)
522            tile+=0x20;
523
524         drawgfx(bitmap,screen->machine->gfx[8],
525            tile,0,0,0,256-16*(mx+0)+scrollx,16*(my+0),
526            cliprect,TRANSPARENCY_NONE,0);
527         drawgfx(bitmap,screen->machine->gfx[8],
528            tile,0,0,0,256-16*(mx+0)+scrollx+512,16*(my+0),
529            cliprect,TRANSPARENCY_NONE,0);
530
531         offs++;
532      }
533   }
534//  #endif
535
536   //return 0;
537
538513//  popmessage("%d %02x %02x %02x %02x %02x %02x %02x %02x",scrollx,deco16_io_ram[0],deco16_io_ram[1],deco16_io_ram[2],deco16_io_ram[3]
539514//  ,deco16_io_ram[4],deco16_io_ram[5],deco16_io_ram[6],deco16_io_ram[7]);
540515
r5077r5078
550525      my = (offs) % 32;
551526      mx = (offs) / 32;
552527
553      drawgfx(bitmap,screen->machine->gfx[gfx_region],
554            tile,1,0,0,248-8*mx,8*my,
555            cliprect,TRANSPARENCY_PEN,0);
528      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx_region],
529            tile,1,0,0,248-8*mx,8*my,0);
556530   }
557531
558532   prosport_draw_sprites(screen->machine,bitmap,cliprect);
src/mame/video/gunsmoke.c
r5077r5078
175175         flipy = !flipy;
176176      }
177177
178      drawgfx(bitmap, machine->gfx[2], code, color, flipx, flipy,
179         sx, sy, cliprect, TRANSPARENCY_PEN, 0);
178      drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy,
179         sx, sy, 0);
180180   }
181181}
182182
src/mame/video/cvs.c
r5077r5078
235235
236236      int gfxnum = (code < ram_based_char_start_indices[character_banking_mode]) ? 0 : 1;
237237
238      drawgfx(background_bitmap, screen->machine->gfx[gfxnum],
238      drawgfx_opaque(background_bitmap, 0, screen->machine->gfx[gfxnum],
239239            code, color,
240240            0, 0,
241            x, y,
242            0, TRANSPARENCY_NONE, 0);
241            x, y);
243242
244243      /* foreground for collision detection */
245244      if (color & 0x80)
r5077r5078
252251            collision_color = 0x102;
253252      }
254253
255      drawgfx(cvs_collision_background, screen->machine->gfx[gfxnum],
254      drawgfx_opaque(cvs_collision_background, 0, screen->machine->gfx[gfxnum],
256255            code, collision_color,
257256            0, 0,
258            x, y,
259            0, TRANSPARENCY_NONE, 0);
257            x, y);
260258   }
261259
262260
src/mame/video/seta.c
r5077r5078
801801         color   =   ( color >> (16-5) ) % total_color_codes;
802802         code   =   (code & 0x3fff) + (bank * 0x4000);
803803
804         drawgfx(bitmap,machine->gfx[0],
804         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
805805               code,
806806               color,
807807               flipx, flipy,
808               ((sx + 0x10) & 0x1ff) - 0x10,((sy + 8) & 0x0ff) - 8,
809               cliprect,TRANSPARENCY_PEN,0);
808               ((sx + 0x10) & 0x1ff) - 0x10,((sy + 8) & 0x0ff) - 8,0);
810809      }
811810   /* next column */
812811   }
r5077r5078
863862
864863      y = max_y - y;
865864
866      drawgfx(bitmap,machine->gfx[0],
865      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
867866            code,
868867            color,
869868            flipx, flipy,
870            ((x + xoffs + 0x10) & 0x1ff) - 0x10,((y - yoffs + 8) & 0x0ff) - 8,
871            cliprect,TRANSPARENCY_PEN,0);
869            ((x + xoffs + 0x10) & 0x1ff) - 0x10,((y - yoffs + 8) & 0x0ff) - 8,0);
872870   }
873871
874872}
src/mame/video/tnzs.c
r5077r5078
172172         if ((sy == 0) && (code == 0)) sy += 240;
173173      }
174174
175      drawgfx(bitmap,machine->gfx[0],
175      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
176176            code,
177177            color,
178178            flipx,flipy,
179            sx,sy+2,
180            cliprect,TRANSPARENCY_PEN,0);
179            sx,sy+2,0);
181180
182181      /* wrap around x */
183      drawgfx(bitmap,machine->gfx[0],
182      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
184183            code,
185184            color,
186185            flipx,flipy,
187            sx + 512,sy+2,
188            cliprect,TRANSPARENCY_PEN,0);
186            sx + 512,sy+2,0);
189187   }
190188}
191189
src/mame/video/tp84.c
r5077r5078
173173      int flip_x = ~tp84_spriteram[offs + 2] & 0x40;
174174      int flip_y =  tp84_spriteram[offs + 2] & 0x80;
175175
176      drawgfx(bitmap, machine->gfx[1], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PENS,
176      drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flip_x, flip_y, x, y,
177177            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, palette_base));
178178
179179   }
src/mame/video/vball.c
r5077r5078
111111   tilemap_mark_all_tiles_dirty(bg_tilemap);
112112}
113113
114#define DRAW_SPRITE( order, sx, sy ) drawgfx( bitmap, gfx, \
115               (which+order),color,flipx,flipy,sx,sy, \
116               cliprect,TRANSPARENCY_PEN,0);
114#define DRAW_SPRITE( order, sx, sy ) drawgfx_transpen( bitmap, \
115               cliprect,gfx, \
116               (which+order),color,flipx,flipy,sx,sy,0);
117117
118118static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
119119{
src/mame/video/rohga.c
r5077r5078
130130
131131      while (multi >= 0)
132132      {
133         pdrawgfx(bitmap,machine->gfx[3],
133         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
134134               sprite - multi * inc,
135135               colour,
136136               fx,fy,
137137               x,y + mult * multi,
138               cliprect,TRANSPARENCY_PEN,0,pri);
138               priority_bitmap,pri,0);
139139
140140         multi--;
141141      }
r5077r5078
416416
417417      for (x=0; x<w; x++) {
418418         for (y=0; y<h; y++) {
419            deco16_pdrawgfx(machine,
420                  bitmap,machine->gfx[gfxbank],
419            deco16_pdrawgfx(
420                  bitmap,cliprect,machine->gfx[gfxbank],
421421                  sprite + y + h * x,
422422                  colour,
423423                  fx,fy,
424424                  sx + x_mult * (w-x),sy + y_mult * (h-y),
425                  cliprect,0,tilemap_pri,sprite_pri,1,alpha);
425                  0,tilemap_pri,sprite_pri,1,alpha);
426426         }
427427      }
428428
src/mame/video/higemaru.c
r5077r5078
122122         flipy = !flipy;
123123      }
124124
125      drawgfx(bitmap,machine->gfx[1],
125      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
126126            code,
127127            col,
128128            flipx,flipy,
129            sx,sy,
130            cliprect,TRANSPARENCY_PEN,15);
129            sx,sy,15);
131130
132131      /* draw again with wraparound */
133      drawgfx(bitmap,machine->gfx[1],
132      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
134133            code,
135134            col,
136135            flipx,flipy,
137            sx - 256,sy,
138            cliprect,TRANSPARENCY_PEN,15);
136            sx - 256,sy,15);
139137   }
140138}
141139
src/mame/video/nemesis.c
r5077r5078
396396                  flipx = !flipx;
397397                  flipy = !flipy;
398398               }
399               pdrawgfxzoom(bitmap,machine->gfx[char_type],
399               pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[char_type],
400400                  code,
401401                  color,
402402                  flipx,flipy,
403403                  sx,sy,
404                  cliprect,TRANSPARENCY_PEN,0,
405404                  zoom,zoom,
406                  0xffcc );
405                  priority_bitmap,0xffcc,0 );
407406            }
408407         } /* if sprite */
409408      } /* for loop */
src/mame/video/cheekyms.c
r5077r5078
110110}
111111
112112
113static void draw_sprites(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int flip)
113static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int flip)
114114{
115115   offs_t offs;
116116
r5077r5078
130130         if (!flip)
131131            code++;
132132
133         drawgfx(bitmap, gfx[1], code, color, 0, 0, x, y, cliprect, TRANSPARENCY_PEN, 0);
133         drawgfx_transpen(bitmap, cliprect, gfx, code, color, 0, 0, x, y, 0);
134134      }
135135      else
136136      {
137137         if (cheekyms_spriteram[offs + 0] & 0x02)
138138         {
139            drawgfx(bitmap, gfx[1], code | 0x20, color, 0, 0,        x, y, cliprect, TRANSPARENCY_PEN, 0);
140            drawgfx(bitmap, gfx[1], code | 0x21, color, 0, 0, 0x10 + x, y, cliprect, TRANSPARENCY_PEN, 0);
139            drawgfx_transpen(bitmap, cliprect, gfx, code | 0x20, color, 0, 0,        x, y, 0);
140            drawgfx_transpen(bitmap, cliprect, gfx, code | 0x21, color, 0, 0, 0x10 + x, y, 0);
141141         }
142142         else
143143         {
144            drawgfx(bitmap, gfx[1], code | 0x20, color, 0, 0, x,        y, cliprect, TRANSPARENCY_PEN, 0);
145            drawgfx(bitmap, gfx[1], code | 0x21, color, 0, 0, x, 0x10 + y, cliprect, TRANSPARENCY_PEN, 0);
144            drawgfx_transpen(bitmap, cliprect, gfx, code | 0x20, color, 0, 0, x,        y, 0);
145            drawgfx_transpen(bitmap, cliprect, gfx, code | 0x21, color, 0, 0, x, 0x10 + y, 0);
146146         }
147147      }
148148   }
r5077r5078
162162   bitmap_fill(bitmap_buffer, cliprect, 0);
163163
164164   /* sprites go under the playfield */
165   draw_sprites(screen->machine->gfx, bitmap, cliprect, flip);
165   draw_sprites(bitmap, cliprect, screen->machine->gfx[1], flip);
166166
167167   /* draw the tilemap to a temp bitmap */
168168   tilemap_draw(bitmap_buffer, cliprect, cheekyms_tilemap, 0, 0);
src/mame/video/magmax.c
r5077r5078
203203         if (code & 0x80)   /* sprite bankswitch */
204204            code += (*magmax_vreg & 0x30) * 0x8;
205205
206         drawgfx(bitmap, screen->machine->gfx[1],
206         drawgfx_transmask(bitmap, cliprect, screen->machine->gfx[1],
207207               code,
208208               color,
209209               flipx, flipy,
210210               sx, sy,
211               cliprect, TRANSPARENCY_PENS,
212211               colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 0x1f));
213212      }
214213   }
r5077r5078
234233            sy = 31 - sy;
235234         }
236235
237         drawgfx(bitmap, screen->machine->gfx[0],
236         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
238237               code,
239238               0,
240239               flipscreen, flipscreen,
241               8 * sx, 8 * sy,
242               cliprect, TRANSPARENCY_PEN, 0x0f);
240               8 * sx, 8 * sy, 0x0f);
243241      }
244242   }
245243   return 0;
src/mame/video/timelimt.c
r5077r5078
129129      code += ( attr & 0x80 ) ? 0x40 : 0x00;
130130      code += ( attr & 0x40 ) ? 0x80 : 0x00;
131131
132      drawgfx( bitmap, machine->gfx[2],
132      drawgfx_transpen( bitmap, cliprect,machine->gfx[2],
133133            code,
134134            attr & 7,
135135            flipx,flipy,
136            sx,sy,
137            cliprect,TRANSPARENCY_PEN,0);
136            sx,sy,0);
138137   }
139138}
140139
src/mame/video/warriorb.c
r5077r5078
8888      if (x>0x3c0) x -= 0x400;
8989      if (y>0x180) y -= 0x200;
9090
91      pdrawgfx(bitmap,machine->gfx[0],
91      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0],
9292               tilenum,
9393             color,
9494             flipx,flipy,
9595             x,y,
96             cliprect,TRANSPARENCY_PEN,0,pri_mask);
96             priority_bitmap,pri_mask,0);
9797   }
9898
9999#ifdef MAME_DEBUG
src/mame/video/sei_crtc.c
r5077r5078
235235      for (ax=0; ax<dx; ax++)
236236         for (ay=0; ay<dy; ay++) {
237237            if (!fx)
238               drawgfx(bitmap,machine->gfx[0],
238               drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
239239                  sprite++,
240                  color,fx,fy,x+ax*16,y+ay*16,
241                  cliprect,TRANSPARENCY_PEN,15);
240                  color,fx,fy,x+ax*16,y+ay*16,15);
242241            else
243               drawgfx(bitmap,machine->gfx[0],
242               drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
244243                  sprite++,
245                  color,fx,fy,x+(dx-1-ax)*16,y+ay*16,
246                  cliprect,TRANSPARENCY_PEN,15);
244                  color,fx,fy,x+(dx-1-ax)*16,y+ay*16,15);
247245         }
248246   }
249247}
src/mame/video/goal92.c
r5077r5078
125125
126126      y = 256-(y+7);
127127
128      drawgfx(bitmap,machine->gfx[0],
128      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
129129            sprite,
130            color,fx,fy,x,y,
131            cliprect,TRANSPARENCY_PEN,15);
130            color,fx,fy,x,y,15);
132131   }
133132}
134133
src/mame/video/deco16ic.c
r5077r5078
835835}
836836
837837/* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */
838void deco16_pdrawgfx(running_machine *machine,
839      bitmap_t *dest,const gfx_element *gfx,
838void deco16_pdrawgfx(
839      bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
840840      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
841      const rectangle *clip,int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha)
841      int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha)
842842{
843843   int ox,oy,cx,cy;
844844   int x_index,y_index,x,y;
845845
846   const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
846   const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
847847   const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
848848
849849   /* check bounds */
src/mame/video/1942.c
r5077r5078
226226
227227      do
228228      {
229         drawgfx(bitmap,machine->gfx[2],
229         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
230230               code + i,col,
231231               flip_screen_get(machine),flip_screen_get(machine),
232               sx,sy + 16 * i * dir,
233               cliprect,TRANSPARENCY_PEN,15);
232               sx,sy + 16 * i * dir,15);
234233
235234         i--;
236235      } while (i >= 0);
src/mame/video/poolshrk.c
r5077r5078
4444      int hpos = poolshrk_hpos_ram[i];
4545      int vpos = poolshrk_vpos_ram[i];
4646
47      drawgfx(bitmap, screen->machine->gfx[0], i, (i == 0) ? 0 : 1, 0, 0,
48         248 - hpos, vpos - 15, cliprect, TRANSPARENCY_PEN, 0);
47      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], i, (i == 0) ? 0 : 1, 0, 0,
48         248 - hpos, vpos - 15, 0);
4949   }
5050
5151   /* draw playfield */
src/mame/video/bloodbro.c
r5077r5078
170170      {
171171         for (y = 0;y <= height;y++)
172172         {
173            pdrawgfx(bitmap,machine->gfx[3],
173            pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
174174                  tile_number++,
175175                  color,
176176                  flipx,flipy,
177177                  flipx ? (sx + 16*(width-x)) : (sx + 16*x),flipy ? (sy + 16*(height-y)) : (sy + 16*y),
178                  cliprect,TRANSPARENCY_PEN,15,
179                  pri_mask);
178                  priority_bitmap,
179                  pri_mask,15);
180180         }
181181      }
182182   }
r5077r5078
214214      /* Remap code 0x800 <-> 0x1000 */
215215      code = (code&0x7ff) | ((code&0x800)<<1) | ((code&0x1000)>>1);
216216
217      pdrawgfx(bitmap,machine->gfx[3],
217      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
218218            code,
219219            color,
220220            flipx,flipy,
221221            sx,sy,
222            cliprect,TRANSPARENCY_PEN,15,
223            pri_mask);
222            priority_bitmap,
223            pri_mask,15);
224224   }
225225}
226226
src/mame/video/raiden.c
r5077r5078
137137         if (fy) fy=0; else fy=1;
138138      }
139139
140      drawgfx(bitmap,machine->gfx[3],
140      drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
141141            sprite,
142            color,fx,fy,x,y,
143            cliprect,TRANSPARENCY_PEN,15);
142            color,fx,fy,x,y,15);
144143   }
145144}
146145
src/mame/video/bombjack.c
r5077r5078
122122         flipy = !flipy;
123123      }
124124
125      drawgfx(bitmap,machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2],
125      drawgfx_transpen(bitmap,cliprect,machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2],
126126            spriteram[offs] & 0x7f,
127127            spriteram[offs+1] & 0x0f,
128128            flipx,flipy,
129            sx,sy,
130            cliprect,TRANSPARENCY_PEN,0);
129            sx,sy,0);
131130   }
132131}
133132
src/mame/video/rallyx.c
r5077r5078
543543      int flipy = spriteram[offs] & 2;
544544      if (flip_screen_get(machine)) sx -= 2*displacement;
545545
546      pdrawgfx(bitmap,machine->gfx[1],
546      pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1],
547547            (spriteram[offs] & 0xfc) >> 2,
548548            color,
549549            flipx,flipy,
550550            sx,sy,
551            cliprect,TRANSPARENCY_PENS,
552            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0),
553            0x02);
551            priority_bitmap,0x02,
552            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
554553   }
555554}
556555
r5077r5078
565564      int color = spriteram_2[offs + 1] & 0x3f;
566565      int flip = spriteram[offs] & 2;
567566
568      pdrawgfx(bitmap,machine->gfx[1],
567      pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1],
569568            ((spriteram[offs] & 0x7c) >> 2) + 0x20*(spriteram[offs] & 0x01) + ((spriteram[offs] & 0x80) >> 1),
570569            color,
571570            flip,flip,
572571            sx,sy,
573            cliprect,TRANSPARENCY_PENS,
574            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0),
575            0x02);
572            priority_bitmap,0x02,
573            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
576574   }
577575}
578576
src/mame/video/unico.c
r5077r5078
258258
259259      for (x = startx ; x != endx ; x += incx)
260260      {
261         pdrawgfx(   bitmap, machine->gfx[0],
261         pdrawgfx_transpen(   bitmap, cliprect, machine->gfx[0],
262262                  code++,
263263                  attr & 0x1f,
264264                  flipx, flipy,
265265                  x, sy,
266                  cliprect, TRANSPARENCY_PEN,0x00,
267                  pri_mask   );
266                  priority_bitmap,
267                  pri_mask,0x00   );
268268      }
269269   }
270270}
r5077r5078
311311
312312      for (x = startx ; x != endx ; x += incx)
313313      {
314         pdrawgfx(   bitmap, machine->gfx[0],
314         pdrawgfx_transpen(   bitmap, cliprect, machine->gfx[0],
315315                  code++,
316316                  attr & 0x1f,
317317                  flipx, flipy,
318318                  x, sy,
319                  cliprect, TRANSPARENCY_PEN,0x00,
320                  pri_mask   );
319                  priority_bitmap,
320                  pri_mask,0x00   );
321321      }
322322   }
323323}
src/mame/video/gcpinbal.c
r5077r5078
231231
232232         for (chain_pos = chain;chain_pos >= 0;chain_pos--)
233233         {
234            pdrawgfx(bitmap, machine->gfx[0],
234            pdrawgfx_transpen(bitmap, cliprect,machine->gfx[0],
235235                  code,
236236                  col,
237237                  flipx, flipy,
238238                  curx,cury,
239                  cliprect,TRANSPARENCY_PEN,0,
240                  priority ? 0xfc : 0xf0);
239                  priority_bitmap,
240                  priority ? 0xfc : 0xf0,0);
241241
242242            code++;
243243
src/mame/video/realbrk.c
r5077r5078
299299            {
300300               bitmap_fill( tmpbitmap0, &spritetile_clip , 0);
301301               bitmap_fill( tmpbitmap1, &spritetile_clip , 0);
302               drawgfxzoom(   tmpbitmap0,machine->gfx[gfx],
302               drawgfxzoom_transpen(   tmpbitmap0,&spritetile_clip,machine->gfx[gfx],
303303                           code++,
304304                           color,
305305                           flipx, flipy,
306306                           0,0,
307                           &spritetile_clip,TRANSPARENCY_PEN,0,
308                           (rot & 1 ? scaley : scalex) << 12, (rot & 1 ? scalex : scaley) << 12);
307                           (rot & 1 ? scaley : scalex) << 12, (rot & 1 ? scalex : scaley) << 12,0);
309308
310309               // peek at the unrotated sprite
311310               // copybitmap_trans( bitmap,tmpbitmap0, 0,0, 50+(x * xdim/0x10000),50+(y * ydim/0x10000), cliprect, 0 );
r5077r5078
362361                  break;
363362
364363               default:
365                  drawgfxzoom(   bitmap,machine->gfx[gfx],
364                  drawgfxzoom_transpen(   bitmap,cliprect,machine->gfx[gfx],
366365                              code++,
367366                              color,
368367                              flipx, flipy,
369368                              currx, curry,
370                              cliprect,TRANSPARENCY_PEN,0,
371                              scalex << 12, scaley << 12);
369                              scalex << 12, scaley << 12,0);
372370                  break;
373371            }
374372
r5077r5078
443441            int scalex = (sx + (x + 1) * xdim) / 0x10000 - currx;
444442            int scaley = (sy + (y + 1) * ydim) / 0x10000 - curry;
445443
446            drawgfxzoom(   bitmap,machine->gfx[gfx],
444            drawgfxzoom_transpen(   bitmap,cliprect,machine->gfx[gfx],
447445                        code++,
448446                        color,
449447                        flipx, flipy,
450448                        currx, curry,
451                        cliprect,TRANSPARENCY_PEN,0,
452                        scalex << 12, scaley << 12);
449                        scalex << 12, scaley << 12,0);
453450         }
454451      }
455452   }
src/mame/video/carjmbre.c
r5077r5078
133133               flipy = !flipy;
134134            }
135135
136            drawgfx(bitmap,screen->machine->gfx[1],
136            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
137137                  spriteram[troffs+1],
138138                  spriteram[troffs+2]&0x07,
139139                  flipx,flipy,
140                  sx,sy,
141                  cliprect,TRANSPARENCY_PEN,0);
140                  sx,sy,0);
142141         }
143142      }
144143   }
src/mame/video/superchs.c
r5077r5078
176176            }
177177            else
178178            {
179               drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
179               drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
180180                     sprite_ptr->code,
181181                     sprite_ptr->color,
182182                     sprite_ptr->flipx,sprite_ptr->flipy,
183183                     sprite_ptr->x,sprite_ptr->y,
184                     cliprect,TRANSPARENCY_PEN,0,
185                     sprite_ptr->zoomx,sprite_ptr->zoomy);
184                     sprite_ptr->zoomx,sprite_ptr->zoomy,0);
186185            }
187186         }
188187      }
r5077r5078
196195   {
197196      sprite_ptr--;
198197
199      pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
198      pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
200199            sprite_ptr->code,
201200            sprite_ptr->color,
202201            sprite_ptr->flipx,sprite_ptr->flipy,
203202            sprite_ptr->x,sprite_ptr->y,
204            cliprect,TRANSPARENCY_PEN,0,
205203            sprite_ptr->zoomx,sprite_ptr->zoomy,
206            sprite_ptr->primask);
204            priority_bitmap,sprite_ptr->primask,0);
207205   }
208206}
209207
src/mame/video/flower.c
r5077r5078
106106            if (xblock) sxoffs+=xblocksizeinpixels;
107107            if (yblock) syoffs+=yblocksizeinpixels;
108108
109            drawgfxzoom(bitmap,gfx,
109            drawgfxzoom_transpen(bitmap,cliprect,gfx,
110110                  code+yoffs+xoffs,
111111                  color,
112112                  flipx,flipy,
113113                  sx+sxoffs,sy+syoffs,
114                  cliprect,TRANSPARENCY_PEN,15,
115                  zoomx,zoomy);
114                  zoomx,zoomy,15);
116115         }
117116      }
118117      source -= 8;
src/mame/video/battlera.c
r5077r5078
285285      if (fy) { my += 16*(cgy-1); yinc = -16; } /* Swap tile order on Y flips */
286286
287287      for (i=0; i<cgy; i++) {
288         drawgfx(bitmap,machine->gfx[1],
288         drawgfx_transpen(bitmap,clip,machine->gfx[1],
289289            code,
290290            colour,
291291            fx,fy,
292            mx,my,
293            clip,TRANSPARENCY_PEN,0);
292            mx,my,0);
294293
295294         if (cgx)
296            drawgfx(bitmap,machine->gfx[1],
295            drawgfx_transpen(bitmap,clip,machine->gfx[1],
297296                  code2,
298297                  colour,
299298                  fx,fy,
300                  mx+16,my,
301                  clip,TRANSPARENCY_PEN,0);
299                  mx+16,my,0);
302300         my += yinc;
303301         /* if (cgx) */ /* Different from console? */
304302         code += 2;
r5077r5078
333331      /* If this tile was changed OR tilemap was changed, redraw */
334332      if (vram_dirty[offs/2]) {
335333         vram_dirty[offs/2]=0;
336           drawgfx(tile_bitmap,screen->machine->gfx[0],
334           drawgfx_opaque(tile_bitmap,0,screen->machine->gfx[0],
337335               code,
338336               HuC6270_vram[offs] >> 4,
339337               0,0,
340               8*mx,8*my,
341               0,TRANSPARENCY_NONE,0);
342         drawgfx(front_bitmap,screen->machine->gfx[2],
338               8*mx,8*my);
339         drawgfx_opaque(front_bitmap,0,screen->machine->gfx[2],
343340               0,
344341               0,   /* fill the spot with pen 256 */
345342               0,0,
346               8*mx,8*my,
347               0,TRANSPARENCY_NONE,0);
348           drawgfx(front_bitmap,screen->machine->gfx[0],
343               8*mx,8*my);
344           drawgfx_transmask(front_bitmap,0,screen->machine->gfx[0],
349345               code,
350346               HuC6270_vram[offs] >> 4,
351347               0,0,
352               8*mx,8*my,
353               0,TRANSPARENCY_PENS,0x1);
348               8*mx,8*my,0x1);
354349         }
355350   }
356351
src/mame/video/xain.c
r5077r5078
195195
196196      if (attr & 0x80)   /* double height */
197197      {
198         drawgfx(bitmap,machine->gfx[3],
198         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
199199               numtile,
200200               color,
201201               flipx,flipy,
202               sx,flipy ? sy+16:sy-16,
203               cliprect,TRANSPARENCY_PEN,0);
204         drawgfx(bitmap,machine->gfx[3],
202               sx,flipy ? sy+16:sy-16,0);
203         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
205204               numtile+1,
206205               color,
207206               flipx,flipy,
208               sx,sy,
209               cliprect,TRANSPARENCY_PEN,0);
207               sx,sy,0);
210208      }
211209      else
212210      {
213         drawgfx(bitmap,machine->gfx[3],
211         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
214212               numtile,
215213               color,
216214               flipx,flipy,
217               sx,sy,
218               cliprect,TRANSPARENCY_PEN,0);
215               sx,sy,0);
219216      }
220217   }
221218}
src/mame/video/mrdo.c
r5077r5078
241241   {
242242      if (spriteram[offs + 1] != 0)
243243      {
244         drawgfx(bitmap,machine->gfx[2],
244         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
245245               spriteram[offs],spriteram[offs + 2] & 0x0f,
246246               spriteram[offs + 2] & 0x10,spriteram[offs + 2] & 0x20,
247               spriteram[offs + 3],256 - spriteram[offs + 1],
248               cliprect,TRANSPARENCY_PEN,0);
247               spriteram[offs + 3],256 - spriteram[offs + 1],0);
249248      }
250249   }
251250}
src/mame/video/m62.c
r5077r5078
389389
390390         do
391391         {
392            drawgfx(bitmap,machine->gfx[1],
392            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
393393                  code + i * incr,col,
394394                  flipx,flipy,
395                  sx,sy + 16 * i,
396                  cliprect,TRANSPARENCY_PEN,0);
395                  sx,sy + 16 * i,0);
397396
398397            i--;
399398         } while (i >= 0);
src/mame/video/megazone.c
r5077r5078
135135         flipy = !flipy;
136136      }
137137
138      drawgfx(tmpbitmap,screen->machine->gfx[1],
138      drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[1],
139139            ((int)videoram[offs]) + ((colorram[offs] & (1<<7) ? 256 : 0) ),
140140            (colorram[offs] & 0x0f) + 0x10,
141141            flipx,flipy,
142            8*sx,8*sy,
143            0,TRANSPARENCY_NONE,0);
142            8*sx,8*sy);
144143   }
145144
146145   /* copy the temporary bitmap to the screen */
r5077r5078
182181         else
183182            sx = sx + 32;
184183
185         drawgfx(bitmap,screen->machine->gfx[0],
184         drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[0],
186185               spriteram[offs + 2],
187186               color,
188187               flipx,flipy,
189188               sx,sy,
190               cliprect,TRANSPARENCY_PENS,
191189               colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[0], color, 0));
192190      }
193191   }
r5077r5078
216214
217215
218216
219         drawgfx(bitmap,screen->machine->gfx[1],
217         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1],
220218               ((int)megazone_videoram2[offs]) + ((megazone_colorram2[offs] & (1<<7) ? 256 : 0) ),
221219               (megazone_colorram2[offs] & 0x0f) + 0x10,
222220               flipx,flipy,
223               8*sx,8*sy,
224               cliprect,TRANSPARENCY_NONE,0);
221               8*sx,8*sy);
225222         offs++;
226223      }
227224   }
src/mame/video/toki.c
r5077r5078
208208            flipy=1;
209209         }
210210
211         drawgfx (bitmap,machine->gfx[1],
211         drawgfx_transpen (bitmap,cliprect,machine->gfx[1],
212212               tile,
213213               color,
214214               flipx,flipy,
215               x,y,
216               cliprect,TRANSPARENCY_PEN,15);
215               x,y,15);
217216      }
218217   }
219218}
r5077r5078
247246         tile    = sprite_word[1] & 0x1fff;
248247         color   = sprite_word[2] >> 12;
249248
250         drawgfx (bitmap,machine->gfx[1],
249         drawgfx_transpen (bitmap,cliprect,machine->gfx[1],
251250               tile,
252251               color,
253252               flipx,0,
254               x,y-1,
255               cliprect,TRANSPARENCY_PEN,15);
253               x,y-1,15);
256254      }
257255   }
258256}
src/mame/video/40love.c
r5077r5078
303303      if (spriteram[offs+2] & 0xe0)
304304         color = mame_rand(machine)&0xf;
305305
306      drawgfx(bitmap,machine->gfx[1],
306      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
307307            code,
308308            color,
309309            flipx,flipy,
310            sx+fortyl_xoffset,sy,
311            cliprect,TRANSPARENCY_PEN,0);
310            sx+fortyl_xoffset,sy,0);
312311   }
313312
314313   /* spriteram #2 */
r5077r5078
332331      if (spriteram_2[offs+2] & 0xe0)
333332         color = mame_rand(machine)&0xf;
334333
335      drawgfx(bitmap,machine->gfx[1],
334      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
336335            code,
337336            color,
338337            flipx,flipy,
339            sx+fortyl_xoffset,sy,
340            cliprect,TRANSPARENCY_PEN,0);
338            sx+fortyl_xoffset,sy,0);
341339   }
342340}
343341
src/mame/video/renegade.c
r5077r5078
104104         if (attributes & 0x80) /* big sprite */
105105         {
106106            sprite_number &= ~1;
107            drawgfx(bitmap, machine->gfx[sprite_bank],
107            drawgfx_transpen(bitmap, cliprect, machine->gfx[sprite_bank],
108108               sprite_number + 1,
109109               color,
110110               xflip, flip_screen_get(machine),
111               sx, sy + (flip_screen_get(machine) ? -16 : 16),
112               cliprect, TRANSPARENCY_PEN, 0);
111               sx, sy + (flip_screen_get(machine) ? -16 : 16), 0);
113112         }
114113         else
115114         {
116115            sy += (flip_screen_get(machine) ? -16 : 16);
117116         }
118         drawgfx(bitmap, machine->gfx[sprite_bank],
117         drawgfx_transpen(bitmap, cliprect, machine->gfx[sprite_bank],
119118            sprite_number,
120119            color,
121120            xflip, flip_screen_get(machine),
122            sx, sy,
123            cliprect, TRANSPARENCY_PEN, 0);
121            sx, sy, 0);
124122      }
125123      source += 4;
126124   }
src/mame/video/galaga.c
r5077r5078
530530      {
531531         for (x = 0;x <= sizex;x++)
532532         {
533            drawgfx(bitmap,machine->gfx[1],
533            drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
534534               sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
535535               color,
536536               flipx,flipy,
537537               sx + 16*x, sy + 16*y,
538               cliprect,TRANSPARENCY_PENS,
539538               colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x0f));
540539         }
541540      }
src/mame/video/lasso.c
r5077r5078
328328      color = source[2] & 0x0f;
329329
330330
331        drawgfx(bitmap, machine->gfx[1],
331        drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
332332            code | ((UINT16)gfxbank << 6),
333333            color,
334334            flipx, flipy,
335            sx,sy,
336            cliprect, TRANSPARENCY_PEN,0);
335            sx,sy,0);
337336
338337      source += inc;
339338    }
src/mame/video/taito_h.c
r5077r5078
164164                     flipy ^= 0x0080;
165165                  }
166166
167                  drawgfxzoom( bitmap, machine -> gfx[0],
167                  drawgfxzoom_transpen( bitmap, cliprect,
168                         machine -> gfx[0],
168169                         tile,
169170                         color,
170171                         flipx, flipy,
171172                         x, y,
172                         cliprect,
173                         TRANSPARENCY_PEN, 0,
174                         zx, zx
173                         zx, zx, 0
175174                  );
176175               }
177176               tile_offs ++;
r5077r5078
276275                     flipy ^= 0x0080;
277276                  }
278277
279                  drawgfxzoom( bitmap, machine -> gfx[0],
278                  drawgfxzoom_transpen( bitmap, cliprect,
279                         machine -> gfx[0],
280280                         tile,
281281                         color,
282282                         flipx, flipy,
283283                         x, y,
284                         cliprect,
285                         TRANSPARENCY_PEN, 0,
286                         zx, zy
284                         zx, zy, 0
287285                  );
288286               }
289287               tile_offs ++;
r5077r5078
377375                        flipy ^= 0x0080;
378376                     }
379377
380                     drawgfxzoom( bitmap, machine -> gfx[0],
378                     drawgfxzoom_transpen( bitmap, cliprect,
379                            machine -> gfx[0],
381380                            tile,
382381                            color,
383382                            flipx, flipy,
384383                            x, y,
385                            cliprect,
386                            TRANSPARENCY_PEN, 0,
387                            zx, zx
384                            zx, zx, 0
388385                     );
389386                  }
390387                  tile_offs ++;
src/mame/video/psychic5.c
r5077r5078
320320  Screen refresh
321321***************************************************************************/
322322
323#define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(machine, bitmap, machine->gfx[0], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 15);
323#define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(bitmap, cliprect, machine->gfx[0], code, color, flipx, flipy, sx, sy, TRANSPARENCY_PEN, 15);
324324
325325static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
326326{
src/mame/video/8080bw.c
r5077r5078
4141}
4242
4343
44void lupin3_flip_screen_w(const address_space *space, int data)
45{
46   color_map = data & 0x40;
47   c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine, "IN2") & 0x04);
48}
49
50
4451void c8080bw_screen_red_w(int data)
4552{
4653   screen_red = data;
src/mame/video/othunder.c
r5077r5078
184184         }
185185         else
186186         {
187            drawgfxzoom(bitmap,machine->gfx[0],
187            drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
188188                  sprite_ptr->code,
189189                  sprite_ptr->color,
190190                  sprite_ptr->flipx,sprite_ptr->flipy,
191191                  sprite_ptr->x,sprite_ptr->y,
192                  cliprect,TRANSPARENCY_PEN,0,
193                  sprite_ptr->zoomx,sprite_ptr->zoomy);
192                  sprite_ptr->zoomx,sprite_ptr->zoomy,0);
194193         }
195194      }
196195
r5077r5078
203202   {
204203      sprite_ptr--;
205204
206      pdrawgfxzoom(bitmap,machine->gfx[0],
205      pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
207206            sprite_ptr->code,
208207            sprite_ptr->color,
209208            sprite_ptr->flipx,sprite_ptr->flipy,
210209            sprite_ptr->x,sprite_ptr->y,
211            cliprect,TRANSPARENCY_PEN,0,
212210            sprite_ptr->zoomx,sprite_ptr->zoomy,
213            sprite_ptr->primask);
211            priority_bitmap,sprite_ptr->primask,0);
214212   }
215213}
216214
src/mame/video/ginganin.c
r5077r5078
233233         flipx = !flipx;    flipy = !flipy;
234234      }
235235
236      drawgfx(bitmap,machine->gfx[3],
236      drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
237237            code & 0x3fff,
238238            attr >> 12,
239239            flipx, flipy,
240            x,y,
241            cliprect,TRANSPARENCY_PEN,15);
240            x,y,15);
242241
243242   }
244243}
src/mame/video/tail2nos.c
r5077r5078
145145      flipx = spriteram16[offs + 2] & 0x1000;
146146      flipy = spriteram16[offs + 2] & 0x0800;
147147
148      drawgfx(bitmap,machine->gfx[1],
148      drawgfx_transpen(bitmap,/* placement relative to zoom layer verified on the real thing */
149            cliprect,machine->gfx[1],
149150            code,
150151            40 + color,
151152            flipx,flipy,
152            sx+3,sy+1,   /* placement relative to zoom layer verified on the real thing */
153            cliprect,TRANSPARENCY_PEN,15);
153            sx+3,sy+1,15);
154154   }
155155}
156156
src/mame/video/mrjong.c
r5077r5078
130130         flipy = !flipy;
131131      }
132132
133      drawgfx(bitmap, machine->gfx[1],
133      drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
134134            sprt,
135135            color,
136136            flipx, flipy,
137            sx, sy,
138            cliprect, TRANSPARENCY_PEN, 0);
137            sx, sy, 0);
139138   }
140139}
141140
src/mame/video/quasar.c
r5077r5078
139139
140140      /* Main Screen */
141141
142      drawgfx(bitmap,screen->machine->gfx[0],
142      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
143143            code,
144144            cvs_color_ram[offs] & 0x3f,
145145            0,0,
146            x,y,
147            cliprect,TRANSPARENCY_PEN,0);
146            x,y,0);
148147
149148
150149      /* background for Collision Detection (it can only hit certain items) */
151150
152151      if((cvs_color_ram[offs] & 7) == 0)
153152      {
154         drawgfx(cvs_collision_background,screen->machine->gfx[0],
153         drawgfx_opaque(cvs_collision_background,cliprect,screen->machine->gfx[0],
155154               code,
156155               64,
157156               0,0,
158               x,y,
159               cliprect,TRANSPARENCY_NONE,0);
157               x,y);
160158      }
161159   }
162160
src/mame/video/slapshot.c
r5077r5078
410410         }
411411         else
412412         {
413            drawgfxzoom(bitmap,machine->gfx[0],
413            drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
414414                  sprite_ptr->code,
415415                  sprite_ptr->color,
416416                  sprite_ptr->flipx,sprite_ptr->flipy,
417417                  sprite_ptr->x,sprite_ptr->y,
418                  cliprect,TRANSPARENCY_PEN,0,
419                  sprite_ptr->zoomx,sprite_ptr->zoomy);
418                  sprite_ptr->zoomx,sprite_ptr->zoomy,0);
420419         }
421420      }
422421   }
r5077r5078
427426   {
428427      sprite_ptr--;
429428
430      pdrawgfxzoom(bitmap,machine->gfx[0],
429      pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
431430            sprite_ptr->code,
432431            sprite_ptr->color,
433432            sprite_ptr->flipx,sprite_ptr->flipy,
434433            sprite_ptr->x,sprite_ptr->y,
435            cliprect,TRANSPARENCY_PEN,0,
436434            sprite_ptr->zoomx,sprite_ptr->zoomy,
437            sprite_ptr->primask);
435            priority_bitmap,sprite_ptr->primask,0);
438436   }
439437}
440438
src/mame/video/1943.c
r5077r5078
250250      {
251251         if (color != 0x0a && color != 0x0b)
252252         {
253            drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine),
254               sx, sy, cliprect, TRANSPARENCY_PEN, 0);
253            drawgfx_transpen(bitmap, cliprect, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine),
254               sx, sy, 0);
255255         }
256256      }
257257      else
258258      {
259259         if (color == 0x0a || color == 0x0b)
260260         {
261            drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine),
262               sx, sy, cliprect, TRANSPARENCY_PEN, 0);
261            drawgfx_transpen(bitmap, cliprect, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine),
262               sx, sy, 0);
263263         }
264264      }
265265   }
src/mame/video/cninja.c
r5077r5078
205205
206206      while (multi >= 0)
207207      {
208         pdrawgfx(bitmap,machine->gfx[3],
208         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
209209               sprite - multi * inc,
210210               colour,
211211               fx,fy,
212212               x,y + mult * multi,
213               cliprect,TRANSPARENCY_PEN,0,pri);
213               priority_bitmap,pri,0);
214214
215215         multi--;
216216      }
r5077r5078
273273
274274      while (multi >= 0)
275275      {
276         pdrawgfx(bitmap,machine->gfx[3],
276         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
277277               sprite - multi * inc,
278278               colour,
279279               fx,fy,
280280               x,y + mult * multi,
281               cliprect,TRANSPARENCY_PEN,0,pri);
281               priority_bitmap,pri,0);
282282
283283         multi--;
284284      }
src/mame/video/pacland.c
r5077r5078
323323         for (x = 0;x <= sizex;x++)
324324         {
325325            if (whichmask != 0)
326               drawgfx(bitmap,machine->gfx[2],
326               drawgfx_transmask(bitmap,cliprect,machine->gfx[2],
327327                  sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
328328                  color,
329329                  flipx,flipy,
330                  sx + 16*x,sy + 16*y,
331                  cliprect,TRANSPARENCY_PENS,transmask[whichmask][color]);
330                  sx + 16*x,sy + 16*y,transmask[whichmask][color]);
332331            else
333               pdrawgfx(bitmap,machine->gfx[2],
332               pdrawgfx_transmask(bitmap,cliprect,machine->gfx[2],
334333                  sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
335334                  color,
336335                  flipx,flipy,
337336                  sx + 16*x,sy + 16*y,
338                  cliprect,TRANSPARENCY_PENS,transmask[whichmask][color],0);
337                  priority_bitmap,0,transmask[whichmask][color]);
339338         }
340339      }
341340   }
src/mame/video/psikyo4.c
r5077r5078
112112
113113         for (j = ystart; j != yend; j += yinc) {
114114            for (i = xstart; i != xend; i += xinc) {
115               drawgfx(bitmap,gfx,tnum+loopnum,colr,flipx,flipy,xpos+16*i,ypos+16*j,cliprect,TRANSPARENCY_PEN,0);
115               drawgfx_transpen(bitmap,cliprect,gfx,tnum+loopnum,colr,flipx,flipy,xpos+16*i,ypos+16*j,0);
116116               loopnum++;
117117            }
118118         }
src/mame/video/rollrace.c
r5077r5078
8787         if(ra_flipy)
8888            sy = 31-sy ;
8989
90         drawgfx(bitmap,
91            screen->machine->gfx[RA_BGCHAR_BASE],
90         drawgfx_transpen(bitmap,
91            cliprect,screen->machine->gfx[RA_BGCHAR_BASE],
9292            mem[offs + ( ra_bkgpage * 1024 )]
9393            + ((( mem[offs + 0x4000 + ( ra_bkgpage * 1024 )] & 0xc0 ) >> 6 ) * 256 ) ,
9494            ra_bkgcol,
9595            ra_flipx,(ra_bkgflip^ra_flipy),
96            sx*8,sy*8,
97            cliprect,TRANSPARENCY_PEN,0);
96            sx*8,sy*8,0);
9897
9998
10099      }
r5077r5078
127126      if(bank)
128127         bank += ra_spritebank;
129128
130      drawgfx(bitmap, screen->machine->gfx[ RA_SP_BASE + bank ],
129      drawgfx_transpen(bitmap, cliprect,screen->machine->gfx[ RA_SP_BASE + bank ],
131130         spriteram[offs+1] & 0x3f ,
132131         spriteram[offs+2] & 0x1f,
133132         ra_flipx,!(s_flipy^ra_flipy),
134         sx,sy,
135         cliprect,TRANSPARENCY_PEN,0);
133         sx,sy,0);
136134      }
137135   }
138136
r5077r5078
156154
157155      if (ra_flipx) sx = 31 - sx;
158156
159      drawgfx(bitmap,screen->machine->gfx[RA_FGCHAR_BASE + ra_chrbank]  ,
157      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[RA_FGCHAR_BASE + ra_chrbank]  ,
160158         videoram[ offs ]  ,
161159         col,
162160         ra_flipx,ra_flipy,
163         8*sx,scroll,
164         cliprect,TRANSPARENCY_PEN,0);
161         8*sx,scroll,0);
165162
166163   }
167164
src/mame/video/ddrible.c
r5077r5078
230230               ex = flipx ? (width-1-x) : x;
231231               ey = flipy ? (height-1-y) : y;
232232
233               drawgfx(bitmap,gfx,
233               drawgfx_transpen(bitmap,cliprect,
234                  gfx,
234235                  (number)+x_offset[ex]+y_offset[ey],
235236                  color,
236237                  flipx, flipy,
237                  sx+x*16,sy+y*16,
238                  cliprect,
239                  TRANSPARENCY_PEN, 0);
238                  sx+x*16,sy+y*16, 0);
240239            }
241240         }
242241      }
src/mame/video/popper.c
r5077r5078
226226            flipy = !flipy;
227227         }
228228
229         drawgfx(bitmap,machine->gfx[1],
229         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
230230               popper_spriteram[offs+1],
231231               (popper_spriteram[offs+2]&0x0f),
232232               flipx,flipy,
233               sx,sy,
234               cliprect,TRANSPARENCY_PEN,0);
233               sx,sy,0);
235234      }
236235   }
237236}
src/mame/video/sidearms.c
r5077r5078
194194         y = (30 * 8) - y;
195195      }
196196
197      drawgfx(bitmap, gfx,
197      drawgfx_transpen(bitmap, cliprect,
198         gfx,
198199         code, color,
199200         flipx, flipy,
200         x, y,
201         cliprect,
202         TRANSPARENCY_PEN, 15);
201         x, y, 15);
203202   }
204203}
205204
src/mame/video/ladyfrog.c
r5077r5078
112112         sy = 240-ladyfrog_spriteram[offs+0];
113113         flipx = ((ladyfrog_spriteram[offs+1]&0x40)>>6);
114114         flipy = ((ladyfrog_spriteram[offs+1]&0x80)>>7);
115         drawgfx(bitmap,machine->gfx[1],
115         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
116116               code,
117117               pal,
118118               flipx,flipy,
119               sx,sy,
120               cliprect,TRANSPARENCY_PEN,15);
119               sx,sy,15);
121120
122121         if(ladyfrog_spriteram[offs+3]>240)
123122         {
124123            sx = (ladyfrog_spriteram[offs+3]-256);
125            drawgfx(bitmap,machine->gfx[1],
124            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
126125                    code,
127126                    pal,
128127                    flipx,flipy,
129                     sx,sy,
130                     cliprect,TRANSPARENCY_PEN,15);
128                     sx,sy,15);
131129               }
132130            }
133131      }
src/mame/video/tumblep.c
r5077r5078
6868
6969      while (multi >= 0)
7070      {
71         drawgfx(bitmap,machine->gfx[2],
71         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
7272               sprite - multi * inc,
7373               colour,
7474               fx,fy,
75               x,y + mult * multi,
76               cliprect,TRANSPARENCY_PEN,0);
75               x,y + mult * multi,0);
7776
7877         multi--;
7978      }
src/mame/video/jack.c
r5077r5078
8383         flipy = !flipy;
8484      }
8585
86      drawgfx(bitmap,machine->gfx[0],
86      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
8787            num,
8888            color,
8989            flipx,flipy,
90            sx,sy,
91            cliprect,TRANSPARENCY_PEN,0);
90            sx,sy,0);
9291   }
9392}
9493
r5077r5078
164163         flipy = !flipy;
165164      }
166165
167      drawgfx(bitmap,machine->gfx[0],
166      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
168167            num,
169168            color,
170169            flipx,flipy,
171            sx,sy,
172            cliprect,TRANSPARENCY_PEN,0);
170            sx,sy,0);
173171   }
174172}
175173
src/mame/video/dogfgt.c
r5077r5078
207207            flipy = !flipy;
208208         }
209209
210         drawgfx(bitmap,machine->gfx[1],
210         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
211211               spriteram[offs+1] + ((spriteram[offs] & 0x30) << 4),
212212               (spriteram[offs] & 0x08) >> 3,
213213               flipx,flipy,
214               sx,sy,
215               cliprect,TRANSPARENCY_PEN,0);
214               sx,sy,0);
216215      }
217216   }
218217}
src/mame/video/dietgo.c
r5077r5078
5353
5454      while (multi >= 0)
5555      {
56         drawgfx(bitmap,machine->gfx[2],
56         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
5757               sprite - multi * inc,
5858               colour,
5959               fx,fy,
60               x,y + mult * multi,
61               cliprect,TRANSPARENCY_PEN,0);
60               x,y + mult * multi,0);
6261
6362         multi--;
6463      }
src/mame/video/vigilant.c
r5077r5078
7777      {
7878         for( col=0; col<512; col+=32 )
7979         {
80            drawgfx(bg_bitmap,
81                  machine->gfx[2],
80            drawgfx_opaque(bg_bitmap,
81                  0,machine->gfx[2],
8282                  charcode,
8383                  row < 128 ? 0 : 1,
8484                  0,0,
85                  512*page + col,row,
86                  0,TRANSPARENCY_NONE,0);
85                  512*page + col,row);
8786            charcode++;
8887         }
8988      }
r5077r5078
202201            {
203202               sx = (sx + scroll) & 0x1ff;
204203
205               drawgfx(bitmap,machine->gfx[0],
204               drawgfx_transmask(bitmap,&bottomvisiblearea,machine->gfx[0],
206205                     tile_number,
207206                     color,
208207                     0,0,
209                     sx,sy,
210                     &bottomvisiblearea,TRANSPARENCY_PENS,0x00ff);
208                     sx,sy,0x00ff);
211209            }
212210         }
213211      }
r5077r5078
269267         if (flipy) c += h-1-y;
270268         else c += y;
271269
272         drawgfx(bitmap,machine->gfx[1],
270         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
273271               c,
274272               color,
275273               flipx,flipy,
276               sx,sy + 16*y,
277               cliprect,TRANSPARENCY_PEN,0);
274               sx,sy + 16*y,0);
278275      }
279276   }
280277}
r5077r5078
331328      int color = (attributes & 0xF0) >> 4;
332329      int tile_number = videoram[offs] | ((attributes & 0x0F) << 8);
333330
334      drawgfx(bitmap,screen->machine->gfx[0],
331      drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
335332            tile_number,
336333            color,
337334            0,0,
338            sx,sy,
339            cliprect,TRANSPARENCY_NONE,0);
335            sx,sy);
340336   }
341337
342338   draw_sprites(screen->machine,bitmap,cliprect);
src/mame/video/taitosj.c
r5077r5078
325325
326326   /* draw the sprites into seperate bitmaps and check overlapping region */
327327   bitmap_fill(sprite_layer_collbitmap1, NULL, TRANSPARENT_PEN);
328   drawgfx(sprite_sprite_collbitmap1, get_sprite_gfx_element(machine, which1),
328   drawgfx_transpen(sprite_sprite_collbitmap1, 0, get_sprite_gfx_element(machine, which1),
329329         taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 3] & 0x3f,
330330         0,
331331         taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 2] & 0x01,
332332         taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 2] & 0x02,
333         sx1, sy1,
334         0, TRANSPARENCY_PEN, 0);
333         sx1, sy1, 0);
335334
336335   bitmap_fill(sprite_sprite_collbitmap2, NULL, TRANSPARENT_PEN);
337   drawgfx(sprite_sprite_collbitmap2, get_sprite_gfx_element(machine, which2),
336   drawgfx_transpen(sprite_sprite_collbitmap2, 0, get_sprite_gfx_element(machine, which2),
338337         taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 3] & 0x3f,
339338         0,
340339         taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 2] & 0x01,
341340         taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 2] & 0x02,
342         sx2, sy2,
343         0, TRANSPARENCY_PEN, 0);
341         sx2, sy2, 0);
344342
345343   for (y = miny; y < maxy; y++)
346344      for (x = minx; x < maxx; x++)
r5077r5078
481479
482480   /* draw sprite into a bitmap and check if layers collide */
483481   bitmap_fill(sprite_layer_collbitmap1, NULL, TRANSPARENT_PEN);
484   drawgfx(sprite_layer_collbitmap1, get_sprite_gfx_element(machine, which),
482   drawgfx_transpen(sprite_layer_collbitmap1, 0,get_sprite_gfx_element(machine, which),
485483         taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs + 3] & 0x3f,
486484         0,
487485         flip_x, flip_y,
488         0,0,
489         0,TRANSPARENCY_PEN,0);
486         0,0,0);
490487
491488   for (y = miny; y < maxy; y++)
492489      for (x = minx; x < maxx; x++)
r5077r5078
540537      if (GLOBAL_FLIP_X) sx = 31 - sx;
541538      if (GLOBAL_FLIP_Y) sy = 31 - sy;
542539
543      drawgfx(taitosj_layer_bitmap[0],machine->gfx[taitosj_colorbank[0] & 0x08 ? 2 : 0],
540      drawgfx_transpen(taitosj_layer_bitmap[0],0,machine->gfx[taitosj_colorbank[0] & 0x08 ? 2 : 0],
544541            taitosj_videoram_1[offs],
545542            taitosj_colorbank[0] & 0x07,
546543            GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
547            8*sx,8*sy,
548            0,TRANSPARENCY_PEN,0);
544            8*sx,8*sy,0);
549545
550      drawgfx(taitosj_layer_bitmap[1],machine->gfx[taitosj_colorbank[0] & 0x80 ? 2 : 0],
546      drawgfx_transpen(taitosj_layer_bitmap[1],0,machine->gfx[taitosj_colorbank[0] & 0x80 ? 2 : 0],
551547            taitosj_videoram_2[offs],
552548            (taitosj_colorbank[0] >> 4) & 0x07,
553549            GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
554            8*sx,8*sy,
555            0,TRANSPARENCY_PEN,0);
550            8*sx,8*sy,0);
556551
557      drawgfx(taitosj_layer_bitmap[2],machine->gfx[taitosj_colorbank[1] & 0x08 ? 2 : 0],
552      drawgfx_transpen(taitosj_layer_bitmap[2],0,machine->gfx[taitosj_colorbank[1] & 0x08 ? 2 : 0],
558553            taitosj_videoram_3[offs],
559554            taitosj_colorbank[1] & 0x07,
560555            GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
561            8*sx,8*sy,
562            0,TRANSPARENCY_PEN,0);
556            8*sx,8*sy,0);
563557   }
564558}
565559
r5077r5078
616610               flip_y = !flip_y;
617611            }
618612
619            drawgfx(bitmap, get_sprite_gfx_element(machine, which), code, color,
620                  flip_x, flip_y, sx, sy,
621                  GLOBAL_FLIP_X ? &spritevisibleareaflip : &spritevisiblearea,TRANSPARENCY_PEN,0);
613            drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? &spritevisibleareaflip : &spritevisiblearea,get_sprite_gfx_element(machine, which), code, color,
614                  flip_x, flip_y, sx, sy,0);
622615
623616            /* draw with wrap around. The horizontal games (eg. sfposeid) need this */
624            drawgfx(bitmap, get_sprite_gfx_element(machine, which), code, color,
625                  flip_x, flip_y, sx - 0x100, sy,
626                  GLOBAL_FLIP_X ? &spritevisibleareaflip : &spritevisiblearea,TRANSPARENCY_PEN,0);
617            drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? &spritevisibleareaflip : &spritevisiblearea,get_sprite_gfx_element(machine, which), code, color,
618                  flip_x, flip_y, sx - 0x100, sy,0);
627619         }
628620      }
629621   }
src/mame/video/kingobox.c
r5077r5078
237237         flipy = !flipy;
238238      }
239239
240      drawgfx(bitmap, machine->gfx[2 + bank],
240      drawgfx_transpen(bitmap, cliprect, machine->gfx[2 + bank],
241241         code, color,
242242         flipx, flipy,
243         sx, sy,
244         cliprect, TRANSPARENCY_PEN, 0);
243         sx, sy, 0);
245244   }
246245}
247246
r5077r5078
297296         flipy = !flipy;
298297      }
299298
300      drawgfx(bitmap, machine->gfx[2 + bank],
299      drawgfx_transpen(bitmap, cliprect, machine->gfx[2 + bank],
301300         code, color,
302301         flipx, flipy,
303         sx, sy,
304         cliprect, TRANSPARENCY_PEN, 0);
302         sx, sy, 0);
305303   }
306304}
307305
src/mame/video/galivan.c
r5077r5078
376376//      code = spriteram[offs+1] + ((attr & 0x02) << 7);
377377      code = spriteram[offs+1] + ((attr & 0x06) << 7);   // for ninjemak, not sure ?
378378
379      drawgfx(bitmap,machine->gfx[2],
379      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
380380            code,
381381            color + 16 * (spritepalettebank[code >> 2] & 0x0f),
382382            flipx,flipy,
383            sx,sy,
384            cliprect,TRANSPARENCY_PEN,15);
383            sx,sy,15);
385384   }
386385}
387386
src/mame/video/tsamurai.c
r5077r5078
175175
176176      if( flip_screen_get(machine) )
177177      {
178         drawgfx( bitmap,gfx,
178         drawgfx_transpen( bitmap,cliprect,gfx,
179179            sprite_number&0x7f,
180180            color,
181181            1,(sprite_number&0x80)?0:1,
182            256-32-sx,256-32-sy,
183            cliprect,TRANSPARENCY_PEN,0 );
182            256-32-sx,256-32-sy,0 );
184183      }
185184      else
186185      {
187         drawgfx( bitmap,gfx,
186         drawgfx_transpen( bitmap,cliprect,gfx,
188187            sprite_number&0x7f,
189188            color,
190189            0,sprite_number&0x80,
191            sx,sy,
192            cliprect,TRANSPARENCY_PEN,0 );
190            sx,sy,0 );
193191      }
194192
195193      source -= 4;
src/mame/video/canyon.c
r5077r5078
4444      int y = canyon_videoram[0x3d0 + 2 * i + 0x8];
4545      int c = canyon_videoram[0x3d0 + 2 * i + 0x9];
4646
47      drawgfx(bitmap, machine->gfx[1],
47      drawgfx_transpen(bitmap, cliprect,
48         machine->gfx[1],
4849         c >> 3,
4950         i,
5051         !(c & 0x80), 0,
5152         224 - x,
52         240 - y,
53         cliprect,
54         TRANSPARENCY_PEN, 0);
53         240 - y, 0);
5554   }
5655}
5756
src/mame/video/splash.c
r5077r5078
225225
226226      if (attr2 & 0x80) sx += 256;
227227
228      drawgfx(bitmap,gfx,number,
228      drawgfx_transpen(bitmap,cliprect,gfx,number,
229229         0x10 + (attr2 & 0x0f),attr & 0x40,attr & 0x80,
230         sx-8,sy,
231         cliprect,TRANSPARENCY_PEN,0);
230         sx-8,sy,0);
232231   }
233232}
234233
r5077r5078
244243      int attr2 = splash_spriteram[i+0x400] >> splash_sprite_attr2_shift;
245244      int number = (splash_spriteram[i] & 0xff) + (attr & 0xf)*256;
246245
247      drawgfx(bitmap,gfx,number,
246      drawgfx_transpen(bitmap,cliprect,gfx,number,
248247         (attr2 & 0x7f),attr & 0x40,attr & 0x80,
249         sx-8,sy,
250         cliprect,TRANSPARENCY_PEN,0);
248         sx-8,sy,0);
251249   }
252250}
253251
src/mame/video/f1gp.c
r5077r5078
226226            else
227227               code = f1gp_spr2cgram[map_start % (f1gp_spr2cgram_size/2)];
228228
229            pdrawgfxzoom(bitmap,machine->gfx[1 + chip],
229            pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1 + chip],
230230                  code,
231231                  color,
232232                  flipx,flipy,
233233                  sx,sy,
234                  cliprect,TRANSPARENCY_PEN,15,
235234                  0x1000 * zoomx,0x1000 * zoomy,
235                  priority_bitmap,
236236//                      pri ? 0 : 0x2);
237                  primask);
237                  primask,15);
238238            map_start++;
239239         }
240240
r5077r5078
293293         gfx = 0;
294294      }
295295
296      pdrawgfx(bitmap,machine->gfx[1 + gfx],
296      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1 + gfx],
297297         code,
298298         color,
299299         flipx,flipy,
300300         x,y,
301         cliprect,TRANSPARENCY_PEN,15,
302         pri ? 0 : 0x2);
301         priority_bitmap,
302         pri ? 0 : 0x2,15);
303303
304304      // wrap around x
305      pdrawgfx(bitmap,machine->gfx[1 + gfx],
305      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1 + gfx],
306306         code,
307307         color,
308308         flipx,flipy,
309309         x - 512,y,
310         cliprect,TRANSPARENCY_PEN,15,
311         pri ? 0 : 0x2);
310         priority_bitmap,
311         pri ? 0 : 0x2,15);
312312   }
313313}
314314
r5077r5078
415415            map_start++;
416416
417417            if (flipscreen)
418               drawgfxzoom(bitmap,machine->gfx[1],
418               drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1],
419419                     code,
420420                     color,
421421                     !flipx,!flipy,
422422                     304-sx,208-sy,
423                     cliprect,TRANSPARENCY_PEN,15,
424                     zoomx << 11,zoomy << 11);
423                     zoomx << 11,zoomy << 11,15);
425424            else
426               drawgfxzoom(bitmap,machine->gfx[1],
425               drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1],
427426                     code,
428427                     color,
429428                     flipx,flipy,
430429                     sx,sy,
431                     cliprect,TRANSPARENCY_PEN,15,
432                     zoomx << 11,zoomy << 11);
430                     zoomx << 11,zoomy << 11,15);
433431         }
434432      }
435433   }
src/mame/video/kan_panb.c
r5077r5078
4343         sy = y;
4444      }
4545
46      drawgfx(bitmap,screen->machine->gfx[1],
46      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
4747            tile,
4848            tilecolour,
4949            flipx, flipy,
50            sx,sy,
51            cliprect,TRANSPARENCY_PEN,0);
50            sx,sy,0);
5251
5352      /* second list interleaved with first (4bpp) ??? */
5453      dx = spriteram16[offs+4] & 0xff;
r5077r5078
7877      tilecolour = (tilecolour&0x03f0) >> 4;
7978      tilecolour ^=0x3f; // unusual, but correct..
8079
81      drawgfx(bitmap,screen->machine->gfx[0],
80      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
8281            tile,
8382            tilecolour,
8483            flipx, flipy,
85            sx,sy,
86            cliprect,TRANSPARENCY_PEN,0);
84            sx,sy,0);
8785   }
8886   return 0;
8987}
r5077r5078
133131      tilecolour = (tilecolour&0x00f0) >> 4;
134132      tilecolour ^=0xf; // unusual, but correct..
135133
136      drawgfx(bitmap,screen->machine->gfx[0],
134      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
137135            tile,
138136            tilecolour,
139137            flipx, flipy,
140            sx,sy,
141            cliprect,TRANSPARENCY_PEN,0);
138            sx,sy,0);
142139   }
143140   return 0;
144141}
r5077r5078
175172
176173      if ((xpos > -16) && (ypos > 0) && (xpos < 256) && (ypos < 240) && (disbl !=2))
177174      {
178         drawgfx(bitmap,screen->machine->gfx[0],
175         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
179176               tilen,
180177               colr,
181178               flipx, flipy,
182               xpos,ypos,
183               cliprect,TRANSPARENCY_PEN,0);
179               xpos,ypos,0);
184180      }
185181   }
186182   return 0;
r5077r5078
264260         tilecolour = 0x10;
265261      }
266262
267   drawgfx(bitmap,gfx,
263   drawgfx_transpen(bitmap,cliprect,gfx,
268264            tile,
269265            (tilecolour & 0xf0) >> 4,
270266            flipx, flipy,
271            sx,sy,
272            cliprect,TRANSPARENCY_PEN,0);
267            sx,sy,0);
273268   }
274269   return 0;
275270}
src/mame/video/polyplay.c
r5077r5078
6060      int sy = offs >> 6 << 3;
6161      UINT8 code = videoram[offs];
6262
63      drawgfx(bitmap,screen->machine->gfx[(code >> 7) & 0x01],
64            code, 0, 0, 0, sx, sy,
65            cliprect, TRANSPARENCY_NONE, 0);
63      drawgfx_opaque(bitmap,cliprect, screen->machine->gfx[(code >> 7) & 0x01],
64            code, 0, 0, 0, sx, sy);
6665   }
6766
6867   return 0;
src/mame/video/exzisus.c
r5077r5078
144144               y = 248 - y;
145145            }
146146
147            drawgfx(bitmap, screen->machine->gfx[0],
147            drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
148148                  code & 0x3fff,
149149                  color,
150150                  flip_screen_get(screen->machine), flip_screen_get(screen->machine),
151                  x, y,
152                  cliprect, TRANSPARENCY_PEN, 15);
151                  x, y, 15);
153152            goffs += 2;
154153         }
155154         gfx_offs += height << 1;
r5077r5078
214213               y = 248 - y;
215214            }
216215
217            drawgfx(bitmap, screen->machine->gfx[1],
216            drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
218217                  code & 0x3fff,
219218                  color,
220219                  flip_screen_get(screen->machine), flip_screen_get(screen->machine),
221                  x, y,
222                  cliprect, TRANSPARENCY_PEN, 15);
220                  x, y, 15);
223221            goffs += 2;
224222         }
225223         gfx_offs += height << 1;
src/mame/video/dassault.c
r5077r5078
128128
129129         while (multi >= 0)
130130         {
131            deco16_pdrawgfx(machine,
132                  bitmap,machine->gfx[gfxbank],
131            deco16_pdrawgfx(
132                  bitmap,cliprect,machine->gfx[gfxbank],
133133                  sprite - multi * inc,
134134                  colour,
135135                  fx,fy,
136136                  x,y + mult * multi,
137                  cliprect,0,pmask,1<<bank, 1, alpha);
137                  0,pmask,1<<bank, 1, alpha);
138138
139139            multi--;
140140         }
src/mame/video/ssrj.c
r5077r5078
239239        {
240240      int code;
241241      code=ssrj_vram3[(i*5+k)*64+(31-j)*2]+256*ssrj_vram3[(i*5+k)*64+(31-j)*2+1];
242      drawgfx(bitmap,
243         machine->gfx[0],
242      drawgfx_transpen(bitmap,
243         cliprect,machine->gfx[0],
244244         code&1023,
245245         ((code>>12)&0x3)+8,
246246         code&0x8000,
247247         code&0x4000,
248248         (247-(x+(j<<3)))&0xff,
249249         y,
250         cliprect,TRANSPARENCY_PEN,
251250         0);
252251        }
253252   }
src/mame/video/pingpong.c
r5077r5078
137137      color = spriteram[offs] & 0x1f;
138138      schar = spriteram[offs + 2] & 0x7f;
139139
140      drawgfx(bitmap,machine->gfx[1],
140      drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1],
141141            schar,
142142            color,
143143            flipx,flipy,
144144            sx,sy,
145            &spritevisiblearea,TRANSPARENCY_PENS,
146145            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
147146   }
148147}
src/mame/video/gotya.c
r5077r5078
138138         sy = 31 - row;
139139      }
140140
141      drawgfx(bitmap,machine->gfx[0],
141      drawgfx_opaque(bitmap,cliprect,
142         machine->gfx[0],
142143         gotya_videoram2[row * 32 + col],
143144         gotya_videoram2[row * 32 + col + 0x10] & 0x0f,
144145         flip_screen_x_get(machine), flip_screen_y_get(machine),
145         8 * sx, 8 * sy,
146         cliprect,
147         TRANSPARENCY_NONE, 0);
146         8 * sx, 8 * sy);
148147   }
149148}
150149
r5077r5078
164163         sy = 240 - sy;
165164      }
166165
167      drawgfx(bitmap,machine->gfx[1],
166      drawgfx_transpen(bitmap,cliprect,
167         machine->gfx[1],
168168         code, color,
169169         flip_screen_x_get(machine), flip_screen_y_get(machine),
170         sx, sy,
171         cliprect,
172         TRANSPARENCY_PEN, 0);
170         sx, sy, 0);
173171   }
174172}
175173
src/mame/video/tatsumi.c
r5077r5078
247247
248248/********************************************************************/
249249
250INLINE void roundupt_drawgfxzoomrotate( running_machine *machine,
251      bitmap_t *dest_bmp,const gfx_element *gfx,
250INLINE void roundupt_drawgfxzoomrotate(
251      bitmap_t *dest_bmp, const rectangle *clip, const gfx_element *gfx,
252252      UINT32 code,UINT32 color,int flipx,int flipy,UINT32 ssx,UINT32 ssy,
253      const rectangle *clip, int scalex, int scaley, int rotate, int write_priority_only )
253      int scalex, int scaley, int rotate, int write_priority_only )
254254{
255255   rectangle myclip;
256256
r5077r5078
282282   {
283283      if( gfx )
284284      {
285         const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
285         const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
286286         const UINT8 *shadow_pens = shadow_pen_array + (gfx->color_granularity * (color % gfx->total_colors));
287287         const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
288288
r5077r5078
643643
644644            for (w=0; w<x_width; w++) {
645645               if (rotate)
646                  roundupt_drawgfxzoomrotate(machine,
647                        temp_bitmap,machine->gfx[0],
646                  roundupt_drawgfxzoomrotate(
647                        temp_bitmap,cliprect,machine->gfx[0],
648648                        base,
649649                        color,fx,0,x_pos,render_y,
650                        cliprect,scale,scale,0,write_priority_only);
650                        scale,scale,0,write_priority_only);
651651               else
652                  roundupt_drawgfxzoomrotate(machine,
653                        bitmap,machine->gfx[0],
652                  roundupt_drawgfxzoomrotate(
653                        bitmap,cliprect,machine->gfx[0],
654654                        base,
655655                        color,fx,0,x_pos,render_y,
656                        cliprect,scale,scale,0,write_priority_only);
656                        scale,scale,0,write_priority_only);
657657               base++;
658658
659659               if (fx)
src/mame/video/supbtime.c
r5077r5078
6969
7070      while (multi >= 0)
7171      {
72         drawgfx(bitmap,machine->gfx[2],
72         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
7373               sprite - multi * inc,
7474               colour,
7575               fx,fy,
76               x,y + mult * multi,
77               cliprect,TRANSPARENCY_PEN,0);
76               x,y + mult * multi,0);
7877
7978         multi--;
8079      }
src/mame/video/konamiic.c
r5077r5078
12921292 *
12931293 */
12941294
1295void K007121_sprites_draw(int chip,bitmap_t *bitmap,gfx_element **gfxs, colortable_t *ctable,
1296                    const rectangle *cliprect, const UINT8 *source,int base_color,
1295void K007121_sprites_draw(int chip,bitmap_t *bitmap,const rectangle *cliprect, gfx_element **gfxs, colortable_t *ctable,
1296                    const UINT8 *source,int base_color,
12971297                    int global_x_offset,int bank_base, UINT32 pri_mask)
12981298{
12991299   const gfx_element *gfx = gfxs[chip];
r5077r5078
18041804
18051805               if (c & bankmask) continue; else c += bank;
18061806
1807               drawgfx(bitmap,K007420_gfx,
1807               drawgfx_transpen(bitmap,cliprect,K007420_gfx,
18081808                  c,
18091809                  color,
18101810                  flipx,flipy,
1811                  sx,sy,
1812                  cliprect,TRANSPARENCY_PEN,0);
1811                  sx,sy,0);
18131812
18141813               if (K007342_regs[2] & 0x80)
1815                  drawgfx(bitmap,K007420_gfx,
1814                  drawgfx_transpen(bitmap,cliprect,K007420_gfx,
18161815                     c,
18171816                     color,
18181817                     flipx,flipy,
1819                     sx,sy-256,
1820                     cliprect,TRANSPARENCY_PEN,0);
1818                     sx,sy-256,0);
18211819            }
18221820         }
18231821      }
r5077r5078
18421840
18431841               if (c & bankmask) continue; else c += bank;
18441842
1845               drawgfxzoom(bitmap,K007420_gfx,
1843               drawgfxzoom_transpen(bitmap,cliprect,K007420_gfx,
18461844                  c,
18471845                  color,
18481846                  flipx,flipy,
18491847                  sx,sy,
1850                  cliprect,TRANSPARENCY_PEN,0,
1851                  (zw << 16) / 8,(zh << 16) / 8);
1848                  (zw << 16) / 8,(zh << 16) / 8,0);
18521849
18531850               if (K007342_regs[2] & 0x80)
1854                  drawgfxzoom(bitmap,K007420_gfx,
1851                  drawgfxzoom_transpen(bitmap,cliprect,K007420_gfx,
18551852                     c,
18561853                     color,
18571854                     flipx,flipy,
18581855                     sx,sy-256,
1859                     cliprect,TRANSPARENCY_PEN,0,
1860                     (zw << 16) / 8,(zh << 16) / 8);
1856                     (zw << 16) / 8,(zh << 16) / 8,0);
18611857            }
18621858         }
18631859      }
src/mame/video/blmbycar.c
r5077r5078
200200      x   =   (x & 0x1ff) - 0x10;
201201      y   =   0xf0 - ((y & 0xff)  - (y & 0x100));
202202
203      pdrawgfx(   bitmap, machine->gfx[0],
203      pdrawgfx_transpen(   bitmap, cliprect, machine->gfx[0],
204204               code,
205205               0x20 + (attr & 0xf),
206206               flipx, flipy,
207207               x, y,
208               cliprect, TRANSPARENCY_PEN,0,
209               pri_mask   );
208               priority_bitmap,
209               pri_mask,0   );
210210   }
211211}
212212
src/mame/video/retofinv.c
r5077r5078
218218      {
219219         for (x = 0;x <= sizex;x++)
220220         {
221            drawgfx(bitmap,machine->gfx[1],
221            drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1],
222222               sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
223223               color,
224224               flipx,flipy,
225225               sx + 16*x,sy + 16*y,
226               &spritevisiblearea,TRANSPARENCY_PENS,
227226               colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0xff));
228227         }
229228      }
src/mame/video/konamiic.h
r5077r5078
1111void K007121_ctrl_w(int chip,int offset,int data);
1212WRITE8_HANDLER( K007121_ctrl_0_w );
1313WRITE8_HANDLER( K007121_ctrl_1_w );
14void K007121_sprites_draw(int chip,bitmap_t *bitmap,gfx_element **gfxs, colortable_t *ctable,
15                    const rectangle *cliprect, const UINT8 *source,int base_color,
14void K007121_sprites_draw(int chip,bitmap_t *bitmap,const rectangle *cliprect, gfx_element **gfxs, colortable_t *ctable,
15                    const UINT8 *source,int base_color,
1616                    int global_x_offset,int bank_base, UINT32 pri_mask);
1717
1818
src/mame/video/meadows.c
r5077r5078
8888      int bank = i;                     /* that fixes it for now :-/ */
8989      int flip = spriteram[i+8] >> 5;         /* bit #5 flip vertical flag */
9090
91      drawgfx(bitmap, machine->gfx[bank + 1], code, 0, flip, 0, x, y, clip, TRANSPARENCY_PEN, 0);
91      drawgfx_transpen(bitmap, clip, machine->gfx[bank + 1], code, 0, flip, 0, x, y, 0);
9292   }
9393}
9494
src/mame/video/bogeyman.c
r5077r5078
126126            flipy = !flipy;
127127         }
128128
129         drawgfx(bitmap, machine->gfx[2],
129         drawgfx_transpen(bitmap, cliprect,
130            machine->gfx[2],
130131            code, color,
131132            flipx, flipy,
132            sx, sy,
133            cliprect,
134            TRANSPARENCY_PEN, 0);
133            sx, sy, 0);
135134
136135         if (multi)
137136         {
138            drawgfx(bitmap,machine->gfx[2],
137            drawgfx_transpen(bitmap,cliprect,
138               machine->gfx[2],
139139               code + 1, color,
140140               flipx, flipy,
141               sx, sy + (flip_screen_get(machine) ? -16 : 16),
142               cliprect,
143               TRANSPARENCY_PEN, 0);
141               sx, sy + (flip_screen_get(machine) ? -16 : 16), 0);
144142         }
145143      }
146144   }
src/mame/video/srmp2.c
r5077r5078
107107
108108      if (srmp2_color_bank) color |= 0x20;
109109
110      drawgfx(bitmap, machine->gfx[0],
110      drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
111111            code,
112112            color,
113113            flipx, flipy,
114114            (x + xoffs) & 0x1ff,
115            max_y - ((y + yoffs) & 0x0ff),
116            cliprect, TRANSPARENCY_PEN, 15);
115            max_y - ((y + yoffs) & 0x0ff), 15);
117116   }
118117}
119118
r5077r5078
173172         code = code & 0x1fff;
174173
175174#define DRAWTILE(_x_, _y_)  \
176         drawgfx(bitmap, machine->gfx[0], \
175         drawgfx_transpen(bitmap, \
176               cliprect, machine->gfx[0], \
177177               code, \
178178               color, \
179179               flipx, flipy, \
180               _x_, _y_, \
181               cliprect, TRANSPARENCY_PEN, 0);
180               _x_, _y_, 0);
182181
183182         DRAWTILE(sx - 0x000, sy + 0x000)
184183         DRAWTILE(sx - 0x200, sy + 0x000)
r5077r5078
264263         flipy = !flipy;
265264      }
266265
267      drawgfx(bitmap,machine->gfx[0],
266      drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
268267            code,
269268            color,
270269            flipx, flipy,
271270            (x + xoffs) & 0x1ff,
272            max_y - ((y + yoffs) & 0x0ff),
273            cliprect, TRANSPARENCY_PEN, 0);
271            max_y - ((y + yoffs) & 0x0ff), 0);
274272   }
275273}
276274
r5077r5078
337335         code   =   (code & 0x3fff) + (gfxbank ? 0x4000 : 0);
338336
339337#define DRAWTILE(_x_, _y_)  \
340         drawgfx(bitmap, machine->gfx[0], \
338         drawgfx_transpen(bitmap, \
339               cliprect, machine->gfx[0], \
341340               code, \
342341               color, \
343342               flipx, flipy, \
344               _x_, _y_, \
345               cliprect, TRANSPARENCY_PEN, 0);
343               _x_, _y_, 0);
346344
347345         DRAWTILE(sx - 0x000, sy + 0x000)
348346         DRAWTILE(sx - 0x200, sy + 0x000)
r5077r5078
421419         flipy = !flipy;
422420      }
423421
424      drawgfx(bitmap,machine->gfx[0],
422      drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
425423            code,
426424            color,
427425            flipx, flipy,
428426            (x + xoffs) & 0x1ff,
429            max_y - ((y + yoffs) & 0x0ff),
430            cliprect, TRANSPARENCY_PEN, 0);
427            max_y - ((y + yoffs) & 0x0ff), 0);
431428   }
432429}
433430
src/mame/video/m72.c
r5077r5078
443443            if (flipy) c += h-1-y;
444444            else c += y;
445445
446            drawgfx(bitmap,machine->gfx[0],
446            drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
447447                  c,
448448                  color,
449449                  flipx,flipy,
450                  sx + 16*x,sy + 16*y,
451                  cliprect,TRANSPARENCY_PEN,0);
450                  sx + 16*x,sy + 16*y,0);
452451         }
453452      }
454453
r5077r5078
495494            if (flipy) c += h-1-y;
496495            else c += y;
497496
498            drawgfx(bitmap,machine->gfx[2],
497            drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
499498                  c,
500499                  color,
501500                  flipx,flipy,
502                  sx + 16*x,sy + 16*y,
503                  cliprect,TRANSPARENCY_PEN,0);
501                  sx + 16*x,sy + 16*y,0);
504502         }
505503      }
506504   }
src/mame/video/ohmygod.c
r5077r5078
9797      if (sy >= 32768) sy -= 65536;
9898      flipx = sr[offs+3] & 0x8000;
9999
100      drawgfx(bitmap,machine->gfx[1],
100      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
101101            code,
102102            color,
103103            flipx,0,
104            sx,sy,
105            cliprect,TRANSPARENCY_PEN,0);
104            sx,sy,0);
106105   }
107106}
108107
src/mame/video/pokechmp.c
r5077r5078
5656            if (flipy) flipy=0; else flipy=1;
5757         }
5858
59         drawgfx(bitmap,machine->gfx[1],
59         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
6060               spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8),
6161               (spriteram[offs+1] & 0x70) >> 4,
6262               flipx,flipy,
63               sx,sy,
64               cliprect,TRANSPARENCY_PEN,0);
63               sx,sy,0);
6564      }
6665   }
6766}
src/mame/video/snk68.c
r5077r5078
247247               fy = !fy;
248248            }
249249
250            drawgfx(bitmap,machine->gfx[1],
250            drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
251251                  tile,
252252                  color,
253253                  fx, fy,
254                  mx, my,
255                  cliprect, TRANSPARENCY_PEN, 0);
254                  mx, my, 0);
256255         }
257256         else
258257         {
src/mame/video/aeroboto.c
r5077r5078
135135         y = 240 - y;
136136      }
137137
138      drawgfx(bitmap, machine->gfx[1],
138      drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
139139            spriteram[offs+1],
140140            spriteram[offs+2] & 0x07,
141141            flip_screen_get(machine), flip_screen_get(machine),
142            ((x + 8) & 0xff) - 8, y,
143            cliprect, TRANSPARENCY_PEN, 0);
142            ((x + 8) & 0xff) - 8, y, 0);
144143   }
145144}
146145
src/mame/video/madalien.c
r5077r5078
168168
169169   gfx_element_set_source(machine->gfx[0], madalien_charram);
170170
171   drawgfx(headlight_bitmap, machine->gfx[2], 0, 0, 0, 0, 0x00, 0x00, NULL, TRANSPARENCY_NONE, 0);
172   drawgfx(headlight_bitmap, machine->gfx[2], 0, 0, 0, 1, 0x00, 0x40, NULL, TRANSPARENCY_NONE, 0);
171   drawgfx_opaque(headlight_bitmap, NULL, machine->gfx[2], 0, 0, 0, 0, 0x00, 0x00);
172   drawgfx_opaque(headlight_bitmap, NULL, machine->gfx[2], 0, 0, 0, 1, 0x00, 0x40);
173173}
174174
175175
src/mame/video/firetrap.c
r5077r5078
239239      {
240240         if (flip_screen_get(machine)) sy -= 16;
241241
242         drawgfx(bitmap,machine->gfx[3],
242         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
243243               code & ~1,
244244               color,
245245               flipx,flipy,
246               sx,flipy ? sy : sy + 16,
247               cliprect,TRANSPARENCY_PEN,0);
248         drawgfx(bitmap,machine->gfx[3],
246               sx,flipy ? sy : sy + 16,0);
247         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
249248               code | 1,
250249               color,
251250               flipx,flipy,
252               sx,flipy ? sy + 16 : sy,
253               cliprect,TRANSPARENCY_PEN,0);
251               sx,flipy ? sy + 16 : sy,0);
254252
255253         /* redraw with wraparound */
256         drawgfx(bitmap,machine->gfx[3],
254         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
257255               code & ~1,
258256               color,
259257               flipx,flipy,
260               sx - 256,flipy ? sy : sy + 16,
261               cliprect,TRANSPARENCY_PEN,0);
262         drawgfx(bitmap,machine->gfx[3],
258               sx - 256,flipy ? sy : sy + 16,0);
259         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
263260               code | 1,
264261               color,
265262               flipx,flipy,
266               sx - 256,flipy ? sy + 16 : sy,
267               cliprect,TRANSPARENCY_PEN,0);
263               sx - 256,flipy ? sy + 16 : sy,0);
268264      }
269265      else
270266      {
271         drawgfx(bitmap,machine->gfx[3],
267         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
272268               code,
273269               color,
274270               flipx,flipy,
275               sx,sy,
276               cliprect,TRANSPARENCY_PEN,0);
271               sx,sy,0);
277272
278273         /* redraw with wraparound */
279         drawgfx(bitmap,machine->gfx[3],
274         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
280275               code,
281276               color,
282277               flipx,flipy,
283               sx - 256,sy,
284               cliprect,TRANSPARENCY_PEN,0);
278               sx - 256,sy,0);
285279      }
286280   }
287281}
src/mame/video/thedeep.c
r5077r5078
195195
196196         for (y = 0; y < ny; y++)
197197         {
198            drawgfx(bitmap,machine->gfx[0],
198            drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
199199                  code + (flipy ? (ny - y - 1) :  y),
200200                  color,
201201                  flipx,flipy,
202                  sx + x * (flipx ? 16 : -16), sy + y * 16,
203                  cliprect,TRANSPARENCY_PEN,0 );
202                  sx + x * (flipx ? 16 : -16), sy + y * 16,0 );
204203         }
205204      }
206205   }
src/mame/video/oneshot.c
r5077r5078
129129         for (blocky = 0; blocky<ysize;blocky++) {
130130
131131
132            drawgfx(
132            drawgfx_transpen(
133133                  bitmap,
134                  cliprect,
134135                  gfx,
135136                  num+(blocky*xsize)+blockx,
136137                  1,
137138                  0,0,
138                  xpos+blockx*8,ypos+blocky*8,
139                  cliprect,
140                  TRANSPARENCY_PEN,0
139                  xpos+blockx*8,ypos+blocky*8,0
141140                  );
142141
143            drawgfx(
142            drawgfx_transpen(
144143                  bitmap,
144                  cliprect,
145145                  gfx,
146146                  num+(blocky*xsize)+blockx,
147147                  1,
148148                  0,0,
149                  xpos+blockx*8-0x200,ypos+blocky*8,
150                  cliprect,
151                  TRANSPARENCY_PEN,0
149                  xpos+blockx*8-0x200,ypos+blocky*8,0
152150                  );
153151         }
154152      }
src/mame/video/stlforce.c
r5077r5078
114114
115115         ypos = 512-ypos;
116116
117         drawgfx( bitmap,
117         drawgfx_transpen( bitmap,
118                cliprect,
118119                gfx,
119120                num,
120121                64+attr,
121122                0,0,
122                xpos+stlforce_sprxoffs,ypos,
123                cliprect,
124                TRANSPARENCY_PEN,0 );
123                xpos+stlforce_sprxoffs,ypos,0 );
125124      }
126125
127126      source += 0x4;
src/mame/video/topspeed.c
r5077r5078
9999         zx = x + (((k+1)*zoomx)/8) - curx;
100100         zy = y + (((j+1)*zoomy)/16) - cury;
101101
102         pdrawgfxzoom(bitmap,machine->gfx[0],
102         pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
103103               code,
104104               color,
105105               flipx,flipy,
106106               curx,cury,
107               cliprect,TRANSPARENCY_PEN,0,
108107               zx<<12,zy<<13,
109               primasks[priority]);
108               priority_bitmap,primasks[priority],0);
110109      }
111110
112111      if (bad_chunks)
src/mame/video/amspdwy.c
r5077r5078
123123         flipx = !flipx;   flipy = !flipy;
124124      }
125125
126      drawgfx(bitmap,machine->gfx[0],
126      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
127127//              code + ((attr & 0x18)<<5),
128128            code + ((attr & 0x08)<<5),
129129            attr,
130130            flipx, flipy,
131            x,y,
132            cliprect,TRANSPARENCY_PEN,0 );
131            x,y,0 );
133132   }
134133}
135134
src/mame/video/fantland.c
r5077r5078
132132
133133      if (x >= 0x180)      x -= 0x200;
134134
135      drawgfx(bitmap,machine->gfx[0], code,color, flipx,flipy, x,y, cliprect,TRANSPARENCY_PEN,0);
135      drawgfx_transpen(bitmap,cliprect,machine->gfx[0], code,color, flipx,flipy, x,y,0);
136136   }
137137}
138138
src/mame/video/srumbler.c
r5077r5078
149149         flipy = !flipy;
150150      }
151151
152      drawgfx(bitmap,machine->gfx[2],
152      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
153153            code,
154154            colour,
155155            flip_screen_get(machine),flipy,
156            sx, sy,
157            cliprect,TRANSPARENCY_PEN,15);
156            sx, sy,15);
158157   }
159158}
160159
src/mame/video/legionna.c
r5077r5078
285285            for (ax=0; ax<dx; ax++)
286286               for (ay=0; ay<dy; ay++)
287287               {
288                  drawgfx(bitmap,machine->gfx[3],
288                  drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
289289                  sprite++,
290                  color,fx,fy,x+ax*16,y+ay*16,
291                  cliprect,TRANSPARENCY_PEN,15);
290                  color,fx,fy,x+ax*16,y+ay*16,15);
292291               }
293292         }
294293         else
r5077r5078
296295            for (ax=0; ax<dx; ax++)
297296               for (ay=0; ay<dy; ay++)
298297               {
299                  drawgfx(bitmap,machine->gfx[3],
298                  drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
300299                  sprite++,
301                  color,fx,fy,x+ax*16,y+(dy-ay-1)*16,
302                  cliprect,TRANSPARENCY_PEN,15);
300                  color,fx,fy,x+ax*16,y+(dy-ay-1)*16,15);
303301               }
304302         }
305303      }
r5077r5078
310308            for (ax=0; ax<dx; ax++)
311309               for (ay=0; ay<dy; ay++)
312310               {
313                  drawgfx(bitmap,machine->gfx[3],
311                  drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
314312                  sprite++,
315                  color,fx,fy,x+(dx-ax-1)*16,y+ay*16,
316                  cliprect,TRANSPARENCY_PEN,15);
313                  color,fx,fy,x+(dx-ax-1)*16,y+ay*16,15);
317314               }
318315         }
319316         else
r5077r5078
321318            for (ax=0; ax<dx; ax++)
322319               for (ay=0; ay<dy; ay++)
323320               {
324                  drawgfx(bitmap,machine->gfx[3],
321                  drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
325322                  sprite++,
326                  color,fx,fy,x+(dx-ax-1)*16,y+(dy-ay-1)*16,
327                  cliprect,TRANSPARENCY_PEN,15);
323                  color,fx,fy,x+(dx-ax-1)*16,y+(dy-ay-1)*16,15);
328324               }
329325         }
330326      }
src/mame/video/pbaction.c
r5077r5078
116116         flipy = !flipy;
117117      }
118118
119      drawgfx(bitmap,machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2],   /* normal or double size */
119      drawgfx_transpen(bitmap,cliprect,machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2],   /* normal or double size */
120120            spriteram[offs],
121121            spriteram[offs + 1] & 0x0f,
122122            flipx,flipy,
123            sx + (flip_screen_get(machine) ? scroll : -scroll), sy,
124            cliprect,TRANSPARENCY_PEN,0);
123            sx + (flip_screen_get(machine) ? scroll : -scroll), sy,0);
125124   }
126125}
127126
src/mame/video/mcr68.c
r5077r5078
249249            The color 8 is used to cover over other sprites. */
250250
251251      /* first draw the sprite, visible */
252      pdrawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, x, y,
253            &sprite_clip, TRANSPARENCY_PENS, 0x0101, 0x00);
252      pdrawgfx_transmask(bitmap, &sprite_clip, machine->gfx[1], code, color, flipx, flipy, x, y,
253            priority_bitmap, 0x00, 0x0101);
254254
255255      /* then draw the mask, behind the background but obscuring following sprites */
256      pdrawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, x, y,
257            &sprite_clip, TRANSPARENCY_PENS, 0xfeff, 0x02);
256      pdrawgfx_transmask(bitmap, &sprite_clip, machine->gfx[1], code, color, flipx, flipy, x, y,
257            priority_bitmap, 0x02, 0xfeff);
258258   }
259259}
260260
r5077r5078
305305            The color 8 is used to cover over other sprites. */
306306
307307      /* first draw the sprite, visible */
308      pdrawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, x, y,
309            cliprect, TRANSPARENCY_PENS, 0x0101, 0x00);
308      pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, x, y,
309            priority_bitmap, 0x00, 0x0101);
310310
311311      /* then draw the mask, behind the background but obscuring following sprites */
312      pdrawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, x, y,
313            cliprect, TRANSPARENCY_PENS, 0xfeff, 0x02);
312      pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, x, y,
313            priority_bitmap, 0x02, 0xfeff);
314314   }
315315}
316316
src/mame/video/spcforce.c
r5077r5078
4545         sy = 248 - sy;
4646      }
4747
48      drawgfx(bitmap,screen->machine->gfx[0],
48      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
4949            code, col,
5050            flip_screen_get(screen->machine), flip_screen_get(screen->machine),
51            sx, sy,
52            cliprect,TRANSPARENCY_PEN,0);
51            sx, sy,0);
5352   }
5453   return 0;
5554}
src/mame/video/gsword.c
r5077r5078
196196            flipx = !flipx;
197197            flipy = !flipy;
198198         }
199         drawgfx(bitmap,machine->gfx[1+spritebank],
199         drawgfx_transmask(bitmap,cliprect,machine->gfx[1+spritebank],
200200               tile,
201201               color,
202202               flipx,flipy,
203203               sx,sy,
204               cliprect,TRANSPARENCY_PENS,
205204               colortable_get_transpen_mask(machine->colortable, machine->gfx[1+spritebank], color, 0x8f));
206205      }
207206   }
src/mame/video/mario.c
r5077r5078
188188         {
189189            y -= 14;
190190            x -= 7;
191            drawgfx(bitmap,machine->gfx[1],
191            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
192192                  state->spriteram[offs + 2],
193193                  (state->spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor,
194194                  !(state->spriteram[offs + 1] & 0x80),!(state->spriteram[offs + 1] & 0x40),
195                  x, y,
196                  cliprect,TRANSPARENCY_PEN,0);
195                  x, y,0);
197196         }
198197         else
199198         {
200199            y += 1;
201200            x -= 8;
202            drawgfx(bitmap,machine->gfx[1],
201            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
203202                  state->spriteram[offs + 2],
204203                  (state->spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor,
205204                  (state->spriteram[offs + 1] & 0x80),(state->spriteram[offs + 1] & 0x40),
206                  x, y,
207                  cliprect,TRANSPARENCY_PEN,0);
205                  x, y,0);
208206         }
209207      }
210208   }
src/mame/video/atarifb.c
r5077r5078
153153      {
154154         shade = ((spriteram[obj*2+1 + 0x20]) & 0x07);
155155
156         drawgfx(bitmap,machine->gfx[gfx + 1],
156         drawgfx_transpen(bitmap,&bigfield_area,machine->gfx[gfx + 1],
157157            charcode, shade,
158            flipx,flipy,sx,sy,
159            &bigfield_area,TRANSPARENCY_PEN,0);
158            flipx,flipy,sx,sy,0);
160159
161160         shade = ((spriteram[obj*2+1 + 0x20]) & 0x08) >> 3;
162161      }
163162
164      drawgfx(bitmap,machine->gfx[gfx],
163      drawgfx_transpen(bitmap,&bigfield_area,machine->gfx[gfx],
165164            charcode, shade,
166            flipx,flipy,sx,sy,
167            &bigfield_area,TRANSPARENCY_PEN,0);
165            flipx,flipy,sx,sy,0);
168166
169167      /* If this isn't soccer, handle the multiplexed sprites */
170168      if (!is_soccer)
r5077r5078
174172         if ((charcode == 0x11) && (sy == 0x07))
175173         {
176174            sy = 0xf1; /* When multiplexed, it's 0x10...why? */
177            drawgfx(bitmap,machine->gfx[gfx],
175            drawgfx_transpen(bitmap,&bigfield_area,machine->gfx[gfx],
178176               charcode, 0,
179               flipx,flipy,sx,sy,
180               &bigfield_area,TRANSPARENCY_PEN,0);
177               flipx,flipy,sx,sy,0);
181178         }
182179      }
183180   }
src/mame/video/silkroad.c
r5077r5078
3737
3838      if (!flipx) {
3939         for (wcount=0;wcount<width;wcount++) {
40         pdrawgfx(bitmap,gfx,tileno+wcount,color,0,0,xpos+wcount*16+8,ypos,cliprect,TRANSPARENCY_PEN,0,pri_mask);
40         pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+wcount,color,0,0,xpos+wcount*16+8,ypos,priority_bitmap,pri_mask,0);
4141         }
4242
4343      } else {
4444
4545         for (wcount=width;wcount>0;wcount--) {
46         pdrawgfx(bitmap,gfx,tileno+(width-wcount),color,1,0,xpos+wcount*16-16+8,ypos,cliprect,TRANSPARENCY_PEN,0,pri_mask);
46         pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+(width-wcount),color,1,0,xpos+wcount*16-16+8,ypos,priority_bitmap,pri_mask,0);
4747         }
4848
4949      }
src/mame/video/videopin.c
r5077r5078
8585            {
8686               for (j = 0; j < 2; j++)
8787               {
88                  drawgfx(bitmap, screen->machine->gfx[1],
88                  drawgfx_transpen(bitmap, &rect, screen->machine->gfx[1],
8989                     0, 0,
9090                     0, 0,
9191                     x + 16 * i,
92                     y + 16 * j,
93                     &rect, TRANSPARENCY_PEN, 0);
92                     y + 16 * j, 0);
9493               }
9594            }
9695
src/mame/video/exprraid.c
r5077r5078
114114         flipy = !flipy;
115115      }
116116
117      drawgfx(bitmap, machine->gfx[1],
117      drawgfx_transpen(bitmap, 0, machine->gfx[1],
118118         code, color,
119119         flipx, flipy,
120         sx, sy,
121         0, TRANSPARENCY_PEN, 0);
120         sx, sy, 0);
122121
123122      /* double height */
124123
125124      if (attr & 0x10)
126125      {
127         drawgfx(bitmap,machine->gfx[1],
126         drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
128127            code + 1, color,
129128            flipx, flipy,
130            sx, sy + (flip_screen_get(machine) ? -16 : 16),
131            cliprect, TRANSPARENCY_PEN, 0);
129            sx, sy + (flip_screen_get(machine) ? -16 : 16), 0);
132130      }
133131   }
134132}
src/mame/video/naughtyb.c
r5077r5078
223223         }
224224      }
225225
226      drawgfx(tmpbitmap,screen->machine->gfx[0],
226      drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[0],
227227            naughtyb_videoram2[offs] + 256 * bankreg,
228228            (naughtyb_videoram2[offs] >> 5) + 8 * palreg,
229229            naughtyb_cocktail,naughtyb_cocktail,
230            8*sx,8*sy,
231            0,TRANSPARENCY_NONE,0);
230            8*sx,8*sy);
232231
233      drawgfx(tmpbitmap,screen->machine->gfx[1],
232      drawgfx_transpen(tmpbitmap,0,screen->machine->gfx[1],
234233            videoram[offs] + 256*bankreg,
235234            (videoram[offs] >> 5) + 8 * palreg,
236235            naughtyb_cocktail,naughtyb_cocktail,
237            8*sx,8*sy,
238            0,TRANSPARENCY_PEN,0);
236            8*sx,8*sy,0);
239237   }
240238
241239   // copy the temporary bitmap to the screen
src/mame/video/runaway.c
r5077r5078
109109
110110      code |= (runaway_sprite_ram[i + 0x30] << 2) & 0x1c0;
111111
112      drawgfx(bitmap, screen->machine->gfx[1],
112      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
113113         code,
114114         0,
115115         flipx, flipy,
116         x, 240 - y,
117         cliprect, TRANSPARENCY_PEN, 0);
116         x, 240 - y, 0);
118117
119      drawgfx(bitmap, screen->machine->gfx[1],
118      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
120119         code,
121120         0,
122121         flipx, flipy,
123         x - 256, 240 - y,
124         cliprect, TRANSPARENCY_PEN, 0);
122         x - 256, 240 - y, 0);
125123   }
126124   return 0;
127125}
r5077r5078
145143
146144      code |= (runaway_sprite_ram[i + 0x30] << 2) & 0x1c0;
147145
148      drawgfx(bitmap, screen->machine->gfx[1],
146      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
149147         code,
150148         0,
151149         flipx, flipy,
152         x, 240 - y,
153         cliprect, TRANSPARENCY_PEN, 0);
150         x, 240 - y, 0);
154151
155      drawgfx(bitmap, screen->machine->gfx[1],
152      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
156153         code,
157154         0,
158155         flipx, flipy,
159         x - 256, 240 - y,
160         cliprect, TRANSPARENCY_PEN, 0);
156         x - 256, 240 - y, 0);
161157   }
162158   return 0;
163159}
src/mame/video/tumbleb.c
r5077r5078
7979
8080      while (multi >= 0)
8181      {
82         drawgfx(bitmap,machine->gfx[3],
82         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
8383               sprite - multi * inc,
8484               colour,
8585               fx,fy,
86               sprite_xoffset + x,sprite_yoffset + y + mult * multi,
87               cliprect,TRANSPARENCY_PEN,0);
86               sprite_xoffset + x,sprite_yoffset + y + mult * multi,0);
8887
8988         multi--;
9089      }
r5077r5078
141140
142141      while (multi >= 0)
143142      {
144         drawgfx(bitmap,machine->gfx[3],
143         drawgfx_transpen(bitmap,// x-1 for bcstory .. realign other layers?
144               cliprect,machine->gfx[3],
145145               sprite - multi * inc,
146146               colour,
147147               fx,fy,
148               sprite_xoffset+x,sprite_yoffset + y + mult * multi, // x-1 for bcstory .. realign other layers?
149               cliprect,TRANSPARENCY_PEN,0);
148               sprite_xoffset+x,sprite_yoffset + y + mult * multi,0);
150149
151150         multi--;
152151      }
r5077r5078
203202
204203      while (multi >= 0)
205204      {
206         drawgfx(bitmap,machine->gfx[3],
205         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
207206               sprite - multi * inc,
208207               colour,
209208               fx,fy,
210               sprite_xoffset+x,sprite_yoffset+ y + mult * multi,
211               cliprect,TRANSPARENCY_PEN,15);
209               sprite_xoffset+x,sprite_yoffset+ y + mult * multi,15);
212210
213211         multi--;
214212      }
src/mame/video/momoko.c
r5077r5078
142142               py = 248-(8*y+dy+9);
143143            }
144144
145            drawgfx(bitmap,screen->machine->gfx[1],
145            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1],
146146               chr,
147147               col,
148148               flip,flip,
149               px,py,
150               cliprect,TRANSPARENCY_NONE,0);
149               px,py);
151150         }
152151      }
153152   }
r5077r5078
177176         py = y+1;
178177      }
179178
180      drawgfx(bitmap,screen->machine->gfx[3],
179      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3],
181180         chr,
182181         col,
183182         !fx,fy,
184         px,py,
185         cliprect,TRANSPARENCY_PEN,0);
183         px,py,0);
186184   }
187185
188186
r5077r5078
241239         px = 248-x;
242240         py = y+1;
243241      }
244      drawgfx(bitmap,screen->machine->gfx[3],
242      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3],
245243         chr,
246244         col,
247245         !fx,fy,
248         px,py,
249         cliprect,TRANSPARENCY_PEN,0);
246         px,py,0);
250247   }
251248
252249
r5077r5078
276273            px = 248-x*8;
277274            py = 255-y;
278275         }
279         drawgfx(bitmap,screen->machine->gfx[0],
276         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
280277            videoram[(sy>>3)*32+x]*8+dy,
281278            col,
282279            flip,0,
283            px,py,
284            cliprect,TRANSPARENCY_PEN,0);
280            px,py,0);
285281      }
286282   }
287283
r5077r5078
311307               px = 248-(8*x+dx-8);
312308               py = 248-(8*y+dy+9);
313309            }
314            drawgfx(bitmap,screen->machine->gfx[2],
310            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
315311               chr,
316312               0, /* color */
317313               flip,flip, /* flip */
318               px,py,
319               cliprect,TRANSPARENCY_PEN,0);
314               px,py,0);
320315         }
321316      }
322317   }
src/mame/video/kchamp.c
r5077r5078
8888         flipy = !flipy;
8989      }
9090
91        drawgfx(bitmap, machine->gfx[bank], code, color, flipx, flipy, sx, sy,
92            cliprect, TRANSPARENCY_PEN, 0);
91        drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], code, color, flipx, flipy, sx, sy, 0);
9392   }
9493}
9594
r5077r5078
116115         flipy = !flipy;
117116      }
118117
119        drawgfx(bitmap, machine->gfx[bank], code, color, flipx, flipy, sx, sy,
120            cliprect, TRANSPARENCY_PEN, 0);
118        drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], code, color, flipx, flipy, sx, sy, 0);
121119   }
122120}
123121
src/mame/video/digdug.c
r5077r5078
292292         for (x = 0;x <= size;x++)
293293         {
294294            UINT32 transmask = colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x1f);
295            drawgfx(bitmap,machine->gfx[1],
295            drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1],
296296               sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)],
297297               color,
298298               flipx,flipy,
299               ((sx + 16*x) & 0xff), sy + 16*y,
300               &spritevisiblearea,TRANSPARENCY_PENS,transmask);
299               ((sx + 16*x) & 0xff), sy + 16*y,transmask);
301300            /* wraparound */
302            drawgfx(bitmap,machine->gfx[1],
301            drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1],
303302               sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)],
304303               color,
305304               flipx,flipy,
306               ((sx + 16*x) & 0xff) + 0x100, sy + 16*y,
307               &spritevisiblearea,TRANSPARENCY_PENS,transmask);
305               ((sx + 16*x) & 0xff) + 0x100, sy + 16*y,transmask);
308306         }
309307      }
310308   }
src/mame/video/ultratnk.c
r5077r5078
7878
7979      if (!(attr & 0x80))
8080      {
81         drawgfx(bitmap, screen->machine->gfx[1],
81         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
8282            (code >> 3) | bank,
8383            i,
8484            0, 0,
8585            horz - 15,
86            vert - 15,
87            cliprect, TRANSPARENCY_PEN, 0);
86            vert - 15, 0);
8887      }
8988   }
9089
r5077r5078
125124      if (code & 4)
126125         bank = 32;
127126
128      drawgfx(helper, machine->gfx[1],
127      drawgfx_transpen(helper, &rect, machine->gfx[1],
129128         (code >> 3) | bank,
130129         4,
131130         0, 0,
132131         horz - 15,
133         vert - 15,
134         &rect, TRANSPARENCY_PEN, 1);
132         vert - 15, 1);
135133
136134      for (y = rect.min_y; y <= rect.max_y; y++)
137135         for (x = rect.min_x; x <= rect.max_x; x++)
src/mame/video/m90.c
r5077r5078
160160      for (i = 0;i < y_multi;i++)
161161
162162         if (m90_video_control_data[7] & 0x01)
163            pdrawgfx(bitmap,machine->gfx[1],
163            pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
164164               sprite + (fy ? y_multi-1 - i : i),
165165               colour,
166166               fx,fy,
167167               x,y+i*16,
168               cliprect,TRANSPARENCY_PEN,0,
169               (colour & 0x08) ? 0x00 : 0x02);
168               priority_bitmap,
169               (colour & 0x08) ? 0x00 : 0x02,0);
170170         else if (m90_video_control_data[7] & 0x02)
171            pdrawgfx(bitmap,machine->gfx[1],
171            pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
172172               sprite + (fy ? y_multi-1 - i : i),
173173               colour,
174174               fx,fy,
175175               x,y+i*16,
176               cliprect,TRANSPARENCY_PEN,0,
177               ((colour & 0x0c)==0x0c) ? 0x00 : 0x02);
176               priority_bitmap,
177               ((colour & 0x0c)==0x0c) ? 0x00 : 0x02,0);
178178         else
179            pdrawgfx(bitmap,machine->gfx[1],
179            pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
180180               sprite + (fy ? y_multi-1 - i : i),
181181               colour,
182182               fx,fy,
183183               x,y+i*16,
184               cliprect,TRANSPARENCY_PEN,0,
185               0x02);
184               priority_bitmap,
185               0x02,0);
186186   }
187187}
188188
r5077r5078
214214      fx = (spriteram16[offs+3] >> 8) & 0x02;
215215      fy = (spriteram16[offs+2] >> 8) & 0x80;
216216
217      pdrawgfx(bitmap,machine->gfx[1],
217      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
218218            sprite,
219219            colour,
220220            fx,fy,
221221            x,y,
222            cliprect,TRANSPARENCY_PEN,0,
223            (colour & 0x08) ? 0x00 : 0x02);
222            priority_bitmap,
223            (colour & 0x08) ? 0x00 : 0x02,0);
224224   }
225225}
226226
r5077r5078
251251      fx = (spriteram16[offs+3] >> 8) & 0x02;
252252      fy = (spriteram16[offs+2] >> 8) & 0x80;
253253
254      pdrawgfx(bitmap,machine->gfx[1],
254      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
255255            sprite,
256256            colour,
257257            fx,fy,
258258            x,y,
259            cliprect,TRANSPARENCY_PEN,0,
260            (colour & 0x08) ? 0x00 : 0x02);
259            priority_bitmap,
260            (colour & 0x08) ? 0x00 : 0x02,0);
261261   }
262262}
263263
src/mame/video/scotrsht.c
r5077r5078
116116         flipy = !flipy;
117117      }
118118
119      drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy,
120         sx, sy, cliprect, TRANSPARENCY_PENS,
119      drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy,
120         sx, sy,
121121         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, scotrsht_palette_bank * 16));
122122   }
123123}
src/mame/video/gunbustr.c
r5077r5078
178178            }
179179            else
180180            {
181               drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
181               drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
182182                     sprite_ptr->code,
183183                     sprite_ptr->color,
184184                     sprite_ptr->flipx,sprite_ptr->flipy,
185185                     sprite_ptr->x,sprite_ptr->y,
186                     cliprect,TRANSPARENCY_PEN,0,
187                     sprite_ptr->zoomx,sprite_ptr->zoomy);
186                     sprite_ptr->zoomx,sprite_ptr->zoomy,0);
188187            }
189188         }
190189      }
r5077r5078
198197   {
199198      sprite_ptr--;
200199
201      pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
200      pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
202201            sprite_ptr->code,
203202            sprite_ptr->color,
204203            sprite_ptr->flipx,sprite_ptr->flipy,
205204            sprite_ptr->x,sprite_ptr->y,
206            cliprect,TRANSPARENCY_PEN,0,
207205            sprite_ptr->zoomx,sprite_ptr->zoomy,
208            sprite_ptr->primask);
206            priority_bitmap,sprite_ptr->primask,0);
209207   }
210208}
211209
src/mame/video/taito_z.c
r5077r5078
243243            flipy = !flipy;
244244         }
245245
246         pdrawgfxzoom(bitmap,machine->gfx[0],
246         pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
247247               code,
248248               color,
249249               flipx,flipy,
250250               curx,cury,
251               cliprect,TRANSPARENCY_PEN,0,
252               zx<<12,zy<<13,primasks[priority]);
251               zx<<12,zy<<13,priority_bitmap,primasks[priority],0);
253252      }
254253
255254      if (bad_chunks)
r5077r5078
338337               flipy = !flipy;
339338            }
340339
341            pdrawgfxzoom(bitmap,machine->gfx[0],
340            pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
342341                  code,
343342                  color,
344343                  flipx,flipy,
345344                  curx,cury,
346                  cliprect,TRANSPARENCY_PEN,0,
347345                  zx<<12,zy<<12,
348                  primasks[priority]);
346                  priority_bitmap,primasks[priority],0);
349347         }
350348      }
351349      else if ((zoomx-1) & 0x20)   /* 64x128 sprites, $40000-$5ffff in spritemap rom, OBJB */
r5077r5078
382380               flipy = !flipy;
383381            }
384382
385            pdrawgfxzoom(bitmap,machine->gfx[2],
383            pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2],
386384                  code,
387385                  color,
388386                  flipx,flipy,
389387                  curx,cury,
390                  cliprect,TRANSPARENCY_PEN,0,
391388                  zx<<12,zy<<12,
392                  primasks[priority]);
389                  priority_bitmap,primasks[priority],0);
393390         }
394391      }
395392      else if (!((zoomx-1) & 0x60))   /* 32x128 sprites, $60000-$7ffff in spritemap rom, OBJB */
r5077r5078
426423               flipy = !flipy;
427424            }
428425
429            pdrawgfxzoom(bitmap,machine->gfx[2],
426            pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2],
430427                  code,
431428                  color,
432429                  flipx,flipy,
433430                  curx,cury,
434                  cliprect,TRANSPARENCY_PEN,0,
435431                  zx<<12,zy<<12,
436                  primasks[priority]);
432                  priority_bitmap,primasks[priority],0);
437433         }
438434      }
439435
r5077r5078
520516            flipy = !flipy;
521517         }
522518
523         pdrawgfxzoom(bitmap,machine->gfx[0],
519         pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
524520               code,
525521               color,
526522               flipx,flipy,
527523               curx,cury,
528               cliprect,TRANSPARENCY_PEN,0,
529524               zx<<12,zy<<13,
530               primasks[priority]);
525               priority_bitmap,primasks[priority],0);
531526      }
532527
533528      if (bad_chunks)
r5077r5078
622617            flipy = !flipy;
623618         }
624619
625         pdrawgfxzoom(bitmap,machine->gfx[0],
620         pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
626621               code,
627622               color,
628623               flipx,flipy,
629624               curx,cury,
630               cliprect,TRANSPARENCY_PEN,0,
631625               zx<<12,zy<<13,
632               primasks[priority]);
626               priority_bitmap,primasks[priority],0);
633627      }
634628
635629      if (bad_chunks)
r5077r5078
714708            flipy = !flipy;
715709         }
716710
717         pdrawgfxzoom(bitmap,machine->gfx[0],
711         pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
718712               code,
719713               color,
720714               flipx,flipy,
721715               curx,cury,
722               cliprect,TRANSPARENCY_PEN,0,
723716               zx<<12,zy<<13,
724               primasks[priority]);
717               priority_bitmap,primasks[priority],0);
725718      }
726719
727720      if (bad_chunks)
r5077r5078
806799            flipy = !flipy;
807800         }
808801
809         pdrawgfxzoom(bitmap,machine->gfx[0],
802         pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
810803               code,
811804               color,
812805               flipx,flipy,
813806               curx,cury,
814               cliprect,TRANSPARENCY_PEN,0,
815807               zx<<12,zy<<13,
816               primasks[priority]);
808               priority_bitmap,primasks[priority],0);
817809      }
818810
819811      if (bad_chunks)
src/mame/video/msisaac.c
r5077r5078
186186         switch(attributes&3)
187187         {
188188         case 0: /* flipx==0 && flipy==0 */
189            drawgfx(bitmap,gfx,
189            drawgfx_transpen(bitmap,cliprect,gfx,
190190               sprite_number+1,color,
191191               flipx,flipy,
192               sx,sy-16,cliprect,TRANSPARENCY_PEN,0 );
193            drawgfx(bitmap,gfx,
192               sx,sy-16,0 );
193            drawgfx_transpen(bitmap,cliprect,gfx,
194194               sprite_number,color,
195195               flipx,flipy,
196               sx,sy,cliprect,TRANSPARENCY_PEN,0 );
196               sx,sy,0 );
197197            break;
198198         case 1: /* flipx==1 && flipy==0 */
199            drawgfx(bitmap,gfx,
199            drawgfx_transpen(bitmap,cliprect,gfx,
200200               sprite_number+1,color,
201201               flipx,flipy,
202               sx,sy-16,cliprect,TRANSPARENCY_PEN,0 );
203            drawgfx(bitmap,gfx,
202               sx,sy-16,0 );
203            drawgfx_transpen(bitmap,cliprect,gfx,
204204               sprite_number,color,
205205               flipx,flipy,
206               sx,sy,cliprect,TRANSPARENCY_PEN,0 );
206               sx,sy,0 );
207207            break;
208208         case 2: /* flipx==0 && flipy==1 */
209            drawgfx(bitmap,gfx,
209            drawgfx_transpen(bitmap,cliprect,gfx,
210210               sprite_number,color,
211211               flipx,flipy,
212               sx,sy-16,cliprect,TRANSPARENCY_PEN,0 );
213            drawgfx(bitmap,gfx,
212               sx,sy-16,0 );
213            drawgfx_transpen(bitmap,cliprect,gfx,
214214               sprite_number+1,color,
215215               flipx,flipy,
216               sx,sy,cliprect,TRANSPARENCY_PEN,0 );
216               sx,sy,0 );
217217            break;
218218         case 3: /* flipx==1 && flipy==1 */
219            drawgfx(bitmap,gfx,
219            drawgfx_transpen(bitmap,cliprect,gfx,
220220               sprite_number,color,
221221               flipx,flipy,
222               sx,sy-16,cliprect,TRANSPARENCY_PEN,0 );
223            drawgfx(bitmap,gfx,
222               sx,sy-16,0 );
223            drawgfx_transpen(bitmap,cliprect,gfx,
224224               sprite_number+1,color,
225225               flipx,flipy,
226               sx,sy,cliprect,TRANSPARENCY_PEN,0 );
226               sx,sy,0 );
227227            break;
228228         }
229229      }
230230      else
231231      {
232         drawgfx(bitmap,gfx,
232         drawgfx_transpen(bitmap,cliprect,gfx,
233233            sprite_number,
234234            color,
235235            flipx,flipy,
236            sx,sy,
237            cliprect,TRANSPARENCY_PEN,0 );
236            sx,sy,0 );
238237      }
239238      source -= 4;
240239   }
src/mame/video/markham.c
r5077r5078
108108      if (px>248)
109109         px = px-256;
110110
111      drawgfx(bitmap,machine->gfx[1],
111      drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
112112         chr,
113113         col,
114114         fx,fy,
115115         px,py,
116         cliprect,TRANSPARENCY_PENS,
117116         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], col, 0));
118117   }
119118}
src/mame/video/superqix.c
r5077r5078
186186         sy = 240 - sy;
187187      }
188188
189      drawgfx(bitmap,machine->gfx[1],
189      drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
190190            code,
191191            color,
192192            flip_screen_get(machine), flip_screen_get(machine),
193            sx, sy,
194            cliprect, TRANSPARENCY_PEN, 0);
193            sx, sy, 0);
195194   }
196195}
197196
r5077r5078
217216         flipy = !flipy;
218217      }
219218
220      drawgfx(bitmap,machine->gfx[2],
219      drawgfx_transpen(bitmap,cliprect, machine->gfx[2],
221220            code,
222221            color,
223222            flipx, flipy,
224            sx, sy,
225            cliprect, TRANSPARENCY_PEN, 0);
223            sx, sy, 0);
226224   }
227225}
228226
src/mame/video/mappy.c
r5077r5078
441441         {
442442            for (x = 0;x <= sizex;x++)
443443            {
444               drawgfx(bitmap,machine->gfx[1],
444               drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
445445                  sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
446446                  color,
447447                  flipx,flipy,
448448                  sx + 16*x,sy + 16*y,
449                  cliprect,TRANSPARENCY_PENS,
450449                  colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, transcolor));
451450            }
452451         }
r5077r5078
517516         {
518517            for (x = 0;x <= sizex;x++)
519518            {
520               drawgfx(bitmap,machine->gfx[1],
519               drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
521520                  sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
522521                  color,
523522                  flipx,flipy,
524523                  sx + 8*x,sy + 8*y,
525                  cliprect,TRANSPARENCY_PENS,
526524                  colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 31));
527525            }
528526         }
src/mame/video/rastan.c
r5077r5078
198198         data1 = spriteram16[offs+3];
199199         color = (spriteram16[offs+4] & 0x0f) | sprite_colbank;
200200
201         drawgfx(bitmap,screen->machine->gfx[0],
201         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
202202               tile,
203203               color,
204204               data1 & 0x40, data1 & 0x80,
205               sx,sy+1,
206               cliprect,TRANSPARENCY_PEN,15);
205               sx,sy+1,15);
207206      }
208207   }
209208
src/mame/video/tigeroad.c
r5077r5078
9696            flipy = !flipy;
9797         }
9898
99         drawgfx(bitmap, machine->gfx[2],
99         drawgfx_transpen(bitmap, cliprect,
100            machine->gfx[2],
100101            tile_number,
101102            color,
102103            flipx, flipy,
103            sx, 240 - sy,
104            cliprect,
105            TRANSPARENCY_PEN, 15);
104            sx, 240 - sy, 15);
106105      }
107106
108107      source -= 4;
src/mame/video/slapfght.c
r5077r5078
172172            sx = buffered_spriteram[offs+1] + 3;
173173            sy = buffered_spriteram[offs+3] - 1;
174174         }
175         drawgfx(bitmap,machine->gfx[1],
175         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
176176            buffered_spriteram[offs],
177177            ((buffered_spriteram[offs+2] >> 1) & 3)   |
178178               ((buffered_spriteram[offs+2] << 2) & 4) | (slapfight_palette_bank << 3),
179179            flipscreen, flipscreen,
180            sx, sy,
181            cliprect,TRANSPARENCY_PEN,0);
180            sx, sy,0);
182181      }
183182   }
184183}
r5077r5078
231230   for (offs = 0;offs < spriteram_size;offs += 4)
232231   {
233232      if (flipscreen)
234         drawgfx(bitmap,screen->machine->gfx[2],
233         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
235234            buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2),
236235            (buffered_spriteram[offs+2] & 0x1e) >> 1,
237236            1,1,
238            288-(buffered_spriteram[offs+1] + ((buffered_spriteram[offs+2] & 0x01) << 8)) +18,240-buffered_spriteram[offs+3],
239            cliprect,TRANSPARENCY_PEN,0);
237            288-(buffered_spriteram[offs+1] + ((buffered_spriteram[offs+2] & 0x01) << 8)) +18,240-buffered_spriteram[offs+3],0);
240238      else
241         drawgfx(bitmap,screen->machine->gfx[2],
239         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
242240            buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2),
243241            (buffered_spriteram[offs+2] & 0x1e) >> 1,
244242            0,0,
245            (buffered_spriteram[offs+1] + ((buffered_spriteram[offs+2] & 0x01) << 8)) - 13,buffered_spriteram[offs+3],
246            cliprect,TRANSPARENCY_PEN,0);
243            (buffered_spriteram[offs+1] + ((buffered_spriteram[offs+2] & 0x01) << 8)) - 13,buffered_spriteram[offs+3],0);
247244   }
248245
249246   tilemap_draw(bitmap,cliprect,fix_tilemap,0,0);
src/mame/video/psikyosh.c
r5077r5078
342342            tileno = (psikyosh_bgram[(bank*0x800)/4 + offs - 0x4000/4] & 0x0007ffff); /* seems to take into account spriteram, hence -0x4000 */
343343            colour = (psikyosh_bgram[(bank*0x800)/4 + offs - 0x4000/4] & 0xff000000) >> 24;
344344
345//              drawgfx(zoom_bitmap,gfx,tileno,colour,0,0,(16*sx)&0x1ff,((16*sy)&(width-1)),NULL,TRANSPARENCY_PEN,0);
345//              drawgfx_transpen(zoom_bitmap,NULL,gfx,tileno,colour,0,0,(16*sx)&0x1ff,((16*sy)&(width-1)),0);
346346
347347            drawgfx_alphatable(bitmap,cliprect,gfx,tileno,colour,0,0,(16*sx+scrollx)&0x1ff,((16*sy+scrolly)&(width-1)),alpha); /* normal */
348348            if(scrollx)
r5077r5078
421421/* sx and sy is top-left of entire sprite regardless of flip */
422422/* Note that Level 5-4 of sbomberb boss is perfect! (Alpha blended zoomed) as well as S1945II logo */
423423/* pixel is only plotted if z is >= priority_buffer[y][x] */
424static void psikyosh_drawgfxzoom( running_machine *machine,
425      bitmap_t *dest_bmp,const gfx_element *gfx,
424static void psikyosh_drawgfxzoom(
425      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
426426      UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
427      const rectangle *clip,int alpha,
427      int alpha,
428428      int zoomx, int zoomy, int wide, int high, UINT32 z)
429429{
430430   rectangle myclip; /* Clip to screen boundaries */
r5077r5078
471471         {
472472            for (xtile = xstart; xtile != xend; xtile += xinc )
473473            {
474               const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
474               const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
475475               const UINT8 *code_base = gfx_element_get_data(gfx, (code + code_offset++) % gfx->total_elements);
476476
477477               int x_index_base, y_index, sx, sy, ex, ey;
r5077r5078
735735      /* Start drawing */
736736      if( gfx )
737737      {
738         const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
738         const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
739739
740740         int sprite_screen_height = ((high*gfx->height*(0x400*0x400))/zoomy + 0x200)>>10; /* Round up to nearest pixel */
741741         int sprite_screen_width = ((wide*gfx->width*(0x400*0x400))/zoomx + 0x200)>>10;
r5077r5078
10461046         /* start drawing */
10471047         if( zoom_table[BYTE_XOR_BE(zoomy)] && zoom_table[BYTE_XOR_BE(zoomx)] ) /* Avoid division-by-zero when table contains 0 (Uninitialised/Bug) */
10481048         {
1049            psikyosh_drawgfxzoom(machine, bitmap,gfx,tnum,colr,flpx,flpy,xpos,ypos,cliprect,alpha,
1049            psikyosh_drawgfxzoom(bitmap,cliprect,gfx,tnum,colr,flpx,flpy,xpos,ypos,alpha,
10501050                           (UINT32)zoom_table[BYTE_XOR_BE(zoomx)], (UINT32)zoom_table[BYTE_XOR_BE(zoomy)], wide, high, listcntr);
10511051
10521052#if 0
src/mame/video/quizdna.c
r5077r5078
181181      {
182182         y &= 0x1ff;
183183
184         drawgfx(bitmap,machine->gfx[2],
184         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
185185               code ^ i,
186186               col,
187187               fx,fy,
188               x,y,
189               cliprect,TRANSPARENCY_PEN,0);
188               x,y,0);
190189
191190         y += dy;
192191      }
src/mame/video/kan_pand.c
r5077r5078
142142      if (sx&0x100) sx-=0x200;
143143      if (sy&0x100) sy-=0x200;
144144
145      drawgfx(bitmap,machine->gfx[pandora_region],
145      drawgfx_transpen(bitmap,cliprect,machine->gfx[pandora_region],
146146            tile,
147147            (tilecolour & 0xf0) >> 4,
148148            flipx, flipy,
149            sx,sy,
150            cliprect,TRANSPARENCY_PEN,0);
149            sx,sy,0);
151150   }
152151}
153152
src/mame/video/boogwing.c
r5077r5078
117117
118118      while (multi >= 0)
119119      {
120         deco16_pdrawgfx(machine,
121               bitmap,machine->gfx[gfx_region],
120         deco16_pdrawgfx(
121               bitmap, cliprect, machine->gfx[gfx_region],
122122               sprite - multi * inc,
123123               colour,
124124               fx,fy,
125125               x,y + mult * multi,
126               cliprect, 0, pri, spri, 0, alpha);
126               0, pri, spri, 0, alpha);
127127
128128         multi--;
129129      }
src/mame/video/equites.c
r5077r5078
283283         // sprites are 16x14 centered in a 16x16 square, so skip the first line
284284         sy += 1;
285285
286         drawgfx(bitmap,machine->gfx[2],
286         drawgfx_transmask(bitmap,cliprect, machine->gfx[2],
287287               tile,
288288               color,
289289               fx, fy,
290               sx, sy,
291               cliprect, TRANSPARENCY_PENS, transmask);
290               sx, sy, transmask);
292291      }
293292   }
294293}
src/mame/video/decocass.c
r5077r5078
159159   else
160160      sx = 91 - (part_h_shift & 0x7f);
161161
162   drawgfx(bitmap, machine->gfx[3], 0, color, 0, 0, sx + 64, sy, cliprect, TRANSPARENCY_PEN, 0);
163   drawgfx(bitmap, machine->gfx[3], 1, color, 0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
164   drawgfx(bitmap, machine->gfx[3], 0, color, 0, 1, sx + 64, sy - 64, cliprect, TRANSPARENCY_PEN, 0);
165   drawgfx(bitmap, machine->gfx[3], 1, color, 0, 1, sx, sy - 64, cliprect, TRANSPARENCY_PEN, 0);
162   drawgfx_transpen(bitmap, cliprect, machine->gfx[3], 0, color, 0, 0, sx + 64, sy, 0);
163   drawgfx_transpen(bitmap, cliprect, machine->gfx[3], 1, color, 0, 0, sx, sy, 0);
164   drawgfx_transpen(bitmap, cliprect, machine->gfx[3], 0, color, 0, 1, sx + 64, sy - 64, 0);
165   drawgfx_transpen(bitmap, cliprect, machine->gfx[3], 1, color, 0, 1, sx, sy - 64, 0);
166166}
167167
168168static void draw_center(bitmap_t *bitmap, const rectangle *cliprect)
r5077r5078
426426
427427      sy -= sprite_y_adjust;
428428
429      drawgfx(bitmap,machine->gfx[1],
429      drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
430430            sprite_ram[offs + interleave],
431431            color,
432432            flipx,flipy,
433            sx,sy,
434            cliprect, TRANSPARENCY_PEN, 0);
433            sx,sy, 0);
435434
436435      sy += (flip_screen_get(machine) ? -256 : 256);
437436
438437      // Wrap around
439      drawgfx(bitmap,machine->gfx[1],
438      drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
440439            sprite_ram[offs + interleave],
441440            color,
442441            flipx,flipy,
443            sx,sy,
444            cliprect, TRANSPARENCY_PEN, 0);
442            sx,sy, 0);
445443   }
446444}
447445
src/mame/video/fromance.c
r5077r5078
360360            for (yt = 0; yt < ytiles; yt++)
361361               for (xt = 0; xt < xtiles; xt++, code++)
362362                  if (!zoomed)
363                     drawgfx(bitmap, screen->machine->gfx[2], code, color, 0, 0,
364                           x + xt * 16, y + yt * 16, cliprect, TRANSPARENCY_PEN, 15);
363                     drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, 0, 0,
364                           x + xt * 16, y + yt * 16, 15);
365365                  else
366                     drawgfxzoom(bitmap, screen->machine->gfx[2], code, color, 0, 0,
367                           x + xt * xzoom, y + yt * yzoom, cliprect, TRANSPARENCY_PEN, 15,
368                           0x1000 * xzoom, 0x1000 * yzoom);
366                     drawgfxzoom_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, 0, 0,
367                           x + xt * xzoom, y + yt * yzoom,
368                           0x1000 * xzoom, 0x1000 * yzoom, 15);
369369         }
370370
371371         /* xflipped case */
r5077r5078
374374            for (yt = 0; yt < ytiles; yt++)
375375               for (xt = 0; xt < xtiles; xt++, code++)
376376                  if (!zoomed)
377                     drawgfx(bitmap, screen->machine->gfx[2], code, color, 1, 0,
378                           x + (xtiles - 1 - xt) * 16, y + yt * 16, cliprect, TRANSPARENCY_PEN, 15);
377                     drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, 1, 0,
378                           x + (xtiles - 1 - xt) * 16, y + yt * 16, 15);
379379                  else
380                     drawgfxzoom(bitmap, screen->machine->gfx[2], code, color, 1, 0,
381                           x + (xtiles - 1 - xt) * xzoom, y + yt * yzoom, cliprect, TRANSPARENCY_PEN, 15,
382                           0x1000 * xzoom, 0x1000 * yzoom);
380                     drawgfxzoom_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, 1, 0,
381                           x + (xtiles - 1 - xt) * xzoom, y + yt * yzoom,
382                           0x1000 * xzoom, 0x1000 * yzoom, 15);
383383         }
384384
385385         /* yflipped case */
r5077r5078
388388            for (yt = 0; yt < ytiles; yt++)
389389               for (xt = 0; xt < xtiles; xt++, code++)
390390                  if (!zoomed)
391                     drawgfx(bitmap, screen->machine->gfx[2], code, color, 0, 1,
392                           x + xt * 16, y + (ytiles - 1 - yt) * 16, cliprect, TRANSPARENCY_PEN, 15);
391                     drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, 0, 1,
392                           x + xt * 16, y + (ytiles - 1 - yt) * 16, 15);
393393                  else
394                     drawgfxzoom(bitmap, screen->machine->gfx[2], code, color, 0, 1,
395                           x + xt * xzoom, y + (ytiles - 1 - yt) * yzoom, cliprect, TRANSPARENCY_PEN, 15,
396                           0x1000 * xzoom, 0x1000 * yzoom);
394                     drawgfxzoom_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, 0, 1,
395                           x + xt * xzoom, y + (ytiles - 1 - yt) * yzoom,
396                           0x1000 * xzoom, 0x1000 * yzoom, 15);
397397         }
398398
399399         /* x & yflipped case */
r5077r5078
402402            for (yt = 0; yt < ytiles; yt++)
403403               for (xt = 0; xt < xtiles; xt++, code++)
404404                  if (!zoomed)
405                     drawgfx(bitmap, screen->machine->gfx[2], code, color, 1, 1,
406                           x + (xtiles - 1 - xt) * 16, y + (ytiles - 1 - yt) * 16, cliprect, TRANSPARENCY_PEN, 15);
405                     drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, 1, 1,
406                           x + (xtiles - 1 - xt) * 16, y + (ytiles - 1 - yt) * 16, 15);
407407                  else
408                     drawgfxzoom(bitmap, screen->machine->gfx[2], code, color, 1, 1,
409                           x + (xtiles - 1 - xt) * xzoom, y + (ytiles - 1 - yt) * yzoom, cliprect, TRANSPARENCY_PEN, 15,
410                           0x1000 * xzoom, 0x1000 * yzoom);
408                     drawgfxzoom_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, 1, 1,
409                           x + (xtiles - 1 - xt) * xzoom, y + (ytiles - 1 - yt) * yzoom,
410                           0x1000 * xzoom, 0x1000 * yzoom, 15);
411411         }
412412      }
413413   }
src/mame/video/irobot.c
r5077r5078
362362         int code = videoram[offs] & 0x3f;
363363         int color = ((videoram[offs] & 0xc0) >> 6) | (irobot_alphamap >> 3);
364364
365         drawgfx(bitmap,screen->machine->gfx[0],
365         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
366366               code, color,
367367               0,0,
368               8*x,8*y,
369               cliprect,TRANSPARENCY_PEN,0);
368               8*x,8*y,0);
370369      }
371370   return 0;
372371}
src/mame/video/skykid.c
r5077r5078
219219      {
220220         for (x = 0;x <= sizex;x++)
221221         {
222            drawgfx(bitmap,machine->gfx[2],
222            drawgfx_transmask(bitmap,cliprect,machine->gfx[2],
223223               sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
224224               color,
225225               flipx,flipy,
226226               sx + 16*x,sy + 16*y,
227               cliprect,TRANSPARENCY_PENS,
228227               colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0xff));
229228         }
230229      }
src/mame/video/djmain.c
r5077r5078
9494               int zw = ox + (((x + 1) * xscale + (1 << 11)) >> 12) - sx;
9595               int zh = oy + (((y + 1) * yscale + (1 << 11)) >> 12) - sy;
9696
97               drawgfxzoom(bitmap,
97               drawgfxzoom_transpen(bitmap,
98                           cliprect,
9899                           machine->gfx[0],
99100                           c,
100101                           color,
r5077r5078
102103                           flipy,
103104                           sx,
104105                           sy,
105                           cliprect,
106                           TRANSPARENCY_PEN,
107                           0,
108106                           (zw << 16) / 16,
109                           (zh << 16) / 16);
107                           (zh << 16) / 16,
108                           0);
110109            }
111110            else
112111            {
113112               int sx = ox + (x << 4);
114113               int sy = oy + (y << 4);
115114
116               drawgfx(bitmap,
115               drawgfx_transpen(bitmap,
116                       cliprect,
117117                       machine->gfx[0],
118118                       c,
119119                       color,
r5077r5078
121121                       flipy,
122122                       sx,
123123                       sy,
124                       cliprect,
125                       TRANSPARENCY_PEN,
126124                       0);
127125            }
128126         }
src/mame/video/firetrk.c
r5077r5078
262262}
263263
264264
265static void firetrk_draw_car(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int which, int flash)
265static void firetrk_draw_car(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int flash)
266266{
267267   int gfx_bank, code, color, flip_x, flip_y, x, y;
268268
r5077r5078
287287      y = 104;
288288   }
289289
290   drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PEN, 0);
290   drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, 0);
291291}
292292
293293
294static void superbug_draw_car(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int flash)
294static void superbug_draw_car(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int flash)
295295{
296296   int gfx_bank = (*firetrk_car_rot & 0x10) ? 4 : 3;
297297   int code = ~*firetrk_car_rot & 0x03;
r5077r5078
299299   int flip_x = *firetrk_car_rot & 0x04;
300300   int flip_y = *firetrk_car_rot & 0x08;
301301
302   drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, 144, 104, cliprect, TRANSPARENCY_PEN, 0);
302   drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, 144, 104, 0);
303303}
304304
305305
306static void montecar_draw_car(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int which, int is_collision_detection)
306static void montecar_draw_car(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int is_collision_detection)
307307{
308308   int gfx_bank, code, color, flip_x, flip_y, x, y;
309309
r5077r5078
328328      y = 104;
329329   }
330330
331   drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PEN, 0);
331   drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, 0);
332332}
333333
334334
335static void draw_text(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *alpha_ram,
335static void draw_text(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, UINT8 *alpha_ram,
336336                 int x, int count, int height)
337337{
338338   int i;
339339
340340   for (i = 0; i < count; i++)
341      drawgfx(bitmap, gfx[0], alpha_ram[i], 0, 0, 0, x, i * height, cliprect, TRANSPARENCY_NONE, 0);
341      drawgfx_opaque(bitmap, cliprect, gfx[0], alpha_ram[i], 0, 0, 0, x, i * height);
342342}
343343
344344
r5077r5078
371371
372372   bitmap_fill(bitmap, cliprect, 0);
373373   tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0);
374   firetrk_draw_car(screen->machine->gfx, bitmap, &playfield_window, 0, firetrk_flash);
375   firetrk_draw_car(screen->machine->gfx, bitmap, &playfield_window, 1, firetrk_flash);
376   draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10);
377   draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x10,   8, 0x10, 0x10);
374   firetrk_draw_car(bitmap, &playfield_window, screen->machine->gfx, 0, firetrk_flash);
375   firetrk_draw_car(bitmap, &playfield_window, screen->machine->gfx, 1, firetrk_flash);
376   draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10);
377   draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x10,   8, 0x10, 0x10);
378378
379379   if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y)
380380   {
381381      tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0);
382382
383383      bitmap_fill(helper2, &playfield_window, 0xff);
384      firetrk_draw_car(screen->machine->gfx, helper2, &playfield_window, 0, FALSE);
384      firetrk_draw_car(helper2, &playfield_window, screen->machine->gfx, 0, FALSE);
385385      check_collision(0);
386386
387387      bitmap_fill(helper2, &playfield_window, 0xff);
388      firetrk_draw_car(screen->machine->gfx, helper2, &playfield_window, 1, FALSE);
388      firetrk_draw_car(helper2, &playfield_window, screen->machine->gfx, 1, FALSE);
389389      check_collision(1);
390390
391391      *firetrk_blink = FALSE;
r5077r5078
405405
406406   bitmap_fill(bitmap, cliprect, 0);
407407   tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0);
408   superbug_draw_car(screen->machine->gfx, bitmap, &playfield_window, firetrk_flash);
409   draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10);
410   draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x10,   8, 0x10, 0x10);
408   superbug_draw_car(bitmap, &playfield_window, screen->machine->gfx, firetrk_flash);
409   draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10);
410   draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x10,   8, 0x10, 0x10);
411411
412412   if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y)
413413   {
414414      tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0);
415415
416416      bitmap_fill(helper2, &playfield_window, 0xff);
417      superbug_draw_car(screen->machine->gfx, helper2, &playfield_window, FALSE);
417      superbug_draw_car(helper2, &playfield_window, screen->machine->gfx, FALSE);
418418      check_collision(0);
419419
420420      *firetrk_blink = FALSE;
r5077r5078
434434
435435   bitmap_fill(bitmap, cliprect, 0x2c);
436436   tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0);
437   montecar_draw_car(screen->machine->gfx, bitmap, &playfield_window, 0, FALSE);
438   montecar_draw_car(screen->machine->gfx, bitmap, &playfield_window, 1, FALSE);
439   draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 24, 0x20, 0x08);
440   draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x20, 16, 0x20, 0x08);
437   montecar_draw_car(bitmap, &playfield_window, screen->machine->gfx, 0, FALSE);
438   montecar_draw_car(bitmap, &playfield_window, screen->machine->gfx, 1, FALSE);
439   draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x00, 24, 0x20, 0x08);
440   draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x20, 16, 0x20, 0x08);
441441
442442   if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y)
443443   {
444444      tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0);
445445
446446      bitmap_fill(helper2, &playfield_window, 0xff);
447      montecar_draw_car(screen->machine->gfx, helper2, &playfield_window, 0, TRUE);
447      montecar_draw_car(helper2, &playfield_window, screen->machine->gfx, 0, TRUE);
448448      check_collision(0);
449449
450450      bitmap_fill(helper2, &playfield_window, 0xff);
451      montecar_draw_car(screen->machine->gfx, helper2, &playfield_window, 1, TRUE);
451      montecar_draw_car(helper2, &playfield_window, screen->machine->gfx, 1, TRUE);
452452      check_collision(1);
453453   }
454454
src/mame/video/m57.c
r5077r5078
244244         flipy = !flipy;
245245      }
246246
247      drawgfx(bitmap,machine->gfx[1+bank],
247      drawgfx_transmask(bitmap,cliprect,machine->gfx[1+bank],
248248         tile_number,
249249         color,
250250         flipx,flipy,
251251         sx,sy,
252         cliprect,TRANSPARENCY_PENS,
253252         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 256+15));
254253   }
255254}
src/mame/video/mustache.c
r5077r5078
127127         sy = 240 - sy;
128128      }
129129
130      drawgfx(bitmap,gfx,
130      drawgfx_transpen(bitmap,&clip,gfx,
131131            code,
132132            color,
133133            flip_screen_get(machine),flip_screen_get(machine),
134            sx,sy,
135            &clip,TRANSPARENCY_PEN,0);
134            sx,sy,0);
136135   }
137136}
138137
src/mame/video/sprcros2.c
r5077r5078
174174            flipy = !flipy;
175175         }
176176
177         drawgfx(bitmap,machine->gfx[1],
177         drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
178178            sprcros2_spriteram[offs],
179179            color,
180180            flipx,flipy,
181181            sx,sy,
182            cliprect,TRANSPARENCY_PENS,
183182            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
184183      }
185184   }
src/mame/video/ladybug.c
r5077r5078
338338         if (spriteram[offs + i] & 0x80)
339339         {
340340            if (spriteram[offs + i] & 0x40)   /* 16x16 */
341               drawgfx(bitmap,machine->gfx[1],
341               drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
342342                     (spriteram[offs + i + 1] >> 2) + 4 * (spriteram[offs + i + 2] & 0x10),
343343                     spriteram[offs + i + 2] & 0x0f,
344344                     spriteram[offs + i] & 0x20,spriteram[offs + i] & 0x10,
345345                     spriteram[offs + i + 3],
346                     offs / 4 - 8 + (spriteram[offs + i] & 0x0f),
347                     cliprect,TRANSPARENCY_PEN,0);
346                     offs / 4 - 8 + (spriteram[offs + i] & 0x0f),0);
348347            else   /* 8x8 */
349               drawgfx(bitmap,machine->gfx[2],
348               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
350349                     spriteram[offs + i + 1] + 16 * (spriteram[offs + i + 2] & 0x10),
351350                     spriteram[offs + i + 2] & 0x0f,
352351                     spriteram[offs + i] & 0x20,spriteram[offs + i] & 0x10,
353352                     spriteram[offs + i + 3],
354                     offs / 4 + (spriteram[offs + i] & 0x0f),
355                     cliprect,TRANSPARENCY_PEN,0);
353                     offs / 4 + (spriteram[offs + i] & 0x0f),0);
356354         }
357355      }
358356   }
src/mame/video/combatsc.c
r5077r5078
479479{
480480   int base_color = (circuit*4)*16+(K007121_ctrlram[circuit][6]&0x10)*2;
481481
482   K007121_sprites_draw(circuit,bitmap,machine->gfx,machine->colortable,cliprect,source,base_color,0,0,pri_mask);
482   K007121_sprites_draw(circuit,bitmap,cliprect,machine->gfx,machine->colortable,source,base_color,0,0,pri_mask);
483483}
484484
485485
r5077r5078
630630//          if(combasc_vreg == 0x23 && (attributes & 0x02)) color += 1*16;
631631//          if(combasc_vreg == 0x66 ) color += 2*16;
632632
633         drawgfx( bitmap, gfx,
633         drawgfx_transpen( bitmap, cliprect, gfx,
634634            number, color,
635635            attributes & 0x10,0, /* flip */
636            x,y,
637            cliprect, TRANSPARENCY_PEN, 15 );
636            x,y, 15 );
638637      }
639638      source -= 8;
640639   }
src/mame/video/blueprnt.c
r5077r5078
106106      }
107107
108108      // sprites are slightly misplaced, regardless of the screen flip
109      drawgfx(bitmap, machine->gfx[1], code, 0, flipx, flipy, 2+sx, sy-1,
110         cliprect, TRANSPARENCY_PEN, 0);
109      drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, 0, flipx, flipy, 2+sx, sy-1, 0);
111110   }
112111}
113112
src/mame/video/buggychl.c
r5077r5078
111111      if (flip_screen_x_get(machine)) sx = 31 - sx;
112112      if (flip_screen_y_get(machine)) sy = 31 - sy;
113113
114      drawgfx(tmpbitmap1,machine->gfx[0],
114      drawgfx_opaque(tmpbitmap1,NULL,machine->gfx[0],
115115            code,
116116            2,
117117            flip_screen_x_get(machine),flip_screen_y_get(machine),
118            8*sx,8*sy,
119            NULL,TRANSPARENCY_NONE,0);
118            8*sx,8*sy);
120119   }
121120
122121   /* first copy to a temp bitmap doing column scroll */
src/mame/video/gotcha.c
r5077r5078
114114
115115      for (y = 0;y < height;y++)
116116      {
117         drawgfx(bitmap,machine->gfx[1],
117         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
118118               code + (flipy ? height-1 - y : y),
119119               color,
120120               flipx,flipy,
121               0x140-5 - ((sx + 0x10) & 0x1ff),0x100+1 - ((sy + 0x10 * (height - y)) & 0x1ff),
122               cliprect,TRANSPARENCY_PEN,0);
121               0x140-5 - ((sx + 0x10) & 0x1ff),0x100+1 - ((sy + 0x10 * (height - y)) & 0x1ff),0);
123122      }
124123   }
125124}
src/mame/video/starshp1.c
r5077r5078
212212   {
213213      int code = (starshp1_obj_ram[i] & 0xf) ^ 0xf;
214214
215      drawgfx(bitmap, machine->gfx[1],
215      drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
216216         code % 8,
217217         code / 8,
218218         0, 0,
219219         get_sprite_hpos(i),
220         get_sprite_vpos(i),
221         cliprect, TRANSPARENCY_PEN, 0);
220         get_sprite_vpos(i), 0);
222221   }
223222}
224223
r5077r5078
239238   if (y <= 0)
240239      y -= (yzoom * starshp1_ship_voffset) >> 16;
241240
242   drawgfxzoom(bitmap, machine->gfx[2],
241   drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[2],
243242      starshp1_ship_picture & 0x03,
244243      starshp1_ship_explode,
245244      starshp1_ship_picture & 0x80, 0,
246245      x, y,
247      cliprect, TRANSPARENCY_PEN, 0,
248      xzoom, yzoom);
246      xzoom, yzoom, 0);
249247}
250248
251249
src/mame/video/pandoras.c
r5077r5078
157157      int nflipx = sr[offs + 3] & 0x40;
158158      int nflipy = sr[offs + 3] & 0x80;
159159
160      drawgfx(bitmap,machine->gfx[0],
160      drawgfx_transmask(bitmap,cliprect,machine->gfx[0],
161161         sr[offs + 2],
162162         color,
163163         !nflipx,!nflipy,
164164         sx,sy,
165         cliprect,TRANSPARENCY_PENS,
166165         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
167166   }
168167}
src/mame/video/bigstrkb.c
r5077r5078
4444      flipx = attr & 0x0100;
4545      col = attr & 0x000f;
4646
47      drawgfx(bitmap,gfx,num,col,flipx,0,xpos,ypos,cliprect,TRANSPARENCY_PEN,15);
47      drawgfx_transpen(bitmap,cliprect,gfx,num,col,flipx,0,xpos,ypos,15);
4848      source+=8;
4949   }
5050}
src/mame/video/taito_f2.c
r5077r5078
367367   spritebank_buffered[7] = spritebank_buffered[6] + 0x400;
368368}
369369
370static void taito_f2_tc360_spritemixdraw( bitmap_t *dest_bmp,const gfx_element *gfx,
370static void taito_f2_tc360_spritemixdraw( bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
371371      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
372      const rectangle *clip,int scalex, int scaley)
372      int scalex, int scaley)
373373{
374374   int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
375375   const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
r5077r5078
857857         }
858858         else
859859         {
860            drawgfxzoom(bitmap,machine->gfx[0],
860            drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
861861                  sprite_ptr->code,
862862                  sprite_ptr->color,
863863                  sprite_ptr->flipx,sprite_ptr->flipy,
864864                  sprite_ptr->x,sprite_ptr->y,
865                  cliprect,TRANSPARENCY_PEN,0,
866                  sprite_ptr->zoomx,sprite_ptr->zoomy);
865                  sprite_ptr->zoomx,sprite_ptr->zoomy,0);
867866         }
868867      }
869868   }
r5077r5078
875874      sprite_ptr--;
876875
877876      if (!uses_tc360_mixer)
878         pdrawgfxzoom(bitmap,machine->gfx[0],
877         pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
879878               sprite_ptr->code,
880879               sprite_ptr->color,
881880               sprite_ptr->flipx,sprite_ptr->flipy,
882881               sprite_ptr->x,sprite_ptr->y,
883               cliprect,TRANSPARENCY_PEN,0,
884882               sprite_ptr->zoomx,sprite_ptr->zoomy,
885               sprite_ptr->primask);
883               priority_bitmap,sprite_ptr->primask,0);
886884      else
887         taito_f2_tc360_spritemixdraw(bitmap,machine->gfx[0],
885         taito_f2_tc360_spritemixdraw(bitmap,cliprect,machine->gfx[0],
888886               sprite_ptr->code,
889887               sprite_ptr->color,
890888               sprite_ptr->flipx,sprite_ptr->flipy,
891889               sprite_ptr->x,sprite_ptr->y,
892               cliprect,
893890               sprite_ptr->zoomx,sprite_ptr->zoomy);
894891   }
895892}
src/mame/video/gberet.c
r5077r5078
161161            flipy = !flipy;
162162         }
163163
164         drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
165            cliprect, TRANSPARENCY_PENS,
164         drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy,
166165            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
167166      }
168167   }
r5077r5078
213212            flipy = !flipy;
214213         }
215214
216         drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
217            cliprect, TRANSPARENCY_PENS,
215         drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy,
218216            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
219217      }
220218   }
src/mame/video/stfight.c
r5077r5078
281281
282282         code = stfight_sprite_base + stfight_sprite_ram[offs];
283283
284         pdrawgfx(bitmap,machine->gfx[4],
284         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
285285                 code,
286286                color,
287287                flipx,flip_screen_get(machine),
288288                sx,sy,
289                 cliprect,TRANSPARENCY_PEN,0x0f,
290                pri ? 0x02 : 0);
289                 priority_bitmap,
290                pri ? 0x02 : 0,0x0f);
291291      }
292292   }
293293}
src/mame/video/gottlieb.c
r5077r5078
233233      if (flip_screen_x_get(machine)) sx = 233 - sx;
234234      if (flip_screen_y_get(machine)) sy = 244 - sy;
235235
236      drawgfx(bitmap, machine->gfx[2],
236      drawgfx_transpen(bitmap, &clip,
237         machine->gfx[2],
237238         code, 0,
238239         flip_screen_x_get(machine), flip_screen_y_get(machine),
239         sx,sy,
240         &clip,
241         TRANSPARENCY_PEN, 0);
240         sx,sy, 0);
242241   }
243242}
244243
src/mame/video/ddragon.c
r5077r5078
157157
158158***************************************************************************/
159159
160#define DRAW_SPRITE( order, sx, sy ) drawgfx( bitmap, gfx, \
161               (which+order),color,flipx,flipy,sx,sy, \
162               cliprect,TRANSPARENCY_PEN,0);
160#define DRAW_SPRITE( order, sx, sy ) drawgfx_transpen( bitmap, \
161               cliprect,gfx, \
162               (which+order),color,flipx,flipy,sx,sy,0);
163163
164164static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectangle *cliprect)
165165{
src/mame/video/exidy.c
r5077r5078
248248   int sx = 236 - *exidy_sprite2_xpos - 4;
249249   int sy = 244 - *exidy_sprite2_ypos - 4;
250250
251   drawgfx(bitmap, machine->gfx[0],
251   drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
252252         ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 1,
253         0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
253         0, 0, sx, sy, 0);
254254
255255   /* draw sprite 1 next */
256256   if (sprite_1_enabled())
r5077r5078
262262
263263      if (sy < 0) sy = 0;
264264
265      drawgfx(bitmap, machine->gfx[0],
265      drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
266266            (*exidy_spriteno & 0x0f) + 16 * sprite_set_1, 0,
267            0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
267            0, 0, sx, sy, 0);
268268   }
269269
270270}
r5077r5078
319319   {
320320      org_1_x = 236 - *exidy_sprite1_xpos - 4;
321321      org_1_y = 244 - *exidy_sprite1_ypos - 4;
322      drawgfx(motion_object_1_vid, machine->gfx[0],
322      drawgfx_transpen(motion_object_1_vid, &clip, machine->gfx[0],
323323            (*exidy_spriteno & 0x0f) + 16 * sprite_set_1, 0,
324            0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
324            0, 0, 0, 0, 0);
325325   }
326326
327327   /* draw sprite 2 */
328328   bitmap_fill(motion_object_2_vid, &clip, 0xff);
329329   org_2_x = 236 - *exidy_sprite2_xpos - 4;
330330   org_2_y = 244 - *exidy_sprite2_ypos - 4;
331   drawgfx(motion_object_2_vid, machine->gfx[0],
331   drawgfx_transpen(motion_object_2_vid, &clip, machine->gfx[0],
332332         ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
333         0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
333         0, 0, 0, 0, 0);
334334
335335   /* draw sprite 2 clipped to sprite 1's location */
336336   bitmap_fill(motion_object_2_clip, &clip, 0xff);
r5077r5078
338338   {
339339      sx = org_2_x - org_1_x;
340340      sy = org_2_y - org_1_y;
341      drawgfx(motion_object_2_clip, machine->gfx[0],
341      drawgfx_transpen(motion_object_2_clip, &clip, machine->gfx[0],
342342            ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
343            0, 0, sx, sy, &clip, TRANSPARENCY_PEN, 0);
343            0, 0, sx, sy, 0);
344344   }
345345
346346   /* scan for collisions */
src/mame/video/xxmissio.c
r5077r5078
8686}
8787
8888
89static void draw_sprites(bitmap_t *bitmap, gfx_element **gfx, const rectangle *cliprect)
89static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
9090{
9191   int offs;
9292   int chr,col;
r5077r5078
119119
120120      px &= 0x1ff;
121121
122      drawgfx(bitmap,gfx[1],
122      drawgfx_transpen(bitmap,cliprect,gfx,
123123         chr,
124124         col,
125125         fx,fy,
126         px,py,
127         cliprect,TRANSPARENCY_PEN,0);
126         px,py,0);
128127
129128      if (px>0x1e0)
130         drawgfx(bitmap,gfx[1],
129         drawgfx_transpen(bitmap,cliprect,gfx,
131130            chr,
132131            col,
133132            fx,fy,
134            px-0x200,py,
135            cliprect,TRANSPARENCY_PEN,0);
133            px-0x200,py,0);
136134
137135   }
138136}
r5077r5078
147145   tilemap_set_scrolly(bg_tilemap, 0, yscroll);
148146
149147   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
150   draw_sprites(bitmap, screen->machine->gfx, cliprect);
148   draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
151149   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
152150
153151   return 0;
src/mame/video/mugsmash.c
r5077r5078
4848      xpos -= 28;
4949      ypos -= 16;
5050
51      drawgfx(
51      drawgfx_transpen(
5252            bitmap,
53            cliprect,
5354            gfx,
5455            num,
5556            colour,
5657            flipx,0,
57            xpos,ypos,
58            cliprect,
59            TRANSPARENCY_PEN,0
58            xpos,ypos,0
6059            );
6160
6261      source += 0x8;
src/mame/video/pcktgal.c
r5077r5078
8282            if (flipy) flipy=0; else flipy=1;
8383         }
8484
85         drawgfx(bitmap,machine->gfx[1],
85         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
8686               spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8),
8787               (spriteram[offs+1] & 0x70) >> 4,
8888               flipx,flipy,
89               sx,sy,
90               cliprect,TRANSPARENCY_PEN,0);
89               sx,sy,0);
9190      }
9291   }
9392}
src/mame/video/hng64.c
r5077r5078
199199      {
200200         for(xdrw=0;xdrw<=chainx;xdrw++)
201201         {
202            drawgfxzoom(bitmap,gfx,tileno,pal,xflip,yflip,xpos+(xinc*xdrw),ypos+(yinc*ydrw),cliprect,TRANSPARENCY_PEN,0,zoomx,zoomy/*0x10000*/);
202            drawgfxzoom_transpen(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,xpos+(xinc*xdrw),ypos+(yinc*ydrw),zoomx,zoomy/*0x10000*/,0);
203203            tileno++;
204204         }
205205      }
src/mame/video/solomon.c
r5077r5078
8989         flipy = !flipy;
9090      }
9191
92      drawgfx(bitmap, machine->gfx[2],
92      drawgfx_transpen(bitmap, cliprect,
93         machine->gfx[2],
9394         code, color,
9495         flipx, flipy,
95         sx, sy,
96         cliprect,
97         TRANSPARENCY_PEN, 0);
96         sx, sy, 0);
9897   }
9998}
10099
src/mame/video/gladiatr.c
r5077r5078
236236
237237            int t = tile_offset[ey][ex] + tile_number;
238238
239            drawgfx(bitmap,machine->gfx[2],
239            drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
240240                  t,
241241                  color,
242242                  xflip, yflip,
243                  sx+x*16, sy+y*16,
244                  cliprect,TRANSPARENCY_PEN,0);
243                  sx+x*16, sy+y*16,0);
245244         }
246245      }
247246   }
src/mame/video/goindol.c
r5077r5078
112112         tile   += tile;
113113         palette    = sprite_ram[offs+2] >> 3;
114114
115         drawgfx(bitmap,machine->gfx[gfxbank],
115         drawgfx_transpen(bitmap,cliprect,
116                  machine->gfx[gfxbank],
116117                  tile,
117118                  palette,
118119                  flip_screen_get(machine),flip_screen_get(machine),
119                  sx,sy,
120                  cliprect,
121                  TRANSPARENCY_PEN, 0);
122         drawgfx(bitmap,machine->gfx[gfxbank],
120                  sx,sy, 0);
121         drawgfx_transpen(bitmap,cliprect,
122                  machine->gfx[gfxbank],
123123                  tile+1,
124124                  palette,
125125                  flip_screen_get(machine),flip_screen_get(machine),
126                  sx,sy + (flip_screen_get(machine) ? -8 : 8),
127                  cliprect,
128                  TRANSPARENCY_PEN, 0);
126                  sx,sy + (flip_screen_get(machine) ? -8 : 8), 0);
129127      }
130128   }
131129}
src/mame/video/taito_l.c
r5077r5078
277277         flipy = !flipy;
278278      }
279279
280      pdrawgfx(bitmap,machine->gfx[1],
280      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
281281            code,
282282            color,
283283            flipx,flipy,
284284            sx,sy,
285            cliprect,TRANSPARENCY_PEN,0,
286            (color & 0x08) ? 0xaa : 0x00);
285            priority_bitmap,
286            (color & 0x08) ? 0xaa : 0x00,0);
287287   }
288288}
289289
src/mame/video/gyruss.c
r5077r5078
134134}
135135
136136
137static void draw_sprites(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect)
137static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx)
138138{
139139   int offs;
140140
r5077r5078
149149      int flip_x = ~gyruss_spriteram[offs + 2] & 0x40;
150150      int flip_y =  gyruss_spriteram[offs + 2] & 0x80;
151151
152      drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PEN, 0);
152      drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, 0);
153153   }
154154}
155155
r5077r5078
163163   }
164164
165165   tilemap_draw(bitmap, cliprect, gyruss_tilemap, TILEMAP_DRAW_OPAQUE, 0);
166   draw_sprites(screen->machine->gfx, bitmap, cliprect);
166   draw_sprites(bitmap, cliprect, screen->machine->gfx);
167167   tilemap_draw(bitmap, cliprect, gyruss_tilemap, 0, 0);
168168
169169   return 0;
src/mame/video/groundfx.c
r5077r5078
203203      else
204204         clipper=cliprect;
205205
206      pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
206      pdrawgfxzoom_transpen(bitmap,clipper,machine->gfx[sprite_ptr->gfx],
207207            sprite_ptr->code,
208208            sprite_ptr->color,
209209            sprite_ptr->flipx,sprite_ptr->flipy,
210210            sprite_ptr->x,sprite_ptr->y,
211            clipper,TRANSPARENCY_PEN,0,
212211            sprite_ptr->zoomx,sprite_ptr->zoomy,
213            primasks[sprite_ptr->pri]);
212            priority_bitmap,primasks[sprite_ptr->pri],0);
214213   }
215214}
216215
src/mame/video/fastlane.c
r5077r5078
163163   tilemap_set_scrolly( layer0, 0, K007121_ctrlram[0][0x02] );
164164
165165   tilemap_draw(bitmap,&finalclip0,layer0,0,0);
166   K007121_sprites_draw(0,bitmap,screen->machine->gfx,screen->machine->colortable,cliprect,spriteram,0,40,0,-1);
166   K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable,spriteram,0,40,0,-1);
167167   tilemap_draw(bitmap,&finalclip1,layer1,0,0);
168168   return 0;
169169}
src/mame/video/cabal.c
r5077r5078
127127            flipy = !flipy;
128128         }
129129
130         drawgfx( bitmap,machine->gfx[2],
130         drawgfx_transpen( bitmap,cliprect,machine->gfx[2],
131131            tile_number,
132132            color,
133133            flipx,flipy,
134            sx,sy,
135            cliprect,TRANSPARENCY_PEN,0xf );
134            sx,sy,0xf );
136135      }
137136   }
138137}
src/mame/video/m92.c
r5077r5078
340340            for (i=0; i<y_multi; i++)
341341            {
342342               if (flip_screen_get(machine)) {
343                  pdrawgfx(bitmap,machine->gfx[1],
343                  pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
344344                        sprite + s_ptr,
345345                        colour,
346346                        !fx,!fy,
347347                        464-x,240-(y-i*16),
348                        cliprect,TRANSPARENCY_PEN,0,pri_back);
348                        priority_bitmap,pri_back,0);
349349
350350                  // wrap around x
351                  pdrawgfx(bitmap,machine->gfx[1],
351                  pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
352352                        sprite + s_ptr,
353353                        colour,
354354                        !fx,!fy,
355355                        464-x+512,240-(y-i*16),
356                        cliprect,TRANSPARENCY_PEN,0,pri_back);
356                        priority_bitmap,pri_back,0);
357357               } else {
358                  pdrawgfx(bitmap,machine->gfx[1],
358                  pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
359359                        sprite + s_ptr,
360360                        colour,
361361                        fx,fy,
362362                        x,y-i*16,
363                        cliprect,TRANSPARENCY_PEN,0,pri_back);
363                        priority_bitmap,pri_back,0);
364364
365365                  // wrap around x
366                  pdrawgfx(bitmap,machine->gfx[1],
366                  pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
367367                        sprite + s_ptr,
368368                        colour,
369369                        fx,fy,
370370                        x-512,y-i*16,
371                        cliprect,TRANSPARENCY_PEN,0,pri_back);
371                        priority_bitmap,pri_back,0);
372372               }
373373               if (fy) s_ptr++; else s_ptr--;
374374            }
src/mame/video/m58.c
r5077r5078
216216 *
217217 *************************************/
218218
219#define DRAW_SPRITE(code, sy) drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PENS, colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 512));
219#define DRAW_SPRITE(code, sy) drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 512));
220220
221221static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
222222{
src/mame/video/destroyr.c
r5077r5078
4343            continue;
4444      }
4545
46      drawgfx(bitmap, screen->machine->gfx[2], num, 0, flipx, 0,
47         horz, 16 * i, cliprect, TRANSPARENCY_PEN, 0);
46      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], num, 0, flipx, 0,
47         horz, 16 * i, 0);
4848   }
4949
5050   /* draw alpha numerics */
r5077r5078
5555      {
5656         int num = destroyr_alpha_num_ram[32 * i + j];
5757
58         drawgfx(bitmap, screen->machine->gfx[0], num, 0, 0, 0,
59            8 * j, 8 * i, cliprect, TRANSPARENCY_PEN, 0);
58         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], num, 0, 0, 0,
59            8 * j, 8 * i, 0);
6060      }
6161   }
6262
r5077r5078
6767      int horz = 256 - destroyr_minor_obj_ram[i + 2];
6868      int vert = 256 - destroyr_minor_obj_ram[i + 4];
6969
70      drawgfx(bitmap, screen->machine->gfx[1], destroyr_minor_obj_ram[i + 0], 0, 0, 0,
71         horz, vert, cliprect, TRANSPARENCY_PEN, 0);
70      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], destroyr_minor_obj_ram[i + 0], 0, 0, 0,
71         horz, vert, 0);
7272   }
7373
7474   /* draw waves */
7575
7676   for (i = 0; i < 4; i++)
7777   {
78      drawgfx(bitmap, screen->machine->gfx[3], destroyr_wavemod ? 1 : 0, 0, 0, 0,
79         64 * i, 0x4e, cliprect, TRANSPARENCY_PEN, 0);
78      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[3], destroyr_wavemod ? 1 : 0, 0, 0, 0,
79         64 * i, 0x4e, 0);
8080   }
8181
8282   /* draw cursor */
src/mame/video/fcombat.c
r5077r5078
195195         else
196196            code &= ~0x10, code2 |= 0x10;
197197
198         drawgfx(bitmap, gfx, code2, color, xflip, yflip, x, y + gfx->height,
199                 cliprect, TRANSPARENCY_PEN, 0);
198         drawgfx_transpen(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height, 0);
200199      }
201200
202201      if(flags&0x10)
r5077r5078
204203
205204
206205
207         drawgfx(bitmap, gfx, code2+16, color, xflip, yflip, x, y + gfx->height,
208                 cliprect, TRANSPARENCY_PEN, 0);
209         drawgfx(bitmap, gfx, code2+16*2, color, xflip, yflip, x, y + 2*gfx->height,
210                 cliprect, TRANSPARENCY_PEN, 0);
211         drawgfx(bitmap, gfx, code2+16*3, color, xflip, yflip, x, y + 3*gfx->height,
212                 cliprect, TRANSPARENCY_PEN, 0);
206         drawgfx_transpen(bitmap, cliprect, gfx, code2+16, color, xflip, yflip, x, y + gfx->height, 0);
207         drawgfx_transpen(bitmap, cliprect, gfx, code2+16*2, color, xflip, yflip, x, y + 2*gfx->height, 0);
208         drawgfx_transpen(bitmap, cliprect, gfx, code2+16*3, color, xflip, yflip, x, y + 3*gfx->height, 0);
213209
214210      }
215211
216212
217213
218      drawgfx(bitmap, gfx, code, color, xflip, yflip, x, y,
219              cliprect, TRANSPARENCY_PEN, 0);
214      drawgfx_transpen(bitmap, cliprect, gfx, code, color, xflip, yflip, x, y, 0);
220215
221216      if (doubled) i += 4;
222217   }
r5077r5078
229224         int y = fcombat_cocktail_flip ? (31*8 - 8*sy) : 8*sy;
230225
231226         offs = sx + sy * 64;
232         drawgfx(bitmap, screen->machine->gfx[0],
227         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
233228            videoram[offs] + 256 * char_bank,
234229            ((videoram[offs] & 0xf0) >> 4) + char_palette * 16,
235            fcombat_cocktail_flip, fcombat_cocktail_flip, x, y,
236            cliprect, TRANSPARENCY_PEN, 0);
230            fcombat_cocktail_flip, fcombat_cocktail_flip, x, y, 0);
237231      }
238232   return 0;
239233}
src/mame/video/thoop2.c
r5077r5078
186186            ex = xflip ? (spr_size-1-x) : x;
187187            ey = yflip ? (spr_size-1-y) : y;
188188
189            drawgfx(bitmap,gfx,number + x_offset[ex] + y_offset[ey],
189            drawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey],
190190                  color,xflip,yflip,
191                  sx-0x0f+x*8,sy+y*8,
192                  cliprect,TRANSPARENCY_PEN,0);
191                  sx-0x0f+x*8,sy+y*8,0);
193192         }
194193      }
195194   }
src/mame/video/wwfwfest.c
r5077r5078
199199         for (count=0;count<chain;count++) {
200200            if (flip_screen_get(machine)) {
201201               if (!flipy) {
202                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),cliprect,TRANSPARENCY_PEN,0);
202                  drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),0);
203203               } else {
204                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+16*count,cliprect,TRANSPARENCY_PEN,0);
204                  drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+16*count,0);
205205               }
206206            } else {
207207                  if (flipy) {
208                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count),cliprect,TRANSPARENCY_PEN,0);
208                  drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count),0);
209209               } else {
210                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-16*count,cliprect,TRANSPARENCY_PEN,0);
210                  drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-16*count,0);
211211               }
212212            }
213213         }
src/mame/video/marineb.c
r5077r5078
202202         sx++;
203203      }
204204
205      drawgfx(bitmap,screen->machine->gfx[gfx],
205      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx],
206206            code,
207207            col,
208208            flipx,flipy,
209            sx,sy,
210            cliprect,TRANSPARENCY_PEN,0);
209            sx,sy,0);
211210   }
212211   return 0;
213212}
r5077r5078
248247         sx++;
249248      }
250249
251      drawgfx(bitmap,screen->machine->gfx[1],
250      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
252251            code >> 2,
253252            col,
254253            flipx,flipy,
255            sx,sy,
256            cliprect,TRANSPARENCY_PEN,0);
254            sx,sy,0);
257255   }
258256
259257   /* draw the big sprite */
r5077r5078
278276
279277   code >>= 4;
280278
281   drawgfx(bitmap,screen->machine->gfx[2],
279   drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
282280         code,
283281         col,
284282         flipx,flipy,
285         sx,sy,
286         cliprect,TRANSPARENCY_PEN,0);
283         sx,sy,0);
287284
288285   /* draw again for wrap around */
289286
290   drawgfx(bitmap,screen->machine->gfx[2],
287   drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
291288         code,
292289         col,
293290         flipx,flipy,
294         sx-256,sy,
295         cliprect,TRANSPARENCY_PEN,0);
291         sx-256,sy,0);
296292   return 0;
297293}
298294
r5077r5078
350346         sx--;
351347      }
352348
353      drawgfx(bitmap,screen->machine->gfx[gfx],
349      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx],
354350            code,
355351            col,
356352            flipx,flipy,
357            sx,sy,
358            cliprect,TRANSPARENCY_PEN,0);
353            sx,sy,0);
359354   }
360355   return 0;
361356}
r5077r5078
398393         flipx = !flipx;
399394      }
400395
401      drawgfx(bitmap,screen->machine->gfx[1],
396      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
402397            code >> 2,
403398            col,
404399            flipx,flipy,
405            sx,sy,
406            cliprect,TRANSPARENCY_PEN,0);
400            sx,sy,0);
407401   }
408402   return 0;
409403}
r5077r5078
461455         sx--;
462456      }
463457
464      drawgfx(bitmap,screen->machine->gfx[gfx],
458      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx],
465459            code,
466460            col,
467461            flipx,flipy,
468            sx,sy,
469            cliprect,TRANSPARENCY_PEN,0);
462            sx,sy,0);
470463   }
471464   return 0;
472465}
src/mame/video/pktgaldx.c
r5077r5078
5858
5959      while (multi >= 0)
6060      {
61         drawgfx(bitmap,machine->gfx[2],
61         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
6262               sprite - multi * inc,
6363               colour,
6464               fx,fy,
65               x,y + mult * multi,
66               cliprect,TRANSPARENCY_PEN,0);
65               x,y + mult * multi,0);
6766
6867         multi--;
6968      }
r5077r5078
123122      y&=0x1ff;
124123      y-=8;
125124
126      drawgfx(bitmap,screen->machine->gfx[0],tileno^0x1000,colour,0,0,x,y,cliprect,TRANSPARENCY_PEN,0);
125      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x1000,colour,0,0,x,y,0);
127126   }
128127
129128   for (offset = 0x1600/2;offset<0x2000/2;offset+=8)
r5077r5078
137136      y&=0x1ff;
138137      y-=8;
139138
140      drawgfx(bitmap,screen->machine->gfx[0],tileno^0x4000,colour,0,0,x,y,cliprect,TRANSPARENCY_PEN,0);
139      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x4000,colour,0,0,x,y,0);
141140   }
142141
143142   for (offset = 0x2000/2;offset<0x4000/2;offset+=8)
r5077r5078
151150      y&=0x1ff;
152151      y-=8;
153152
154      drawgfx(bitmap,screen->machine->gfx[0],tileno^0x3000,colour,0,0,x,y,cliprect,TRANSPARENCY_PEN,0);
153      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x3000,colour,0,0,x,y,0);
155154   }
156155
157156   return 0;
src/mame/video/timeplt.c
r5077r5078
171171      int flipx = ~spriteram_2[offs] & 0x40;
172172      int flipy = spriteram_2[offs] & 0x80;
173173
174      drawgfx(bitmap,machine->gfx[1],
174      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
175175            code,
176176            color,
177177            flipx,flipy,
178            sx,sy,
179            cliprect,TRANSPARENCY_PEN,0);
178            sx,sy,0);
180179   }
181180}
182181
src/mame/video/fuukifg2.c
r5077r5078
202202         for (x = xstart; x != xend; x += xinc)
203203         {
204204            if (xzoom == (16*8) && yzoom == (16*8))
205               pdrawgfx(      bitmap,screen->machine->gfx[0],
205               pdrawgfx_transpen(      bitmap,cliprect,screen->machine->gfx[0],
206206                           code++,
207207                           attr & 0x3f,
208208                           flipx, flipy,
209209                           sx + x * 16, sy + y * 16,
210                           cliprect,TRANSPARENCY_PEN,15,
211                           pri_mask   );
210                           priority_bitmap,
211                           pri_mask,15   );
212212            else
213               pdrawgfxzoom(   bitmap,screen->machine->gfx[0],
213               pdrawgfxzoom_transpen(   bitmap,cliprect,screen->machine->gfx[0],
214214                           code++,
215215                           attr & 0x3f,
216216                           flipx, flipy,
217217                           sx + (x * xzoom) / 8, sy + (y * yzoom) / 8,
218                           cliprect,TRANSPARENCY_PEN,15,
219                           (0x10000/0x10/8) * (xzoom + 8),(0x10000/0x10/8) * (yzoom + 8),   // nearest greater integer value to avoid holes
220                           pri_mask   );
218                           (0x10000/0x10/8) * (xzoom + 8),(0x10000/0x10/8) * (yzoom + 8),   priority_bitmap,// nearest greater integer value to avoid holes
219                           pri_mask,15   );
221220         }
222221      }
223222
src/mame/video/vulgus.c
r5077r5078
197197
198198      do
199199      {
200         drawgfx(bitmap,machine->gfx[2],
200         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
201201               code + i,
202202               col,
203203               flip_screen_get(machine),flip_screen_get(machine),
204               sx, sy + 16 * i * dir,
205               cliprect,TRANSPARENCY_PEN,15);
204               sx, sy + 16 * i * dir,15);
206205
207206         /* draw again with wraparound */
208         drawgfx(bitmap,machine->gfx[2],
207         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
209208               code + i,
210209               col,
211210               flip_screen_get(machine),flip_screen_get(machine),
212               sx, sy + 16 * i * dir -  dir * 256,
213               cliprect,TRANSPARENCY_PEN,15);
211               sx, sy + 16 * i * dir -  dir * 256,15);
214212         i--;
215213      } while (i >= 0);
216214   }
src/mame/video/sderby.c
r5077r5078
8383      code = spriteram16[offs+2] >> codeshift;
8484      color = (spriteram16[offs+1] & 0x3e00) >> 9;
8585
86      drawgfx(bitmap,machine->gfx[1],
86      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
8787            code,
8888            color/colordiv+48,
8989            flipx,0,
90            sx,sy,
91            cliprect,TRANSPARENCY_PEN,0);
90            sx,sy,0);
9291   }
9392}
9493
src/mame/video/circus.c
r5077r5078
111111   draw_line (bitmap,cliprect,0,193,17,193,0);
112112   draw_line (bitmap,cliprect,231,193,248,193,0);
113113
114   drawgfx(bitmap,machine->gfx[1],
114   drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
115115         clown_z,
116116         0,
117117         0,0,
118         clown_y,clown_x,
119         cliprect,TRANSPARENCY_PEN,0);
118         clown_y,clown_x,0);
120119}
121120
122121VIDEO_UPDATE( circus )
r5077r5078
161160
162161static void robotbwl_draw_ball(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
163162{
164   drawgfx(bitmap,machine->gfx[1],
163   drawgfx_transpen(bitmap,/* Y is horizontal position */
164         cliprect,machine->gfx[1],
165165         clown_z,
166166         0,
167167         0,0,
168         clown_y+8,clown_x+8, /* Y is horizontal position */
169         cliprect,TRANSPARENCY_PEN,0);
168         clown_y+8,clown_x+8,0);
170169}
171170
172171VIDEO_UPDATE( robotbwl )
r5077r5078
180179
181180static void crash_draw_car(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
182181{
183   drawgfx(bitmap,machine->gfx[1],
182   drawgfx_transpen(bitmap,/* Y is horizontal position */
183      cliprect,machine->gfx[1],
184184      clown_z,
185185      0,
186186      0,0,
187      clown_y,clown_x, /* Y is horizontal position */
188      cliprect,TRANSPARENCY_PEN,0);
187      clown_y,clown_x,0);
189188}
190189
191190VIDEO_UPDATE( crash )
src/mame/video/zac2650.c
r5077r5078
6565
6666        /* Draw first sprite */
6767
68       drawgfx(spritebitmap,machine->gfx[expand],
68       drawgfx_opaque(spritebitmap,0, machine->gfx[expand],
6969             first * 2,
7070             0,
7171             0,0,
72             fx,fy,
73             0, TRANSPARENCY_NONE, 0);
72             fx,fy);
7473
7574        /* Get fingerprint */
7675
r5077r5078
9291
9392        /* Blackout second sprite */
9493
95       drawgfx(spritebitmap,machine->gfx[1],
94       drawgfx_transpen(spritebitmap,0, machine->gfx[1],
9695             second * 2,
9796             1,
9897             0,0,
99             (zac2650_s2636_0_ram[second * 0x10 + 10] * 4)-22,(zac2650_s2636_0_ram[second * 0x10 + 12] * 3) + 3,
100             0, TRANSPARENCY_PEN, 0);
98             (zac2650_s2636_0_ram[second * 0x10 + 10] * 4)-22,(zac2650_s2636_0_ram[second * 0x10 + 12] * 3) + 3, 0);
10199
102100        /* Remove fingerprint */
103101
r5077r5078
119117
120118        /* Zero bitmap */
121119
122       drawgfx(spritebitmap,machine->gfx[expand],
120       drawgfx_opaque(spritebitmap,0, machine->gfx[expand],
123121             first * 2,
124122             1,
125123             0,0,
126             fx,fy,
127             0, TRANSPARENCY_NONE, 0);
124             fx,fy);
128125    }
129126
130127   return Checksum;
r5077r5078
181178            int x,y;
182179
183180            /* Sprite->Background collision detection */
184         drawgfx(bitmap,machine->gfx[expand],
181         drawgfx_transpen(bitmap,0, machine->gfx[expand],
185182                spriteno,
186183               1,
187184                0,0,
188                bx,by,
189                0, TRANSPARENCY_PEN, 0);
185                bx,by, 0);
190186
191187           for (x = bx; x < bx + machine->gfx[expand]->width; x++)
192188           {
r5077r5078
208204                }
209205           }
210206
211         drawgfx(bitmap,machine->gfx[expand],
207         drawgfx_transpen(bitmap,0, machine->gfx[expand],
212208                spriteno,
213209               0,
214210                0,0,
215                bx,by,
216                0, TRANSPARENCY_PEN, 0);
211                bx,by, 0);
217212        }
218213    }
219214
src/mame/video/shangha3.c
r5077r5078
215215                  if (flipy) dy = sy + sizey-15 - dy;
216216                  else dy = sy + dy;
217217
218                  drawgfx(rawbitmap,space->machine->gfx[0],
218                  drawgfx_transpen(rawbitmap,&myclip,space->machine->gfx[0],
219219                        (tile & 0x0fff) | (code & 0xf000),
220220                        (tile >> 12) | (color & 0x70),
221221                        flipx,flipy,
222                        dx,dy,
223                        &myclip,TRANSPARENCY_PEN,15);
222                        dx,dy,15);
224223               }
225224            }
226225         }
src/mame/video/vastar.c
r5077r5078
157157         if (!flip_screen_get(machine))
158158            sy = 224 - sy;
159159
160         drawgfx(bitmap,machine->gfx[2],
160         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
161161               code/2,
162162               color,
163163               flipx,flipy,
164               sx,sy,
165               cliprect,TRANSPARENCY_PEN,0);
164               sx,sy,0);
166165         /* redraw with wraparound */
167         drawgfx(bitmap,machine->gfx[2],
166         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
168167               code/2,
169168               color,
170169               flipx,flipy,
171               sx,sy+256,
172               cliprect,TRANSPARENCY_PEN,0);
170               sx,sy+256,0);
173171      }
174172      else
175173      {
176174         if (!flip_screen_get(machine))
177175            sy = 240 - sy;
178176
179         drawgfx(bitmap,machine->gfx[1],
177         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
180178               code,
181179               color,
182180               flipx,flipy,
183               sx,sy,
184               cliprect,TRANSPARENCY_PEN,0);
181               sx,sy,0);
185182      }
186183   }
187184}
src/mame/video/taotaido.c
r5077r5078
105105            else sx = ((xpos + xzoom * x / 2 + 16) & 0x1ff) - 16;
106106
107107
108         drawgfxzoom(bitmap,gfx,
108         drawgfxzoom_transpen(bitmap,cliprect,gfx,
109109                  realtile,
110110                  color,
111111                  xflip,yflip,
112112                  sx,sy,
113                  cliprect,TRANSPARENCY_PEN,15,
114                  xzoom << 11, yzoom << 11);
113                  xzoom << 11, yzoom << 11,15);
115114
116115         tile++;
117116
src/mame/video/taito_f3.c
r5077r5078
26192619   dest++;                  \
26202620   pri++;
26212621
2622INLINE void f3_drawgfx( running_machine *machine,
2623      bitmap_t *dest_bmp,const gfx_element *gfx,
2622INLINE void f3_drawgfx(
2623      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
26242624      UINT32 code,
26252625      UINT32 color,
26262626      int flipx,int flipy,
26272627      int sx,int sy,
2628      const rectangle *clip,
26292628      UINT8 pri_dst)
26302629{
26312630   rectangle myclip;
r5077r5078
26512650
26522651   if( gfx )
26532652   {
2654      const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
2653      const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
26552654      const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
26562655
26572656      {
r5077r5078
27832782#undef NEXT_P
27842783
27852784
2786INLINE void f3_drawgfxzoom(running_machine *machine,
2787      bitmap_t *dest_bmp,const gfx_element *gfx,
2785INLINE void f3_drawgfxzoom(
2786      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
27882787      UINT32 code,
27892788      UINT32 color,
27902789      int flipx,int flipy,
27912790      int sx,int sy,
2792      const rectangle *clip,
27932791      int scalex, int scaley,
27942792      UINT8 pri_dst)
27952793{
r5077r5078
28162814
28172815   if( gfx )
28182816   {
2819      const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
2817      const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
28202818      const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
28212819
28222820      {
r5077r5078
32063204      sprite_pri_usage|=1<<pri;
32073205
32083206      if(sprite_ptr->zoomx==16 && sprite_ptr->zoomy==16)
3209         f3_drawgfx(machine,
3210               bitmap,sprite_gfx,
3207         f3_drawgfx(
3208               bitmap,cliprect,sprite_gfx,
32113209               sprite_ptr->code,
32123210               sprite_ptr->color & (~sprite_extra_planes),
32133211               sprite_ptr->flipx,sprite_ptr->flipy,
32143212               sprite_ptr->x,sprite_ptr->y,
3215               cliprect,
32163213               pri);
32173214      else
3218         f3_drawgfxzoom(machine,
3219               bitmap,sprite_gfx,
3215         f3_drawgfxzoom(
3216               bitmap,cliprect,sprite_gfx,
32203217               sprite_ptr->code,
32213218               sprite_ptr->color & (~sprite_extra_planes),
32223219               sprite_ptr->flipx,sprite_ptr->flipy,
32233220               sprite_ptr->x,sprite_ptr->y,
3224               cliprect,
32253221               sprite_ptr->zoomx,sprite_ptr->zoomy,
32263222               pri);
32273223   }
src/mame/video/gaelco2.c
r5077r5078
383383
384384               /* normal sprite, pen 0 transparent */
385385               if (color_effect == 0){
386                  drawgfx(bitmap, gfx, number,
386                  drawgfx_transpen(bitmap, cliprect, gfx, number,
387387                     color, xflip, yflip,
388388                     ((sx + ex*16) & 0x3ff) + spr_x_adjust,
389                     ((sy + ey*16) & 0x1ff),
390                     cliprect, TRANSPARENCY_PEN, 0);
389                     ((sy + ey*16) & 0x1ff), 0);
391390
392391               } else { /* last palette entry is reserved for shadows and highlights */
393392
src/mame/video/homerun.c
r5077r5078
7777      color = (spriteram[offs+2] & 0x7)+8 ;
7878      flipx=(spriteram[offs+2] & 0x40) ;
7979      flipy=(spriteram[offs+2] & 0x80) ;
80      drawgfx(bitmap,machine->gfx[1],
80      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
8181            code,
8282            color,
8383            flipx,flipy,
84            sx,sy,
85            cliprect,TRANSPARENCY_PEN,0);
84            sx,sy,0);
8685   }
8786}
8887
src/mame/video/champbas.c
r5077r5078
210210      int sx = spriteram_2[offs + 1] - 16;
211211      int sy = 255 - spriteram_2[offs];
212212
213      drawgfx(bitmap, gfx,
213      drawgfx_transmask(bitmap, cliprect,
214            gfx,
214215            code, color,
215216            flipx, flipy,
216217            sx, sy,
217            cliprect,
218            TRANSPARENCY_PENS,
219218            colortable_get_transpen_mask(machine->colortable, gfx, color, 0));
220219
221220      // wraparound
222      drawgfx(bitmap, gfx,
221      drawgfx_transmask(bitmap, cliprect,
222            gfx,
223223            code, color,
224224            flipx, flipy,
225225            sx + 256, sy,
226            cliprect,
227            TRANSPARENCY_PENS,
228226            colortable_get_transpen_mask(machine->colortable, gfx, color, 0));
229227   }
230228}
r5077r5078
250248      color = ( obj1[offs+1] ) & 0x0f;
251249      bank = ( ( obj1[offs+1] >> 4 ) & 1 );
252250
253      drawgfx(bitmap,machine->gfx[1],
251      drawgfx_transpen(bitmap,cliprect,
252            machine->gfx[1],
254253            code + (bank << 6),
255254            color,
256255            flipx, flipy,
257            sx,sy,
258            cliprect,
259            TRANSPARENCY_PEN,0);
256            sx,sy,0);
260257   }
261258
262259   obj1 = spriteram_2;
r5077r5078
274271      flipy = ( ~obj1[offs] ) & 0x02;
275272      color = ( obj1[offs+1] ) & 0x0f;
276273
277      drawgfx(bitmap,machine->gfx[2],
274      drawgfx_transmask(bitmap,cliprect,
275            machine->gfx[2],
278276            code,
279277            color,
280278            flipx, flipy,
281279            sx,sy,
282            cliprect,
283            TRANSPARENCY_PENS,
284280            colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0x10));
285281   }
286282}
src/mame/video/baraduke.c
r5077r5078
273273         {
274274            for (x = 0;x <= sizex;x++)
275275            {
276               drawgfx( bitmap, machine->gfx[3],
276               drawgfx_transpen( bitmap, cliprect,machine->gfx[3],
277277                  sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
278278                  color,
279279                  flipx,flipy,
280280                  -71 + ((sx + 16*x) & 0x1ff),
281                  1 + ((sy + 16*y) & 0xff),
282                  cliprect,TRANSPARENCY_PEN,0xf);
281                  1 + ((sy + 16*y) & 0xff),0xf);
283282            }
284283         }
285284      }
src/mame/video/ssozumo.c
r5077r5078
162162            flipy = !flipy;
163163         }
164164
165         drawgfx(bitmap, machine->gfx[2],
165         drawgfx_transpen(bitmap, cliprect,
166            machine->gfx[2],
166167            code, color,
167168            flipx, flipy,
168            sx, sy,
169            cliprect,
170            TRANSPARENCY_PEN, 0);
169            sx, sy, 0);
171170      }
172171   }
173172}
src/mame/video/m107.c
r5077r5078
190190
191191         for (i=0; i<y_multi; i++)
192192         {
193            drawgfx(bitmap,machine->gfx[1],
193            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
194194                  sprite + s_ptr,
195195                  colour,
196196                  fx,fy,
197                  x,y-i*16,
198                  cliprect,TRANSPARENCY_PEN,0);
197                  x,y-i*16,0);
199198            if (fy) s_ptr++; else s_ptr--;
200199         }
201200      }
r5077r5078
218217               if (!ffy) sprite+=y_multi-1;
219218               for (i=0; i<y_multi; i++)
220219               {
221                  drawgfx(bitmap,machine->gfx[1],
220                  drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
222221                        sprite+(ffy?i:-i),
223222                        colour,
224223                        ffx,ffy,
225                        (x+xdisp)&0x1ff,(y-ydisp-16*i)&0x1ff,
226                        cliprect,TRANSPARENCY_PEN,0);
224                        (x+xdisp)&0x1ff,(y-ydisp-16*i)&0x1ff,0);
227225               }
228226
229227               if (rom[rom_offs+1]&0x80) break;   /* end of block */
src/mame/video/ninjaw.c
r5077r5078
128128      sprite_ptr->x = curx;
129129      sprite_ptr->y = cury;
130130
131      drawgfx(bitmap,machine->gfx[0],
131      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
132132            sprite_ptr->code,
133133            sprite_ptr->color,
134134            sprite_ptr->flipx,sprite_ptr->flipy,
135            sprite_ptr->x,sprite_ptr->y,
136            cliprect,TRANSPARENCY_PEN,0);
135            sprite_ptr->x,sprite_ptr->y,0);
137136   }
138137
139138#ifdef MAME_DEBUG
src/mame/video/matmania.c
r5077r5078
150150      sx = 15 - offs / 32;
151151      sy = offs % 32;
152152
153      drawgfx(tmpbitmap,screen->machine->gfx[1],
153      drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[1],
154154            videoram[offs] + ((colorram[offs] & 0x08) << 5),
155155            (colorram[offs] & 0x30) >> 4,
156156            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
157            16*sx,16*sy,
158            0,TRANSPARENCY_NONE,0);
157            16*sx,16*sy);
159158   }
160159
161160   /* Update the tiles in the right tile ram bank */
r5077r5078
167166      sx = 15 - offs / 32;
168167      sy = offs % 32;
169168
170      drawgfx(tmpbitmap2,screen->machine->gfx[1],
169      drawgfx_opaque(tmpbitmap2,0,screen->machine->gfx[1],
171170            matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x08) << 5),
172171            (matmania_colorram3[offs] & 0x30) >> 4,
173172            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
174            16*sx,16*sy,
175            0,TRANSPARENCY_NONE,0);
173            16*sx,16*sy);
176174   }
177175
178176
r5077r5078
194192   {
195193      if (spriteram[offs] & 0x01)
196194      {
197         drawgfx(bitmap,screen->machine->gfx[2],
195         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
198196               spriteram[offs+1] + ((spriteram[offs] & 0xf0) << 4),
199197               (spriteram[offs] & 0x08) >> 3,
200198               spriteram[offs] & 0x04,spriteram[offs] & 0x02,
201               239 - spriteram[offs+3],(240 - spriteram[offs+2]) & 0xff,
202               cliprect,TRANSPARENCY_PEN,0);
199               239 - spriteram[offs+3],(240 - spriteram[offs+2]) & 0xff,0);
203200      }
204201   }
205202
r5077r5078
213210      sx = 31 - offs / 32;
214211      sy = offs % 32;
215212
216      drawgfx(bitmap,screen->machine->gfx[0],
213      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
217214            matmania_videoram2[offs] + 256 * (matmania_colorram2[offs] & 0x07),
218215            (matmania_colorram2[offs] & 0x30) >> 4,
219216            0,0,
220            8*sx,8*sy,
221            cliprect,TRANSPARENCY_PEN,0);
217            8*sx,8*sy,0);
222218   }
223219   return 0;
224220}
r5077r5078
237233      sx = 15 - offs / 32;
238234      sy = offs % 32;
239235
240      drawgfx(tmpbitmap,screen->machine->gfx[1],
236      drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[1],
241237            videoram[offs] + ((colorram[offs] & 0x03) << 8),
242238            (colorram[offs] & 0x30) >> 4,
243239            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
244            16*sx,16*sy,
245            0,TRANSPARENCY_NONE,0);
240            16*sx,16*sy);
246241   }
247242
248243   /* Update the tiles in the right tile ram bank */
r5077r5078
254249      sx = 15 - offs / 32;
255250      sy = offs % 32;
256251
257      drawgfx(tmpbitmap2,screen->machine->gfx[1],
252      drawgfx_opaque(tmpbitmap2,0,screen->machine->gfx[1],
258253            matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x03) << 8),
259254            (matmania_colorram3[offs] & 0x30) >> 4,
260255            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
261            16*sx,16*sy,
262            0,TRANSPARENCY_NONE,0);
256            16*sx,16*sy);
263257   }
264258
265259
r5077r5078
282276   {
283277      if (spriteram[offs] & 0x01)
284278      {
285         drawgfx(bitmap,screen->machine->gfx[2],
279         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
286280               spriteram[offs+1] + ((spriteram[offs] & 0xf0) << 4),
287281               (spriteram[offs] & 0x08) >> 3,
288282               spriteram[offs] & 0x04,spriteram[offs] & 0x02,
289               239 - spriteram[offs+3],(240 - spriteram[offs+2]) & 0xff,
290               cliprect,TRANSPARENCY_PEN,0);
283               239 - spriteram[offs+3],(240 - spriteram[offs+2]) & 0xff,0);
291284      }
292285   }
293286
r5077r5078
301294      sx = 31 - offs / 32;
302295      sy = offs % 32;
303296
304      drawgfx(bitmap,screen->machine->gfx[0],
297      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
305298            matmania_videoram2[offs] + 256 * (matmania_colorram2[offs] & 0x07),
306299            (matmania_colorram2[offs] & 0x30) >> 4,
307300            0,0,
308            8*sx,8*sy,
309            cliprect,TRANSPARENCY_PEN,0);
301            8*sx,8*sy,0);
310302   }
311303   return 0;
312304}
src/mame/video/arkanoid.c
r5077r5078
153153
154154      code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) + 1024 * gfxbank;
155155
156      drawgfx(bitmap,machine->gfx[0],
156      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
157157            2 * code,
158158            ((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank,
159159            flip_screen_x_get(machine),flip_screen_y_get(machine),
160            sx,sy + (flip_screen_y_get(machine) ? 8 : -8),
161            cliprect,TRANSPARENCY_PEN,0);
162      drawgfx(bitmap,machine->gfx[0],
160            sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0);
161      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
163162            2 * code + 1,
164163            ((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank,
165164            flip_screen_x_get(machine),flip_screen_y_get(machine),
166            sx,sy,
167            cliprect,TRANSPARENCY_PEN,0);
165            sx,sy,0);
168166   }
169167}
170168
src/mame/video/megasys1.c
r5077r5078
620620            code  = spritedata[0x0E/2] + objectdata[0x06/2];
621621            color = (attr & color_mask);
622622
623            pdrawgfx(bitmap,machine->gfx[3],
623            pdrawgfx_transpen(bitmap,cliprect,
624                  machine->gfx[3],
624625                  (code & 0xfff ) + ((megasys1_sprite_bank & 1) << 12),
625626                  color,
626627                  flipx, flipy,
627628                  sx, sy,
628                  cliprect,
629                  TRANSPARENCY_PEN,15,
630                  (attr & 0x08) ? 0x0c : 0x0a);
629                  priority_bitmap,
630                  (attr & 0x08) ? 0x0c : 0x0a,15);
631631         }   /* sprite */
632632      }   /* offs */
633633   }   /* non Z hw */
r5077r5078
660660            sx = 240-sx;      sy = 240-sy;
661661         }
662662
663         pdrawgfx(bitmap,machine->gfx[2],
663         pdrawgfx_transpen(bitmap,cliprect,
664               machine->gfx[2],
664665               code,
665666               color,
666667               flipx, flipy,
667668               sx, sy,
668               cliprect,
669               TRANSPARENCY_PEN,15,
670               (attr & 0x08) ? 0x0c : 0x0a);
669               priority_bitmap,
670               (attr & 0x08) ? 0x0c : 0x0a,15);
671671      }   /* sprite */
672672   }   /* Z hw */
673673
src/mame/video/crshrace.c
r5077r5078
150150            map_start++;
151151
152152            if (flipscreen)
153               drawgfxzoom(bitmap,machine->gfx[2],
153               drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2],
154154                     code,
155155                     color,
156156                     !flipx,!flipy,
157157                     304-sx,208-sy,
158                     cliprect,TRANSPARENCY_PEN,15,
159                     0x1000 * zoomx,0x1000 * zoomy);
158                     0x1000 * zoomx,0x1000 * zoomy,15);
160159            else
161               drawgfxzoom(bitmap,machine->gfx[2],
160               drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2],
162161                     code,
163162                     color,
164163                     flipx,flipy,
165164                     sx,sy,
166                     cliprect,TRANSPARENCY_PEN,15,
167                     0x1000 * zoomx,0x1000 * zoomy);
165                     0x1000 * zoomx,0x1000 * zoomy,15);
168166         }
169167      }
170168   }
src/mame/video/pacman.c
r5077r5078
240240         sy = spriteram_2[offs] - 31;
241241         color = ( spriteram[offs + 1] & 0x1f ) | (colortablebank << 5) | (palettebank << 6 );
242242
243         drawgfx(bitmap,screen->machine->gfx[1],
243         drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1],
244244               ( spriteram[offs] >> 2 ) | (spritebank << 6),
245245               color,
246246               spriteram[offs] & 1,spriteram[offs] & 2,
247247               sx,sy,
248               &spriteclip,TRANSPARENCY_PENS,
249248               colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
250249
251250         /* also plot the sprite with wraparound (tunnel in Crush Roller) */
252         drawgfx(bitmap,screen->machine->gfx[1],
251         drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1],
253252               ( spriteram[offs] >> 2 ) | (spritebank << 6),
254253               color,
255254               spriteram[offs] & 1,spriteram[offs] & 2,
256255               sx - 256,sy,
257               &spriteclip,TRANSPARENCY_PENS,
258256               colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
259257      }
260258      /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
r5077r5078
268266         sy = spriteram_2[offs] - 31;
269267         color = ( spriteram[offs + 1] & 0x1f ) | (colortablebank << 5) | (palettebank << 6 );
270268
271         drawgfx(bitmap,screen->machine->gfx[1],
269         drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1],
272270               ( spriteram[offs] >> 2 ) | (spritebank << 6),
273271               color,
274272               spriteram[offs] & 1,spriteram[offs] & 2,
275273               sx,sy + xoffsethack,
276               &spriteclip,TRANSPARENCY_PENS,
277274               colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
278275
279276         /* also plot the sprite with wraparound (tunnel in Crush Roller) */
280         drawgfx(bitmap,screen->machine->gfx[1],
277         drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1],
281278               ( spriteram[offs] >> 2 ) | (spritebank << 6),
282279               color,
283280               spriteram[offs] & 2,spriteram[offs] & 1,
284281               sx - 256,sy + xoffsethack,
285               &spriteclip,TRANSPARENCY_PENS,
286282               colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
287283      }
288284   }
r5077r5078
410406      color = spriteram[offs + 1] & 0x1f;
411407
412408      /* TODO: ?? */
413      drawgfx(bitmap,screen->machine->gfx[1],
409      drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1],
414410            (spriteram[offs] >> 2) | ((s2650games_spriteram[offs] & 3) << 6),
415411            color,
416412            spriteram[offs] & 1,spriteram[offs] & 2,
417413            sx,sy,
418            cliprect,TRANSPARENCY_PENS,
419414            colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
420415   }
421416   /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
r5077r5078
431426      color = spriteram[offs + 1] & 0x1f;
432427
433428      /* TODO: ?? */
434      drawgfx(bitmap,screen->machine->gfx[1],
429      drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1],
435430            (spriteram[offs] >> 2) | ((s2650games_spriteram[offs] & 3)<<6),
436431            color,
437432            spriteram[offs] & 1,spriteram[offs] & 2,
438433            sx,sy + xoffsethack,
439            cliprect,TRANSPARENCY_PENS,
440434            colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
441435   }
442436   return 0;
src/mame/video/clshroad.c
r5077r5078
312312         flipy = !flipy;
313313      }
314314
315      drawgfx(bitmap,machine->gfx[0],
315      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
316316            code,
317317            attr & 0x0f,
318318            flipx,flipy,
319            x,y,
320            cliprect,TRANSPARENCY_PEN,15 );
319            x,y,15 );
321320   }
322321}
323322
src/mame/video/bwing.c
r5077r5078
240240
241241      // single/double
242242      if (!(attrib & 0x10))
243         drawgfx(bmp, gfx, code, color, fx, fy, x, y, clip, TRANSPARENCY_PEN, 0);
243         drawgfx_transpen(bmp, clip, gfx, code, color, fx, fy, x, y, 0);
244244      else
245         drawgfxzoom(bmp, gfx, code, color, fx, fy, x, y, clip, TRANSPARENCY_PEN, 0, 1<<16, 2<<16);
245         drawgfxzoom_transpen(bmp, clip, gfx, code, color, fx, fy, x, y, 1<<16, 2<<16, 0);
246246   }
247247}
248248
src/mame/video/sf.c
r5077r5078
172172            t = c2; c2 = c4; c4 = t;
173173         }
174174
175         drawgfx(bitmap,
176               machine->gfx[2],
175         drawgfx_transpen(bitmap,
176               cliprect, machine->gfx[2],
177177               sf_invert(c1),
178178               color,
179179               flipx,flipy,
180               sx,sy,
181               cliprect, TRANSPARENCY_PEN, 15);
182         drawgfx(bitmap,
183               machine->gfx[2],
180               sx,sy, 15);
181         drawgfx_transpen(bitmap,
182               cliprect, machine->gfx[2],
184183               sf_invert(c2),
185184               color,
186185               flipx,flipy,
187               sx+16,sy,
188               cliprect, TRANSPARENCY_PEN, 15);
189         drawgfx(bitmap,
190               machine->gfx[2],
186               sx+16,sy, 15);
187         drawgfx_transpen(bitmap,
188               cliprect, machine->gfx[2],
191189               sf_invert(c3),
192190               color,
193191               flipx,flipy,
194               sx,sy+16,
195               cliprect, TRANSPARENCY_PEN, 15);
196         drawgfx(bitmap,
197               machine->gfx[2],
192               sx,sy+16, 15);
193         drawgfx_transpen(bitmap,
194               cliprect, machine->gfx[2],
198195               sf_invert(c4),
199196               color,
200197               flipx,flipy,
201               sx+16,sy+16,
202               cliprect, TRANSPARENCY_PEN, 15);
198               sx+16,sy+16, 15);
203199      }
204200      else
205201      {
r5077r5078
211207            flipy = !flipy;
212208         }
213209
214         drawgfx(bitmap,
215               machine->gfx[2],
210         drawgfx_transpen(bitmap,
211               cliprect, machine->gfx[2],
216212               sf_invert(c),
217213               color,
218214               flipx,flipy,
219               sx,sy,
220               cliprect, TRANSPARENCY_PEN, 15);
215               sx,sy, 15);
221216      }
222217   }
223218}
src/mame/video/lsasquad.c
r5077r5078
3434         code = videoram[base + 2*y] + ((attr & 0x0f) << 8);
3535         color = attr >> 4;
3636
37         drawgfx(bitmap,machine->gfx[0],
37         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
3838               code,
3939               color,
4040               flip_screen_get(machine),flip_screen_get(machine),
41               sx,sy,
42               cliprect,TRANSPARENCY_PEN,15);
41               sx,sy,15);
4342         if (sx > 248)   /* wraparound */
44            drawgfx(bitmap,machine->gfx[0],
43            drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
4544                  code,
4645                  color,
4746                  flip_screen_get(machine),flip_screen_get(machine),
48                  sx-256,sy,
49                  cliprect,TRANSPARENCY_PEN,15);
47                  sx-256,sy,15);
5048      }
5149   }
5250}
r5077r5078
122120
123121         if((type==0 && color!=0x0d) || (type !=0 && color==0x0d))
124122            {
125         drawgfx(bitmap,machine->gfx[0],
123         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
126124               code,
127125               color,
128126               flip_screen_get(machine),flip_screen_get(machine),
129               sx,sy,
130               cliprect,TRANSPARENCY_PEN,15);
127               sx,sy,15);
131128         if (sx > 248)   /* wraparound */
132            drawgfx(bitmap,machine->gfx[0],
129            drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
133130                  code,
134131                  color,
135132                  flip_screen_get(machine),flip_screen_get(machine),
136                  sx-256,sy,
137                  cliprect,TRANSPARENCY_PEN,15);
133                  sx-256,sy,15);
138134               }
139135      }
140136   }
r5077r5078
184180         flipy = !flipy;
185181      }
186182
187      drawgfx(bitmap,machine->gfx[1],
183      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
188184            code,
189185            color,
190186            flipx,flipy,
191            sx,sy,
192            cliprect,TRANSPARENCY_PEN,15);
187            sx,sy,15);
193188      /* wraparound */
194      drawgfx(bitmap,machine->gfx[1],
189      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
195190            code,
196191            color,
197192            flipx,flipy,
198            sx-256,sy,
199            cliprect,TRANSPARENCY_PEN,15);
193            sx-256,sy,15);
200194   }
201195}
202196
src/mame/video/dooyong.c
r5077r5078
424424
425425      for (y = 0; y <= height; y++)
426426      {
427         pdrawgfx(bitmap, machine->gfx[1],
427         pdrawgfx_transpen(bitmap, cliprect, machine->gfx[1],
428428               code + y,
429429               color,
430430               flipx, flipy,
431431               sx, sy + (16 * (flipy ? (height - y) : y)),
432               cliprect, TRANSPARENCY_PEN, 15,
433               pri);
432               priority_bitmap,
433               pri, 15);
434434      }
435435   }
436436}
r5077r5078
490490            for (x = 0; x <= width; x++)
491491            {
492492               int _x = sx + (16 * (flipx ? (width - x) : x));
493               pdrawgfx(bitmap, machine->gfx[0],
493               pdrawgfx_transpen(bitmap, cliprect, machine->gfx[0],
494494                     code,
495495                     color,
496496                     flipx, flipy,
497497                     _x, _y,
498                     cliprect, TRANSPARENCY_PEN, 15,
499                     pri);
498                     priority_bitmap,
499                     pri, 15);
500500               code++;
501501            }
502502         }
src/mame/video/brkthru.c
r5077r5078
210210
211211         if (spriteram[offs] & 0x10)   /* double height */
212212         {
213            drawgfx(bitmap,machine->gfx[9],
213            drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
214214                  code & ~1,
215215                  color,
216216                  flipscreen,flipscreen,
217                  sx,flipscreen? sy + 16 : sy - 16,
218                  cliprect,TRANSPARENCY_PEN,0);
219            drawgfx(bitmap,machine->gfx[9],
217                  sx,flipscreen? sy + 16 : sy - 16,0);
218            drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
220219                  code | 1,
221220                  color,
222221                  flipscreen,flipscreen,
223                  sx,sy,
224                  cliprect,TRANSPARENCY_PEN,0);
222                  sx,sy,0);
225223
226224            /* redraw with wraparound */
227            drawgfx(bitmap,machine->gfx[9],
225            drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
228226                  code & ~1,
229227                  color,
230228                  flipscreen,flipscreen,
231                  sx,(flipscreen? sy + 16 : sy - 16) + 256,
232                  cliprect,TRANSPARENCY_PEN,0);
233            drawgfx(bitmap,machine->gfx[9],
229                  sx,(flipscreen? sy + 16 : sy - 16) + 256,0);
230            drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
234231                  code | 1,
235232                  color,
236233                  flipscreen,flipscreen,
237                  sx,sy + 256,
238                  cliprect,TRANSPARENCY_PEN,0);
234                  sx,sy + 256,0);
239235
240236         }
241237         else
242238         {
243            drawgfx(bitmap,machine->gfx[9],
239            drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
244240                  code,
245241                  color,
246242                  flipscreen,flipscreen,
247                  sx,sy,
248                  cliprect,TRANSPARENCY_PEN,0);
243                  sx,sy,0);
249244
250245            /* redraw with wraparound */
251            drawgfx(bitmap,machine->gfx[9],
246            drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
252247                  code,
253248                  color,
254249                  flipscreen,flipscreen,
255                  sx,sy + 256,
256                  cliprect,TRANSPARENCY_PEN,0);
250                  sx,sy + 256,0);
257251
258252         }
259253         }
src/mame/video/dec8.c
r5077r5078
296296      else
297297         sprite2=sprite+1;
298298
299      drawgfx(bitmap,machine->gfx[1],
299      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
300300            sprite,
301            colour,fx,fy,x,y,
302            cliprect,TRANSPARENCY_PEN,0);
301            colour,fx,fy,x,y,0);
303302
304303       /* 1 more sprite drawn underneath */
305304       if (extra)
306          drawgfx(bitmap,machine->gfx[1],
305          drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
307306            sprite2,
308            colour,fx,fy,x,y+16,
309            cliprect,TRANSPARENCY_PEN,0);
307            colour,fx,fy,x,y+16,0);
310308   }
311309}
312310
r5077r5078
364362
365363      while (multi >= 0)
366364      {
367         drawgfx(bitmap,machine->gfx[1],
365         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
368366               sprite - multi * inc,
369367               colour,
370368               fx,fy,
371               x,y + mult * multi,
372               cliprect,TRANSPARENCY_PEN,0);
369               x,y + mult * multi,0);
373370         multi--;
374371      }
375372   }
r5077r5078
408405      }
409406      else sy2=sy+16;
410407
411       drawgfx(bitmap,machine->gfx[1],
408       drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
412409              code,
413410            color,
414411            fx,flip_screen_get(machine),
415            sx,sy,
416            cliprect,TRANSPARENCY_PEN,0);
412            sx,sy,0);
417413        if (multi)
418          drawgfx(bitmap,machine->gfx[1],
414          drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
419415            code+1,
420416            color,
421417            fx,flip_screen_get(machine),
422            sx,sy2,
423            cliprect,TRANSPARENCY_PEN,0);
418            sx,sy2,0);
424419   }
425420}
426421
r5077r5078
440435      mx = (offs/2) % 32;
441436      my = (offs/2) / 32;
442437
443      drawgfx(bitmap,machine->gfx[0],
444            tile,color,0,0,8*mx,8*my,
445            cliprect,TRANSPARENCY_PEN,0);
438      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
439            tile,color,0,0,8*mx,8*my,0);
446440   }
447441}
448442#endif
src/mame/video/fuukifg3.c
r5077r5078
234234         for (x = xstart; x != xend; x += xinc)
235235         {
236236            if (xzoom == (16*8) && yzoom == (16*8))
237               pdrawgfx(      bitmap,screen->machine->gfx[0],
237               pdrawgfx_transpen(      bitmap,cliprect,screen->machine->gfx[0],
238238                           code++,
239239                           attr & 0x3f,
240240                           flipx, flipy,
241241                           sx + x * 16, sy + y * 16,
242                           cliprect,TRANSPARENCY_PEN,15,
243                           pri_mask   );
242                           priority_bitmap,
243                           pri_mask,15   );
244244            else
245               pdrawgfxzoom(   bitmap,screen->machine->gfx[0],
245               pdrawgfxzoom_transpen(   bitmap,cliprect,screen->machine->gfx[0],
246246                           code++,
247247                           attr & 0x3f,
248248                           flipx, flipy,
249249                           sx + (x * xzoom) / 8, sy + (y * yzoom) / 8,
250                           cliprect,TRANSPARENCY_PEN,15,
251                           (0x10000/0x10/8) * (xzoom + 8),(0x10000/0x10/8) * (yzoom + 8),   // nearest greater integer value to avoid holes
252                           pri_mask   );
250                           (0x10000/0x10/8) * (xzoom + 8),(0x10000/0x10/8) * (yzoom + 8),   priority_bitmap,// nearest greater integer value to avoid holes
251                           pri_mask,15   );
253252         }
254253      }
255254
src/mame/video/tbowl.c
r5077r5078
159159
160160               sx -= xscroll;
161161
162               drawgfx(bitmap,machine->gfx[3],
162               drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
163163                     code + layout[y][x],
164164                     color,
165165                     flipx,flipy,
166                     sx,sy,
167                     cliprect,TRANSPARENCY_PEN,0 );
166                     sx,sy,0 );
168167
169168               /* wraparound */
170               drawgfx(bitmap,machine->gfx[3],
169               drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
171170                     code + layout[y][x],
172171                     color,
173172                     flipx,flipy,
174                     sx,sy-0x200,
175                     cliprect,TRANSPARENCY_PEN,0 );
173                     sx,sy-0x200,0 );
176174
177175               /* wraparound */
178               drawgfx(bitmap,machine->gfx[3],
176               drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
179177                     code + layout[y][x],
180178                     color,
181179                     flipx,flipy,
182                     sx-0x400,sy,
183                     cliprect,TRANSPARENCY_PEN,0 );
180                     sx-0x400,sy,0 );
184181
185182               /* wraparound */
186               drawgfx(bitmap,machine->gfx[3],
183               drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
187184                     code + layout[y][x],
188185                     color,
189186                     flipx,flipy,
190                     sx-0x400,sy-0x200,
191                     cliprect,TRANSPARENCY_PEN,0 );
187                     sx-0x400,sy-0x200,0 );
192188
193189
194190
src/mame/video/battlane.c
r5077r5078
190190            flipy = !flipy;
191191         }
192192
193         drawgfx(bitmap,machine->gfx[0],
193         drawgfx_transpen(bitmap,cliprect,
194            machine->gfx[0],
194195            code,
195196            color,
196197            flipx, flipy,
197            sx, sy,
198            cliprect,
199            TRANSPARENCY_PEN, 0);
198            sx, sy, 0);
200199
201200         if (attr & 0x10)  /* Double Y direction */
202201         {
203202            dy = flipy ? 16 : -16;
204203
205            drawgfx(bitmap,machine->gfx[0],
204            drawgfx_transpen(bitmap,cliprect,
205               machine->gfx[0],
206206               code + 1,
207207               color,
208208               flipx, flipy,
209               sx, sy + dy,
210               cliprect,
211               TRANSPARENCY_PEN, 0);
209               sx, sy + dy, 0);
212210         }
213211      }
214212   }
src/mame/video/thepit.c
r5077r5078
287287         /* sprites 0-3 are drawn one pixel down */
288288         if (offs < 16) y++;
289289
290         drawgfx(bitmap, machine->gfx[2 * graphics_bank + 1],
290         drawgfx_transpen(bitmap, thepit_flip_screen_x ? &spritevisibleareaflipx : &spritevisiblearea,
291               machine->gfx[2 * graphics_bank + 1],
291292               thepit_spriteram[offs + 1] & 0x3f,
292293               thepit_spriteram[offs + 2],
293               flipx, flipy, x, y,
294               thepit_flip_screen_x ? &spritevisibleareaflipx : &spritevisiblearea,
295               TRANSPARENCY_PEN, 0);
294               flipx, flipy, x, y, 0);
296295      }
297296   }
298297}
src/mame/video/rpunch.c
r5077r5078
230230      if (x >= BITMAP_WIDTH) x -= 512;
231231      if (y >= BITMAP_HEIGHT) y -= 512;
232232
233      drawgfx(bitmap, machine->gfx[2],
234            code, color + (rpunch_sprite_palette / 16), xflip, yflip, x, y, cliprect, TRANSPARENCY_PEN, 15);
233      drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
234            code, color + (rpunch_sprite_palette / 16), xflip, yflip, x, y, 15);
235235   }
236236}
237237
src/mame/video/cloud9.c
r5077r5078
271271         int which = spriteaddr[offs + 0x20];
272272         int color = 0;
273273
274         drawgfx(spritebitmap, screen->machine->gfx[0], which, color, xflip, yflip, x, y, cliprect, TRANSPARENCY_PEN, 0);
274         drawgfx_transpen(spritebitmap, cliprect, screen->machine->gfx[0], which, color, xflip, yflip, x, y, 0);
275275         if (x >= 256 - 16)
276            drawgfx(spritebitmap, screen->machine->gfx[0], which, color, xflip, yflip, x - 256, y, cliprect, TRANSPARENCY_PEN, 0);
276            drawgfx_transpen(spritebitmap, cliprect, screen->machine->gfx[0], which, color, xflip, yflip, x - 256, y, 0);
277277      }
278278
279279   /* draw the bitmap to the screen, looping over Y */
src/mame/video/triplhnt.c
r5077r5078
8484
8585      /* render sprite to auxiliary bitmap */
8686
87      drawgfx(helper, machine->gfx[triplhnt_sprite_zoom],
87      drawgfx_opaque(helper, cliprect, machine->gfx[triplhnt_sprite_zoom],
8888         2 * code + triplhnt_sprite_bank, 0, code & 8, 0,
89         rect.min_x, rect.min_y, cliprect, TRANSPARENCY_NONE, 0);
89         rect.min_x, rect.min_y);
9090
9191      if (rect.min_x < cliprect->min_x)
9292         rect.min_x = cliprect->min_x;
src/mame/video/pooyan.c
r5077r5078
172172      int flipx = ~spriteram_2[offs] & 0x40;
173173      int flipy = spriteram_2[offs] & 0x80;
174174
175      drawgfx(bitmap,machine->gfx[1],
175      drawgfx_transmask(bitmap,cliprect,
176         machine->gfx[1],
176177         code,
177178         color,
178179         flipx, flipy,
179180         sx, sy,
180         cliprect,
181         TRANSPARENCY_PENS,
182181         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
183182   }
184183}
src/mame/video/sidepckt.c
r5077r5078
123123      flipx = spriteram[offs+1] & 0x08;
124124      flipy = spriteram[offs+1] & 0x04;
125125
126      drawgfx(bitmap,machine->gfx[1],
126      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
127127            code,
128128            color,
129129            flipx,flipy,
130            sx,sy,
131            cliprect,TRANSPARENCY_PEN,0);
130            sx,sy,0);
132131      /* wraparound */
133      drawgfx(bitmap,machine->gfx[1],
132      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
134133            code,
135134            color,
136135            flipx,flipy,
137            sx-256,sy,
138            cliprect,TRANSPARENCY_PEN,0);
136            sx-256,sy,0);
139137   }
140138}
141139
src/mame/video/wolfpack.c
r5077r5078
164164
165165   int chop = (scaler[wolfpack_ship_size >> 2] * wolfpack_ship_h_precess) >> 16;
166166
167   drawgfxzoom(bitmap, machine->gfx[1],
167   drawgfxzoom_transpen(bitmap, cliprect,
168      machine->gfx[1],
168169      wolfpack_ship_pic,
169170      0,
170171      wolfpack_ship_reflect, 0,
171172      2 * (wolfpack_ship_h - chop),
172173      128,
173      cliprect,
174      TRANSPARENCY_PEN, 0,
175      2 * scaler[wolfpack_ship_size >> 2], scaler[wolfpack_ship_size >> 2]);
174      2 * scaler[wolfpack_ship_size >> 2], scaler[wolfpack_ship_size >> 2], 0);
176175}
177176
178177
r5077r5078
183182   int x;
184183   int y;
185184
186   drawgfx(bitmap, machine->gfx[3],
185   drawgfx_transpen(bitmap, cliprect,
186      machine->gfx[3],
187187      wolfpack_torpedo_pic,
188188      0,
189189      0, 0,
190190      2 * (244 - wolfpack_torpedo_h),
191      224 - wolfpack_torpedo_v,
192      cliprect,
193      TRANSPARENCY_PEN, 0);
191      224 - wolfpack_torpedo_v, 0);
194192
195193   for (y = 16; y < 224 - wolfpack_torpedo_v; y++)
196194   {
r5077r5078
220218   if (!(wolfpack_pt_pic & 0x10))
221219      rect.max_x = 255;
222220
223   drawgfx(bitmap, machine->gfx[2],
221   drawgfx_transpen(bitmap, &rect,
222      machine->gfx[2],
224223      wolfpack_pt_pic,
225224      0,
226225      0, 0,
227226      2 * wolfpack_pt_horz,
228      wolfpack_pt_pos_select ? 0x70 : 0xA0,
229      &rect,
230      TRANSPARENCY_PEN, 0);
227      wolfpack_pt_pos_select ? 0x70 : 0xA0, 0);
231228
232   drawgfx(bitmap, machine->gfx[2],
229   drawgfx_transpen(bitmap, &rect,
230      machine->gfx[2],
233231      wolfpack_pt_pic,
234232      0,
235233      0, 0,
236234      2 * wolfpack_pt_horz - 512,
237      wolfpack_pt_pos_select ? 0x70 : 0xA0,
238      &rect,
239      TRANSPARENCY_PEN, 0);
235      wolfpack_pt_pos_select ? 0x70 : 0xA0, 0);
240236}
241237
242238
r5077r5078
283279      {
284280         int code = wolfpack_alpha_num_ram[32 * i + j];
285281
286         drawgfx(bitmap, screen->machine->gfx[0],
282         drawgfx_opaque(bitmap, cliprect,
283            screen->machine->gfx[0],
287284            code,
288285            wolfpack_video_invert,
289286            0, 0,
290287            16 * j,
291            192 + 8 * i,
292            cliprect,
293            TRANSPARENCY_NONE, 0);
288            192 + 8 * i);
294289      }
295290
296291   draw_pt(screen->machine, bitmap, cliprect);
src/mame/video/pirates.c
r5077r5078
9494
9595      ypos = 0xf2 - ypos;
9696
97      drawgfx(bitmap,gfx,
97      drawgfx_transpen(bitmap,cliprect,gfx,
9898            code,
9999            color,
100100            flipx,flipy,
101            xpos,ypos,
102            cliprect,TRANSPARENCY_PEN,0);
101            xpos,ypos,0);
103102
104103      source+=4;
105104   }
src/mame/video/tankbatt.c
r5077r5078
9090      int x = tankbatt_bulletsram[offs + 1];
9191      int y = 255 - tankbatt_bulletsram[offs] - 2;
9292
93      drawgfx(bitmap,machine->gfx[1],
93      drawgfx_opaque(bitmap,cliprect,machine->gfx[1],
9494         0,   /* this is just a square, generated by the hardware */
9595         color,
9696         0,0,
97         x,y,
98         cliprect,TRANSPARENCY_NONE,0);
97         x,y);
9998   }
10099}
101100
src/mame/video/exerion.c
r5077r5078
394394         else
395395            code &= ~0x10, code2 |= 0x10;
396396
397         drawgfx(bitmap, gfx, code2, color, xflip, yflip, x, y + gfx->height,
398                 cliprect, TRANSPARENCY_PENS,
397         drawgfx_transmask(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height,
399398                 colortable_get_transpen_mask(screen->machine->colortable, gfx, color, 0x10));
400399      }
401400
402      drawgfx(bitmap, gfx, code, color, xflip, yflip, x, y,
403             cliprect, TRANSPARENCY_PENS,
401      drawgfx_transmask(bitmap, cliprect, gfx, code, color, xflip, yflip, x, y,
404402             colortable_get_transpen_mask(screen->machine->colortable, gfx, color, 0x10));
405403
406404      if (doubled) i += 4;
r5077r5078
414412         int y = exerion_cocktail_flip ? (31*8 - 8*sy) : 8*sy;
415413
416414         offs = sx + sy * 64;
417         drawgfx(bitmap, screen->machine->gfx[0],
415         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
418416            videoram[offs] + 256 * char_bank,
419417            ((videoram[offs] & 0xf0) >> 4) + char_palette * 16,
420            exerion_cocktail_flip, exerion_cocktail_flip, x, y,
421            cliprect, TRANSPARENCY_PEN, 0);
418            exerion_cocktail_flip, exerion_cocktail_flip, x, y, 0);
422419      }
423420
424421   return 0;
src/mame/video/wrally.c
r5077r5078
131131      }
132132
133133      if (!color_effect) {
134         drawgfx(bitmap,gfx,number,
134         drawgfx_transpen(bitmap,cliprect,gfx,number,
135135               0x20 + color,xflip,yflip,
136               sx - 0x0f,sy,
137               cliprect,TRANSPARENCY_PEN,0);
136               sx - 0x0f,sy,0);
138137      } else {
139138         /* get a pointer to the current sprite's gfx data */
140139         const UINT8 *gfx_src = gfx_element_get_data(gfx, number % gfx->total_elements);
src/mame/video/crospang.c
r5077r5078
176176
177177      while (multi >= 0)
178178      {
179         drawgfx(bitmap,machine->gfx[0],
179         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
180180               sprite - multi * inc,
181181               colour,
182182               fx,fy,
183               x-xsproff,y-ysproff + mult * multi,
184               cliprect,TRANSPARENCY_PEN,0);
183               x-xsproff,y-ysproff + mult * multi,0);
185184
186185         multi--;
187186      }
src/mame/video/subs.c
r5077r5078
7878      if (screen == left_screen)
7979      {
8080         if ((left_enable || left_sonar_window) && (!right_sonar_window))
81            drawgfx(bitmap,screen->machine->gfx[0],
81            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
8282                  charcode, 1,
83                  0,0,sx,sy,
84                  cliprect,TRANSPARENCY_NONE,0);
83                  0,0,sx,sy);
8584         else
86            drawgfx(bitmap,screen->machine->gfx[0],
85            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
8786                  0, 1,
88                  0,0,sx,sy,
89                  cliprect,TRANSPARENCY_NONE,0);
87                  0,0,sx,sy);
9088      }
9189
9290      /* draw the right screen */
9391      if (screen == right_screen)
9492      {
9593         if ((right_enable || right_sonar_window) && (!left_sonar_window))
96            drawgfx(bitmap,screen->machine->gfx[0],
94            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
9795                  charcode, 0,
98                  0,0,sx,sy,
99                  cliprect,TRANSPARENCY_NONE,0);
96                  0,0,sx,sy);
10097         else
101            drawgfx(bitmap,screen->machine->gfx[0],
98            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
10299                  0, 0,
103                  0,0,sx,sy,
104                  cliprect,TRANSPARENCY_NONE,0);
100                  0,0,sx,sy);
105101      }
106102   }
107103
r5077r5078
128124      if (screen == left_screen)
129125      {
130126         if ((offs!=0) || (sub_enable))
131            drawgfx(bitmap,screen->machine->gfx[1],
127            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
132128                  charcode + 32 * prom_set,
133129                  0,
134                  0,0,sx,sy,
135                  cliprect,TRANSPARENCY_PEN,0);
130                  0,0,sx,sy,0);
136131      }
137132
138133
r5077r5078
140135      if (screen == right_screen)
141136      {
142137         if ((offs!=1) || (sub_enable))
143            drawgfx(bitmap,screen->machine->gfx[1],
138            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
144139                  charcode + 32 * prom_set,
145140                  0,
146                  0,0,sx,sy,
147                  cliprect,TRANSPARENCY_PEN,0);
141                  0,0,sx,sy,0);
148142      }
149143   }
150144
src/mame/video/darkmist.c
r5077r5078
180180
181181      palette+=32;
182182
183      drawgfx(
184               bitmap,screen->machine->gfx[2],
183      drawgfx_transpen(
184               bitmap,cliprect,
185               screen->machine->gfx[2],
185186               tile,
186187               palette,
187188               fx,fy,
188               spriteram[i+3],spriteram[i+2],
189               cliprect,
190               TRANSPARENCY_PEN,0 );
189               spriteram[i+3],spriteram[i+2],0 );
191190      }
192191
193192   }
src/mame/video/funybubl.c
r5077r5078
6767      if (source[1] & 0x20) {   if (xpos < 0xe0) xpos += 0x100; }
6868      // bits 0x40 and 0x10 not used?...
6969
70      drawgfx(bitmap,machine->gfx[1],tile,0,0,0,xpos,ypos,cliprect,TRANSPARENCY_PEN,255);
70      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],tile,0,0,0,xpos,ypos,255);
7171
7272      source -= 0x20;
7373   }
r5077r5078
9292         int data;
9393
9494         data = funybubl_banked_videoram[offs] | (funybubl_banked_videoram[offs+1] << 8);
95         drawgfx(bitmap,screen->machine->gfx[0],data&0x7fff,(data&0x8000)?2:1,0,0,x*8,y*8,cliprect,TRANSPARENCY_PEN,0);
95         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],data&0x7fff,(data&0x8000)?2:1,0,0,x*8,y*8,0);
9696         offs+=2;
9797      }
9898   }
src/mame/video/nmk16.c
r5077r5078
405405            xx = w;
406406            do
407407            {
408               drawgfx(bitmap,machine->gfx[2],
408               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
409409                     code,
410410                     color,
411411                     flip_screen_get(machine), flip_screen_get(machine),
412                     ((x + 16) & 0x1ff) - 16,sy & 0x1ff,
413                     cliprect,TRANSPARENCY_PEN,15);
412                     ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15);
414413               code++;
415414               x += delta;
416415            } while (--xx >= 0);
r5077r5078
465464            xx = w;
466465            do
467466            {
468               drawgfx(bitmap,machine->gfx[2],
467               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
469468                     code,
470469                     color,
471470                     flipx, flipy,
472                     ((x + 16) & 0x1ff) - 16,sy & 0x1ff,
473                     cliprect,TRANSPARENCY_PEN,15);
471                     ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15);
474472
475473               code++;
476474               x +=delta * ( flipx?-1:1 );
r5077r5078
627625            int numtile = data&0xfff;
628626            int color = (data&0xf000)>>12;
629627
630            drawgfx(background_bitmap,screen->machine->gfx[3],
628            drawgfx_opaque(background_bitmap,0,screen->machine->gfx[3],
631629                  numtile,
632630                  color,
633631                  0,0,   /* no flip */
634                  16*sx,16*sy,
635                  0,TRANSPARENCY_NONE,0);
632                  16*sx,16*sy);
636633
637634            data = tilerom[offs+0x1000+bank];
638635            numtile = data&0xfff;
639636            color = (data&0xf000)>>12;
640            drawgfx(background_bitmap,screen->machine->gfx[3],
637            drawgfx_opaque(background_bitmap,0,screen->machine->gfx[3],
641638                  numtile,
642639                  color,
643640                  0,0,   /* no flip */
644                  16*sx,(16*sy)+256,
645                  0,TRANSPARENCY_NONE,0);
641                  16*sx,(16*sy)+256);
646642
647643            sy++;
648644            if (sy==16) {sy=0; sx++;}
src/mame/video/m10.c
r5077r5078
146146
147147   for (i=0;i<4;i++)
148148      if (state->flip)
149         drawgfx(bitmap, back_gfx, i, color[i], 1, 1, 31*8 - xpos[i], 6, cliprect, 0, 0);
149         drawgfx_opaque(bitmap, cliprect, back_gfx, i, color[i], 1, 1, 31*8 - xpos[i], 6);
150150      else
151         drawgfx(bitmap, back_gfx, i, color[i], 0, 0, xpos[i], 0, cliprect, 0, 0);
151         drawgfx_opaque(bitmap, cliprect, back_gfx, i, color[i], 0, 0, xpos[i], 0);
152152
153153   if (state->bottomline)
154154   {
src/mame/drivers/mgolf.c
r5077r5078
5151
5252   for (i = 0; i < 2; i++)
5353   {
54      drawgfx(bitmap, screen->machine->gfx[1],
54      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
5555         mgolf_video_ram[0x399 + 4 * i],
5656         i,
5757         0, 0,
5858         mgolf_video_ram[0x390 + 2 * i] - 7,
59         mgolf_video_ram[0x398 + 4 * i] - 16,
60         cliprect, TRANSPARENCY_PEN, 0);
59         mgolf_video_ram[0x398 + 4 * i] - 16, 0);
6160
62      drawgfx(bitmap, screen->machine->gfx[1],
61      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
6362         mgolf_video_ram[0x39b + 4 * i],
6463         i,
6564         0, 0,
6665         mgolf_video_ram[0x390 + 2 * i] - 15,
67         mgolf_video_ram[0x39a + 4 * i] - 16,
68         cliprect, TRANSPARENCY_PEN, 0);
66         mgolf_video_ram[0x39a + 4 * i] - 16, 0);
6967   }
7068   return 0;
7169}
src/mame/drivers/murogem.c
r5077r5078
181181         int tileno = murogem_videoram[count]&0x3f;
182182         int attr = murogem_videoram[count+0x400]&0x0f;
183183
184         drawgfx(bitmap,screen->machine->gfx[0],tileno,attr,0,0,xx*8,yy*8,cliprect,TRANSPARENCY_PEN,0);
184         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno,attr,0,0,xx*8,yy*8,0);
185185
186186         count++;
187187
src/mame/drivers/cntsteer.c
r5077r5078
146146        {
147147         if(fy)
148148         {
149            drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
150            drawgfx(bitmap,machine->gfx[1],code+1,color,fx,fy,sx,sy-16,cliprect,TRANSPARENCY_PEN,0);
149            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,color,fx,fy,sx,sy,0);
150            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code+1,color,fx,fy,sx,sy-16,0);
151151         }
152152         else
153153         {
154              drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy-16,cliprect,TRANSPARENCY_PEN,0);
155              drawgfx(bitmap,machine->gfx[1],code+1,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
154              drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,color,fx,fy,sx,sy-16,0);
155              drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code+1,color,fx,fy,sx,sy,0);
156156         }
157157      }
158158      else
159            drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
159            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,color,fx,fy,sx,sy,0);
160160   }
161161}
162162
r5077r5078
201201        {
202202         if(fy)
203203         {
204            drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
205            drawgfx(bitmap,machine->gfx[1],code+1,color,fx,fy,sx,sy-16,cliprect,TRANSPARENCY_PEN,0);
204            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,color,fx,fy,sx,sy,0);
205            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code+1,color,fx,fy,sx,sy-16,0);
206206         }
207207         else
208208         {
209              drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy-16,cliprect,TRANSPARENCY_PEN,0);
210              drawgfx(bitmap,machine->gfx[1],code+1,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
209              drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,color,fx,fy,sx,sy-16,0);
210              drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code+1,color,fx,fy,sx,sy,0);
211211         }
212212      }
213213      else
214            drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
214            drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,color,fx,fy,sx,sy,0);
215215   }
216216}
217217
src/mame/drivers/dblewing.c
r5077r5078
119119
120120      while (multi >= 0)
121121      {
122         pdrawgfx(bitmap,machine->gfx[2],
122         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],
123123               sprite - multi * inc,
124124               colour,
125125               fx,fy,
126126               x,y + mult * multi,
127               cliprect,TRANSPARENCY_PEN,0,pri);
127               priority_bitmap,pri,0);
128128
129129         if (xsize)
130         pdrawgfx(bitmap,machine->gfx[2],
130         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],
131131               (sprite - multi * inc)-mult2,
132132               colour,
133133               fx,fy,
134134               x-16,y + mult * multi,
135               cliprect,TRANSPARENCY_PEN,0,pri);
135               priority_bitmap,pri,0);
136136
137137
138138         multi--;
src/mame/drivers/arabian.c
r5077r5078
171171   return 0;
172172}
173173
174static WRITE8_HANDLER( custom_cpu_w )
175{
176    custom_cpu_ram[0x7f0 + offset] = data;
177}
174178
179
175180static void update_flip_state(void)
176181{
177182   /* the custom CPU also controls the video flip control line; unfortunately,    */
r5077r5078
217222   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x01ff) AM_READ_PORT("IN0")
218223   AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x01ff) AM_READ_PORT("DSW1")
219224   AM_RANGE(0xd000, 0xd7ef) AM_RAM AM_BASE(&custom_cpu_ram)
220   AM_RANGE(0xd7f0, 0xd7ff) AM_READ(custom_cpu_r) AM_WRITENOP
225   AM_RANGE(0xd7f0, 0xd7ff) AM_READWRITE(custom_cpu_r, custom_cpu_w)
221226   AM_RANGE(0xe000, 0xe007) AM_MIRROR(0x0ff8) AM_WRITE(arabian_blitter_w) AM_BASE(&arabian_blitter)
222227ADDRESS_MAP_END
223228
src/mame/drivers/discoboy.c
r5077r5078
9494         }
9595      }
9696
97      drawgfx(bitmap,machine->gfx[0],
97      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
9898             code,
9999             color,
100100             flipscreen,0,
101             sx,sy,
102             cliprect,TRANSPARENCY_PEN,15);
101             sx,sy,15);
103102   }
104103}
105104
r5077r5078
156155
157156         }
158157
159         drawgfx(bitmap,screen->machine->gfx[1], tileno ,discoboy_ram_att[count/2],0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
158         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1], tileno ,discoboy_ram_att[count/2],0,0,x*8,y*8);
160159         count+=2;
161160      }
162161   }
src/mame/drivers/mediagx.c
r5077r5078
180180   }
181181}
182182
183static void draw_char(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
183static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
184184{
185185   int i,j;
186186   const UINT8 *dp;
187187   int index = 0;
188   const pen_t *pens = gfx->machine->pens;
189
188190   dp = gfx_element_get_data(gfx, ch);
189191
190192   for (j=y; j < y+8; j++)
r5077r5078
194196      {
195197         UINT8 pen = dp[index++];
196198         if (pen)
197            p[i] = machine->pens[gfx->color_base + (att & 0xf)];
199            p[i] = pens[gfx->color_base + (att & 0xf)];
198200         else
199201         {
200202            if (((att >> 4) & 7) > 0)
201               p[i] = machine->pens[gfx->color_base + ((att >> 4) & 0x7)];
203               p[i] = pens[gfx->color_base + ((att >> 4) & 0x7)];
202204         }
203205      }
204206   }
r5077r5078
311313         int att1 = (cga[index] >> 24) & 0xff;
312314         int ch1 = (cga[index] >> 16) & 0xff;
313315
314         draw_char(machine, bitmap, cliprect, gfx, ch0, att0, i*8, j*8);
315         draw_char(machine, bitmap, cliprect, gfx, ch1, att1, (i*8)+8, j*8);
316         draw_char(bitmap, cliprect, gfx, ch0, att0, i*8, j*8);
317         draw_char(bitmap, cliprect, gfx, ch1, att1, (i*8)+8, j*8);
316318         index++;
317319      }
318320   }
src/mame/drivers/mwarr.c
r5077r5078
354354
355355         for(i=0;i<=dy;i++)
356356         {
357            pdrawgfx( bitmap,
357            pdrawgfx_transpen( bitmap,
358                    cliprect,
358359                    gfx,
359360                    source[2]+i,
360361                    color,
361362                    flipx,0,
362363                    x,y+i*16,
363                    cliprect,
364                    TRANSPARENCY_PEN,0,pri_mask );
364                    priority_bitmap,pri_mask,0 );
365365
366366            /* wrap around x */
367            pdrawgfx( bitmap,
367            pdrawgfx_transpen( bitmap,
368                    cliprect,
368369                    gfx,
369370                    source[2]+i,
370371                    color,
371372                    flipx,0,
372373                    x-1024,y+i*16,
373                    cliprect,
374                    TRANSPARENCY_PEN,0,pri_mask );
374                    priority_bitmap,pri_mask,0 );
375375
376376            /* wrap around y */
377            pdrawgfx( bitmap,
378                    gfx,
377            pdrawgfx_transpen( bitmap,
378                    cliprect,
379                   gfx,
379380                    source[2]+i,
380381                    color,
381382                    flipx,0,
382383                    x,y-512+i*16,
383                   cliprect,
384                   TRANSPARENCY_PEN,0,pri_mask );
384                   priority_bitmap,pri_mask,0 );
385385
386386            /* wrap around x & y */
387            pdrawgfx( bitmap,
387            pdrawgfx_transpen( bitmap,
388                    cliprect,
388389                    gfx,
389390                    source[2]+i,
390391                    color,
391392                    flipx,0,
392393                    x-1024,y-512+i*16,
393                    cliprect,
394                    TRANSPARENCY_PEN,0,pri_mask );
394                    priority_bitmap,pri_mask,0 );
395395         }
396396      }
397397
src/mame/drivers/vroulet.c
r5077r5078
9494static VIDEO_UPDATE(vroulet)
9595{
9696   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
97   drawgfx(bitmap, screen->machine->gfx[0], 0x320, 1, 0, 0,
98      vroulet_ball[1], vroulet_ball[0] - 12, cliprect, TRANSPARENCY_PEN, 0);
97   drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], 0x320, 1, 0, 0,
98      vroulet_ball[1], vroulet_ball[0] - 12, 0);
9999   return 0;
100100}
101101
src/mame/drivers/balsente.c
r5077r5078
14321432   ROM_LOAD( "rom-gr4.u5b", 0x08000, 0x2000, CRC(3fbfa686) SHA1(6c137d177c7aa2701497ac3ac922fdb8cd9f52b3) )
14331433   ROM_LOAD( "rom-gr5.u4b", 0x0a000, 0x2000, CRC(345f94fb) SHA1(0af24f4e1a797efe5272f64b8a34483fe6002436) )
14341434
1435    /* From a picture in an eBay auction the board appears to have a PAL that needs to be dumped. */
1436
14351437    MOTHERBOARD_PALS
14361438ROM_END
14371439
r5077r5078
18491851   ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, CRC(970c81f6) SHA1(f22189e172a795d115597feb48ccbc04be3859b9) )
18501852   ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, CRC(90ddd737) SHA1(8e1dde2f42e9bf755dedeef218745d1fc54faac7) )
18511853
1854    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1855    ROM_LOAD( "pal16r8.u7c", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8ANC */
1856
18521857    MOTHERBOARD_PALS
18531858ROM_END
18541859
r5077r5078
21302135/* Board: 006-8003-01-0D Rev D */
21312136GAME( 1984, hattrick, 0,        balsente, hattrick, hattrick, ROT0, "Bally/Sente",  "Hat Trick", GAME_SUPPORTS_SAVE )
21322137
2133/* Board: Unknown */
2138/* Board: Unknown (From a picture on eBay Snacks'n Jaxson does not match any documented types here.) */
21342139GAME( 1984, otwalls,  0,        balsente, otwalls,  otwalls,  ROT0, "Bally/Sente",  "Off the Wall (Sente)", GAME_SUPPORTS_SAVE )
21352140GAME( 1984, snakepit, 0,        balsente, sentetst, snakepit, ROT0, "Bally/Sente",  "Snake Pit", GAME_SUPPORTS_SAVE )
21362141GAME( 1984, snakjack, 0,        balsente, snakjack, snakjack, ROT0, "Bally/Sente",  "Snacks'n Jaxson", GAME_SUPPORTS_SAVE )
r5077r5078
21562161GAME( 1986, nstocker, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente",  "Night Stocker (set 1)", GAME_SUPPORTS_SAVE )
21572162GAME( 1986, nstockr2, nstocker, balsente, nstocker, nstocker, ROT0, "Bally/Sente",  "Night Stocker (set 2)", GAME_SUPPORTS_SAVE )
21582163GAME( 1986, sfootbal, 0,        balsente, sfootbal, sfootbal, ROT0, "Bally/Sente",  "Street Football", GAME_SUPPORTS_SAVE )
2164GAME( 1986, spiker,   0,        balsente, spiker,   spiker,   ROT0, "Bally/Sente",  "Spiker", GAME_SUPPORTS_SAVE )
21592165
21602166/* Board: Unknown */
2161GAME( 1986, spiker,   0,        balsente, spiker,   spiker,   ROT0, "Bally/Sente",  "Spiker", GAME_SUPPORTS_SAVE )
21622167GAME( 1986, stompin,  0,        balsente, stompin,  stompin,  ROT0, "Bally/Sente",  "Stompin'", GAME_SUPPORTS_SAVE )
21632168GAME( 1987, rescraid, 0,        balsente, rescraid, rescraid, ROT0, "Bally/Midway", "Rescue Raider", GAME_SUPPORTS_SAVE )
21642169GAME( 1987, rescrdsa, rescraid, balsente, rescraid, rescraid, ROT0, "Bally/Midway", "Rescue Raider (stand-alone)", GAME_SUPPORTS_SAVE )
src/mame/drivers/midzeus.c
r5077r5078
11641164
11651165ROM_START( mk4 )
11661166   ROM_REGION16_LE( 0x1000000, "dcs", ROMREGION_ERASEFF )   /* sound data */
1167   ROM_LOAD16_BYTE( "mk4_l2.u2", 0x000000, 0x200000, CRC(4c01b493) SHA1(dcd6da9ee30d0f6645bfdb1762d926be0a26090a) )
1167   ROM_LOAD16_BYTE( "mk4_l2.u2", 0x000000, 0x200000, CRC(4c01b493) SHA1(dcd6da9ee30d0f6645bfdb1762d926be0a26090a) ) /* These four sound roms were labeled as v2.0 */
11681168   ROM_LOAD16_BYTE( "mk4_l2.u3", 0x400000, 0x200000, CRC(8fbcf0ac) SHA1(c53704e72cfcba800c7af3a03267041f1e29a784) )
11691169   ROM_LOAD16_BYTE( "mk4_l2.u4", 0x800000, 0x200000, CRC(dee91696) SHA1(00a182a36a414744cd014fcfc53c2e1a66ab5189) )
11701170   ROM_LOAD16_BYTE( "mk4_l2.u5", 0xc00000, 0x200000, CRC(44d072be) SHA1(8a636c2801d799dfb84e69607ade76d2b49cf09f) )
11711171
11721172   ROM_REGION32_LE( 0x1800000, "user1", 0 )
1173   ROM_LOAD32_WORD( "mk4_l3.u10", 0x0000000, 0x200000, CRC(84efe5a9) SHA1(e2a9bf6fab971691017371a87ab87b1bf66f96d0) )
1173   ROM_LOAD32_WORD( "mk4_l3.u10", 0x0000000, 0x200000, CRC(84efe5a9) SHA1(e2a9bf6fab971691017371a87ab87b1bf66f96d0) ) /* Roms U10 & U11 were labeled as v3.0 */
11741174   ROM_LOAD32_WORD( "mk4_l3.u11", 0x0000002, 0x200000, CRC(0c026ccb) SHA1(7531fe81ff8d8dd9ec3cd915acaf14cbe6bdc90a) )
1175   ROM_LOAD32_WORD( "mk4_l3.u12", 0x0400000, 0x200000, CRC(7816c07f) SHA1(da94b4391e671f915c61b5eb9bece4acb3382e31) )
1176   ROM_LOAD32_WORD( "mk4_l3.u13", 0x0400002, 0x200000, CRC(b3c237cd) SHA1(9e71e60cc92c17524f85f36543c174ca138104cd) )
1177   ROM_LOAD32_WORD( "mk4_l3.u14", 0x0800000, 0x200000, CRC(fd33eb1a) SHA1(59d9d2e5251679d19cab031f51731c85f429ba18) )
1178   ROM_LOAD32_WORD( "mk4_l3.u15", 0x0800002, 0x200000, CRC(b907518f) SHA1(cfb56538746895bdca779957fec6a872019b23c3) )
1179   ROM_LOAD32_WORD( "mk4_l3.u16", 0x0c00000, 0x200000, CRC(24371d57) SHA1(c90134b17c23a182d391d1679bf457d251e641f7) )
1180   ROM_LOAD32_WORD( "mk4_l3.u17", 0x0c00002, 0x200000, CRC(3a1a082c) SHA1(5f8e8ce760d8ebadd1240ef08f1382a37cf11d0b) )
1175   ROM_LOAD32_WORD( "mk4_l2.u12", 0x0400000, 0x200000, CRC(7816c07f) SHA1(da94b4391e671f915c61b5eb9bece4acb3382e31) ) /* Roms U12 through U17 were all labeled as v2.0 */
1176   ROM_LOAD32_WORD( "mk4_l2.u13", 0x0400002, 0x200000, CRC(b3c237cd) SHA1(9e71e60cc92c17524f85f36543c174ca138104cd) )
1177   ROM_LOAD32_WORD( "mk4_l2.u14", 0x0800000, 0x200000, CRC(fd33eb1a) SHA1(59d9d2e5251679d19cab031f51731c85f429ba18) ) /* It is possible that in late production, these */
1178   ROM_LOAD32_WORD( "mk4_l2.u15", 0x0800002, 0x200000, CRC(b907518f) SHA1(cfb56538746895bdca779957fec6a872019b23c3) ) /* rom were also labeled as v3.0, but the labels */
1179   ROM_LOAD32_WORD( "mk4_l2.u16", 0x0c00000, 0x200000, CRC(24371d57) SHA1(c90134b17c23a182d391d1679bf457d251e641f7) ) /* with v2.0 have been verified on several boards */
1180   ROM_LOAD32_WORD( "mk4_l2.u17", 0x0c00002, 0x200000, CRC(3a1a082c) SHA1(5f8e8ce760d8ebadd1240ef08f1382a37cf11d0b) )
11811181ROM_END
11821182
11831183ROM_START( mk4a )
11841184   ROM_REGION16_LE( 0x1000000, "dcs", ROMREGION_ERASEFF )   /* sound data */
1185   ROM_LOAD16_BYTE( "mk4_l2.2", 0x000000, 0x200000, CRC(4c01b493) SHA1(dcd6da9ee30d0f6645bfdb1762d926be0a26090a) )
1186   ROM_LOAD16_BYTE( "mk4_l2.3", 0x400000, 0x200000, CRC(8fbcf0ac) SHA1(c53704e72cfcba800c7af3a03267041f1e29a784) )
1187   ROM_LOAD16_BYTE( "mk4_l2.4", 0x800000, 0x200000, CRC(dee91696) SHA1(00a182a36a414744cd014fcfc53c2e1a66ab5189) )
1188   ROM_LOAD16_BYTE( "mk4_l2.5", 0xc00000, 0x200000, CRC(44d072be) SHA1(8a636c2801d799dfb84e69607ade76d2b49cf09f) )
1185   ROM_LOAD16_BYTE( "mk4_l2.u2", 0x000000, 0x200000, CRC(4c01b493) SHA1(dcd6da9ee30d0f6645bfdb1762d926be0a26090a) ) /* These four sound roms were labeled as v2.0 */
1186   ROM_LOAD16_BYTE( "mk4_l2.u3", 0x400000, 0x200000, CRC(8fbcf0ac) SHA1(c53704e72cfcba800c7af3a03267041f1e29a784) )
1187   ROM_LOAD16_BYTE( "mk4_l2.u4", 0x800000, 0x200000, CRC(dee91696) SHA1(00a182a36a414744cd014fcfc53c2e1a66ab5189) )
1188   ROM_LOAD16_BYTE( "mk4_l2.u5", 0xc00000, 0x200000, CRC(44d072be) SHA1(8a636c2801d799dfb84e69607ade76d2b49cf09f) )
11891189
11901190   ROM_REGION32_LE( 0x1800000, "user1", 0 )
1191   ROM_LOAD32_WORD( "mk4_l2.1.u10", 0x000000, 0x200000, CRC(42d0f1c9) SHA1(5ac0ded8bf6e756319be2691e3b555eac079ebdc) )
1191   ROM_LOAD32_WORD( "mk4_l2.1.u10", 0x000000, 0x200000, CRC(42d0f1c9) SHA1(5ac0ded8bf6e756319be2691e3b555eac079ebdc) ) /* Roms U10 & U11 were labeled as v2.1 */
11921192   ROM_LOAD32_WORD( "mk4_l2.1.u11", 0x000002, 0x200000, CRC(6e21b243) SHA1(6d4768a5972db05c1409e0d16e79df9eff8918a0) )
1193   ROM_LOAD32_WORD( "mk4_l3.u12", 0x0400000, 0x200000, CRC(7816c07f) SHA1(da94b4391e671f915c61b5eb9bece4acb3382e31) )
1194   ROM_LOAD32_WORD( "mk4_l3.u13", 0x0400002, 0x200000, CRC(b3c237cd) SHA1(9e71e60cc92c17524f85f36543c174ca138104cd) )
1195   ROM_LOAD32_WORD( "mk4_l3.u14", 0x0800000, 0x200000, CRC(fd33eb1a) SHA1(59d9d2e5251679d19cab031f51731c85f429ba18) )
1196   ROM_LOAD32_WORD( "mk4_l3.u15", 0x0800002, 0x200000, CRC(b907518f) SHA1(cfb56538746895bdca779957fec6a872019b23c3) )
1197   ROM_LOAD32_WORD( "mk4_l3.u16", 0x0c00000, 0x200000, CRC(24371d57) SHA1(c90134b17c23a182d391d1679bf457d251e641f7) )
1198   ROM_LOAD32_WORD( "mk4_l3.u17", 0x0c00002, 0x200000, CRC(3a1a082c) SHA1(5f8e8ce760d8ebadd1240ef08f1382a37cf11d0b) )
1193   ROM_LOAD32_WORD( "mk4_l2.u12", 0x0400000, 0x200000, CRC(7816c07f) SHA1(da94b4391e671f915c61b5eb9bece4acb3382e31) ) /* Roms U12 through U17 were all labeled as v2.0 */
1194   ROM_LOAD32_WORD( "mk4_l2.u13", 0x0400002, 0x200000, CRC(b3c237cd) SHA1(9e71e60cc92c17524f85f36543c174ca138104cd) )
1195   ROM_LOAD32_WORD( "mk4_l2.u14", 0x0800000, 0x200000, CRC(fd33eb1a) SHA1(59d9d2e5251679d19cab031f51731c85f429ba18) )
1196   ROM_LOAD32_WORD( "mk4_l2.u15", 0x0800002, 0x200000, CRC(b907518f) SHA1(cfb56538746895bdca779957fec6a872019b23c3) )
1197   ROM_LOAD32_WORD( "mk4_l2.u16", 0x0c00000, 0x200000, CRC(24371d57) SHA1(c90134b17c23a182d391d1679bf457d251e641f7) )
1198   ROM_LOAD32_WORD( "mk4_l2.u17", 0x0c00002, 0x200000, CRC(3a1a082c) SHA1(5f8e8ce760d8ebadd1240ef08f1382a37cf11d0b) )
11991199ROM_END
12001200
12011201ROM_START( invasnab ) /* Version 5.0 Program roms, v4.0 Graphics roms, v2.0 Sound roms */
src/mame/drivers/bestleag.c
r5077r5078
114114      if(bestleag_vregs[0x00/2] & 0x1000)
115115         color &= 7;
116116
117      drawgfx(bitmap,machine->gfx[2],
117      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
118118               code,
119119               color,
120120               flipx, 0,
121               flipx ? (sx+16) : (sx),sy,
122               cliprect,TRANSPARENCY_PEN,15);
121               flipx ? (sx+16) : (sx),sy,15);
123122
124      drawgfx(bitmap,machine->gfx[2],
123      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
125124               code+1,
126125               color,
127126               flipx, 0,
128               flipx ? (sx) : (sx+16),sy,
129               cliprect,TRANSPARENCY_PEN,15);
127               flipx ? (sx) : (sx+16),sy,15);
130128
131129      /* wraparound x */
132      drawgfx(bitmap,machine->gfx[2],
130      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
133131               code,
134132               color,
135133               flipx, 0,
136               flipx ? (sx+16 - 512) : (sx - 512),sy,
137               cliprect,TRANSPARENCY_PEN,15);
134               flipx ? (sx+16 - 512) : (sx - 512),sy,15);
138135
139      drawgfx(bitmap,machine->gfx[2],
136      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
140137               code+1,
141138               color,
142139               flipx, 0,
143               flipx ? (sx - 512) : (sx+16 - 512),sy,
144               cliprect,TRANSPARENCY_PEN,15);
140               flipx ? (sx - 512) : (sx+16 - 512),sy,15);
145141   }
146142}
147143
src/mame/drivers/norautp.c
r5077r5078
204204            int tile = np_vram[count] & 0x3f;
205205            int colour = (np_vram[count] & 0xc0) >> 6;
206206
207            drawgfx(bitmap,screen->machine->gfx[1], tile, colour, 0, 0, x * 32, y * 32, cliprect, TRANSPARENCY_NONE, 0);
207            drawgfx_opaque(bitmap,cliprect, screen->machine->gfx[1], tile, colour, 0, 0, x * 32, y * 32);
208208
209209            count+=2;
210210         }
r5077r5078
216216            int tile = np_vram[count] & 0x3f;
217217            int colour = (np_vram[count] & 0xc0) >> 6;
218218
219            drawgfx(bitmap,screen->machine->gfx[0], tile, colour, 0, 0, x * 16, y * 32, cliprect, TRANSPARENCY_NONE, 0);
219            drawgfx_opaque(bitmap,cliprect, screen->machine->gfx[0], tile, colour, 0, 0, x * 16, y * 32);
220220
221221            count++;
222222         }
src/mame/drivers/kaneko16.c
r5077r5078
8080#include "sound/2151intf.h"
8181#include "sound/okim6295.h"
8282
83UINT16* kaneko16_calc3_fakeram;
84static UINT16* kaneko16_mainram;
85
8386/***************************************************************************
8487
8588
r5077r5078
789792
790793static ADDRESS_MAP_START( shogwarr, ADDRESS_SPACE_PROGRAM, 16 )
791794   AM_RANGE(0x000000, 0x03ffff) AM_ROM      // ROM
792   AM_RANGE(0x100000, 0x10ffff) AM_RAM      // Work RAM
795   AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_BASE(&kaneko16_mainram)      // Work RAM
793796   AM_RANGE(0x200000, 0x20ffff) AM_READWRITE(SMH_RAM,calc3_mcu_ram_w) AM_BASE(&kaneko16_mcu_ram)   // Shared With MCU
794797   AM_RANGE(0x280000, 0x280001) AM_WRITE(calc3_mcu_com0_w)
795798   AM_RANGE(0x290000, 0x290001) AM_WRITE(calc3_mcu_com1_w)
r5077r5078
813816   AM_RANGE(0xb80006, 0xb80007) AM_READ_PORT("UNK")
814817   AM_RANGE(0xd00000, 0xd00001) AM_NOP                     // ? (bit 0)
815818   AM_RANGE(0xe00000, 0xe00001) AM_WRITE(shogwarr_oki_bank_w)   // Samples Bankswitching
819
820   AM_RANGE(0xf00000, 0xffffff) AM_RAM AM_BASE(&kaneko16_calc3_fakeram) // I copy protection data tables here because I don't know where they really go.  NOT ON PCB
816821ADDRESS_MAP_END
817822
818823
r5077r5078
19741979   {
19751980      case 2:  cpu_set_input_line(device, 2, HOLD_LINE); break;
19761981      case 1:  cpu_set_input_line(device, 3, HOLD_LINE); break;
1977      case 0:  cpu_set_input_line(device, 4, HOLD_LINE); break;
1982
1983      // the code for this interupt is provided by the MCU..
1984      //case 0:  cpu_set_input_line(device, 4, HOLD_LINE); break;
1985      case 0:
1986      {
1987         // hack, clear this ram address to get into test mode (interrupt would clear it)
1988         if (kaneko16_mainram[0x2dfe/2]==0xff00)
1989         {
1990            kaneko16_mainram[0x2dfe/2]=0x0000;
1991         }
1992
1993      }
19781994   }
19791995}
19801996
r5077r5078
36383654
36393655UINT16 calc3_mcu_crc;
36403656
3641DRIVER_INIT( calc3 )
3657/* decryption tables */
3658
3659/* table 0x00 = not encrypted? */
3660static UINT8 calc3_table00[64] = {
3661   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
3662   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
3663   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
3664   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
3665};
3666
3667/* ok */
3668static UINT8 calc3_table01[64] = {
3669   0xce,0xab,0xa1,0xaa,0x20,0x20,0xcb,0x57,0x5b,0x65,0xd6,0x65,0x5e,0x92,0x6c,0x0a,
3670   0xf8,0xea,0xb6,0xfd,0x76,0x35,0x47,0xaf,0xed,0xe0,0xcc,0x4d,0x4c,0xd6,0x74,0x78,
3671   0x20,0x1c,0x1f,0xc1,0x25,0x2e,0x49,0xe7,0x90,0x1b,0xb4,0xcf,0x1e,0x61,0xd7,0x46,
3672   0xda,0x89,0x08,0x77,0xb1,0x81,0x6b,0x2d,0xb6,0xbc,0x99,0xc9,0x35,0x0a,0x0f,0x01
3673};
3674
3675/* ok */
3676static UINT8 calc3_table15[64] = {
3677   0x0C,0xEB,0x30,0x25,0xA8,0xED,0xE3,0x23,0xAC,0x2B,0x8D,0x34,0x88,0x9F,0x55,0xB5,
3678   0xBF,0x15,0xE3,0x7C,0x54,0xD4,0x72,0xA9,0x7E,0x80,0x27,0x9F,0xA3,0x3F,0xA1,0x4D,
3679   0x84,0x1B,0xD1,0xB2,0xB5,0xA7,0x0C,0xA0,0x51,0xE6,0x5E,0xC0,0xEB,0x68,0x22,0xD6,
3680   0xC8,0xB6,0xCF,0x46,0x4B,0xF0,0x15,0xD7,0xB0,0xB5,0x29,0xB8,0xFD,0x43,0x5C,0xC0
3681};
3682
3683/* partial guessed tables
3684unsigned char table31[64] = {
3685    // x     x     x    ok     x     x     x    ok     x     x     x    ok     x     x     x    ok
3686    0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3b,
3687    0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0xdc,
3688    0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0xde,
3689    0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xb1
3690};
3691
3692
3693unsigned char tableb0[64] = {
3694    // x     x     x    ok     x     x     x    ok     x     x     x    ok     x     x     x    ok
3695    0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x81,
3696    0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x32,
3697    0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00,
3698    0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x5b
3699};
3700
3701unsigned char tableb7[64] = {
3702    // x     x     x    ok     x     x     x    ok     x     x     x    ok     x     x     x    ok
3703    0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xd7,
3704    0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x82,
3705    0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x26,
3706    0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x33
3707};
3708
3709unsigned char tablebb[64] = {
3710    // x     x     x    ok     x     x     x    ok     x     x     x    ok     x     x     x    ok
3711    0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x3d,
3712    0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x69,
3713    0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x9e,
3714    0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x4d
3715};
3716*/
3717
3718// global so we can use them in the filename when we save out the data (debug..)
3719static UINT8 calc3_decryption_key_byte;
3720static UINT8 calc3_unknown;
3721static UINT8 calc3_mode;
3722static UINT8 calc3_blocksize_offset;
3723static UINT16 calc3_dataend;
3724static UINT16 calc3_database;
3725
3726// endian safe? you're having a laugh
3727int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, int dstoffset)
36423728{
36433729   UINT8* rom = memory_region(machine,"cpu1");
3644
3730   UINT8 numregions;
3731   UINT16 length;
36453732   int x;
36463733   int offset = 0;
3647   UINT8 numregions;
3734   numregions = rom[offset+0];
36483735
3649   calc3_mcu_crc = 0;
3650   for (x=0;x<0x20000;x++)
3736   if (tabnum > numregions)
36513737   {
3652      calc3_mcu_crc+=rom[x];
3738      printf("CALC3 error, requested table > num tables!\n");
3739      return 0;
36533740   }
3654   printf("crc %04x\n",calc3_mcu_crc);
36553741
3656   numregions = rom[offset+0];
36573742   rom++;
36583743
3744   // scan through the linked list to find the start of the requested table info
3745   for (x=0;x<tabnum;x++)
3746   {
3747      UINT8 blocksize_offset = rom[offset+0]; // location of the 'block length'
3748      offset+= blocksize_offset+1;
3749      length = rom[offset+0] | (rom[offset+1]<<8);
3750      offset+=length+2;
3751   }
36593752
3660
3661
3662
3663   for (x=0;x<numregions;x++)
3753   // we're at the start of the block, get the info about it
36643754   {
3665      int length;
3666      int startoffset = offset;
3667      int xx;
3668      int blocksize_offset = rom[offset+0]; // location of the 'block length'
3669      int decryption_key_byte = rom[offset+3];
3670      int inline_table_base = 0;
3671      int inline_table_size = 0;
3672      UINT8 mode = rom[offset+1];
3673      UINT8 unknown = rom[offset+2];
3755      UINT16 inline_table_base = 0;
3756      UINT16 inline_table_size = 0;
3757      calc3_database = offset;
3758      calc3_blocksize_offset =    rom[offset+0]; // location of the 'block length'
3759      calc3_mode =                rom[offset+1];
3760      calc3_unknown =             rom[offset+2];
3761      calc3_decryption_key_byte = rom[offset+3];
36743762
36753763
3676      printf("%04x keydat %02x - bsofs:%02x m:%02x u:%02x k:%02x | ", startoffset, x, blocksize_offset,mode,unknown,decryption_key_byte);
3677
3678      // if blocksize_offset > 3, it seems to specify the decryption table (or _a_ decryption table) inline of specified length, which loops over the data
3679      if (blocksize_offset>3)
3764      // if blocksize_offset > 3, it appears to specify the encryption table as 'inline' which can be of any size (odd or even) and loops over the bytes to decrypt
3765      // the decryption key specified seems to be ignored?
3766      if (calc3_blocksize_offset>3)
36803767      {
36813768         inline_table_base = offset+4;
3682         inline_table_size = blocksize_offset-3;
3683         for (xx=0;xx<blocksize_offset-3;xx++)
3684         {
3685            printf("%02x ", rom[inline_table_base+xx]);
3686         }
3769         inline_table_size = calc3_blocksize_offset-3;
36873770      }
36883771
3689
3690      offset+= blocksize_offset+1;
3772      offset+= calc3_blocksize_offset+1;
36913773      length = rom[offset+0] | (rom[offset+1]<<8);
3774      offset+=2;
36923775
3693      printf("(length %04x)", length);
3776      if (inline_table_size)
3777      {
3778         printf("Block %02x Found Base %04x - Inline Encryption (size %02x) - Mode? %02x Unknown %02x Key (unused?) %02x Length %04x\n", tabnum, calc3_database, inline_table_size, calc3_mode, calc3_unknown, calc3_decryption_key_byte, length);
3779      }
3780      else
3781      {
3782         printf("Block %02x Found Base %04x - Mode? %02x Unknown %02x Key (unused?) %02x Length %04x\n", tabnum, calc3_database, calc3_mode, calc3_unknown, calc3_decryption_key_byte, length);
3783      }
36943784
3695      printf("\n");
36963785
3697      offset+=2;
3786      // copy + decrypt the table to the specified memory area
3787      if (dstram)
3788      {
3789         int i;
36983790
3699      //if (x==0x2d)
3700      {
3701         if (length != 0)
3791         if (length==0x00)
37023792         {
3793            // shogwarr does this with 'mode' as 0x08, which probably has some special meaning
3794            //printf("CALC3: requested 0 length table!\n");
3795         }
37033796
3704            if (blocksize_offset==3)
3797         if (inline_table_size)
3798         {
3799            for (i=0;i<length;i++)
37053800            {
3801               UINT8 dat = rom[offset+i];
3802               dat -= rom[inline_table_base + (i%inline_table_size)];
3803               dstram[(dstoffset+i)^1] = dat;
3804            }
3805         }
3806         else
3807         {
3808            UINT8* table = calc3_table00;
37063809
3707               // these tables are guessed, where do they come from? internal mcu rom? 0x1000 block at the end? are they related?
3708               UINT8* table = 0;
3810            // 0x00 seems to have no 'encryption'
3811            if (calc3_decryption_key_byte == 0x00) table = calc3_table00;
37093812
3710               /* ok */
3711               UINT8 table01[64] = {
3712                  0xce,0xab,0xa1,0xaa,0x20,0x20,0xcb,0x57,0x5b,0x65,0xd6,0x65,0x5e,0x92,0x6c,0x0a,
3713                  0xf8,0xea,0xb6,0xfd,0x76,0x35,0x47,0xaf,0xed,0xe0,0xcc,0x4d,0x4c,0xd6,0x74,0x78,
3714                  0x20,0x1c,0x1f,0xc1,0x25,0x2e,0x49,0xe7,0x90,0x1b,0xb4,0xcf,0x1e,0x61,0xd7,0x46,
3715                  0xda,0x89,0x08,0x77,0xb1,0x81,0x6b,0x2d,0xb6,0xbc,0x99,0xc9,0x35,0x0a,0x0f,0x01
3716               };
3813            // currently only handle 2 of the formats :-(
3814            if (calc3_decryption_key_byte == 0x01) table = calc3_table01;
3815            if (calc3_decryption_key_byte == 0x15) table = calc3_table15;
37173816
3817            for (i=0;i<length;i++)
3818            {
3819               UINT8 dat = rom[offset+i];
3820               dat -= table[i&0x3f];
3821               dstram[(dstoffset+i)^1] = dat;
3822            }
3823         }
3824      }
37183825
3826      calc3_dataend = offset+length+1;
3827   }
37193828
3720               /* ok */
3721               UINT8 table15[64] = {
3722                  0x0C,0xEB,0x30,0x25,0xA8,0xED,0xE3,0x23,0xAC,0x2B,0x8D,0x34,0x88,0x9F,0x55,0xB5,
3723                  0xBF,0x15,0xE3,0x7C,0x54,0xD4,0x72,0xA9,0x7E,0x80,0x27,0x9F,0xA3,0x3F,0xA1,0x4D,
3724                  0x84,0x1B,0xD1,0xB2,0xB5,0xA7,0x0C,0xA0,0x51,0xE6,0x5E,0xC0,0xEB,0x68,0x22,0xD6,
3725                  0xC8,0xB6,0xCF,0x46,0x4B,0xF0,0x15,0xD7,0xB0,0xB5,0x29,0xB8,0xFD,0x43,0x5C,0xC0
3726               };
3829   //printf("data base %04x data end %04x\n", calc3_database, calc3_dataend);
37273830
3831   return length;
37283832
3729               /* used by shogun & brapboys */
3730               unsigned char table31[64] = {
3731                        // x     x     x    ok     x     x     x    ok     x     x     x    ok     x     x     x    ok
3732                  0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3b,
3733                  0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0xdc,
3734                  0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0xde,
3735                  0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xb1
3736               };
3833}
37373834
3738               /* not ok */
3739               unsigned char table3f[64] = {
3740                  0x29,0x34,0xD9,0x20,0x61,0x54,0x5F,0x6C,0x21,0x7E,0x5A,0x0F,0xD0,0x35,0x3B,0x2E,
3741                  0x44,0x4C,0x71,0xE5,0x53,0x93,0x59,0x1A,0x1A,0xB5,0xE7,0x7A,0x0F,0x61,0x13,0xBD,
3742                  0xC7,0xA8,0x05,0x2A,0x86,0xA7,0x00,0x5A,0x8B,0x65,0x10,0xBE,0x18,0xFE,0x71,0xE3,
3743                  0x43,0x02,0xC3,0xF5,0x7E,0x18,0xF1,0x82,0xE7,0xE7,0xDC,0x01,0x4F,0x36,0xCA,0x13
3744                  };
3835static UINT8 calc3_decryption_key_byte;
3836static UINT8 calc3_unknown;
3837static UINT8 calc3_mode;
3838static UINT8 calc3_blocksize_offset;
37453839
3840DRIVER_INIT( calc3 )
3841{
3842   UINT8* rom = memory_region(machine,"cpu1");
3843   UINT8 numregions;
37463844
3845   int x;
37473846
3748               unsigned char tableb0[64] = {
3749                        // x     x     x    ok     x     x     x    ok     x     x     x    ok     x     x     x    ok
3750                  0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x81,
3751                  0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x32,
3752                  0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00,
3753                  0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x5b
3754               };
3847   calc3_mcu_crc = 0;
3848   for (x=0;x<0x20000;x++)
3849   {
3850      calc3_mcu_crc+=rom[x];
3851   }
3852   printf("crc %04x\n",calc3_mcu_crc);
3853   numregions = rom[0];
37553854
3756               unsigned char tableb7[64] = {
3757                        // x     x     x    ok     x     x     x    ok     x     x     x    ok     x     x     x    ok
3758                  0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xd7,
3759                  0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x82,
3760                  0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x26,
3761                  0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x33
3762               };
3855   for (x=0;x<numregions;x++)
3856   {
3857      UINT8* tmpdstram = malloc(0x2000);
3858      int length;
3859      memset(tmpdstram, 0x00,0x2000);
3860      length = calc3_decompress_table(machine, x, tmpdstram, 0);
37633861
3764               unsigned char tablebb[64] = {
3765                        // x     x     x    ok     x     x     x    ok     x     x     x    ok     x     x     x    ok
3766                  0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x3d,
3767                  0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x69,
3768                  0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x9e,
3769                  0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x4d
3770               };
3771                           /* not ok */
3772               unsigned char tablebf[64] = {
3773                  0x9B, 0x8F, 0xDC, 0xBE, 0xE1, 0xD9, 0xE1, 0x86, 0x10, 0x4E, 0xBA, 0xC4,   0x8D, 0x6E, 0xD8, 0x9B,
3774                  0x2F, 0x0F, 0xAC, 0x2C, 0xCB, 0x00, 0x92, 0x5D,   0x80, 0xED, 0x7E, 0xD9, 0xC3, 0x82, 0x69, 0x58,
3775                  0x29, 0xD3, 0x78, 0x21,   0xF7, 0xFC, 0xF1, 0xCD, 0x69, 0x04, 0xDD, 0x4D, 0xC4, 0x08, 0x7C, 0x2F,
3776                  0x1D, 0x95, 0x6C, 0x1C, 0xE7, 0x55, 0x98, 0xA6, 0x3D, 0xEE, 0xE1, 0x40,   0xF4, 0x27, 0x8E, 0x8E
3777               };
3862      // dump to file
3863      if (length)
3864      {
3865         FILE *fp;
3866         char filename[256];
37783867
3779               if (decryption_key_byte == 0x01) table = table01;
3780               if (decryption_key_byte == 0x15) table = table15;
3781               if (decryption_key_byte == 0x31) table = table31;
3782               if (decryption_key_byte == 0x3f) table = table3f;
3783               if (decryption_key_byte == 0xb0) table = tableb0;
3784               if (decryption_key_byte == 0xb7) table = tableb7;
3785               if (decryption_key_byte == 0xbb) table = tablebb;
3786               if (decryption_key_byte == 0xbf) table = tablebf;
3787
3788               if (table)
3789               {
3790                  int l;
3791                  for (l=0;l<length;l++)
3792                  {
3793                     rom[offset+l] -= table[l&0x3f];
3794                  }
3795               }
3796            }
3797            else if (blocksize_offset>3)// inline decryption table case
3798            {
3799               int l;
3800               for (l=0;l<length;l++)
3801               {
3802                  rom[offset+l] -= rom[inline_table_base + (l%inline_table_size)];
3803               }
3804            }
3805            else
3806            {
3807               printf("blocksize offset < 3??\n");
3808
3809            }
3810
3811            // dump out file
3812            {
3813               FILE *fp;
3814               char filename[256];
3815
3816               sprintf(filename,"data_%s_tableno%02x_key%02x_inlineoffset%02x_length%04x",
3868         if (calc3_blocksize_offset==3)
3869         {
3870            sprintf(filename,"data_%s_table_%04x k%02x m%02x u%02x length %04x",
3871                  machine->gamedrv->name,
3872                  x, calc3_decryption_key_byte, calc3_mode, calc3_unknown, length);
3873         }
3874         else
3875         {
3876            sprintf(filename,"data_%s_table_%04x k%02x (use indirect size %02x) m%02x u%02x length %04x",
38173877               machine->gamedrv->name,
3818               x,
3819               decryption_key_byte,
3820               blocksize_offset,
3821               length);
3878               x, calc3_decryption_key_byte, calc3_blocksize_offset-3, calc3_mode, calc3_unknown, length);
3879         }
38223880
3823
3824               fp=fopen(filename, "w+b");
3825               if (fp)
3826               {
3827                  fwrite(&rom[offset], length, 1, fp);
3828                  fclose(fp);
3829               }
3830            }
3831
3881         fp=fopen(filename, "w+b");
3882         if (fp)
3883         {
3884            fwrite(tmpdstram, length, 1, fp);
3885            fclose(fp);
38323886         }
38333887      }
38343888
3835      offset+=length;
3889      free(tmpdstram);
38363890   }
38373891
3892   // there is also a 0x1000 block of data at the end.. same on both games, maybe it's related to the decryption tables??
3893   // the calc3_dataend points to the data after the last block processed, as we process all the blocks in the above loop, we assume this points
3894   // to that extra block of data
3895
38383896   // dump out the 0x1000 sized block at the end
38393897   {
38403898      FILE *fp;
r5077r5078
38463904      fp=fopen(filename, "w+b");
38473905      if (fp)
38483906      {
3849         fwrite(&rom[offset], 0x1000, 1, fp);
3907         fwrite(&rom[calc3_dataend], 0x1000, 1, fp);
38503908         fclose(fp);
38513909      }
38523910   }
src/mame/drivers/chanbara.c
r5077r5078
144144            if(!flipy)
145145            {
146146
147               drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy-16,cliprect, TRANSPARENCY_PEN, 0);
148               drawgfx(bitmap, machine->gfx[1], code+1, color, flipx, flipy, sx, sy,   cliprect, TRANSPARENCY_PEN, 0);
147               drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy-16, 0);
148               drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code+1, color, flipx, flipy, sx, sy, 0);
149149            }
150150            else
151151            {
152               drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,cliprect, TRANSPARENCY_PEN, 0);
153               drawgfx(bitmap, machine->gfx[1], code+1, color, flipx, flipy, sx, sy-16,cliprect, TRANSPARENCY_PEN, 0);
152               drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
153               drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code+1, color, flipx, flipy, sx, sy-16, 0);
154154            }
155155         }
156156         else
157157         {
158            drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,cliprect, TRANSPARENCY_PEN, 0);
158            drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
159159         }
160160      }
161161   }
src/mame/drivers/chsuper.c
r5077r5078
3636         tile ^=chsuper_tilexor;
3737         //int colour = tile>>12;
3838
39         drawgfx(bitmap,gfx,tile,0,0,0,x*4,y*8,cliprect,TRANSPARENCY_NONE,0);
39         drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*4,y*8);
4040         count+=2;
4141      }
4242   }
src/mame/drivers/fcrash.c
r5077r5078
147147      colour = cps1_gfxram[base+pos+1]&0x1f;
148148      ypos = 256-ypos;
149149
150      pdrawgfx(bitmap,machine->gfx[2],tileno,colour,flipx,flipy,xpos+49,ypos-16,cliprect,TRANSPARENCY_PEN,15,0x02);
150      pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],tileno,colour,flipx,flipy,xpos+49,ypos-16,priority_bitmap,0x02,15);
151151
152152   }
153153
src/mame/drivers/gstream.c
r5077r5078
433433      if (x & 0x8000) x-=0x10000;
434434      if (y & 0x8000) y-=0x10000;
435435
436      drawgfx(bitmap,screen->machine->gfx[1],code,col,0,0,x-2,y,cliprect,TRANSPARENCY_PEN,0);
436      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],code,col,0,0,x-2,y,0);
437437   }
438438
439439   return 0;
src/mame/drivers/igs017.c
r5077r5078
180180
181181   gfx_element_build_temporary(&gfx, machine, sprites_gfx + addr, dimx, dimy, dimx, 0x100, 32, 0);
182182
183   drawgfx(   bitmap,&gfx,
183   drawgfx_transpen(   bitmap,cliprect, &gfx,
184184            0, color,
185185            flipx, flipy,
186            sx, sy,
187            cliprect, TRANSPARENCY_PEN, 0x1f   );
186            sx, sy, 0x1f   );
188187}
189188
190189static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
src/mame/drivers/missb2.c
r5077r5078
105105               flipy = !flipy;
106106            }
107107
108            drawgfx(bitmap,screen->machine->gfx[0],
108            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
109109                  code,
110110                  0,
111111                  flipx,flipy,
112                  x,y,
113                  cliprect,TRANSPARENCY_PEN,0xff);
112                  x,y,0xff);
114113         }
115114      }
116115
src/mame/drivers/mpoker.c
r5077r5078
2828      {
2929         UINT16 dat = mpoker_video[count];
3030         UINT16 col = mpoker_video[count+0x400];
31         drawgfx(bitmap,gfx,dat,col,0,0,x*16,y*16,cliprect,TRANSPARENCY_NONE,0);
31         drawgfx_opaque(bitmap,cliprect,gfx,dat,col,0,0,x*16,y*16);
3232         count++;
3333      }
3434
src/mame/drivers/skyarmy.c
r5077r5078
118118      sy = 242-spriteram[offs];
119119      flipy = (spriteram[offs+1]&0x80)>>7;
120120      flipx = (spriteram[offs+1]&0x40)>>6;
121      drawgfx(bitmap,screen->machine->gfx[1],
121      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
122122      spriteram[offs+1]&0x3f,
123123      pal,
124124      flipx,flipy,
125      sx,sy,
126      cliprect,TRANSPARENCY_PEN,0);
125      sx,sy,0);
127126   }
128127   return 0;
129128}
src/mame/drivers/dmndrby.c
r5077r5078
363363         int chr = racetrack_tilemap_rom[off];
364364         int col = racetrack_tilemap_rom[off+0x2000]&0x1f;
365365         int flipx = racetrack_tilemap_rom[off+0x2000]&0x40;
366         drawgfx(bitmap,track,chr,col,flipx,0,y*16+scrolly,x*16,cliprect,TRANSPARENCY_NONE,0);
366         drawgfx_opaque(bitmap,cliprect,track,chr,col,flipx,0,y*16+scrolly,x*16);
367367         // draw another bit of track
368368         // a rubbish way of doing it
369369         chr = racetrack_tilemap_rom[off-0x100];
370370         col = racetrack_tilemap_rom[off+0x1f00]&0x1f;
371371         flipx = racetrack_tilemap_rom[off+0x1f00]&0x40;
372         drawgfx(bitmap,track,chr,col,flipx,0,y*16-256+scrolly,x*16,cliprect,TRANSPARENCY_NONE,0);
372         drawgfx_opaque(bitmap,cliprect,track,chr,col,flipx,0,y*16-256+scrolly,x*16);
373373         off++;
374374      }
375375   }
r5077r5078
399399      for (a=0;a<8 ;a++)
400400      {
401401         for(b=0;b<7;b++) {
402            drawgfx(bitmap,sprites,anim+a*8+b,col,0,0,sprx+a*8,spry+b*8,cliprect,TRANSPARENCY_PEN,0);
402            drawgfx_transpen(bitmap,cliprect,sprites,anim+a*8+b,col,0,0,sprx+a*8,spry+b*8,0);
403403         }
404404      }
405405      // draw the horse number
406406      a=3;
407407      b=3;
408      drawgfx(bitmap,sprites,anim+horse,col,0,0,sprx+a*8,spry+b*8,cliprect,TRANSPARENCY_PEN,0);
408      drawgfx_transpen(bitmap,cliprect,sprites,anim+horse,col,0,0,sprx+a*8,spry+b*8,0);
409409
410410
411411   }
src/mame/drivers/metro.c
r5077r5078
869869static ADDRESS_MAP_START( balcube_map, ADDRESS_SPACE_PROGRAM, 16 )
870870   AM_RANGE(0x000000, 0x07ffff) AM_ROM                                       // ROM
871871   AM_RANGE(0xf00000, 0xf0ffff) AM_RAM                                       // RAM
872   AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE8("ymf", ymf278b_r,ymf278b_w, 0x00ff)   // Sound
872   AM_RANGE(0x300000, 0x300001) AM_DEVREAD8("ymf", ymf278b_r, 0x00ff)               // Sound
873   AM_RANGE(0x300000, 0x30000b) AM_DEVWRITE8("ymf", ymf278b_w, 0x00ff)               // Sound
873874   AM_RANGE(0x400000, 0x41ffff) AM_READ(balcube_dsw_r)                           // DSW x 3
874875   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("IN0")                           // Inputs
875876   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("IN1")                           //
r5077r5078
903904static ADDRESS_MAP_START( daitoa_map, ADDRESS_SPACE_PROGRAM, 16 )
904905   AM_RANGE(0x000000, 0x07ffff) AM_ROM                                       // ROM
905906   AM_RANGE(0xf00000, 0xf0ffff) AM_RAM                                     // RAM
906   AM_RANGE(0x400000, 0x400001) AM_DEVREADWRITE8("ymf", ymf278b_r,ymf278b_w, 0x00ff)   // Sound
907   AM_RANGE(0x400000, 0x400001) AM_DEVREAD8("ymf", ymf278b_r, 0x00ff)               // Sound
908   AM_RANGE(0x400000, 0x40000b) AM_DEVWRITE8("ymf", ymf278b_w, 0x00ff)               // Sound
907909   AM_RANGE(0x300000, 0x31ffff) AM_READ(balcube_dsw_r)                           // DSW x 3
908910   AM_RANGE(0x100000, 0x11ffff) AM_RAM_WRITE(metro_vram_0_w) AM_BASE(&metro_vram_0   )   // Layer 0
909911   AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(&metro_vram_1   )   // Layer 1
r5077r5078
937939   AM_RANGE(0x000000, 0x07ffff) AM_ROM                                       // ROM
938940   AM_RANGE(0xf00000, 0xf0ffff) AM_RAM                                       // RAM
939941   AM_RANGE(0xf10000, 0xf10fff) AM_RAM                                       // RAM (bug in the ram test routine)
940   AM_RANGE(0xb00000, 0xb00001) AM_DEVREADWRITE8("ymf", ymf278b_r,ymf278b_w, 0x00ff)   // Sound
942   AM_RANGE(0xb00000, 0xb00001) AM_DEVREAD8("ymf", ymf278b_r, 0x00ff)               // Sound
943   AM_RANGE(0xb00000, 0xb0000b) AM_DEVWRITE8("ymf", ymf278b_w, 0x00ff)               // Sound
941944   AM_RANGE(0xc00000, 0xc1ffff) AM_READ(balcube_dsw_r)                           // DSW x 3
942945   AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("IN0")                           // Inputs
943946   AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("IN1")                           //
src/mame/drivers/liberate.c
r5077r5078
3737WRITE8_HANDLER( prosoccr_io_w );
3838WRITE8_HANDLER( prosport_io_w );
3939WRITE8_HANDLER( prosport_paletteram_w );
40WRITE8_HANDLER( prosport_bg_vram_w );
4041WRITE8_HANDLER( liberate_videoram_w );
4142WRITE8_HANDLER( liberate_colorram_w );
4243
r5077r5078
241242
242243static ADDRESS_MAP_START( prosport_map, ADDRESS_SPACE_PROGRAM, 8 )
243244   AM_RANGE(0x0200, 0x021f) AM_RAM_WRITE(prosport_paletteram_w) AM_BASE(&paletteram)
244   AM_RANGE(0x0400, 0x07ff) AM_RAM AM_BASE(&prosport_bg_vram)
245245   AM_RANGE(0x0000, 0x03ff) AM_SHARE(2) AM_RAM
246//  AM_RANGE(0x0e00, 0x0fff) AM_RAM
247//  AM_RANGE(0x1600, 0x17ff) AM_RAM
248//  AM_RANGE(0x1e00, 0x1fff) AM_RAM
246   AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(prosport_bg_vram_w) AM_BASE(&prosport_bg_vram)
249247   AM_RANGE(0x0800, 0x1fff) AM_READWRITE(prosport_charram_r,prosport_charram_w) //0x1e00-0x1ff isn't charram!
250//  AM_RANGE(0x2000, 0x2fff) AM_RAM //likely i/o
251248   AM_RANGE(0x2000, 0x23ff) AM_SHARE(2) AM_RAM
252   AM_RANGE(0x2800, 0x2bff) AM_RAM
253//  AM_RANGE(0x2800, 0x2fff) AM_SHARE(2) AM_RAM
249    AM_RANGE(0x2400, 0x2fff) AM_RAM
254250   AM_RANGE(0x3000, 0x33ff) AM_RAM_WRITE(liberate_colorram_w) AM_BASE(&colorram)
255251   AM_RANGE(0x3400, 0x37ff) AM_RAM_WRITE(liberate_videoram_w) AM_BASE(&videoram)
256252   AM_RANGE(0x3800, 0x3fff) AM_RAM AM_BASE(&spriteram)
r5077r5078
823819
824820   /* basic machine hardware */
825821   MDRV_CPU_MODIFY("maincpu")
826   MDRV_CPU_CLOCK(12000000/8) //xtal is 12 Mhz, divider is unknown
822   MDRV_CPU_CLOCK(10000000/8) //xtal is unknown?
827823   MDRV_CPU_PROGRAM_MAP(prosoccr_map)
828824   MDRV_CPU_IO_MAP(prosoccr_io_map)
829825
830826   MDRV_CPU_MODIFY("audiocpu")
827   MDRV_CPU_CLOCK(10000000/8) //xtal is 12 Mhz, divider is unknown
831828   MDRV_CPU_PROGRAM_MAP(prosoccr_sound_map)
832829
830   MDRV_QUANTUM_TIME(HZ(12000))
831
833832   MDRV_SCREEN_MODIFY("screen")
834833   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 32*8-1)
835834
r5077r5078
864863   MDRV_GFXDECODE(prosport)
865864   MDRV_PALETTE_LENGTH(256)
866865
867   MDRV_VIDEO_START(boomrang)
866   MDRV_VIDEO_START(prosport)
868867   MDRV_VIDEO_UPDATE(prosport)
869868
870869   /* sound hardware */
r5077r5078
13461345 *************************************/
13471346
13481347GAME( 1983, prosoccr,  0,        prosoccr,  prosoccr, prosport, ROT270, "Data East Corporation", "Pro Soccer", 0 )
1349GAME( 1983, prosport,  0,        prosport,  liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1350GAME( 1983, prosporta, prosport, prosport,  liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports (alternate)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1348GAME( 1983, prosport,  0,        prosport,  liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1349GAME( 1983, prosporta, prosport, prosport,  liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports (alternate)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
13511350GAME( 1983, boomrang,  0,        boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 1)", 0 )
13521351GAME( 1983, boomranga, boomrang, boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 2)", 0 )
13531352GAME( 1984, kamikcab,  0,        boomrang,  kamikcab, prosport, ROT270, "Data East Corporation", "Kamikaze Cabbie", 0 )
src/mame/drivers/laserbat.c
r5077r5078
554554   }
555555
556556   if(sprite_info.enable)
557      drawgfx(bitmap,screen->machine->gfx[1],
557      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
558558              sprite_info.code,
559559            sprite_info.color,
560560            0,0,
561            sprite_info.x - 6,sprite_info.y,
562            cliprect,TRANSPARENCY_PEN,0);
561            sprite_info.x - 6,sprite_info.y,0);
563562
564563   return 0;
565564}
src/mame/drivers/naomi.c
r5077r5078
49234923    {1,6,4,3,5,2,7,0}
49244924};
49254925
4926struct AtomiswaveKey ssu_key = {
4927    {1,3,7,8,10,2,4,5,11,0,6,12,15,9,13,14},
4928    {7,8,12,0,3,11,1,15,6,10,9,14,4,5,2,13},
4929    {4,16,23,11,3,10,28,2,12,30,29,22,20,7,6,9,8,31,24,27,18,17,15,25,14,0,21,5,26,1,13,19},
4930    {13,5,1,12,3,11,15,6,0,4,9,14,2,8,10,7},
4931    {7,5,4,3,0,8,12,1,13,9,6,2,15,11,10,14},
4932    {4,1,0,2,5,3,7,6}
4933};
49264934
4935struct AtomiswaveKey rm_key = {
4936    {1,4,5,6,9,7,10,11,13,0,8,12,14,2,3,15},
4937    {12,0,3,8,7,6,15,11,1,4,14,10,9,5,13,2},
4938    {3,6,0,19,14,30,17,22,13,23,2,11,29,24,28,4,10,7,15,12,31,1,20,16,9,8,18,26,25,21,27,5},
4939    {2,6,3,7,11,4,12,0,10,9,15,14,13,5,1,8},
4940    {1,13,12,15,8,7,0,5,11,3,4,14,9,10,6,2},
4941    {6,0,7,4,5,3,1,2}
4942};
49274943static UINT16 atomiswave_decrypt(UINT16 cipherText, int address, const struct AtomiswaveKey* key)
49284944{
49294945    int b0,b1,b2,b3;
r5077r5078
50195035
50205036   for(i=0; i<rom_size/2; i++)
50215037   {
5022      src[i] = atomiswave_decrypt(src[i], i*2, &df_key);   // $$$TODO: need key
5038      src[i] = atomiswave_decrypt(src[i], i*2, &ssu_key);
50235039   }
50245040}
50255041
r5077r5078
50325048
50335049   for(i=0; i<rom_size/2; i++)
50345050   {
5035      src[i] = atomiswave_decrypt(src[i], i*2, &df_key);   // $$$TODO: need key
5051      src[i] = atomiswave_decrypt(src[i], i*2, &rm_key);
50365052   }
50375053}
50385054
src/mame/drivers/asteroid.c
r5077r5078
2727  require, check ROMs on your Asteroids PCB.  If ROM code is "-01" order kit no. 08-0303009.
2828  If ROM code is "-02", order no. 08-0303008.
2929
30*** It looks like both current sets are the older "easier" version.  We need dumps of the updates
31    for both sets.
30For kit 08-0303009 (from rev 01) swap the following:
3231
32 035127-01 --> 035127-02
33 035143-01 --> 035143-02
34 035144-01 --> 034144-04E
35 035145-01 --> 034145-04E
36
37For kit 08-0303008 (from rev 02) swap the following:
38
39 035144-02 --> 034144-04E
40 035145-02 --> 034145-04E
41
42There is not a rev 3 known, mentioned or dumped
43
3344    Asteroids-deluxe state-prom added by HIGHWAYMAN.
3445    The prom pcb location is:C8 and is 256x4
3546    (i need to update the dump, this one is read in 8bit-mode)
r5077r5078
678689
679690ROM_START( asteroid )
680691   ROM_REGION( 0x8000, "maincpu", 0 )
692   ROM_LOAD( "035145.04e",   0x6800, 0x0800, CRC(b503eaf7) SHA1(5369dcfe01c0b9e48b15a96a0de8d23ee8ef9145) )
693   ROM_LOAD( "035144.04e",   0x7000, 0x0800, CRC(25233192) SHA1(51b2865fa897cdaa84ac6500c4b4833a80827019) )
694   ROM_LOAD( "035143.02",    0x7800, 0x0800, CRC(312caa02) SHA1(1ce2eac1ab90b972e3f1fc3d250908f26328d6cb) )
695   /* Vector ROM */
696   ROM_LOAD( "035127.02",    0x5000, 0x0800, CRC(8b71fd9e) SHA1(8cd5005e531eafa361d6b7e9eed159d164776c70) )
697
698   /* DVG PROM */
699   ROM_REGION( 0x100, "user1", 0 )
700   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
701ROM_END
702
703ROM_START( asteroi2 )
704   ROM_REGION( 0x8000, "maincpu", 0 )
681705   ROM_LOAD( "035145.02",    0x6800, 0x0800, CRC(0cc75459) SHA1(2af85c9689b878155004da47fedbde5853a18723) )
682706   ROM_LOAD( "035144.02",    0x7000, 0x0800, CRC(096ed35c) SHA1(064d680ded7f30c543f93ae5ca85f90d550f73e5) )
683707   ROM_LOAD( "035143.02",    0x7800, 0x0800, CRC(312caa02) SHA1(1ce2eac1ab90b972e3f1fc3d250908f26328d6cb) )
684708   /* Vector ROM */
685709   ROM_LOAD( "035127.02",    0x5000, 0x0800, CRC(8b71fd9e) SHA1(8cd5005e531eafa361d6b7e9eed159d164776c70) )
710
686711   /* DVG PROM */
687712   ROM_REGION( 0x100, "user1", 0 )
688713   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
r5077r5078
695720   ROM_LOAD( "035143.01",    0x7800, 0x0800, CRC(7d4e3d05) SHA1(d88000e904e158efde50e453e2889ecd2cb95f24) )
696721   /* Vector ROM */
697722   ROM_LOAD( "035127.01",    0x5000, 0x0800, CRC(99699366) SHA1(9b2828fc1cef7727f65fa65e1e11e309b7c98792) )
723
698724   /* DVG PROM */
699725   ROM_REGION( 0x100, "user1", 0 )
700726   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
r5077r5078
723749   /* Vector ROM */
724750   ROM_LOAD( "sidamas.0",    0x5000, 0x0400, CRC(6bd2053f) SHA1(790f2858f44bbb1854e2d9d549e29f4815c4665b) )
725751   ROM_LOAD( "sidamas.1",    0x5400, 0x0400, CRC(231ce201) SHA1(710f4c19864d725ba1c9ea447a97e84001a679f7) )
752
726753   /* DVG PROM */
727754   ROM_REGION( 0x100, "user1", 0 )
728755   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
r5077r5078
735762   ROM_LOAD( "m2_j1.bin",    0x7800, 0x0800, CRC(64bd0408) SHA1(141d053cb4cce3fece98293136928b527d3ade0f) )
736763   /* Vector ROM */
737764   ROM_LOAD( "mv_np3.bin",   0x5000, 0x0800, CRC(11d1c4ae) SHA1(433c2c05b92094bbe102c356d7f1a907db13da67) )
765
738766   /* DVG PROM */
739767   ROM_REGION( 0x100, "user1", 0 )
740768   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
r5077r5078
751779   /* Vector ROM */
752780   ROM_LOAD( "a.bin",    0x5000, 0x0400, CRC(d7822110) SHA1(bf6c5e622fdc16c39a1d8f23fc029abaa1e99b19) )
753781   ROM_LOAD( "b.bin",    0x5400, 0x0400, CRC(d62b2887) SHA1(8832953c7166d2f0ed1067c43ebf369db4a4aa70) )
782
754783   /* DVG PROM */
755784   ROM_REGION( 0x100, "user1", 0 )
756785   ROM_LOAD( "prom.bin",   0x0000, 0x0100, CRC(9e237193) SHA1(f663e12d5db0fa50ea49d03591475ae0a7168bc0) )
r5077r5078
766795   /* Vector ROM */
767796   ROM_LOAD( "036800.02",    0x4800, 0x0800, CRC(bb8cabe1) SHA1(cebaa1b91b96e8b80f2b2c17c6fd31fa9f156386) )
768797   ROM_LOAD( "036799.01",    0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) )
798
769799   /* DVG PROM */
770800   ROM_REGION( 0x100, "user1", 0 )
771801   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
r5077r5078
780810   /* Vector ROM */
781811   ROM_LOAD( "036800.01",    0x4800, 0x0800, CRC(3b597407) SHA1(344fea2e5d84acce365d76daed61e96b9b6b37cc) )
782812   ROM_LOAD( "036799.01",    0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) )
813
783814   /* DVG PROM */
784815   ROM_REGION( 0x0100, "user1", 0 )
785816   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
r5077r5078
832863   /* Vector ROM */
833864   ROM_LOAD( "036800.01",    0x4800, 0x0800, CRC(3b597407) SHA1(344fea2e5d84acce365d76daed61e96b9b6b37cc) )
834865   ROM_LOAD( "036799.01",    0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) )
866
835867   /* DVG PROM */
836868   ROM_REGION( 0x0100, "user1", 0 )
837869   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
r5077r5078
850882   /* This _should_ be the rom for international versions. */
851883   /* Unfortunately, is it not currently available. */
852884   ROM_LOAD( "034597.01",    0x5800, 0x0800, NO_DUMP )
885
853886   /* DVG PROM */
854887   ROM_REGION( 0x100, "user1", 0 )
855888   ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
r5077r5078
900933 *
901934 *************************************/
902935
903GAME( 1979, asteroid, 0,        asteroid, asteroid, 0,        ROT0, "Atari",   "Asteroids (rev 2)",                        GAME_SUPPORTS_SAVE              )
904GAME( 1979, asteroi1, asteroid, asteroid, asteroid, 0,        ROT0, "Atari",   "Asteroids (rev 1)",                        GAME_SUPPORTS_SAVE              )
905GAME( 1979, asteroib, asteroid, asteroid, asteroib, asteroib, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", GAME_SUPPORTS_SAVE              )
906GAME( 1979, asterock, asteroid, asterock, asterock, asterock, ROT0, "Sidam",   "Asterock",                              GAME_SUPPORTS_SAVE              )
907GAME( 1979, meteorts, asteroid, asteroid, asteroid, 0,        ROT0, "VGG",     "Meteorites",                           GAME_SUPPORTS_SAVE              )
908GAME( 1980, meteorho, asteroid, asteroid, asteroid, 0,        ROT0, "Hoei",    "Meteor",                              GAME_SUPPORTS_SAVE              )
909GAMEL(1980, astdelux, 0,        astdelux, astdelux, 0,        ROT0, "Atari",   "Asteroids Deluxe (rev 3)",                  GAME_SUPPORTS_SAVE, layout_ho88ffff )
910GAMEL(1980, astdelu2, astdelux, astdelux, astdelux, 0,        ROT0, "Atari",   "Asteroids Deluxe (rev 2)",                  GAME_SUPPORTS_SAVE, layout_ho88ffff )
911GAMEL(1980, astdelu1, astdelux, astdelux, astdelux, 0,        ROT0, "Atari",   "Asteroids Deluxe (rev 1)",                  GAME_SUPPORTS_SAVE, layout_ho88ffff )
912GAME( 1979, llander,  0,        llander,  llander,  0,        ROT0, "Atari",   "Lunar Lander (rev 2)",                     GAME_SUPPORTS_SAVE              )
913GAME( 1979, llander1, llander,  llander,  llander1, 0,        ROT0, "Atari",   "Lunar Lander (rev 1)",                     GAME_SUPPORTS_SAVE              )
936GAME( 1979, asteroid, 0,        asteroid, asteroid, 0,        ROT0, "Atari",   "Asteroids (rev 4)",        GAME_SUPPORTS_SAVE )
937GAME( 1979, asteroi2, asteroid, asteroid, asteroid, 0,        ROT0, "Atari",   "Asteroids (rev 2)",        GAME_SUPPORTS_SAVE )
938GAME( 1979, asteroi1, asteroid, asteroid, asteroid, 0,        ROT0, "Atari",   "Asteroids (rev 1)",        GAME_SUPPORTS_SAVE )
939GAME( 1979, asteroib, asteroid, asteroid, asteroib, asteroib, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", GAME_SUPPORTS_SAVE )
940GAME( 1979, asterock, asteroid, asterock, asterock, asterock, ROT0, "Sidam",   "Asterock",                 GAME_SUPPORTS_SAVE )
941GAME( 1979, meteorts, asteroid, asteroid, asteroid, 0,        ROT0, "VGG",     "Meteorites",               GAME_SUPPORTS_SAVE )
942GAME( 1980, meteorho, asteroid, asteroid, asteroid, 0,        ROT0, "Hoei",    "Meteor",                   GAME_SUPPORTS_SAVE )
943GAMEL(1980, astdelux, 0,        astdelux, astdelux, 0,        ROT0, "Atari",   "Asteroids Deluxe (rev 3)", GAME_SUPPORTS_SAVE, layout_ho88ffff )
944GAMEL(1980, astdelu2, astdelux, astdelux, astdelux, 0,        ROT0, "Atari",   "Asteroids Deluxe (rev 2)", GAME_SUPPORTS_SAVE, layout_ho88ffff )
945GAMEL(1980, astdelu1, astdelux, astdelux, astdelux, 0,        ROT0, "Atari",   "Asteroids Deluxe (rev 1)", GAME_SUPPORTS_SAVE, layout_ho88ffff )
946GAME( 1979, llander,  0,        llander,  llander,  0,        ROT0, "Atari",   "Lunar Lander (rev 2)",     GAME_SUPPORTS_SAVE )
947GAME( 1979, llander1, llander,  llander,  llander1, 0,        ROT0, "Atari",   "Lunar Lander (rev 1)",     GAME_SUPPORTS_SAVE )
src/mame/drivers/vamphalf.c
r5077r5078
407407            y = 256 - y;
408408         }
409409
410         drawgfx(bitmap,gfx,code,color,fx,fy,x,y,&clip,TRANSPARENCY_PEN,0);
410         drawgfx_transpen(bitmap,&clip,gfx,code,color,fx,fy,x,y,0);
411411      }
412412   }
413413}
r5077r5078
460460            y = 256 - y;
461461         }
462462
463         drawgfx(bitmap,gfx,code,color,fx,fy,x,y,&clip,TRANSPARENCY_PEN,0);
463         drawgfx_transpen(bitmap,&clip,gfx,code,color,fx,fy,x,y,0);
464464      }
465465   }
466466}
src/mame/drivers/galaxia.c
r5077r5078
6161      for (x=0;x<256/8;x++)
6262      {
6363         int tile = galaxia_video[count];
64         drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
64         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8);
6565         count++;
6666      }
6767   }
src/mame/drivers/bnstars.c
r5077r5078
368368
369369   int tx, ty, sx, sy, flipx, flipy;
370370   int xsize, ysize, xzoom, yzoom;
371   int code, attr, color, size, pri, pri_mask, trans;
371   int code, attr, color, size, pri, pri_mask;
372372   gfx_element *gfx = machine->gfx[region];
373373
374374   UINT32      *source   = sprram_top;
r5077r5078
422422      yzoom = 0x1000000/yzoom;
423423      xzoom = 0x1000000/xzoom;
424424
425      trans = TRANSPARENCY_PEN; // there are surely also shadows (see gametngk) but how they're enabled we don't know
425      //trans = TRANSPARENCY_PEN; // there are surely also shadows (see gametngk) but how they're enabled we don't know
426426
427427      if (flipscreen)
428428      {
r5077r5078
443443         pri_mask = 0xfe;
444444
445445      gfx_element_set_source_clip(gfx, tx, xsize, ty, ysize);
446      pdrawgfxzoom(bitmap, gfx,
446      pdrawgfxzoom_transpen(bitmap, cliprect, gfx,
447447            code,
448448            color,
449449            flipx, flipy,
450450            sx,sy,
451            cliprect, trans, 0,
452            xzoom, yzoom, pri_mask);
451            xzoom, yzoom, priority_bitmap,pri_mask, 0);
453452   }   /* end sprite loop */
454453}
455454
src/mame/drivers/firefox.c
r5077r5078
188188            int flipx = flags & 0x20;
189189            int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) );
190190
191            drawgfx( bitmap, screen->machine->gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), cliprect, TRANSPARENCY_PEN, 0 );
191            drawgfx_transpen( bitmap, cliprect, screen->machine->gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 );
192192         }
193193      }
194194   }
src/mame/drivers/deco156.c
r5077r5078
119119
120120      while (multi >= 0)
121121      {
122         pdrawgfx(bitmap,machine->gfx[2],
122         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],
123123               sprite - multi * inc,
124124               colour,
125125               fx,fy,
126126               x,y + mult * multi,
127               cliprect,TRANSPARENCY_PEN,0,pri);
127               priority_bitmap,pri,0);
128128
129129         multi--;
130130      }
src/mame/drivers/dwarfd.c
r5077r5078
515515               b=1;
516516            }
517517         }
518         drawgfx(bitmap,machine->gfx[0],
518         drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
519519            tile+(bank+bank2)*128,
520520            0,
521521            0, 0,
522            x*8,y*8,
523            cliprect,TRANSPARENCY_PEN,0);
522            x*8,y*8,0);
524523      }
525524   }
526525}
src/mame/drivers/hitpoker.c
r0r5078
1/******************************************************************************
2
3Hit Poker (c) 1997 Accept LTD
4
5preliminary driver by Angelo Salese & David Haywood
6Many thanks to Olivier Galibert for the CPU identify effort ;-)
7
8TODO:
9- CPU core bugs?
10- Protection controls inputs;
11- Understand & fix EEPROM emulation;
12- Hangs during attract mode, eeprom or protection?
13- complete video HW (unknown bits and hblank);
14- 24Khz monitor isn't supported, it changes the resolution to 648 x 480 and
15  changes the register 9 (raster lines x character lines) from 7 to 0xf.
16- sound (I've heard something reasonable during tests, so it could be OK);
17
18================================================================================
19
20'Hit Poker'?
21
22cpu hd46505SP (HD6845SP) <- ha, ha, ha... --"
23
24other : ZC407615CFN (infralink)
25
26chrystal : no idea
27
28ram km6264BL X3
29TMM 2018 X2
30DALLAS REAL TIME CLK DS17487-5
31SOUND YM2149F
32DIP 1X4
33
34============================================================================
35
36Some debug tricks (let's test this CPU as more as possible):
37- set a bp at 1185, the "bad crc 000" msg is caused by this routine.
38  (kludged to work)
39- set a bp at 121f then pc=1223
40- set a bp at 3a50 then pc+=2, it should now enter into attract mode
41
42***************************************************************************/
43
44
45#include "driver.h"
46#include "cpu/mc68hc11/mc68hc11.h"
47#include "sound/ay8910.h"
48#include "video/mc6845.h"
49
50static UINT8 *hitpoker_sys_regs;
51static UINT8 hitpoker_pic_data;
52
53#define CRTC_CLOCK XTAL_3_579545MHz
54
55VIDEO_START(hitpoker)
56{
57   videoram = auto_alloc_array(machine, UINT8, 0x35ff);
58   paletteram = auto_alloc_array(machine, UINT8, 0x1000);
59   colorram = auto_alloc_array(machine, UINT8, 0x2000);
60}
61
62VIDEO_UPDATE(hitpoker)
63{
64   int count = 0;
65   int y,x;
66
67   bitmap_fill(bitmap, cliprect, 0);
68
69   for (y=0;y<31;y++)
70   {
71      for (x=0;x<81;x++) //it's probably 80 + 1 global line attribute at the start of each line
72      {
73         int tile,color,gfx_bpp;
74
75         tile = (((videoram[count]<<8)|(videoram[count+1])) & 0x3fff);
76         gfx_bpp = (colorram[count] & 0x80)>>7; //flag between 4 and 8 bpp
77         color = gfx_bpp ? ((colorram[count] & 0x70)>>4) : (colorram[count] & 0xf);
78
79         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfx_bpp],tile,color,0,0,x*8,y*8);
80
81         count+=2;
82      }
83   }
84
85   return 0;
86}
87
88static READ8_HANDLER( hitpoker_vram_r )
89{
90   UINT8 *ROM = memory_region(space->machine, "maincpu");
91
92   if(hitpoker_pic_data & 0x10)
93      return videoram[offset];
94   else
95      return ROM[offset+0x8000];
96}
97
98static WRITE8_HANDLER( hitpoker_vram_w )
99{
100//  UINT8 *ROM = memory_region(space->machine, "maincpu");
101
102//  if(hitpoker_sys_regs[0x00] & 0x10)
103   videoram[offset] = data;
104}
105
106static READ8_HANDLER( hitpoker_cram_r )
107{
108   UINT8 *ROM = memory_region(space->machine, "maincpu");
109
110   if(hitpoker_pic_data & 0x10)
111      return colorram[offset];
112   else
113      return ROM[offset+0xc000];
114}
115
116static WRITE8_HANDLER( hitpoker_cram_w )
117{
118   colorram[offset] = data;
119}
120
121static READ8_HANDLER( hitpoker_paletteram_r )
122{
123   UINT8 *ROM = memory_region(space->machine, "maincpu");
124
125   if(hitpoker_pic_data & 0x10)
126      return paletteram[offset];
127   else
128      return ROM[offset+0xe000];
129}
130
131static WRITE8_HANDLER( hitpoker_paletteram_w )
132{
133   int r,g,b,datax;
134   paletteram[offset] = data;
135   offset>>=1;
136   datax=256*paletteram[offset*2]+paletteram[offset*2+1];
137
138   /* RGB565 */
139   b = ((datax)&0xf800)>>11;
140   g = ((datax)&0x07e0)>>5;
141   r = ((datax)&0x001f)>>0;
142
143   palette_set_color_rgb(space->machine, offset, pal5bit(r), pal6bit(g), pal5bit(b));
144}
145
146static READ8_HANDLER( rtc_r )
147{
148   return 0x80; //kludge it for now
149}
150
151static UINT8 eeprom_data[0x200];
152static UINT16 eeprom_index;
153
154/* tests 0x180, what EEPROM is this one??? */
155static WRITE8_HANDLER( eeprom_w )
156{
157   if(offset == 0)
158   {
159      eeprom_index = (eeprom_index & 0x100)|(data & 0xff);
160      //printf("W INDEX %02x\n",data);
161   }
162   if(offset == 1)
163   {
164      eeprom_index = (eeprom_index & 0xff)|((data & 0x1)<<8);
165      //data & 0x4: eeprom clock
166      //printf("W CLOCK + INDEX %02x\n",data);
167   }
168}
169
170static READ8_HANDLER( eeprom_r )
171{
172   static UINT8 tmp;
173   tmp = eeprom_data[eeprom_index];
174   if((eeprom_index & 0x1f) == 0x1f)
175      tmp = 0xaa;
176   //printf("%02x\n",eeprom_index);
177   eeprom_index++;
178   //eeprom_index&=0x1f;
179   return tmp;
180}
181
182static READ8_HANDLER( hitpoker_pic_r )
183{
184//  logerror("R\n");
185
186   if(offset == 0)
187   {
188      if(cpu_get_pc(space->cpu) == 0x3143 ||
189         cpu_get_pc(space->cpu) == 0x314e ||
190         cpu_get_pc(space->cpu) == 0x3164 ||
191         cpu_get_pc(space->cpu) == 0x3179)
192         return hitpoker_pic_data;
193
194      return (hitpoker_pic_data & 0x7f) | (hitpoker_pic_data & 0x40 ? 0x80 : 0x00);
195   }
196
197   return hitpoker_sys_regs[offset];
198}
199
200static WRITE8_HANDLER( hitpoker_pic_w )
201{
202   if(offset == 0)
203      hitpoker_pic_data = (data & 0xff);// | (data & 0x40) ? 0x80 : 0x00;
204//  logerror("%02x W\n",data);
205   hitpoker_sys_regs[offset] = data;
206}
207
208#if 0
209static READ8_HANDLER( test_r )
210{
211   return mame_rand(space->machine);
212}
213#endif
214
215/* overlap empty rom addresses */
216static ADDRESS_MAP_START( hitpoker_map, ADDRESS_SPACE_PROGRAM, 8 )
217   AM_RANGE(0x0000, 0x00ff) AM_RAM // stack ram
218   AM_RANGE(0x1000, 0x103f) AM_READWRITE(hitpoker_pic_r,hitpoker_pic_w) AM_BASE(&hitpoker_sys_regs) // protection
219   AM_RANGE(0x8000, 0xb5ff) AM_READWRITE(hitpoker_vram_r,hitpoker_vram_w)
220   AM_RANGE(0xb600, 0xbdff) AM_RAM
221   AM_RANGE(0xbe0a, 0xbe0a) AM_READ_PORT("IN0")
222   AM_RANGE(0xbe0c, 0xbe0c) AM_READ_PORT("IN2") //irq ack?
223   AM_RANGE(0xbe0d, 0xbe0d) AM_READ(rtc_r)
224   AM_RANGE(0xbe0e, 0xbe0e) AM_READ_PORT("IN1")
225   AM_RANGE(0xbe50, 0xbe51) AM_WRITE(eeprom_w)
226   AM_RANGE(0xbe53, 0xbe53) AM_READ(eeprom_r)
227   AM_RANGE(0xbe80, 0xbe80) AM_DEVWRITE("crtc", mc6845_address_w)
228   AM_RANGE(0xbe81, 0xbe81) AM_DEVWRITE("crtc", mc6845_register_w)
229   AM_RANGE(0xbe90, 0xbe91) AM_DEVREADWRITE("ay", ay8910_r,ay8910_address_data_w)
230   AM_RANGE(0xbea0, 0xbea0) AM_READ_PORT("VBLANK") //probably other bits as well
231//  AM_RANGE(0xbe00, 0xbeff) AM_READ(test_r)
232   AM_RANGE(0xc000, 0xdfff) AM_READWRITE(hitpoker_cram_r,hitpoker_cram_w)
233   AM_RANGE(0xe000, 0xefff) AM_READWRITE(hitpoker_paletteram_r,hitpoker_paletteram_w)
234   AM_RANGE(0x0000, 0xbdff) AM_ROM
235   AM_RANGE(0xbf00, 0xffff) AM_ROM
236ADDRESS_MAP_END
237
238/* unused, to be removed */
239static ADDRESS_MAP_START( hitpoker_io, ADDRESS_SPACE_IO, 8 )
240ADDRESS_MAP_END
241
242static INPUT_PORTS_START( hitpoker )
243   PORT_START("VBLANK")
244   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
245   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
246   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
247   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) //resets the game?
248   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
249   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
250   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
251   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
252   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
253   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
254   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
255   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
256   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
257   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
258   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
259   PORT_DIPNAME( 0x20, 0x20, "H-Blank" ) //scanline counter probably
260   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
261   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
262   PORT_DIPNAME( 0x40, 0x40, "Monitor" ) //a JP probably
263   PORT_DIPSETTING(    0x40, "15KHz" )
264   PORT_DIPSETTING(    0x00, "24KHz" )
265   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
266
267   PORT_START("IN0")
268   PORT_DIPNAME( 0x01, 0x01, "IN0" )
269   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
270   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
271   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
272   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
273   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
274   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
275   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
276   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
277   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
278   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
279   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
280   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
281   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
282   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
283   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
284   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
285   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
286   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
287   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
288   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
289   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
290   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
291   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
292
293   PORT_START("IN1")
294   PORT_DIPNAME( 0x01, 0x01, "IN1" )
295   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
296   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
297   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
298   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
299   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
300   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
301   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
302   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
303   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
304   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
305   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
306   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
307   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
308   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
309   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
310   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
311   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
312   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
313   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
314   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
315   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
316   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
317   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
318
319   PORT_START("IN2")
320   PORT_DIPNAME( 0x01, 0x01, "IN2" )
321   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
322   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
323   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
324   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
325   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
326   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
327   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
328   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
329   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
330   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
331   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
332   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
333   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
334   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
335   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
336   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
337   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
338   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
339   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
340   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
341   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
342   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
343   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
344
345   PORT_START("DSW1")
346   PORT_DIPNAME( 0x01, 0x01, "DSW1" )
347   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
348   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
349   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
350   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
351   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
352   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
353   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
354   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
355   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
356   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
357   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
358   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
359   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
360   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
361   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
362   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
363   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
364   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
365   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
366   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
367   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
368   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
369   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
370
371   PORT_START("DSW2")
372   PORT_DIPNAME( 0x01, 0x01, "DSW2" )
373   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
374   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
375   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
376   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
377   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
378   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
379   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
380   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
381   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
382   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
383   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
384   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
385   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
386   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
387   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
388   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
389   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
390   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
391   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
392   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
393   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
394   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
395   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
396INPUT_PORTS_END
397
398
399static const gfx_layout hitpoker_layout_4bpp =
400{
401   8,8,
402   RGN_FRAC(1,1),
403   4,
404   { 0,4,8,12 },
405   { 0,1,2,3,16,17,18,19 },
406   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
407   8*32
408};
409
410static const gfx_layout hitpoker_layout_8bpp =
411{
412   8,8,
413   RGN_FRAC(1,2),
414   8,
415   { RGN_FRAC(1,2)+0,RGN_FRAC(1,2)+4,RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+12,0,4,8,12 },
416   { 0,1,2,3,16,17,18,19 },
417   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
418   8*32
419};
420
421static GFXDECODE_START( hitpoker )
422   GFXDECODE_ENTRY( "gfx1", 0, hitpoker_layout_4bpp,   0, 0x100  )
423   GFXDECODE_ENTRY( "gfx1", 0, hitpoker_layout_8bpp,   0, 8  )
424GFXDECODE_END
425
426static const mc6845_interface mc6845_intf =
427{
428   "screen",   /* screen we are acting on */
429   8,         /* number of pixels per video memory address */
430   NULL,      /* before pixel update callback */
431   NULL,      /* row update callback */
432   NULL,      /* after pixel update callback */
433   DEVCB_NULL,   /* callback for display state changes */
434   DEVCB_NULL,   /* callback for cursor state changes */
435   DEVCB_NULL,   /* HSYNC callback */
436   DEVCB_NULL,   /* VSYNC callback */
437   NULL      /* update address callback */
438};
439
440static const ay8910_interface ay8910_config =
441{
442   AY8910_LEGACY_OUTPUT,
443   AY8910_DEFAULT_LOADS,
444   DEVCB_INPUT_PORT("DSW1"),
445   DEVCB_INPUT_PORT("DSW2"),
446   DEVCB_NULL,
447   DEVCB_NULL
448};
449
450/* For whatever reason the MCU capabilities are disabled, might be a version without it or the engineers programmed the MCU to not have it. */
451static const hc11_config hitpoker_config =
452{
453   0, //has internal I/O
454   0  //internal RAM size
455};
456
457static MACHINE_DRIVER_START( hitpoker )
458   MDRV_CPU_ADD("maincpu", MC68HC11,1000000)
459   MDRV_CPU_PROGRAM_MAP(hitpoker_map)
460   MDRV_CPU_IO_MAP(hitpoker_io)
461   MDRV_CPU_CONFIG(hitpoker_config)
462   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
463
464   /* video hardware */
465   MDRV_SCREEN_ADD("screen", RASTER)
466   MDRV_SCREEN_REFRESH_RATE(60)
467   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate
468   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
469   MDRV_SCREEN_SIZE(648, 480) //setted by the CRTC
470   MDRV_SCREEN_VISIBLE_AREA(0, 648-1, 0, 240-1)
471
472   MDRV_MC6845_ADD("crtc", H46505, CRTC_CLOCK/2, mc6845_intf)   /* hand tuned to get ~60 fps */
473
474   MDRV_GFXDECODE(hitpoker)
475   MDRV_PALETTE_LENGTH(0x800)
476
477   MDRV_VIDEO_START(hitpoker)
478   MDRV_VIDEO_UPDATE(hitpoker)
479
480   MDRV_SPEAKER_STANDARD_MONO("mono")
481
482   MDRV_SOUND_ADD("ay", AY8910, 1500000)
483   MDRV_SOUND_CONFIG(ay8910_config)
484   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
485MACHINE_DRIVER_END
486
487DRIVER_INIT(hitpoker)
488{
489   UINT8 *ROM = memory_region(machine, "maincpu");
490
491   #if 1
492   ROM[0x1220] = 0x01; //patch eeprom write?
493   ROM[0x1221] = 0x01;
494   ROM[0x1222] = 0x01;
495
496   ROM[0x10c6] = 0x01;
497   ROM[0x10c7] = 0x01; //patch the checksum routine
498   #endif
499}
500
501ROM_START( hitpoker )
502   ROM_REGION( 0x10000, "maincpu", 0 )
503   ROM_LOAD( "u4.bin",         0x00000, 0x10000, CRC(0016497a) SHA1(017320bfe05fea8a48e26a66c0412415846cee7c) )
504
505   ROM_REGION( 0x10000, "pic", 0 )
506   ROM_LOAD( "pic",         0x00000, 0x1000, NO_DUMP ) // unknown type
507
508   ROM_REGION( 0x100000, "gfx1", 0 ) // tile 0x4c8 seems to contain something non-gfx related, could be tilemap / colour data, check!
509   ROM_LOAD16_BYTE( "u42.bin",         0x00001, 0x40000, CRC(cbe56fec) SHA1(129bfd10243eaa7fb6a087f96de90228e6030353) )
510   ROM_LOAD16_BYTE( "u43.bin",         0x00000, 0x40000, CRC(6c0d4283) SHA1(04a4fd82f5cc0ed9f548e490ac67d287227073c3) )
511   ROM_LOAD16_BYTE( "u44.bin",         0x80001, 0x40000, CRC(e23d5f30) SHA1(ca8855301528aa4eeff40cb820943b4268f8596e) ) // the 'adult images' are 8bpp
512   ROM_LOAD16_BYTE( "u45.bin",         0x80000, 0x40000, CRC(e65b3e52) SHA1(c0c1a360a4a1823bf71c0a4105ff41f4102862e8) ) //  the first part of these 2 is almost empty as the standard gfx are 4bpp
513ROM_END
514
515GAME( 1997, hitpoker,  0,    hitpoker, hitpoker,  hitpoker, ROT0, "Accept Ltd.", "Hit Poker (Bulgaria)", GAME_NOT_WORKING|GAME_NO_SOUND )
516
src/mame/drivers/go2000.c
r5077r5078
170170      {
171171         int tile = go2000_video[count];
172172         int attr = go2000_video2[count];
173         drawgfx(bitmap,screen->machine->gfx[0],tile,attr,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
173         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,attr,0,0,x*8,y*8);
174174         count++;
175175      }
176176   }
r5077r5078
182182      {
183183         int tile = go2000_video[count];
184184         int attr = go2000_video2[count];
185         drawgfx(bitmap,screen->machine->gfx[0],tile,attr,0,0,x*8,y*8,cliprect,TRANSPARENCY_PEN,0xf);
185         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tile,attr,0,0,x*8,y*8,0xf);
186186         count++;
187187      }
188188   }
r5077r5078
261261               tile_flipy = !tile_flipy;
262262            }
263263
264            drawgfx(   bitmap, screen->machine->gfx[0],
264            drawgfx_transpen(   bitmap, cliprect,screen->machine->gfx[0],
265265                     (tile & 0x1fff) + bank*0x4000,
266266                     attr,
267267                     tile_flipx, tile_flipy,
268                     sx, sy,
269                     cliprect,TRANSPARENCY_PEN,15   );
268                     sx, sy,15   );
270269
271270            tile_x += tile_xinc;
272271         }
src/mame/drivers/buster.c
r5077r5078
3232      {
3333         int tile = (buster_vram[count+1])|(buster_vram[count]<<8);
3434         //int colour = tile>>12;
35         drawgfx(bitmap,gfx,tile,0,0,0,x*8,y*4,cliprect,TRANSPARENCY_NONE,0);
35         drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*4);
3636
3737         count+=2;
3838      }
src/mame/drivers/m63.c
r5077r5078
281281         flipy = !flipy;
282282      }
283283
284      drawgfx(bitmap, machine->gfx[2],
284      drawgfx_transpen(bitmap, cliprect,
285         machine->gfx[2],
285286         code, color,
286287         flipx, flipy,
287         sx, sy,
288         cliprect,
289         TRANSPARENCY_PEN, 0);
288         sx, sy, 0);
290289
291290      /* sprite wrapping - verified on real hardware*/
292291      if(sx>0xf0)
293292      {
294         drawgfx(bitmap, machine->gfx[2],
293         drawgfx_transpen(bitmap, cliprect,
294         machine->gfx[2],
295295         code, color,
296296         flipx, flipy,
297         sx-0x100, sy,
298         cliprect,
299         TRANSPARENCY_PEN, 0);
297         sx-0x100, sy, 0);
300298      }
301299
302300   }
src/mame/drivers/mastboy.c
r5077r5078
495495         }
496496
497497
498         drawgfx(bitmap,gfx,tileno,attr,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
498         drawgfx_opaque(bitmap,cliprect,gfx,tileno,attr,0,0,x*8,y*8);
499499
500500         count+=4;
501501
src/mame/drivers/albazc.c
r5077r5078
6161         flipy = !flipy;
6262      }
6363
64      drawgfx(bitmap, machine->gfx[0], code, color, flipx, flipy,
65         sx, sy, cliprect, TRANSPARENCY_PEN, 0);
64      drawgfx_transpen(bitmap, cliprect, machine->gfx[0], code, color, flipx, flipy,
65         sx, sy, 0);
6666   }
6767}
6868
src/mame/drivers/midas.c
r5077r5078
146146         UINT16 code      =   codes[y*2];
147147         UINT16 attr      =   codes[y*2+1];
148148
149         drawgfxzoom(   bitmap,   machine->gfx[0],
149         drawgfxzoom_transpen(   bitmap,   cliprect, machine->gfx[0],
150150                     code,
151151                     attr >> 8,
152152                     attr & 1, attr & 2,
153153                     sx / 0x10000, ((sy + y * ydim) / 0x10000)&0x1ff,
154                     cliprect, TRANSPARENCY_PEN, 0,
155                     xscale, yscale         );
154                     xscale, yscale, 0         );
156155      }
157156   }
158157}
src/mame/drivers/aristmk4.c
r5077r5078
6060         int flipx = ((mkiv_vram[count]) & 0x04);
6161         // 0x0800 probably flipy
6262
63         drawgfx(bitmap,gfx,tile,color,flipx,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
63         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,flipx,0,x*8,y*8);
6464         count+=2;
6565      }
6666   }
src/mame/drivers/murogmbl.c
r5077r5078
9393      for (x = 0; x < 32; x++)
9494      {
9595         int tile = murogmbl_video[count];
96         drawgfx(bitmap, gfx, tile, 0, 0, 0, x * 8, y * 8, cliprect, TRANSPARENCY_NONE, 0);
96         drawgfx_opaque(bitmap, cliprect, gfx, tile, 0, 0, 0, x * 8, y * 8);
9797
9898         count++;
9999      }
src/mame/drivers/olibochu.c
r5077r5078
158158         flipy = !flipy;
159159      }
160160
161      drawgfx(bitmap, machine->gfx[1],
161      drawgfx_transpen(bitmap, cliprect,
162         machine->gfx[1],
162163         code, color,
163164         flipx, flipy,
164         sx, sy,
165         cliprect,
166         TRANSPARENCY_PEN, 0);
165         sx, sy, 0);
167166   }
168167
169168   /* 8x8 sprites */
r5077r5078
186185         flipy = !flipy;
187186      }
188187
189      drawgfx(bitmap, machine->gfx[0],
188      drawgfx_transpen(bitmap, cliprect,
189         machine->gfx[0],
190190         code, color,
191191         flipx, flipy,
192         sx, sy,
193         cliprect,
194         TRANSPARENCY_PEN, 0);
192         sx, sy, 0);
195193   }
196194}
197195
src/mame/drivers/kingdrby.c
r5077r5078
164164      {
165165         for(dy=0;dy<h;dy++)
166166            for(dx=0;dx<w;dx++)
167               drawgfx(bitmap,machine->gfx[0],spr_offs++,colour,1,0,((x+16*w)-(dx+1)*16),(y+dy*16),cliprect,TRANSPARENCY_PEN,0);
167               drawgfx_transpen(bitmap,cliprect,machine->gfx[0],spr_offs++,colour,1,0,((x+16*w)-(dx+1)*16),(y+dy*16),0);
168168      }
169169      else
170170      {
171171         for(dy=0;dy<h;dy++)
172172            for(dx=0;dx<w;dx++)
173               drawgfx(bitmap,machine->gfx[0],spr_offs++,colour,0,0,(x+dx*16),(y+dy*16),cliprect,TRANSPARENCY_PEN,0);
173               drawgfx_transpen(bitmap,cliprect,machine->gfx[0],spr_offs++,colour,0,0,(x+dx*16),(y+dy*16),0);
174174      }
175175   }
176176}
src/mame/drivers/looping.c
r5077r5078
269269         flipy = !flipy;
270270      }
271271
272      drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
272      drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
273273   }
274274}
275275
src/mame/drivers/1945kiii.c
r5077r5078
9797      ypos = (source[0] & 0x00ff) >> 0;
9898      tileno = (source2[0] & 0x7ffe) >> 1;
9999      xpos |=  (source2[0] & 0x0001) << 8;
100      drawgfx(bitmap,gfx, tileno,1,0,0,xpos,ypos,cliprect,TRANSPARENCY_PEN,0);
101      drawgfx(bitmap,gfx, tileno,1,0,0,xpos,ypos-0x100,cliprect,TRANSPARENCY_PEN,0); // wrap
102      drawgfx(bitmap,gfx, tileno,1,0,0,xpos-0x200,ypos,cliprect,TRANSPARENCY_PEN,0); // wrap
103      drawgfx(bitmap,gfx, tileno,1,0,0,xpos-0x200,ypos-0x100,cliprect,TRANSPARENCY_PEN,0); // wrap
100      drawgfx_transpen(bitmap,cliprect,gfx, tileno,1,0,0,xpos,ypos,0);
101      drawgfx_transpen(bitmap,cliprect,gfx, tileno,1,0,0,xpos,ypos-0x100,0); // wrap
102      drawgfx_transpen(bitmap,cliprect,gfx, tileno,1,0,0,xpos-0x200,ypos,0); // wrap
103      drawgfx_transpen(bitmap,cliprect,gfx, tileno,1,0,0,xpos-0x200,ypos-0x100,0); // wrap
104104
105105      source++;source2++;
106106   }
src/mame/drivers/esh.c
r5077r5078
5858         //int blinkLine = (tile_control_ram[current_screen_character] & 0x40) >> 6;
5959         //int blinkChar = (tile_control_ram[current_screen_character] & 0x80) >> 7;
6060
61         drawgfx(bitmap, screen->machine->gfx[0],
61         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
6262               tile_ram[current_screen_character] + (0x100 * tileOffs),
6363               palIndex,
64               0, 0, charx*8, chary*8, cliprect, TRANSPARENCY_PEN, 0);
64               0, 0, charx*8, chary*8, 0);
6565      }
6666   }
6767
src/mame/drivers/namcoic.c
r5077r5078
265265
266266/**************************************************************************************/
267267
268static void zdrawgfxzoom(running_machine *machine,
269      bitmap_t *dest_bmp,const gfx_element *gfx,
268static void zdrawgfxzoom(
269      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
270270      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
271      const rectangle *clip,int transparency,int transparent_color,
271      int transparency,int transparent_color,
272272      int scalex, int scaley, int zpos )
273273{
274274   if (!scalex || !scaley) return;
r5077r5078
276276   {
277277      if( gfx )
278278      {
279         int shadow_offset = (machine->config->video_attributes&VIDEO_HAS_SHADOWS)?machine->config->total_colors:0;
280         const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
279         int shadow_offset = (gfx->machine->config->video_attributes&VIDEO_HAS_SHADOWS)?gfx->machine->config->total_colors:0;
280         const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
281281         const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
282282         int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
283283         int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
r5077r5078
478478                  gfx_element_set_source_clip(gfx, 0, 32, 0, 32);
479479
480480               zdrawgfxzoom(
481                  machine,
482481                  bitmap,
482                  cliprect,
483483                  gfx,
484484                  sprn,
485485                  color,
486486                  flipx,flipy,
487487                  xpos,ypos,
488                  cliprect,
489488                  TRANSPARENCY_PEN,0xff,
490489                  scalex,scaley,
491490                  loop );
r5077r5078
613612            rect.min_y += (tile&2)?16:0;
614613            rect.max_y += (tile&2)?16:0;
615614         }
616         zdrawgfxzoom(machine,
617            bitmap,machine->gfx[0],
615         zdrawgfxzoom(
616            bitmap,
617            &rect,
618            machine->gfx[0],
618619            sprn, color,
619620            flipx,flipy,
620621            sx,sy,
621            &rect,
622622            TRANSPARENCY_PEN,0xff,
623623            scalex, scaley,
624624            loop );
r5077r5078
877877         tile = spritetile16[tile_index++];
878878         if( (tile&0x8000)==0 )
879879         {
880            zdrawgfxzoom(machine,
881               bitmap,machine->gfx[mGfxC355],
880            zdrawgfxzoom(
881               bitmap,
882               &clip,
883               machine->gfx[mGfxC355],
882884               mpCodeToTile(tile) + offset,
883885               color,
884886               flipx,flipy,
885887               sx,sy,
886               &clip,
887888               TRANSPARENCY_PEN,0xff,
888889               zoomx, zoomy, zpos );
889890         }
src/mame/drivers/carrera.c
r5077r5078
248248      {
249249         int tile = carrera_tileram[count&0x7ff] | carrera_tileram[(count&0x7ff)+0x800]<<8;
250250
251         drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
251         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8);
252252         count++;
253253      }
254254   }
src/mame/drivers/gottlieb.c
r5077r5078
3030
3131****************************************************************************
3232
33    Board Id           Game             Game Id
34    ---------------    -------------    --------
35                       Reactor          GV-100
36                       Mad Planets      GV-102
37    C-22248-2          Q*Bert           GV-103
38                       Krull            GV-105
39    22399-1 (GD-01)    M.A.C.H. 3       GV-109
40                       Wiz Warz         GV-110
41                       Knightmare       GV-112
42                       Three Stooges    GV-113
43                       Q*Bert Qubes     GV-118
44                       Us vs. Them      GV-126
45                       Video Vince      GV-132
46                       Curve Ball       GV-134
47
48****************************************************************************
49
3350    Thanks to Frans van Egmond for locating and dumping Tylz
3451
3552    Notes:
src/mame/drivers/acommand.c
r5077r5078
130130            xx = w;
131131            do
132132            {
133               drawgfx(bitmap,machine->gfx[2],
133               drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
134134                     code,
135135                     color,
136136                     flipx, flipy,
137                     ((x + 16) & 0x1ff) - 16,sy & 0x1ff,
138                     cliprect,TRANSPARENCY_PEN,15);
137                     ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15);
139138
140139               code++;
141140               x += delta;
src/mame/drivers/segald.c
r5077r5078
4545      for (characterY = 0; characterY < 32; characterY++)
4646      {
4747         int current_screen_character = (characterY*32) + characterX;
48         drawgfx(bitmap, machine->gfx[0], fix_RAM[current_screen_character],
49               1, 0, 0, characterX*8, characterY*8, cliprect, TRANSPARENCY_PEN, 0);
48         drawgfx_transpen(bitmap, cliprect, machine->gfx[0], fix_RAM[current_screen_character],
49               1, 0, 0, characterX*8, characterY*8, 0);
5050      }
5151   }
5252}
src/mame/drivers/feversoc.c
r5077r5078
9292
9393      for(dx=0;dx<w;dx++)
9494         for(dy=0;dy<h;dy++)
95            drawgfx(bitmap,screen->machine->gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),cliprect,TRANSPARENCY_PEN,0x3f);
95            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f);
9696   }
9797
9898   return 0;
src/mame/drivers/fortecar.c
r5077r5078
257257         tile = fortecar_ram[(count*4)+1] | (fortecar_ram[(count*4)+2]<<8);
258258         color = fortecar_ram[(count*4)+3];
259259
260         drawgfx(bitmap,screen->machine->gfx[0],tile,color,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
260         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,color,0,0,x*8,y*8);
261261         count++;
262262
263263      }
src/mame/drivers/rbmk.c
r5077r5078
440440      for (x=0;x<64;x++)
441441      {
442442         int tile = gms_vidram2[count+0x600];
443         drawgfx(bitmap,screen->machine->gfx[0],(tile&0xfff)+((tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32,cliprect,TRANSPARENCY_NONE,0);
443         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],(tile&0xfff)+((tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32);
444444         count++;
445445      }
446446   }
r5077r5078
452452      for (x=0;x<64;x++)
453453      {
454454         int tile = gms_vidram[count];
455         drawgfx(bitmap,screen->machine->gfx[1],(tile&0xfff)+((tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,cliprect,TRANSPARENCY_PEN,0);
455         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],(tile&0xfff)+((tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0);
456456         count++;
457457      }
458458   }
src/mame/drivers/backfire.c
r5077r5078
153153
154154      while (multi >= 0)
155155      {
156         pdrawgfx(bitmap,machine->gfx[region],
156         pdrawgfx_transpen(bitmap,cliprect,machine->gfx[region],
157157               sprite - multi * inc,
158158               colour,
159159               fx,fy,
160160               x,y + mult * multi,
161               cliprect,TRANSPARENCY_PEN,0,pri);
161               priority_bitmap,pri,0);
162162
163163         multi--;
164164      }
src/mame/drivers/astrocorp.c
r5077r5078
6464      {
6565         for (x = 0 ; x < dimx ; x++)
6666         {
67            drawgfx(bitmap,machine->gfx[0],
67            drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
6868                  code++, 0,
6969                  0, 0,
70                  sx + x * 16, sy + y * 16,
71                  cliprect, TRANSPARENCY_PEN, 0xff);
70                  sx + x * 16, sy + y * 16, 0xff);
7271         }
7372      }
7473   }
src/mame/drivers/intrscti.c
r5077r5078
7171      {
7272         int dat;
7373         dat = intrscti_ram[count];
74         drawgfx(bitmap,screen->machine->gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_PEN,0);
74         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
7575         count++;
7676      }
7777   }
src/mame/drivers/chinsan.c
r5077r5078
6868         int tileno,colour;
6969         tileno = chinsan_video[count] | (chinsan_video[count+0x800]<<8);
7070         colour = chinsan_video[count+0x1000]>>3;
71         drawgfx(bitmap,screen->machine->gfx[0],tileno,colour,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
71         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tileno,colour,0,0,x*8,y*8);
7272         count++;
7373      }
7474   }
src/mame/drivers/cshooter.c
r5077r5078
158158         {
159159            int tile=0x30+((spriteram[i]>>2)&0x1f);
160160
161            drawgfx(bitmap,screen->machine->gfx[0],
161            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
162162                     tile,
163163                     spriteram[i+1],
164164                     0, 0,
165                     spriteram[i+3],spriteram[i+2],
166                     cliprect,TRANSPARENCY_PEN,3);
165                     spriteram[i+3],spriteram[i+2],3);
167166
168            drawgfx(bitmap,screen->machine->gfx[0],
167            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
169168                     tile,
170169                     spriteram[i+1],
171170                     0, 0,
172                     spriteram[i+3]+8,spriteram[i+2],
173                     cliprect,TRANSPARENCY_PEN,3);
171                     spriteram[i+3]+8,spriteram[i+2],3);
174172
175            drawgfx(bitmap,screen->machine->gfx[0],
173            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
176174                     tile,
177175                     spriteram[i+1],
178176                     0, 0,
179                     spriteram[i+3]+8,spriteram[i+2]+8,
180                     cliprect,TRANSPARENCY_PEN,3);
177                     spriteram[i+3]+8,spriteram[i+2]+8,3);
181178
182            drawgfx(bitmap,screen->machine->gfx[0],
179            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
183180                     tile,
184181                     spriteram[i+1],
185182                     0, 0,
186                     spriteram[i+3],spriteram[i+2]+8,
187                     cliprect,TRANSPARENCY_PEN,3);
183                     spriteram[i+3],spriteram[i+2]+8,3);
188184         }
189185      }
190186   }
src/mame/drivers/midyunit.c
r5077r5078
17191719ROM_END
17201720
17211721
1722ROM_START( hiimpac1 )
1723   ROM_REGION( 0x90000, "cvsdcpu", 0 )   /* sound CPU */
1724   ROM_LOAD (  "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
1725   ROM_LOAD ( "sl1u19.bin", 0x30000, 0x20000, CRC(0ea22c89) SHA1(6d4579f6b10cac685be01348451b3537a0626034) )
1726   ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
1727
1728   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
1729   ROM_LOAD16_BYTE( "u105-la1",  0xc0000, 0x20000, CRC(e86228ba) SHA1(0af263e51cb65115038ee5bf508515674e05913e) )
1730   ROM_LOAD16_BYTE( "u89-la1",   0xc0001, 0x20000, CRC(f23e972e) SHA1(e5ae5eaf5f97ec271b92072fd674e8cd93b36778) )
1731
1732   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE )
1733   ROM_LOAD ( "la1u111.bin",  0x000000, 0x20000, CRC(49560560) SHA1(03d51e6019afa9a396c91a484969be4922fa4c99) ) /* All roms had a "LA 1" sticker over a "PA 1" on the label */
1734   ROM_LOAD ( "la1u112.bin",  0x020000, 0x20000, CRC(4dd879dc) SHA1(ac4f02fcb933df38f1ebf51b109092b77563b684) )
1735   ROM_LOAD ( "la1u113.bin",  0x040000, 0x20000, CRC(b67aeb70) SHA1(dd1512329c46da4254712712b6f847544f4487bd) )
1736   ROM_LOAD ( "la1u114.bin",  0x060000, 0x20000, CRC(9a4bc44b) SHA1(309eb5214fe5e1fe64d724d515190a31fc524aae) )
1737
1738   ROM_LOAD (  "la1u95.bin",  0x200000, 0x20000, CRC(e1352dc0) SHA1(7faa2cfa9ebaf2d99b243232316221b672869703) )
1739   ROM_LOAD (  "la1u96.bin",  0x220000, 0x20000, CRC(197d0f34) SHA1(2d544588c3241423188ac7fb7aff87043fdd063d) )
1740   ROM_LOAD (  "la1u97.bin",  0x240000, 0x20000, CRC(908ea575) SHA1(79802d8df4e016d178be98333d2b1d047a27eccc) )
1741   ROM_LOAD (  "la1u98.bin",  0x260000, 0x20000, CRC(6dcbab11) SHA1(7432172810fd4b922b61769c68d86f24769a42cf) )
1742
1743    ROM_LOAD ( "la1u106.bin",  0x400000, 0x20000, CRC(7d0ead0d) SHA1(1e65b6e7e629021d70603df37db5fa89cfe93175) )
1744   ROM_LOAD ( "la1u107.bin",  0x420000, 0x20000, CRC(ef48e8fa) SHA1(538de37cd8342085ec27f67292a7eeb1007e3b1f) )
1745   ROM_LOAD ( "la1u108.bin",  0x440000, 0x20000, CRC(5f363e12) SHA1(da398c0204f785aad4c52007d2f25031ecc1c63f) )
1746   ROM_LOAD ( "la1u109.bin",  0x460000, 0x20000, CRC(3689fbbc) SHA1(d95c0a2e3abf977ba7a899e419c22d004020c560) )
1747
1748   ROM_REGION( 0x1100, "plds", ROMREGION_DISPOSE )
1749   ROM_LOAD( "ep610.u8",    0x0000, 0x032f, NO_DUMP ) /* PAL is read protected */
1750   ROM_LOAD( "pls153a.u40", 0x0400, 0x00eb, CRC(69e5143f) SHA1(1a1e7b3233f7d5a1c161564710e8e984a9b0a16c) )
1751   ROM_LOAD( "ep610.u51",   0x0500, 0x032f, NO_DUMP ) /* PAL is read protected */
1752   ROM_LOAD( "ep610.u52",   0x0900, 0x032f, NO_DUMP ) /* PAL is read protected */
1753   ROM_LOAD( "ep610.u65",   0x0d00, 0x032f, NO_DUMP ) /* PAL is read protected */
1754ROM_END
1755
1756
17221757ROM_START( hiimpacp )
17231758   ROM_REGION( 0x90000, "cvsdcpu", 0 )   /* sound CPU */
17241759   ROM_LOAD (  "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
r5077r5078
17301765   ROM_LOAD16_BYTE( "u89-pa1",   0xc0001, 0x20000, CRC(2bd3de30) SHA1(ee3615c1cc5b948731eb258887641f059b942b25) )
17311766
17321767   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE )
1733   ROM_LOAD ( "la1u111.bin",  0x000000, 0x20000, CRC(49560560) SHA1(03d51e6019afa9a396c91a484969be4922fa4c99) )
1734   ROM_LOAD ( "la1u112.bin",  0x020000, 0x20000, CRC(4dd879dc) SHA1(ac4f02fcb933df38f1ebf51b109092b77563b684) )
1768   ROM_LOAD ( "la1u111.bin",  0x000000, 0x20000, CRC(49560560) SHA1(03d51e6019afa9a396c91a484969be4922fa4c99) ) /* All rom were labeled "PA 1" which Williams later designated "LA 1" */
1769   ROM_LOAD ( "la1u112.bin",  0x020000, 0x20000, CRC(4dd879dc) SHA1(ac4f02fcb933df38f1ebf51b109092b77563b684) ) /* without changing any of the contents when they release ver LA 1 */
17351770   ROM_LOAD ( "la1u113.bin",  0x040000, 0x20000, CRC(b67aeb70) SHA1(dd1512329c46da4254712712b6f847544f4487bd) )
17361771   ROM_LOAD ( "la1u114.bin",  0x060000, 0x20000, CRC(9a4bc44b) SHA1(309eb5214fe5e1fe64d724d515190a31fc524aae) )
17371772
r5077r5078
23152350GAME( 1990, hiimpact, 0,        yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA5 02/15/91)", GAME_SUPPORTS_SAVE )
23162351GAME( 1990, hiimpac4, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA4 02/04/91)", GAME_SUPPORTS_SAVE )
23172352GAME( 1990, hiimpac3, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA3 12/27/90)", GAME_SUPPORTS_SAVE )
2353GAME( 1990, hiimpac1, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA1 12/16/90)", GAME_SUPPORTS_SAVE )
23182354GAME( 1990, hiimpacp, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (prototype, rev 8.6 12/09/90)", GAME_SUPPORTS_SAVE )
23192355GAME( 1991, shimpact, 0,        yunit_cvsd_6bit_slow,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (rev LA1 09/30/91)", GAME_SUPPORTS_SAVE )
23202356GAME( 1991, shimpap6, shimpact, yunit_cvsd_6bit_slow,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (prototype, rev 6.0 09/23/91)", GAME_SUPPORTS_SAVE )
src/mame/drivers/lgp.c
r5077r5078
9999
100100         /* Somewhere there's a flag that offsets the tilemap by 0x100*x */
101101         /* Palette is likely set somewhere as well (tile_control_ram?) */
102         drawgfx(bitmap, screen->machine->gfx[0],
102         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
103103               tile_ram[current_screen_character],
104104               0,
105               0, 0, charx*8, chary*8, cliprect, TRANSPARENCY_PEN, 0);
105               0, 0, charx*8, chary*8, 0);
106106      }
107107   }
108108
src/mame/drivers/86lions.c
r5077r5078
5353         int tile = lions_vram[count+1]|lions_vram[count]<<8;
5454         tile&=0x1ff;
5555         //int colour = tile>>12;
56         drawgfx(bitmap,gfx,tile,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
56         drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8);
5757
5858         count+=2;
5959      }
src/mame/drivers/system1.c
r5077r5078
7373
74744dwarrio    3x16k 1x8k  6x8k  4x16k  no  pio  ????    ????
7575
76shtngmst    3x32k 1x32k 3x32k 7x32k  yes      7102(a) 7104
77shtngmst1   3x32k 1x32k 3x32k 7x32k  yes      7102
78shtngmsta   3x32k 1x32k 3x32k 7x32k  yes      license
76shtngmst    3x32k 1x32k 3x32k 7x32k  yes      7102
77shtngmste   3x32k 1x32k 3x32k 7x32k  yes      7102(a) 7104
7978
8079choplift    3x32k 1x32k 3x32k 4x32k  yes      7126    7120
8180chopliftu   3x32k 1x32k 3x32k 4x32k  yes      7154
r5077r5078
32923291
32933292
32943293/*
3294    Shooting Master (SEGA)
3295    Year: 1985
3296    System 2
3297
32953298    Main Board        834-5719
32963299    Light Gun Board?  834-5720
32973300*/
r5077r5078
34123415ROM_END
34133416
34143417/*
3415    Shooting Master (SEGA) - Rev A
3416    Year: 1985
3417    System 2
3418
3419    Main Board        834-5719
3420    Light Gun Board?  834-5720
3421*/
3422ROM_START( shtngmstu )
3423   ROM_REGION( 0x20000, "maincpu", 0 )
3424    /* This rom is located on the daughter board. */
3425   ROM_LOAD( "epr7100a.ic18",  0x00000, 0x8000, BAD_DUMP CRC(661f0b6e) SHA1(a1d064839c95d8a6f6d89b0894259f666d637ec4) )
3426    /* These roms are located on the main board. */
3427   ROM_LOAD( "epr7101.ic91",   0x10000, 0x8000, CRC(ebf5ff72) SHA1(13ae06e3a81cf00b80ec939d5baf30143d61d480) )
3428   ROM_LOAD( "epr7102.ic92",   0x18000, 0x8000, CRC(c890a4ad) SHA1(4b59d37902ace3a69b380ff40652ee37c85f0e9d) )
3429
3430    /* This rom is located on the main board. */
3431   ROM_REGION( 0x10000, "soundcpu", 0 )
3432   ROM_LOAD( "epr7043.ic126",  0x0000, 0x8000, CRC(99a368ab) SHA1(a9451f39ee2613e5c3e2791d4d8d837b4a3ab666) )
3433
3434    /* These roms are located on the main board. */
3435   ROM_REGION( 0x18000, "tiles", 0 )
3436   ROM_LOAD( "epr7040.ic4",    0x00000, 0x8000, CRC(f30769fa) SHA1(366c1fbe4e1c8943b209f6c831c9a6b7e4372105) )
3437   ROM_LOAD( "epr7041.ic5",    0x08000, 0x8000, CRC(f3e273f9) SHA1(b8715c528299dc1e4f0c19c50d91ca9861a423a1) )
3438   ROM_LOAD( "epr7042.ic6",    0x10000, 0x8000, CRC(6841c917) SHA1(6553843eea0131eb7b5a9aa29dddf641e41d8cc3) )
3439
3440    /* These roms are located on the daughter board. */
3441   ROM_REGION( 0x40000, "sprites", ROMREGION_ERASEFF )
3442   ROM_LOAD( "epr7110.ic26",   0x00000, 0x8000, CRC(5d1a5048) SHA1(d1626ab1981080451c912df7e4ad7f76c0cb3459) )
3443   ROM_LOAD( "epr7106.ic22",   0x08000, 0x8000, CRC(ae7ab7a2) SHA1(153691e468d29d21b95f1fbffb6896a3140d7e14) )
3444   ROM_LOAD( "epr7108.ic24",   0x10000, 0x8000, CRC(816180ac) SHA1(a59670ec77d4359041ebf12dae5b74add55d82ac) )
3445   ROM_LOAD( "epr7104.ic20",   0x18000, 0x8000, CRC(84a679c5) SHA1(19a21b1b33fc215f606093bfd61d597e4bd0b3d0) )
3446   ROM_LOAD( "epr7109.ic25",   0x20000, 0x8000, CRC(097f7481) SHA1(4d93ea01b811af1cd3e136116625e4b8e06358a2) )
3447   ROM_LOAD( "epr7105.ic21",   0x28000, 0x8000, CRC(13111729) SHA1(57ca2b945db36b056d0e40a39456fd8bf9d0a3ec) )
3448   ROM_LOAD( "epr7107.ic23",   0x30000, 0x8000, CRC(8f50ea24) SHA1(781687e202dedca7b72c9bd5b97d9d46fcfd601c) )
3449
3450    /* These proms are located on the main board. */
3451   ROM_REGION( 0x0300, "palette", 0 )
3452   ROM_LOAD( "epr7113.ic20",   0x00000, 0x0100, CRC(5c0e1360) SHA1(2011b3eef2a58f9bd3f3b1bb9e6c201db85727c2) ) /* palette red component */
3453   ROM_LOAD( "epr7112.ic14",   0x00100, 0x0100, CRC(46fbd351) SHA1(1fca7fbc5d5f8e13e58bbac735511bd0af392446) ) /* palette green component */
3454   ROM_LOAD( "epr7111.ic8",    0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */
3455
3456   ROM_REGION( 0x0100, "proms", 0 )
3457   ROM_LOAD( "epr5317.ic37",   0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* N82S129AN */
3458
3459    /* These pld's are located on the main board. */
3460   ROM_REGION( 0x0618, "plds", 0 )
3461   ROM_LOAD( "315-5137.bin",   0x00000, 0x0104, CRC(6ffd9e6f) SHA1(a60a3a2ec5bc256b18bfff0fec0172ee2e4fd955) ) /* TI PAL16R4A-2CN Located at IC10 */
3462   ROM_LOAD( "315-5138.bin",   0x00000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) ) /* TI PAL16R4ACN Located at IC11 */
3463    ROM_LOAD( "315-5139.bin",   0x00000, 0x0104, NO_DUMP ) /* CK2605 located at IC50 */
3464    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC7 */
3465    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC13 */
3466    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC19 */
3467ROM_END
3468
3469
3470/*
34713418    Choplifter (8751 315-5151)
34723419    Year: 1985
34733420    System 2
r5077r5078
48014748GAME( 1985, chopliftbl, choplift, sys2row,  choplift,  bank0c,   ROT0,   "bootleg",         "Choplifter (bootleg)", GAME_SUPPORTS_SAVE )
48024749GAME( 1985, shtngmst,   0,        sys2m,    shtngmst,  shtngmst, ROT0,   "Sega",            "Shooting Master (8751 315-5159)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
48034750GAME( 1985, shtngmste,  shtngmst, sys2m,    shtngmst,  shtngmst, ROT0,   "Sega [EVG]",      "Shooting Master (EVG, 8751 315-5159a)", GAME_SUPPORTS_SAVE )
4804GAME( 1985, shtngmstu,  shtngmst, sys2,     shtngmst,  shtngmst, ROT0,   "Sega",            "Shooting Master (unprotected)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
48054751GAME( 1986, gardiab,    gardia,   sys2,     gardia,    gardiab,  ROT270, "bootleg",         "Gardia (317-0007?, bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
48064752GAME( 1986, wboysys2,   wboy,     sys2,     wboysys2,  wboysys2, ROT0,   "Sega (Escape license)", "Wonder Boy (system 2)", GAME_SUPPORTS_SAVE )
48074753GAME( 1987, tokisens,   0,        sys2,     tokisens,  bank0c,   ROT90,  "Sega",            "Toki no Senshi - Chrono Soldier", GAME_SUPPORTS_SAVE )
src/mame/drivers/witch.c
r5077r5078
707707         color  =  flags & 0x0f;
708708
709709
710         drawgfx(bitmap,machine->gfx[1],
710         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
711711            tileno, color,
712712            flipx, flipy,
713            sx+8*flipx,sy+8*flipy,
714            cliprect,TRANSPARENCY_PEN,0);
713            sx+8*flipx,sy+8*flipy,0);
715714
716         drawgfx(bitmap,machine->gfx[1],
715         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
717716            tileno+1, color,
718717            flipx, flipy,
719            sx+8-8*flipx,sy+8*flipy,
720            cliprect,TRANSPARENCY_PEN,0);
718            sx+8-8*flipx,sy+8*flipy,0);
721719
722         drawgfx(bitmap,machine->gfx[1],
720         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
723721            tileno+2, color,
724722            flipx, flipy,
725            sx+8*flipx,sy+8-8*flipy,
726            cliprect,TRANSPARENCY_PEN,0);
723            sx+8*flipx,sy+8-8*flipy,0);
727724
728         drawgfx(bitmap,machine->gfx[1],
725         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
729726            tileno+3, color,
730727            flipx, flipy,
731            sx+8-8*flipx,sy+8-8*flipy,
732            cliprect,TRANSPARENCY_PEN,0);
728            sx+8-8*flipx,sy+8-8*flipy,0);
733729
734730      }
735731   }
src/mame/drivers/acefruit.c
r5077r5078
7878
7979         if( color < 0x4 )
8080         {
81            drawgfx( bitmap, screen->machine->gfx[ 1 ], code, color, 0, 0, col * 16, row * 8, cliprect, TRANSPARENCY_NONE, 0 );
81            drawgfx_opaque( bitmap, cliprect, screen->machine->gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 );
8282         }
8383         else if( color >= 0x5 && color <= 0x7 )
8484         {
src/mame/drivers/system16.c
r5077r5078
918918   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&paletteram16)
919919   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1")
920920   AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2")
921   AM_RANGE(0x900006, 0x900007) AM_WRITE(sound_command_w)
921922   AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_WRITE(sys16_coinctrl_w)
922923   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
923924   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
r5077r5078
10981099
10991100/***************************************************************************/
11001101
1102static MACHINE_DRIVER_START( sys16_datsu_sound_cfg )
1103   /* TODO:
1104    - other games might use this sound configuration
1105    - speaker is likely to be mono for the bootlegs, not stereo.
1106    - check msm5205 frequency.
1107    */
1108   MDRV_CPU_ADD("soundcpu",Z80, 4000000)
1109   MDRV_CPU_PROGRAM_MAP(tturfbl_sound_map)
1110   MDRV_CPU_IO_MAP(tturfbl_sound_io_map)
1111
1112   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1113
1114   MDRV_SOUND_ADD("ym", YM2151, 4000000)
1115   MDRV_SOUND_ROUTE(0, "lspeaker", 0.32)
1116   MDRV_SOUND_ROUTE(1, "rspeaker", 0.32)
1117
1118   MDRV_SOUND_ADD("5205", MSM5205, 220000)
1119   MDRV_SOUND_CONFIG(tturfbl_msm5205_interface)
1120   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
1121   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
1122MACHINE_DRIVER_END
1123
11011124static MACHINE_DRIVER_START( goldnaxe_b1 )
11021125
11031126   /* basic machine hardware */
r5077r5078
11431166   MDRV_IMPORT_FROM(goldnaxe_b1)
11441167   MDRV_CPU_MODIFY("maincpu")
11451168   MDRV_CPU_PROGRAM_MAP(bayroute_b2_map)
1169
1170   MDRV_IMPORT_FROM(sys16_datsu_sound_cfg)
11461171MACHINE_DRIVER_END
11471172
11481173static MACHINE_DRIVER_START( dduxbl )
r5077r5078
19531978   ROM_LOAD16_BYTE( "bs7.bin",     0x60000, 0x10000, CRC(0c91abcc) SHA1(d25608f3cbacd1bd169f1a2247f007ac8bc8dda0) )
19541979
19551980   ROM_REGION( 0x50000, "soundcpu", 0 ) /* sound CPU */
1956   ROM_LOAD( "br_01", 0x00000, 0x10000, CRC(b87156ec) SHA1(bdfef2ab5a4d3cac4077c92ce1ef4604b4c11cf8) )
1957   ROM_LOAD( "br_02", 0x10000, 0x10000, CRC(ef63991b) SHA1(4221741780f88c80b3213ddca949bee7d4c1469a) )
1981   ROM_LOAD( "br_01", 0x10000, 0x10000, CRC(b87156ec) SHA1(bdfef2ab5a4d3cac4077c92ce1ef4604b4c11cf8) )
1982   ROM_LOAD( "br_02", 0x20000, 0x10000, CRC(ef63991b) SHA1(4221741780f88c80b3213ddca949bee7d4c1469a) )
19581983ROM_END
19591984
19601985// sys16B
r5077r5078
21272152
21282153static DRIVER_INIT( bayrouteb2 )
21292154{
2155   UINT8 *mem;
2156
21302157   MACHINE_RESET_CALL(sys16_onetime);
2158
2159   mem = memory_region(machine, "soundcpu");
2160   memcpy(mem, mem+0x10000, 0x8000);
21312161}
21322162
21332163/*
r5077r5078
24882518
24892519// System 16B based bootlegs
24902520GAME( 1989, bayrouteb1, bayroute, bayrouteb1, bayroute, bayrouteb1, ROT0,   "bootleg", "Bay Route (encrypted, protected bootleg)", GAME_NO_SOUND | GAME_NOT_WORKING ) // broken sprites (due to missing/wrong irq code?)
2491GAME( 1989, bayrouteb2, bayroute, bayrouteb2, bayroute, bayrouteb2, ROT0,   "bootleg", "Bay Route (Datsu bootleg)", GAME_NO_SOUND | GAME_NOT_WORKING )
2521GAME( 1989, bayrouteb2, bayroute, bayrouteb2, bayroute, bayrouteb2, ROT0,   "bootleg", "Bay Route (Datsu bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
24922522GAME( 1989, goldnaxeb1, goldnaxe, goldnaxe_b1, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (encrypted bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND )
24932523GAME( 1989, goldnaxeb2, goldnaxe, goldnaxe_b2, goldnaxe, goldnab2, ROT0,   "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND )
24942524GAME( 1989, tturfbl,  tturf,    tturfbl,  tturf,    tturfbl,  ROT0,   "bootleg", "Tough Turf (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
src/mame/drivers/limenko.c
r5077r5078
241241   SET_TILE_INFO(0,tile,color,0);
242242}
243243
244static void draw_single_sprite(bitmap_t *dest_bmp,const gfx_element *gfx,
244static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
245245      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
246      const rectangle *clip,int priority)
246      int priority)
247247{
248248   int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
249249   const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
r5077r5078
388388      /* prepare GfxElement on the fly */
389389      gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width, 0, 256, 0);
390390
391      draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x,y,cliprect,pri);
391      draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y,pri);
392392
393393      // wrap around x
394      draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x-512,y,cliprect,pri);
394      draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x-512,y,pri);
395395
396396      // wrap around y
397      draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x,y-512,cliprect,pri);
397      draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y-512,pri);
398398
399399      // wrap around x and y
400      draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x-512,y-512,cliprect,pri);
400      draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x-512,y-512,pri);
401401   }
402402}
403403
src/mame/drivers/calorie.c
r5077r5078
157157      if( calorie_sprites[x+1] & 0x10 )
158158      {
159159          /* 32x32 sprites */
160         drawgfx(bitmap,screen->machine->gfx[3],tileno | 0x40,color,flipx,flipy,xpos,ypos - 31,cliprect,TRANSPARENCY_PEN,0);
160         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3],tileno | 0x40,color,flipx,flipy,xpos,ypos - 31,0);
161161      }
162162      else
163163      {
164164         /* 16x16 sprites */
165         drawgfx(bitmap,screen->machine->gfx[2],tileno,color,flipx,flipy,xpos,ypos - 15,cliprect,TRANSPARENCY_PEN,0);
165         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],tileno,color,flipx,flipy,xpos,ypos - 15,0);
166166      }
167167   }
168168   return 0;
src/mame/drivers/drtomy.c
r5077r5078
8181            ex = xflip ? (spr_size-1-x) : x;
8282            ey = yflip ? (spr_size-1-y) : y;
8383
84            drawgfx(bitmap,gfx,number + x_offset[ex] + y_offset[ey],
84            drawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey],
8585                  color,xflip,yflip,
86                  sx-0x09+x*8,sy+y*8,
87                  cliprect,TRANSPARENCY_PEN,0);
86                  sx-0x09+x*8,sy+y*8,0);
8887         }
8988      }
9089   }
src/mame/drivers/sangho.c
r5077r5078
9393
9494static ADDRESS_MAP_START( sexyboom_io_map, ADDRESS_SPACE_IO, 8 )
9595   ADDRESS_MAP_GLOBAL_MASK(0xff)
96   AM_RANGE( 0x7c, 0x7d) AM_DEVWRITE( "ym", ym2413_w )
9697   AM_RANGE( 0xa0, 0xa0) AM_READ_PORT("P1")
9798   AM_RANGE( 0xa1, 0xa1) AM_READ_PORT("P2")
98   AM_RANGE( 0xf7, 0xf7) AM_READ_PORT("DSW")
99   AM_RANGE( 0xf0, 0xf0) AM_READ( v9938_0_vram_r )
100   AM_RANGE( 0xf1, 0xf1) AM_READ( v9938_0_status_r )
101
102   ADDRESS_MAP_GLOBAL_MASK(0xff)
103   AM_RANGE( 0x7c, 0x7d) AM_DEVWRITE( "ym", ym2413_w )
104   AM_RANGE( 0xf0, 0xf0) AM_WRITE( v9938_0_vram_w )
105   AM_RANGE( 0xf1, 0xf1) AM_WRITE( v9938_0_command_w )
99   AM_RANGE( 0xf0, 0xf0) AM_READWRITE( v9938_0_vram_r,v9938_0_vram_w )
100   AM_RANGE( 0xf1, 0xf1) AM_READWRITE( v9938_0_status_r,v9938_0_command_w )
106101   AM_RANGE( 0xf2, 0xf2) AM_WRITE( v9938_0_palette_w )
107102   AM_RANGE( 0xf3, 0xf3) AM_WRITE( v9938_0_register_w )
103   AM_RANGE( 0xf7, 0xf7) AM_READ_PORT("DSW")
108104   //bank f8-ff ???
109105ADDRESS_MAP_END
110106
src/mame/drivers/pachifev.c
r5077r5078
1515
1616============================================================================
1717
18Skeleton driver, the main issue is to decrypt/identify the main CPU.
19ADPCM & remaining ROM space is pretty much identical to Jantotsu, maybe
20there's a correlation? Or the dump is bad/missing something?
18Skeleton driver, just the main CPU was identified (TMS9900). Can't get it
19to upload a vram / blitter list at all :-/
20Many thanks to Olivier Galibert and Wilbert Pol for the identify effort ;-)
2121
2222***************************************************************************/
2323
2424#include "driver.h"
25#include "cpu/z80/z80.h"
25#include "cpu/tms9900/tms9900.h"
2626#include "sound/msm5205.h"
2727
2828static VIDEO_START( pachifev )
r5077r5078
3535   return 0;
3636}
3737
38static ADDRESS_MAP_START( pachifev_map, ADDRESS_SPACE_PROGRAM, 8 )
38static ADDRESS_MAP_START( pachifev_map, ADDRESS_SPACE_PROGRAM, 16 )
3939   AM_RANGE(0x0000, 0xbfff) AM_ROM
40   AM_RANGE(0xe000, 0xffff) AM_RAM
4041ADDRESS_MAP_END
4142
4243static ADDRESS_MAP_START( pachifev_io, ADDRESS_SPACE_IO, 8 )
43   ADDRESS_MAP_GLOBAL_MASK(0xff)
44//  AM_RANGE(0x0f70, 0x0f70) AM_WRITE()
45//  AM_RANGE(0x0f71, 0x0f71) AM_WRITE()
4446ADDRESS_MAP_END
4547
4648
r5077r5078
8789   adpcm_pos = 0;
8890}
8991
92static INTERRUPT_GEN( pachifev_vblank_irq )
93{
94}
95
9096static MACHINE_DRIVER_START( pachifev )
9197
9298   /* basic machine hardware */
93   MDRV_CPU_ADD("maincpu",Z80,8000000/2)
99   MDRV_CPU_ADD("maincpu", TMS9900, 12000000/4) /* unknown divider */
94100   MDRV_CPU_PROGRAM_MAP(pachifev_map)
95101   MDRV_CPU_IO_MAP(pachifev_io)
96//  MDRV_CPU_FLAGS(CPU_DISABLE)
97//  MDRV_CPU_VBLANK_INT("screen",irq0_line_hold)
102   MDRV_CPU_VBLANK_INT("screen",pachifev_vblank_irq)
98103
99104   /* video hardware */
100105   MDRV_SCREEN_ADD("screen", RASTER)
r5077r5078
123128***************************************************************************/
124129
125130ROM_START( pachifev )
126   ROM_REGION( 0xc000, "maincpu", 0 )
127   ROM_LOAD( "ic42.00",   0x0000, 0x2000, CRC(9653546e) SHA1(0836d01118241d38bbf61732275afe3ae47d0622) )
128   ROM_LOAD( "ic43.01",   0x2000, 0x2000, CRC(5572dce5) SHA1(fad45b33e095ac6e3ed3d7cdc3d8678c153a1b38) )
129   ROM_LOAD( "ic44.02",   0x4000, 0x2000, CRC(98b3841f) SHA1(0563139877bf01e1673767ee1798bbcf68adadea) )
130   ROM_LOAD( "ic45.03",   0x6000, 0x2000, CRC(6b76e6fa) SHA1(5be10ab0b76e2061fc7e9c77649572955bee7661) )
131   ROM_LOAD( "ic46.04",   0x8000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) )
132   ROM_LOAD( "ic48.50",   0xa000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) )
131   ROM_REGION( 0x10000, "maincpu", 0 )
132   ROM_LOAD( "ic42.00",   0x00000, 0x2000, CRC(9653546e) SHA1(0836d01118241d38bbf61732275afe3ae47d0622) )
133   ROM_LOAD( "ic43.01",   0x02000, 0x2000, CRC(5572dce5) SHA1(fad45b33e095ac6e3ed3d7cdc3d8678c153a1b38) )
134   ROM_LOAD( "ic44.02",   0x04000, 0x2000, CRC(98b3841f) SHA1(0563139877bf01e1673767ee1798bbcf68adadea) )
135   ROM_LOAD( "ic45.03",   0x06000, 0x2000, CRC(6b76e6fa) SHA1(5be10ab0b76e2061fc7e9c77649572955bee7661) )
136   ROM_LOAD( "ic46.04",   0x08000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) )
137   ROM_LOAD( "ic48.50",   0x0a000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) )
133138
134139   ROM_REGION( 0x4000, "adpcm", 0 ) //msm code
135140   ROM_LOAD( "ic66.10",   0x0000, 0x2000, CRC(217c573e) SHA1(6fb90865d1d81f5ea00fa7916d0ccb6756ef5ce5) )
136141ROM_END
137142
138GAME( 1983, pachifev,  0,       pachifev,  pachifev,  0, ROT0, "Sanki Denshi Kogyo", "Pachi Fever", GAME_NOT_WORKING )
143static DRIVER_INIT( pachifev )
144{
145}
146
147GAME( 1983, pachifev,  0,       pachifev,  pachifev,  pachifev, ROT0, "Sanki Denshi Kogyo", "Pachi Fever", GAME_NOT_WORKING )
src/mame/drivers/pcat_nit.c
r5077r5078
144144         tile =  (vga_vram[offs] & 0x00ff0000)>>16;
145145         color = (vga_vram[offs] & 0xff000000)>>24;
146146
147         drawgfx(bitmap,machine->gfx[gfx_num],
147         drawgfx_opaque(bitmap,cliprect,machine->gfx[gfx_num],
148148               tile,
149149               color,
150150               0,0,
151               (x+1)*8,y*8,
152               cliprect,TRANSPARENCY_NONE,0);
151               (x+1)*8,y*8);
153152
154153
155154         tile =  (vga_vram[offs] & 0x000000ff);
156155         color = (vga_vram[offs] & 0x0000ff00)>>8;
157156
158         drawgfx(bitmap,machine->gfx[gfx_num],
157         drawgfx_opaque(bitmap,cliprect,machine->gfx[gfx_num],
159158               tile,
160159               color,
161160               0,0,
162               (x+0)*8,y*8,
163               cliprect,TRANSPARENCY_NONE,0);
161               (x+0)*8,y*8);
164162
165163         offs++;
166164      }
src/mame/drivers/raiden2.c
r5077r5078
240240      {
241241         for (ytiles = 0; ytiles < ytlim; ytiles++)
242242         {
243            drawgfx(
243            drawgfx_transpen(
244244                  bitmap,
245                  cliprect,
245246                  gfx,
246247                  tile_number,
247248                  colr,
248249                  yflip,xflip,
249                  sx+xstep*xtiles,sy+ystep*ytiles,
250                  cliprect,
251                  TRANSPARENCY_PEN,15);
250                  sx+xstep*xtiles,sy+ystep*ytiles,15);
252251
253252            tile_number++;
254253         }
src/mame/drivers/taitojc.c
r5077r5078
12931293   cpu_set_input_line(device, 6, HOLD_LINE);
12941294}
12951295
1296static const hc11_config taitojc_config =
1297{
1298   1, //has internal I/O
1299   1280 //internal RAM size
1300};
1301
1302
12961303static MACHINE_DRIVER_START( taitojc )
12971304   MDRV_CPU_ADD("maincpu", M68040, 25000000)
12981305   MDRV_CPU_PROGRAM_MAP(taitojc_map)
r5077r5078
13011308
13021309   TAITO_F3_SOUND_SYSTEM_CPU(16000000)
13031310
1304   MDRV_CPU_ADD("sub", MC68HC11, 4000000)
1311   MDRV_CPU_ADD("sub", MC68HC11, 4000000) //MC68HC11M0
13051312   MDRV_CPU_PROGRAM_MAP(hc11_pgm_map)
13061313   MDRV_CPU_IO_MAP(hc11_io_map)
1314   MDRV_CPU_CONFIG(taitojc_config)
13071315
13081316   MDRV_CPU_ADD("dsp", TMS32051, 50000000)
13091317   MDRV_CPU_PROGRAM_MAP(tms_program_map)
src/mame/drivers/ddealer.c
r5077r5078
175175               UINT16 tile = (src[count]&0x0fff);
176176               UINT16 colr = (src[count]&0xf000)>>12;
177177               count++;
178               drawgfx(bitmap,gfx,tile,colr,0,flipy,(x*16)-sx,(y*16)-sy,cliprect,TRANSPARENCY_PEN,15);
178               drawgfx_transpen(bitmap,cliprect,gfx,tile,colr,0,flipy,(x*16)-sx,(y*16)-sy,15);
179179            }
180180         }
181181         count = 0;
r5077r5078
188188               UINT16 tile = (src[count]&0x0fff);
189189               UINT16 colr = (src[count]&0xf000)>>12;
190190               count++;
191               drawgfx(bitmap,gfx,tile,colr,0,flipy,(x*16)-sx,(y*16)-sy,cliprect,TRANSPARENCY_PEN,15);
191               drawgfx_transpen(bitmap,cliprect,gfx,tile,colr,0,flipy,(x*16)-sx,(y*16)-sy,15);
192192            }
193193         }
194194      }
r5077r5078
207207               UINT16 tile = (src[count]&0x0fff);
208208               UINT16 colr = (src[count]&0xf000)>>12;
209209               count++;
210               drawgfx(bitmap,gfx,tile,colr,flipy,flipy,(x*16)+sx,(y*16)+sy,cliprect,TRANSPARENCY_PEN,15);
210               drawgfx_transpen(bitmap,cliprect,gfx,tile,colr,flipy,flipy,(x*16)+sx,(y*16)+sy,15);
211211            }
212212         }
213213         count = 0;
r5077r5078
220220               UINT16 tile = (src[count]&0x0fff);
221221               UINT16 colr = (src[count]&0xf000)>>12;
222222               count++;
223               drawgfx(bitmap,gfx,tile,colr,flipy,flipy,(x*16)+sx,(y*16)+sy,cliprect,TRANSPARENCY_PEN,15);
223               drawgfx_transpen(bitmap,cliprect,gfx,tile,colr,flipy,flipy,(x*16)+sx,(y*16)+sy,15);
224224            }
225225         }
226226      }
src/mame/drivers/dacholer.c
r5077r5078
322322         flipy = !flipy;
323323      }
324324
325      drawgfx(bitmap,machine->gfx[2],
325      drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
326326            code,
327327            0,
328328            flipx,flipy,
329            sx,sy,
330            cliprect,TRANSPARENCY_PEN,0);
329            sx,sy,0);
331330   }
332331}
333332
src/mame/drivers/marinedt.c
r5077r5078
468468   tilemap_draw(tile, cliprect, tx_tilemap, 0, 0);
469469
470470   bitmap_fill(obj1, NULL, 0);
471   drawgfx(obj1, screen->machine->gfx[1],
471   drawgfx_transpen(obj1, NULL, screen->machine->gfx[1],
472472         OBJ_CODE(marinedt_obj1_a),
473473         OBJ_COLOR(marinedt_obj1_a),
474474         OBJ_FLIPX(marinedt_obj1_a), OBJ_FLIPY(marinedt_obj1_a),
475         0, 0,
476         NULL, TRANSPARENCY_PEN, 0);
475         0, 0, 0);
477476
478477   bitmap_fill(obj2, NULL, 0);
479   drawgfx(obj2, screen->machine->gfx[2],
478   drawgfx_transpen(obj2, NULL, screen->machine->gfx[2],
480479         OBJ_CODE(marinedt_obj2_a),
481480         OBJ_COLOR(marinedt_obj2_a),
482481         OBJ_FLIPX(marinedt_obj2_a), OBJ_FLIPY(marinedt_obj2_a),
483         0, 0,
484         NULL, TRANSPARENCY_PEN, 0);
482         0, 0, 0);
485483
486484   bitmap_fill(bitmap, NULL, 0);
487485
src/mame/drivers/cps3.c
r5077r5078
380380#define CPS3_TRANSPARENCY_PEN_INDEX 2
381381#define CPS3_TRANSPARENCY_PEN_INDEX_BLEND 3
382382
383INLINE void cps3_drawgfxzoom(running_machine *machine, bitmap_t *dest_bmp,const gfx_element *gfx,
383INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
384384      unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
385      const rectangle *clip,int transparency,int transparent_color,
385      int transparency,int transparent_color,
386386      int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask)
387387{
388388   rectangle myclip;
r5077r5078
581581                                 if (c&0x02) dest[x] |= 0x4000;
582582                                 if (c&0x04) dest[x] |= 0x8000;
583583                                 if (c&0x08) dest[x] |= 0x10000;
584                                 if (c&0xf0) dest[x] |= mame_rand(machine); // ?? not used?
584                                 if (c&0xf0) dest[x] |= mame_rand(gfx->machine); // ?? not used?
585585                              }
586586                              else
587587                              {
r5077r5078
912912         if (!bpp) machine->gfx[1]->color_granularity=256;
913913         else machine->gfx[1]->color_granularity=64;
914914
915         cps3_drawgfxzoom(machine, bitmap, machine->gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,&clip,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
915         cps3_drawgfxzoom(bitmap,&clip,machine->gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
916916      }
917917   }
918918}
r5077r5078
11551155
11561156                           if (global_alpha || alpha)
11571157                           {
1158                              cps3_drawgfxzoom(screen->machine, renderbuffer_bitmap, screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,&renderbuffer_clip,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
1158                              cps3_drawgfxzoom(renderbuffer_bitmap,&renderbuffer_clip,screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
11591159                           }
11601160                           else
11611161                           {
1162                              cps3_drawgfxzoom(screen->machine, renderbuffer_bitmap, screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,&renderbuffer_clip,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
1162                              cps3_drawgfxzoom(renderbuffer_bitmap,&renderbuffer_clip,screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
11631163                           }
11641164                           count++;
11651165                        }
r5077r5078
12251225            pal += cps3_ss_pal_base << 5;
12261226            tile+=0x200;
12271227
1228            cps3_drawgfxzoom(screen->machine, bitmap, screen->machine->gfx[0],tile,pal,flipx,flipy,x*8,y*8,cliprect,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
1228            cps3_drawgfxzoom(bitmap, cliprect, screen->machine->gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
12291229            count++;
12301230         }
12311231      }
src/mame/drivers/mlanding.c
r5077r5078
11/* Taito Midnight Landing
22  Dual 68k + 2xZ80
33  no other hardware info..but it doesn't seem related to taitoair.c at all
4
5    TODO:
6    - Fix "sprite" emulation, it's probably a blitter/buffer with commands etc.;
7    - Comms between the four CPUs;
8    - understand how to display the "dots", my guess is that they are at 0x200000-0x203fff of the sub cpu (this might need a side-by-side);
9    - Fix "sound cpu error" msg;
10    - Inputs, particularly needed for a game like this one;
411*/
512
613#include "driver.h"
r5077r5078
5865        other bits = language(german, japan, english), video test
5966    */
6067
61      int retval= (status_bit|1|0x07fff);
62      status_bit=0x8000;
63      return retval;
64
68   int retval= (status_bit|1|0x07fff);
69   status_bit=0x8000;
70   return retval;
6571}
6672
6773static WRITE16_HANDLER(ml_subreset_w)
r5077r5078
108114   adpcm_pos &= 0xff00;
109115}
110116
117/* TODO: check this */
118static WRITE16_HANDLER( sound_reset_w )
119{
120   cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
121}
122
111123static ADDRESS_MAP_START( mlanding_mem, ADDRESS_SPACE_PROGRAM, 16 )
112124   AM_RANGE(0x000000, 0x05ffff) AM_ROM
113125   AM_RANGE(0x080000, 0x08ffff) AM_RAM
r5077r5078
119131   AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE(1)
120132
121133   AM_RANGE(0x1d0000, 0x1d0001) AM_WRITENOP
122   AM_RANGE(0x1d0002, 0x1d0003) AM_NOP //sound reset ??
134   AM_RANGE(0x1d0002, 0x1d0003) AM_WRITE(sound_reset_w) //sound reset ??
123135
124136   AM_RANGE(0x2d0000, 0x2d0001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
125   AM_RANGE(0x2d0002, 0x2d0003) AM_READ8(taitosound_comm_r, 0xff00) AM_WRITE8(taitosound_comm_w, 0x00ff)
137//  AM_RANGE(0x2d0002, 0x2d0003) AM_READ8(taitosound_comm_r, 0xff00) AM_WRITE8(taitosound_comm_w, 0x00ff)
138   AM_RANGE(0x2d0002, 0x2d0003) AM_READ8(taitosound_comm_r, 0x00ff) AM_WRITE8(taitosound_comm_w, 0x00ff)
126139
127140   AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)//AM_SHARE(2)
128141   AM_RANGE(0x280000, 0x2807ff) AM_RAM // is it shared with mecha ? tested around $940
r5077r5078
134147   AM_RANGE(0x240006, 0x240007) AM_READ(io1_r) // vblank ?
135148   AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(ml_subreset_w)
136149
150   /* are we sure that these are for an analog stick? */
137151   AM_RANGE(0x2b0000, 0x2b0001) AM_READ_PORT("STICKX")      //-40 .. 40 analog controls ?
138152   AM_RANGE(0x2b0004, 0x2b0005) AM_READ_PORT("STICKY")      //-40 .. 40 analog controls ?
153   AM_RANGE(0x2b0006, 0x2b0007) AM_READNOP // tested in service mode, dips?
139154   AM_RANGE(0x2c0000, 0x2c0001) AM_READ_PORT("STICKZ")      //-60 .. 60 analog controls ?
140155   AM_RANGE(0x2c0002, 0x2c0003) AM_READ_PORT("IN3")
141156   AM_RANGE(0x2b0002, 0x2b0003) AM_READ_PORT("IN2")      // IN2/IN3 could be switched
r5077r5078
155170
156171static ADDRESS_MAP_START( mlanding_z80_mem, ADDRESS_SPACE_PROGRAM, 8 )
157172   AM_RANGE(0x0000, 0x3fff) AM_ROM
158   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK(1))
173   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
159174   AM_RANGE(0x8000, 0x8fff) AM_RAM
160   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
161   AM_RANGE(0x9002, 0x9100) AM_READ(SMH_RAM)
175   AM_RANGE(0x9000, 0x9001) AM_MIRROR(0x00fe) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
162176   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
163177   AM_RANGE(0xa001, 0xa001) AM_READ(taitosound_slave_comm_r) AM_WRITE(taitosound_slave_comm_w)
164178
r5077r5078
226240            //test
227241               if(code)
228242               {
229                  drawgfx(ml_bitmap[num],screen->machine->gfx[0],
243                  drawgfx_opaque(ml_bitmap[num],cliprect,screen->machine->gfx[0],
230244                     code++,
231245                     color,
232246                     0,0,
233                     x+j*8,y+k*8,
234                     cliprect,TRANSPARENCY_NONE,0);
247                     x+j*8,y+k*8);
235248               }
236249               else
237250               {
r5077r5078
254267         copybitmap_trans(bitmap,ml_bitmap[i], 0, 0, 0, 0, cliprect, 0);
255268      }
256269   }
257   status_bit=0;
270   status_bit=0; //FIXME: emulation variable in VIDEO_UPDATE()
258271   {
259272   /*  int i;
260273        for(i=0;i<0x8000;i++)
r5077r5078
269282
270283static INPUT_PORTS_START( mlanding )
271284   PORT_START("IN0")
272   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_TILT )
273   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) //service coin?
285   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
286   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
287   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
288   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Door") PORT_TOGGLE
289   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
290   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
291   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
292   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
293   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
294   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
295   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
296   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
297   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
298   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
299   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
300   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
274301
275302   PORT_START("IN1")
276   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_COIN1 )
277   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN2 )
303   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
304   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
305   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
306   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
307   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
308   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
309   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
310   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
311   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
312   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
313   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
314   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
315   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
316   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
317   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
318   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
319   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
320   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
321   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
322   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
278323
279324   PORT_START("IN2")
280   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
281   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
282   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
283   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
284   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
285   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
286   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)
287   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1)
325   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" ) //high bits of counter 2
326   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
327   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
328   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
329   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
330   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
331   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
332   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
333   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
334   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
335   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
336   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
337   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
338   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Slot Down")
339   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Slot Up")
340   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
341   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
342   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
288343
289344   PORT_START("IN3")
290   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1)
291   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1)
292   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_START2 )
293   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_START1 )
294   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN3 )
295   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
296   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
297   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
298   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
299   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
300   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
301   PORT_DIPNAME( 0x0080, 0x0080, "test 1" )
302   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
303   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )
345   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" ) //high bits of counter 3
346   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
347   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
348   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
349   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
350   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
351   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
352   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
353   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
354   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
355   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
356   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
357   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
358   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
359   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
360   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
361   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
362   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
304363
305364   PORT_START("STICKX")      /* Stick 1 (3) */
306365   PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0xffd8,0x28) PORT_SENSITIVITY(30) PORT_KEYDELTA(1) PORT_PLAYER(1)
r5077r5078
358417   MDRV_CPU_PROGRAM_MAP(mlanding_z80_sub_mem)
359418   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
360419
420   MDRV_QUANTUM_TIME(HZ(600))
421
361422   /* video hardware */
362423   MDRV_SCREEN_ADD("screen", RASTER)
363424   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/pturn.c
r5077r5078
158158
159159      if(sx|sy)
160160      {
161         drawgfx(bitmap, screen->machine->gfx[2],
161         drawgfx_transpen(bitmap, cliprect,screen->machine->gfx[2],
162162         spriteram[offs+1] & 0x3f ,
163163         (spriteram[offs+2] & 0x1f),
164164         flipx, flipy,
165         sx,sy,
166         cliprect,TRANSPARENCY_PEN,0);
165         sx,sy,0);
167166      }
168167   }
169168   tilemap_draw(bitmap,cliprect,pturn_fgmap,0,0);
src/mame/drivers/mpu4drvr.c
r5077r5078
524524         colattr = tiledat >>12;
525525         tiledat &= 0x0fff;
526526
527         drawgfx(bitmap,screen->machine->gfx[gfxregion],tiledat,colattr,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
527         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfxregion],tiledat,colattr,0,0,x*8,y*8);
528528
529529         count++;
530530      }
r5077r5078
16251625      {
16261626         int tile = dealem_videoram[count + 0x1000] | (dealem_videoram[count] << 8);
16271627         count++;
1628         drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x * 8,y * 8,cliprect,TRANSPARENCY_NONE,0);
1628         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x * 8,y * 8);
16291629      }
16301630   }
16311631
src/mame/drivers/cubocd32.c
r5077r5078
11/* Cubo CD32 (Original hardware by Commodore, additional hardware and games by CD Express, Milan, Italy)
22
3   Preliminary driver by Mariusz Wojcieszek
3   Driver by Mariusz Wojcieszek
44   CD-ROM controller by Ernesto Corvi
5   Inputs by Stephane Humbert
56
67   This is basically a CD32 (Amiga 68020, AGA based games system) hacked up to run arcade games.
78   see http://ninjaw.ifrance.com/cd32/cubo/ for a brief overview.
r5077r5078
2324    * Gamepad, Serial port, 2 Gameports, Interfaces for keyboard
2425
2526
26   ToDo:
27      Inputs
2827
29
3028   Known Games:
3129   Title                | rev. | year
3230   ----------------------------------------------
r5077r5078
4139   Odeon Twister 2      |202.19| 1999
4240
4341
42   ToDo:
43   - remove the hack needed to make inputs working
44   - settings are not saved
45
46
47   Stephh notes:
48
49   Harem Challenge:
50
51settings (A5=0x00a688 & A2= 0x0028e8) :
52
53  -                      : photo level - soft* / erotic / porno
54  - 002906.b (A2 + 0x1e) : difficulty (2) - 1 = LOW / 2 = NORMAL / 3 = HIGH
55  - 0028fc.b (A2 + 0x14) : deadly selftouch (0) - 0 = NO / 1 = YES
56  - 0028ff.b (A2 + 0x17) : energy supply - 100%* / 0% / 50%
57  - 002900.b (A2 + 0x18) : area to cover 1P - 75% / 80%* / 85%
58  - 002901.b (A2 + 0x19) : area to cover 2P - 70% / 75%* / 80%
59  - 002902.w (A2 + 0x1a) : level time (00C8) - 0096 = 1:00 / 00C8 = 1:20 / 00FA = 1:40
60  - 002904.b (A2 + 0x1c) : tournament mode (2) - 0 = NO CHALLENGE / 2 = BEST OF 3 / 3 = BEST OF 5
61  -                      : reset hi-score - NO* / YES
62  - 0028fd.b (A2 + 0x15) : coin x 1 play (1) <=> number of credits used for each play
63  - 0028fe.b (A2 + 0x16) : play x credit (1) <=> credits awarded for each coin
64  -                      : demo photo level - soft* / erot
65
66useful addresses :
67
68  - 002907.b (-$7f00,A5 -> $1f,A2) : must be 0x0000 instead of 0x0001 to accept coins !
69  - 00278c.w (-$7efc,A5) : player 2 inputs
70  - 00278e.w (-$7efa,A5) : player 1 inputs
71  - 002790.b (-$7ef8,A5) : credits
72
73  - 0028e8.b (A2       ) : level - range (0x01 - 0x09 and 0x00 when in "attract mode")
74  - 0028ea.w (A2 + 0x02) : time (not used for "continue play") - range (0x0000 - 0x0014 with 0x0000 being max)
75
76  - 026fe8.l (-$7fa0,A5 -> A2 + $18 x 0 + 0x00) : player 1 energy (in MSW after swap) - range (0x00000000 - 0x00270000)
77  - 026fec.l (-$7fa0,A5 -> A2 + $18 x 0 + 0x04) : player 1 score
78  - 026ff8.w (-$7fa0,A5 -> A2 + $18 x 0 + 0x10) : player 1 girls
79  - 027000.l (-$7fa0,A5 -> A2 + $18 x 1 + 0x00) : player 2 energy (in MSW after swap) - range (0x00000000 - 0x00270000)
80  - 027004.l (-$7fa0,A5 -> A2 + $18 x 1 + 0x04) : player 2 score
81  - 027010.w (-$7fa0,A5 -> A2 + $18 x 1 + 0x10) : player 2 girls
82
83routines :
84
85  - 04a5de : inputs read
86  - 061928 : buttons + coin read
87      * D0 = 0 : read POTGO (player 2)
88      * D0 = 1 : read POTGO (player 1)
89
90  - 04a692 : coin verification
91  - 050b8c : start buttons verification
92
93
94  Laser Strixx 2
95
96settings (A5=0x00a688 & A2= 0x0027f8) :
97
98  -                      : photo level - soft* / erotic / porno
99  - 002910.l (A2 + 0x18) : difficulty (00010000) - 00008000 = LOW / 00010000 = NORMAL / 00018000 = HIGH
100  - 002818.b (A2 + 0x20) : deadly selftouch (0) - 0 = NO / 1 = YES
101  - 00281b.b (A2 + 0x23) : energy supply - 100%* / 0% / 50%
102  - 002819.b (A2 + 0x21) : coin x 1 play (1) <=> number of credits used for each play
103  - 00281a.b (A2 + 0x22) : play x credit (1) <=> credits awarded for each coin
104
105useful addresses :
106
107  - 00281c.b (-$7fa2,A5 -> $24,A2) : must be 0x0000 instead of 0x0001 to accept coins !
108  - 0026f4.w (-$7f94,A5) : player 1 inputs (in MSW after swap)
109  - 0026ee.b (-$7f9a,A5) : credits
110
111  - 0027f8.l (A2 + 0x00) : player 1 energy (in MSW after swap) - range (0x00000000 - 0x00270000)
112  - 0027fc.b (A2 + 0x04) : level - range (0x01 - 0x09 and 0x00 when in "attract mode")
113  - 0027fe.w (A2 + 0x06) : time (not used for "continue play") - range (0x0000 - 0x0014 with 0x0000 being max)
114  - 002800.l (A2 + 0x08) : player 1 score
115  - 00280a.b (A2 + 0x12) : mouth status (0x00 = not out - 0x01 = out - 0x02 = captured = LIVE STRIP at the end of level)
116  - 00280b.b (A2 + 0x13) : strip phase (0x01 - n with 0x01 being last phase)
117                             Ann : n = 0x05
118                             Eva : n = 0x04
119                             Jo  : n = 0x06
120                             Sue : n = 0x04
121                             Bob : n = 0x05
122
123routines :
124
125  - 04d1ae : inputs read
126  - 058340 : buttons + coin read
127      * D0 = 0 : read POTGO (player 2)
128      * D0 = 1 : read POTGO (player 1)
129
130  - 04d1da : coin verification
131
132
133    Candy Puzzle
134
135settings (A5=0x059ac0) :
136
137  - 051ba0.w (-$7f20,A5) : difficulty player 1 (0)
138  - 051ba2.w (-$7f1e,A5) : difficulty player 2 (0)
139  - 051ba4.w (-$7f1c,A5) : challenge rounds (3)
140  - 051ba6.w (-$7f1a,A5) : death in 2P mode (0) - 0 = NO / 1 = YES
141  - 051ba8.w (-$7f18,A5) : play x credit (1)
142  - 051bac.w (-$7f14,A5) : coin x 1 play (1)
143  - 051bb0.w (-$7f10,A5) : maxpalleattack (2)
144  -                      : reset high score - NO* / YES
145  - 051baa.w (-$7f16,A5) : 1 coin 2 players (1) - 0 = NO / 1 = YES
146
147useful addresses :
148
149  - 051c02.w (-$7ebe,A5) : must be 0x0000 instead of 0x0001 to accept coins !
150  - 051c04.b (-$7ebc,A5) : credits
151  - 051c10.l (-$7eb0,A5) : basic address for inputs = 0006fd18 :
152      * BA + 1 x 6 + 4 : start 2 (bit 5) and coin (bit 2)
153      * BA + 1 x 6 + 0 : player 2 L/R (-1/0/1)
154      * BA + 1 x 6 + 2 : player 2 U/D (-1/0/1)
155      * BA + 0 x 6 + 4 : start 1 (bit 5)
156      * BA + 0 x 6 + 0 : player 1 L/R (-1/0/1)
157      * BA + 0 x 6 + 2 : player 1 U/D (-1/0/1)
158
159routines :
160
161  - 07acae : inputs read
162  - 092c8a : buttons + coin read
163      * D0 = 0 : read POTGO (player 2)
164      * D0 = 1 : read POTGO (player 1)
165  - 092baa : joy read - test bits 1 and 9 : 1 if bit 1, -1 if bit 9, 0 if none
166      * D0 = 0 : read JOY0DAT (player 2)
167      * D0 = 1 : read JOY1DAT (player 1)
168  - 092bd4 : joy read - test bits 0 and 8 : 1 if bit 0, -1 if bit 8, 0 if none ("eor.w read, read >> 1" before test)
169      * D0 = 0 : read JOY0DAT (player 2)
170      * D0 = 1 : read JOY1DAT (player 1)
171
172  - 07ada4 : coin verification
173  - 07d0fe : start buttons verification
174
44175*/
45176
46177#include "driver.h"
r5077r5078
138269   AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION("user1", 0x0)      /* Kickstart */
139270ADDRESS_MAP_END
140271
141//int cubo_input_port_val = 0;
142//int cubo_input_select = 0;
272/*************************************
273 *
274 *  Inputs
275 *
276 *************************************/
277
143278static UINT16 potgo_value = 0;
144279static int cd32_shifter[2];
280static void (*cubocd32_input_hack)(running_machine *machine) = 0;
145281
146282static void cubocd32_potgo_w(running_machine *machine, UINT16 data)
147283{
148284   int i;
149285
286   if (cubocd32_input_hack != NULL)
287      cubocd32_input_hack(machine);
288
150289   potgo_value = potgo_value & 0x5500;
151290   potgo_value |= data & 0xaa00;
152291
r5077r5078
165304       UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */
166305       UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */
167306       if ((potgo_value & p5dir) && (potgo_value & p5dat))
168      cd32_shifter[i] = 8;
307         cd32_shifter[i] = 8;
169308    }
170
171309}
172310
173311static void handle_cd32_joystick_cia(UINT8 pra, UINT8 dra)
r5077r5078
180318      UINT8 but = 0x40 << i;
181319      UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */
182320      UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */
321
183322      if (!(potgo_value & p5dir) || !(potgo_value & p5dat))
184323      {
185324         if ((dra & but) && (pra & but) != oldstate[i])
r5077r5078
198337
199338static UINT16 handle_joystick_potgor (running_machine *machine, UINT16 potgor)
200339{
340   static const char *const player_portname[] = { "P2", "P1" };
201341    int i;
202342
203343    for (i = 0; i < 2; i++)
r5077r5078
218358       /* shift at 1 == return one, >1 = return button states */
219359       if (cd32_shifter[i] == 0)
220360         potgor &= ~p9dat; /* shift at zero == return zero */
221      if (i == 0)
222         if (cd32_shifter[i] >= 2 && (input_port_read(machine, "IN0") & (1 << (cd32_shifter[i] - 2))))
223            potgor &= ~p9dat;
361      if (cd32_shifter[i] >= 2 && (input_port_read(machine, player_portname[i]) & (1 << (cd32_shifter[i] - 2))))
362         potgor &= ~p9dat;
224363    }
225364    return potgor;
226365}
r5077r5078
233372
234373static INPUT_PORTS_START( cd32 )
235374   PORT_START("CIA0PORTA")
236   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_SPECIAL )
237   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
238   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
375   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
239376
240377   PORT_START("CIA0PORTB")
241   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
242   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
378   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
243379
244380   PORT_START("JOY0DAT")
245   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P1JOY")
381   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P2JOY")
246382   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
247383
248384   PORT_START("JOY1DAT")
249   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P2JOY")
385   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P1JOY")
250386   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
251387
252388   PORT_START("POTGO")
253   PORT_BIT( 0x4400, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(cubo_input, 0)
254   PORT_BIT( 0xaaff, IP_ACTIVE_LOW, IPT_UNUSED )
389   PORT_BIT( 0x4400, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cubo_input, 0)
390   PORT_BIT( 0xbbff, IP_ACTIVE_HIGH, IPT_UNUSED )
255391
256392   PORT_START("P1JOY")
257   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
258   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
259   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
393   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_PLAYER(1)
394   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_PLAYER(1)
395   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_PLAYER(1)
260396   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
261397
262398   PORT_START("P2JOY")
263   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
264   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
265   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
399   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_PLAYER(2)
400   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_PLAYER(2)
401   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_PLAYER(2)
266402   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
267403
268   PORT_START("COINS")
269   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
270   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
271
272404   PORT_START("DIPSW1")
273405   PORT_DIPNAME( 0x01, 0x01, "DSW1 1" )
274406   PORT_DIPSETTING(    0x01, "Reset" )
r5077r5078
293425   PORT_DIPSETTING(    0x80, "Reset" )
294426   PORT_DIPSETTING(    0x00, "Set" )
295427
296   PORT_START("IN0")
297   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 )
298   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 )
299   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 )
300   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 )
301   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 )
302   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 )
303   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON7 )
304   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
305   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
428   PORT_START("P1")
429   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
430   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
431   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)    /* COIN1 */
432   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1)
433   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1)
434   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1)    /* BUTTON1 & START1 */
435   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(1)
436   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(1)
306437
438   PORT_START("P2")
439   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
440   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
441   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
442   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2)
443   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2)
444   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2)    /* BUTTON1 & START2 */
445   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(2)
446   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(2)
447
307448INPUT_PORTS_END
308449
450static INPUT_PORTS_START( cndypuzl )
451   PORT_INCLUDE( cd32 )
452
453   PORT_MODIFY("P1")
454   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
455   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
456   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_COIN1 )
457   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN )
458   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )
459   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)    /* START1 and launch bubble */
460   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )
461   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
462
463   PORT_MODIFY("P2")
464   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
465   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
466   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )
467   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN )
468   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )
469   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)    /* START2 and launch bubble */
470   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )
471   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
472
473INPUT_PORTS_END
474
475static INPUT_PORTS_START( haremchl )
476   PORT_INCLUDE( cd32 )
477
478   PORT_MODIFY("P1")
479   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
480   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
481   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_COIN1 )
482   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)    /* fire */
483   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )
484   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)    /* START1 and draw */
485   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)    /* retract */
486   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
487
488   PORT_MODIFY("P2")
489   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
490   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
491   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )
492   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)    /* fire */
493   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )
494   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)    /* START2 and draw */
495   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)    /* retract */
496   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
497
498INPUT_PORTS_END
499
500static INPUT_PORTS_START( lasstixx )
501   PORT_INCLUDE( cd32 )
502
503   PORT_MODIFY("P2JOY")
504   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
505   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
506   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
507   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
508
509   PORT_MODIFY("P1")
510   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
511   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
512   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_COIN1 )
513   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN )
514   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )
515   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)    /* START1 and draw */
516   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)    /* retract */
517   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
518
519   PORT_MODIFY("P2")
520   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
521   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
522   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )
523   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN )
524   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )
525   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN )
526   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )
527   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
528
529INPUT_PORTS_END
309530/*************************************
310531 *
311532 *  Sound definitions
r5077r5078
463684
464685   /* intialize akiko */
465686   amiga_akiko_init(machine);
687
688   /* input hack */
689   cubocd32_input_hack = NULL;
466690}
467691
692static void haremchl_input_hack(running_machine *machine)
693{
694   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
695      amiga_chip_ram_w(0x2906, 0x00);
696}
697
698static DRIVER_INIT(haremchl)
699{
700   DRIVER_INIT_CALL(cd32);
701   cubocd32_input_hack = haremchl_input_hack;
702}
703
704static void cndypuzl_input_hack(running_machine *machine)
705{
706   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
707      amiga_chip_ram_w(0x051c02, 0x00);
708}
709
710static DRIVER_INIT(cndypuzl)
711{
712   DRIVER_INIT_CALL(cd32);
713   cubocd32_input_hack = cndypuzl_input_hack;
714}
715
716static void lasstixx_input_hack(running_machine *machine)
717{
718   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
719      amiga_chip_ram_w(0x0281c, 0x00);
720}
721
722static DRIVER_INIT(lasstixx)
723{
724   DRIVER_INIT_CALL(cd32);
725   cubocd32_input_hack = lasstixx_input_hack;
726}
727
468728/***************************************************************************************************/
469729
470730/* BIOS */
471731GAME( 1993, cd32, 0, cd32, cd32, cd32,   ROT0, "Commodore", "Amiga CD32 Bios", GAME_IS_BIOS_ROOT )
472732
473GAME( 1995, cndypuzl, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Candy Puzzle (v1.0)", GAME_NOT_WORKING|GAME_NO_SOUND )
474GAME( 1995, haremchl, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Harem Challenge", GAME_NOT_WORKING|GAME_NO_SOUND )
475GAME( 1995, lsrquiz,  cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Laser Quiz", GAME_NOT_WORKING|GAME_NO_SOUND )
476GAME( 1995, lsrquiz2, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Laser Quiz '2' Italy (v1.0)", GAME_NOT_WORKING|GAME_NO_SOUND )
477GAME( 1996, mgprem11, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Magic Premium (v1.1)", GAME_NOT_WORKING|GAME_NO_SOUND )
478GAME( 1995, lasstixx, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Laser Strixx", GAME_NOT_WORKING|GAME_NO_SOUND )
479GAME( 1995, mgnumber, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Magic Number", GAME_NOT_WORKING|GAME_NO_SOUND )
733GAME( 1995, cndypuzl, cd32, cd32, cndypuzl, cndypuzl, ROT0, "CD Express", "Candy Puzzle (v1.0)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
734GAME( 1995, haremchl, cd32, cd32, haremchl, haremchl, ROT0, "CD Express", "Harem Challenge", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
735GAME( 1995, lsrquiz,  cd32, cd32, cd32,     cd32,     ROT0, "CD Express", "Laser Quiz Italy", GAME_NOT_WORKING|GAME_NO_SOUND )
736GAME( 1995, lsrquiz2, cd32, cd32, cd32,     cd32,     ROT0, "CD Express", "Laser Quiz 2 Italy (v1.0)", GAME_NOT_WORKING|GAME_NO_SOUND )
737GAME( 1996, mgprem11, cd32, cd32, cd32,     cd32,     ROT0, "CD Express", "Magic Premium (v1.1)", GAME_NOT_WORKING|GAME_NO_SOUND )
738GAME( 1995, lasstixx, cd32, cd32, lasstixx, lasstixx, ROT0, "CD Express", "Laser Strixx 2", GAME_NOT_WORKING|GAME_NO_SOUND )
739GAME( 1995, mgnumber, cd32, cd32, cd32,     cd32,     ROT0, "CD Express", "Magic Number", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/progolf.c
r5077r5078
9292         {
9393            int tile = videoram[count];
9494
95            drawgfx(bitmap,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8,cliprect,TRANSPARENCY_NONE,0);
95            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8);
9696            /* wrap-around */
97            drawgfx(bitmap,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8,cliprect,TRANSPARENCY_NONE,0);
97            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8);
9898
9999            count++;
100100         }
src/mame/drivers/powerbal.c
r5077r5078
429429      code = spriteram16[offs+2];
430430      color = (spriteram16[offs+1] & 0xf000) >> 12;
431431
432      drawgfx(bitmap,machine->gfx[0],
432      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
433433            code,
434434            color,
435435            flipx,0,
436            sx + xoffset,sy + yoffset,
437            cliprect,TRANSPARENCY_PEN,0);
436            sx + xoffset,sy + yoffset,0);
438437   }
439438}
440439
src/mame/drivers/blackt96.c
r5077r5078
7272      for (y=0;y<32;y++)
7373      {
7474         UINT16 tile = (blackt96_tilemapram2[count*2 + (0x2000/2)+1]);
75         drawgfx(bitmap,gfxbg,tile,6,0,0,x*16,y*16,cliprect,TRANSPARENCY_NONE,0);
75         drawgfx_opaque(bitmap,cliprect,gfxbg,tile,6,0,0,x*16,y*16);
7676         count++;
7777      }
7878   }
r5077r5078
8888         UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000);
8989         UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10;
9090
91         drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16,cliprect,TRANSPARENCY_PEN,0);
91         drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0);
9292         count++;
9393      }
9494   }
r5077r5078
102102         UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000);
103103         UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10;
104104
105         drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16,cliprect,TRANSPARENCY_PEN,0);
105         drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0);
106106         count++;
107107      }
108108   }
r5077r5078
116116         UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000);
117117         UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10;
118118
119         drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16,cliprect,TRANSPARENCY_PEN,0);
119         drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0);
120120         count++;
121121      }
122122   }
r5077r5078
130130         UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000);
131131         UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10;
132132
133         drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16,cliprect,TRANSPARENCY_PEN,0);
133         drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0);
134134         count++;
135135      }
136136   }
r5077r5078
143143         UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000);
144144         UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10;
145145
146         drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16,cliprect,TRANSPARENCY_PEN,0);
146         drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0);
147147         count++;
148148      }
149149   }
r5077r5078
156156         UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000);
157157         UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10;
158158
159         drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16,cliprect,TRANSPARENCY_PEN,0);
159         drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0);
160160         count++;
161161      }
162162   }
r5077r5078
168168      for (y=0;y<32;y++)
169169      {
170170         UINT16 tile = (blackt96_tilemapram[count*2]&0x7ff)+0x800; // +0xc00 for korean text
171         drawgfx(bitmap,gfx,tile,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_PEN,0);
171         drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8,0);
172172         count++;
173173      }
174174
src/mame/drivers/ace.c
r5077r5078
7777   bitmap_fill(bitmap, cliprect, 0);
7878
7979
80      drawgfx(bitmap,screen->machine->gfx[1],
80      drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1],
8181            0,
8282            0,
8383            0,0,
84            objpos[0],objpos[1],
85            cliprect,TRANSPARENCY_NONE,0);
84            objpos[0],objpos[1]);
8685
87      drawgfx(bitmap,screen->machine->gfx[2],
86      drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[2],
8887            0,
8988            0,
9089            0,0,
91            objpos[2],objpos[3],
92            cliprect,TRANSPARENCY_NONE,0);
90            objpos[2],objpos[3]);
9391
94      drawgfx(bitmap,screen->machine->gfx[3],
92      drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[3],
9593            0,
9694            0,
9795            0,0,
98            objpos[4],objpos[5],
99            cliprect,TRANSPARENCY_NONE,0);
96            objpos[4],objpos[5]);
10097
10198   for (offs = 0; offs < 8; offs++)
10299   {
103      drawgfx(bitmap,screen->machine->gfx[4],
100      drawgfx_opaque(bitmap,/* ?? */
101            cliprect,screen->machine->gfx[4],
104102            offs,
105103            0,
106104            0,0,
107            10*8+offs*16,256-16, /* ?? */
108            cliprect,TRANSPARENCY_NONE,0);
105            10*8+offs*16,256-16);
109106   }
110107   return 0;
111108}
src/mame/drivers/dreamwld.c
r5077r5078
138138      {
139139         for (xct=0;xct<xsize;xct++)
140140         {
141            drawgfx(bitmap,gfx,redirect[tileno],colour,xflip,0,xpos+xct*xinc,ypos+yct*16,cliprect,TRANSPARENCY_PEN,0);
142            drawgfx(bitmap,gfx,redirect[tileno],colour,xflip,0,(xpos+xct*xinc)-0x200,ypos+yct*16,cliprect,TRANSPARENCY_PEN,0);
143            drawgfx(bitmap,gfx,redirect[tileno],colour,xflip,0,(xpos+xct*xinc)-0x200,(ypos+yct*16)-0x200,cliprect,TRANSPARENCY_PEN,0);
144            drawgfx(bitmap,gfx,redirect[tileno],colour,xflip,0,xpos+xct*xinc,(ypos+yct*16)-0x200,cliprect,TRANSPARENCY_PEN,0);
141            drawgfx_transpen(bitmap,cliprect,gfx,redirect[tileno],colour,xflip,0,xpos+xct*xinc,ypos+yct*16,0);
142            drawgfx_transpen(bitmap,cliprect,gfx,redirect[tileno],colour,xflip,0,(xpos+xct*xinc)-0x200,ypos+yct*16,0);
143            drawgfx_transpen(bitmap,cliprect,gfx,redirect[tileno],colour,xflip,0,(xpos+xct*xinc)-0x200,(ypos+yct*16)-0x200,0);
144            drawgfx_transpen(bitmap,cliprect,gfx,redirect[tileno],colour,xflip,0,xpos+xct*xinc,(ypos+yct*16)-0x200,0);
145145
146146            tileno++;
147147         }
src/mame/drivers/panicr.c
r5077r5078
216216
217217      sprite = spriteram[offs+0]+(scrollram[0x0c]<<8);
218218
219      drawgfx(bitmap,machine->gfx[2],
219      drawgfx_transmask(bitmap,cliprect,machine->gfx[2],
220220            sprite,
221221            color,fx,fy,x,y,
222            cliprect,TRANSPARENCY_PENS,
223222            colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0));
224223   }
225224}
src/mame/drivers/istellar.c
r5077r5078
6464      {
6565         int current_screen_character = (chary*32) + charx;
6666
67         drawgfx(bitmap, screen->machine->gfx[0],
67         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
6868               tile_ram[current_screen_character],
6969               (tile_control_ram[current_screen_character] & 0x0f),
70               0, 0, charx*8, chary*8, cliprect, TRANSPARENCY_PEN, 0);
70               0, 0, charx*8, chary*8, 0);
7171      }
7272   }
7373
src/mame/drivers/8080bw.c
r5077r5078
10701070   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, lupin3_sh_port_1_w)
10711071   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
10721072   AM_RANGE(0x05, 0x05) AM_WRITE(lupin3_sh_port_2_w)
1073   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
10731074ADDRESS_MAP_END
10741075
10751076
r5077r5078
10771078   PORT_INCLUDE( invrvnge )
10781079
10791080   PORT_MODIFY("IN0")
1081   PORT_BIT( 0x03, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1082   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
1083   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_COCKTAIL
1084   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1085   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1086   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1087   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1088
1089   PORT_MODIFY("IN1")
1090   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1091   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1092   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1093   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1094   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1095   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1096
1097   PORT_MODIFY("IN2")
1098   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW1:3")
1099   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1100   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
1101   PORT_DIPNAME( 0x08, 0x00, "Bags To Collect" )      PORT_DIPLOCATION("SW1:4")
1102   PORT_DIPSETTING(    0x08, "2" )
1103   PORT_DIPSETTING(    0x00, "8" )
1104   PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "SW1:5" )
1105   PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW1:6" )
1106   PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW1:7" )
1107   PORT_DIPNAME(0x80,  0x00, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW1:8")
1108   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1109   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1110INPUT_PORTS_END
1111
1112static INPUT_PORTS_START( lupin3a )
1113   PORT_INCLUDE( invrvnge )
1114
1115   PORT_MODIFY("IN0")
10801116   //PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* selects color mode (dynamic vs. static) */
10811117   //PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* something has to do with sound */
10821118   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
r5077r5078
11091145   PORT_DIPNAME(0x80,  0x00, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW1:8")
11101146   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11111147   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1112
1113   /* Dummy port for cocktail mode (not used) */
1114   PORT_MODIFY(CABINET_PORT_TAG)
1115   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
11161148INPUT_PORTS_END
11171149
11181150static MACHINE_DRIVER_START( lupin3 )
r5077r5078
11201152   /* basic machine hardware */
11211153   MDRV_IMPORT_FROM(mw8080bw_root)
11221154   MDRV_CPU_MODIFY("maincpu")
1155   MDRV_CPU_IO_MAP(lupin3_io_map)
1156    MDRV_MACHINE_START(extra_8080bw)
1157
1158   /* video hardware */
1159   MDRV_VIDEO_UPDATE(indianbt)
1160
1161   /* sound hardware */
1162   MDRV_IMPORT_FROM(invaders_samples_audio)
1163
1164MACHINE_DRIVER_END
1165
1166static MACHINE_DRIVER_START( lupin3a )
1167
1168   /* basic machine hardware */
1169   MDRV_IMPORT_FROM(mw8080bw_root)
1170   MDRV_CPU_MODIFY("maincpu")
11231171   MDRV_CPU_PROGRAM_MAP(schaser_map)
11241172   MDRV_CPU_IO_MAP(lupin3_io_map)
11251173    MDRV_MACHINE_START(extra_8080bw)
r5077r5078
15641612/*                                                     */
15651613/*******************************************************/
15661614
1615static WRITE8_HANDLER( steelwkr_sh_port_3_w )
1616{
1617   coin_lockout_global_w(!(~data & 0x03));      /* possibly */
1618}
1619
15671620static ADDRESS_MAP_START( steelwkr_io_map, ADDRESS_SPACE_IO, 8 )
1568    AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
1569    AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1570    AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
1571    AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, invadpt2_sh_port_1_w)
1572    AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
1573    AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
1574   AM_RANGE(0x06, 0x06) AM_WRITENOP /* ? */
1621   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1622   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
1623   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, invadpt2_sh_port_1_w)
1624   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
1625   AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
1626   AM_RANGE(0x06, 0x06) AM_WRITE(steelwkr_sh_port_3_w)
15751627ADDRESS_MAP_END
15761628
15771629static INPUT_PORTS_START( steelwkr )
1578   PORT_START("IN0")
1579   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1580   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1581   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1582   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1583   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1584   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1585   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1586   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1630   /* PORT_START("IN0") - never read */
15871631
15881632   PORT_START("IN1")
15891633   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
r5077r5078
15961640   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON2 )
15971641
15981642   PORT_START("IN2")
1599   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )                           PORT_DIPLOCATION("SW1:1,2")
1643   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
16001644   PORT_DIPSETTING(    0x00, "1" )
16011645   PORT_DIPSETTING(    0x01, "2" )
16021646   PORT_DIPSETTING(    0x02, "3" )
16031647   PORT_DIPSETTING(    0x03, "4" )
1604   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )                              PORT_DIPLOCATION("SW1:3")
1648   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )         PORT_DIPLOCATION("SW1:3")
16051649   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
16061650   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
16071651   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
r5077r5078
16131657INPUT_PORTS_END
16141658
16151659
1616/* same as regular invaders, but with a color board added */
1617
16181660static MACHINE_DRIVER_START( steelwkr )
16191661
1620    /* basic machine hardware */
1621    MDRV_IMPORT_FROM(mw8080bw_root)
1622    MDRV_CPU_MODIFY("maincpu")
1623    MDRV_CPU_IO_MAP(steelwkr_io_map)
1624    MDRV_MACHINE_START(extra_8080bw)
1662   /* basic machine hardware */
1663   MDRV_IMPORT_FROM(mw8080bw_root)
1664   MDRV_CPU_MODIFY("maincpu")
1665   MDRV_CPU_IO_MAP(steelwkr_io_map)
1666   MDRV_MACHINE_START(extra_8080bw)
16251667
16261668   /* video hardware */
16271669   MDRV_VIDEO_UPDATE(invadpt2)
16281670
1629    /* sound hardware */
1671   /* sound hardware */
16301672   MDRV_IMPORT_FROM(invaders_samples_audio)
16311673
16321674MACHINE_DRIVER_END
r5077r5078
24362478
24372479ROM_START( lupin3 )
24382480   ROM_REGION( 0x10000, "maincpu", 0 )
2481   ROM_LOAD( "lp01.36",      0x0000, 0x0800, CRC(fd506ee8) SHA1(67ce62f24892f0eddf3e47913dff541f41493a17) )
2482   ROM_LOAD( "lp02.35",      0x0800, 0x0800, CRC(ec4225f8) SHA1(cd7360b3b339e5050075b498226070914fb7a031) )
2483   ROM_LOAD( "lp03.34",      0x1000, 0x0800, CRC(9307d377) SHA1(081f6c63ff2dcc549e44ab5ff5f5ddf99d544640) )
2484   ROM_LOAD( "lp04.33",      0x1800, 0x0800, CRC(e41e8b2b) SHA1(e67eaa8aeaf13f706afc17074fbbde3ad2cc9548) )
2485   ROM_LOAD( "lp05.32",      0x4000, 0x0800, CRC(f5c2faf4) SHA1(8d056f8c630e4659c02dd5da759dd497e4734292) )
2486   ROM_LOAD( "lp06.31",      0x4800, 0x0800, CRC(66289ab2) SHA1(fc9b4a7b7a08d43f34beaf1a8e68ed0ff6148534) )
2487
2488   ROM_REGION( 0x0800, "proms", 0 )      /* color map */
2489   ROM_LOAD( "lp08.1",       0x0000, 0x0400, CRC(33dbd03a) SHA1(1e0ae1cad1e9a90642886ae2ef726d3f383dd6cf) )
2490   ROM_LOAD( "lp09.2",       0x0400, 0x0400, CRC(9eaee652) SHA1(a4d2d8282ba825f3a8c0cc9bca16e1d36a0d0796) )
2491ROM_END
2492
2493ROM_START( lupin3a )
2494   ROM_REGION( 0x10000, "maincpu", 0 )
24392495   ROM_LOAD( "lp12.bin",     0x0000, 0x0800, CRC(68a7f47a) SHA1(dce99b3810331d7603fa468f1dea984e571f709b) )
24402496   ROM_LOAD( "lp13.bin",     0x0800, 0x0800, CRC(cae9a17b) SHA1(a333ba7db45325996e3254ab36162bb7577e8a38) )
24412497   ROM_LOAD( "lp14.bin",     0x1000, 0x0800, CRC(3553b9e4) SHA1(6affb5b6caf08f365c0dce669e44046295c3df91) )
r5077r5078
26522708GAME( 1979, schaser,  0,        schaser,  schaser,  0, ROT270, "Taito", "Space Chaser", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_COLORS )
26532709GAME( 1979, schasrcv, schaser,  schasrcv, schasrcv, 0, ROT270, "Taito", "Space Chaser (CV version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_COLORS )
26542710GAME( 1979, sflush,   0,        sflush,   sflush,   0, ROT270, "Taito", "Straight Flush",GAME_SUPPORTS_SAVE | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NO_COCKTAIL)
2655GAME( 1980, lupin3,   0,        lupin3,   lupin3,   0, ROT270, "Taito", "Lupin III", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL )
2711GAME( 1980, lupin3,   0,        lupin3,   lupin3,   0, ROT270, "Taito", "Lupin III (set 1)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
2712GAME( 1980, lupin3a,  lupin3,   lupin3a,  lupin3a,  0, ROT270, "Taito", "Lupin III (set 2)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
26562713GAME( 1980, polaris,  0,        polaris,  polaris,  0, ROT270, "Taito", "Polaris (set 1)", GAME_SUPPORTS_SAVE )
26572714GAME( 1980, polarisa, polaris,  polaris,  polaris,  0, ROT270, "Taito", "Polaris (set 2)", GAME_SUPPORTS_SAVE )
26582715GAME( 1980, ballbomb, 0,        ballbomb, ballbomb, 0, ROT270, "Taito", "Balloon Bomber", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )    /* missing clouds */
src/mame/drivers/mirage.c
r5077r5078
9797
9898      while (multi >= 0)
9999      {
100         drawgfx(bitmap,machine->gfx[2],
100         drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
101101               sprite - multi * inc,
102102               colour,
103103               fx,fy,
104               x,y + mult * multi,
105               cliprect,TRANSPARENCY_PEN,0);
104               x,y + mult * multi,0);
106105
107106         multi--;
108107      }
src/mame/drivers/supdrapo.c
r5077r5078
208208         /* Global Column Coloring, GUESS! */
209209         color = col_line[(x*2)+1] ? (col_line[(x*2)+1]-1) & 0x7 : 0;
210210
211         drawgfx(bitmap,screen->machine->gfx[0],tile,color,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
211         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,color,0,0,x*8,y*8);
212212
213213         count++;
214214      }
src/mame/drivers/dominob.c
r5077r5078
5555
5656      code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8)  ;
5757
58      drawgfx(bitmap,machine->gfx[0],
58      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
5959            2 * code,
6060            ((spriteram[offs + 2] & 0xf8) >> 3)  ,
6161            flip_screen_x_get(machine),flip_screen_y_get(machine),
62            sx,sy + (flip_screen_y_get(machine) ? 8 : -8),
63            cliprect,TRANSPARENCY_PEN,0);
64      drawgfx(bitmap,machine->gfx[0],
62            sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0);
63      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
6564            2 * code + 1,
6665            ((spriteram[offs + 2] & 0xf8) >> 3)  ,
6766            flip_screen_x_get(machine),flip_screen_y_get(machine),
68            sx,sy,
69            cliprect,TRANSPARENCY_PEN,0);
67            sx,sy,0);
7068   }
7169}
7270
r5077r5078
8078      for(y=0;y<256/32;y++)
8179          for(x=0;x<256/32;x++)
8280          {
83             drawgfx(   bitmap,
84                           screen->machine->gfx[1],
81             drawgfx_opaque(   bitmap,
82                           cliprect,
83                  screen->machine->gfx[1],
8584                           bgram[index]+256*(bgram[index+1]&0xf),
8685                  bgram[index+1]>>4,
8786                  0, 0,
88                  x*32,y*32,
89                  cliprect,
90                  TRANSPARENCY_NONE,0);
87                  x*32,y*32);
9188            index+=2;
9289          }
9390   }
r5077r5078
9794      for(y=0;y<32;y++)
9895          for(x=0;x<32;x++)
9996          {
100             drawgfx(   bitmap,
97             drawgfx_transpen(   bitmap,
98                  cliprect,
10199                  screen->machine->gfx[0],
102100                  videoram[(y*32+x)*2+1]+(videoram[(y*32+x)*2]&7)*256,
103101                  (videoram[(y*32+x)*2]>>3),
104102                  0, 0,
105                  x*8,y*8,
106                  cliprect,
107                  TRANSPARENCY_PEN,0);
103                  x*8,y*8,0);
108104          }
109105   }
110106
src/mame/drivers/sbrkout.c
r5077r5078
316316      int sx = 31 * 8 - videoram[0x380 + 0x10 + ball * 2];
317317      int sy = 30 * 8 - videoram[0x380 + 0x18 + ball * 2];
318318
319      drawgfx(bitmap, screen->machine->gfx[1], code, 0, 0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
319      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], code, 0, 0, 0, sx, sy, 0);
320320   }
321321   return 0;
322322}
src/mame/drivers/jackpool.c
r5077r5078
5454            int attr = (sc1_vram[count+0x800] & 0x1f00)>>8;
5555            //int t_pen = (sc1_vram[count+0x800] & 0x2000);
5656            //int colour = tile>>12;
57            drawgfx(bitmap,gfx,tile,attr,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
57            drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8);
5858
5959            count++;
6060         }
r5077r5078
8787            int attr = (sc2_vram[count+0x800] & 0x1f00)>>8;
8888            //int t_pen = (sc1_vram[count+0x800] & 0x2000);
8989            //int colour = tile>>12;
90            drawgfx(bitmap,gfx,tile,attr,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
90            drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8);
9191
9292            count++;
9393         }
src/mame/drivers/nmg5.c
r5077r5078
823823
824824      for (y = 0;y < height;y++)
825825      {
826         drawgfx(bitmap,machine->gfx[1],
826         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
827827               code + (flipy ? height-1 - y : y),
828828               color,
829829               flipx,flipy,
830               sx & 0x1ff,248 - ((sy + 0x10 * (height - y)) & 0x1ff),
831               cliprect,TRANSPARENCY_PEN,0);
830               sx & 0x1ff,248 - ((sy + 0x10 * (height - y)) & 0x1ff),0);
832831
833832         /* wrap around */
834         drawgfx(bitmap,machine->gfx[1],
833         drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
835834               code + (flipy ? height-1 - y : y),
836835               color,
837836               flipx,flipy,
838               (sx & 0x1ff) - 512,248 - ((sy + 0x10 * (height - y)) & 0x1ff),
839               cliprect,TRANSPARENCY_PEN,0);
837               (sx & 0x1ff) - 512,248 - ((sy + 0x10 * (height - y)) & 0x1ff),0);
840838      }
841839   }
842840}
src/mame/drivers/2mindril.c
r5077r5078
7171                { \
7272                   UINT16 data0=map[y*128+x*2]; \
7373                   UINT16 data1=map[y*128+x*2+1]; \
74                   drawgfx(bitmap,screen->machine->gfx[0], data1, \
74                   drawgfx_transpen(bitmap,\
75                     cliprect,screen->machine->gfx[0], data1, \
7576                      data0&0xff, \
7677                     data0&0x4000, data0&0x8000, \
77                     x*16-512/*+(((INT16)(unkram[0x60000/2+num]))/32)*/, y*16/*+(((INT16)(unkram[0x60008/2+num]))/32)*/, \
78                     cliprect,TRANSPARENCY_PEN,0); \
78                     x*16-512/*+(((INT16)(unkram[0x60000/2+num]))/32)*/, y*16/*+(((INT16)(unkram[0x60008/2+num]))/32)*/,0); \
7979                }   \
8080         }
8181
r5077r5078
9494      for(y=0;y<64;y++)
9595          for(x=0;x<64;x++)
9696          {
97             drawgfx(   bitmap,
97             drawgfx_transpen(   bitmap,
98                  cliprect,
9899                  screen->machine->gfx[1],
99100                  textram[y*64+x]&0xff, //1ff ??
100101                  ((textram[y*64+x]>>9)&0xf),
101102                  0, 0,
102                  x*8,y*8,
103                  cliprect,
104                  TRANSPARENCY_PEN,0);
103                  x*8,y*8,0);
105104          }
106105   }
107106   //printf("%.4X %.4X %.4X %.4X %.4X %.4X\n", unkram[0x60000/2],unkram[0x60000/2+1],unkram[0x60000/2+2],unkram[0x60000/2+3],unkram[0x60000/2+4],unkram[0x60000/2+5]);
src/mame/drivers/pzletime.c
r5077r5078
103103
104104         // is spriteram16[offs+0] & 0x200 flipy? it's always set
105105
106         drawgfx(bitmap,screen->machine->gfx[1],spr_offs,colour,0,1,sx,sy,cliprect,TRANSPARENCY_PEN,0);
106         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],spr_offs,colour,0,1,sx,sy,0);
107107      }
108108   }
109109
src/mame/drivers/darkhors.c
r5077r5078
130130      sy   =   -sy;
131131      sy   +=   0xf8;
132132
133      drawgfx(   bitmap,   machine->gfx[0],
133      drawgfx_transpen(   bitmap,   cliprect, machine->gfx[0],
134134               code/2,   color,
135               flipx,   flipy,   sx,   sy,
136               cliprect, TRANSPARENCY_PEN, 0);
135               flipx,   flipy,   sx,   sy, 0);
137136   }
138137}
139138
src/mame/drivers/mirax.c
r5077r5078
103103      y = 0x100 - spriteram[count];
104104      x = spriteram[count+3];
105105
106      drawgfx(bitmap,machine->gfx[1],spr_offs,color,fx,fy,x,y-16,cliprect,TRANSPARENCY_PEN,0);
106      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],spr_offs,color,fx,fy,x,y-16,0);
107107   }
108108}
109109
r5077r5078
122122         int x_scroll = (color & 0xff00)>>8;
123123         tile |= ((color & 0xe0)<<3);
124124
125         drawgfx(bitmap,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll,cliprect,TRANSPARENCY_NONE,0);
125         drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll);
126126         /* wrap-around */
127         drawgfx(bitmap,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll+256,cliprect,TRANSPARENCY_NONE,0);
127         drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll+256);
128128
129129         count++;
130130      }
r5077r5078
146146
147147         if(x <= 1 || x >= 30)
148148         {
149            drawgfx(bitmap,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll,cliprect,TRANSPARENCY_NONE,0);
149            drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll);
150150            /* wrap-around */
151            drawgfx(bitmap,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll+256,cliprect,TRANSPARENCY_NONE,0);
151            drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll+256);
152152         }
153153
154154         count++;
src/mame/drivers/dlair.c
r5077r5078
168168      for (x = 0; x < 32; x++)
169169      {
170170         UINT8 *base = &videoram[y * 64 + x * 2 + 1];
171         drawgfx(bitmap, screen->machine->gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y, cliprect, TRANSPARENCY_NONE, 0);
171         drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y);
172172      }
173173
174174   return 0;
src/mame/drivers/jollyjgr.c
r5077r5078
353353
354354      if (offs < 3*4)  sy++;
355355
356      drawgfx(bitmap,screen->machine->gfx[1],
356      drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
357357            code,color,
358358            flipx,flipy,
359            sx,sy,
360            cliprect,TRANSPARENCY_PEN,0);
359            sx,sy,0);
361360
362361   }
363362   return 0;
src/mame/drivers/klax.c
r5077r5078
55    driver by Aaron Giles
66
77    Games supported:
8        * Klax (1989) [4 sets]
8        * Klax (1989) [5 sets]
99
1010    Known bugs:
1111        * none at this time
r5077r5078
197197
198198ROM_START( klax )
199199   ROM_REGION( 0x40000, "maincpu", 0 )   /* 4*64k for 68000 code */
200   ROM_LOAD16_BYTE( "136075-6.006", 0x00000, 0x10000, CRC(e8991709) SHA1(90d69b0712e68e842a8b946539f1f43ef165e8de) )
201   ROM_LOAD16_BYTE( "136075-6.005", 0x00001, 0x10000, CRC(72b8c510) SHA1(f79d3a2de4deaabbcec632e8be9a1d5f6c0c3740) )
202   ROM_LOAD16_BYTE( "136075-6.008", 0x20000, 0x10000, CRC(c7c91a9d) SHA1(9f79ca689ec635f8113a74162e81f253c88992f5) )
203   ROM_LOAD16_BYTE( "136075-6.007", 0x20001, 0x10000, CRC(d2021a88) SHA1(0f8a0dcc3bb5ca433601b1abfc796c98791facf6) )
200   ROM_LOAD16_BYTE( "136075-6006.3n", 0x00000, 0x10000, CRC(e8991709) SHA1(90d69b0712e68e842a8b946539f1f43ef165e8de) )
201   ROM_LOAD16_BYTE( "136075-6005.1n", 0x00001, 0x10000, CRC(72b8c510) SHA1(f79d3a2de4deaabbcec632e8be9a1d5f6c0c3740) )
202   ROM_LOAD16_BYTE( "136075-6008.3k", 0x20000, 0x10000, CRC(c7c91a9d) SHA1(9f79ca689ec635f8113a74162e81f253c88992f5) )
203   ROM_LOAD16_BYTE( "136075-6007.1k", 0x20001, 0x10000, CRC(d2021a88) SHA1(0f8a0dcc3bb5ca433601b1abfc796c98791facf6) )
204204
205205   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
206   ROM_LOAD( "136075-2.010", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
207   ROM_LOAD( "136075-2.012", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
208   ROM_LOAD( "136075-2.009", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
209   ROM_LOAD( "136075-2.011", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
206   ROM_LOAD( "136075-2010.17x", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
207   ROM_LOAD( "136075-2012.12x", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
208   ROM_LOAD( "136075-2009.17u", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
209   ROM_LOAD( "136075-2011.12u", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
210210
211211   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
212   ROM_LOAD( "136075-2.014", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
213   ROM_LOAD( "136075-2.013", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
212   ROM_LOAD( "136075-2014.17y", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
213   ROM_LOAD( "136075-2013.17w", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
214214
215215   ROM_REGION( 0x20000, "oki", 0 )   /* ADPCM data */
216   ROM_LOAD( "136075-1.015", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
217   ROM_LOAD( "136075-1.016", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
216   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
217   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
218
219    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
220    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
221    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
222    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
223    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
224    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
218225ROM_END
219226
220227
221228ROM_START( klax2 )
222229   ROM_REGION( 0x40000, "maincpu", 0 )   /* 4*64k for 68000 code */
223   ROM_LOAD16_BYTE( "136075.006",   0x00000, 0x10000, CRC(05c98fc0) SHA1(84880d3d65c46c96c739063b3f61b1663989c56e) )
224   ROM_LOAD16_BYTE( "136075.005",   0x00001, 0x10000, CRC(d461e1ee) SHA1(73e8615a742555f74c1086c0b745afc7e94a478f) )
225   ROM_LOAD16_BYTE( "136075.008",   0x20000, 0x10000, CRC(f1b8e588) SHA1(080511f90aecb7526ab2107c196e73cb881a2bb5) )
226   ROM_LOAD16_BYTE( "136075.007",   0x20001, 0x10000, CRC(adbe33a8) SHA1(c6c4f9ea5224169dbf4dda1062954563ebab18d4) )
230   ROM_LOAD16_BYTE( "13607-5006.3n", 0x00000, 0x10000, CRC(05c98fc0) SHA1(84880d3d65c46c96c739063b3f61b1663989c56e) )
231   ROM_LOAD16_BYTE( "13607-5005.1n", 0x00001, 0x10000, CRC(d461e1ee) SHA1(73e8615a742555f74c1086c0b745afc7e94a478f) )
232   ROM_LOAD16_BYTE( "13607-5008.3k", 0x20000, 0x10000, CRC(f1b8e588) SHA1(080511f90aecb7526ab2107c196e73cb881a2bb5) )
233   ROM_LOAD16_BYTE( "13607-5007.1k", 0x20001, 0x10000, CRC(adbe33a8) SHA1(c6c4f9ea5224169dbf4dda1062954563ebab18d4) )
227234
228235   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
229   ROM_LOAD( "136075-2.010", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
230   ROM_LOAD( "136075-2.012", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
231   ROM_LOAD( "136075-2.009", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
232   ROM_LOAD( "136075-2.011", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
236   ROM_LOAD( "136075-2010.17x", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
237   ROM_LOAD( "136075-2012.12x", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
238   ROM_LOAD( "136075-2009.17u", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
239   ROM_LOAD( "136075-2011.12u", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
233240
234241   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
235   ROM_LOAD( "136075-2.014", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
236   ROM_LOAD( "136075-2.013", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
242   ROM_LOAD( "136075-2014.17y", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
243   ROM_LOAD( "136075-2013.17w", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
237244
238245   ROM_REGION( 0x20000, "oki", 0 )   /* ADPCM data */
239   ROM_LOAD( "136075-1.015", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
240   ROM_LOAD( "136075-1.016", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
246   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
247   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
248
249    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
250    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
251    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
252    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
253    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
254    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
241255ROM_END
242256
243257
244258ROM_START( klax3 )
245259   ROM_REGION( 0x40000, "maincpu", 0 )   /* 4*64k for 68000 code */
246   ROM_LOAD16_BYTE( "136075-5006", 0x00000, 0x10000, CRC(65eb9a31) SHA1(3f47d58fe9eb154ab14ac282919f92679b5c7922) )
247   ROM_LOAD16_BYTE( "136075-5005", 0x00001, 0x10000, CRC(7be27349) SHA1(79eef2b7f4a0fb6991d81f6543d5ae00de9f2452) )
248   ROM_LOAD16_BYTE( "136075-4008", 0x20000, 0x10000, CRC(f3c79106) SHA1(c315159020d5bc6f919c3fb975fb8b228584f88c) )
249   ROM_LOAD16_BYTE( "136075-4007", 0x20001, 0x10000, CRC(a23cde5d) SHA1(51afadc900524d73ff7906b003fdf801f5d1f1fd) )
260   ROM_LOAD16_BYTE( "136075-5006.3n", 0x00000, 0x10000, CRC(65eb9a31) SHA1(3f47d58fe9eb154ab14ac282919f92679b5c7922) )
261   ROM_LOAD16_BYTE( "136075-5005.1n", 0x00001, 0x10000, CRC(7be27349) SHA1(79eef2b7f4a0fb6991d81f6543d5ae00de9f2452) )
262   ROM_LOAD16_BYTE( "136075-4008.3k", 0x20000, 0x10000, CRC(f3c79106) SHA1(c315159020d5bc6f919c3fb975fb8b228584f88c) )
263   ROM_LOAD16_BYTE( "136075-4007.1k", 0x20001, 0x10000, CRC(a23cde5d) SHA1(51afadc900524d73ff7906b003fdf801f5d1f1fd) )
250264
251265   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
252   ROM_LOAD( "136075-2.010", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
253   ROM_LOAD( "136075-2.012", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
254   ROM_LOAD( "136075-2.009", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
255   ROM_LOAD( "136075-2.011", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
266   ROM_LOAD( "136075-2010.17x", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
267   ROM_LOAD( "136075-2012.12x", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
268   ROM_LOAD( "136075-2009.17u", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
269   ROM_LOAD( "136075-2011.12u", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
256270
257271   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
258   ROM_LOAD( "136075-2.014", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
259   ROM_LOAD( "136075-2.013", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
272   ROM_LOAD( "136075-2014.17y", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
273   ROM_LOAD( "136075-2013.17w", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
260274
261275   ROM_REGION( 0x20000, "oki", 0 )   /* ADPCM data */
262   ROM_LOAD( "136075-1.015", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
263   ROM_LOAD( "136075-1.016", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
276   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
277   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
278
279    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
280    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
281    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
282    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
283    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
284    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
264285ROM_END
265286
266287
267288ROM_START( klaxj )
268289   ROM_REGION( 0x40000, "maincpu", 0 )   /* 4*64k for 68000 code */
269   ROM_LOAD16_BYTE( "136075-3.406", 0x00000, 0x10000, CRC(ab2aa50b) SHA1(0ebffc8b4724eb8c4423e0b1f62b0fff7cc30aab) )
270   ROM_LOAD16_BYTE( "136075-3.405", 0x00001, 0x10000, CRC(9dc9a590) SHA1(4c77b1ad9c083325f33520f2b6aa598dde247ad8) )
271   ROM_LOAD16_BYTE( "136075-2.408", 0x20000, 0x10000, CRC(89d515ce) SHA1(4991b859a53f34776671f660dbdb18a746259549) )
272   ROM_LOAD16_BYTE( "136075-2.407", 0x20001, 0x10000, CRC(48ce4edb) SHA1(014f879298408295a338c19c2d518524b41491cb) )
290   ROM_LOAD16_BYTE( "136075-3406.3n", 0x00000, 0x10000, CRC(ab2aa50b) SHA1(0ebffc8b4724eb8c4423e0b1f62b0fff7cc30aab) )
291   ROM_LOAD16_BYTE( "136075-3405.1n", 0x00001, 0x10000, CRC(9dc9a590) SHA1(4c77b1ad9c083325f33520f2b6aa598dde247ad8) )
292   ROM_LOAD16_BYTE( "136075-2408.3k", 0x20000, 0x10000, CRC(89d515ce) SHA1(4991b859a53f34776671f660dbdb18a746259549) )
293   ROM_LOAD16_BYTE( "136075-2407.1k", 0x20001, 0x10000, CRC(48ce4edb) SHA1(014f879298408295a338c19c2d518524b41491cb) )
273294
274295   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
275   ROM_LOAD( "136075-2.010", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
276   ROM_LOAD( "136075-2.012", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
277   ROM_LOAD( "136075-2.009", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
278   ROM_LOAD( "136075-2.011", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
296   ROM_LOAD( "136075-2010.17x", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
297   ROM_LOAD( "136075-2012.12x", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
298   ROM_LOAD( "136075-2009.17u", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
299   ROM_LOAD( "136075-2011.12u", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
279300
280301   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
281   ROM_LOAD( "136075-2.014", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
282   ROM_LOAD( "136075-2.013", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
302   ROM_LOAD( "136075-2014.17y", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
303   ROM_LOAD( "136075-2013.17w", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
283304
284305   ROM_REGION( 0x20000, "oki", 0 )   /* ADPCM data */
285   ROM_LOAD( "136075-1.015", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
286   ROM_LOAD( "136075-1.016", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
306   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
307   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
308
309    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
310    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
311    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
312    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
313    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
314    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
287315ROM_END
288316
289317
290318ROM_START( klaxd )
291319   ROM_REGION( 0x40000, "maincpu", 0 )   /* 4*64k for 68000 code */
292   ROM_LOAD16_BYTE( "2206.bin",     0x00000, 0x10000, CRC(9d1a713b) SHA1(6e60a43934bd8959c5c07dd12e087c63ea791bb9) )
293   ROM_LOAD16_BYTE( "1205.bin",     0x00001, 0x10000, CRC(45065a5a) SHA1(77339ca04e54a04489ce9d6e11816475e57d1311) )
294   ROM_LOAD16_BYTE( "1208.bin",     0x20000, 0x10000, CRC(b4019b32) SHA1(83fba82a9100af14cddd812be9f3dbd58d8511d2) )
295   ROM_LOAD16_BYTE( "1207.bin",     0x20001, 0x10000, CRC(14550a75) SHA1(35599a339e6978682a09db4fb78c76bb3d3b6bc7) )
320   ROM_LOAD16_BYTE( "136075-2206.3n", 0x00000, 0x10000, CRC(9d1a713b) SHA1(6e60a43934bd8959c5c07dd12e087c63ea791bb9) )
321   ROM_LOAD16_BYTE( "136075-1205.1n", 0x00001, 0x10000, CRC(45065a5a) SHA1(77339ca04e54a04489ce9d6e11816475e57d1311) )
322   ROM_LOAD16_BYTE( "136075-1208.3k", 0x20000, 0x10000, CRC(b4019b32) SHA1(83fba82a9100af14cddd812be9f3dbd58d8511d2) )
323   ROM_LOAD16_BYTE( "136075-1207.1k", 0x20001, 0x10000, CRC(14550a75) SHA1(35599a339e6978682a09db4fb78c76bb3d3b6bc7) )
296324
297325   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
298   ROM_LOAD( "136075-2.010", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
299   ROM_LOAD( "136075-2.012", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
300   ROM_LOAD( "136075-2.009", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
301   ROM_LOAD( "136075-2.011", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
326   ROM_LOAD( "136075-2010.17x", 0x00000, 0x10000, CRC(15290a0d) SHA1(e1338f3fb298aae19735548f4b597d1c33944960) )
327   ROM_LOAD( "136075-2012.12x", 0x10000, 0x10000, CRC(c0d9eb0f) SHA1(aa68b9ad435eeaa8b43693e237cc7f9a53d94dfc) )
328   ROM_LOAD( "136075-2009.17u", 0x20000, 0x10000, CRC(6368dbaf) SHA1(fa8b5cf6777108c0b1e38a3650ee4cdb2ec76810) )
329   ROM_LOAD( "136075-2011.12u", 0x30000, 0x10000, CRC(e83cca91) SHA1(45f1155d51ab3e2cc08aad1ec4e557d132085cc6) )
302330
303331   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
304   ROM_LOAD( "136075-2.014", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
305   ROM_LOAD( "136075-2.013", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
332   ROM_LOAD( "136075-2014.17y", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) )
333   ROM_LOAD( "136075-2013.17w", 0x10000, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) )
306334
307335   ROM_REGION( 0x20000, "oki", 0 )   /* ADPCM data */
308   ROM_LOAD( "136075-1.015", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
309   ROM_LOAD( "136075-1.016", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
336   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
337   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
338
339    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
340    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
341    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
342    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
343    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
344    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
310345ROM_END
311346
312347
src/mame/drivers/ddayjlc.c
r5077r5078
360360
361361      code=(code&0x7f)|((flags&0x30)<<3);
362362
363      drawgfx(bitmap, screen->machine->gfx[0], code, 1, xflip, yflip, x, y, cliprect, TRANSPARENCY_PEN, 0);
363      drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], code, 1, xflip, yflip, x, y, 0);
364364   }
365365
366366   {
r5077r5078
370370         {
371371            c=videoram[y*32+x];
372372            if(x>1&&x<30)
373               drawgfx(bitmap, screen->machine->gfx[1], c+char_bank*0x100, 1, 0, 0, x*8, y*8, cliprect, TRANSPARENCY_PEN, 0);
373               drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], c+char_bank*0x100, 1, 0, 0, x*8, y*8, 0);
374374            else
375               drawgfx(bitmap, screen->machine->gfx[1], c+char_bank*0x100, 1, 0, 0, x*8, y*8, cliprect, TRANSPARENCY_NONE, 0);
375               drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1], c+char_bank*0x100, 1, 0, 0, x*8, y*8);
376376      }
377377   }
378378   return 0;
src/mame/drivers/egghunt.c
r5077r5078
8484         sx = 496 - sx;
8585         sy = 240 - sy;
8686      }
87      drawgfx(bitmap,machine->gfx[1],
87      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
8888             code,
8989             color,
9090             flipscreen,flipscreen,
91             sx,sy,
92             cliprect,TRANSPARENCY_PEN,15);
91             sx,sy,15);
9392   }
9493}
9594
src/mame/drivers/gpworld.c
r5077r5078
7171      {
7272         int current_screen_character = (characterY*64) + characterX;
7373
74         drawgfx(bitmap, machine->gfx[0], tile_RAM[current_screen_character],
75               characterY, 0, 0, characterX*8, characterY*8, cliprect, TRANSPARENCY_PEN, 0);
74         drawgfx_transpen(bitmap, cliprect, machine->gfx[0], tile_RAM[current_screen_character],
75               characterY, 0, 0, characterX*8, characterY*8, 0);
7676      }
7777   }
7878}
src/mame/drivers/gaelco2.c
r5077r5078
1515    Touch & Go     | 1995 | GAE1 501  | 950510-1 | DS5002FP
1616    Maniac Square  | 1996 | Unknown   | ???      | DS5002FP, but unprotected version available
1717    Snow Board     | 1996 | CG-1V 366 | 960419/1 | Lattice IspLSI 1016-80LJ
18    Bang!          | 1998 | CG-1V 388 | ???      | No
18    Bang!          | 1998 | CG-1V 388 | 980921/1 | No
1919
2020***************************************************************************/
2121
r5077r5078
309309MACHINE_DRIVER_END
310310
311311
312/*
313PCB Layout:
314
315REF: 980921/1
316+--------------------------------------------------------------------+
317|                                                                    | Plug-In Daughterboard:
318|                      TDA1543          KM428C256TR (x2)             | +--------------------------+
319|              POT1                                         IC43*  +-| |                          |
320+--+                                                               | | | IC1     IC9     IC16   +-|
321   |                                                        IC44*  |J| | IC2     IC10    IC17   | |
322   |                               +----------+                    |P| | IC3     IC11    IC18   |J| JP1 - 50 pin (dual in-line) header
323+--+                               |          |             IC45*  |1| | IC4*    IC12*   IC19*  |P| * Denotes unpopulated sockets
324|                                  |  CG-1V   |                    |0| | IC5     IC13    IC20   |1| All roms are 27C040 type
325|                     CY7C199      |   388    |             IC46*  | | | IC6*    IC14    IC21   | |
326|                     CY7C199      |          |                    | | |                        +-|
327| J                                +----------+             IC47*  +-| | 74LS139N   74LS373N x3   |
328| A                                                                  | +--------------------------+
329| M                                                                  |
330| M                                                                  |
331| A                                                                  |
332|                         30.000MHz                         CY7C199  |
333|        93C66N           30.000MHz       +---------+       CY7C199  |
334|                                         | Lattice |       CY7C199  |
335+--+                                      | IspLSI  |                |
336   |                                      |  1016E  |      IC53      |
337   |  J J                                 +---------+                |
338+--+  P P                               +-----------+       CY7C199  |
339|     2 3                               |           |                |
340|                                       | MC68HC000 |      IC55      |
341|                                       |   FN16    |                |
342|                                       +-----------+                |
343+--------------------------------------------------------------------+
344
345   CPU: MC68HC000FN16
346Custom: CG-1V 388 (System chip, Graphics & Sound)
347   OSC: 30.000MHz (x2)
348EEPROM: 93C66N
349
350RAM: CY7C199-15PC (IC12, IC13, IC50, IC51, IC52 & IC54)
351     KM428C256TR-7 (IC32 & IC33)
352
353* IC42 through IC47 unpopulated
354
355JP10 - 50 pin (dual in-line) header for Plug-In Daughterboard
356JP2  - 4 pin light gun header (player 1)
357JP3  - 4 pin light gun header (player 2)
358
359*/
360
312361ROM_START( bang )
313362   ROM_REGION( 0x100000, "maincpu", 0 )   /* 68000 code */
314   ROM_LOAD16_BYTE( "bang.u53",   0x000000, 0x080000, CRC(014bb939) SHA1(bb245acf7a3bd4a56b3559518bcb8d0ae39dbaf4) )
315   ROM_LOAD16_BYTE( "bang.u55",   0x000001, 0x080000, CRC(582f8b1e) SHA1(c9b0d4c1dee71cdb2c01d49f20ffde32eddc9583) )
363   ROM_LOAD16_BYTE( "bang53.ic53",   0x000000, 0x080000, CRC(014bb939) SHA1(bb245acf7a3bd4a56b3559518bcb8d0ae39dbaf4) )
364   ROM_LOAD16_BYTE( "bang55.ic55",   0x000001, 0x080000, CRC(582f8b1e) SHA1(c9b0d4c1dee71cdb2c01d49f20ffde32eddc9583) )
316365
317366   ROM_REGION( 0x0a00000, "gfx1", 0 ) /* GFX + Sound */
318   ROM_LOAD( "bang.u16",   0x0000000, 0x0080000, CRC(6ee4b878) SHA1(f646380d95650a60b5a17973bdfd3b80450a4d3b) )   /* GFX only */
319   ROM_LOAD( "bang.u17",   0x0080000, 0x0080000, CRC(0c35aa6f) SHA1(df0474b1b9466d3c199e5aade39b7233f0cb45ee) )   /* GFX only */
320   ROM_LOAD( "bang.u18",   0x0100000, 0x0080000, CRC(2056b1ad) SHA1(b796f92eef4bbb0efa12c53580e429b8a0aa394c) )   /* Sound only */
321   ROM_FILL(            0x0180000, 0x0080000, 0x0 )         /* Empty */
322   ROM_LOAD( "bang.u9",   0x0200000, 0x0080000, CRC(078195dc) SHA1(362ff194e2579346dfc7af88559b0718bc36ec8a) )   /* GFX only */
323   ROM_LOAD( "bang.u10",   0x0280000, 0x0080000, CRC(06711eeb) SHA1(3662ffe730fb54ee48925de9765f88be1abd5e4e) )   /* GFX only */
324   ROM_LOAD( "bang.u11",   0x0300000, 0x0080000, CRC(2088d15c) SHA1(0c043ab9fd33836fa4b7ad60fd8e7cb96ffb6121) )   /* Sound only */
325   ROM_FILL(            0x0380000, 0x0080000, 0x0 )         /* Empty */
326   ROM_LOAD( "bang.u1",   0x0400000, 0x0080000, CRC(e7b97b0f) SHA1(b5503687ae3ca0a0faa4b867a267d89dac788d6d) )   /* GFX only */
327   ROM_LOAD( "bang.u2",   0x0480000, 0x0080000, CRC(ff297a8f) SHA1(28819a9d7b3cb177e7a7db3fe23a94f5cba33049) )   /* GFX only */
328   ROM_LOAD( "bang.u3",   0x0500000, 0x0080000, CRC(d3da5d4f) SHA1(b9bea0b4d20ab0bfda3fac2bb1fab974c007aaf0) )   /* Sound only */
329   ROM_FILL(            0x0580000, 0x0080000, 0x0 )         /* Empty */
330   ROM_LOAD( "bang.u20",   0x0600000, 0x0080000, CRC(a1145df8) SHA1(305cda041a6f201cb011982f1bf1fc6a4153a669) )   /* GFX only */
331   ROM_LOAD( "bang.u13",   0x0680000, 0x0080000, CRC(fe3e8d07) SHA1(7a37561b1cf422b47cddb8751a6b6d57dec8baae) )   /* GFX only */
332   ROM_LOAD( "bang.u5",   0x0700000, 0x0080000, CRC(9bee444c) SHA1(aebaa3306e7e5aada99ed469da9bf64507808cff) )   /* Sound only */
333   ROM_FILL(            0x0780000, 0x0080000, 0x0 )         /* Empty */
334   ROM_LOAD( "bang.u21",   0x0800000, 0x0080000, CRC(fd93d7f2) SHA1(ff9d8eb5ac8d9757132aa6d79d2f7662c14cd650) )   /* GFX only */
335   ROM_LOAD( "bang.u14",   0x0880000, 0x0080000, CRC(858fcbf9) SHA1(1e67431c8775666f4839bdc427fabf59ffc708c0) )   /* GFX only */
336   ROM_FILL(            0x0900000, 0x0100000, 0x0 )         /* Empty */
367   ROM_LOAD( "bang16.ic16", 0x0000000, 0x0080000, CRC(6ee4b878) SHA1(f646380d95650a60b5a17973bdfd3b80450a4d3b) )   /* GFX only */
368   ROM_LOAD( "bang17.ic17", 0x0080000, 0x0080000, CRC(0c35aa6f) SHA1(df0474b1b9466d3c199e5aade39b7233f0cb45ee) )   /* GFX only */
369   ROM_LOAD( "bang18.ic18", 0x0100000, 0x0080000, CRC(2056b1ad) SHA1(b796f92eef4bbb0efa12c53580e429b8a0aa394c) )   /* Sound only */
370   ROM_FILL(                0x0180000, 0x0080000, 0x0 )         /* Empty */
371   ROM_LOAD( "bang9.ic9",   0x0200000, 0x0080000, CRC(078195dc) SHA1(362ff194e2579346dfc7af88559b0718bc36ec8a) )   /* GFX only */
372   ROM_LOAD( "bang10.ic10", 0x0280000, 0x0080000, CRC(06711eeb) SHA1(3662ffe730fb54ee48925de9765f88be1abd5e4e) )   /* GFX only */
373   ROM_LOAD( "bang11.ic11", 0x0300000, 0x0080000, CRC(2088d15c) SHA1(0c043ab9fd33836fa4b7ad60fd8e7cb96ffb6121) )   /* Sound only */
374   ROM_FILL(                0x0380000, 0x0080000, 0x0 )         /* Empty */
375   ROM_LOAD( "bang1.ic1",   0x0400000, 0x0080000, CRC(e7b97b0f) SHA1(b5503687ae3ca0a0faa4b867a267d89dac788d6d) )   /* GFX only */
376   ROM_LOAD( "bang2.ic2",   0x0480000, 0x0080000, CRC(ff297a8f) SHA1(28819a9d7b3cb177e7a7db3fe23a94f5cba33049) )   /* GFX only */
377   ROM_LOAD( "bang3.ic3",    0x0500000, 0x0080000, CRC(d3da5d4f) SHA1(b9bea0b4d20ab0bfda3fac2bb1fab974c007aaf0) )   /* Sound only */
378   ROM_FILL(                0x0580000, 0x0080000, 0x0 )         /* Empty */
379   ROM_LOAD( "bang20.ic20", 0x0600000, 0x0080000, CRC(a1145df8) SHA1(305cda041a6f201cb011982f1bf1fc6a4153a669) )   /* GFX only */
380   ROM_LOAD( "bang13.ic13", 0x0680000, 0x0080000, CRC(fe3e8d07) SHA1(7a37561b1cf422b47cddb8751a6b6d57dec8baae) )   /* GFX only */
381   ROM_LOAD( "bang5.ic5",   0x0700000, 0x0080000, CRC(9bee444c) SHA1(aebaa3306e7e5aada99ed469da9bf64507808cff) )   /* Sound only */
382   ROM_FILL(                0x0780000, 0x0080000, 0x0 )         /* Empty */
383   ROM_LOAD( "bang21.ic21", 0x0800000, 0x0080000, CRC(fd93d7f2) SHA1(ff9d8eb5ac8d9757132aa6d79d2f7662c14cd650) )   /* GFX only */
384   ROM_LOAD( "bang14.ic14", 0x0880000, 0x0080000, CRC(858fcbf9) SHA1(1e67431c8775666f4839bdc427fabf59ffc708c0) )   /* GFX only */
385   ROM_FILL(                0x0900000, 0x0100000, 0x0 )         /* Empty */
337386ROM_END
338387
339388
340389
341390ROM_START( bangj )
342391   ROM_REGION( 0x100000, "maincpu", 0 )   /* 68000 code */
343   ROM_LOAD16_BYTE( "bang-a.u53",   0x000000, 0x080000, CRC(5ee514e9) SHA1(b78b507d18de41be58049f5c597acd107ec1273f) )
344   ROM_LOAD16_BYTE( "bang-a.u55",   0x000001, 0x080000, CRC(b90223ab) SHA1(7c097754a710169f41c574c3cc1a6346824853c4) )
392   ROM_LOAD16_BYTE( "bang-a.ic53",   0x000000, 0x080000, CRC(5ee514e9) SHA1(b78b507d18de41be58049f5c597acd107ec1273f) )
393   ROM_LOAD16_BYTE( "bang-a.ic55",   0x000001, 0x080000, CRC(b90223ab) SHA1(7c097754a710169f41c574c3cc1a6346824853c4) )
345394
346395   ROM_REGION( 0x0a00000, "gfx1", 0 ) /* GFX + Sound */
347   ROM_LOAD( "bang-a.u16",   0x0000000, 0x0080000, CRC(3b63acfc) SHA1(48f5598cdbc70f342d6b75909166571271920a8f) )   /* GFX only */
348   ROM_LOAD( "bang-a.u17",   0x0080000, 0x0080000, CRC(72865b80) SHA1(ec7753ea7961015149b9e6386fdeb9bd59aa962a) )   /* GFX only */
349   ROM_LOAD( "bang.u18",   0x0100000, 0x0080000, CRC(2056b1ad) SHA1(b796f92eef4bbb0efa12c53580e429b8a0aa394c) )   /* Sound only */
350   ROM_FILL(            0x0180000, 0x0080000, 0x0 )         /* Empty */
351   ROM_LOAD( "bang-a.u9",   0x0200000, 0x0080000, CRC(3cb86360) SHA1(c803b3add253a552a1554714218740bdfca91764) )   /* GFX only */
352   ROM_LOAD( "bang-a.u10",   0x0280000, 0x0080000, CRC(03fdd777) SHA1(9eec194239f93d961ee9902a585c872dcdc7728f) )   /* GFX only */
353   ROM_LOAD( "bang.u11",   0x0300000, 0x0080000, CRC(2088d15c) SHA1(0c043ab9fd33836fa4b7ad60fd8e7cb96ffb6121) )   /* Sound only */
354   ROM_FILL(            0x0380000, 0x0080000, 0x0 )         /* Empty */
355   ROM_LOAD( "bang-a.u1",   0x0400000, 0x0080000, CRC(965d0ad9) SHA1(eff521735129b7dd9366855c6312ed568950233c) )   /* GFX only */
356   ROM_LOAD( "bang-a.u2",   0x0480000, 0x0080000, CRC(8ea261a7) SHA1(50b59cf058ca03c0b8c888f6ddb40c720a210ece) )   /* GFX only */
357   ROM_LOAD( "bang.u3",   0x0500000, 0x0080000, CRC(d3da5d4f) SHA1(b9bea0b4d20ab0bfda3fac2bb1fab974c007aaf0) )   /* Sound only */
358   ROM_FILL(            0x0580000, 0x0080000, 0x0 )         /* Empty */
359   ROM_LOAD( "bang-a.u20",   0x0600000, 0x0080000, CRC(4b828f3c) SHA1(5227a89c05c659a85d33f092c6778ce9d57a0236) )   /* GFX only */
360   ROM_LOAD( "bang-a.u13",   0x0680000, 0x0080000, CRC(d1146b92) SHA1(2b28d49fbffea6c038160fdab177bc0045195ca8) )   /* GFX only */
361   ROM_LOAD( "bang.u5",   0x0700000, 0x0080000, CRC(9bee444c) SHA1(aebaa3306e7e5aada99ed469da9bf64507808cff) )   /* Sound only */
362   ROM_FILL(            0x0780000, 0x0080000, 0x0 )         /* Empty */
363   ROM_LOAD( "bang-a.u21",   0x0800000, 0x0080000, CRC(531ce3b6) SHA1(196bb720591acc082f815b609a7cf1609510c8c1) )   /* GFX only */
364   ROM_LOAD( "bang-a.u14",   0x0880000, 0x0080000, CRC(f8e1cf84) SHA1(559c08584094e605635c5ef3a25534ea0bcfa199) )   /* GFX only */
365   ROM_FILL(            0x0900000, 0x0100000, 0x0 )         /* Empty */
396   ROM_LOAD( "bang-a.ic16", 0x0000000, 0x0080000, CRC(3b63acfc) SHA1(48f5598cdbc70f342d6b75909166571271920a8f) )   /* GFX only */
397   ROM_LOAD( "bang-a.ic17", 0x0080000, 0x0080000, CRC(72865b80) SHA1(ec7753ea7961015149b9e6386fdeb9bd59aa962a) )   /* GFX only */
398   ROM_LOAD( "bang18.ic18", 0x0100000, 0x0080000, CRC(2056b1ad) SHA1(b796f92eef4bbb0efa12c53580e429b8a0aa394c) )   /* Sound only */
399   ROM_FILL(                0x0180000, 0x0080000, 0x0 )         /* Empty */
400   ROM_LOAD( "bang-a.ic9",  0x0200000, 0x0080000, CRC(3cb86360) SHA1(c803b3add253a552a1554714218740bdfca91764) )   /* GFX only */
401   ROM_LOAD( "bang-a.ic10", 0x0280000, 0x0080000, CRC(03fdd777) SHA1(9eec194239f93d961ee9902a585c872dcdc7728f) )   /* GFX only */
402   ROM_LOAD( "bang11.ic11", 0x0300000, 0x0080000, CRC(2088d15c) SHA1(0c043ab9fd33836fa4b7ad60fd8e7cb96ffb6121) )   /* Sound only */
403   ROM_FILL(                0x0380000, 0x0080000, 0x0 )         /* Empty */
404   ROM_LOAD( "bang-a.ic1",  0x0400000, 0x0080000, CRC(965d0ad9) SHA1(eff521735129b7dd9366855c6312ed568950233c) )   /* GFX only */
405   ROM_LOAD( "bang-a.ic2",  0x0480000, 0x0080000, CRC(8ea261a7) SHA1(50b59cf058ca03c0b8c888f6ddb40c720a210ece) )   /* GFX only */
406   ROM_LOAD( "bang3.ic3",    0x0500000, 0x0080000, CRC(d3da5d4f) SHA1(b9bea0b4d20ab0bfda3fac2bb1fab974c007aaf0) )   /* Sound only */
407   ROM_FILL(                0x0580000, 0x0080000, 0x0 )         /* Empty */
408   ROM_LOAD( "bang-a.ic20", 0x0600000, 0x0080000, CRC(4b828f3c) SHA1(5227a89c05c659a85d33f092c6778ce9d57a0236) )   /* GFX only */
409   ROM_LOAD( "bang-a.ic13", 0x0680000, 0x0080000, CRC(d1146b92) SHA1(2b28d49fbffea6c038160fdab177bc0045195ca8) )   /* GFX only */
410   ROM_LOAD( "bang5.ic5",   0x0700000, 0x0080000, CRC(9bee444c) SHA1(aebaa3306e7e5aada99ed469da9bf64507808cff) )   /* Sound only */
411   ROM_FILL(                0x0780000, 0x0080000, 0x0 )         /* Empty */
412   ROM_LOAD( "bang-a.ic21", 0x0800000, 0x0080000, CRC(531ce3b6) SHA1(196bb720591acc082f815b609a7cf1609510c8c1) )   /* GFX only */
413   ROM_LOAD( "bang-a.ic14", 0x0880000, 0x0080000, CRC(f8e1cf84) SHA1(559c08584094e605635c5ef3a25534ea0bcfa199) )   /* GFX only */
414   ROM_FILL(                0x0900000, 0x0100000, 0x0 )         /* Empty */
366415ROM_END
367416
368417
r5077r5078
9521001   |         SW1                                                   IC43      |
9531002   |                   34.000MHz          |----------|                       |
9541003|---        93C66                         |          |             IC44      |
955|                                         | GC-1V    |                       |
1004|                                         | CG-1V   |                       |
9561005| J                            6264       |   366    |             IC45      |
9571006|                              6264       |          |                       |
9581007| A                                       |----------|             IC46      |
r5077r5078
9651014|                                            |----------|                    |
9661015|                                30.000MHz   | Lattice  |                    |
9671016|---                                         | IspLSI   |                    |
968   |                                         |   1016   |          SB55      |
1017   |                                         |   1016   |          SB53      |
9691018   |                                         |----------|                    |
9701019|---                                        |------------|           62256   |
9711020|                                           |            |                   |
972|                                           |  MC68HC000 |         SB53      |
1021|                                           |  MC68HC000 |         SB55      |
9731022|                                           |    FN16    |                   |
9741023|                                           |------------|                   |
9751024-----------------------------------------------------------------------------|
src/mame/drivers/cball.c
r5077r5078
4141
4242   /* draw sprite */
4343
44   drawgfx(bitmap, screen->machine->gfx[1],
44   drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
4545      cball_video_ram[0x399] >> 4,
4646      0,
4747      0, 0,
4848      240 - cball_video_ram[0x390],
49      240 - cball_video_ram[0x398],
50      cliprect, TRANSPARENCY_PEN, 0);
49      240 - cball_video_ram[0x398], 0);
5150   return 0;
5251}
5352
src/mame/drivers/bigfghtr.c
r5077r5078
230230
231231      if (((buffered_spriteram16[offs+0] & 0x3000) >> 12) == priority)
232232      {
233         drawgfx(bitmap,machine->gfx[3],
233         drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
234234            code & 0xfff,
235235            color,
236236             flipx,flipy,
237            sx,sy,
238            cliprect,TRANSPARENCY_PEN,15);
237            sx,sy,15);
239238      }
240239   }
241240}
src/mame/drivers/rabbit.c
r5077r5078
244244
245245      if(xpos&0x800)xpos-=0x1000;
246246
247      drawgfx(rabbit_sprite_bitmap,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0x20-8/*-(rabbit_spriteregs[0]&0x00000fff)*/,ypos-24/*-((rabbit_spriteregs[1]&0x0fff0000)>>16)*/,&rabbit_sprite_clip,TRANSPARENCY_PEN,0);
248//      drawgfx(bitmap,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0xa0-8/*-(rabbit_spriteregs[0]&0x00000fff)*/,ypos-24+0x80/*-((rabbit_spriteregs[1]&0x0fff0000)>>16)*/,cliprect,TRANSPARENCY_PEN,0);
247      drawgfx_transpen(rabbit_sprite_bitmap,&rabbit_sprite_clip,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0x20-8/*-(rabbit_spriteregs[0]&0x00000fff)*/,ypos-24/*-((rabbit_spriteregs[1]&0x0fff0000)>>16)*/,0);
248//      drawgfx_transpen(bitmap,cliprect,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0xa0-8/*-(rabbit_spriteregs[0]&0x00000fff)*/,ypos-24+0x80/*-((rabbit_spriteregs[1]&0x0fff0000)>>16)*/,0);
249249
250250
251251      source-=2;
src/mame/drivers/nmk16.c
r5077r5078
57415741
57425742ROM_START( hachamf )
57435743   ROM_REGION( 0x40000, "maincpu", 0 )      /* 68000 code */
5744   ROM_LOAD16_BYTE( "hmf_07.rom",  0x00000, 0x20000, CRC(9d847c31) SHA1(1d370d8db9cadadb9c2cb213e32f681947d81b7f) )
5745   ROM_LOAD16_BYTE( "hmf_06.rom",  0x00001, 0x20000, CRC(de6408a0) SHA1(2df77fecd44d2d8b0444abd4545923213ed76b2d) )
5744   ROM_LOAD16_BYTE( "7.93",  0x00000, 0x20000, CRC(9d847c31) SHA1(1d370d8db9cadadb9c2cb213e32f681947d81b7f) )
5745   ROM_LOAD16_BYTE( "6.94",  0x00001, 0x20000, CRC(de6408a0) SHA1(2df77fecd44d2d8b0444abd4545923213ed76b2d) )
57465746
57475747   ROM_REGION( 0x10000, "audiocpu", 0 )      /* unknown  - sound cpu ?????? */
5748   ROM_LOAD( "hmf_01.rom",  0x00000, 0x10000, CRC(9e6f48fc) SHA1(aeb5bfecc025b5478f6de874792fc0f7f54932be) )
5748   ROM_LOAD( "1.70",  0x00000, 0x10000, CRC(9e6f48fc) SHA1(aeb5bfecc025b5478f6de874792fc0f7f54932be) )
57495749
57505750   ROM_REGION( 0x020000, "gfx1", ROMREGION_DISPOSE )
5751   ROM_LOAD( "hmf_05.rom",  0x000000, 0x020000, CRC(29fb04a2) SHA1(9654b90a66d0e2a0f9cd369cab29cdd0c6f77869) )   /* 8x8 tiles */
5751   ROM_LOAD( "5.95",  0x000000, 0x020000, CRC(29fb04a2) SHA1(9654b90a66d0e2a0f9cd369cab29cdd0c6f77869) )   /* 8x8 tiles */
57525752
57535753   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE ) /* 16x16 tiles */
5754   // the first half of this rom is missing, the game uses 2 banks, most of the graphics needed aren't present
5755   ROM_LOAD( "hmf_04.rom",  0x080000, 0x080000, BAD_DUMP CRC(05a624e3) SHA1(e1b686b36c0adedfddf70eeb6411671bbcd897d8) )
5754   ROM_LOAD( "91076-4.101",  0x000000, 0x100000, CRC(df9653a4) SHA1(4a3204a98d7738c7895169fcece922fdf355f4fa) )
57565755
57575756   ROM_REGION( 0x100000, "gfx3", ROMREGION_DISPOSE )
5758   ROM_LOAD16_WORD_SWAP( "hmf_08.rom",  0x000000, 0x100000, CRC(7fd0f556) SHA1(d1b4bec0946869d3d7bcb870d9ae3bd17395a231) )   /* Sprites */
5757   ROM_LOAD16_WORD_SWAP( "91076-8.57",  0x000000, 0x100000, CRC(7fd0f556) SHA1(d1b4bec0946869d3d7bcb870d9ae3bd17395a231) )   /* Sprites */
57595758
57605759   ROM_REGION( 0x0a0000, "oki1", 0 )   /* OKIM6295 samples */
5761   ROM_LOAD( "hmf_02.rom",   0x00000, 0x20000, CRC(3f1e67f2) SHA1(413e78587d8a043a0eb94447313ba1b3c5b35be5) )
5760   ROM_LOAD( "91076-2.46",   0x00000, 0x20000, CRC(3f1e67f2) SHA1(413e78587d8a043a0eb94447313ba1b3c5b35be5) )
57625761   ROM_CONTINUE(             0x40000, 0x60000 )   /* banked */
57635762
57645763   ROM_REGION( 0x0a0000, "oki2", 0 )   /* OKIM6295 samples */
5765   ROM_LOAD( "hmf_03.rom",   0x00000, 0x20000, CRC(b25ed93b) SHA1(d7bc686bbccf982f40420a11158aa8e5dd4207c5) )
5764   ROM_LOAD( "91076-3.45",   0x00000, 0x20000, CRC(b25ed93b) SHA1(d7bc686bbccf982f40420a11158aa8e5dd4207c5) )
57665765   ROM_CONTINUE(             0x40000, 0x60000 )   /* banked */
57675766ROM_END
57685767
src/tools/jedutil.c
r5077r5078
191191   /* does the source end in '.jed'? */
192192   len = strlen(srcfile);
193193   src_is_jed = (srcfile[len - 4] == '.' &&
194                tolower(srcfile[len - 3]) == 'j' &&
195                tolower(srcfile[len - 2]) == 'e' &&
196                tolower(srcfile[len - 1]) == 'd');
194                tolower((UINT8)srcfile[len - 3]) == 'j' &&
195                tolower((UINT8)srcfile[len - 2]) == 'e' &&
196                tolower((UINT8)srcfile[len - 1]) == 'd');
197197
198198   /* does the destination end in '.jed'? */
199199   len = strlen(dstfile);
200200   dst_is_jed = (dstfile[len - 4] == '.' &&
201                tolower(dstfile[len - 3]) == 'j' &&
202                tolower(dstfile[len - 2]) == 'e' &&
203                tolower(dstfile[len - 1]) == 'd');
201                tolower((UINT8)dstfile[len - 3]) == 'j' &&
202                tolower((UINT8)dstfile[len - 2]) == 'e' &&
203                tolower((UINT8)dstfile[len - 1]) == 'd');
204204
205205   /* error if neither or both are .jed */
206206   if (!src_is_jed && !dst_is_jed)
src/tools/ldverify.c
r5077r5078
680680   srcfilelen = strlen(srcfile);
681681   if (srcfilelen < 4)
682682      return usage();
683   if (tolower(srcfile[srcfilelen-3]) == 'a' && tolower(srcfile[srcfilelen-2]) == 'v' && tolower(srcfile[srcfilelen-1]) == 'i')
683   if (tolower((UINT8)srcfile[srcfilelen-3]) == 'a' && tolower((UINT8)srcfile[srcfilelen-2]) == 'v' && tolower((UINT8)srcfile[srcfilelen-1]) == 'i')
684684      isavi = TRUE;
685   else if (tolower(srcfile[srcfilelen-3]) == 'c' && tolower(srcfile[srcfilelen-2]) == 'h' && tolower(srcfile[srcfilelen-1]) == 'd')
685   else if (tolower((UINT8)srcfile[srcfilelen-3]) == 'c' && tolower((UINT8)srcfile[srcfilelen-2]) == 'h' && tolower((UINT8)srcfile[srcfilelen-1]) == 'd')
686686      isavi = FALSE;
687687   else
688688      return usage();
src/tools/regrep.c
r5077r5078
177177   int length;
178178
179179   /* trim leading spaces */
180   while (*string != 0 && isspace(*string))
180   while (*string != 0 && isspace((UINT8)*string))
181181      string++;
182182
183183   /* trim trailing spaces */
184184   length = strlen(string);
185   while (length > 0 && isspace(string[length - 1]))
185   while (length > 0 && isspace((UINT8)string[length - 1]))
186186      string[--length] = 0;
187187
188188   return string;
r5077r5078
400400         {
401401            /* find the end of the line and normalize it with a CR */
402402            for (curptr = linestart; *curptr != 0 && *curptr != '\n' && *curptr != '\r'; curptr++)
403               if (!isspace(*curptr))
403               if (!isspace((UINT8)*curptr))
404404                  foundchars = 1;
405405            *curptr++ = '\n';
406406            *curptr = 0;
r5077r5078
434434         char *end;
435435
436436         /* find the end */
437         for (end = start; !isspace(*end); end++) ;
437         for (end = start; !isspace((UINT8)*end); end++) ;
438438         *end = 0;
439439         strcpy(lists[index].version, start);
440440         fprintf(stderr, "Parsing results from version %s\n", lists[index].version);
src/tools/chdcd.c
r5077r5078
6161   int singlequote = 0;
6262   int doublequote = 0;
6363
64   while ((i < linebuffersize) && isspace(linebuffer[i]))
64   while ((i < linebuffersize) && isspace((UINT8)linebuffer[i]))
6565   {
6666      i++;
6767   }
r5077r5078
7676      {
7777         singlequote = !singlequote;
7878      }
79      else if (!singlequote && !doublequote && isspace(linebuffer[i]))
79      else if (!singlequote && !doublequote && isspace((UINT8)linebuffer[i]))
8080      {
8181         break;
8282      }
r5077r5078
298298               /* it's a decimal offset, use it */
299299               f = strtoul(&token[1], NULL, 10);
300300            }
301            else if (isdigit(token[0]))
301            else if (isdigit((UINT8)token[0]))
302302            {
303303               /* convert the time to an offset */
304304               f = msf_to_frames( token );
r5077r5078
314314
315315            TOKENIZE
316316
317            if (isdigit(token[0]))
317            if (isdigit((UINT8)token[0]))
318318            {
319319               // this could be the length or an offset from the previous field.
320320               f = msf_to_frames( token );
321321
322322               TOKENIZE
323323
324               if (isdigit(token[0]))
324               if (isdigit((UINT8)token[0]))
325325               {
326326                  // it was an offset.
327327                  f *= (outtoc->tracks[trknum].datasize + outtoc->tracks[trknum].subsize);
src/tools/chdman.c
r5077r5078
313313
314314      /* if there are any non-digits in the 'offset', then treat it as a ident file */
315315      for (scan = argv[4]; *scan != 0; scan++)
316         if (!isdigit(*scan))
316         if (!isdigit((UINT8)*scan))
317317            break;
318318      if (*scan != 0)
319319      {
src/emu/debug/debugcpu.c
r5077r5078
235235
236236         /* strip all spaces from the name and convert to lowercase */
237237         for (charnum = 0; charnum < sizeof(symname) - 1 && str < colon; str++)
238            if (!isspace(*str))
239               symname[charnum++] = tolower(*str);
238            if (!isspace((UINT8)*str))
239               symname[charnum++] = tolower((UINT8)*str);
240240         symname[charnum] = 0;
241241
242242         /* add the symbol to the table */
r5077r5078
21332133
21342134      /* strip whitespace */
21352135      i = (int)strlen(buf);
2136      while((i > 0) && (isspace(buf[i-1])))
2136      while((i > 0) && (isspace((UINT8)buf[i-1])))
21372137         buf[--i] = '\0';
21382138
21392139      /* execute the command */
src/emu/debug/debugvw.c
r5077r5078
11471147   }
11481148
11491149   /* now trim spaces */
1150   while (isspace(str[tagstart]) && taglen > 0)
1150   while (isspace((UINT8)str[tagstart]) && taglen > 0)
11511151      tagstart++, taglen--;
1152   while (isspace(str[tagstart + taglen - 1]) && taglen > 0)
1152   while (isspace((UINT8)str[tagstart + taglen - 1]) && taglen > 0)
11531153      taglen--;
1154   while (isspace(str[valstart]) && vallen > 0)
1154   while (isspace((UINT8)str[valstart]) && vallen > 0)
11551155      valstart++, vallen--;
1156   while (isspace(str[valstart + vallen - 1]) && vallen > 0)
1156   while (isspace((UINT8)str[valstart + vallen - 1]) && vallen > 0)
11571157      vallen--;
11581158   if (str[valstart] == '!')
11591159      valstart++, vallen--;
src/emu/debug/debugcmd.c
r5077r5078
17051705      {
17061706         /* check for a 'b','w','d',or 'q' prefix */
17071707         data_size[data_count] = cur_data_size;
1708         if (tolower(pdata[0]) == 'b' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 1; pdata += 2; }
1709         if (tolower(pdata[0]) == 'w' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 2; pdata += 2; }
1710         if (tolower(pdata[0]) == 'd' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 4; pdata += 2; }
1711         if (tolower(pdata[0]) == 'q' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 8; pdata += 2; }
1708         if (tolower((UINT8)pdata[0]) == 'b' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 1; pdata += 2; }
1709         if (tolower((UINT8)pdata[0]) == 'w' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 2; pdata += 2; }
1710         if (tolower((UINT8)pdata[0]) == 'd' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 4; pdata += 2; }
1711         if (tolower((UINT8)pdata[0]) == 'q' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 8; pdata += 2; }
17121712
17131713         /* look for a wildcard */
17141714         if (!strcmp(pdata, "?"))
src/emu/debug/debugcon.c
r5077r5078
197197      return CMDERR_NONE;
198198
199199   /* the first parameter has the command and the real first parameter; separate them */
200   for (p = param[0]; *p && isspace(*p); p++) { }
201   for (command = p; *p && !isspace(*p); p++) { }
200   for (p = param[0]; *p && isspace((UINT8)*p); p++) { }
201   for (command = p; *p && !isspace((UINT8)*p); p++) { }
202202   if (*p != 0)
203203   {
204204      *p++ = 0;
205      for ( ; *p && isspace(*p); p++) { }
205      for ( ; *p && isspace((UINT8)*p); p++) { }
206206      if (*p != 0)
207207         param[0] = p;
208208      else
r5077r5078
302302               case '+':   if (parendex == 0 && paramcount == 1 && p[1] == '+') isexpr = TRUE; *p = c; break;
303303               case '=':   if (parendex == 0 && paramcount == 1) isexpr = TRUE; *p = c; break;
304304               case 0:      foundend = TRUE; break;
305               default:   *p = tolower(c); break;
305               default:   *p = tolower((UINT8)c); break;
306306            }
307307         }
308308      }
r5077r5078
321321      command_start = params[0];
322322
323323      /* allow for "do" commands */
324      if (tolower(command_start[0] == 'd') && tolower(command_start[1] == 'o') && isspace(command_start[2]))
324      if (tolower((UINT8)command_start[0] == 'd') && tolower((UINT8)command_start[1] == 'o') && isspace((UINT8)command_start[2]))
325325      {
326326         isexpr = TRUE;
327327         command_start += 3;
src/emu/debug/express.c
r5077r5078
627627   while (string[0] != 0 && token - expr->token < MAX_TOKENS)
628628   {
629629      /* ignore any whitespace */
630      while (string[0] != 0 && isspace(string[0]))
630      while (string[0] != 0 && isspace((UINT8)string[0]))
631631         string++;
632632      if (string[0] == 0)
633633         break;
r5077r5078
637637      token->offset = string - stringstart;
638638
639639      /* switch off the first character */
640      switch (tolower(string[0]))
640      switch (tolower((UINT8)string[0]))
641641      {
642642         case '(':
643643            SET_TOKEN_INFO(1, TOK_OPERATOR, TVL_LPAREN, TIN_PRECEDENCE_0);
r5077r5078
827827            /* accumulate a lower-case version of the symbol */
828828            while (1)
829829            {
830               char val = tolower(string[0]);
830               char val = tolower((UINT8)string[0]);
831831               if (val == 0 || strchr(valid, val) == NULL)
832832                  break;
833833               buffer[bufindex++] = val;
r5077r5078
925925                  value = 0;
926926                  while (buffer[bufindex] != 0)
927927                  {
928                     const char *ptr = strchr(numbers, tolower(buffer[bufindex]));
928                     const char *ptr = strchr(numbers, tolower((UINT8)buffer[bufindex]));
929929                     int digit;
930930
931931                     if (ptr == NULL)
r5077r5078
19671967   all_digits = TRUE;
19681968   for (i = 0; name[i]; i++)
19691969   {
1970      if (!isdigit(name[i]))
1970      if (!isdigit((UINT8)name[i]))
19711971      {
19721972         all_digits = FALSE;
19731973         break;
r5077r5078
19991999
20002000   /* copy the string, converting to lowercase */
20012001   for (strindex = 0; name[strindex] != 0; strindex++)
2002      newstring[strindex] = tolower(name[strindex]);
2002      newstring[strindex] = tolower((UINT8)name[strindex]);
20032003   newstring[strindex] = 0;
20042004
20052005   /* fill in the details */
src/emu/debug/debughlp.c
r5077r5078
10481048
10491049   /* make a lowercase copy of the tag */
10501050   for (i = 0; i <= taglen; i++)
1051      tagcopy[i] = tolower(tag[i]);
1051      tagcopy[i] = tolower((UINT8)tag[i]);
10521052
10531053   /* find a match */
10541054   for (i = 0; i < sizeof(static_help_list) / sizeof(static_help_list[0]); i++)
src/emu/cpu/cpu.mak
r5077r5078
229229
230230
231231#-------------------------------------------------
232# Atmela 8-bit AVR series
232# Atmel 8-bit AVR
233233#-------------------------------------------------
234234
235235ifneq ($(filter AVR8,$(CPUS)),)
r5077r5078
238238DBGOBJS += $(CPUOBJ)/avr8/avr8dasm.o
239239endif
240240
241$(CPUOBJ)/avr8/avr8.o:   $(CPUSRC)/avr8/avr8.c \
241$(CPUOBJ)/avr8/avr8.o:    $(CPUSRC)/avr8/avr8.c \
242         $(CPUSRC)/avr8/avr8.h
242243
243244
244245
src/emu/cpu/mc68hc11/hc11ops.c
r5077r5078
1010#define SET_C8(x)         (cpustate->ccr |= ((x) & 0x100) ? CC_C : 0)
1111#define SET_C16(x)         (cpustate->ccr |= ((x) & 0x10000) ? CC_C : 0)
1212#define CLEAR_Z(cpustate)         (cpustate->ccr &= ~(CC_Z))
13#define CLEAR_C(cpustate)         (cpustate->ccr &= ~(CC_C))
1314#define CLEAR_NZV(cpustate)         (cpustate->ccr &= ~(CC_N | CC_Z | CC_V))
15#define CLEAR_ZVC(cpustate)         (cpustate->ccr &= ~(CC_Z | CC_V | CC_C))
1416#define CLEAR_NZVC(cpustate)      (cpustate->ccr &= ~(CC_N | CC_Z | CC_V | CC_C))
1517#define CLEAR_HNZVC(cpustate)      (cpustate->ccr &= ~(CC_H | CC_N | CC_Z | CC_V | CC_C))
1618
r5077r5078
615617   CYCLES(cpustate, 5);
616618}
617619
620/* ASLA             0x48 */
621static void HC11OP(asla)(hc11_state *cpustate)
622{
623   UINT16 r = REG_A << 1;
624   CLEAR_NZVC(cpustate);
625   SET_C8(r);
626   REG_A = (UINT16)(r);
627   SET_N8(REG_A);
628   SET_Z8(REG_A);
618629
630   if (((cpustate->ccr & CC_N) == CC_N && (cpustate->ccr & CC_C) == 0) ||
631      ((cpustate->ccr & CC_N) == 0 && (cpustate->ccr & CC_C) == CC_C))
632   {
633      cpustate->ccr |= CC_V;
634   }
635
636   CYCLES(cpustate, 2);
637}
638
639/* ASLB             0x58 */
640static void HC11OP(aslb)(hc11_state *cpustate)
641{
642   UINT16 r = REG_B << 1;
643   CLEAR_NZVC(cpustate);
644   SET_C8(r);
645   REG_B = (UINT16)(r);
646   SET_N8(REG_B);
647   SET_Z8(REG_B);
648
649   if (((cpustate->ccr & CC_N) == CC_N && (cpustate->ccr & CC_C) == 0) ||
650      ((cpustate->ccr & CC_N) == 0 && (cpustate->ccr & CC_C) == CC_C))
651   {
652      cpustate->ccr |= CC_V;
653   }
654
655   CYCLES(cpustate, 2);
656}
657
619658/* BITA IMM         0x85 */
620659static void HC11OP(bita_imm)(hc11_state *cpustate)
621660{
r5077r5078
735774   CYCLES(cpustate, 5);
736775}
737776
777/* BCC              0x24 */
778static void HC11OP(bcc)(hc11_state *cpustate)
779{
780   INT8 rel = FETCH(cpustate);
781   if ((cpustate->ccr & CC_C) == 0)   /* Branch if C flag clear */
782   {
783      SET_PC(cpustate, cpustate->ppc + rel + 2);
784   }
785   CYCLES(cpustate, 3);
786}
738787
788/* BCLR INDX       0x1d */
789static void HC11OP(bclr_indx)(hc11_state *cpustate)
790{
791   UINT8 offset = FETCH(cpustate);
792   UINT8 mask = FETCH(cpustate);
793   UINT8 r = READ8(cpustate, cpustate->ix + offset);
794   r = r & ~mask;
795   WRITE8(cpustate, cpustate->ix + offset, r);
796   CLEAR_NZV(cpustate);
797   SET_N8(r);
798   SET_Z8(r);
799
800   CYCLES(cpustate, 7);
801}
802
739803/* BCS              0x25 */
740804static void HC11OP(bcs)(hc11_state *cpustate)
741805{
r5077r5078
760824}
761825
762826
827/* BHI              0x22 */
828static void HC11OP(bhi)(hc11_state *cpustate)
829{
830   INT8 rel = FETCH(cpustate);
831   if (((cpustate->ccr & CC_C) == 0) && ((cpustate->ccr & CC_Z) == 0))   /* Branch if C and Z flag clear */
832   {
833      SET_PC(cpustate, cpustate->ppc + rel + 2);
834   }
835   CYCLES(cpustate, 3);
836}
837
838
763839/* BNE              0x26 */
764840static void HC11OP(bne)(hc11_state *cpustate)
765841{
r5077r5078
785861   CYCLES(cpustate, 3);
786862}
787863
864/* BLS              0x23 */
865static void HC11OP(bls)(hc11_state *cpustate)
866{
867   INT8 rel = FETCH(cpustate);
868   if (cpustate->ccr & CC_C || cpustate->ccr & CC_Z)   /* Branch if C or Z flag set */
869   {
870      SET_PC(cpustate, cpustate->ppc + rel + 2);
871   }
872   CYCLES(cpustate, 3);
873}
788874
875/* BMI              0x2B */
876static void HC11OP(bmi)(hc11_state *cpustate)
877{
878   INT8 rel = FETCH(cpustate);
879   if (cpustate->ccr & CC_N)      /* Branch if N flag set */
880   {
881      SET_PC(cpustate, cpustate->ppc + rel + 2);
882   }
883   CYCLES(cpustate, 3);
884}
885
789886/* BPL              0x2A */
790887static void HC11OP(bpl)(hc11_state *cpustate)
791888{
r5077r5078
806903   CYCLES(cpustate, 3);
807904}
808905
906/* BRCLR DIR       0x13 */
907static void HC11OP(brclr_dir)(hc11_state *cpustate)
908{
909   UINT8 d = FETCH(cpustate);
910   UINT8 mask = FETCH(cpustate);
911   INT8 rel = FETCH(cpustate);
912   UINT8 i = READ8(cpustate, d);
809913
914   if(!(i & mask))
915   {
916      SET_PC(cpustate, cpustate->ppc + rel + 4);
917   }
918
919   CYCLES(cpustate, 6);
920}
921
922
923/* BRCLR INDX       0x1F */
924static void HC11OP(brclr_indx)(hc11_state *cpustate)
925{
926   UINT8 offset = FETCH(cpustate);
927   UINT8 mask = FETCH(cpustate);
928   INT8 rel = FETCH(cpustate);
929   UINT8 i = READ8(cpustate, cpustate->ix + offset);
930
931   if(!(i & mask))
932   {
933      SET_PC(cpustate, cpustate->ppc + rel + 4);
934   }
935
936   CYCLES(cpustate, 7);
937}
938
939/* BRSET DIR       0x12 */
940static void HC11OP(brset_dir)(hc11_state *cpustate)
941{
942   UINT8 d = FETCH(cpustate);
943   UINT8 mask = FETCH(cpustate);
944   INT8 rel = FETCH(cpustate);
945   UINT8 i = READ8(cpustate, d);
946
947   if(i & mask)
948   {
949      SET_PC(cpustate, cpustate->ppc + rel + 4);
950   }
951
952   CYCLES(cpustate, 6);
953}
954
955
956/* BRSET INDX       0x1E */
957static void HC11OP(brset_indx)(hc11_state *cpustate)
958{
959   UINT8 offset = FETCH(cpustate);
960   UINT8 mask = FETCH(cpustate);
961   INT8 rel = FETCH(cpustate);
962   UINT8 i = READ8(cpustate, cpustate->ix + offset);
963
964   if(i & mask)
965   {
966      SET_PC(cpustate, cpustate->ppc + rel + 4);
967   }
968
969   CYCLES(cpustate, 7);
970}
971
972
973/* BRN              0x21 */
974static void HC11OP(brn)(hc11_state *cpustate)
975{
976   /* with this opcode the branch condition is always false. */
977   SET_PC(cpustate, cpustate->ppc + 2);
978   CYCLES(cpustate, 3);
979}
980
981/* BSET INDX       0x1c */
982static void HC11OP(bset_indx)(hc11_state *cpustate)
983{
984   UINT8 offset = FETCH(cpustate);
985   UINT8 mask = FETCH(cpustate);
986   UINT8 r = READ8(cpustate, cpustate->ix + offset);
987   r = (r & ~mask) | mask;
988   WRITE8(cpustate, cpustate->ix + offset, r);
989   CLEAR_NZV(cpustate);
990   SET_N8(r);
991   SET_Z8(r);
992
993   CYCLES(cpustate, 7);
994}
995
810996/* BSR              0x8D */
811997static void HC11OP(bsr)(hc11_state *cpustate)
812998{
r5077r5078
8171003   CYCLES(cpustate, 6);
8181004}
8191005
1006/* BVC              0x28 */
1007static void HC11OP(bvc)(hc11_state *cpustate)
1008{
1009   INT8 rel = FETCH(cpustate);
1010   if ((cpustate->ccr & CC_V) == 0)   /* Branch if V flag clear */
1011   {
1012      SET_PC(cpustate, cpustate->ppc + rel + 2);
1013   }
1014   CYCLES(cpustate, 3);
1015}
8201016
1017/* BVS              0x29 */
1018static void HC11OP(bvs)(hc11_state *cpustate)
1019{
1020   INT8 rel = FETCH(cpustate);
1021   if (cpustate->ccr & CC_V)   /* Branch if V flag set */
1022   {
1023      SET_PC(cpustate, cpustate->ppc + rel + 2);
1024   }
1025   CYCLES(cpustate, 3);
1026}
1027
1028/* CBA              0x11 */
1029static void HC11OP(cba)(hc11_state *cpustate)
1030{
1031   UINT16 r = REG_A - REG_B;
1032   CLEAR_NZVC(cpustate);
1033   SET_N8(r);
1034   SET_Z8(r);
1035   SET_V_SUB8(r, REG_B, REG_A);
1036   SET_C8(r);
1037   CYCLES(cpustate, 2);
1038}
1039
1040/* CLC              0x0C */
1041static void HC11OP(clc)(hc11_state *cpustate)
1042{
1043   cpustate->ccr &= ~CC_C;
1044   CYCLES(cpustate, 2);
1045}
1046
1047
8211048/* CLI              0x0E */
8221049static void HC11OP(cli)(hc11_state *cpustate)
8231050{
r5077r5078
8751102}
8761103
8771104
1105/* CLV              0x0A */
1106static void HC11OP(clv)(hc11_state *cpustate)
1107{
1108   cpustate->ccr &= ~CC_V;
1109   CYCLES(cpustate, 2);
1110}
1111
1112
8781113/* CMPA IMM         0x81 */
8791114static void HC11OP(cmpa_imm)(hc11_state *cpustate)
8801115{
r5077r5078
10151250}
10161251
10171252
1253/* COMA              , 0x43 */
1254static void HC11OP(coma)(hc11_state *cpustate)
1255{
1256   UINT16 r = 0xff - REG_A;
1257   CLEAR_NZVC(cpustate);
1258   SET_N8(r);
1259   SET_Z8(r);
1260   cpustate->ccr |= CC_C; //always set for M6800 compatibility
1261   REG_A = r;
1262   CYCLES(cpustate, 2);
1263}
1264
1265
1266/* COMB              , 0x53 */
1267static void HC11OP(comb)(hc11_state *cpustate)
1268{
1269   UINT16 r = 0xff - REG_B;
1270   CLEAR_NZVC(cpustate);
1271   SET_N8(r);
1272   SET_Z8(r);
1273   cpustate->ccr |= CC_C; //always set for M6800 compatibility
1274   REG_B = r;
1275   CYCLES(cpustate, 2);
1276}
1277
1278
10181279/* CPD IMM          0x1A, 0x83 */
10191280static void HC11OP(cpd_imm)(hc11_state *cpustate)
10201281{
r5077r5078
11541415   CYCLES(cpustate, 7);
11551416}
11561417
1157
11581418/* CPY IMM          0x18, 0x8C */
11591419static void HC11OP(cpy_imm)(hc11_state *cpustate)
11601420{
r5077r5078
11681428   CYCLES(cpustate, 5);
11691429}
11701430
1431/* CPY DIR          0x18 0x9C */
1432static void HC11OP(cpy_dir)(hc11_state *cpustate)
1433{
1434   UINT8 d = FETCH(cpustate);
1435   UINT16 i = READ16(cpustate, d);
1436   UINT32 r = cpustate->iy - i;
1437   CLEAR_NZVC(cpustate);
1438   SET_N16(r);
1439   SET_Z16(r);
1440   SET_V_SUB16(r, i, cpustate->iy);
1441   SET_C16(r);
1442   CYCLES(cpustate, 6);
1443}
11711444
1445/* CPY EXT          0x18 0xBC */
1446static void HC11OP(cpy_ext)(hc11_state *cpustate)
1447{
1448   UINT16 adr = FETCH16(cpustate);
1449   UINT16 i = READ16(cpustate, adr);
1450   UINT32 r = cpustate->iy - i;
1451   CLEAR_NZVC(cpustate);
1452   SET_N16(r);
1453   SET_Z16(r);
1454   SET_V_SUB16(r, i, cpustate->iy);
1455   SET_C16(r);
1456   CYCLES(cpustate, 7);
1457}
1458
1459/* CPY IND, X       0x1A 0xAC */
1460static void HC11OP(cpy_indx)(hc11_state *cpustate)
1461{
1462   UINT8 offset = FETCH(cpustate);
1463   UINT16 i = READ16(cpustate, cpustate->ix + offset);
1464   UINT32 r = cpustate->iy - i;
1465   CLEAR_NZVC(cpustate);
1466   SET_N16(r);
1467   SET_Z16(r);
1468   SET_V_SUB16(r, i, cpustate->iy);
1469   SET_C16(r);
1470   CYCLES(cpustate, 7);
1471}
1472
1473/* CPY IND, Y       0x18 0xAC */
1474static void HC11OP(cpy_indy)(hc11_state *cpustate)
1475{
1476   UINT8 offset = FETCH(cpustate);
1477   UINT16 i = READ16(cpustate, cpustate->iy + offset);
1478   UINT32 r = cpustate->iy - i;
1479   CLEAR_NZVC(cpustate);
1480   SET_N16(r);
1481   SET_Z16(r);
1482   SET_V_SUB16(r, i, cpustate->iy);
1483   SET_C16(r);
1484   CYCLES(cpustate, 7);
1485}
1486
1487/* DECA             0x4A */
1488static void HC11OP(deca)(hc11_state *cpustate)
1489{
1490   CLEAR_NZV(cpustate);
1491   if (REG_A == 0x80)
1492      SET_VFLAG(cpustate);
1493   REG_A--;
1494   SET_N8(REG_A);
1495   SET_Z8(REG_A);
1496   CYCLES(cpustate, 2);
1497}
1498
1499/* DECB             0x5A */
1500static void HC11OP(decb)(hc11_state *cpustate)
1501{
1502   CLEAR_NZV(cpustate);
1503   if (REG_B == 0x80)
1504      SET_VFLAG(cpustate);
1505   REG_B--;
1506   SET_N8(REG_B);
1507   SET_Z8(REG_B);
1508   CYCLES(cpustate, 2);
1509}
1510
1511/* DEC EXT          0x7A */
1512static void HC11OP(dec_ext)(hc11_state *cpustate)
1513{
1514   UINT16 adr = FETCH16(cpustate);
1515   UINT8 i = READ8(cpustate, adr);
1516
1517   CLEAR_NZV(cpustate);
1518   if (i == 0x80)
1519      SET_VFLAG(cpustate);
1520   i--;
1521   SET_N8(i);
1522   SET_Z8(i);
1523   WRITE8(cpustate, adr, i);
1524   CYCLES(cpustate, 6);
1525}
1526
1527/* DEC INDX          0x6A */
1528static void HC11OP(dec_indx)(hc11_state *cpustate)
1529{
1530   UINT8 offset = FETCH(cpustate);
1531   UINT8 i = READ8(cpustate, cpustate->ix + offset);
1532
1533   CLEAR_NZV(cpustate);
1534   if (i == 0x80)
1535      SET_VFLAG(cpustate);
1536   i--;
1537   SET_N8(i);
1538   SET_Z8(i);
1539   WRITE8(cpustate, cpustate->ix + offset, i);
1540   CYCLES(cpustate, 6);
1541}
1542
1543/* DEC INDY          0x18 0x6A */
1544static void HC11OP(dec_indy)(hc11_state *cpustate)
1545{
1546   UINT8 offset = FETCH(cpustate);
1547   UINT8 i = READ8(cpustate, cpustate->iy + offset);
1548
1549   CLEAR_NZV(cpustate);
1550   if (i == 0x80)
1551      SET_VFLAG(cpustate);
1552   i--;
1553   SET_N8(i);
1554   SET_Z8(i);
1555   WRITE8(cpustate, cpustate->iy + offset, i);
1556   CYCLES(cpustate, 7);
1557}
1558
11721559/* DEX              0x09 */
11731560static void HC11OP(dex)(hc11_state *cpustate)
11741561{
r5077r5078
13081695   CYCLES(cpustate, 5);
13091696}
13101697
1698/* IDIV             0x02 */
1699static void HC11OP(idiv)(hc11_state *cpustate)
1700{
1701   UINT16 numerator = REG_D;
1702   UINT16 denominator = cpustate->ix;
1703   UINT16 remainder;
1704   UINT16 result;
13111705
1706   CLEAR_ZVC(cpustate);
1707   if(denominator == 0) // divide by zero behaviour
1708   {
1709      remainder = 0xffff; // TODO: undefined behaviour according to the docs
1710      result = 0xffff;
1711      logerror("HC11: divide by zero at PC=%04x\n",cpustate->pc-1);
1712      cpustate->ccr |= CC_C;
1713   }
1714   else
1715   {
1716      remainder = numerator % denominator;
1717      result = numerator / denominator;
1718   }
1719   cpustate->ix = result;
1720   REG_D = remainder;
1721   SET_Z16(result);
1722
1723   CYCLES(cpustate, 41);
1724}
1725
13121726/* INCA             0x4C */
13131727static void HC11OP(inca)(hc11_state *cpustate)
13141728{
r5077r5078
13211735   CYCLES(cpustate, 2);
13221736}
13231737
1738/* INCB             0x5C */
1739static void HC11OP(incb)(hc11_state *cpustate)
1740{
1741   CLEAR_NZV(cpustate);
1742   if (REG_B == 0x7f)
1743      SET_VFLAG(cpustate);
1744   REG_B++;
1745   SET_N8(REG_B);
1746   SET_Z8(REG_B);
1747   CYCLES(cpustate, 2);
1748}
13241749
1750/* INC EXT          0x7C */
1751static void HC11OP(inc_ext)(hc11_state *cpustate)
1752{
1753   UINT16 adr = FETCH16(cpustate);
1754   UINT8 i = READ8(cpustate, adr);
1755
1756   CLEAR_NZV(cpustate);
1757   if (i == 0x7f)
1758      SET_VFLAG(cpustate);
1759   i++;
1760   SET_N8(i);
1761   SET_Z8(i);
1762   WRITE8(cpustate, adr, i);
1763   CYCLES(cpustate, 6);
1764}
1765
1766/* INC INDX          0x6C */
1767static void HC11OP(inc_indx)(hc11_state *cpustate)
1768{
1769   UINT8 offset = FETCH(cpustate);
1770   UINT8 i = READ8(cpustate, cpustate->ix + offset);
1771
1772   CLEAR_NZV(cpustate);
1773   if (i == 0x7f)
1774      SET_VFLAG(cpustate);
1775   i++;
1776   SET_N8(i);
1777   SET_Z8(i);
1778   WRITE8(cpustate, cpustate->ix + offset, i);
1779   CYCLES(cpustate, 6);
1780}
1781
1782
1783/* INC INDY          0x18 0x6C */
1784static void HC11OP(inc_indy)(hc11_state *cpustate)
1785{
1786   UINT8 offset = FETCH(cpustate);
1787   UINT8 i = READ8(cpustate, cpustate->iy + offset);
1788
1789   CLEAR_NZV(cpustate);
1790   if (i == 0x7f)
1791      SET_VFLAG(cpustate);
1792   i++;
1793   SET_N8(i);
1794   SET_Z8(i);
1795   WRITE8(cpustate, cpustate->iy + offset, i);
1796   CYCLES(cpustate, 7);
1797}
1798
1799
13251800/* INX              0x08 */
13261801static void HC11OP(inx)(hc11_state *cpustate)
13271802{
r5077r5078
13401815   CYCLES(cpustate, 4);
13411816}
13421817
1818/* JMP IND X        0x6E */
1819static void HC11OP(jmp_indx)(hc11_state *cpustate)
1820{
1821   UINT16 adr = FETCH(cpustate);
1822   SET_PC(cpustate, cpustate->ix + adr);
1823   CYCLES(cpustate, 3);
1824}
13431825
1826/* JMP IND Y        0x18 0x6E */
1827static void HC11OP(jmp_indy)(hc11_state *cpustate)
1828{
1829   UINT16 adr = FETCH(cpustate);
1830   SET_PC(cpustate, cpustate->iy + adr);
1831   CYCLES(cpustate, 4);
1832}
1833
13441834/* JMP EXT          0x7E */
13451835static void HC11OP(jmp_ext)(hc11_state *cpustate)
13461836{
r5077r5078
17192209   CYCLES(cpustate, 6);
17202210}
17212211
1722
17232212/* LSLD             0x05 */
17242213static void HC11OP(lsld)(hc11_state *cpustate)
17252214{
r5077r5078
17392228   CYCLES(cpustate, 3);
17402229}
17412230
2231/* LSRA              0x44 */
2232static void HC11OP(lsra)(hc11_state *cpustate)
2233{
2234   UINT16 r = REG_A >> 1;
2235   CLEAR_NZVC(cpustate);
2236   cpustate->ccr |= (REG_A & 1) ? CC_C : 0;
2237   REG_A = (UINT8)(r);
2238   cpustate->ccr |= ((cpustate->ccr & CC_C) == CC_C) ? CC_V : 0;
2239   SET_Z8(REG_A);
17422240
2241   CYCLES(cpustate, 2);
2242}
2243
2244/* LSRB              0x54 */
2245static void HC11OP(lsrb)(hc11_state *cpustate)
2246{
2247   UINT16 r = REG_B >> 1;
2248   CLEAR_NZVC(cpustate);
2249   cpustate->ccr |= (REG_B & 1) ? CC_C : 0;
2250   REG_B = (UINT8)(r);
2251   cpustate->ccr |= ((cpustate->ccr & CC_C) == CC_C) ? CC_V : 0;
2252   SET_Z8(REG_B);
2253
2254   CYCLES(cpustate, 2);
2255}
2256
2257/* LSRD             0x04 */
2258static void HC11OP(lsrd)(hc11_state *cpustate)
2259{
2260   UINT32 r = REG_D >> 1;
2261   CLEAR_NZVC(cpustate);
2262   cpustate->ccr |= (REG_D & 1) ? CC_C : 0;
2263   REG_D = (UINT16)(r);
2264   cpustate->ccr |= ((cpustate->ccr & CC_C) == CC_C) ? CC_V : 0;
2265
2266   SET_N16(REG_D);
2267   SET_Z16(REG_D);
2268
2269   CYCLES(cpustate, 3);
2270}
2271
2272/* MUL              0x3d */
2273static void HC11OP(mul)(hc11_state *cpustate)
2274{
2275   UINT16 r = (UINT8)REG_A * (UINT8)REG_B;
2276   REG_D = r;
2277   CLEAR_C(cpustate);
2278   cpustate->ccr |= (REG_B & 0x80) ? CC_C : 0;
2279   CYCLES(cpustate, 10);
2280}
2281
2282/* NEGA              0x40 */
2283static void HC11OP(nega)(hc11_state *cpustate)
2284{
2285   INT8 r = 0x00 - REG_A;
2286   REG_A = r;
2287   CLEAR_NZVC(cpustate);
2288   SET_N8(r);
2289   SET_Z8(r);
2290   cpustate->ccr |= (REG_A == 0x80) ? CC_V : 0;
2291   cpustate->ccr |= (REG_A == 0x00) ? CC_C : 0;
2292   CYCLES(cpustate, 2);
2293}
2294
2295/* NEGB              0x50 */
2296static void HC11OP(negb)(hc11_state *cpustate)
2297{
2298   INT8 r = 0x00 - REG_B;
2299   REG_B = r;
2300   CLEAR_NZVC(cpustate);
2301   SET_N8(r);
2302   SET_Z8(r);
2303   cpustate->ccr |= (REG_B == 0x80) ? CC_V : 0;
2304   cpustate->ccr |= (REG_B == 0x00) ? CC_C : 0;
2305   CYCLES(cpustate, 2);
2306}
2307
2308
2309/* NEG EXT           0x70 */
2310static void HC11OP(neg_ext)(hc11_state *cpustate)
2311{
2312   UINT16 adr = FETCH16(cpustate);
2313   UINT8 i = READ8(cpustate, adr);
2314   INT8 r = 0x00 - i;
2315   i = r;
2316   CLEAR_NZVC(cpustate);
2317   SET_N8(r);
2318   SET_Z8(r);
2319   cpustate->ccr |= (i == 0x80) ? CC_V : 0;
2320   cpustate->ccr |= (i == 0x00) ? CC_C : 0;
2321   WRITE8(cpustate, adr, i);
2322   CYCLES(cpustate, 6);
2323}
2324
2325
2326/* NEG INDX           0x60 */
2327static void HC11OP(neg_indx)(hc11_state *cpustate)
2328{
2329   UINT16 offset = FETCH(cpustate);
2330   UINT8 i = READ8(cpustate, cpustate->ix + offset);
2331   INT8 r = 0x00 - i;
2332   i = r;
2333   CLEAR_NZVC(cpustate);
2334   SET_N8(r);
2335   SET_Z8(r);
2336   cpustate->ccr |= (i == 0x80) ? CC_V : 0;
2337   cpustate->ccr |= (i == 0x00) ? CC_C : 0;
2338   WRITE8(cpustate, cpustate->ix + offset, i);
2339   CYCLES(cpustate, 6);
2340}
2341
2342
2343/* NEG INDY           0x18 0x60 */
2344static void HC11OP(neg_indy)(hc11_state *cpustate)
2345{
2346   UINT16 offset = FETCH(cpustate);
2347   UINT8 i = READ8(cpustate, cpustate->iy + offset);
2348   INT8 r = 0x00 - i;
2349   i = r;
2350   CLEAR_NZVC(cpustate);
2351   SET_N8(r);
2352   SET_Z8(r);
2353   cpustate->ccr |= (i == 0x80) ? CC_V : 0;
2354   cpustate->ccr |= (i == 0x00) ? CC_C : 0;
2355   WRITE8(cpustate, cpustate->iy + offset, i);
2356   CYCLES(cpustate, 7);
2357}
2358
2359
2360/* NOP              0x01 */
2361static void HC11OP(nop)(hc11_state *cpustate)
2362{
2363   CYCLES(cpustate, 2);
2364}
2365
17432366/* PSHA             0x36 */
17442367static void HC11OP(psha)(hc11_state *cpustate)
17452368{
r5077r5078
17472370   CYCLES(cpustate, 3);
17482371}
17492372
1750
17512373/* ORAA IMM         0x8A */
17522374static void HC11OP(oraa_imm)(hc11_state *cpustate)
17532375{
r5077r5078
19232545   CYCLES(cpustate, 6);
19242546}
19252547
2548/* ROLA             0x49 */
2549static void HC11OP(rola)(hc11_state *cpustate)
2550{
2551   UINT8 c = (REG_A & 0x80);
2552   UINT16 r = ((REG_A & 0x7f) << 1) | (cpustate->ccr & CC_C ? 1 : 0);
2553   CLEAR_NZVC(cpustate);
2554   cpustate->ccr |= (c & 0x80) ? CC_C : 0;
2555   REG_A = (UINT16)(r);
2556   SET_N8(REG_A);
2557   SET_Z8(REG_A);
19262558
2559   if (((cpustate->ccr & CC_N) == CC_N && (cpustate->ccr & CC_C) == 0) ||
2560      ((cpustate->ccr & CC_N) == 0 && (cpustate->ccr & CC_C) == CC_C))
2561   {
2562      cpustate->ccr |= CC_V;
2563   }
2564
2565   CYCLES(cpustate, 2);
2566}
2567
2568/* ROLB             0x59 */
2569static void HC11OP(rolb)(hc11_state *cpustate)
2570{
2571   UINT8 c = (REG_B & 0x80);
2572   UINT16 r = (REG_B << 1) | (cpustate->ccr & CC_C ? 1 : 0);
2573   CLEAR_NZVC(cpustate);
2574   cpustate->ccr |= (c & 0x80) ? CC_C : 0;
2575   REG_B = (UINT16)(r);
2576   SET_N8(REG_B);
2577   SET_Z8(REG_B);
2578
2579   if (((cpustate->ccr & CC_N) == CC_N && (cpustate->ccr & CC_C) == 0) ||
2580      ((cpustate->ccr & CC_N) == 0 && (cpustate->ccr & CC_C) == CC_C))
2581   {
2582      cpustate->ccr |= CC_V;
2583   }
2584
2585   CYCLES(cpustate, 2);
2586}
2587
2588/* RORA             0x46 */
2589static void HC11OP(rora)(hc11_state *cpustate)
2590{
2591   UINT8 c = (REG_A & 1);
2592   UINT16 r = ((REG_A & 0x7f) >> 1) | (cpustate->ccr & CC_C ? 0x80 : 0);
2593   CLEAR_NZVC(cpustate);
2594   cpustate->ccr |= (c & 1) ? CC_C : 0;
2595   REG_A = (UINT16)(r);
2596   SET_N8(REG_A);
2597   SET_Z8(REG_A);
2598
2599   if (((cpustate->ccr & CC_N) == CC_N && (cpustate->ccr & CC_C) == 0) ||
2600      ((cpustate->ccr & CC_N) == 0 && (cpustate->ccr & CC_C) == CC_C))
2601   {
2602      cpustate->ccr |= CC_V;
2603   }
2604
2605   CYCLES(cpustate, 2);
2606}
2607
2608/* RORB             0x56 */
2609static void HC11OP(rorb)(hc11_state *cpustate)
2610{
2611   UINT8 c = (REG_B & 1);
2612   UINT16 r = ((REG_B & 0x7f) >> 1) | (cpustate->ccr & CC_C ? 0x80 : 0);
2613   CLEAR_NZVC(cpustate);
2614   cpustate->ccr |= (c & 1) ? CC_C : 0;
2615   REG_B = (UINT16)(r);
2616   SET_N8(REG_B);
2617   SET_Z8(REG_B);
2618
2619   if (((cpustate->ccr & CC_N) == CC_N && (cpustate->ccr & CC_C) == 0) ||
2620      ((cpustate->ccr & CC_N) == 0 && (cpustate->ccr & CC_C) == CC_C))
2621   {
2622      cpustate->ccr |= CC_V;
2623   }
2624
2625   CYCLES(cpustate, 2);
2626}
2627
2628/* RTI              0x3B */
2629static void HC11OP(rti)(hc11_state *cpustate)
2630{
2631   UINT16 rt_adr;
2632   UINT8 x_flag = cpustate->ccr & CC_X;
2633   cpustate->ccr = POP8(cpustate);
2634   if(x_flag == 0 && cpustate->ccr & CC_X) //X flag cannot do a 0->1 transition with this instruction.
2635      cpustate->ccr &= ~CC_X;
2636   REG_B = POP8(cpustate);
2637   REG_A = POP8(cpustate);
2638   cpustate->ix = POP16(cpustate);
2639   cpustate->iy = POP16(cpustate);
2640   rt_adr = POP16(cpustate);
2641   SET_PC(cpustate, rt_adr);
2642   CYCLES(cpustate, 12);
2643}
2644
19272645/* RTS              0x39 */
19282646static void HC11OP(rts)(hc11_state *cpustate)
19292647{
r5077r5078
19332651}
19342652
19352653
2654/* SBA              0x10 */
2655static void HC11OP(sba)(hc11_state *cpustate)
2656{
2657   UINT16 r = REG_A - REG_B;
2658   CLEAR_NZVC(cpustate);
2659//  SET_H(r, i, REG_A);
2660   SET_N8(r);
2661   SET_Z8(r);
2662   SET_V_SUB8(r, REG_B, REG_A);
2663   cpustate->ccr|= (REG_B > REG_A) ? CC_C : 0;
2664   REG_A = (UINT8)r;
2665   CYCLES(cpustate, 2);
2666}
2667
2668
2669/* SBCA IMM         0x82 */
2670static void HC11OP(sbca_imm)(hc11_state *cpustate)
2671{
2672   int c = (cpustate->ccr & CC_C) ? 1 : 0;
2673   UINT8 i = FETCH(cpustate);
2674   UINT16 r = (REG_A - i) - c;
2675   CLEAR_NZVC(cpustate);
2676//  SET_H(r, i-c, REG_A);
2677   SET_N8(r);
2678   SET_Z8(r);
2679   SET_V_SUB8(r, i-c, REG_A);
2680   SET_C8(r);
2681   REG_A = (UINT8)r;
2682   CYCLES(cpustate, 2);
2683}
2684
2685/* SBCA IND, X      0xA2 */
2686static void HC11OP(sbca_indx)(hc11_state *cpustate)
2687{
2688   int c = (cpustate->ccr & CC_C) ? 1 : 0;
2689   UINT8 offset = FETCH(cpustate);
2690   UINT8 i = READ8(cpustate, cpustate->ix + offset);
2691   UINT16 r = (REG_A - i) - c;
2692   CLEAR_NZVC(cpustate);
2693//  SET_H(r, i-c, REG_A);
2694   SET_N8(r);
2695   SET_Z8(r);
2696   SET_V_SUB8(r, i-c, REG_A);
2697   SET_C8(r);
2698   REG_A = (UINT8)r;
2699   CYCLES(cpustate, 4);
2700}
2701
2702/* SBCA IND, Y      0x18, 0xA2 */
2703static void HC11OP(sbca_indy)(hc11_state *cpustate)
2704{
2705   int c = (cpustate->ccr & CC_C) ? 1 : 0;
2706   UINT8 offset = FETCH(cpustate);
2707   UINT8 i = READ8(cpustate, cpustate->iy + offset);
2708   UINT16 r = (REG_A - i) - c;
2709   CLEAR_NZVC(cpustate);
2710//  SET_H(r, i-c, REG_A);
2711   SET_N8(r);
2712   SET_Z8(r);
2713   SET_V_SUB8(r, i-c, REG_A);
2714   SET_C8(r);
2715   REG_A = (UINT8)r;
2716   CYCLES(cpustate, 5);
2717}
2718
2719/* SBCB IMM         0xC2 */
2720static void HC11OP(sbcb_imm)(hc11_state *cpustate)
2721{
2722   int c = (cpustate->ccr & CC_C) ? 1 : 0;
2723   UINT8 i = FETCH(cpustate);
2724   UINT16 r = (REG_B - i) - c;
2725   CLEAR_NZVC(cpustate);
2726//  SET_H(r, i-c, REG_B);
2727   SET_N8(r);
2728   SET_Z8(r);
2729   SET_V_SUB8(r, i-c, REG_B);
2730   SET_C8(r);
2731   REG_B = (UINT8)r;
2732   CYCLES(cpustate, 2);
2733}
2734
2735/* SBCB IND, X      0xE2 */
2736static void HC11OP(sbcb_indx)(hc11_state *cpustate)
2737{
2738   int c = (cpustate->ccr & CC_C) ? 1 : 0;
2739   UINT8 offset = FETCH(cpustate);
2740   UINT8 i = READ8(cpustate, cpustate->ix + offset);
2741   UINT16 r = (REG_B - i) - c;
2742   CLEAR_NZVC(cpustate);
2743//  SET_H(r, i-c, REG_B);
2744   SET_N8(r);
2745   SET_Z8(r);
2746   SET_V_SUB8(r, i-c, REG_B);
2747   SET_C8(r);
2748   REG_B = (UINT8)r;
2749   CYCLES(cpustate, 4);
2750}
2751
2752/* SBCB IND, Y      0x18, 0xE2 */
2753static void HC11OP(sbcb_indy)(hc11_state *cpustate)
2754{
2755   int c = (cpustate->ccr & CC_C) ? 1 : 0;
2756   UINT8 offset = FETCH(cpustate);
2757   UINT8 i = READ8(cpustate, cpustate->iy + offset);
2758   UINT16 r = (REG_B - i) - c;
2759   CLEAR_NZVC(cpustate);
2760//  SET_H(r, i-c, REG_B);
2761   SET_N8(r);
2762   SET_Z8(r);
2763   SET_V_SUB8(r, i-c, REG_B);
2764   SET_C8(r);
2765   REG_B = (UINT8)r;
2766   CYCLES(cpustate, 5);
2767}
2768
2769/* SEC              0x0D */
2770static void HC11OP(sec)(hc11_state *cpustate)
2771{
2772   cpustate->ccr |= CC_C;
2773   CYCLES(cpustate, 2);
2774}
2775
19362776/* SEI              0x0F */
19372777static void HC11OP(sei)(hc11_state *cpustate)
19382778{
r5077r5078
19402780   CYCLES(cpustate, 2);
19412781}
19422782
2783/* SEV              0x0B */
2784static void HC11OP(sev)(hc11_state *cpustate)
2785{
2786   cpustate->ccr |= CC_V;
2787   CYCLES(cpustate, 2);
2788}
19432789
19442790/* STAA DIR         0x97 */
19452791static void HC11OP(staa_dir)(hc11_state *cpustate)
r5077r5078
20752921}
20762922
20772923
2924/* STX EXT          0xFF */
2925static void HC11OP(stx_ext)(hc11_state *cpustate)
2926{
2927   UINT16 adr = FETCH16(cpustate);
2928   UINT16 r = cpustate->ix;
2929   CLEAR_NZV(cpustate);
2930   WRITE8(cpustate, adr, (r & 0xff00) >> 8);
2931   WRITE8(cpustate, adr + 1, (r & 0xff));
2932   SET_N16(r);
2933   SET_Z16(r);
2934   CYCLES(cpustate, 5);
2935}
2936
2937
2938/* STX INDX         0xEF */
2939static void HC11OP(stx_indx)(hc11_state *cpustate)
2940{
2941   UINT16 adr = FETCH(cpustate);
2942   UINT16 r = cpustate->ix;
2943   CLEAR_NZV(cpustate);
2944   WRITE8(cpustate, cpustate->ix + adr, (r & 0xff00) >> 8);
2945   WRITE8(cpustate, cpustate->ix + adr + 1, (r & 0xff));
2946   SET_N16(r);
2947   SET_Z16(r);
2948   CYCLES(cpustate, 5);
2949}
2950
2951
2952/* STX INDY         0xCD 0xEF */
2953static void HC11OP(stx_indy)(hc11_state *cpustate)
2954{
2955   UINT16 adr = FETCH(cpustate);
2956   UINT16 r = cpustate->ix;
2957   CLEAR_NZV(cpustate);
2958   WRITE8(cpustate, cpustate->iy + adr, (r & 0xff00) >> 8);
2959   WRITE8(cpustate, cpustate->iy + adr + 1, (r & 0xff));
2960   SET_N16(r);
2961   SET_Z16(r);
2962   CYCLES(cpustate, 6);
2963}
2964
2965
2966/* STY EXT          0x18 0xFF */
2967static void HC11OP(sty_ext)(hc11_state *cpustate)
2968{
2969   UINT16 adr = FETCH16(cpustate);
2970   UINT16 r = cpustate->iy;
2971   CLEAR_NZV(cpustate);
2972   WRITE8(cpustate, adr, (r & 0xff00) >> 8);
2973   WRITE8(cpustate, adr + 1, (r & 0xff));
2974   SET_N16(r);
2975   SET_Z16(r);
2976   CYCLES(cpustate, 6);
2977}
2978
2979/* STY INDX         0x1A 0xEF */
2980static void HC11OP(sty_indx)(hc11_state *cpustate)
2981{
2982   UINT16 adr = FETCH(cpustate);
2983   UINT16 r = cpustate->iy;
2984   CLEAR_NZV(cpustate);
2985   WRITE8(cpustate, cpustate->ix + adr, (r & 0xff00) >> 8);
2986   WRITE8(cpustate, cpustate->ix + adr + 1, (r & 0xff));
2987   SET_N16(r);
2988   SET_Z16(r);
2989   CYCLES(cpustate, 6);
2990}
2991
2992/* STY INDY         0x18 0xEF */
2993static void HC11OP(sty_indy)(hc11_state *cpustate)
2994{
2995   UINT16 adr = FETCH(cpustate);
2996   UINT16 r = cpustate->iy;
2997   CLEAR_NZV(cpustate);
2998   WRITE8(cpustate, cpustate->iy + adr, (r & 0xff00) >> 8);
2999   WRITE8(cpustate, cpustate->iy + adr + 1, (r & 0xff));
3000   SET_N16(r);
3001   SET_Z16(r);
3002   CYCLES(cpustate, 6);
3003}
3004
3005/* STOP              0xCF */
3006static void HC11OP(stop)(hc11_state *cpustate)
3007{
3008   if(cpustate->stop_state == 0 && ((cpustate->ccr & CC_S) == 0))
3009   {
3010      cpustate->stop_state = 1;
3011   }
3012
3013   if(cpustate->stop_state == 1)
3014   {
3015      SET_PC(cpustate, cpustate->ppc); // wait for an exception
3016   }
3017
3018   if(cpustate->stop_state == 2)
3019   {
3020      cpustate->stop_state = 0;
3021   }
3022
3023   CYCLES(cpustate, 2);
3024}
3025
3026
3027/* SUBA IMM         0x80 */
3028static void HC11OP(suba_imm)(hc11_state *cpustate)
3029{
3030   UINT8 i = FETCH(cpustate);
3031   UINT16 r = REG_A - i;
3032   CLEAR_NZVC(cpustate);
3033//  SET_H(r, i, REG_A);
3034   SET_N8(r);
3035   SET_Z8(r);
3036   SET_V_SUB8(r, i, REG_A);
3037   SET_C8(r);
3038   REG_A = (UINT8)r;
3039   CYCLES(cpustate, 2);
3040}
3041
3042
3043/* SUBA DIR         0xd0 */
3044static void HC11OP(suba_dir)(hc11_state *cpustate)
3045{
3046   UINT8 d = FETCH(cpustate);
3047   UINT8 i = READ8(cpustate, d);
3048   UINT16 r = REG_A - i;
3049   CLEAR_NZVC(cpustate);
3050//  SET_H(r, i, REG_A);
3051   SET_N8(r);
3052   SET_Z8(r);
3053   SET_V_SUB8(r, i, REG_A);
3054   SET_C8(r);
3055   REG_A = (UINT8)r;
3056   CYCLES(cpustate, 3);
3057}
3058
3059
3060/* SUBA EXT         0xE0 */
3061static void HC11OP(suba_ext)(hc11_state *cpustate)
3062{
3063   UINT16 adr = FETCH16(cpustate);
3064   UINT8 i = READ8(cpustate, adr);
3065   UINT16 r = REG_A - i;
3066   CLEAR_NZVC(cpustate);
3067//  SET_H(r, i, REG_A);
3068   SET_N8(r);
3069   SET_Z8(r);
3070   SET_V_SUB8(r, i, REG_A);
3071   SET_C8(r);
3072   REG_A = (UINT8)r;
3073   CYCLES(cpustate, 4);
3074}
3075
3076
3077/* SUBA INDX        0xA0 */
3078static void HC11OP(suba_indx)(hc11_state *cpustate)
3079{
3080   UINT16 adr = FETCH(cpustate);
3081   UINT8 i = READ8(cpustate, cpustate->ix + adr);
3082   UINT16 r = REG_A - i;
3083   CLEAR_NZVC(cpustate);
3084//  SET_H(r, i, REG_A);
3085   SET_N8(r);
3086   SET_Z8(r);
3087   SET_V_SUB8(r, i, REG_A);
3088   SET_C8(r);
3089   REG_A = (UINT8)r;
3090   CYCLES(cpustate, 4);
3091}
3092
3093
3094/* SUBA INDY        0x18 0xA0 */
3095static void HC11OP(suba_indy)(hc11_state *cpustate)
3096{
3097   UINT16 adr = FETCH(cpustate);
3098   UINT8 i = READ8(cpustate, cpustate->iy + adr);
3099   UINT16 r = REG_A - i;
3100   CLEAR_NZVC(cpustate);
3101//  SET_H(r, i, REG_A);
3102   SET_N8(r);
3103   SET_Z8(r);
3104   SET_V_SUB8(r, i, REG_A);
3105   SET_C8(r);
3106   REG_A = (UINT8)r;
3107   CYCLES(cpustate, 5);
3108}
3109
3110
3111/* SUBB IMM         0xC0 */
3112static void HC11OP(subb_imm)(hc11_state *cpustate)
3113{
3114   UINT8 i = FETCH(cpustate);
3115   UINT16 r = REG_B - i;
3116   CLEAR_NZVC(cpustate);
3117//  SET_H(r, i, REG_B);
3118   SET_N8(r);
3119   SET_Z8(r);
3120   SET_V_SUB8(r, i, REG_B);
3121   SET_C8(r);
3122   REG_B = (UINT8)r;
3123   CYCLES(cpustate, 2);
3124}
3125
3126
3127/* SUBB DIR         0xD0 */
3128static void HC11OP(subb_dir)(hc11_state *cpustate)
3129{
3130   UINT8 d = FETCH(cpustate);
3131   UINT8 i = READ8(cpustate, d);
3132   UINT16 r = REG_B - i;
3133   CLEAR_NZVC(cpustate);
3134//  SET_H(r, i, REG_B);
3135   SET_N8(r);
3136   SET_Z8(r);
3137   SET_V_SUB8(r, i, REG_B);
3138   SET_C8(r);
3139   REG_B = (UINT8)r;
3140   CYCLES(cpustate, 3);
3141}
3142
3143
3144/* SUBB EXT         0xF0 */
3145static void HC11OP(subb_ext)(hc11_state *cpustate)
3146{
3147   UINT16 adr = FETCH16(cpustate);
3148   UINT8 i = READ8(cpustate, adr);
3149   UINT16 r = REG_B - i;
3150   CLEAR_NZVC(cpustate);
3151//  SET_H(r, i, REG_B);
3152   SET_N8(r);
3153   SET_Z8(r);
3154   SET_V_SUB8(r, i, REG_B);
3155   SET_C8(r);
3156   REG_B = (UINT8)r;
3157   CYCLES(cpustate, 4);
3158}
3159
3160
3161/* SUBB INDX        0xE0 */
3162static void HC11OP(subb_indx)(hc11_state *cpustate)
3163{
3164   UINT16 adr = FETCH(cpustate);
3165   UINT8 i = READ8(cpustate, cpustate->ix + adr);
3166   UINT16 r = REG_B - i;
3167   CLEAR_NZVC(cpustate);
3168//  SET_H(r, i, REG_B);
3169   SET_N8(r);
3170   SET_Z8(r);
3171   SET_V_SUB8(r, i, REG_B);
3172   SET_C8(r);
3173   REG_B = (UINT8)r;
3174   CYCLES(cpustate, 4);
3175}
3176
3177/* SUBB INDY        0x18 0xE0 */
3178static void HC11OP(subb_indy)(hc11_state *cpustate)
3179{
3180   UINT16 adr = FETCH(cpustate);
3181   UINT8 i = READ8(cpustate, cpustate->iy + adr);
3182   UINT16 r = REG_B - i;
3183   CLEAR_NZVC(cpustate);
3184//  SET_H(r, i, REG_B);
3185   SET_N8(r);
3186   SET_Z8(r);
3187   SET_V_SUB8(r, i, REG_B);
3188   SET_C8(r);
3189   REG_B = (UINT8)r;
3190   CYCLES(cpustate, 5);
3191}
3192
3193/* SUBD IMM         0x83 */
3194static void HC11OP(subd_imm)(hc11_state *cpustate)
3195{
3196   UINT16 i = FETCH16(cpustate);
3197   UINT32 r = REG_D - i;
3198   CLEAR_NZVC(cpustate);
3199   SET_N16(r);
3200   SET_Z16(r);
3201   SET_V_SUB16(r, i, REG_D);
3202   SET_C16(r);
3203   REG_D = (UINT16)r;
3204   CYCLES(cpustate, 4);
3205}
3206
3207/* SUBD INDX        0xA3 */
3208static void HC11OP(subd_indx)(hc11_state *cpustate)
3209{
3210   UINT8 offset = FETCH(cpustate);
3211   UINT16 i = READ16(cpustate, cpustate->ix + offset);
3212   UINT32 r = REG_D - i;
3213   CLEAR_NZVC(cpustate);
3214   SET_N16(r);
3215   SET_Z16(r);
3216   SET_V_SUB16(r, i, REG_D);
3217   SET_C16(r);
3218   REG_D = (UINT16)r;
3219   CYCLES(cpustate, 6);
3220}
3221
3222/* SUBD INDY        0x18 0xA3 */
3223static void HC11OP(subd_indy)(hc11_state *cpustate)
3224{
3225   UINT8 offset = FETCH(cpustate);
3226   UINT16 i = READ16(cpustate, cpustate->iy + offset);
3227   UINT32 r = REG_D - i;
3228   CLEAR_NZVC(cpustate);
3229   SET_N16(r);
3230   SET_Z16(r);
3231   SET_V_SUB16(r, i, REG_D);
3232   SET_C16(r);
3233   REG_D = (UINT16)r;
3234   CYCLES(cpustate, 7);
3235}
3236
3237/* SWI              0x3F */
3238static void HC11OP(swi)(hc11_state *cpustate)
3239{
3240   UINT16 pc_vector;
3241   //cpustate->pc++;
3242   PUSH16(cpustate, cpustate->pc);
3243   PUSH16(cpustate, cpustate->iy);
3244   PUSH16(cpustate, cpustate->ix);
3245   PUSH8(cpustate, REG_A);
3246   PUSH8(cpustate, REG_B);
3247   PUSH8(cpustate, cpustate->ccr);
3248   pc_vector = READ16(cpustate, 0xfff6);
3249   SET_PC(cpustate, pc_vector);
3250   cpustate->ccr |= CC_I; //irq taken, mask the flag
3251   CYCLES(cpustate, 14);
3252}
3253
20783254/* TAB              0x16 */
20793255static void HC11OP(tab)(hc11_state *cpustate)
20803256{
r5077r5078
20853261   CYCLES(cpustate, 2);
20863262}
20873263
2088
20893264/* TAP              0x06 */
20903265static void HC11OP(tap)(hc11_state *cpustate)
20913266{
r5077r5078
20943269   CYCLES(cpustate, 2);
20953270}
20963271
3272/* TBA              0x17 */
3273static void HC11OP(tba)(hc11_state *cpustate)
3274{
3275   CLEAR_NZV(cpustate);
3276   REG_A = REG_B;
3277   SET_N8(REG_A);
3278   SET_Z8(REG_A);
3279   CYCLES(cpustate, 2);
3280}
20973281
3282/* TEST              0x00 */
3283static void HC11OP(test)(hc11_state *cpustate)
3284{
3285//  if(cpustate->test_mode)
3286      SET_PC(cpustate, cpustate->ppc); // Note: docs says "incremented" but the behaviour makes me think that's actually "decremented".
3287//  else
3288//  {
3289//      TODO: execute an illegal opcode exception here (NMI)
3290//  }
3291
3292   CYCLES(cpustate, 1);
3293}
3294
20983295/* TPA              0x07 */
20993296static void HC11OP(tpa)(hc11_state *cpustate)
21003297{
r5077r5078
21543351   CYCLES(cpustate, 6);
21553352}
21563353
3354/* TSX              0x30 */
3355static void HC11OP(tsx)(hc11_state *cpustate)
3356{
3357   cpustate->ix = cpustate->sp + 1;
3358   CYCLES(cpustate, 3);
3359}
21573360
3361/* TSY              0x18 0x30 */
3362static void HC11OP(tsy)(hc11_state *cpustate)
3363{
3364   cpustate->iy = cpustate->sp + 1;
3365   CYCLES(cpustate, 4);
3366}
3367
3368/* TXS              0x35 */
3369static void HC11OP(txs)(hc11_state *cpustate)
3370{
3371   cpustate->sp = cpustate->ix - 1;
3372   CYCLES(cpustate, 3);
3373}
3374
3375/* TYS              0x18 0x35 */
3376static void HC11OP(tys)(hc11_state *cpustate)
3377{
3378   cpustate->sp = cpustate->iy - 1;
3379   CYCLES(cpustate, 4);
3380}
3381
3382/* WAI              0x3E */
3383static void HC11OP(wai)(hc11_state *cpustate)
3384{
3385   if(cpustate->wait_state == 0)
3386   {
3387      /* TODO: the following is bogus, pushes regs HERE in an instruction that wants an irq to go out? */
3388      PUSH16(cpustate, cpustate->pc);
3389      PUSH16(cpustate, cpustate->iy);
3390      PUSH16(cpustate, cpustate->ix);
3391      PUSH8(cpustate, REG_A);
3392      PUSH8(cpustate, REG_B);
3393      PUSH8(cpustate, cpustate->ccr);
3394      CYCLES(cpustate, 14);
3395      cpustate->wait_state = 1;
3396   }
3397   if(cpustate->wait_state == 1)
3398   {
3399      SET_PC(cpustate, cpustate->ppc); // wait for an exception
3400      CYCLES(cpustate, 1);
3401   }
3402   if(cpustate->wait_state == 2)
3403   {
3404      cpustate->wait_state = 0;
3405      CYCLES(cpustate, 1);
3406   }
3407}
3408
21583409/* XGDX             0x8F */
21593410static void HC11OP(xgdx)(hc11_state *cpustate)
21603411{
src/emu/cpu/mc68hc11/mc68hc11.h
r5077r5078
3030#define MC68HC11_IO_AD6            0x16
3131#define MC68HC11_IO_AD7            0x17
3232
33#define MC68HC11_IRQ_LINE         0
34
35typedef struct _hc11_config hc11_config;
36struct _hc11_config
37{
38   int has_io; // I/O enable flag
39   int internal_ram_size;
40};
41
42
3343#endif /* __MC68HC11_H__ */
src/emu/cpu/mc68hc11/hc11dasm.c
r5077r5078
463463   { "?",            0,                  },
464464   { "?",            0,                  },
465465   { "?",            0,                  },
466   { "cpy",         EA_IMM8,            },
466   { "cpy",         EA_IMM16,            },
467467   { "?",            0,                  },
468468   { "?",            0,                  },
469469   { "xgdy",         0,                  },
src/emu/cpu/mc68hc11/hc11ops.h
r5077r5078
4747   {   0,      0xf4,         HC11OP(andb_ext)         },
4848   {   0,      0xe4,         HC11OP(andb_indx)         },
4949   {   0x18,   0xe4,         HC11OP(andb_indy)         },
50   {   0,      0x48,         HC11OP(asla)            },
51   {   0,      0x58,         HC11OP(aslb)            },
52//  {   0,      0x78,           HC11OP(asl_ext)             },
53//  {   0,      0x68,           HC11OP(asl_indx)            },
54//  {   0x18,   0x68,           HC11OP(asl_indy)            },
55//  {   0,      0x47,           HC11OP(asra)                },
56//  {   0,      0x57,           HC11OP(asrb)                },
57//  {   0,      0x77,           HC11OP(asr_ext)             },
58//  {   0,      0x67,           HC11OP(asr_indx)            },
59//  {   0x18,   0x67,           HC11OP(asr_indy)            },
60   {   0,      0x24,         HC11OP(bcc)               },
61//  {   0,      0x15,           HC11OP(bclr_dir)            },
62   {   0,      0x1d,         HC11OP(bclr_indx)         },
63//  {   0x18,   0x1d,           HC11OP(bclr_indy)           },
64   {   0,      0x25,         HC11OP(bcs)               },
65   {   0,      0x27,         HC11OP(beq)               },
66//  {   0,      0x2c,           HC11OP(bge)                 },
67//  {   0,      0x2e,           HC11OP(bgt)                 },
68   {   0,      0x22,         HC11OP(bhi)               },
5069   {   0,      0x85,         HC11OP(bita_imm)         },
5170   {   0,      0x95,         HC11OP(bita_dir)         },
5271   {   0,      0xb5,         HC11OP(bita_ext)         },
r5077r5078
5776   {   0,      0xf5,         HC11OP(bitb_ext)         },
5877   {   0,      0xe5,         HC11OP(bitb_indx)         },
5978   {   0x18,   0xe5,         HC11OP(bitb_indy)         },
60   {   0,      0x25,         HC11OP(bcs)               },
61   {   0,      0x27,         HC11OP(beq)               },
79   {   0,      0x2f,         HC11OP(ble)               },
80   {   0,      0x23,         HC11OP(bls)               },
81//  {   0,      0x2d,           HC11OP(blt)                 },
82   {   0,      0x2b,         HC11OP(bmi)               },
6283   {   0,      0x26,         HC11OP(bne)               },
63   {   0,      0x2f,         HC11OP(ble)               },
6484   {   0,      0x2a,         HC11OP(bpl)               },
6585   {   0,      0x20,         HC11OP(bra)               },
86   {   0,      0x13,         HC11OP(brclr_dir)         },
87   {   0,      0x1f,         HC11OP(brclr_indx)         },
88//  {   0x18,   0x1f,           HC11OP(brclr_indy)          },
89   {   0,      0x21,         HC11OP(brn)               },
90   {   0,      0x12,         HC11OP(brset_dir)         },
91   {   0,      0x1e,         HC11OP(brset_indx)         },
92//  {   0x18,   0x1e,           HC11OP(brset_indy)          },
93//  {   0,      0x14,           HC11OP(bset_dir)            },
94   {   0,      0x1c,         HC11OP(bset_indx)         },
95//  {   0x18,   0x1c,           HC11OP(bset_indy)           },
6696   {   0,      0x8d,         HC11OP(bsr)               },
97   {   0,      0x28,         HC11OP(bvc)               },
98   {   0,      0x29,         HC11OP(bvs)               },
99   {   0,      0x11,         HC11OP(cba)               },
100   {   0,      0x0c,         HC11OP(clc)               },
67101   {   0,      0x0e,         HC11OP(cli)               },
68102   {   0,      0x4f,         HC11OP(clra)            },
69103   {   0,      0x5f,         HC11OP(clrb)            },
70104   {   0,      0x7f,         HC11OP(clr_ext)            },
71105   {   0,      0x6f,         HC11OP(clr_indx)         },
72106   {   0x18,   0x6f,         HC11OP(clr_indy)         },
107   {   0,      0x0a,         HC11OP(clv)               },
73108   {   0,      0x81,         HC11OP(cmpa_imm)         },
74109   {   0,      0x91,         HC11OP(cmpa_dir)         },
75110   {   0,      0xb1,         HC11OP(cmpa_ext)         },
76111   {   0,      0xa1,         HC11OP(cmpa_indx)         },
77   {   0x18,   0x81,         HC11OP(cmpa_indy)         },
112   {   0x18,   0xa1,         HC11OP(cmpa_indy)         },
78113   {   0,      0xc1,         HC11OP(cmpb_imm)         },
79114   {   0,      0xd1,         HC11OP(cmpb_dir)         },
80115   {   0,      0xf1,         HC11OP(cmpb_ext)         },
81116   {   0,      0xe1,         HC11OP(cmpb_indx)         },
82117   {   0x18,   0xe1,         HC11OP(cmpb_indy)         },
118   {   0,      0x43,         HC11OP(coma)            },
119   {   0,      0x53,         HC11OP(comb)            },
120//  {   0,      0x73,           HC11OP(com_ext)             },
121//  {   0,      0x63,           HC11OP(com_indx)            },
122//  {   0x18,   0x63,           HC11OP(com_indy)            },
83123   {   0x1a,   0x83,         HC11OP(cpd_imm)            },
84124   {   0x1a,   0x93,         HC11OP(cpd_dir)            },
85125   {   0x1a,   0xb3,         HC11OP(cpd_ext)            },
r5077r5078
91131   {   0,      0xac,         HC11OP(cpx_indx)         },
92132   {   0xcd,   0xac,         HC11OP(cpx_indy)         },
93133   {   0x18,   0x8c,         HC11OP(cpy_imm)            },
134   {   0x18,   0x9c,         HC11OP(cpy_dir)            },
135   {   0x18,   0xbc,         HC11OP(cpy_ext)            },
136   {   0x1a,   0xac,         HC11OP(cpy_indx)         },
137   {   0x18,   0xac,         HC11OP(cpy_indy)         },
138//  {   0,      0x19,           HC11OP(daa)                 },
139   {   0,      0x4a,         HC11OP(deca)            },
140   {   0,      0x5a,         HC11OP(decb)            },
141   {   0,      0x7a,         HC11OP(dec_ext)            },
142   {   0,      0x6a,         HC11OP(dec_indx)         },
143   {   0x18,   0x6a,         HC11OP(dec_indy)         },
144//  {   0,      0x34,           HC11OP(des)                 },
94145   {   0,      0x09,         HC11OP(dex)               },
95146   {   0x18,   0x09,         HC11OP(dey)               },
96147   {   0,      0x88,         HC11OP(eora_imm)         },
r5077r5078
103154   {   0,      0xf8,         HC11OP(eorb_ext)         },
104155   {   0,      0xe8,         HC11OP(eorb_indx)         },
105156   {   0x18,   0xe8,         HC11OP(eorb_indy)         },
157//  {   0,      0x03,           HC11OP(fdiv)                },
158   {   0,      0x02,         HC11OP(idiv)            },
106159   {   0,      0x4c,         HC11OP(inca)            },
160   {   0,      0x5c,         HC11OP(incb)            },
161   {   0,      0x7c,         HC11OP(inc_ext)            },
162   {   0,      0x6c,         HC11OP(inc_indx)         },
163   {   0x18,   0x6c,         HC11OP(inc_indy)         },
164//  {   0,      0x31,           HC11OP(ins)                 },
107165   {   0,      0x08,         HC11OP(inx)               },
108166   {   0x18,   0x08,         HC11OP(iny)               },
109167   {   0,      0x7e,         HC11OP(jmp_ext)            },
168   {   0,      0x6e,         HC11OP(jmp_indx)         },
169   {   0x18,   0x6e,         HC11OP(jmp_indy)         },
110170   {   0,      0x9d,         HC11OP(jsr_dir)            },
111171   {   0,      0xbd,         HC11OP(jsr_ext)            },
112172   {   0,      0xad,         HC11OP(jsr_indx)         },
r5077r5078
142202   {   0x1a,   0xee,         HC11OP(ldy_indx)         },
143203   {   0x18,   0xee,         HC11OP(ldy_indy)         },
144204   {   0,      0x05,         HC11OP(lsld)            },
205   {   0,      0x44,         HC11OP(lsra)            },
206   {   0,      0x54,         HC11OP(lsrb)            },
207//  {   0,      0x74,           HC11OP(lsr_ext)             },
208//  {   0,      0x64,           HC11OP(lsr_indx)            },
209//  {   0x18,   0x64,           HC11OP(lsr_indy)            },
210   {   0,      0x04,         HC11OP(lsrd)            },
211   {   0,      0x3d,         HC11OP(mul)               },
212   {   0,      0x40,         HC11OP(nega)            },
213   {   0,      0x50,         HC11OP(negb)            },
214   {   0,      0x70,         HC11OP(neg_ext)            },
215   {   0,      0x60,         HC11OP(neg_indx)         },
216   {   0x18,   0x60,         HC11OP(neg_indy)         },
217   {   0,      0x01,         HC11OP(nop)               },
145218   {   0,      0x8a,         HC11OP(oraa_imm)         },
146219   {   0,      0x9a,         HC11OP(oraa_dir)         },
147220   {   0,      0xba,         HC11OP(oraa_ext)         },
r5077r5078
160233   {   0,      0x33,         HC11OP(pulb)            },
161234   {   0,      0x38,         HC11OP(pulx)            },
162235   {   0x18,   0x38,         HC11OP(puly)            },
236   {   0,      0x49,         HC11OP(rola)            },
237   {   0,      0x59,         HC11OP(rolb)            },
238//  {   0,      0x79,           HC11OP(rol_ext)             },
239//  {   0,      0x69,           HC11OP(rol_indx)            },
240//  {   0x18,   0x69,           HC11OP(rol_indy)            },
241   {   0,      0x46,         HC11OP(rora)            },
242   {   0,      0x56,         HC11OP(rorb)            },
243//  {   0,      0x76,           HC11OP(ror_ext)             },
244//  {   0,      0x66,           HC11OP(ror_indx)            },
245//  {   0x18,   0x66,           HC11OP(ror_indy)            },
246   {   0,      0x3b,         HC11OP(rti)               },
163247   {   0,      0x39,         HC11OP(rts)               },
248   {   0,      0x10,         HC11OP(sba)               },
249   {   0,      0x82,         HC11OP(sbca_imm)         },
250//  {   0,      0x92,           HC11OP(sbca_dir)            },
251//  {   0,      0xb2,           HC11OP(sbca_ext)            },
252   {   0,      0xa2,         HC11OP(sbca_indx)         },
253   {   0x18,   0xa2,         HC11OP(sbca_indy)         },
254   {   0,      0xc2,         HC11OP(sbcb_imm)         },
255//  {   0,      0xd2,           HC11OP(sbcb_dir)            },
256//  {   0,      0xf2,           HC11OP(sbcb_ext)            },
257   {   0,      0xe2,         HC11OP(sbcb_indx)         },
258   {   0x18,   0xe2,         HC11OP(sbcb_indy)         },
259   {   0,      0x0d,         HC11OP(sec)               },
164260   {   0,      0x0f,         HC11OP(sei)               },
261   {   0,      0x0b,         HC11OP(sev)               },
165262   {   0,      0x97,         HC11OP(staa_dir)         },
166263   {   0,      0xb7,         HC11OP(staa_ext)         },
167264   {   0,      0xa7,         HC11OP(staa_indx)         },
r5077r5078
174271   {   0,      0xfd,         HC11OP(std_ext)            },
175272   {   0,      0xed,         HC11OP(std_indx)         },
176273   {   0x18,   0xed,         HC11OP(std_indy)         },
274//  {   0,      0x9f,           HC11OP(sts_dir)             },
275//  {   0,      0xbf,           HC11OP(sts_ext)             },
276//  {   0,      0xaf,           HC11OP(sts_indx)            },
277//  {   0x18,   0xaf,           HC11OP(sts_indy)            },
278//  {   0,      0xdf,           HC11OP(stx_dir)             },
279   {   0,      0xff,         HC11OP(stx_ext)            },
280   {   0,      0xef,         HC11OP(stx_indx)         },
281   {   0xcd,   0xef,         HC11OP(stx_indy)         },
282//  {   0x18,   0xdf,           HC11OP(sty_dir)             },
283   {   0x18,   0xff,         HC11OP(sty_ext)            },
284   {   0x1a,   0xef,         HC11OP(sty_indx)         },
285   {   0x18,   0xef,         HC11OP(sty_indy)         },
286   {   0,      0xcf,         HC11OP(stop)            },
287   {   0,      0x80,         HC11OP(suba_imm)         },
288   {   0,      0x90,         HC11OP(suba_dir)         },
289   {   0,      0xb0,         HC11OP(suba_ext)         },
290   {   0,      0xa0,         HC11OP(suba_indx)         },
291   {   0x18,   0xa0,         HC11OP(suba_indy)         },
292   {   0,      0xc0,         HC11OP(subb_imm)         },
293   {   0,      0xd0,         HC11OP(subb_dir)         },
294   {   0,      0xf0,         HC11OP(subb_ext)         },
295   {   0,      0xe0,         HC11OP(subb_indx)         },
296   {   0x18,   0xe0,         HC11OP(subb_indy)         },
297   {   0,      0x83,         HC11OP(subd_imm)         },
298//  {   0,      0x93,           HC11OP(subd_dir)            },
299//  {   0,      0xb3,           HC11OP(subd_ext)            },
300   {   0,      0xa3,         HC11OP(subd_indx)         },
301   {   0x18,   0xa3,         HC11OP(subd_indy)         },
302   {   0,      0x3f,         HC11OP(swi)               },
177303   {   0,      0x16,         HC11OP(tab)               },
178304   {   0,      0x06,         HC11OP(tap)               },
305   {   0,      0x17,         HC11OP(tba)               },
306   {   0,      0x00,         HC11OP(test)            },
179307   {   0,      0x07,         HC11OP(tpa)               },
180308   {   0,      0x4d,         HC11OP(tsta)            },
181309   {   0,      0x5d,         HC11OP(tstb)            },
182310   {   0,      0x7d,         HC11OP(tst_ext)            },
183311   {   0,      0x6d,         HC11OP(tst_indx)         },
184312   {   0x18,   0x6d,         HC11OP(tst_indy)         },
313   {   0,      0x30,         HC11OP(tsx)               },
314   {   0x18,   0x30,         HC11OP(tsy)               },
315   {   0,      0x35,         HC11OP(txs)               },
316   {   0x18,   0x35,         HC11OP(tys)               },
317   {   0,      0x3e,         HC11OP(wai)               },
185318   {   0,      0x8f,         HC11OP(xgdx)            },
186319   {   0x18,   0x8f,         HC11OP(xgdy)            },
187320
src/emu/cpu/mc68hc11/mc68hc11.c
r5077r5078
11/*
22   Motorola MC68HC11 emulator
33
4   Written by Ville Linde
4   Written by Ville Linde & Angelo Salese
5
6TODO:
7- Interrupts handling is really bare-bones, just to make Hit Poker happy;
8- Complete opcodes hook-up;
9- Emulate the MC68HC12 (same as HC11 with a bunch of new opcodes);
10
511 */
612
713#include "debugger.h"
r5077r5078
5359   int ad_channel;
5460
5561   cpu_irq_callback irq_callback;
62   UINT8 irq_state[2];
5663   const device_config *device;
5764   const address_space *program;
5865   const address_space *io;
r5077r5078
6067   int ram_position;
6168   int reg_position;
6269   UINT8 *internal_ram;
70   int has_io; // I/O enable flag
6371   int internal_ram_size;
72   UINT8 wait_state,stop_state;
6473};
6574
6675INLINE hc11_state *get_safe_token(const device_config *device)
r5077r5078
8796         return memory_read_byte(cpustate->io, MC68HC11_IO_PORTA);
8897      case 0x01:      /* DDRA */
8998         return 0;
99      case 0x02:      /* PIOC */
100         return 0;
90101      case 0x09:      /* DDRD */
91102         return 0;
92103      case 0x28:      /* SPCR1 */
r5077r5078
167178         return 0;
168179   }
169180
170   fatalerror("HC11: regs_r %02X", reg);
181   logerror("HC11: regs_r %02X\n", reg);
171182   return 0; // Dummy
172183}
173184
r5077r5078
256267         return;
257268
258269   }
259   fatalerror("HC11: regs_w %02X, %02X", reg, value);
270
271   logerror("HC11: regs_w %02X, %02X\n", reg, value);
260272}
261273
262274/*****************************************************************************/
r5077r5078
276288
277289INLINE UINT8 READ8(hc11_state *cpustate, UINT32 address)
278290{
279   if(address >= cpustate->reg_position && address < cpustate->reg_position+0x100)
291   if(address >= cpustate->reg_position && address < cpustate->reg_position+0x100 && cpustate->has_io)
280292   {
281293      return hc11_regs_r(cpustate, address);
282294   }
r5077r5078
289301
290302INLINE void WRITE8(hc11_state *cpustate, UINT32 address, UINT8 value)
291303{
292   if(address >= cpustate->reg_position && address < cpustate->reg_position+0x100)
304   if(address >= cpustate->reg_position && address < cpustate->reg_position+0x100 && cpustate->has_io)
293305   {
294306      hc11_regs_w(cpustate, address, value);
295307      return;
r5077r5078
328340   hc11_state *cpustate = get_safe_token(device);
329341   int i;
330342
343   const hc11_config *conf = (const hc11_config *)device->static_config;
344
331345   /* clear the opcode tables */
332346   for(i=0; i < 256; i++) {
333347      hc11_optable[i] = HC11OP(invalid);
r5077r5078
355369      }
356370   }
357371
358   cpustate->internal_ram_size = 1280;      /* FIXME: this is for MC68HC11M0 */
372   if(conf)
373   {
374      cpustate->has_io = conf->has_io;
375      cpustate->internal_ram_size = conf->internal_ram_size;
376   }
377   else
378   {
379      /* defaults it to the HC11M0 version for now (I might strip this down on a later date) */
380      cpustate->has_io = 1;
381      cpustate->internal_ram_size = 1280;
382   }
383
359384   cpustate->internal_ram = auto_alloc_array(device->machine, UINT8, cpustate->internal_ram_size);
360385
361386   cpustate->reg_position = 0;
r5077r5078
370395{
371396   hc11_state *cpustate = get_safe_token(device);
372397   cpustate->pc = READ16(cpustate, 0xfffe);
398   cpustate->wait_state = 0;
399   cpustate->stop_state = 0;
373400}
374401
375402static CPU_EXIT( hc11 )
r5077r5078
377404
378405}
379406
407/*
408IRQ table vectors:
4090xffd6: SCI
4100xffd8: SPI
4110xffda: Pulse Accumulator Input Edge
4120xffdc: Pulse Accumulator Overflow
4130xffde: Timer Overflow
4140xffe0: Timer Output Capture 5
4150xffe2: Timer Output Capture 4
4160xffe4: Timer Output Capture 3
4170xffe6: Timer Output Capture 2
4180xffe8: Timer Output Capture 1
4190xffea: Timer Input Capture 3
4200xffec: Timer Input Capture 2
4210xffee: Timer Input Capture 1
4220xfff0: Real Time Int
4230xfff2: IRQ
4240xfff4: XIRQ
4250xfff6: SWI (Trap IRQ)
4260xfff8: Illegal Opcode (NMI)
4270xfffa: CO-Processor Fail
4280xfffc: Clock Monitor
4290xfffe: RESET
430*/
431
432static void check_irq_lines(hc11_state *cpustate)
433{
434   if( cpustate->irq_state[MC68HC11_IRQ_LINE]!=CLEAR_LINE && (!(cpustate->ccr & CC_I)) )
435   {
436      UINT16 pc_vector;
437
438      if(cpustate->wait_state == 0)
439      {
440         PUSH16(cpustate, cpustate->pc);
441         PUSH16(cpustate, cpustate->iy);
442         PUSH16(cpustate, cpustate->ix);
443         PUSH8(cpustate, REG_A);
444         PUSH8(cpustate, REG_B);
445         PUSH8(cpustate, cpustate->ccr);
446      }
447      pc_vector = READ16(cpustate, 0xfff2);
448      SET_PC(cpustate, pc_vector);
449      cpustate->ccr |= CC_I; //irq taken, mask the flag
450      if(cpustate->wait_state == 1) { cpustate->wait_state = 2; }
451      if(cpustate->stop_state == 1) { cpustate->stop_state = 2; }
452      (void)(*cpustate->irq_callback)(cpustate->device, MC68HC11_IRQ_LINE);
453   }
454}
455
456static void set_irq_line(hc11_state *cpustate, int irqline, int state)
457{
458   cpustate->irq_state[irqline] = state;
459   if (state == CLEAR_LINE) return;
460   check_irq_lines(cpustate);
461}
462
380463static CPU_EXECUTE( hc11 )
381464{
382465   hc11_state *cpustate = get_safe_token(device);
r5077r5078
387470   {
388471      UINT8 op;
389472
473      check_irq_lines(cpustate);
474
390475      cpustate->ppc = cpustate->pc;
391476      debugger_instruction_hook(device, cpustate->pc);
392477
r5077r5078
405490
406491   switch (state)
407492   {
493      case CPUINFO_INT_INPUT_STATE + MC68HC11_IRQ_LINE:   set_irq_line(cpustate, MC68HC11_IRQ_LINE, info->i);      break;
494
408495      /* --- the following bits of info are set as 64-bit signed integers --- */
409496      case CPUINFO_INT_PC:                     cpustate->pc = info->i;                  break;
410      case CPUINFO_INT_REGISTER + HC11_PC:         cpustate->pc = info->i;                   break;
497      case CPUINFO_INT_REGISTER + HC11_PC:         cpustate->pc = info->i;                break;
411498      case CPUINFO_INT_REGISTER + HC11_SP:         cpustate->sp = info->i;                  break;
412499      case CPUINFO_INT_REGISTER + HC11_A:            cpustate->d.d8.a = info->i;               break;
413500      case CPUINFO_INT_REGISTER + HC11_B:            cpustate->d.d8.b = info->i;               break;
r5077r5078
423510   switch(state)
424511   {
425512      /* --- the following bits of info are returned as 64-bit signed integers --- */
426      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(hc11_state);         break;
427      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
428      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
429      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_BIG;               break;
430      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
431      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
432      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
433      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5;                     break;
434      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
435      case CPUINFO_INT_MAX_CYCLES:               info->i = 41;                     break;
513      case CPUINFO_INT_CONTEXT_SIZE:                  info->i = sizeof(hc11_state);   break;
514      case CPUINFO_INT_INPUT_LINES:                  info->i = 1;               break;
515      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:            info->i = 0;               break;
516      case CPUINFO_INT_ENDIANNESS:                  info->i = ENDIANNESS_BIG;      break;
517      case CPUINFO_INT_CLOCK_MULTIPLIER:               info->i = 1;               break;
518      case CPUINFO_INT_CLOCK_DIVIDER:                  info->i = 1;               break;
519      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:            info->i = 1;               break;
520      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:            info->i = 5;               break;
521      case CPUINFO_INT_MIN_CYCLES:                  info->i = 1;               break;
522      case CPUINFO_INT_MAX_CYCLES:                  info->i = 41;               break;
436523
437      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:   info->i = 8;               break;
438      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16;               break;
439      case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0;               break;
440      case CPUINFO_INT_DATABUS_WIDTH_DATA:   info->i = 0;               break;
441      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:    info->i = 0;               break;
442      case CPUINFO_INT_ADDRBUS_SHIFT_DATA:    info->i = 0;               break;
443      case CPUINFO_INT_DATABUS_WIDTH_IO:      info->i = 8;               break;
444      case CPUINFO_INT_ADDRBUS_WIDTH_IO:       info->i = 8;               break;
445      case CPUINFO_INT_ADDRBUS_SHIFT_IO:       info->i = 0;               break;
524      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:            info->i = 8;               break;
525      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM:          info->i = 16;               break;
526      case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM:          info->i = 0;               break;
527      case CPUINFO_INT_DATABUS_WIDTH_DATA:            info->i = 0;               break;
528      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:             info->i = 0;               break;
529      case CPUINFO_INT_ADDRBUS_SHIFT_DATA:             info->i = 0;               break;
530      case CPUINFO_INT_DATABUS_WIDTH_IO:               info->i = 8;               break;
531      case CPUINFO_INT_ADDRBUS_WIDTH_IO:                info->i = 8;               break;
532      case CPUINFO_INT_ADDRBUS_SHIFT_IO:                info->i = 0;               break;
446533
447      case CPUINFO_INT_INPUT_STATE:               info->i = CLEAR_LINE;               break;
534      case CPUINFO_INT_INPUT_STATE + MC68HC11_IRQ_LINE:   info->i = cpustate->irq_state[MC68HC11_IRQ_LINE]; break;
448535
449      case CPUINFO_INT_PREVIOUSPC:               /* not implemented */               break;
536      case CPUINFO_INT_PREVIOUSPC:                  /* not implemented */         break;
450537
451538      case CPUINFO_INT_PC:   /* intentional fallthrough */
452      case CPUINFO_INT_REGISTER + HC11_PC:         info->i = cpustate->pc;                  break;
453      case CPUINFO_INT_REGISTER + HC11_SP:         info->i = cpustate->sp;                  break;
454      case CPUINFO_INT_REGISTER + HC11_A:            info->i = cpustate->d.d8.a;               break;
455      case CPUINFO_INT_REGISTER + HC11_B:            info->i = cpustate->d.d8.b;               break;
456      case CPUINFO_INT_REGISTER + HC11_IX:         info->i = cpustate->ix;                  break;
457      case CPUINFO_INT_REGISTER + HC11_IY:         info->i = cpustate->iy;                  break;
539      case CPUINFO_INT_REGISTER + HC11_PC:         info->i = cpustate->pc;            break;
540      case CPUINFO_INT_REGISTER + HC11_SP:         info->i = cpustate->sp;            break;
541      case CPUINFO_INT_REGISTER + HC11_A:            info->i = cpustate->d.d8.a;         break;
542      case CPUINFO_INT_REGISTER + HC11_B:            info->i = cpustate->d.d8.b;         break;
543      case CPUINFO_INT_REGISTER + HC11_IX:         info->i = cpustate->ix;            break;
544      case CPUINFO_INT_REGISTER + HC11_IY:         info->i = cpustate->iy;            break;
458545
459546      /* --- the following bits of info are returned as pointers to data or functions --- */
460547      case CPUINFO_FCT_SET_INFO:                  info->setinfo = CPU_SET_INFO_NAME(mc68hc11);      break;
src/emu/cpu/powerpc/ppcdrc.c
r5077r5078
21062106   {
21072107      if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP))
21082108      {
2109         void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc);
2109         void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc ^ ppc->codexor);
21102110         UML_LOAD(block, IREG(0), base, IMM(0), DWORD);                           // load    i0,base,dword
21112111         UML_CMP(block, IREG(0), IMM(seqhead->opptr.l[0]));                        // cmp     i0,*opptr
21122112         UML_EXHc(block, IF_NE, ppc->impstate->nocode, IMM(seqhead->pc));            // exne    nocode,seqhead->pc
r5077r5078
21202120      for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next)
21212121         if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
21222122         {
2123            void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc);
2123            void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc ^ ppc->codexor);
21242124            UML_LOAD(block, IREG(0), base, IMM(0), DWORD);                        // load    i0,base,dword
21252125            UML_CMP(block, IREG(0), IMM(curdesc->opptr.l[0]));                     // cmp     i0,*opptr
21262126            UML_EXHc(block, IF_NE, ppc->impstate->nocode, IMM(seqhead->pc));         // exne    nocode,seqhead->pc
21272127         }
21282128#else
21292129      UINT32 sum = 0;
2130      void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc);
2130      void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc ^ ppc->codexor);
21312131      UML_LOAD(block, IREG(0), base, IMM(0), DWORD);                              // load    i0,base,dword
21322132      sum += seqhead->opptr.l[0];
21332133      for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next)
21342134         if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
21352135         {
2136            base = memory_decrypted_read_ptr(ppc->program, curdesc->physpc);
2136            base = memory_decrypted_read_ptr(ppc->program, curdesc->physpc ^ ppc->codexor);
21372137            UML_LOAD(block, IREG(1), base, IMM(0), DWORD);                        // load    i1,base,dword
21382138            UML_ADD(block, IREG(0), IREG(0), IREG(1));                           // add     i0,i0,i1
21392139            sum += curdesc->opptr.l[0];
src/emu/cpu/tms32010/32010dsm.c
r5077r5078
211211         fatalerror("not enough bits in encoding '%s %s' %d",
212212            ops[0],ops[1],bit);
213213      }
214      while (isspace(*p)) p++;
214      while (isspace((UINT8)*p)) p++;
215215      if (*p) Op[i].extcode = *p;
216216      Op[i].bits = bits;
217217      Op[i].mask = mask;
src/emu/cpu/alph8201/8201dasm.c
r5077r5078
321321      Op[i].type  = type;
322322
323323      /* 2 byte code ? */
324      while (isspace(*p)) p++;
324      while (isspace((UINT8)*p)) p++;
325325      if( (*p) )
326326         Op[i].type |= 0x10;
327327      /* number of param */
src/emu/cpu/tms9900/99xxcore.h
r5077r5078
14951495         }
14961496      }
14971497
1498      if ((device->machine->debug_flags & DEBUG_FLAG_CALL_HOOK) != 0)
1499      {
1500         #if 0      /* Trace */
1501         logerror("> PC %4.4x :%4.4x %4.4x : R=%4.4x %4.4x %4.4x %4.4x %4.4x %4.4x %4.4x %4.4x %4.4x %4.4x%4.4x %4.4x %4.4x %4.4x %4.4x %4.4x :T=%d\n",cpustate->PC,cpustate->STATUS,cpustate->WP,cpustate->FR[0],cpustate->FR[1],cpustate->FR[2],cpustate->FR[3],cpustate->FR[4],cpustate->FR[5],cpustate->FR[6],cpustate->FR[7],cpustate->FR[8],cpustate->FR[9],cpustate->FR[10],cpustate->FR[11],cpustate->FR[12],cpustate->FR[13],cpustate->FR[14],cpustate->FR[15],cpustate->icount);
1502            #if 0   /* useful with TI99/4a driver */
1503            #ifdef MESS
1504            if (cpustate->PC == 0x0078)
1505            {
1506               extern struct
1507               {
1508                  /* pointer to GROM data */
1509                  UINT8 *data_ptr;
1510                  /* current address pointer for the active GROM in port (16 bits) */
1511                  unsigned int addr;
1512                  /* GROM data buffer */
1513                  UINT8 buf;
1514                  /* internal flip-flops that are set after the first access to the GROM
1515                       address so that next access is mapped to the LSB, and cleared after each
1516                       data access */
1517                  char raddr_LSB, waddr_LSB;
1518               } console_GROMs;
1519               logerror("> GPL pointer %4.4X\n", console_GROMs.addr);
1520            }
1521            #endif
1522            #endif
1523         #endif
1498      debugger_instruction_hook(device, cpustate->PC);
15241499
1525         debugger_instruction_hook(device, cpustate->IR);
1526      }
1527
15281500      if (cpustate->IDLE)
15291501      {   /* IDLE instruction has halted execution */
15301502         #if EXTERNAL_INSTRUCTION_DECODING
src/emu/cpu/tms32025/32025dsm.c
r5077r5078
373373         fatalerror("not enough bits in encoding '%s %s' %d",
374374            ops[0],ops[1],bit);
375375      }
376      while (isspace(*p)) p++;
376      while (isspace((UINT8)*p)) p++;
377377      if (*p) Op[i].extcode = *p;
378378      Op[i].bits = bits;
379379      Op[i].mask = mask;
src/emu/cpu/pic16c5x/16c5xdsm.c
r5077r5078
137137         fatalerror("not enough bits in encoding '%s %s' %d",
138138            ops[0],ops[1],bit);
139139      }
140      while (isspace(*p)) p++;
140      while (isspace((UINT8)*p)) p++;
141141      if (*p) Op[i].extcode = *p;
142142      Op[i].bits = bits;
143143      Op[i].mask = mask;
src/emu/hash.c
r5077r5078
278278      c1 = *chk1++;
279279      c2 = *chk2++;
280280
281      if (tolower(c1) != tolower(c2))
281      if (tolower((UINT8)c1) != tolower((UINT8)c2))
282282         return 0;
283283      if (!c1)
284284         return 0;
r5077r5078
381381
382382   // Copy the checksum (and make it lowercase)
383383   for (i=0;i<info->size*2;i++)
384      checksum[i] = tolower(data[i]);
384      checksum[i] = tolower((UINT8)data[i]);
385385
386386   checksum[info->size*2] = '\0';
387387
r5077r5078
395395
396396   for (i = 0; i < size * 2; i++)
397397   {
398      c = tolower(*data++);
398      c = tolower((UINT8)*data++);
399399
400400      if (c >= '0' && c <= '9')
401401         c -= '0';
r5077r5078
590590
591591         strcpy(temp, hash_function_name(func));
592592         for (j = 0; temp[j]; j++)
593            temp[j] = toupper(temp[j]);
593            temp[j] = toupper((UINT8)temp[j]);
594594         strcat(buffer, temp);
595595         strcat(buffer, "(");
596596
r5077r5078
637637
638638         for (i = 0; (hash[i] != '#') && (i < len); i++)
639639         {
640            if (!isxdigit(hash[i]))
640            if (!isxdigit((UINT8)hash[i]))
641641               return FALSE;
642642         }
643643         if (hash[i] != '#')
src/emu/uimenu.c
r5077r5078
32443244               /* look for files ending in .png with a name not larger then 9 chars*/
32453245               if ((length > 4) && (length <= CROSSHAIR_PIC_NAME_LENGTH + 4) &&
32463246                  dir->name[length - 4] == '.' &&
3247                  tolower(dir->name[length - 3]) == 'p' &&
3248                  tolower(dir->name[length - 2]) == 'n' &&
3249                  tolower(dir->name[length - 1]) == 'g')
3247                  tolower((UINT8)dir->name[length - 3]) == 'p' &&
3248                  tolower((UINT8)dir->name[length - 2]) == 'n' &&
3249                  tolower((UINT8)dir->name[length - 1]) == 'g')
32503250
32513251               {
32523252                  /* remove .png from length */
r5077r5078
35573557
35583558         /* build a name for it */
35593559         for (src = dir->name; *src != 0 && *src != '.' && dst < &drivername[ARRAY_LENGTH(drivername) - 1]; src++)
3560            *dst++ = tolower(*src);
3560            *dst++ = tolower((UINT8)*src);
35613561         *dst = 0;
35623562
35633563         /* find it in the array */
src/emu/inputseq.c
r5077r5078
527527      char *strtemp;
528528
529529      /* trim any leading spaces */
530      while (*str != 0 && isspace(*str))
530      while (*str != 0 && isspace((UINT8)*str))
531531         str++;
532532
533533      /* bail if we're done */
r5077r5078
538538      }
539539
540540      /* find the end of the token and make it upper-case along the way */
541      for (strtemp = str; *strtemp != 0 && !isspace(*strtemp); strtemp++)
542         *strtemp = toupper(*strtemp);
541      for (strtemp = str; *strtemp != 0 && !isspace((UINT8)*strtemp); strtemp++)
542         *strtemp = toupper((UINT8)*strtemp);
543543      origspace = *strtemp;
544544      *strtemp = 0;
545545
src/emu/driver.c
r5077r5078
205205   for ( ; *source && *target; target++)
206206   {
207207      /* do a case insensitive match */
208      int match = (tolower(*source) == tolower(*target));
208      int match = (tolower((UINT8)*source) == tolower((UINT8)*target));
209209
210210      /* if we matched, advance the source */
211211      if (match)
src/emu/cheat.c
r5077r5078
465465   {
466466      if (description != NULL)
467467      {
468         while (isspace(**description))
468         while (isspace((UINT8)**description))
469469            *description += 1;
470470         if (**description == 0)
471471            *description = MENU_SEPARATOR_ITEM;
src/emu/validity.c
r5077r5078
176176
177177   for (p = tag; *p != 0; p++)
178178   {
179      if (*p != tolower(*p))
179      if (*p != tolower((UINT8)*p))
180180      {
181181         mame_printf_error("%s: %s has %s with tag '%s' containing upper-case characters\n", driver->source_file, driver->name, object, tag);
182182         error = TRUE;
r5077r5078
532532
533533   /* make sure the year is only digits, '?' or '+' */
534534   for (s = driver->year; *s; s++)
535      if (!isdigit(*s) && *s != '?' && *s != '+')
535      if (!isdigit((UINT8)*s) && *s != '?' && *s != '+')
536536      {
537537         mame_printf_error("%s: %s has an invalid year '%s'\n", driver->source_file, driver->name, driver->year);
538538         error = TRUE;
r5077r5078
702702
703703            /* make sure it's all lowercase */
704704            for (s = last_name; *s; s++)
705               if (tolower(*s) != *s)
705               if (tolower((UINT8)*s) != *s)
706706               {
707707                  mame_printf_error("%s: %s has upper case ROM name %s\n", driver->source_file, driver->name, last_name);
708708                  error = TRUE;
src/lib/util/corestr.c
r5077r5078
1010****************************************************************************/
1111
1212#include "corestr.h"
13#include "osdcore.h"
1314#include <ctype.h>
1415#include <stdlib.h>
1516
r5077r5078
2223{
2324   for (;;)
2425    {
25      int c1 = tolower(*s1++);
26      int c2 = tolower(*s2++);
26      int c1 = tolower((UINT8)*s1++);
27      int c2 = tolower((UINT8)*s2++);
2728      if (c1 == 0 || c1 != c2)
2829         return c1 - c2;
2930    }
r5077r5078
3940   size_t i;
4041   for (i = 0; i < n; i++)
4142    {
42      int c1 = tolower(*s1++);
43      int c2 = tolower(*s2++);
43      int c1 = tolower((UINT8)*s1++);
44      int c2 = tolower((UINT8)*s2++);
4445      if (c1 == 0 || c1 != c2)
4546         return c1 - c2;
4647    }
src/lib/util/xmlfile.c
r5077r5078
103103   if (newstr != NULL)
104104   {
105105      for (i = 0; input[i] != 0; i++)
106         newstr[i] = tolower(input[i]);
106         newstr[i] = tolower((UINT8)input[i]);
107107      newstr[i] = 0;
108108   }
109109
r5077r5078
710710      char *end = start + strlen(start);
711711
712712      /* first strip leading spaces */
713      while (*start && isspace(*start))
713      while (*start && isspace((UINT8)*start))
714714         start++;
715715
716716      /* then strip trailing spaces */
717      while (end > start && isspace(end[-1]))
717      while (end > start && isspace((UINT8)end[-1]))
718718         end--;
719719
720720      /* if nothing left, just free it */
src/lib/util/astring.c
r5077r5078
498498   const char *s1 = str1->text;
499499
500500   /* loop while equal until we hit the end of strings */
501   while (*s1 != 0 && *str2 != 0 && tolower(*s1) == tolower(*str2))
501   while (*s1 != 0 && *str2 != 0 && tolower((UINT8)*s1) == tolower((UINT8)*str2))
502502      s1++, str2++;
503   return tolower(*s1) - tolower(*str2);
503   return tolower((UINT8)*s1) - tolower((UINT8)*str2);
504504}
505505
506506
r5077r5078
515515   int result;
516516
517517   /* loop while equal until we hit the end of strings */
518   while (count-- > 0 && *s1 != 0 && *str2 != 0 && tolower(*s1) == tolower(*str2))
518   while (count-- > 0 && *s1 != 0 && *str2 != 0 && tolower((UINT8)*s1) == tolower((UINT8)*str2))
519519      s1++, str2++;
520   result = (count == -1) ? 0 : tolower(*s1) - tolower(*str2);
520   result = (count == -1) ? 0 : tolower((UINT8)*s1) - tolower((UINT8)*str2);
521521   if (result == 0 && *s1 != 0)
522522      result = 1;
523523   return result;
r5077r5078
669669
670670   /* just toupper() on all characters */
671671   for (text = str->text; *text != 0; text++)
672      *text = toupper(*text);
672      *text = toupper((UINT8)*text);
673673
674674   return str;
675675}
r5077r5078
686686
687687   /* just tolower() on all characters */
688688   for (text = str->text; *text != 0; text++)
689      *text = tolower(*text);
689      *text = tolower((UINT8)*text);
690690
691691   return str;
692692}
r5077r5078
702702   char *ptr;
703703
704704   /* first remove stuff from the end */
705   for (ptr = str->text + strlen(str->text) - 1; ptr >= str->text && (!(*ptr & 0x80) && isspace(*ptr)); ptr--)
705   for (ptr = str->text + strlen(str->text) - 1; ptr >= str->text && (!(*ptr & 0x80) && isspace((UINT8)*ptr)); ptr--)
706706      *ptr = 0;
707707
708708   /* then count how much to remove from the beginning */
709   for (ptr = str->text; *ptr != 0 && (!(*ptr & 0x80) && isspace(*ptr)); ptr++) ;
709   for (ptr = str->text; *ptr != 0 && (!(*ptr & 0x80) && isspace((UINT8)*ptr)); ptr++) ;
710710   if (ptr > str->text)
711711      astring_substr(str, ptr - str->text, -1);
712712
src/lib/util/corefile.c
r5077r5078
884884
885885   /* work backwards checking for a match */
886886   while (extlen > 0)
887      if (tolower(filename[--namelen]) != tolower(extension[--extlen]))
887      if (tolower((UINT8)filename[--namelen]) != tolower((UINT8)extension[--extlen]))
888888      {
889889         matches = FALSE;
890890         break;
src/lib/util/options.c
r5077r5078
483483
484484      /* find the name */
485485      for (optionname = buffer; *optionname != 0; optionname++)
486         if (!isspace(*optionname))
486         if (!isspace((UINT8)*optionname))
487487            break;
488488
489489      /* skip comments */
r5077r5078
492492
493493      /* scan forward to find the first space */
494494      for (temp = optionname; *temp != 0; temp++)
495         if (isspace(*temp))
495         if (isspace((UINT8)*temp))
496496            break;
497497
498498      /* if we hit the end early, print a warning and continue */
r5077r5078
973973   int i;
974974
975975   /* strip off leading/trailing spaces */
976   while (isspace(*datastart) && datastart <= dataend)
976   while (isspace((UINT8)*datastart) && datastart <= dataend)
977977      datastart++;
978   while (isspace(*dataend) && datastart <= dataend)
978   while (isspace((UINT8)*dataend) && datastart <= dataend)
979979      dataend--;
980980
981981   /* strip off quotes */
docs/messnew.txt
r5077r5078
4949
5050Source Changes:
5151----------------
52- The core is based on MAME 0.132u1.  This incorporates all features of the
52- The core is based on MAME 0.132u2.  This incorporates all features of the
5353  update to this core.  [MAME team]
5454
5555- Added support for passing around 'deleted address mark' information
whatsnew.txt
r5077r5078
11681168  [Smitdogg, cricri_pingouin, incog, B. Sparks, ANY]
11691169Streets of Rage (Mega-Tech)
11701170  [Smitdogg, cricri_pingouin, incog, B. Sparks, ANY]
1171

Previous 15994 Revisions Next


© 1998-2018 The MESS Team