| 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 |
| r5077 | r5078 | |
|---|---|---|
| 13 | 13 | #include <string.h> |
| 14 | 14 | #include <stdlib.h> |
| 15 | 15 | |
| 16 | typedef unsigned char UINT8; | |
| 17 | ||
| 16 | 18 | #define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0])) |
| 17 | 19 | #define BUILD_WINDOWS (0) |
| 18 | 20 | #define BUILD_WINUI (1) |
| r5077 | r5078 | |
| 123 | 125 | { |
| 124 | 126 | int value = 0; |
| 125 | 127 | |
| 126 | while (str[*position] != 0 && !isspace(str[*position]) && !isdigit(str[*position])) | |
| 128 | while (str[*position] != 0 && !isspace((UINT8)str[*position]) && !isdigit((UINT8)str[*position])) | |
| 127 | 129 | (*position)++; |
| 128 | 130 | |
| 129 | if (str[*position] != 0 && isdigit(str[*position])) | |
| 131 | if (str[*position] != 0 && isdigit((UINT8)str[*position])) | |
| 130 | 132 | { |
| 131 | 133 | sscanf(&str[*position], "%d", &value); |
| 132 | while (isdigit(str[*position])) | |
| 134 | while (isdigit((UINT8)str[*position])) | |
| 133 | 135 | (*position)++; |
| 134 | 136 | } |
| 135 | 137 | return value; |
| r5077 | r5078 | |
|---|---|---|
| 1057 | 1057 | if (rising_bits & 0x08) sample_start(samples, 3, 0, 0); /* start intermission, end game */ |
| 1058 | 1058 | //if (rising_bits & 0x10) sample_start(samples, 3, 9, 0); /* Dog barking */ |
| 1059 | 1059 | |
| 1060 | | |
| 1060 | lupin3 | |
| 1061 | 1061 | |
| 1062 | 1062 | port_2_last_extra = data; |
| 1063 | 1063 | } |
| r5077 | r5078 | |
|---|---|---|
| 305 | 305 | pri : 0 = topmost, 255 = backmost (pixel priority) |
| 306 | 306 | */ |
| 307 | 307 | |
| 308 | INLINE void zdrawgfxzoom32GP( running_machine *machine, | |
| 309 | bitmap_t *bitmap, const gfx_element *gfx, const rectangle *cliprect, | |
| 308 | INLINE void zdrawgfxzoom32GP( | |
| 309 | bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, | |
| 310 | 310 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, |
| 311 | 311 | int scalex, int scaley, int alpha, int drawmode, int zcode, int pri) |
| 312 | 312 | { |
| r5077 | r5078 | |
| 371 | 371 | src_fh = 16; |
| 372 | 372 | src_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 373 | 373 | |
| 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; | |
| 376 | 376 | |
| 377 | 377 | dst_ptr = (UINT32 *)bitmap->base; |
| 378 | 378 | dst_pitch = bitmap->rowpixels; |
| r5077 | r5078 | |
| 1662 | 1662 | |
| 1663 | 1663 | if (nozoom) { scaley = scalex = 0x10000; } else { scalex = zw << 12; scaley = zh << 12; }; |
| 1664 | 1664 | |
| 1665 | zdrawgfxzoom32GP(machine, | |
| 1666 | bitmap, K053247_gfx, cliprect, | |
| 1665 | zdrawgfxzoom32GP( | |
| 1666 | bitmap, cliprect, K053247_gfx, | |
| 1667 | 1667 | temp, |
| 1668 | 1668 | color, |
| 1669 | 1669 | temp1,temp2, |
| r5077 | r5078 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | static void a310_set_timer(int tmr) |
| 115 | 115 | { |
| 116 | double freq | |
| 116 | double freq | |
| 117 | 117 | |
| 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 | } | |
| 121 | 124 | } |
| 122 | 125 | |
| 123 | 126 | // param |
| r5077 | r5078 | |
| 366 | 369 | #ifdef MESS |
| 367 | 370 | const device_config *fdc = (const device_config *)devtag_get_device(space->machine, "wd1772"); |
| 368 | 371 | #endif |
| 372 | ||
| 369 | 373 | if (offset >= 0x80000 && offset < 0xc0000) |
| 370 | 374 | { |
| 371 | 375 | // logerror("IOC: W %02x @ reg %s (PC=%x)\n", data&0xff, ioc_regnames[offset&0x1f], cpu_get_pc( space->cpu )); |
| r5077 | r5078 | |
|---|---|---|
| 313 | 313 | */ |
| 314 | 314 | UINT32 writeaddress; |
| 315 | 315 | extern UINT16 calc3_mcu_crc; |
| 316 | extern UINT16* kaneko16_calc3_fakeram; | |
| 316 | 317 | |
| 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) | |
| 318 | static const UINT16 shogwarr_snip_[] = { | |
| 319 | 0x48E7,0xFFFE, // movem.l D0-D7/A0-A6, -(A7) | |
| 318 | extern int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, int dstoffset); | |
| 320 | 319 | |
| 321 | 0x3039,0x00A8,0x0000, // move.w $a80000.l, D0 | |
| 322 | 0x4279,0x0020,0xFFFE, // clr.w $20fffe.l | |
| 323 | 320 | |
| 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 | ||
| 392 | 321 | static void calc3_mcu_run(running_machine *machine) |
| 393 | 322 | { |
| 394 | 323 | UINT16 mcu_command; |
| r5077 | r5078 | |
| 443 | 372 | |
| 444 | 373 | // clear old command (handshake to main cpu) |
| 445 | 374 | 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 | */ | |
| 454 | 384 | calc3_mcu_command_offset = param3; // where next command will be written? |
| 455 | 385 | |
| 456 | 386 | |
| 457 | 387 | } |
| 458 | 388 | break; |
| 459 | 389 | |
| 390 | case 0x0001: | |
| 391 | case 0x0002: | |
| 392 | case 0x0003: | |
| 393 | case 0x0004: | |
| 394 | case 0x0005: | |
| 395 | case 0x0006: | |
| 396 | case 0x0007: | |
| 460 | 397 | // the 'case' seems to be the number of commands in the list |
| 461 | 398 | // there are parts of the code where i've seen up to '5' specified, and the game uploads 5 transfer commands |
| 462 | 399 | // |
| 463 | ||
| 464 | case 0x0001: | |
| 465 | 400 | { |
| 401 | int num_transfers = mcu_command; | |
| 466 | 402 | 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]; | |
| 474 | 403 | |
| 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); | |
| 478 | 405 | |
| 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; | |
| 479 | 413 | |
| 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); | |
| 483 | 415 | |
| 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; | |
| 486 | 419 | |
| 420 | calc3_decompress_table(machine, commandtabl, (UINT8*)kaneko16_calc3_fakeram, fakeoffs); | |
| 487 | 421 | |
| 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.. | |
| 488 | 425 | |
| 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); | |
| 490 | 429 | |
| 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]; | |
| 509 | 430 | } |
| 510 | 431 | |
| 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;; | |
| 517 | 434 | } |
| 518 | 435 | 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 | ||
| 580 | 436 | } |
| 581 | 437 | |
| 582 | 438 | } |
| r5077 | r5078 | |
|---|---|---|
| 1216 | 1216 | DRIVER( schaser ) /* RT Taito */ |
| 1217 | 1217 | DRIVER( schasrcv ) /* RT Taito */ |
| 1218 | 1218 | DRIVER( lupin3 ) /* LP (c) 1980 Taito */ |
| 1219 | DRIVER( lupin3a ) /* LP (c) 1980 Taito */ | |
| 1219 | 1220 | DRIVER( intruder ) /* (c) 1980 GamePlan (Taito) */ |
| 1220 | 1221 | DRIVER( spclaser ) /* (c) 1980 GamePlan (Taito) */ |
| 1221 | 1222 | DRIVER( laser ) /* (c) 1980 Leisure Time Electronics Inc. */ |
| r5077 | r5078 | |
| 3547 | 3548 | DRIVER( myherok ) /* 834-5755 (c) 1985 Coreland / Sega (S1) */ |
| 3548 | 3549 | DRIVER( shtngmst ) /* 834-5719/5720 (c) 1985 (S2) */ |
| 3549 | 3550 | DRIVER( shtngmste ) /* 834-5719/5720 (c) 1985 (S2) */ |
| 3550 | DRIVER( shtngmstu ) /* 834-5719/5720 (c) 1985 (S2) */ | |
| 3551 | 3551 | DRIVER( choplift ) /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */ |
| 3552 | 3552 | DRIVER( chopliftu ) /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */ |
| 3553 | 3553 | DRIVER( chopliftbl )/* bootleg (S2) */ |
| r5077 | r5078 | |
| 5622 | 5622 | DRIVER( llander ) /* 0345xx no copyright notice */ |
| 5623 | 5623 | DRIVER( llander1 ) /* 0345xx no copyright notice */ |
| 5624 | 5624 | DRIVER( asteroid ) /* 035127-035145 (c) 1979 */ |
| 5625 | DRIVER( asteroi2 ) /* 035127-035145 (c) 1979 */ | |
| 5625 | 5626 | DRIVER( asteroi1 ) /* 035127-035145 no copyright notice */ |
| 5626 | 5627 | DRIVER( asteroib ) /* (bootleg) */ |
| 5627 | 5628 | DRIVER( asterock ) /* Sidam bootleg (c) 1979 */ |
| r5077 | r5078 | |
| 6670 | 6671 | DRIVER( hiimpact ) /* (c) 1990 Williams */ |
| 6671 | 6672 | DRIVER( hiimpac4 ) /* (c) 1990 Williams */ |
| 6672 | 6673 | DRIVER( hiimpac3 ) /* (c) 1990 Williams */ |
| 6674 | DRIVER( hiimpac1 ) /* (c) 1990 Williams */ | |
| 6673 | 6675 | DRIVER( hiimpacp ) /* (c) 1990 Williams */ |
| 6674 | 6676 | DRIVER( shimpact ) /* (c) 1991 Midway */ |
| 6675 | 6677 | DRIVER( shimpap6 ) /* (c) 1991 Midway */ |
| r5077 | r5078 | |
| 9537 | 9539 | |
| 9538 | 9540 | DRIVER( roul ) |
| 9539 | 9541 | |
| 9542 | /* Accept LTD. */ | |
| 9543 | DRIVER( hitpoker ) /* (c) 1997 */ | |
| 9544 | ||
| 9540 | 9545 | #endif /* DRIVER_RECURSIVE */ |
| r5077 | r5078 | |
|---|---|---|
| 37 | 37 | void deco16_tilemap_34_combine_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); |
| 38 | 38 | |
| 39 | 39 | void deco16_clear_sprite_priority_bitmap(void); |
| 40 | void deco16_pdrawgfx(running_machine *machine, | |
| 41 | bitmap_t *dest,const gfx_element *gfx, | |
| 40 | void deco16_pdrawgfx( | |
| 41 | bitmap_t *dest,const rectangle *clip,const gfx_element *gfx, | |
| 42 | 42 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 43 | | |
| 43 | | |
| 44 | 44 | |
| 45 | 45 | tilemap *deco16_get_tilemap(int pf, int size); |
| 46 | 46 |
| r5077 | r5078 | |
|---|---|---|
| 76 | 76 | MACHINE_START( extra_8080bw_vh ); |
| 77 | 77 | |
| 78 | 78 | void c8080bw_flip_screen_w(const address_space *space, int data); |
| 79 | void lupin3_flip_screen_w(const address_space *space, int data); | |
| 79 | 80 | void c8080bw_screen_red_w(int data); |
| 80 | 81 | void schaser_background_control_w(int data); |
| 81 | 82 |
| r5077 | r5078 | |
|---|---|---|
| 144 | 144 | #define REG_BPLCON3 (0x106/2) /* W D Bit plane control reg (enhanced features) */ |
| 145 | 145 | #define REG_BPL1MOD (0x108/2) /* W A Bit plane modulo (odd planes) */ |
| 146 | 146 | #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) */ | |
| 147 | 148 | #define REG_BPL1DAT (0x110/2) /* W D Bit plane 1 data (parallel-to-serial convert) */ |
| 148 | 149 | #define REG_BPL2DAT (0x112/2) /* W D Bit plane 2 data (parallel-to-serial convert) */ |
| 149 | 150 | #define REG_BPL3DAT (0x114/2) /* W D Bit plane 3 data (parallel-to-serial convert) */ |
| r5077 | r5078 | |
|---|---|---|
| 111 | 111 | CPUS += SM8500 |
| 112 | 112 | CPUS += MINX |
| 113 | 113 | CPUS += SSEM |
| 114 | CPUS += AVR8 | |
| 114 | 115 | |
| 115 | 116 | |
| 116 | 117 | #------------------------------------------------- |
| r5077 | r5078 | |
| 1518 | 1519 | $(DRIVERS)/hexa.o $(VIDEO)/hexa.o \ |
| 1519 | 1520 | $(DRIVERS)/highvdeo.o \ |
| 1520 | 1521 | $(DRIVERS)/himesiki.o $(VIDEO)/himesiki.o \ |
| 1522 | $(DRIVERS)/hitpoker.o \ | |
| 1521 | 1523 | $(DRIVERS)/homedata.o $(VIDEO)/homedata.o \ |
| 1522 | 1524 | $(DRIVERS)/hotblock.o \ |
| 1523 | 1525 | $(DRIVERS)/ilpag.o \ |
| r5077 | r5078 | |
|---|---|---|
| 121 | 121 | int xflip = attr & 0x20; |
| 122 | 122 | int yflip = attr & 0x40; |
| 123 | 123 | |
| 124 | drawgfx(bitmap,gfx,number, | |
| 124 | drawgfx_transpen(bitmap,cliprect,gfx,number, | |
| 125 | 125 | 0x20 + color,xflip,yflip, |
| 126 | sx - 0x0f,sy, | |
| 127 | cliprect,TRANSPARENCY_PEN,0); | |
| 126 | sx - 0x0f,sy,0); | |
| 128 | 127 | } |
| 129 | 128 | } |
| 130 | 129 |
| r5077 | r5078 | |
|---|---|---|
| 166 | 166 | flipx = ((nycaptor_spriteram[offs+1]&0x40)>>6); |
| 167 | 167 | flipy = ((nycaptor_spriteram[offs+1]&0x80)>>7); |
| 168 | 168 | |
| 169 | drawgfx(bitmap,machine->gfx[1], | |
| 169 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 170 | 170 | code, |
| 171 | 171 | pal, |
| 172 | 172 | flipx,flipy, |
| 173 | sx,sy, | |
| 174 | cliprect,TRANSPARENCY_PEN,15); | |
| 173 | sx,sy,15); | |
| 175 | 174 | |
| 176 | 175 | if(nycaptor_spriteram[offs+3]>240) |
| 177 | 176 | { |
| 178 | 177 | sx = (nycaptor_spriteram[offs+3]-256); |
| 179 | drawgfx(bitmap,machine->gfx[1], | |
| 178 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 180 | 179 | code, |
| 181 | 180 | pal, |
| 182 | 181 | flipx,flipy, |
| 183 | sx,sy, | |
| 184 | cliprect,TRANSPARENCY_PEN,15); | |
| 182 | sx,sy,15); | |
| 185 | 183 | } |
| 186 | 184 | } |
| 187 | 185 | } |
| r5077 | r5078 | |
|---|---|---|
| 271 | 271 | sx = 496 - sx; |
| 272 | 272 | sy = 240 - sy; |
| 273 | 273 | } |
| 274 | drawgfx(bitmap,machine->gfx[1], | |
| 274 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 275 | 275 | code, |
| 276 | 276 | color, |
| 277 | 277 | flipscreen,flipscreen, |
| 278 | sx,sy, | |
| 279 | cliprect,TRANSPARENCY_PEN,15); | |
| 278 | sx,sy,15); | |
| 280 | 279 | } |
| 281 | 280 | } |
| 282 | 281 |
| r5077 | r5078 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | int x = sx + 8*(flipx?(size-1-col):col); |
| 77 | 77 | int y = sy + 8*(flipy?(size-1-row):row); |
| 78 | drawgfx(bitmap,machine->gfx[1], | |
| 78 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 79 | 79 | code + layout[row][col], |
| 80 | 80 | color, |
| 81 | 81 | flipx,flipy, |
| 82 | x,y, | |
| 83 | cliprect,TRANSPARENCY_PEN,0); | |
| 82 | x,y,0); | |
| 84 | 83 | } |
| 85 | 84 | } |
| 86 | 85 | } |
| r5077 | r5078 | |
| 125 | 124 | /* What is this? A priority/half transparency marker? */ |
| 126 | 125 | if (!(attr & 0x0008)) |
| 127 | 126 | { |
| 128 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 127 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 129 | 128 | code, |
| 130 | 129 | color, |
| 131 | 130 | 0,0, |
| 132 | 131 | // 16*sx + screenscroll,8*sy, |
| 133 | 16*sx,8*sy, | |
| 134 | cliprect,TRANSPARENCY_PEN,0); | |
| 132 | 16*sx,8*sy,0); | |
| 135 | 133 | } |
| 136 | 134 | } |
| 137 | 135 |
| r5077 | r5078 | |
|---|---|---|
| 468 | 468 | if (spriteram_3[offs] & 1) /* double width, double height */ |
| 469 | 469 | { |
| 470 | 470 | code &= ~3; |
| 471 | drawgfx(bitmap,machine->gfx[bank], | |
| 471 | drawgfx_transmask(bitmap,cliprect,machine->gfx[bank], | |
| 472 | 472 | 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], | |
| 476 | 475 | 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); | |
| 479 | 477 | } |
| 480 | 478 | code &= ~2; |
| 481 | drawgfx(bitmap,machine->gfx[bank], | |
| 479 | drawgfx_transmask(bitmap,cliprect,machine->gfx[bank], | |
| 482 | 480 | 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], | |
| 486 | 483 | 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); | |
| 489 | 485 | } |
| 490 | 486 | else if (spriteram_3[offs] & 1) /* double width */ |
| 491 | 487 | { |
| 492 | 488 | code &= ~1; |
| 493 | drawgfx(bitmap,machine->gfx[bank], | |
| 489 | drawgfx_transmask(bitmap,cliprect,machine->gfx[bank], | |
| 494 | 490 | 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], | |
| 498 | 493 | 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); | |
| 501 | 495 | } |
| 502 | 496 | else /* normal */ |
| 503 | 497 | { |
| 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); | |
| 507 | 500 | } |
| 508 | 501 | } |
| 509 | 502 | } |
| r5077 | r5078 | |
|---|---|---|
| 215 | 215 | flipx = !flipx; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | drawgfx(bitmap,machine->gfx[2], | |
| 218 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 219 | 219 | code, |
| 220 | 220 | color, |
| 221 | 221 | flipx,flip_screen_get(machine), |
| 222 | sx,sy, | |
| 223 | cliprect,TRANSPARENCY_PEN,15); | |
| 222 | sx,sy,15); | |
| 224 | 223 | } |
| 225 | 224 | } |
| 226 | 225 |
| r5077 | r5078 | |
|---|---|---|
| 161 | 161 | if (fy) fy=0; else fy=1; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | drawgfx(bitmap,machine->gfx[3], | |
| 164 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 165 | 165 | sprite, |
| 166 | color,fx,fy,x,y, | |
| 167 | cliprect,TRANSPARENCY_PEN,15); | |
| 166 | color,fx,fy,x,y,15); | |
| 168 | 167 | } |
| 169 | 168 | } |
| 170 | 169 |
| r5077 | r5078 | |
|---|---|---|
| 60 | 60 | } |
| 61 | 61 | #endif |
| 62 | 62 | |
| 63 | static void mlc_drawgfxzoom(running_machine *machine, | |
| 64 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 63 | static void mlc_drawgfxzoom( | |
| 64 | bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 65 | 65 | UINT32 code1,UINT32 code2, UINT32 color,int flipx,int flipy,int sx,int sy, |
| 66 | | |
| 66 | | |
| 67 | 67 | int scalex, int scaley,int alpha) |
| 68 | 68 | { |
| 69 | 69 | rectangle myclip; |
| r5077 | r5078 | |
| 96 | 96 | { |
| 97 | 97 | if( gfx ) |
| 98 | 98 | { |
| 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)]; | |
| 100 | 100 | const UINT8 *code_base1 = gfx_element_get_data(gfx, code1 % gfx->total_elements); |
| 101 | 101 | const UINT8 *code_base2 = gfx_element_get_data(gfx, code2 % gfx->total_elements); |
| 102 | 102 | |
| r5077 | r5078 | |
| 482 | 482 | // if (rasterMode) |
| 483 | 483 | // rasterDirty=1; |
| 484 | 484 | |
| 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], | |
| 487 | 487 | tile,tile2, |
| 488 | 488 | color + colorOffset,fx,fy,xbase,ybase, |
| 489 | | |
| 489 | | |
| 490 | 490 | use8bppMode,(xscale<<8),(yscale<<8),alpha); |
| 491 | 491 | |
| 492 | 492 | sprite++; |
| r5077 | r5078 | |
|---|---|---|
| 332 | 332 | { |
| 333 | 333 | for( sy=0; sy<256; sy+=16 ) |
| 334 | 334 | { |
| 335 | drawgfx( bitmap, machine->gfx[1], | |
| 335 | drawgfx_transpen( bitmap, cliprect, | |
| 336 | machine->gfx[1], | |
| 336 | 337 | picture_code, |
| 337 | 338 | 0, /* color */ |
| 338 | 339 | 0,0, /* flip */ |
| 339 | sx,sy, | |
| 340 | cliprect, | |
| 341 | TRANSPARENCY_PEN,0 ); | |
| 340 | sx,sy,0 ); | |
| 342 | 341 | } |
| 343 | 342 | } |
| 344 | 343 | } |
| r5077 | r5078 | |
| 358 | 357 | vstop = 0x00 |
| 359 | 358 | |
| 360 | 359 | */ |
| 361 | drawgfx( bitmap, machine->gfx[1], | |
| 360 | drawgfx_transpen( bitmap, cliprect, | |
| 361 | machine->gfx[1], | |
| 362 | 362 | picture_code, |
| 363 | 363 | 0, /* color */ |
| 364 | 364 | 0,0, /* flip */ |
| 365 | 255-hposition-16,vstart-32, | |
| 366 | cliprect, | |
| 367 | TRANSPARENCY_PEN,0 ); | |
| 365 | 255-hposition-16,vstart-32,0 ); | |
| 368 | 366 | } |
| 369 | 367 | |
| 370 | 368 | VIDEO_UPDATE( tunhunt ) |
| r5077 | r5078 | |
|---|---|---|
| 207 | 207 | /* Double Height */ |
| 208 | 208 | if(spriteram[offs] & 0x10) |
| 209 | 209 | { |
| 210 | drawgfx(bitmap,machine->gfx[1], | |
| 210 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 211 | 211 | sprite, |
| 212 | color,fx,fy,x,y + inc, | |
| 213 | cliprect,TRANSPARENCY_PEN,0); | |
| 212 | color,fx,fy,x,y + inc,0); | |
| 214 | 213 | |
| 215 | drawgfx(bitmap,machine->gfx[1], | |
| 214 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 216 | 215 | sprite+1, |
| 217 | color,fx,fy,x,y, | |
| 218 | cliprect,TRANSPARENCY_PEN,0); | |
| 216 | color,fx,fy,x,y,0); | |
| 219 | 217 | } |
| 220 | 218 | else |
| 221 | 219 | { |
| 222 | drawgfx(bitmap,machine->gfx[1], | |
| 220 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 223 | 221 | sprite, |
| 224 | color,fx,fy,x,y, | |
| 225 | cliprect,TRANSPARENCY_PEN,0); | |
| 222 | color,fx,fy,x,y,0); | |
| 226 | 223 | } |
| 227 | 224 | } |
| 228 | 225 | } |
| r5077 | r5078 | |
|---|---|---|
| 204 | 204 | { |
| 205 | 205 | if ((color & pri_mask) == pri_val && |
| 206 | 206 | (!flash || (video_screen_get_frame_number(machine->primary_screen) & 1))) |
| 207 | drawgfx(bitmap,machine->gfx[3], | |
| 207 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 208 | 208 | code - y * incy + h * x, |
| 209 | 209 | color, |
| 210 | 210 | flipx,flipy, |
| 211 | sx + mult * x,sy + mult * y, | |
| 212 | cliprect,TRANSPARENCY_PEN,0); | |
| 211 | sx + mult * x,sy + mult * y,0); | |
| 213 | 212 | } |
| 214 | 213 | |
| 215 | 214 | offs += 4; |
| r5077 | r5078 | |
|---|---|---|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | #define DRAW_SPRITE(DX,DY,CODE) \ |
| 202 | drawgfx(bitmap,machine->gfx[0], \ | |
| 202 | drawgfx_transpen(bitmap,\ | |
| 203 | cliprect,machine->gfx[0], \ | |
| 203 | 204 | (CODE), \ |
| 204 | 205 | 0, \ |
| 205 | 206 | flipx,flipy, \ |
| 206 | x + (DX),y + (DY), \ | |
| 207 | cliprect,TRANSPARENCY_PEN, 0xff); \ | |
| 207 | x + (DX),y + (DY), 0xff); \ | |
| 208 | 208 | |
| 209 | 209 | if (skyfox_bg_ctrl & 1) // flipscreen |
| 210 | 210 | { |
| r5077 | r5078 | |
|---|---|---|
| 86 | 86 | flipy = !flipy; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 89 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 90 | 90 | code, |
| 91 | 91 | color, |
| 92 | 92 | flipx,flipy, |
| 93 | x,y, | |
| 94 | cliprect,TRANSPARENCY_PEN,15); | |
| 93 | x,y,15); | |
| 95 | 94 | } |
| 96 | 95 | } |
| 97 | 96 |
| r5077 | r5078 | |
|---|---|---|
| 383 | 383 | else |
| 384 | 384 | code = aerofgt_spriteram2[map_start & 0x1fff] & 0x1fff; |
| 385 | 385 | |
| 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)], | |
| 387 | 387 | code, |
| 388 | 388 | color, |
| 389 | 389 | flipx,flipy, |
| 390 | 390 | sx,sy, |
| 391 | cliprect,TRANSPARENCY_PEN,15, | |
| 392 | zoomx << 11, zoomy << 11); | |
| 391 | zoomx << 11, zoomy << 11,15); | |
| 393 | 392 | map_start++; |
| 394 | 393 | } |
| 395 | 394 | } |
| r5077 | r5078 | |
| 455 | 454 | else |
| 456 | 455 | code = aerofgt_spriteram2[map_start % (aerofgt_spriteram2_size/2)]; |
| 457 | 456 | |
| 458 | pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + chip], | |
| 457 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + chip], | |
| 459 | 458 | code, |
| 460 | 459 | color, |
| 461 | 460 | flipx,flipy, |
| 462 | 461 | sx,sy, |
| 463 | cliprect,TRANSPARENCY_PEN,15, | |
| 464 | 462 | zoomx << 11, zoomy << 11, |
| 465 | pri ? 0 : 2); | |
| 463 | priority_bitmap,pri ? 0 : 2,15); | |
| 466 | 464 | map_start++; |
| 467 | 465 | } |
| 468 | 466 | |
| r5077 | r5078 | |
| 530 | 528 | else |
| 531 | 529 | code = aerofgt_spriteram2[map_start % (aerofgt_spriteram2_size/2)]; |
| 532 | 530 | |
| 533 | pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + chip], | |
| 531 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + chip], | |
| 534 | 532 | code, |
| 535 | 533 | color, |
| 536 | 534 | flipx,flipy, |
| 537 | 535 | sx,sy, |
| 538 | cliprect,TRANSPARENCY_PEN,15, | |
| 539 | 536 | zoomx << 11, zoomy << 11, |
| 540 | pri ? 2 : 0); | |
| 537 | priority_bitmap,pri ? 2 : 0,15); | |
| 541 | 538 | map_start++; |
| 542 | 539 | } |
| 543 | 540 | |
| r5077 | r5078 | |
| 606 | 603 | else |
| 607 | 604 | code = aerofgt_spriteram2[map_start % (aerofgt_spriteram2_size/2)]; |
| 608 | 605 | |
| 609 | pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + chip], | |
| 606 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + chip], | |
| 610 | 607 | code, |
| 611 | 608 | color, |
| 612 | 609 | flipx,flipy, |
| 613 | 610 | sx,sy, |
| 614 | cliprect,TRANSPARENCY_PEN,15, | |
| 615 | 611 | zoomx << 11, zoomy << 11, |
| 616 | pri ? 0 : 2); | |
| 612 | priority_bitmap,pri ? 0 : 2,15); | |
| 617 | 613 | map_start++; |
| 618 | 614 | } |
| 619 | 615 | |
| r5077 | r5078 | |
| 642 | 638 | flipx = aerofgt_spriteram3[i + 1] & 0x0800; |
| 643 | 639 | color = aerofgt_spriteram3[i + 1] & 0x000f; |
| 644 | 640 | |
| 645 | drawgfx(bitmap,machine->gfx[sprite_gfx], | |
| 641 | drawgfx_transpen(bitmap,cliprect,machine->gfx[sprite_gfx], | |
| 646 | 642 | code, |
| 647 | 643 | color, |
| 648 | 644 | flipx,flipy, |
| 649 | xpos,ypos, | |
| 650 | cliprect,TRANSPARENCY_PEN,15); | |
| 645 | xpos,ypos,15); | |
| 651 | 646 | |
| 652 | 647 | /* wrap around y */ |
| 653 | drawgfx(bitmap,machine->gfx[sprite_gfx], | |
| 648 | drawgfx_transpen(bitmap,cliprect,machine->gfx[sprite_gfx], | |
| 654 | 649 | code, |
| 655 | 650 | color, |
| 656 | 651 | flipx,flipy, |
| 657 | xpos,ypos + 512, | |
| 658 | cliprect,TRANSPARENCY_PEN,15); | |
| 652 | xpos,ypos + 512,15); | |
| 659 | 653 | |
| 660 | 654 | } |
| 661 | 655 | } |
| r5077 | r5078 | |
| 685 | 679 | |
| 686 | 680 | realcode = (lookup[code] << 8) + lookup[0x10000 + code]; |
| 687 | 681 | |
| 688 | drawgfx(bitmap,machine->gfx[sprite_gfx], | |
| 682 | drawgfx_transpen(bitmap,cliprect,machine->gfx[sprite_gfx], | |
| 689 | 683 | realcode, |
| 690 | 684 | color, |
| 691 | 685 | flipx,flipy, |
| 692 | xpos,ypos, | |
| 693 | cliprect,TRANSPARENCY_PEN,15); | |
| 686 | xpos,ypos,15); | |
| 694 | 687 | |
| 695 | 688 | /* wrap around y */ |
| 696 | drawgfx(bitmap,machine->gfx[sprite_gfx], | |
| 689 | drawgfx_transpen(bitmap,cliprect,machine->gfx[sprite_gfx], | |
| 697 | 690 | realcode, |
| 698 | 691 | color, |
| 699 | 692 | flipx,flipy, |
| 700 | xpos,ypos + 512, | |
| 701 | cliprect,TRANSPARENCY_PEN,15); | |
| 693 | xpos,ypos + 512,15); | |
| 702 | 694 | } |
| 703 | 695 | } |
| 704 | 696 | |
| r5077 | r5078 | |
| 733 | 725 | |
| 734 | 726 | sx = ((ox + 16 + 3) & 0x1ff) - 16; |
| 735 | 727 | |
| 736 | pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)], | |
| 728 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)], | |
| 737 | 729 | code, |
| 738 | 730 | color, |
| 739 | 731 | flipx,flipy, |
| 740 | 732 | sx,sy, |
| 741 | cliprect,TRANSPARENCY_PEN,15, | |
| 742 | 733 | zoomx << 11,zoomy << 11, |
| 743 | pri ? 0 : 2); | |
| 734 | priority_bitmap,pri ? 0 : 2,15); | |
| 744 | 735 | |
| 745 | 736 | } |
| 746 | 737 | |
| r5077 | r5078 | |
| 771 | 762 | |
| 772 | 763 | sx = ((ox + 16 + 3) & 0x1ff) - 16; |
| 773 | 764 | |
| 774 | pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)], | |
| 765 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)], | |
| 775 | 766 | code, |
| 776 | 767 | color, |
| 777 | 768 | flipx,flipy, |
| 778 | 769 | sx,sy, |
| 779 | cliprect,TRANSPARENCY_PEN,15, | |
| 780 | 770 | zoomx << 11,zoomy << 11, |
| 781 | pri ? 0 : 2); | |
| 771 | priority_bitmap,pri ? 0 : 2,15); | |
| 782 | 772 | |
| 783 | 773 | } |
| 784 | 774 | } |
| r5077 | r5078 | |
| 861 | 851 | { |
| 862 | 852 | UINT16 tileno = spikes91_tx_tilemap_ram[count]&0x1fff; |
| 863 | 853 | UINT16 colour = spikes91_tx_tilemap_ram[count]&0xe000; |
| 864 | drawgfx(bitmap,gfx, | |
| 854 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 865 | 855 | tileno, |
| 866 | 856 | colour>>13, |
| 867 | 857 | 0,0, |
| 868 | (x*8)+24,(y*8)+8, | |
| 869 | cliprect,TRANSPARENCY_PEN,15); | |
| 858 | (x*8)+24,(y*8)+8,15); | |
| 870 | 859 | |
| 871 | 860 | count++; |
| 872 | 861 |
| r5077 | r5078 | |
|---|---|---|
| 126 | 126 | { |
| 127 | 127 | int color = spriteram_2[offs] & 0x0f; |
| 128 | 128 | |
| 129 | drawgfx(bitmap,machine->gfx[0], | |
| 129 | drawgfx_transmask(bitmap,cliprect,machine->gfx[0], | |
| 130 | 130 | spriteram[offs + 1], |
| 131 | 131 | color, |
| 132 | 132 | spriteram_2[offs] & 0x40,~spriteram_2[offs] & 0x80, |
| 133 | 133 | 240-spriteram[offs],spriteram_2[offs + 1], |
| 134 | cliprect,TRANSPARENCY_PENS, | |
| 135 | 134 | colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0)); |
| 136 | 135 | } |
| 137 | 136 | } |
| r5077 | r5078 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | if (fgoal_player == 1 && (input_port_read(screen->machine, "IN1") & 0x40)) |
| 55 | 55 | { |
| 56 | drawgfxzoom(fgbitmap, screen->machine->gfx[0], | |
| 56 | drawgfxzoom_opaque(fgbitmap, cliprect, screen->machine->gfx[0], | |
| 57 | 57 | 0, (fgoal_player << 2) | current_color, |
| 58 | 58 | 1, 1, |
| 59 | 59 | 0, 16, |
| 60 | cliprect, TRANSPARENCY_NONE, 0, | |
| 61 | 60 | 0x40000, |
| 62 | 61 | 0x40000); |
| 63 | 62 | |
| 64 | drawgfxzoom(bgbitmap, screen->machine->gfx[1], | |
| 63 | drawgfxzoom_opaque(bgbitmap, cliprect, screen->machine->gfx[1], | |
| 65 | 64 | 0, 0, |
| 66 | 65 | 1, 1, |
| 67 | 66 | 0, 16, |
| 68 | cliprect, TRANSPARENCY_NONE, 0, | |
| 69 | 67 | 0x40000, |
| 70 | 68 | 0x40000); |
| 71 | 69 | } |
| 72 | 70 | else |
| 73 | 71 | { |
| 74 | drawgfxzoom(fgbitmap, screen->machine->gfx[0], | |
| 72 | drawgfxzoom_opaque(fgbitmap, cliprect, screen->machine->gfx[0], | |
| 75 | 73 | 0, (fgoal_player << 2) | current_color, |
| 76 | 74 | 0, 0, |
| 77 | 75 | 0, 0, |
| 78 | cliprect, TRANSPARENCY_NONE, 0, | |
| 79 | 76 | 0x40000, |
| 80 | 77 | 0x40000); |
| 81 | 78 | |
| 82 | drawgfxzoom(bgbitmap, screen->machine->gfx[1], | |
| 79 | drawgfxzoom_opaque(bgbitmap, cliprect, screen->machine->gfx[1], | |
| 83 | 80 | 0, 0, |
| 84 | 81 | 0, 0, |
| 85 | 82 | 0, 0, |
| 86 | cliprect, TRANSPARENCY_NONE, 0, | |
| 87 | 83 | 0x40000, |
| 88 | 84 | 0x40000); |
| 89 | 85 | } |
| r5077 | r5078 | |
|---|---|---|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /* first draw the sprite, visible */ |
| 200 | pdrawgfx(bitmap,machine->gfx[1], | |
| 200 | pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 201 | 201 | code, |
| 202 | 202 | color, |
| 203 | 203 | flipx,flipy, |
| 204 | 204 | sx,sy, |
| 205 | cliprect,TRANSPARENCY_PENS,0x80ff, | |
| 206 | 0x00); | |
| 205 | priority_bitmap, | |
| 206 | 0x00,0x80ff); | |
| 207 | 207 | |
| 208 | 208 | /* 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], | |
| 210 | 210 | code, |
| 211 | 211 | color, |
| 212 | 212 | flipx,flipy, |
| 213 | 213 | sx,sy, |
| 214 | cliprect,TRANSPARENCY_PENS,0x7fff, | |
| 215 | 0x02); | |
| 214 | priority_bitmap, | |
| 215 | 0x02,0x7fff); | |
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 |
| r5077 | r5078 | |
|---|---|---|
| 121 | 121 | flipy = !flipy; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | drawgfx( bitmap,gfx, | |
| 124 | drawgfx_transpen( bitmap,cliprect,gfx, | |
| 125 | 125 | tile_number, |
| 126 | 126 | color, |
| 127 | 127 | flipx,flipy, |
| 128 | sx,sy, | |
| 129 | cliprect,TRANSPARENCY_PEN,7); | |
| 128 | sx,sy,7); | |
| 130 | 129 | |
| 131 | 130 | source+=4; |
| 132 | 131 | } |
| r5077 | r5078 | |
|---|---|---|
| 179 | 179 | * |
| 180 | 180 | *************************************/ |
| 181 | 181 | |
| 182 | static void draw_sprites( | |
| 182 | static void draw_sprites( | |
| 183 | 183 | { |
| 184 | mystston_state *state = (mystston_state *)gfx->machine->driver_data; | |
| 184 | 185 | int offs; |
| 185 | 186 | |
| 186 | 187 | for (offs = 0; offs < 0x60; offs += 4) |
| r5077 | r5078 | |
| 204 | 205 | flipy = !flipy; |
| 205 | 206 | } |
| 206 | 207 | |
| 207 | drawgfx(bitmap, gfx | |
| 208 | drawgfx_transpen(bitmap, cliprect, gfx | |
| 208 | 209 | } |
| 209 | 210 | } |
| 210 | 211 | } |
| r5077 | r5078 | |
| 266 | 267 | tilemap_set_flip(ALL_TILEMAPS, flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 267 | 268 | |
| 268 | 269 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); |
| 269 | draw_sprites( | |
| 270 | draw_sprites(bitmap, cliprect, screen->machine->gfx[2] | |
| 270 | 271 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); |
| 271 | 272 | |
| 272 | 273 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 590 | 590 | logerror( "SZ_8X8: sprite=%d\n", code ); |
| 591 | 591 | code = 0; |
| 592 | 592 | } |
| 593 | drawgfx( bitmap, machine->gfx[GFX_8X8_4BIT], | |
| 593 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT], | |
| 594 | 594 | code+namcond1_gfxbank*0x10000, |
| 595 | 595 | color, |
| 596 | 596 | flipx,flipy, |
| 597 | sx,sy, | |
| 598 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 597 | sx,sy,0x00); | |
| 599 | 598 | // redraw with wrap-around |
| 600 | 599 | if( sx > 512-8 ) |
| 601 | drawgfx( bitmap, machine->gfx[GFX_8X8_4BIT], | |
| 600 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT], | |
| 602 | 601 | code+namcond1_gfxbank*0x10000, |
| 603 | 602 | color, |
| 604 | 603 | flipx,flipy, |
| 605 | sx-512,sy, | |
| 606 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 604 | sx-512,sy,0x00); | |
| 607 | 605 | if( sy > 512-8 ) |
| 608 | drawgfx( bitmap, machine->gfx[GFX_8X8_4BIT], | |
| 606 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT], | |
| 609 | 607 | code+namcond1_gfxbank*0x10000, |
| 610 | 608 | color, |
| 611 | 609 | flipx,flipy, |
| 612 | sx,sy-512, | |
| 613 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 610 | sx,sy-512,0x00); | |
| 614 | 611 | // really should draw again for both wrapped! |
| 615 | 612 | // - ignore until someone thinks it's required |
| 616 | 613 | break; |
| r5077 | r5078 | |
| 623 | 620 | logerror( "SZ_8X8: sprite=%d\n", code ); |
| 624 | 621 | code = 0; |
| 625 | 622 | } |
| 626 | drawgfx( bitmap, machine->gfx[GFX_16X16_4BIT], | |
| 623 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT], | |
| 627 | 624 | code+namcond1_gfxbank*0x4000, |
| 628 | 625 | color, |
| 629 | 626 | flipx,flipy, |
| 630 | sx,sy, | |
| 631 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 627 | sx,sy,0x00); | |
| 632 | 628 | // redraw with wrap-around |
| 633 | 629 | if( sx > 512-16 ) |
| 634 | drawgfx( bitmap, machine->gfx[GFX_16X16_4BIT], | |
| 630 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT], | |
| 635 | 631 | code+namcond1_gfxbank*0x4000, |
| 636 | 632 | color, |
| 637 | 633 | flipx,flipy, |
| 638 | sx-512,sy, | |
| 639 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 634 | sx-512,sy,0x00); | |
| 640 | 635 | if( sy > 512-16 ) |
| 641 | drawgfx( bitmap, machine->gfx[GFX_16X16_4BIT], | |
| 636 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT], | |
| 642 | 637 | code+namcond1_gfxbank*0x4000, |
| 643 | 638 | color, |
| 644 | 639 | flipx,flipy, |
| 645 | sx,sy-512, | |
| 646 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 640 | sx,sy-512,0x00); | |
| 647 | 641 | // really should draw again for both wrapped! |
| 648 | 642 | // - ignore until someone thinks it's required |
| 649 | 643 | break; |
| r5077 | r5078 | |
| 656 | 650 | logerror( "SZ_32X32: sprite=%d\n", code ); |
| 657 | 651 | code = 0; |
| 658 | 652 | } |
| 659 | drawgfx( bitmap, machine->gfx[GFX_32X32_4BIT], | |
| 653 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT], | |
| 660 | 654 | code+namcond1_gfxbank*0x1000, |
| 661 | 655 | color, |
| 662 | 656 | flipx,flipy, |
| 663 | sx,sy, | |
| 664 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 657 | sx,sy,0x00); | |
| 665 | 658 | // redraw with wrap-around |
| 666 | 659 | if( sx > 512-32 ) |
| 667 | drawgfx( bitmap, machine->gfx[GFX_32X32_4BIT], | |
| 660 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT], | |
| 668 | 661 | code+namcond1_gfxbank*0x1000, |
| 669 | 662 | color, |
| 670 | 663 | flipx,flipy, |
| 671 | sx-512,sy, | |
| 672 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 664 | sx-512,sy,0x00); | |
| 673 | 665 | if( sy > 512-32 ) |
| 674 | drawgfx( bitmap, machine->gfx[GFX_32X32_4BIT], | |
| 666 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT], | |
| 675 | 667 | code+namcond1_gfxbank*0x1000, |
| 676 | 668 | color, |
| 677 | 669 | flipx,flipy, |
| 678 | sx,sy-512, | |
| 679 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 670 | sx,sy-512,0x00); | |
| 680 | 671 | // really should draw again for both wrapped! |
| 681 | 672 | // - ignore until someone thinks it's required |
| 682 | 673 | break; |
| r5077 | r5078 | |
| 689 | 680 | logerror( "SZ_64X64: sprite=%d\n", code ); |
| 690 | 681 | code = 0; |
| 691 | 682 | } |
| 692 | drawgfx( bitmap, machine->gfx[GFX_64X64_4BIT], | |
| 683 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT], | |
| 693 | 684 | code+namcond1_gfxbank*0x400, |
| 694 | 685 | color, |
| 695 | 686 | flipx,flipy, |
| 696 | sx,sy, | |
| 697 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 687 | sx,sy,0x00); | |
| 698 | 688 | // redraw with wrap-around |
| 699 | 689 | if( sx > 512-64 ) |
| 700 | drawgfx( bitmap, machine->gfx[GFX_64X64_4BIT], | |
| 690 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT], | |
| 701 | 691 | code+namcond1_gfxbank*0x400, |
| 702 | 692 | color, |
| 703 | 693 | flipx,flipy, |
| 704 | sx-512,sy, | |
| 705 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 694 | sx-512,sy,0x00); | |
| 706 | 695 | if( sy > 512-64 ) |
| 707 | drawgfx( bitmap, machine->gfx[GFX_64X64_4BIT], | |
| 696 | drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT], | |
| 708 | 697 | code+namcond1_gfxbank*0x400, |
| 709 | 698 | color, |
| 710 | 699 | flipx,flipy, |
| 711 | sx,sy-512, | |
| 712 | &spriteClip,TRANSPARENCY_PEN,0x00); | |
| 700 | sx,sy-512,0x00); | |
| 713 | 701 | // really should draw again for both wrapped! |
| 714 | 702 | // - ignore until someone thinks it's required |
| 715 | 703 | break; |
| r5077 | r5078 | |
|---|---|---|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
| 271 | drawgfx(bitmap,machine->gfx[big ? 5 : 4], | |
| 271 | drawgfx_transpen(bitmap,cliprect,machine->gfx[big ? 5 : 4], | |
| 272 | 272 | spriteram[offs], |
| 273 | 273 | spriteram[offs + 1] & 0x07, |
| 274 | 274 | flipx,flipy, |
| 275 | sx,sy, | |
| 276 | cliprect,TRANSPARENCY_PEN,0); | |
| 275 | sx,sy,0); | |
| 277 | 276 | } |
| 278 | 277 | } |
| 279 | 278 | } |
| r5077 | r5078 | |
|---|---|---|
| 133 | 133 | sy++; /* fix title screen & garbage at the bottom of the screen */ |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | drawgfx(bitmap, machine->gfx[1], | |
| 136 | drawgfx_transpen(bitmap, cliprect, | |
| 137 | machine->gfx[1], | |
| 137 | 138 | code, color, |
| 138 | 139 | flipx, flipy, |
| 139 | sx, sy, | |
| 140 | cliprect, | |
| 141 | TRANSPARENCY_PEN, 0); | |
| 140 | sx, sy, 0); | |
| 142 | 141 | } |
| 143 | 142 | } |
| 144 | 143 |
| r5077 | r5078 | |
|---|---|---|
| 156 | 156 | flipy = !flipy; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | drawgfx(bitmap, machine->gfx[1], | |
| 159 | drawgfx_transpen(bitmap, cliprect, | |
| 160 | machine->gfx[1], | |
| 160 | 161 | code, color, |
| 161 | 162 | flipx, flipy, |
| 162 | sx, sy, | |
| 163 | cliprect, | |
| 164 | TRANSPARENCY_PEN, 0); | |
| 163 | sx, sy, 0); | |
| 165 | 164 | } |
| 166 | 165 | } |
| 167 | 166 |
| r5077 | r5078 | |
|---|---|---|
| 44 | 44 | { |
| 45 | 45 | if (flipx) |
| 46 | 46 | { |
| 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); | |
| 51 | 51 | } |
| 52 | 52 | else |
| 53 | 53 | { |
| 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); | |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | else |
| 61 | 61 | { |
| 62 | 62 | if (flipx) |
| 63 | 63 | { |
| 64 | drawgfx(bitmap,gfx,number ^ 2,colr,1,0,xpos,ypos | |
| 64 | drawgfx_transpen(bitmap,cliprect,gfx,number ^ 2,colr,1,0,xpos,ypos | |
| 65 | 65 | } |
| 66 | 66 | else |
| 67 | 67 | { |
| 68 | drawgfx(bitmap,gfx,number,colr,0,0,xpos,ypos | |
| 68 | drawgfx_transpen(bitmap,cliprect,gfx,number,colr,0,0,xpos,ypos | |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 |
| r5077 | r5078 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | while (multi >= 0) |
| 100 | 100 | { |
| 101 | pdrawgfx(bitmap,machine->gfx[2], | |
| 101 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 102 | 102 | sprite - multi * inc, |
| 103 | 103 | colour, |
| 104 | 104 | fx,fy, |
| 105 | 105 | x,y + mult * multi, |
| 106 | | |
| 106 | | |
| 107 | 107 | |
| 108 | 108 | multi--; |
| 109 | 109 | } |
| r5077 | r5078 | |
|---|---|---|
| 201 | 201 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sbank, int bank ) |
| 202 | 202 | { |
| 203 | 203 | int bank_base = (bank == 0) ? 0x4000 * (gfx_bank & 1) : 0; |
| 204 | K007121_sprites_draw(bank,bitmap,machine->gfx,machine->colortable | |
| 204 | K007121_sprites_draw(bank,bitmap,cliprect,machine->gfx,machine->colortable | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /*****************************************************************************/ |
| r5077 | r5078 | |
|---|---|---|
| 115 | 115 | if (fy) fy=0; else fy=1; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | pdrawgfx(bitmap,machine->gfx[1], | |
| 118 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 119 | 119 | sprite, |
| 120 | 120 | color,fx,fy,x,y, |
| 121 | | |
| 121 | | |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 |
| r5077 | r5078 | |
|---|---|---|
| 28 | 28 | sx = 31 - (offs % 32); |
| 29 | 29 | sy = offs / 32; |
| 30 | 30 | |
| 31 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 31 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 32 | 32 | videoram[offs] & 0x3f,0, |
| 33 | 33 | 0,0, |
| 34 | 8*sx,8*sy, | |
| 35 | cliprect,TRANSPARENCY_NONE,0); | |
| 34 | 8*sx,8*sy); | |
| 36 | 35 | } |
| 37 | 36 | |
| 38 | 37 | |
| 39 | 38 | /* Draw the cars. Positioning was based on a screen shot */ |
| 40 | 39 | if (copsnrob_cary[0]) |
| 41 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 40 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 42 | 41 | copsnrob_carimage[0],0, |
| 43 | 42 | 1,0, |
| 44 | 0xe4,256-copsnrob_cary[0], | |
| 45 | cliprect,TRANSPARENCY_PEN,0); | |
| 43 | 0xe4,256-copsnrob_cary[0],0); | |
| 46 | 44 | |
| 47 | 45 | if (copsnrob_cary[1]) |
| 48 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 46 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 49 | 47 | copsnrob_carimage[1],0, |
| 50 | 48 | 1,0, |
| 51 | 0xc4,256-copsnrob_cary[1], | |
| 52 | cliprect,TRANSPARENCY_PEN,0); | |
| 49 | 0xc4,256-copsnrob_cary[1],0); | |
| 53 | 50 | |
| 54 | 51 | if (copsnrob_cary[2]) |
| 55 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 52 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 56 | 53 | copsnrob_carimage[2],0, |
| 57 | 54 | 0,0, |
| 58 | 0x24,256-copsnrob_cary[2], | |
| 59 | cliprect,TRANSPARENCY_PEN,0); | |
| 55 | 0x24,256-copsnrob_cary[2],0); | |
| 60 | 56 | |
| 61 | 57 | if (copsnrob_cary[3]) |
| 62 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 58 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 63 | 59 | copsnrob_carimage[3],0, |
| 64 | 60 | 0,0, |
| 65 | 0x04,256-copsnrob_cary[3], | |
| 66 | cliprect,TRANSPARENCY_PEN,0); | |
| 61 | 0x04,256-copsnrob_cary[3],0); | |
| 67 | 62 | |
| 68 | 63 | |
| 69 | 64 | /* Draw the beer truck. Positioning was based on a screen shot. |
| r5077 | r5078 | |
| 89 | 84 | { |
| 90 | 85 | /* We've hit a truck's back end, so draw the truck. The front |
| 91 | 86 | 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], | |
| 93 | 88 | 0,0, |
| 94 | 89 | 0,0, |
| 95 | 0x80,256-(y+31), | |
| 96 | cliprect,TRANSPARENCY_PEN,0); | |
| 90 | 0x80,256-(y+31),0); | |
| 97 | 91 | /* Skip past this truck's front end so we don't draw this |
| 98 | 92 | truck twice. */ |
| 99 | 93 | y += 31; |
| r5077 | r5078 | |
| 102 | 96 | { |
| 103 | 97 | /* We missed a truck's back end (it was off the bottom of the |
| 104 | 98 | 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], | |
| 106 | 100 | 0,0, |
| 107 | 101 | 0,0, |
| 108 | 0x80,256-y, | |
| 109 | cliprect,TRANSPARENCY_PEN,0); | |
| 102 | 0x80,256-y,0); | |
| 110 | 103 | } |
| 111 | 104 | } |
| 112 | 105 | } |
| r5077 | r5078 | |
|---|---|---|
| 470 | 470 | flipx = attribute & 0x100; |
| 471 | 471 | if (flipx) sx -= 14; /* should really be 15 */ |
| 472 | 472 | flipy = attribute & 0x200; |
| 473 | drawgfx(bitmap,machine->gfx[3], | |
| 473 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 474 | 474 | sprite, |
| 475 | 475 | color, |
| 476 | 476 | flipx,flipy, |
| 477 | sx-32,sy-16, | |
| 478 | cliprect,TRANSPARENCY_PEN,0); | |
| 477 | sx-32,sy-16,0); | |
| 479 | 478 | } |
| 480 | 479 | } |
| 481 | 480 | } |
| r5077 | r5078 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | /* draw the balls */ |
| 260 | 260 | |
| 261 | drawgfx(bitmap, screen->machine->gfx[2], | |
| 261 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], | |
| 262 | 262 | ball1_pic, |
| 263 | 263 | palette_bank, |
| 264 | 264 | 0, 0, |
| 265 | xld1, yld1, | |
| 266 | cliprect, TRANSPARENCY_PEN, 0); | |
| 265 | xld1, yld1, 0); | |
| 267 | 266 | |
| 268 | drawgfx(bitmap, screen->machine->gfx[3], | |
| 267 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[3], | |
| 269 | 268 | ball2_pic, |
| 270 | 269 | palette_bank, |
| 271 | 270 | 0, 0, |
| 272 | xld2, yld2, | |
| 273 | cliprect, TRANSPARENCY_PEN, 0); | |
| 271 | xld2, yld2, 0); | |
| 274 | 272 | |
| 275 | 273 | /* draw the crow */ |
| 276 | 274 | |
| 277 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 275 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 278 | 276 | crow_pic, |
| 279 | 277 | palette_bank, |
| 280 | 278 | 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); | |
| 283 | 280 | return 0; |
| 284 | 281 | } |
| 285 | 282 | |
| r5077 | r5078 | |
| 298 | 295 | xld = xld1; |
| 299 | 296 | yld = yld1; |
| 300 | 297 | |
| 301 | drawgfx(helper1, machine->gfx[2], | |
| 298 | drawgfx_opaque(helper1, &rect, machine->gfx[2], | |
| 302 | 299 | ball1_pic, |
| 303 | 300 | 0, |
| 304 | 301 | 0, 0, |
| 305 | 0, 0, | |
| 306 | &rect, TRANSPARENCY_NONE, 0); | |
| 302 | 0, 0); | |
| 307 | 303 | |
| 308 | 304 | latch = 0x0C00; |
| 309 | 305 | } |
| r5077 | r5078 | |
| 313 | 309 | xld = xld2; |
| 314 | 310 | yld = yld2; |
| 315 | 311 | |
| 316 | drawgfx(helper1, machine->gfx[3], | |
| 312 | drawgfx_opaque(helper1, &rect, machine->gfx[3], | |
| 317 | 313 | ball2_pic, |
| 318 | 314 | 0, |
| 319 | 315 | 0, 0, |
| 320 | 0, 0, | |
| 321 | &rect, TRANSPARENCY_NONE, 0); | |
| 316 | 0, 0); | |
| 322 | 317 | |
| 323 | 318 | latch = 0x0400; |
| 324 | 319 | } |
| r5077 | r5078 | |
|---|---|---|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | tilemap_draw(bitmap,&finalclip0,layer0,TILEMAP_DRAW_OPAQUE,0); |
| 204 | K007121_sprites_draw(0,bitmap,screen->machine->gfx,screen->machine->colortable | |
| 204 | K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable | |
| 205 | 205 | /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */ |
| 206 | 206 | tilemap_draw(bitmap,&finalclip1,layer1,TILEMAP_DRAW_OPAQUE,0); |
| 207 | 207 | } |
| r5077 | r5078 | |
| 269 | 269 | tilemap_draw(bitmap,&finalclip1,layer1,0,1); |
| 270 | 270 | if(use_clip3[1]) tilemap_draw(bitmap,&finalclip3,layer1,0,1); |
| 271 | 271 | |
| 272 | K007121_sprites_draw(0,bitmap,screen->machine->gfx,screen->machine->colortable | |
| 272 | K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable | |
| 273 | 273 | } |
| 274 | 274 | return 0; |
| 275 | 275 | } |
| r5077 | r5078 | |
|---|---|---|
| 122 | 122 | flipy ^= 0x0080; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | drawgfxzoom( bitmap, machine -> gfx[0], | |
| 125 | drawgfxzoom_transpen( bitmap, cliprect, | |
| 126 | machine -> gfx[0], | |
| 126 | 127 | tile, |
| 127 | 128 | color, |
| 128 | 129 | flipx, flipy, |
| 129 | 130 | x, y, |
| 130 | cliprect, | |
| 131 | TRANSPARENCY_PEN, 0, | |
| 132 | zx, zy | |
| 131 | zx, zy, 0 | |
| 133 | 132 | ); |
| 134 | 133 | } |
| 135 | 134 | tile_offs ++; |
| r5077 | r5078 | |
|---|---|---|
| 288 | 288 | int which = spriteaddr[offs]; |
| 289 | 289 | int color = spriteaddr[offs+2] >> 7; |
| 290 | 290 | |
| 291 | drawgfx(spritebitmap, screen->machine->gfx[0], which, color, flip, flip, x, y | |
| 291 | drawgfx_transpen(spritebitmap, cliprect, screen->machine->gfx[0], which, color, flip, flip, x, y | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /* draw the bitmap to the screen, looping over Y */ |
| r5077 | r5078 | |
|---|---|---|
| 163 | 163 | |
| 164 | 164 | for (i = 0; i <= height; i++) |
| 165 | 165 | { |
| 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); | |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 |
| r5077 | r5078 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | for (i = 0; i < 4; i++) |
| 133 | 133 | { |
| 134 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 134 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 135 | 135 | get_sprite_code(i), |
| 136 | 136 | i, |
| 137 | 137 | 0, 0, |
| 138 | 138 | get_sprite_x(i), |
| 139 | get_sprite_y(i), | |
| 140 | cliprect, TRANSPARENCY_PEN, 0); | |
| 139 | get_sprite_y(i), 0); | |
| 141 | 140 | } |
| 142 | 141 | return 0; |
| 143 | 142 | } |
| r5077 | r5078 | |
| 179 | 178 | |
| 180 | 179 | tilemap_draw(helper, &rect, bg_tilemap, 0, 0); |
| 181 | 180 | |
| 182 | drawgfx(helper, machine->gfx[1], | |
| 181 | drawgfx_transpen(helper, &rect, machine->gfx[1], | |
| 183 | 182 | get_sprite_code(i), |
| 184 | 183 | 0, |
| 185 | 184 | 0, 0, |
| 186 | 185 | get_sprite_x(i), |
| 187 | get_sprite_y(i), | |
| 188 | &rect, TRANSPARENCY_PEN, 1); | |
| 186 | get_sprite_y(i), 1); | |
| 189 | 187 | |
| 190 | 188 | collision[i] |= collision_check(machine->colortable, &rect); |
| 191 | 189 | |
| r5077 | r5078 | |
| 194 | 192 | for (j = 0; j < 4; j++) |
| 195 | 193 | if (j != i) |
| 196 | 194 | { |
| 197 | drawgfx(helper, machine->gfx[1], | |
| 195 | drawgfx_transpen(helper, &rect, machine->gfx[1], | |
| 198 | 196 | get_sprite_code(j), |
| 199 | 197 | 1, |
| 200 | 198 | 0, 0, |
| 201 | 199 | get_sprite_x(j), |
| 202 | get_sprite_y(j), | |
| 203 | &rect, TRANSPARENCY_PEN, 0); | |
| 200 | get_sprite_y(j), 0); | |
| 204 | 201 | } |
| 205 | 202 | |
| 206 | drawgfx(helper, machine->gfx[1], | |
| 203 | drawgfx_transpen(helper, &rect, machine->gfx[1], | |
| 207 | 204 | get_sprite_code(i), |
| 208 | 205 | 0, |
| 209 | 206 | 0, 0, |
| 210 | 207 | get_sprite_x(i), |
| 211 | get_sprite_y(i), | |
| 212 | &rect, TRANSPARENCY_PEN, 1); | |
| 208 | get_sprite_y(i), 1); | |
| 213 | 209 | |
| 214 | 210 | collision[i] |= collision_check(machine->colortable, &rect); |
| 215 | 211 | } |
| r5077 | r5078 | |
|---|---|---|
| 78 | 78 | hpos <<= 1; |
| 79 | 79 | vpos <<= 1; |
| 80 | 80 | |
| 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); | |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 |
| r5077 | r5078 | |
|---|---|---|
| 159 | 159 | flipy = !flipy; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | drawgfx(bitmap,screen->machine->gfx[gfx], | |
| 162 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx], | |
| 163 | 163 | code, col | ((*ambush_colorbank & 0x03) << 4), |
| 164 | 164 | flipx, flipy, |
| 165 | sx,sy, | |
| 166 | cliprect,TRANSPARENCY_PEN,0); | |
| 165 | sx,sy,0); | |
| 167 | 166 | } |
| 168 | 167 | |
| 169 | 168 |
| r5077 | r5078 | |
|---|---|---|
| 234 | 234 | COMBINE_DATA( &video_dma_address ); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | static void draw_blend | |
| 237 | static void drawgfx_blend | |
| 238 | 238 | { |
| 239 | const pen_t *pens = &machine->pens[gfx->color_base]; | |
| 239 | const pen_t *pens = &gfx->machine->pens[gfx->color_base]; | |
| 240 | 240 | const UINT8 *dp; |
| 241 | 241 | int i, j; |
| 242 | 242 | int x1, x2; |
| r5077 | r5078 | |
| 410 | 410 | |
| 411 | 411 | for( x=x1; x < width; x++ ) { |
| 412 | 412 | for( y=y1; y < height; y++ ) { |
| 413 | draw_blend | |
| 413 | drawgfx_blend | |
| 414 | 414 | |
| 415 | 415 | /* xpos seems to wrap-around to 0 at 512 */ |
| 416 | 416 | if( (xpos + (16 * x) + 16) >= 512 ) { |
| 417 | draw_blend | |
| 417 | drawgfx_blend | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | tile_num++; |
| r5077 | r5078 | |
|---|---|---|
| 133 | 133 | sy = 240 - sy; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | drawgfx(bitmap, machine->gfx[2], | |
| 136 | drawgfx_transpen(bitmap, cliprect,machine->gfx[2], | |
| 137 | 137 | code, |
| 138 | 138 | color, |
| 139 | 139 | flipx,flip_screen_get(machine), |
| 140 | sx,sy, | |
| 141 | cliprect,TRANSPARENCY_PEN,0); | |
| 140 | sx,sy,0); | |
| 142 | 141 | } |
| 143 | 142 | } |
| 144 | 143 | |
| r5077 | r5078 | |
| 203 | 202 | sy = 240 - sy; |
| 204 | 203 | } |
| 205 | 204 | |
| 206 | drawgfx(bitmap, machine->gfx[1], | |
| 205 | drawgfx_transpen(bitmap, cliprect,machine->gfx[1], | |
| 207 | 206 | code, |
| 208 | 207 | color, |
| 209 | 208 | flipx,flip_screen_get(machine), |
| 210 | sx,sy, | |
| 211 | cliprect,TRANSPARENCY_PEN,0); | |
| 209 | sx,sy,0); | |
| 212 | 210 | } |
| 213 | 211 | } |
| 214 | 212 |
| r5077 | r5078 | |
|---|---|---|
| 303 | 303 | { |
| 304 | 304 | for (x = 0;x <= sizex;x++) |
| 305 | 305 | { |
| 306 | drawgfx(bitmap,machine->gfx[1], | |
| 306 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 307 | 307 | sprite + (duplicate ? 0 : (gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)])), |
| 308 | 308 | color, |
| 309 | 309 | flipx,flipy, |
| 310 | 310 | sx + 16*x,sy + 16*y, |
| 311 | cliprect,TRANSPARENCY_PENS, | |
| 312 | 311 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0xff)); |
| 313 | 312 | } |
| 314 | 313 | } |
| r5077 | r5078 | |
|---|---|---|
| 154 | 154 | else |
| 155 | 155 | x = (240-x) & 0xff; |
| 156 | 156 | |
| 157 | drawgfx(bitmap,screen->machine->gfx[3-g], | |
| 157 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3-g], | |
| 158 | 158 | chr, |
| 159 | 159 | col, |
| 160 | 160 | fx,fy, |
| 161 | x,y, | |
| 162 | cliprect,TRANSPARENCY_PEN,0); | |
| 161 | x,y,0); | |
| 163 | 162 | |
| 164 | 163 | if (x>240) |
| 165 | 164 | { |
| 166 | drawgfx(bitmap,screen->machine->gfx[3-g], | |
| 165 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3-g], | |
| 167 | 166 | chr, |
| 168 | 167 | col, |
| 169 | 168 | fx,fy, |
| 170 | x-256,y, | |
| 171 | cliprect,TRANSPARENCY_PEN,0); | |
| 169 | x-256,y,0); | |
| 172 | 170 | } |
| 173 | 171 | } |
| 174 | 172 | } |
| r5077 | r5078 | |
|---|---|---|
| 196 | 196 | code = carpolo_alpharam[alpha_line * 32 + x] >> 2; |
| 197 | 197 | col = carpolo_alpharam[alpha_line * 32 + x] & 0x03; |
| 198 | 198 | |
| 199 | drawgfx(bitmap,machine->gfx[2], | |
| 199 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 200 | 200 | code,col, |
| 201 | 201 | 0,0, |
| 202 | x*8,video_line*8, | |
| 203 | cliprect,TRANSPARENCY_PEN,0); | |
| 202 | x*8,video_line*8,0); | |
| 204 | 203 | } |
| 205 | 204 | } |
| 206 | 205 | |
| r5077 | r5078 | |
| 225 | 224 | x = 240 - x; |
| 226 | 225 | y = 240 - y; |
| 227 | 226 | |
| 228 | drawgfx(bitmap,machine->gfx[0], | |
| 227 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 229 | 228 | remapped_code, col, |
| 230 | 229 | 0, flipy, |
| 231 | x, y, | |
| 232 | cliprect,TRANSPARENCY_PEN,0); | |
| 230 | x, y,0); | |
| 233 | 231 | |
| 234 | 232 | /* draw with wrap around */ |
| 235 | drawgfx(bitmap,machine->gfx[0], | |
| 233 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 236 | 234 | remapped_code, col, |
| 237 | 235 | 0, flipy, |
| 238 | (INT16)x - 256, y, | |
| 239 | cliprect,TRANSPARENCY_PEN,0); | |
| 236 | (INT16)x - 256, y,0); | |
| 240 | 237 | } |
| 241 | 238 | |
| 242 | 239 | |
| r5077 | r5078 | |
| 283 | 280 | |
| 284 | 281 | /* left goal - position determined by bit 6 of the |
| 285 | 282 | horizontal and vertical timing PROMs */ |
| 286 | drawgfxzoom(bitmap,screen->machine->gfx[1], | |
| 283 | drawgfxzoom_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 287 | 284 | 0,0, |
| 288 | 285 | 0,0, |
| 289 | 286 | LEFT_GOAL_X,GOAL_Y, |
| 290 | cliprect,TRANSPARENCY_PEN,0, | |
| 291 | 0x20000,0x20000); | |
| 287 | 0x20000,0x20000,0); | |
| 292 | 288 | |
| 293 | 289 | /* right goal */ |
| 294 | drawgfxzoom(bitmap,screen->machine->gfx[1], | |
| 290 | drawgfxzoom_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 295 | 291 | 0,1, |
| 296 | 292 | 1,0, |
| 297 | 293 | RIGHT_GOAL_X,GOAL_Y, |
| 298 | cliprect,TRANSPARENCY_PEN,0, | |
| 299 | 0x20000,0x20000); | |
| 294 | 0x20000,0x20000,0); | |
| 300 | 295 | |
| 301 | 296 | /* special char - bit 0 of 0x0f enables it, |
| 302 | 297 | bit 1 marked as WIDE, but never appears to be set */ |
| r5077 | r5078 | |
| 382 | 377 | bitmap_fill(sprite_sprite_collision_bitmap1, 0, 0); |
| 383 | 378 | bitmap_fill(sprite_sprite_collision_bitmap2, 0, 0); |
| 384 | 379 | |
| 385 | drawgfx(sprite_sprite_collision_bitmap1,machine->gfx[0], | |
| 380 | drawgfx_opaque(sprite_sprite_collision_bitmap1,0,machine->gfx[0], | |
| 386 | 381 | code1,0, |
| 387 | 382 | 0,flipy1, |
| 388 | x1,y1, | |
| 389 | 0,TRANSPARENCY_NONE,0); | |
| 383 | x1,y1); | |
| 390 | 384 | |
| 391 | drawgfx(sprite_sprite_collision_bitmap2,machine->gfx[0], | |
| 385 | drawgfx_opaque(sprite_sprite_collision_bitmap2,0,machine->gfx[0], | |
| 392 | 386 | code2,0, |
| 393 | 387 | 0,flipy2, |
| 394 | x2,y2, | |
| 395 | 0,TRANSPARENCY_NONE,0); | |
| 388 | x2,y2); | |
| 396 | 389 | |
| 397 | 390 | for (x = x1; x < x1 + SPRITE_WIDTH; x++) |
| 398 | 391 | for (y = y1; y < y1 + SPRITE_HEIGHT; y++) |
| r5077 | r5078 | |
| 437 | 430 | bitmap_fill(sprite_goal_collision_bitmap1, 0, 0); |
| 438 | 431 | bitmap_fill(sprite_goal_collision_bitmap2, 0, 0); |
| 439 | 432 | |
| 440 | drawgfx(sprite_goal_collision_bitmap1,machine->gfx[0], | |
| 433 | drawgfx_opaque(sprite_goal_collision_bitmap1,0,machine->gfx[0], | |
| 441 | 434 | code1,0, |
| 442 | 435 | 0,flipy1, |
| 443 | x1,y1, | |
| 444 | 0,TRANSPARENCY_NONE,0); | |
| 436 | x1,y1); | |
| 445 | 437 | |
| 446 | drawgfxzoom(sprite_goal_collision_bitmap2,machine->gfx[1], | |
| 438 | drawgfxzoom_transpen(sprite_goal_collision_bitmap2,0,machine->gfx[1], | |
| 447 | 439 | 0,0, |
| 448 | 440 | 0,0, |
| 449 | 441 | x2,y2, |
| 450 | 0,TRANSPARENCY_PEN,0, | |
| 451 | 0x20000,0x20000); | |
| 442 | 0x20000,0x20000,0); | |
| 452 | 443 | |
| 453 | 444 | for (x = x1; x < x1 + SPRITE_WIDTH; x++) |
| 454 | 445 | for (y = y1; y < y1 + SPRITE_HEIGHT; y++) |
| r5077 | r5078 | |
| 496 | 487 | bitmap_fill(sprite_goal_collision_bitmap1, 0, 0); |
| 497 | 488 | bitmap_fill(sprite_goal_collision_bitmap2, 0, 0); |
| 498 | 489 | |
| 499 | drawgfx(sprite_goal_collision_bitmap1,machine->gfx[0], | |
| 490 | drawgfx_opaque(sprite_goal_collision_bitmap1,0,machine->gfx[0], | |
| 500 | 491 | code1,0, |
| 501 | 492 | 0,flipy1, |
| 502 | x1,y1, | |
| 503 | 0,TRANSPARENCY_NONE,0); | |
| 493 | x1,y1); | |
| 504 | 494 | |
| 505 | drawgfxzoom(sprite_goal_collision_bitmap2,machine->gfx[1], | |
| 495 | drawgfxzoom_transpen(sprite_goal_collision_bitmap2,0,machine->gfx[1], | |
| 506 | 496 | 0,1, |
| 507 | 497 | 1,0, |
| 508 | 498 | x2,y2, |
| 509 | 0,TRANSPARENCY_PEN,0, | |
| 510 | 0x20000,0x20000); | |
| 499 | 0x20000,0x20000,0); | |
| 511 | 500 | |
| 512 | 501 | for (x = x1; x < x1 + SPRITE_WIDTH; x++) |
| 513 | 502 | for (y = y1; y < y1 + SPRITE_HEIGHT; y++) |
| r5077 | r5078 | |
| 543 | 532 | x1 = 240 - x1; |
| 544 | 533 | y1 = 240 - y1; |
| 545 | 534 | |
| 546 | drawgfx(sprite_border_collision_bitmap,machine->gfx[0], | |
| 535 | drawgfx_opaque(sprite_border_collision_bitmap,0,machine->gfx[0], | |
| 547 | 536 | code1,0, |
| 548 | 537 | 0,flipy1, |
| 549 | 0,0, | |
| 550 | 0,TRANSPARENCY_NONE,0); | |
| 538 | 0,0); | |
| 551 | 539 | |
| 552 | 540 | for (x = 0; x < SPRITE_WIDTH; x++) |
| 553 | 541 | for (y = 0; y < SPRITE_HEIGHT; y++) |
| r5077 | r5078 | |
|---|---|---|
| 311 | 311 | { |
| 312 | 312 | for (y = 0 ; y < dimy ; y++) |
| 313 | 313 | { |
| 314 | drawgfx(bitmap,machine->gfx[2], | |
| 314 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 315 | 315 | code, |
| 316 | 316 | color, |
| 317 | 317 | flipx, flipy, |
| 318 | 318 | sx + x*16, |
| 319 | sy + y*16, | |
| 320 | cliprect,TRANSPARENCY_PEN,15); | |
| 319 | sy + y*16,15); | |
| 321 | 320 | |
| 322 | 321 | code += inc; |
| 323 | 322 | } |
| r5077 | r5078 | |
|---|---|---|
| 2392 | 2392 | |
| 2393 | 2393 | } |
| 2394 | 2394 | |
| 2395 | static void stv_vdp2_drawgfxzoom( running_machine *machine, | |
| 2396 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 2395 | static void stv_vdp2_drawgfxzoom( | |
| 2396 | bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 2397 | 2397 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 2398 | | |
| 2398 | | |
| 2399 | 2399 | int sprite_screen_width, int sprite_screen_height, int alpha) |
| 2400 | 2400 | { |
| 2401 | 2401 | rectangle myclip; |
| r5077 | r5078 | |
| 2449 | 2449 | |
| 2450 | 2450 | if( gfx ) |
| 2451 | 2451 | { |
| 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)]; | |
| 2453 | 2453 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 2454 | 2454 | |
| 2455 | 2455 | //int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; |
| r5077 | r5078 | |
| 2726 | 2726 | *rgb = (_r << 10) | (_g << 5) | _b; |
| 2727 | 2727 | } |
| 2728 | 2728 | |
| 2729 | static 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) | |
| 2729 | static 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) | |
| 2731 | 2731 | { |
| 2732 | 2732 | rectangle myclip; |
| 2733 | 2733 | UINT8* gfxdata; |
| r5077 | r5078 | |
| 3711 | 3711 | if (stv2_current_tilemap.tile_size==1) |
| 3712 | 3712 | { |
| 3713 | 3713 | /* 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); | |
| 3718 | 3718 | |
| 3719 | 3719 | } |
| 3720 | 3720 | else |
| 3721 | 3721 | { |
| 3722 | stv_vdp2_drawgfxzoom( | |
| 3722 | stv_vdp2_drawgfxzoom( | |
| 3723 | 3723 | } |
| 3724 | 3724 | } |
| 3725 | 3725 | else |
| r5077 | r5078 | |
| 3732 | 3732 | if ( stv2_current_tilemap.colour_depth == 3 ) |
| 3733 | 3733 | { |
| 3734 | 3734 | /* 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); | |
| 3739 | 3739 | |
| 3740 | 3740 | } |
| 3741 | 3741 | else if (stv2_current_tilemap.transparency == STV_TRANSPARENCY_ALPHA) |
| r5077 | r5078 | |
| 3761 | 3761 | { |
| 3762 | 3762 | if ( stv2_current_tilemap.colour_depth == 3 ) |
| 3763 | 3763 | { |
| 3764 | stv_vdp2_drawgfx_rgb555(bitmap,tilecode,flipyx&1,flipyx&2,drawxpos,drawypos | |
| 3764 | stv_vdp2_drawgfx_rgb555(bitmap,cliprect,tilecode,flipyx&1,flipyx&2,drawxpos,drawypos | |
| 3765 | 3765 | } |
| 3766 | 3766 | else |
| 3767 | 3767 | { |
| r5077 | r5078 | |
|---|---|---|
| 204 | 204 | sx = buffered_spriteram[offs + 3] - ((buffered_spriteram[offs + 1] & 0x80) << 1); |
| 205 | 205 | sy = buffered_spriteram[offs + 2]; |
| 206 | 206 | |
| 207 | drawgfx(bitmap,machine->gfx[3], | |
| 207 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 208 | 208 | code, |
| 209 | 209 | color, |
| 210 | 210 | flipx,flipy, |
| 211 | sx,sy, | |
| 212 | cliprect,TRANSPARENCY_PEN,0); | |
| 211 | sx,sy,0); | |
| 213 | 212 | } |
| 214 | 213 | } |
| 215 | 214 | } |
| r5077 | r5078 | |
|---|---|---|
| 285 | 285 | { |
| 286 | 286 | for (tx = 0; tx <= tilesize; tx++) |
| 287 | 287 | { |
| 288 | drawgfx(bitmap, machine->gfx[gfx], | |
| 288 | drawgfx_transpen(bitmap, cliprect,machine->gfx[gfx], | |
| 289 | 289 | code ^ tx ^ (ty<<1), |
| 290 | 290 | color, |
| 291 | 291 | 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 ); | |
| 294 | 293 | } |
| 295 | 294 | } |
| 296 | 295 | |
| r5077 | r5078 | |
| 328 | 327 | { |
| 329 | 328 | for (x = 0; x <= sizex; x++) |
| 330 | 329 | { |
| 331 | drawgfx(bitmap, machine->gfx[gfx], | |
| 330 | drawgfx_transpen(bitmap, cliprect,machine->gfx[gfx], | |
| 332 | 331 | code++, |
| 333 | 332 | color, |
| 334 | 333 | 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 ); | |
| 337 | 335 | } |
| 338 | 336 | } |
| 339 | 337 | } |
| r5077 | r5078 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | /* draw the graphics */ |
| 175 | 175 | tilemap_draw(bitmap,&final_clip[0],k007121_tilemap[0],0,0); |
| 176 | K007121_sprites_draw(0,bitmap,screen->machine->gfx,NULL | |
| 176 | K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,NULL | |
| 177 | 177 | tilemap_draw(bitmap,&final_clip[1],k007121_tilemap[1],0,0); |
| 178 | 178 | return 0; |
| 179 | 179 | } |
| r5077 | r5078 | |
|---|---|---|
| 122 | 122 | vy = 240 - vy; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | pdrawgfx(bitmap,gfx, | |
| 125 | pdrawgfx_transpen(bitmap,cliprect,gfx, | |
| 126 | 126 | number, |
| 127 | 127 | 0 /*color*/, |
| 128 | 128 | flipx,flipy, |
| 129 | 129 | vx,vy, |
| 130 | cliprect,TRANSPARENCY_PEN,0, | |
| 131 | priority_mask); | |
| 130 | priority_bitmap, | |
| 131 | priority_mask,0); | |
| 132 | 132 | |
| 133 | 133 | number++; |
| 134 | 134 | sy += 16; |
| r5077 | r5078 | |
| 141 | 141 | vy = 240 - vy; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | pdrawgfx(bitmap,gfx, | |
| 144 | pdrawgfx_transpen(bitmap,cliprect,gfx, | |
| 145 | 145 | number, |
| 146 | 146 | 0 /*color*/, |
| 147 | 147 | flipx,flipy, |
| 148 | 148 | vx,vy, |
| 149 | cliprect,TRANSPARENCY_PEN,0, | |
| 150 | priority_mask); | |
| 149 | priority_bitmap, | |
| 150 | priority_mask,0); | |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | source -= 4; |
| r5077 | r5078 | |
|---|---|---|
| 275 | 275 | if (bank==0) source=private_spriteram; |
| 276 | 276 | else source=private_spriteram_2; |
| 277 | 277 | |
| 278 | K007121_sprites_draw(bank,bitmap,machine->gfx,machine->colortable | |
| 278 | K007121_sprites_draw(bank,bitmap,cliprect,machine->gfx,machine->colortable | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | VIDEO_UPDATE( contra ) |
| r5077 | r5078 | |
|---|---|---|
| 195 | 195 | if (flip_screen_get(machine)) { x = 0xf0 - x; flipx = !flipx; |
| 196 | 196 | y = 0xf0 - y; flipy = !flipy; } |
| 197 | 197 | |
| 198 | drawgfx(bitmap,machine->gfx[0], | |
| 198 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 199 | 199 | code + (attr << 8), |
| 200 | 200 | 0, |
| 201 | 201 | flipx, flipy, |
| 202 | x,y, | |
| 203 | cliprect,TRANSPARENCY_PEN, 0xff ); | |
| 202 | x,y, 0xff ); | |
| 204 | 203 | |
| 205 | 204 | /* wrap around x */ |
| 206 | drawgfx(bitmap,machine->gfx[0], | |
| 205 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 207 | 206 | code + (attr << 8), |
| 208 | 207 | 0, |
| 209 | 208 | flipx, flipy, |
| 210 | x - 256,y, | |
| 211 | cliprect,TRANSPARENCY_PEN, 0xff ); | |
| 209 | x - 256,y, 0xff ); | |
| 212 | 210 | |
| 213 | drawgfx(bitmap,machine->gfx[0], | |
| 211 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 214 | 212 | code + (attr << 8), |
| 215 | 213 | 0, |
| 216 | 214 | flipx, flipy, |
| 217 | x + 256,y, | |
| 218 | cliprect,TRANSPARENCY_PEN, 0xff ); | |
| 215 | x + 256,y, 0xff ); | |
| 219 | 216 | } |
| 220 | 217 | } |
| 221 | 218 |
| r5077 | r5078 | |
|---|---|---|
| 88 | 88 | x = (sx + xc * 8) & 0xff; |
| 89 | 89 | y = (sy + yc * 8) & 0xff; |
| 90 | 90 | |
| 91 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 91 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 92 | 92 | code, |
| 93 | 93 | color, |
| 94 | 94 | flipx,flipy, |
| 95 | x,y, | |
| 96 | cliprect,TRANSPARENCY_PEN,15); | |
| 95 | x,y,15); | |
| 97 | 96 | } |
| 98 | 97 | } |
| 99 | 98 | } |
| r5077 | r5078 | |
| 145 | 144 | color = (mexico86_videoram[goffs + 1] & 0xe0) >> 5; |
| 146 | 145 | goffs += 0x40; |
| 147 | 146 | |
| 148 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 147 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 149 | 148 | code, |
| 150 | 149 | color, |
| 151 | 150 | 0,0, |
| 152 | sx&0xff,y, | |
| 153 | cliprect,TRANSPARENCY_PEN,15); | |
| 151 | sx&0xff,y,15); | |
| 154 | 152 | |
| 155 | 153 | code = mexico86_videoram[goffs] + ((mexico86_videoram[goffs + 1] & 0x1f) << 8); |
| 156 | 154 | color = (mexico86_videoram[goffs + 1] & 0xe0) >> 5; |
| 157 | 155 | |
| 158 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 156 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 159 | 157 | code, |
| 160 | 158 | color, |
| 161 | 159 | 0,0, |
| 162 | (sx+8)&0xff,y, | |
| 163 | cliprect,TRANSPARENCY_PEN,15); | |
| 160 | (sx+8)&0xff,y,15); | |
| 164 | 161 | } |
| 165 | 162 | } |
| 166 | 163 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 235 | 235 | flipy = !flipy; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | drawgfx(bitmap,machine->gfx[0], | |
| 238 | drawgfx_transpen(bitmap,cliprect, | |
| 239 | machine->gfx[0], | |
| 239 | 240 | tile, |
| 240 | 241 | color, |
| 241 | 242 | flipx, flipy, |
| 242 | sx, sy, | |
| 243 | cliprect, | |
| 244 | TRANSPARENCY_PEN, 0); | |
| 243 | sx, sy, 0); | |
| 245 | 244 | } |
| 246 | 245 | } |
| 247 | 246 |
| r5077 | r5078 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | if (end) break; |
| 36 | 36 | if (prio == layer) |
| 37 | drawgfx(bitmap,gfx,number,colr,xflip,yflip,xpos,ypos | |
| 37 | drawgfx_transpen(bitmap,cliprect,gfx,number,colr,xflip,yflip,xpos,ypos | |
| 38 | 38 | |
| 39 | 39 | source+=4; |
| 40 | 40 | } |
| r5077 | r5078 | |
|---|---|---|
| 211 | 211 | |
| 212 | 212 | y = 0xf0 - drones_vert[i >> 1]; |
| 213 | 213 | |
| 214 | drawgfx(bitmap, machine->gfx[1], | |
| 214 | drawgfx_transpen(bitmap, cliprect, | |
| 215 | machine->gfx[1], | |
| 215 | 216 | code[i] ^ toggle, |
| 216 | 217 | 0, |
| 217 | 218 | 0, 0, |
| 218 | 219 | x, |
| 219 | y, | |
| 220 | cliprect, | |
| 221 | TRANSPARENCY_PEN, 0); | |
| 220 | y, 0); | |
| 222 | 221 | } |
| 223 | 222 | } |
| 224 | 223 | |
| r5077 | r5078 | |
| 242 | 241 | |
| 243 | 242 | y = 0xf0 - driver_vert; |
| 244 | 243 | |
| 245 | drawgfx(bitmap, machine->gfx[0], | |
| 244 | drawgfx_transpen(bitmap, cliprect, | |
| 245 | machine->gfx[0], | |
| 246 | 246 | driver_pic, |
| 247 | 247 | 0, |
| 248 | 248 | 0, 0, |
| 249 | 249 | x, |
| 250 | y, | |
| 251 | cliprect, | |
| 252 | TRANSPARENCY_PEN, 0); | |
| 250 | y, 0); | |
| 253 | 251 | } |
| 254 | 252 | |
| 255 | 253 |
| r5077 | r5078 | |
|---|---|---|
| 86 | 86 | flipy = !flipy; |
| 87 | 87 | } |
| 88 | 88 | |
| 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 ); | |
| 91 | 91 | |
| 92 | 92 | pSource += 4; |
| 93 | 93 | } |
| r5077 | r5078 | |
|---|---|---|
| 87 | 87 | /* Note: this is _not_ dependant on flipping */ |
| 88 | 88 | color_offs = offs%32 + ((256 + 8*(offs/32) - spriteram[offs%32])%256)/8*32; |
| 89 | 89 | |
| 90 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 90 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 91 | 91 | videoram[offs] | (colorram[color_offs]>>5)*256 | ((colorram[color_offs]>>4)&1)*512, |
| 92 | 92 | colorram[color_offs]%16, |
| 93 | 93 | 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); | |
| 96 | 95 | } |
| 97 | 96 | |
| 98 | 97 | /* There seem to be two sets of sprites, each decoded identically */ |
| r5077 | r5078 | |
| 119 | 118 | } |
| 120 | 119 | |
| 121 | 120 | 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)], | |
| 123 | 122 | spriteram[offs]&0x3f, |
| 124 | 123 | spriteram[offs+1]%16, |
| 125 | 124 | flipx,flipy, |
| 126 | sx,sy, | |
| 127 | cliprect,TRANSPARENCY_PEN,0); | |
| 125 | sx,sy,0); | |
| 128 | 126 | } |
| 129 | 127 | |
| 130 | 128 | /* This is the second set of 8 sprites */ |
| r5077 | r5078 | |
| 149 | 147 | } |
| 150 | 148 | |
| 151 | 149 | 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)], | |
| 153 | 151 | spriteram[offs]&0x3f, |
| 154 | 152 | spriteram[offs+1]%16, |
| 155 | 153 | flipx,flipy, |
| 156 | sx,sy, | |
| 157 | cliprect,TRANSPARENCY_PEN,0); | |
| 154 | sx,sy,0); | |
| 158 | 155 | } |
| 159 | 156 | |
| 160 | 157 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 192 | 192 | } |
| 193 | 193 | else |
| 194 | 194 | { |
| 195 | drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 195 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 196 | 196 | sprite_ptr->code, |
| 197 | 197 | sprite_ptr->color, |
| 198 | 198 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 199 | 199 | 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); | |
| 202 | 201 | } |
| 203 | 202 | } |
| 204 | 203 | } |
| r5077 | r5078 | |
| 212 | 211 | { |
| 213 | 212 | sprite_ptr--; |
| 214 | 213 | |
| 215 | pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 214 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 216 | 215 | sprite_ptr->code, |
| 217 | 216 | sprite_ptr->color, |
| 218 | 217 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 219 | 218 | sprite_ptr->x,sprite_ptr->y, |
| 220 | cliprect,TRANSPARENCY_PEN,0, | |
| 221 | 219 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 222 | sprite_ptr->primask); | |
| 220 | priority_bitmap,sprite_ptr->primask,0); | |
| 223 | 221 | } |
| 224 | 222 | } |
| 225 | 223 | |
| r5077 | r5078 | |
| 331 | 329 | } |
| 332 | 330 | else |
| 333 | 331 | { |
| 334 | drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 332 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 335 | 333 | sprite_ptr->code, |
| 336 | 334 | sprite_ptr->color, |
| 337 | 335 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 338 | 336 | 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); | |
| 341 | 338 | } |
| 342 | 339 | } |
| 343 | 340 | } |
| r5077 | r5078 | |
| 347 | 344 | { |
| 348 | 345 | sprite_ptr--; |
| 349 | 346 | |
| 350 | pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 347 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 351 | 348 | sprite_ptr->code, |
| 352 | 349 | sprite_ptr->color, |
| 353 | 350 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 354 | 351 | sprite_ptr->x,sprite_ptr->y, |
| 355 | cliprect,TRANSPARENCY_PEN,0, | |
| 356 | 352 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 357 | sprite_ptr->primask); | |
| 353 | priority_bitmap,sprite_ptr->primask,0); | |
| 358 | 354 | } |
| 359 | 355 | } |
| 360 | 356 |
| r5077 | r5078 | |
|---|---|---|
| 279 | 279 | |
| 280 | 280 | for (x=0; x<w; x++) { |
| 281 | 281 | for (y=0; y<h; y++) { |
| 282 | pdrawgfx(bitmap,machine->gfx[gfxbank], | |
| 282 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[gfxbank], | |
| 283 | 283 | sprite + y + h * x, |
| 284 | 284 | colour, |
| 285 | 285 | fx,fy, |
| 286 | 286 | sx + x_mult * (w-x),sy + y_mult * (h-y), |
| 287 | | |
| 287 | | |
| 288 | 288 | |
| 289 | 289 | // wrap-around y |
| 290 | pdrawgfx(bitmap,machine->gfx[gfxbank], | |
| 290 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[gfxbank], | |
| 291 | 291 | sprite + y + h * x, |
| 292 | 292 | colour, |
| 293 | 293 | fx,fy, |
| 294 | 294 | sx + x_mult * (w-x),sy + y_mult * (h-y) - 512, |
| 295 | | |
| 295 | | |
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | } |
| r5077 | r5078 | |
| 346 | 346 | |
| 347 | 347 | while (multi >= 0) |
| 348 | 348 | { |
| 349 | deco16_pdrawgfx(machine, | |
| 350 | bitmap,machine->gfx[gfxbank], | |
| 349 | deco16_pdrawgfx( | |
| 350 | bitmap,cliprect,machine->gfx[gfxbank], | |
| 351 | 351 | sprite - multi * inc, |
| 352 | 352 | colour, |
| 353 | 353 | fx,fy, |
| 354 | 354 | x,y + mult * multi, |
| 355 | | |
| 355 | | |
| 356 | 356 | |
| 357 | 357 | multi--; |
| 358 | 358 | } |
| r5077 | r5078 | |
| 364 | 364 | Bottom 8 bits per pixel is palettised sprite data, top 8 is |
| 365 | 365 | colour/alpha/priority. |
| 366 | 366 | */ |
| 367 | static 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) | |
| 367 | static 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) | |
| 370 | 369 | { |
| 371 | 370 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 372 | 371 | int ox,oy,cx,cy; |
| r5077 | r5078 | |
| 462 | 461 | |
| 463 | 462 | while (multi >= 0) |
| 464 | 463 | { |
| 465 | deco32_draw_sprite(bitmap,machine->gfx[gfxbank], | |
| 464 | deco32_draw_sprite(bitmap,cliprect,machine->gfx[gfxbank], | |
| 466 | 465 | sprite - multi * inc, |
| 467 | 466 | colour, |
| 468 | 467 | fx,fy, |
| 469 | x,y + mult * multi, | |
| 470 | cliprect); | |
| 468 | x,y + mult * multi); | |
| 471 | 469 | |
| 472 | 470 | multi--; |
| 473 | 471 | } |
| 474 | 472 | } |
| 475 | 473 | } |
| 476 | 474 | |
| 477 | INLINE void dragngun_drawgfxzoom( running_machine *machine, | |
| 478 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 475 | INLINE void dragngun_drawgfxzoom( | |
| 476 | bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 479 | 477 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 480 | | |
| 478 | | |
| 481 | 479 | int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask, int sprite_screen_width, int sprite_screen_height, UINT8 alpha ) |
| 482 | 480 | { |
| 483 | 481 | rectangle myclip; |
| r5077 | r5078 | |
| 510 | 508 | { |
| 511 | 509 | if( gfx ) |
| 512 | 510 | { |
| 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)]; | |
| 514 | 512 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 515 | 513 | |
| 516 | 514 | if (sprite_screen_width && sprite_screen_height) |
| r5077 | r5078 | |
| 821 | 819 | sprite&=0x7fff; |
| 822 | 820 | |
| 823 | 821 | if (zoomx!=0x10000 || zoomy!=0x10000) |
| 824 | dragngun_drawgfxzoom(machine, | |
| 825 | bitmap,machine->gfx[bank], | |
| 822 | dragngun_drawgfxzoom( | |
| 823 | bitmap,cliprect,machine->gfx[bank], | |
| 826 | 824 | sprite, |
| 827 | 825 | colour, |
| 828 | 826 | fx,fy, |
| 829 | 827 | xpos>>16,ypos>>16, |
| 830 | | |
| 828 | | |
| 831 | 829 | ((xpos+(zoomx<<4))>>16) - (xpos>>16), ((ypos+(zoomy<<4))>>16) - (ypos>>16), alpha ); |
| 832 | 830 | else |
| 833 | 831 | drawgfx_alpha(bitmap,cliprect,machine->gfx[bank], |
| r5077 | r5078 | |
| 1443 | 1441 | blending support - it can't be done in-place on the final framebuffer |
| 1444 | 1442 | without a lot of support bitmaps. |
| 1445 | 1443 | */ |
| 1446 | static void mixDualAlphaSprites( | |
| 1444 | static void mixDualAlphaSprites( | |
| 1447 | 1445 | { |
| 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]; | |
| 1451 | 1450 | int x,y; |
| 1452 | 1451 | |
| 1453 | 1452 | /* Mix sprites into main bitmap, based on priority & alpha */ |
| r5077 | r5078 | |
| 1653 | 1652 | } |
| 1654 | 1653 | } |
| 1655 | 1654 | |
| 1656 | mixDualAlphaSprites( | |
| 1655 | mixDualAlphaSprites( | |
| 1657 | 1656 | |
| 1658 | 1657 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); |
| 1659 | 1658 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 178 | 178 | { |
| 179 | 179 | if (saa5050_state.saa5050_flags & SAA5050_DBLHI) |
| 180 | 180 | { |
| 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); | |
| 185 | 185 | } |
| 186 | 186 | else |
| 187 | 187 | { |
| 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); | |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | } |
| r5077 | r5078 | |
| 213 | 213 | if(sx < -15) |
| 214 | 214 | sx+=256; |
| 215 | 215 | |
| 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); | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /* update the S2636 chips */ |
| r5077 | r5078 | |
|---|---|---|
| 131 | 131 | if( which==0 ) |
| 132 | 132 | { |
| 133 | 133 | /* draw the current player sprite into a work bitmap */ |
| 134 | drawgfx( state->work_bitmap, | |
| 134 | drawgfx_opaque( state->work_bitmap, | |
| 135 | 0, | |
| 135 | 136 | machine->gfx[4], |
| 136 | 137 | state->cpu0_out[4]&0xf, |
| 137 | 138 | 1, /* color */ |
| 138 | 139 | 0,0, |
| 139 | 0,0, | |
| 140 | 0, | |
| 141 | TRANSPARENCY_NONE, 0 ); | |
| 140 | 0,0 ); | |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | 143 | for( y = 0; y <32; y++ ) |
| r5077 | r5078 | |
| 199 | 198 | int sy = 240-source[0]; |
| 200 | 199 | int color = source[2]; |
| 201 | 200 | int code = source[1]; |
| 202 | drawgfx(bitmap, gfx, | |
| 201 | drawgfx_transpen(bitmap, cliprect, | |
| 202 | gfx, | |
| 203 | 203 | bank + (code & 0x3f), |
| 204 | 204 | color, |
| 205 | 205 | code & 0x40, |
| 206 | 206 | code & 0x80, |
| 207 | sx,sy, | |
| 208 | cliprect, | |
| 209 | TRANSPARENCY_PEN, 0); | |
| 207 | sx,sy, 0); | |
| 210 | 208 | source += 4; |
| 211 | 209 | } |
| 212 | 210 | } |
| r5077 | r5078 | |
|---|---|---|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | if (priority != pri) |
| 903 | jal_blend_drawgfx(machine, | |
| 904 | bitmap,machine->gfx[0], | |
| 903 | jal_blend_drawgfx( | |
| 904 | bitmap,cliprect,machine->gfx[0], | |
| 905 | 905 | tile, |
| 906 | 906 | color, |
| 907 | 907 | flipx, flipy, |
| 908 | 908 | sx, sy, |
| 909 | cliprect, | |
| 910 | 909 | TRANSPARENCY_PEN, 15); |
| 911 | 910 | } |
| 912 | 911 | } |
| r5077 | r5078 | |
| 1033 | 1032 | flipy = !flipy; |
| 1034 | 1033 | } |
| 1035 | 1034 | |
| 1036 | jal_blend_drawgfx(machine, | |
| 1037 | bitmap,machine->gfx[0], | |
| 1035 | jal_blend_drawgfx( | |
| 1036 | bitmap,cliprect,machine->gfx[0], | |
| 1038 | 1037 | tile, |
| 1039 | 1038 | color, |
| 1040 | 1039 | flipx, flipy, |
| 1041 | 1040 | sx, sy, |
| 1042 | cliprect, | |
| 1043 | 1041 | TRANSPARENCY_PEN, 15); |
| 1044 | 1042 | } |
| 1045 | 1043 | } |
| r5077 | r5078 | |
| 1084 | 1082 | |
| 1085 | 1083 | if ((offs >= 0x100 && offs <= 0x2ff) || (offs >= 0x400 && offs <= 0x57f)) |
| 1086 | 1084 | { |
| 1087 | jal_blend_drawgfx(machine, | |
| 1088 | bitmap,machine->gfx[0], | |
| 1085 | jal_blend_drawgfx( | |
| 1086 | bitmap,cliprect,machine->gfx[0], | |
| 1089 | 1087 | tile, |
| 1090 | 1088 | color, |
| 1091 | 1089 | flipx, flipy, |
| 1092 | 1090 | sx, sy, |
| 1093 | cliprect, | |
| 1094 | 1091 | TRANSPARENCY_PEN, 7); |
| 1095 | 1092 | } |
| 1096 | 1093 | else if ((offs >= 0x000 && offs <= 0x0ff) || (offs >= 0x300 && offs <= 0x3ff)) |
| r5077 | r5078 | |
| 1099 | 1096 | { |
| 1100 | 1097 | td = (fx) ? (1 - i) : i; |
| 1101 | 1098 | |
| 1102 | jal_blend_drawgfx(machine, | |
| 1103 | bitmap,machine->gfx[0], | |
| 1099 | jal_blend_drawgfx( | |
| 1100 | bitmap,cliprect,machine->gfx[0], | |
| 1104 | 1101 | tile + td, |
| 1105 | 1102 | color, |
| 1106 | 1103 | flipx, flipy, |
| 1107 | 1104 | sx + i * 16, sy, |
| 1108 | cliprect, | |
| 1109 | 1105 | TRANSPARENCY_PEN, 7); |
| 1110 | 1106 | } |
| 1111 | 1107 | } |
| r5077 | r5078 | |
| 1120 | 1116 | else |
| 1121 | 1117 | td = (fx) ? (i * 2) + 1 - j : i * 2 + j; |
| 1122 | 1118 | |
| 1123 | jal_blend_drawgfx(machine, | |
| 1124 | bitmap,machine->gfx[0], | |
| 1119 | jal_blend_drawgfx( | |
| 1120 | bitmap,cliprect,machine->gfx[0], | |
| 1125 | 1121 | tile + td, |
| 1126 | 1122 | color, |
| 1127 | 1123 | flipx, flipy, |
| 1128 | 1124 | sx + j * 16, sy - i * 16, |
| 1129 | cliprect, | |
| 1130 | 1125 | TRANSPARENCY_PEN, 7); |
| 1131 | 1126 | } |
| 1132 | 1127 | } |
| r5077 | r5078 | |
| 1142 | 1137 | else |
| 1143 | 1138 | td = (fx) ? (i * 4) + 3 - j : i * 4 + j; |
| 1144 | 1139 | |
| 1145 | jal_blend_drawgfx(machine, | |
| 1146 | bitmap,machine->gfx[0], | |
| 1140 | jal_blend_drawgfx( | |
| 1141 | bitmap,cliprect,machine->gfx[0], | |
| 1147 | 1142 | tile + td, |
| 1148 | 1143 | color, |
| 1149 | 1144 | flipx, flipy, |
| 1150 | 1145 | sx + j * 16, sy - i * 16, |
| 1151 | cliprect, | |
| 1152 | 1146 | TRANSPARENCY_PEN, 7); |
| 1153 | 1147 | } |
| 1154 | 1148 | } |
| r5077 | r5078 | |
|---|---|---|
| 145 | 145 | |
| 146 | 146 | for (y = 0;y < height;y++) |
| 147 | 147 | { |
| 148 | pdrawgfx( | |
| 148 | pdrawgfx_transpen( | |
| 149 | 149 | bitmap, |
| 150 | cliprect, | |
| 150 | 151 | machine->gfx[1], |
| 151 | 152 | sprite_number ^ y, |
| 152 | 153 | color, |
| 153 | 154 | flipx,flipy, |
| 154 | 155 | sx&0xff, |
| 155 | 156 | sy + 16*y, |
| 156 | cliprect, | |
| 157 | TRANSPARENCY_PEN,0, | |
| 158 | priority_mask ); | |
| 157 | priority_bitmap, | |
| 158 | priority_mask,0 ); | |
| 159 | 159 | } |
| 160 | 160 | source+=4; |
| 161 | 161 | } |
| r5077 | r5078 | |
|---|---|---|
| 437 | 437 | int sx = find_minimum_x(spriteram[offs + 3], flip); |
| 438 | 438 | |
| 439 | 439 | /* 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); | |
| 444 | 444 | } |
| 445 | 445 | } |
| 446 | 446 |
| r5077 | r5078 | |
|---|---|---|
| 138 | 138 | { |
| 139 | 139 | sx = xpos+(c^xflip)*width; |
| 140 | 140 | sy = ypos+(r^yflip)*height; |
| 141 | drawgfxzoom( | |
| 141 | drawgfxzoom_transpen( | |
| 142 | 142 | bitmap, |
| 143 | cliprect, | |
| 143 | 144 | gfx, |
| 144 | 145 | tile+c*8+r, |
| 145 | 146 | color, |
| 146 | 147 | xflip,yflip, |
| 147 | 148 | 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 ); | |
| 151 | 150 | } |
| 152 | 151 | } |
| 153 | 152 | } |
| r5077 | r5078 | |
| 286 | 285 | sx = videoram[0x1381+i]-64+8+16; |
| 287 | 286 | if( attr&1 ) sx += 0x100; |
| 288 | 287 | |
| 289 | drawgfx( | |
| 288 | drawgfx_transpen( | |
| 290 | 289 | bitmap, |
| 290 | cliprect, | |
| 291 | 291 | machine->gfx[1], |
| 292 | 292 | bank*0x40 + (tile&0x3f), |
| 293 | 293 | color, |
| 294 | 294 | tile&0x80,tile&0x40, /* flipx,flipy */ |
| 295 | sx,sy, | |
| 296 | cliprect, | |
| 297 | TRANSPARENCY_PEN,3 ); | |
| 295 | sx,sy,3 ); | |
| 298 | 296 | } |
| 299 | 297 | } |
| 300 | 298 |
| r5077 | r5078 | |
|---|---|---|
| 213 | 213 | /* proving that this is a hardware related "feature" */ |
| 214 | 214 | sy += 1; |
| 215 | 215 | |
| 216 | drawgfx(bitmap, machine->gfx[0], | |
| 216 | drawgfx_transmask(bitmap, cliprect, | |
| 217 | machine->gfx[0], | |
| 217 | 218 | code + sprite_bank1 + sprite_bank2, color, |
| 218 | 219 | flipx, flipy, |
| 219 | 220 | sx, sy, |
| 220 | cliprect, | |
| 221 | TRANSPARENCY_PENS, | |
| 222 | 221 | colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0)); |
| 223 | 222 | |
| 224 | 223 | /* redraw with wraparound */ |
| 225 | drawgfx(bitmap,machine->gfx[0], | |
| 224 | drawgfx_transmask(bitmap,cliprect, | |
| 225 | machine->gfx[0], | |
| 226 | 226 | code + sprite_bank1 + sprite_bank2, color, |
| 227 | 227 | flipx, flipy, |
| 228 | 228 | sx - 256, sy, |
| 229 | cliprect, | |
| 230 | TRANSPARENCY_PENS, | |
| 231 | 229 | colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0)); |
| 232 | 230 | } |
| 233 | 231 | } |
| r5077 | r5078 | |
|---|---|---|
| 298 | 298 | flipy = !flipy; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | drawgfx(bitmap,machine->gfx[1], | |
| 301 | drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,machine->gfx[1], | |
| 302 | 302 | code, |
| 303 | 303 | colorbank | (fastfred_spriteram[offs + 2] & 0x07), |
| 304 | 304 | flipx,flipy, |
| 305 | sx,sy, | |
| 306 | flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0); | |
| 305 | sx,sy,0); | |
| 307 | 306 | } |
| 308 | 307 | } |
| 309 | 308 |
| r5077 | r5078 | |
|---|---|---|
| 90 | 90 | color = tile >> 12; |
| 91 | 91 | tile = tile&0x7ff; |
| 92 | 92 | 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); | |
| 96 | 95 | 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); | |
| 100 | 98 | } |
| 101 | 99 | |
| 102 | 100 | if (!flipscreen) { |
| r5077 | r5078 | |
| 152 | 150 | } |
| 153 | 151 | else sprite2=sprite+1; |
| 154 | 152 | |
| 155 | drawgfx(bitmap,machine->gfx[2], | |
| 153 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 156 | 154 | sprite, |
| 157 | colour,fx,fy,x,y, | |
| 158 | cliprect,TRANSPARENCY_PEN,0); | |
| 155 | colour,fx,fy,x,y,0); | |
| 159 | 156 | |
| 160 | 157 | /* 1 more sprite drawn underneath */ |
| 161 | 158 | if (extra) |
| 162 | drawgfx(bitmap,machine->gfx[2], | |
| 159 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 163 | 160 | sprite2, |
| 164 | colour,fx,fy,x,y+16, | |
| 165 | cliprect,TRANSPARENCY_PEN,0); | |
| 161 | colour,fx,fy,x,y+16,0); | |
| 166 | 162 | } |
| 167 | 163 | } |
| 168 | 164 |
| r5077 | r5078 | |
|---|---|---|
| 211 | 211 | flipy = !flipy; |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | drawgfx(bitmap,machine->gfx[2], | |
| 214 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 215 | 215 | code,color, |
| 216 | 216 | flipx,flipy, |
| 217 | sx,sy, | |
| 218 | cliprect,TRANSPARENCY_PEN,15); | |
| 217 | sx,sy,15); | |
| 219 | 218 | } |
| 220 | 219 | } |
| 221 | 220 | } |
| r5077 | r5078 | |
| 260 | 259 | flipy = !flipy; |
| 261 | 260 | } |
| 262 | 261 | |
| 263 | drawgfx(bitmap,machine->gfx[2], | |
| 262 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 264 | 263 | code,color, |
| 265 | 264 | flipx,flipy, |
| 266 | sx,sy, | |
| 267 | cliprect,TRANSPARENCY_PEN,15); | |
| 265 | sx,sy,15); | |
| 268 | 266 | } |
| 269 | 267 | } |
| 270 | 268 | } |
| r5077 | r5078 | |
|---|---|---|
| 225 | 225 | { |
| 226 | 226 | int sx = xpos + 8*(flipx?(size-1-x):x); |
| 227 | 227 | int sy = ypos + 8*(flipy?(size-1-y):y); |
| 228 | pdrawgfx(bitmap,machine->gfx[1], | |
| 228 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 229 | 229 | code + layout[y][x], |
| 230 | 230 | flags & 0xf, |
| 231 | 231 | flipx,flipy, |
| 232 | 232 | sx,sy, |
| 233 | cliprect,TRANSPARENCY_PEN,0, | |
| 234 | priority_mask); | |
| 233 | priority_bitmap, | |
| 234 | priority_mask,0); | |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | } |
| r5077 | r5078 | |
|---|---|---|
| 76 | 76 | sx = (sx&0x1ff) - (sx&0x200); |
| 77 | 77 | sy = (sy&0x1ff) - (sy&0x200); |
| 78 | 78 | |
| 79 | drawgfx(bitmap,machine->gfx[0], | |
| 79 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 80 | 80 | code, |
| 81 | 81 | color, |
| 82 | 82 | flipx,flipy, |
| 83 | sx,sy, | |
| 84 | cliprect,TRANSPARENCY_PEN,0); | |
| 83 | sx,sy,0); | |
| 85 | 84 | } |
| 86 | 85 | } |
| 87 | 86 |
| r5077 | r5078 | |
|---|---|---|
| 135 | 135 | flipy = !flipy; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | drawgfx(bitmap,gfx1, | |
| 138 | drawgfx_transpen(bitmap,cliprect,gfx1, | |
| 139 | 139 | code, |
| 140 | 140 | color, |
| 141 | 141 | 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, | |
| 145 | 144 | code + 1, |
| 146 | 145 | color, |
| 147 | 146 | 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, | |
| 151 | 149 | code + 2, |
| 152 | 150 | color, |
| 153 | 151 | 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, | |
| 157 | 154 | code + 3, |
| 158 | 155 | color, |
| 159 | 156 | 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); | |
| 162 | 158 | } |
| 163 | 159 | else |
| 164 | 160 | { |
| r5077 | r5078 | |
| 172 | 168 | |
| 173 | 169 | if (size == 0x00) /* 16x16 */ |
| 174 | 170 | { |
| 175 | drawgfx(bitmap,gfx1, | |
| 171 | drawgfx_transpen(bitmap,cliprect,gfx1, | |
| 176 | 172 | code, |
| 177 | 173 | color, |
| 178 | 174 | flipx,flipy, |
| 179 | sx,sy, | |
| 180 | cliprect,TRANSPARENCY_PEN,0); | |
| 175 | sx,sy,0); | |
| 181 | 176 | } |
| 182 | 177 | else |
| 183 | 178 | { |
| r5077 | r5078 | |
| 185 | 180 | |
| 186 | 181 | if (size == 0x04) /* 16x8 */ |
| 187 | 182 | { |
| 188 | drawgfx(bitmap,gfx2, | |
| 183 | drawgfx_transpen(bitmap,cliprect,gfx2, | |
| 189 | 184 | code & ~1, |
| 190 | 185 | color, |
| 191 | 186 | 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, | |
| 195 | 189 | code | 1, |
| 196 | 190 | color, |
| 197 | 191 | flipx,flipy, |
| 198 | flipx?sx:sx+8,sy, | |
| 199 | cliprect,TRANSPARENCY_PEN,0); | |
| 192 | flipx?sx:sx+8,sy,0); | |
| 200 | 193 | } |
| 201 | 194 | else if (size == 0x08) /* 8x16 */ |
| 202 | 195 | { |
| 203 | drawgfx(bitmap,gfx2, | |
| 196 | drawgfx_transpen(bitmap,cliprect,gfx2, | |
| 204 | 197 | code & ~2, |
| 205 | 198 | color, |
| 206 | 199 | 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, | |
| 210 | 202 | code | 2, |
| 211 | 203 | color, |
| 212 | 204 | flipx,flipy, |
| 213 | sx,flipy?sy:sy+8, | |
| 214 | cliprect,TRANSPARENCY_PEN,0); | |
| 205 | sx,flipy?sy:sy+8,0); | |
| 215 | 206 | } |
| 216 | 207 | else if (size == 0x0c) /* 8x8 */ |
| 217 | 208 | { |
| 218 | drawgfx(bitmap,gfx2, | |
| 209 | drawgfx_transpen(bitmap,cliprect,gfx2, | |
| 219 | 210 | code, |
| 220 | 211 | color, |
| 221 | 212 | flipx,flipy, |
| 222 | sx,sy, | |
| 223 | cliprect,TRANSPARENCY_PEN,0); | |
| 213 | sx,sy,0); | |
| 224 | 214 | } |
| 225 | 215 | } |
| 226 | 216 | } |
| r5077 | r5078 | |
|---|---|---|
| 102 | 102 | int code = (spriteram16[i+1] & 0x0ffc) >> 2; |
| 103 | 103 | int color = (spriteram16[i+1] & 0xf000) >> 12; |
| 104 | 104 | |
| 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); | |
| 107 | 106 | } |
| 108 | 107 | } |
| 109 | 108 |
| r5077 | r5078 | |
|---|---|---|
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | |
| 553 | static void cclimber_draw_sprites(bitmap_t *bitmap, | |
| 553 | static void cclimber_draw_sprites(bitmap_t *bitmap, | |
| 554 | 554 | { |
| 555 | 555 | int offs; |
| 556 | 556 | |
| r5077 | r5078 | |
| 582 | 582 | flipy = !flipy; |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | drawgfx(bitmap, gfx | |
| 585 | drawgfx_transpen(bitmap, cliprect, gfx | |
| 586 | 586 | } |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | |
| 590 | static void swimmer_draw_sprites(bitmap_t *bitmap, | |
| 590 | static void swimmer_draw_sprites(bitmap_t *bitmap, | |
| 591 | 591 | { |
| 592 | 592 | int offs; |
| 593 | 593 | |
| r5077 | r5078 | |
| 619 | 619 | flipy = !flipy; |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | drawgfx(bitmap, gfx | |
| 622 | drawgfx_transpen(bitmap, cliprect, gfx | |
| 623 | 623 | } |
| 624 | 624 | } |
| 625 | 625 | |
| r5077 | r5078 | |
| 633 | 633 | if ((cclimber_bigsprite_control[0] & 0x01)) |
| 634 | 634 | { |
| 635 | 635 | cclimber_draw_bigsprite(bitmap, cliprect); |
| 636 | cclimber_draw_sprites(bitmap, screen->machine->gfx | |
| 636 | cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1] | |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | /* draw the "big sprite" over the regular sprites */ |
| 640 | 640 | else |
| 641 | 641 | { |
| 642 | cclimber_draw_sprites(bitmap, screen->machine->gfx | |
| 642 | cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1] | |
| 643 | 643 | cclimber_draw_bigsprite(bitmap, cliprect); |
| 644 | 644 | } |
| 645 | 645 | |
| r5077 | r5078 | |
| 667 | 667 | if ((cclimber_bigsprite_control[0] & 0x01)) |
| 668 | 668 | { |
| 669 | 669 | cclimber_draw_bigsprite(bitmap, cliprect); |
| 670 | cclimber_draw_sprites(bitmap, screen->machine->gfx | |
| 670 | cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1] | |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | /* draw the "big sprite" over the regular sprites */ |
| 674 | 674 | else |
| 675 | 675 | { |
| 676 | cclimber_draw_sprites(bitmap, screen->machine->gfx | |
| 676 | cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1] | |
| 677 | 677 | cclimber_draw_bigsprite(bitmap, cliprect); |
| 678 | 678 | } |
| 679 | 679 | |
| r5077 | r5078 | |
| 719 | 719 | if ((cclimber_bigsprite_control[0] & 0x01)) |
| 720 | 720 | { |
| 721 | 721 | cclimber_draw_bigsprite(bitmap, cliprect); |
| 722 | swimmer_draw_sprites(bitmap, screen->machine->gfx | |
| 722 | swimmer_draw_sprites(bitmap, cliprect, screen->machine->gfx[1] | |
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | /* draw the "big sprite" over the regular sprites */ |
| 726 | 726 | else |
| 727 | 727 | { |
| 728 | swimmer_draw_sprites(bitmap, screen->machine->gfx | |
| 728 | swimmer_draw_sprites(bitmap, cliprect, screen->machine->gfx[1] | |
| 729 | 729 | cclimber_draw_bigsprite(bitmap, cliprect); |
| 730 | 730 | } |
| 731 | 731 | |
| r5077 | r5078 | |
| 750 | 750 | /* draw the "big sprite" over the regular sprites */ |
| 751 | 751 | if ((cclimber_bigsprite_control[1] & 0x20)) |
| 752 | 752 | { |
| 753 | cclimber_draw_sprites(bitmap, screen->machine->gfx | |
| 753 | cclimber_draw_sprites(bitmap, &scroll_area_clip, screen->machine->gfx[1] | |
| 754 | 754 | toprollr_draw_bigsprite(bitmap, &scroll_area_clip); |
| 755 | 755 | } |
| 756 | 756 | |
| r5077 | r5078 | |
| 758 | 758 | else |
| 759 | 759 | { |
| 760 | 760 | toprollr_draw_bigsprite(bitmap, &scroll_area_clip); |
| 761 | cclimber_draw_sprites(bitmap, screen->machine->gfx | |
| 761 | cclimber_draw_sprites(bitmap, &scroll_area_clip, screen->machine->gfx[1] | |
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | tilemap_mark_all_tiles_dirty(pf_tilemap); |
| r5077 | r5078 | |
|---|---|---|
| 78 | 78 | tileno += ((attr & 0xe0) >> 5) * 0x100; |
| 79 | 79 | color = attr & 0x0f; |
| 80 | 80 | |
| 81 | drawgfx(bitmap,gfx, | |
| 81 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 82 | 82 | tileno, |
| 83 | 83 | color, |
| 84 | 84 | 0,0, |
| 85 | xpos,ypos, | |
| 86 | cliprect,TRANSPARENCY_PEN,15); | |
| 85 | xpos,ypos,15); | |
| 87 | 86 | |
| 88 | 87 | source +=4; |
| 89 | 88 | } |
| r5077 | r5078 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Amiga hardware | |
| 3 | Amiga AGA hardware | |
| 4 | 4 | |
| 5 | 5 | Driver by: Ernesto Corvi, Mariusz Wojcieszek, Aaron Giles |
| 6 | 6 | |
| r5077 | r5078 | |
| 9 | 9 | - bitplane data fetching |
| 10 | 10 | - support for up to 8 standard bitplanes |
| 11 | 11 | - HAM8 mode |
| 12 | - preliminary sprites | |
| 12 | 13 | |
| 13 | 14 | To do: |
| 14 | - sprites (current implementation is incomplete - see CD32 logo) | |
| 15 | 15 | - incorrect hstart/hstop values in CD32 logo, lsrquiz & lsrquiz2 |
| 16 | - sprite collisions | |
| 16 | 17 | |
| 17 | 18 | ***************************************************************************/ |
| 18 | 19 | |
| r5077 | r5078 | |
| 59 | 60 | static UINT8 sprite_comparitor_enable_mask; |
| 60 | 61 | static UINT8 sprite_dma_reload_mask; |
| 61 | 62 | static UINT8 sprite_dma_live_mask; |
| 63 | static UINT8 sprite_ctl_written; | |
| 62 | 64 | static UINT32 sprite_shiftreg[8]; |
| 63 | 65 | static UINT8 sprite_remain[8]; |
| 64 | 66 | static UINT16 aga_sprdata[8][4]; |
| r5077 | r5078 | |
| 208 | 210 | |
| 209 | 211 | /* reset the genlock color */ |
| 210 | 212 | genlock_color = 0xffff; |
| 213 | ||
| 214 | sprite_ctl_written = 0; | |
| 211 | 215 | } |
| 212 | 216 | |
| 213 | 217 | |
| r5077 | r5078 | |
| 398 | 402 | |
| 399 | 403 | void amiga_aga_sprite_dma_reset(int which) |
| 400 | 404 | { |
| 405 | if (LOG_SPRITE_DMA) logerror("sprite %d dma reset\n", which ); | |
| 401 | 406 | sprite_dma_reload_mask |= 1 << which; |
| 402 | 407 | sprite_dma_live_mask |= 1 << which; |
| 403 | 408 | } |
| r5077 | r5078 | |
| 405 | 410 | |
| 406 | 411 | void amiga_aga_sprite_enable_comparitor(int which, int enable) |
| 407 | 412 | { |
| 413 | if (LOG_SPRITE_DMA) logerror("sprite %d comparitor %sable\n", which, enable ? "en" : "dis" ); | |
| 408 | 414 | if (enable) |
| 409 | 415 | { |
| 410 | 416 | sprite_comparitor_enable_mask |= 1 << which; |
| 411 | 417 | sprite_dma_live_mask &= ~(1 << which); |
| 412 | 418 | } |
| 413 | 419 | else |
| 420 | { | |
| 414 | 421 | sprite_comparitor_enable_mask &= ~(1 << which); |
| 422 | sprite_ctl_written |= (1 << which); | |
| 423 | } | |
| 415 | 424 | } |
| 416 | 425 | |
| 417 | 426 | |
| r5077 | r5078 | |
| 422 | 431 | * |
| 423 | 432 | *************************************/ |
| 424 | 433 | |
| 425 | INLINE void fetch_sprite_data(int sprite) | |
| 434 | INLINE void fetch_sprite_data(int scanline, int sprite) | |
| 426 | 435 | { |
| 427 | 436 | switch((CUSTOM_REG(REG_FMODE) >> 2) & 0x03) |
| 428 | 437 | { |
| r5077 | r5078 | |
| 431 | 440 | aga_sprdatb[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2); |
| 432 | 441 | CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4; |
| 433 | 442 | 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]); | |
| 434 | 444 | break; |
| 435 | 445 | case 1: |
| 436 | 446 | case 2: |
| 437 | 447 | aga_sprdata[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0); |
| 438 | aga_sprdat | |
| 448 | aga_sprdata[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2); | |
| 439 | 449 | CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4; |
| 440 | aga_sprdat | |
| 450 | aga_sprdatb[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0); | |
| 441 | 451 | aga_sprdatb[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2); |
| 442 | 452 | CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4; |
| 443 | 453 | 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] ); | |
| 444 | 455 | break; |
| 445 | 456 | case 3: |
| 446 | 457 | aga_sprdata[sprite][0] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0); |
| 447 | aga_sprdat | |
| 458 | aga_sprdata[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2); | |
| 448 | 459 | 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); | |
| 450 | 464 | aga_sprdatb[sprite][1] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2); |
| 451 | 465 | 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); | |
| 456 | 467 | aga_sprdatb[sprite][3] = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2); |
| 457 | 468 | CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) += 4; |
| 458 | 469 | 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]); | |
| 459 | 476 | break; |
| 460 | 477 | } |
| 461 | 478 | aga_sprite_dma_used_words[sprite] = 0; |
| r5077 | r5078 | |
| 478 | 495 | int vstart, vstop; |
| 479 | 496 | |
| 480 | 497 | /* 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)) | |
| 482 | 499 | { |
| 483 | 500 | /* disable the sprite */ |
| 484 | 501 | sprite_comparitor_enable_mask &= ~bitmask; |
| r5077 | r5078 | |
| 488 | 505 | CUSTOM_REG(REG_SPR0POS + 4 * num) = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) + 0); |
| 489 | 506 | CUSTOM_REG(REG_SPR0CTL + 4 * num) = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) + 2); |
| 490 | 507 | 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 | } | |
| 491 | 521 | 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)); |
| 492 | 522 | } |
| 493 | 523 | |
| r5077 | r5078 | |
| 505 | 535 | /* if we hit vstop, disable the comparitor and trigger a reload for the next scanline */ |
| 506 | 536 | if (scanline == vstop) |
| 507 | 537 | { |
| 538 | sprite_ctl_written &= ~bitmask; | |
| 508 | 539 | sprite_comparitor_enable_mask &= ~bitmask; |
| 509 | 540 | sprite_dma_reload_mask |= 1 << num; |
| 510 | 541 | CUSTOM_REG(REG_SPR0DATA + 4 * num) = 0; /* just a guess */ |
| r5077 | r5078 | |
| 518 | 549 | //CUSTOM_REG(REG_SPR0DATA + 4 * num) = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) + 0); |
| 519 | 550 | //CUSTOM_REG(REG_SPR0DATB + 4 * num) = amiga_chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * num) + 2); |
| 520 | 551 | //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); | |
| 523 | 553 | } |
| 524 | 554 | } |
| 525 | 555 | } |
| r5077 | r5078 | |
| 573 | 603 | if (aga_sprite_dma_used_words[num] < aga_sprite_fetched_words) |
| 574 | 604 | { |
| 575 | 605 | sprite_remain[num] = 16; |
| 576 | sprite_shiftreg[num] = interleave_sprite_data(aga_sprdata[aga_sprite_dma_used_words[num]] | |
| 606 | sprite_shiftreg[num] = interleave_sprite_data(aga_sprdata[num][aga_sprite_dma_used_words[num]] | |
| 577 | 607 | aga_sprite_dma_used_words[num]++; |
| 578 | 608 | } |
| 579 | 609 | } |
| r5077 | r5078 | |
| 594 | 624 | 0x0000, 0x0800, 0x2000, 0x2a00, 0x4000, 0x4c00, 0x7000, 0x7e00 |
| 595 | 625 | }; |
| 596 | 626 | int collide; |
| 627 | int esprm, osprm; | |
| 597 | 628 | |
| 629 | esprm = CUSTOM_REG(REG_BPLCON4) & 0x00f0; | |
| 630 | osprm = (CUSTOM_REG(REG_BPLCON4) & 0x000f) << 4; | |
| 631 | ||
| 598 | 632 | /* OR the two sprite bits together so we only have 1 bit per sprite */ |
| 599 | 633 | collide = pixels | (pixels >> 1); |
| 600 | 634 | |
| r5077 | r5078 | |
| 612 | 646 | if (pixels & 0x0f) |
| 613 | 647 | { |
| 614 | 648 | /* 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 | |
| 618 | 652 | */ |
| 619 | 653 | |
| 620 | 654 | /* attached case */ |
| 621 | 655 | if (CUSTOM_REG(REG_SPR1CTL + 8 * pair) & 0x0080) |
| 622 | return (pixels & 0xf) | | |
| 656 | return (pixels & 0xf) | osprm | (collide << 8) | (pair << 12); | |
| 623 | 657 | |
| 624 | 658 | /* lower-numbered sprite of pair */ |
| 625 | 659 | else if (pixels & 3) |
| 626 | return (pixels & 3) | | |
| 660 | return (pixels & 3) | esprm | (pair << 2) | (collide << 8) | (pair << 12); | |
| 627 | 661 | |
| 628 | 662 | /* higher-numbered sprite of pair */ |
| 629 | 663 | else |
| 630 | return ((pixels >> 2) & 3) | | |
| 664 | return ((pixels >> 2) & 3) | osprm | (pair << 2) | (collide << 8) | (pair << 12); | |
| 631 | 665 | } |
| 632 | 666 | } |
| 633 | 667 | |
| r5077 | r5078 | |
| 1014 | 1048 | if (sprpix && pf1pri > (sprpix >> 10)) |
| 1015 | 1049 | { |
| 1016 | 1050 | dst[x*2+0] = |
| 1017 | dst[x*2+1] = aga_palette[sprpix & 0x | |
| 1051 | dst[x*2+1] = aga_palette[sprpix & 0xff]; | |
| 1018 | 1052 | } |
| 1019 | 1053 | |
| 1020 | 1054 | /* playfield has priority */ |
| r5077 | r5078 | |
| 1034 | 1068 | pix = sprpix & 0x1f; |
| 1035 | 1069 | if (pix) |
| 1036 | 1070 | { |
| 1037 | if ((pfpix0 & 0x15) && pf1pri <= (sprpix >> 1 | |
| 1071 | if ((pfpix0 & 0x15) && pf1pri <= (sprpix >> 12)) | |
| 1038 | 1072 | pix = 0; |
| 1039 | if ((pfpix0 & 0x2a) && pf2pri <= (sprpix >> 1 | |
| 1073 | if ((pfpix0 & 0x2a) && pf2pri <= (sprpix >> 12)) | |
| 1040 | 1074 | pix = 0; |
| 1041 | 1075 | } |
| 1042 | 1076 | |
| r5077 | r5078 | |
| 1047 | 1081 | dst[x*2+0] = aga_palette[separate_bitplanes[(CUSTOM_REG(REG_BPLCON2) >> 6) & 1][pfpix0]]; |
| 1048 | 1082 | |
| 1049 | 1083 | /* mask out the sprite if it doesn't have priority */ |
| 1050 | pix = sprpix & 0x | |
| 1084 | pix = sprpix & 0xff; | |
| 1051 | 1085 | if (pix) |
| 1052 | 1086 | { |
| 1053 | if ((pfpix1 & 0x15) && pf1pri <= (sprpix >> 1 | |
| 1087 | if ((pfpix1 & 0x15) && pf1pri <= (sprpix >> 12)) | |
| 1054 | 1088 | pix = 0; |
| 1055 | if ((pfpix1 & 0x2a) && pf2pri <= (sprpix >> 1 | |
| 1089 | if ((pfpix1 & 0x2a) && pf2pri <= (sprpix >> 12)) | |
| 1056 | 1090 | pix = 0; |
| 1057 | 1091 | } |
| 1058 | 1092 | |
| r5077 | r5078 | |
| 1067 | 1101 | else |
| 1068 | 1102 | { |
| 1069 | 1103 | /* sprite has priority */ |
| 1070 | if (sprpix && pf1pri > (sprpix >> 1 | |
| 1104 | if (sprpix && pf1pri > (sprpix >> 12)) | |
| 1071 | 1105 | { |
| 1072 | 1106 | dst[x*2+0] = |
| 1073 | dst[x*2+1] = aga_palette[(sprpix & 0x | |
| 1107 | dst[x*2+1] = aga_palette[(sprpix & 0xff)]; | |
| 1074 | 1108 | } |
| 1075 | 1109 | |
| 1076 | 1110 | /* playfield has priority */ |
| r5077 | r5078 | |
|---|---|---|
| 223 | 223 | flipy = !flipy; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | drawgfx(bitmap, machine->gfx[1], code, 0, flipx, flipy, sx, sy | |
| 226 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, 0, flipx, flipy, sx, sy | |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 |
| r5077 | r5078 | |
|---|---|---|
| 143 | 143 | int vflip = (data1 >> 14) & 1; |
| 144 | 144 | int pri = (data1 >> 13) & 1; |
| 145 | 145 | |
| 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); | |
| 148 | 148 | |
| 149 | 149 | /* 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); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 48 | 48 | pic = (pic & 0x3F); |
| 49 | 49 | color = (color & 0x3F); |
| 50 | 50 | |
| 51 | drawgfx(bitmap,machine->gfx[1], | |
| 51 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 52 | 52 | pic, color, |
| 53 | flipx,0,sx,sy, | |
| 54 | cliprect,TRANSPARENCY_PEN,0); | |
| 53 | flipx,0,sx,sy,0); | |
| 55 | 54 | } |
| 56 | 55 | } |
| 57 | 56 |
| r5077 | r5078 | |
|---|---|---|
| 251 | 251 | |
| 252 | 252 | if (((buffered_spriteram16[offs+0] & 0x3000) >> 12) == priority) |
| 253 | 253 | { |
| 254 | drawgfx(bitmap,machine->gfx[3], | |
| 254 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 255 | 255 | code & 0xfff, |
| 256 | 256 | color, |
| 257 | 257 | flipx,flipy, |
| 258 | sx,sy, | |
| 259 | cliprect,TRANSPARENCY_PEN,15); | |
| 258 | sx,sy,15); | |
| 260 | 259 | } |
| 261 | 260 | } |
| 262 | 261 | } |
| r5077 | r5078 | |
|---|---|---|
| 649 | 649 | |
| 650 | 650 | if (state->flip) |
| 651 | 651 | { |
| 652 | drawgfx(bitmap,machine->gfx[1], | |
| 652 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 653 | 653 | (state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits), |
| 654 | 654 | (state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank, |
| 655 | 655 | !(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); | |
| 658 | 657 | } |
| 659 | 658 | else |
| 660 | 659 | { |
| 661 | drawgfx(bitmap,machine->gfx[1], | |
| 660 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 662 | 661 | (state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits), |
| 663 | 662 | (state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank, |
| 664 | 663 | (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); | |
| 667 | 665 | } |
| 668 | 666 | |
| 669 | 667 | num_sprt++; |
| r5077 | r5078 | |
| 1016 | 1014 | { |
| 1017 | 1015 | if (state->sprite_ram[offs]) |
| 1018 | 1016 | { |
| 1019 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 1017 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 1020 | 1018 | state->sprite_ram[offs + 2], |
| 1021 | 1019 | (state->sprite_ram[offs + 1] & 0x0f) + 16 * state->palette_bank, |
| 1022 | 1020 | 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); | |
| 1025 | 1022 | } |
| 1026 | 1023 | } |
| 1027 | 1024 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 77 | 77 | if (i & 1) |
| 78 | 78 | bank = 32; |
| 79 | 79 | |
| 80 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 80 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 81 | 81 | (code >> 3) | bank, |
| 82 | 82 | (attr & 0x80) ? 4 : i, |
| 83 | 83 | 0, 0, |
| 84 | 84 | horz - 15, |
| 85 | vert - 15, | |
| 86 | cliprect, TRANSPARENCY_PEN, 0); | |
| 85 | vert - 15, 0); | |
| 87 | 86 | } |
| 88 | 87 | return 0; |
| 89 | 88 | } |
| r5077 | r5078 | |
| 122 | 121 | if (i & 1) |
| 123 | 122 | bank = 32; |
| 124 | 123 | |
| 125 | drawgfx(helper, machine->gfx[1], | |
| 124 | drawgfx_transpen(helper, &rect, machine->gfx[1], | |
| 126 | 125 | (code >> 3) | bank, |
| 127 | 126 | 4, |
| 128 | 127 | 0, 0, |
| 129 | 128 | horz - 15, |
| 130 | vert - 15, | |
| 131 | &rect, TRANSPARENCY_PEN, 1); | |
| 129 | vert - 15, 1); | |
| 132 | 130 | |
| 133 | 131 | for (y = rect.min_y; y <= rect.max_y; y++) |
| 134 | 132 | for (x = rect.min_x; x <= rect.max_x; x++) |
| r5077 | r5078 | |
|---|---|---|
| 206 | 206 | /* bit 7 unknown (used) */ |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | static void appoooh_draw_sprites( | |
| 209 | static void appoooh_draw_sprites( | |
| 210 | 210 | bitmap_t *dest_bmp, |
| 211 | 211 | const rectangle *cliprect, |
| 212 | 212 | const gfx_element *gfx, |
| 213 | 213 | UINT8 *sprite) |
| 214 | 214 | { |
| 215 | 215 | int offs; |
| 216 | int flipy = flip_screen_get(gfx->machine); | |
| 216 | 217 | |
| 217 | 218 | for (offs = 0x20 - 4;offs >= 0;offs -= 4) |
| 218 | 219 | { |
| r5077 | r5078 | |
| 224 | 225 | |
| 225 | 226 | if(sx>=248) sx -= 256; |
| 226 | 227 | |
| 227 | if (flip | |
| 228 | if (flipy | |
| 228 | 229 | { |
| 229 | 230 | sx = 239 - sx; |
| 230 | 231 | sy = 239 - sy; |
| 231 | 232 | flipx = !flipx; |
| 232 | 233 | } |
| 233 | drawgfx( dest_bmp, gfx, | |
| 234 | drawgfx_transpen( dest_bmp, cliprect, | |
| 235 | gfx, | |
| 234 | 236 | code, |
| 235 | 237 | color, |
| 236 | flipx,flip_screen_get(machine), | |
| 237 | sx, sy, | |
| 238 | cliprect, | |
| 239 | TRANSPARENCY_PEN , 0); | |
| 238 | flipx,flipy, | |
| 239 | sx, sy, 0); | |
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | static void robowres_draw_sprites( | |
| 243 | static void robowres_draw_sprites( | |
| 244 | 244 | bitmap_t *dest_bmp, |
| 245 | 245 | const rectangle *cliprect, |
| 246 | 246 | const gfx_element *gfx, |
| 247 | 247 | UINT8 *sprite) |
| 248 | 248 | { |
| 249 | 249 | int offs; |
| 250 | int flipy = flip_screen_get(gfx->machine); | |
| 250 | 251 | |
| 251 | 252 | for (offs = 0x20 - 4;offs >= 0;offs -= 4) |
| 252 | 253 | { |
| r5077 | r5078 | |
| 258 | 259 | |
| 259 | 260 | if(sx>=248) sx -= 256; |
| 260 | 261 | |
| 261 | if (flip | |
| 262 | if (flipy | |
| 262 | 263 | { |
| 263 | 264 | sx = 239 - sx; |
| 264 | 265 | sy = 239 - sy; |
| 265 | 266 | flipx = !flipx; |
| 266 | 267 | } |
| 267 | drawgfx( dest_bmp, gfx, | |
| 268 | drawgfx_transpen( dest_bmp, cliprect, | |
| 269 | gfx, | |
| 268 | 270 | code, |
| 269 | 271 | color, |
| 270 | flipx,flip_screen_get(machine), | |
| 271 | sx, sy, | |
| 272 | cliprect, | |
| 273 | TRANSPARENCY_PEN , 0); | |
| 272 | flipx,flipy, | |
| 273 | sx, sy, 0); | |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | |
| r5077 | r5078 | |
| 286 | 286 | if (priority == 1) |
| 287 | 287 | { |
| 288 | 288 | /* sprite set #1 */ |
| 289 | appoooh_draw_sprites( | |
| 289 | appoooh_draw_sprites( | |
| 290 | 290 | /* sprite set #2 */ |
| 291 | appoooh_draw_sprites( | |
| 291 | appoooh_draw_sprites( | |
| 292 | 292 | } |
| 293 | 293 | else |
| 294 | 294 | { |
| 295 | 295 | /* sprite set #2 */ |
| 296 | appoooh_draw_sprites( | |
| 296 | appoooh_draw_sprites( | |
| 297 | 297 | /* sprite set #1 */ |
| 298 | appoooh_draw_sprites( | |
| 298 | appoooh_draw_sprites( | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | if (priority != 0) /* fg in front of sprites */ |
| r5077 | r5078 | |
| 314 | 314 | if (priority == 1) |
| 315 | 315 | { |
| 316 | 316 | /* sprite set #1 */ |
| 317 | robowres_draw_sprites( | |
| 317 | robowres_draw_sprites( | |
| 318 | 318 | /* sprite set #2 */ |
| 319 | robowres_draw_sprites( | |
| 319 | robowres_draw_sprites( | |
| 320 | 320 | } |
| 321 | 321 | else |
| 322 | 322 | { |
| 323 | 323 | /* sprite set #2 */ |
| 324 | robowres_draw_sprites( | |
| 324 | robowres_draw_sprites( | |
| 325 | 325 | /* sprite set #1 */ |
| 326 | robowres_draw_sprites( | |
| 326 | robowres_draw_sprites( | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | if (priority != 0) /* fg in front of sprites */ |
| r5077 | r5078 | |
|---|---|---|
| 35 | 35 | y = 136 + 16 * (i ^ 1); |
| 36 | 36 | |
| 37 | 37 | for (x = 0; x < bitmap->width; x += 16) |
| 38 | drawgfx(bitmap, machine->gfx[0], *p++, 0, 0, 0, x, y | |
| 38 | drawgfx_transpen(bitmap, cliprect, machine->gfx[0], *p++, 0, 0, 0, x, y | |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| r5077 | r5078 | |
| 89 | 89 | vert -= 31; |
| 90 | 90 | |
| 91 | 91 | if (flag & 1) |
| 92 | drawgfx(bitmap, machine->gfx[1], | |
| 92 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 93 | 93 | code ^ 15, code >> 3, 0, 0, |
| 94 | horz / 2, vert, | |
| 94 | horz / 2, vert, | |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| r5077 | r5078 | |
| 111 | 111 | vert -= 15; |
| 112 | 112 | horz -= 31; |
| 113 | 113 | |
| 114 | drawgfx(bitmap, machine->gfx[2], | |
| 114 | drawgfx_transpen(bitmap, cliprect, machine->gfx[2], | |
| 115 | 115 | code ^ 15, 0, 0, 0, |
| 116 | horz / 2, vert, | |
| 116 | horz / 2, vert, | |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 |
| r5077 | r5078 | |
|---|---|---|
| 327 | 327 | flipy = !flipy; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | drawgfx(bitmap,machine->gfx[1], | |
| 330 | drawgfx_transpen(bitmap,&clip,machine->gfx[1], | |
| 331 | 331 | code, |
| 332 | 332 | attr & 0x0f, |
| 333 | 333 | flipx,flipy, |
| 334 | sx,sy, | |
| 335 | &clip,TRANSPARENCY_PEN,0); | |
| 334 | sx,sy,0); | |
| 336 | 335 | } |
| 337 | 336 | } |
| 338 | 337 |
| r5077 | r5078 | |
|---|---|---|
| 206 | 206 | { |
| 207 | 207 | if (sizey) |
| 208 | 208 | { |
| 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); | |
| 211 | 211 | |
| 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); | |
| 214 | 214 | } |
| 215 | 215 | else |
| 216 | 216 | { |
| 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); | |
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | } |
| r5077 | r5078 | |
|---|---|---|
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities |
| 435 | static void kaneko16_draw_sprites_custom( | |
| 435 | static void kaneko16_draw_sprites_custom( | |
| 436 | 436 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 437 | | |
| 437 | | |
| 438 | 438 | { |
| 439 | 439 | pen_t pen_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); |
| 440 | 440 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| r5077 | r5078 | |
| 635 | 635 | |
| 636 | 636 | UINT32 primask = kaneko16_priority.sprite[curr_pri]; |
| 637 | 637 | |
| 638 | kaneko16_draw_sprites_custom( machine, | |
| 639 | bitmap,machine->gfx[0], | |
| 638 | kaneko16_draw_sprites_custom( | |
| 639 | bitmap,cliprect,machine->gfx[0], | |
| 640 | 640 | s->code, |
| 641 | 641 | s->color, |
| 642 | 642 | s->flipx, s->flipy, |
| 643 | 643 | s->x, s->y, |
| 644 | cliprect, | |
| 645 | 644 | primask ); |
| 646 | 645 | } |
| 647 | 646 | } |
| r5077 | r5078 | |
|---|---|---|
| 289 | 289 | int girlyscroll = (INT8)((cm_girl_scroll & 0xf0)); |
| 290 | 290 | int girlxscroll = (INT8)((cm_girl_scroll & 0x0f)<<4); |
| 291 | 291 | |
| 292 | drawgfxzoom(bitmap,gfx,cmaster_girl_num,cmaster_girl_pal,0,0,-(girlxscroll*2),-(girlyscroll), | |
| 292 | drawgfxzoom_transpen(bitmap,cliprect,gfx,cmaster_girl_num,cmaster_girl_pal,0,0,-(girlxscroll*2),-(girlyscroll), | |
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 |
| r5077 | r5078 | |
|---|---|---|
| 281 | 281 | |
| 282 | 282 | int tx, ty, sx, sy, flipx, flipy; |
| 283 | 283 | int xsize, ysize, xzoom, yzoom; |
| 284 | int code, attr, color, size, pri, pri_mask | |
| 284 | int code, attr, color, size, pri, pri_mask | |
| 285 | 285 | gfx_element *gfx = machine->gfx[0]; |
| 286 | 286 | |
| 287 | 287 | UINT32 *source = sprram_top; |
| r5077 | r5078 | |
| 335 | 335 | yzoom = 0x1000000/yzoom; |
| 336 | 336 | xzoom = 0x1000000/xzoom; |
| 337 | 337 | |
| 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 | |
| 339 | 339 | |
| 340 | 340 | if (flipscreen) |
| 341 | 341 | { |
| r5077 | r5078 | |
| 363 | 363 | pri_mask = 0xfe; |
| 364 | 364 | |
| 365 | 365 | gfx_element_set_source_clip(gfx, tx, xsize, ty, ysize); |
| 366 | pdrawgfxzoom(bitmap, gfx, | |
| 366 | pdrawgfxzoom_transpen(bitmap, cliprect, gfx, | |
| 367 | 367 | code, |
| 368 | 368 | color, |
| 369 | 369 | flipx, flipy, |
| 370 | 370 | sx,sy, |
| 371 | cliprect, trans, 0, | |
| 372 | xzoom, yzoom, pri_mask); | |
| 371 | xzoom, yzoom, priority_bitmap,pri_mask, 0); | |
| 373 | 372 | } /* end sprite loop */ |
| 374 | 373 | } |
| 375 | 374 |
| r5077 | r5078 | |
|---|---|---|
| 216 | 216 | |
| 217 | 217 | while (multi >= 0) |
| 218 | 218 | { |
| 219 | drawgfx(bitmap,machine->gfx[3], | |
| 219 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 220 | 220 | sprite - multi * inc, |
| 221 | 221 | colour, |
| 222 | 222 | fx,fy, |
| 223 | x,y + mult * multi, | |
| 224 | cliprect,TRANSPARENCY_PEN,0); | |
| 223 | x,y + mult * multi,0); | |
| 225 | 224 | |
| 226 | 225 | multi--; |
| 227 | 226 | } |
| r5077 | r5078 | |
|---|---|---|
| 100 | 100 | for (offs = spriteram_size - 4;offs >= 0;offs -= 4) |
| 101 | 101 | { |
| 102 | 102 | int x = spriteram[offs + 3]; |
| 103 | drawgfx(bitmap,machine->gfx[1], | |
| 103 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 104 | 104 | (spriteram[offs] & 0x3f) + ((spriteram[offs + 1] & 0x10) << 2) + 128, |
| 105 | 105 | spriteram[offs + 1] & 0x0f, |
| 106 | 106 | spriteram[offs] & 0x40,spriteram[offs] & 0x80, |
| 107 | x,240-spriteram[offs + 2], | |
| 108 | cliprect,TRANSPARENCY_PEN,0); | |
| 107 | x,240-spriteram[offs + 2],0); | |
| 109 | 108 | if(x>0xf0) |
| 110 | drawgfx(bitmap,machine->gfx[1], | |
| 109 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 111 | 110 | (spriteram[offs] & 0x3f) + ((spriteram[offs + 1] & 0x10) << 2) + 128, |
| 112 | 111 | spriteram[offs + 1] & 0x0f, |
| 113 | 112 | 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); | |
| 116 | 114 | } |
| 117 | 115 | |
| 118 | 116 | for (offs = spriteram_2_size - 4;offs >= 0;offs -= 4) |
| 119 | 117 | { |
| 120 | 118 | int x = spriteram_2[offs + 3]; |
| 121 | drawgfx(bitmap,machine->gfx[1], | |
| 119 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 122 | 120 | (spriteram_2[offs] & 0x3f) + ((spriteram_2[offs + 1] & 0x10) << 2), |
| 123 | 121 | spriteram_2[offs + 1] & 0x0f, |
| 124 | 122 | 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); | |
| 127 | 124 | if(x>0xf0) |
| 128 | drawgfx(bitmap,machine->gfx[1], | |
| 125 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 129 | 126 | (spriteram_2[offs] & 0x3f) + ((spriteram_2[offs + 1] & 0x10) << 2), |
| 130 | 127 | spriteram_2[offs + 1] & 0x0f, |
| 131 | 128 | 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); | |
| 134 | 130 | } |
| 135 | 131 | } |
| 136 | 132 |
| r5077 | r5078 | |
|---|---|---|
| 233 | 233 | if (!mcr_cocktail_flip) |
| 234 | 234 | { |
| 235 | 235 | /* 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); | |
| 238 | 238 | |
| 239 | 239 | /* 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); | |
| 242 | 242 | } |
| 243 | 243 | else |
| 244 | 244 | { |
| 245 | 245 | /* 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); | |
| 248 | 248 | |
| 249 | 249 | /* 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); | |
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | } |
| r5077 | r5078 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | while (multi >= 0) |
| 74 | 74 | { |
| 75 | drawgfx(bitmap,machine->gfx[2], | |
| 75 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 76 | 76 | sprite - multi * inc, |
| 77 | 77 | colour, |
| 78 | 78 | fx,fy, |
| 79 | x,y + mult * multi, | |
| 80 | cliprect,TRANSPARENCY_PEN,0); | |
| 79 | x,y + mult * multi,0); | |
| 81 | 80 | multi--; |
| 82 | 81 | } |
| 83 | 82 | } |
| r5077 | r5078 | |
|---|---|---|
| 137 | 137 | |
| 138 | 138 | if ((foreground && priority) || (!foreground && !priority)) |
| 139 | 139 | { |
| 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); | |
| 142 | 141 | } |
| 143 | 142 | } |
| 144 | 143 | } |
| r5077 | r5078 | |
|---|---|---|
| 168 | 168 | { |
| 169 | 169 | if (!flipy) |
| 170 | 170 | { |
| 171 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+16*count | |
| 171 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+16*count | |
| 172 | 172 | } |
| 173 | 173 | else |
| 174 | 174 | { |
| 175 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count) | |
| 175 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count) | |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | else |
| 179 | 179 | { |
| 180 | 180 | if (!flipy) |
| 181 | 181 | { |
| 182 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count) | |
| 182 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count) | |
| 183 | 183 | } |
| 184 | 184 | else |
| 185 | 185 | { |
| 186 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-16*count | |
| 186 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-16*count | |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | } |
| r5077 | r5078 | |
|---|---|---|
| 211 | 211 | |
| 212 | 212 | while (multi >= 0) |
| 213 | 213 | { |
| 214 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 214 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 215 | 215 | sprite - multi * inc, |
| 216 | 216 | colour, |
| 217 | 217 | fx,fy, |
| 218 | x,y + mult * multi, | |
| 219 | cliprect,TRANSPARENCY_PEN,0); | |
| 218 | x,y + mult * multi,0); | |
| 220 | 219 | multi--; |
| 221 | 220 | } |
| 222 | 221 | } |
| r5077 | r5078 | |
| 296 | 295 | |
| 297 | 296 | while (multi >= 0) |
| 298 | 297 | { |
| 299 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 298 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 300 | 299 | sprite - multi * inc, |
| 301 | 300 | colour, |
| 302 | 301 | fx,fy, |
| 303 | x,y + mult * multi, | |
| 304 | cliprect,TRANSPARENCY_PEN,0); | |
| 302 | x,y + mult * multi,0); | |
| 305 | 303 | multi--; |
| 306 | 304 | } |
| 307 | 305 | } |
| r5077 | r5078 | |
|---|---|---|
| 118 | 118 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | #define DRAW_SPRITE(bank, code, sx, sy) drawgfx(bitmap, machine->gfx[bank], code, color, flipx, flipy, sx, sy | |
| 121 | #define DRAW_SPRITE(bank, code, sx, sy) drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], code, color, flipx, flipy, sx, sy | |
| 122 | 122 | |
| 123 | 123 | static void draw_sprites_region(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *sram, int length, int bank ) |
| 124 | 124 | { |
| r5077 | r5078 | |
|---|---|---|
| 150 | 150 | int x = get_x_pos(i); |
| 151 | 151 | int y = get_y_pos(i); |
| 152 | 152 | |
| 153 | drawgfx(bitmap, machine->gfx[(code & 0x04) ? 2 : 3], | |
| 153 | drawgfx_transpen(bitmap, cliprect, machine->gfx[(code & 0x04) ? 2 : 3], | |
| 154 | 154 | code & 0x03, |
| 155 | 155 | i, |
| 156 | 156 | code & 0x10, |
| 157 | 157 | code & 0x08, |
| 158 | 158 | x, |
| 159 | y, | |
| 160 | cliprect, TRANSPARENCY_PEN, 0); | |
| 159 | y, 0); | |
| 161 | 160 | } |
| 162 | 161 | } |
| 163 | 162 |
| r5077 | r5078 | |
|---|---|---|
| 1320 | 1320 | x += PC090OJ_xoffs; |
| 1321 | 1321 | y += PC090OJ_yoffs; |
| 1322 | 1322 | |
| 1323 | pdrawgfx(bitmap,machine->gfx[PC090OJ_gfxnum], | |
| 1323 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[PC090OJ_gfxnum], | |
| 1324 | 1324 | code, |
| 1325 | 1325 | color, |
| 1326 | 1326 | flipx,flipy, |
| 1327 | 1327 | x,y, |
| 1328 | cliprect,TRANSPARENCY_PEN,0, | |
| 1329 | priority ? 0xfc : 0xf0); | |
| 1328 | priority_bitmap, | |
| 1329 | priority ? 0xfc : 0xf0,0); | |
| 1330 | 1330 | } |
| 1331 | 1331 | } |
| 1332 | 1332 |
| r5077 | r5078 | |
|---|---|---|
| 310 | 310 | sy++; /* sprites are buffered and delayed by one scanline */ |
| 311 | 311 | |
| 312 | 312 | gfx_element_set_source_clip(gfx, tx, sizex, ty, sizey); |
| 313 | pdrawgfx( bitmap, gfx, | |
| 313 | pdrawgfx_transpen( bitmap, cliprect,gfx, | |
| 314 | 314 | sprite, |
| 315 | 315 | color, |
| 316 | 316 | flipx,flipy, |
| 317 | 317 | sx & 0x1ff, |
| 318 | 318 | ((sy + 16) & 0xff) - 16, |
| 319 | | |
| 319 | | |
| 320 | 320 | |
| 321 | 321 | source -= 0x10; |
| 322 | 322 | } |
| r5077 | r5078 | |
|---|---|---|
| 322 | 322 | { sx = max_x - sx; tile_flipx = !tile_flipx; |
| 323 | 323 | sy = max_y - sy; tile_flipy = !tile_flipy; } |
| 324 | 324 | |
| 325 | drawgfx( bitmap,machine->gfx[0], | |
| 325 | drawgfx_transpen( bitmap,cliprect,machine->gfx[0], | |
| 326 | 326 | tile + (attr & 0x3)*0x100 + gfxbank, |
| 327 | 327 | ((attr >> 2) & 0xf) | colorbank, // hardhea2 player2 |
| 328 | 328 | tile_flipx, tile_flipy, |
| 329 | sx, sy, | |
| 330 | cliprect,TRANSPARENCY_PEN,15); | |
| 329 | sx, sy,15); | |
| 331 | 330 | } |
| 332 | 331 | } |
| 333 | 332 | |
| r5077 | r5078 | |
| 387 | 386 | { sx = max_x - sx; flipx = !flipx; |
| 388 | 387 | sy = max_y - sy; flipy = !flipy; } |
| 389 | 388 | |
| 390 | drawgfx( bitmap,machine->gfx[0], | |
| 389 | drawgfx_transpen( bitmap,cliprect,machine->gfx[0], | |
| 391 | 390 | tile + (attr & 0x3)*0x100 + bank, |
| 392 | 391 | (attr >> 2) & 0xf, |
| 393 | 392 | flipx, flipy, |
| 394 | sx, sy, | |
| 395 | cliprect,TRANSPARENCY_PEN,15); | |
| 393 | sx, sy,15); | |
| 396 | 394 | } |
| 397 | 395 | } |
| 398 | 396 |
| r5077 | r5078 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | while (multi >= 0) |
| 135 | 135 | { |
| 136 | drawgfx(bitmap,machine->gfx[3], | |
| 136 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 137 | 137 | sprite - multi * inc, |
| 138 | 138 | colour, |
| 139 | 139 | fx,fy, |
| 140 | x,y + mult * multi, | |
| 141 | cliprect,TRANSPARENCY_PEN,0); | |
| 140 | x,y + mult * multi,0); | |
| 142 | 141 | |
| 143 | 142 | multi--; |
| 144 | 143 | } |
| r5077 | r5078 | |
|---|---|---|
| 371 | 371 | |
| 372 | 372 | y = y - sprite_y_adjust; |
| 373 | 373 | |
| 374 | drawgfx(bitmap,machine->gfx[1], | |
| 374 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 375 | 375 | sprite_ram[offs + interleave], |
| 376 | 376 | color, |
| 377 | 377 | flipx,flipy, |
| 378 | x, y, | |
| 379 | cliprect,TRANSPARENCY_PEN,0); | |
| 378 | x, y,0); | |
| 380 | 379 | |
| 381 | 380 | y = y + (flip_screen_get(machine) ? -256 : 256); |
| 382 | 381 | |
| 383 | 382 | // Wrap around |
| 384 | drawgfx(bitmap,machine->gfx[1], | |
| 383 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 385 | 384 | sprite_ram[offs + interleave], |
| 386 | 385 | color, |
| 387 | 386 | flipx,flipy, |
| 388 | x,y, | |
| 389 | cliprect,TRANSPARENCY_PEN,0); | |
| 387 | x,y,0); | |
| 390 | 388 | } |
| 391 | 389 | } |
| 392 | 390 | |
| r5077 | r5078 | |
| 418 | 416 | y = 256 - y; |
| 419 | 417 | } |
| 420 | 418 | |
| 421 | drawgfx(bitmap, machine->gfx[2], | |
| 419 | drawgfx_opaque(bitmap, cliprect,machine->gfx[2], | |
| 422 | 420 | gfx[tileoffset + offs], |
| 423 | 421 | color, |
| 424 | 422 | flip_screen_get(machine),flip_screen_get(machine), |
| 425 | x,y, | |
| 426 | cliprect,TRANSPARENCY_NONE,0); | |
| 423 | x,y); | |
| 427 | 424 | } |
| 428 | 425 | } |
| 429 | 426 | } |
| r5077 | r5078 | |
| 517 | 514 | sy = 256 - sy; |
| 518 | 515 | } |
| 519 | 516 | |
| 520 | drawgfx(background_bitmap, screen->machine->gfx[2], | |
| 517 | drawgfx_opaque(background_bitmap, 0, screen->machine->gfx[2], | |
| 521 | 518 | (bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32, |
| 522 | 519 | 0, |
| 523 | 520 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), |
| 524 | sx, sy, | |
| 525 | 0, TRANSPARENCY_NONE, 0); | |
| 521 | sx, sy); | |
| 526 | 522 | } |
| 527 | 523 | |
| 528 | 524 | /* copy the background bitmap to the screen */ |
| r5077 | r5078 | |
| 564 | 560 | sy = 33 - sy; |
| 565 | 561 | } |
| 566 | 562 | |
| 567 | drawgfx(bitmap, screen->machine->gfx[2], | |
| 563 | drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[2], | |
| 568 | 564 | bnj_backgroundram[offs], |
| 569 | 565 | 0, |
| 570 | 566 | 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); | |
| 573 | 568 | } |
| 574 | 569 | |
| 575 | 570 | draw_chars(screen->machine, bitmap, cliprect, TRANSPARENCY_PEN, 0, -1); |
| r5077 | r5078 | |
|---|---|---|
| 285 | 285 | flipy = !flipy; |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | drawgfx(bitmap, gfx, | |
| 288 | drawgfx_transpen(bitmap, cliprect, gfx, | |
| 289 | 289 | tile, |
| 290 | 290 | color, |
| 291 | 291 | flipx, flipy, |
| 292 | sx, sy, | |
| 293 | cliprect, TRANSPARENCY_PEN, 0); | |
| 292 | sx, sy, 0); | |
| 294 | 293 | } |
| 295 | 294 | } |
| 296 | 295 | |
| r5077 | r5078 | |
| 322 | 321 | flipy = !flipy; |
| 323 | 322 | } |
| 324 | 323 | |
| 325 | drawgfx(bitmap, gfx, | |
| 324 | drawgfx_transpen(bitmap, cliprect, gfx, | |
| 326 | 325 | tile, |
| 327 | 326 | color, |
| 328 | 327 | flipx, flipy, |
| 329 | sx, sy, | |
| 330 | cliprect, TRANSPARENCY_PEN, 0); | |
| 328 | sx, sy, 0); | |
| 331 | 329 | |
| 332 | 330 | // there's no X MSB, so draw with wraparound (fixes title screen) |
| 333 | drawgfx(bitmap, gfx, | |
| 331 | drawgfx_transpen(bitmap, cliprect, gfx, | |
| 334 | 332 | tile, |
| 335 | 333 | color, |
| 336 | 334 | flipx, flipy, |
| 337 | sx - 256, sy, | |
| 338 | cliprect, TRANSPARENCY_PEN, 0); | |
| 335 | sx - 256, sy, 0); | |
| 339 | 336 | } |
| 340 | 337 | } |
| 341 | 338 |
| r5077 | r5078 | |
|---|---|---|
| 2210 | 2210 | #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ |
| 2211 | 2211 | { \ |
| 2212 | 2212 | if (flip_screen_get(machine)) \ |
| 2213 | pdrawgfx(bitmap,machine->gfx[2], \ | |
| 2213 | pdrawgfx_transpen(bitmap,\ | |
| 2214 | cliprect,machine->gfx[2], \ | |
| 2214 | 2215 | CODE, \ |
| 2215 | 2216 | COLOR, \ |
| 2216 | 2217 | !(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); \ | |
| 2219 | 2219 | else \ |
| 2220 | pdrawgfx(bitmap,machine->gfx[2], \ | |
| 2220 | pdrawgfx_transpen(bitmap,\ | |
| 2221 | cliprect,machine->gfx[2], \ | |
| 2221 | 2222 | CODE, \ |
| 2222 | 2223 | COLOR, \ |
| 2223 | 2224 | FLIPX,FLIPY, \ |
| 2224 | SX,SY, \ | |
| 2225 | cliprect,TRANSPARENCY_PEN,15,0x02); \ | |
| 2225 | SX,SY, priority_bitmap,0x02,15); \ | |
| 2226 | 2226 | } |
| 2227 | 2227 | |
| 2228 | 2228 | |
| r5077 | r5078 | |
| 2446 | 2446 | #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ |
| 2447 | 2447 | { \ |
| 2448 | 2448 | if (flip_screen_get(machine)) \ |
| 2449 | pdrawgfx(bitmap,machine->gfx[2], \ | |
| 2449 | pdrawgfx_transpen(bitmap,\ | |
| 2450 | cliprect,machine->gfx[2], \ | |
| 2450 | 2451 | CODE, \ |
| 2451 | 2452 | COLOR, \ |
| 2452 | 2453 | !(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); \ | |
| 2455 | 2455 | else \ |
| 2456 | pdrawgfx(bitmap,machine->gfx[2], \ | |
| 2456 | pdrawgfx_transpen(bitmap,\ | |
| 2457 | cliprect,machine->gfx[2], \ | |
| 2457 | 2458 | CODE, \ |
| 2458 | 2459 | COLOR, \ |
| 2459 | 2460 | FLIPX,FLIPY, \ |
| 2460 | SX,SY, \ | |
| 2461 | cliprect,TRANSPARENCY_PEN,15,primasks[priority]); \ | |
| 2461 | SX,SY, priority_bitmap,primasks[priority],15); \ | |
| 2462 | 2462 | } |
| 2463 | 2463 | |
| 2464 | 2464 | int i; |
| r5077 | r5078 | |
|---|---|---|
| 214 | 214 | org_y = s1_y; |
| 215 | 215 | |
| 216 | 216 | /* Draw ship 1 */ |
| 217 | drawgfx(ship1_vid, | |
| 217 | drawgfx_opaque(ship1_vid, | |
| 218 | &clip, | |
| 218 | 219 | machine->gfx[8+((s1_sprite&0x04)>>2)], |
| 219 | 220 | (s1_sprite&0x03)^0x03, |
| 220 | 221 | 0, |
| 221 | 222 | (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); | |
| 226 | 224 | |
| 227 | 225 | /* Draw ship 2 */ |
| 228 | drawgfx(ship2_vid, | |
| 226 | drawgfx_opaque(ship2_vid, | |
| 227 | &clip, | |
| 229 | 228 | machine->gfx[10+((s2_sprite&0x04)>>2)], |
| 230 | 229 | (s2_sprite&0x03)^0x03, |
| 231 | 230 | 0, |
| 232 | 231 | (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); | |
| 237 | 233 | |
| 238 | 234 | /* Now check for collisions */ |
| 239 | 235 | for (sy=0;sy<16;sy++) |
| r5077 | r5078 | |
| 274 | 270 | if (p1_sprite & 0x08) /* if p1 is a projectile */ |
| 275 | 271 | { |
| 276 | 272 | /* Draw score/projectile 1 */ |
| 277 | drawgfx(proj1_vid, | |
| 273 | drawgfx_opaque(proj1_vid, | |
| 274 | &clip, | |
| 278 | 275 | machine->gfx[(p1_sprite&0x0c)>>2], |
| 279 | 276 | (p1_sprite&0x03)^0x03, |
| 280 | 277 | 0, |
| 281 | 278 | 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); | |
| 286 | 280 | } |
| 287 | 281 | |
| 288 | 282 | if (p2_sprite & 0x08) /* if p2 is a projectile */ |
| 289 | 283 | { |
| 290 | 284 | /* Draw score/projectile 2 */ |
| 291 | drawgfx(proj2_vid, | |
| 285 | drawgfx_opaque(proj2_vid, | |
| 286 | &clip, | |
| 292 | 287 | machine->gfx[4+((p2_sprite&0x0c)>>2)], |
| 293 | 288 | (p2_sprite&0x03)^0x03, |
| 294 | 289 | 0, |
| 295 | 290 | 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); | |
| 300 | 292 | } |
| 301 | 293 | |
| 302 | 294 | /* Now check for collisions */ |
| r5077 | r5078 | |
| 337 | 329 | org_y = s1_y; |
| 338 | 330 | |
| 339 | 331 | /* Draw ship 1 */ |
| 340 | drawgfx(ship1_vid, | |
| 332 | drawgfx_opaque(ship1_vid, | |
| 333 | &clip, | |
| 341 | 334 | machine->gfx[8+((s1_sprite&0x04)>>2)], |
| 342 | 335 | (s1_sprite&0x03)^0x03, |
| 343 | 336 | 0, |
| 344 | 337 | (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); | |
| 349 | 339 | |
| 350 | 340 | if (p1_sprite & 0x08) /* if p1 is a projectile */ |
| 351 | 341 | { |
| 352 | 342 | /* Draw projectile 1 */ |
| 353 | drawgfx(proj1_vid, | |
| 343 | drawgfx_opaque(proj1_vid, | |
| 344 | &clip, | |
| 354 | 345 | machine->gfx[(p1_sprite&0x0c)>>2], |
| 355 | 346 | (p1_sprite&0x03)^0x03, |
| 356 | 347 | 0, |
| 357 | 348 | 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); | |
| 362 | 350 | } |
| 363 | 351 | |
| 364 | 352 | if (p2_sprite & 0x08) /* if p2 is a projectile */ |
| 365 | 353 | { |
| 366 | 354 | /* Draw projectile 2 */ |
| 367 | drawgfx(proj2_vid, | |
| 355 | drawgfx_opaque(proj2_vid, | |
| 356 | &clip, | |
| 368 | 357 | machine->gfx[4+((p2_sprite&0x0c)>>2)], |
| 369 | 358 | (p2_sprite&0x03)^0x03, |
| 370 | 359 | 0, |
| 371 | 360 | 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); | |
| 376 | 362 | } |
| 377 | 363 | |
| 378 | 364 | /* Now check for collisions */ |
| r5077 | r5078 | |
| 419 | 405 | org_y = s2_y; |
| 420 | 406 | |
| 421 | 407 | /* Draw ship 2 */ |
| 422 | drawgfx(ship2_vid, | |
| 408 | drawgfx_opaque(ship2_vid, | |
| 409 | &clip, | |
| 423 | 410 | machine->gfx[10+((s2_sprite&0x04)>>2)], |
| 424 | 411 | (s2_sprite&0x03)^0x03, |
| 425 | 412 | 0, |
| 426 | 413 | (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); | |
| 431 | 415 | |
| 432 | 416 | if (p1_sprite & 0x08) /* if p1 is a projectile */ |
| 433 | 417 | { |
| 434 | 418 | /* Draw projectile 1 */ |
| 435 | drawgfx(proj1_vid, | |
| 419 | drawgfx_opaque(proj1_vid, | |
| 420 | &clip, | |
| 436 | 421 | machine->gfx[(p1_sprite&0x0c)>>2], |
| 437 | 422 | (p1_sprite&0x03)^0x03, |
| 438 | 423 | 0, |
| 439 | 424 | 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); | |
| 444 | 426 | } |
| 445 | 427 | |
| 446 | 428 | if (p2_sprite & 0x08) /* if p2 is a projectile */ |
| 447 | 429 | { |
| 448 | 430 | /* Draw projectile 2 */ |
| 449 | drawgfx(proj2_vid, | |
| 431 | drawgfx_opaque(proj2_vid, | |
| 432 | &clip, | |
| 450 | 433 | machine->gfx[4+((p2_sprite&0x0c)>>2)], |
| 451 | 434 | (p2_sprite&0x03)^0x03, |
| 452 | 435 | 0, |
| 453 | 436 | 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); | |
| 458 | 438 | } |
| 459 | 439 | |
| 460 | 440 | /* Now check for collisions */ |
| r5077 | r5078 | |
| 478 | 458 | bitmap_fill(bitmap,cliprect,0); |
| 479 | 459 | |
| 480 | 460 | /* Draw ship 1 */ |
| 481 | drawgfx(bitmap, | |
| 461 | drawgfx_transpen(bitmap, | |
| 462 | cliprect, | |
| 482 | 463 | screen->machine->gfx[8+((s1_sprite&0x04)>>2)], |
| 483 | 464 | (s1_sprite&0x03)^0x03, |
| 484 | 465 | 0, |
| 485 | 466 | (s1_sprite&0x08)>>3,(s1_sprite&0x10)>>4, |
| 486 | 467 | s1_x,s1_y, |
| 487 | cliprect, | |
| 488 | TRANSPARENCY_PEN, | |
| 489 | 468 | 0); |
| 490 | 469 | |
| 491 | 470 | /* Draw ship 2 */ |
| 492 | drawgfx(bitmap, | |
| 471 | drawgfx_transpen(bitmap, | |
| 472 | cliprect, | |
| 493 | 473 | screen->machine->gfx[10+((s2_sprite&0x04)>>2)], |
| 494 | 474 | (s2_sprite&0x03)^0x03, |
| 495 | 475 | 0, |
| 496 | 476 | (s2_sprite&0x08)>>3,(s2_sprite&0x10)>>4, |
| 497 | 477 | s2_x,s2_y, |
| 498 | cliprect, | |
| 499 | TRANSPARENCY_PEN, | |
| 500 | 478 | 0); |
| 501 | 479 | |
| 502 | 480 | /* Draw score/projectile 1 */ |
| 503 | drawgfx(bitmap, | |
| 481 | drawgfx_transpen(bitmap, | |
| 482 | cliprect, | |
| 504 | 483 | screen->machine->gfx[(p1_sprite&0x0c)>>2], |
| 505 | 484 | (p1_sprite&0x03)^0x03, |
| 506 | 485 | 0, |
| 507 | 486 | 0,0, |
| 508 | 487 | p1_x,p1_y, |
| 509 | cliprect, | |
| 510 | TRANSPARENCY_PEN, | |
| 511 | 488 | 0); |
| 512 | 489 | |
| 513 | 490 | /* Draw score/projectile 2 */ |
| 514 | drawgfx(bitmap, | |
| 491 | drawgfx_transpen(bitmap, | |
| 492 | cliprect, | |
| 515 | 493 | screen->machine->gfx[4+((p2_sprite&0x0c)>>2)], |
| 516 | 494 | (p2_sprite&0x03)^0x03, |
| 517 | 495 | 0, |
| 518 | 496 | 0,0, |
| 519 | 497 | p2_x,p2_y, |
| 520 | cliprect, | |
| 521 | TRANSPARENCY_PEN, | |
| 522 | 498 | 0); |
| 523 | 499 | |
| 524 | 500 | /* Collision detection */ |
| r5077 | r5078 | |
|---|---|---|
| 182 | 182 | flipy = !flipy; y = max_y - y - 16; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | pdrawgfx( bitmap,machine->gfx[1], | |
| 185 | pdrawgfx_transpen( bitmap,cliprect,machine->gfx[1], | |
| 186 | 186 | code, |
| 187 | 187 | attr & 0x1f, |
| 188 | 188 | flipx, flipy, |
| 189 | 189 | x,y, |
| 190 | cliprect,TRANSPARENCY_PEN,15, | |
| 191 | pri_mask ); | |
| 190 | priority_bitmap, | |
| 191 | pri_mask,15 ); | |
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 |
| r5077 | r5078 | |
|---|---|---|
| 147 | 147 | if (flipx) sx = 31 - sx; |
| 148 | 148 | |
| 149 | 149 | |
| 150 | drawgfx(bitmap,machine->gfx[bank], | |
| 150 | drawgfx_transpen(bitmap,cliprect,machine->gfx[bank], | |
| 151 | 151 | videoram[offs], |
| 152 | 152 | col + 8 * palette_bank, |
| 153 | 153 | flipx,flipy, |
| 154 | 8*sx,scroll, | |
| 155 | cliprect,TRANSPARENCY_PEN,0); | |
| 154 | 8*sx,scroll,0); | |
| 156 | 155 | } |
| 157 | 156 | } |
| 158 | 157 | |
| r5077 | r5078 | |
| 186 | 185 | if (flipx) sx = 31 - sx; |
| 187 | 186 | |
| 188 | 187 | |
| 189 | drawgfx(bitmap,machine->gfx[char_bank[1]], | |
| 188 | drawgfx_transpen(bitmap,cliprect,machine->gfx[char_bank[1]], | |
| 190 | 189 | wiz_videoram2[offs], |
| 191 | 190 | col + 8 * palette_bank, |
| 192 | 191 | flipx,flipy, |
| 193 | 8*sx,scroll, | |
| 194 | cliprect,TRANSPARENCY_PEN,0); | |
| 192 | 8*sx,scroll,0); | |
| 195 | 193 | } |
| 196 | 194 | } |
| 197 | 195 | |
| r5077 | r5078 | |
| 214 | 212 | if ( flipx) sx = 240 - sx; |
| 215 | 213 | if (!flipy) sy = 240 - sy; |
| 216 | 214 | |
| 217 | drawgfx(bitmap,machine->gfx[bank], | |
| 215 | drawgfx_transpen(bitmap,cliprect,machine->gfx[bank], | |
| 218 | 216 | sprite_ram[offs + 1], |
| 219 | 217 | (sprite_ram[offs + 2] & 0x07) + 8 * palette_bank, |
| 220 | 218 | flipx,flipy, |
| 221 | sx,sy, | |
| 222 | cliprect,TRANSPARENCY_PEN,0); | |
| 219 | sx,sy,0); | |
| 223 | 220 | } |
| 224 | 221 | } |
| 225 | 222 |
| r5077 | r5078 | |
|---|---|---|
| 199 | 199 | sy = 240 - sy; |
| 200 | 200 | } |
| 201 | 201 | |
| 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); | |
| 205 | 204 | } |
| 206 | 205 | } |
| 207 | 206 | |
| r5077 | r5078 | |
| 299 | 298 | |
| 300 | 299 | tilemap_draw(helper, &rect, bg_tilemap, 0, 0); |
| 301 | 300 | |
| 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); | |
| 304 | 302 | |
| 305 | 303 | coll_bit2 |= collision_check(machine->colortable, &rect); |
| 306 | 304 | |
| r5077 | r5078 | |
| 311 | 309 | |
| 312 | 310 | tilemap_draw(helper, &rect, fg_tilemap, 0, 0); |
| 313 | 311 | |
| 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); | |
| 316 | 313 | |
| 317 | 314 | coll_bit1 |= collision_check(machine->colortable, &rect); |
| 318 | 315 | |
| r5077 | r5078 | |
| 350 | 347 | sy2 = 240 - sy2; |
| 351 | 348 | } |
| 352 | 349 | |
| 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); | |
| 355 | 351 | } |
| 356 | 352 | |
| 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); | |
| 359 | 354 | |
| 360 | 355 | coll_bit0 |= collision_check(machine->colortable, &rect); |
| 361 | 356 | } |
| r5077 | r5078 | |
| 440 | 435 | sy2 = 240 - sy2; |
| 441 | 436 | } |
| 442 | 437 | |
| 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); | |
| 445 | 439 | } |
| 446 | 440 | |
| 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); | |
| 449 | 442 | |
| 450 | 443 | coll_bit3 |= collision_check(machine->colortable, &rect); |
| 451 | 444 | } |
| r5077 | r5078 | |
| 530 | 523 | sy2 = 240 - sy2; |
| 531 | 524 | } |
| 532 | 525 | |
| 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); | |
| 535 | 527 | } |
| 536 | 528 | |
| 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); | |
| 539 | 530 | |
| 540 | 531 | coll_bit6 |= collision_check(machine->colortable, &rect); |
| 541 | 532 | } |
| r5077 | r5078 | |
|---|---|---|
| 187 | 187 | for (ay=0; ay<dy; ay++) { |
| 188 | 188 | if (!fx && !fy) |
| 189 | 189 | { |
| 190 | pdrawgfx(bitmap,machine->gfx[4], | |
| 190 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 191 | 191 | sprite + inc, |
| 192 | 192 | color,fx,fy,x+ax*16,y+ay*16, |
| 193 | | |
| 193 | | |
| 194 | 194 | |
| 195 | 195 | // wrap around y |
| 196 | pdrawgfx(bitmap,machine->gfx[4], | |
| 196 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 197 | 197 | sprite + inc, |
| 198 | 198 | color,fx,fy,x+ax*16,y+ay*16 + 512, |
| 199 | | |
| 199 | | |
| 200 | 200 | |
| 201 | 201 | // wrap around y |
| 202 | pdrawgfx(bitmap,machine->gfx[4], | |
| 202 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 203 | 203 | sprite + inc, |
| 204 | 204 | color,fx,fy,x+ax*16,y+ay*16 - 512, |
| 205 | | |
| 205 | | |
| 206 | 206 | } |
| 207 | 207 | else if (fx && !fy) |
| 208 | 208 | { |
| 209 | pdrawgfx(bitmap,machine->gfx[4], | |
| 209 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 210 | 210 | sprite + inc, |
| 211 | 211 | color,fx,fy,x+(dx-1-ax)*16,y+ay*16, |
| 212 | | |
| 212 | | |
| 213 | 213 | |
| 214 | 214 | // wrap around y |
| 215 | pdrawgfx(bitmap,machine->gfx[4], | |
| 215 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 216 | 216 | sprite + inc, |
| 217 | 217 | color,fx,fy,x+(dx-1-ax)*16,y+ay*16 + 512, |
| 218 | | |
| 218 | | |
| 219 | 219 | |
| 220 | 220 | // wrap around y |
| 221 | pdrawgfx(bitmap,machine->gfx[4], | |
| 221 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 222 | 222 | sprite + inc, |
| 223 | 223 | color,fx,fy,x+(dx-1-ax)*16,y+ay*16 - 512, |
| 224 | | |
| 224 | | |
| 225 | 225 | } |
| 226 | 226 | else if (!fx && fy) |
| 227 | 227 | { |
| 228 | pdrawgfx(bitmap,machine->gfx[4], | |
| 228 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 229 | 229 | sprite + inc, |
| 230 | 230 | color,fx,fy,x+ax*16,y+(dy-1-ay)*16, |
| 231 | | |
| 231 | | |
| 232 | 232 | |
| 233 | 233 | // wrap around y |
| 234 | pdrawgfx(bitmap,machine->gfx[4], | |
| 234 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 235 | 235 | sprite + inc, |
| 236 | 236 | color,fx,fy,x+ax*16,y+(dy-1-ay)*16 + 512, |
| 237 | | |
| 237 | | |
| 238 | 238 | |
| 239 | 239 | // wrap around y |
| 240 | pdrawgfx(bitmap,machine->gfx[4], | |
| 240 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 241 | 241 | sprite + inc, |
| 242 | 242 | color,fx,fy,x+ax*16,y+(dy-1-ay)*16 - 512, |
| 243 | | |
| 243 | | |
| 244 | 244 | } |
| 245 | 245 | else |
| 246 | 246 | { |
| 247 | pdrawgfx(bitmap,machine->gfx[4], | |
| 247 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 248 | 248 | sprite + inc, |
| 249 | 249 | color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16, |
| 250 | | |
| 250 | | |
| 251 | 251 | |
| 252 | 252 | // wrap around y |
| 253 | pdrawgfx(bitmap,machine->gfx[4], | |
| 253 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 254 | 254 | sprite + inc, |
| 255 | 255 | color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16 + 512, |
| 256 | | |
| 256 | | |
| 257 | 257 | |
| 258 | 258 | // wrap around y |
| 259 | pdrawgfx(bitmap,machine->gfx[4], | |
| 259 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 260 | 260 | sprite + inc, |
| 261 | 261 | color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16 - 512, |
| 262 | | |
| 262 | | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | inc++; |
| r5077 | r5078 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | ypos = 0x200-ypos; |
| 105 | 105 | |
| 106 | drawgfx(bitmap,gfx, | |
| 106 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 107 | 107 | tileno, |
| 108 | 108 | 0x30 + color, |
| 109 | 109 | flipx,0, |
| 110 | xpos-16+4,ypos-32, | |
| 111 | cliprect,TRANSPARENCY_PEN,15); | |
| 110 | xpos-16+4,ypos-32,15); | |
| 112 | 111 | } |
| 113 | 112 | } |
| 114 | 113 | |
| r5077 | r5078 | |
| 226 | 225 | |
| 227 | 226 | ypos = 0x110-ypos; |
| 228 | 227 | |
| 229 | drawgfx(bitmap,gfx, | |
| 228 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 230 | 229 | tileno+0x4000, |
| 231 | 230 | 0x30 + color, |
| 232 | 231 | flipx,0, |
| 233 | xpos-16+4,ypos-32, | |
| 234 | cliprect,TRANSPARENCY_PEN,15); | |
| 232 | xpos-16+4,ypos-32,15); | |
| 235 | 233 | } |
| 236 | 234 | } |
| 237 | 235 |
| r5077 | r5078 | |
|---|---|---|
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | /* draw */ |
| 643 | drawgfx(bitmap, machine->gfx[1], | |
| 643 | drawgfx_transpen(bitmap, &clip, | |
| 644 | machine->gfx[1], | |
| 644 | 645 | code, color, |
| 645 | 646 | flipx, flipy, |
| 646 | GALAXIAN_H0START + GALAXIAN_XSCALE * sx, sy, | |
| 647 | &clip, | |
| 648 | TRANSPARENCY_PEN, 0); | |
| 647 | GALAXIAN_H0START + GALAXIAN_XSCALE * sx, sy, 0); | |
| 649 | 648 | } |
| 650 | 649 | } |
| 651 | 650 |
| r5077 | r5078 | |
|---|---|---|
| 165 | 165 | { |
| 166 | 166 | for (x = 0;x < sizex;x++) |
| 167 | 167 | { |
| 168 | drawgfx(bitmap,machine->gfx[0], | |
| 168 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 169 | 169 | code + x + sizex * y, |
| 170 | 170 | color, |
| 171 | 171 | 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); | |
| 174 | 173 | } |
| 175 | 174 | } |
| 176 | 175 | } |
| r5077 | r5078 | |
|---|---|---|
| 449 | 449 | for (x=0;x<xnum;x++) |
| 450 | 450 | { |
| 451 | 451 | // 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); | |
| 454 | 454 | xp += xstep; |
| 455 | 455 | tile++; |
| 456 | 456 | } |
| r5077 | r5078 | |
|---|---|---|
| 530 | 530 | |
| 531 | 531 | gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width, 0, 256, 0); |
| 532 | 532 | |
| 533 | pdrawgfxzoom( bitmap,&gfx, | |
| 533 | pdrawgfxzoom_transpen( bitmap,cliprect, &gfx, | |
| 534 | 534 | 0, |
| 535 | 535 | color_start >> 4, |
| 536 | 536 | flipx, flipy, |
| 537 | 537 | x, y, |
| 538 | cliprect, TRANSPARENCY_PEN, 255, | |
| 539 | 538 | zoom, zoom, |
| 540 | primask[pri]); | |
| 539 | priority_bitmap,primask[pri], 255); | |
| 541 | 540 | } |
| 542 | 541 | else |
| 543 | 542 | { |
| r5077 | r5078 | |
| 547 | 546 | |
| 548 | 547 | gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width/2, 0, 16, GFX_ELEMENT_PACKED); |
| 549 | 548 | |
| 550 | pdrawgfxzoom( bitmap,&gfx, | |
| 549 | pdrawgfxzoom_transpen( bitmap,cliprect, &gfx, | |
| 551 | 550 | 0, |
| 552 | 551 | color + color_start, |
| 553 | 552 | flipx, flipy, |
| 554 | 553 | x, y, |
| 555 | cliprect, TRANSPARENCY_PEN, 15, | |
| 556 | 554 | zoom, zoom, |
| 557 | primask[pri]); | |
| 555 | priority_bitmap,primask[pri], 15); | |
| 558 | 556 | } |
| 559 | 557 | #if 0 |
| 560 | 558 | { /* Display priority + zoom on each sprite */ |
| r5077 | r5078 | |
|---|---|---|
| 166 | 166 | flipx = ((spriteram[offs+1]&0x40)>>6)^flipscreen; |
| 167 | 167 | flipy = ((spriteram[offs+1]&0x80)>>7)^flipscreen; |
| 168 | 168 | |
| 169 | drawgfx(bitmap,machine->gfx[1], | |
| 169 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 170 | 170 | code, |
| 171 | 171 | spriteram[offs+1] & 0x0f, |
| 172 | 172 | flipx,flipy, |
| 173 | sx,sy, | |
| 174 | cliprect,TRANSPARENCY_PEN,15); | |
| 173 | sx,sy,15); | |
| 175 | 174 | /* wrap around */ |
| 176 | 175 | if (sx > 240) |
| 177 | drawgfx(bitmap,machine->gfx[1], | |
| 176 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 178 | 177 | code, |
| 179 | 178 | spriteram[offs+1] & 0x0f, |
| 180 | 179 | flipx,flipy, |
| 181 | sx-256,sy, | |
| 182 | cliprect,TRANSPARENCY_PEN,15); | |
| 180 | sx-256,sy,15); | |
| 183 | 181 | } |
| 184 | 182 | } |
| 185 | 183 | } |
| r5077 | r5078 | |
| 223 | 221 | flipx = ((spriteram[offs+1]&0x40)>>6)^flipscreen; |
| 224 | 222 | flipy = ((spriteram[offs+1]&0x80)>>7)^flipscreen; |
| 225 | 223 | |
| 226 | drawgfx(bitmap,machine->gfx[1], | |
| 224 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 227 | 225 | code, |
| 228 | 226 | spriteram[offs+1] & 0x0f, |
| 229 | 227 | flipx,flipy, |
| 230 | sx,sy, | |
| 231 | cliprect,TRANSPARENCY_PEN,15); | |
| 228 | sx,sy,15); | |
| 232 | 229 | /* wrap around */ |
| 233 | 230 | if (sx > 240) |
| 234 | drawgfx(bitmap,machine->gfx[1], | |
| 231 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 235 | 232 | code, |
| 236 | 233 | spriteram[offs+1] & 0x0f, |
| 237 | 234 | flipx,flipy, |
| 238 | sx-256,sy, | |
| 239 | cliprect,TRANSPARENCY_PEN,15); | |
| 235 | sx-256,sy,15); | |
| 240 | 236 | } |
| 241 | 237 | } |
| 242 | 238 | } |
| r5077 | r5078 | |
|---|---|---|
| 75 | 75 | if (!flipx) { |
| 76 | 76 | for (xcnt = 0; xcnt < wide+1; xcnt ++) { |
| 77 | 77 | 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); | |
| 80 | 80 | loopno ++; |
| 81 | 81 | } |
| 82 | 82 | } else { |
| 83 | 83 | for (xcnt = wide; xcnt >= 0; xcnt --) { |
| 84 | 84 | 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); | |
| 87 | 87 | loopno ++; |
| 88 | 88 | } |
| 89 | 89 | } |
| r5077 | r5078 | |
|---|---|---|
| 111 | 111 | if (sx > 248) |
| 112 | 112 | sx = sx - 256; |
| 113 | 113 | |
| 114 | drawgfx(bitmap, machine->gfx[1], | |
| 114 | drawgfx_transmask(bitmap, cliprect, | |
| 115 | machine->gfx[1], | |
| 115 | 116 | code, color, |
| 116 | 117 | flipx, flipy, |
| 117 | 118 | px, py, |
| 118 | cliprect, | |
| 119 | TRANSPARENCY_PENS, | |
| 120 | 119 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 121 | 120 | } |
| 122 | 121 | } |
| r5077 | r5078 | |
|---|---|---|
| 297 | 297 | |
| 298 | 298 | if (spriteram[offs] & 0x80) |
| 299 | 299 | /* 16x16 sprite */ |
| 300 | drawgfx(bitmap,machine->gfx[0], | |
| 300 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 301 | 301 | code, color, |
| 302 | 302 | 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); | |
| 305 | 304 | else |
| 306 | 305 | /* 32x32 sprite */ |
| 307 | drawgfx(bitmap,machine->gfx[1], | |
| 306 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 308 | 307 | code >> 2, color, |
| 309 | 308 | 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); | |
| 312 | 310 | } |
| 313 | 311 | } |
| 314 | 312 | } |
| r5077 | r5078 | |
|---|---|---|
| 172 | 172 | flipy = !flipy; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | drawgfx(bitmap, machine->gfx[1], | |
| 175 | drawgfx_transmask(bitmap, cliprect,machine->gfx[1], | |
| 176 | 176 | code, color, |
| 177 | 177 | flipx, flipy, |
| 178 | 178 | sx, sy, |
| 179 | cliprect,TRANSPARENCY_PENS, | |
| 180 | 179 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, palettebank << 5)); |
| 181 | 180 | } |
| 182 | 181 | } |
| r5077 | r5078 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | while (multi >= 0) |
| 98 | 98 | { |
| 99 | drawgfx(bitmap,machine->gfx[2], | |
| 99 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 100 | 100 | sprite - multi * inc, |
| 101 | 101 | colour, |
| 102 | 102 | fx,fy, |
| 103 | x,y + mult * multi, | |
| 104 | cliprect,TRANSPARENCY_PEN,0); | |
| 103 | x,y + mult * multi,0); | |
| 105 | 104 | |
| 106 | 105 | multi--; |
| 107 | 106 | } |
| r5077 | r5078 | |
|---|---|---|
| 121 | 121 | sy = 27 - sy; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 124 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 125 | 125 | videoram[offs], |
| 126 | 126 | colorram[offs] & 0x3f, |
| 127 | 127 | flipscreen,flipscreen, |
| 128 | sx*8,sy*8, | |
| 129 | cliprect,TRANSPARENCY_NONE,0); | |
| 128 | sx*8,sy*8); | |
| 130 | 129 | } |
| 131 | 130 | |
| 132 | 131 | /* Note, we're counting up on purpose ! */ |
| r5077 | r5078 | |
| 150 | 149 | flipy = !flipy; |
| 151 | 150 | } |
| 152 | 151 | |
| 153 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 152 | drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1], | |
| 154 | 153 | (spriteram[offs] & 0x3f) + 64 * otherbank, |
| 155 | 154 | color, |
| 156 | 155 | flipx,flipy, |
| 157 | 156 | sx,sy, |
| 158 | cliprect,TRANSPARENCY_PENS, | |
| 159 | 157 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 0x1f)); |
| 160 | 158 | } |
| 161 | 159 | |
| r5077 | r5078 | |
| 191 | 189 | sy = 27 - sy; |
| 192 | 190 | } |
| 193 | 191 | |
| 194 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 192 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 195 | 193 | videoram[offs], |
| 196 | 194 | colorram[offs] & 0x3f, |
| 197 | 195 | flipscreen,flipscreen, |
| 198 | sx*8,sy*8, | |
| 199 | cliprect,TRANSPARENCY_NONE,0); | |
| 196 | sx*8,sy*8); | |
| 200 | 197 | } |
| 201 | 198 | } |
| 202 | 199 |
| r5077 | r5078 | |
|---|---|---|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
| 210 | drawgfx( bitmap, machine->gfx[2], | |
| 210 | drawgfx_transpen( bitmap, cliprect,machine->gfx[2], | |
| 211 | 211 | code, |
| 212 | 212 | color, |
| 213 | 213 | 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 ); | |
| 216 | 215 | } |
| 217 | 216 | } |
| 218 | 217 | } |
| r5077 | r5078 | |
|---|---|---|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | if (spriteram[offs] != 0) |
| 360 | drawgfx(bitmap,machine->gfx[1], | |
| 360 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 361 | 361 | code ^ 0x1ff, |
| 362 | 362 | color, |
| 363 | 363 | flipx,flipy, |
| 364 | sx,sy, | |
| 365 | cliprect,TRANSPARENCY_PEN,0); | |
| 364 | sx,sy,0); | |
| 366 | 365 | } |
| 367 | 366 | } |
| 368 | 367 |
| r5077 | r5078 | |
|---|---|---|
| 70 | 70 | sx *= HORZ_CHR; |
| 71 | 71 | sy *= VERT_CHR; |
| 72 | 72 | |
| 73 | drawgfx(bitmap, screen->machine->gfx[0], | |
| 73 | drawgfx_opaque(bitmap, cliprect,screen->machine->gfx[0], | |
| 74 | 74 | videoram[i], video_inverted ? 1 : 0, |
| 75 | 75 | 0,0, |
| 76 | sx,sy, | |
| 77 | cliprect,TRANSPARENCY_NONE,0); | |
| 76 | sx,sy); | |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | x = marker_x - 1; /* normal video lags marker by 1 pixel */ |
| r5077 | r5078 | |
|---|---|---|
| 38 | 38 | sx = offs % 32; |
| 39 | 39 | sy = offs / 32; |
| 40 | 40 | |
| 41 | drawgfx(bitmap,screen->machine->gfx[3], | |
| 41 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[3], | |
| 42 | 42 | taxidrvr_vram3[offs], |
| 43 | 43 | 0, |
| 44 | 44 | 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); | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | for (offs = 0;offs < 0x400;offs++) |
| r5077 | r5078 | |
| 51 | 50 | sx = offs % 32; |
| 52 | 51 | sy = offs / 32; |
| 53 | 52 | |
| 54 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 53 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 55 | 54 | taxidrvr_vram2[offs]+256*taxidrvr_vram2[offs+0x400], |
| 56 | 55 | 0, |
| 57 | 56 | 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); | |
| 60 | 58 | } |
| 61 | 59 | |
| 62 | 60 | if (spritectrl[2] & 4) |
| r5077 | r5078 | |
| 118 | 116 | sx = offs % 32; |
| 119 | 117 | sy = offs / 32; |
| 120 | 118 | |
| 121 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 119 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 122 | 120 | taxidrvr_vram1[offs], |
| 123 | 121 | 0, |
| 124 | 122 | 0,0, |
| 125 | sx*8,sy*8, | |
| 126 | cliprect,TRANSPARENCY_PEN,0); | |
| 123 | sx*8,sy*8,0); | |
| 127 | 124 | } |
| 128 | 125 | |
| 129 | 126 | for (offs = 0;offs < 0x2000;offs++) |
| r5077 | r5078 | |
| 146 | 143 | sx = offs % 32; |
| 147 | 144 | sy = offs / 32; |
| 148 | 145 | |
| 149 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 146 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 150 | 147 | taxidrvr_vram0[offs], |
| 151 | 148 | 0, |
| 152 | 149 | 0,0, |
| 153 | sx*8,sy*8, | |
| 154 | cliprect,TRANSPARENCY_PEN,0); | |
| 150 | sx*8,sy*8,0); | |
| 155 | 151 | } |
| 156 | 152 | return 0; |
| 157 | 153 | } |
| r5077 | r5078 | |
|---|---|---|
| 101 | 101 | fx = spriteram[offs]&4; |
| 102 | 102 | fy = 0; /* ? */ |
| 103 | 103 | |
| 104 | drawgfx(bitmap,machine->gfx[0], | |
| 104 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 105 | 105 | sprite, |
| 106 | color,fx,fy,x,y, | |
| 107 | cliprect,TRANSPARENCY_PEN,0); | |
| 106 | color,fx,fy,x,y,0); | |
| 108 | 107 | |
| 109 | 108 | /* Double Height */ |
| 110 | 109 | if(spriteram[offs] & 0x10) |
| 111 | 110 | { |
| 112 | drawgfx(bitmap,machine->gfx[0], | |
| 111 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 113 | 112 | sprite+1, |
| 114 | color,fx,fy,x,y+16, | |
| 115 | cliprect,TRANSPARENCY_PEN,0); | |
| 113 | color,fx,fy,x,y+16,0); | |
| 116 | 114 | } |
| 117 | 115 | } |
| 118 | 116 | } |
| r5077 | r5078 | |
|---|---|---|
| 245 | 245 | sx -= 0x18; |
| 246 | 246 | sy = (sy & 0x7ff) - (sy & 0x800); |
| 247 | 247 | |
| 248 | drawgfx( bitmap, machine->gfx[0], | |
| 248 | drawgfx_transpen( bitmap, cliprect, machine->gfx[0], | |
| 249 | 249 | code, color, |
| 250 | flipx, flipy, sx, sy, | |
| 251 | cliprect, TRANSPARENCY_PEN, 0x3f); | |
| 250 | flipx, flipy, sx, sy, 0x3f); | |
| 252 | 251 | } |
| 253 | 252 | } |
| 254 | 253 |
| r5077 | r5078 | |
|---|---|---|
| 107 | 107 | flipy = !flipy; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | drawgfx(bitmap,machine->gfx[1], | |
| 110 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 111 | 111 | sprite, |
| 112 | color,flipx,flipy,x,y, | |
| 113 | cliprect,TRANSPARENCY_PEN,15); | |
| 112 | color,flipx,flipy,x,y,15); | |
| 114 | 113 | } |
| 115 | 114 | } |
| 116 | 115 |
| r5077 | r5078 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | while (multi >= 0) |
| 68 | 68 | { |
| 69 | drawgfx(bitmap,machine->gfx[gfxbank], | |
| 69 | drawgfx_transpen(bitmap,cliprect,machine->gfx[gfxbank], | |
| 70 | 70 | sprite - multi * inc, |
| 71 | 71 | colour, |
| 72 | 72 | fx,fy, |
| 73 | x,y + mult * multi, | |
| 74 | cliprect,TRANSPARENCY_PEN,0); | |
| 73 | x,y + mult * multi,0); | |
| 75 | 74 | |
| 76 | 75 | multi--; |
| 77 | 76 | } |
| r5077 | r5078 | |
|---|---|---|
| 200 | 200 | { |
| 201 | 201 | if (flipscreen) |
| 202 | 202 | { |
| 203 | drawgfx(bitmap,machine->gfx[1], | |
| 203 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 204 | 204 | code,color, |
| 205 | 205 | 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], | |
| 209 | 208 | code + 1, |
| 210 | 209 | color, |
| 211 | 210 | flipx,flipy, |
| 212 | sx,sy, | |
| 213 | cliprect,TRANSPARENCY_PEN,0); | |
| 211 | sx,sy,0); | |
| 214 | 212 | } |
| 215 | 213 | else |
| 216 | 214 | { |
| 217 | drawgfx(bitmap,machine->gfx[1], | |
| 215 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 218 | 216 | code,color, |
| 219 | 217 | 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], | |
| 223 | 220 | code + 1,color, |
| 224 | 221 | flipx,flipy, |
| 225 | sx,sy, | |
| 226 | cliprect,TRANSPARENCY_PEN,0); | |
| 222 | sx,sy,0); | |
| 227 | 223 | } |
| 228 | 224 | } |
| 229 | 225 | else |
| 230 | 226 | { |
| 231 | drawgfx(bitmap,machine->gfx[1], | |
| 227 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 232 | 228 | code,color, |
| 233 | 229 | flipx,flipy, |
| 234 | sx,sy, | |
| 235 | cliprect,TRANSPARENCY_PEN,0); | |
| 230 | sx,sy,0); | |
| 236 | 231 | } |
| 237 | 232 | } |
| 238 | 233 | } |
| r5077 | r5078 | |
|---|---|---|
| 152 | 152 | |
| 153 | 153 | sy += 1; |
| 154 | 154 | |
| 155 | drawgfx(bitmap,machine->gfx[0], | |
| 155 | drawgfx_transmask(bitmap,cliprect, | |
| 156 | machine->gfx[0], | |
| 156 | 157 | code, color, |
| 157 | 158 | flipx, flipy, |
| 158 | 159 | sx, sy, |
| 159 | cliprect, | |
| 160 | TRANSPARENCY_PENS, | |
| 161 | 160 | colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0)); |
| 162 | 161 | |
| 163 | 162 | /* redraw with wraparound */ |
| 164 | 163 | |
| 165 | drawgfx(bitmap,machine->gfx[0], | |
| 164 | drawgfx_transmask(bitmap,cliprect, | |
| 165 | machine->gfx[0], | |
| 166 | 166 | code, color, |
| 167 | 167 | flipx, flipy, |
| 168 | 168 | sx - 256, sy, |
| 169 | cliprect, | |
| 170 | TRANSPARENCY_PENS, | |
| 171 | 169 | colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0)); |
| 172 | 170 | } |
| 173 | 171 | } |
| r5077 | r5078 | |
|---|---|---|
| 177 | 177 | spritecode = tiamc1_spriteram_n[offs] ^ 0xff; |
| 178 | 178 | |
| 179 | 179 | if (!(tiamc1_spriteram_a[offs] & 0x01)) |
| 180 | drawgfx(bitmap, machine->gfx[1], | |
| 180 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 181 | 181 | spritecode, |
| 182 | 182 | 0, |
| 183 | 183 | flipx, flipy, |
| 184 | sx, sy, | |
| 185 | cliprect, TRANSPARENCY_PEN, 15); | |
| 184 | sx, sy, 15); | |
| 186 | 185 | } |
| 187 | 186 | } |
| 188 | 187 |
| r5077 | r5078 | |
|---|---|---|
| 929 | 929 | ***************************************************************************/ |
| 930 | 930 | |
| 931 | 931 | // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities |
| 932 | static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 932 | static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 933 | 933 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 934 | | |
| 934 | | |
| 935 | 935 | { |
| 936 | 936 | int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); |
| 937 | 937 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| r5077 | r5078 | |
| 1080 | 1080 | if (fcu_flipscreen) sx = sx_base - dim_x; |
| 1081 | 1081 | else sx = sx_base + dim_x; |
| 1082 | 1082 | |
| 1083 | toaplan1_draw_sprite_custom(bitmap,machine->gfx[1], | |
| 1083 | toaplan1_draw_sprite_custom(bitmap,cliprect,machine->gfx[1], | |
| 1084 | 1084 | sprite,color, |
| 1085 | 1085 | fcu_flipscreen,fcu_flipscreen, |
| 1086 | 1086 | sx,sy, |
| 1087 | | |
| 1087 | | |
| 1088 | 1088 | |
| 1089 | 1089 | sprite++ ; |
| 1090 | 1090 | } |
| r5077 | r5078 | |
| 1115 | 1115 | flipx = attrib & 0x100; |
| 1116 | 1116 | if (flipx) sx -= 15; |
| 1117 | 1117 | flipy = attrib & 0x200; |
| 1118 | drawgfx(bitmap,machine->gfx[1], | |
| 1118 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 1119 | 1119 | sprite, |
| 1120 | 1120 | color, |
| 1121 | 1121 | flipx,flipy, |
| 1122 | sx-31,sy-16, | |
| 1123 | cliprect,TRANSPARENCY_PEN,0); | |
| 1122 | sx-31,sy-16,0); | |
| 1124 | 1123 | } |
| 1125 | 1124 | } |
| 1126 | 1125 | } |
| r5077 | r5078 | |
|---|---|---|
| 656 | 656 | UINT8 tile = videoram[offs]; |
| 657 | 657 | |
| 658 | 658 | /* draw the tile */ |
| 659 | drawgfx(bitmap, machine->gfx[0], tile, tile >> 4, video_flip, video_flip, x*8, y*8 | |
| 659 | drawgfx_transmask(bitmap, cliprect, machine->gfx[0], tile, tile >> 4, video_flip, video_flip, x*8, y*8 | |
| 660 | 660 | } |
| 661 | 661 | } |
| 662 | 662 | } |
| r5077 | r5078 | |
|---|---|---|
| 150 | 150 | y = 255 - y; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | drawgfx( | |
| 153 | drawgfx_transpen( | |
| 154 | 154 | bitmap, |
| 155 | machine->gfx[2], | |
| 155 | cliprect,machine->gfx[2], | |
| 156 | 156 | 0, /* this is just a dot, generated by the hardware */ |
| 157 | 157 | 0, |
| 158 | 158 | 0,0, |
| 159 | x,y, | |
| 160 | cliprect,TRANSPARENCY_PEN,0); | |
| 159 | x,y,0); | |
| 161 | 160 | } |
| 162 | 161 | } |
| 163 | 162 | |
| r5077 | r5078 | |
| 181 | 180 | flipy = !flipy; |
| 182 | 181 | } |
| 183 | 182 | |
| 184 | drawgfx(bitmap, | |
| 183 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 185 | 184 | spritecode, |
| 186 | 185 | spriteram[offs + 2] & 0x07, |
| 187 | 186 | flipx, flipy, |
| 188 | 187 | sx, sy, |
| 189 | //flip_screen[0] ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0); | |
| 190 | //&spritevisiblearea,TRANSPARENCY_PEN,0); | |
| 191 | cliprect, TRANSPARENCY_PEN, 0); | |
| 188 | 0); | |
| 192 | 189 | } |
| 193 | 190 | } |
| 194 | 191 |
| r5077 | r5078 | |
|---|---|---|
| 202 | 202 | flipy = !flipy; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | drawgfx(bitmap,machine->gfx[2], | |
| 205 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 206 | 206 | (spriteram[offs+1]&0x3f)+((spriteram[offs+2]&0x80)>>1)+((spriteram[offs+2]&0x40)<<1), |
| 207 | 207 | pal, |
| 208 | 208 | flipx,flipy, |
| 209 | sx,sy, | |
| 210 | cliprect,TRANSPARENCY_PEN,0); | |
| 209 | sx,sy,0); | |
| 211 | 210 | } |
| 212 | 211 | } |
| 213 | 212 |
| r5077 | r5078 | |
|---|---|---|
| 151 | 151 | flipy = !flipy; |
| 152 | 152 | } |
| 153 | 153 | |
| 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); | |
| 157 | 156 | } |
| 158 | 157 | } |
| 159 | 158 |
| r5077 | r5078 | |
|---|---|---|
| 219 | 219 | flipy = !flipy; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | drawgfx( bitmap, gfx, | |
| 222 | drawgfx_transpen( bitmap, cliprect,gfx, | |
| 223 | 223 | tile_number, |
| 224 | 224 | color, |
| 225 | 225 | flipx,flipy, |
| 226 | sx,sy, | |
| 227 | cliprect,TRANSPARENCY_PEN,15); | |
| 226 | sx,sy,15); | |
| 228 | 227 | } |
| 229 | 228 | } |
| 230 | 229 | } |
| r5077 | r5078 | |
|---|---|---|
| 126 | 126 | flipx = !flipx; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | drawgfx(bitmap,machine->gfx[spriteram[offs + 1] & 0x80 ? 2 : 1], | |
| 129 | drawgfx_transpen(bitmap,cliprect,machine->gfx[spriteram[offs + 1] & 0x80 ? 2 : 1], | |
| 130 | 130 | spriteram[offs + 1] & 0x7f, |
| 131 | 131 | spriteram[offs + 2] & 0x0f, |
| 132 | 132 | flipx,flip_screen_get(machine), |
| 133 | sx,sy, | |
| 134 | cliprect,TRANSPARENCY_PEN,0); | |
| 133 | sx,sy,0); | |
| 135 | 134 | } |
| 136 | 135 | } |
| 137 | 136 |
| r5077 | r5078 | |
|---|---|---|
| 213 | 213 | fy = !fy; |
| 214 | 214 | y = 240 - y; |
| 215 | 215 | } |
| 216 | drawgfx(bitmap, screen->machine->gfx[2], code, color, fx, fy, x, y | |
| 216 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, fx, fy, x, y | |
| 217 | 217 | } |
| 218 | 218 | return 0; |
| 219 | 219 | } |
| r5077 | r5078 | |
|---|---|---|
| 380 | 380 | int addr = (code*2) & (TILES_LEN-1); |
| 381 | 381 | |
| 382 | 382 | if (zoomx == 32 && zoomy == 32) |
| 383 | pdrawgfx(bitmap,machine->gfx[0], | |
| 383 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 384 | 384 | TILES[addr+1] * 256 + TILES[addr], |
| 385 | 385 | attr >> 8, |
| 386 | 386 | flipx, flipy, |
| 387 | 387 | 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); | |
| 390 | 390 | else |
| 391 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 391 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 392 | 392 | TILES[addr+1] * 256 + TILES[addr], |
| 393 | 393 | attr >> 8, |
| 394 | 394 | flipx, flipy, |
| 395 | 395 | x + (dx * zoomx) / 2, y + (dy * zoomy) / 2, |
| 396 | cliprect,TRANSPARENCY_PEN,trans_pen, | |
| 397 | 396 | zoomx << 11,zoomy << 11, |
| 398 | pri[(attr & 0xc0) >> 6]); | |
| 397 | priority_bitmap,pri[(attr & 0xc0) >> 6],trans_pen); | |
| 399 | 398 | |
| 400 | 399 | code++; |
| 401 | 400 | } |
| r5077 | r5078 | |
|---|---|---|
| 361 | 361 | if(!pri && (color & 0x0c) == 0x0c) |
| 362 | 362 | pri = 2; |
| 363 | 363 | |
| 364 | pdrawgfx(bitmap,machine->gfx[0], | |
| 364 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 365 | 365 | code, |
| 366 | 366 | color, |
| 367 | 367 | flipx,0, |
| 368 | 368 | sx + xoffset,sy + yoffset, |
| 369 | | |
| 369 | | |
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 |
| r5077 | r5078 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | for (y = starty ; y != endy ; y += incy) |
| 249 | 249 | { |
| 250 | pdrawgfx( bitmap, machine->gfx[0], | |
| 250 | pdrawgfx_transpen( bitmap, cliprect, machine->gfx[0], | |
| 251 | 251 | code++, |
| 252 | 252 | color, |
| 253 | 253 | flipx, flipy, |
| 254 | 254 | sx, y, |
| 255 | | |
| 255 | | |
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | } |
| r5077 | r5078 | |
| 310 | 310 | |
| 311 | 311 | for (y = starty ; y != endy ; y += incy) |
| 312 | 312 | { |
| 313 | pdrawgfx( bitmap, machine->gfx[0], | |
| 313 | pdrawgfx_transpen( bitmap, cliprect, machine->gfx[0], | |
| 314 | 314 | code++, |
| 315 | 315 | color, |
| 316 | 316 | flipx, flipy, |
| 317 | 317 | sx, y, |
| 318 | | |
| 318 | | |
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | } |
| r5077 | r5078 | |
|---|---|---|
| 105 | 105 | sprite_ptr->x = curx; |
| 106 | 106 | sprite_ptr->y = cury; |
| 107 | 107 | |
| 108 | drawgfx(bitmap,machine->gfx[0], | |
| 108 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 109 | 109 | sprite_ptr->code, |
| 110 | 110 | sprite_ptr->color, |
| 111 | 111 | 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); | |
| 114 | 113 | } |
| 115 | 114 | } |
| 116 | 115 | } |
| r5077 | r5078 | |
|---|---|---|
| 94 | 94 | if (y > 240) |
| 95 | 95 | y = y - 256; |
| 96 | 96 | |
| 97 | drawgfx(sprite_bitmap,machine->gfx[1], | |
| 97 | drawgfx_transmask(sprite_bitmap,cliprect, machine->gfx[1], | |
| 98 | 98 | code, color, |
| 99 | 99 | ikki_flipscreen,ikki_flipscreen, |
| 100 | 100 | x,y, |
| 101 | cliprect, TRANSPARENCY_PENS, | |
| 102 | 101 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 103 | 102 | } |
| 104 | 103 | |
| r5077 | r5078 | |
| 177 | 176 | bank = (color & 0xe0) << 3; |
| 178 | 177 | color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2); |
| 179 | 178 | |
| 180 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 179 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 181 | 180 | videoram[offs*2+1] + bank, |
| 182 | 181 | color, |
| 183 | 182 | ikki_flipscreen,ikki_flipscreen, |
| 184 | x,y, | |
| 185 | cliprect,TRANSPARENCY_NONE,0); | |
| 183 | x,y); | |
| 186 | 184 | } |
| 187 | 185 | |
| 188 | 186 | draw_sprites(screen->machine, bitmap, cliprect); |
| r5077 | r5078 | |
| 213 | 211 | bank = (color & 0xe0) << 3; |
| 214 | 212 | color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2); |
| 215 | 213 | |
| 216 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 214 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 217 | 215 | videoram[offs*2+1] + bank, |
| 218 | 216 | color, |
| 219 | 217 | ikki_flipscreen,ikki_flipscreen, |
| 220 | x,y, | |
| 221 | cliprect,TRANSPARENCY_NONE,0); | |
| 218 | x,y); | |
| 222 | 219 | } |
| 223 | 220 | } |
| 224 | 221 |
| r5077 | r5078 | |
|---|---|---|
| 162 | 162 | flipx = !flipx; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | drawgfx(bitmap,machine->gfx[2], | |
| 165 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 166 | 166 | code, |
| 167 | 167 | color, |
| 168 | 168 | flipx,flipscreen, |
| 169 | sx,sy, | |
| 170 | cliprect,TRANSPARENCY_PEN,15); | |
| 169 | sx,sy,15); | |
| 171 | 170 | } |
| 172 | 171 | } |
| 173 | 172 |
| r5077 | r5078 | |
|---|---|---|
| 511 | 511 | |
| 512 | 512 | if(priority) |
| 513 | 513 | { |
| 514 | drawgfx(bitmap,gfx, | |
| 514 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 515 | 515 | code, |
| 516 | 516 | color, |
| 517 | 517 | 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); | |
| 520 | 519 | } |
| 521 | 520 | else |
| 522 | 521 | { |
| r5077 | r5078 | |
|---|---|---|
| 160 | 160 | flipy = !flipy; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | drawgfx(bitmap,machine->gfx[1], | |
| 163 | drawgfx_transpen(bitmap,cliprect, | |
| 164 | machine->gfx[1], | |
| 164 | 165 | code, color, |
| 165 | 166 | flipx, flipy, |
| 166 | sx, sy, | |
| 167 | cliprect, | |
| 168 | TRANSPARENCY_PEN, 0); | |
| 167 | sx, sy, 0); | |
| 169 | 168 | } |
| 170 | 169 | } |
| 171 | 170 | } |
| r5077 | r5078 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | while (multi >= 0) |
| 67 | 67 | { |
| 68 | drawgfx(bitmap,machine->gfx[2], | |
| 68 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 69 | 69 | sprite - multi * inc, |
| 70 | 70 | colour, |
| 71 | 71 | fx,fy, |
| 72 | x,y + mult * multi, | |
| 73 | cliprect,TRANSPARENCY_PEN,0); | |
| 72 | x,y + mult * multi,0); | |
| 74 | 73 | |
| 75 | 74 | multi--; |
| 76 | 75 | } |
| r5077 | r5078 | |
|---|---|---|
| 89 | 89 | flipy^=1; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | drawgfx(bitmap,gfx, | |
| 92 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 93 | 93 | tile&0x7f, |
| 94 | 94 | (attributes) & 7, |
| 95 | 95 | flipx,flipy, |
| 96 | sx,sy, | |
| 97 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 96 | sx,sy,0 ); | |
| 98 | 97 | |
| 99 | 98 | source -= 4; |
| 100 | 99 | } |
| r5077 | r5078 | |
|---|---|---|
| 85 | 85 | y -= 0x100; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | drawgfx(bitmap,machine->gfx[1],code,col,fx,fy,x,y | |
| 88 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,col,fx,fy,x,y | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | for (offs = 0; offs<0x100; offs+=4) |
| r5077 | r5078 | |
| 114 | 114 | if (y > 0xf0) |
| 115 | 115 | y -= 0x100; |
| 116 | 116 | |
| 117 | drawgfx(bitmap,machine->gfx[2],code,col,f,f,x,y | |
| 117 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2],code,col,f,f,x,y | |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 |
| r5077 | r5078 | |
|---|---|---|
| 104 | 104 | flipy = !flipy; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | drawgfx(bitmap,gfx,tile,color,flipx,flipy,sx,sy | |
| 107 | drawgfx_transpen(bitmap,cliprect,gfx,tile,color,flipx,flipy,sx,sy | |
| 108 | 108 | |
| 109 | 109 | source += 4; |
| 110 | 110 | } |
| r5077 | r5078 | |
|---|---|---|
| 183 | 183 | switch (sr[offs+4] & 0x0c) |
| 184 | 184 | { |
| 185 | 185 | case 0x00: /* 16x16 */ |
| 186 | drawgfx(bitmap,machine->gfx[1], | |
| 186 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 187 | 187 | code/4, |
| 188 | 188 | color, |
| 189 | 189 | flipx,flipy, |
| 190 | sx,sy, | |
| 191 | cliprect,TRANSPARENCY_PEN,0); | |
| 190 | sx,sy,0); | |
| 192 | 191 | break; |
| 193 | 192 | |
| 194 | 193 | case 0x04: /* 16x8 */ |
| 195 | 194 | { |
| 196 | 195 | if (flip_screen_get(machine)) sy += 8; // this fixes the train wheels' position |
| 197 | 196 | |
| 198 | drawgfx(bitmap,machine->gfx[2], | |
| 197 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 199 | 198 | code & ~1, |
| 200 | 199 | color, |
| 201 | 200 | 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], | |
| 205 | 203 | code | 1, |
| 206 | 204 | color, |
| 207 | 205 | flipx,flipy, |
| 208 | flipx?sx:sx+8,sy, | |
| 209 | cliprect,TRANSPARENCY_PEN,0); | |
| 206 | flipx?sx:sx+8,sy,0); | |
| 210 | 207 | } |
| 211 | 208 | break; |
| 212 | 209 | |
| 213 | 210 | case 0x08: /* 8x16 */ |
| 214 | 211 | { |
| 215 | drawgfx(bitmap,machine->gfx[2], | |
| 212 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 216 | 213 | code & ~2, |
| 217 | 214 | color, |
| 218 | 215 | 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], | |
| 222 | 218 | code | 2, |
| 223 | 219 | color, |
| 224 | 220 | flipx,flipy, |
| 225 | sx,flipy?sy:sy+8, | |
| 226 | cliprect,TRANSPARENCY_PEN,0); | |
| 221 | sx,flipy?sy:sy+8,0); | |
| 227 | 222 | } |
| 228 | 223 | break; |
| 229 | 224 | |
| 230 | 225 | case 0x0c: /* 8x8 */ |
| 231 | 226 | { |
| 232 | drawgfx(bitmap,machine->gfx[2], | |
| 227 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 233 | 228 | code, |
| 234 | 229 | color, |
| 235 | 230 | flipx,flipy, |
| 236 | sx,sy, | |
| 237 | cliprect,TRANSPARENCY_PEN,0); | |
| 231 | sx,sy,0); | |
| 238 | 232 | } |
| 239 | 233 | break; |
| 240 | 234 | } |
| r5077 | r5078 | |
| 306 | 300 | switch (sr[offs+3] & 0x0c) |
| 307 | 301 | { |
| 308 | 302 | case 0x00: /* 16x16 */ |
| 309 | drawgfx(bitmap,machine->gfx[1], | |
| 303 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 310 | 304 | code/4, |
| 311 | 305 | color, |
| 312 | 306 | flipx,flipy, |
| 313 | sx,sy, | |
| 314 | cliprect,TRANSPARENCY_PEN,0); | |
| 307 | sx,sy,0); | |
| 315 | 308 | break; |
| 316 | 309 | |
| 317 | 310 | case 0x04: /* 16x8 */ |
| 318 | 311 | { |
| 319 | 312 | if (flip_screen_get(machine)) sy += 8; // this fixes the train wheels' position |
| 320 | 313 | |
| 321 | drawgfx(bitmap,machine->gfx[2], | |
| 314 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 322 | 315 | code & ~1, |
| 323 | 316 | color, |
| 324 | 317 | 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], | |
| 328 | 320 | code | 1, |
| 329 | 321 | color, |
| 330 | 322 | flipx,flipy, |
| 331 | flipx?sx:sx+8,sy, | |
| 332 | cliprect,TRANSPARENCY_PEN,0); | |
| 323 | flipx?sx:sx+8,sy,0); | |
| 333 | 324 | } |
| 334 | 325 | break; |
| 335 | 326 | |
| 336 | 327 | case 0x08: /* 8x16 */ |
| 337 | 328 | { |
| 338 | drawgfx(bitmap,machine->gfx[2], | |
| 329 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 339 | 330 | code & ~2, |
| 340 | 331 | color, |
| 341 | 332 | 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], | |
| 345 | 335 | code | 2, |
| 346 | 336 | color, |
| 347 | 337 | flipx,flipy, |
| 348 | sx,flipy?sy:sy+8, | |
| 349 | cliprect,TRANSPARENCY_PEN,0); | |
| 338 | sx,flipy?sy:sy+8,0); | |
| 350 | 339 | } |
| 351 | 340 | break; |
| 352 | 341 | |
| 353 | 342 | case 0x0c: /* 8x8 */ |
| 354 | 343 | { |
| 355 | drawgfx(bitmap,machine->gfx[2], | |
| 344 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 356 | 345 | code, |
| 357 | 346 | color, |
| 358 | 347 | flipx,flipy, |
| 359 | sx,sy, | |
| 360 | cliprect,TRANSPARENCY_PEN,0); | |
| 348 | sx,sy,0); | |
| 361 | 349 | } |
| 362 | 350 | break; |
| 363 | 351 | } |
| r5077 | r5078 | |
|---|---|---|
| 47 | 47 | int ypos = source[0]-16+3; |
| 48 | 48 | int tile_number = source[2]+source[3]*0x100; |
| 49 | 49 | |
| 50 | drawgfx( bitmap, gfx, | |
| 50 | drawgfx_transpen( bitmap, &clip,gfx, | |
| 51 | 51 | tile_number, |
| 52 | 52 | 0, /* color */ |
| 53 | 53 | 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, | |
| 57 | 56 | tile_number, |
| 58 | 57 | 0, /* color */ |
| 59 | 58 | 0,0, /* no flip */ |
| 60 | xpos,256+ypos, | |
| 61 | &clip,TRANSPARENCY_PEN,0 ); | |
| 59 | xpos,256+ypos,0 ); | |
| 62 | 60 | source+=4; |
| 63 | 61 | } |
| 64 | 62 | } |
| r5077 | r5078 | |
| 75 | 73 | for( sx=0; sx<256; sx+=8 ){ |
| 76 | 74 | int tile_number = base+source[0]+source[0x400]*0x100; |
| 77 | 75 | source++; |
| 78 | drawgfx( bitmap, gfx, | |
| 76 | drawgfx_opaque( bitmap, cliprect, | |
| 77 | gfx, | |
| 79 | 78 | tile_number, |
| 80 | 79 | 0, /* color */ |
| 81 | 80 | 0,0, /* no flip */ |
| 82 | sx,sy, | |
| 83 | cliprect, | |
| 84 | TRANSPARENCY_NONE,0 ); | |
| 81 | sx,sy ); | |
| 85 | 82 | } |
| 86 | 83 | } |
| 87 | 84 | } |
| r5077 | r5078 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | number = ((number & 0x03) << 14) | ((number & 0x0fffc) >> 2); |
| 182 | 182 | |
| 183 | drawgfx(bitmap,gfx,number, | |
| 183 | drawgfx_transpen(bitmap,cliprect,gfx,number, | |
| 184 | 184 | 0x10 + (color & 0x0f),xflip,yflip, |
| 185 | sx-0x0f,sy, | |
| 186 | cliprect,TRANSPARENCY_PEN,0); | |
| 185 | sx-0x0f,sy,0); | |
| 187 | 186 | } |
| 188 | 187 | } |
| 189 | 188 |
| r5077 | r5078 | |
|---|---|---|
| 1416 | 1416 | if (flipx) sx = sx_base - dim_x; |
| 1417 | 1417 | else sx = sx_base + dim_x; |
| 1418 | 1418 | |
| 1419 | drawgfx(bitmap,gfx,sprite, | |
| 1419 | drawgfx_transpen(bitmap,cliprect,gfx,sprite, | |
| 1420 | 1420 | color, |
| 1421 | 1421 | flipx,flipy, |
| 1422 | sx,sy, | |
| 1423 | cliprect,TRANSPARENCY_PEN,0); | |
| 1422 | sx,sy,0); | |
| 1424 | 1423 | |
| 1425 | 1424 | sprite++ ; |
| 1426 | 1425 | } |
| r5077 | r5078 | |
|---|---|---|
| 115 | 115 | sx += 16; |
| 116 | 116 | sy += 1; |
| 117 | 117 | |
| 118 | drawgfx(bitmap,machine->gfx[1], | |
| 118 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 119 | 119 | code, |
| 120 | 120 | color, |
| 121 | 121 | flipx,flipy, |
| 122 | sx,sy, | |
| 123 | cliprect,TRANSPARENCY_PEN,0); | |
| 122 | sx,sy,0); | |
| 124 | 123 | } |
| 125 | 124 | } |
| 126 | 125 |
| r5077 | r5078 | |
|---|---|---|
| 88 | 88 | flipy = !flipy; |
| 89 | 89 | } |
| 90 | 90 | |
| 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, | |
| 93 | 93 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 94 | 94 | } |
| 95 | 95 | } |
| r5077 | r5078 | |
|---|---|---|
| 172 | 172 | ex = xflip ? (spr_size-1-x) : x; |
| 173 | 173 | ey = yflip ? (spr_size-1-y) : y; |
| 174 | 174 | |
| 175 | pdrawgfx(bitmap,gfx,number + x_offset[ex] + y_offset[ey], | |
| 175 | pdrawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey], | |
| 176 | 176 | color,xflip,yflip, |
| 177 | 177 | sx-0x0f+x*8,sy+y*8, |
| 178 | | |
| 178 | | |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | } |
| r5077 | r5078 | |
|---|---|---|
| 670 | 670 | ------------------------------------------------------------------------*/ |
| 671 | 671 | |
| 672 | 672 | // blends two 8x8x16bpp direct RGB tilemaps |
| 673 | static void draw_cloud(running_machine *machine, bitmap_t *bitmap, | |
| 674 | gfx_element *gfx, | |
| 673 | static void draw_cloud(bitmap_t *bitmap, | |
| 674 | const gfx_element *gfx, | |
| 675 | 675 | UINT16 *tm_base, |
| 676 | 676 | int x0, int y0, // target coordinate |
| 677 | 677 | int xcount, int ycount, // number of tiles to draw in x and y |
| r5077 | r5078 | |
| 707 | 707 | |
| 708 | 708 | dst_base = BITMAP_ADDR32(bitmap, y0+dy, x0+dx); |
| 709 | 709 | |
| 710 | pal_base = machine->pens + pal_offset * gfx->color_granularity; | |
| 710 | pal_base = gfx->machine->pens + pal_offset * gfx->color_granularity; | |
| 711 | 711 | |
| 712 | 712 | alpha <<= 6; |
| 713 | 713 | |
| r5077 | r5078 | |
| 827 | 827 | |
| 828 | 828 | for (sx=0; sx<2*XSIZE; sx+=64) |
| 829 | 829 | { |
| 830 | drawgfx(bitmap,machine->gfx[0], | |
| 830 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 831 | 831 | code++, |
| 832 | 832 | color, |
| 833 | 833 | 0,0, |
| 834 | ((sx-scrollx)&0x3ff)-(384-32),sy, | |
| 835 | cliprect,TRANSPARENCY_PEN,0); | |
| 834 | ((sx-scrollx)&0x3ff)-(384-32),sy,0); | |
| 836 | 835 | } |
| 837 | 836 | } |
| 838 | 837 | |
| r5077 | r5078 | |
| 1098 | 1097 | ((pen_t *)mrct)[0] = ((pen_t *)mrct)[0x40] = ((pen_t *)mrct)[0x200] = ((pen_t *)mrct)[0x205]; |
| 1099 | 1098 | |
| 1100 | 1099 | if (video_on) |
| 1101 | draw_cloud( | |
| 1100 | draw_cloud( | |
| 1102 | 1101 | bitmap, |
| 1103 | 1102 | screen->machine->gfx[0], |
| 1104 | 1103 | wecleman_pageram+0x1800, |
| r5077 | r5078 | |
|---|---|---|
| 218 | 218 | if ((spriteram[offs+1]!=4)) //otherwise - ghost sprites |
| 219 | 219 | { |
| 220 | 220 | |
| 221 | drawgfx(bitmap,machine->gfx[0], | |
| 221 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 222 | 222 | code, color, |
| 223 | 223 | flipx,flipy, |
| 224 | sx,sy, | |
| 225 | cliprect,TRANSPARENCY_PEN,0); | |
| 224 | sx,sy,0); | |
| 226 | 225 | } |
| 227 | 226 | } |
| 228 | 227 | } |
| r5077 | r5078 | |
|---|---|---|
| 137 | 137 | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | drawgfx(bitmap,machine->gfx[0], | |
| 140 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 141 | 141 | tilenum,color, |
| 142 | 142 | 0,fy, |
| 143 | sx,sy, | |
| 144 | cliprect,TRANSPARENCY_PEN,0); | |
| 143 | sx,sy,0); | |
| 145 | 144 | |
| 146 | 145 | source += 0x10; |
| 147 | 146 | } |
| r5077 | r5078 | |
|---|---|---|
| 224 | 224 | int color = spriteram_2[offs + 1] & 0x3f; |
| 225 | 225 | if (flip_screen_get(machine)) sx += 32-2; |
| 226 | 226 | |
| 227 | drawgfx(bitmap,machine->gfx[1], | |
| 227 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 228 | 228 | (spriteram[offs] & 0xfc) >> 2, |
| 229 | 229 | color, |
| 230 | 230 | flipx,flipy, |
| 231 | 231 | sx,sy, |
| 232 | cliprect,TRANSPARENCY_PENS, | |
| 233 | 232 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x0f)); |
| 234 | 233 | } |
| 235 | 234 | } |
| r5077 | r5078 | |
| 247 | 246 | y = 253 - bosco_radary[offs]; |
| 248 | 247 | if (flip_screen_get(machine)) x -= 3; |
| 249 | 248 | |
| 250 | drawgfx(bitmap,machine->gfx[2], | |
| 249 | drawgfx_transmask(bitmap,cliprect,machine->gfx[2], | |
| 251 | 250 | ((bosco_radarattr[offs] & 0x0e) >> 1) ^ 0x07, |
| 252 | 251 | 0, |
| 253 | 252 | 0,0, |
| 254 | x,y, | |
| 255 | cliprect,TRANSPARENCY_PENS,0xf0); | |
| 253 | x,y,0xf0); | |
| 256 | 254 | } |
| 257 | 255 | } |
| 258 | 256 |
| r5077 | r5078 | |
|---|---|---|
| 69 | 69 | } |
| 70 | 70 | for( sy=0; sy<256; sy+=8 ) |
| 71 | 71 | { |
| 72 | drawgfx( bitmap, gfx, | |
| 72 | drawgfx_opaque( bitmap, cliprect, | |
| 73 | gfx, | |
| 73 | 74 | *source++, |
| 74 | 75 | 0, /* color */ |
| 75 | 76 | 0,0, /* no flip */ |
| 76 | sx,sy, | |
| 77 | cliprect, | |
| 78 | TRANSPARENCY_NONE, 0 ); | |
| 77 | sx,sy ); | |
| 79 | 78 | } |
| 80 | 79 | } |
| 81 | 80 | } |
| r5077 | r5078 | |
| 101 | 100 | { |
| 102 | 101 | for( col=0; col<4; col++ ) |
| 103 | 102 | { |
| 104 | drawgfx( tmpbitmap,gfx, | |
| 103 | drawgfx_opaque( tmpbitmap,0, gfx, | |
| 105 | 104 | rom[col+tile_number*4+row*0x400], |
| 106 | 105 | mnchmobl_palette_bank, |
| 107 | 106 | 0,0, /* flip */ |
| 108 | sx+col*8, sy+row*8, | |
| 109 | 0, TRANSPARENCY_NONE, 0 ); | |
| 107 | sx+col*8, sy+row*8 ); | |
| 110 | 108 | } |
| 111 | 109 | } |
| 112 | 110 | } |
| r5077 | r5078 | |
| 143 | 141 | { |
| 144 | 142 | sx = (sx >> 1) | (tile_number & 0x80); |
| 145 | 143 | sx = 2 * ((- 32 - scroll - sx) & 0xff) + xadjust; |
| 146 | drawgfx( bitmap, gfx, | |
| 144 | drawgfx_transpen( bitmap, cliprect, gfx, | |
| 147 | 145 | 0x7f - (tile_number & 0x7f), |
| 148 | 146 | color_base - (attributes & 0x03), |
| 149 | 147 | 0,0, /* no flip */ |
| 150 | sx,sy, | |
| 151 | cliprect, TRANSPARENCY_PEN, 7 ); | |
| 148 | sx,sy, 7 ); | |
| 152 | 149 | } |
| 153 | 150 | } |
| 154 | 151 | } |
| r5077 | r5078 | |
|---|---|---|
| 113 | 113 | flipx = !flipx; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | drawgfx(bitmap,machine->gfx[2+gfx_bank], | |
| 116 | drawgfx_transpen(bitmap,cliprect, machine->gfx[2+gfx_bank], | |
| 117 | 117 | code, color, |
| 118 | 118 | flipx, flipy, |
| 119 | sx, sy, | |
| 120 | cliprect, TRANSPARENCY_PEN, 0); | |
| 119 | sx, sy, 0); | |
| 121 | 120 | } |
| 122 | 121 | } |
| 123 | 122 | |
| r5077 | r5078 | |
| 136 | 135 | if (flip) |
| 137 | 136 | sy = 248 - sy; |
| 138 | 137 | |
| 139 | drawgfx(bitmap,machine->gfx[gfx_bank], | |
| 138 | drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_bank], | |
| 140 | 139 | code, color, |
| 141 | 140 | flip, flip, |
| 142 | sx, sy, | |
| 143 | cliprect,TRANSPARENCY_PEN,0); | |
| 141 | sx, sy,0); | |
| 144 | 142 | |
| 145 | 143 | code = videoram[0x1d00 + offs]; |
| 146 | 144 | color = colorram[0x1f11] & 0x03; |
| r5077 | r5078 | |
| 150 | 148 | if (flip) |
| 151 | 149 | sy = 248 - sy; |
| 152 | 150 | |
| 153 | drawgfx(bitmap,machine->gfx[gfx_bank], | |
| 151 | drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_bank], | |
| 154 | 152 | code, color, |
| 155 | 153 | flip, flip, |
| 156 | sx, sy, | |
| 157 | cliprect,TRANSPARENCY_PEN,0); | |
| 154 | sx, sy,0); | |
| 158 | 155 | } |
| 159 | 156 | } |
| 160 | 157 |
| r5077 | r5078 | |
|---|---|---|
| 221 | 221 | if ((priority != 0 && sprite_ptr->primask != 0) || |
| 222 | 222 | (priority == 0 && sprite_ptr->primask == 0)) |
| 223 | 223 | { |
| 224 | pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 224 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 225 | 225 | sprite_ptr->code, |
| 226 | 226 | sprite_ptr->color, |
| 227 | 227 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 228 | 228 | sprite_ptr->x,sprite_ptr->y, |
| 229 | cliprect,TRANSPARENCY_PEN,0, | |
| 230 | 229 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 231 | primasks[sprite_ptr->primask]); | |
| 230 | priority_bitmap,primasks[sprite_ptr->primask],0); | |
| 232 | 231 | } |
| 233 | 232 | } |
| 234 | 233 | } |
| r5077 | r5078 | |
|---|---|---|
| 473 | 473 | { |
| 474 | 474 | for (x = xstart; x != xend; x += xinc) |
| 475 | 475 | { |
| 476 | pdrawgfx(bitmap, machine->gfx[gfxnum], | |
| 476 | pdrawgfx_transpen(bitmap, &clip, | |
| 477 | machine->gfx[gfxnum], | |
| 477 | 478 | code++, |
| 478 | 479 | color, |
| 479 | 480 | flipx, flipy, |
| 480 | 481 | sx + x * 8, sy + y * 8, |
| 481 | &clip, | |
| 482 | TRANSPARENCY_PEN, 0, primask); | |
| 482 | priority_bitmap, primask, 0); | |
| 483 | 483 | } |
| 484 | 484 | code += (0x100/8) - xnum; |
| 485 | 485 | } |
| r5077 | r5078 | |
|---|---|---|
| 242 | 242 | flipy = !flipy; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | drawgfx(bitmap,machine->gfx[0], | |
| 245 | drawgfx_transpen(bitmap,cliprect, | |
| 246 | machine->gfx[0], | |
| 246 | 247 | code, |
| 247 | 248 | color, |
| 248 | 249 | flipx,flipy, |
| 249 | sx,sy, | |
| 250 | cliprect, | |
| 251 | TRANSPARENCY_PEN,15); | |
| 250 | sx,sy,15); | |
| 252 | 251 | } |
| 253 | 252 | } |
| 254 | 253 |
| r5077 | r5078 | |
|---|---|---|
| 99 | 99 | realy = ypos+incy*y; |
| 100 | 100 | realnumber = number+x+y*16; |
| 101 | 101 | |
| 102 | drawgfx(bitmap,gfx,realnumber,colr,flipx,flipy,realx,realy | |
| 102 | drawgfx_transpen(bitmap,cliprect,gfx,realnumber,colr,flipx,flipy,realx,realy | |
| 103 | 103 | |
| 104 | 104 | } |
| 105 | 105 | } |
| r5077 | r5078 | |
|---|---|---|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (color) |
| 119 | drawgfx(bitmap,machine->gfx[1], | |
| 119 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 120 | 120 | tile, |
| 121 | 121 | color, |
| 122 | 122 | fx,fy, |
| 123 | mx,my, | |
| 124 | cliprect,TRANSPARENCY_PEN,0); | |
| 123 | mx,my,0); | |
| 125 | 124 | |
| 126 | 125 | if (flipscreen) |
| 127 | 126 | my=(my-16)&0x1ff; |
| r5077 | r5078 | |
| 257 | 256 | } |
| 258 | 257 | |
| 259 | 258 | if (color) |
| 260 | drawgfx(bitmap,machine->gfx[1], | |
| 259 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 261 | 260 | tile, |
| 262 | 261 | color, |
| 263 | 262 | fx,fy, |
| 264 | mx,my, | |
| 265 | cliprect,TRANSPARENCY_PEN,0); | |
| 263 | mx,my,0); | |
| 266 | 264 | |
| 267 | 265 | if (flipscreen) |
| 268 | 266 | my=(my-16)&0x1ff; |
| r5077 | r5078 | |
| 350 | 348 | fy = data & 0x4000; |
| 351 | 349 | color = color_prom[tile<<1|data>>15]; |
| 352 | 350 | |
| 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); | |
| 355 | 352 | |
| 356 | 353 | my = (my + 8) & 0xff; |
| 357 | 354 | } |
| r5077 | r5078 | |
| 473 | 470 | |
| 474 | 471 | tile = (data>>3 & 0x400) | (data & 0x3ff); |
| 475 | 472 | 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); | |
| 478 | 474 | } |
| 479 | 475 | } |
| 480 | 476 | //ZT |
| r5077 | r5078 | |
| 532 | 528 | color = (data>>7 & 0x18) | (data>>13 & 7); |
| 533 | 529 | tile = data & 0x3ff; |
| 534 | 530 | 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); | |
| 537 | 532 | } |
| 538 | 533 | //ZT |
| 539 | 534 | if(flipscreen) |
| r5077 | r5078 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | code = p[32 * l + 4 * i + j]; |
| 37 | 37 | |
| 38 | drawgfx(bitmap, machine->gfx[n], | |
| 38 | drawgfx_transpen(bitmap, cliprect, | |
| 39 | machine->gfx[n], | |
| 39 | 40 | code, |
| 40 | 41 | 0, |
| 41 | 42 | code & 0x80, 0, |
| 42 | 43 | x + 8 * j, |
| 43 | y + 8 * i, | |
| 44 | cliprect, | |
| 45 | TRANSPARENCY_PEN, 1); | |
| 44 | y + 8 * i, 1); | |
| 46 | 45 | |
| 47 | 46 | code = p[32 * r + 4 * i - j + 3]; |
| 48 | 47 | |
| 49 | drawgfx(bitmap, machine->gfx[n], | |
| 48 | drawgfx_transpen(bitmap, cliprect, | |
| 49 | machine->gfx[n], | |
| 50 | 50 | code, |
| 51 | 51 | 0, |
| 52 | 52 | !(code & 0x80), 0, |
| 53 | 53 | x + 8 * j + 32, |
| 54 | y + 8 * i, | |
| 55 | cliprect, | |
| 56 | TRANSPARENCY_PEN, 1); | |
| 54 | y + 8 * i, 1); | |
| 57 | 55 | } |
| 58 | 56 | } |
| 59 | 57 | } |
| r5077 | r5078 | |
| 73 | 71 | { |
| 74 | 72 | UINT8 code = boxer_tile_ram[32 * i + j]; |
| 75 | 73 | |
| 76 | drawgfx(bitmap, screen->machine->gfx[2], | |
| 74 | drawgfx_transpen(bitmap, cliprect, | |
| 75 | screen->machine->gfx[2], | |
| 77 | 76 | code, |
| 78 | 77 | 0, |
| 79 | 78 | code & 0x40, code & 0x40, |
| 80 | 79 | 8 * j + 4, |
| 81 | 8 * (i % 2) + 32 * (i / 2), | |
| 82 | cliprect, | |
| 83 | TRANSPARENCY_PEN, 0); | |
| 80 | 8 * (i % 2) + 32 * (i / 2), 0); | |
| 84 | 81 | } |
| 85 | 82 | } |
| 86 | 83 |
| r5077 | r5078 | |
|---|---|---|
| 55 | 55 | flipy = !flipy; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | drawgfx(bitmap,machine->gfx[1], | |
| 58 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 59 | 59 | code, |
| 60 | 60 | color, |
| 61 | 61 | flipx,flipy, |
| 62 | xpos,240-ypos, | |
| 63 | cliprect,TRANSPARENCY_PEN,0); | |
| 62 | xpos,240-ypos,0); | |
| 64 | 63 | } |
| 65 | 64 | } |
| 66 | 65 | |
| r5077 | r5078 | |
| 90 | 89 | flipy = !flipy; |
| 91 | 90 | } |
| 92 | 91 | |
| 93 | drawgfx(bitmap,machine->gfx[1], | |
| 92 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 94 | 93 | code, |
| 95 | 94 | color, |
| 96 | 95 | flipx,flipy, |
| 97 | xpos,240-ypos, | |
| 98 | cliprect,TRANSPARENCY_PEN,0); | |
| 96 | xpos,240-ypos,0); | |
| 99 | 97 | } |
| 100 | 98 | } |
| 101 | 99 | |
| r5077 | r5078 | |
| 126 | 124 | flipy = !flipy; |
| 127 | 125 | } |
| 128 | 126 | |
| 129 | drawgfx(bitmap,machine->gfx[1], | |
| 127 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 130 | 128 | code, |
| 131 | 129 | color, |
| 132 | 130 | flipx,flipy, |
| 133 | xpos,248-ypos, | |
| 134 | cliprect,TRANSPARENCY_PEN,0); | |
| 131 | xpos,248-ypos,0); | |
| 135 | 132 | } |
| 136 | 133 | } |
| 137 | 134 |
| r5077 | r5078 | |
|---|---|---|
| 556 | 556 | |
| 557 | 557 | static void |
| 558 | 558 | mydrawgfxzoom( |
| 559 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 559 | bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 560 | 560 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 561 | const rectangle *clip, | |
| 562 | 561 | int scalex, int scaley, int z, int prioverchar, int alpha ) |
| 563 | 562 | { |
| 564 | 563 | int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; |
| r5077 | r5078 | |
| 650 | 649 | } /* ApplyGamma */ |
| 651 | 650 | |
| 652 | 651 | static void |
| 653 | poly3d_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 ) | |
| 652 | poly3d_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 ) | |
| 654 | 653 | { |
| 655 | 654 | int flipx = 0; |
| 656 | 655 | int flipy = 0; |
| r5077 | r5078 | |
| 661 | 660 | clip.max_y = 480-1; |
| 662 | 661 | mydrawgfxzoom( |
| 663 | 662 | bitmap, |
| 663 | &clip, | |
| 664 | 664 | gfx, |
| 665 | 665 | tileNumber, |
| 666 | 666 | color, |
| 667 | 667 | flipx, flipy, |
| 668 | 668 | sx, sy, |
| 669 | &clip, | |
| 670 | 669 | (width<<16)/32, |
| 671 | 670 | (height<<16)/32, |
| 672 | 671 | zc, pri, 0xff - translucency ); |
| r5077 | r5078 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | /* draw pitcher */ |
| 75 | 75 | |
| 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); | |
| 78 | 78 | |
| 79 | 79 | /* draw ball */ |
| 80 | 80 |
| r5077 | r5078 | |
|---|---|---|
| 200 | 200 | { |
| 201 | 201 | int code = ((spriteram[offs + i + 1] & 0xf0) >> 4) + ((gfxbank & 1) << 4); |
| 202 | 202 | |
| 203 | drawgfx(bitmap,machine->gfx[3], | |
| 203 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 204 | 204 | code, |
| 205 | 205 | color, |
| 206 | 206 | 0,0, |
| 207 | sx,sy - 16, | |
| 208 | cliprect,TRANSPARENCY_PEN,0); | |
| 207 | sx,sy - 16,0); | |
| 209 | 208 | /* wraparound */ |
| 210 | drawgfx(bitmap,machine->gfx[3], | |
| 209 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 211 | 210 | code, |
| 212 | 211 | color, |
| 213 | 212 | 0,0, |
| 214 | sx - 256,sy - 16, | |
| 215 | cliprect,TRANSPARENCY_PEN,0); | |
| 213 | sx - 256,sy - 16,0); | |
| 216 | 214 | break; |
| 217 | 215 | } |
| 218 | 216 | |
| r5077 | r5078 | |
| 222 | 220 | int code = ((spriteram[offs + i + 1] & 0xf8) >> 3) + ((gfxbank & 1) << 5); |
| 223 | 221 | int bank = (spriteram[offs + i + 1] & 0x02) >> 1; |
| 224 | 222 | |
| 225 | drawgfx(bitmap,machine->gfx[4+bank], | |
| 223 | drawgfx_transpen(bitmap,cliprect,machine->gfx[4+bank], | |
| 226 | 224 | code, |
| 227 | 225 | color, |
| 228 | 226 | 0,0, |
| 229 | sx,sy - 16, | |
| 230 | cliprect,TRANSPARENCY_PEN,0); | |
| 227 | sx,sy - 16,0); | |
| 231 | 228 | } |
| 232 | 229 | else |
| 233 | 230 | { |
| 234 | 231 | int code = ((spriteram[offs + i + 1] & 0xf0) >> 4) + ((gfxbank & 1) << 4); |
| 235 | 232 | |
| 236 | drawgfx(bitmap,machine->gfx[2], | |
| 233 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 237 | 234 | code, |
| 238 | 235 | color, |
| 239 | 236 | 0,0, |
| 240 | sx,sy - 16, | |
| 241 | cliprect,TRANSPARENCY_PEN,0); | |
| 237 | sx,sy - 16,0); | |
| 242 | 238 | } |
| 243 | 239 | break; |
| 244 | 240 | |
| 245 | 241 | case 1: /* 8x8 */ |
| 246 | drawgfx(bitmap,machine->gfx[1], | |
| 242 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 247 | 243 | spriteram[offs + i + 1],// + 4 * (spriteram[offs + i + 2] & 0x10), |
| 248 | 244 | color, |
| 249 | 245 | 0,0, |
| 250 | sx,sy - 16, | |
| 251 | cliprect,TRANSPARENCY_PEN,0); | |
| 246 | sx,sy - 16,0); | |
| 252 | 247 | break; |
| 253 | 248 | |
| 254 | 249 | case 0: |
| r5077 | r5078 | |
|---|---|---|
| 1857 | 1857 | if (offs < 3*4) sy++; |
| 1858 | 1858 | |
| 1859 | 1859 | |
| 1860 | drawgfx(bitmap,machine->gfx[1], | |
| 1860 | drawgfx_transpen(bitmap,flipscreen_x ? spritevisibleareaflipx : spritevisiblearea,machine->gfx[1], | |
| 1861 | 1861 | code,color, |
| 1862 | 1862 | flipx,flipy, |
| 1863 | sx,sy, | |
| 1864 | flipscreen_x ? spritevisibleareaflipx : spritevisiblearea,TRANSPARENCY_PEN,0); | |
| 1863 | sx,sy,0); | |
| 1865 | 1864 | } |
| 1866 | 1865 | } |
| 1867 | 1866 |
| r5077 | r5078 | |
|---|---|---|
| 431 | 431 | int x = spriteram[offs + 0x20]; |
| 432 | 432 | int y = 240 - spriteram[offs + 0x10]; |
| 433 | 433 | |
| 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]); | |
| 436 | 435 | } |
| 437 | 436 | return 0; |
| 438 | 437 | } |
| r5077 | r5078 | |
| 476 | 475 | flipx = !flipx; |
| 477 | 476 | } |
| 478 | 477 | |
| 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); | |
| 481 | 479 | } |
| 482 | 480 | return 0; |
| 483 | 481 | } |
| r5077 | r5078 | |
| 507 | 505 | int x = spriteram[offs + 0x20]; |
| 508 | 506 | int y = 240 - spriteram[offs + 0x10]; |
| 509 | 507 | |
| 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); | |
| 512 | 509 | } |
| 513 | 510 | return 0; |
| 514 | 511 | } |
| r5077 | r5078 | |
| 544 | 541 | flipy = !flipy; |
| 545 | 542 | } |
| 546 | 543 | |
| 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]); | |
| 549 | 545 | } |
| 550 | 546 | return 0; |
| 551 | 547 | } |
| r5077 | r5078 | |
|---|---|---|
| 435 | 435 | zx = x + (((k+1)*zoomx)/2) - curx; |
| 436 | 436 | zy = y + (((j+1)*zoomy)/2) - cury; |
| 437 | 437 | |
| 438 | pdrawgfxzoom(bitmap, machine->gfx[0], | |
| 438 | pdrawgfxzoom_transpen(bitmap, cliprect,machine->gfx[0], | |
| 439 | 439 | code, |
| 440 | 440 | col, |
| 441 | 441 | flipx, flipy, |
| 442 | 442 | curx,cury, |
| 443 | cliprect,TRANSPARENCY_PEN,0, | |
| 444 | 443 | 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...? */ | |
| 446 | 445 | } |
| 447 | 446 | } |
| 448 | 447 | else |
| r5077 | r5078 | |
| 467 | 466 | zx = x + (((k+1)*zoomx)/4) - curx; |
| 468 | 467 | zy = y + (((j+1)*zoomy)/4) - cury; |
| 469 | 468 | |
| 470 | pdrawgfxzoom(bitmap, machine->gfx[0], | |
| 469 | pdrawgfxzoom_transpen(bitmap, cliprect,machine->gfx[0], | |
| 471 | 470 | code, |
| 472 | 471 | col, |
| 473 | 472 | flipx, flipy, |
| 474 | 473 | curx,cury, |
| 475 | cliprect,TRANSPARENCY_PEN,0, | |
| 476 | 474 | 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...? */ | |
| 478 | 476 | } |
| 479 | 477 | } |
| 480 | 478 | } |
| r5077 | r5078 | |
|---|---|---|
| 80 | 80 | for (yt = 0; yt < ytiles; yt++) { |
| 81 | 81 | for (xt = 0; xt < xtiles; xt++, code++) { |
| 82 | 82 | 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); | |
| 85 | 85 | 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); | |
| 89 | 89 | } |
| 90 | 90 | if (xtiles == 3) code += 1; |
| 91 | 91 | if (xtiles == 5) code += 3; |
| r5077 | r5078 | |
| 99 | 99 | for (yt = 0; yt < ytiles; yt++) { |
| 100 | 100 | for (xt = 0; xt < xtiles; xt++, code++) { |
| 101 | 101 | 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); | |
| 104 | 104 | 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); | |
| 108 | 108 | } |
| 109 | 109 | if (xtiles == 3) code += 1; |
| 110 | 110 | if (xtiles == 5) code += 3; |
| r5077 | r5078 | |
| 118 | 118 | for (yt = 0; yt < ytiles; yt++) { |
| 119 | 119 | for (xt = 0; xt < xtiles; xt++, code++) { |
| 120 | 120 | 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); | |
| 123 | 123 | 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); | |
| 127 | 127 | } |
| 128 | 128 | if (xtiles == 3) code += 1; |
| 129 | 129 | if (xtiles == 5) code += 3; |
| r5077 | r5078 | |
| 137 | 137 | for (yt = 0; yt < ytiles; yt++) { |
| 138 | 138 | for (xt = 0; xt < xtiles; xt++, code++) { |
| 139 | 139 | 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); | |
| 142 | 142 | 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); | |
| 146 | 146 | } |
| 147 | 147 | if (xtiles == 3) code += 1; |
| 148 | 148 | if (xtiles == 5) code += 3; |
| r5077 | r5078 | |
|---|---|---|
| 150 | 150 | if (code & 0x80) |
| 151 | 151 | x |= 0x100; |
| 152 | 152 | |
| 153 | drawgfx(bitmap, machine->gfx[2], | |
| 153 | drawgfx_transpen(bitmap, cliprect, machine->gfx[2], | |
| 154 | 154 | code ^ 7, |
| 155 | 155 | i, |
| 156 | 156 | !(code & 0x10), !(code & 0x08), |
| 157 | 496 - x, y - 31, | |
| 158 | cliprect, TRANSPARENCY_PEN, 0); | |
| 157 | 496 - x, y - 31, 0); | |
| 159 | 158 | } |
| 160 | 159 | } |
| 161 | 160 |
| r5077 | r5078 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | static int shadow_pen_mask, shadow_pen_shift; |
| 145 | 145 | |
| 146 | static void ssv_drawgfx( bitmap_t *bitmap, const gfx_element *gfx, | |
| 146 | static void ssv_drawgfx( bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, | |
| 147 | 147 | UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0, |
| 148 | | |
| 148 | | |
| 149 | 149 | { |
| 150 | 150 | const UINT8 *addr, *source; |
| 151 | 151 | UINT8 pen; |
| r5077 | r5078 | |
| 701 | 701 | { |
| 702 | 702 | for (ty = ystart; ty != yend; ty += yinc) |
| 703 | 703 | { |
| 704 | ssv_drawgfx( bitmap, | |
| 704 | ssv_drawgfx( bitmap, &clip, machine->gfx[gfx], | |
| 705 | 705 | code++, |
| 706 | 706 | color, |
| 707 | 707 | flipx, flipy, |
| 708 | 708 | sx + tx * 16, sy + ty * 8, |
| 709 | | |
| 709 | | |
| 710 | 710 | } /* ty */ |
| 711 | 711 | } /* tx */ |
| 712 | 712 | |
| r5077 | r5078 | |
| 890 | 890 | { |
| 891 | 891 | for (y = ystart; y != yend; y += yinc) |
| 892 | 892 | { |
| 893 | ssv_drawgfx( bitmap, | |
| 893 | ssv_drawgfx( bitmap, cliprect, machine->gfx[gfx], | |
| 894 | 894 | code++, |
| 895 | 895 | color, |
| 896 | 896 | flipx, flipy, |
| 897 | 897 | sx + x * 16, sy + y * 8, |
| 898 | | |
| 898 | | |
| 899 | 899 | } |
| 900 | 900 | } |
| 901 | 901 | |
| r5077 | r5078 | |
| 1067 | 1067 | { |
| 1068 | 1068 | for (y = ystart; y != yend; y += yinc) |
| 1069 | 1069 | { |
| 1070 | drawgfxzoom( | |
| 1070 | drawgfxzoom_transpen( bitmap, cliprect, machine->gfx[2], | |
| 1071 | 1071 | code++, |
| 1072 | 1072 | color, |
| 1073 | 1073 | flipx, flipy, |
| 1074 | 1074 | (sx + x * xdim) / 0x10000, (sy + y * ydim) / 0x10000, |
| 1075 | cliprect, TRANSPARENCY_PEN, 0, | |
| 1076 | xscale, yscale | |
| 1075 | xscale, yscale, 0 | |
| 1077 | 1076 | ); |
| 1078 | 1077 | } |
| 1079 | 1078 | } |
| r5077 | r5078 | |
|---|---|---|
| 201 | 201 | |
| 202 | 202 | while (multi >= 0) |
| 203 | 203 | { |
| 204 | drawgfx(bitmap,machine->gfx[3], | |
| 204 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 205 | 205 | sprite - multi * inc, |
| 206 | 206 | colour, |
| 207 | 207 | fx,fy, |
| 208 | x,y + mult * multi, | |
| 209 | cliprect,TRANSPARENCY_PEN,0); | |
| 208 | x,y + mult * multi,0); | |
| 210 | 209 | |
| 211 | 210 | multi--; |
| 212 | 211 | } |
| r5077 | r5078 | |
|---|---|---|
| 173 | 173 | flipy ^= 0x0080; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | drawgfxzoom( bitmap, machine -> gfx[0], | |
| 176 | drawgfxzoom_transpen( bitmap, cliprect, | |
| 177 | machine -> gfx[0], | |
| 177 | 178 | tile, |
| 178 | 179 | color, |
| 179 | 180 | flipx, flipy, |
| 180 | 181 | x, y, |
| 181 | cliprect, | |
| 182 | TRANSPARENCY_PEN, 0, | |
| 183 | zx, zy | |
| 182 | zx, zy, 0 | |
| 184 | 183 | ); |
| 185 | 184 | } |
| 186 | 185 | tile_offs ++; |
| r5077 | r5078 | |
|---|---|---|
| 501 | 501 | x -= 64; |
| 502 | 502 | y -= 78; |
| 503 | 503 | |
| 504 | drawgfxzoom(bitmap, | |
| 504 | drawgfxzoom_transmask(bitmap, | |
| 505 | cliprect, | |
| 505 | 506 | machine->gfx[gfx], |
| 506 | 507 | code, |
| 507 | 508 | color, |
| 508 | 509 | flipx, flipy, |
| 509 | 510 | x, y, |
| 510 | cliprect, | |
| 511 | TRANSPARENCY_PENS, | |
| 512 | colortable_get_transpen_mask(machine->colortable, machine->gfx[gfx], color, SPR_TRANS_COLOR), | |
| 513 | 511 | scalex, |
| 514 | scaley); | |
| 512 | scaley, | |
| 513 | colortable_get_transpen_mask(machine->colortable, machine->gfx[gfx], color, SPR_TRANS_COLOR)); | |
| 515 | 514 | } |
| 516 | 515 | } |
| 517 | 516 |
| r5077 | r5078 | |
|---|---|---|
| 196 | 196 | if (code&0x80) |
| 197 | 197 | code += (mightguy_vreg[0]&0x30)<<3; |
| 198 | 198 | |
| 199 | drawgfx(bitmap,machine->gfx[2], | |
| 199 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 200 | 200 | code, |
| 201 | 201 | color, |
| 202 | 202 | flipx,flipy, |
| 203 | sx,sy, | |
| 204 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 203 | sx,sy,0 ); | |
| 205 | 204 | } |
| 206 | 205 | } |
| 207 | 206 |
| r5077 | r5078 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | for (chain_pos = chain;chain_pos >= 0;chain_pos--) |
| 48 | 48 | { |
| 49 | drawgfx(bitmap, machine->gfx[0], | |
| 49 | drawgfx_transpen(bitmap, cliprect,machine->gfx[0], | |
| 50 | 50 | code, |
| 51 | 51 | col, |
| 52 | 52 | flipx, flipy, |
| 53 | curx,cury, | |
| 54 | cliprect,TRANSPARENCY_PEN,0); | |
| 53 | curx,cury,0); | |
| 55 | 54 | |
| 56 | 55 | /* wrap around y */ |
| 57 | drawgfx(bitmap, machine->gfx[0], | |
| 56 | drawgfx_transpen(bitmap, cliprect,machine->gfx[0], | |
| 58 | 57 | code, |
| 59 | 58 | col, |
| 60 | 59 | flipx, flipy, |
| 61 | curx,cury+256, | |
| 62 | cliprect,TRANSPARENCY_PEN,0); | |
| 60 | curx,cury+256,0); | |
| 63 | 61 | |
| 64 | 62 | code++; |
| 65 | 63 |
| r5077 | r5078 | |
|---|---|---|
| 697 | 697 | |
| 698 | 698 | gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width, 0, 256, 0); |
| 699 | 699 | |
| 700 | pdrawgfxzoom( bitmap,&gfx, | |
| 700 | pdrawgfxzoom_transpen( bitmap,cliprect, &gfx, | |
| 701 | 701 | 0, |
| 702 | 702 | color_start >> 4, |
| 703 | 703 | flipx, flipy, |
| 704 | 704 | x, y, |
| 705 | cliprect, TRANSPARENCY_PEN, 255, | |
| 706 | 705 | zoom, zoom, |
| 707 | primask[pri]); | |
| 706 | priority_bitmap,primask[pri], 255); | |
| 708 | 707 | } |
| 709 | 708 | else |
| 710 | 709 | { |
| r5077 | r5078 | |
| 714 | 713 | |
| 715 | 714 | gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width/2, 0, 16, GFX_ELEMENT_PACKED); |
| 716 | 715 | |
| 717 | pdrawgfxzoom( bitmap,&gfx, | |
| 716 | pdrawgfxzoom_transpen( bitmap,cliprect, &gfx, | |
| 718 | 717 | 0, |
| 719 | 718 | color + color_start, |
| 720 | 719 | flipx, flipy, |
| 721 | 720 | x, y, |
| 722 | cliprect, TRANSPARENCY_PEN, 15, | |
| 723 | 721 | zoom, zoom, |
| 724 | primask[pri]); | |
| 722 | priority_bitmap,primask[pri], 15); | |
| 725 | 723 | } |
| 726 | 724 | #if 0 |
| 727 | 725 | { /* Display priority + zoom on each sprite */ |
| r5077 | r5078 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | if (enable & enable_n) |
| 179 | 179 | { |
| 180 | drawgfx( | |
| 180 | drawgfx_transpen( | |
| 181 | 181 | bitmap, |
| 182 | cliprect, | |
| 182 | 183 | gfx, |
| 183 | 184 | tile_no, |
| 184 | 185 | color*4, |
| 185 | 186 | flipx,flipy, |
| 186 | xpos,ypos, | |
| 187 | cliprect, | |
| 188 | TRANSPARENCY_PEN,15 | |
| 187 | xpos,ypos,15 | |
| 189 | 188 | ); |
| 190 | 189 | /* wraparound */ |
| 191 | 190 | if (xpos > 240) |
| 192 | drawgfx( | |
| 191 | drawgfx_transpen( | |
| 193 | 192 | bitmap, |
| 193 | cliprect, | |
| 194 | 194 | gfx, |
| 195 | 195 | tile_no, |
| 196 | 196 | color*4, |
| 197 | 197 | flipx,flipy, |
| 198 | xpos-256,ypos, | |
| 199 | cliprect, | |
| 200 | TRANSPARENCY_PEN,15 | |
| 198 | xpos-256,ypos,15 | |
| 201 | 199 | ); |
| 202 | 200 | /* wraparound */ |
| 203 | 201 | if (ypos > 240) |
| 204 | 202 | { |
| 205 | drawgfx( | |
| 203 | drawgfx_transpen( | |
| 206 | 204 | bitmap, |
| 205 | cliprect, | |
| 207 | 206 | gfx, |
| 208 | 207 | tile_no, |
| 209 | 208 | color*4, |
| 210 | 209 | flipx,flipy, |
| 211 | xpos,ypos-256, | |
| 212 | cliprect, | |
| 213 | TRANSPARENCY_PEN,15 | |
| 210 | xpos,ypos-256,15 | |
| 214 | 211 | ); |
| 215 | 212 | /* wraparound */ |
| 216 | 213 | if (xpos > 240) |
| 217 | drawgfx( | |
| 214 | drawgfx_transpen( | |
| 218 | 215 | bitmap, |
| 216 | cliprect, | |
| 219 | 217 | gfx, |
| 220 | 218 | tile_no, |
| 221 | 219 | color*4, |
| 222 | 220 | flipx,flipy, |
| 223 | xpos-256,ypos-256, | |
| 224 | cliprect, | |
| 225 | TRANSPARENCY_PEN,15 | |
| 221 | xpos-256,ypos-256,15 | |
| 226 | 222 | ); |
| 227 | 223 | } |
| 228 | 224 |
| r5077 | r5078 | |
|---|---|---|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| 197 | drawgfx(bitmap,machine->gfx[1], | |
| 197 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 198 | 198 | code, color, |
| 199 | 199 | flipx,flipy, |
| 200 | 200 | sx,sy, |
| 201 | cliprect,TRANSPARENCY_PENS, | |
| 202 | 201 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 203 | 202 | } |
| 204 | 203 | } |
| r5077 | r5078 | |
|---|---|---|
| 155 | 155 | flipy = !flipy; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | drawgfx(bitmap, machine->gfx[gfxbank], | |
| 158 | drawgfx_transpen(bitmap, cliprect, | |
| 159 | machine->gfx[gfxbank], | |
| 159 | 160 | code, color, |
| 160 | 161 | flipx,flipy, |
| 161 | sx,sy, | |
| 162 | cliprect, | |
| 163 | TRANSPARENCY_PEN, 0); | |
| 162 | sx,sy, 0); | |
| 164 | 163 | } |
| 165 | 164 | } |
| 166 | 165 |
| r5077 | r5078 | |
|---|---|---|
| 246 | 246 | flipy = !flipy; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | drawgfx(bitmap,machine->gfx[1], | |
| 249 | drawgfx_transpen(bitmap,&clip,machine->gfx[1], | |
| 250 | 250 | (spriteram_2[offs + 2] & 0x3f) + (spriteram_2[offs + 1] & 0xc0), |
| 251 | 251 | 4 * (spriteram_2[offs + 1] & 0x07), |
| 252 | 252 | flipx,flipy, |
| 253 | sx,sy, | |
| 254 | &clip,TRANSPARENCY_PEN,0); | |
| 253 | sx,sy,0); | |
| 255 | 254 | } |
| 256 | 255 | |
| 257 | 256 | for (offs = 0;offs < spriteram_size;offs += 4) |
| r5077 | r5078 | |
| 272 | 271 | flipy = !flipy; |
| 273 | 272 | } |
| 274 | 273 | |
| 275 | drawgfx(bitmap,machine->gfx[1], | |
| 274 | drawgfx_transpen(bitmap,&clip,machine->gfx[1], | |
| 276 | 275 | (spriteram[offs + 1] & 0x3f) + (spriteram[offs + 2] & 0xc0), |
| 277 | 276 | 4 * (spriteram[offs + 2] & 0x07), |
| 278 | 277 | flipx,flipy, |
| 279 | sx,sy, | |
| 280 | &clip,TRANSPARENCY_PEN,0); | |
| 278 | sx,sy,0); | |
| 281 | 279 | } |
| 282 | 280 | } |
| 283 | 281 |
| r5077 | r5078 | |
|---|---|---|
| 190 | 190 | tile_flipy = !tile_flipy; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | drawgfx( bitmap, machine->gfx[gfx], | |
| 193 | drawgfx_transpen( bitmap, cliprect,machine->gfx[gfx], | |
| 194 | 194 | (tile & 0x3fff) + bank*0x4000, |
| 195 | 195 | attr + (color_bank << 4), |
| 196 | 196 | tile_flipx, tile_flipy, |
| 197 | sx, sy, | |
| 198 | cliprect,TRANSPARENCY_PEN,15 ); | |
| 197 | sx, sy,15 ); | |
| 199 | 198 | |
| 200 | 199 | tile_x += tile_xinc; |
| 201 | 200 | } |
| r5077 | r5078 | |
|---|---|---|
| 109 | 109 | flipx = flipy = 1; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | drawgfx (bitmap,machine->gfx[2], | |
| 112 | drawgfx_transpen (bitmap,cliprect,machine->gfx[2], | |
| 113 | 113 | code, |
| 114 | 114 | color, |
| 115 | 115 | flipx,flipy, |
| 116 | x,y, | |
| 117 | cliprect,TRANSPARENCY_PEN,0); | |
| 116 | x,y,0); | |
| 118 | 117 | } |
| 119 | 118 | } |
| 120 | 119 |
| r5077 | r5078 | |
|---|---|---|
| 139 | 139 | height++; |
| 140 | 140 | if (enable) { |
| 141 | 141 | 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); | |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | source-=8; |
| r5077 | r5078 | |
|---|---|---|
| 157 | 157 | flipy = !flipy; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | drawgfx(bitmap, machine->gfx[1], | |
| 160 | drawgfx_transpen(bitmap, cliprect, | |
| 161 | machine->gfx[1], | |
| 161 | 162 | code, color, |
| 162 | 163 | flipx, flipy, |
| 163 | sx, sy, | |
| 164 | cliprect, | |
| 165 | TRANSPARENCY_PEN, 0); | |
| 164 | sx, sy, 0); | |
| 166 | 165 | |
| 167 | 166 | /* Wrap around */ |
| 168 | 167 | |
| r5077 | r5078 | |
| 170 | 169 | color = palettebank; |
| 171 | 170 | sy += (flip_screen_get(machine) ? -256 : 256); |
| 172 | 171 | |
| 173 | drawgfx(bitmap, machine->gfx[1], | |
| 172 | drawgfx_transpen(bitmap, cliprect, | |
| 173 | machine->gfx[1], | |
| 174 | 174 | code, color, |
| 175 | 175 | flipx, flipy, |
| 176 | sx, sy, | |
| 177 | cliprect, | |
| 178 | TRANSPARENCY_PEN, 0); | |
| 176 | sx, sy, 0); | |
| 179 | 177 | } |
| 180 | 178 | } |
| 181 | 179 |
| r5077 | r5078 | |
|---|---|---|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (spriteram[offs + 2] && spriteram[offs + 3]) |
| 136 | drawgfx(bitmap,machine->gfx[1], | |
| 136 | drawgfx_transpen(bitmap,/* compensate misplacement */ | |
| 137 | cliprect,machine->gfx[1], | |
| 137 | 138 | (spriteram[offs] & 0x3f) + 2 * (spriteram[offs + 1] & 0x20), |
| 138 | 139 | spriteram[offs + 1] & 0x1f, |
| 139 | 140 | flipx,flipy, |
| 140 | sx,sy+1, /* compensate misplacement */ | |
| 141 | cliprect,TRANSPARENCY_PEN,0); | |
| 141 | sx,sy+1,0); | |
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 |
| r5077 | r5078 | |
|---|---|---|
| 79 | 79 | sx = bigevglf_spriteram2[i+3]; |
| 80 | 80 | sy = 200-bigevglf_spriteram2[i]; |
| 81 | 81 | for(j=0;j<16;j++) |
| 82 | drawgfx(bitmap,machine->gfx[0], | |
| 82 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 83 | 83 | bigevglf_spriteram1[(code<<4)+j]+((bigevglf_spriteram1[0x400+(code<<4)+j]&0xf)<<8), |
| 84 | 84 | bigevglf_spriteram2[i+2] & 0xf, |
| 85 | 85 | 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); | |
| 88 | 87 | } |
| 89 | 88 | } |
| 90 | 89 |
| r5077 | r5078 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | code = ((inufuku_spriteram2[map_start] & 0x0007) << 16) + inufuku_spriteram2[map_start + 1]; |
| 145 | 145 | |
| 146 | pdrawgfxzoom(bitmap, machine->gfx[2], | |
| 146 | pdrawgfxzoom_transpen(bitmap, cliprect, machine->gfx[2], | |
| 147 | 147 | code, |
| 148 | 148 | color, |
| 149 | 149 | flipx, flipy, |
| 150 | 150 | sx - 16, sy - 16, |
| 151 | cliprect, TRANSPARENCY_PEN, 15, | |
| 152 | 151 | zoomx << 11, zoomy << 11, |
| 153 | priority_mask); | |
| 152 | priority_bitmap,priority_mask, 15); | |
| 154 | 153 | |
| 155 | 154 | map_start += 2; |
| 156 | 155 | } |
| r5077 | r5078 | |
|---|---|---|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | 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); | |
| 126 | 125 | } |
| 127 | 126 | } |
| 128 | 127 |
| r5077 | r5078 | |
|---|---|---|
| 197 | 197 | sx -= 8; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | drawgfxzoom(bitmap,machine->gfx[1], | |
| 200 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1], | |
| 201 | 201 | charcode, color, |
| 202 | 202 | xflip,yflip,sx,sy, |
| 203 | cliprect,TRANSPARENCY_PEN,0, | |
| 204 | wide ? 0x20000 : 0x10000, 0x10000); | |
| 203 | wide ? 0x20000 : 0x10000, 0x10000,0); | |
| 205 | 204 | } |
| 206 | 205 | } |
| 207 | 206 |
| r5077 | r5078 | |
|---|---|---|
| 410 | 410 | { |
| 411 | 411 | int const tile = code ^ (x << big_xshift) ^ (y << big_yshift); |
| 412 | 412 | |
| 413 | drawgfx(bitmap, gfx, | |
| 413 | drawgfx_transpen(bitmap, 0, gfx, | |
| 414 | 414 | tile, |
| 415 | 415 | color, |
| 416 | 416 | flipx,flipy, |
| 417 | sx + 16*x, sy + 16*y, | |
| 418 | 0, TRANSPARENCY_PEN, 15); | |
| 417 | sx + 16*x, sy + 16*y, 15); | |
| 419 | 418 | |
| 420 | 419 | ++sprites_drawn; |
| 421 | 420 | if (sprites_drawn >= 96) |
| r5077 | r5078 | |
|---|---|---|
| 314 | 314 | /* this may not be correct */ |
| 315 | 315 | ypos = ypos + (22 - 8); |
| 316 | 316 | |
| 317 | drawgfx(bitmap, machine->gfx[image], | |
| 317 | drawgfx_transpen(bitmap, cliprect, | |
| 318 | machine->gfx[image], | |
| 318 | 319 | 0, 0, |
| 319 | 320 | flip_screen_get(machine), |
| 320 | 321 | flip_screen_get(machine), |
| 321 | 322 | xpos, |
| 322 | ypos, | |
| 323 | cliprect, | |
| 324 | TRANSPARENCY_PEN, 0); | |
| 323 | ypos, 0); | |
| 325 | 324 | |
| 326 | drawgfx(bitmap, machine->gfx[image], | |
| 325 | drawgfx_transpen(bitmap, cliprect, | |
| 326 | machine->gfx[image], | |
| 327 | 327 | 0, 0, |
| 328 | 328 | flip_screen_get(machine), |
| 329 | 329 | flip_screen_get(machine), |
| 330 | 330 | xpos - 256, |
| 331 | ypos, | |
| 332 | cliprect, | |
| 333 | TRANSPARENCY_PEN, 0); | |
| 331 | ypos, 0); | |
| 334 | 332 | |
| 335 | 333 | rect.min_x = visarea->min_x; |
| 336 | 334 | rect.max_x = visarea->max_x; |
| r5077 | r5078 | |
| 419 | 417 | clip = *cliprect; |
| 420 | 418 | #endif |
| 421 | 419 | |
| 422 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 420 | drawgfx_transmask(bitmap, &clip, screen->machine->gfx[1], | |
| 423 | 421 | code, color, flipx, flipy, sx, sy, |
| 424 | &clip, TRANSPARENCY_PENS, | |
| 425 | 422 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 512+32)); |
| 426 | 423 | } |
| 427 | 424 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | while (multi >= 0) |
| 123 | 123 | { |
| 124 | drawgfx(bitmap,machine->gfx[3], | |
| 124 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 125 | 125 | sprite - multi * inc, |
| 126 | 126 | colour, |
| 127 | 127 | fx,fy, |
| 128 | x,y + mult * multi, | |
| 129 | cliprect,TRANSPARENCY_PEN,0); | |
| 128 | x,y + mult * multi,0); | |
| 130 | 129 | |
| 131 | 130 | multi--; |
| 132 | 131 | } |
| r5077 | r5078 | |
|---|---|---|
| 136 | 136 | flipy = !flipy; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | drawgfx(bitmap,gfx, | |
| 139 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 140 | 140 | buffered_spriteram[offs] + ((attributes<<2) & 0x300), |
| 141 | 141 | (attributes >> 4) & 3, |
| 142 | 142 | flipx,flipy, |
| 143 | sx,sy, | |
| 144 | cliprect,TRANSPARENCY_PEN,15); | |
| 143 | sx,sy,15); | |
| 145 | 144 | } |
| 146 | 145 | } |
| 147 | 146 |
| r5077 | r5078 | |
|---|---|---|
| 60 | 60 | return MAKE_RGB(r,g,b); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | void jal_blend_drawgfx( | |
| 63 | void jal_blend_drawgfx( | |
| 64 | 64 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 65 | | |
| 65 | | |
| 66 | 66 | { |
| 67 | 67 | if (jal_blend_table == NULL) |
| 68 | 68 | { |
| r5077 | r5078 | |
| 73 | 73 | /* Start drawing */ |
| 74 | 74 | if (gfx) |
| 75 | 75 | { |
| 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)]; | |
| 77 | 77 | const UINT8 *alpha = &jal_blend_table[gfx->color_granularity * (color % gfx->total_colors)]; |
| 78 | 78 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 79 | 79 | int x_index_base, y_index, sx, sy, ex, ey; |
| r5077 | r5078 | |
|---|---|---|
| 1 | 1 | extern UINT8 *jal_blend_table; |
| 2 | 2 | rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha); |
| 3 | void jal_blend_drawgfx( | |
| 3 | void jal_blend_drawgfx( | |
| 4 | 4 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 5 | | |
| 5 | |
| r5077 | r5078 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | sy = 240 - spriteram[offs + 1]; |
| 129 | 129 | |
| 130 | drawgfx( bitmap, machine->gfx[17], code, | |
| 130 | drawgfx_transpen( bitmap, cliprect,machine->gfx[17], code, | |
| 131 | 131 | flags >> 4, /* color */ |
| 132 | 132 | bank & 1, /* flipx */ |
| 133 | 133 | bank & 2, /* flipy */ |
| 134 | 134 | sx, |
| 135 | sy, | |
| 136 | cliprect,TRANSPARENCY_PEN,15 ); | |
| 135 | sy,15 ); | |
| 137 | 136 | } |
| 138 | 137 | } |
| 139 | 138 | } |
| r5077 | r5078 | |
|---|---|---|
| 226 | 226 | |
| 227 | 227 | if (sx >= 256-8) sx -= 256; |
| 228 | 228 | |
| 229 | drawgfx(bitmap,gfx, | |
| 229 | drawgfx_transpen(bitmap,&clip,gfx, | |
| 230 | 230 | code, |
| 231 | 231 | color, |
| 232 | 232 | flipx,flipy, |
| 233 | sx,sy, | |
| 234 | &clip,TRANSPARENCY_PEN,0); | |
| 233 | sx,sy,0); | |
| 235 | 234 | } |
| 236 | 235 | } |
| 237 | 236 |
| r5077 | r5078 | |
|---|---|---|
| 132 | 132 | sy = 240 - sy; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | drawgfx(bitmap,machine->gfx[1], | |
| 135 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 136 | 136 | code, |
| 137 | 137 | color, |
| 138 | 138 | flipx,flipy, |
| 139 | 2*sx,2*sy, | |
| 140 | cliprect,TRANSPARENCY_PEN,0); | |
| 139 | 2*sx,2*sy,0); | |
| 141 | 140 | } |
| 142 | 141 | } |
| 143 | 142 | |
| r5077 | r5078 | |
| 170 | 169 | sy = 240 - sy; |
| 171 | 170 | } |
| 172 | 171 | |
| 173 | drawgfx(bitmap,machine->gfx[1], | |
| 172 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 174 | 173 | code, |
| 175 | 174 | color, |
| 176 | 175 | flipx,flipy, |
| 177 | sx,sy, | |
| 178 | cliprect,TRANSPARENCY_PEN,0); | |
| 176 | sx,sy,0); | |
| 179 | 177 | } |
| 180 | 178 | } |
| 181 | 179 |
| r5077 | r5078 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | ***************************************************************************/ |
| 153 | 153 | |
| 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); | |
| 157 | 157 | |
| 158 | 158 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) |
| 159 | 159 | { |
| r5077 | r5078 | |
|---|---|---|
| 75 | 75 | tile = videoram[tile_index] + ((colorram[tile_index] & 0x7) << 8); |
| 76 | 76 | color = (colorram[tile_index] & 0x70) >> 4; |
| 77 | 77 | |
| 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 | ||
| 83 | 78 | SET_TILE_INFO(0, tile, color, 0); |
| 84 | 79 | } |
| 85 | 80 | |
| 81 | static 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 | ||
| 86 | 94 | /***************************************************************************/ |
| 87 | 95 | |
| 88 | 96 | WRITE8_HANDLER( deco16_io_w ) |
| r5077 | r5078 | |
| 152 | 160 | { |
| 153 | 161 | case 0: |
| 154 | 162 | //background_disable = ~data & 0x80; |
| 163 | flip_screen_set(space->machine, data & 0x80); | |
| 164 | tilemap_mark_all_tiles_dirty(background_tilemap); | |
| 155 | 165 | break; |
| 156 | 166 | case 2: /* Sound */ |
| 157 | 167 | soundlatch_w(space, 0, data); |
| r5077 | r5078 | |
| 175 | 185 | tilemap_mark_tile_dirty(fix_tilemap, offset); |
| 176 | 186 | } |
| 177 | 187 | |
| 188 | WRITE8_HANDLER( prosport_bg_vram_w ) | |
| 189 | { | |
| 190 | prosport_bg_vram[offset] = data; | |
| 191 | tilemap_mark_tile_dirty(background_tilemap, offset); | |
| 192 | } | |
| 193 | ||
| 178 | 194 | /***************************************************************************/ |
| 179 | 195 | |
| 180 | 196 | VIDEO_START( prosoccr ) |
| r5077 | r5078 | |
| 185 | 201 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 186 | 202 | |
| 187 | 203 | prosoccr_charram = auto_alloc_array(machine, UINT8, 0x1800*2); |
| 188 | ||
| 189 | 204 | } |
| 190 | 205 | |
| 191 | 206 | VIDEO_START( boomrang ) |
| r5077 | r5078 | |
| 205 | 220 | tilemap_set_transparent_pen(fix_tilemap,0); |
| 206 | 221 | } |
| 207 | 222 | |
| 223 | VIDEO_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 | ||
| 208 | 231 | /***************************************************************************/ |
| 209 | 232 | |
| 210 | 233 | WRITE8_HANDLER( prosport_paletteram_w ) |
| r5077 | r5078 | |
| 299 | 322 | sy2=sy+16; |
| 300 | 323 | } |
| 301 | 324 | |
| 302 | drawgfx(bitmap,machine->gfx[1], | |
| 325 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 303 | 326 | code, |
| 304 | 327 | color, |
| 305 | 328 | fx,fy, |
| 306 | sx,sy, | |
| 307 | cliprect,TRANSPARENCY_PEN,0); | |
| 329 | sx,sy,0); | |
| 308 | 330 | if (multi) |
| 309 | drawgfx(bitmap,machine->gfx[1], | |
| 331 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 310 | 332 | code+1, |
| 311 | 333 | color, |
| 312 | 334 | fx,fy, |
| 313 | sx,sy2, | |
| 314 | cliprect,TRANSPARENCY_PEN,0); | |
| 335 | sx,sy2,0); | |
| 315 | 336 | } |
| 316 | 337 | } |
| 317 | 338 | |
| r5077 | r5078 | |
| 342 | 363 | |
| 343 | 364 | color = 1;//(deco16_io_ram[4] & 2)+1;//(spriteram[offs+0]&0x4)>>2; |
| 344 | 365 | |
| 345 | fx = spriteram[offs+0] & 0x02; | |
| 346 | fy = spriteram[offs+0] & 0x04; | |
| 366 | fy = spriteram[offs+0] & 0x02; | |
| 367 | fx = spriteram[offs+0] & 0x04; | |
| 347 | 368 | multi = 0;// spriteram[offs+0] & 0x10; |
| 348 | 369 | |
| 349 | 370 | // if (multi) sy-=16; |
| r5077 | r5078 | |
| 362 | 383 | sy2=sy+16; |
| 363 | 384 | } |
| 364 | 385 | |
| 365 | drawgfx(bitmap,machine->gfx[gfx_region], | |
| 386 | drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region], | |
| 366 | 387 | code, |
| 367 | 388 | color, |
| 368 | 389 | fx,fy, |
| 369 | sx,sy, | |
| 370 | cliprect,TRANSPARENCY_PEN,0); | |
| 390 | sx,sy,0); | |
| 371 | 391 | if (multi) |
| 372 | drawgfx(bitmap,machine->gfx[gfx_region], | |
| 392 | drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region], | |
| 373 | 393 | code2, |
| 374 | 394 | color, |
| 375 | 395 | fx,fy, |
| 376 | sx,sy2, | |
| 377 | cliprect,TRANSPARENCY_PEN,0); | |
| 396 | sx,sy2,0); | |
| 378 | 397 | } |
| 379 | 398 | } |
| 380 | 399 | |
| r5077 | r5078 | |
| 420 | 439 | sy2=sy+16; |
| 421 | 440 | } |
| 422 | 441 | |
| 423 | drawgfx(bitmap,machine->gfx[1], | |
| 442 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 424 | 443 | code, |
| 425 | 444 | color, |
| 426 | 445 | fx,fy, |
| 427 | sx,sy, | |
| 428 | cliprect,TRANSPARENCY_PEN,0); | |
| 446 | sx,sy,0); | |
| 429 | 447 | if (multi) |
| 430 | drawgfx(bitmap,machine->gfx[1], | |
| 448 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 431 | 449 | code2, |
| 432 | 450 | color, |
| 433 | 451 | fx,fy, |
| 434 | sx,sy2, | |
| 435 | cliprect,TRANSPARENCY_PEN,0); | |
| 452 | sx,sy2,0); | |
| 436 | 453 | } |
| 437 | 454 | } |
| 438 | 455 | |
| r5077 | r5078 | |
| 450 | 467 | fx = spriteram[offs+0] & 4; |
| 451 | 468 | fy = spriteram[offs+0] & 2; |
| 452 | 469 | |
| 453 | drawgfx(bitmap,machine->gfx[1], | |
| 470 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 454 | 471 | code, |
| 455 | 472 | 0, |
| 456 | 473 | fx,fy, |
| 457 | sx,sy, | |
| 458 | cliprect,TRANSPARENCY_PEN,0); | |
| 474 | sx,sy,0); | |
| 459 | 475 | } |
| 460 | 476 | } |
| 461 | 477 | |
| r5077 | r5078 | |
| 480 | 496 | VIDEO_UPDATE( prosport ) |
| 481 | 497 | { |
| 482 | 498 | int mx,my,tile,offs,gfx_region; |
| 483 | int scrollx; | |
| 499 | int scrollx,scrolly; | |
| 484 | 500 | |
| 485 | 501 | bitmap_fill(bitmap,cliprect,0); |
| 486 | 502 | |
| 487 | // popmessage("%d",scrollx); | |
| 488 | ||
| 489 | 503 | 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]); | |
| 492 | 507 | |
| 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); | |
| 499 | 510 | |
| 500 | if(deco16_io_ram[0]&0x20) | |
| 501 | tile+=0x20; | |
| 511 | tilemap_draw(bitmap,cliprect,background_tilemap,0,0); | |
| 502 | 512 | |
| 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 | ||
| 538 | 513 | // 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] |
| 539 | 514 | // ,deco16_io_ram[4],deco16_io_ram[5],deco16_io_ram[6],deco16_io_ram[7]); |
| 540 | 515 | |
| r5077 | r5078 | |
| 550 | 525 | my = (offs) % 32; |
| 551 | 526 | mx = (offs) / 32; |
| 552 | 527 | |
| 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); | |
| 556 | 530 | } |
| 557 | 531 | |
| 558 | 532 | prosport_draw_sprites(screen->machine,bitmap,cliprect); |
| r5077 | r5078 | |
|---|---|---|
| 175 | 175 | flipy = !flipy; |
| 176 | 176 | } |
| 177 | 177 | |
| 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); | |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 |
| r5077 | r5078 | |
|---|---|---|
| 235 | 235 | |
| 236 | 236 | int gfxnum = (code < ram_based_char_start_indices[character_banking_mode]) ? 0 : 1; |
| 237 | 237 | |
| 238 | drawgfx(background_bitmap, screen->machine->gfx[gfxnum], | |
| 238 | drawgfx_opaque(background_bitmap, 0, screen->machine->gfx[gfxnum], | |
| 239 | 239 | code, color, |
| 240 | 240 | 0, 0, |
| 241 | x, y, | |
| 242 | 0, TRANSPARENCY_NONE, 0); | |
| 241 | x, y); | |
| 243 | 242 | |
| 244 | 243 | /* foreground for collision detection */ |
| 245 | 244 | if (color & 0x80) |
| r5077 | r5078 | |
| 252 | 251 | collision_color = 0x102; |
| 253 | 252 | } |
| 254 | 253 | |
| 255 | drawgfx(cvs_collision_background, screen->machine->gfx[gfxnum], | |
| 254 | drawgfx_opaque(cvs_collision_background, 0, screen->machine->gfx[gfxnum], | |
| 256 | 255 | code, collision_color, |
| 257 | 256 | 0, 0, |
| 258 | x, y, | |
| 259 | 0, TRANSPARENCY_NONE, 0); | |
| 257 | x, y); | |
| 260 | 258 | } |
| 261 | 259 | |
| 262 | 260 |
| r5077 | r5078 | |
|---|---|---|
| 801 | 801 | color = ( color >> (16-5) ) % total_color_codes; |
| 802 | 802 | code = (code & 0x3fff) + (bank * 0x4000); |
| 803 | 803 | |
| 804 | drawgfx(bitmap,machine->gfx[0], | |
| 804 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 805 | 805 | code, |
| 806 | 806 | color, |
| 807 | 807 | 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); | |
| 810 | 809 | } |
| 811 | 810 | /* next column */ |
| 812 | 811 | } |
| r5077 | r5078 | |
| 863 | 862 | |
| 864 | 863 | y = max_y - y; |
| 865 | 864 | |
| 866 | drawgfx(bitmap,machine->gfx[0], | |
| 865 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 867 | 866 | code, |
| 868 | 867 | color, |
| 869 | 868 | 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); | |
| 872 | 870 | } |
| 873 | 871 | |
| 874 | 872 | } |
| r5077 | r5078 | |
|---|---|---|
| 172 | 172 | if ((sy == 0) && (code == 0)) sy += 240; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | drawgfx(bitmap,machine->gfx[0], | |
| 175 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 176 | 176 | code, |
| 177 | 177 | color, |
| 178 | 178 | flipx,flipy, |
| 179 | sx,sy+2, | |
| 180 | cliprect,TRANSPARENCY_PEN,0); | |
| 179 | sx,sy+2,0); | |
| 181 | 180 | |
| 182 | 181 | /* wrap around x */ |
| 183 | drawgfx(bitmap,machine->gfx[0], | |
| 182 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 184 | 183 | code, |
| 185 | 184 | color, |
| 186 | 185 | flipx,flipy, |
| 187 | sx + 512,sy+2, | |
| 188 | cliprect,TRANSPARENCY_PEN,0); | |
| 186 | sx + 512,sy+2,0); | |
| 189 | 187 | } |
| 190 | 188 | } |
| 191 | 189 |
| r5077 | r5078 | |
|---|---|---|
| 173 | 173 | int flip_x = ~tp84_spriteram[offs + 2] & 0x40; |
| 174 | 174 | int flip_y = tp84_spriteram[offs + 2] & 0x80; |
| 175 | 175 | |
| 176 | drawgfx(bitmap, machine->gfx[1], code, color, flip_x, flip_y, x, y | |
| 176 | drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flip_x, flip_y, x, y | |
| 177 | 177 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, palette_base)); |
| 178 | 178 | |
| 179 | 179 | } |
| r5077 | r5078 | |
|---|---|---|
| 111 | 111 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 112 | 112 | } |
| 113 | 113 | |
| 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); | |
| 117 | 117 | |
| 118 | 118 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 119 | 119 | { |
| r5077 | r5078 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | while (multi >= 0) |
| 132 | 132 | { |
| 133 | pdrawgfx(bitmap,machine->gfx[3], | |
| 133 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 134 | 134 | sprite - multi * inc, |
| 135 | 135 | colour, |
| 136 | 136 | fx,fy, |
| 137 | 137 | x,y + mult * multi, |
| 138 | | |
| 138 | | |
| 139 | 139 | |
| 140 | 140 | multi--; |
| 141 | 141 | } |
| r5077 | r5078 | |
| 416 | 416 | |
| 417 | 417 | for (x=0; x<w; x++) { |
| 418 | 418 | for (y=0; y<h; y++) { |
| 419 | deco16_pdrawgfx(machine, | |
| 420 | bitmap,machine->gfx[gfxbank], | |
| 419 | deco16_pdrawgfx( | |
| 420 | bitmap,cliprect,machine->gfx[gfxbank], | |
| 421 | 421 | sprite + y + h * x, |
| 422 | 422 | colour, |
| 423 | 423 | fx,fy, |
| 424 | 424 | sx + x_mult * (w-x),sy + y_mult * (h-y), |
| 425 | | |
| 425 | | |
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 |
| r5077 | r5078 | |
|---|---|---|
| 122 | 122 | flipy = !flipy; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | drawgfx(bitmap,machine->gfx[1], | |
| 125 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 126 | 126 | code, |
| 127 | 127 | col, |
| 128 | 128 | flipx,flipy, |
| 129 | sx,sy, | |
| 130 | cliprect,TRANSPARENCY_PEN,15); | |
| 129 | sx,sy,15); | |
| 131 | 130 | |
| 132 | 131 | /* draw again with wraparound */ |
| 133 | drawgfx(bitmap,machine->gfx[1], | |
| 132 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 134 | 133 | code, |
| 135 | 134 | col, |
| 136 | 135 | flipx,flipy, |
| 137 | sx - 256,sy, | |
| 138 | cliprect,TRANSPARENCY_PEN,15); | |
| 136 | sx - 256,sy,15); | |
| 139 | 137 | } |
| 140 | 138 | } |
| 141 | 139 |
| r5077 | r5078 | |
|---|---|---|
| 396 | 396 | flipx = !flipx; |
| 397 | 397 | flipy = !flipy; |
| 398 | 398 | } |
| 399 | pdrawgfxzoom(bitmap,machine->gfx[char_type], | |
| 399 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[char_type], | |
| 400 | 400 | code, |
| 401 | 401 | color, |
| 402 | 402 | flipx,flipy, |
| 403 | 403 | sx,sy, |
| 404 | cliprect,TRANSPARENCY_PEN,0, | |
| 405 | 404 | zoom,zoom, |
| 406 | 0xffcc ); | |
| 405 | priority_bitmap,0xffcc,0 ); | |
| 407 | 406 | } |
| 408 | 407 | } /* if sprite */ |
| 409 | 408 | } /* for loop */ |
| r5077 | r5078 | |
|---|---|---|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| 113 | static void draw_sprites( | |
| 113 | static void draw_sprites( | |
| 114 | 114 | { |
| 115 | 115 | offs_t offs; |
| 116 | 116 | |
| r5077 | r5078 | |
| 130 | 130 | if (!flip) |
| 131 | 131 | code++; |
| 132 | 132 | |
| 133 | drawgfx(bitmap, gfx | |
| 133 | drawgfx_transpen(bitmap, cliprect, gfx | |
| 134 | 134 | } |
| 135 | 135 | else |
| 136 | 136 | { |
| 137 | 137 | if (cheekyms_spriteram[offs + 0] & 0x02) |
| 138 | 138 | { |
| 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); | |
| 141 | 141 | } |
| 142 | 142 | else |
| 143 | 143 | { |
| 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); | |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | } |
| r5077 | r5078 | |
| 162 | 162 | bitmap_fill(bitmap_buffer, cliprect, 0); |
| 163 | 163 | |
| 164 | 164 | /* sprites go under the playfield */ |
| 165 | draw_sprites(screen->machine->gfx | |
| 165 | draw_sprites(bitmap, cliprect, screen->machine->gfx[1] | |
| 166 | 166 | |
| 167 | 167 | /* draw the tilemap to a temp bitmap */ |
| 168 | 168 | tilemap_draw(bitmap_buffer, cliprect, cheekyms_tilemap, 0, 0); |
| r5077 | r5078 | |
|---|---|---|
| 203 | 203 | if (code & 0x80) /* sprite bankswitch */ |
| 204 | 204 | code += (*magmax_vreg & 0x30) * 0x8; |
| 205 | 205 | |
| 206 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 206 | drawgfx_transmask(bitmap, cliprect, screen->machine->gfx[1], | |
| 207 | 207 | code, |
| 208 | 208 | color, |
| 209 | 209 | flipx, flipy, |
| 210 | 210 | sx, sy, |
| 211 | cliprect, TRANSPARENCY_PENS, | |
| 212 | 211 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 0x1f)); |
| 213 | 212 | } |
| 214 | 213 | } |
| r5077 | r5078 | |
| 234 | 233 | sy = 31 - sy; |
| 235 | 234 | } |
| 236 | 235 | |
| 237 | drawgfx(bitmap, screen->machine->gfx[0], | |
| 236 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], | |
| 238 | 237 | code, |
| 239 | 238 | 0, |
| 240 | 239 | flipscreen, flipscreen, |
| 241 | 8 * sx, 8 * sy, | |
| 242 | cliprect, TRANSPARENCY_PEN, 0x0f); | |
| 240 | 8 * sx, 8 * sy, 0x0f); | |
| 243 | 241 | } |
| 244 | 242 | } |
| 245 | 243 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 129 | 129 | code += ( attr & 0x80 ) ? 0x40 : 0x00; |
| 130 | 130 | code += ( attr & 0x40 ) ? 0x80 : 0x00; |
| 131 | 131 | |
| 132 | drawgfx( bitmap, machine->gfx[2], | |
| 132 | drawgfx_transpen( bitmap, cliprect,machine->gfx[2], | |
| 133 | 133 | code, |
| 134 | 134 | attr & 7, |
| 135 | 135 | flipx,flipy, |
| 136 | sx,sy, | |
| 137 | cliprect,TRANSPARENCY_PEN,0); | |
| 136 | sx,sy,0); | |
| 138 | 137 | } |
| 139 | 138 | } |
| 140 | 139 |
| r5077 | r5078 | |
|---|---|---|
| 88 | 88 | if (x>0x3c0) x -= 0x400; |
| 89 | 89 | if (y>0x180) y -= 0x200; |
| 90 | 90 | |
| 91 | pdrawgfx(bitmap,machine->gfx[0], | |
| 91 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 92 | 92 | tilenum, |
| 93 | 93 | color, |
| 94 | 94 | flipx,flipy, |
| 95 | 95 | x,y, |
| 96 | | |
| 96 | | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | #ifdef MAME_DEBUG |
| r5077 | r5078 | |
|---|---|---|
| 235 | 235 | for (ax=0; ax<dx; ax++) |
| 236 | 236 | for (ay=0; ay<dy; ay++) { |
| 237 | 237 | if (!fx) |
| 238 | drawgfx(bitmap,machine->gfx[0], | |
| 238 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 239 | 239 | 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); | |
| 242 | 241 | else |
| 243 | drawgfx(bitmap,machine->gfx[0], | |
| 242 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 244 | 243 | 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); | |
| 247 | 245 | } |
| 248 | 246 | } |
| 249 | 247 | } |
| r5077 | r5078 | |
|---|---|---|
| 125 | 125 | |
| 126 | 126 | y = 256-(y+7); |
| 127 | 127 | |
| 128 | drawgfx(bitmap,machine->gfx[0], | |
| 128 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 129 | 129 | sprite, |
| 130 | color,fx,fy,x,y, | |
| 131 | cliprect,TRANSPARENCY_PEN,15); | |
| 130 | color,fx,fy,x,y,15); | |
| 132 | 131 | } |
| 133 | 132 | } |
| 134 | 133 |
| r5077 | r5078 | |
|---|---|---|
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | /* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */ |
| 838 | void deco16_pdrawgfx(running_machine *machine, | |
| 839 | bitmap_t *dest,const gfx_element *gfx, | |
| 838 | void deco16_pdrawgfx( | |
| 839 | bitmap_t *dest,const rectangle *clip,const gfx_element *gfx, | |
| 840 | 840 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 841 | | |
| 841 | | |
| 842 | 842 | { |
| 843 | 843 | int ox,oy,cx,cy; |
| 844 | 844 | int x_index,y_index,x,y; |
| 845 | 845 | |
| 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)]; | |
| 847 | 847 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 848 | 848 | |
| 849 | 849 | /* check bounds */ |
| r5077 | r5078 | |
|---|---|---|
| 226 | 226 | |
| 227 | 227 | do |
| 228 | 228 | { |
| 229 | drawgfx(bitmap,machine->gfx[2], | |
| 229 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 230 | 230 | code + i,col, |
| 231 | 231 | 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); | |
| 234 | 233 | |
| 235 | 234 | i--; |
| 236 | 235 | } while (i >= 0); |
| r5077 | r5078 | |
|---|---|---|
| 44 | 44 | int hpos = poolshrk_hpos_ram[i]; |
| 45 | 45 | int vpos = poolshrk_vpos_ram[i]; |
| 46 | 46 | |
| 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); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /* draw playfield */ |
| r5077 | r5078 | |
|---|---|---|
| 170 | 170 | { |
| 171 | 171 | for (y = 0;y <= height;y++) |
| 172 | 172 | { |
| 173 | pdrawgfx(bitmap,machine->gfx[3], | |
| 173 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 174 | 174 | tile_number++, |
| 175 | 175 | color, |
| 176 | 176 | flipx,flipy, |
| 177 | 177 | 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); | |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | } |
| r5077 | r5078 | |
| 214 | 214 | /* Remap code 0x800 <-> 0x1000 */ |
| 215 | 215 | code = (code&0x7ff) | ((code&0x800)<<1) | ((code&0x1000)>>1); |
| 216 | 216 | |
| 217 | pdrawgfx(bitmap,machine->gfx[3], | |
| 217 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 218 | 218 | code, |
| 219 | 219 | color, |
| 220 | 220 | flipx,flipy, |
| 221 | 221 | sx,sy, |
| 222 | cliprect,TRANSPARENCY_PEN,15, | |
| 223 | pri_mask); | |
| 222 | priority_bitmap, | |
| 223 | pri_mask,15); | |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 |
| r5077 | r5078 | |
|---|---|---|
| 137 | 137 | if (fy) fy=0; else fy=1; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | drawgfx(bitmap,machine->gfx[3], | |
| 140 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 141 | 141 | sprite, |
| 142 | color,fx,fy,x,y, | |
| 143 | cliprect,TRANSPARENCY_PEN,15); | |
| 142 | color,fx,fy,x,y,15); | |
| 144 | 143 | } |
| 145 | 144 | } |
| 146 | 145 |
| r5077 | r5078 | |
|---|---|---|
| 122 | 122 | flipy = !flipy; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | drawgfx(bitmap,machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2], | |
| 125 | drawgfx_transpen(bitmap,cliprect,machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2], | |
| 126 | 126 | spriteram[offs] & 0x7f, |
| 127 | 127 | spriteram[offs+1] & 0x0f, |
| 128 | 128 | flipx,flipy, |
| 129 | sx,sy, | |
| 130 | cliprect,TRANSPARENCY_PEN,0); | |
| 129 | sx,sy,0); | |
| 131 | 130 | } |
| 132 | 131 | } |
| 133 | 132 |
| r5077 | r5078 | |
|---|---|---|
| 543 | 543 | int flipy = spriteram[offs] & 2; |
| 544 | 544 | if (flip_screen_get(machine)) sx -= 2*displacement; |
| 545 | 545 | |
| 546 | pdrawgfx(bitmap,machine->gfx[1], | |
| 546 | pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 547 | 547 | (spriteram[offs] & 0xfc) >> 2, |
| 548 | 548 | color, |
| 549 | 549 | flipx,flipy, |
| 550 | 550 | 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)); | |
| 554 | 553 | } |
| 555 | 554 | } |
| 556 | 555 | |
| r5077 | r5078 | |
| 565 | 564 | int color = spriteram_2[offs + 1] & 0x3f; |
| 566 | 565 | int flip = spriteram[offs] & 2; |
| 567 | 566 | |
| 568 | pdrawgfx(bitmap,machine->gfx[1], | |
| 567 | pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 569 | 568 | ((spriteram[offs] & 0x7c) >> 2) + 0x20*(spriteram[offs] & 0x01) + ((spriteram[offs] & 0x80) >> 1), |
| 570 | 569 | color, |
| 571 | 570 | flip,flip, |
| 572 | 571 | 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)); | |
| 576 | 574 | } |
| 577 | 575 | } |
| 578 | 576 |
| r5077 | r5078 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | for (x = startx ; x != endx ; x += incx) |
| 260 | 260 | { |
| 261 | pdrawgfx( bitmap, machine->gfx[0], | |
| 261 | pdrawgfx_transpen( bitmap, cliprect, machine->gfx[0], | |
| 262 | 262 | code++, |
| 263 | 263 | attr & 0x1f, |
| 264 | 264 | flipx, flipy, |
| 265 | 265 | x, sy, |
| 266 | cliprect, TRANSPARENCY_PEN,0x00, | |
| 267 | pri_mask ); | |
| 266 | priority_bitmap, | |
| 267 | pri_mask,0x00 ); | |
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | } |
| r5077 | r5078 | |
| 311 | 311 | |
| 312 | 312 | for (x = startx ; x != endx ; x += incx) |
| 313 | 313 | { |
| 314 | pdrawgfx( bitmap, machine->gfx[0], | |
| 314 | pdrawgfx_transpen( bitmap, cliprect, machine->gfx[0], | |
| 315 | 315 | code++, |
| 316 | 316 | attr & 0x1f, |
| 317 | 317 | flipx, flipy, |
| 318 | 318 | x, sy, |
| 319 | cliprect, TRANSPARENCY_PEN,0x00, | |
| 320 | pri_mask ); | |
| 319 | priority_bitmap, | |
| 320 | pri_mask,0x00 ); | |
| 321 | 321 | } |
| 322 | 322 | } |
| 323 | 323 | } |
| r5077 | r5078 | |
|---|---|---|
| 231 | 231 | |
| 232 | 232 | for (chain_pos = chain;chain_pos >= 0;chain_pos--) |
| 233 | 233 | { |
| 234 | pdrawgfx(bitmap, machine->gfx[0], | |
| 234 | pdrawgfx_transpen(bitmap, cliprect,machine->gfx[0], | |
| 235 | 235 | code, |
| 236 | 236 | col, |
| 237 | 237 | flipx, flipy, |
| 238 | 238 | curx,cury, |
| 239 | cliprect,TRANSPARENCY_PEN,0, | |
| 240 | priority ? 0xfc : 0xf0); | |
| 239 | priority_bitmap, | |
| 240 | priority ? 0xfc : 0xf0,0); | |
| 241 | 241 | |
| 242 | 242 | code++; |
| 243 | 243 |
| r5077 | r5078 | |
|---|---|---|
| 299 | 299 | { |
| 300 | 300 | bitmap_fill( tmpbitmap0, &spritetile_clip , 0); |
| 301 | 301 | bitmap_fill( tmpbitmap1, &spritetile_clip , 0); |
| 302 | drawgfxzoom( tmpbitmap0,machine->gfx[gfx], | |
| 302 | drawgfxzoom_transpen( tmpbitmap0,&spritetile_clip,machine->gfx[gfx], | |
| 303 | 303 | code++, |
| 304 | 304 | color, |
| 305 | 305 | flipx, flipy, |
| 306 | 306 | 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); | |
| 309 | 308 | |
| 310 | 309 | // peek at the unrotated sprite |
| 311 | 310 | // copybitmap_trans( bitmap,tmpbitmap0, 0,0, 50+(x * xdim/0x10000),50+(y * ydim/0x10000), cliprect, 0 ); |
| r5077 | r5078 | |
| 362 | 361 | break; |
| 363 | 362 | |
| 364 | 363 | default: |
| 365 | drawgfxzoom( bitmap,machine->gfx[gfx], | |
| 364 | drawgfxzoom_transpen( bitmap,cliprect,machine->gfx[gfx], | |
| 366 | 365 | code++, |
| 367 | 366 | color, |
| 368 | 367 | flipx, flipy, |
| 369 | 368 | currx, curry, |
| 370 | cliprect,TRANSPARENCY_PEN,0, | |
| 371 | scalex << 12, scaley << 12); | |
| 369 | scalex << 12, scaley << 12,0); | |
| 372 | 370 | break; |
| 373 | 371 | } |
| 374 | 372 | |
| r5077 | r5078 | |
| 443 | 441 | int scalex = (sx + (x + 1) * xdim) / 0x10000 - currx; |
| 444 | 442 | int scaley = (sy + (y + 1) * ydim) / 0x10000 - curry; |
| 445 | 443 | |
| 446 | drawgfxzoom( bitmap,machine->gfx[gfx], | |
| 444 | drawgfxzoom_transpen( bitmap,cliprect,machine->gfx[gfx], | |
| 447 | 445 | code++, |
| 448 | 446 | color, |
| 449 | 447 | flipx, flipy, |
| 450 | 448 | currx, curry, |
| 451 | cliprect,TRANSPARENCY_PEN,0, | |
| 452 | scalex << 12, scaley << 12); | |
| 449 | scalex << 12, scaley << 12,0); | |
| 453 | 450 | } |
| 454 | 451 | } |
| 455 | 452 | } |
| r5077 | r5078 | |
|---|---|---|
| 133 | 133 | flipy = !flipy; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 136 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 137 | 137 | spriteram[troffs+1], |
| 138 | 138 | spriteram[troffs+2]&0x07, |
| 139 | 139 | flipx,flipy, |
| 140 | sx,sy, | |
| 141 | cliprect,TRANSPARENCY_PEN,0); | |
| 140 | sx,sy,0); | |
| 142 | 141 | } |
| 143 | 142 | } |
| 144 | 143 | } |
| r5077 | r5078 | |
|---|---|---|
| 176 | 176 | } |
| 177 | 177 | else |
| 178 | 178 | { |
| 179 | drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 179 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 180 | 180 | sprite_ptr->code, |
| 181 | 181 | sprite_ptr->color, |
| 182 | 182 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 183 | 183 | 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); | |
| 186 | 185 | } |
| 187 | 186 | } |
| 188 | 187 | } |
| r5077 | r5078 | |
| 196 | 195 | { |
| 197 | 196 | sprite_ptr--; |
| 198 | 197 | |
| 199 | pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 198 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 200 | 199 | sprite_ptr->code, |
| 201 | 200 | sprite_ptr->color, |
| 202 | 201 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 203 | 202 | sprite_ptr->x,sprite_ptr->y, |
| 204 | cliprect,TRANSPARENCY_PEN,0, | |
| 205 | 203 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 206 | sprite_ptr->primask); | |
| 204 | priority_bitmap,sprite_ptr->primask,0); | |
| 207 | 205 | } |
| 208 | 206 | } |
| 209 | 207 |
| r5077 | r5078 | |
|---|---|---|
| 106 | 106 | if (xblock) sxoffs+=xblocksizeinpixels; |
| 107 | 107 | if (yblock) syoffs+=yblocksizeinpixels; |
| 108 | 108 | |
| 109 | drawgfxzoom(bitmap,gfx, | |
| 109 | drawgfxzoom_transpen(bitmap,cliprect,gfx, | |
| 110 | 110 | code+yoffs+xoffs, |
| 111 | 111 | color, |
| 112 | 112 | flipx,flipy, |
| 113 | 113 | sx+sxoffs,sy+syoffs, |
| 114 | cliprect,TRANSPARENCY_PEN,15, | |
| 115 | zoomx,zoomy); | |
| 114 | zoomx,zoomy,15); | |
| 116 | 115 | } |
| 117 | 116 | } |
| 118 | 117 | source -= 8; |
| r5077 | r5078 | |
|---|---|---|
| 285 | 285 | if (fy) { my += 16*(cgy-1); yinc = -16; } /* Swap tile order on Y flips */ |
| 286 | 286 | |
| 287 | 287 | for (i=0; i<cgy; i++) { |
| 288 | drawgfx(bitmap,machine->gfx[1], | |
| 288 | drawgfx_transpen(bitmap,clip,machine->gfx[1], | |
| 289 | 289 | code, |
| 290 | 290 | colour, |
| 291 | 291 | fx,fy, |
| 292 | mx,my, | |
| 293 | clip,TRANSPARENCY_PEN,0); | |
| 292 | mx,my,0); | |
| 294 | 293 | |
| 295 | 294 | if (cgx) |
| 296 | drawgfx(bitmap,machine->gfx[1], | |
| 295 | drawgfx_transpen(bitmap,clip,machine->gfx[1], | |
| 297 | 296 | code2, |
| 298 | 297 | colour, |
| 299 | 298 | fx,fy, |
| 300 | mx+16,my, | |
| 301 | clip,TRANSPARENCY_PEN,0); | |
| 299 | mx+16,my,0); | |
| 302 | 300 | my += yinc; |
| 303 | 301 | /* if (cgx) */ /* Different from console? */ |
| 304 | 302 | code += 2; |
| r5077 | r5078 | |
| 333 | 331 | /* If this tile was changed OR tilemap was changed, redraw */ |
| 334 | 332 | if (vram_dirty[offs/2]) { |
| 335 | 333 | vram_dirty[offs/2]=0; |
| 336 | drawgfx(tile_bitmap,screen->machine->gfx[0], | |
| 334 | drawgfx_opaque(tile_bitmap,0,screen->machine->gfx[0], | |
| 337 | 335 | code, |
| 338 | 336 | HuC6270_vram[offs] >> 4, |
| 339 | 337 | 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], | |
| 343 | 340 | 0, |
| 344 | 341 | 0, /* fill the spot with pen 256 */ |
| 345 | 342 | 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], | |
| 349 | 345 | code, |
| 350 | 346 | HuC6270_vram[offs] >> 4, |
| 351 | 347 | 0,0, |
| 352 | 8*mx,8*my, | |
| 353 | 0,TRANSPARENCY_PENS,0x1); | |
| 348 | 8*mx,8*my,0x1); | |
| 354 | 349 | } |
| 355 | 350 | } |
| 356 | 351 |
| r5077 | r5078 | |
|---|---|---|
| 195 | 195 | |
| 196 | 196 | if (attr & 0x80) /* double height */ |
| 197 | 197 | { |
| 198 | drawgfx(bitmap,machine->gfx[3], | |
| 198 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 199 | 199 | numtile, |
| 200 | 200 | color, |
| 201 | 201 | 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], | |
| 205 | 204 | numtile+1, |
| 206 | 205 | color, |
| 207 | 206 | flipx,flipy, |
| 208 | sx,sy, | |
| 209 | cliprect,TRANSPARENCY_PEN,0); | |
| 207 | sx,sy,0); | |
| 210 | 208 | } |
| 211 | 209 | else |
| 212 | 210 | { |
| 213 | drawgfx(bitmap,machine->gfx[3], | |
| 211 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 214 | 212 | numtile, |
| 215 | 213 | color, |
| 216 | 214 | flipx,flipy, |
| 217 | sx,sy, | |
| 218 | cliprect,TRANSPARENCY_PEN,0); | |
| 215 | sx,sy,0); | |
| 219 | 216 | } |
| 220 | 217 | } |
| 221 | 218 | } |
| r5077 | r5078 | |
|---|---|---|
| 241 | 241 | { |
| 242 | 242 | if (spriteram[offs + 1] != 0) |
| 243 | 243 | { |
| 244 | drawgfx(bitmap,machine->gfx[2], | |
| 244 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 245 | 245 | spriteram[offs],spriteram[offs + 2] & 0x0f, |
| 246 | 246 | 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); | |
| 249 | 248 | } |
| 250 | 249 | } |
| 251 | 250 | } |
| r5077 | r5078 | |
|---|---|---|
| 389 | 389 | |
| 390 | 390 | do |
| 391 | 391 | { |
| 392 | drawgfx(bitmap,machine->gfx[1], | |
| 392 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 393 | 393 | code + i * incr,col, |
| 394 | 394 | flipx,flipy, |
| 395 | sx,sy + 16 * i, | |
| 396 | cliprect,TRANSPARENCY_PEN,0); | |
| 395 | sx,sy + 16 * i,0); | |
| 397 | 396 | |
| 398 | 397 | i--; |
| 399 | 398 | } while (i >= 0); |
| r5077 | r5078 | |
|---|---|---|
| 135 | 135 | flipy = !flipy; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | drawgfx(tmpbitmap,screen->machine->gfx[1], | |
| 138 | drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[1], | |
| 139 | 139 | ((int)videoram[offs]) + ((colorram[offs] & (1<<7) ? 256 : 0) ), |
| 140 | 140 | (colorram[offs] & 0x0f) + 0x10, |
| 141 | 141 | flipx,flipy, |
| 142 | 8*sx,8*sy, | |
| 143 | 0,TRANSPARENCY_NONE,0); | |
| 142 | 8*sx,8*sy); | |
| 144 | 143 | } |
| 145 | 144 | |
| 146 | 145 | /* copy the temporary bitmap to the screen */ |
| r5077 | r5078 | |
| 182 | 181 | else |
| 183 | 182 | sx = sx + 32; |
| 184 | 183 | |
| 185 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 184 | drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[0], | |
| 186 | 185 | spriteram[offs + 2], |
| 187 | 186 | color, |
| 188 | 187 | flipx,flipy, |
| 189 | 188 | sx,sy, |
| 190 | cliprect,TRANSPARENCY_PENS, | |
| 191 | 189 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[0], color, 0)); |
| 192 | 190 | } |
| 193 | 191 | } |
| r5077 | r5078 | |
| 216 | 214 | |
| 217 | 215 | |
| 218 | 216 | |
| 219 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 217 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1], | |
| 220 | 218 | ((int)megazone_videoram2[offs]) + ((megazone_colorram2[offs] & (1<<7) ? 256 : 0) ), |
| 221 | 219 | (megazone_colorram2[offs] & 0x0f) + 0x10, |
| 222 | 220 | flipx,flipy, |
| 223 | 8*sx,8*sy, | |
| 224 | cliprect,TRANSPARENCY_NONE,0); | |
| 221 | 8*sx,8*sy); | |
| 225 | 222 | offs++; |
| 226 | 223 | } |
| 227 | 224 | } |
| r5077 | r5078 | |
|---|---|---|
| 208 | 208 | flipy=1; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | drawgfx (bitmap,machine->gfx[1], | |
| 211 | drawgfx_transpen (bitmap,cliprect,machine->gfx[1], | |
| 212 | 212 | tile, |
| 213 | 213 | color, |
| 214 | 214 | flipx,flipy, |
| 215 | x,y, | |
| 216 | cliprect,TRANSPARENCY_PEN,15); | |
| 215 | x,y,15); | |
| 217 | 216 | } |
| 218 | 217 | } |
| 219 | 218 | } |
| r5077 | r5078 | |
| 247 | 246 | tile = sprite_word[1] & 0x1fff; |
| 248 | 247 | color = sprite_word[2] >> 12; |
| 249 | 248 | |
| 250 | drawgfx (bitmap,machine->gfx[1], | |
| 249 | drawgfx_transpen (bitmap,cliprect,machine->gfx[1], | |
| 251 | 250 | tile, |
| 252 | 251 | color, |
| 253 | 252 | flipx,0, |
| 254 | x,y-1, | |
| 255 | cliprect,TRANSPARENCY_PEN,15); | |
| 253 | x,y-1,15); | |
| 256 | 254 | } |
| 257 | 255 | } |
| 258 | 256 | } |
| r5077 | r5078 | |
|---|---|---|
| 303 | 303 | if (spriteram[offs+2] & 0xe0) |
| 304 | 304 | color = mame_rand(machine)&0xf; |
| 305 | 305 | |
| 306 | drawgfx(bitmap,machine->gfx[1], | |
| 306 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 307 | 307 | code, |
| 308 | 308 | color, |
| 309 | 309 | flipx,flipy, |
| 310 | sx+fortyl_xoffset,sy, | |
| 311 | cliprect,TRANSPARENCY_PEN,0); | |
| 310 | sx+fortyl_xoffset,sy,0); | |
| 312 | 311 | } |
| 313 | 312 | |
| 314 | 313 | /* spriteram #2 */ |
| r5077 | r5078 | |
| 332 | 331 | if (spriteram_2[offs+2] & 0xe0) |
| 333 | 332 | color = mame_rand(machine)&0xf; |
| 334 | 333 | |
| 335 | drawgfx(bitmap,machine->gfx[1], | |
| 334 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 336 | 335 | code, |
| 337 | 336 | color, |
| 338 | 337 | flipx,flipy, |
| 339 | sx+fortyl_xoffset,sy, | |
| 340 | cliprect,TRANSPARENCY_PEN,0); | |
| 338 | sx+fortyl_xoffset,sy,0); | |
| 341 | 339 | } |
| 342 | 340 | } |
| 343 | 341 |
| r5077 | r5078 | |
|---|---|---|
| 104 | 104 | if (attributes & 0x80) /* big sprite */ |
| 105 | 105 | { |
| 106 | 106 | sprite_number &= ~1; |
| 107 | drawgfx(bitmap, machine->gfx[sprite_bank], | |
| 107 | drawgfx_transpen(bitmap, cliprect, machine->gfx[sprite_bank], | |
| 108 | 108 | sprite_number + 1, |
| 109 | 109 | color, |
| 110 | 110 | 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); | |
| 113 | 112 | } |
| 114 | 113 | else |
| 115 | 114 | { |
| 116 | 115 | sy += (flip_screen_get(machine) ? -16 : 16); |
| 117 | 116 | } |
| 118 | drawgfx(bitmap, machine->gfx[sprite_bank], | |
| 117 | drawgfx_transpen(bitmap, cliprect, machine->gfx[sprite_bank], | |
| 119 | 118 | sprite_number, |
| 120 | 119 | color, |
| 121 | 120 | xflip, flip_screen_get(machine), |
| 122 | sx, sy, | |
| 123 | cliprect, TRANSPARENCY_PEN, 0); | |
| 121 | sx, sy, 0); | |
| 124 | 122 | } |
| 125 | 123 | source += 4; |
| 126 | 124 | } |
| r5077 | r5078 | |
|---|---|---|
| 530 | 530 | { |
| 531 | 531 | for (x = 0;x <= sizex;x++) |
| 532 | 532 | { |
| 533 | drawgfx(bitmap,machine->gfx[1], | |
| 533 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 534 | 534 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 535 | 535 | color, |
| 536 | 536 | flipx,flipy, |
| 537 | 537 | sx + 16*x, sy + 16*y, |
| 538 | cliprect,TRANSPARENCY_PENS, | |
| 539 | 538 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x0f)); |
| 540 | 539 | } |
| 541 | 540 | } |
| r5077 | r5078 | |
|---|---|---|
| 328 | 328 | color = source[2] & 0x0f; |
| 329 | 329 | |
| 330 | 330 | |
| 331 | drawgfx(bitmap, machine->gfx[1], | |
| 331 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 332 | 332 | code | ((UINT16)gfxbank << 6), |
| 333 | 333 | color, |
| 334 | 334 | flipx, flipy, |
| 335 | sx,sy, | |
| 336 | cliprect, TRANSPARENCY_PEN,0); | |
| 335 | sx,sy,0); | |
| 337 | 336 | |
| 338 | 337 | source += inc; |
| 339 | 338 | } |
| r5077 | r5078 | |
|---|---|---|
| 164 | 164 | flipy ^= 0x0080; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | drawgfxzoom( bitmap, machine -> gfx[0], | |
| 167 | drawgfxzoom_transpen( bitmap, cliprect, | |
| 168 | machine -> gfx[0], | |
| 168 | 169 | tile, |
| 169 | 170 | color, |
| 170 | 171 | flipx, flipy, |
| 171 | 172 | x, y, |
| 172 | cliprect, | |
| 173 | TRANSPARENCY_PEN, 0, | |
| 174 | zx, zx | |
| 173 | zx, zx, 0 | |
| 175 | 174 | ); |
| 176 | 175 | } |
| 177 | 176 | tile_offs ++; |
| r5077 | r5078 | |
| 276 | 275 | flipy ^= 0x0080; |
| 277 | 276 | } |
| 278 | 277 | |
| 279 | drawgfxzoom( bitmap, machine -> gfx[0], | |
| 278 | drawgfxzoom_transpen( bitmap, cliprect, | |
| 279 | machine -> gfx[0], | |
| 280 | 280 | tile, |
| 281 | 281 | color, |
| 282 | 282 | flipx, flipy, |
| 283 | 283 | x, y, |
| 284 | cliprect, | |
| 285 | TRANSPARENCY_PEN, 0, | |
| 286 | zx, zy | |
| 284 | zx, zy, 0 | |
| 287 | 285 | ); |
| 288 | 286 | } |
| 289 | 287 | tile_offs ++; |
| r5077 | r5078 | |
| 377 | 375 | flipy ^= 0x0080; |
| 378 | 376 | } |
| 379 | 377 | |
| 380 | drawgfxzoom( bitmap, machine -> gfx[0], | |
| 378 | drawgfxzoom_transpen( bitmap, cliprect, | |
| 379 | machine -> gfx[0], | |
| 381 | 380 | tile, |
| 382 | 381 | color, |
| 383 | 382 | flipx, flipy, |
| 384 | 383 | x, y, |
| 385 | cliprect, | |
| 386 | TRANSPARENCY_PEN, 0, | |
| 387 | zx, zx | |
| 384 | zx, zx, 0 | |
| 388 | 385 | ); |
| 389 | 386 | } |
| 390 | 387 | tile_offs ++; |
| r5077 | r5078 | |
|---|---|---|
| 320 | 320 | Screen refresh |
| 321 | 321 | ***************************************************************************/ |
| 322 | 322 | |
| 323 | #define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx( | |
| 323 | #define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx( | |
| 324 | 324 | |
| 325 | 325 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 326 | 326 | { |
| r5077 | r5078 | |
|---|---|---|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| 44 | void 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 | ||
| 44 | 51 | void c8080bw_screen_red_w(int data) |
| 45 | 52 | { |
| 46 | 53 | screen_red = data; |
| r5077 | r5078 | |
|---|---|---|
| 184 | 184 | } |
| 185 | 185 | else |
| 186 | 186 | { |
| 187 | drawgfxzoom(bitmap,machine->gfx[0], | |
| 187 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 188 | 188 | sprite_ptr->code, |
| 189 | 189 | sprite_ptr->color, |
| 190 | 190 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 191 | 191 | 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); | |
| 194 | 193 | } |
| 195 | 194 | } |
| 196 | 195 | |
| r5077 | r5078 | |
| 203 | 202 | { |
| 204 | 203 | sprite_ptr--; |
| 205 | 204 | |
| 206 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 205 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 207 | 206 | sprite_ptr->code, |
| 208 | 207 | sprite_ptr->color, |
| 209 | 208 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 210 | 209 | sprite_ptr->x,sprite_ptr->y, |
| 211 | cliprect,TRANSPARENCY_PEN,0, | |
| 212 | 210 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 213 | sprite_ptr->primask); | |
| 211 | priority_bitmap,sprite_ptr->primask,0); | |
| 214 | 212 | } |
| 215 | 213 | } |
| 216 | 214 |
| r5077 | r5078 | |
|---|---|---|
| 233 | 233 | flipx = !flipx; flipy = !flipy; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | drawgfx(bitmap,machine->gfx[3], | |
| 236 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 237 | 237 | code & 0x3fff, |
| 238 | 238 | attr >> 12, |
| 239 | 239 | flipx, flipy, |
| 240 | x,y, | |
| 241 | cliprect,TRANSPARENCY_PEN,15); | |
| 240 | x,y,15); | |
| 242 | 241 | |
| 243 | 242 | } |
| 244 | 243 | } |
| r5077 | r5078 | |
|---|---|---|
| 145 | 145 | flipx = spriteram16[offs + 2] & 0x1000; |
| 146 | 146 | flipy = spriteram16[offs + 2] & 0x0800; |
| 147 | 147 | |
| 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], | |
| 149 | 150 | code, |
| 150 | 151 | 40 + color, |
| 151 | 152 | 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); | |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 |
| r5077 | r5078 | |
|---|---|---|
| 130 | 130 | flipy = !flipy; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | drawgfx(bitmap, machine->gfx[1], | |
| 133 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 134 | 134 | sprt, |
| 135 | 135 | color, |
| 136 | 136 | flipx, flipy, |
| 137 | sx, sy, | |
| 138 | cliprect, TRANSPARENCY_PEN, 0); | |
| 137 | sx, sy, 0); | |
| 139 | 138 | } |
| 140 | 139 | } |
| 141 | 140 |
| r5077 | r5078 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | /* Main Screen */ |
| 141 | 141 | |
| 142 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 142 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 143 | 143 | code, |
| 144 | 144 | cvs_color_ram[offs] & 0x3f, |
| 145 | 145 | 0,0, |
| 146 | x,y, | |
| 147 | cliprect,TRANSPARENCY_PEN,0); | |
| 146 | x,y,0); | |
| 148 | 147 | |
| 149 | 148 | |
| 150 | 149 | /* background for Collision Detection (it can only hit certain items) */ |
| 151 | 150 | |
| 152 | 151 | if((cvs_color_ram[offs] & 7) == 0) |
| 153 | 152 | { |
| 154 | drawgfx(cvs_collision_background,screen->machine->gfx[0], | |
| 153 | drawgfx_opaque(cvs_collision_background,cliprect,screen->machine->gfx[0], | |
| 155 | 154 | code, |
| 156 | 155 | 64, |
| 157 | 156 | 0,0, |
| 158 | x,y, | |
| 159 | cliprect,TRANSPARENCY_NONE,0); | |
| 157 | x,y); | |
| 160 | 158 | } |
| 161 | 159 | } |
| 162 | 160 |
| r5077 | r5078 | |
|---|---|---|
| 410 | 410 | } |
| 411 | 411 | else |
| 412 | 412 | { |
| 413 | drawgfxzoom(bitmap,machine->gfx[0], | |
| 413 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 414 | 414 | sprite_ptr->code, |
| 415 | 415 | sprite_ptr->color, |
| 416 | 416 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 417 | 417 | 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); | |
| 420 | 419 | } |
| 421 | 420 | } |
| 422 | 421 | } |
| r5077 | r5078 | |
| 427 | 426 | { |
| 428 | 427 | sprite_ptr--; |
| 429 | 428 | |
| 430 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 429 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 431 | 430 | sprite_ptr->code, |
| 432 | 431 | sprite_ptr->color, |
| 433 | 432 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 434 | 433 | sprite_ptr->x,sprite_ptr->y, |
| 435 | cliprect,TRANSPARENCY_PEN,0, | |
| 436 | 434 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 437 | sprite_ptr->primask); | |
| 435 | priority_bitmap,sprite_ptr->primask,0); | |
| 438 | 436 | } |
| 439 | 437 | } |
| 440 | 438 |
| r5077 | r5078 | |
|---|---|---|
| 250 | 250 | { |
| 251 | 251 | if (color != 0x0a && color != 0x0b) |
| 252 | 252 | { |
| 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); | |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | else |
| 258 | 258 | { |
| 259 | 259 | if (color == 0x0a || color == 0x0b) |
| 260 | 260 | { |
| 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); | |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | } |
| r5077 | r5078 | |
|---|---|---|
| 205 | 205 | |
| 206 | 206 | while (multi >= 0) |
| 207 | 207 | { |
| 208 | pdrawgfx(bitmap,machine->gfx[3], | |
| 208 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 209 | 209 | sprite - multi * inc, |
| 210 | 210 | colour, |
| 211 | 211 | fx,fy, |
| 212 | 212 | x,y + mult * multi, |
| 213 | | |
| 213 | | |
| 214 | 214 | |
| 215 | 215 | multi--; |
| 216 | 216 | } |
| r5077 | r5078 | |
| 273 | 273 | |
| 274 | 274 | while (multi >= 0) |
| 275 | 275 | { |
| 276 | pdrawgfx(bitmap,machine->gfx[3], | |
| 276 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 277 | 277 | sprite - multi * inc, |
| 278 | 278 | colour, |
| 279 | 279 | fx,fy, |
| 280 | 280 | x,y + mult * multi, |
| 281 | | |
| 281 | | |
| 282 | 282 | |
| 283 | 283 | multi--; |
| 284 | 284 | } |
| r5077 | r5078 | |
|---|---|---|
| 323 | 323 | for (x = 0;x <= sizex;x++) |
| 324 | 324 | { |
| 325 | 325 | if (whichmask != 0) |
| 326 | drawgfx(bitmap,machine->gfx[2], | |
| 326 | drawgfx_transmask(bitmap,cliprect,machine->gfx[2], | |
| 327 | 327 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 328 | 328 | color, |
| 329 | 329 | 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]); | |
| 332 | 331 | else |
| 333 | pdrawgfx(bitmap,machine->gfx[2], | |
| 332 | pdrawgfx_transmask(bitmap,cliprect,machine->gfx[2], | |
| 334 | 333 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 335 | 334 | color, |
| 336 | 335 | flipx,flipy, |
| 337 | 336 | sx + 16*x,sy + 16*y, |
| 338 | | |
| 337 | | |
| 339 | 338 | } |
| 340 | 339 | } |
| 341 | 340 | } |
| r5077 | r5078 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | for (j = ystart; j != yend; j += yinc) { |
| 114 | 114 | for (i = xstart; i != xend; i += xinc) { |
| 115 | drawgfx(bitmap,gfx,tnum+loopnum,colr,flipx,flipy,xpos+16*i,ypos+16*j | |
| 115 | drawgfx_transpen(bitmap,cliprect,gfx,tnum+loopnum,colr,flipx,flipy,xpos+16*i,ypos+16*j | |
| 116 | 116 | loopnum++; |
| 117 | 117 | } |
| 118 | 118 | } |
| r5077 | r5078 | |
|---|---|---|
| 87 | 87 | if(ra_flipy) |
| 88 | 88 | sy = 31-sy ; |
| 89 | 89 | |
| 90 | drawgfx(bitmap, | |
| 91 | screen->machine->gfx[RA_BGCHAR_BASE], | |
| 90 | drawgfx_transpen(bitmap, | |
| 91 | cliprect,screen->machine->gfx[RA_BGCHAR_BASE], | |
| 92 | 92 | mem[offs + ( ra_bkgpage * 1024 )] |
| 93 | 93 | + ((( mem[offs + 0x4000 + ( ra_bkgpage * 1024 )] & 0xc0 ) >> 6 ) * 256 ) , |
| 94 | 94 | ra_bkgcol, |
| 95 | 95 | ra_flipx,(ra_bkgflip^ra_flipy), |
| 96 | sx*8,sy*8, | |
| 97 | cliprect,TRANSPARENCY_PEN,0); | |
| 96 | sx*8,sy*8,0); | |
| 98 | 97 | |
| 99 | 98 | |
| 100 | 99 | } |
| r5077 | r5078 | |
| 127 | 126 | if(bank) |
| 128 | 127 | bank += ra_spritebank; |
| 129 | 128 | |
| 130 | drawgfx(bitmap, screen->machine->gfx[ RA_SP_BASE + bank ], | |
| 129 | drawgfx_transpen(bitmap, cliprect,screen->machine->gfx[ RA_SP_BASE + bank ], | |
| 131 | 130 | spriteram[offs+1] & 0x3f , |
| 132 | 131 | spriteram[offs+2] & 0x1f, |
| 133 | 132 | ra_flipx,!(s_flipy^ra_flipy), |
| 134 | sx,sy, | |
| 135 | cliprect,TRANSPARENCY_PEN,0); | |
| 133 | sx,sy,0); | |
| 136 | 134 | } |
| 137 | 135 | } |
| 138 | 136 | |
| r5077 | r5078 | |
| 156 | 154 | |
| 157 | 155 | if (ra_flipx) sx = 31 - sx; |
| 158 | 156 | |
| 159 | drawgfx(bitmap,screen->machine->gfx[RA_FGCHAR_BASE + ra_chrbank] , | |
| 157 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[RA_FGCHAR_BASE + ra_chrbank] , | |
| 160 | 158 | videoram[ offs ] , |
| 161 | 159 | col, |
| 162 | 160 | ra_flipx,ra_flipy, |
| 163 | 8*sx,scroll, | |
| 164 | cliprect,TRANSPARENCY_PEN,0); | |
| 161 | 8*sx,scroll,0); | |
| 165 | 162 | |
| 166 | 163 | } |
| 167 | 164 |
| r5077 | r5078 | |
|---|---|---|
| 230 | 230 | ex = flipx ? (width-1-x) : x; |
| 231 | 231 | ey = flipy ? (height-1-y) : y; |
| 232 | 232 | |
| 233 | drawgfx(bitmap,gfx, | |
| 233 | drawgfx_transpen(bitmap,cliprect, | |
| 234 | gfx, | |
| 234 | 235 | (number)+x_offset[ex]+y_offset[ey], |
| 235 | 236 | color, |
| 236 | 237 | flipx, flipy, |
| 237 | sx+x*16,sy+y*16, | |
| 238 | cliprect, | |
| 239 | TRANSPARENCY_PEN, 0); | |
| 238 | sx+x*16,sy+y*16, 0); | |
| 240 | 239 | } |
| 241 | 240 | } |
| 242 | 241 | } |
| r5077 | r5078 | |
|---|---|---|
| 226 | 226 | flipy = !flipy; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | drawgfx(bitmap,machine->gfx[1], | |
| 229 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 230 | 230 | popper_spriteram[offs+1], |
| 231 | 231 | (popper_spriteram[offs+2]&0x0f), |
| 232 | 232 | flipx,flipy, |
| 233 | sx,sy, | |
| 234 | cliprect,TRANSPARENCY_PEN,0); | |
| 233 | sx,sy,0); | |
| 235 | 234 | } |
| 236 | 235 | } |
| 237 | 236 | } |
| r5077 | r5078 | |
|---|---|---|
| 194 | 194 | y = (30 * 8) - y; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | drawgfx(bitmap, gfx, | |
| 197 | drawgfx_transpen(bitmap, cliprect, | |
| 198 | gfx, | |
| 198 | 199 | code, color, |
| 199 | 200 | flipx, flipy, |
| 200 | x, y, | |
| 201 | cliprect, | |
| 202 | TRANSPARENCY_PEN, 15); | |
| 201 | x, y, 15); | |
| 203 | 202 | } |
| 204 | 203 | } |
| 205 | 204 |
| r5077 | r5078 | |
|---|---|---|
| 112 | 112 | sy = 240-ladyfrog_spriteram[offs+0]; |
| 113 | 113 | flipx = ((ladyfrog_spriteram[offs+1]&0x40)>>6); |
| 114 | 114 | flipy = ((ladyfrog_spriteram[offs+1]&0x80)>>7); |
| 115 | drawgfx(bitmap,machine->gfx[1], | |
| 115 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 116 | 116 | code, |
| 117 | 117 | pal, |
| 118 | 118 | flipx,flipy, |
| 119 | sx,sy, | |
| 120 | cliprect,TRANSPARENCY_PEN,15); | |
| 119 | sx,sy,15); | |
| 121 | 120 | |
| 122 | 121 | if(ladyfrog_spriteram[offs+3]>240) |
| 123 | 122 | { |
| 124 | 123 | sx = (ladyfrog_spriteram[offs+3]-256); |
| 125 | drawgfx(bitmap,machine->gfx[1], | |
| 124 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 126 | 125 | code, |
| 127 | 126 | pal, |
| 128 | 127 | flipx,flipy, |
| 129 | sx,sy, | |
| 130 | cliprect,TRANSPARENCY_PEN,15); | |
| 128 | sx,sy,15); | |
| 131 | 129 | } |
| 132 | 130 | } |
| 133 | 131 | } |
| r5077 | r5078 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | while (multi >= 0) |
| 70 | 70 | { |
| 71 | drawgfx(bitmap,machine->gfx[2], | |
| 71 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 72 | 72 | sprite - multi * inc, |
| 73 | 73 | colour, |
| 74 | 74 | fx,fy, |
| 75 | x,y + mult * multi, | |
| 76 | cliprect,TRANSPARENCY_PEN,0); | |
| 75 | x,y + mult * multi,0); | |
| 77 | 76 | |
| 78 | 77 | multi--; |
| 79 | 78 | } |
| r5077 | r5078 | |
|---|---|---|
| 83 | 83 | flipy = !flipy; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | drawgfx(bitmap,machine->gfx[0], | |
| 86 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 87 | 87 | num, |
| 88 | 88 | color, |
| 89 | 89 | flipx,flipy, |
| 90 | sx,sy, | |
| 91 | cliprect,TRANSPARENCY_PEN,0); | |
| 90 | sx,sy,0); | |
| 92 | 91 | } |
| 93 | 92 | } |
| 94 | 93 | |
| r5077 | r5078 | |
| 164 | 163 | flipy = !flipy; |
| 165 | 164 | } |
| 166 | 165 | |
| 167 | drawgfx(bitmap,machine->gfx[0], | |
| 166 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 168 | 167 | num, |
| 169 | 168 | color, |
| 170 | 169 | flipx,flipy, |
| 171 | sx,sy, | |
| 172 | cliprect,TRANSPARENCY_PEN,0); | |
| 170 | sx,sy,0); | |
| 173 | 171 | } |
| 174 | 172 | } |
| 175 | 173 |
| r5077 | r5078 | |
|---|---|---|
| 207 | 207 | flipy = !flipy; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | drawgfx(bitmap,machine->gfx[1], | |
| 210 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 211 | 211 | spriteram[offs+1] + ((spriteram[offs] & 0x30) << 4), |
| 212 | 212 | (spriteram[offs] & 0x08) >> 3, |
| 213 | 213 | flipx,flipy, |
| 214 | sx,sy, | |
| 215 | cliprect,TRANSPARENCY_PEN,0); | |
| 214 | sx,sy,0); | |
| 216 | 215 | } |
| 217 | 216 | } |
| 218 | 217 | } |
| r5077 | r5078 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | while (multi >= 0) |
| 55 | 55 | { |
| 56 | drawgfx(bitmap,machine->gfx[2], | |
| 56 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 57 | 57 | sprite - multi * inc, |
| 58 | 58 | colour, |
| 59 | 59 | fx,fy, |
| 60 | x,y + mult * multi, | |
| 61 | cliprect,TRANSPARENCY_PEN,0); | |
| 60 | x,y + mult * multi,0); | |
| 62 | 61 | |
| 63 | 62 | multi--; |
| 64 | 63 | } |
| r5077 | r5078 | |
|---|---|---|
| 77 | 77 | { |
| 78 | 78 | for( col=0; col<512; col+=32 ) |
| 79 | 79 | { |
| 80 | drawgfx(bg_bitmap, | |
| 81 | machine->gfx[2], | |
| 80 | drawgfx_opaque(bg_bitmap, | |
| 81 | 0,machine->gfx[2], | |
| 82 | 82 | charcode, |
| 83 | 83 | row < 128 ? 0 : 1, |
| 84 | 84 | 0,0, |
| 85 | 512*page + col,row, | |
| 86 | 0,TRANSPARENCY_NONE,0); | |
| 85 | 512*page + col,row); | |
| 87 | 86 | charcode++; |
| 88 | 87 | } |
| 89 | 88 | } |
| r5077 | r5078 | |
| 202 | 201 | { |
| 203 | 202 | sx = (sx + scroll) & 0x1ff; |
| 204 | 203 | |
| 205 | drawgfx(bitmap,machine->gfx[0], | |
| 204 | drawgfx_transmask(bitmap,&bottomvisiblearea,machine->gfx[0], | |
| 206 | 205 | tile_number, |
| 207 | 206 | color, |
| 208 | 207 | 0,0, |
| 209 | sx,sy, | |
| 210 | &bottomvisiblearea,TRANSPARENCY_PENS,0x00ff); | |
| 208 | sx,sy,0x00ff); | |
| 211 | 209 | } |
| 212 | 210 | } |
| 213 | 211 | } |
| r5077 | r5078 | |
| 269 | 267 | if (flipy) c += h-1-y; |
| 270 | 268 | else c += y; |
| 271 | 269 | |
| 272 | drawgfx(bitmap,machine->gfx[1], | |
| 270 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 273 | 271 | c, |
| 274 | 272 | color, |
| 275 | 273 | flipx,flipy, |
| 276 | sx,sy + 16*y, | |
| 277 | cliprect,TRANSPARENCY_PEN,0); | |
| 274 | sx,sy + 16*y,0); | |
| 278 | 275 | } |
| 279 | 276 | } |
| 280 | 277 | } |
| r5077 | r5078 | |
| 331 | 328 | int color = (attributes & 0xF0) >> 4; |
| 332 | 329 | int tile_number = videoram[offs] | ((attributes & 0x0F) << 8); |
| 333 | 330 | |
| 334 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 331 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 335 | 332 | tile_number, |
| 336 | 333 | color, |
| 337 | 334 | 0,0, |
| 338 | sx,sy, | |
| 339 | cliprect,TRANSPARENCY_NONE,0); | |
| 335 | sx,sy); | |
| 340 | 336 | } |
| 341 | 337 | |
| 342 | 338 | draw_sprites(screen->machine,bitmap,cliprect); |
| r5077 | r5078 | |
|---|---|---|
| 325 | 325 | |
| 326 | 326 | /* draw the sprites into seperate bitmaps and check overlapping region */ |
| 327 | 327 | 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), | |
| 329 | 329 | taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 3] & 0x3f, |
| 330 | 330 | 0, |
| 331 | 331 | taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 2] & 0x01, |
| 332 | 332 | taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 2] & 0x02, |
| 333 | sx1, sy1, | |
| 334 | 0, TRANSPARENCY_PEN, 0); | |
| 333 | sx1, sy1, 0); | |
| 335 | 334 | |
| 336 | 335 | 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), | |
| 338 | 337 | taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 3] & 0x3f, |
| 339 | 338 | 0, |
| 340 | 339 | taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 2] & 0x01, |
| 341 | 340 | taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 2] & 0x02, |
| 342 | sx2, sy2, | |
| 343 | 0, TRANSPARENCY_PEN, 0); | |
| 341 | sx2, sy2, 0); | |
| 344 | 342 | |
| 345 | 343 | for (y = miny; y < maxy; y++) |
| 346 | 344 | for (x = minx; x < maxx; x++) |
| r5077 | r5078 | |
| 481 | 479 | |
| 482 | 480 | /* draw sprite into a bitmap and check if layers collide */ |
| 483 | 481 | 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), | |
| 485 | 483 | taitosj_spriteram[SPRITE_RAM_PAGE_OFFSET + offs + 3] & 0x3f, |
| 486 | 484 | 0, |
| 487 | 485 | flip_x, flip_y, |
| 488 | 0,0, | |
| 489 | 0,TRANSPARENCY_PEN,0); | |
| 486 | 0,0,0); | |
| 490 | 487 | |
| 491 | 488 | for (y = miny; y < maxy; y++) |
| 492 | 489 | for (x = minx; x < maxx; x++) |
| r5077 | r5078 | |
| 540 | 537 | if (GLOBAL_FLIP_X) sx = 31 - sx; |
| 541 | 538 | if (GLOBAL_FLIP_Y) sy = 31 - sy; |
| 542 | 539 | |
| 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], | |
| 544 | 541 | taitosj_videoram_1[offs], |
| 545 | 542 | taitosj_colorbank[0] & 0x07, |
| 546 | 543 | GLOBAL_FLIP_X,GLOBAL_FLIP_Y, |
| 547 | 8*sx,8*sy, | |
| 548 | 0,TRANSPARENCY_PEN,0); | |
| 544 | 8*sx,8*sy,0); | |
| 549 | 545 | |
| 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], | |
| 551 | 547 | taitosj_videoram_2[offs], |
| 552 | 548 | (taitosj_colorbank[0] >> 4) & 0x07, |
| 553 | 549 | GLOBAL_FLIP_X,GLOBAL_FLIP_Y, |
| 554 | 8*sx,8*sy, | |
| 555 | 0,TRANSPARENCY_PEN,0); | |
| 550 | 8*sx,8*sy,0); | |
| 556 | 551 | |
| 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], | |
| 558 | 553 | taitosj_videoram_3[offs], |
| 559 | 554 | taitosj_colorbank[1] & 0x07, |
| 560 | 555 | GLOBAL_FLIP_X,GLOBAL_FLIP_Y, |
| 561 | 8*sx,8*sy, | |
| 562 | 0,TRANSPARENCY_PEN,0); | |
| 556 | 8*sx,8*sy,0); | |
| 563 | 557 | } |
| 564 | 558 | } |
| 565 | 559 | |
| r5077 | r5078 | |
| 616 | 610 | flip_y = !flip_y; |
| 617 | 611 | } |
| 618 | 612 | |
| 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); | |
| 622 | 615 | |
| 623 | 616 | /* 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); | |
| 627 | 619 | } |
| 628 | 620 | } |
| 629 | 621 | } |
| r5077 | r5078 | |
|---|---|---|
| 237 | 237 | flipy = !flipy; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | drawgfx(bitmap, machine->gfx[2 + bank], | |
| 240 | drawgfx_transpen(bitmap, cliprect, machine->gfx[2 + bank], | |
| 241 | 241 | code, color, |
| 242 | 242 | flipx, flipy, |
| 243 | sx, sy, | |
| 244 | cliprect, TRANSPARENCY_PEN, 0); | |
| 243 | sx, sy, 0); | |
| 245 | 244 | } |
| 246 | 245 | } |
| 247 | 246 | |
| r5077 | r5078 | |
| 297 | 296 | flipy = !flipy; |
| 298 | 297 | } |
| 299 | 298 | |
| 300 | drawgfx(bitmap, machine->gfx[2 + bank], | |
| 299 | drawgfx_transpen(bitmap, cliprect, machine->gfx[2 + bank], | |
| 301 | 300 | code, color, |
| 302 | 301 | flipx, flipy, |
| 303 | sx, sy, | |
| 304 | cliprect, TRANSPARENCY_PEN, 0); | |
| 302 | sx, sy, 0); | |
| 305 | 303 | } |
| 306 | 304 | } |
| 307 | 305 |
| r5077 | r5078 | |
|---|---|---|
| 376 | 376 | // code = spriteram[offs+1] + ((attr & 0x02) << 7); |
| 377 | 377 | code = spriteram[offs+1] + ((attr & 0x06) << 7); // for ninjemak, not sure ? |
| 378 | 378 | |
| 379 | drawgfx(bitmap,machine->gfx[2], | |
| 379 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 380 | 380 | code, |
| 381 | 381 | color + 16 * (spritepalettebank[code >> 2] & 0x0f), |
| 382 | 382 | flipx,flipy, |
| 383 | sx,sy, | |
| 384 | cliprect,TRANSPARENCY_PEN,15); | |
| 383 | sx,sy,15); | |
| 385 | 384 | } |
| 386 | 385 | } |
| 387 | 386 |
| r5077 | r5078 | |
|---|---|---|
| 175 | 175 | |
| 176 | 176 | if( flip_screen_get(machine) ) |
| 177 | 177 | { |
| 178 | drawgfx( bitmap,gfx, | |
| 178 | drawgfx_transpen( bitmap,cliprect,gfx, | |
| 179 | 179 | sprite_number&0x7f, |
| 180 | 180 | color, |
| 181 | 181 | 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 ); | |
| 184 | 183 | } |
| 185 | 184 | else |
| 186 | 185 | { |
| 187 | drawgfx( bitmap,gfx, | |
| 186 | drawgfx_transpen( bitmap,cliprect,gfx, | |
| 188 | 187 | sprite_number&0x7f, |
| 189 | 188 | color, |
| 190 | 189 | 0,sprite_number&0x80, |
| 191 | sx,sy, | |
| 192 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 190 | sx,sy,0 ); | |
| 193 | 191 | } |
| 194 | 192 | |
| 195 | 193 | source -= 4; |
| r5077 | r5078 | |
|---|---|---|
| 44 | 44 | int y = canyon_videoram[0x3d0 + 2 * i + 0x8]; |
| 45 | 45 | int c = canyon_videoram[0x3d0 + 2 * i + 0x9]; |
| 46 | 46 | |
| 47 | drawgfx(bitmap, machine->gfx[1], | |
| 47 | drawgfx_transpen(bitmap, cliprect, | |
| 48 | machine->gfx[1], | |
| 48 | 49 | c >> 3, |
| 49 | 50 | i, |
| 50 | 51 | !(c & 0x80), 0, |
| 51 | 52 | 224 - x, |
| 52 | 240 - y, | |
| 53 | cliprect, | |
| 54 | TRANSPARENCY_PEN, 0); | |
| 53 | 240 - y, 0); | |
| 55 | 54 | } |
| 56 | 55 | } |
| 57 | 56 |
| r5077 | r5078 | |
|---|---|---|
| 225 | 225 | |
| 226 | 226 | if (attr2 & 0x80) sx += 256; |
| 227 | 227 | |
| 228 | drawgfx(bitmap,gfx,number, | |
| 228 | drawgfx_transpen(bitmap,cliprect,gfx,number, | |
| 229 | 229 | 0x10 + (attr2 & 0x0f),attr & 0x40,attr & 0x80, |
| 230 | sx-8,sy, | |
| 231 | cliprect,TRANSPARENCY_PEN,0); | |
| 230 | sx-8,sy,0); | |
| 232 | 231 | } |
| 233 | 232 | } |
| 234 | 233 | |
| r5077 | r5078 | |
| 244 | 243 | int attr2 = splash_spriteram[i+0x400] >> splash_sprite_attr2_shift; |
| 245 | 244 | int number = (splash_spriteram[i] & 0xff) + (attr & 0xf)*256; |
| 246 | 245 | |
| 247 | drawgfx(bitmap,gfx,number, | |
| 246 | drawgfx_transpen(bitmap,cliprect,gfx,number, | |
| 248 | 247 | (attr2 & 0x7f),attr & 0x40,attr & 0x80, |
| 249 | sx-8,sy, | |
| 250 | cliprect,TRANSPARENCY_PEN,0); | |
| 248 | sx-8,sy,0); | |
| 251 | 249 | } |
| 252 | 250 | } |
| 253 | 251 |
| r5077 | r5078 | |
|---|---|---|
| 226 | 226 | else |
| 227 | 227 | code = f1gp_spr2cgram[map_start % (f1gp_spr2cgram_size/2)]; |
| 228 | 228 | |
| 229 | pdrawgfxzoom(bitmap,machine->gfx[1 + chip], | |
| 229 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1 + chip], | |
| 230 | 230 | code, |
| 231 | 231 | color, |
| 232 | 232 | flipx,flipy, |
| 233 | 233 | sx,sy, |
| 234 | cliprect,TRANSPARENCY_PEN,15, | |
| 235 | 234 | 0x1000 * zoomx,0x1000 * zoomy, |
| 235 | priority_bitmap, | |
| 236 | 236 | // pri ? 0 : 0x2); |
| 237 | primask); | |
| 237 | primask,15); | |
| 238 | 238 | map_start++; |
| 239 | 239 | } |
| 240 | 240 | |
| r5077 | r5078 | |
| 293 | 293 | gfx = 0; |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | pdrawgfx(bitmap,machine->gfx[1 + gfx], | |
| 296 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1 + gfx], | |
| 297 | 297 | code, |
| 298 | 298 | color, |
| 299 | 299 | flipx,flipy, |
| 300 | 300 | x,y, |
| 301 | cliprect,TRANSPARENCY_PEN,15, | |
| 302 | pri ? 0 : 0x2); | |
| 301 | priority_bitmap, | |
| 302 | pri ? 0 : 0x2,15); | |
| 303 | 303 | |
| 304 | 304 | // wrap around x |
| 305 | pdrawgfx(bitmap,machine->gfx[1 + gfx], | |
| 305 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1 + gfx], | |
| 306 | 306 | code, |
| 307 | 307 | color, |
| 308 | 308 | flipx,flipy, |
| 309 | 309 | x - 512,y, |
| 310 | cliprect,TRANSPARENCY_PEN,15, | |
| 311 | pri ? 0 : 0x2); | |
| 310 | priority_bitmap, | |
| 311 | pri ? 0 : 0x2,15); | |
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | |
| r5077 | r5078 | |
| 415 | 415 | map_start++; |
| 416 | 416 | |
| 417 | 417 | if (flipscreen) |
| 418 | drawgfxzoom(bitmap,machine->gfx[1], | |
| 418 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1], | |
| 419 | 419 | code, |
| 420 | 420 | color, |
| 421 | 421 | !flipx,!flipy, |
| 422 | 422 | 304-sx,208-sy, |
| 423 | cliprect,TRANSPARENCY_PEN,15, | |
| 424 | zoomx << 11,zoomy << 11); | |
| 423 | zoomx << 11,zoomy << 11,15); | |
| 425 | 424 | else |
| 426 | drawgfxzoom(bitmap,machine->gfx[1], | |
| 425 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1], | |
| 427 | 426 | code, |
| 428 | 427 | color, |
| 429 | 428 | flipx,flipy, |
| 430 | 429 | sx,sy, |
| 431 | cliprect,TRANSPARENCY_PEN,15, | |
| 432 | zoomx << 11,zoomy << 11); | |
| 430 | zoomx << 11,zoomy << 11,15); | |
| 433 | 431 | } |
| 434 | 432 | } |
| 435 | 433 | } |
| r5077 | r5078 | |
|---|---|---|
| 43 | 43 | sy = y; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 46 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 47 | 47 | tile, |
| 48 | 48 | tilecolour, |
| 49 | 49 | flipx, flipy, |
| 50 | sx,sy, | |
| 51 | cliprect,TRANSPARENCY_PEN,0); | |
| 50 | sx,sy,0); | |
| 52 | 51 | |
| 53 | 52 | /* second list interleaved with first (4bpp) ??? */ |
| 54 | 53 | dx = spriteram16[offs+4] & 0xff; |
| r5077 | r5078 | |
| 78 | 77 | tilecolour = (tilecolour&0x03f0) >> 4; |
| 79 | 78 | tilecolour ^=0x3f; // unusual, but correct.. |
| 80 | 79 | |
| 81 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 80 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 82 | 81 | tile, |
| 83 | 82 | tilecolour, |
| 84 | 83 | flipx, flipy, |
| 85 | sx,sy, | |
| 86 | cliprect,TRANSPARENCY_PEN,0); | |
| 84 | sx,sy,0); | |
| 87 | 85 | } |
| 88 | 86 | return 0; |
| 89 | 87 | } |
| r5077 | r5078 | |
| 133 | 131 | tilecolour = (tilecolour&0x00f0) >> 4; |
| 134 | 132 | tilecolour ^=0xf; // unusual, but correct.. |
| 135 | 133 | |
| 136 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 134 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 137 | 135 | tile, |
| 138 | 136 | tilecolour, |
| 139 | 137 | flipx, flipy, |
| 140 | sx,sy, | |
| 141 | cliprect,TRANSPARENCY_PEN,0); | |
| 138 | sx,sy,0); | |
| 142 | 139 | } |
| 143 | 140 | return 0; |
| 144 | 141 | } |
| r5077 | r5078 | |
| 175 | 172 | |
| 176 | 173 | if ((xpos > -16) && (ypos > 0) && (xpos < 256) && (ypos < 240) && (disbl !=2)) |
| 177 | 174 | { |
| 178 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 175 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 179 | 176 | tilen, |
| 180 | 177 | colr, |
| 181 | 178 | flipx, flipy, |
| 182 | xpos,ypos, | |
| 183 | cliprect,TRANSPARENCY_PEN,0); | |
| 179 | xpos,ypos,0); | |
| 184 | 180 | } |
| 185 | 181 | } |
| 186 | 182 | return 0; |
| r5077 | r5078 | |
| 264 | 260 | tilecolour = 0x10; |
| 265 | 261 | } |
| 266 | 262 | |
| 267 | drawgfx(bitmap,gfx, | |
| 263 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 268 | 264 | tile, |
| 269 | 265 | (tilecolour & 0xf0) >> 4, |
| 270 | 266 | flipx, flipy, |
| 271 | sx,sy, | |
| 272 | cliprect,TRANSPARENCY_PEN,0); | |
| 267 | sx,sy,0); | |
| 273 | 268 | } |
| 274 | 269 | return 0; |
| 275 | 270 | } |
| r5077 | r5078 | |
|---|---|---|
| 60 | 60 | int sy = offs >> 6 << 3; |
| 61 | 61 | UINT8 code = videoram[offs]; |
| 62 | 62 | |
| 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); | |
| 66 | 65 | } |
| 67 | 66 | |
| 68 | 67 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 144 | 144 | y = 248 - y; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | drawgfx(bitmap, screen->machine->gfx[0], | |
| 147 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], | |
| 148 | 148 | code & 0x3fff, |
| 149 | 149 | color, |
| 150 | 150 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), |
| 151 | x, y, | |
| 152 | cliprect, TRANSPARENCY_PEN, 15); | |
| 151 | x, y, 15); | |
| 153 | 152 | goffs += 2; |
| 154 | 153 | } |
| 155 | 154 | gfx_offs += height << 1; |
| r5077 | r5078 | |
| 214 | 213 | y = 248 - y; |
| 215 | 214 | } |
| 216 | 215 | |
| 217 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 216 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 218 | 217 | code & 0x3fff, |
| 219 | 218 | color, |
| 220 | 219 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), |
| 221 | x, y, | |
| 222 | cliprect, TRANSPARENCY_PEN, 15); | |
| 220 | x, y, 15); | |
| 223 | 221 | goffs += 2; |
| 224 | 222 | } |
| 225 | 223 | gfx_offs += height << 1; |
| r5077 | r5078 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | while (multi >= 0) |
| 130 | 130 | { |
| 131 | deco16_pdrawgfx(machine, | |
| 132 | bitmap,machine->gfx[gfxbank], | |
| 131 | deco16_pdrawgfx( | |
| 132 | bitmap,cliprect,machine->gfx[gfxbank], | |
| 133 | 133 | sprite - multi * inc, |
| 134 | 134 | colour, |
| 135 | 135 | fx,fy, |
| 136 | 136 | x,y + mult * multi, |
| 137 | | |
| 137 | | |
| 138 | 138 | |
| 139 | 139 | multi--; |
| 140 | 140 | } |
| r5077 | r5078 | |
|---|---|---|
| 239 | 239 | { |
| 240 | 240 | int code; |
| 241 | 241 | 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], | |
| 244 | 244 | code&1023, |
| 245 | 245 | ((code>>12)&0x3)+8, |
| 246 | 246 | code&0x8000, |
| 247 | 247 | code&0x4000, |
| 248 | 248 | (247-(x+(j<<3)))&0xff, |
| 249 | 249 | y, |
| 250 | cliprect,TRANSPARENCY_PEN, | |
| 251 | 250 | 0); |
| 252 | 251 | } |
| 253 | 252 | } |
| r5077 | r5078 | |
|---|---|---|
| 137 | 137 | color = spriteram[offs] & 0x1f; |
| 138 | 138 | schar = spriteram[offs + 2] & 0x7f; |
| 139 | 139 | |
| 140 | drawgfx(bitmap,machine->gfx[1], | |
| 140 | drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1], | |
| 141 | 141 | schar, |
| 142 | 142 | color, |
| 143 | 143 | flipx,flipy, |
| 144 | 144 | sx,sy, |
| 145 | &spritevisiblearea,TRANSPARENCY_PENS, | |
| 146 | 145 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 147 | 146 | } |
| 148 | 147 | } |
| r5077 | r5078 | |
|---|---|---|
| 138 | 138 | sy = 31 - row; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | drawgfx(bitmap,machine->gfx[0], | |
| 141 | drawgfx_opaque(bitmap,cliprect, | |
| 142 | machine->gfx[0], | |
| 142 | 143 | gotya_videoram2[row * 32 + col], |
| 143 | 144 | gotya_videoram2[row * 32 + col + 0x10] & 0x0f, |
| 144 | 145 | 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); | |
| 148 | 147 | } |
| 149 | 148 | } |
| 150 | 149 | |
| r5077 | r5078 | |
| 164 | 163 | sy = 240 - sy; |
| 165 | 164 | } |
| 166 | 165 | |
| 167 | drawgfx(bitmap,machine->gfx[1], | |
| 166 | drawgfx_transpen(bitmap,cliprect, | |
| 167 | machine->gfx[1], | |
| 168 | 168 | code, color, |
| 169 | 169 | flip_screen_x_get(machine), flip_screen_y_get(machine), |
| 170 | sx, sy, | |
| 171 | cliprect, | |
| 172 | TRANSPARENCY_PEN, 0); | |
| 170 | sx, sy, 0); | |
| 173 | 171 | } |
| 174 | 172 | } |
| 175 | 173 |
| r5077 | r5078 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | /********************************************************************/ |
| 249 | 249 | |
| 250 | INLINE void roundupt_drawgfxzoomrotate( running_machine *machine, | |
| 251 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 250 | INLINE void roundupt_drawgfxzoomrotate( | |
| 251 | bitmap_t *dest_bmp, const rectangle *clip, const gfx_element *gfx, | |
| 252 | 252 | UINT32 code,UINT32 color,int flipx,int flipy,UINT32 ssx,UINT32 ssy, |
| 253 | | |
| 253 | | |
| 254 | 254 | { |
| 255 | 255 | rectangle myclip; |
| 256 | 256 | |
| r5077 | r5078 | |
| 282 | 282 | { |
| 283 | 283 | if( gfx ) |
| 284 | 284 | { |
| 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)]; | |
| 286 | 286 | const UINT8 *shadow_pens = shadow_pen_array + (gfx->color_granularity * (color % gfx->total_colors)); |
| 287 | 287 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 288 | 288 | |
| r5077 | r5078 | |
| 643 | 643 | |
| 644 | 644 | for (w=0; w<x_width; w++) { |
| 645 | 645 | if (rotate) |
| 646 | roundupt_drawgfxzoomrotate(machine, | |
| 647 | temp_bitmap,machine->gfx[0], | |
| 646 | roundupt_drawgfxzoomrotate( | |
| 647 | temp_bitmap,cliprect,machine->gfx[0], | |
| 648 | 648 | base, |
| 649 | 649 | color,fx,0,x_pos,render_y, |
| 650 | | |
| 650 | | |
| 651 | 651 | else |
| 652 | roundupt_drawgfxzoomrotate(machine, | |
| 653 | bitmap,machine->gfx[0], | |
| 652 | roundupt_drawgfxzoomrotate( | |
| 653 | bitmap,cliprect,machine->gfx[0], | |
| 654 | 654 | base, |
| 655 | 655 | color,fx,0,x_pos,render_y, |
| 656 | | |
| 656 | | |
| 657 | 657 | base++; |
| 658 | 658 | |
| 659 | 659 | if (fx) |
| r5077 | r5078 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | while (multi >= 0) |
| 71 | 71 | { |
| 72 | drawgfx(bitmap,machine->gfx[2], | |
| 72 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 73 | 73 | sprite - multi * inc, |
| 74 | 74 | colour, |
| 75 | 75 | fx,fy, |
| 76 | x,y + mult * multi, | |
| 77 | cliprect,TRANSPARENCY_PEN,0); | |
| 76 | x,y + mult * multi,0); | |
| 78 | 77 | |
| 79 | 78 | multi--; |
| 80 | 79 | } |
| r5077 | r5078 | |
|---|---|---|
| 1292 | 1292 | * |
| 1293 | 1293 | */ |
| 1294 | 1294 | |
| 1295 | void K007121_sprites_draw(int chip,bitmap_t *bitmap,gfx_element **gfxs, colortable_t *ctable, | |
| 1296 | const rectangle *cliprect, const UINT8 *source,int base_color, | |
| 1295 | void K007121_sprites_draw(int chip,bitmap_t *bitmap,const rectangle *cliprect, gfx_element **gfxs, colortable_t *ctable, | |
| 1296 | const UINT8 *source,int base_color, | |
| 1297 | 1297 | int global_x_offset,int bank_base, UINT32 pri_mask) |
| 1298 | 1298 | { |
| 1299 | 1299 | const gfx_element *gfx = gfxs[chip]; |
| r5077 | r5078 | |
| 1804 | 1804 | |
| 1805 | 1805 | if (c & bankmask) continue; else c += bank; |
| 1806 | 1806 | |
| 1807 | drawgfx(bitmap,K007420_gfx, | |
| 1807 | drawgfx_transpen(bitmap,cliprect,K007420_gfx, | |
| 1808 | 1808 | c, |
| 1809 | 1809 | color, |
| 1810 | 1810 | flipx,flipy, |
| 1811 | sx,sy, | |
| 1812 | cliprect,TRANSPARENCY_PEN,0); | |
| 1811 | sx,sy,0); | |
| 1813 | 1812 | |
| 1814 | 1813 | if (K007342_regs[2] & 0x80) |
| 1815 | drawgfx(bitmap,K007420_gfx, | |
| 1814 | drawgfx_transpen(bitmap,cliprect,K007420_gfx, | |
| 1816 | 1815 | c, |
| 1817 | 1816 | color, |
| 1818 | 1817 | flipx,flipy, |
| 1819 | sx,sy-256, | |
| 1820 | cliprect,TRANSPARENCY_PEN,0); | |
| 1818 | sx,sy-256,0); | |
| 1821 | 1819 | } |
| 1822 | 1820 | } |
| 1823 | 1821 | } |
| r5077 | r5078 | |
| 1842 | 1840 | |
| 1843 | 1841 | if (c & bankmask) continue; else c += bank; |
| 1844 | 1842 | |
| 1845 | drawgfxzoom(bitmap,K007420_gfx, | |
| 1843 | drawgfxzoom_transpen(bitmap,cliprect,K007420_gfx, | |
| 1846 | 1844 | c, |
| 1847 | 1845 | color, |
| 1848 | 1846 | flipx,flipy, |
| 1849 | 1847 | sx,sy, |
| 1850 | cliprect,TRANSPARENCY_PEN,0, | |
| 1851 | (zw << 16) / 8,(zh << 16) / 8); | |
| 1848 | (zw << 16) / 8,(zh << 16) / 8,0); | |
| 1852 | 1849 | |
| 1853 | 1850 | if (K007342_regs[2] & 0x80) |
| 1854 | drawgfxzoom(bitmap,K007420_gfx, | |
| 1851 | drawgfxzoom_transpen(bitmap,cliprect,K007420_gfx, | |
| 1855 | 1852 | c, |
| 1856 | 1853 | color, |
| 1857 | 1854 | flipx,flipy, |
| 1858 | 1855 | sx,sy-256, |
| 1859 | cliprect,TRANSPARENCY_PEN,0, | |
| 1860 | (zw << 16) / 8,(zh << 16) / 8); | |
| 1856 | (zw << 16) / 8,(zh << 16) / 8,0); | |
| 1861 | 1857 | } |
| 1862 | 1858 | } |
| 1863 | 1859 | } |
| r5077 | r5078 | |
|---|---|---|
| 200 | 200 | x = (x & 0x1ff) - 0x10; |
| 201 | 201 | y = 0xf0 - ((y & 0xff) - (y & 0x100)); |
| 202 | 202 | |
| 203 | pdrawgfx( bitmap, machine->gfx[0], | |
| 203 | pdrawgfx_transpen( bitmap, cliprect, machine->gfx[0], | |
| 204 | 204 | code, |
| 205 | 205 | 0x20 + (attr & 0xf), |
| 206 | 206 | flipx, flipy, |
| 207 | 207 | x, y, |
| 208 | cliprect, TRANSPARENCY_PEN,0, | |
| 209 | pri_mask ); | |
| 208 | priority_bitmap, | |
| 209 | pri_mask,0 ); | |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 |
| r5077 | r5078 | |
|---|---|---|
| 218 | 218 | { |
| 219 | 219 | for (x = 0;x <= sizex;x++) |
| 220 | 220 | { |
| 221 | drawgfx(bitmap,machine->gfx[1], | |
| 221 | drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1], | |
| 222 | 222 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 223 | 223 | color, |
| 224 | 224 | flipx,flipy, |
| 225 | 225 | sx + 16*x,sy + 16*y, |
| 226 | &spritevisiblearea,TRANSPARENCY_PENS, | |
| 227 | 226 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0xff)); |
| 228 | 227 | } |
| 229 | 228 | } |
| r5077 | r5078 | |
|---|---|---|
| 11 | 11 | void K007121_ctrl_w(int chip,int offset,int data); |
| 12 | 12 | WRITE8_HANDLER( K007121_ctrl_0_w ); |
| 13 | 13 | WRITE8_HANDLER( K007121_ctrl_1_w ); |
| 14 | void K007121_sprites_draw(int chip,bitmap_t *bitmap,gfx_element **gfxs, colortable_t *ctable, | |
| 15 | const rectangle *cliprect, const UINT8 *source,int base_color, | |
| 14 | void K007121_sprites_draw(int chip,bitmap_t *bitmap,const rectangle *cliprect, gfx_element **gfxs, colortable_t *ctable, | |
| 15 | const UINT8 *source,int base_color, | |
| 16 | 16 | int global_x_offset,int bank_base, UINT32 pri_mask); |
| 17 | 17 | |
| 18 | 18 |
| r5077 | r5078 | |
|---|---|---|
| 88 | 88 | int bank = i; /* that fixes it for now :-/ */ |
| 89 | 89 | int flip = spriteram[i+8] >> 5; /* bit #5 flip vertical flag */ |
| 90 | 90 | |
| 91 | drawgfx(bitmap, machine->gfx[bank + 1], code, 0, flip, 0, x, y | |
| 91 | drawgfx_transpen(bitmap, clip, machine->gfx[bank + 1], code, 0, flip, 0, x, y | |
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 |
| r5077 | r5078 | |
|---|---|---|
| 126 | 126 | flipy = !flipy; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | drawgfx(bitmap, machine->gfx[2], | |
| 129 | drawgfx_transpen(bitmap, cliprect, | |
| 130 | machine->gfx[2], | |
| 130 | 131 | code, color, |
| 131 | 132 | flipx, flipy, |
| 132 | sx, sy, | |
| 133 | cliprect, | |
| 134 | TRANSPARENCY_PEN, 0); | |
| 133 | sx, sy, 0); | |
| 135 | 134 | |
| 136 | 135 | if (multi) |
| 137 | 136 | { |
| 138 | drawgfx(bitmap,machine->gfx[2], | |
| 137 | drawgfx_transpen(bitmap,cliprect, | |
| 138 | machine->gfx[2], | |
| 139 | 139 | code + 1, color, |
| 140 | 140 | 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); | |
| 144 | 142 | } |
| 145 | 143 | } |
| 146 | 144 | } |
| r5077 | r5078 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | if (srmp2_color_bank) color |= 0x20; |
| 109 | 109 | |
| 110 | drawgfx(bitmap, machine->gfx[0], | |
| 110 | drawgfx_transpen(bitmap, cliprect, machine->gfx[0], | |
| 111 | 111 | code, |
| 112 | 112 | color, |
| 113 | 113 | flipx, flipy, |
| 114 | 114 | (x + xoffs) & 0x1ff, |
| 115 | max_y - ((y + yoffs) & 0x0ff), | |
| 116 | cliprect, TRANSPARENCY_PEN, 15); | |
| 115 | max_y - ((y + yoffs) & 0x0ff), 15); | |
| 117 | 116 | } |
| 118 | 117 | } |
| 119 | 118 | |
| r5077 | r5078 | |
| 173 | 172 | code = code & 0x1fff; |
| 174 | 173 | |
| 175 | 174 | #define DRAWTILE(_x_, _y_) \ |
| 176 | drawgfx(bitmap, machine->gfx[0], \ | |
| 175 | drawgfx_transpen(bitmap, \ | |
| 176 | cliprect, machine->gfx[0], \ | |
| 177 | 177 | code, \ |
| 178 | 178 | color, \ |
| 179 | 179 | flipx, flipy, \ |
| 180 | _x_, _y_, \ | |
| 181 | cliprect, TRANSPARENCY_PEN, 0); | |
| 180 | _x_, _y_, 0); | |
| 182 | 181 | |
| 183 | 182 | DRAWTILE(sx - 0x000, sy + 0x000) |
| 184 | 183 | DRAWTILE(sx - 0x200, sy + 0x000) |
| r5077 | r5078 | |
| 264 | 263 | flipy = !flipy; |
| 265 | 264 | } |
| 266 | 265 | |
| 267 | drawgfx(bitmap,machine->gfx[0], | |
| 266 | drawgfx_transpen(bitmap,cliprect, machine->gfx[0], | |
| 268 | 267 | code, |
| 269 | 268 | color, |
| 270 | 269 | flipx, flipy, |
| 271 | 270 | (x + xoffs) & 0x1ff, |
| 272 | max_y - ((y + yoffs) & 0x0ff), | |
| 273 | cliprect, TRANSPARENCY_PEN, 0); | |
| 271 | max_y - ((y + yoffs) & 0x0ff), 0); | |
| 274 | 272 | } |
| 275 | 273 | } |
| 276 | 274 | |
| r5077 | r5078 | |
| 337 | 335 | code = (code & 0x3fff) + (gfxbank ? 0x4000 : 0); |
| 338 | 336 | |
| 339 | 337 | #define DRAWTILE(_x_, _y_) \ |
| 340 | drawgfx(bitmap, machine->gfx[0], \ | |
| 338 | drawgfx_transpen(bitmap, \ | |
| 339 | cliprect, machine->gfx[0], \ | |
| 341 | 340 | code, \ |
| 342 | 341 | color, \ |
| 343 | 342 | flipx, flipy, \ |
| 344 | _x_, _y_, \ | |
| 345 | cliprect, TRANSPARENCY_PEN, 0); | |
| 343 | _x_, _y_, 0); | |
| 346 | 344 | |
| 347 | 345 | DRAWTILE(sx - 0x000, sy + 0x000) |
| 348 | 346 | DRAWTILE(sx - 0x200, sy + 0x000) |
| r5077 | r5078 | |
| 421 | 419 | flipy = !flipy; |
| 422 | 420 | } |
| 423 | 421 | |
| 424 | drawgfx(bitmap,machine->gfx[0], | |
| 422 | drawgfx_transpen(bitmap,cliprect, machine->gfx[0], | |
| 425 | 423 | code, |
| 426 | 424 | color, |
| 427 | 425 | flipx, flipy, |
| 428 | 426 | (x + xoffs) & 0x1ff, |
| 429 | max_y - ((y + yoffs) & 0x0ff), | |
| 430 | cliprect, TRANSPARENCY_PEN, 0); | |
| 427 | max_y - ((y + yoffs) & 0x0ff), 0); | |
| 431 | 428 | } |
| 432 | 429 | } |
| 433 | 430 |
| r5077 | r5078 | |
|---|---|---|
| 443 | 443 | if (flipy) c += h-1-y; |
| 444 | 444 | else c += y; |
| 445 | 445 | |
| 446 | drawgfx(bitmap,machine->gfx[0], | |
| 446 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 447 | 447 | c, |
| 448 | 448 | color, |
| 449 | 449 | flipx,flipy, |
| 450 | sx + 16*x,sy + 16*y, | |
| 451 | cliprect,TRANSPARENCY_PEN,0); | |
| 450 | sx + 16*x,sy + 16*y,0); | |
| 452 | 451 | } |
| 453 | 452 | } |
| 454 | 453 | |
| r5077 | r5078 | |
| 495 | 494 | if (flipy) c += h-1-y; |
| 496 | 495 | else c += y; |
| 497 | 496 | |
| 498 | drawgfx(bitmap,machine->gfx[2], | |
| 497 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 499 | 498 | c, |
| 500 | 499 | color, |
| 501 | 500 | flipx,flipy, |
| 502 | sx + 16*x,sy + 16*y, | |
| 503 | cliprect,TRANSPARENCY_PEN,0); | |
| 501 | sx + 16*x,sy + 16*y,0); | |
| 504 | 502 | } |
| 505 | 503 | } |
| 506 | 504 | } |
| r5077 | r5078 | |
|---|---|---|
| 97 | 97 | if (sy >= 32768) sy -= 65536; |
| 98 | 98 | flipx = sr[offs+3] & 0x8000; |
| 99 | 99 | |
| 100 | drawgfx(bitmap,machine->gfx[1], | |
| 100 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 101 | 101 | code, |
| 102 | 102 | color, |
| 103 | 103 | flipx,0, |
| 104 | sx,sy, | |
| 105 | cliprect,TRANSPARENCY_PEN,0); | |
| 104 | sx,sy,0); | |
| 106 | 105 | } |
| 107 | 106 | } |
| 108 | 107 |
| r5077 | r5078 | |
|---|---|---|
| 56 | 56 | if (flipy) flipy=0; else flipy=1; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | drawgfx(bitmap,machine->gfx[1], | |
| 59 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 60 | 60 | spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8), |
| 61 | 61 | (spriteram[offs+1] & 0x70) >> 4, |
| 62 | 62 | flipx,flipy, |
| 63 | sx,sy, | |
| 64 | cliprect,TRANSPARENCY_PEN,0); | |
| 63 | sx,sy,0); | |
| 65 | 64 | } |
| 66 | 65 | } |
| 67 | 66 | } |
| r5077 | r5078 | |
|---|---|---|
| 247 | 247 | fy = !fy; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | drawgfx(bitmap,machine->gfx[1], | |
| 250 | drawgfx_transpen(bitmap,cliprect, machine->gfx[1], | |
| 251 | 251 | tile, |
| 252 | 252 | color, |
| 253 | 253 | fx, fy, |
| 254 | mx, my, | |
| 255 | cliprect, TRANSPARENCY_PEN, 0); | |
| 254 | mx, my, 0); | |
| 256 | 255 | } |
| 257 | 256 | else |
| 258 | 257 | { |
| r5077 | r5078 | |
|---|---|---|
| 135 | 135 | y = 240 - y; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | drawgfx(bitmap, machine->gfx[1], | |
| 138 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 139 | 139 | spriteram[offs+1], |
| 140 | 140 | spriteram[offs+2] & 0x07, |
| 141 | 141 | 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); | |
| 144 | 143 | } |
| 145 | 144 | } |
| 146 | 145 |
| r5077 | r5078 | |
|---|---|---|
| 168 | 168 | |
| 169 | 169 | gfx_element_set_source(machine->gfx[0], madalien_charram); |
| 170 | 170 | |
| 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); | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 |
| r5077 | r5078 | |
|---|---|---|
| 239 | 239 | { |
| 240 | 240 | if (flip_screen_get(machine)) sy -= 16; |
| 241 | 241 | |
| 242 | drawgfx(bitmap,machine->gfx[3], | |
| 242 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 243 | 243 | code & ~1, |
| 244 | 244 | color, |
| 245 | 245 | 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], | |
| 249 | 248 | code | 1, |
| 250 | 249 | color, |
| 251 | 250 | flipx,flipy, |
| 252 | sx,flipy ? sy + 16 : sy, | |
| 253 | cliprect,TRANSPARENCY_PEN,0); | |
| 251 | sx,flipy ? sy + 16 : sy,0); | |
| 254 | 252 | |
| 255 | 253 | /* redraw with wraparound */ |
| 256 | drawgfx(bitmap,machine->gfx[3], | |
| 254 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 257 | 255 | code & ~1, |
| 258 | 256 | color, |
| 259 | 257 | 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], | |
| 263 | 260 | code | 1, |
| 264 | 261 | color, |
| 265 | 262 | flipx,flipy, |
| 266 | sx - 256,flipy ? sy + 16 : sy, | |
| 267 | cliprect,TRANSPARENCY_PEN,0); | |
| 263 | sx - 256,flipy ? sy + 16 : sy,0); | |
| 268 | 264 | } |
| 269 | 265 | else |
| 270 | 266 | { |
| 271 | drawgfx(bitmap,machine->gfx[3], | |
| 267 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 272 | 268 | code, |
| 273 | 269 | color, |
| 274 | 270 | flipx,flipy, |
| 275 | sx,sy, | |
| 276 | cliprect,TRANSPARENCY_PEN,0); | |
| 271 | sx,sy,0); | |
| 277 | 272 | |
| 278 | 273 | /* redraw with wraparound */ |
| 279 | drawgfx(bitmap,machine->gfx[3], | |
| 274 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 280 | 275 | code, |
| 281 | 276 | color, |
| 282 | 277 | flipx,flipy, |
| 283 | sx - 256,sy, | |
| 284 | cliprect,TRANSPARENCY_PEN,0); | |
| 278 | sx - 256,sy,0); | |
| 285 | 279 | } |
| 286 | 280 | } |
| 287 | 281 | } |
| r5077 | r5078 | |
|---|---|---|
| 195 | 195 | |
| 196 | 196 | for (y = 0; y < ny; y++) |
| 197 | 197 | { |
| 198 | drawgfx(bitmap,machine->gfx[0], | |
| 198 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 199 | 199 | code + (flipy ? (ny - y - 1) : y), |
| 200 | 200 | color, |
| 201 | 201 | 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 ); | |
| 204 | 203 | } |
| 205 | 204 | } |
| 206 | 205 | } |
| r5077 | r5078 | |
|---|---|---|
| 129 | 129 | for (blocky = 0; blocky<ysize;blocky++) { |
| 130 | 130 | |
| 131 | 131 | |
| 132 | drawgfx( | |
| 132 | drawgfx_transpen( | |
| 133 | 133 | bitmap, |
| 134 | cliprect, | |
| 134 | 135 | gfx, |
| 135 | 136 | num+(blocky*xsize)+blockx, |
| 136 | 137 | 1, |
| 137 | 138 | 0,0, |
| 138 | xpos+blockx*8,ypos+blocky*8, | |
| 139 | cliprect, | |
| 140 | TRANSPARENCY_PEN,0 | |
| 139 | xpos+blockx*8,ypos+blocky*8,0 | |
| 141 | 140 | ); |
| 142 | 141 | |
| 143 | drawgfx( | |
| 142 | drawgfx_transpen( | |
| 144 | 143 | bitmap, |
| 144 | cliprect, | |
| 145 | 145 | gfx, |
| 146 | 146 | num+(blocky*xsize)+blockx, |
| 147 | 147 | 1, |
| 148 | 148 | 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 | |
| 152 | 150 | ); |
| 153 | 151 | } |
| 154 | 152 | } |
| r5077 | r5078 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | ypos = 512-ypos; |
| 116 | 116 | |
| 117 | drawgfx( bitmap, | |
| 117 | drawgfx_transpen( bitmap, | |
| 118 | cliprect, | |
| 118 | 119 | gfx, |
| 119 | 120 | num, |
| 120 | 121 | 64+attr, |
| 121 | 122 | 0,0, |
| 122 | xpos+stlforce_sprxoffs,ypos, | |
| 123 | cliprect, | |
| 124 | TRANSPARENCY_PEN,0 ); | |
| 123 | xpos+stlforce_sprxoffs,ypos,0 ); | |
| 125 | 124 | } |
| 126 | 125 | |
| 127 | 126 | source += 0x4; |
| r5077 | r5078 | |
|---|---|---|
| 99 | 99 | zx = x + (((k+1)*zoomx)/8) - curx; |
| 100 | 100 | zy = y + (((j+1)*zoomy)/16) - cury; |
| 101 | 101 | |
| 102 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 102 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 103 | 103 | code, |
| 104 | 104 | color, |
| 105 | 105 | flipx,flipy, |
| 106 | 106 | curx,cury, |
| 107 | cliprect,TRANSPARENCY_PEN,0, | |
| 108 | 107 | zx<<12,zy<<13, |
| 109 | primasks[priority]); | |
| 108 | priority_bitmap,primasks[priority],0); | |
| 110 | 109 | } |
| 111 | 110 | |
| 112 | 111 | if (bad_chunks) |
| r5077 | r5078 | |
|---|---|---|
| 123 | 123 | flipx = !flipx; flipy = !flipy; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | drawgfx(bitmap,machine->gfx[0], | |
| 126 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 127 | 127 | // code + ((attr & 0x18)<<5), |
| 128 | 128 | code + ((attr & 0x08)<<5), |
| 129 | 129 | attr, |
| 130 | 130 | flipx, flipy, |
| 131 | x,y, | |
| 132 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 131 | x,y,0 ); | |
| 133 | 132 | } |
| 134 | 133 | } |
| 135 | 134 |
| r5077 | r5078 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | if (x >= 0x180) x -= 0x200; |
| 134 | 134 | |
| 135 | drawgfx(bitmap,machine->gfx[0], code,color, flipx,flipy, x,y | |
| 135 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], code,color, flipx,flipy, x,y | |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 |
| r5077 | r5078 | |
|---|---|---|
| 149 | 149 | flipy = !flipy; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | drawgfx(bitmap,machine->gfx[2], | |
| 152 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 153 | 153 | code, |
| 154 | 154 | colour, |
| 155 | 155 | flip_screen_get(machine),flipy, |
| 156 | sx, sy, | |
| 157 | cliprect,TRANSPARENCY_PEN,15); | |
| 156 | sx, sy,15); | |
| 158 | 157 | } |
| 159 | 158 | } |
| 160 | 159 |
| r5077 | r5078 | |
|---|---|---|
| 285 | 285 | for (ax=0; ax<dx; ax++) |
| 286 | 286 | for (ay=0; ay<dy; ay++) |
| 287 | 287 | { |
| 288 | drawgfx(bitmap,machine->gfx[3], | |
| 288 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 289 | 289 | 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); | |
| 292 | 291 | } |
| 293 | 292 | } |
| 294 | 293 | else |
| r5077 | r5078 | |
| 296 | 295 | for (ax=0; ax<dx; ax++) |
| 297 | 296 | for (ay=0; ay<dy; ay++) |
| 298 | 297 | { |
| 299 | drawgfx(bitmap,machine->gfx[3], | |
| 298 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 300 | 299 | 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); | |
| 303 | 301 | } |
| 304 | 302 | } |
| 305 | 303 | } |
| r5077 | r5078 | |
| 310 | 308 | for (ax=0; ax<dx; ax++) |
| 311 | 309 | for (ay=0; ay<dy; ay++) |
| 312 | 310 | { |
| 313 | drawgfx(bitmap,machine->gfx[3], | |
| 311 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 314 | 312 | 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); | |
| 317 | 314 | } |
| 318 | 315 | } |
| 319 | 316 | else |
| r5077 | r5078 | |
| 321 | 318 | for (ax=0; ax<dx; ax++) |
| 322 | 319 | for (ay=0; ay<dy; ay++) |
| 323 | 320 | { |
| 324 | drawgfx(bitmap,machine->gfx[3], | |
| 321 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 325 | 322 | 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); | |
| 328 | 324 | } |
| 329 | 325 | } |
| 330 | 326 | } |
| r5077 | r5078 | |
|---|---|---|
| 116 | 116 | flipy = !flipy; |
| 117 | 117 | } |
| 118 | 118 | |
| 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 */ | |
| 120 | 120 | spriteram[offs], |
| 121 | 121 | spriteram[offs + 1] & 0x0f, |
| 122 | 122 | 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); | |
| 125 | 124 | } |
| 126 | 125 | } |
| 127 | 126 |
| r5077 | r5078 | |
|---|---|---|
| 249 | 249 | The color 8 is used to cover over other sprites. */ |
| 250 | 250 | |
| 251 | 251 | /* 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); | |
| 254 | 254 | |
| 255 | 255 | /* 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); | |
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | |
| r5077 | r5078 | |
| 305 | 305 | The color 8 is used to cover over other sprites. */ |
| 306 | 306 | |
| 307 | 307 | /* 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); | |
| 310 | 310 | |
| 311 | 311 | /* 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); | |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 |
| r5077 | r5078 | |
|---|---|---|
| 45 | 45 | sy = 248 - sy; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 48 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 49 | 49 | code, col, |
| 50 | 50 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), |
| 51 | sx, sy, | |
| 52 | cliprect,TRANSPARENCY_PEN,0); | |
| 51 | sx, sy,0); | |
| 53 | 52 | } |
| 54 | 53 | return 0; |
| 55 | 54 | } |
| r5077 | r5078 | |
|---|---|---|
| 196 | 196 | flipx = !flipx; |
| 197 | 197 | flipy = !flipy; |
| 198 | 198 | } |
| 199 | drawgfx(bitmap,machine->gfx[1+spritebank], | |
| 199 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1+spritebank], | |
| 200 | 200 | tile, |
| 201 | 201 | color, |
| 202 | 202 | flipx,flipy, |
| 203 | 203 | sx,sy, |
| 204 | cliprect,TRANSPARENCY_PENS, | |
| 205 | 204 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1+spritebank], color, 0x8f)); |
| 206 | 205 | } |
| 207 | 206 | } |
| r5077 | r5078 | |
|---|---|---|
| 188 | 188 | { |
| 189 | 189 | y -= 14; |
| 190 | 190 | x -= 7; |
| 191 | drawgfx(bitmap,machine->gfx[1], | |
| 191 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 192 | 192 | state->spriteram[offs + 2], |
| 193 | 193 | (state->spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor, |
| 194 | 194 | !(state->spriteram[offs + 1] & 0x80),!(state->spriteram[offs + 1] & 0x40), |
| 195 | x, y, | |
| 196 | cliprect,TRANSPARENCY_PEN,0); | |
| 195 | x, y,0); | |
| 197 | 196 | } |
| 198 | 197 | else |
| 199 | 198 | { |
| 200 | 199 | y += 1; |
| 201 | 200 | x -= 8; |
| 202 | drawgfx(bitmap,machine->gfx[1], | |
| 201 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 203 | 202 | state->spriteram[offs + 2], |
| 204 | 203 | (state->spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor, |
| 205 | 204 | (state->spriteram[offs + 1] & 0x80),(state->spriteram[offs + 1] & 0x40), |
| 206 | x, y, | |
| 207 | cliprect,TRANSPARENCY_PEN,0); | |
| 205 | x, y,0); | |
| 208 | 206 | } |
| 209 | 207 | } |
| 210 | 208 | } |
| r5077 | r5078 | |
|---|---|---|
| 153 | 153 | { |
| 154 | 154 | shade = ((spriteram[obj*2+1 + 0x20]) & 0x07); |
| 155 | 155 | |
| 156 | drawgfx(bitmap,machine->gfx[gfx + 1], | |
| 156 | drawgfx_transpen(bitmap,&bigfield_area,machine->gfx[gfx + 1], | |
| 157 | 157 | charcode, shade, |
| 158 | flipx,flipy,sx,sy, | |
| 159 | &bigfield_area,TRANSPARENCY_PEN,0); | |
| 158 | flipx,flipy,sx,sy,0); | |
| 160 | 159 | |
| 161 | 160 | shade = ((spriteram[obj*2+1 + 0x20]) & 0x08) >> 3; |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | drawgfx(bitmap,machine->gfx[gfx], | |
| 163 | drawgfx_transpen(bitmap,&bigfield_area,machine->gfx[gfx], | |
| 165 | 164 | charcode, shade, |
| 166 | flipx,flipy,sx,sy, | |
| 167 | &bigfield_area,TRANSPARENCY_PEN,0); | |
| 165 | flipx,flipy,sx,sy,0); | |
| 168 | 166 | |
| 169 | 167 | /* If this isn't soccer, handle the multiplexed sprites */ |
| 170 | 168 | if (!is_soccer) |
| r5077 | r5078 | |
| 174 | 172 | if ((charcode == 0x11) && (sy == 0x07)) |
| 175 | 173 | { |
| 176 | 174 | sy = 0xf1; /* When multiplexed, it's 0x10...why? */ |
| 177 | drawgfx(bitmap,machine->gfx[gfx], | |
| 175 | drawgfx_transpen(bitmap,&bigfield_area,machine->gfx[gfx], | |
| 178 | 176 | charcode, 0, |
| 179 | flipx,flipy,sx,sy, | |
| 180 | &bigfield_area,TRANSPARENCY_PEN,0); | |
| 177 | flipx,flipy,sx,sy,0); | |
| 181 | 178 | } |
| 182 | 179 | } |
| 183 | 180 | } |
| r5077 | r5078 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | if (!flipx) { |
| 39 | 39 | for (wcount=0;wcount<width;wcount++) { |
| 40 | pdrawgfx(bitmap,gfx,tileno+wcount,color,0,0,xpos+wcount*16+8,ypos, | |
| 40 | pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+wcount,color,0,0,xpos+wcount*16+8,ypos, | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | } else { |
| 44 | 44 | |
| 45 | 45 | for (wcount=width;wcount>0;wcount--) { |
| 46 | pdrawgfx(bitmap,gfx,tileno+(width-wcount),color,1,0,xpos+wcount*16-16+8,ypos, | |
| 46 | pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+(width-wcount),color,1,0,xpos+wcount*16-16+8,ypos, | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | } |
| r5077 | r5078 | |
|---|---|---|
| 85 | 85 | { |
| 86 | 86 | for (j = 0; j < 2; j++) |
| 87 | 87 | { |
| 88 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 88 | drawgfx_transpen(bitmap, &rect, screen->machine->gfx[1], | |
| 89 | 89 | 0, 0, |
| 90 | 90 | 0, 0, |
| 91 | 91 | x + 16 * i, |
| 92 | y + 16 * j, | |
| 93 | &rect, TRANSPARENCY_PEN, 0); | |
| 92 | y + 16 * j, 0); | |
| 94 | 93 | } |
| 95 | 94 | } |
| 96 | 95 |
| r5077 | r5078 | |
|---|---|---|
| 114 | 114 | flipy = !flipy; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | drawgfx(bitmap, machine->gfx[1], | |
| 117 | drawgfx_transpen(bitmap, 0, machine->gfx[1], | |
| 118 | 118 | code, color, |
| 119 | 119 | flipx, flipy, |
| 120 | sx, sy, | |
| 121 | 0, TRANSPARENCY_PEN, 0); | |
| 120 | sx, sy, 0); | |
| 122 | 121 | |
| 123 | 122 | /* double height */ |
| 124 | 123 | |
| 125 | 124 | if (attr & 0x10) |
| 126 | 125 | { |
| 127 | drawgfx(bitmap,machine->gfx[1], | |
| 126 | drawgfx_transpen(bitmap,cliprect, machine->gfx[1], | |
| 128 | 127 | code + 1, color, |
| 129 | 128 | 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); | |
| 132 | 130 | } |
| 133 | 131 | } |
| 134 | 132 | } |
| r5077 | r5078 | |
|---|---|---|
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | drawgfx(tmpbitmap,screen->machine->gfx[0], | |
| 226 | drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[0], | |
| 227 | 227 | naughtyb_videoram2[offs] + 256 * bankreg, |
| 228 | 228 | (naughtyb_videoram2[offs] >> 5) + 8 * palreg, |
| 229 | 229 | naughtyb_cocktail,naughtyb_cocktail, |
| 230 | 8*sx,8*sy, | |
| 231 | 0,TRANSPARENCY_NONE,0); | |
| 230 | 8*sx,8*sy); | |
| 232 | 231 | |
| 233 | drawgfx(tmpbitmap,screen->machine->gfx[1], | |
| 232 | drawgfx_transpen(tmpbitmap,0,screen->machine->gfx[1], | |
| 234 | 233 | videoram[offs] + 256*bankreg, |
| 235 | 234 | (videoram[offs] >> 5) + 8 * palreg, |
| 236 | 235 | naughtyb_cocktail,naughtyb_cocktail, |
| 237 | 8*sx,8*sy, | |
| 238 | 0,TRANSPARENCY_PEN,0); | |
| 236 | 8*sx,8*sy,0); | |
| 239 | 237 | } |
| 240 | 238 | |
| 241 | 239 | // copy the temporary bitmap to the screen |
| r5077 | r5078 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | code |= (runaway_sprite_ram[i + 0x30] << 2) & 0x1c0; |
| 111 | 111 | |
| 112 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 112 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 113 | 113 | code, |
| 114 | 114 | 0, |
| 115 | 115 | flipx, flipy, |
| 116 | x, 240 - y, | |
| 117 | cliprect, TRANSPARENCY_PEN, 0); | |
| 116 | x, 240 - y, 0); | |
| 118 | 117 | |
| 119 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 118 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 120 | 119 | code, |
| 121 | 120 | 0, |
| 122 | 121 | flipx, flipy, |
| 123 | x - 256, 240 - y, | |
| 124 | cliprect, TRANSPARENCY_PEN, 0); | |
| 122 | x - 256, 240 - y, 0); | |
| 125 | 123 | } |
| 126 | 124 | return 0; |
| 127 | 125 | } |
| r5077 | r5078 | |
| 145 | 143 | |
| 146 | 144 | code |= (runaway_sprite_ram[i + 0x30] << 2) & 0x1c0; |
| 147 | 145 | |
| 148 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 146 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 149 | 147 | code, |
| 150 | 148 | 0, |
| 151 | 149 | flipx, flipy, |
| 152 | x, 240 - y, | |
| 153 | cliprect, TRANSPARENCY_PEN, 0); | |
| 150 | x, 240 - y, 0); | |
| 154 | 151 | |
| 155 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 152 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 156 | 153 | code, |
| 157 | 154 | 0, |
| 158 | 155 | flipx, flipy, |
| 159 | x - 256, 240 - y, | |
| 160 | cliprect, TRANSPARENCY_PEN, 0); | |
| 156 | x - 256, 240 - y, 0); | |
| 161 | 157 | } |
| 162 | 158 | return 0; |
| 163 | 159 | } |
| r5077 | r5078 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | while (multi >= 0) |
| 81 | 81 | { |
| 82 | drawgfx(bitmap,machine->gfx[3], | |
| 82 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 83 | 83 | sprite - multi * inc, |
| 84 | 84 | colour, |
| 85 | 85 | 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); | |
| 88 | 87 | |
| 89 | 88 | multi--; |
| 90 | 89 | } |
| r5077 | r5078 | |
| 141 | 140 | |
| 142 | 141 | while (multi >= 0) |
| 143 | 142 | { |
| 144 | drawgfx(bitmap,machine->gfx[3], | |
| 143 | drawgfx_transpen(bitmap,// x-1 for bcstory .. realign other layers? | |
| 144 | cliprect,machine->gfx[3], | |
| 145 | 145 | sprite - multi * inc, |
| 146 | 146 | colour, |
| 147 | 147 | 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); | |
| 150 | 149 | |
| 151 | 150 | multi--; |
| 152 | 151 | } |
| r5077 | r5078 | |
| 203 | 202 | |
| 204 | 203 | while (multi >= 0) |
| 205 | 204 | { |
| 206 | drawgfx(bitmap,machine->gfx[3], | |
| 205 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 207 | 206 | sprite - multi * inc, |
| 208 | 207 | colour, |
| 209 | 208 | 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); | |
| 212 | 210 | |
| 213 | 211 | multi--; |
| 214 | 212 | } |
| r5077 | r5078 | |
|---|---|---|
| 142 | 142 | py = 248-(8*y+dy+9); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 145 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1], | |
| 146 | 146 | chr, |
| 147 | 147 | col, |
| 148 | 148 | flip,flip, |
| 149 | px,py, | |
| 150 | cliprect,TRANSPARENCY_NONE,0); | |
| 149 | px,py); | |
| 151 | 150 | } |
| 152 | 151 | } |
| 153 | 152 | } |
| r5077 | r5078 | |
| 177 | 176 | py = y+1; |
| 178 | 177 | } |
| 179 | 178 | |
| 180 | drawgfx(bitmap,screen->machine->gfx[3], | |
| 179 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3], | |
| 181 | 180 | chr, |
| 182 | 181 | col, |
| 183 | 182 | !fx,fy, |
| 184 | px,py, | |
| 185 | cliprect,TRANSPARENCY_PEN,0); | |
| 183 | px,py,0); | |
| 186 | 184 | } |
| 187 | 185 | |
| 188 | 186 | |
| r5077 | r5078 | |
| 241 | 239 | px = 248-x; |
| 242 | 240 | py = y+1; |
| 243 | 241 | } |
| 244 | drawgfx(bitmap,screen->machine->gfx[3], | |
| 242 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3], | |
| 245 | 243 | chr, |
| 246 | 244 | col, |
| 247 | 245 | !fx,fy, |
| 248 | px,py, | |
| 249 | cliprect,TRANSPARENCY_PEN,0); | |
| 246 | px,py,0); | |
| 250 | 247 | } |
| 251 | 248 | |
| 252 | 249 | |
| r5077 | r5078 | |
| 276 | 273 | px = 248-x*8; |
| 277 | 274 | py = 255-y; |
| 278 | 275 | } |
| 279 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 276 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 280 | 277 | videoram[(sy>>3)*32+x]*8+dy, |
| 281 | 278 | col, |
| 282 | 279 | flip,0, |
| 283 | px,py, | |
| 284 | cliprect,TRANSPARENCY_PEN,0); | |
| 280 | px,py,0); | |
| 285 | 281 | } |
| 286 | 282 | } |
| 287 | 283 | |
| r5077 | r5078 | |
| 311 | 307 | px = 248-(8*x+dx-8); |
| 312 | 308 | py = 248-(8*y+dy+9); |
| 313 | 309 | } |
| 314 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 310 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 315 | 311 | chr, |
| 316 | 312 | 0, /* color */ |
| 317 | 313 | flip,flip, /* flip */ |
| 318 | px,py, | |
| 319 | cliprect,TRANSPARENCY_PEN,0); | |
| 314 | px,py,0); | |
| 320 | 315 | } |
| 321 | 316 | } |
| 322 | 317 | } |
| r5077 | r5078 | |
|---|---|---|
| 88 | 88 | flipy = !flipy; |
| 89 | 89 | } |
| 90 | 90 | |
| 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); | |
| 93 | 92 | } |
| 94 | 93 | } |
| 95 | 94 | |
| r5077 | r5078 | |
| 116 | 115 | flipy = !flipy; |
| 117 | 116 | } |
| 118 | 117 | |
| 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); | |
| 121 | 119 | } |
| 122 | 120 | } |
| 123 | 121 |
| r5077 | r5078 | |
|---|---|---|
| 292 | 292 | for (x = 0;x <= size;x++) |
| 293 | 293 | { |
| 294 | 294 | 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], | |
| 296 | 296 | sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)], |
| 297 | 297 | color, |
| 298 | 298 | flipx,flipy, |
| 299 | ((sx + 16*x) & 0xff), sy + 16*y, | |
| 300 | &spritevisiblearea,TRANSPARENCY_PENS,transmask); | |
| 299 | ((sx + 16*x) & 0xff), sy + 16*y,transmask); | |
| 301 | 300 | /* wraparound */ |
| 302 | drawgfx(bitmap,machine->gfx[1], | |
| 301 | drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1], | |
| 303 | 302 | sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)], |
| 304 | 303 | color, |
| 305 | 304 | 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); | |
| 308 | 306 | } |
| 309 | 307 | } |
| 310 | 308 | } |
| r5077 | r5078 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | if (!(attr & 0x80)) |
| 80 | 80 | { |
| 81 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 81 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 82 | 82 | (code >> 3) | bank, |
| 83 | 83 | i, |
| 84 | 84 | 0, 0, |
| 85 | 85 | horz - 15, |
| 86 | vert - 15, | |
| 87 | cliprect, TRANSPARENCY_PEN, 0); | |
| 86 | vert - 15, 0); | |
| 88 | 87 | } |
| 89 | 88 | } |
| 90 | 89 | |
| r5077 | r5078 | |
| 125 | 124 | if (code & 4) |
| 126 | 125 | bank = 32; |
| 127 | 126 | |
| 128 | drawgfx(helper, machine->gfx[1], | |
| 127 | drawgfx_transpen(helper, &rect, machine->gfx[1], | |
| 129 | 128 | (code >> 3) | bank, |
| 130 | 129 | 4, |
| 131 | 130 | 0, 0, |
| 132 | 131 | horz - 15, |
| 133 | vert - 15, | |
| 134 | &rect, TRANSPARENCY_PEN, 1); | |
| 132 | vert - 15, 1); | |
| 135 | 133 | |
| 136 | 134 | for (y = rect.min_y; y <= rect.max_y; y++) |
| 137 | 135 | for (x = rect.min_x; x <= rect.max_x; x++) |
| r5077 | r5078 | |
|---|---|---|
| 160 | 160 | for (i = 0;i < y_multi;i++) |
| 161 | 161 | |
| 162 | 162 | if (m90_video_control_data[7] & 0x01) |
| 163 | pdrawgfx(bitmap,machine->gfx[1], | |
| 163 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 164 | 164 | sprite + (fy ? y_multi-1 - i : i), |
| 165 | 165 | colour, |
| 166 | 166 | fx,fy, |
| 167 | 167 | x,y+i*16, |
| 168 | cliprect,TRANSPARENCY_PEN,0, | |
| 169 | (colour & 0x08) ? 0x00 : 0x02); | |
| 168 | priority_bitmap, | |
| 169 | (colour & 0x08) ? 0x00 : 0x02,0); | |
| 170 | 170 | else if (m90_video_control_data[7] & 0x02) |
| 171 | pdrawgfx(bitmap,machine->gfx[1], | |
| 171 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 172 | 172 | sprite + (fy ? y_multi-1 - i : i), |
| 173 | 173 | colour, |
| 174 | 174 | fx,fy, |
| 175 | 175 | 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); | |
| 178 | 178 | else |
| 179 | pdrawgfx(bitmap,machine->gfx[1], | |
| 179 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 180 | 180 | sprite + (fy ? y_multi-1 - i : i), |
| 181 | 181 | colour, |
| 182 | 182 | fx,fy, |
| 183 | 183 | x,y+i*16, |
| 184 | cliprect,TRANSPARENCY_PEN,0, | |
| 185 | 0x02); | |
| 184 | priority_bitmap, | |
| 185 | 0x02,0); | |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | |
| r5077 | r5078 | |
| 214 | 214 | fx = (spriteram16[offs+3] >> 8) & 0x02; |
| 215 | 215 | fy = (spriteram16[offs+2] >> 8) & 0x80; |
| 216 | 216 | |
| 217 | pdrawgfx(bitmap,machine->gfx[1], | |
| 217 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 218 | 218 | sprite, |
| 219 | 219 | colour, |
| 220 | 220 | fx,fy, |
| 221 | 221 | x,y, |
| 222 | cliprect,TRANSPARENCY_PEN,0, | |
| 223 | (colour & 0x08) ? 0x00 : 0x02); | |
| 222 | priority_bitmap, | |
| 223 | (colour & 0x08) ? 0x00 : 0x02,0); | |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
| r5077 | r5078 | |
| 251 | 251 | fx = (spriteram16[offs+3] >> 8) & 0x02; |
| 252 | 252 | fy = (spriteram16[offs+2] >> 8) & 0x80; |
| 253 | 253 | |
| 254 | pdrawgfx(bitmap,machine->gfx[1], | |
| 254 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 255 | 255 | sprite, |
| 256 | 256 | colour, |
| 257 | 257 | fx,fy, |
| 258 | 258 | x,y, |
| 259 | cliprect,TRANSPARENCY_PEN,0, | |
| 260 | (colour & 0x08) ? 0x00 : 0x02); | |
| 259 | priority_bitmap, | |
| 260 | (colour & 0x08) ? 0x00 : 0x02,0); | |
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 |
| r5077 | r5078 | |
|---|---|---|
| 116 | 116 | flipy = !flipy; |
| 117 | 117 | } |
| 118 | 118 | |
| 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, | |
| 121 | 121 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, scotrsht_palette_bank * 16)); |
| 122 | 122 | } |
| 123 | 123 | } |
| r5077 | r5078 | |
|---|---|---|
| 178 | 178 | } |
| 179 | 179 | else |
| 180 | 180 | { |
| 181 | drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 181 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 182 | 182 | sprite_ptr->code, |
| 183 | 183 | sprite_ptr->color, |
| 184 | 184 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 185 | 185 | 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); | |
| 188 | 187 | } |
| 189 | 188 | } |
| 190 | 189 | } |
| r5077 | r5078 | |
| 198 | 197 | { |
| 199 | 198 | sprite_ptr--; |
| 200 | 199 | |
| 201 | pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 200 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx], | |
| 202 | 201 | sprite_ptr->code, |
| 203 | 202 | sprite_ptr->color, |
| 204 | 203 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 205 | 204 | sprite_ptr->x,sprite_ptr->y, |
| 206 | cliprect,TRANSPARENCY_PEN,0, | |
| 207 | 205 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 208 | sprite_ptr->primask); | |
| 206 | priority_bitmap,sprite_ptr->primask,0); | |
| 209 | 207 | } |
| 210 | 208 | } |
| 211 | 209 |
| r5077 | r5078 | |
|---|---|---|
| 243 | 243 | flipy = !flipy; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 246 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 247 | 247 | code, |
| 248 | 248 | color, |
| 249 | 249 | flipx,flipy, |
| 250 | 250 | curx,cury, |
| 251 | cliprect,TRANSPARENCY_PEN,0, | |
| 252 | zx<<12,zy<<13,primasks[priority]); | |
| 251 | zx<<12,zy<<13,priority_bitmap,primasks[priority],0); | |
| 253 | 252 | } |
| 254 | 253 | |
| 255 | 254 | if (bad_chunks) |
| r5077 | r5078 | |
| 338 | 337 | flipy = !flipy; |
| 339 | 338 | } |
| 340 | 339 | |
| 341 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 340 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 342 | 341 | code, |
| 343 | 342 | color, |
| 344 | 343 | flipx,flipy, |
| 345 | 344 | curx,cury, |
| 346 | cliprect,TRANSPARENCY_PEN,0, | |
| 347 | 345 | zx<<12,zy<<12, |
| 348 | primasks[priority]); | |
| 346 | priority_bitmap,primasks[priority],0); | |
| 349 | 347 | } |
| 350 | 348 | } |
| 351 | 349 | else if ((zoomx-1) & 0x20) /* 64x128 sprites, $40000-$5ffff in spritemap rom, OBJB */ |
| r5077 | r5078 | |
| 382 | 380 | flipy = !flipy; |
| 383 | 381 | } |
| 384 | 382 | |
| 385 | pdrawgfxzoom(bitmap,machine->gfx[2], | |
| 383 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2], | |
| 386 | 384 | code, |
| 387 | 385 | color, |
| 388 | 386 | flipx,flipy, |
| 389 | 387 | curx,cury, |
| 390 | cliprect,TRANSPARENCY_PEN,0, | |
| 391 | 388 | zx<<12,zy<<12, |
| 392 | primasks[priority]); | |
| 389 | priority_bitmap,primasks[priority],0); | |
| 393 | 390 | } |
| 394 | 391 | } |
| 395 | 392 | else if (!((zoomx-1) & 0x60)) /* 32x128 sprites, $60000-$7ffff in spritemap rom, OBJB */ |
| r5077 | r5078 | |
| 426 | 423 | flipy = !flipy; |
| 427 | 424 | } |
| 428 | 425 | |
| 429 | pdrawgfxzoom(bitmap,machine->gfx[2], | |
| 426 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2], | |
| 430 | 427 | code, |
| 431 | 428 | color, |
| 432 | 429 | flipx,flipy, |
| 433 | 430 | curx,cury, |
| 434 | cliprect,TRANSPARENCY_PEN,0, | |
| 435 | 431 | zx<<12,zy<<12, |
| 436 | primasks[priority]); | |
| 432 | priority_bitmap,primasks[priority],0); | |
| 437 | 433 | } |
| 438 | 434 | } |
| 439 | 435 | |
| r5077 | r5078 | |
| 520 | 516 | flipy = !flipy; |
| 521 | 517 | } |
| 522 | 518 | |
| 523 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 519 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 524 | 520 | code, |
| 525 | 521 | color, |
| 526 | 522 | flipx,flipy, |
| 527 | 523 | curx,cury, |
| 528 | cliprect,TRANSPARENCY_PEN,0, | |
| 529 | 524 | zx<<12,zy<<13, |
| 530 | primasks[priority]); | |
| 525 | priority_bitmap,primasks[priority],0); | |
| 531 | 526 | } |
| 532 | 527 | |
| 533 | 528 | if (bad_chunks) |
| r5077 | r5078 | |
| 622 | 617 | flipy = !flipy; |
| 623 | 618 | } |
| 624 | 619 | |
| 625 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 620 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 626 | 621 | code, |
| 627 | 622 | color, |
| 628 | 623 | flipx,flipy, |
| 629 | 624 | curx,cury, |
| 630 | cliprect,TRANSPARENCY_PEN,0, | |
| 631 | 625 | zx<<12,zy<<13, |
| 632 | primasks[priority]); | |
| 626 | priority_bitmap,primasks[priority],0); | |
| 633 | 627 | } |
| 634 | 628 | |
| 635 | 629 | if (bad_chunks) |
| r5077 | r5078 | |
| 714 | 708 | flipy = !flipy; |
| 715 | 709 | } |
| 716 | 710 | |
| 717 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 711 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 718 | 712 | code, |
| 719 | 713 | color, |
| 720 | 714 | flipx,flipy, |
| 721 | 715 | curx,cury, |
| 722 | cliprect,TRANSPARENCY_PEN,0, | |
| 723 | 716 | zx<<12,zy<<13, |
| 724 | primasks[priority]); | |
| 717 | priority_bitmap,primasks[priority],0); | |
| 725 | 718 | } |
| 726 | 719 | |
| 727 | 720 | if (bad_chunks) |
| r5077 | r5078 | |
| 806 | 799 | flipy = !flipy; |
| 807 | 800 | } |
| 808 | 801 | |
| 809 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 802 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 810 | 803 | code, |
| 811 | 804 | color, |
| 812 | 805 | flipx,flipy, |
| 813 | 806 | curx,cury, |
| 814 | cliprect,TRANSPARENCY_PEN,0, | |
| 815 | 807 | zx<<12,zy<<13, |
| 816 | primasks[priority]); | |
| 808 | priority_bitmap,primasks[priority],0); | |
| 817 | 809 | } |
| 818 | 810 | |
| 819 | 811 | if (bad_chunks) |
| r5077 | r5078 | |
|---|---|---|
| 186 | 186 | switch(attributes&3) |
| 187 | 187 | { |
| 188 | 188 | case 0: /* flipx==0 && flipy==0 */ |
| 189 | drawgfx(bitmap,gfx, | |
| 189 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 190 | 190 | sprite_number+1,color, |
| 191 | 191 | 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, | |
| 194 | 194 | sprite_number,color, |
| 195 | 195 | flipx,flipy, |
| 196 | sx,sy, | |
| 196 | sx,sy, | |
| 197 | 197 | break; |
| 198 | 198 | case 1: /* flipx==1 && flipy==0 */ |
| 199 | drawgfx(bitmap,gfx, | |
| 199 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 200 | 200 | sprite_number+1,color, |
| 201 | 201 | 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, | |
| 204 | 204 | sprite_number,color, |
| 205 | 205 | flipx,flipy, |
| 206 | sx,sy, | |
| 206 | sx,sy, | |
| 207 | 207 | break; |
| 208 | 208 | case 2: /* flipx==0 && flipy==1 */ |
| 209 | drawgfx(bitmap,gfx, | |
| 209 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 210 | 210 | sprite_number,color, |
| 211 | 211 | 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, | |
| 214 | 214 | sprite_number+1,color, |
| 215 | 215 | flipx,flipy, |
| 216 | sx,sy, | |
| 216 | sx,sy, | |
| 217 | 217 | break; |
| 218 | 218 | case 3: /* flipx==1 && flipy==1 */ |
| 219 | drawgfx(bitmap,gfx, | |
| 219 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 220 | 220 | sprite_number,color, |
| 221 | 221 | 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, | |
| 224 | 224 | sprite_number+1,color, |
| 225 | 225 | flipx,flipy, |
| 226 | sx,sy, | |
| 226 | sx,sy, | |
| 227 | 227 | break; |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | else |
| 231 | 231 | { |
| 232 | drawgfx(bitmap,gfx, | |
| 232 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 233 | 233 | sprite_number, |
| 234 | 234 | color, |
| 235 | 235 | flipx,flipy, |
| 236 | sx,sy, | |
| 237 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 236 | sx,sy,0 ); | |
| 238 | 237 | } |
| 239 | 238 | source -= 4; |
| 240 | 239 | } |
| r5077 | r5078 | |
|---|---|---|
| 108 | 108 | if (px>248) |
| 109 | 109 | px = px-256; |
| 110 | 110 | |
| 111 | drawgfx(bitmap,machine->gfx[1], | |
| 111 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 112 | 112 | chr, |
| 113 | 113 | col, |
| 114 | 114 | fx,fy, |
| 115 | 115 | px,py, |
| 116 | cliprect,TRANSPARENCY_PENS, | |
| 117 | 116 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], col, 0)); |
| 118 | 117 | } |
| 119 | 118 | } |
| r5077 | r5078 | |
|---|---|---|
| 186 | 186 | sy = 240 - sy; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | drawgfx(bitmap,machine->gfx[1], | |
| 189 | drawgfx_transpen(bitmap,cliprect, machine->gfx[1], | |
| 190 | 190 | code, |
| 191 | 191 | color, |
| 192 | 192 | flip_screen_get(machine), flip_screen_get(machine), |
| 193 | sx, sy, | |
| 194 | cliprect, TRANSPARENCY_PEN, 0); | |
| 193 | sx, sy, 0); | |
| 195 | 194 | } |
| 196 | 195 | } |
| 197 | 196 | |
| r5077 | r5078 | |
| 217 | 216 | flipy = !flipy; |
| 218 | 217 | } |
| 219 | 218 | |
| 220 | drawgfx(bitmap,machine->gfx[2], | |
| 219 | drawgfx_transpen(bitmap,cliprect, machine->gfx[2], | |
| 221 | 220 | code, |
| 222 | 221 | color, |
| 223 | 222 | flipx, flipy, |
| 224 | sx, sy, | |
| 225 | cliprect, TRANSPARENCY_PEN, 0); | |
| 223 | sx, sy, 0); | |
| 226 | 224 | } |
| 227 | 225 | } |
| 228 | 226 |
| r5077 | r5078 | |
|---|---|---|
| 441 | 441 | { |
| 442 | 442 | for (x = 0;x <= sizex;x++) |
| 443 | 443 | { |
| 444 | drawgfx(bitmap,machine->gfx[1], | |
| 444 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 445 | 445 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 446 | 446 | color, |
| 447 | 447 | flipx,flipy, |
| 448 | 448 | sx + 16*x,sy + 16*y, |
| 449 | cliprect,TRANSPARENCY_PENS, | |
| 450 | 449 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, transcolor)); |
| 451 | 450 | } |
| 452 | 451 | } |
| r5077 | r5078 | |
| 517 | 516 | { |
| 518 | 517 | for (x = 0;x <= sizex;x++) |
| 519 | 518 | { |
| 520 | drawgfx(bitmap,machine->gfx[1], | |
| 519 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 521 | 520 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 522 | 521 | color, |
| 523 | 522 | flipx,flipy, |
| 524 | 523 | sx + 8*x,sy + 8*y, |
| 525 | cliprect,TRANSPARENCY_PENS, | |
| 526 | 524 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 31)); |
| 527 | 525 | } |
| 528 | 526 | } |
| r5077 | r5078 | |
|---|---|---|
| 198 | 198 | data1 = spriteram16[offs+3]; |
| 199 | 199 | color = (spriteram16[offs+4] & 0x0f) | sprite_colbank; |
| 200 | 200 | |
| 201 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 201 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 202 | 202 | tile, |
| 203 | 203 | color, |
| 204 | 204 | data1 & 0x40, data1 & 0x80, |
| 205 | sx,sy+1, | |
| 206 | cliprect,TRANSPARENCY_PEN,15); | |
| 205 | sx,sy+1,15); | |
| 207 | 206 | } |
| 208 | 207 | } |
| 209 | 208 |
| r5077 | r5078 | |
|---|---|---|
| 96 | 96 | flipy = !flipy; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | drawgfx(bitmap, machine->gfx[2], | |
| 99 | drawgfx_transpen(bitmap, cliprect, | |
| 100 | machine->gfx[2], | |
| 100 | 101 | tile_number, |
| 101 | 102 | color, |
| 102 | 103 | flipx, flipy, |
| 103 | sx, 240 - sy, | |
| 104 | cliprect, | |
| 105 | TRANSPARENCY_PEN, 15); | |
| 104 | sx, 240 - sy, 15); | |
| 106 | 105 | } |
| 107 | 106 | |
| 108 | 107 | source -= 4; |
| r5077 | r5078 | |
|---|---|---|
| 172 | 172 | sx = buffered_spriteram[offs+1] + 3; |
| 173 | 173 | sy = buffered_spriteram[offs+3] - 1; |
| 174 | 174 | } |
| 175 | drawgfx(bitmap,machine->gfx[1], | |
| 175 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 176 | 176 | buffered_spriteram[offs], |
| 177 | 177 | ((buffered_spriteram[offs+2] >> 1) & 3) | |
| 178 | 178 | ((buffered_spriteram[offs+2] << 2) & 4) | (slapfight_palette_bank << 3), |
| 179 | 179 | flipscreen, flipscreen, |
| 180 | sx, sy, | |
| 181 | cliprect,TRANSPARENCY_PEN,0); | |
| 180 | sx, sy,0); | |
| 182 | 181 | } |
| 183 | 182 | } |
| 184 | 183 | } |
| r5077 | r5078 | |
| 231 | 230 | for (offs = 0;offs < spriteram_size;offs += 4) |
| 232 | 231 | { |
| 233 | 232 | if (flipscreen) |
| 234 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 233 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 235 | 234 | buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2), |
| 236 | 235 | (buffered_spriteram[offs+2] & 0x1e) >> 1, |
| 237 | 236 | 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); | |
| 240 | 238 | else |
| 241 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 239 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 242 | 240 | buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2), |
| 243 | 241 | (buffered_spriteram[offs+2] & 0x1e) >> 1, |
| 244 | 242 | 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); | |
| 247 | 244 | } |
| 248 | 245 | |
| 249 | 246 | tilemap_draw(bitmap,cliprect,fix_tilemap,0,0); |
| r5077 | r5078 | |
|---|---|---|
| 342 | 342 | tileno = (psikyosh_bgram[(bank*0x800)/4 + offs - 0x4000/4] & 0x0007ffff); /* seems to take into account spriteram, hence -0x4000 */ |
| 343 | 343 | colour = (psikyosh_bgram[(bank*0x800)/4 + offs - 0x4000/4] & 0xff000000) >> 24; |
| 344 | 344 | |
| 345 | // drawgfx(zoom_bitmap,gfx,tileno,colour,0,0,(16*sx)&0x1ff,((16*sy)&(width-1)) | |
| 345 | // drawgfx_transpen(zoom_bitmap,NULL,gfx,tileno,colour,0,0,(16*sx)&0x1ff,((16*sy)&(width-1)) | |
| 346 | 346 | |
| 347 | 347 | drawgfx_alphatable(bitmap,cliprect,gfx,tileno,colour,0,0,(16*sx+scrollx)&0x1ff,((16*sy+scrolly)&(width-1)),alpha); /* normal */ |
| 348 | 348 | if(scrollx) |
| r5077 | r5078 | |
| 421 | 421 | /* sx and sy is top-left of entire sprite regardless of flip */ |
| 422 | 422 | /* Note that Level 5-4 of sbomberb boss is perfect! (Alpha blended zoomed) as well as S1945II logo */ |
| 423 | 423 | /* pixel is only plotted if z is >= priority_buffer[y][x] */ |
| 424 | static void psikyosh_drawgfxzoom( running_machine *machine, | |
| 425 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 424 | static void psikyosh_drawgfxzoom( | |
| 425 | bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 426 | 426 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 427 | | |
| 427 | | |
| 428 | 428 | int zoomx, int zoomy, int wide, int high, UINT32 z) |
| 429 | 429 | { |
| 430 | 430 | rectangle myclip; /* Clip to screen boundaries */ |
| r5077 | r5078 | |
| 471 | 471 | { |
| 472 | 472 | for (xtile = xstart; xtile != xend; xtile += xinc ) |
| 473 | 473 | { |
| 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)]; | |
| 475 | 475 | const UINT8 *code_base = gfx_element_get_data(gfx, (code + code_offset++) % gfx->total_elements); |
| 476 | 476 | |
| 477 | 477 | int x_index_base, y_index, sx, sy, ex, ey; |
| r5077 | r5078 | |
| 735 | 735 | /* Start drawing */ |
| 736 | 736 | if( gfx ) |
| 737 | 737 | { |
| 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)]; | |
| 739 | 739 | |
| 740 | 740 | int sprite_screen_height = ((high*gfx->height*(0x400*0x400))/zoomy + 0x200)>>10; /* Round up to nearest pixel */ |
| 741 | 741 | int sprite_screen_width = ((wide*gfx->width*(0x400*0x400))/zoomx + 0x200)>>10; |
| r5077 | r5078 | |
| 1046 | 1046 | /* start drawing */ |
| 1047 | 1047 | if( zoom_table[BYTE_XOR_BE(zoomy)] && zoom_table[BYTE_XOR_BE(zoomx)] ) /* Avoid division-by-zero when table contains 0 (Uninitialised/Bug) */ |
| 1048 | 1048 | { |
| 1049 | psikyosh_drawgfxzoom( | |
| 1049 | psikyosh_drawgfxzoom( | |
| 1050 | 1050 | (UINT32)zoom_table[BYTE_XOR_BE(zoomx)], (UINT32)zoom_table[BYTE_XOR_BE(zoomy)], wide, high, listcntr); |
| 1051 | 1051 | |
| 1052 | 1052 | #if 0 |
| r5077 | r5078 | |
|---|---|---|
| 181 | 181 | { |
| 182 | 182 | y &= 0x1ff; |
| 183 | 183 | |
| 184 | drawgfx(bitmap,machine->gfx[2], | |
| 184 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 185 | 185 | code ^ i, |
| 186 | 186 | col, |
| 187 | 187 | fx,fy, |
| 188 | x,y, | |
| 189 | cliprect,TRANSPARENCY_PEN,0); | |
| 188 | x,y,0); | |
| 190 | 189 | |
| 191 | 190 | y += dy; |
| 192 | 191 | } |
| r5077 | r5078 | |
|---|---|---|
| 142 | 142 | if (sx&0x100) sx-=0x200; |
| 143 | 143 | if (sy&0x100) sy-=0x200; |
| 144 | 144 | |
| 145 | drawgfx(bitmap,machine->gfx[pandora_region], | |
| 145 | drawgfx_transpen(bitmap,cliprect,machine->gfx[pandora_region], | |
| 146 | 146 | tile, |
| 147 | 147 | (tilecolour & 0xf0) >> 4, |
| 148 | 148 | flipx, flipy, |
| 149 | sx,sy, | |
| 150 | cliprect,TRANSPARENCY_PEN,0); | |
| 149 | sx,sy,0); | |
| 151 | 150 | } |
| 152 | 151 | } |
| 153 | 152 |
| r5077 | r5078 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | while (multi >= 0) |
| 119 | 119 | { |
| 120 | deco16_pdrawgfx(machine, | |
| 121 | bitmap,machine->gfx[gfx_region], | |
| 120 | deco16_pdrawgfx( | |
| 121 | bitmap, cliprect, machine->gfx[gfx_region], | |
| 122 | 122 | sprite - multi * inc, |
| 123 | 123 | colour, |
| 124 | 124 | fx,fy, |
| 125 | 125 | x,y + mult * multi, |
| 126 | | |
| 126 | | |
| 127 | 127 | |
| 128 | 128 | multi--; |
| 129 | 129 | } |
| r5077 | r5078 | |
|---|---|---|
| 283 | 283 | // sprites are 16x14 centered in a 16x16 square, so skip the first line |
| 284 | 284 | sy += 1; |
| 285 | 285 | |
| 286 | drawgfx(bitmap,machine->gfx[2], | |
| 286 | drawgfx_transmask(bitmap,cliprect, machine->gfx[2], | |
| 287 | 287 | tile, |
| 288 | 288 | color, |
| 289 | 289 | fx, fy, |
| 290 | sx, sy, | |
| 291 | cliprect, TRANSPARENCY_PENS, transmask); | |
| 290 | sx, sy, transmask); | |
| 292 | 291 | } |
| 293 | 292 | } |
| 294 | 293 | } |
| r5077 | r5078 | |
|---|---|---|
| 159 | 159 | else |
| 160 | 160 | sx = 91 - (part_h_shift & 0x7f); |
| 161 | 161 | |
| 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); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | static void draw_center(bitmap_t *bitmap, const rectangle *cliprect) |
| r5077 | r5078 | |
| 426 | 426 | |
| 427 | 427 | sy -= sprite_y_adjust; |
| 428 | 428 | |
| 429 | drawgfx(bitmap,machine->gfx[1], | |
| 429 | drawgfx_transpen(bitmap,cliprect, machine->gfx[1], | |
| 430 | 430 | sprite_ram[offs + interleave], |
| 431 | 431 | color, |
| 432 | 432 | flipx,flipy, |
| 433 | sx,sy, | |
| 434 | cliprect, TRANSPARENCY_PEN, 0); | |
| 433 | sx,sy, 0); | |
| 435 | 434 | |
| 436 | 435 | sy += (flip_screen_get(machine) ? -256 : 256); |
| 437 | 436 | |
| 438 | 437 | // Wrap around |
| 439 | drawgfx(bitmap,machine->gfx[1], | |
| 438 | drawgfx_transpen(bitmap,cliprect, machine->gfx[1], | |
| 440 | 439 | sprite_ram[offs + interleave], |
| 441 | 440 | color, |
| 442 | 441 | flipx,flipy, |
| 443 | sx,sy, | |
| 444 | cliprect, TRANSPARENCY_PEN, 0); | |
| 442 | sx,sy, 0); | |
| 445 | 443 | } |
| 446 | 444 | } |
| 447 | 445 |
| r5077 | r5078 | |
|---|---|---|
| 360 | 360 | for (yt = 0; yt < ytiles; yt++) |
| 361 | 361 | for (xt = 0; xt < xtiles; xt++, code++) |
| 362 | 362 | 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); | |
| 365 | 365 | 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); | |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | /* xflipped case */ |
| r5077 | r5078 | |
| 374 | 374 | for (yt = 0; yt < ytiles; yt++) |
| 375 | 375 | for (xt = 0; xt < xtiles; xt++, code++) |
| 376 | 376 | 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); | |
| 379 | 379 | 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); | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /* yflipped case */ |
| r5077 | r5078 | |
| 388 | 388 | for (yt = 0; yt < ytiles; yt++) |
| 389 | 389 | for (xt = 0; xt < xtiles; xt++, code++) |
| 390 | 390 | 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); | |
| 393 | 393 | 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); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | /* x & yflipped case */ |
| r5077 | r5078 | |
| 402 | 402 | for (yt = 0; yt < ytiles; yt++) |
| 403 | 403 | for (xt = 0; xt < xtiles; xt++, code++) |
| 404 | 404 | 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); | |
| 407 | 407 | 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); | |
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | } |
| r5077 | r5078 | |
|---|---|---|
| 362 | 362 | int code = videoram[offs] & 0x3f; |
| 363 | 363 | int color = ((videoram[offs] & 0xc0) >> 6) | (irobot_alphamap >> 3); |
| 364 | 364 | |
| 365 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 365 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 366 | 366 | code, color, |
| 367 | 367 | 0,0, |
| 368 | 8*x,8*y, | |
| 369 | cliprect,TRANSPARENCY_PEN,0); | |
| 368 | 8*x,8*y,0); | |
| 370 | 369 | } |
| 371 | 370 | return 0; |
| 372 | 371 | } |
| r5077 | r5078 | |
|---|---|---|
| 219 | 219 | { |
| 220 | 220 | for (x = 0;x <= sizex;x++) |
| 221 | 221 | { |
| 222 | drawgfx(bitmap,machine->gfx[2], | |
| 222 | drawgfx_transmask(bitmap,cliprect,machine->gfx[2], | |
| 223 | 223 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 224 | 224 | color, |
| 225 | 225 | flipx,flipy, |
| 226 | 226 | sx + 16*x,sy + 16*y, |
| 227 | cliprect,TRANSPARENCY_PENS, | |
| 228 | 227 | colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0xff)); |
| 229 | 228 | } |
| 230 | 229 | } |
| r5077 | r5078 | |
|---|---|---|
| 94 | 94 | int zw = ox + (((x + 1) * xscale + (1 << 11)) >> 12) - sx; |
| 95 | 95 | int zh = oy + (((y + 1) * yscale + (1 << 11)) >> 12) - sy; |
| 96 | 96 | |
| 97 | drawgfxzoom(bitmap, | |
| 97 | drawgfxzoom_transpen(bitmap, | |
| 98 | cliprect, | |
| 98 | 99 | machine->gfx[0], |
| 99 | 100 | c, |
| 100 | 101 | color, |
| r5077 | r5078 | |
| 102 | 103 | flipy, |
| 103 | 104 | sx, |
| 104 | 105 | sy, |
| 105 | cliprect, | |
| 106 | TRANSPARENCY_PEN, | |
| 107 | 0, | |
| 108 | 106 | (zw << 16) / 16, |
| 109 | (zh << 16) / 16); | |
| 107 | (zh << 16) / 16, | |
| 108 | 0); | |
| 110 | 109 | } |
| 111 | 110 | else |
| 112 | 111 | { |
| 113 | 112 | int sx = ox + (x << 4); |
| 114 | 113 | int sy = oy + (y << 4); |
| 115 | 114 | |
| 116 | drawgfx(bitmap, | |
| 115 | drawgfx_transpen(bitmap, | |
| 116 | cliprect, | |
| 117 | 117 | machine->gfx[0], |
| 118 | 118 | c, |
| 119 | 119 | color, |
| r5077 | r5078 | |
| 121 | 121 | flipy, |
| 122 | 122 | sx, |
| 123 | 123 | sy, |
| 124 | cliprect, | |
| 125 | TRANSPARENCY_PEN, | |
| 126 | 124 | 0); |
| 127 | 125 | } |
| 128 | 126 | } |
| r5077 | r5078 | |
|---|---|---|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | |
| 265 | static void firetrk_draw_car( | |
| 265 | static void firetrk_draw_car( | |
| 266 | 266 | { |
| 267 | 267 | int gfx_bank, code, color, flip_x, flip_y, x, y; |
| 268 | 268 | |
| r5077 | r5078 | |
| 287 | 287 | y = 104; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y | |
| 290 | drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, x, y | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | |
| 294 | static void superbug_draw_car( | |
| 294 | static void superbug_draw_car( | |
| 295 | 295 | { |
| 296 | 296 | int gfx_bank = (*firetrk_car_rot & 0x10) ? 4 : 3; |
| 297 | 297 | int code = ~*firetrk_car_rot & 0x03; |
| r5077 | r5078 | |
| 299 | 299 | int flip_x = *firetrk_car_rot & 0x04; |
| 300 | 300 | int flip_y = *firetrk_car_rot & 0x08; |
| 301 | 301 | |
| 302 | drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, 144, 104 | |
| 302 | drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, 144, 104 | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| 306 | static void montecar_draw_car( | |
| 306 | static void montecar_draw_car( | |
| 307 | 307 | { |
| 308 | 308 | int gfx_bank, code, color, flip_x, flip_y, x, y; |
| 309 | 309 | |
| r5077 | r5078 | |
| 328 | 328 | y = 104; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y | |
| 331 | drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, x, y | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | |
| 335 | static void draw_text( | |
| 335 | static void draw_text( | |
| 336 | 336 | int x, int count, int height) |
| 337 | 337 | { |
| 338 | 338 | int i; |
| 339 | 339 | |
| 340 | 340 | for (i = 0; i < count; i++) |
| 341 | drawgfx(bitmap, gfx[0], alpha_ram[i], 0, 0, 0, x, i * height | |
| 341 | drawgfx_opaque(bitmap, cliprect, gfx[0], alpha_ram[i], 0, 0, 0, x, i * height | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | |
| r5077 | r5078 | |
| 371 | 371 | |
| 372 | 372 | bitmap_fill(bitmap, cliprect, 0); |
| 373 | 373 | 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); | |
| 378 | 378 | |
| 379 | 379 | if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y) |
| 380 | 380 | { |
| 381 | 381 | tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0); |
| 382 | 382 | |
| 383 | 383 | bitmap_fill(helper2, &playfield_window, 0xff); |
| 384 | firetrk_draw_car( | |
| 384 | firetrk_draw_car( | |
| 385 | 385 | check_collision(0); |
| 386 | 386 | |
| 387 | 387 | bitmap_fill(helper2, &playfield_window, 0xff); |
| 388 | firetrk_draw_car( | |
| 388 | firetrk_draw_car( | |
| 389 | 389 | check_collision(1); |
| 390 | 390 | |
| 391 | 391 | *firetrk_blink = FALSE; |
| r5077 | r5078 | |
| 405 | 405 | |
| 406 | 406 | bitmap_fill(bitmap, cliprect, 0); |
| 407 | 407 | 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); | |
| 411 | 411 | |
| 412 | 412 | if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y) |
| 413 | 413 | { |
| 414 | 414 | tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0); |
| 415 | 415 | |
| 416 | 416 | bitmap_fill(helper2, &playfield_window, 0xff); |
| 417 | superbug_draw_car( | |
| 417 | superbug_draw_car( | |
| 418 | 418 | check_collision(0); |
| 419 | 419 | |
| 420 | 420 | *firetrk_blink = FALSE; |
| r5077 | r5078 | |
| 434 | 434 | |
| 435 | 435 | bitmap_fill(bitmap, cliprect, 0x2c); |
| 436 | 436 | 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); | |
| 441 | 441 | |
| 442 | 442 | if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y) |
| 443 | 443 | { |
| 444 | 444 | tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0); |
| 445 | 445 | |
| 446 | 446 | bitmap_fill(helper2, &playfield_window, 0xff); |
| 447 | montecar_draw_car( | |
| 447 | montecar_draw_car( | |
| 448 | 448 | check_collision(0); |
| 449 | 449 | |
| 450 | 450 | bitmap_fill(helper2, &playfield_window, 0xff); |
| 451 | montecar_draw_car( | |
| 451 | montecar_draw_car( | |
| 452 | 452 | check_collision(1); |
| 453 | 453 | } |
| 454 | 454 |
| r5077 | r5078 | |
|---|---|---|
| 244 | 244 | flipy = !flipy; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | drawgfx(bitmap,machine->gfx[1+bank], | |
| 247 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1+bank], | |
| 248 | 248 | tile_number, |
| 249 | 249 | color, |
| 250 | 250 | flipx,flipy, |
| 251 | 251 | sx,sy, |
| 252 | cliprect,TRANSPARENCY_PENS, | |
| 253 | 252 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 256+15)); |
| 254 | 253 | } |
| 255 | 254 | } |
| r5077 | r5078 | |
|---|---|---|
| 127 | 127 | sy = 240 - sy; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | drawgfx(bitmap,gfx, | |
| 130 | drawgfx_transpen(bitmap,&clip,gfx, | |
| 131 | 131 | code, |
| 132 | 132 | color, |
| 133 | 133 | flip_screen_get(machine),flip_screen_get(machine), |
| 134 | sx,sy, | |
| 135 | &clip,TRANSPARENCY_PEN,0); | |
| 134 | sx,sy,0); | |
| 136 | 135 | } |
| 137 | 136 | } |
| 138 | 137 |
| r5077 | r5078 | |
|---|---|---|
| 174 | 174 | flipy = !flipy; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | drawgfx(bitmap,machine->gfx[1], | |
| 177 | drawgfx_transmask(bitmap,cliprect,machine->gfx[1], | |
| 178 | 178 | sprcros2_spriteram[offs], |
| 179 | 179 | color, |
| 180 | 180 | flipx,flipy, |
| 181 | 181 | sx,sy, |
| 182 | cliprect,TRANSPARENCY_PENS, | |
| 183 | 182 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 184 | 183 | } |
| 185 | 184 | } |
| r5077 | r5078 | |
|---|---|---|
| 338 | 338 | if (spriteram[offs + i] & 0x80) |
| 339 | 339 | { |
| 340 | 340 | if (spriteram[offs + i] & 0x40) /* 16x16 */ |
| 341 | drawgfx(bitmap,machine->gfx[1], | |
| 341 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 342 | 342 | (spriteram[offs + i + 1] >> 2) + 4 * (spriteram[offs + i + 2] & 0x10), |
| 343 | 343 | spriteram[offs + i + 2] & 0x0f, |
| 344 | 344 | spriteram[offs + i] & 0x20,spriteram[offs + i] & 0x10, |
| 345 | 345 | 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); | |
| 348 | 347 | else /* 8x8 */ |
| 349 | drawgfx(bitmap,machine->gfx[2], | |
| 348 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 350 | 349 | spriteram[offs + i + 1] + 16 * (spriteram[offs + i + 2] & 0x10), |
| 351 | 350 | spriteram[offs + i + 2] & 0x0f, |
| 352 | 351 | spriteram[offs + i] & 0x20,spriteram[offs + i] & 0x10, |
| 353 | 352 | spriteram[offs + i + 3], |
| 354 | offs / 4 + (spriteram[offs + i] & 0x0f), | |
| 355 | cliprect,TRANSPARENCY_PEN,0); | |
| 353 | offs / 4 + (spriteram[offs + i] & 0x0f),0); | |
| 356 | 354 | } |
| 357 | 355 | } |
| 358 | 356 | } |
| r5077 | r5078 | |
|---|---|---|
| 479 | 479 | { |
| 480 | 480 | int base_color = (circuit*4)*16+(K007121_ctrlram[circuit][6]&0x10)*2; |
| 481 | 481 | |
| 482 | K007121_sprites_draw(circuit,bitmap,machine->gfx,machine->colortable | |
| 482 | K007121_sprites_draw(circuit,bitmap,cliprect,machine->gfx,machine->colortable | |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | |
| r5077 | r5078 | |
| 630 | 630 | // if(combasc_vreg == 0x23 && (attributes & 0x02)) color += 1*16; |
| 631 | 631 | // if(combasc_vreg == 0x66 ) color += 2*16; |
| 632 | 632 | |
| 633 | drawgfx( bitmap, gfx, | |
| 633 | drawgfx_transpen( bitmap, cliprect, gfx, | |
| 634 | 634 | number, color, |
| 635 | 635 | attributes & 0x10,0, /* flip */ |
| 636 | x,y, | |
| 637 | cliprect, TRANSPARENCY_PEN, 15 ); | |
| 636 | x,y, 15 ); | |
| 638 | 637 | } |
| 639 | 638 | source -= 8; |
| 640 | 639 | } |
| r5077 | r5078 | |
|---|---|---|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | // 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); | |
| 111 | 110 | } |
| 112 | 111 | } |
| 113 | 112 |
| r5077 | r5078 | |
|---|---|---|
| 111 | 111 | if (flip_screen_x_get(machine)) sx = 31 - sx; |
| 112 | 112 | if (flip_screen_y_get(machine)) sy = 31 - sy; |
| 113 | 113 | |
| 114 | drawgfx(tmpbitmap1,machine->gfx[0], | |
| 114 | drawgfx_opaque(tmpbitmap1,NULL,machine->gfx[0], | |
| 115 | 115 | code, |
| 116 | 116 | 2, |
| 117 | 117 | 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); | |
| 120 | 119 | } |
| 121 | 120 | |
| 122 | 121 | /* first copy to a temp bitmap doing column scroll */ |
| r5077 | r5078 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | for (y = 0;y < height;y++) |
| 116 | 116 | { |
| 117 | drawgfx(bitmap,machine->gfx[1], | |
| 117 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 118 | 118 | code + (flipy ? height-1 - y : y), |
| 119 | 119 | color, |
| 120 | 120 | 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); | |
| 123 | 122 | } |
| 124 | 123 | } |
| 125 | 124 | } |
| r5077 | r5078 | |
|---|---|---|
| 212 | 212 | { |
| 213 | 213 | int code = (starshp1_obj_ram[i] & 0xf) ^ 0xf; |
| 214 | 214 | |
| 215 | drawgfx(bitmap, machine->gfx[1], | |
| 215 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 216 | 216 | code % 8, |
| 217 | 217 | code / 8, |
| 218 | 218 | 0, 0, |
| 219 | 219 | get_sprite_hpos(i), |
| 220 | get_sprite_vpos(i), | |
| 221 | cliprect, TRANSPARENCY_PEN, 0); | |
| 220 | get_sprite_vpos(i), 0); | |
| 222 | 221 | } |
| 223 | 222 | } |
| 224 | 223 | |
| r5077 | r5078 | |
| 239 | 238 | if (y <= 0) |
| 240 | 239 | y -= (yzoom * starshp1_ship_voffset) >> 16; |
| 241 | 240 | |
| 242 | drawgfxzoom(bitmap, machine->gfx[2], | |
| 241 | drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[2], | |
| 243 | 242 | starshp1_ship_picture & 0x03, |
| 244 | 243 | starshp1_ship_explode, |
| 245 | 244 | starshp1_ship_picture & 0x80, 0, |
| 246 | 245 | x, y, |
| 247 | cliprect, TRANSPARENCY_PEN, 0, | |
| 248 | xzoom, yzoom); | |
| 246 | xzoom, yzoom, 0); | |
| 249 | 247 | } |
| 250 | 248 | |
| 251 | 249 |
| r5077 | r5078 | |
|---|---|---|
| 157 | 157 | int nflipx = sr[offs + 3] & 0x40; |
| 158 | 158 | int nflipy = sr[offs + 3] & 0x80; |
| 159 | 159 | |
| 160 | drawgfx(bitmap,machine->gfx[0], | |
| 160 | drawgfx_transmask(bitmap,cliprect,machine->gfx[0], | |
| 161 | 161 | sr[offs + 2], |
| 162 | 162 | color, |
| 163 | 163 | !nflipx,!nflipy, |
| 164 | 164 | sx,sy, |
| 165 | cliprect,TRANSPARENCY_PENS, | |
| 166 | 165 | colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0)); |
| 167 | 166 | } |
| 168 | 167 | } |
| r5077 | r5078 | |
|---|---|---|
| 44 | 44 | flipx = attr & 0x0100; |
| 45 | 45 | col = attr & 0x000f; |
| 46 | 46 | |
| 47 | drawgfx(bitmap,gfx,num,col,flipx,0,xpos,ypos | |
| 47 | drawgfx_transpen(bitmap,cliprect,gfx,num,col,flipx,0,xpos,ypos | |
| 48 | 48 | source+=8; |
| 49 | 49 | } |
| 50 | 50 | } |
| r5077 | r5078 | |
|---|---|---|
| 367 | 367 | spritebank_buffered[7] = spritebank_buffered[6] + 0x400; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | static void taito_f2_tc360_spritemixdraw( bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 370 | static void taito_f2_tc360_spritemixdraw( bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 371 | 371 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 372 | | |
| 372 | | |
| 373 | 373 | { |
| 374 | 374 | int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); |
| 375 | 375 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| r5077 | r5078 | |
| 857 | 857 | } |
| 858 | 858 | else |
| 859 | 859 | { |
| 860 | drawgfxzoom(bitmap,machine->gfx[0], | |
| 860 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 861 | 861 | sprite_ptr->code, |
| 862 | 862 | sprite_ptr->color, |
| 863 | 863 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 864 | 864 | 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); | |
| 867 | 866 | } |
| 868 | 867 | } |
| 869 | 868 | } |
| r5077 | r5078 | |
| 875 | 874 | sprite_ptr--; |
| 876 | 875 | |
| 877 | 876 | if (!uses_tc360_mixer) |
| 878 | pdrawgfxzoom(bitmap,machine->gfx[0], | |
| 877 | pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0], | |
| 879 | 878 | sprite_ptr->code, |
| 880 | 879 | sprite_ptr->color, |
| 881 | 880 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 882 | 881 | sprite_ptr->x,sprite_ptr->y, |
| 883 | cliprect,TRANSPARENCY_PEN,0, | |
| 884 | 882 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 885 | sprite_ptr->primask); | |
| 883 | priority_bitmap,sprite_ptr->primask,0); | |
| 886 | 884 | else |
| 887 | taito_f2_tc360_spritemixdraw(bitmap,machine->gfx[0], | |
| 885 | taito_f2_tc360_spritemixdraw(bitmap,cliprect,machine->gfx[0], | |
| 888 | 886 | sprite_ptr->code, |
| 889 | 887 | sprite_ptr->color, |
| 890 | 888 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 891 | 889 | sprite_ptr->x,sprite_ptr->y, |
| 892 | cliprect, | |
| 893 | 890 | sprite_ptr->zoomx,sprite_ptr->zoomy); |
| 894 | 891 | } |
| 895 | 892 | } |
| r5077 | r5078 | |
|---|---|---|
| 161 | 161 | flipy = !flipy; |
| 162 | 162 | } |
| 163 | 163 | |
| 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, | |
| 166 | 165 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 167 | 166 | } |
| 168 | 167 | } |
| r5077 | r5078 | |
| 213 | 212 | flipy = !flipy; |
| 214 | 213 | } |
| 215 | 214 | |
| 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, | |
| 218 | 216 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 219 | 217 | } |
| 220 | 218 | } |
| r5077 | r5078 | |
|---|---|---|
| 281 | 281 | |
| 282 | 282 | code = stfight_sprite_base + stfight_sprite_ram[offs]; |
| 283 | 283 | |
| 284 | pdrawgfx(bitmap,machine->gfx[4], | |
| 284 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4], | |
| 285 | 285 | code, |
| 286 | 286 | color, |
| 287 | 287 | flipx,flip_screen_get(machine), |
| 288 | 288 | sx,sy, |
| 289 | cliprect,TRANSPARENCY_PEN,0x0f, | |
| 290 | pri ? 0x02 : 0); | |
| 289 | priority_bitmap, | |
| 290 | pri ? 0x02 : 0,0x0f); | |
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | } |
| r5077 | r5078 | |
|---|---|---|
| 233 | 233 | if (flip_screen_x_get(machine)) sx = 233 - sx; |
| 234 | 234 | if (flip_screen_y_get(machine)) sy = 244 - sy; |
| 235 | 235 | |
| 236 | drawgfx(bitmap, machine->gfx[2], | |
| 236 | drawgfx_transpen(bitmap, &clip, | |
| 237 | machine->gfx[2], | |
| 237 | 238 | code, 0, |
| 238 | 239 | flip_screen_x_get(machine), flip_screen_y_get(machine), |
| 239 | sx,sy, | |
| 240 | &clip, | |
| 241 | TRANSPARENCY_PEN, 0); | |
| 240 | sx,sy, 0); | |
| 242 | 241 | } |
| 243 | 242 | } |
| 244 | 243 |
| r5077 | r5078 | |
|---|---|---|
| 157 | 157 | |
| 158 | 158 | ***************************************************************************/ |
| 159 | 159 | |
| 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); | |
| 163 | 163 | |
| 164 | 164 | static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectangle *cliprect) |
| 165 | 165 | { |
| r5077 | r5078 | |
|---|---|---|
| 248 | 248 | int sx = 236 - *exidy_sprite2_xpos - 4; |
| 249 | 249 | int sy = 244 - *exidy_sprite2_ypos - 4; |
| 250 | 250 | |
| 251 | drawgfx(bitmap, machine->gfx[0], | |
| 251 | drawgfx_transpen(bitmap, cliprect, machine->gfx[0], | |
| 252 | 252 | ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 1, |
| 253 | 0, 0, sx, sy, | |
| 253 | 0, 0, sx, sy, | |
| 254 | 254 | |
| 255 | 255 | /* draw sprite 1 next */ |
| 256 | 256 | if (sprite_1_enabled()) |
| r5077 | r5078 | |
| 262 | 262 | |
| 263 | 263 | if (sy < 0) sy = 0; |
| 264 | 264 | |
| 265 | drawgfx(bitmap, machine->gfx[0], | |
| 265 | drawgfx_transpen(bitmap, cliprect, machine->gfx[0], | |
| 266 | 266 | (*exidy_spriteno & 0x0f) + 16 * sprite_set_1, 0, |
| 267 | 0, 0, sx, sy, | |
| 267 | 0, 0, sx, sy, | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | } |
| r5077 | r5078 | |
| 319 | 319 | { |
| 320 | 320 | org_1_x = 236 - *exidy_sprite1_xpos - 4; |
| 321 | 321 | 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], | |
| 323 | 323 | (*exidy_spriteno & 0x0f) + 16 * sprite_set_1, 0, |
| 324 | 0, 0, 0, 0, | |
| 324 | 0, 0, 0, 0, | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /* draw sprite 2 */ |
| 328 | 328 | bitmap_fill(motion_object_2_vid, &clip, 0xff); |
| 329 | 329 | org_2_x = 236 - *exidy_sprite2_xpos - 4; |
| 330 | 330 | 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], | |
| 332 | 332 | ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, |
| 333 | 0, 0, 0, 0, | |
| 333 | 0, 0, 0, 0, | |
| 334 | 334 | |
| 335 | 335 | /* draw sprite 2 clipped to sprite 1's location */ |
| 336 | 336 | bitmap_fill(motion_object_2_clip, &clip, 0xff); |
| r5077 | r5078 | |
| 338 | 338 | { |
| 339 | 339 | sx = org_2_x - org_1_x; |
| 340 | 340 | 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], | |
| 342 | 342 | ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, |
| 343 | 0, 0, sx, sy, | |
| 343 | 0, 0, sx, sy, | |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /* scan for collisions */ |
| r5077 | r5078 | |
|---|---|---|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | static void draw_sprites(bitmap_t *bitmap, | |
| 89 | static void draw_sprites(bitmap_t *bitmap, | |
| 90 | 90 | { |
| 91 | 91 | int offs; |
| 92 | 92 | int chr,col; |
| r5077 | r5078 | |
| 119 | 119 | |
| 120 | 120 | px &= 0x1ff; |
| 121 | 121 | |
| 122 | drawgfx(bitmap,gfx | |
| 122 | drawgfx_transpen(bitmap,cliprect,gfx | |
| 123 | 123 | chr, |
| 124 | 124 | col, |
| 125 | 125 | fx,fy, |
| 126 | px,py, | |
| 127 | cliprect,TRANSPARENCY_PEN,0); | |
| 126 | px,py,0); | |
| 128 | 127 | |
| 129 | 128 | if (px>0x1e0) |
| 130 | drawgfx(bitmap,gfx | |
| 129 | drawgfx_transpen(bitmap,cliprect,gfx | |
| 131 | 130 | chr, |
| 132 | 131 | col, |
| 133 | 132 | fx,fy, |
| 134 | px-0x200,py, | |
| 135 | cliprect,TRANSPARENCY_PEN,0); | |
| 133 | px-0x200,py,0); | |
| 136 | 134 | |
| 137 | 135 | } |
| 138 | 136 | } |
| r5077 | r5078 | |
| 147 | 145 | tilemap_set_scrolly(bg_tilemap, 0, yscroll); |
| 148 | 146 | |
| 149 | 147 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 150 | draw_sprites(bitmap, screen->machine->gfx | |
| 148 | draw_sprites(bitmap, cliprect, screen->machine->gfx[1] | |
| 151 | 149 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 152 | 150 | |
| 153 | 151 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 48 | 48 | xpos -= 28; |
| 49 | 49 | ypos -= 16; |
| 50 | 50 | |
| 51 | drawgfx( | |
| 51 | drawgfx_transpen( | |
| 52 | 52 | bitmap, |
| 53 | cliprect, | |
| 53 | 54 | gfx, |
| 54 | 55 | num, |
| 55 | 56 | colour, |
| 56 | 57 | flipx,0, |
| 57 | xpos,ypos, | |
| 58 | cliprect, | |
| 59 | TRANSPARENCY_PEN,0 | |
| 58 | xpos,ypos,0 | |
| 60 | 59 | ); |
| 61 | 60 | |
| 62 | 61 | source += 0x8; |
| r5077 | r5078 | |
|---|---|---|
| 82 | 82 | if (flipy) flipy=0; else flipy=1; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | drawgfx(bitmap,machine->gfx[1], | |
| 85 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 86 | 86 | spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8), |
| 87 | 87 | (spriteram[offs+1] & 0x70) >> 4, |
| 88 | 88 | flipx,flipy, |
| 89 | sx,sy, | |
| 90 | cliprect,TRANSPARENCY_PEN,0); | |
| 89 | sx,sy,0); | |
| 91 | 90 | } |
| 92 | 91 | } |
| 93 | 92 | } |
| r5077 | r5078 | |
|---|---|---|
| 199 | 199 | { |
| 200 | 200 | for(xdrw=0;xdrw<=chainx;xdrw++) |
| 201 | 201 | { |
| 202 | drawgfxzoom(bitmap,gfx,tileno,pal,xflip,yflip,xpos+(xinc*xdrw),ypos+(yinc*ydrw), | |
| 202 | drawgfxzoom_transpen(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,xpos+(xinc*xdrw),ypos+(yinc*ydrw), | |
| 203 | 203 | tileno++; |
| 204 | 204 | } |
| 205 | 205 | } |
| r5077 | r5078 | |
|---|---|---|
| 89 | 89 | flipy = !flipy; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | drawgfx(bitmap, machine->gfx[2], | |
| 92 | drawgfx_transpen(bitmap, cliprect, | |
| 93 | machine->gfx[2], | |
| 93 | 94 | code, color, |
| 94 | 95 | flipx, flipy, |
| 95 | sx, sy, | |
| 96 | cliprect, | |
| 97 | TRANSPARENCY_PEN, 0); | |
| 96 | sx, sy, 0); | |
| 98 | 97 | } |
| 99 | 98 | } |
| 100 | 99 |
| r5077 | r5078 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | int t = tile_offset[ey][ex] + tile_number; |
| 238 | 238 | |
| 239 | drawgfx(bitmap,machine->gfx[2], | |
| 239 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 240 | 240 | t, |
| 241 | 241 | color, |
| 242 | 242 | xflip, yflip, |
| 243 | sx+x*16, sy+y*16, | |
| 244 | cliprect,TRANSPARENCY_PEN,0); | |
| 243 | sx+x*16, sy+y*16,0); | |
| 245 | 244 | } |
| 246 | 245 | } |
| 247 | 246 | } |
| r5077 | r5078 | |
|---|---|---|
| 112 | 112 | tile += tile; |
| 113 | 113 | palette = sprite_ram[offs+2] >> 3; |
| 114 | 114 | |
| 115 | drawgfx(bitmap,machine->gfx[gfxbank], | |
| 115 | drawgfx_transpen(bitmap,cliprect, | |
| 116 | machine->gfx[gfxbank], | |
| 116 | 117 | tile, |
| 117 | 118 | palette, |
| 118 | 119 | 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], | |
| 123 | 123 | tile+1, |
| 124 | 124 | palette, |
| 125 | 125 | 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); | |
| 129 | 127 | } |
| 130 | 128 | } |
| 131 | 129 | } |
| r5077 | r5078 | |
|---|---|---|
| 277 | 277 | flipy = !flipy; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | pdrawgfx(bitmap,machine->gfx[1], | |
| 280 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 281 | 281 | code, |
| 282 | 282 | color, |
| 283 | 283 | flipx,flipy, |
| 284 | 284 | sx,sy, |
| 285 | cliprect,TRANSPARENCY_PEN,0, | |
| 286 | (color & 0x08) ? 0xaa : 0x00); | |
| 285 | priority_bitmap, | |
| 286 | (color & 0x08) ? 0xaa : 0x00,0); | |
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 |
| r5077 | r5078 | |
|---|---|---|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| 137 | static void draw_sprites( | |
| 137 | static void draw_sprites( | |
| 138 | 138 | { |
| 139 | 139 | int offs; |
| 140 | 140 | |
| r5077 | r5078 | |
| 149 | 149 | int flip_x = ~gyruss_spriteram[offs + 2] & 0x40; |
| 150 | 150 | int flip_y = gyruss_spriteram[offs + 2] & 0x80; |
| 151 | 151 | |
| 152 | drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y | |
| 152 | drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, x, y | |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| r5077 | r5078 | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | tilemap_draw(bitmap, cliprect, gyruss_tilemap, TILEMAP_DRAW_OPAQUE, 0); |
| 166 | draw_sprites(screen->machine->gfx | |
| 166 | draw_sprites(bitmap, cliprect, screen->machine->gfx | |
| 167 | 167 | tilemap_draw(bitmap, cliprect, gyruss_tilemap, 0, 0); |
| 168 | 168 | |
| 169 | 169 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 203 | 203 | else |
| 204 | 204 | clipper=cliprect; |
| 205 | 205 | |
| 206 | pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx], | |
| 206 | pdrawgfxzoom_transpen(bitmap,clipper,machine->gfx[sprite_ptr->gfx], | |
| 207 | 207 | sprite_ptr->code, |
| 208 | 208 | sprite_ptr->color, |
| 209 | 209 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 210 | 210 | sprite_ptr->x,sprite_ptr->y, |
| 211 | clipper,TRANSPARENCY_PEN,0, | |
| 212 | 211 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 213 | primasks[sprite_ptr->pri]); | |
| 212 | priority_bitmap,primasks[sprite_ptr->pri],0); | |
| 214 | 213 | } |
| 215 | 214 | } |
| 216 | 215 |
| r5077 | r5078 | |
|---|---|---|
| 163 | 163 | tilemap_set_scrolly( layer0, 0, K007121_ctrlram[0][0x02] ); |
| 164 | 164 | |
| 165 | 165 | tilemap_draw(bitmap,&finalclip0,layer0,0,0); |
| 166 | K007121_sprites_draw(0,bitmap,screen->machine->gfx,screen->machine->colortable | |
| 166 | K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable | |
| 167 | 167 | tilemap_draw(bitmap,&finalclip1,layer1,0,0); |
| 168 | 168 | return 0; |
| 169 | 169 | } |
| r5077 | r5078 | |
|---|---|---|
| 127 | 127 | flipy = !flipy; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | drawgfx( bitmap,machine->gfx[2], | |
| 130 | drawgfx_transpen( bitmap,cliprect,machine->gfx[2], | |
| 131 | 131 | tile_number, |
| 132 | 132 | color, |
| 133 | 133 | flipx,flipy, |
| 134 | sx,sy, | |
| 135 | cliprect,TRANSPARENCY_PEN,0xf ); | |
| 134 | sx,sy,0xf ); | |
| 136 | 135 | } |
| 137 | 136 | } |
| 138 | 137 | } |
| r5077 | r5078 | |
|---|---|---|
| 340 | 340 | for (i=0; i<y_multi; i++) |
| 341 | 341 | { |
| 342 | 342 | if (flip_screen_get(machine)) { |
| 343 | pdrawgfx(bitmap,machine->gfx[1], | |
| 343 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 344 | 344 | sprite + s_ptr, |
| 345 | 345 | colour, |
| 346 | 346 | !fx,!fy, |
| 347 | 347 | 464-x,240-(y-i*16), |
| 348 | | |
| 348 | | |
| 349 | 349 | |
| 350 | 350 | // wrap around x |
| 351 | pdrawgfx(bitmap,machine->gfx[1], | |
| 351 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 352 | 352 | sprite + s_ptr, |
| 353 | 353 | colour, |
| 354 | 354 | !fx,!fy, |
| 355 | 355 | 464-x+512,240-(y-i*16), |
| 356 | | |
| 356 | | |
| 357 | 357 | } else { |
| 358 | pdrawgfx(bitmap,machine->gfx[1], | |
| 358 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 359 | 359 | sprite + s_ptr, |
| 360 | 360 | colour, |
| 361 | 361 | fx,fy, |
| 362 | 362 | x,y-i*16, |
| 363 | | |
| 363 | | |
| 364 | 364 | |
| 365 | 365 | // wrap around x |
| 366 | pdrawgfx(bitmap,machine->gfx[1], | |
| 366 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 367 | 367 | sprite + s_ptr, |
| 368 | 368 | colour, |
| 369 | 369 | fx,fy, |
| 370 | 370 | x-512,y-i*16, |
| 371 | | |
| 371 | | |
| 372 | 372 | } |
| 373 | 373 | if (fy) s_ptr++; else s_ptr--; |
| 374 | 374 | } |
| r5077 | r5078 | |
|---|---|---|
| 216 | 216 | * |
| 217 | 217 | *************************************/ |
| 218 | 218 | |
| 219 | #define DRAW_SPRITE(code, sy) drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy | |
| 219 | #define DRAW_SPRITE(code, sy) drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy | |
| 220 | 220 | |
| 221 | 221 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) |
| 222 | 222 | { |
| r5077 | r5078 | |
|---|---|---|
| 43 | 43 | continue; |
| 44 | 44 | } |
| 45 | 45 | |
| 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); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /* draw alpha numerics */ |
| r5077 | r5078 | |
| 55 | 55 | { |
| 56 | 56 | int num = destroyr_alpha_num_ram[32 * i + j]; |
| 57 | 57 | |
| 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); | |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| r5077 | r5078 | |
| 67 | 67 | int horz = 256 - destroyr_minor_obj_ram[i + 2]; |
| 68 | 68 | int vert = 256 - destroyr_minor_obj_ram[i + 4]; |
| 69 | 69 | |
| 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); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /* draw waves */ |
| 75 | 75 | |
| 76 | 76 | for (i = 0; i < 4; i++) |
| 77 | 77 | { |
| 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); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /* draw cursor */ |
| r5077 | r5078 | |
|---|---|---|
| 195 | 195 | else |
| 196 | 196 | code &= ~0x10, code2 |= 0x10; |
| 197 | 197 | |
| 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); | |
| 200 | 199 | } |
| 201 | 200 | |
| 202 | 201 | if(flags&0x10) |
| r5077 | r5078 | |
| 204 | 203 | |
| 205 | 204 | |
| 206 | 205 | |
| 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); | |
| 213 | 209 | |
| 214 | 210 | } |
| 215 | 211 | |
| 216 | 212 | |
| 217 | 213 | |
| 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); | |
| 220 | 215 | |
| 221 | 216 | if (doubled) i += 4; |
| 222 | 217 | } |
| r5077 | r5078 | |
| 229 | 224 | int y = fcombat_cocktail_flip ? (31*8 - 8*sy) : 8*sy; |
| 230 | 225 | |
| 231 | 226 | offs = sx + sy * 64; |
| 232 | drawgfx(bitmap, screen->machine->gfx[0], | |
| 227 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], | |
| 233 | 228 | videoram[offs] + 256 * char_bank, |
| 234 | 229 | ((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); | |
| 237 | 231 | } |
| 238 | 232 | return 0; |
| 239 | 233 | } |
| r5077 | r5078 | |
|---|---|---|
| 186 | 186 | ex = xflip ? (spr_size-1-x) : x; |
| 187 | 187 | ey = yflip ? (spr_size-1-y) : y; |
| 188 | 188 | |
| 189 | drawgfx(bitmap,gfx,number + x_offset[ex] + y_offset[ey], | |
| 189 | drawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey], | |
| 190 | 190 | 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); | |
| 193 | 192 | } |
| 194 | 193 | } |
| 195 | 194 | } |
| r5077 | r5078 | |
|---|---|---|
| 199 | 199 | for (count=0;count<chain;count++) { |
| 200 | 200 | if (flip_screen_get(machine)) { |
| 201 | 201 | if (!flipy) { |
| 202 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count) | |
| 202 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count) | |
| 203 | 203 | } else { |
| 204 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+16*count | |
| 204 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+16*count | |
| 205 | 205 | } |
| 206 | 206 | } else { |
| 207 | 207 | if (flipy) { |
| 208 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count) | |
| 208 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count) | |
| 209 | 209 | } else { |
| 210 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-16*count | |
| 210 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos-16*count | |
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | } |
| r5077 | r5078 | |
|---|---|---|
| 202 | 202 | sx++; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | drawgfx(bitmap,screen->machine->gfx[gfx], | |
| 205 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx], | |
| 206 | 206 | code, |
| 207 | 207 | col, |
| 208 | 208 | flipx,flipy, |
| 209 | sx,sy, | |
| 210 | cliprect,TRANSPARENCY_PEN,0); | |
| 209 | sx,sy,0); | |
| 211 | 210 | } |
| 212 | 211 | return 0; |
| 213 | 212 | } |
| r5077 | r5078 | |
| 248 | 247 | sx++; |
| 249 | 248 | } |
| 250 | 249 | |
| 251 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 250 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 252 | 251 | code >> 2, |
| 253 | 252 | col, |
| 254 | 253 | flipx,flipy, |
| 255 | sx,sy, | |
| 256 | cliprect,TRANSPARENCY_PEN,0); | |
| 254 | sx,sy,0); | |
| 257 | 255 | } |
| 258 | 256 | |
| 259 | 257 | /* draw the big sprite */ |
| r5077 | r5078 | |
| 278 | 276 | |
| 279 | 277 | code >>= 4; |
| 280 | 278 | |
| 281 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 279 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 282 | 280 | code, |
| 283 | 281 | col, |
| 284 | 282 | flipx,flipy, |
| 285 | sx,sy, | |
| 286 | cliprect,TRANSPARENCY_PEN,0); | |
| 283 | sx,sy,0); | |
| 287 | 284 | |
| 288 | 285 | /* draw again for wrap around */ |
| 289 | 286 | |
| 290 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 287 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 291 | 288 | code, |
| 292 | 289 | col, |
| 293 | 290 | flipx,flipy, |
| 294 | sx-256,sy, | |
| 295 | cliprect,TRANSPARENCY_PEN,0); | |
| 291 | sx-256,sy,0); | |
| 296 | 292 | return 0; |
| 297 | 293 | } |
| 298 | 294 | |
| r5077 | r5078 | |
| 350 | 346 | sx--; |
| 351 | 347 | } |
| 352 | 348 | |
| 353 | drawgfx(bitmap,screen->machine->gfx[gfx], | |
| 349 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx], | |
| 354 | 350 | code, |
| 355 | 351 | col, |
| 356 | 352 | flipx,flipy, |
| 357 | sx,sy, | |
| 358 | cliprect,TRANSPARENCY_PEN,0); | |
| 353 | sx,sy,0); | |
| 359 | 354 | } |
| 360 | 355 | return 0; |
| 361 | 356 | } |
| r5077 | r5078 | |
| 398 | 393 | flipx = !flipx; |
| 399 | 394 | } |
| 400 | 395 | |
| 401 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 396 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 402 | 397 | code >> 2, |
| 403 | 398 | col, |
| 404 | 399 | flipx,flipy, |
| 405 | sx,sy, | |
| 406 | cliprect,TRANSPARENCY_PEN,0); | |
| 400 | sx,sy,0); | |
| 407 | 401 | } |
| 408 | 402 | return 0; |
| 409 | 403 | } |
| r5077 | r5078 | |
| 461 | 455 | sx--; |
| 462 | 456 | } |
| 463 | 457 | |
| 464 | drawgfx(bitmap,screen->machine->gfx[gfx], | |
| 458 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx], | |
| 465 | 459 | code, |
| 466 | 460 | col, |
| 467 | 461 | flipx,flipy, |
| 468 | sx,sy, | |
| 469 | cliprect,TRANSPARENCY_PEN,0); | |
| 462 | sx,sy,0); | |
| 470 | 463 | } |
| 471 | 464 | return 0; |
| 472 | 465 | } |
| r5077 | r5078 | |
|---|---|---|
| 58 | 58 | |
| 59 | 59 | while (multi >= 0) |
| 60 | 60 | { |
| 61 | drawgfx(bitmap,machine->gfx[2], | |
| 61 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 62 | 62 | sprite - multi * inc, |
| 63 | 63 | colour, |
| 64 | 64 | fx,fy, |
| 65 | x,y + mult * multi, | |
| 66 | cliprect,TRANSPARENCY_PEN,0); | |
| 65 | x,y + mult * multi,0); | |
| 67 | 66 | |
| 68 | 67 | multi--; |
| 69 | 68 | } |
| r5077 | r5078 | |
| 123 | 122 | y&=0x1ff; |
| 124 | 123 | y-=8; |
| 125 | 124 | |
| 126 | drawgfx(bitmap,screen->machine->gfx[0],tileno^0x1000,colour,0,0,x,y | |
| 125 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x1000,colour,0,0,x,y | |
| 127 | 126 | } |
| 128 | 127 | |
| 129 | 128 | for (offset = 0x1600/2;offset<0x2000/2;offset+=8) |
| r5077 | r5078 | |
| 137 | 136 | y&=0x1ff; |
| 138 | 137 | y-=8; |
| 139 | 138 | |
| 140 | drawgfx(bitmap,screen->machine->gfx[0],tileno^0x4000,colour,0,0,x,y | |
| 139 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x4000,colour,0,0,x,y | |
| 141 | 140 | } |
| 142 | 141 | |
| 143 | 142 | for (offset = 0x2000/2;offset<0x4000/2;offset+=8) |
| r5077 | r5078 | |
| 151 | 150 | y&=0x1ff; |
| 152 | 151 | y-=8; |
| 153 | 152 | |
| 154 | drawgfx(bitmap,screen->machine->gfx[0],tileno^0x3000,colour,0,0,x,y | |
| 153 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x3000,colour,0,0,x,y | |
| 155 | 154 | } |
| 156 | 155 | |
| 157 | 156 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 171 | 171 | int flipx = ~spriteram_2[offs] & 0x40; |
| 172 | 172 | int flipy = spriteram_2[offs] & 0x80; |
| 173 | 173 | |
| 174 | drawgfx(bitmap,machine->gfx[1], | |
| 174 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 175 | 175 | code, |
| 176 | 176 | color, |
| 177 | 177 | flipx,flipy, |
| 178 | sx,sy, | |
| 179 | cliprect,TRANSPARENCY_PEN,0); | |
| 178 | sx,sy,0); | |
| 180 | 179 | } |
| 181 | 180 | } |
| 182 | 181 |
| r5077 | r5078 | |
|---|---|---|
| 202 | 202 | for (x = xstart; x != xend; x += xinc) |
| 203 | 203 | { |
| 204 | 204 | if (xzoom == (16*8) && yzoom == (16*8)) |
| 205 | pdrawgfx( bitmap,screen->machine->gfx[0], | |
| 205 | pdrawgfx_transpen( bitmap,cliprect,screen->machine->gfx[0], | |
| 206 | 206 | code++, |
| 207 | 207 | attr & 0x3f, |
| 208 | 208 | flipx, flipy, |
| 209 | 209 | sx + x * 16, sy + y * 16, |
| 210 | cliprect,TRANSPARENCY_PEN,15, | |
| 211 | pri_mask ); | |
| 210 | priority_bitmap, | |
| 211 | pri_mask,15 ); | |
| 212 | 212 | else |
| 213 | pdrawgfxzoom( bitmap,screen->machine->gfx[0], | |
| 213 | pdrawgfxzoom_transpen( bitmap,cliprect,screen->machine->gfx[0], | |
| 214 | 214 | code++, |
| 215 | 215 | attr & 0x3f, |
| 216 | 216 | flipx, flipy, |
| 217 | 217 | 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 ); | |
| 221 | 220 | } |
| 222 | 221 | } |
| 223 | 222 |
| r5077 | r5078 | |
|---|---|---|
| 197 | 197 | |
| 198 | 198 | do |
| 199 | 199 | { |
| 200 | drawgfx(bitmap,machine->gfx[2], | |
| 200 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 201 | 201 | code + i, |
| 202 | 202 | col, |
| 203 | 203 | 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); | |
| 206 | 205 | |
| 207 | 206 | /* draw again with wraparound */ |
| 208 | drawgfx(bitmap,machine->gfx[2], | |
| 207 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 209 | 208 | code + i, |
| 210 | 209 | col, |
| 211 | 210 | 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); | |
| 214 | 212 | i--; |
| 215 | 213 | } while (i >= 0); |
| 216 | 214 | } |
| r5077 | r5078 | |
|---|---|---|
| 83 | 83 | code = spriteram16[offs+2] >> codeshift; |
| 84 | 84 | color = (spriteram16[offs+1] & 0x3e00) >> 9; |
| 85 | 85 | |
| 86 | drawgfx(bitmap,machine->gfx[1], | |
| 86 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 87 | 87 | code, |
| 88 | 88 | color/colordiv+48, |
| 89 | 89 | flipx,0, |
| 90 | sx,sy, | |
| 91 | cliprect,TRANSPARENCY_PEN,0); | |
| 90 | sx,sy,0); | |
| 92 | 91 | } |
| 93 | 92 | } |
| 94 | 93 |
| r5077 | r5078 | |
|---|---|---|
| 111 | 111 | draw_line (bitmap,cliprect,0,193,17,193,0); |
| 112 | 112 | draw_line (bitmap,cliprect,231,193,248,193,0); |
| 113 | 113 | |
| 114 | drawgfx(bitmap,machine->gfx[1], | |
| 114 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 115 | 115 | clown_z, |
| 116 | 116 | 0, |
| 117 | 117 | 0,0, |
| 118 | clown_y,clown_x, | |
| 119 | cliprect,TRANSPARENCY_PEN,0); | |
| 118 | clown_y,clown_x,0); | |
| 120 | 119 | } |
| 121 | 120 | |
| 122 | 121 | VIDEO_UPDATE( circus ) |
| r5077 | r5078 | |
| 161 | 160 | |
| 162 | 161 | static void robotbwl_draw_ball(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 163 | 162 | { |
| 164 | drawgfx(bitmap,machine->gfx[1], | |
| 163 | drawgfx_transpen(bitmap,/* Y is horizontal position */ | |
| 164 | cliprect,machine->gfx[1], | |
| 165 | 165 | clown_z, |
| 166 | 166 | 0, |
| 167 | 167 | 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); | |
| 170 | 169 | } |
| 171 | 170 | |
| 172 | 171 | VIDEO_UPDATE( robotbwl ) |
| r5077 | r5078 | |
| 180 | 179 | |
| 181 | 180 | static void crash_draw_car(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 182 | 181 | { |
| 183 | drawgfx(bitmap,machine->gfx[1], | |
| 182 | drawgfx_transpen(bitmap,/* Y is horizontal position */ | |
| 183 | cliprect,machine->gfx[1], | |
| 184 | 184 | clown_z, |
| 185 | 185 | 0, |
| 186 | 186 | 0,0, |
| 187 | clown_y,clown_x, /* Y is horizontal position */ | |
| 188 | cliprect,TRANSPARENCY_PEN,0); | |
| 187 | clown_y,clown_x,0); | |
| 189 | 188 | } |
| 190 | 189 | |
| 191 | 190 | VIDEO_UPDATE( crash ) |
| r5077 | r5078 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | /* Draw first sprite */ |
| 67 | 67 | |
| 68 | drawgfx(spritebitmap,machine->gfx[expand], | |
| 68 | drawgfx_opaque(spritebitmap,0, machine->gfx[expand], | |
| 69 | 69 | first * 2, |
| 70 | 70 | 0, |
| 71 | 71 | 0,0, |
| 72 | fx,fy, | |
| 73 | 0, TRANSPARENCY_NONE, 0); | |
| 72 | fx,fy); | |
| 74 | 73 | |
| 75 | 74 | /* Get fingerprint */ |
| 76 | 75 | |
| r5077 | r5078 | |
| 92 | 91 | |
| 93 | 92 | /* Blackout second sprite */ |
| 94 | 93 | |
| 95 | drawgfx(spritebitmap,machine->gfx[1], | |
| 94 | drawgfx_transpen(spritebitmap,0, machine->gfx[1], | |
| 96 | 95 | second * 2, |
| 97 | 96 | 1, |
| 98 | 97 | 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); | |
| 101 | 99 | |
| 102 | 100 | /* Remove fingerprint */ |
| 103 | 101 | |
| r5077 | r5078 | |
| 119 | 117 | |
| 120 | 118 | /* Zero bitmap */ |
| 121 | 119 | |
| 122 | drawgfx(spritebitmap,machine->gfx[expand], | |
| 120 | drawgfx_opaque(spritebitmap,0, machine->gfx[expand], | |
| 123 | 121 | first * 2, |
| 124 | 122 | 1, |
| 125 | 123 | 0,0, |
| 126 | fx,fy, | |
| 127 | 0, TRANSPARENCY_NONE, 0); | |
| 124 | fx,fy); | |
| 128 | 125 | } |
| 129 | 126 | |
| 130 | 127 | return Checksum; |
| r5077 | r5078 | |
| 181 | 178 | int x,y; |
| 182 | 179 | |
| 183 | 180 | /* Sprite->Background collision detection */ |
| 184 | drawgfx(bitmap,machine->gfx[expand], | |
| 181 | drawgfx_transpen(bitmap,0, machine->gfx[expand], | |
| 185 | 182 | spriteno, |
| 186 | 183 | 1, |
| 187 | 184 | 0,0, |
| 188 | bx,by, | |
| 189 | 0, TRANSPARENCY_PEN, 0); | |
| 185 | bx,by, 0); | |
| 190 | 186 | |
| 191 | 187 | for (x = bx; x < bx + machine->gfx[expand]->width; x++) |
| 192 | 188 | { |
| r5077 | r5078 | |
| 208 | 204 | } |
| 209 | 205 | } |
| 210 | 206 | |
| 211 | drawgfx(bitmap,machine->gfx[expand], | |
| 207 | drawgfx_transpen(bitmap,0, machine->gfx[expand], | |
| 212 | 208 | spriteno, |
| 213 | 209 | 0, |
| 214 | 210 | 0,0, |
| 215 | bx,by, | |
| 216 | 0, TRANSPARENCY_PEN, 0); | |
| 211 | bx,by, 0); | |
| 217 | 212 | } |
| 218 | 213 | } |
| 219 | 214 |
| r5077 | r5078 | |
|---|---|---|
| 215 | 215 | if (flipy) dy = sy + sizey-15 - dy; |
| 216 | 216 | else dy = sy + dy; |
| 217 | 217 | |
| 218 | drawgfx(rawbitmap,space->machine->gfx[0], | |
| 218 | drawgfx_transpen(rawbitmap,&myclip,space->machine->gfx[0], | |
| 219 | 219 | (tile & 0x0fff) | (code & 0xf000), |
| 220 | 220 | (tile >> 12) | (color & 0x70), |
| 221 | 221 | flipx,flipy, |
| 222 | dx,dy, | |
| 223 | &myclip,TRANSPARENCY_PEN,15); | |
| 222 | dx,dy,15); | |
| 224 | 223 | } |
| 225 | 224 | } |
| 226 | 225 | } |
| r5077 | r5078 | |
|---|---|---|
| 157 | 157 | if (!flip_screen_get(machine)) |
| 158 | 158 | sy = 224 - sy; |
| 159 | 159 | |
| 160 | drawgfx(bitmap,machine->gfx[2], | |
| 160 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 161 | 161 | code/2, |
| 162 | 162 | color, |
| 163 | 163 | flipx,flipy, |
| 164 | sx,sy, | |
| 165 | cliprect,TRANSPARENCY_PEN,0); | |
| 164 | sx,sy,0); | |
| 166 | 165 | /* redraw with wraparound */ |
| 167 | drawgfx(bitmap,machine->gfx[2], | |
| 166 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 168 | 167 | code/2, |
| 169 | 168 | color, |
| 170 | 169 | flipx,flipy, |
| 171 | sx,sy+256, | |
| 172 | cliprect,TRANSPARENCY_PEN,0); | |
| 170 | sx,sy+256,0); | |
| 173 | 171 | } |
| 174 | 172 | else |
| 175 | 173 | { |
| 176 | 174 | if (!flip_screen_get(machine)) |
| 177 | 175 | sy = 240 - sy; |
| 178 | 176 | |
| 179 | drawgfx(bitmap,machine->gfx[1], | |
| 177 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 180 | 178 | code, |
| 181 | 179 | color, |
| 182 | 180 | flipx,flipy, |
| 183 | sx,sy, | |
| 184 | cliprect,TRANSPARENCY_PEN,0); | |
| 181 | sx,sy,0); | |
| 185 | 182 | } |
| 186 | 183 | } |
| 187 | 184 | } |
| r5077 | r5078 | |
|---|---|---|
| 105 | 105 | else sx = ((xpos + xzoom * x / 2 + 16) & 0x1ff) - 16; |
| 106 | 106 | |
| 107 | 107 | |
| 108 | drawgfxzoom(bitmap,gfx, | |
| 108 | drawgfxzoom_transpen(bitmap,cliprect,gfx, | |
| 109 | 109 | realtile, |
| 110 | 110 | color, |
| 111 | 111 | xflip,yflip, |
| 112 | 112 | sx,sy, |
| 113 | cliprect,TRANSPARENCY_PEN,15, | |
| 114 | xzoom << 11, yzoom << 11); | |
| 113 | xzoom << 11, yzoom << 11,15); | |
| 115 | 114 | |
| 116 | 115 | tile++; |
| 117 | 116 |
| r5077 | r5078 | |
|---|---|---|
| 2619 | 2619 | dest++; \ |
| 2620 | 2620 | pri++; |
| 2621 | 2621 | |
| 2622 | INLINE void f3_drawgfx( running_machine *machine, | |
| 2623 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 2622 | INLINE void f3_drawgfx( | |
| 2623 | bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 2624 | 2624 | UINT32 code, |
| 2625 | 2625 | UINT32 color, |
| 2626 | 2626 | int flipx,int flipy, |
| 2627 | 2627 | int sx,int sy, |
| 2628 | const rectangle *clip, | |
| 2629 | 2628 | UINT8 pri_dst) |
| 2630 | 2629 | { |
| 2631 | 2630 | rectangle myclip; |
| r5077 | r5078 | |
| 2651 | 2650 | |
| 2652 | 2651 | if( gfx ) |
| 2653 | 2652 | { |
| 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)]; | |
| 2655 | 2654 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 2656 | 2655 | |
| 2657 | 2656 | { |
| r5077 | r5078 | |
| 2783 | 2782 | #undef NEXT_P |
| 2784 | 2783 | |
| 2785 | 2784 | |
| 2786 | INLINE void f3_drawgfxzoom(running_machine *machine, | |
| 2787 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 2785 | INLINE void f3_drawgfxzoom( | |
| 2786 | bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 2788 | 2787 | UINT32 code, |
| 2789 | 2788 | UINT32 color, |
| 2790 | 2789 | int flipx,int flipy, |
| 2791 | 2790 | int sx,int sy, |
| 2792 | const rectangle *clip, | |
| 2793 | 2791 | int scalex, int scaley, |
| 2794 | 2792 | UINT8 pri_dst) |
| 2795 | 2793 | { |
| r5077 | r5078 | |
| 2816 | 2814 | |
| 2817 | 2815 | if( gfx ) |
| 2818 | 2816 | { |
| 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)]; | |
| 2820 | 2818 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 2821 | 2819 | |
| 2822 | 2820 | { |
| r5077 | r5078 | |
| 3206 | 3204 | sprite_pri_usage|=1<<pri; |
| 3207 | 3205 | |
| 3208 | 3206 | 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, | |
| 3211 | 3209 | sprite_ptr->code, |
| 3212 | 3210 | sprite_ptr->color & (~sprite_extra_planes), |
| 3213 | 3211 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 3214 | 3212 | sprite_ptr->x,sprite_ptr->y, |
| 3215 | cliprect, | |
| 3216 | 3213 | pri); |
| 3217 | 3214 | else |
| 3218 | f3_drawgfxzoom(machine, | |
| 3219 | bitmap,sprite_gfx, | |
| 3215 | f3_drawgfxzoom( | |
| 3216 | bitmap,cliprect,sprite_gfx, | |
| 3220 | 3217 | sprite_ptr->code, |
| 3221 | 3218 | sprite_ptr->color & (~sprite_extra_planes), |
| 3222 | 3219 | sprite_ptr->flipx,sprite_ptr->flipy, |
| 3223 | 3220 | sprite_ptr->x,sprite_ptr->y, |
| 3224 | cliprect, | |
| 3225 | 3221 | sprite_ptr->zoomx,sprite_ptr->zoomy, |
| 3226 | 3222 | pri); |
| 3227 | 3223 | } |
| r5077 | r5078 | |
|---|---|---|
| 383 | 383 | |
| 384 | 384 | /* normal sprite, pen 0 transparent */ |
| 385 | 385 | if (color_effect == 0){ |
| 386 | drawgfx(bitmap, gfx, number, | |
| 386 | drawgfx_transpen(bitmap, cliprect, gfx, number, | |
| 387 | 387 | color, xflip, yflip, |
| 388 | 388 | ((sx + ex*16) & 0x3ff) + spr_x_adjust, |
| 389 | ((sy + ey*16) & 0x1ff), | |
| 390 | cliprect, TRANSPARENCY_PEN, 0); | |
| 389 | ((sy + ey*16) & 0x1ff), 0); | |
| 391 | 390 | |
| 392 | 391 | } else { /* last palette entry is reserved for shadows and highlights */ |
| 393 | 392 |
| r5077 | r5078 | |
|---|---|---|
| 77 | 77 | color = (spriteram[offs+2] & 0x7)+8 ; |
| 78 | 78 | flipx=(spriteram[offs+2] & 0x40) ; |
| 79 | 79 | flipy=(spriteram[offs+2] & 0x80) ; |
| 80 | drawgfx(bitmap,machine->gfx[1], | |
| 80 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 81 | 81 | code, |
| 82 | 82 | color, |
| 83 | 83 | flipx,flipy, |
| 84 | sx,sy, | |
| 85 | cliprect,TRANSPARENCY_PEN,0); | |
| 84 | sx,sy,0); | |
| 86 | 85 | } |
| 87 | 86 | } |
| 88 | 87 |
| r5077 | r5078 | |
|---|---|---|
| 210 | 210 | int sx = spriteram_2[offs + 1] - 16; |
| 211 | 211 | int sy = 255 - spriteram_2[offs]; |
| 212 | 212 | |
| 213 | drawgfx(bitmap, gfx, | |
| 213 | drawgfx_transmask(bitmap, cliprect, | |
| 214 | gfx, | |
| 214 | 215 | code, color, |
| 215 | 216 | flipx, flipy, |
| 216 | 217 | sx, sy, |
| 217 | cliprect, | |
| 218 | TRANSPARENCY_PENS, | |
| 219 | 218 | colortable_get_transpen_mask(machine->colortable, gfx, color, 0)); |
| 220 | 219 | |
| 221 | 220 | // wraparound |
| 222 | drawgfx(bitmap, gfx, | |
| 221 | drawgfx_transmask(bitmap, cliprect, | |
| 222 | gfx, | |
| 223 | 223 | code, color, |
| 224 | 224 | flipx, flipy, |
| 225 | 225 | sx + 256, sy, |
| 226 | cliprect, | |
| 227 | TRANSPARENCY_PENS, | |
| 228 | 226 | colortable_get_transpen_mask(machine->colortable, gfx, color, 0)); |
| 229 | 227 | } |
| 230 | 228 | } |
| r5077 | r5078 | |
| 250 | 248 | color = ( obj1[offs+1] ) & 0x0f; |
| 251 | 249 | bank = ( ( obj1[offs+1] >> 4 ) & 1 ); |
| 252 | 250 | |
| 253 | drawgfx(bitmap,machine->gfx[1], | |
| 251 | drawgfx_transpen(bitmap,cliprect, | |
| 252 | machine->gfx[1], | |
| 254 | 253 | code + (bank << 6), |
| 255 | 254 | color, |
| 256 | 255 | flipx, flipy, |
| 257 | sx,sy, | |
| 258 | cliprect, | |
| 259 | TRANSPARENCY_PEN,0); | |
| 256 | sx,sy,0); | |
| 260 | 257 | } |
| 261 | 258 | |
| 262 | 259 | obj1 = spriteram_2; |
| r5077 | r5078 | |
| 274 | 271 | flipy = ( ~obj1[offs] ) & 0x02; |
| 275 | 272 | color = ( obj1[offs+1] ) & 0x0f; |
| 276 | 273 | |
| 277 | drawgfx(bitmap,machine->gfx[2], | |
| 274 | drawgfx_transmask(bitmap,cliprect, | |
| 275 | machine->gfx[2], | |
| 278 | 276 | code, |
| 279 | 277 | color, |
| 280 | 278 | flipx, flipy, |
| 281 | 279 | sx,sy, |
| 282 | cliprect, | |
| 283 | TRANSPARENCY_PENS, | |
| 284 | 280 | colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0x10)); |
| 285 | 281 | } |
| 286 | 282 | } |
| r5077 | r5078 | |
|---|---|---|
| 273 | 273 | { |
| 274 | 274 | for (x = 0;x <= sizex;x++) |
| 275 | 275 | { |
| 276 | drawgfx( bitmap, machine->gfx[3], | |
| 276 | drawgfx_transpen( bitmap, cliprect,machine->gfx[3], | |
| 277 | 277 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 278 | 278 | color, |
| 279 | 279 | flipx,flipy, |
| 280 | 280 | -71 + ((sx + 16*x) & 0x1ff), |
| 281 | 1 + ((sy + 16*y) & 0xff), | |
| 282 | cliprect,TRANSPARENCY_PEN,0xf); | |
| 281 | 1 + ((sy + 16*y) & 0xff),0xf); | |
| 283 | 282 | } |
| 284 | 283 | } |
| 285 | 284 | } |
| r5077 | r5078 | |
|---|---|---|
| 162 | 162 | flipy = !flipy; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | drawgfx(bitmap, machine->gfx[2], | |
| 165 | drawgfx_transpen(bitmap, cliprect, | |
| 166 | machine->gfx[2], | |
| 166 | 167 | code, color, |
| 167 | 168 | flipx, flipy, |
| 168 | sx, sy, | |
| 169 | cliprect, | |
| 170 | TRANSPARENCY_PEN, 0); | |
| 169 | sx, sy, 0); | |
| 171 | 170 | } |
| 172 | 171 | } |
| 173 | 172 | } |
| r5077 | r5078 | |
|---|---|---|
| 190 | 190 | |
| 191 | 191 | for (i=0; i<y_multi; i++) |
| 192 | 192 | { |
| 193 | drawgfx(bitmap,machine->gfx[1], | |
| 193 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 194 | 194 | sprite + s_ptr, |
| 195 | 195 | colour, |
| 196 | 196 | fx,fy, |
| 197 | x,y-i*16, | |
| 198 | cliprect,TRANSPARENCY_PEN,0); | |
| 197 | x,y-i*16,0); | |
| 199 | 198 | if (fy) s_ptr++; else s_ptr--; |
| 200 | 199 | } |
| 201 | 200 | } |
| r5077 | r5078 | |
| 218 | 217 | if (!ffy) sprite+=y_multi-1; |
| 219 | 218 | for (i=0; i<y_multi; i++) |
| 220 | 219 | { |
| 221 | drawgfx(bitmap,machine->gfx[1], | |
| 220 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 222 | 221 | sprite+(ffy?i:-i), |
| 223 | 222 | colour, |
| 224 | 223 | 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); | |
| 227 | 225 | } |
| 228 | 226 | |
| 229 | 227 | if (rom[rom_offs+1]&0x80) break; /* end of block */ |
| r5077 | r5078 | |
|---|---|---|
| 128 | 128 | sprite_ptr->x = curx; |
| 129 | 129 | sprite_ptr->y = cury; |
| 130 | 130 | |
| 131 | drawgfx(bitmap,machine->gfx[0], | |
| 131 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 132 | 132 | sprite_ptr->code, |
| 133 | 133 | sprite_ptr->color, |
| 134 | 134 | 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); | |
| 137 | 136 | } |
| 138 | 137 | |
| 139 | 138 | #ifdef MAME_DEBUG |
| r5077 | r5078 | |
|---|---|---|
| 150 | 150 | sx = 15 - offs / 32; |
| 151 | 151 | sy = offs % 32; |
| 152 | 152 | |
| 153 | drawgfx(tmpbitmap,screen->machine->gfx[1], | |
| 153 | drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[1], | |
| 154 | 154 | videoram[offs] + ((colorram[offs] & 0x08) << 5), |
| 155 | 155 | (colorram[offs] & 0x30) >> 4, |
| 156 | 156 | 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); | |
| 159 | 158 | } |
| 160 | 159 | |
| 161 | 160 | /* Update the tiles in the right tile ram bank */ |
| r5077 | r5078 | |
| 167 | 166 | sx = 15 - offs / 32; |
| 168 | 167 | sy = offs % 32; |
| 169 | 168 | |
| 170 | drawgfx(tmpbitmap2,screen->machine->gfx[1], | |
| 169 | drawgfx_opaque(tmpbitmap2,0,screen->machine->gfx[1], | |
| 171 | 170 | matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x08) << 5), |
| 172 | 171 | (matmania_colorram3[offs] & 0x30) >> 4, |
| 173 | 172 | 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); | |
| 176 | 174 | } |
| 177 | 175 | |
| 178 | 176 | |
| r5077 | r5078 | |
| 194 | 192 | { |
| 195 | 193 | if (spriteram[offs] & 0x01) |
| 196 | 194 | { |
| 197 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 195 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 198 | 196 | spriteram[offs+1] + ((spriteram[offs] & 0xf0) << 4), |
| 199 | 197 | (spriteram[offs] & 0x08) >> 3, |
| 200 | 198 | 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); | |
| 203 | 200 | } |
| 204 | 201 | } |
| 205 | 202 | |
| r5077 | r5078 | |
| 213 | 210 | sx = 31 - offs / 32; |
| 214 | 211 | sy = offs % 32; |
| 215 | 212 | |
| 216 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 213 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 217 | 214 | matmania_videoram2[offs] + 256 * (matmania_colorram2[offs] & 0x07), |
| 218 | 215 | (matmania_colorram2[offs] & 0x30) >> 4, |
| 219 | 216 | 0,0, |
| 220 | 8*sx,8*sy, | |
| 221 | cliprect,TRANSPARENCY_PEN,0); | |
| 217 | 8*sx,8*sy,0); | |
| 222 | 218 | } |
| 223 | 219 | return 0; |
| 224 | 220 | } |
| r5077 | r5078 | |
| 237 | 233 | sx = 15 - offs / 32; |
| 238 | 234 | sy = offs % 32; |
| 239 | 235 | |
| 240 | drawgfx(tmpbitmap,screen->machine->gfx[1], | |
| 236 | drawgfx_opaque(tmpbitmap,0,screen->machine->gfx[1], | |
| 241 | 237 | videoram[offs] + ((colorram[offs] & 0x03) << 8), |
| 242 | 238 | (colorram[offs] & 0x30) >> 4, |
| 243 | 239 | 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); | |
| 246 | 241 | } |
| 247 | 242 | |
| 248 | 243 | /* Update the tiles in the right tile ram bank */ |
| r5077 | r5078 | |
| 254 | 249 | sx = 15 - offs / 32; |
| 255 | 250 | sy = offs % 32; |
| 256 | 251 | |
| 257 | drawgfx(tmpbitmap2,screen->machine->gfx[1], | |
| 252 | drawgfx_opaque(tmpbitmap2,0,screen->machine->gfx[1], | |
| 258 | 253 | matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x03) << 8), |
| 259 | 254 | (matmania_colorram3[offs] & 0x30) >> 4, |
| 260 | 255 | 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); | |
| 263 | 257 | } |
| 264 | 258 | |
| 265 | 259 | |
| r5077 | r5078 | |
| 282 | 276 | { |
| 283 | 277 | if (spriteram[offs] & 0x01) |
| 284 | 278 | { |
| 285 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 279 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2], | |
| 286 | 280 | spriteram[offs+1] + ((spriteram[offs] & 0xf0) << 4), |
| 287 | 281 | (spriteram[offs] & 0x08) >> 3, |
| 288 | 282 | 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); | |
| 291 | 284 | } |
| 292 | 285 | } |
| 293 | 286 | |
| r5077 | r5078 | |
| 301 | 294 | sx = 31 - offs / 32; |
| 302 | 295 | sy = offs % 32; |
| 303 | 296 | |
| 304 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 297 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 305 | 298 | matmania_videoram2[offs] + 256 * (matmania_colorram2[offs] & 0x07), |
| 306 | 299 | (matmania_colorram2[offs] & 0x30) >> 4, |
| 307 | 300 | 0,0, |
| 308 | 8*sx,8*sy, | |
| 309 | cliprect,TRANSPARENCY_PEN,0); | |
| 301 | 8*sx,8*sy,0); | |
| 310 | 302 | } |
| 311 | 303 | return 0; |
| 312 | 304 | } |
| r5077 | r5078 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) + 1024 * gfxbank; |
| 155 | 155 | |
| 156 | drawgfx(bitmap,machine->gfx[0], | |
| 156 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 157 | 157 | 2 * code, |
| 158 | 158 | ((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank, |
| 159 | 159 | 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], | |
| 163 | 162 | 2 * code + 1, |
| 164 | 163 | ((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank, |
| 165 | 164 | flip_screen_x_get(machine),flip_screen_y_get(machine), |
| 166 | sx,sy, | |
| 167 | cliprect,TRANSPARENCY_PEN,0); | |
| 165 | sx,sy,0); | |
| 168 | 166 | } |
| 169 | 167 | } |
| 170 | 168 |
| r5077 | r5078 | |
|---|---|---|
| 620 | 620 | code = spritedata[0x0E/2] + objectdata[0x06/2]; |
| 621 | 621 | color = (attr & color_mask); |
| 622 | 622 | |
| 623 | pdrawgfx(bitmap,machine->gfx[3], | |
| 623 | pdrawgfx_transpen(bitmap,cliprect, | |
| 624 | machine->gfx[3], | |
| 624 | 625 | (code & 0xfff ) + ((megasys1_sprite_bank & 1) << 12), |
| 625 | 626 | color, |
| 626 | 627 | flipx, flipy, |
| 627 | 628 | sx, sy, |
| 628 | cliprect, | |
| 629 | TRANSPARENCY_PEN,15, | |
| 630 | (attr & 0x08) ? 0x0c : 0x0a); | |
| 629 | priority_bitmap, | |
| 630 | (attr & 0x08) ? 0x0c : 0x0a,15); | |
| 631 | 631 | } /* sprite */ |
| 632 | 632 | } /* offs */ |
| 633 | 633 | } /* non Z hw */ |
| r5077 | r5078 | |
| 660 | 660 | sx = 240-sx; sy = 240-sy; |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | pdrawgfx(bitmap,machine->gfx[2], | |
| 663 | pdrawgfx_transpen(bitmap,cliprect, | |
| 664 | machine->gfx[2], | |
| 664 | 665 | code, |
| 665 | 666 | color, |
| 666 | 667 | flipx, flipy, |
| 667 | 668 | sx, sy, |
| 668 | cliprect, | |
| 669 | TRANSPARENCY_PEN,15, | |
| 670 | (attr & 0x08) ? 0x0c : 0x0a); | |
| 669 | priority_bitmap, | |
| 670 | (attr & 0x08) ? 0x0c : 0x0a,15); | |
| 671 | 671 | } /* sprite */ |
| 672 | 672 | } /* Z hw */ |
| 673 | 673 |
| r5077 | r5078 | |
|---|---|---|
| 150 | 150 | map_start++; |
| 151 | 151 | |
| 152 | 152 | if (flipscreen) |
| 153 | drawgfxzoom(bitmap,machine->gfx[2], | |
| 153 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2], | |
| 154 | 154 | code, |
| 155 | 155 | color, |
| 156 | 156 | !flipx,!flipy, |
| 157 | 157 | 304-sx,208-sy, |
| 158 | cliprect,TRANSPARENCY_PEN,15, | |
| 159 | 0x1000 * zoomx,0x1000 * zoomy); | |
| 158 | 0x1000 * zoomx,0x1000 * zoomy,15); | |
| 160 | 159 | else |
| 161 | drawgfxzoom(bitmap,machine->gfx[2], | |
| 160 | drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2], | |
| 162 | 161 | code, |
| 163 | 162 | color, |
| 164 | 163 | flipx,flipy, |
| 165 | 164 | sx,sy, |
| 166 | cliprect,TRANSPARENCY_PEN,15, | |
| 167 | 0x1000 * zoomx,0x1000 * zoomy); | |
| 165 | 0x1000 * zoomx,0x1000 * zoomy,15); | |
| 168 | 166 | } |
| 169 | 167 | } |
| 170 | 168 | } |
| r5077 | r5078 | |
|---|---|---|
| 240 | 240 | sy = spriteram_2[offs] - 31; |
| 241 | 241 | color = ( spriteram[offs + 1] & 0x1f ) | (colortablebank << 5) | (palettebank << 6 ); |
| 242 | 242 | |
| 243 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 243 | drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1], | |
| 244 | 244 | ( spriteram[offs] >> 2 ) | (spritebank << 6), |
| 245 | 245 | color, |
| 246 | 246 | spriteram[offs] & 1,spriteram[offs] & 2, |
| 247 | 247 | sx,sy, |
| 248 | &spriteclip,TRANSPARENCY_PENS, | |
| 249 | 248 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0)); |
| 250 | 249 | |
| 251 | 250 | /* 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], | |
| 253 | 252 | ( spriteram[offs] >> 2 ) | (spritebank << 6), |
| 254 | 253 | color, |
| 255 | 254 | spriteram[offs] & 1,spriteram[offs] & 2, |
| 256 | 255 | sx - 256,sy, |
| 257 | &spriteclip,TRANSPARENCY_PENS, | |
| 258 | 256 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0)); |
| 259 | 257 | } |
| 260 | 258 | /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */ |
| r5077 | r5078 | |
| 268 | 266 | sy = spriteram_2[offs] - 31; |
| 269 | 267 | color = ( spriteram[offs + 1] & 0x1f ) | (colortablebank << 5) | (palettebank << 6 ); |
| 270 | 268 | |
| 271 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 269 | drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1], | |
| 272 | 270 | ( spriteram[offs] >> 2 ) | (spritebank << 6), |
| 273 | 271 | color, |
| 274 | 272 | spriteram[offs] & 1,spriteram[offs] & 2, |
| 275 | 273 | sx,sy + xoffsethack, |
| 276 | &spriteclip,TRANSPARENCY_PENS, | |
| 277 | 274 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0)); |
| 278 | 275 | |
| 279 | 276 | /* 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], | |
| 281 | 278 | ( spriteram[offs] >> 2 ) | (spritebank << 6), |
| 282 | 279 | color, |
| 283 | 280 | spriteram[offs] & 2,spriteram[offs] & 1, |
| 284 | 281 | sx - 256,sy + xoffsethack, |
| 285 | &spriteclip,TRANSPARENCY_PENS, | |
| 286 | 282 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0)); |
| 287 | 283 | } |
| 288 | 284 | } |
| r5077 | r5078 | |
| 410 | 406 | color = spriteram[offs + 1] & 0x1f; |
| 411 | 407 | |
| 412 | 408 | /* TODO: ?? */ |
| 413 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 409 | drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1], | |
| 414 | 410 | (spriteram[offs] >> 2) | ((s2650games_spriteram[offs] & 3) << 6), |
| 415 | 411 | color, |
| 416 | 412 | spriteram[offs] & 1,spriteram[offs] & 2, |
| 417 | 413 | sx,sy, |
| 418 | cliprect,TRANSPARENCY_PENS, | |
| 419 | 414 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0)); |
| 420 | 415 | } |
| 421 | 416 | /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */ |
| r5077 | r5078 | |
| 431 | 426 | color = spriteram[offs + 1] & 0x1f; |
| 432 | 427 | |
| 433 | 428 | /* TODO: ?? */ |
| 434 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 429 | drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1], | |
| 435 | 430 | (spriteram[offs] >> 2) | ((s2650games_spriteram[offs] & 3)<<6), |
| 436 | 431 | color, |
| 437 | 432 | spriteram[offs] & 1,spriteram[offs] & 2, |
| 438 | 433 | sx,sy + xoffsethack, |
| 439 | cliprect,TRANSPARENCY_PENS, | |
| 440 | 434 | colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0)); |
| 441 | 435 | } |
| 442 | 436 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 312 | 312 | flipy = !flipy; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | drawgfx(bitmap,machine->gfx[0], | |
| 315 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 316 | 316 | code, |
| 317 | 317 | attr & 0x0f, |
| 318 | 318 | flipx,flipy, |
| 319 | x,y, | |
| 320 | cliprect,TRANSPARENCY_PEN,15 ); | |
| 319 | x,y,15 ); | |
| 321 | 320 | } |
| 322 | 321 | } |
| 323 | 322 |
| r5077 | r5078 | |
|---|---|---|
| 240 | 240 | |
| 241 | 241 | // single/double |
| 242 | 242 | if (!(attrib & 0x10)) |
| 243 | drawgfx(bmp, gfx, code, color, fx, fy, x, y | |
| 243 | drawgfx_transpen(bmp, clip, gfx, code, color, fx, fy, x, y | |
| 244 | 244 | else |
| 245 | drawgfxzoom(bmp, gfx, code, color, fx, fy, x, y, | |
| 245 | drawgfxzoom_transpen(bmp, clip, gfx, code, color, fx, fy, x, y, | |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 |
| r5077 | r5078 | |
|---|---|---|
| 172 | 172 | t = c2; c2 = c4; c4 = t; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | drawgfx(bitmap, | |
| 176 | machine->gfx[2], | |
| 175 | drawgfx_transpen(bitmap, | |
| 176 | cliprect, machine->gfx[2], | |
| 177 | 177 | sf_invert(c1), |
| 178 | 178 | color, |
| 179 | 179 | 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], | |
| 184 | 183 | sf_invert(c2), |
| 185 | 184 | color, |
| 186 | 185 | 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], | |
| 191 | 189 | sf_invert(c3), |
| 192 | 190 | color, |
| 193 | 191 | 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], | |
| 198 | 195 | sf_invert(c4), |
| 199 | 196 | color, |
| 200 | 197 | flipx,flipy, |
| 201 | sx+16,sy+16, | |
| 202 | cliprect, TRANSPARENCY_PEN, 15); | |
| 198 | sx+16,sy+16, 15); | |
| 203 | 199 | } |
| 204 | 200 | else |
| 205 | 201 | { |
| r5077 | r5078 | |
| 211 | 207 | flipy = !flipy; |
| 212 | 208 | } |
| 213 | 209 | |
| 214 | drawgfx(bitmap, | |
| 215 | machine->gfx[2], | |
| 210 | drawgfx_transpen(bitmap, | |
| 211 | cliprect, machine->gfx[2], | |
| 216 | 212 | sf_invert(c), |
| 217 | 213 | color, |
| 218 | 214 | flipx,flipy, |
| 219 | sx,sy, | |
| 220 | cliprect, TRANSPARENCY_PEN, 15); | |
| 215 | sx,sy, 15); | |
| 221 | 216 | } |
| 222 | 217 | } |
| 223 | 218 | } |
| r5077 | r5078 | |
|---|---|---|
| 34 | 34 | code = videoram[base + 2*y] + ((attr & 0x0f) << 8); |
| 35 | 35 | color = attr >> 4; |
| 36 | 36 | |
| 37 | drawgfx(bitmap,machine->gfx[0], | |
| 37 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 38 | 38 | code, |
| 39 | 39 | color, |
| 40 | 40 | flip_screen_get(machine),flip_screen_get(machine), |
| 41 | sx,sy, | |
| 42 | cliprect,TRANSPARENCY_PEN,15); | |
| 41 | sx,sy,15); | |
| 43 | 42 | if (sx > 248) /* wraparound */ |
| 44 | drawgfx(bitmap,machine->gfx[0], | |
| 43 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 45 | 44 | code, |
| 46 | 45 | color, |
| 47 | 46 | flip_screen_get(machine),flip_screen_get(machine), |
| 48 | sx-256,sy, | |
| 49 | cliprect,TRANSPARENCY_PEN,15); | |
| 47 | sx-256,sy,15); | |
| 50 | 48 | } |
| 51 | 49 | } |
| 52 | 50 | } |
| r5077 | r5078 | |
| 122 | 120 | |
| 123 | 121 | if((type==0 && color!=0x0d) || (type !=0 && color==0x0d)) |
| 124 | 122 | { |
| 125 | drawgfx(bitmap,machine->gfx[0], | |
| 123 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 126 | 124 | code, |
| 127 | 125 | color, |
| 128 | 126 | flip_screen_get(machine),flip_screen_get(machine), |
| 129 | sx,sy, | |
| 130 | cliprect,TRANSPARENCY_PEN,15); | |
| 127 | sx,sy,15); | |
| 131 | 128 | if (sx > 248) /* wraparound */ |
| 132 | drawgfx(bitmap,machine->gfx[0], | |
| 129 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 133 | 130 | code, |
| 134 | 131 | color, |
| 135 | 132 | flip_screen_get(machine),flip_screen_get(machine), |
| 136 | sx-256,sy, | |
| 137 | cliprect,TRANSPARENCY_PEN,15); | |
| 133 | sx-256,sy,15); | |
| 138 | 134 | } |
| 139 | 135 | } |
| 140 | 136 | } |
| r5077 | r5078 | |
| 184 | 180 | flipy = !flipy; |
| 185 | 181 | } |
| 186 | 182 | |
| 187 | drawgfx(bitmap,machine->gfx[1], | |
| 183 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 188 | 184 | code, |
| 189 | 185 | color, |
| 190 | 186 | flipx,flipy, |
| 191 | sx,sy, | |
| 192 | cliprect,TRANSPARENCY_PEN,15); | |
| 187 | sx,sy,15); | |
| 193 | 188 | /* wraparound */ |
| 194 | drawgfx(bitmap,machine->gfx[1], | |
| 189 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 195 | 190 | code, |
| 196 | 191 | color, |
| 197 | 192 | flipx,flipy, |
| 198 | sx-256,sy, | |
| 199 | cliprect,TRANSPARENCY_PEN,15); | |
| 193 | sx-256,sy,15); | |
| 200 | 194 | } |
| 201 | 195 | } |
| 202 | 196 |
| r5077 | r5078 | |
|---|---|---|
| 424 | 424 | |
| 425 | 425 | for (y = 0; y <= height; y++) |
| 426 | 426 | { |
| 427 | pdrawgfx(bitmap, machine->gfx[1], | |
| 427 | pdrawgfx_transpen(bitmap, cliprect, machine->gfx[1], | |
| 428 | 428 | code + y, |
| 429 | 429 | color, |
| 430 | 430 | flipx, flipy, |
| 431 | 431 | sx, sy + (16 * (flipy ? (height - y) : y)), |
| 432 | cliprect, TRANSPARENCY_PEN, 15, | |
| 433 | pri); | |
| 432 | priority_bitmap, | |
| 433 | pri, 15); | |
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 | } |
| r5077 | r5078 | |
| 490 | 490 | for (x = 0; x <= width; x++) |
| 491 | 491 | { |
| 492 | 492 | int _x = sx + (16 * (flipx ? (width - x) : x)); |
| 493 | pdrawgfx(bitmap, machine->gfx[0], | |
| 493 | pdrawgfx_transpen(bitmap, cliprect, machine->gfx[0], | |
| 494 | 494 | code, |
| 495 | 495 | color, |
| 496 | 496 | flipx, flipy, |
| 497 | 497 | _x, _y, |
| 498 | cliprect, TRANSPARENCY_PEN, 15, | |
| 499 | pri); | |
| 498 | priority_bitmap, | |
| 499 | pri, 15); | |
| 500 | 500 | code++; |
| 501 | 501 | } |
| 502 | 502 | } |
| r5077 | r5078 | |
|---|---|---|
| 210 | 210 | |
| 211 | 211 | if (spriteram[offs] & 0x10) /* double height */ |
| 212 | 212 | { |
| 213 | drawgfx(bitmap,machine->gfx[9], | |
| 213 | drawgfx_transpen(bitmap,cliprect,machine->gfx[9], | |
| 214 | 214 | code & ~1, |
| 215 | 215 | color, |
| 216 | 216 | 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], | |
| 220 | 219 | code | 1, |
| 221 | 220 | color, |
| 222 | 221 | flipscreen,flipscreen, |
| 223 | sx,sy, | |
| 224 | cliprect,TRANSPARENCY_PEN,0); | |
| 222 | sx,sy,0); | |
| 225 | 223 | |
| 226 | 224 | /* redraw with wraparound */ |
| 227 | drawgfx(bitmap,machine->gfx[9], | |
| 225 | drawgfx_transpen(bitmap,cliprect,machine->gfx[9], | |
| 228 | 226 | code & ~1, |
| 229 | 227 | color, |
| 230 | 228 | 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], | |
| 234 | 231 | code | 1, |
| 235 | 232 | color, |
| 236 | 233 | flipscreen,flipscreen, |
| 237 | sx,sy + 256, | |
| 238 | cliprect,TRANSPARENCY_PEN,0); | |
| 234 | sx,sy + 256,0); | |
| 239 | 235 | |
| 240 | 236 | } |
| 241 | 237 | else |
| 242 | 238 | { |
| 243 | drawgfx(bitmap,machine->gfx[9], | |
| 239 | drawgfx_transpen(bitmap,cliprect,machine->gfx[9], | |
| 244 | 240 | code, |
| 245 | 241 | color, |
| 246 | 242 | flipscreen,flipscreen, |
| 247 | sx,sy, | |
| 248 | cliprect,TRANSPARENCY_PEN,0); | |
| 243 | sx,sy,0); | |
| 249 | 244 | |
| 250 | 245 | /* redraw with wraparound */ |
| 251 | drawgfx(bitmap,machine->gfx[9], | |
| 246 | drawgfx_transpen(bitmap,cliprect,machine->gfx[9], | |
| 252 | 247 | code, |
| 253 | 248 | color, |
| 254 | 249 | flipscreen,flipscreen, |
| 255 | sx,sy + 256, | |
| 256 | cliprect,TRANSPARENCY_PEN,0); | |
| 250 | sx,sy + 256,0); | |
| 257 | 251 | |
| 258 | 252 | } |
| 259 | 253 | } |
| r5077 | r5078 | |
|---|---|---|
| 296 | 296 | else |
| 297 | 297 | sprite2=sprite+1; |
| 298 | 298 | |
| 299 | drawgfx(bitmap,machine->gfx[1], | |
| 299 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 300 | 300 | sprite, |
| 301 | colour,fx,fy,x,y, | |
| 302 | cliprect,TRANSPARENCY_PEN,0); | |
| 301 | colour,fx,fy,x,y,0); | |
| 303 | 302 | |
| 304 | 303 | /* 1 more sprite drawn underneath */ |
| 305 | 304 | if (extra) |
| 306 | drawgfx(bitmap,machine->gfx[1], | |
| 305 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 307 | 306 | sprite2, |
| 308 | colour,fx,fy,x,y+16, | |
| 309 | cliprect,TRANSPARENCY_PEN,0); | |
| 307 | colour,fx,fy,x,y+16,0); | |
| 310 | 308 | } |
| 311 | 309 | } |
| 312 | 310 | |
| r5077 | r5078 | |
| 364 | 362 | |
| 365 | 363 | while (multi >= 0) |
| 366 | 364 | { |
| 367 | drawgfx(bitmap,machine->gfx[1], | |
| 365 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 368 | 366 | sprite - multi * inc, |
| 369 | 367 | colour, |
| 370 | 368 | fx,fy, |
| 371 | x,y + mult * multi, | |
| 372 | cliprect,TRANSPARENCY_PEN,0); | |
| 369 | x,y + mult * multi,0); | |
| 373 | 370 | multi--; |
| 374 | 371 | } |
| 375 | 372 | } |
| r5077 | r5078 | |
| 408 | 405 | } |
| 409 | 406 | else sy2=sy+16; |
| 410 | 407 | |
| 411 | drawgfx(bitmap,machine->gfx[1], | |
| 408 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 412 | 409 | code, |
| 413 | 410 | color, |
| 414 | 411 | fx,flip_screen_get(machine), |
| 415 | sx,sy, | |
| 416 | cliprect,TRANSPARENCY_PEN,0); | |
| 412 | sx,sy,0); | |
| 417 | 413 | if (multi) |
| 418 | drawgfx(bitmap,machine->gfx[1], | |
| 414 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 419 | 415 | code+1, |
| 420 | 416 | color, |
| 421 | 417 | fx,flip_screen_get(machine), |
| 422 | sx,sy2, | |
| 423 | cliprect,TRANSPARENCY_PEN,0); | |
| 418 | sx,sy2,0); | |
| 424 | 419 | } |
| 425 | 420 | } |
| 426 | 421 | |
| r5077 | r5078 | |
| 440 | 435 | mx = (offs/2) % 32; |
| 441 | 436 | my = (offs/2) / 32; |
| 442 | 437 | |
| 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); | |
| 446 | 440 | } |
| 447 | 441 | } |
| 448 | 442 | #endif |
| r5077 | r5078 | |
|---|---|---|
| 234 | 234 | for (x = xstart; x != xend; x += xinc) |
| 235 | 235 | { |
| 236 | 236 | if (xzoom == (16*8) && yzoom == (16*8)) |
| 237 | pdrawgfx( bitmap,screen->machine->gfx[0], | |
| 237 | pdrawgfx_transpen( bitmap,cliprect,screen->machine->gfx[0], | |
| 238 | 238 | code++, |
| 239 | 239 | attr & 0x3f, |
| 240 | 240 | flipx, flipy, |
| 241 | 241 | sx + x * 16, sy + y * 16, |
| 242 | cliprect,TRANSPARENCY_PEN,15, | |
| 243 | pri_mask ); | |
| 242 | priority_bitmap, | |
| 243 | pri_mask,15 ); | |
| 244 | 244 | else |
| 245 | pdrawgfxzoom( bitmap,screen->machine->gfx[0], | |
| 245 | pdrawgfxzoom_transpen( bitmap,cliprect,screen->machine->gfx[0], | |
| 246 | 246 | code++, |
| 247 | 247 | attr & 0x3f, |
| 248 | 248 | flipx, flipy, |
| 249 | 249 | 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 ); | |
| 253 | 252 | } |
| 254 | 253 | } |
| 255 | 254 |
| r5077 | r5078 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | sx -= xscroll; |
| 161 | 161 | |
| 162 | drawgfx(bitmap,machine->gfx[3], | |
| 162 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 163 | 163 | code + layout[y][x], |
| 164 | 164 | color, |
| 165 | 165 | flipx,flipy, |
| 166 | sx,sy, | |
| 167 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 166 | sx,sy,0 ); | |
| 168 | 167 | |
| 169 | 168 | /* wraparound */ |
| 170 | drawgfx(bitmap,machine->gfx[3], | |
| 169 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 171 | 170 | code + layout[y][x], |
| 172 | 171 | color, |
| 173 | 172 | flipx,flipy, |
| 174 | sx,sy-0x200, | |
| 175 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 173 | sx,sy-0x200,0 ); | |
| 176 | 174 | |
| 177 | 175 | /* wraparound */ |
| 178 | drawgfx(bitmap,machine->gfx[3], | |
| 176 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 179 | 177 | code + layout[y][x], |
| 180 | 178 | color, |
| 181 | 179 | flipx,flipy, |
| 182 | sx-0x400,sy, | |
| 183 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 180 | sx-0x400,sy,0 ); | |
| 184 | 181 | |
| 185 | 182 | /* wraparound */ |
| 186 | drawgfx(bitmap,machine->gfx[3], | |
| 183 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 187 | 184 | code + layout[y][x], |
| 188 | 185 | color, |
| 189 | 186 | flipx,flipy, |
| 190 | sx-0x400,sy-0x200, | |
| 191 | cliprect,TRANSPARENCY_PEN,0 ); | |
| 187 | sx-0x400,sy-0x200,0 ); | |
| 192 | 188 | |
| 193 | 189 | |
| 194 | 190 |
| r5077 | r5078 | |
|---|---|---|
| 190 | 190 | flipy = !flipy; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | drawgfx(bitmap,machine->gfx[0], | |
| 193 | drawgfx_transpen(bitmap,cliprect, | |
| 194 | machine->gfx[0], | |
| 194 | 195 | code, |
| 195 | 196 | color, |
| 196 | 197 | flipx, flipy, |
| 197 | sx, sy, | |
| 198 | cliprect, | |
| 199 | TRANSPARENCY_PEN, 0); | |
| 198 | sx, sy, 0); | |
| 200 | 199 | |
| 201 | 200 | if (attr & 0x10) /* Double Y direction */ |
| 202 | 201 | { |
| 203 | 202 | dy = flipy ? 16 : -16; |
| 204 | 203 | |
| 205 | drawgfx(bitmap,machine->gfx[0], | |
| 204 | drawgfx_transpen(bitmap,cliprect, | |
| 205 | machine->gfx[0], | |
| 206 | 206 | code + 1, |
| 207 | 207 | color, |
| 208 | 208 | flipx, flipy, |
| 209 | sx, sy + dy, | |
| 210 | cliprect, | |
| 211 | TRANSPARENCY_PEN, 0); | |
| 209 | sx, sy + dy, 0); | |
| 212 | 210 | } |
| 213 | 211 | } |
| 214 | 212 | } |
| r5077 | r5078 | |
|---|---|---|
| 287 | 287 | /* sprites 0-3 are drawn one pixel down */ |
| 288 | 288 | if (offs < 16) y++; |
| 289 | 289 | |
| 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], | |
| 291 | 292 | thepit_spriteram[offs + 1] & 0x3f, |
| 292 | 293 | 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); | |
| 296 | 295 | } |
| 297 | 296 | } |
| 298 | 297 | } |
| r5077 | r5078 | |
|---|---|---|
| 230 | 230 | if (x >= BITMAP_WIDTH) x -= 512; |
| 231 | 231 | if (y >= BITMAP_HEIGHT) y -= 512; |
| 232 | 232 | |
| 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); | |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 |
| r5077 | r5078 | |
|---|---|---|
| 271 | 271 | int which = spriteaddr[offs + 0x20]; |
| 272 | 272 | int color = 0; |
| 273 | 273 | |
| 274 | drawgfx(spritebitmap, screen->machine->gfx[0], which, color, xflip, yflip, x, y | |
| 274 | drawgfx_transpen(spritebitmap, cliprect, screen->machine->gfx[0], which, color, xflip, yflip, x, y | |
| 275 | 275 | if (x >= 256 - 16) |
| 276 | drawgfx(spritebitmap, screen->machine->gfx[0], which, color, xflip, yflip, x - 256, y | |
| 276 | drawgfx_transpen(spritebitmap, cliprect, screen->machine->gfx[0], which, color, xflip, yflip, x - 256, y | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | /* draw the bitmap to the screen, looping over Y */ |
| r5077 | r5078 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | /* render sprite to auxiliary bitmap */ |
| 86 | 86 | |
| 87 | drawgfx(helper, machine->gfx[triplhnt_sprite_zoom], | |
| 87 | drawgfx_opaque(helper, cliprect, machine->gfx[triplhnt_sprite_zoom], | |
| 88 | 88 | 2 * code + triplhnt_sprite_bank, 0, code & 8, 0, |
| 89 | rect.min_x, rect.min_y | |
| 89 | rect.min_x, rect.min_y | |
| 90 | 90 | |
| 91 | 91 | if (rect.min_x < cliprect->min_x) |
| 92 | 92 | rect.min_x = cliprect->min_x; |
| r5077 | r5078 | |
|---|---|---|
| 172 | 172 | int flipx = ~spriteram_2[offs] & 0x40; |
| 173 | 173 | int flipy = spriteram_2[offs] & 0x80; |
| 174 | 174 | |
| 175 | drawgfx(bitmap,machine->gfx[1], | |
| 175 | drawgfx_transmask(bitmap,cliprect, | |
| 176 | machine->gfx[1], | |
| 176 | 177 | code, |
| 177 | 178 | color, |
| 178 | 179 | flipx, flipy, |
| 179 | 180 | sx, sy, |
| 180 | cliprect, | |
| 181 | TRANSPARENCY_PENS, | |
| 182 | 181 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0)); |
| 183 | 182 | } |
| 184 | 183 | } |
| r5077 | r5078 | |
|---|---|---|
| 123 | 123 | flipx = spriteram[offs+1] & 0x08; |
| 124 | 124 | flipy = spriteram[offs+1] & 0x04; |
| 125 | 125 | |
| 126 | drawgfx(bitmap,machine->gfx[1], | |
| 126 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 127 | 127 | code, |
| 128 | 128 | color, |
| 129 | 129 | flipx,flipy, |
| 130 | sx,sy, | |
| 131 | cliprect,TRANSPARENCY_PEN,0); | |
| 130 | sx,sy,0); | |
| 132 | 131 | /* wraparound */ |
| 133 | drawgfx(bitmap,machine->gfx[1], | |
| 132 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 134 | 133 | code, |
| 135 | 134 | color, |
| 136 | 135 | flipx,flipy, |
| 137 | sx-256,sy, | |
| 138 | cliprect,TRANSPARENCY_PEN,0); | |
| 136 | sx-256,sy,0); | |
| 139 | 137 | } |
| 140 | 138 | } |
| 141 | 139 |
| r5077 | r5078 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | int chop = (scaler[wolfpack_ship_size >> 2] * wolfpack_ship_h_precess) >> 16; |
| 166 | 166 | |
| 167 | drawgfxzoom(bitmap, machine->gfx[1], | |
| 167 | drawgfxzoom_transpen(bitmap, cliprect, | |
| 168 | machine->gfx[1], | |
| 168 | 169 | wolfpack_ship_pic, |
| 169 | 170 | 0, |
| 170 | 171 | wolfpack_ship_reflect, 0, |
| 171 | 172 | 2 * (wolfpack_ship_h - chop), |
| 172 | 173 | 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); | |
| 176 | 175 | } |
| 177 | 176 | |
| 178 | 177 | |
| r5077 | r5078 | |
| 183 | 182 | int x; |
| 184 | 183 | int y; |
| 185 | 184 | |
| 186 | drawgfx(bitmap, machine->gfx[3], | |
| 185 | drawgfx_transpen(bitmap, cliprect, | |
| 186 | machine->gfx[3], | |
| 187 | 187 | wolfpack_torpedo_pic, |
| 188 | 188 | 0, |
| 189 | 189 | 0, 0, |
| 190 | 190 | 2 * (244 - wolfpack_torpedo_h), |
| 191 | 224 - wolfpack_torpedo_v, | |
| 192 | cliprect, | |
| 193 | TRANSPARENCY_PEN, 0); | |
| 191 | 224 - wolfpack_torpedo_v, 0); | |
| 194 | 192 | |
| 195 | 193 | for (y = 16; y < 224 - wolfpack_torpedo_v; y++) |
| 196 | 194 | { |
| r5077 | r5078 | |
| 220 | 218 | if (!(wolfpack_pt_pic & 0x10)) |
| 221 | 219 | rect.max_x = 255; |
| 222 | 220 | |
| 223 | drawgfx(bitmap, machine->gfx[2], | |
| 221 | drawgfx_transpen(bitmap, &rect, | |
| 222 | machine->gfx[2], | |
| 224 | 223 | wolfpack_pt_pic, |
| 225 | 224 | 0, |
| 226 | 225 | 0, 0, |
| 227 | 226 | 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); | |
| 231 | 228 | |
| 232 | drawgfx(bitmap, machine->gfx[2], | |
| 229 | drawgfx_transpen(bitmap, &rect, | |
| 230 | machine->gfx[2], | |
| 233 | 231 | wolfpack_pt_pic, |
| 234 | 232 | 0, |
| 235 | 233 | 0, 0, |
| 236 | 234 | 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); | |
| 240 | 236 | } |
| 241 | 237 | |
| 242 | 238 | |
| r5077 | r5078 | |
| 283 | 279 | { |
| 284 | 280 | int code = wolfpack_alpha_num_ram[32 * i + j]; |
| 285 | 281 | |
| 286 | drawgfx(bitmap, screen->machine->gfx[0], | |
| 282 | drawgfx_opaque(bitmap, cliprect, | |
| 283 | screen->machine->gfx[0], | |
| 287 | 284 | code, |
| 288 | 285 | wolfpack_video_invert, |
| 289 | 286 | 0, 0, |
| 290 | 287 | 16 * j, |
| 291 | 192 + 8 * i, | |
| 292 | cliprect, | |
| 293 | TRANSPARENCY_NONE, 0); | |
| 288 | 192 + 8 * i); | |
| 294 | 289 | } |
| 295 | 290 | |
| 296 | 291 | draw_pt(screen->machine, bitmap, cliprect); |
| r5077 | r5078 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | ypos = 0xf2 - ypos; |
| 96 | 96 | |
| 97 | drawgfx(bitmap,gfx, | |
| 97 | drawgfx_transpen(bitmap,cliprect,gfx, | |
| 98 | 98 | code, |
| 99 | 99 | color, |
| 100 | 100 | flipx,flipy, |
| 101 | xpos,ypos, | |
| 102 | cliprect,TRANSPARENCY_PEN,0); | |
| 101 | xpos,ypos,0); | |
| 103 | 102 | |
| 104 | 103 | source+=4; |
| 105 | 104 | } |
| r5077 | r5078 | |
|---|---|---|
| 90 | 90 | int x = tankbatt_bulletsram[offs + 1]; |
| 91 | 91 | int y = 255 - tankbatt_bulletsram[offs] - 2; |
| 92 | 92 | |
| 93 | drawgfx(bitmap,machine->gfx[1], | |
| 93 | drawgfx_opaque(bitmap,cliprect,machine->gfx[1], | |
| 94 | 94 | 0, /* this is just a square, generated by the hardware */ |
| 95 | 95 | color, |
| 96 | 96 | 0,0, |
| 97 | x,y, | |
| 98 | cliprect,TRANSPARENCY_NONE,0); | |
| 97 | x,y); | |
| 99 | 98 | } |
| 100 | 99 | } |
| 101 | 100 |
| r5077 | r5078 | |
|---|---|---|
| 394 | 394 | else |
| 395 | 395 | code &= ~0x10, code2 |= 0x10; |
| 396 | 396 | |
| 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, | |
| 399 | 398 | colortable_get_transpen_mask(screen->machine->colortable, gfx, color, 0x10)); |
| 400 | 399 | } |
| 401 | 400 | |
| 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, | |
| 404 | 402 | colortable_get_transpen_mask(screen->machine->colortable, gfx, color, 0x10)); |
| 405 | 403 | |
| 406 | 404 | if (doubled) i += 4; |
| r5077 | r5078 | |
| 414 | 412 | int y = exerion_cocktail_flip ? (31*8 - 8*sy) : 8*sy; |
| 415 | 413 | |
| 416 | 414 | offs = sx + sy * 64; |
| 417 | drawgfx(bitmap, screen->machine->gfx[0], | |
| 415 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], | |
| 418 | 416 | videoram[offs] + 256 * char_bank, |
| 419 | 417 | ((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); | |
| 422 | 419 | } |
| 423 | 420 | |
| 424 | 421 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (!color_effect) { |
| 134 | drawgfx(bitmap,gfx,number, | |
| 134 | drawgfx_transpen(bitmap,cliprect,gfx,number, | |
| 135 | 135 | 0x20 + color,xflip,yflip, |
| 136 | sx - 0x0f,sy, | |
| 137 | cliprect,TRANSPARENCY_PEN,0); | |
| 136 | sx - 0x0f,sy,0); | |
| 138 | 137 | } else { |
| 139 | 138 | /* get a pointer to the current sprite's gfx data */ |
| 140 | 139 | const UINT8 *gfx_src = gfx_element_get_data(gfx, number % gfx->total_elements); |
| r5077 | r5078 | |
|---|---|---|
| 176 | 176 | |
| 177 | 177 | while (multi >= 0) |
| 178 | 178 | { |
| 179 | drawgfx(bitmap,machine->gfx[0], | |
| 179 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 180 | 180 | sprite - multi * inc, |
| 181 | 181 | colour, |
| 182 | 182 | fx,fy, |
| 183 | x-xsproff,y-ysproff + mult * multi, | |
| 184 | cliprect,TRANSPARENCY_PEN,0); | |
| 183 | x-xsproff,y-ysproff + mult * multi,0); | |
| 185 | 184 | |
| 186 | 185 | multi--; |
| 187 | 186 | } |
| r5077 | r5078 | |
|---|---|---|
| 78 | 78 | if (screen == left_screen) |
| 79 | 79 | { |
| 80 | 80 | 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], | |
| 82 | 82 | charcode, 1, |
| 83 | 0,0,sx,sy, | |
| 84 | cliprect,TRANSPARENCY_NONE,0); | |
| 83 | 0,0,sx,sy); | |
| 85 | 84 | else |
| 86 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 85 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 87 | 86 | 0, 1, |
| 88 | 0,0,sx,sy, | |
| 89 | cliprect,TRANSPARENCY_NONE,0); | |
| 87 | 0,0,sx,sy); | |
| 90 | 88 | } |
| 91 | 89 | |
| 92 | 90 | /* draw the right screen */ |
| 93 | 91 | if (screen == right_screen) |
| 94 | 92 | { |
| 95 | 93 | 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], | |
| 97 | 95 | charcode, 0, |
| 98 | 0,0,sx,sy, | |
| 99 | cliprect,TRANSPARENCY_NONE,0); | |
| 96 | 0,0,sx,sy); | |
| 100 | 97 | else |
| 101 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 98 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], | |
| 102 | 99 | 0, 0, |
| 103 | 0,0,sx,sy, | |
| 104 | cliprect,TRANSPARENCY_NONE,0); | |
| 100 | 0,0,sx,sy); | |
| 105 | 101 | } |
| 106 | 102 | } |
| 107 | 103 | |
| r5077 | r5078 | |
| 128 | 124 | if (screen == left_screen) |
| 129 | 125 | { |
| 130 | 126 | if ((offs!=0) || (sub_enable)) |
| 131 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 127 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 132 | 128 | charcode + 32 * prom_set, |
| 133 | 129 | 0, |
| 134 | 0,0,sx,sy, | |
| 135 | cliprect,TRANSPARENCY_PEN,0); | |
| 130 | 0,0,sx,sy,0); | |
| 136 | 131 | } |
| 137 | 132 | |
| 138 | 133 | |
| r5077 | r5078 | |
| 140 | 135 | if (screen == right_screen) |
| 141 | 136 | { |
| 142 | 137 | if ((offs!=1) || (sub_enable)) |
| 143 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 138 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 144 | 139 | charcode + 32 * prom_set, |
| 145 | 140 | 0, |
| 146 | 0,0,sx,sy, | |
| 147 | cliprect,TRANSPARENCY_PEN,0); | |
| 141 | 0,0,sx,sy,0); | |
| 148 | 142 | } |
| 149 | 143 | } |
| 150 | 144 |
| r5077 | r5078 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | palette+=32; |
| 182 | 182 | |
| 183 | drawgfx( | |
| 184 | bitmap,screen->machine->gfx[2], | |
| 183 | drawgfx_transpen( | |
| 184 | bitmap,cliprect, | |
| 185 | screen->machine->gfx[2], | |
| 185 | 186 | tile, |
| 186 | 187 | palette, |
| 187 | 188 | fx,fy, |
| 188 | spriteram[i+3],spriteram[i+2], | |
| 189 | cliprect, | |
| 190 | TRANSPARENCY_PEN,0 ); | |
| 189 | spriteram[i+3],spriteram[i+2],0 ); | |
| 191 | 190 | } |
| 192 | 191 | |
| 193 | 192 | } |
| r5077 | r5078 | |
|---|---|---|
| 67 | 67 | if (source[1] & 0x20) { if (xpos < 0xe0) xpos += 0x100; } |
| 68 | 68 | // bits 0x40 and 0x10 not used?... |
| 69 | 69 | |
| 70 | drawgfx(bitmap,machine->gfx[1],tile,0,0,0,xpos,ypos | |
| 70 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],tile,0,0,0,xpos,ypos | |
| 71 | 71 | |
| 72 | 72 | source -= 0x20; |
| 73 | 73 | } |
| r5077 | r5078 | |
| 92 | 92 | int data; |
| 93 | 93 | |
| 94 | 94 | 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 | |
| 95 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],data&0x7fff,(data&0x8000)?2:1,0,0,x*8,y*8 | |
| 96 | 96 | offs+=2; |
| 97 | 97 | } |
| 98 | 98 | } |
| r5077 | r5078 | |
|---|---|---|
| 405 | 405 | xx = w; |
| 406 | 406 | do |
| 407 | 407 | { |
| 408 | drawgfx(bitmap,machine->gfx[2], | |
| 408 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 409 | 409 | code, |
| 410 | 410 | color, |
| 411 | 411 | 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); | |
| 414 | 413 | code++; |
| 415 | 414 | x += delta; |
| 416 | 415 | } while (--xx >= 0); |
| r5077 | r5078 | |
| 465 | 464 | xx = w; |
| 466 | 465 | do |
| 467 | 466 | { |
| 468 | drawgfx(bitmap,machine->gfx[2], | |
| 467 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 469 | 468 | code, |
| 470 | 469 | color, |
| 471 | 470 | flipx, flipy, |
| 472 | ((x + 16) & 0x1ff) - 16,sy & 0x1ff, | |
| 473 | cliprect,TRANSPARENCY_PEN,15); | |
| 471 | ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15); | |
| 474 | 472 | |
| 475 | 473 | code++; |
| 476 | 474 | x +=delta * ( flipx?-1:1 ); |
| r5077 | r5078 | |
| 627 | 625 | int numtile = data&0xfff; |
| 628 | 626 | int color = (data&0xf000)>>12; |
| 629 | 627 | |
| 630 | drawgfx(background_bitmap,screen->machine->gfx[3], | |
| 628 | drawgfx_opaque(background_bitmap,0,screen->machine->gfx[3], | |
| 631 | 629 | numtile, |
| 632 | 630 | color, |
| 633 | 631 | 0,0, /* no flip */ |
| 634 | 16*sx,16*sy, | |
| 635 | 0,TRANSPARENCY_NONE,0); | |
| 632 | 16*sx,16*sy); | |
| 636 | 633 | |
| 637 | 634 | data = tilerom[offs+0x1000+bank]; |
| 638 | 635 | numtile = data&0xfff; |
| 639 | 636 | color = (data&0xf000)>>12; |
| 640 | drawgfx(background_bitmap,screen->machine->gfx[3], | |
| 637 | drawgfx_opaque(background_bitmap,0,screen->machine->gfx[3], | |
| 641 | 638 | numtile, |
| 642 | 639 | color, |
| 643 | 640 | 0,0, /* no flip */ |
| 644 | 16*sx,(16*sy)+256, | |
| 645 | 0,TRANSPARENCY_NONE,0); | |
| 641 | 16*sx,(16*sy)+256); | |
| 646 | 642 | |
| 647 | 643 | sy++; |
| 648 | 644 | if (sy==16) {sy=0; sx++;} |
| r5077 | r5078 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | for (i=0;i<4;i++) |
| 148 | 148 | if (state->flip) |
| 149 | drawgfx(bitmap, back_gfx, i, color[i], 1, 1, 31*8 - xpos[i], 6 | |
| 149 | drawgfx_opaque(bitmap, cliprect, back_gfx, i, color[i], 1, 1, 31*8 - xpos[i], 6 | |
| 150 | 150 | else |
| 151 | drawgfx(bitmap, back_gfx, i, color[i], 0, 0, xpos[i] | |
| 151 | drawgfx_opaque(bitmap, cliprect, back_gfx, i, color[i], 0, 0, xpos[i] | |
| 152 | 152 | |
| 153 | 153 | if (state->bottomline) |
| 154 | 154 | { |
| r5077 | r5078 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | for (i = 0; i < 2; i++) |
| 53 | 53 | { |
| 54 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 54 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 55 | 55 | mgolf_video_ram[0x399 + 4 * i], |
| 56 | 56 | i, |
| 57 | 57 | 0, 0, |
| 58 | 58 | 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); | |
| 61 | 60 | |
| 62 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 61 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 63 | 62 | mgolf_video_ram[0x39b + 4 * i], |
| 64 | 63 | i, |
| 65 | 64 | 0, 0, |
| 66 | 65 | 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); | |
| 69 | 67 | } |
| 70 | 68 | return 0; |
| 71 | 69 | } |
| r5077 | r5078 | |
|---|---|---|
| 181 | 181 | int tileno = murogem_videoram[count]&0x3f; |
| 182 | 182 | int attr = murogem_videoram[count+0x400]&0x0f; |
| 183 | 183 | |
| 184 | drawgfx(bitmap,screen->machine->gfx[0],tileno,attr,0,0,xx*8,yy*8 | |
| 184 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno,attr,0,0,xx*8,yy*8 | |
| 185 | 185 | |
| 186 | 186 | count++; |
| 187 | 187 |
| r5077 | r5078 | |
|---|---|---|
| 146 | 146 | { |
| 147 | 147 | if(fy) |
| 148 | 148 | { |
| 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); | |
| 151 | 151 | } |
| 152 | 152 | else |
| 153 | 153 | { |
| 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); | |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | else |
| 159 | drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy | |
| 159 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,color,fx,fy,sx,sy | |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| r5077 | r5078 | |
| 201 | 201 | { |
| 202 | 202 | if(fy) |
| 203 | 203 | { |
| 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); | |
| 206 | 206 | } |
| 207 | 207 | else |
| 208 | 208 | { |
| 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); | |
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | else |
| 214 | drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy | |
| 214 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],code,color,fx,fy,sx,sy | |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 |
| r5077 | r5078 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | while (multi >= 0) |
| 121 | 121 | { |
| 122 | pdrawgfx(bitmap,machine->gfx[2], | |
| 122 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 123 | 123 | sprite - multi * inc, |
| 124 | 124 | colour, |
| 125 | 125 | fx,fy, |
| 126 | 126 | x,y + mult * multi, |
| 127 | | |
| 127 | | |
| 128 | 128 | |
| 129 | 129 | if (xsize) |
| 130 | pdrawgfx(bitmap,machine->gfx[2], | |
| 130 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 131 | 131 | (sprite - multi * inc)-mult2, |
| 132 | 132 | colour, |
| 133 | 133 | fx,fy, |
| 134 | 134 | x-16,y + mult * multi, |
| 135 | | |
| 135 | | |
| 136 | 136 | |
| 137 | 137 | |
| 138 | 138 | multi--; |
| r5077 | r5078 | |
|---|---|---|
| 171 | 171 | return 0; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | static WRITE8_HANDLER( custom_cpu_w ) | |
| 175 | { | |
| 176 | custom_cpu_ram[0x7f0 + offset] = data; | |
| 177 | } | |
| 174 | 178 | |
| 179 | ||
| 175 | 180 | static void update_flip_state(void) |
| 176 | 181 | { |
| 177 | 182 | /* the custom CPU also controls the video flip control line; unfortunately, */ |
| r5077 | r5078 | |
| 217 | 222 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x01ff) AM_READ_PORT("IN0") |
| 218 | 223 | AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x01ff) AM_READ_PORT("DSW1") |
| 219 | 224 | AM_RANGE(0xd000, 0xd7ef) AM_RAM AM_BASE(&custom_cpu_ram) |
| 220 | AM_RANGE(0xd7f0, 0xd7ff) AM_READ(custom_cpu_r | |
| 225 | AM_RANGE(0xd7f0, 0xd7ff) AM_READWRITE(custom_cpu_r, custom_cpu_w) | |
| 221 | 226 | AM_RANGE(0xe000, 0xe007) AM_MIRROR(0x0ff8) AM_WRITE(arabian_blitter_w) AM_BASE(&arabian_blitter) |
| 222 | 227 | ADDRESS_MAP_END |
| 223 | 228 |
| r5077 | r5078 | |
|---|---|---|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | drawgfx(bitmap,machine->gfx[0], | |
| 97 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 98 | 98 | code, |
| 99 | 99 | color, |
| 100 | 100 | flipscreen,0, |
| 101 | sx,sy, | |
| 102 | cliprect,TRANSPARENCY_PEN,15); | |
| 101 | sx,sy,15); | |
| 103 | 102 | } |
| 104 | 103 | } |
| 105 | 104 | |
| r5077 | r5078 | |
| 156 | 155 | |
| 157 | 156 | } |
| 158 | 157 | |
| 159 | drawgfx(bitmap,screen->machine->gfx[1], tileno ,discoboy_ram_att[count/2],0,0,x*8,y*8 | |
| 158 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1], tileno ,discoboy_ram_att[count/2],0,0,x*8,y*8 | |
| 160 | 159 | count+=2; |
| 161 | 160 | } |
| 162 | 161 | } |
| r5077 | r5078 | |
|---|---|---|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | static void draw_char( | |
| 183 | static void draw_char( | |
| 184 | 184 | { |
| 185 | 185 | int i,j; |
| 186 | 186 | const UINT8 *dp; |
| 187 | 187 | int index = 0; |
| 188 | const pen_t *pens = gfx->machine->pens; | |
| 189 | ||
| 188 | 190 | dp = gfx_element_get_data(gfx, ch); |
| 189 | 191 | |
| 190 | 192 | for (j=y; j < y+8; j++) |
| r5077 | r5078 | |
| 194 | 196 | { |
| 195 | 197 | UINT8 pen = dp[index++]; |
| 196 | 198 | if (pen) |
| 197 | p[i] = | |
| 199 | p[i] = | |
| 198 | 200 | else |
| 199 | 201 | { |
| 200 | 202 | if (((att >> 4) & 7) > 0) |
| 201 | p[i] = | |
| 203 | p[i] = | |
| 202 | 204 | } |
| 203 | 205 | } |
| 204 | 206 | } |
| r5077 | r5078 | |
| 311 | 313 | int att1 = (cga[index] >> 24) & 0xff; |
| 312 | 314 | int ch1 = (cga[index] >> 16) & 0xff; |
| 313 | 315 | |
| 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); | |
| 316 | 318 | index++; |
| 317 | 319 | } |
| 318 | 320 | } |
| r5077 | r5078 | |
|---|---|---|
| 354 | 354 | |
| 355 | 355 | for(i=0;i<=dy;i++) |
| 356 | 356 | { |
| 357 | pdrawgfx( bitmap, | |
| 357 | pdrawgfx_transpen( bitmap, | |
| 358 | cliprect, | |
| 358 | 359 | gfx, |
| 359 | 360 | source[2]+i, |
| 360 | 361 | color, |
| 361 | 362 | flipx,0, |
| 362 | 363 | x,y+i*16, |
| 363 | cliprect, | |
| 364 | TRANSPARENCY_PEN,0,pri_mask ); | |
| 364 | priority_bitmap,pri_mask,0 ); | |
| 365 | 365 | |
| 366 | 366 | /* wrap around x */ |
| 367 | pdrawgfx( bitmap, | |
| 367 | pdrawgfx_transpen( bitmap, | |
| 368 | cliprect, | |
| 368 | 369 | gfx, |
| 369 | 370 | source[2]+i, |
| 370 | 371 | color, |
| 371 | 372 | flipx,0, |
| 372 | 373 | x-1024,y+i*16, |
| 373 | cliprect, | |
| 374 | TRANSPARENCY_PEN,0,pri_mask ); | |
| 374 | priority_bitmap,pri_mask,0 ); | |
| 375 | 375 | |
| 376 | 376 | /* wrap around y */ |
| 377 | pdrawgfx( bitmap, | |
| 378 | gfx, | |
| 377 | pdrawgfx_transpen( bitmap, | |
| 378 | cliprect, | |
| 379 | gfx, | |
| 379 | 380 | source[2]+i, |
| 380 | 381 | color, |
| 381 | 382 | flipx,0, |
| 382 | 383 | x,y-512+i*16, |
| 383 | cliprect, | |
| 384 | TRANSPARENCY_PEN,0,pri_mask ); | |
| 384 | priority_bitmap,pri_mask,0 ); | |
| 385 | 385 | |
| 386 | 386 | /* wrap around x & y */ |
| 387 | pdrawgfx( bitmap, | |
| 387 | pdrawgfx_transpen( bitmap, | |
| 388 | cliprect, | |
| 388 | 389 | gfx, |
| 389 | 390 | source[2]+i, |
| 390 | 391 | color, |
| 391 | 392 | flipx,0, |
| 392 | 393 | x-1024,y-512+i*16, |
| 393 | cliprect, | |
| 394 | TRANSPARENCY_PEN,0,pri_mask ); | |
| 394 | priority_bitmap,pri_mask,0 ); | |
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 |
| r5077 | r5078 | |
|---|---|---|
| 94 | 94 | static VIDEO_UPDATE(vroulet) |
| 95 | 95 | { |
| 96 | 96 | 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); | |
| 99 | 99 | return 0; |
| 100 | 100 | } |
| 101 | 101 |
| r5077 | r5078 | |
|---|---|---|
| 1432 | 1432 | ROM_LOAD( "rom-gr4.u5b", 0x08000, 0x2000, CRC(3fbfa686) SHA1(6c137d177c7aa2701497ac3ac922fdb8cd9f52b3) ) |
| 1433 | 1433 | ROM_LOAD( "rom-gr5.u4b", 0x0a000, 0x2000, CRC(345f94fb) SHA1(0af24f4e1a797efe5272f64b8a34483fe6002436) ) |
| 1434 | 1434 | |
| 1435 | /* From a picture in an eBay auction the board appears to have a PAL that needs to be dumped. */ | |
| 1436 | ||
| 1435 | 1437 | MOTHERBOARD_PALS |
| 1436 | 1438 | ROM_END |
| 1437 | 1439 | |
| r5077 | r5078 | |
| 1849 | 1851 | ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, CRC(970c81f6) SHA1(f22189e172a795d115597feb48ccbc04be3859b9) ) |
| 1850 | 1852 | ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, CRC(90ddd737) SHA1(8e1dde2f42e9bf755dedeef218745d1fc54faac7) ) |
| 1851 | 1853 | |
| 1854 | ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */ | |
| 1855 | ROM_LOAD( "pal16r8.u7c", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8ANC */ | |
| 1856 | ||
| 1852 | 1857 | MOTHERBOARD_PALS |
| 1853 | 1858 | ROM_END |
| 1854 | 1859 | |
| r5077 | r5078 | |
| 2130 | 2135 | /* Board: 006-8003-01-0D Rev D */ |
| 2131 | 2136 | GAME( 1984, hattrick, 0, balsente, hattrick, hattrick, ROT0, "Bally/Sente", "Hat Trick", GAME_SUPPORTS_SAVE ) |
| 2132 | 2137 | |
| 2133 | /* Board: Unknown */ | |
| 2138 | /* Board: Unknown (From a picture on eBay Snacks'n Jaxson does not match any documented types here.) */ | |
| 2134 | 2139 | GAME( 1984, otwalls, 0, balsente, otwalls, otwalls, ROT0, "Bally/Sente", "Off the Wall (Sente)", GAME_SUPPORTS_SAVE ) |
| 2135 | 2140 | GAME( 1984, snakepit, 0, balsente, sentetst, snakepit, ROT0, "Bally/Sente", "Snake Pit", GAME_SUPPORTS_SAVE ) |
| 2136 | 2141 | GAME( 1984, snakjack, 0, balsente, snakjack, snakjack, ROT0, "Bally/Sente", "Snacks'n Jaxson", GAME_SUPPORTS_SAVE ) |
| r5077 | r5078 | |
| 2156 | 2161 | GAME( 1986, nstocker, 0, balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 1)", GAME_SUPPORTS_SAVE ) |
| 2157 | 2162 | GAME( 1986, nstockr2, nstocker, balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 2)", GAME_SUPPORTS_SAVE ) |
| 2158 | 2163 | GAME( 1986, sfootbal, 0, balsente, sfootbal, sfootbal, ROT0, "Bally/Sente", "Street Football", GAME_SUPPORTS_SAVE ) |
| 2164 | GAME( 1986, spiker, 0, balsente, spiker, spiker, ROT0, "Bally/Sente", "Spiker", GAME_SUPPORTS_SAVE ) | |
| 2159 | 2165 | |
| 2160 | 2166 | /* Board: Unknown */ |
| 2161 | GAME( 1986, spiker, 0, balsente, spiker, spiker, ROT0, "Bally/Sente", "Spiker", GAME_SUPPORTS_SAVE ) | |
| 2162 | 2167 | GAME( 1986, stompin, 0, balsente, stompin, stompin, ROT0, "Bally/Sente", "Stompin'", GAME_SUPPORTS_SAVE ) |
| 2163 | 2168 | GAME( 1987, rescraid, 0, balsente, rescraid, rescraid, ROT0, "Bally/Midway", "Rescue Raider", GAME_SUPPORTS_SAVE ) |
| 2164 | 2169 | GAME( 1987, rescrdsa, rescraid, balsente, rescraid, rescraid, ROT0, "Bally/Midway", "Rescue Raider (stand-alone)", GAME_SUPPORTS_SAVE ) |
| r5077 | r5078 | |
|---|---|---|
| 1164 | 1164 | |
| 1165 | 1165 | ROM_START( mk4 ) |
| 1166 | 1166 | 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 */ | |
| 1168 | 1168 | ROM_LOAD16_BYTE( "mk4_l2.u3", 0x400000, 0x200000, CRC(8fbcf0ac) SHA1(c53704e72cfcba800c7af3a03267041f1e29a784) ) |
| 1169 | 1169 | ROM_LOAD16_BYTE( "mk4_l2.u4", 0x800000, 0x200000, CRC(dee91696) SHA1(00a182a36a414744cd014fcfc53c2e1a66ab5189) ) |
| 1170 | 1170 | ROM_LOAD16_BYTE( "mk4_l2.u5", 0xc00000, 0x200000, CRC(44d072be) SHA1(8a636c2801d799dfb84e69607ade76d2b49cf09f) ) |
| 1171 | 1171 | |
| 1172 | 1172 | 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 */ | |
| 1174 | 1174 | 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) ) | |
| 1181 | 1181 | ROM_END |
| 1182 | 1182 | |
| 1183 | 1183 | ROM_START( mk4a ) |
| 1184 | 1184 | 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) ) | |
| 1189 | 1189 | |
| 1190 | 1190 | 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 */ | |
| 1192 | 1192 | 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) ) | |
| 1199 | 1199 | ROM_END |
| 1200 | 1200 | |
| 1201 | 1201 | ROM_START( invasnab ) /* Version 5.0 Program roms, v4.0 Graphics roms, v2.0 Sound roms */ |
| r5077 | r5078 | |
|---|---|---|
| 114 | 114 | if(bestleag_vregs[0x00/2] & 0x1000) |
| 115 | 115 | color &= 7; |
| 116 | 116 | |
| 117 | drawgfx(bitmap,machine->gfx[2], | |
| 117 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 118 | 118 | code, |
| 119 | 119 | color, |
| 120 | 120 | flipx, 0, |
| 121 | flipx ? (sx+16) : (sx),sy, | |
| 122 | cliprect,TRANSPARENCY_PEN,15); | |
| 121 | flipx ? (sx+16) : (sx),sy,15); | |
| 123 | 122 | |
| 124 | drawgfx(bitmap,machine->gfx[2], | |
| 123 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 125 | 124 | code+1, |
| 126 | 125 | color, |
| 127 | 126 | flipx, 0, |
| 128 | flipx ? (sx) : (sx+16),sy, | |
| 129 | cliprect,TRANSPARENCY_PEN,15); | |
| 127 | flipx ? (sx) : (sx+16),sy,15); | |
| 130 | 128 | |
| 131 | 129 | /* wraparound x */ |
| 132 | drawgfx(bitmap,machine->gfx[2], | |
| 130 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 133 | 131 | code, |
| 134 | 132 | color, |
| 135 | 133 | flipx, 0, |
| 136 | flipx ? (sx+16 - 512) : (sx - 512),sy, | |
| 137 | cliprect,TRANSPARENCY_PEN,15); | |
| 134 | flipx ? (sx+16 - 512) : (sx - 512),sy,15); | |
| 138 | 135 | |
| 139 | drawgfx(bitmap,machine->gfx[2], | |
| 136 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 140 | 137 | code+1, |
| 141 | 138 | color, |
| 142 | 139 | flipx, 0, |
| 143 | flipx ? (sx - 512) : (sx+16 - 512),sy, | |
| 144 | cliprect,TRANSPARENCY_PEN,15); | |
| 140 | flipx ? (sx - 512) : (sx+16 - 512),sy,15); | |
| 145 | 141 | } |
| 146 | 142 | } |
| 147 | 143 |
| r5077 | r5078 | |
|---|---|---|
| 204 | 204 | int tile = np_vram[count] & 0x3f; |
| 205 | 205 | int colour = (np_vram[count] & 0xc0) >> 6; |
| 206 | 206 | |
| 207 | drawgfx(bitmap,screen->machine->gfx[1], tile, colour, 0, 0, x * 32, y * 32 | |
| 207 | drawgfx_opaque(bitmap,cliprect, screen->machine->gfx[1], tile, colour, 0, 0, x * 32, y * 32 | |
| 208 | 208 | |
| 209 | 209 | count+=2; |
| 210 | 210 | } |
| r5077 | r5078 | |
| 216 | 216 | int tile = np_vram[count] & 0x3f; |
| 217 | 217 | int colour = (np_vram[count] & 0xc0) >> 6; |
| 218 | 218 | |
| 219 | drawgfx(bitmap,screen->machine->gfx[0], tile, colour, 0, 0, x * 16, y * 32 | |
| 219 | drawgfx_opaque(bitmap,cliprect, screen->machine->gfx[0], tile, colour, 0, 0, x * 16, y * 32 | |
| 220 | 220 | |
| 221 | 221 | count++; |
| 222 | 222 | } |
| r5077 | r5078 | |
|---|---|---|
| 80 | 80 | #include "sound/2151intf.h" |
| 81 | 81 | #include "sound/okim6295.h" |
| 82 | 82 | |
| 83 | UINT16* kaneko16_calc3_fakeram; | |
| 84 | static UINT16* kaneko16_mainram; | |
| 85 | ||
| 83 | 86 | /*************************************************************************** |
| 84 | 87 | |
| 85 | 88 | |
| r5077 | r5078 | |
| 789 | 792 | |
| 790 | 793 | static ADDRESS_MAP_START( shogwarr, ADDRESS_SPACE_PROGRAM, 16 ) |
| 791 | 794 | 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 | |
| 793 | 796 | AM_RANGE(0x200000, 0x20ffff) AM_READWRITE(SMH_RAM,calc3_mcu_ram_w) AM_BASE(&kaneko16_mcu_ram) // Shared With MCU |
| 794 | 797 | AM_RANGE(0x280000, 0x280001) AM_WRITE(calc3_mcu_com0_w) |
| 795 | 798 | AM_RANGE(0x290000, 0x290001) AM_WRITE(calc3_mcu_com1_w) |
| r5077 | r5078 | |
| 813 | 816 | AM_RANGE(0xb80006, 0xb80007) AM_READ_PORT("UNK") |
| 814 | 817 | AM_RANGE(0xd00000, 0xd00001) AM_NOP // ? (bit 0) |
| 815 | 818 | 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 | |
| 816 | 821 | ADDRESS_MAP_END |
| 817 | 822 | |
| 818 | 823 | |
| r5077 | r5078 | |
| 1974 | 1979 | { |
| 1975 | 1980 | case 2: cpu_set_input_line(device, 2, HOLD_LINE); break; |
| 1976 | 1981 | 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 | } | |
| 1978 | 1994 | } |
| 1979 | 1995 | } |
| 1980 | 1996 | |
| r5077 | r5078 | |
| 3638 | 3654 | |
| 3639 | 3655 | UINT16 calc3_mcu_crc; |
| 3640 | 3656 | |
| 3641 | DRIVER_INIT( calc3 ) | |
| 3657 | /* decryption tables */ | |
| 3658 | ||
| 3659 | /* table 0x00 = not encrypted? */ | |
| 3660 | static 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 */ | |
| 3668 | static 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 */ | |
| 3676 | static 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 | |
| 3684 | unsigned 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 | ||
| 3693 | unsigned 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 | ||
| 3701 | unsigned 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 | ||
| 3709 | unsigned 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..) | |
| 3719 | static UINT8 calc3_decryption_key_byte; | |
| 3720 | static UINT8 calc3_unknown; | |
| 3721 | static UINT8 calc3_mode; | |
| 3722 | static UINT8 calc3_blocksize_offset; | |
| 3723 | static UINT16 calc3_dataend; | |
| 3724 | static UINT16 calc3_database; | |
| 3725 | ||
| 3726 | // endian safe? you're having a laugh | |
| 3727 | int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, int dstoffset) | |
| 3642 | 3728 | { |
| 3643 | 3729 | UINT8* rom = memory_region(machine,"cpu1"); |
| 3644 | ||
| 3730 | UINT8 numregions; | |
| 3731 | UINT16 length; | |
| 3645 | 3732 | int x; |
| 3646 | 3733 | int offset = 0; |
| 3647 | | |
| 3734 | | |
| 3648 | 3735 | |
| 3649 | calc3_mcu_crc = 0; | |
| 3650 | for (x=0;x<0x20000;x++) | |
| 3736 | if (tabnum > numregions) | |
| 3651 | 3737 | { |
| 3652 | calc3_mcu_crc+=rom[x]; | |
| 3738 | printf("CALC3 error, requested table > num tables!\n"); | |
| 3739 | return 0; | |
| 3653 | 3740 | } |
| 3654 | printf("crc %04x\n",calc3_mcu_crc); | |
| 3655 | 3741 | |
| 3656 | numregions = rom[offset+0]; | |
| 3657 | 3742 | rom++; |
| 3658 | 3743 | |
| 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 | } | |
| 3659 | 3752 | |
| 3660 | ||
| 3661 | ||
| 3662 | ||
| 3663 | for (x=0;x<numregions;x++) | |
| 3753 | // we're at the start of the block, get the info about it | |
| 3664 | 3754 | { |
| 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]; | |
| 3674 | 3762 | |
| 3675 | 3763 | |
| 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) | |
| 3680 | 3767 | { |
| 3681 | 3768 | 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; | |
| 3687 | 3770 | } |
| 3688 | 3771 | |
| 3689 | ||
| 3690 | offset+= blocksize_offset+1; | |
| 3772 | offset+= calc3_blocksize_offset+1; | |
| 3691 | 3773 | length = rom[offset+0] | (rom[offset+1]<<8); |
| 3774 | offset+=2; | |
| 3692 | 3775 | |
| 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 | } | |
| 3694 | 3784 | |
| 3695 | printf("\n"); | |
| 3696 | 3785 | |
| 3697 | offset+=2; | |
| 3786 | // copy + decrypt the table to the specified memory area | |
| 3787 | if (dstram) | |
| 3788 | { | |
| 3789 | int i; | |
| 3698 | 3790 | |
| 3699 | //if (x==0x2d) | |
| 3700 | { | |
| 3701 | if (length != 0) | |
| 3791 | if (length==0x00) | |
| 3702 | 3792 | { |
| 3793 | // shogwarr does this with 'mode' as 0x08, which probably has some special meaning | |
| 3794 | //printf("CALC3: requested 0 length table!\n"); | |
| 3795 | } | |
| 3703 | 3796 | |
| 3704 | if (blocksize_offset==3) | |
| 3797 | if (inline_table_size) | |
| 3798 | { | |
| 3799 | for (i=0;i<length;i++) | |
| 3705 | 3800 | { |
| 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; | |
| 3706 | 3809 | |
| 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; | |
| 3709 | 3812 | |
| 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; | |
| 3717 | 3816 | |
| 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 | } | |
| 3718 | 3825 | |
| 3826 | calc3_dataend = offset+length+1; | |
| 3827 | } | |
| 3719 | 3828 | |
| 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); | |
| 3727 | 3830 | |
| 3831 | return length; | |
| 3728 | 3832 | |
| 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 | } | |
| 3737 | 3834 | |
| 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 | }; | |
| 3835 | static UINT8 calc3_decryption_key_byte; | |
| 3836 | static UINT8 calc3_unknown; | |
| 3837 | static UINT8 calc3_mode; | |
| 3838 | static UINT8 calc3_blocksize_offset; | |
| 3745 | 3839 | |
| 3840 | DRIVER_INIT( calc3 ) | |
| 3841 | { | |
| 3842 | UINT8* rom = memory_region(machine,"cpu1"); | |
| 3843 | UINT8 numregions; | |
| 3746 | 3844 | |
| 3845 | int x; | |
| 3747 | 3846 | |
| 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]; | |
| 3755 | 3854 | |
| 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); | |
| 3763 | 3861 | |
| 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]; | |
| 3778 | 3867 | |
| 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", | |
| 3817 | 3877 | 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 | } | |
| 3822 | 3880 | |
| 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); | |
| 3832 | 3886 | } |
| 3833 | 3887 | } |
| 3834 | 3888 | |
| 3835 | | |
| 3889 | | |
| 3836 | 3890 | } |
| 3837 | 3891 | |
| 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 | ||
| 3838 | 3896 | // dump out the 0x1000 sized block at the end |
| 3839 | 3897 | { |
| 3840 | 3898 | FILE *fp; |
| r5077 | r5078 | |
| 3846 | 3904 | fp=fopen(filename, "w+b"); |
| 3847 | 3905 | if (fp) |
| 3848 | 3906 | { |
| 3849 | fwrite(&rom[ | |
| 3907 | fwrite(&rom[calc3_dataend], 0x1000, 1, fp); | |
| 3850 | 3908 | fclose(fp); |
| 3851 | 3909 | } |
| 3852 | 3910 | } |
| r5077 | r5078 | |
|---|---|---|
| 144 | 144 | if(!flipy) |
| 145 | 145 | { |
| 146 | 146 | |
| 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); | |
| 149 | 149 | } |
| 150 | 150 | else |
| 151 | 151 | { |
| 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); | |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | else |
| 157 | 157 | { |
| 158 | drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy | |
| 158 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy | |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | } |
| r5077 | r5078 | |
|---|---|---|
| 36 | 36 | tile ^=chsuper_tilexor; |
| 37 | 37 | //int colour = tile>>12; |
| 38 | 38 | |
| 39 | drawgfx(bitmap,gfx,tile,0,0,0,x*4,y*8 | |
| 39 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*4,y*8 | |
| 40 | 40 | count+=2; |
| 41 | 41 | } |
| 42 | 42 | } |
| r5077 | r5078 | |
|---|---|---|
| 147 | 147 | colour = cps1_gfxram[base+pos+1]&0x1f; |
| 148 | 148 | ypos = 256-ypos; |
| 149 | 149 | |
| 150 | pdrawgfx(bitmap,machine->gfx[2],tileno,colour,flipx,flipy,xpos+49,ypos-16, | |
| 150 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],tileno,colour,flipx,flipy,xpos+49,ypos-16, | |
| 151 | 151 | |
| 152 | 152 | } |
| 153 | 153 |
| r5077 | r5078 | |
|---|---|---|
| 433 | 433 | if (x & 0x8000) x-=0x10000; |
| 434 | 434 | if (y & 0x8000) y-=0x10000; |
| 435 | 435 | |
| 436 | drawgfx(bitmap,screen->machine->gfx[1],code,col,0,0,x-2,y | |
| 436 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],code,col,0,0,x-2,y | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | gfx_element_build_temporary(&gfx, machine, sprites_gfx + addr, dimx, dimy, dimx, 0x100, 32, 0); |
| 182 | 182 | |
| 183 | drawgfx( bitmap,&gfx, | |
| 183 | drawgfx_transpen( bitmap,cliprect, &gfx, | |
| 184 | 184 | 0, color, |
| 185 | 185 | flipx, flipy, |
| 186 | sx, sy, | |
| 187 | cliprect, TRANSPARENCY_PEN, 0x1f ); | |
| 186 | sx, sy, 0x1f ); | |
| 188 | 187 | } |
| 189 | 188 | |
| 190 | 189 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) |
| r5077 | r5078 | |
|---|---|---|
| 105 | 105 | flipy = !flipy; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 108 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 109 | 109 | code, |
| 110 | 110 | 0, |
| 111 | 111 | flipx,flipy, |
| 112 | x,y, | |
| 113 | cliprect,TRANSPARENCY_PEN,0xff); | |
| 112 | x,y,0xff); | |
| 114 | 113 | } |
| 115 | 114 | } |
| 116 | 115 |
| r5077 | r5078 | |
|---|---|---|
| 28 | 28 | { |
| 29 | 29 | UINT16 dat = mpoker_video[count]; |
| 30 | 30 | UINT16 col = mpoker_video[count+0x400]; |
| 31 | drawgfx(bitmap,gfx,dat,col,0,0,x*16,y*16 | |
| 31 | drawgfx_opaque(bitmap,cliprect,gfx,dat,col,0,0,x*16,y*16 | |
| 32 | 32 | count++; |
| 33 | 33 | } |
| 34 | 34 |
| r5077 | r5078 | |
|---|---|---|
| 118 | 118 | sy = 242-spriteram[offs]; |
| 119 | 119 | flipy = (spriteram[offs+1]&0x80)>>7; |
| 120 | 120 | flipx = (spriteram[offs+1]&0x40)>>6; |
| 121 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 121 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 122 | 122 | spriteram[offs+1]&0x3f, |
| 123 | 123 | pal, |
| 124 | 124 | flipx,flipy, |
| 125 | sx,sy, | |
| 126 | cliprect,TRANSPARENCY_PEN,0); | |
| 125 | sx,sy,0); | |
| 127 | 126 | } |
| 128 | 127 | return 0; |
| 129 | 128 | } |
| r5077 | r5078 | |
|---|---|---|
| 363 | 363 | int chr = racetrack_tilemap_rom[off]; |
| 364 | 364 | int col = racetrack_tilemap_rom[off+0x2000]&0x1f; |
| 365 | 365 | int flipx = racetrack_tilemap_rom[off+0x2000]&0x40; |
| 366 | drawgfx(bitmap,track,chr,col,flipx,0,y*16+scrolly,x*16 | |
| 366 | drawgfx_opaque(bitmap,cliprect,track,chr,col,flipx,0,y*16+scrolly,x*16 | |
| 367 | 367 | // draw another bit of track |
| 368 | 368 | // a rubbish way of doing it |
| 369 | 369 | chr = racetrack_tilemap_rom[off-0x100]; |
| 370 | 370 | col = racetrack_tilemap_rom[off+0x1f00]&0x1f; |
| 371 | 371 | flipx = racetrack_tilemap_rom[off+0x1f00]&0x40; |
| 372 | drawgfx(bitmap,track,chr,col,flipx,0,y*16-256+scrolly,x*16 | |
| 372 | drawgfx_opaque(bitmap,cliprect,track,chr,col,flipx,0,y*16-256+scrolly,x*16 | |
| 373 | 373 | off++; |
| 374 | 374 | } |
| 375 | 375 | } |
| r5077 | r5078 | |
| 399 | 399 | for (a=0;a<8 ;a++) |
| 400 | 400 | { |
| 401 | 401 | for(b=0;b<7;b++) { |
| 402 | drawgfx(bitmap,sprites,anim+a*8+b,col,0,0,sprx+a*8,spry+b*8 | |
| 402 | drawgfx_transpen(bitmap,cliprect,sprites,anim+a*8+b,col,0,0,sprx+a*8,spry+b*8 | |
| 403 | 403 | } |
| 404 | 404 | } |
| 405 | 405 | // draw the horse number |
| 406 | 406 | a=3; |
| 407 | 407 | b=3; |
| 408 | drawgfx(bitmap,sprites,anim+horse,col,0,0,sprx+a*8,spry+b*8 | |
| 408 | drawgfx_transpen(bitmap,cliprect,sprites,anim+horse,col,0,0,sprx+a*8,spry+b*8 | |
| 409 | 409 | |
| 410 | 410 | |
| 411 | 411 | } |
| r5077 | r5078 | |
|---|---|---|
| 869 | 869 | static ADDRESS_MAP_START( balcube_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 870 | 870 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 871 | 871 | 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 | |
| 873 | 874 | AM_RANGE(0x400000, 0x41ffff) AM_READ(balcube_dsw_r) // DSW x 3 |
| 874 | 875 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("IN0") // Inputs |
| 875 | 876 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("IN1") // |
| r5077 | r5078 | |
| 903 | 904 | static ADDRESS_MAP_START( daitoa_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 904 | 905 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 905 | 906 | 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 | |
| 907 | 909 | AM_RANGE(0x300000, 0x31ffff) AM_READ(balcube_dsw_r) // DSW x 3 |
| 908 | 910 | AM_RANGE(0x100000, 0x11ffff) AM_RAM_WRITE(metro_vram_0_w) AM_BASE(&metro_vram_0 ) // Layer 0 |
| 909 | 911 | AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(&metro_vram_1 ) // Layer 1 |
| r5077 | r5078 | |
| 937 | 939 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 938 | 940 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM // RAM |
| 939 | 941 | 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 | |
| 941 | 944 | AM_RANGE(0xc00000, 0xc1ffff) AM_READ(balcube_dsw_r) // DSW x 3 |
| 942 | 945 | AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("IN0") // Inputs |
| 943 | 946 | AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("IN1") // |
| r5077 | r5078 | |
|---|---|---|
| 37 | 37 | WRITE8_HANDLER( prosoccr_io_w ); |
| 38 | 38 | WRITE8_HANDLER( prosport_io_w ); |
| 39 | 39 | WRITE8_HANDLER( prosport_paletteram_w ); |
| 40 | WRITE8_HANDLER( prosport_bg_vram_w ); | |
| 40 | 41 | WRITE8_HANDLER( liberate_videoram_w ); |
| 41 | 42 | WRITE8_HANDLER( liberate_colorram_w ); |
| 42 | 43 | |
| r5077 | r5078 | |
| 241 | 242 | |
| 242 | 243 | static ADDRESS_MAP_START( prosport_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 243 | 244 | 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) | |
| 245 | 245 | 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) | |
| 249 | 247 | 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 | |
| 251 | 248 | 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 | |
| 254 | 250 | AM_RANGE(0x3000, 0x33ff) AM_RAM_WRITE(liberate_colorram_w) AM_BASE(&colorram) |
| 255 | 251 | AM_RANGE(0x3400, 0x37ff) AM_RAM_WRITE(liberate_videoram_w) AM_BASE(&videoram) |
| 256 | 252 | AM_RANGE(0x3800, 0x3fff) AM_RAM AM_BASE(&spriteram) |
| r5077 | r5078 | |
| 823 | 819 | |
| 824 | 820 | /* basic machine hardware */ |
| 825 | 821 | MDRV_CPU_MODIFY("maincpu") |
| 826 | MDRV_CPU_CLOCK(1 | |
| 822 | MDRV_CPU_CLOCK(1 | |
| 827 | 823 | MDRV_CPU_PROGRAM_MAP(prosoccr_map) |
| 828 | 824 | MDRV_CPU_IO_MAP(prosoccr_io_map) |
| 829 | 825 | |
| 830 | 826 | MDRV_CPU_MODIFY("audiocpu") |
| 827 | MDRV_CPU_CLOCK(10000000/8) //xtal is 12 Mhz, divider is unknown | |
| 831 | 828 | MDRV_CPU_PROGRAM_MAP(prosoccr_sound_map) |
| 832 | 829 | |
| 830 | MDRV_QUANTUM_TIME(HZ(12000)) | |
| 831 | ||
| 833 | 832 | MDRV_SCREEN_MODIFY("screen") |
| 834 | 833 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 32*8-1) |
| 835 | 834 | |
| r5077 | r5078 | |
| 864 | 863 | MDRV_GFXDECODE(prosport) |
| 865 | 864 | MDRV_PALETTE_LENGTH(256) |
| 866 | 865 | |
| 867 | MDRV_VIDEO_START( | |
| 866 | MDRV_VIDEO_START(prospo | |
| 868 | 867 | MDRV_VIDEO_UPDATE(prosport) |
| 869 | 868 | |
| 870 | 869 | /* sound hardware */ |
| r5077 | r5078 | |
| 1346 | 1345 | *************************************/ |
| 1347 | 1346 | |
| 1348 | 1347 | GAME( 1983, prosoccr, 0, prosoccr, prosoccr, prosport, ROT270, "Data East Corporation", "Pro Soccer", 0 ) |
| 1349 | GAME( 1983, prosport, 0, prosport, liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 1350 | GAME( 1983, prosporta, prosport, prosport, liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports (alternate)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 1348 | GAME( 1983, prosport, 0, prosport, liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 1349 | GAME( 1983, prosporta, prosport, prosport, liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports (alternate)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 1351 | 1350 | GAME( 1983, boomrang, 0, boomrang, boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 1)", 0 ) |
| 1352 | 1351 | GAME( 1983, boomranga, boomrang, boomrang, boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 2)", 0 ) |
| 1353 | 1352 | GAME( 1984, kamikcab, 0, boomrang, kamikcab, prosport, ROT270, "Data East Corporation", "Kamikaze Cabbie", 0 ) |
| r5077 | r5078 | |
|---|---|---|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | if(sprite_info.enable) |
| 557 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 557 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 558 | 558 | sprite_info.code, |
| 559 | 559 | sprite_info.color, |
| 560 | 560 | 0,0, |
| 561 | sprite_info.x - 6,sprite_info.y, | |
| 562 | cliprect,TRANSPARENCY_PEN,0); | |
| 561 | sprite_info.x - 6,sprite_info.y,0); | |
| 563 | 562 | |
| 564 | 563 | return 0; |
| 565 | 564 | } |
| r5077 | r5078 | |
|---|---|---|
| 4923 | 4923 | {1,6,4,3,5,2,7,0} |
| 4924 | 4924 | }; |
| 4925 | 4925 | |
| 4926 | struct 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 | }; | |
| 4926 | 4934 | |
| 4935 | struct 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 | }; | |
| 4927 | 4943 | static UINT16 atomiswave_decrypt(UINT16 cipherText, int address, const struct AtomiswaveKey* key) |
| 4928 | 4944 | { |
| 4929 | 4945 | int b0,b1,b2,b3; |
| r5077 | r5078 | |
| 5019 | 5035 | |
| 5020 | 5036 | for(i=0; i<rom_size/2; i++) |
| 5021 | 5037 | { |
| 5022 | src[i] = atomiswave_decrypt(src[i], i*2, & | |
| 5038 | src[i] = atomiswave_decrypt(src[i], i*2, &ssu_key); | |
| 5023 | 5039 | } |
| 5024 | 5040 | } |
| 5025 | 5041 | |
| r5077 | r5078 | |
| 5032 | 5048 | |
| 5033 | 5049 | for(i=0; i<rom_size/2; i++) |
| 5034 | 5050 | { |
| 5035 | src[i] = atomiswave_decrypt(src[i], i*2, & | |
| 5051 | src[i] = atomiswave_decrypt(src[i], i*2, &rm_key); | |
| 5036 | 5052 | } |
| 5037 | 5053 | } |
| 5038 | 5054 |
| r5077 | r5078 | |
|---|---|---|
| 27 | 27 | require, check ROMs on your Asteroids PCB. If ROM code is "-01" order kit no. 08-0303009. |
| 28 | 28 | If ROM code is "-02", order no. 08-0303008. |
| 29 | 29 | |
| 30 | *** It looks like both current sets are the older "easier" version. We need dumps of the updates | |
| 31 | for both sets. | |
| 30 | For kit 08-0303009 (from rev 01) swap the following: | |
| 32 | 31 | |
| 32 | 035127-01 --> 035127-02 | |
| 33 | 035143-01 --> 035143-02 | |
| 34 | 035144-01 --> 034144-04E | |
| 35 | 035145-01 --> 034145-04E | |
| 36 | ||
| 37 | For kit 08-0303008 (from rev 02) swap the following: | |
| 38 | ||
| 39 | 035144-02 --> 034144-04E | |
| 40 | 035145-02 --> 034145-04E | |
| 41 | ||
| 42 | There is not a rev 3 known, mentioned or dumped | |
| 43 | ||
| 33 | 44 | Asteroids-deluxe state-prom added by HIGHWAYMAN. |
| 34 | 45 | The prom pcb location is:C8 and is 256x4 |
| 35 | 46 | (i need to update the dump, this one is read in 8bit-mode) |
| r5077 | r5078 | |
| 678 | 689 | |
| 679 | 690 | ROM_START( asteroid ) |
| 680 | 691 | 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) ) | |
| 701 | ROM_END | |
| 702 | ||
| 703 | ROM_START( asteroi2 ) | |
| 704 | ROM_REGION( 0x8000, "maincpu", 0 ) | |
| 681 | 705 | ROM_LOAD( "035145.02", 0x6800, 0x0800, CRC(0cc75459) SHA1(2af85c9689b878155004da47fedbde5853a18723) ) |
| 682 | 706 | ROM_LOAD( "035144.02", 0x7000, 0x0800, CRC(096ed35c) SHA1(064d680ded7f30c543f93ae5ca85f90d550f73e5) ) |
| 683 | 707 | ROM_LOAD( "035143.02", 0x7800, 0x0800, CRC(312caa02) SHA1(1ce2eac1ab90b972e3f1fc3d250908f26328d6cb) ) |
| 684 | 708 | /* Vector ROM */ |
| 685 | 709 | ROM_LOAD( "035127.02", 0x5000, 0x0800, CRC(8b71fd9e) SHA1(8cd5005e531eafa361d6b7e9eed159d164776c70) ) |
| 710 | ||
| 686 | 711 | /* DVG PROM */ |
| 687 | 712 | ROM_REGION( 0x100, "user1", 0 ) |
| 688 | 713 | ROM_LOAD( "034602-01.c8", 0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) |
| r5077 | r5078 | |
| 695 | 720 | ROM_LOAD( "035143.01", 0x7800, 0x0800, CRC(7d4e3d05) SHA1(d88000e904e158efde50e453e2889ecd2cb95f24) ) |
| 696 | 721 | /* Vector ROM */ |
| 697 | 722 | ROM_LOAD( "035127.01", 0x5000, 0x0800, CRC(99699366) SHA1(9b2828fc1cef7727f65fa65e1e11e309b7c98792) ) |
| 723 | ||
| 698 | 724 | /* DVG PROM */ |
| 699 | 725 | ROM_REGION( 0x100, "user1", 0 ) |
| 700 | 726 | ROM_LOAD( "034602-01.c8", 0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) |
| r5077 | r5078 | |
| 723 | 749 | /* Vector ROM */ |
| 724 | 750 | ROM_LOAD( "sidamas.0", 0x5000, 0x0400, CRC(6bd2053f) SHA1(790f2858f44bbb1854e2d9d549e29f4815c4665b) ) |
| 725 | 751 | ROM_LOAD( "sidamas.1", 0x5400, 0x0400, CRC(231ce201) SHA1(710f4c19864d725ba1c9ea447a97e84001a679f7) ) |
| 752 | ||
| 726 | 753 | /* DVG PROM */ |
| 727 | 754 | ROM_REGION( 0x100, "user1", 0 ) |
| 728 | 755 | ROM_LOAD( "034602-01.c8", 0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) |
| r5077 | r5078 | |
| 735 | 762 | ROM_LOAD( "m2_j1.bin", 0x7800, 0x0800, CRC(64bd0408) SHA1(141d053cb4cce3fece98293136928b527d3ade0f) ) |
| 736 | 763 | /* Vector ROM */ |
| 737 | 764 | ROM_LOAD( "mv_np3.bin", 0x5000, 0x0800, CRC(11d1c4ae) SHA1(433c2c05b92094bbe102c356d7f1a907db13da67) ) |
| 765 | ||
| 738 | 766 | /* DVG PROM */ |
| 739 | 767 | ROM_REGION( 0x100, "user1", 0 ) |
| 740 | 768 | ROM_LOAD( "034602-01.c8", 0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) |
| r5077 | r5078 | |
| 751 | 779 | /* Vector ROM */ |
| 752 | 780 | ROM_LOAD( "a.bin", 0x5000, 0x0400, CRC(d7822110) SHA1(bf6c5e622fdc16c39a1d8f23fc029abaa1e99b19) ) |
| 753 | 781 | ROM_LOAD( "b.bin", 0x5400, 0x0400, CRC(d62b2887) SHA1(8832953c7166d2f0ed1067c43ebf369db4a4aa70) ) |
| 782 | ||
| 754 | 783 | /* DVG PROM */ |
| 755 | 784 | ROM_REGION( 0x100, "user1", 0 ) |
| 756 | 785 | ROM_LOAD( "prom.bin", 0x0000, 0x0100, CRC(9e237193) SHA1(f663e12d5db0fa50ea49d03591475ae0a7168bc0) ) |
| r5077 | r5078 | |
| 766 | 795 | /* Vector ROM */ |
| 767 | 796 | ROM_LOAD( "036800.02", 0x4800, 0x0800, CRC(bb8cabe1) SHA1(cebaa1b91b96e8b80f2b2c17c6fd31fa9f156386) ) |
| 768 | 797 | ROM_LOAD( "036799.01", 0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) ) |
| 798 | ||
| 769 | 799 | /* DVG PROM */ |
| 770 | 800 | ROM_REGION( 0x100, "user1", 0 ) |
| 771 | 801 | ROM_LOAD( "034602-01.c8", 0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) |
| r5077 | r5078 | |
| 780 | 810 | /* Vector ROM */ |
| 781 | 811 | ROM_LOAD( "036800.01", 0x4800, 0x0800, CRC(3b597407) SHA1(344fea2e5d84acce365d76daed61e96b9b6b37cc) ) |
| 782 | 812 | ROM_LOAD( "036799.01", 0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) ) |
| 813 | ||
| 783 | 814 | /* DVG PROM */ |
| 784 | 815 | ROM_REGION( 0x0100, "user1", 0 ) |
| 785 | 816 | ROM_LOAD( "034602-01.c8", 0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) |
| r5077 | r5078 | |
| 832 | 863 | /* Vector ROM */ |
| 833 | 864 | ROM_LOAD( "036800.01", 0x4800, 0x0800, CRC(3b597407) SHA1(344fea2e5d84acce365d76daed61e96b9b6b37cc) ) |
| 834 | 865 | ROM_LOAD( "036799.01", 0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) ) |
| 866 | ||
| 835 | 867 | /* DVG PROM */ |
| 836 | 868 | ROM_REGION( 0x0100, "user1", 0 ) |
| 837 | 869 | ROM_LOAD( "034602-01.c8", 0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) |
| r5077 | r5078 | |
| 850 | 882 | /* This _should_ be the rom for international versions. */ |
| 851 | 883 | /* Unfortunately, is it not currently available. */ |
| 852 | 884 | ROM_LOAD( "034597.01", 0x5800, 0x0800, NO_DUMP ) |
| 885 | ||
| 853 | 886 | /* DVG PROM */ |
| 854 | 887 | ROM_REGION( 0x100, "user1", 0 ) |
| 855 | 888 | ROM_LOAD( "034602-01.c8", 0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) |
| r5077 | r5078 | |
| 900 | 933 | * |
| 901 | 934 | *************************************/ |
| 902 | 935 | |
| 903 | GAME( 1979, asteroid, 0, asteroid, asteroid, 0, ROT0, "Atari", "Asteroids (rev 2)", GAME_SUPPORTS_SAVE ) | |
| 904 | GAME( 1979, asteroi1, asteroid, asteroid, asteroid, 0, ROT0, "Atari", "Asteroids (rev 1)", GAME_SUPPORTS_SAVE ) | |
| 905 | GAME( 1979, asteroib, asteroid, asteroid, asteroib, asteroib, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", GAME_SUPPORTS_SAVE ) | |
| 906 | GAME( 1979, asterock, asteroid, asterock, asterock, asterock, ROT0, "Sidam", "Asterock", GAME_SUPPORTS_SAVE ) | |
| 907 | GAME( 1979, meteorts, asteroid, asteroid, asteroid, 0, ROT0, "VGG", "Meteorites", GAME_SUPPORTS_SAVE ) | |
| 908 | GAME( 1980, meteorho, asteroid, asteroid, asteroid, 0, ROT0, "Hoei", "Meteor", GAME_SUPPORTS_SAVE ) | |
| 909 | GAMEL(1980, astdelux, 0, astdelux, astdelux, 0, ROT0, "Atari", "Asteroids Deluxe (rev 3)", GAME_SUPPORTS_SAVE, layout_ho88ffff ) | |
| 910 | GAMEL(1980, astdelu2, astdelux, astdelux, astdelux, 0, ROT0, "Atari", "Asteroids Deluxe (rev 2)", GAME_SUPPORTS_SAVE, layout_ho88ffff ) | |
| 911 | GAMEL(1980, astdelu1, astdelux, astdelux, astdelux, 0, ROT0, "Atari", "Asteroids Deluxe (rev 1)", GAME_SUPPORTS_SAVE, layout_ho88ffff ) | |
| 912 | GAME( 1979, llander, 0, llander, llander, 0, ROT0, "Atari", "Lunar Lander (rev 2)", GAME_SUPPORTS_SAVE ) | |
| 913 | GAME( 1979, llander1, llander, llander, llander1, 0, ROT0, "Atari", "Lunar Lander (rev 1)", GAME_SUPPORTS_SAVE ) | |
| 936 | GAME( 1979, asteroid, 0, asteroid, asteroid, 0, ROT0, "Atari", "Asteroids (rev 4)", GAME_SUPPORTS_SAVE ) | |
| 937 | GAME( 1979, asteroi2, asteroid, asteroid, asteroid, 0, ROT0, "Atari", "Asteroids (rev 2)", GAME_SUPPORTS_SAVE ) | |
| 938 | GAME( 1979, asteroi1, asteroid, asteroid, asteroid, 0, ROT0, "Atari", "Asteroids (rev 1)", GAME_SUPPORTS_SAVE ) | |
| 939 | GAME( 1979, asteroib, asteroid, asteroid, asteroib, asteroib, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", GAME_SUPPORTS_SAVE ) | |
| 940 | GAME( 1979, asterock, asteroid, asterock, asterock, asterock, ROT0, "Sidam", "Asterock", GAME_SUPPORTS_SAVE ) | |
| 941 | GAME( 1979, meteorts, asteroid, asteroid, asteroid, 0, ROT0, "VGG", "Meteorites", GAME_SUPPORTS_SAVE ) | |
| 942 | GAME( 1980, meteorho, asteroid, asteroid, asteroid, 0, ROT0, "Hoei", "Meteor", GAME_SUPPORTS_SAVE ) | |
| 943 | GAMEL(1980, astdelux, 0, astdelux, astdelux, 0, ROT0, "Atari", "Asteroids Deluxe (rev 3)", GAME_SUPPORTS_SAVE, layout_ho88ffff ) | |
| 944 | GAMEL(1980, astdelu2, astdelux, astdelux, astdelux, 0, ROT0, "Atari", "Asteroids Deluxe (rev 2)", GAME_SUPPORTS_SAVE, layout_ho88ffff ) | |
| 945 | GAMEL(1980, astdelu1, astdelux, astdelux, astdelux, 0, ROT0, "Atari", "Asteroids Deluxe (rev 1)", GAME_SUPPORTS_SAVE, layout_ho88ffff ) | |
| 946 | GAME( 1979, llander, 0, llander, llander, 0, ROT0, "Atari", "Lunar Lander (rev 2)", GAME_SUPPORTS_SAVE ) | |
| 947 | GAME( 1979, llander1, llander, llander, llander1, 0, ROT0, "Atari", "Lunar Lander (rev 1)", GAME_SUPPORTS_SAVE ) |
| r5077 | r5078 | |
|---|---|---|
| 407 | 407 | y = 256 - y; |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | drawgfx(bitmap,gfx,code,color,fx,fy,x,y | |
| 410 | drawgfx_transpen(bitmap,&clip,gfx,code,color,fx,fy,x,y | |
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | } |
| r5077 | r5078 | |
| 460 | 460 | y = 256 - y; |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | drawgfx(bitmap,gfx,code,color,fx,fy,x,y | |
| 463 | drawgfx_transpen(bitmap,&clip,gfx,code,color,fx,fy,x,y | |
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | } |
| r5077 | r5078 | |
|---|---|---|
| 61 | 61 | for (x=0;x<256/8;x++) |
| 62 | 62 | { |
| 63 | 63 | int tile = galaxia_video[count]; |
| 64 | drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x*8,y*8 | |
| 64 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8 | |
| 65 | 65 | count++; |
| 66 | 66 | } |
| 67 | 67 | } |
| r5077 | r5078 | |
|---|---|---|
| 368 | 368 | |
| 369 | 369 | int tx, ty, sx, sy, flipx, flipy; |
| 370 | 370 | int xsize, ysize, xzoom, yzoom; |
| 371 | int code, attr, color, size, pri, pri_mask | |
| 371 | int code, attr, color, size, pri, pri_mask | |
| 372 | 372 | gfx_element *gfx = machine->gfx[region]; |
| 373 | 373 | |
| 374 | 374 | UINT32 *source = sprram_top; |
| r5077 | r5078 | |
| 422 | 422 | yzoom = 0x1000000/yzoom; |
| 423 | 423 | xzoom = 0x1000000/xzoom; |
| 424 | 424 | |
| 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 | |
| 426 | 426 | |
| 427 | 427 | if (flipscreen) |
| 428 | 428 | { |
| r5077 | r5078 | |
| 443 | 443 | pri_mask = 0xfe; |
| 444 | 444 | |
| 445 | 445 | gfx_element_set_source_clip(gfx, tx, xsize, ty, ysize); |
| 446 | pdrawgfxzoom(bitmap, gfx, | |
| 446 | pdrawgfxzoom_transpen(bitmap, cliprect, gfx, | |
| 447 | 447 | code, |
| 448 | 448 | color, |
| 449 | 449 | flipx, flipy, |
| 450 | 450 | sx,sy, |
| 451 | cliprect, trans, 0, | |
| 452 | xzoom, yzoom, pri_mask); | |
| 451 | xzoom, yzoom, priority_bitmap,pri_mask, 0); | |
| 453 | 452 | } /* end sprite loop */ |
| 454 | 453 | } |
| 455 | 454 |
| r5077 | r5078 | |
|---|---|---|
| 188 | 188 | int flipx = flags & 0x20; |
| 189 | 189 | int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) ); |
| 190 | 190 | |
| 191 | drawgfx( bitmap, screen->machine->gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ) | |
| 191 | drawgfx_transpen( bitmap, cliprect, screen->machine->gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ) | |
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | } |
| r5077 | r5078 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | while (multi >= 0) |
| 121 | 121 | { |
| 122 | pdrawgfx(bitmap,machine->gfx[2], | |
| 122 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 123 | 123 | sprite - multi * inc, |
| 124 | 124 | colour, |
| 125 | 125 | fx,fy, |
| 126 | 126 | x,y + mult * multi, |
| 127 | | |
| 127 | | |
| 128 | 128 | |
| 129 | 129 | multi--; |
| 130 | 130 | } |
| r5077 | r5078 | |
|---|---|---|
| 515 | 515 | b=1; |
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | drawgfx(bitmap,machine->gfx[0], | |
| 518 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 519 | 519 | tile+(bank+bank2)*128, |
| 520 | 520 | 0, |
| 521 | 521 | 0, 0, |
| 522 | x*8,y*8, | |
| 523 | cliprect,TRANSPARENCY_PEN,0); | |
| 522 | x*8,y*8,0); | |
| 524 | 523 | } |
| 525 | 524 | } |
| 526 | 525 | } |
| r0 | r5078 | |
|---|---|---|
| 1 | /****************************************************************************** | |
| 2 | ||
| 3 | Hit Poker (c) 1997 Accept LTD | |
| 4 | ||
| 5 | preliminary driver by Angelo Salese & David Haywood | |
| 6 | Many thanks to Olivier Galibert for the CPU identify effort ;-) | |
| 7 | ||
| 8 | TODO: | |
| 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 | ||
| 22 | cpu hd46505SP (HD6845SP) <- ha, ha, ha... --" | |
| 23 | ||
| 24 | other : ZC407615CFN (infralink) | |
| 25 | ||
| 26 | chrystal : no idea | |
| 27 | ||
| 28 | ram km6264BL X3 | |
| 29 | TMM 2018 X2 | |
| 30 | DALLAS REAL TIME CLK DS17487-5 | |
| 31 | SOUND YM2149F | |
| 32 | DIP 1X4 | |
| 33 | ||
| 34 | ============================================================================ | |
| 35 | ||
| 36 | Some 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 | ||
| 50 | static UINT8 *hitpoker_sys_regs; | |
| 51 | static UINT8 hitpoker_pic_data; | |
| 52 | ||
| 53 | #define CRTC_CLOCK XTAL_3_579545MHz | |
| 54 | ||
| 55 | VIDEO_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 | ||
| 62 | VIDEO_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 | ||
| 88 | static 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 | ||
| 98 | static 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 | ||
| 106 | static 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 | ||
| 116 | static WRITE8_HANDLER( hitpoker_cram_w ) | |
| 117 | { | |
| 118 | colorram[offset] = data; | |
| 119 | } | |
| 120 | ||
| 121 | static 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 | ||
| 131 | static 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 | ||
| 146 | static READ8_HANDLER( rtc_r ) | |
| 147 | { | |
| 148 | return 0x80; //kludge it for now | |
| 149 | } | |
| 150 | ||
| 151 | static UINT8 eeprom_data[0x200]; | |
| 152 | static UINT16 eeprom_index; | |
| 153 | ||
| 154 | /* tests 0x180, what EEPROM is this one??? */ | |
| 155 | static 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 | ||
| 170 | static 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 | ||
| 182 | static 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 | ||
| 200 | static 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 | |
| 209 | static READ8_HANDLER( test_r ) | |
| 210 | { | |
| 211 | return mame_rand(space->machine); | |
| 212 | } | |
| 213 | #endif | |
| 214 | ||
| 215 | /* overlap empty rom addresses */ | |
| 216 | static 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 | |
| 236 | ADDRESS_MAP_END | |
| 237 | ||
| 238 | /* unused, to be removed */ | |
| 239 | static ADDRESS_MAP_START( hitpoker_io, ADDRESS_SPACE_IO, 8 ) | |
| 240 | ADDRESS_MAP_END | |
| 241 | ||
| 242 | static 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 ) ) | |
| 396 | INPUT_PORTS_END | |
| 397 | ||
| 398 | ||
| 399 | static 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 | ||
| 410 | static 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 | ||
| 421 | static GFXDECODE_START( hitpoker ) | |
| 422 | GFXDECODE_ENTRY( "gfx1", 0, hitpoker_layout_4bpp, 0, 0x100 ) | |
| 423 | GFXDECODE_ENTRY( "gfx1", 0, hitpoker_layout_8bpp, 0, 8 ) | |
| 424 | GFXDECODE_END | |
| 425 | ||
| 426 | static 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 | ||
| 440 | static 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. */ | |
| 451 | static const hc11_config hitpoker_config = | |
| 452 | { | |
| 453 | 0, //has internal I/O | |
| 454 | 0 //internal RAM size | |
| 455 | }; | |
| 456 | ||
| 457 | static 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) | |
| 485 | MACHINE_DRIVER_END | |
| 486 | ||
| 487 | DRIVER_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 | ||
| 501 | ROM_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 | |
| 513 | ROM_END | |
| 514 | ||
| 515 | GAME( 1997, hitpoker, 0, hitpoker, hitpoker, hitpoker, ROT0, "Accept Ltd.", "Hit Poker (Bulgaria)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 516 |
| r5077 | r5078 | |
|---|---|---|
| 170 | 170 | { |
| 171 | 171 | int tile = go2000_video[count]; |
| 172 | 172 | int attr = go2000_video2[count]; |
| 173 | drawgfx(bitmap,screen->machine->gfx[0],tile,attr,0,0,x*8,y*8 | |
| 173 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,attr,0,0,x*8,y*8 | |
| 174 | 174 | count++; |
| 175 | 175 | } |
| 176 | 176 | } |
| r5077 | r5078 | |
| 182 | 182 | { |
| 183 | 183 | int tile = go2000_video[count]; |
| 184 | 184 | int attr = go2000_video2[count]; |
| 185 | drawgfx(bitmap,screen->machine->gfx[0],tile,attr,0,0,x*8,y*8 | |
| 185 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tile,attr,0,0,x*8,y*8 | |
| 186 | 186 | count++; |
| 187 | 187 | } |
| 188 | 188 | } |
| r5077 | r5078 | |
| 261 | 261 | tile_flipy = !tile_flipy; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | drawgfx( bitmap, screen->machine->gfx[0], | |
| 264 | drawgfx_transpen( bitmap, cliprect,screen->machine->gfx[0], | |
| 265 | 265 | (tile & 0x1fff) + bank*0x4000, |
| 266 | 266 | attr, |
| 267 | 267 | tile_flipx, tile_flipy, |
| 268 | sx, sy, | |
| 269 | cliprect,TRANSPARENCY_PEN,15 ); | |
| 268 | sx, sy,15 ); | |
| 270 | 269 | |
| 271 | 270 | tile_x += tile_xinc; |
| 272 | 271 | } |
| r5077 | r5078 | |
|---|---|---|
| 32 | 32 | { |
| 33 | 33 | int tile = (buster_vram[count+1])|(buster_vram[count]<<8); |
| 34 | 34 | //int colour = tile>>12; |
| 35 | drawgfx(bitmap,gfx,tile,0,0,0,x*8,y*4 | |
| 35 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*4 | |
| 36 | 36 | |
| 37 | 37 | count+=2; |
| 38 | 38 | } |
| r5077 | r5078 | |
|---|---|---|
| 281 | 281 | flipy = !flipy; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | drawgfx(bitmap, machine->gfx[2], | |
| 284 | drawgfx_transpen(bitmap, cliprect, | |
| 285 | machine->gfx[2], | |
| 285 | 286 | code, color, |
| 286 | 287 | flipx, flipy, |
| 287 | sx, sy, | |
| 288 | cliprect, | |
| 289 | TRANSPARENCY_PEN, 0); | |
| 288 | sx, sy, 0); | |
| 290 | 289 | |
| 291 | 290 | /* sprite wrapping - verified on real hardware*/ |
| 292 | 291 | if(sx>0xf0) |
| 293 | 292 | { |
| 294 | drawgfx(bitmap, machine->gfx[2], | |
| 293 | drawgfx_transpen(bitmap, cliprect, | |
| 294 | machine->gfx[2], | |
| 295 | 295 | code, color, |
| 296 | 296 | flipx, flipy, |
| 297 | sx-0x100, sy, | |
| 298 | cliprect, | |
| 299 | TRANSPARENCY_PEN, 0); | |
| 297 | sx-0x100, sy, 0); | |
| 300 | 298 | } |
| 301 | 299 | |
| 302 | 300 | } |
| r5077 | r5078 | |
|---|---|---|
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | |
| 498 | drawgfx(bitmap,gfx,tileno,attr,0,0,x*8,y*8 | |
| 498 | drawgfx_opaque(bitmap,cliprect,gfx,tileno,attr,0,0,x*8,y*8 | |
| 499 | 499 | |
| 500 | 500 | count+=4; |
| 501 | 501 |
| r5077 | r5078 | |
|---|---|---|
| 61 | 61 | flipy = !flipy; |
| 62 | 62 | } |
| 63 | 63 | |
| 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); | |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 |
| r5077 | r5078 | |
|---|---|---|
| 146 | 146 | UINT16 code = codes[y*2]; |
| 147 | 147 | UINT16 attr = codes[y*2+1]; |
| 148 | 148 | |
| 149 | drawgfxzoom( bitmap, machine->gfx[0], | |
| 149 | drawgfxzoom_transpen( bitmap, cliprect, machine->gfx[0], | |
| 150 | 150 | code, |
| 151 | 151 | attr >> 8, |
| 152 | 152 | attr & 1, attr & 2, |
| 153 | 153 | sx / 0x10000, ((sy + y * ydim) / 0x10000)&0x1ff, |
| 154 | cliprect, TRANSPARENCY_PEN, 0, | |
| 155 | xscale, yscale ); | |
| 154 | xscale, yscale, 0 ); | |
| 156 | 155 | } |
| 157 | 156 | } |
| 158 | 157 | } |
| r5077 | r5078 | |
|---|---|---|
| 60 | 60 | int flipx = ((mkiv_vram[count]) & 0x04); |
| 61 | 61 | // 0x0800 probably flipy |
| 62 | 62 | |
| 63 | drawgfx(bitmap,gfx,tile,color,flipx,0,x*8,y*8 | |
| 63 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,flipx,0,x*8,y*8 | |
| 64 | 64 | count+=2; |
| 65 | 65 | } |
| 66 | 66 | } |
| r5077 | r5078 | |
|---|---|---|
| 93 | 93 | for (x = 0; x < 32; x++) |
| 94 | 94 | { |
| 95 | 95 | int tile = murogmbl_video[count]; |
| 96 | drawgfx(bitmap, gfx, tile, 0, 0, 0, x * 8, y * 8 | |
| 96 | drawgfx_opaque(bitmap, cliprect, gfx, tile, 0, 0, 0, x * 8, y * 8 | |
| 97 | 97 | |
| 98 | 98 | count++; |
| 99 | 99 | } |
| r5077 | r5078 | |
|---|---|---|
| 158 | 158 | flipy = !flipy; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | drawgfx(bitmap, machine->gfx[1], | |
| 161 | drawgfx_transpen(bitmap, cliprect, | |
| 162 | machine->gfx[1], | |
| 162 | 163 | code, color, |
| 163 | 164 | flipx, flipy, |
| 164 | sx, sy, | |
| 165 | cliprect, | |
| 166 | TRANSPARENCY_PEN, 0); | |
| 165 | sx, sy, 0); | |
| 167 | 166 | } |
| 168 | 167 | |
| 169 | 168 | /* 8x8 sprites */ |
| r5077 | r5078 | |
| 186 | 185 | flipy = !flipy; |
| 187 | 186 | } |
| 188 | 187 | |
| 189 | drawgfx(bitmap, machine->gfx[0], | |
| 188 | drawgfx_transpen(bitmap, cliprect, | |
| 189 | machine->gfx[0], | |
| 190 | 190 | code, color, |
| 191 | 191 | flipx, flipy, |
| 192 | sx, sy, | |
| 193 | cliprect, | |
| 194 | TRANSPARENCY_PEN, 0); | |
| 192 | sx, sy, 0); | |
| 195 | 193 | } |
| 196 | 194 | } |
| 197 | 195 |
| r5077 | r5078 | |
|---|---|---|
| 164 | 164 | { |
| 165 | 165 | for(dy=0;dy<h;dy++) |
| 166 | 166 | 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) | |
| 167 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0],spr_offs++,colour,1,0,((x+16*w)-(dx+1)*16),(y+dy*16) | |
| 168 | 168 | } |
| 169 | 169 | else |
| 170 | 170 | { |
| 171 | 171 | for(dy=0;dy<h;dy++) |
| 172 | 172 | for(dx=0;dx<w;dx++) |
| 173 | drawgfx(bitmap,machine->gfx[0],spr_offs++,colour,0,0,(x+dx*16),(y+dy*16) | |
| 173 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0],spr_offs++,colour,0,0,(x+dx*16),(y+dy*16) | |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | } |
| r5077 | r5078 | |
|---|---|---|
| 269 | 269 | flipy = !flipy; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy | |
| 272 | drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy | |
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 |
| r5077 | r5078 | |
|---|---|---|
| 97 | 97 | ypos = (source[0] & 0x00ff) >> 0; |
| 98 | 98 | tileno = (source2[0] & 0x7ffe) >> 1; |
| 99 | 99 | 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 | |
| 104 | 104 | |
| 105 | 105 | source++;source2++; |
| 106 | 106 | } |
| r5077 | r5078 | |
|---|---|---|
| 58 | 58 | //int blinkLine = (tile_control_ram[current_screen_character] & 0x40) >> 6; |
| 59 | 59 | //int blinkChar = (tile_control_ram[current_screen_character] & 0x80) >> 7; |
| 60 | 60 | |
| 61 | drawgfx(bitmap, screen->machine->gfx[0], | |
| 61 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], | |
| 62 | 62 | tile_ram[current_screen_character] + (0x100 * tileOffs), |
| 63 | 63 | palIndex, |
| 64 | 0, 0, charx*8, chary*8, | |
| 64 | 0, 0, charx*8, chary*8, | |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 |
| r5077 | r5078 | |
|---|---|---|
| 265 | 265 | |
| 266 | 266 | /**************************************************************************************/ |
| 267 | 267 | |
| 268 | static void zdrawgfxzoom(running_machine *machine, | |
| 269 | bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 268 | static void zdrawgfxzoom( | |
| 269 | bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 270 | 270 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 271 | | |
| 271 | | |
| 272 | 272 | int scalex, int scaley, int zpos ) |
| 273 | 273 | { |
| 274 | 274 | if (!scalex || !scaley) return; |
| r5077 | r5078 | |
| 276 | 276 | { |
| 277 | 277 | if( gfx ) |
| 278 | 278 | { |
| 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)]; | |
| 281 | 281 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| 282 | 282 | int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; |
| 283 | 283 | int sprite_screen_width = (scalex*gfx->width+0x8000)>>16; |
| r5077 | r5078 | |
| 478 | 478 | gfx_element_set_source_clip(gfx, 0, 32, 0, 32); |
| 479 | 479 | |
| 480 | 480 | zdrawgfxzoom( |
| 481 | machine, | |
| 482 | 481 | bitmap, |
| 482 | cliprect, | |
| 483 | 483 | gfx, |
| 484 | 484 | sprn, |
| 485 | 485 | color, |
| 486 | 486 | flipx,flipy, |
| 487 | 487 | xpos,ypos, |
| 488 | cliprect, | |
| 489 | 488 | TRANSPARENCY_PEN,0xff, |
| 490 | 489 | scalex,scaley, |
| 491 | 490 | loop ); |
| r5077 | r5078 | |
| 613 | 612 | rect.min_y += (tile&2)?16:0; |
| 614 | 613 | rect.max_y += (tile&2)?16:0; |
| 615 | 614 | } |
| 616 | zdrawgfxzoom(machine, | |
| 617 | bitmap,machine->gfx[0], | |
| 615 | zdrawgfxzoom( | |
| 616 | bitmap, | |
| 617 | &rect, | |
| 618 | machine->gfx[0], | |
| 618 | 619 | sprn, color, |
| 619 | 620 | flipx,flipy, |
| 620 | 621 | sx,sy, |
| 621 | &rect, | |
| 622 | 622 | TRANSPARENCY_PEN,0xff, |
| 623 | 623 | scalex, scaley, |
| 624 | 624 | loop ); |
| r5077 | r5078 | |
| 877 | 877 | tile = spritetile16[tile_index++]; |
| 878 | 878 | if( (tile&0x8000)==0 ) |
| 879 | 879 | { |
| 880 | zdrawgfxzoom(machine, | |
| 881 | bitmap,machine->gfx[mGfxC355], | |
| 880 | zdrawgfxzoom( | |
| 881 | bitmap, | |
| 882 | &clip, | |
| 883 | machine->gfx[mGfxC355], | |
| 882 | 884 | mpCodeToTile(tile) + offset, |
| 883 | 885 | color, |
| 884 | 886 | flipx,flipy, |
| 885 | 887 | sx,sy, |
| 886 | &clip, | |
| 887 | 888 | TRANSPARENCY_PEN,0xff, |
| 888 | 889 | zoomx, zoomy, zpos ); |
| 889 | 890 | } |
| r5077 | r5078 | |
|---|---|---|
| 248 | 248 | { |
| 249 | 249 | int tile = carrera_tileram[count&0x7ff] | carrera_tileram[(count&0x7ff)+0x800]<<8; |
| 250 | 250 | |
| 251 | drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x*8,y*8 | |
| 251 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8 | |
| 252 | 252 | count++; |
| 253 | 253 | } |
| 254 | 254 | } |
| r5077 | r5078 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | **************************************************************************** |
| 32 | 32 | |
| 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 | ||
| 33 | 50 | Thanks to Frans van Egmond for locating and dumping Tylz |
| 34 | 51 | |
| 35 | 52 | Notes: |
| r5077 | r5078 | |
|---|---|---|
| 130 | 130 | xx = w; |
| 131 | 131 | do |
| 132 | 132 | { |
| 133 | drawgfx(bitmap,machine->gfx[2], | |
| 133 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 134 | 134 | code, |
| 135 | 135 | color, |
| 136 | 136 | flipx, flipy, |
| 137 | ((x + 16) & 0x1ff) - 16,sy & 0x1ff, | |
| 138 | cliprect,TRANSPARENCY_PEN,15); | |
| 137 | ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15); | |
| 139 | 138 | |
| 140 | 139 | code++; |
| 141 | 140 | x += delta; |
| r5077 | r5078 | |
|---|---|---|
| 45 | 45 | for (characterY = 0; characterY < 32; characterY++) |
| 46 | 46 | { |
| 47 | 47 | 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); | |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | } |
| r5077 | r5078 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | for(dx=0;dx<w;dx++) |
| 94 | 94 | for(dy=0;dy<h;dy++) |
| 95 | drawgfx(bitmap,screen->machine->gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16) | |
| 95 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16) | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 257 | 257 | tile = fortecar_ram[(count*4)+1] | (fortecar_ram[(count*4)+2]<<8); |
| 258 | 258 | color = fortecar_ram[(count*4)+3]; |
| 259 | 259 | |
| 260 | drawgfx(bitmap,screen->machine->gfx[0],tile,color,0,0,x*8,y*8 | |
| 260 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,color,0,0,x*8,y*8 | |
| 261 | 261 | count++; |
| 262 | 262 | |
| 263 | 263 | } |
| r5077 | r5078 | |
|---|---|---|
| 440 | 440 | for (x=0;x<64;x++) |
| 441 | 441 | { |
| 442 | 442 | 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 | |
| 443 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],(tile&0xfff)+((tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32 | |
| 444 | 444 | count++; |
| 445 | 445 | } |
| 446 | 446 | } |
| r5077 | r5078 | |
| 452 | 452 | for (x=0;x<64;x++) |
| 453 | 453 | { |
| 454 | 454 | 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 | |
| 455 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],(tile&0xfff)+((tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8 | |
| 456 | 456 | count++; |
| 457 | 457 | } |
| 458 | 458 | } |
| r5077 | r5078 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | while (multi >= 0) |
| 155 | 155 | { |
| 156 | pdrawgfx(bitmap,machine->gfx[region], | |
| 156 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[region], | |
| 157 | 157 | sprite - multi * inc, |
| 158 | 158 | colour, |
| 159 | 159 | fx,fy, |
| 160 | 160 | x,y + mult * multi, |
| 161 | | |
| 161 | | |
| 162 | 162 | |
| 163 | 163 | multi--; |
| 164 | 164 | } |
| r5077 | r5078 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | for (x = 0 ; x < dimx ; x++) |
| 66 | 66 | { |
| 67 | drawgfx(bitmap,machine->gfx[0], | |
| 67 | drawgfx_transpen(bitmap,cliprect, machine->gfx[0], | |
| 68 | 68 | code++, 0, |
| 69 | 69 | 0, 0, |
| 70 | sx + x * 16, sy + y * 16, | |
| 71 | cliprect, TRANSPARENCY_PEN, 0xff); | |
| 70 | sx + x * 16, sy + y * 16, 0xff); | |
| 72 | 71 | } |
| 73 | 72 | } |
| 74 | 73 | } |
| r5077 | r5078 | |
|---|---|---|
| 71 | 71 | { |
| 72 | 72 | int dat; |
| 73 | 73 | dat = intrscti_ram[count]; |
| 74 | drawgfx(bitmap,screen->machine->gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8 | |
| 74 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8 | |
| 75 | 75 | count++; |
| 76 | 76 | } |
| 77 | 77 | } |
| r5077 | r5078 | |
|---|---|---|
| 68 | 68 | int tileno,colour; |
| 69 | 69 | tileno = chinsan_video[count] | (chinsan_video[count+0x800]<<8); |
| 70 | 70 | colour = chinsan_video[count+0x1000]>>3; |
| 71 | drawgfx(bitmap,screen->machine->gfx[0],tileno,colour,0,0,x*8,y*8 | |
| 71 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tileno,colour,0,0,x*8,y*8 | |
| 72 | 72 | count++; |
| 73 | 73 | } |
| 74 | 74 | } |
| r5077 | r5078 | |
|---|---|---|
| 158 | 158 | { |
| 159 | 159 | int tile=0x30+((spriteram[i]>>2)&0x1f); |
| 160 | 160 | |
| 161 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 161 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 162 | 162 | tile, |
| 163 | 163 | spriteram[i+1], |
| 164 | 164 | 0, 0, |
| 165 | spriteram[i+3],spriteram[i+2], | |
| 166 | cliprect,TRANSPARENCY_PEN,3); | |
| 165 | spriteram[i+3],spriteram[i+2],3); | |
| 167 | 166 | |
| 168 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 167 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 169 | 168 | tile, |
| 170 | 169 | spriteram[i+1], |
| 171 | 170 | 0, 0, |
| 172 | spriteram[i+3]+8,spriteram[i+2], | |
| 173 | cliprect,TRANSPARENCY_PEN,3); | |
| 171 | spriteram[i+3]+8,spriteram[i+2],3); | |
| 174 | 172 | |
| 175 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 173 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 176 | 174 | tile, |
| 177 | 175 | spriteram[i+1], |
| 178 | 176 | 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); | |
| 181 | 178 | |
| 182 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 179 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0], | |
| 183 | 180 | tile, |
| 184 | 181 | spriteram[i+1], |
| 185 | 182 | 0, 0, |
| 186 | spriteram[i+3],spriteram[i+2]+8, | |
| 187 | cliprect,TRANSPARENCY_PEN,3); | |
| 183 | spriteram[i+3],spriteram[i+2]+8,3); | |
| 188 | 184 | } |
| 189 | 185 | } |
| 190 | 186 | } |
| r5077 | r5078 | |
|---|---|---|
| 1719 | 1719 | ROM_END |
| 1720 | 1720 | |
| 1721 | 1721 | |
| 1722 | ROM_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 */ | |
| 1754 | ROM_END | |
| 1755 | ||
| 1756 | ||
| 1722 | 1757 | ROM_START( hiimpacp ) |
| 1723 | 1758 | ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */ |
| 1724 | 1759 | ROM_LOAD ( "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) ) |
| r5077 | r5078 | |
| 1730 | 1765 | ROM_LOAD16_BYTE( "u89-pa1", 0xc0001, 0x20000, CRC(2bd3de30) SHA1(ee3615c1cc5b948731eb258887641f059b942b25) ) |
| 1731 | 1766 | |
| 1732 | 1767 | 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 */ | |
| 1735 | 1770 | ROM_LOAD ( "la1u113.bin", 0x040000, 0x20000, CRC(b67aeb70) SHA1(dd1512329c46da4254712712b6f847544f4487bd) ) |
| 1736 | 1771 | ROM_LOAD ( "la1u114.bin", 0x060000, 0x20000, CRC(9a4bc44b) SHA1(309eb5214fe5e1fe64d724d515190a31fc524aae) ) |
| 1737 | 1772 | |
| r5077 | r5078 | |
| 2315 | 2350 | GAME( 1990, hiimpact, 0, yunit_cvsd_6bit_slow, trog, hiimpact, ROT0, "Williams", "High Impact Football (rev LA5 02/15/91)", GAME_SUPPORTS_SAVE ) |
| 2316 | 2351 | GAME( 1990, hiimpac4, hiimpact, yunit_cvsd_6bit_slow, trog, hiimpact, ROT0, "Williams", "High Impact Football (rev LA4 02/04/91)", GAME_SUPPORTS_SAVE ) |
| 2317 | 2352 | GAME( 1990, hiimpac3, hiimpact, yunit_cvsd_6bit_slow, trog, hiimpact, ROT0, "Williams", "High Impact Football (rev LA3 12/27/90)", GAME_SUPPORTS_SAVE ) |
| 2353 | GAME( 1990, hiimpac1, hiimpact, yunit_cvsd_6bit_slow, trog, hiimpact, ROT0, "Williams", "High Impact Football (rev LA1 12/16/90)", GAME_SUPPORTS_SAVE ) | |
| 2318 | 2354 | GAME( 1990, hiimpacp, hiimpact, yunit_cvsd_6bit_slow, trog, hiimpact, ROT0, "Williams", "High Impact Football (prototype, rev 8.6 12/09/90)", GAME_SUPPORTS_SAVE ) |
| 2319 | 2355 | GAME( 1991, shimpact, 0, yunit_cvsd_6bit_slow, trog, shimpact, ROT0, "Midway", "Super High Impact (rev LA1 09/30/91)", GAME_SUPPORTS_SAVE ) |
| 2320 | 2356 | GAME( 1991, shimpap6, shimpact, yunit_cvsd_6bit_slow, trog, shimpact, ROT0, "Midway", "Super High Impact (prototype, rev 6.0 09/23/91)", GAME_SUPPORTS_SAVE ) |
| r5077 | r5078 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | /* Somewhere there's a flag that offsets the tilemap by 0x100*x */ |
| 101 | 101 | /* 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], | |
| 103 | 103 | tile_ram[current_screen_character], |
| 104 | 104 | 0, |
| 105 | 0, 0, charx*8, chary*8, | |
| 105 | 0, 0, charx*8, chary*8, | |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 |
| r5077 | r5078 | |
|---|---|---|
| 53 | 53 | int tile = lions_vram[count+1]|lions_vram[count]<<8; |
| 54 | 54 | tile&=0x1ff; |
| 55 | 55 | //int colour = tile>>12; |
| 56 | drawgfx(bitmap,gfx,tile,0,0,0,x*8,y*8 | |
| 56 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8 | |
| 57 | 57 | |
| 58 | 58 | count+=2; |
| 59 | 59 | } |
| r5077 | r5078 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | 4dwarrio 3x16k 1x8k 6x8k 4x16k no pio ???? ???? |
| 75 | 75 | |
| 76 | shtngmst 3x32k 1x32k 3x32k 7x32k yes 7102(a) 7104 | |
| 77 | shtngmst1 3x32k 1x32k 3x32k 7x32k yes 7102 | |
| 78 | shtngmsta 3x32k 1x32k 3x32k 7x32k yes license | |
| 76 | shtngmst 3x32k 1x32k 3x32k 7x32k yes 7102 | |
| 77 | shtngmste 3x32k 1x32k 3x32k 7x32k yes 7102(a) 7104 | |
| 79 | 78 | |
| 80 | 79 | choplift 3x32k 1x32k 3x32k 4x32k yes 7126 7120 |
| 81 | 80 | chopliftu 3x32k 1x32k 3x32k 4x32k yes 7154 |
| r5077 | r5078 | |
| 3292 | 3291 | |
| 3293 | 3292 | |
| 3294 | 3293 | /* |
| 3294 | Shooting Master (SEGA) | |
| 3295 | Year: 1985 | |
| 3296 | System 2 | |
| 3297 | ||
| 3295 | 3298 | Main Board 834-5719 |
| 3296 | 3299 | Light Gun Board? 834-5720 |
| 3297 | 3300 | */ |
| r5077 | r5078 | |
| 3412 | 3415 | ROM_END |
| 3413 | 3416 | |
| 3414 | 3417 | /* |
| 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 | */ | |
| 3422 | ROM_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 */ | |
| 3467 | ROM_END | |
| 3468 | ||
| 3469 | ||
| 3470 | /* | |
| 3471 | 3418 | Choplifter (8751 315-5151) |
| 3472 | 3419 | Year: 1985 |
| 3473 | 3420 | System 2 |
| r5077 | r5078 | |
| 4801 | 4748 | GAME( 1985, chopliftbl, choplift, sys2row, choplift, bank0c, ROT0, "bootleg", "Choplifter (bootleg)", GAME_SUPPORTS_SAVE ) |
| 4802 | 4749 | GAME( 1985, shtngmst, 0, sys2m, shtngmst, shtngmst, ROT0, "Sega", "Shooting Master (8751 315-5159)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| 4803 | 4750 | GAME( 1985, shtngmste, shtngmst, sys2m, shtngmst, shtngmst, ROT0, "Sega [EVG]", "Shooting Master (EVG, 8751 315-5159a)", GAME_SUPPORTS_SAVE ) |
| 4804 | GAME( 1985, shtngmstu, shtngmst, sys2, shtngmst, shtngmst, ROT0, "Sega", "Shooting Master (unprotected)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) | |
| 4805 | 4751 | GAME( 1986, gardiab, gardia, sys2, gardia, gardiab, ROT270, "bootleg", "Gardia (317-0007?, bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 4806 | 4752 | GAME( 1986, wboysys2, wboy, sys2, wboysys2, wboysys2, ROT0, "Sega (Escape license)", "Wonder Boy (system 2)", GAME_SUPPORTS_SAVE ) |
| 4807 | 4753 | GAME( 1987, tokisens, 0, sys2, tokisens, bank0c, ROT90, "Sega", "Toki no Senshi - Chrono Soldier", GAME_SUPPORTS_SAVE ) |
| r5077 | r5078 | |
|---|---|---|
| 707 | 707 | color = flags & 0x0f; |
| 708 | 708 | |
| 709 | 709 | |
| 710 | drawgfx(bitmap,machine->gfx[1], | |
| 710 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 711 | 711 | tileno, color, |
| 712 | 712 | flipx, flipy, |
| 713 | sx+8*flipx,sy+8*flipy, | |
| 714 | cliprect,TRANSPARENCY_PEN,0); | |
| 713 | sx+8*flipx,sy+8*flipy,0); | |
| 715 | 714 | |
| 716 | drawgfx(bitmap,machine->gfx[1], | |
| 715 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 717 | 716 | tileno+1, color, |
| 718 | 717 | flipx, flipy, |
| 719 | sx+8-8*flipx,sy+8*flipy, | |
| 720 | cliprect,TRANSPARENCY_PEN,0); | |
| 718 | sx+8-8*flipx,sy+8*flipy,0); | |
| 721 | 719 | |
| 722 | drawgfx(bitmap,machine->gfx[1], | |
| 720 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 723 | 721 | tileno+2, color, |
| 724 | 722 | flipx, flipy, |
| 725 | sx+8*flipx,sy+8-8*flipy, | |
| 726 | cliprect,TRANSPARENCY_PEN,0); | |
| 723 | sx+8*flipx,sy+8-8*flipy,0); | |
| 727 | 724 | |
| 728 | drawgfx(bitmap,machine->gfx[1], | |
| 725 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 729 | 726 | tileno+3, color, |
| 730 | 727 | 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); | |
| 733 | 729 | |
| 734 | 730 | } |
| 735 | 731 | } |
| r5077 | r5078 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | if( color < 0x4 ) |
| 80 | 80 | { |
| 81 | drawgfx( bitmap, screen->machine->gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 | |
| 81 | drawgfx_opaque( bitmap, cliprect, screen->machine->gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 | |
| 82 | 82 | } |
| 83 | 83 | else if( color >= 0x5 && color <= 0x7 ) |
| 84 | 84 | { |
| r5077 | r5078 | |
|---|---|---|
| 918 | 918 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE( segaic16_paletteram_w ) AM_BASE(&paletteram16) |
| 919 | 919 | AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1") |
| 920 | 920 | AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2") |
| 921 | AM_RANGE(0x900006, 0x900007) AM_WRITE(sound_command_w) | |
| 921 | 922 | AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_WRITE(sys16_coinctrl_w) |
| 922 | 923 | AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1") |
| 923 | 924 | AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2") |
| r5077 | r5078 | |
| 1098 | 1099 | |
| 1099 | 1100 | /***************************************************************************/ |
| 1100 | 1101 | |
| 1102 | static 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) | |
| 1122 | MACHINE_DRIVER_END | |
| 1123 | ||
| 1101 | 1124 | static MACHINE_DRIVER_START( goldnaxe_b1 ) |
| 1102 | 1125 | |
| 1103 | 1126 | /* basic machine hardware */ |
| r5077 | r5078 | |
| 1143 | 1166 | MDRV_IMPORT_FROM(goldnaxe_b1) |
| 1144 | 1167 | MDRV_CPU_MODIFY("maincpu") |
| 1145 | 1168 | MDRV_CPU_PROGRAM_MAP(bayroute_b2_map) |
| 1169 | ||
| 1170 | MDRV_IMPORT_FROM(sys16_datsu_sound_cfg) | |
| 1146 | 1171 | MACHINE_DRIVER_END |
| 1147 | 1172 | |
| 1148 | 1173 | static MACHINE_DRIVER_START( dduxbl ) |
| r5077 | r5078 | |
| 1953 | 1978 | ROM_LOAD16_BYTE( "bs7.bin", 0x60000, 0x10000, CRC(0c91abcc) SHA1(d25608f3cbacd1bd169f1a2247f007ac8bc8dda0) ) |
| 1954 | 1979 | |
| 1955 | 1980 | 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) ) | |
| 1958 | 1983 | ROM_END |
| 1959 | 1984 | |
| 1960 | 1985 | // sys16B |
| r5077 | r5078 | |
| 2127 | 2152 | |
| 2128 | 2153 | static DRIVER_INIT( bayrouteb2 ) |
| 2129 | 2154 | { |
| 2155 | UINT8 *mem; | |
| 2156 | ||
| 2130 | 2157 | MACHINE_RESET_CALL(sys16_onetime); |
| 2158 | ||
| 2159 | mem = memory_region(machine, "soundcpu"); | |
| 2160 | memcpy(mem, mem+0x10000, 0x8000); | |
| 2131 | 2161 | } |
| 2132 | 2162 | |
| 2133 | 2163 | /* |
| r5077 | r5078 | |
| 2488 | 2518 | |
| 2489 | 2519 | // System 16B based bootlegs |
| 2490 | 2520 | GAME( 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?) |
| 2491 | GAME( 1989, bayrouteb2, bayroute, bayrouteb2, bayroute, bayrouteb2, ROT0, "bootleg", "Bay Route (Datsu bootleg)", GAME_ | |
| 2521 | GAME( 1989, bayrouteb2, bayroute, bayrouteb2, bayroute, bayrouteb2, ROT0, "bootleg", "Bay Route (Datsu bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 2492 | 2522 | GAME( 1989, goldnaxeb1, goldnaxe, goldnaxe_b1, goldnaxe, goldnabl, ROT0, "bootleg", "Golden Axe (encrypted bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
| 2493 | 2523 | GAME( 1989, goldnaxeb2, goldnaxe, goldnaxe_b2, goldnaxe, goldnab2, ROT0, "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
| 2494 | 2524 | GAME( 1989, tturfbl, tturf, tturfbl, tturf, tturfbl, ROT0, "bootleg", "Tough Turf (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| r5077 | r5078 | |
|---|---|---|
| 241 | 241 | SET_TILE_INFO(0,tile,color,0); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | static void draw_single_sprite(bitmap_t *dest_bmp,const gfx_element *gfx, | |
| 244 | static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx, | |
| 245 | 245 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 246 | | |
| 246 | | |
| 247 | 247 | { |
| 248 | 248 | int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); |
| 249 | 249 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); |
| r5077 | r5078 | |
| 388 | 388 | /* prepare GfxElement on the fly */ |
| 389 | 389 | gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width, 0, 256, 0); |
| 390 | 390 | |
| 391 | draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x,y | |
| 391 | draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y | |
| 392 | 392 | |
| 393 | 393 | // wrap around x |
| 394 | draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x-512,y | |
| 394 | draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x-512,y | |
| 395 | 395 | |
| 396 | 396 | // wrap around y |
| 397 | draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x,y-512 | |
| 397 | draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y-512 | |
| 398 | 398 | |
| 399 | 399 | // wrap around x and y |
| 400 | draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x-512,y-512 | |
| 400 | draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x-512,y-512 | |
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 |
| r5077 | r5078 | |
|---|---|---|
| 157 | 157 | if( calorie_sprites[x+1] & 0x10 ) |
| 158 | 158 | { |
| 159 | 159 | /* 32x32 sprites */ |
| 160 | drawgfx(bitmap,screen->machine->gfx[3],tileno | 0x40,color,flipx,flipy,xpos,ypos - 31 | |
| 160 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3],tileno | 0x40,color,flipx,flipy,xpos,ypos - 31 | |
| 161 | 161 | } |
| 162 | 162 | else |
| 163 | 163 | { |
| 164 | 164 | /* 16x16 sprites */ |
| 165 | drawgfx(bitmap,screen->machine->gfx[2],tileno,color,flipx,flipy,xpos,ypos - 15 | |
| 165 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],tileno,color,flipx,flipy,xpos,ypos - 15 | |
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 81 | 81 | ex = xflip ? (spr_size-1-x) : x; |
| 82 | 82 | ey = yflip ? (spr_size-1-y) : y; |
| 83 | 83 | |
| 84 | drawgfx(bitmap,gfx,number + x_offset[ex] + y_offset[ey], | |
| 84 | drawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey], | |
| 85 | 85 | 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); | |
| 88 | 87 | } |
| 89 | 88 | } |
| 90 | 89 | } |
| r5077 | r5078 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | static ADDRESS_MAP_START( sexyboom_io_map, ADDRESS_SPACE_IO, 8 ) |
| 95 | 95 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 96 | AM_RANGE( 0x7c, 0x7d) AM_DEVWRITE( "ym", ym2413_w ) | |
| 96 | 97 | AM_RANGE( 0xa0, 0xa0) AM_READ_PORT("P1") |
| 97 | 98 | 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 ) | |
| 106 | 101 | AM_RANGE( 0xf2, 0xf2) AM_WRITE( v9938_0_palette_w ) |
| 107 | 102 | AM_RANGE( 0xf3, 0xf3) AM_WRITE( v9938_0_register_w ) |
| 103 | AM_RANGE( 0xf7, 0xf7) AM_READ_PORT("DSW") | |
| 108 | 104 | //bank f8-ff ??? |
| 109 | 105 | ADDRESS_MAP_END |
| 110 | 106 |
| r5077 | r5078 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | ============================================================================ |
| 17 | 17 | |
| 18 | Skeleton driver, the main issue is to decrypt/identify the main CPU. | |
| 19 | ADPCM & remaining ROM space is pretty much identical to Jantotsu, maybe | |
| 20 | there's a correlation? Or the dump is bad/missing something? | |
| 18 | Skeleton driver, just the main CPU was identified (TMS9900). Can't get it | |
| 19 | to upload a vram / blitter list at all :-/ | |
| 20 | Many thanks to Olivier Galibert and Wilbert Pol for the identify effort ;-) | |
| 21 | 21 | |
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/ | |
| 25 | #include "cpu/tms9900/tms9900.h" | |
| 26 | 26 | #include "sound/msm5205.h" |
| 27 | 27 | |
| 28 | 28 | static VIDEO_START( pachifev ) |
| r5077 | r5078 | |
| 35 | 35 | return 0; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | static ADDRESS_MAP_START( pachifev_map, ADDRESS_SPACE_PROGRAM, | |
| 38 | static ADDRESS_MAP_START( pachifev_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 39 | 39 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 40 | AM_RANGE(0xe000, 0xffff) AM_RAM | |
| 40 | 41 | ADDRESS_MAP_END |
| 41 | 42 | |
| 42 | 43 | static 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() | |
| 44 | 46 | ADDRESS_MAP_END |
| 45 | 47 | |
| 46 | 48 | |
| r5077 | r5078 | |
| 87 | 89 | adpcm_pos = 0; |
| 88 | 90 | } |
| 89 | 91 | |
| 92 | static INTERRUPT_GEN( pachifev_vblank_irq ) | |
| 93 | { | |
| 94 | } | |
| 95 | ||
| 90 | 96 | static MACHINE_DRIVER_START( pachifev ) |
| 91 | 97 | |
| 92 | 98 | /* basic machine hardware */ |
| 93 | MDRV_CPU_ADD("maincpu", | |
| 99 | MDRV_CPU_ADD("maincpu", TMS9900, 12000000/4) /* unknown divider */ | |
| 94 | 100 | MDRV_CPU_PROGRAM_MAP(pachifev_map) |
| 95 | 101 | 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) | |
| 98 | 103 | |
| 99 | 104 | /* video hardware */ |
| 100 | 105 | MDRV_SCREEN_ADD("screen", RASTER) |
| r5077 | r5078 | |
| 123 | 128 | ***************************************************************************/ |
| 124 | 129 | |
| 125 | 130 | ROM_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) ) | |
| 133 | 138 | |
| 134 | 139 | ROM_REGION( 0x4000, "adpcm", 0 ) //msm code |
| 135 | 140 | ROM_LOAD( "ic66.10", 0x0000, 0x2000, CRC(217c573e) SHA1(6fb90865d1d81f5ea00fa7916d0ccb6756ef5ce5) ) |
| 136 | 141 | ROM_END |
| 137 | 142 | |
| 138 | GAME( 1983, pachifev, 0, pachifev, pachifev, 0, ROT0, "Sanki Denshi Kogyo", "Pachi Fever", GAME_NOT_WORKING ) | |
| 143 | static DRIVER_INIT( pachifev ) | |
| 144 | { | |
| 145 | } | |
| 146 | ||
| 147 | GAME( 1983, pachifev, 0, pachifev, pachifev, pachifev, ROT0, "Sanki Denshi Kogyo", "Pachi Fever", GAME_NOT_WORKING ) |
| r5077 | r5078 | |
|---|---|---|
| 144 | 144 | tile = (vga_vram[offs] & 0x00ff0000)>>16; |
| 145 | 145 | color = (vga_vram[offs] & 0xff000000)>>24; |
| 146 | 146 | |
| 147 | drawgfx(bitmap,machine->gfx[gfx_num], | |
| 147 | drawgfx_opaque(bitmap,cliprect,machine->gfx[gfx_num], | |
| 148 | 148 | tile, |
| 149 | 149 | color, |
| 150 | 150 | 0,0, |
| 151 | (x+1)*8,y*8, | |
| 152 | cliprect,TRANSPARENCY_NONE,0); | |
| 151 | (x+1)*8,y*8); | |
| 153 | 152 | |
| 154 | 153 | |
| 155 | 154 | tile = (vga_vram[offs] & 0x000000ff); |
| 156 | 155 | color = (vga_vram[offs] & 0x0000ff00)>>8; |
| 157 | 156 | |
| 158 | drawgfx(bitmap,machine->gfx[gfx_num], | |
| 157 | drawgfx_opaque(bitmap,cliprect,machine->gfx[gfx_num], | |
| 159 | 158 | tile, |
| 160 | 159 | color, |
| 161 | 160 | 0,0, |
| 162 | (x+0)*8,y*8, | |
| 163 | cliprect,TRANSPARENCY_NONE,0); | |
| 161 | (x+0)*8,y*8); | |
| 164 | 162 | |
| 165 | 163 | offs++; |
| 166 | 164 | } |
| r5077 | r5078 | |
|---|---|---|
| 240 | 240 | { |
| 241 | 241 | for (ytiles = 0; ytiles < ytlim; ytiles++) |
| 242 | 242 | { |
| 243 | drawgfx( | |
| 243 | drawgfx_transpen( | |
| 244 | 244 | bitmap, |
| 245 | cliprect, | |
| 245 | 246 | gfx, |
| 246 | 247 | tile_number, |
| 247 | 248 | colr, |
| 248 | 249 | yflip,xflip, |
| 249 | sx+xstep*xtiles,sy+ystep*ytiles, | |
| 250 | cliprect, | |
| 251 | TRANSPARENCY_PEN,15); | |
| 250 | sx+xstep*xtiles,sy+ystep*ytiles,15); | |
| 252 | 251 | |
| 253 | 252 | tile_number++; |
| 254 | 253 | } |
| r5077 | r5078 | |
|---|---|---|
| 1293 | 1293 | cpu_set_input_line(device, 6, HOLD_LINE); |
| 1294 | 1294 | } |
| 1295 | 1295 | |
| 1296 | static const hc11_config taitojc_config = | |
| 1297 | { | |
| 1298 | 1, //has internal I/O | |
| 1299 | 1280 //internal RAM size | |
| 1300 | }; | |
| 1301 | ||
| 1302 | ||
| 1296 | 1303 | static MACHINE_DRIVER_START( taitojc ) |
| 1297 | 1304 | MDRV_CPU_ADD("maincpu", M68040, 25000000) |
| 1298 | 1305 | MDRV_CPU_PROGRAM_MAP(taitojc_map) |
| r5077 | r5078 | |
| 1301 | 1308 | |
| 1302 | 1309 | TAITO_F3_SOUND_SYSTEM_CPU(16000000) |
| 1303 | 1310 | |
| 1304 | MDRV_CPU_ADD("sub", MC68HC11, 4000000) | |
| 1311 | MDRV_CPU_ADD("sub", MC68HC11, 4000000) //MC68HC11M0 | |
| 1305 | 1312 | MDRV_CPU_PROGRAM_MAP(hc11_pgm_map) |
| 1306 | 1313 | MDRV_CPU_IO_MAP(hc11_io_map) |
| 1314 | MDRV_CPU_CONFIG(taitojc_config) | |
| 1307 | 1315 | |
| 1308 | 1316 | MDRV_CPU_ADD("dsp", TMS32051, 50000000) |
| 1309 | 1317 | MDRV_CPU_PROGRAM_MAP(tms_program_map) |
| r5077 | r5078 | |
|---|---|---|
| 175 | 175 | UINT16 tile = (src[count]&0x0fff); |
| 176 | 176 | UINT16 colr = (src[count]&0xf000)>>12; |
| 177 | 177 | count++; |
| 178 | drawgfx(bitmap,gfx,tile,colr,0,flipy,(x*16)-sx,(y*16)-sy | |
| 178 | drawgfx_transpen(bitmap,cliprect,gfx,tile,colr,0,flipy,(x*16)-sx,(y*16)-sy | |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | count = 0; |
| r5077 | r5078 | |
| 188 | 188 | UINT16 tile = (src[count]&0x0fff); |
| 189 | 189 | UINT16 colr = (src[count]&0xf000)>>12; |
| 190 | 190 | count++; |
| 191 | drawgfx(bitmap,gfx,tile,colr,0,flipy,(x*16)-sx,(y*16)-sy | |
| 191 | drawgfx_transpen(bitmap,cliprect,gfx,tile,colr,0,flipy,(x*16)-sx,(y*16)-sy | |
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | } |
| r5077 | r5078 | |
| 207 | 207 | UINT16 tile = (src[count]&0x0fff); |
| 208 | 208 | UINT16 colr = (src[count]&0xf000)>>12; |
| 209 | 209 | count++; |
| 210 | drawgfx(bitmap,gfx,tile,colr,flipy,flipy,(x*16)+sx,(y*16)+sy | |
| 210 | drawgfx_transpen(bitmap,cliprect,gfx,tile,colr,flipy,flipy,(x*16)+sx,(y*16)+sy | |
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | count = 0; |
| r5077 | r5078 | |
| 220 | 220 | UINT16 tile = (src[count]&0x0fff); |
| 221 | 221 | UINT16 colr = (src[count]&0xf000)>>12; |
| 222 | 222 | count++; |
| 223 | drawgfx(bitmap,gfx,tile,colr,flipy,flipy,(x*16)+sx,(y*16)+sy | |
| 223 | drawgfx_transpen(bitmap,cliprect,gfx,tile,colr,flipy,flipy,(x*16)+sx,(y*16)+sy | |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | } |
| r5077 | r5078 | |
|---|---|---|
| 322 | 322 | flipy = !flipy; |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | drawgfx(bitmap,machine->gfx[2], | |
| 325 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 326 | 326 | code, |
| 327 | 327 | 0, |
| 328 | 328 | flipx,flipy, |
| 329 | sx,sy, | |
| 330 | cliprect,TRANSPARENCY_PEN,0); | |
| 329 | sx,sy,0); | |
| 331 | 330 | } |
| 332 | 331 | } |
| 333 | 332 |
| r5077 | r5078 | |
|---|---|---|
| 468 | 468 | tilemap_draw(tile, cliprect, tx_tilemap, 0, 0); |
| 469 | 469 | |
| 470 | 470 | bitmap_fill(obj1, NULL, 0); |
| 471 | drawgfx(obj1, screen->machine->gfx[1], | |
| 471 | drawgfx_transpen(obj1, NULL, screen->machine->gfx[1], | |
| 472 | 472 | OBJ_CODE(marinedt_obj1_a), |
| 473 | 473 | OBJ_COLOR(marinedt_obj1_a), |
| 474 | 474 | OBJ_FLIPX(marinedt_obj1_a), OBJ_FLIPY(marinedt_obj1_a), |
| 475 | 0, 0, | |
| 476 | NULL, TRANSPARENCY_PEN, 0); | |
| 475 | 0, 0, 0); | |
| 477 | 476 | |
| 478 | 477 | bitmap_fill(obj2, NULL, 0); |
| 479 | drawgfx(obj2, screen->machine->gfx[2], | |
| 478 | drawgfx_transpen(obj2, NULL, screen->machine->gfx[2], | |
| 480 | 479 | OBJ_CODE(marinedt_obj2_a), |
| 481 | 480 | OBJ_COLOR(marinedt_obj2_a), |
| 482 | 481 | OBJ_FLIPX(marinedt_obj2_a), OBJ_FLIPY(marinedt_obj2_a), |
| 483 | 0, 0, | |
| 484 | NULL, TRANSPARENCY_PEN, 0); | |
| 482 | 0, 0, 0); | |
| 485 | 483 | |
| 486 | 484 | bitmap_fill(bitmap, NULL, 0); |
| 487 | 485 |
| r5077 | r5078 | |
|---|---|---|
| 380 | 380 | #define CPS3_TRANSPARENCY_PEN_INDEX 2 |
| 381 | 381 | #define CPS3_TRANSPARENCY_PEN_INDEX_BLEND 3 |
| 382 | 382 | |
| 383 | INLINE void cps3_drawgfxzoom( | |
| 383 | INLINE void cps3_drawgfxzoom( | |
| 384 | 384 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 385 | | |
| 385 | | |
| 386 | 386 | int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask) |
| 387 | 387 | { |
| 388 | 388 | rectangle myclip; |
| r5077 | r5078 | |
| 581 | 581 | if (c&0x02) dest[x] |= 0x4000; |
| 582 | 582 | if (c&0x04) dest[x] |= 0x8000; |
| 583 | 583 | 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? | |
| 585 | 585 | } |
| 586 | 586 | else |
| 587 | 587 | { |
| r5077 | r5078 | |
| 912 | 912 | if (!bpp) machine->gfx[1]->color_granularity=256; |
| 913 | 913 | else machine->gfx[1]->color_granularity=64; |
| 914 | 914 | |
| 915 | cps3_drawgfxzoom( | |
| 915 | cps3_drawgfxzoom( | |
| 916 | 916 | } |
| 917 | 917 | } |
| 918 | 918 | } |
| r5077 | r5078 | |
| 1155 | 1155 | |
| 1156 | 1156 | if (global_alpha || alpha) |
| 1157 | 1157 | { |
| 1158 | cps3_drawgfxzoom( | |
| 1158 | cps3_drawgfxzoom( | |
| 1159 | 1159 | } |
| 1160 | 1160 | else |
| 1161 | 1161 | { |
| 1162 | cps3_drawgfxzoom( | |
| 1162 | cps3_drawgfxzoom( | |
| 1163 | 1163 | } |
| 1164 | 1164 | count++; |
| 1165 | 1165 | } |
| r5077 | r5078 | |
| 1225 | 1225 | pal += cps3_ss_pal_base << 5; |
| 1226 | 1226 | tile+=0x200; |
| 1227 | 1227 | |
| 1228 | cps3_drawgfxzoom( | |
| 1228 | cps3_drawgfxzoom( | |
| 1229 | 1229 | count++; |
| 1230 | 1230 | } |
| 1231 | 1231 | } |
| r5077 | r5078 | |
|---|---|---|
| 1 | 1 | /* Taito Midnight Landing |
| 2 | 2 | Dual 68k + 2xZ80 |
| 3 | 3 | 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; | |
| 4 | 11 | */ |
| 5 | 12 | |
| 6 | 13 | #include "driver.h" |
| r5077 | r5078 | |
| 58 | 65 | other bits = language(german, japan, english), video test |
| 59 | 66 | */ |
| 60 | 67 | |
| 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; | |
| 65 | 71 | } |
| 66 | 72 | |
| 67 | 73 | static WRITE16_HANDLER(ml_subreset_w) |
| r5077 | r5078 | |
| 108 | 114 | adpcm_pos &= 0xff00; |
| 109 | 115 | } |
| 110 | 116 | |
| 117 | /* TODO: check this */ | |
| 118 | static WRITE16_HANDLER( sound_reset_w ) | |
| 119 | { | |
| 120 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE); | |
| 121 | } | |
| 122 | ||
| 111 | 123 | static ADDRESS_MAP_START( mlanding_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 112 | 124 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 113 | 125 | AM_RANGE(0x080000, 0x08ffff) AM_RAM |
| r5077 | r5078 | |
| 119 | 131 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE(1) |
| 120 | 132 | |
| 121 | 133 | AM_RANGE(0x1d0000, 0x1d0001) AM_WRITENOP |
| 122 | AM_RANGE(0x1d0002, 0x1d0003) AM_ | |
| 134 | AM_RANGE(0x1d0002, 0x1d0003) AM_WRITE(sound_reset_w) //sound reset ?? | |
| 123 | 135 | |
| 124 | 136 | 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) | |
| 126 | 139 | |
| 127 | 140 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)//AM_SHARE(2) |
| 128 | 141 | AM_RANGE(0x280000, 0x2807ff) AM_RAM // is it shared with mecha ? tested around $940 |
| r5077 | r5078 | |
| 134 | 147 | AM_RANGE(0x240006, 0x240007) AM_READ(io1_r) // vblank ? |
| 135 | 148 | AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(ml_subreset_w) |
| 136 | 149 | |
| 150 | /* are we sure that these are for an analog stick? */ | |
| 137 | 151 | AM_RANGE(0x2b0000, 0x2b0001) AM_READ_PORT("STICKX") //-40 .. 40 analog controls ? |
| 138 | 152 | AM_RANGE(0x2b0004, 0x2b0005) AM_READ_PORT("STICKY") //-40 .. 40 analog controls ? |
| 153 | AM_RANGE(0x2b0006, 0x2b0007) AM_READNOP // tested in service mode, dips? | |
| 139 | 154 | AM_RANGE(0x2c0000, 0x2c0001) AM_READ_PORT("STICKZ") //-60 .. 60 analog controls ? |
| 140 | 155 | AM_RANGE(0x2c0002, 0x2c0003) AM_READ_PORT("IN3") |
| 141 | 156 | AM_RANGE(0x2b0002, 0x2b0003) AM_READ_PORT("IN2") // IN2/IN3 could be switched |
| r5077 | r5078 | |
| 155 | 170 | |
| 156 | 171 | static ADDRESS_MAP_START( mlanding_z80_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 157 | 172 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 158 | AM_RANGE(0x4000, 0x7fff) AM_R | |
| 173 | AM_RANGE(0x4000, 0x7fff) AM_RO | |
| 159 | 174 | 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) | |
| 162 | 176 | AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w) |
| 163 | 177 | AM_RANGE(0xa001, 0xa001) AM_READ(taitosound_slave_comm_r) AM_WRITE(taitosound_slave_comm_w) |
| 164 | 178 | |
| r5077 | r5078 | |
| 226 | 240 | //test |
| 227 | 241 | if(code) |
| 228 | 242 | { |
| 229 | drawgfx(ml_bitmap[num],screen->machine->gfx[0], | |
| 243 | drawgfx_opaque(ml_bitmap[num],cliprect,screen->machine->gfx[0], | |
| 230 | 244 | code++, |
| 231 | 245 | color, |
| 232 | 246 | 0,0, |
| 233 | x+j*8,y+k*8, | |
| 234 | cliprect,TRANSPARENCY_NONE,0); | |
| 247 | x+j*8,y+k*8); | |
| 235 | 248 | } |
| 236 | 249 | else |
| 237 | 250 | { |
| r5077 | r5078 | |
| 254 | 267 | copybitmap_trans(bitmap,ml_bitmap[i], 0, 0, 0, 0, cliprect, 0); |
| 255 | 268 | } |
| 256 | 269 | } |
| 257 | status_bit=0; | |
| 270 | status_bit=0; //FIXME: emulation variable in VIDEO_UPDATE() | |
| 258 | 271 | { |
| 259 | 272 | /* int i; |
| 260 | 273 | for(i=0;i<0x8000;i++) |
| r5077 | r5078 | |
| 269 | 282 | |
| 270 | 283 | static INPUT_PORTS_START( mlanding ) |
| 271 | 284 | 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 ) ) | |
| 274 | 301 | |
| 275 | 302 | 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 ) ) | |
| 278 | 323 | |
| 279 | 324 | 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 ) ) | |
| 288 | 343 | |
| 289 | 344 | 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 ) ) | |
| 304 | 363 | |
| 305 | 364 | PORT_START("STICKX") /* Stick 1 (3) */ |
| 306 | 365 | PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0xffd8,0x28) PORT_SENSITIVITY(30) PORT_KEYDELTA(1) PORT_PLAYER(1) |
| r5077 | r5078 | |
| 358 | 417 | MDRV_CPU_PROGRAM_MAP(mlanding_z80_sub_mem) |
| 359 | 418 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 360 | 419 | |
| 420 | MDRV_QUANTUM_TIME(HZ(600)) | |
| 421 | ||
| 361 | 422 | /* video hardware */ |
| 362 | 423 | MDRV_SCREEN_ADD("screen", RASTER) |
| 363 | 424 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| r5077 | r5078 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | if(sx|sy) |
| 160 | 160 | { |
| 161 | drawgfx(bitmap, screen->machine->gfx[2], | |
| 161 | drawgfx_transpen(bitmap, cliprect,screen->machine->gfx[2], | |
| 162 | 162 | spriteram[offs+1] & 0x3f , |
| 163 | 163 | (spriteram[offs+2] & 0x1f), |
| 164 | 164 | flipx, flipy, |
| 165 | sx,sy, | |
| 166 | cliprect,TRANSPARENCY_PEN,0); | |
| 165 | sx,sy,0); | |
| 167 | 166 | } |
| 168 | 167 | } |
| 169 | 168 | tilemap_draw(bitmap,cliprect,pturn_fgmap,0,0); |
| r5077 | r5078 | |
|---|---|---|
| 524 | 524 | colattr = tiledat >>12; |
| 525 | 525 | tiledat &= 0x0fff; |
| 526 | 526 | |
| 527 | drawgfx(bitmap,screen->machine->gfx[gfxregion],tiledat,colattr,0,0,x*8,y*8 | |
| 527 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfxregion],tiledat,colattr,0,0,x*8,y*8 | |
| 528 | 528 | |
| 529 | 529 | count++; |
| 530 | 530 | } |
| r5077 | r5078 | |
| 1625 | 1625 | { |
| 1626 | 1626 | int tile = dealem_videoram[count + 0x1000] | (dealem_videoram[count] << 8); |
| 1627 | 1627 | count++; |
| 1628 | drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x * 8,y * 8 | |
| 1628 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x * 8,y * 8 | |
| 1629 | 1629 | } |
| 1630 | 1630 | } |
| 1631 | 1631 |
| r5077 | r5078 | |
|---|---|---|
| 1 | 1 | /* Cubo CD32 (Original hardware by Commodore, additional hardware and games by CD Express, Milan, Italy) |
| 2 | 2 | |
| 3 | | |
| 3 | D | |
| 4 | 4 | CD-ROM controller by Ernesto Corvi |
| 5 | Inputs by Stephane Humbert | |
| 5 | 6 | |
| 6 | 7 | This is basically a CD32 (Amiga 68020, AGA based games system) hacked up to run arcade games. |
| 7 | 8 | see http://ninjaw.ifrance.com/cd32/cubo/ for a brief overview. |
| r5077 | r5078 | |
| 23 | 24 | * Gamepad, Serial port, 2 Gameports, Interfaces for keyboard |
| 24 | 25 | |
| 25 | 26 | |
| 26 | ToDo: | |
| 27 | Inputs | |
| 28 | 27 | |
| 29 | ||
| 30 | 28 | Known Games: |
| 31 | 29 | Title | rev. | year |
| 32 | 30 | ---------------------------------------------- |
| r5077 | r5078 | |
| 41 | 39 | Odeon Twister 2 |202.19| 1999 |
| 42 | 40 | |
| 43 | 41 | |
| 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 | ||
| 51 | settings (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 | ||
| 66 | useful 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 | ||
| 83 | routines : | |
| 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 | ||
| 96 | settings (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 | ||
| 105 | useful 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 | ||
| 123 | routines : | |
| 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 | ||
| 135 | settings (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 | ||
| 147 | useful 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 | ||
| 159 | routines : | |
| 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 | ||
| 44 | 175 | */ |
| 45 | 176 | |
| 46 | 177 | #include "driver.h" |
| r5077 | r5078 | |
| 138 | 269 | AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION("user1", 0x0) /* Kickstart */ |
| 139 | 270 | ADDRESS_MAP_END |
| 140 | 271 | |
| 141 | //int cubo_input_port_val = 0; | |
| 142 | //int cubo_input_select = 0; | |
| 272 | /************************************* | |
| 273 | * | |
| 274 | * Inputs | |
| 275 | * | |
| 276 | *************************************/ | |
| 277 | ||
| 143 | 278 | static UINT16 potgo_value = 0; |
| 144 | 279 | static int cd32_shifter[2]; |
| 280 | static void (*cubocd32_input_hack)(running_machine *machine) = 0; | |
| 145 | 281 | |
| 146 | 282 | static void cubocd32_potgo_w(running_machine *machine, UINT16 data) |
| 147 | 283 | { |
| 148 | 284 | int i; |
| 149 | 285 | |
| 286 | if (cubocd32_input_hack != NULL) | |
| 287 | cubocd32_input_hack(machine); | |
| 288 | ||
| 150 | 289 | potgo_value = potgo_value & 0x5500; |
| 151 | 290 | potgo_value |= data & 0xaa00; |
| 152 | 291 | |
| r5077 | r5078 | |
| 165 | 304 | UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */ |
| 166 | 305 | UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */ |
| 167 | 306 | if ((potgo_value & p5dir) && (potgo_value & p5dat)) |
| 168 | cd32_shifter[i] = 8; | |
| 307 | cd32_shifter[i] = 8; | |
| 169 | 308 | } |
| 170 | ||
| 171 | 309 | } |
| 172 | 310 | |
| 173 | 311 | static void handle_cd32_joystick_cia(UINT8 pra, UINT8 dra) |
| r5077 | r5078 | |
| 180 | 318 | UINT8 but = 0x40 << i; |
| 181 | 319 | UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */ |
| 182 | 320 | UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */ |
| 321 | ||
| 183 | 322 | if (!(potgo_value & p5dir) || !(potgo_value & p5dat)) |
| 184 | 323 | { |
| 185 | 324 | if ((dra & but) && (pra & but) != oldstate[i]) |
| r5077 | r5078 | |
| 198 | 337 | |
| 199 | 338 | static UINT16 handle_joystick_potgor (running_machine *machine, UINT16 potgor) |
| 200 | 339 | { |
| 340 | static const char *const player_portname[] = { "P2", "P1" }; | |
| 201 | 341 | int i; |
| 202 | 342 | |
| 203 | 343 | for (i = 0; i < 2; i++) |
| r5077 | r5078 | |
| 218 | 358 | /* shift at 1 == return one, >1 = return button states */ |
| 219 | 359 | if (cd32_shifter[i] == 0) |
| 220 | 360 | 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; | |
| 224 | 363 | } |
| 225 | 364 | return potgor; |
| 226 | 365 | } |
| r5077 | r5078 | |
| 233 | 372 | |
| 234 | 373 | static INPUT_PORTS_START( cd32 ) |
| 235 | 374 | 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 ) | |
| 239 | 376 | |
| 240 | 377 | 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 ) | |
| 243 | 379 | |
| 244 | 380 | PORT_START("JOY0DAT") |
| 245 | PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P | |
| 381 | PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P2JOY") | |
| 246 | 382 | PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 247 | 383 | |
| 248 | 384 | PORT_START("JOY1DAT") |
| 249 | PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P | |
| 385 | PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P1JOY") | |
| 250 | 386 | PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 251 | 387 | |
| 252 | 388 | 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 ) | |
| 255 | 391 | |
| 256 | 392 | 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) | |
| 260 | 396 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) |
| 261 | 397 | |
| 262 | 398 | 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) | |
| 266 | 402 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 267 | 403 | |
| 268 | PORT_START("COINS") | |
| 269 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 270 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 271 | ||
| 272 | 404 | PORT_START("DIPSW1") |
| 273 | 405 | PORT_DIPNAME( 0x01, 0x01, "DSW1 1" ) |
| 274 | 406 | PORT_DIPSETTING( 0x01, "Reset" ) |
| r5077 | r5078 | |
| 293 | 425 | PORT_DIPSETTING( 0x80, "Reset" ) |
| 294 | 426 | PORT_DIPSETTING( 0x00, "Set" ) |
| 295 | 427 | |
| 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) | |
| 306 | 437 | |
| 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 | ||
| 307 | 448 | INPUT_PORTS_END |
| 308 | 449 | |
| 450 | static 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 | ||
| 473 | INPUT_PORTS_END | |
| 474 | ||
| 475 | static 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 | ||
| 498 | INPUT_PORTS_END | |
| 499 | ||
| 500 | static 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 | ||
| 529 | INPUT_PORTS_END | |
| 309 | 530 | /************************************* |
| 310 | 531 | * |
| 311 | 532 | * Sound definitions |
| r5077 | r5078 | |
| 463 | 684 | |
| 464 | 685 | /* intialize akiko */ |
| 465 | 686 | amiga_akiko_init(machine); |
| 687 | ||
| 688 | /* input hack */ | |
| 689 | cubocd32_input_hack = NULL; | |
| 466 | 690 | } |
| 467 | 691 | |
| 692 | static 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 | ||
| 698 | static DRIVER_INIT(haremchl) | |
| 699 | { | |
| 700 | DRIVER_INIT_CALL(cd32); | |
| 701 | cubocd32_input_hack = haremchl_input_hack; | |
| 702 | } | |
| 703 | ||
| 704 | static 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 | ||
| 710 | static DRIVER_INIT(cndypuzl) | |
| 711 | { | |
| 712 | DRIVER_INIT_CALL(cd32); | |
| 713 | cubocd32_input_hack = cndypuzl_input_hack; | |
| 714 | } | |
| 715 | ||
| 716 | static 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 | ||
| 722 | static DRIVER_INIT(lasstixx) | |
| 723 | { | |
| 724 | DRIVER_INIT_CALL(cd32); | |
| 725 | cubocd32_input_hack = lasstixx_input_hack; | |
| 726 | } | |
| 727 | ||
| 468 | 728 | /***************************************************************************************************/ |
| 469 | 729 | |
| 470 | 730 | /* BIOS */ |
| 471 | 731 | GAME( 1993, cd32, 0, cd32, cd32, cd32, ROT0, "Commodore", "Amiga CD32 Bios", GAME_IS_BIOS_ROOT ) |
| 472 | 732 | |
| 473 | GAME( 1995, cndypuzl, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Candy Puzzle (v1.0)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 474 | GAME( 1995, haremchl, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Harem Challenge", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 475 | GAME( 1995, lsrquiz, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Laser Quiz", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 476 | GAME( 1995, lsrquiz2, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Laser Quiz '2' Italy (v1.0)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 477 | GAME( 1996, mgprem11, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Magic Premium (v1.1)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 478 | GAME( 1995, lasstixx, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Laser Strixx", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 479 | GAME( 1995, mgnumber, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Magic Number", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 733 | GAME( 1995, cndypuzl, cd32, cd32, cndypuzl, cndypuzl, ROT0, "CD Express", "Candy Puzzle (v1.0)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) | |
| 734 | GAME( 1995, haremchl, cd32, cd32, haremchl, haremchl, ROT0, "CD Express", "Harem Challenge", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) | |
| 735 | GAME( 1995, lsrquiz, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Laser Quiz Italy", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 736 | GAME( 1995, lsrquiz2, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Laser Quiz 2 Italy (v1.0)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 737 | GAME( 1996, mgprem11, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Magic Premium (v1.1)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 738 | GAME( 1995, lasstixx, cd32, cd32, lasstixx, lasstixx, ROT0, "CD Express", "Laser Strixx 2", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 739 | GAME( 1995, mgnumber, cd32, cd32, cd32, cd32, ROT0, "CD Express", "Magic Number", GAME_NOT_WORKING|GAME_NO_SOUND ) |
| r5077 | r5078 | |
|---|---|---|
| 92 | 92 | { |
| 93 | 93 | int tile = videoram[count]; |
| 94 | 94 | |
| 95 | drawgfx(bitmap,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8 | |
| 95 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8 | |
| 96 | 96 | /* wrap-around */ |
| 97 | drawgfx(bitmap,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8 | |
| 97 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8 | |
| 98 | 98 | |
| 99 | 99 | count++; |
| 100 | 100 | } |
| r5077 | r5078 | |
|---|---|---|
| 429 | 429 | code = spriteram16[offs+2]; |
| 430 | 430 | color = (spriteram16[offs+1] & 0xf000) >> 12; |
| 431 | 431 | |
| 432 | drawgfx(bitmap,machine->gfx[0], | |
| 432 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 433 | 433 | code, |
| 434 | 434 | color, |
| 435 | 435 | flipx,0, |
| 436 | sx + xoffset,sy + yoffset, | |
| 437 | cliprect,TRANSPARENCY_PEN,0); | |
| 436 | sx + xoffset,sy + yoffset,0); | |
| 438 | 437 | } |
| 439 | 438 | } |
| 440 | 439 |
| r5077 | r5078 | |
|---|---|---|
| 72 | 72 | for (y=0;y<32;y++) |
| 73 | 73 | { |
| 74 | 74 | UINT16 tile = (blackt96_tilemapram2[count*2 + (0x2000/2)+1]); |
| 75 | drawgfx(bitmap,gfxbg,tile,6,0,0,x*16,y*16 | |
| 75 | drawgfx_opaque(bitmap,cliprect,gfxbg,tile,6,0,0,x*16,y*16 | |
| 76 | 76 | count++; |
| 77 | 77 | } |
| 78 | 78 | } |
| r5077 | r5078 | |
| 88 | 88 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); |
| 89 | 89 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; |
| 90 | 90 | |
| 91 | drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 91 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 92 | 92 | count++; |
| 93 | 93 | } |
| 94 | 94 | } |
| r5077 | r5078 | |
| 102 | 102 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); |
| 103 | 103 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; |
| 104 | 104 | |
| 105 | drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 105 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 106 | 106 | count++; |
| 107 | 107 | } |
| 108 | 108 | } |
| r5077 | r5078 | |
| 116 | 116 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); |
| 117 | 117 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; |
| 118 | 118 | |
| 119 | drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 119 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 120 | 120 | count++; |
| 121 | 121 | } |
| 122 | 122 | } |
| r5077 | r5078 | |
| 130 | 130 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); |
| 131 | 131 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; |
| 132 | 132 | |
| 133 | drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 133 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 134 | 134 | count++; |
| 135 | 135 | } |
| 136 | 136 | } |
| r5077 | r5078 | |
| 143 | 143 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); |
| 144 | 144 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; |
| 145 | 145 | |
| 146 | drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 146 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 147 | 147 | count++; |
| 148 | 148 | } |
| 149 | 149 | } |
| r5077 | r5078 | |
| 156 | 156 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); |
| 157 | 157 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; |
| 158 | 158 | |
| 159 | drawgfx(bitmap,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 159 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16 | |
| 160 | 160 | count++; |
| 161 | 161 | } |
| 162 | 162 | } |
| r5077 | r5078 | |
| 168 | 168 | for (y=0;y<32;y++) |
| 169 | 169 | { |
| 170 | 170 | UINT16 tile = (blackt96_tilemapram[count*2]&0x7ff)+0x800; // +0xc00 for korean text |
| 171 | drawgfx(bitmap,gfx,tile,0,0,0,x*8,y*8 | |
| 171 | drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8 | |
| 172 | 172 | count++; |
| 173 | 173 | } |
| 174 | 174 |
| r5077 | r5078 | |
|---|---|---|
| 77 | 77 | bitmap_fill(bitmap, cliprect, 0); |
| 78 | 78 | |
| 79 | 79 | |
| 80 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 80 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1], | |
| 81 | 81 | 0, |
| 82 | 82 | 0, |
| 83 | 83 | 0,0, |
| 84 | objpos[0],objpos[1], | |
| 85 | cliprect,TRANSPARENCY_NONE,0); | |
| 84 | objpos[0],objpos[1]); | |
| 86 | 85 | |
| 87 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 86 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[2], | |
| 88 | 87 | 0, |
| 89 | 88 | 0, |
| 90 | 89 | 0,0, |
| 91 | objpos[2],objpos[3], | |
| 92 | cliprect,TRANSPARENCY_NONE,0); | |
| 90 | objpos[2],objpos[3]); | |
| 93 | 91 | |
| 94 | drawgfx(bitmap,screen->machine->gfx[3], | |
| 92 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[3], | |
| 95 | 93 | 0, |
| 96 | 94 | 0, |
| 97 | 95 | 0,0, |
| 98 | objpos[4],objpos[5], | |
| 99 | cliprect,TRANSPARENCY_NONE,0); | |
| 96 | objpos[4],objpos[5]); | |
| 100 | 97 | |
| 101 | 98 | for (offs = 0; offs < 8; offs++) |
| 102 | 99 | { |
| 103 | drawgfx(bitmap,screen->machine->gfx[4], | |
| 100 | drawgfx_opaque(bitmap,/* ?? */ | |
| 101 | cliprect,screen->machine->gfx[4], | |
| 104 | 102 | offs, |
| 105 | 103 | 0, |
| 106 | 104 | 0,0, |
| 107 | 10*8+offs*16,256-16, /* ?? */ | |
| 108 | cliprect,TRANSPARENCY_NONE,0); | |
| 105 | 10*8+offs*16,256-16); | |
| 109 | 106 | } |
| 110 | 107 | return 0; |
| 111 | 108 | } |
| r5077 | r5078 | |
|---|---|---|
| 138 | 138 | { |
| 139 | 139 | for (xct=0;xct<xsize;xct++) |
| 140 | 140 | { |
| 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); | |
| 145 | 145 | |
| 146 | 146 | tileno++; |
| 147 | 147 | } |
| r5077 | r5078 | |
|---|---|---|
| 216 | 216 | |
| 217 | 217 | sprite = spriteram[offs+0]+(scrollram[0x0c]<<8); |
| 218 | 218 | |
| 219 | drawgfx(bitmap,machine->gfx[2], | |
| 219 | drawgfx_transmask(bitmap,cliprect,machine->gfx[2], | |
| 220 | 220 | sprite, |
| 221 | 221 | color,fx,fy,x,y, |
| 222 | cliprect,TRANSPARENCY_PENS, | |
| 223 | 222 | colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0)); |
| 224 | 223 | } |
| 225 | 224 | } |
| r5077 | r5078 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | int current_screen_character = (chary*32) + charx; |
| 66 | 66 | |
| 67 | drawgfx(bitmap, screen->machine->gfx[0], | |
| 67 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], | |
| 68 | 68 | tile_ram[current_screen_character], |
| 69 | 69 | (tile_control_ram[current_screen_character] & 0x0f), |
| 70 | 0, 0, charx*8, chary*8, | |
| 70 | 0, 0, charx*8, chary*8, | |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 |
| r5077 | r5078 | |
|---|---|---|
| 1070 | 1070 | AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, lupin3_sh_port_1_w) |
| 1071 | 1071 | AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w) |
| 1072 | 1072 | AM_RANGE(0x05, 0x05) AM_WRITE(lupin3_sh_port_2_w) |
| 1073 | AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w) | |
| 1073 | 1074 | ADDRESS_MAP_END |
| 1074 | 1075 | |
| 1075 | 1076 | |
| r5077 | r5078 | |
| 1077 | 1078 | PORT_INCLUDE( invrvnge ) |
| 1078 | 1079 | |
| 1079 | 1080 | 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 ) ) | |
| 1110 | INPUT_PORTS_END | |
| 1111 | ||
| 1112 | static INPUT_PORTS_START( lupin3a ) | |
| 1113 | PORT_INCLUDE( invrvnge ) | |
| 1114 | ||
| 1115 | PORT_MODIFY("IN0") | |
| 1080 | 1116 | //PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* selects color mode (dynamic vs. static) */ |
| 1081 | 1117 | //PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* something has to do with sound */ |
| 1082 | 1118 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) |
| r5077 | r5078 | |
| 1109 | 1145 | PORT_DIPNAME(0x80, 0x00, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW1:8") |
| 1110 | 1146 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1111 | 1147 | 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 ) | |
| 1116 | 1148 | INPUT_PORTS_END |
| 1117 | 1149 | |
| 1118 | 1150 | static MACHINE_DRIVER_START( lupin3 ) |
| r5077 | r5078 | |
| 1120 | 1152 | /* basic machine hardware */ |
| 1121 | 1153 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 1122 | 1154 | 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 | ||
| 1164 | MACHINE_DRIVER_END | |
| 1165 | ||
| 1166 | static MACHINE_DRIVER_START( lupin3a ) | |
| 1167 | ||
| 1168 | /* basic machine hardware */ | |
| 1169 | MDRV_IMPORT_FROM(mw8080bw_root) | |
| 1170 | MDRV_CPU_MODIFY("maincpu") | |
| 1123 | 1171 | MDRV_CPU_PROGRAM_MAP(schaser_map) |
| 1124 | 1172 | MDRV_CPU_IO_MAP(lupin3_io_map) |
| 1125 | 1173 | MDRV_MACHINE_START(extra_8080bw) |
| r5077 | r5078 | |
| 1564 | 1612 | /* */ |
| 1565 | 1613 | /*******************************************************/ |
| 1566 | 1614 | |
| 1615 | static WRITE8_HANDLER( steelwkr_sh_port_3_w ) | |
| 1616 | { | |
| 1617 | coin_lockout_global_w(!(~data & 0x03)); /* possibly */ | |
| 1618 | } | |
| 1619 | ||
| 1567 | 1620 | static 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) | |
| 1575 | 1627 | ADDRESS_MAP_END |
| 1576 | 1628 | |
| 1577 | 1629 | static 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 */ | |
| 1587 | 1631 | |
| 1588 | 1632 | PORT_START("IN1") |
| 1589 | 1633 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r5077 | r5078 | |
| 1596 | 1640 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1597 | 1641 | |
| 1598 | 1642 | PORT_START("IN2") |
| 1599 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) | |
| 1643 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) | |
| 1600 | 1644 | PORT_DIPSETTING( 0x00, "1" ) |
| 1601 | 1645 | PORT_DIPSETTING( 0x01, "2" ) |
| 1602 | 1646 | PORT_DIPSETTING( 0x02, "3" ) |
| 1603 | 1647 | PORT_DIPSETTING( 0x03, "4" ) |
| 1604 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 1648 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 1605 | 1649 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" ) |
| 1606 | 1650 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1607 | 1651 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) |
| r5077 | r5078 | |
| 1613 | 1657 | INPUT_PORTS_END |
| 1614 | 1658 | |
| 1615 | 1659 | |
| 1616 | /* same as regular invaders, but with a color board added */ | |
| 1617 | ||
| 1618 | 1660 | static MACHINE_DRIVER_START( steelwkr ) |
| 1619 | 1661 | |
| 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) | |
| 1625 | 1667 | |
| 1626 | 1668 | /* video hardware */ |
| 1627 | 1669 | MDRV_VIDEO_UPDATE(invadpt2) |
| 1628 | 1670 | |
| 1629 | ||
| 1671 | | |
| 1630 | 1672 | MDRV_IMPORT_FROM(invaders_samples_audio) |
| 1631 | 1673 | |
| 1632 | 1674 | MACHINE_DRIVER_END |
| r5077 | r5078 | |
| 2436 | 2478 | |
| 2437 | 2479 | ROM_START( lupin3 ) |
| 2438 | 2480 | 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) ) | |
| 2491 | ROM_END | |
| 2492 | ||
| 2493 | ROM_START( lupin3a ) | |
| 2494 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2439 | 2495 | ROM_LOAD( "lp12.bin", 0x0000, 0x0800, CRC(68a7f47a) SHA1(dce99b3810331d7603fa468f1dea984e571f709b) ) |
| 2440 | 2496 | ROM_LOAD( "lp13.bin", 0x0800, 0x0800, CRC(cae9a17b) SHA1(a333ba7db45325996e3254ab36162bb7577e8a38) ) |
| 2441 | 2497 | ROM_LOAD( "lp14.bin", 0x1000, 0x0800, CRC(3553b9e4) SHA1(6affb5b6caf08f365c0dce669e44046295c3df91) ) |
| r5077 | r5078 | |
| 2652 | 2708 | GAME( 1979, schaser, 0, schaser, schaser, 0, ROT270, "Taito", "Space Chaser", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_COLORS ) |
| 2653 | 2709 | GAME( 1979, schasrcv, schaser, schasrcv, schasrcv, 0, ROT270, "Taito", "Space Chaser (CV version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_COLORS ) |
| 2654 | 2710 | GAME( 1979, sflush, 0, sflush, sflush, 0, ROT270, "Taito", "Straight Flush",GAME_SUPPORTS_SAVE | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NO_COCKTAIL) |
| 2655 | GAME( 1980, lupin3, 0, lupin3, lupin3, 0, ROT270, "Taito", "Lupin III", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL ) | |
| 2711 | GAME( 1980, lupin3, 0, lupin3, lupin3, 0, ROT270, "Taito", "Lupin III (set 1)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) | |
| 2712 | GAME( 1980, lupin3a, lupin3, lupin3a, lupin3a, 0, ROT270, "Taito", "Lupin III (set 2)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) | |
| 2656 | 2713 | GAME( 1980, polaris, 0, polaris, polaris, 0, ROT270, "Taito", "Polaris (set 1)", GAME_SUPPORTS_SAVE ) |
| 2657 | 2714 | GAME( 1980, polarisa, polaris, polaris, polaris, 0, ROT270, "Taito", "Polaris (set 2)", GAME_SUPPORTS_SAVE ) |
| 2658 | 2715 | GAME( 1980, ballbomb, 0, ballbomb, ballbomb, 0, ROT270, "Taito", "Balloon Bomber", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) /* missing clouds */ |
| r5077 | r5078 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | while (multi >= 0) |
| 99 | 99 | { |
| 100 | drawgfx(bitmap,machine->gfx[2], | |
| 100 | drawgfx_transpen(bitmap,cliprect,machine->gfx[2], | |
| 101 | 101 | sprite - multi * inc, |
| 102 | 102 | colour, |
| 103 | 103 | fx,fy, |
| 104 | x,y + mult * multi, | |
| 105 | cliprect,TRANSPARENCY_PEN,0); | |
| 104 | x,y + mult * multi,0); | |
| 106 | 105 | |
| 107 | 106 | multi--; |
| 108 | 107 | } |
| r5077 | r5078 | |
|---|---|---|
| 208 | 208 | /* Global Column Coloring, GUESS! */ |
| 209 | 209 | color = col_line[(x*2)+1] ? (col_line[(x*2)+1]-1) & 0x7 : 0; |
| 210 | 210 | |
| 211 | drawgfx(bitmap,screen->machine->gfx[0],tile,color,0,0,x*8,y*8 | |
| 211 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,color,0,0,x*8,y*8 | |
| 212 | 212 | |
| 213 | 213 | count++; |
| 214 | 214 | } |
| r5077 | r5078 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) ; |
| 57 | 57 | |
| 58 | drawgfx(bitmap,machine->gfx[0], | |
| 58 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0], | |
| 59 | 59 | 2 * code, |
| 60 | 60 | ((spriteram[offs + 2] & 0xf8) >> 3) , |
| 61 | 61 | 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], | |
| 65 | 64 | 2 * code + 1, |
| 66 | 65 | ((spriteram[offs + 2] & 0xf8) >> 3) , |
| 67 | 66 | flip_screen_x_get(machine),flip_screen_y_get(machine), |
| 68 | sx,sy, | |
| 69 | cliprect,TRANSPARENCY_PEN,0); | |
| 67 | sx,sy,0); | |
| 70 | 68 | } |
| 71 | 69 | } |
| 72 | 70 | |
| r5077 | r5078 | |
| 80 | 78 | for(y=0;y<256/32;y++) |
| 81 | 79 | for(x=0;x<256/32;x++) |
| 82 | 80 | { |
| 83 | drawgfx( bitmap, | |
| 84 | screen->machine->gfx[1], | |
| 81 | drawgfx_opaque( bitmap, | |
| 82 | cliprect, | |
| 83 | screen->machine->gfx[1], | |
| 85 | 84 | bgram[index]+256*(bgram[index+1]&0xf), |
| 86 | 85 | bgram[index+1]>>4, |
| 87 | 86 | 0, 0, |
| 88 | x*32,y*32, | |
| 89 | cliprect, | |
| 90 | TRANSPARENCY_NONE,0); | |
| 87 | x*32,y*32); | |
| 91 | 88 | index+=2; |
| 92 | 89 | } |
| 93 | 90 | } |
| r5077 | r5078 | |
| 97 | 94 | for(y=0;y<32;y++) |
| 98 | 95 | for(x=0;x<32;x++) |
| 99 | 96 | { |
| 100 | drawgfx( bitmap, | |
| 97 | drawgfx_transpen( bitmap, | |
| 98 | cliprect, | |
| 101 | 99 | screen->machine->gfx[0], |
| 102 | 100 | videoram[(y*32+x)*2+1]+(videoram[(y*32+x)*2]&7)*256, |
| 103 | 101 | (videoram[(y*32+x)*2]>>3), |
| 104 | 102 | 0, 0, |
| 105 | x*8,y*8, | |
| 106 | cliprect, | |
| 107 | TRANSPARENCY_PEN,0); | |
| 103 | x*8,y*8,0); | |
| 108 | 104 | } |
| 109 | 105 | } |
| 110 | 106 |
| r5077 | r5078 | |
|---|---|---|
| 316 | 316 | int sx = 31 * 8 - videoram[0x380 + 0x10 + ball * 2]; |
| 317 | 317 | int sy = 30 * 8 - videoram[0x380 + 0x18 + ball * 2]; |
| 318 | 318 | |
| 319 | drawgfx(bitmap, screen->machine->gfx[1], code, 0, 0, 0, sx, sy | |
| 319 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], code, 0, 0, 0, sx, sy | |
| 320 | 320 | } |
| 321 | 321 | return 0; |
| 322 | 322 | } |
| r5077 | r5078 | |
|---|---|---|
| 54 | 54 | int attr = (sc1_vram[count+0x800] & 0x1f00)>>8; |
| 55 | 55 | //int t_pen = (sc1_vram[count+0x800] & 0x2000); |
| 56 | 56 | //int colour = tile>>12; |
| 57 | drawgfx(bitmap,gfx,tile,attr,0,0,x*8,y*8 | |
| 57 | drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8 | |
| 58 | 58 | |
| 59 | 59 | count++; |
| 60 | 60 | } |
| r5077 | r5078 | |
| 87 | 87 | int attr = (sc2_vram[count+0x800] & 0x1f00)>>8; |
| 88 | 88 | //int t_pen = (sc1_vram[count+0x800] & 0x2000); |
| 89 | 89 | //int colour = tile>>12; |
| 90 | drawgfx(bitmap,gfx,tile,attr,0,0,x*8,y*8 | |
| 90 | drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8 | |
| 91 | 91 | |
| 92 | 92 | count++; |
| 93 | 93 | } |
| r5077 | r5078 | |
|---|---|---|
| 823 | 823 | |
| 824 | 824 | for (y = 0;y < height;y++) |
| 825 | 825 | { |
| 826 | drawgfx(bitmap,machine->gfx[1], | |
| 826 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 827 | 827 | code + (flipy ? height-1 - y : y), |
| 828 | 828 | color, |
| 829 | 829 | 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); | |
| 832 | 831 | |
| 833 | 832 | /* wrap around */ |
| 834 | drawgfx(bitmap,machine->gfx[1], | |
| 833 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 835 | 834 | code + (flipy ? height-1 - y : y), |
| 836 | 835 | color, |
| 837 | 836 | 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); | |
| 840 | 838 | } |
| 841 | 839 | } |
| 842 | 840 | } |
| r5077 | r5078 | |
|---|---|---|
| 71 | 71 | { \ |
| 72 | 72 | UINT16 data0=map[y*128+x*2]; \ |
| 73 | 73 | 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, \ | |
| 75 | 76 | data0&0xff, \ |
| 76 | 77 | 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); \ | |
| 79 | 79 | } \ |
| 80 | 80 | } |
| 81 | 81 | |
| r5077 | r5078 | |
| 94 | 94 | for(y=0;y<64;y++) |
| 95 | 95 | for(x=0;x<64;x++) |
| 96 | 96 | { |
| 97 | drawgfx( bitmap, | |
| 97 | drawgfx_transpen( bitmap, | |
| 98 | cliprect, | |
| 98 | 99 | screen->machine->gfx[1], |
| 99 | 100 | textram[y*64+x]&0xff, //1ff ?? |
| 100 | 101 | ((textram[y*64+x]>>9)&0xf), |
| 101 | 102 | 0, 0, |
| 102 | x*8,y*8, | |
| 103 | cliprect, | |
| 104 | TRANSPARENCY_PEN,0); | |
| 103 | x*8,y*8,0); | |
| 105 | 104 | } |
| 106 | 105 | } |
| 107 | 106 | //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]); |
| r5077 | r5078 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | // is spriteram16[offs+0] & 0x200 flipy? it's always set |
| 105 | 105 | |
| 106 | drawgfx(bitmap,screen->machine->gfx[1],spr_offs,colour,0,1,sx,sy | |
| 106 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],spr_offs,colour,0,1,sx,sy | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 |
| r5077 | r5078 | |
|---|---|---|
| 130 | 130 | sy = -sy; |
| 131 | 131 | sy += 0xf8; |
| 132 | 132 | |
| 133 | drawgfx( bitmap, machine->gfx[0], | |
| 133 | drawgfx_transpen( bitmap, cliprect, machine->gfx[0], | |
| 134 | 134 | code/2, color, |
| 135 | flipx, flipy, sx, sy, | |
| 136 | cliprect, TRANSPARENCY_PEN, 0); | |
| 135 | flipx, flipy, sx, sy, 0); | |
| 137 | 136 | } |
| 138 | 137 | } |
| 139 | 138 |
| r5077 | r5078 | |
|---|---|---|
| 103 | 103 | y = 0x100 - spriteram[count]; |
| 104 | 104 | x = spriteram[count+3]; |
| 105 | 105 | |
| 106 | drawgfx(bitmap,machine->gfx[1],spr_offs,color,fx,fy,x,y-16 | |
| 106 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],spr_offs,color,fx,fy,x,y-16 | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| r5077 | r5078 | |
| 122 | 122 | int x_scroll = (color & 0xff00)>>8; |
| 123 | 123 | tile |= ((color & 0xe0)<<3); |
| 124 | 124 | |
| 125 | drawgfx(bitmap,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll | |
| 125 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll | |
| 126 | 126 | /* wrap-around */ |
| 127 | drawgfx(bitmap,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll+256 | |
| 127 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll+256 | |
| 128 | 128 | |
| 129 | 129 | count++; |
| 130 | 130 | } |
| r5077 | r5078 | |
| 146 | 146 | |
| 147 | 147 | if(x <= 1 || x >= 30) |
| 148 | 148 | { |
| 149 | drawgfx(bitmap,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll | |
| 149 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll | |
| 150 | 150 | /* wrap-around */ |
| 151 | drawgfx(bitmap,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll+256 | |
| 151 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,0,0,(x*8),(y*8)-x_scroll+256 | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | count++; |
| r5077 | r5078 | |
|---|---|---|
| 168 | 168 | for (x = 0; x < 32; x++) |
| 169 | 169 | { |
| 170 | 170 | 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 | |
| 171 | drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 353 | 353 | |
| 354 | 354 | if (offs < 3*4) sy++; |
| 355 | 355 | |
| 356 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 356 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], | |
| 357 | 357 | code,color, |
| 358 | 358 | flipx,flipy, |
| 359 | sx,sy, | |
| 360 | cliprect,TRANSPARENCY_PEN,0); | |
| 359 | sx,sy,0); | |
| 361 | 360 | |
| 362 | 361 | } |
| 363 | 362 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 5 | 5 | driver by Aaron Giles |
| 6 | 6 | |
| 7 | 7 | Games supported: |
| 8 | * Klax (1989) [ | |
| 8 | * Klax (1989) [5 sets] | |
| 9 | 9 | |
| 10 | 10 | Known bugs: |
| 11 | 11 | * none at this time |
| r5077 | r5078 | |
| 197 | 197 | |
| 198 | 198 | ROM_START( klax ) |
| 199 | 199 | 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) ) | |
| 204 | 204 | |
| 205 | 205 | 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) ) | |
| 210 | 210 | |
| 211 | 211 | 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) ) | |
| 214 | 214 | |
| 215 | 215 | 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) ) | |
| 218 | 225 | ROM_END |
| 219 | 226 | |
| 220 | 227 | |
| 221 | 228 | ROM_START( klax2 ) |
| 222 | 229 | 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) ) | |
| 227 | 234 | |
| 228 | 235 | 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) ) | |
| 233 | 240 | |
| 234 | 241 | 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) ) | |
| 237 | 244 | |
| 238 | 245 | 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) ) | |
| 241 | 255 | ROM_END |
| 242 | 256 | |
| 243 | 257 | |
| 244 | 258 | ROM_START( klax3 ) |
| 245 | 259 | 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) ) | |
| 250 | 264 | |
| 251 | 265 | 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) ) | |
| 256 | 270 | |
| 257 | 271 | 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) ) | |
| 260 | 274 | |
| 261 | 275 | 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) ) | |
| 264 | 285 | ROM_END |
| 265 | 286 | |
| 266 | 287 | |
| 267 | 288 | ROM_START( klaxj ) |
| 268 | 289 | 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) ) | |
| 273 | 294 | |
| 274 | 295 | 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) ) | |
| 279 | 300 | |
| 280 | 301 | 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) ) | |
| 283 | 304 | |
| 284 | 305 | 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) ) | |
| 287 | 315 | ROM_END |
| 288 | 316 | |
| 289 | 317 | |
| 290 | 318 | ROM_START( klaxd ) |
| 291 | 319 | 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) ) | |
| 296 | 324 | |
| 297 | 325 | 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) ) | |
| 302 | 330 | |
| 303 | 331 | 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) ) | |
| 306 | 334 | |
| 307 | 335 | 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) ) | |
| 310 | 345 | ROM_END |
| 311 | 346 | |
| 312 | 347 |
| r5077 | r5078 | |
|---|---|---|
| 360 | 360 | |
| 361 | 361 | code=(code&0x7f)|((flags&0x30)<<3); |
| 362 | 362 | |
| 363 | drawgfx(bitmap, screen->machine->gfx[0], code, 1, xflip, yflip, x, y | |
| 363 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], code, 1, xflip, yflip, x, y | |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | { |
| r5077 | r5078 | |
| 370 | 370 | { |
| 371 | 371 | c=videoram[y*32+x]; |
| 372 | 372 | if(x>1&&x<30) |
| 373 | drawgfx(bitmap, screen->machine->gfx[1], c+char_bank*0x100, 1, 0, 0, x*8, y*8 | |
| 373 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], c+char_bank*0x100, 1, 0, 0, x*8, y*8 | |
| 374 | 374 | else |
| 375 | drawgfx(bitmap, screen->machine->gfx[1], c+char_bank*0x100, 1, 0, 0, x*8, y*8 | |
| 375 | drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1], c+char_bank*0x100, 1, 0, 0, x*8, y*8 | |
| 376 | 376 | } |
| 377 | 377 | } |
| 378 | 378 | return 0; |
| r5077 | r5078 | |
|---|---|---|
| 84 | 84 | sx = 496 - sx; |
| 85 | 85 | sy = 240 - sy; |
| 86 | 86 | } |
| 87 | drawgfx(bitmap,machine->gfx[1], | |
| 87 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], | |
| 88 | 88 | code, |
| 89 | 89 | color, |
| 90 | 90 | flipscreen,flipscreen, |
| 91 | sx,sy, | |
| 92 | cliprect,TRANSPARENCY_PEN,15); | |
| 91 | sx,sy,15); | |
| 93 | 92 | } |
| 94 | 93 | } |
| 95 | 94 |
| r5077 | r5078 | |
|---|---|---|
| 71 | 71 | { |
| 72 | 72 | int current_screen_character = (characterY*64) + characterX; |
| 73 | 73 | |
| 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); | |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | } |
| r5077 | r5078 | |
|---|---|---|
| 15 | 15 | Touch & Go | 1995 | GAE1 501 | 950510-1 | DS5002FP |
| 16 | 16 | Maniac Square | 1996 | Unknown | ??? | DS5002FP, but unprotected version available |
| 17 | 17 | Snow Board | 1996 | CG-1V 366 | 960419/1 | Lattice IspLSI 1016-80LJ |
| 18 | Bang! | 1998 | CG-1V 388 | | |
| 18 | Bang! | 1998 | CG-1V 388 | 980921/1 | No | |
| 19 | 19 | |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| r5077 | r5078 | |
| 309 | 309 | MACHINE_DRIVER_END |
| 310 | 310 | |
| 311 | 311 | |
| 312 | /* | |
| 313 | PCB Layout: | |
| 314 | ||
| 315 | REF: 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 | |
| 346 | Custom: CG-1V 388 (System chip, Graphics & Sound) | |
| 347 | OSC: 30.000MHz (x2) | |
| 348 | EEPROM: 93C66N | |
| 349 | ||
| 350 | RAM: CY7C199-15PC (IC12, IC13, IC50, IC51, IC52 & IC54) | |
| 351 | KM428C256TR-7 (IC32 & IC33) | |
| 352 | ||
| 353 | * IC42 through IC47 unpopulated | |
| 354 | ||
| 355 | JP10 - 50 pin (dual in-line) header for Plug-In Daughterboard | |
| 356 | JP2 - 4 pin light gun header (player 1) | |
| 357 | JP3 - 4 pin light gun header (player 2) | |
| 358 | ||
| 359 | */ | |
| 360 | ||
| 312 | 361 | ROM_START( bang ) |
| 313 | 362 | 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) ) | |
| 316 | 365 | |
| 317 | 366 | 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 */ | |
| 337 | 386 | ROM_END |
| 338 | 387 | |
| 339 | 388 | |
| 340 | 389 | |
| 341 | 390 | ROM_START( bangj ) |
| 342 | 391 | 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) ) | |
| 345 | 394 | |
| 346 | 395 | 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 */ | |
| 366 | 415 | ROM_END |
| 367 | 416 | |
| 368 | 417 | |
| r5077 | r5078 | |
| 952 | 1001 | | SW1 IC43 | |
| 953 | 1002 | | 34.000MHz |----------| | |
| 954 | 1003 | |--- 93C66 | | IC44 | |
| 955 | | | | |
| 1004 | | | CG-1V | |
| 956 | 1005 | | J 6264 | 366 | IC45 | |
| 957 | 1006 | | 6264 | | | |
| 958 | 1007 | | A |----------| IC46 | |
| r5077 | r5078 | |
| 965 | 1014 | | |----------| | |
| 966 | 1015 | | 30.000MHz | Lattice | | |
| 967 | 1016 | |--- | IspLSI | | |
| 968 | | | 1016 | SB5 | |
| 1017 | | | 1016 | SB53 | | |
| 969 | 1018 | | |----------| | |
| 970 | 1019 | |--- |------------| 62256 | |
| 971 | 1020 | | | | | |
| 972 | | | MC68HC000 | SB5 | |
| 1021 | | | MC68HC000 | SB55 | | |
| 973 | 1022 | | | FN16 | | |
| 974 | 1023 | | |------------| | |
| 975 | 1024 | -----------------------------------------------------------------------------| |
| r5077 | r5078 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | /* draw sprite */ |
| 43 | 43 | |
| 44 | drawgfx(bitmap, screen->machine->gfx[1], | |
| 44 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], | |
| 45 | 45 | cball_video_ram[0x399] >> 4, |
| 46 | 46 | 0, |
| 47 | 47 | 0, 0, |
| 48 | 48 | 240 - cball_video_ram[0x390], |
| 49 | 240 - cball_video_ram[0x398], | |
| 50 | cliprect, TRANSPARENCY_PEN, 0); | |
| 49 | 240 - cball_video_ram[0x398], 0); | |
| 51 | 50 | return 0; |
| 52 | 51 | } |
| 53 | 52 |
| r5077 | r5078 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | if (((buffered_spriteram16[offs+0] & 0x3000) >> 12) == priority) |
| 232 | 232 | { |
| 233 | drawgfx(bitmap,machine->gfx[3], | |
| 233 | drawgfx_transpen(bitmap,cliprect,machine->gfx[3], | |
| 234 | 234 | code & 0xfff, |
| 235 | 235 | color, |
| 236 | 236 | flipx,flipy, |
| 237 | sx,sy, | |
| 238 | cliprect,TRANSPARENCY_PEN,15); | |
| 237 | sx,sy,15); | |
| 239 | 238 | } |
| 240 | 239 | } |
| 241 | 240 | } |
| r5077 | r5078 | |
|---|---|---|
| 244 | 244 | |
| 245 | 245 | if(xpos&0x800)xpos-=0x1000; |
| 246 | 246 | |
| 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); | |
| 249 | 249 | |
| 250 | 250 | |
| 251 | 251 | source-=2; |
| r5077 | r5078 | |
|---|---|---|
| 5741 | 5741 | |
| 5742 | 5742 | ROM_START( hachamf ) |
| 5743 | 5743 | 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) ) | |
| 5746 | 5746 | |
| 5747 | 5747 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* unknown - sound cpu ?????? */ |
| 5748 | ROM_LOAD( " | |
| 5748 | ROM_LOAD( " | |
| 5749 | 5749 | |
| 5750 | 5750 | ROM_REGION( 0x020000, "gfx1", ROMREGION_DISPOSE ) |
| 5751 | ROM_LOAD( " | |
| 5751 | ROM_LOAD( " | |
| 5752 | 5752 | |
| 5753 | 5753 | 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) ) | |
| 5756 | 5755 | |
| 5757 | 5756 | ROM_REGION( 0x100000, "gfx3", ROMREGION_DISPOSE ) |
| 5758 | ROM_LOAD16_WORD_SWAP( " | |
| 5757 | ROM_LOAD16_WORD_SWAP( "91 | |
| 5759 | 5758 | |
| 5760 | 5759 | ROM_REGION( 0x0a0000, "oki1", 0 ) /* OKIM6295 samples */ |
| 5761 | ROM_LOAD( " | |
| 5760 | ROM_LOAD( "91 | |
| 5762 | 5761 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ |
| 5763 | 5762 | |
| 5764 | 5763 | ROM_REGION( 0x0a0000, "oki2", 0 ) /* OKIM6295 samples */ |
| 5765 | ROM_LOAD( " | |
| 5764 | ROM_LOAD( "91 | |
| 5766 | 5765 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ |
| 5767 | 5766 | ROM_END |
| 5768 | 5767 |
| r5077 | r5078 | |
|---|---|---|
| 191 | 191 | /* does the source end in '.jed'? */ |
| 192 | 192 | len = strlen(srcfile); |
| 193 | 193 | 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'); | |
| 197 | 197 | |
| 198 | 198 | /* does the destination end in '.jed'? */ |
| 199 | 199 | len = strlen(dstfile); |
| 200 | 200 | 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'); | |
| 204 | 204 | |
| 205 | 205 | /* error if neither or both are .jed */ |
| 206 | 206 | if (!src_is_jed && !dst_is_jed) |
| r5077 | r5078 | |
|---|---|---|
| 680 | 680 | srcfilelen = strlen(srcfile); |
| 681 | 681 | if (srcfilelen < 4) |
| 682 | 682 | 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') | |
| 684 | 684 | 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') | |
| 686 | 686 | isavi = FALSE; |
| 687 | 687 | else |
| 688 | 688 | return usage(); |
| r5077 | r5078 | |
|---|---|---|
| 177 | 177 | int length; |
| 178 | 178 | |
| 179 | 179 | /* trim leading spaces */ |
| 180 | while (*string != 0 && isspace(*string)) | |
| 180 | while (*string != 0 && isspace((UINT8)*string)) | |
| 181 | 181 | string++; |
| 182 | 182 | |
| 183 | 183 | /* trim trailing spaces */ |
| 184 | 184 | length = strlen(string); |
| 185 | while (length > 0 && isspace(string[length - 1])) | |
| 185 | while (length > 0 && isspace((UINT8)string[length - 1])) | |
| 186 | 186 | string[--length] = 0; |
| 187 | 187 | |
| 188 | 188 | return string; |
| r5077 | r5078 | |
| 400 | 400 | { |
| 401 | 401 | /* find the end of the line and normalize it with a CR */ |
| 402 | 402 | for (curptr = linestart; *curptr != 0 && *curptr != '\n' && *curptr != '\r'; curptr++) |
| 403 | if (!isspace(*curptr)) | |
| 403 | if (!isspace((UINT8)*curptr)) | |
| 404 | 404 | foundchars = 1; |
| 405 | 405 | *curptr++ = '\n'; |
| 406 | 406 | *curptr = 0; |
| r5077 | r5078 | |
| 434 | 434 | char *end; |
| 435 | 435 | |
| 436 | 436 | /* find the end */ |
| 437 | for (end = start; !isspace(*end); end++) ; | |
| 437 | for (end = start; !isspace((UINT8)*end); end++) ; | |
| 438 | 438 | *end = 0; |
| 439 | 439 | strcpy(lists[index].version, start); |
| 440 | 440 | fprintf(stderr, "Parsing results from version %s\n", lists[index].version); |
| r5077 | r5078 | |
|---|---|---|
| 61 | 61 | int singlequote = 0; |
| 62 | 62 | int doublequote = 0; |
| 63 | 63 | |
| 64 | while ((i < linebuffersize) && isspace(linebuffer[i])) | |
| 64 | while ((i < linebuffersize) && isspace((UINT8)linebuffer[i])) | |
| 65 | 65 | { |
| 66 | 66 | i++; |
| 67 | 67 | } |
| r5077 | r5078 | |
| 76 | 76 | { |
| 77 | 77 | singlequote = !singlequote; |
| 78 | 78 | } |
| 79 | else if (!singlequote && !doublequote && isspace(linebuffer[i])) | |
| 79 | else if (!singlequote && !doublequote && isspace((UINT8)linebuffer[i])) | |
| 80 | 80 | { |
| 81 | 81 | break; |
| 82 | 82 | } |
| r5077 | r5078 | |
| 298 | 298 | /* it's a decimal offset, use it */ |
| 299 | 299 | f = strtoul(&token[1], NULL, 10); |
| 300 | 300 | } |
| 301 | else if (isdigit(token[0])) | |
| 301 | else if (isdigit((UINT8)token[0])) | |
| 302 | 302 | { |
| 303 | 303 | /* convert the time to an offset */ |
| 304 | 304 | f = msf_to_frames( token ); |
| r5077 | r5078 | |
| 314 | 314 | |
| 315 | 315 | TOKENIZE |
| 316 | 316 | |
| 317 | if (isdigit(token[0])) | |
| 317 | if (isdigit((UINT8)token[0])) | |
| 318 | 318 | { |
| 319 | 319 | // this could be the length or an offset from the previous field. |
| 320 | 320 | f = msf_to_frames( token ); |
| 321 | 321 | |
| 322 | 322 | TOKENIZE |
| 323 | 323 | |
| 324 | if (isdigit(token[0])) | |
| 324 | if (isdigit((UINT8)token[0])) | |
| 325 | 325 | { |
| 326 | 326 | // it was an offset. |
| 327 | 327 | f *= (outtoc->tracks[trknum].datasize + outtoc->tracks[trknum].subsize); |
| r5077 | r5078 | |
|---|---|---|
| 313 | 313 | |
| 314 | 314 | /* if there are any non-digits in the 'offset', then treat it as a ident file */ |
| 315 | 315 | for (scan = argv[4]; *scan != 0; scan++) |
| 316 | if (!isdigit(*scan)) | |
| 316 | if (!isdigit((UINT8)*scan)) | |
| 317 | 317 | break; |
| 318 | 318 | if (*scan != 0) |
| 319 | 319 | { |
| r5077 | r5078 | |
|---|---|---|
| 235 | 235 | |
| 236 | 236 | /* strip all spaces from the name and convert to lowercase */ |
| 237 | 237 | 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); | |
| 240 | 240 | symname[charnum] = 0; |
| 241 | 241 | |
| 242 | 242 | /* add the symbol to the table */ |
| r5077 | r5078 | |
| 2133 | 2133 | |
| 2134 | 2134 | /* strip whitespace */ |
| 2135 | 2135 | i = (int)strlen(buf); |
| 2136 | while((i > 0) && (isspace(buf[i-1]))) | |
| 2136 | while((i > 0) && (isspace((UINT8)buf[i-1]))) | |
| 2137 | 2137 | buf[--i] = '\0'; |
| 2138 | 2138 | |
| 2139 | 2139 | /* execute the command */ |
| r5077 | r5078 | |
|---|---|---|
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | 1149 | /* now trim spaces */ |
| 1150 | while (isspace(str[tagstart]) && taglen > 0) | |
| 1150 | while (isspace((UINT8)str[tagstart]) && taglen > 0) | |
| 1151 | 1151 | tagstart++, taglen--; |
| 1152 | while (isspace(str[tagstart + taglen - 1]) && taglen > 0) | |
| 1152 | while (isspace((UINT8)str[tagstart + taglen - 1]) && taglen > 0) | |
| 1153 | 1153 | taglen--; |
| 1154 | while (isspace(str[valstart]) && vallen > 0) | |
| 1154 | while (isspace((UINT8)str[valstart]) && vallen > 0) | |
| 1155 | 1155 | valstart++, vallen--; |
| 1156 | while (isspace(str[valstart + vallen - 1]) && vallen > 0) | |
| 1156 | while (isspace((UINT8)str[valstart + vallen - 1]) && vallen > 0) | |
| 1157 | 1157 | vallen--; |
| 1158 | 1158 | if (str[valstart] == '!') |
| 1159 | 1159 | valstart++, vallen--; |
| r5077 | r5078 | |
|---|---|---|
| 1705 | 1705 | { |
| 1706 | 1706 | /* check for a 'b','w','d',or 'q' prefix */ |
| 1707 | 1707 | 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; } | |
| 1712 | 1712 | |
| 1713 | 1713 | /* look for a wildcard */ |
| 1714 | 1714 | if (!strcmp(pdata, "?")) |
| r5077 | r5078 | |
|---|---|---|
| 197 | 197 | return CMDERR_NONE; |
| 198 | 198 | |
| 199 | 199 | /* 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++) { } | |
| 202 | 202 | if (*p != 0) |
| 203 | 203 | { |
| 204 | 204 | *p++ = 0; |
| 205 | for ( ; *p && isspace(*p); p++) { } | |
| 205 | for ( ; *p && isspace((UINT8)*p); p++) { } | |
| 206 | 206 | if (*p != 0) |
| 207 | 207 | param[0] = p; |
| 208 | 208 | else |
| r5077 | r5078 | |
| 302 | 302 | case '+': if (parendex == 0 && paramcount == 1 && p[1] == '+') isexpr = TRUE; *p = c; break; |
| 303 | 303 | case '=': if (parendex == 0 && paramcount == 1) isexpr = TRUE; *p = c; break; |
| 304 | 304 | case 0: foundend = TRUE; break; |
| 305 | default: *p = tolower(c); break; | |
| 305 | default: *p = tolower((UINT8)c); break; | |
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | } |
| r5077 | r5078 | |
| 321 | 321 | command_start = params[0]; |
| 322 | 322 | |
| 323 | 323 | /* 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])) | |
| 325 | 325 | { |
| 326 | 326 | isexpr = TRUE; |
| 327 | 327 | command_start += 3; |
| r5077 | r5078 | |
|---|---|---|
| 627 | 627 | while (string[0] != 0 && token - expr->token < MAX_TOKENS) |
| 628 | 628 | { |
| 629 | 629 | /* ignore any whitespace */ |
| 630 | while (string[0] != 0 && isspace(string[0])) | |
| 630 | while (string[0] != 0 && isspace((UINT8)string[0])) | |
| 631 | 631 | string++; |
| 632 | 632 | if (string[0] == 0) |
| 633 | 633 | break; |
| r5077 | r5078 | |
| 637 | 637 | token->offset = string - stringstart; |
| 638 | 638 | |
| 639 | 639 | /* switch off the first character */ |
| 640 | switch (tolower(string[0])) | |
| 640 | switch (tolower((UINT8)string[0])) | |
| 641 | 641 | { |
| 642 | 642 | case '(': |
| 643 | 643 | SET_TOKEN_INFO(1, TOK_OPERATOR, TVL_LPAREN, TIN_PRECEDENCE_0); |
| r5077 | r5078 | |
| 827 | 827 | /* accumulate a lower-case version of the symbol */ |
| 828 | 828 | while (1) |
| 829 | 829 | { |
| 830 | char val = tolower(string[0]); | |
| 830 | char val = tolower((UINT8)string[0]); | |
| 831 | 831 | if (val == 0 || strchr(valid, val) == NULL) |
| 832 | 832 | break; |
| 833 | 833 | buffer[bufindex++] = val; |
| r5077 | r5078 | |
| 925 | 925 | value = 0; |
| 926 | 926 | while (buffer[bufindex] != 0) |
| 927 | 927 | { |
| 928 | const char *ptr = strchr(numbers, tolower(buffer[bufindex])); | |
| 928 | const char *ptr = strchr(numbers, tolower((UINT8)buffer[bufindex])); | |
| 929 | 929 | int digit; |
| 930 | 930 | |
| 931 | 931 | if (ptr == NULL) |
| r5077 | r5078 | |
| 1967 | 1967 | all_digits = TRUE; |
| 1968 | 1968 | for (i = 0; name[i]; i++) |
| 1969 | 1969 | { |
| 1970 | if (!isdigit(name[i])) | |
| 1970 | if (!isdigit((UINT8)name[i])) | |
| 1971 | 1971 | { |
| 1972 | 1972 | all_digits = FALSE; |
| 1973 | 1973 | break; |
| r5077 | r5078 | |
| 1999 | 1999 | |
| 2000 | 2000 | /* copy the string, converting to lowercase */ |
| 2001 | 2001 | for (strindex = 0; name[strindex] != 0; strindex++) |
| 2002 | newstring[strindex] = tolower(name[strindex]); | |
| 2002 | newstring[strindex] = tolower((UINT8)name[strindex]); | |
| 2003 | 2003 | newstring[strindex] = 0; |
| 2004 | 2004 | |
| 2005 | 2005 | /* fill in the details */ |
| r5077 | r5078 | |
|---|---|---|
| 1048 | 1048 | |
| 1049 | 1049 | /* make a lowercase copy of the tag */ |
| 1050 | 1050 | for (i = 0; i <= taglen; i++) |
| 1051 | tagcopy[i] = tolower(tag[i]); | |
| 1051 | tagcopy[i] = tolower((UINT8)tag[i]); | |
| 1052 | 1052 | |
| 1053 | 1053 | /* find a match */ |
| 1054 | 1054 | for (i = 0; i < sizeof(static_help_list) / sizeof(static_help_list[0]); i++) |
| r5077 | r5078 | |
|---|---|---|
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | #------------------------------------------------- |
| 232 | # Atmel | |
| 232 | # Atmel | |
| 233 | 233 | #------------------------------------------------- |
| 234 | 234 | |
| 235 | 235 | ifneq ($(filter AVR8,$(CPUS)),) |
| r5077 | r5078 | |
| 238 | 238 | DBGOBJS += $(CPUOBJ)/avr8/avr8dasm.o |
| 239 | 239 | endif |
| 240 | 240 | |
| 241 | $(CPUOBJ)/avr8/avr8.o: $(CPUSRC)/avr8/avr8.c \ | |
| 241 | $(CPUOBJ)/avr8/avr8.o: $(CPUSRC)/avr8/avr8.c \ | |
| 242 | $(CPUSRC)/avr8/avr8.h | |
| 242 | 243 | |
| 243 | 244 | |
| 244 | 245 |
| r5077 | r5078 | |
|---|---|---|
| 10 | 10 | #define SET_C8(x) (cpustate->ccr |= ((x) & 0x100) ? CC_C : 0) |
| 11 | 11 | #define SET_C16(x) (cpustate->ccr |= ((x) & 0x10000) ? CC_C : 0) |
| 12 | 12 | #define CLEAR_Z(cpustate) (cpustate->ccr &= ~(CC_Z)) |
| 13 | #define CLEAR_C(cpustate) (cpustate->ccr &= ~(CC_C)) | |
| 13 | 14 | #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)) | |
| 14 | 16 | #define CLEAR_NZVC(cpustate) (cpustate->ccr &= ~(CC_N | CC_Z | CC_V | CC_C)) |
| 15 | 17 | #define CLEAR_HNZVC(cpustate) (cpustate->ccr &= ~(CC_H | CC_N | CC_Z | CC_V | CC_C)) |
| 16 | 18 | |
| r5077 | r5078 | |
| 615 | 617 | CYCLES(cpustate, 5); |
| 616 | 618 | } |
| 617 | 619 | |
| 620 | /* ASLA 0x48 */ | |
| 621 | static 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); | |
| 618 | 629 | |
| 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 */ | |
| 640 | static 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 | ||
| 619 | 658 | /* BITA IMM 0x85 */ |
| 620 | 659 | static void HC11OP(bita_imm)(hc11_state *cpustate) |
| 621 | 660 | { |
| r5077 | r5078 | |
| 735 | 774 | CYCLES(cpustate, 5); |
| 736 | 775 | } |
| 737 | 776 | |
| 777 | /* BCC 0x24 */ | |
| 778 | static 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 | } | |
| 738 | 787 | |
| 788 | /* BCLR INDX 0x1d */ | |
| 789 | static 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 | ||
| 739 | 803 | /* BCS 0x25 */ |
| 740 | 804 | static void HC11OP(bcs)(hc11_state *cpustate) |
| 741 | 805 | { |
| r5077 | r5078 | |
| 760 | 824 | } |
| 761 | 825 | |
| 762 | 826 | |
| 827 | /* BHI 0x22 */ | |
| 828 | static 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 | ||
| 763 | 839 | /* BNE 0x26 */ |
| 764 | 840 | static void HC11OP(bne)(hc11_state *cpustate) |
| 765 | 841 | { |
| r5077 | r5078 | |
| 785 | 861 | CYCLES(cpustate, 3); |
| 786 | 862 | } |
| 787 | 863 | |
| 864 | /* BLS 0x23 */ | |
| 865 | static 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 | } | |
| 788 | 874 | |
| 875 | /* BMI 0x2B */ | |
| 876 | static 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 | ||
| 789 | 886 | /* BPL 0x2A */ |
| 790 | 887 | static void HC11OP(bpl)(hc11_state *cpustate) |
| 791 | 888 | { |
| r5077 | r5078 | |
| 806 | 903 | CYCLES(cpustate, 3); |
| 807 | 904 | } |
| 808 | 905 | |
| 906 | /* BRCLR DIR 0x13 */ | |
| 907 | static 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); | |
| 809 | 913 | |
| 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 */ | |
| 924 | static 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 */ | |
| 940 | static 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 */ | |
| 957 | static 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 */ | |
| 974 | static 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 */ | |
| 982 | static 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 | ||
| 810 | 996 | /* BSR 0x8D */ |
| 811 | 997 | static void HC11OP(bsr)(hc11_state *cpustate) |
| 812 | 998 | { |
| r5077 | r5078 | |
| 817 | 1003 | CYCLES(cpustate, 6); |
| 818 | 1004 | } |
| 819 | 1005 | |
| 1006 | /* BVC 0x28 */ | |
| 1007 | static 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 | } | |
| 820 | 1016 | |
| 1017 | /* BVS 0x29 */ | |
| 1018 | static 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 */ | |
| 1029 | static 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 */ | |
| 1041 | static void HC11OP(clc)(hc11_state *cpustate) | |
| 1042 | { | |
| 1043 | cpustate->ccr &= ~CC_C; | |
| 1044 | CYCLES(cpustate, 2); | |
| 1045 | } | |
| 1046 | ||
| 1047 | ||
| 821 | 1048 | /* CLI 0x0E */ |
| 822 | 1049 | static void HC11OP(cli)(hc11_state *cpustate) |
| 823 | 1050 | { |
| r5077 | r5078 | |
| 875 | 1102 | } |
| 876 | 1103 | |
| 877 | 1104 | |
| 1105 | /* CLV 0x0A */ | |
| 1106 | static void HC11OP(clv)(hc11_state *cpustate) | |
| 1107 | { | |
| 1108 | cpustate->ccr &= ~CC_V; | |
| 1109 | CYCLES(cpustate, 2); | |
| 1110 | } | |
| 1111 | ||
| 1112 | ||
| 878 | 1113 | /* CMPA IMM 0x81 */ |
| 879 | 1114 | static void HC11OP(cmpa_imm)(hc11_state *cpustate) |
| 880 | 1115 | { |
| r5077 | r5078 | |
| 1015 | 1250 | } |
| 1016 | 1251 | |
| 1017 | 1252 | |
| 1253 | /* COMA , 0x43 */ | |
| 1254 | static 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 */ | |
| 1267 | static 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 | ||
| 1018 | 1279 | /* CPD IMM 0x1A, 0x83 */ |
| 1019 | 1280 | static void HC11OP(cpd_imm)(hc11_state *cpustate) |
| 1020 | 1281 | { |
| r5077 | r5078 | |
| 1154 | 1415 | CYCLES(cpustate, 7); |
| 1155 | 1416 | } |
| 1156 | 1417 | |
| 1157 | ||
| 1158 | 1418 | /* CPY IMM 0x18, 0x8C */ |
| 1159 | 1419 | static void HC11OP(cpy_imm)(hc11_state *cpustate) |
| 1160 | 1420 | { |
| r5077 | r5078 | |
| 1168 | 1428 | CYCLES(cpustate, 5); |
| 1169 | 1429 | } |
| 1170 | 1430 | |
| 1431 | /* CPY DIR 0x18 0x9C */ | |
| 1432 | static 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 | } | |
| 1171 | 1444 | |
| 1445 | /* CPY EXT 0x18 0xBC */ | |
| 1446 | static 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 */ | |
| 1460 | static 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 */ | |
| 1474 | static 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 */ | |
| 1488 | static 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 */ | |
| 1500 | static 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 */ | |
| 1512 | static 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 */ | |
| 1528 | static 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 */ | |
| 1544 | static 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 | ||
| 1172 | 1559 | /* DEX 0x09 */ |
| 1173 | 1560 | static void HC11OP(dex)(hc11_state *cpustate) |
| 1174 | 1561 | { |
| r5077 | r5078 | |
| 1308 | 1695 | CYCLES(cpustate, 5); |
| 1309 | 1696 | } |
| 1310 | 1697 | |
| 1698 | /* IDIV 0x02 */ | |
| 1699 | static void HC11OP(idiv)(hc11_state *cpustate) | |
| 1700 | { | |
| 1701 | UINT16 numerator = REG_D; | |
| 1702 | UINT16 denominator = cpustate->ix; | |
| 1703 | UINT16 remainder; | |
| 1704 | UINT16 result; | |
| 1311 | 1705 | |
| 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 | ||
| 1312 | 1726 | /* INCA 0x4C */ |
| 1313 | 1727 | static void HC11OP(inca)(hc11_state *cpustate) |
| 1314 | 1728 | { |
| r5077 | r5078 | |
| 1321 | 1735 | CYCLES(cpustate, 2); |
| 1322 | 1736 | } |
| 1323 | 1737 | |
| 1738 | /* INCB 0x5C */ | |
| 1739 | static 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 | } | |
| 1324 | 1749 | |
| 1750 | /* INC EXT 0x7C */ | |
| 1751 | static 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 */ | |
| 1767 | static 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 */ | |
| 1784 | static 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 | ||
| 1325 | 1800 | /* INX 0x08 */ |
| 1326 | 1801 | static void HC11OP(inx)(hc11_state *cpustate) |
| 1327 | 1802 | { |
| r5077 | r5078 | |
| 1340 | 1815 | CYCLES(cpustate, 4); |
| 1341 | 1816 | } |
| 1342 | 1817 | |
| 1818 | /* JMP IND X 0x6E */ | |
| 1819 | static 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 | } | |
| 1343 | 1825 | |
| 1826 | /* JMP IND Y 0x18 0x6E */ | |
| 1827 | static 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 | ||
| 1344 | 1834 | /* JMP EXT 0x7E */ |
| 1345 | 1835 | static void HC11OP(jmp_ext)(hc11_state *cpustate) |
| 1346 | 1836 | { |
| r5077 | r5078 | |
| 1719 | 2209 | CYCLES(cpustate, 6); |
| 1720 | 2210 | } |
| 1721 | 2211 | |
| 1722 | ||
| 1723 | 2212 | /* LSLD 0x05 */ |
| 1724 | 2213 | static void HC11OP(lsld)(hc11_state *cpustate) |
| 1725 | 2214 | { |
| r5077 | r5078 | |
| 1739 | 2228 | CYCLES(cpustate, 3); |
| 1740 | 2229 | } |
| 1741 | 2230 | |
| 2231 | /* LSRA 0x44 */ | |
| 2232 | static 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); | |
| 1742 | 2240 | |
| 2241 | CYCLES(cpustate, 2); | |
| 2242 | } | |
| 2243 | ||
| 2244 | /* LSRB 0x54 */ | |
| 2245 | static 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 */ | |
| 2258 | static 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 */ | |
| 2273 | static 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 */ | |
| 2283 | static 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 */ | |
| 2296 | static 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 */ | |
| 2310 | static 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 */ | |
| 2327 | static 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 */ | |
| 2344 | static 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 */ | |
| 2361 | static void HC11OP(nop)(hc11_state *cpustate) | |
| 2362 | { | |
| 2363 | CYCLES(cpustate, 2); | |
| 2364 | } | |
| 2365 | ||
| 1743 | 2366 | /* PSHA 0x36 */ |
| 1744 | 2367 | static void HC11OP(psha)(hc11_state *cpustate) |
| 1745 | 2368 | { |
| r5077 | r5078 | |
| 1747 | 2370 | CYCLES(cpustate, 3); |
| 1748 | 2371 | } |
| 1749 | 2372 | |
| 1750 | ||
| 1751 | 2373 | /* ORAA IMM 0x8A */ |
| 1752 | 2374 | static void HC11OP(oraa_imm)(hc11_state *cpustate) |
| 1753 | 2375 | { |
| r5077 | r5078 | |
| 1923 | 2545 | CYCLES(cpustate, 6); |
| 1924 | 2546 | } |
| 1925 | 2547 | |
| 2548 | /* ROLA 0x49 */ | |
| 2549 | static 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); | |
| 1926 | 2558 | |
| 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 */ | |
| 2569 | static 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 */ | |
| 2589 | static 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 */ | |
| 2609 | static 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 */ | |
| 2629 | static 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 | ||
| 1927 | 2645 | /* RTS 0x39 */ |
| 1928 | 2646 | static void HC11OP(rts)(hc11_state *cpustate) |
| 1929 | 2647 | { |
| r5077 | r5078 | |
| 1933 | 2651 | } |
| 1934 | 2652 | |
| 1935 | 2653 | |
| 2654 | /* SBA 0x10 */ | |
| 2655 | static 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 */ | |
| 2670 | static 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 */ | |
| 2686 | static 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 */ | |
| 2703 | static 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 */ | |
| 2720 | static 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 */ | |
| 2736 | static 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 */ | |
| 2753 | static 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 */ | |
| 2770 | static void HC11OP(sec)(hc11_state *cpustate) | |
| 2771 | { | |
| 2772 | cpustate->ccr |= CC_C; | |
| 2773 | CYCLES(cpustate, 2); | |
| 2774 | } | |
| 2775 | ||
| 1936 | 2776 | /* SEI 0x0F */ |
| 1937 | 2777 | static void HC11OP(sei)(hc11_state *cpustate) |
| 1938 | 2778 | { |
| r5077 | r5078 | |
| 1940 | 2780 | CYCLES(cpustate, 2); |
| 1941 | 2781 | } |
| 1942 | 2782 | |
| 2783 | /* SEV 0x0B */ | |
| 2784 | static void HC11OP(sev)(hc11_state *cpustate) | |
| 2785 | { | |
| 2786 | cpustate->ccr |= CC_V; | |
| 2787 | CYCLES(cpustate, 2); | |
| 2788 | } | |
| 1943 | 2789 | |
| 1944 | 2790 | /* STAA DIR 0x97 */ |
| 1945 | 2791 | static void HC11OP(staa_dir)(hc11_state *cpustate) |
| r5077 | r5078 | |
| 2075 | 2921 | } |
| 2076 | 2922 | |
| 2077 | 2923 | |
| 2924 | /* STX EXT 0xFF */ | |
| 2925 | static 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 */ | |
| 2939 | static 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 */ | |
| 2953 | static 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 */ | |
| 2967 | static 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 */ | |
| 2980 | static 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 */ | |
| 2993 | static 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 */ | |
| 3006 | static 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 */ | |
| 3028 | static 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 */ | |
| 3044 | static 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 */ | |
| 3061 | static 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 */ | |
| 3078 | static 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 */ | |
| 3095 | static 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 */ | |
| 3112 | static 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 */ | |
| 3128 | static 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 */ | |
| 3145 | static 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 */ | |
| 3162 | static 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 */ | |
| 3178 | static 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 */ | |
| 3194 | static 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 */ | |
| 3208 | static 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 */ | |
| 3223 | static 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 */ | |
| 3238 | static 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 | ||
| 2078 | 3254 | /* TAB 0x16 */ |
| 2079 | 3255 | static void HC11OP(tab)(hc11_state *cpustate) |
| 2080 | 3256 | { |
| r5077 | r5078 | |
| 2085 | 3261 | CYCLES(cpustate, 2); |
| 2086 | 3262 | } |
| 2087 | 3263 | |
| 2088 | ||
| 2089 | 3264 | /* TAP 0x06 */ |
| 2090 | 3265 | static void HC11OP(tap)(hc11_state *cpustate) |
| 2091 | 3266 | { |
| r5077 | r5078 | |
| 2094 | 3269 | CYCLES(cpustate, 2); |
| 2095 | 3270 | } |
| 2096 | 3271 | |
| 3272 | /* TBA 0x17 */ | |
| 3273 | static 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 | } | |
| 2097 | 3281 | |
| 3282 | /* TEST 0x00 */ | |
| 3283 | static 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 | ||
| 2098 | 3295 | /* TPA 0x07 */ |
| 2099 | 3296 | static void HC11OP(tpa)(hc11_state *cpustate) |
| 2100 | 3297 | { |
| r5077 | r5078 | |
| 2154 | 3351 | CYCLES(cpustate, 6); |
| 2155 | 3352 | } |
| 2156 | 3353 | |
| 3354 | /* TSX 0x30 */ | |
| 3355 | static void HC11OP(tsx)(hc11_state *cpustate) | |
| 3356 | { | |
| 3357 | cpustate->ix = cpustate->sp + 1; | |
| 3358 | CYCLES(cpustate, 3); | |
| 3359 | } | |
| 2157 | 3360 | |
| 3361 | /* TSY 0x18 0x30 */ | |
| 3362 | static void HC11OP(tsy)(hc11_state *cpustate) | |
| 3363 | { | |
| 3364 | cpustate->iy = cpustate->sp + 1; | |
| 3365 | CYCLES(cpustate, 4); | |
| 3366 | } | |
| 3367 | ||
| 3368 | /* TXS 0x35 */ | |
| 3369 | static void HC11OP(txs)(hc11_state *cpustate) | |
| 3370 | { | |
| 3371 | cpustate->sp = cpustate->ix - 1; | |
| 3372 | CYCLES(cpustate, 3); | |
| 3373 | } | |
| 3374 | ||
| 3375 | /* TYS 0x18 0x35 */ | |
| 3376 | static void HC11OP(tys)(hc11_state *cpustate) | |
| 3377 | { | |
| 3378 | cpustate->sp = cpustate->iy - 1; | |
| 3379 | CYCLES(cpustate, 4); | |
| 3380 | } | |
| 3381 | ||
| 3382 | /* WAI 0x3E */ | |
| 3383 | static 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 | ||
| 2158 | 3409 | /* XGDX 0x8F */ |
| 2159 | 3410 | static void HC11OP(xgdx)(hc11_state *cpustate) |
| 2160 | 3411 | { |
| r5077 | r5078 | |
|---|---|---|
| 30 | 30 | #define MC68HC11_IO_AD6 0x16 |
| 31 | 31 | #define MC68HC11_IO_AD7 0x17 |
| 32 | 32 | |
| 33 | #define MC68HC11_IRQ_LINE 0 | |
| 34 | ||
| 35 | typedef struct _hc11_config hc11_config; | |
| 36 | struct _hc11_config | |
| 37 | { | |
| 38 | int has_io; // I/O enable flag | |
| 39 | int internal_ram_size; | |
| 40 | }; | |
| 41 | ||
| 42 | ||
| 33 | 43 | #endif /* __MC68HC11_H__ */ |
| r5077 | r5078 | |
|---|---|---|
| 463 | 463 | { "?", 0, }, |
| 464 | 464 | { "?", 0, }, |
| 465 | 465 | { "?", 0, }, |
| 466 | { "cpy", EA_IMM | |
| 466 | { "cpy", EA_IMM16, }, | |
| 467 | 467 | { "?", 0, }, |
| 468 | 468 | { "?", 0, }, |
| 469 | 469 | { "xgdy", 0, }, |
| r5077 | r5078 | |
|---|---|---|
| 47 | 47 | { 0, 0xf4, HC11OP(andb_ext) }, |
| 48 | 48 | { 0, 0xe4, HC11OP(andb_indx) }, |
| 49 | 49 | { 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) }, | |
| 50 | 69 | { 0, 0x85, HC11OP(bita_imm) }, |
| 51 | 70 | { 0, 0x95, HC11OP(bita_dir) }, |
| 52 | 71 | { 0, 0xb5, HC11OP(bita_ext) }, |
| r5077 | r5078 | |
| 57 | 76 | { 0, 0xf5, HC11OP(bitb_ext) }, |
| 58 | 77 | { 0, 0xe5, HC11OP(bitb_indx) }, |
| 59 | 78 | { 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) }, | |
| 62 | 83 | { 0, 0x26, HC11OP(bne) }, |
| 63 | { 0, 0x2f, HC11OP(ble) }, | |
| 64 | 84 | { 0, 0x2a, HC11OP(bpl) }, |
| 65 | 85 | { 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) }, | |
| 66 | 96 | { 0, 0x8d, HC11OP(bsr) }, |
| 97 | { 0, 0x28, HC11OP(bvc) }, | |
| 98 | { 0, 0x29, HC11OP(bvs) }, | |
| 99 | { 0, 0x11, HC11OP(cba) }, | |
| 100 | { 0, 0x0c, HC11OP(clc) }, | |
| 67 | 101 | { 0, 0x0e, HC11OP(cli) }, |
| 68 | 102 | { 0, 0x4f, HC11OP(clra) }, |
| 69 | 103 | { 0, 0x5f, HC11OP(clrb) }, |
| 70 | 104 | { 0, 0x7f, HC11OP(clr_ext) }, |
| 71 | 105 | { 0, 0x6f, HC11OP(clr_indx) }, |
| 72 | 106 | { 0x18, 0x6f, HC11OP(clr_indy) }, |
| 107 | { 0, 0x0a, HC11OP(clv) }, | |
| 73 | 108 | { 0, 0x81, HC11OP(cmpa_imm) }, |
| 74 | 109 | { 0, 0x91, HC11OP(cmpa_dir) }, |
| 75 | 110 | { 0, 0xb1, HC11OP(cmpa_ext) }, |
| 76 | 111 | { 0, 0xa1, HC11OP(cmpa_indx) }, |
| 77 | { 0x18, 0x | |
| 112 | { 0x18, 0xa1, HC11OP(cmpa_indy) }, | |
| 78 | 113 | { 0, 0xc1, HC11OP(cmpb_imm) }, |
| 79 | 114 | { 0, 0xd1, HC11OP(cmpb_dir) }, |
| 80 | 115 | { 0, 0xf1, HC11OP(cmpb_ext) }, |
| 81 | 116 | { 0, 0xe1, HC11OP(cmpb_indx) }, |
| 82 | 117 | { 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) }, | |
| 83 | 123 | { 0x1a, 0x83, HC11OP(cpd_imm) }, |
| 84 | 124 | { 0x1a, 0x93, HC11OP(cpd_dir) }, |
| 85 | 125 | { 0x1a, 0xb3, HC11OP(cpd_ext) }, |
| r5077 | r5078 | |
| 91 | 131 | { 0, 0xac, HC11OP(cpx_indx) }, |
| 92 | 132 | { 0xcd, 0xac, HC11OP(cpx_indy) }, |
| 93 | 133 | { 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) }, | |
| 94 | 145 | { 0, 0x09, HC11OP(dex) }, |
| 95 | 146 | { 0x18, 0x09, HC11OP(dey) }, |
| 96 | 147 | { 0, 0x88, HC11OP(eora_imm) }, |
| r5077 | r5078 | |
| 103 | 154 | { 0, 0xf8, HC11OP(eorb_ext) }, |
| 104 | 155 | { 0, 0xe8, HC11OP(eorb_indx) }, |
| 105 | 156 | { 0x18, 0xe8, HC11OP(eorb_indy) }, |
| 157 | // { 0, 0x03, HC11OP(fdiv) }, | |
| 158 | { 0, 0x02, HC11OP(idiv) }, | |
| 106 | 159 | { 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) }, | |
| 107 | 165 | { 0, 0x08, HC11OP(inx) }, |
| 108 | 166 | { 0x18, 0x08, HC11OP(iny) }, |
| 109 | 167 | { 0, 0x7e, HC11OP(jmp_ext) }, |
| 168 | { 0, 0x6e, HC11OP(jmp_indx) }, | |
| 169 | { 0x18, 0x6e, HC11OP(jmp_indy) }, | |
| 110 | 170 | { 0, 0x9d, HC11OP(jsr_dir) }, |
| 111 | 171 | { 0, 0xbd, HC11OP(jsr_ext) }, |
| 112 | 172 | { 0, 0xad, HC11OP(jsr_indx) }, |
| r5077 | r5078 | |
| 142 | 202 | { 0x1a, 0xee, HC11OP(ldy_indx) }, |
| 143 | 203 | { 0x18, 0xee, HC11OP(ldy_indy) }, |
| 144 | 204 | { 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) }, | |
| 145 | 218 | { 0, 0x8a, HC11OP(oraa_imm) }, |
| 146 | 219 | { 0, 0x9a, HC11OP(oraa_dir) }, |
| 147 | 220 | { 0, 0xba, HC11OP(oraa_ext) }, |
| r5077 | r5078 | |
| 160 | 233 | { 0, 0x33, HC11OP(pulb) }, |
| 161 | 234 | { 0, 0x38, HC11OP(pulx) }, |
| 162 | 235 | { 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) }, | |
| 163 | 247 | { 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) }, | |
| 164 | 260 | { 0, 0x0f, HC11OP(sei) }, |
| 261 | { 0, 0x0b, HC11OP(sev) }, | |
| 165 | 262 | { 0, 0x97, HC11OP(staa_dir) }, |
| 166 | 263 | { 0, 0xb7, HC11OP(staa_ext) }, |
| 167 | 264 | { 0, 0xa7, HC11OP(staa_indx) }, |
| r5077 | r5078 | |
| 174 | 271 | { 0, 0xfd, HC11OP(std_ext) }, |
| 175 | 272 | { 0, 0xed, HC11OP(std_indx) }, |
| 176 | 273 | { 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) }, | |
| 177 | 303 | { 0, 0x16, HC11OP(tab) }, |
| 178 | 304 | { 0, 0x06, HC11OP(tap) }, |
| 305 | { 0, 0x17, HC11OP(tba) }, | |
| 306 | { 0, 0x00, HC11OP(test) }, | |
| 179 | 307 | { 0, 0x07, HC11OP(tpa) }, |
| 180 | 308 | { 0, 0x4d, HC11OP(tsta) }, |
| 181 | 309 | { 0, 0x5d, HC11OP(tstb) }, |
| 182 | 310 | { 0, 0x7d, HC11OP(tst_ext) }, |
| 183 | 311 | { 0, 0x6d, HC11OP(tst_indx) }, |
| 184 | 312 | { 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) }, | |
| 185 | 318 | { 0, 0x8f, HC11OP(xgdx) }, |
| 186 | 319 | { 0x18, 0x8f, HC11OP(xgdy) }, |
| 187 | 320 |
| r5077 | r5078 | |
|---|---|---|
| 1 | 1 | /* |
| 2 | 2 | Motorola MC68HC11 emulator |
| 3 | 3 | |
| 4 | Written by Ville Linde | |
| 4 | Written by Ville Linde & Angelo Salese | |
| 5 | ||
| 6 | TODO: | |
| 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 | ||
| 5 | 11 | */ |
| 6 | 12 | |
| 7 | 13 | #include "debugger.h" |
| r5077 | r5078 | |
| 53 | 59 | int ad_channel; |
| 54 | 60 | |
| 55 | 61 | cpu_irq_callback irq_callback; |
| 62 | UINT8 irq_state[2]; | |
| 56 | 63 | const device_config *device; |
| 57 | 64 | const address_space *program; |
| 58 | 65 | const address_space *io; |
| r5077 | r5078 | |
| 60 | 67 | int ram_position; |
| 61 | 68 | int reg_position; |
| 62 | 69 | UINT8 *internal_ram; |
| 70 | int has_io; // I/O enable flag | |
| 63 | 71 | int internal_ram_size; |
| 72 | UINT8 wait_state,stop_state; | |
| 64 | 73 | }; |
| 65 | 74 | |
| 66 | 75 | INLINE hc11_state *get_safe_token(const device_config *device) |
| r5077 | r5078 | |
| 87 | 96 | return memory_read_byte(cpustate->io, MC68HC11_IO_PORTA); |
| 88 | 97 | case 0x01: /* DDRA */ |
| 89 | 98 | return 0; |
| 99 | case 0x02: /* PIOC */ | |
| 100 | return 0; | |
| 90 | 101 | case 0x09: /* DDRD */ |
| 91 | 102 | return 0; |
| 92 | 103 | case 0x28: /* SPCR1 */ |
| r5077 | r5078 | |
| 167 | 178 | return 0; |
| 168 | 179 | } |
| 169 | 180 | |
| 170 | | |
| 181 | | |
| 171 | 182 | return 0; // Dummy |
| 172 | 183 | } |
| 173 | 184 | |
| r5077 | r5078 | |
| 256 | 267 | return; |
| 257 | 268 | |
| 258 | 269 | } |
| 259 | fatalerror("HC11: regs_w %02X, %02X", reg, value); | |
| 270 | ||
| 271 | logerror("HC11: regs_w %02X, %02X\n", reg, value); | |
| 260 | 272 | } |
| 261 | 273 | |
| 262 | 274 | /*****************************************************************************/ |
| r5077 | r5078 | |
| 276 | 288 | |
| 277 | 289 | INLINE UINT8 READ8(hc11_state *cpustate, UINT32 address) |
| 278 | 290 | { |
| 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) | |
| 280 | 292 | { |
| 281 | 293 | return hc11_regs_r(cpustate, address); |
| 282 | 294 | } |
| r5077 | r5078 | |
| 289 | 301 | |
| 290 | 302 | INLINE void WRITE8(hc11_state *cpustate, UINT32 address, UINT8 value) |
| 291 | 303 | { |
| 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) | |
| 293 | 305 | { |
| 294 | 306 | hc11_regs_w(cpustate, address, value); |
| 295 | 307 | return; |
| r5077 | r5078 | |
| 328 | 340 | hc11_state *cpustate = get_safe_token(device); |
| 329 | 341 | int i; |
| 330 | 342 | |
| 343 | const hc11_config *conf = (const hc11_config *)device->static_config; | |
| 344 | ||
| 331 | 345 | /* clear the opcode tables */ |
| 332 | 346 | for(i=0; i < 256; i++) { |
| 333 | 347 | hc11_optable[i] = HC11OP(invalid); |
| r5077 | r5078 | |
| 355 | 369 | } |
| 356 | 370 | } |
| 357 | 371 | |
| 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 | ||
| 359 | 384 | cpustate->internal_ram = auto_alloc_array(device->machine, UINT8, cpustate->internal_ram_size); |
| 360 | 385 | |
| 361 | 386 | cpustate->reg_position = 0; |
| r5077 | r5078 | |
| 370 | 395 | { |
| 371 | 396 | hc11_state *cpustate = get_safe_token(device); |
| 372 | 397 | cpustate->pc = READ16(cpustate, 0xfffe); |
| 398 | cpustate->wait_state = 0; | |
| 399 | cpustate->stop_state = 0; | |
| 373 | 400 | } |
| 374 | 401 | |
| 375 | 402 | static CPU_EXIT( hc11 ) |
| r5077 | r5078 | |
| 377 | 404 | |
| 378 | 405 | } |
| 379 | 406 | |
| 407 | /* | |
| 408 | IRQ table vectors: | |
| 409 | 0xffd6: SCI | |
| 410 | 0xffd8: SPI | |
| 411 | 0xffda: Pulse Accumulator Input Edge | |
| 412 | 0xffdc: Pulse Accumulator Overflow | |
| 413 | 0xffde: Timer Overflow | |
| 414 | 0xffe0: Timer Output Capture 5 | |
| 415 | 0xffe2: Timer Output Capture 4 | |
| 416 | 0xffe4: Timer Output Capture 3 | |
| 417 | 0xffe6: Timer Output Capture 2 | |
| 418 | 0xffe8: Timer Output Capture 1 | |
| 419 | 0xffea: Timer Input Capture 3 | |
| 420 | 0xffec: Timer Input Capture 2 | |
| 421 | 0xffee: Timer Input Capture 1 | |
| 422 | 0xfff0: Real Time Int | |
| 423 | 0xfff2: IRQ | |
| 424 | 0xfff4: XIRQ | |
| 425 | 0xfff6: SWI (Trap IRQ) | |
| 426 | 0xfff8: Illegal Opcode (NMI) | |
| 427 | 0xfffa: CO-Processor Fail | |
| 428 | 0xfffc: Clock Monitor | |
| 429 | 0xfffe: RESET | |
| 430 | */ | |
| 431 | ||
| 432 | static 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 | ||
| 456 | static 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 | ||
| 380 | 463 | static CPU_EXECUTE( hc11 ) |
| 381 | 464 | { |
| 382 | 465 | hc11_state *cpustate = get_safe_token(device); |
| r5077 | r5078 | |
| 387 | 470 | { |
| 388 | 471 | UINT8 op; |
| 389 | 472 | |
| 473 | check_irq_lines(cpustate); | |
| 474 | ||
| 390 | 475 | cpustate->ppc = cpustate->pc; |
| 391 | 476 | debugger_instruction_hook(device, cpustate->pc); |
| 392 | 477 | |
| r5077 | r5078 | |
| 405 | 490 | |
| 406 | 491 | switch (state) |
| 407 | 492 | { |
| 493 | case CPUINFO_INT_INPUT_STATE + MC68HC11_IRQ_LINE: set_irq_line(cpustate, MC68HC11_IRQ_LINE, info->i); break; | |
| 494 | ||
| 408 | 495 | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 409 | 496 | case CPUINFO_INT_PC: cpustate->pc = info->i; break; |
| 410 | case CPUINFO_INT_REGISTER + HC11_PC: cpustate->pc = info->i; | |
| 497 | case CPUINFO_INT_REGISTER + HC11_PC: cpustate->pc = info->i; | |
| 411 | 498 | case CPUINFO_INT_REGISTER + HC11_SP: cpustate->sp = info->i; break; |
| 412 | 499 | case CPUINFO_INT_REGISTER + HC11_A: cpustate->d.d8.a = info->i; break; |
| 413 | 500 | case CPUINFO_INT_REGISTER + HC11_B: cpustate->d.d8.b = info->i; break; |
| r5077 | r5078 | |
| 423 | 510 | switch(state) |
| 424 | 511 | { |
| 425 | 512 | /* --- 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; | |
| 436 | 523 | |
| 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; | |
| 446 | 533 | |
| 447 | case CPUINFO_INT_INPUT_STATE: | |
| 534 | case CPUINFO_INT_INPUT_STATE + MC68HC11_IRQ_LINE: | |
| 448 | 535 | |
| 449 | case CPUINFO_INT_PREVIOUSPC: /* not implemented */ | |
| 536 | case CPUINFO_INT_PREVIOUSPC: /* not implemented */ | |
| 450 | 537 | |
| 451 | 538 | 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; | |
| 458 | 545 | |
| 459 | 546 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 460 | 547 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mc68hc11); break; |
| r5077 | r5078 | |
|---|---|---|
| 2106 | 2106 | { |
| 2107 | 2107 | if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2108 | 2108 | { |
| 2109 | void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc); | |
| 2109 | void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc ^ ppc->codexor); | |
| 2110 | 2110 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,dword |
| 2111 | 2111 | UML_CMP(block, IREG(0), IMM(seqhead->opptr.l[0])); // cmp i0,*opptr |
| 2112 | 2112 | UML_EXHc(block, IF_NE, ppc->impstate->nocode, IMM(seqhead->pc)); // exne nocode,seqhead->pc |
| r5077 | r5078 | |
| 2120 | 2120 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) |
| 2121 | 2121 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2122 | 2122 | { |
| 2123 | void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc); | |
| 2123 | void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc ^ ppc->codexor); | |
| 2124 | 2124 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,dword |
| 2125 | 2125 | UML_CMP(block, IREG(0), IMM(curdesc->opptr.l[0])); // cmp i0,*opptr |
| 2126 | 2126 | UML_EXHc(block, IF_NE, ppc->impstate->nocode, IMM(seqhead->pc)); // exne nocode,seqhead->pc |
| 2127 | 2127 | } |
| 2128 | 2128 | #else |
| 2129 | 2129 | 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); | |
| 2131 | 2131 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,dword |
| 2132 | 2132 | sum += seqhead->opptr.l[0]; |
| 2133 | 2133 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) |
| 2134 | 2134 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2135 | 2135 | { |
| 2136 | base = memory_decrypted_read_ptr(ppc->program, curdesc->physpc); | |
| 2136 | base = memory_decrypted_read_ptr(ppc->program, curdesc->physpc ^ ppc->codexor); | |
| 2137 | 2137 | UML_LOAD(block, IREG(1), base, IMM(0), DWORD); // load i1,base,dword |
| 2138 | 2138 | UML_ADD(block, IREG(0), IREG(0), IREG(1)); // add i0,i0,i1 |
| 2139 | 2139 | sum += curdesc->opptr.l[0]; |
| r5077 | r5078 | |
|---|---|---|
| 211 | 211 | fatalerror("not enough bits in encoding '%s %s' %d", |
| 212 | 212 | ops[0],ops[1],bit); |
| 213 | 213 | } |
| 214 | while (isspace(*p)) p++; | |
| 214 | while (isspace((UINT8)*p)) p++; | |
| 215 | 215 | if (*p) Op[i].extcode = *p; |
| 216 | 216 | Op[i].bits = bits; |
| 217 | 217 | Op[i].mask = mask; |
| r5077 | r5078 | |
|---|---|---|
| 321 | 321 | Op[i].type = type; |
| 322 | 322 | |
| 323 | 323 | /* 2 byte code ? */ |
| 324 | while (isspace(*p)) p++; | |
| 324 | while (isspace((UINT8)*p)) p++; | |
| 325 | 325 | if( (*p) ) |
| 326 | 326 | Op[i].type |= 0x10; |
| 327 | 327 | /* number of param */ |
| r5077 | r5078 | |
|---|---|---|
| 1495 | 1495 | } |
| 1496 | 1496 | } |
| 1497 | 1497 | |
| 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); | |
| 1524 | 1499 | |
| 1525 | debugger_instruction_hook(device, cpustate->IR); | |
| 1526 | } | |
| 1527 | ||
| 1528 | 1500 | if (cpustate->IDLE) |
| 1529 | 1501 | { /* IDLE instruction has halted execution */ |
| 1530 | 1502 | #if EXTERNAL_INSTRUCTION_DECODING |
| r5077 | r5078 | |
|---|---|---|
| 373 | 373 | fatalerror("not enough bits in encoding '%s %s' %d", |
| 374 | 374 | ops[0],ops[1],bit); |
| 375 | 375 | } |
| 376 | while (isspace(*p)) p++; | |
| 376 | while (isspace((UINT8)*p)) p++; | |
| 377 | 377 | if (*p) Op[i].extcode = *p; |
| 378 | 378 | Op[i].bits = bits; |
| 379 | 379 | Op[i].mask = mask; |
| r5077 | r5078 | |
|---|---|---|
| 137 | 137 | fatalerror("not enough bits in encoding '%s %s' %d", |
| 138 | 138 | ops[0],ops[1],bit); |
| 139 | 139 | } |
| 140 | while (isspace(*p)) p++; | |
| 140 | while (isspace((UINT8)*p)) p++; | |
| 141 | 141 | if (*p) Op[i].extcode = *p; |
| 142 | 142 | Op[i].bits = bits; |
| 143 | 143 | Op[i].mask = mask; |
| r5077 | r5078 | |
|---|---|---|
| 278 | 278 | c1 = *chk1++; |
| 279 | 279 | c2 = *chk2++; |
| 280 | 280 | |
| 281 | if (tolower(c1) != tolower(c2)) | |
| 281 | if (tolower((UINT8)c1) != tolower((UINT8)c2)) | |
| 282 | 282 | return 0; |
| 283 | 283 | if (!c1) |
| 284 | 284 | return 0; |
| r5077 | r5078 | |
| 381 | 381 | |
| 382 | 382 | // Copy the checksum (and make it lowercase) |
| 383 | 383 | for (i=0;i<info->size*2;i++) |
| 384 | checksum[i] = tolower(data[i]); | |
| 384 | checksum[i] = tolower((UINT8)data[i]); | |
| 385 | 385 | |
| 386 | 386 | checksum[info->size*2] = '\0'; |
| 387 | 387 | |
| r5077 | r5078 | |
| 395 | 395 | |
| 396 | 396 | for (i = 0; i < size * 2; i++) |
| 397 | 397 | { |
| 398 | c = tolower(*data++); | |
| 398 | c = tolower((UINT8)*data++); | |
| 399 | 399 | |
| 400 | 400 | if (c >= '0' && c <= '9') |
| 401 | 401 | c -= '0'; |
| r5077 | r5078 | |
| 590 | 590 | |
| 591 | 591 | strcpy(temp, hash_function_name(func)); |
| 592 | 592 | for (j = 0; temp[j]; j++) |
| 593 | temp[j] = toupper(temp[j]); | |
| 593 | temp[j] = toupper((UINT8)temp[j]); | |
| 594 | 594 | strcat(buffer, temp); |
| 595 | 595 | strcat(buffer, "("); |
| 596 | 596 | |
| r5077 | r5078 | |
| 637 | 637 | |
| 638 | 638 | for (i = 0; (hash[i] != '#') && (i < len); i++) |
| 639 | 639 | { |
| 640 | if (!isxdigit(hash[i])) | |
| 640 | if (!isxdigit((UINT8)hash[i])) | |
| 641 | 641 | return FALSE; |
| 642 | 642 | } |
| 643 | 643 | if (hash[i] != '#') |
| r5077 | r5078 | |
|---|---|---|
| 3244 | 3244 | /* look for files ending in .png with a name not larger then 9 chars*/ |
| 3245 | 3245 | if ((length > 4) && (length <= CROSSHAIR_PIC_NAME_LENGTH + 4) && |
| 3246 | 3246 | 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') | |
| 3250 | 3250 | |
| 3251 | 3251 | { |
| 3252 | 3252 | /* remove .png from length */ |
| r5077 | r5078 | |
| 3557 | 3557 | |
| 3558 | 3558 | /* build a name for it */ |
| 3559 | 3559 | for (src = dir->name; *src != 0 && *src != '.' && dst < &drivername[ARRAY_LENGTH(drivername) - 1]; src++) |
| 3560 | *dst++ = tolower(*src); | |
| 3560 | *dst++ = tolower((UINT8)*src); | |
| 3561 | 3561 | *dst = 0; |
| 3562 | 3562 | |
| 3563 | 3563 | /* find it in the array */ |
| r5077 | r5078 | |
|---|---|---|
| 527 | 527 | char *strtemp; |
| 528 | 528 | |
| 529 | 529 | /* trim any leading spaces */ |
| 530 | while (*str != 0 && isspace(*str)) | |
| 530 | while (*str != 0 && isspace((UINT8)*str)) | |
| 531 | 531 | str++; |
| 532 | 532 | |
| 533 | 533 | /* bail if we're done */ |
| r5077 | r5078 | |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | /* 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); | |
| 543 | 543 | origspace = *strtemp; |
| 544 | 544 | *strtemp = 0; |
| 545 | 545 |
| r5077 | r5078 | |
|---|---|---|
| 205 | 205 | for ( ; *source && *target; target++) |
| 206 | 206 | { |
| 207 | 207 | /* do a case insensitive match */ |
| 208 | int match = (tolower(*source) == tolower(*target)); | |
| 208 | int match = (tolower((UINT8)*source) == tolower((UINT8)*target)); | |
| 209 | 209 | |
| 210 | 210 | /* if we matched, advance the source */ |
| 211 | 211 | if (match) |
| r5077 | r5078 | |
|---|---|---|
| 465 | 465 | { |
| 466 | 466 | if (description != NULL) |
| 467 | 467 | { |
| 468 | while (isspace(**description)) | |
| 468 | while (isspace((UINT8)**description)) | |
| 469 | 469 | *description += 1; |
| 470 | 470 | if (**description == 0) |
| 471 | 471 | *description = MENU_SEPARATOR_ITEM; |
| r5077 | r5078 | |
|---|---|---|
| 176 | 176 | |
| 177 | 177 | for (p = tag; *p != 0; p++) |
| 178 | 178 | { |
| 179 | if (*p != tolower(*p)) | |
| 179 | if (*p != tolower((UINT8)*p)) | |
| 180 | 180 | { |
| 181 | 181 | mame_printf_error("%s: %s has %s with tag '%s' containing upper-case characters\n", driver->source_file, driver->name, object, tag); |
| 182 | 182 | error = TRUE; |
| r5077 | r5078 | |
| 532 | 532 | |
| 533 | 533 | /* make sure the year is only digits, '?' or '+' */ |
| 534 | 534 | for (s = driver->year; *s; s++) |
| 535 | if (!isdigit(*s) && *s != '?' && *s != '+') | |
| 535 | if (!isdigit((UINT8)*s) && *s != '?' && *s != '+') | |
| 536 | 536 | { |
| 537 | 537 | mame_printf_error("%s: %s has an invalid year '%s'\n", driver->source_file, driver->name, driver->year); |
| 538 | 538 | error = TRUE; |
| r5077 | r5078 | |
| 702 | 702 | |
| 703 | 703 | /* make sure it's all lowercase */ |
| 704 | 704 | for (s = last_name; *s; s++) |
| 705 | if (tolower(*s) != *s) | |
| 705 | if (tolower((UINT8)*s) != *s) | |
| 706 | 706 | { |
| 707 | 707 | mame_printf_error("%s: %s has upper case ROM name %s\n", driver->source_file, driver->name, last_name); |
| 708 | 708 | error = TRUE; |
| r5077 | r5078 | |
|---|---|---|
| 10 | 10 | ****************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "corestr.h" |
| 13 | #include "osdcore.h" | |
| 13 | 14 | #include <ctype.h> |
| 14 | 15 | #include <stdlib.h> |
| 15 | 16 | |
| r5077 | r5078 | |
| 22 | 23 | { |
| 23 | 24 | for (;;) |
| 24 | 25 | { |
| 25 | int c1 = tolower(*s1++); | |
| 26 | int c2 = tolower(*s2++); | |
| 26 | int c1 = tolower((UINT8)*s1++); | |
| 27 | int c2 = tolower((UINT8)*s2++); | |
| 27 | 28 | if (c1 == 0 || c1 != c2) |
| 28 | 29 | return c1 - c2; |
| 29 | 30 | } |
| r5077 | r5078 | |
| 39 | 40 | size_t i; |
| 40 | 41 | for (i = 0; i < n; i++) |
| 41 | 42 | { |
| 42 | int c1 = tolower(*s1++); | |
| 43 | int c2 = tolower(*s2++); | |
| 43 | int c1 = tolower((UINT8)*s1++); | |
| 44 | int c2 = tolower((UINT8)*s2++); | |
| 44 | 45 | if (c1 == 0 || c1 != c2) |
| 45 | 46 | return c1 - c2; |
| 46 | 47 | } |
| r5077 | r5078 | |
|---|---|---|
| 103 | 103 | if (newstr != NULL) |
| 104 | 104 | { |
| 105 | 105 | for (i = 0; input[i] != 0; i++) |
| 106 | newstr[i] = tolower(input[i]); | |
| 106 | newstr[i] = tolower((UINT8)input[i]); | |
| 107 | 107 | newstr[i] = 0; |
| 108 | 108 | } |
| 109 | 109 | |
| r5077 | r5078 | |
| 710 | 710 | char *end = start + strlen(start); |
| 711 | 711 | |
| 712 | 712 | /* first strip leading spaces */ |
| 713 | while (*start && isspace(*start)) | |
| 713 | while (*start && isspace((UINT8)*start)) | |
| 714 | 714 | start++; |
| 715 | 715 | |
| 716 | 716 | /* then strip trailing spaces */ |
| 717 | while (end > start && isspace(end[-1])) | |
| 717 | while (end > start && isspace((UINT8)end[-1])) | |
| 718 | 718 | end--; |
| 719 | 719 | |
| 720 | 720 | /* if nothing left, just free it */ |
| r5077 | r5078 | |
|---|---|---|
| 498 | 498 | const char *s1 = str1->text; |
| 499 | 499 | |
| 500 | 500 | /* 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)) | |
| 502 | 502 | s1++, str2++; |
| 503 | return tolower(*s1) - tolower(*str2); | |
| 503 | return tolower((UINT8)*s1) - tolower((UINT8)*str2); | |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | |
| r5077 | r5078 | |
| 515 | 515 | int result; |
| 516 | 516 | |
| 517 | 517 | /* 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)) | |
| 519 | 519 | s1++, str2++; |
| 520 | result = (count == -1) ? 0 : tolower(*s1) - tolower(*str2); | |
| 520 | result = (count == -1) ? 0 : tolower((UINT8)*s1) - tolower((UINT8)*str2); | |
| 521 | 521 | if (result == 0 && *s1 != 0) |
| 522 | 522 | result = 1; |
| 523 | 523 | return result; |
| r5077 | r5078 | |
| 669 | 669 | |
| 670 | 670 | /* just toupper() on all characters */ |
| 671 | 671 | for (text = str->text; *text != 0; text++) |
| 672 | *text = toupper(*text); | |
| 672 | *text = toupper((UINT8)*text); | |
| 673 | 673 | |
| 674 | 674 | return str; |
| 675 | 675 | } |
| r5077 | r5078 | |
| 686 | 686 | |
| 687 | 687 | /* just tolower() on all characters */ |
| 688 | 688 | for (text = str->text; *text != 0; text++) |
| 689 | *text = tolower(*text); | |
| 689 | *text = tolower((UINT8)*text); | |
| 690 | 690 | |
| 691 | 691 | return str; |
| 692 | 692 | } |
| r5077 | r5078 | |
| 702 | 702 | char *ptr; |
| 703 | 703 | |
| 704 | 704 | /* 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--) | |
| 706 | 706 | *ptr = 0; |
| 707 | 707 | |
| 708 | 708 | /* 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++) ; | |
| 710 | 710 | if (ptr > str->text) |
| 711 | 711 | astring_substr(str, ptr - str->text, -1); |
| 712 | 712 |
| r5077 | r5078 | |
|---|---|---|
| 884 | 884 | |
| 885 | 885 | /* work backwards checking for a match */ |
| 886 | 886 | while (extlen > 0) |
| 887 | if (tolower(filename[--namelen]) != tolower(extension[--extlen])) | |
| 887 | if (tolower((UINT8)filename[--namelen]) != tolower((UINT8)extension[--extlen])) | |
| 888 | 888 | { |
| 889 | 889 | matches = FALSE; |
| 890 | 890 | break; |
| r5077 | r5078 | |
|---|---|---|
| 483 | 483 | |
| 484 | 484 | /* find the name */ |
| 485 | 485 | for (optionname = buffer; *optionname != 0; optionname++) |
| 486 | if (!isspace(*optionname)) | |
| 486 | if (!isspace((UINT8)*optionname)) | |
| 487 | 487 | break; |
| 488 | 488 | |
| 489 | 489 | /* skip comments */ |
| r5077 | r5078 | |
| 492 | 492 | |
| 493 | 493 | /* scan forward to find the first space */ |
| 494 | 494 | for (temp = optionname; *temp != 0; temp++) |
| 495 | if (isspace(*temp)) | |
| 495 | if (isspace((UINT8)*temp)) | |
| 496 | 496 | break; |
| 497 | 497 | |
| 498 | 498 | /* if we hit the end early, print a warning and continue */ |
| r5077 | r5078 | |
| 973 | 973 | int i; |
| 974 | 974 | |
| 975 | 975 | /* strip off leading/trailing spaces */ |
| 976 | while (isspace(*datastart) && datastart <= dataend) | |
| 976 | while (isspace((UINT8)*datastart) && datastart <= dataend) | |
| 977 | 977 | datastart++; |
| 978 | while (isspace(*dataend) && datastart <= dataend) | |
| 978 | while (isspace((UINT8)*dataend) && datastart <= dataend) | |
| 979 | 979 | dataend--; |
| 980 | 980 | |
| 981 | 981 | /* strip off quotes */ |
| r5077 | r5078 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | Source Changes: |
| 51 | 51 | ---------------- |
| 52 | - The core is based on MAME 0.132u | |
| 52 | - The core is based on MAME 0.132u2. This incorporates all features of the | |
| 53 | 53 | update to this core. [MAME team] |
| 54 | 54 | |
| 55 | 55 | - Added support for passing around 'deleted address mark' information |
| r5077 | r5078 | |
|---|---|---|
| 1168 | 1168 | [Smitdogg, cricri_pingouin, incog, B. Sparks, ANY] |
| 1169 | 1169 | Streets of Rage (Mega-Tech) |
| 1170 | 1170 | [Smitdogg, cricri_pingouin, incog, B. Sparks, ANY] |
| 1171 |
| Previous | 15994 Revisions | Next |