Previous 15994 Revisions Next

r1650 Sunday 3rd February, 2008 at 16:04:45 UTC by Nathan Woods
Updated to MAME 0.122u8 core
[ROOT]makefile
[docs]messnew.txt
[src/build]build.mak png2bdc.c
[src/emu]cpuexec.c cpuexec.h cpuint.c cpuintrf.c debugger.h deprecat.h* drawgfx.c drawgfx.h driver.h emu.mak emuopts.c emupal.c inptport.c inptport.h input.c mame.c mame.h memory.c memory.h profiler.c render.c rendlay.c romload.c sndintrf.c sound.c state.c streams.c streams.h tilemap.c timer.c ui.c uigfx.c uimenu.c video.c
[src/emu/audio]generic.c
[src/emu/cpu]cpu.mak x64drc.c x86drc.c
[src/emu/cpu/adsp2100]adsp2100.c
[src/emu/cpu/alph8201]alph8201.c alph8201.h
[src/emu/cpu/apexc]apexc.c apexc.h
[src/emu/cpu/arm]arm.c arm.h
[src/emu/cpu/arm7]arm7.c arm7core.c arm7core.h arm7exec.c
[src/emu/cpu/asap]asap.c
[src/emu/cpu/ccpu]ccpu.c ccpu.h
[src/emu/cpu/cdp1802]cdp1802.c cdp1802.h
[src/emu/cpu/cop400]cop400.h cop410.c cop420.c
[src/emu/cpu/cp1610]cp1610.c cp1610.h
[src/emu/cpu/dsp32]dsp32.c dsp32ops.c
[src/emu/cpu/dsp56k]dsp56dsm.c dsp56k.c dsp56ops.c
[src/emu/cpu/e132xs]e132xs.c e132xs.h
[src/emu/cpu/f8]f8.c
[src/emu/cpu/g65816]g65816.c g65816.h g65816cm.h g65816op.h
[src/emu/cpu/h6280]h6280.c h6280.h
[src/emu/cpu/h83002]h83002.c h8disasm.c h8periph.c h8priv.h
[src/emu/cpu/hd6309]hd6309.c
[src/emu/cpu/i386]i386.c i386.h
[src/emu/cpu/i8039]i8039.c i8039.h
[src/emu/cpu/i8051]i8051.c i8051.h
[src/emu/cpu/i8085]i8085.c i8085.h
[src/emu/cpu/i86]i286.c i86.c
[src/emu/cpu/i8x41]i8x41.c i8x41.h
[src/emu/cpu/i960]i960.c
[src/emu/cpu/jaguar]jaguar.c
[src/emu/cpu/konami]konami.c konami.h
[src/emu/cpu/lh5801]lh5801.c
[src/emu/cpu/m37710]m37710.c m37710.h m37710cm.h m37710op.h
[src/emu/cpu/m6502]m4510.c m4510.h m6502.c m6502.h m6509.c m65ce02.c m65ce02.h
[src/emu/cpu/m6800]m6800.c m6800.h
[src/emu/cpu/m68000]m68k.h m68kcpu.c m68kcpu.h m68kmame.c m68kmame.h
[src/emu/cpu/m6805]m6805.c m6805.h
[src/emu/cpu/m6809]m6809.c
[src/emu/cpu/mb86233]mb86233.c
[src/emu/cpu/mb88xx]mb88xx.c mb88xx.h
[src/emu/cpu/mc68hc11]mc68hc11.c mc68hc11.h
[src/emu/cpu/minx]minx.c minx.h
[src/emu/cpu/mips]mdrc64.c mdrcold.c mips3.c mips3com.c mips3com.h mips3drc.c psx.c psx.h r3000.c
[src/emu/cpu/nec]nec.c nec.h
[src/emu/cpu/pdp1]pdp1.c pdp1.h tx0.c tx0.h
[src/emu/cpu/pic16c5x]16c5xdsm.c pic16c5x.c pic16c5x.h
[src/emu/cpu/powerpc]ppc.c ppc.h ppc403.c ppc602.c ppc603.c ppc_mem.c ppcdrc.c
[src/emu/cpu/rsp]rsp.c rsp.h
[src/emu/cpu/s2650]s2650.c s2650.h
[src/emu/cpu/saturn]saturn.c saturn.h
[src/emu/cpu/sc61860]sc61860.c sc61860.h
[src/emu/cpu/se3208]se3208.c se3208.h
[src/emu/cpu/sh2]sh2.c sh2.h
[src/emu/cpu/sh4]sh4.c sh4.h
[src/emu/cpu/sharc]sharc.c sharc.h sharcops.c
[src/emu/cpu/sm8500]sm8500.c sm8500.h
[src/emu/cpu/spc700]spc700.c
[src/emu/cpu/ssp1610]ssp1610.c ssp1610.h
[src/emu/cpu/t11]t11.c t11.h
[src/emu/cpu/tlcs90]tlcs90.c tlcs90.h
[src/emu/cpu/tms32010]32010dsm.c tms32010.c tms32010.h
[src/emu/cpu/tms32025]32025dsm.c tms32025.c tms32025.h
[src/emu/cpu/tms32031]32031ops.c tms32031.c
[src/emu/cpu/tms32051]tms32051.c tms32051.h
[src/emu/cpu/tms34010]tms34010.c tms34010.h
[src/emu/cpu/tms7000]tms7000.c tms7000.h
[src/emu/cpu/tms9900]99xxcore.h tms9900.h
[src/emu/cpu/upd7810]upd7810.c upd7810.h
[src/emu/cpu/v30mz]v30mz.c
[src/emu/cpu/v60]v60.c v60d.c
[src/emu/cpu/v810]v810.c v810.h
[src/emu/cpu/z180]z180.c z180.h z180op.c z180ops.h z180tbl.h
[src/emu/cpu/z80]z80.c z80.h
[src/emu/cpu/z8000]z8000.c z8000.h
[src/emu/cpu/z80gb]z80gb.c z80gb.h
[src/emu/debug]debugcmd.c debugcmt.c debugcon.c debugcpu.c
[src/emu/drivers]xtal.h
[src/emu/machine]6526cia.c 6532riot.c 6821pia.c 6840ptm.c 6840ptm.h 74181.c 8042kbdc.c 8237dma.c 8257dma.c ds1302.c generic.c idectrl.c laserdsc.c mc146818.c msm6242.c rtc65271.c timekpr.c tmp68301.c z80ctc.c z80dma.c
[src/emu/sound]c6280.c cdp1869.c discrete.c filter.c flt_rc.c flt_vol.c hc55516.c msm5205.c nes_apu.c rf5c400.c s14001a.c samples.c scsp.c sid.c sid6581.c sn76477.c speaker.c vlm5030.c votrax.c wave.c
[src/emu/video]cdp1869.c generic.c poly.c rgbsse.h tms9928a.c v9938.c vector.c voodoo.c
[src/lib/util]cdrom.c chd.c chd.h harddisk.c palette.h sha1.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]amiga.c atarijsa.c aztarac.c cage.c carnival.c cchasm.c cinemat.c cyberbal.c dcs.c dkong.c exidy.c exidy440.c firetrk.c galaxian.c gottlieb.c gridlee.c gyruss.c harddriv.c irem.c irem.h jaguar.c leland.c mario.c mcr.c mcr.h n8080.c namco54.c namcoc7x.c phoenix.c pleiads.c redalert.c scramble.c segag80r.c segasnd.c seibu.c senjyo.c spacefb.c starwars.c system16.c taito_en.c taitosnd.c timeplt.c timeplt.h trackfld.c turbo.c tx1.c williams.c
[src/mame/drivers]1942.c 1943.c 20pacgal.c 2mindril.c 40love.c 8080bw.c 88games.c ace.c acommand.c actfancr.c aerofgt.c airbustr.c alg.c aliens.c alpha68k.c ampoker2.c* amspdwy.c angelkds.c appoooh.c aquarium.c arabian.c arcadecl.c argus.c armedf.c artmagic.c ashnojoe.c asterix.c astrocde.c astrof.c asuka.c atarig42.c atarigt.c atarigx2.c atarisy2.c ataxx.c atetris.c backfire.c balsente.c baraduke.c batman.c battlane.c battlera.c battlnts.c bbusters.c beathead.c bfcobra.c bfm_sc2.c bigevglf.c bigfghtr.c bionicc.c bishi.c bishjan.c bking.c* bladestl.c blktiger.c blmbycar.c blockhl.c blockout.c blstroid.c blueprnt.c bmcbowl.c bnstars.c boogwing.c bottom9.c boxer.c brkthru.c btime.c btoads.c bublbobl.c buggychl.c bwidow.c bwing.c cabal.c capbowl.c carjmbre.c carpolo.c carrera.c cave.c cbuster.c ccastles.c cchasm.c cclimber.c centiped.c cham24.c champbas.c cherrym.c cherrym2.c chinagat.c chinsan.c chqflag.c cidelsa.c cinemat.c circusc.c cischeat.c cliffhgr.c cloak.c cloud9.c clshroad.c cninja.c cntsteer.c cojag.c combatsc.c compgolf.c contra.c coolpool.c coolridr.c cop01.c cosmic.c cowrace.c cps1.c cps2.c cps3.c crbaloon.c crgolf.c crimfght.c crospang.c crshrace.c crystal.c cshooter.c cubocd32.c cvs.c cyberbal.c cybertnk.c dacholer.c darius.c darkhors.c darkmist.c darkseal.c dassault.c dblewing.c dbz.c dcheese.c ddayjlc.c ddealer.c ddenlovr.c ddragon.c ddragon3.c ddrible.c deadang.c dec0.c dec8.c deco156.c deco32.c deco_mlc.c deniam.c destroyr.c dgpix.c dietgo.c discoboy.c diverboy.c djboy.c djmain.c dkong.c dlair.c dmndrby.c dogfgt.c dominob.c dooyong.c dreamwld.c dribling.c dunhuang.c dwarfd.c dynax.c egghunt.c enigma2.c eolith.c eolithsp.c eprom.c equites.c ertictac.c esd16.c esh.c espial.c ettrivia.c exctsccr.c exedexes.c exidy440.c expro02.c exprraid.c exterm.c exzisus.c f1gp.c fantland.c fastlane.c fgoal.c filetto.c finalizr.c findout.c firebeat.c firetrap.c fitfight.c flkatck.c flower.c flstory.c fortecar.c fromanc2.c fromance.c funkyjet.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaelco3d.c gaiden.c galaga.c galaxian.c galgames.c* galivan.c galpani2.c galpani3.c galpanic.c galspnbl.c gamecstl.c gameplan.c gaplus.c gauntlet.c gberet.c gbusters.c genesis.c getrivia.c gijoe.c ginganin.c gladiatr.c glass.c goal92.c goodejan.c gotcha.c gotya.c gpworld.c gradius3.c grchamp.c groundfx.c gstream.c gstriker.c gsword.c gticlub.c gtipoker.c gunbustr.c gundealr.c gunpey.c gyruss.c hal21.c halleys.c hcastle.c hexion.c higemaru.c hitme.c hng64.c homedata.c hornet.c hotblock.c hshavoc.c hyprduel.c igs_180.c igs_blit.c ikki.c imolagp.c intrscti.c inufuku.c iqblock.c irobot.c ironhors.c istellar.c itech32.c itech8.c jack.c jackpool.c jchan.c jcross.c jedi.c jpmimpct.c jrpacman.c junofrst.c kaneko16.c kangaroo.c karnov.c kchamp.c kingobox.c kingpin.c kinst.c kncljoe.c konamigq.c konamigx.c konamim2.c kopunch.c ksys573.c kyugo.c labyrunr.c ladybug.c ladyfrog.c laserbas.c laserbat.c lasso.c lastduel.c lastfght.c legionna.c leland.c lemmings.c lethal.c limenko.c littlerb.c lkage.c lockon.c looping.c lordgun.c lsasquad.c lucky8.c m107.c m52.c* m57.c* m58.c* m62.c m72.c m92.c macrossp.c madalien.c madmotor.c magic10.c magmax.c mainevt.c mainsnk.c mappy.c marinedt.c mario.c marvins.c mastboy.c matmania.c maxaflex.c mazerbla.c mcatadv.c mcr3.c meadows.c mediagx.c megadriv.c megaplay.c megasys1.c megatech.c megazone.c meijinsn.c merit.c metlclsh.c metro.c mgolf.c micro3d.c midvunit.c midzeus.c mikie.c miniboy7.c mirage.c missb2.c missile.c mitchell.c mlanding.c model1.c model2.c model3.c mogura.c moo.c mouser.c mpu4.c mpu4drvr.c mrflea.c ms32.c msisaac.c mugsmash.c multigam.c munchmo.c murogem.c mwarr.c mystston.c mystwarr.c namcona1.c namconb1.c namcos1.c namcos12.c namcos21.c namcos22.c namcos23.c namcos86.c naomi.c nbmj9195.c nemesis.c neodrvr.c neogeo.c ninjakd2.c ninjaw.c niyanpai.c nmg5.c nmk16.c nwk-tr.c nycaptor.c nyny.c offtwall.c ojankohs.c olibochu.c omegrace.c oneshot.c onetwo.c opwolf.c othldrby.c othunder.c overdriv.c pacland.c pacman.c pandoras.c panicr.c parodius.c pasha2.c pbaction.c pcktgal.c peplus.c pgm.c pingpong.c pipedrm.c pipeline.c pkscram.c pktgaldx.c plygonet.c pntnpuzl.c pokechmp.c polepos.c policetr.c polyplay.c poolshrk.c pooyan.c popper.c powerins.c prehisle.c psikyo.c psikyo4.c psikyosh.c psychic5.c punchout.c pushman.c qdrmfgp.c quizo.c r2dtank.c rabbit.c rainbow.c rallyx.c rampart.c rastan.c rbmk.c realbrk.c redalert.c redclash.c relief.c renegade.c retofinv.c rockola.c rockrage.c rocnrope.c rohga.c rollerg.c route16.c royalmah.c rpunch.c runaway.c rungun.c sandscrp.c sangho.c sauro.c sbasketb.c sbowling.c sbrkout.c sbugger.c scotrsht.c scramble.c seattle.c segac2.c segae.c segag80r.c segag80v.c segahang.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segas32.c segaxbd.c segaybd.c seibuspi.c seicross.c senjyo.c seta.c seta2.c sf.c sg1000a.c sgladiat.c shadfrce.c shangha3.c shanghai.c shangkid.c shaolins.c shisen.c shootout.c shougi.c shuuz.c sidearms.c sidepckt.c silkroad.c simpl156.c simpsons.c skullxbo.c skychut.c skykid.c skylncr.c slapfght.c slapshot.c sliver.c smstrv.c snk.c snk68.c snowbros.c solomon.c sonson.c spaceg.c spbactn.c spcforce.c spdodgeb.c speedspn.c spiders.c splash.c sprcros2.c sprint8.c spy.c srmp2.c srmp6.c srumbler.c ssfindo.c sshangha.c sslam.c ssozumo.c sspeedr.c ssv.c st0016.c stadhero.c starfire.c starshp1.c starwars.c steaser.c stepstag.c strnskil.c stv.c stvinit.c suna16.c suna8.c supbtime.c superchs.c superdq.c superqix.c supertnk.c suprgolf.c suprloco.c suprnova.c suprridr.c suprslam.c surpratk.c system1.c system16.c system18.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_x.c taito_z.c taitoair.c taitojc.c taitosj.c taitowlf.c talbot.c tank8.c tankbatt.c taotaido.c tatsumi.c tbowl.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c tempest.c tetrisp2.c tetriunk.c thayers.c thedeep.c thunderj.c thunderx.c tigeroad.c timelimt.c timeplt.c tmaster.c tmnt.c tnzs.c toaplan1.c toaplan2.c toki.c toobin.c topshoot.c topspeed.c toratora.c toypop.c tp84.c travrusa.c triplhnt.c trvmadns.c trvquest.c tryout.c tsamurai.c ttchamp.c tubep.c tumbleb.c tumblep.c turbo.c turbosub.c tutankhm.c twin16.c twincobr.c tx1.c uapce.c ultraman.c ultrsprt.c undrfire.c unico.c vamphalf.c vaportra.c vastar.c vball.c vegaeo.c vegas.c vendetta.c vertigo.c vicdual.c videopin.c vmetal.c volfied.c vroulet.c vsnes.c vulgus.c wardner.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c wheelfir.c williams.c wilytowr.c wink.c wiping.c witch.c wwfsstar.c wwfwfest.c xain.c xexex.c xmen.c xxmissio.c xyonix.c yamato.c yunsun16.c yunsung8.c zaccaria.c zaxxon.c zerozone.c zn.c zr107.c
[src/mame/includes]20pacgal.h* arabian.h cclimber.h centiped.h crgolf.h exidy440.h jedi.h kangaroo.h leland.h lockon.h* m52.h* m57.h* m58.h* m62.h* pooyan.h* starfire.h system16.h timeplt.h* tutankhm.h* williams.h
[src/mame/layout]ampoker2.lay*
[src/mame/machine]ajax.c amiga.c asic65.c atari.c atarifb.c atarigen.c balsente.c beezer.c bigevglf.c bublbobl.c buggychl.c carpolo.c cps2crpt.c daikaiju.c dc.c dec0.c decocass.c decoprot.c docastle.c equites.c fd1094.h fddebug.c flstory.c galaxian.c harddriv.c irem_cpu.c irobot.c kaneko16.c konamigx.c konppc.c leland.c lkage.c lsasquad.c mcr.c mexico86.c mhavoc.c midwayic.c midwunit.c midyunit.c model1.c model3.c n64.c namco50.c namcoio.c namcond1.c namcos1.c namcos2.c nitedrvr.c nycaptor.c pcshare.c pitnrun.c playch10.c psx.c qix.c rainbow.c retofinv.c s16fd.c scudsp.c segaic16.c simpsons.c slapfght.c slapstic.c snes.c stactics.c starwars.c system16.c tait8741.c taitosj.c tatsumi.c tnzs.c toaplan1.c twincobr.c tx1.c vertigo.c vsnes.c williams.c
[src/mame/video]1942.c 1943.c 20pacgal.c 40love.c actfancr.c alpha68k.c ampoker2.c* angelkds.c appoooh.c arabian.c argus.c arkanoid.c astrocde.c atari.c atarifb.c atarig1.c atarirle.c atarisy1.c atarisy2.c avgdvg.c balsente.c battlane.c battlera.c battlex.c beathead.c beezer.c bfm_adr2.c bigevglf.c bking.c* bladestl.c blktiger.c blmbycar.c blockout.c blueprnt.c boogwing.c brkthru.c btime.c btoads.c buggychl.c bwing.c carjmbre.c carpolo.c cbuster.c ccastles.c cchasm.c cclimber.c centiped.c champbas.c changela.c cinemat.c circusc.c cischeat.c citycon.c cloak.c cloud9.c clshroad.c cninja.c combatsc.c commando.c contra.c cop01.c cosmic.c cps1.c crbaloon.c crgolf.c crospang.c csk.c cvs.c cyberbal.c darkmist.c darkseal.c dassault.c dday.c ddrible.c dec0.c dec8.c deco16ic.c deco32.c deco_mlc.c decocass.c deniam.c dietgo.c diverboy.c djboy.c dkong.c dogfgt.c dynduke.c eolith.c exidy.c exidy440.c f1gp.c fantland.c fastfred.c fastlane.c finalizr.c flkatck.c foodf.c fromanc2.c fromance.c funkyjet.c funybubl.c gaelco2.c gaelco3d.c gaiden.c galaxian.c galpani2.c galpanic.c galspnbl.c genesis.c ginganin.c gladiatr.c glass.c goldstar.c gomoku.c gottlieb.c gotya.c grchamp.c gtia.c gticlub.c gundealr.c gyruss.c harddriv.c hcastle.c hng64.c homedata.c homerun.c hyhoo.c hyprduel.c ikki.c irobot.c itech32.c itech8.c jaguar.c jedi.c jpmimpct.c kan_pand.c kaneko16.c kangaroo.c karnov.c konamigx.c konamiic.c konamiic.h labyrunr.c ladybug.c leland.c lemmings.c lethalj.c liberate.c liberatr.c lockon.c* lordgun.c m52.c* m57.c* m58.c* m62.c m72.c macrossp.c madmotor.c magmax.c mainsnk.c mappy.c mario.c matmania.c mcr.c mcr3.c mcr68.c megasys1.c megazone.c metro.c midtunit.c midvunit.c midyunit.c midzeus.c mjsister.c model1.c model3.c ms32.c munchmo.c n8080.c namcona1.c namcos1.c namcos2.c namcos21.c namcos22.c naughtyb.c nbmj8688.c nbmj8891.c nbmj8991.c nbmj9195.c nemesis.c ninjakd2.c niyanpai.c nmk16.c ojankohs.c pacland.c pacman.c paradise.c pastelg.c pitnrun.c pktgaldx.c playch10.c playmark.c policetr.c pooyan.c popeye.c popper.c powerins.c ppu2c0x.c psikyosh.c psx.c psychic5.c punchout.c qix.c quasar.c quizdna.c realbrk.c rockola.c rohga.c rpunch.c runaway.c segag80r.c segaic16.c segaic24.c segaic24.h segas32.c segasyse.c seibuspi.c seta.c shangha3.c shisen.c sidearms.c simpl156.c skullxbo.c skychut.c snk.c snk68.c spdodgeb.c sshangha.c ssozumo.c ssv.c st0016.c stactics.c stadhero.c starfire.c starshp1.c stvvdp1.c stvvdp2.c subs.c suna16.c suna8.c supbtime.c superqix.c suprnova.c system1.c system16.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_z.c taitoair.c taitoic.c taitojc.c taitosj.c tank8.c tatsumi.c tceptor.c tetrisp2.c thief.c tia.c tiamc1.c timeplt.c tmnt.c toaplan1.c toaplan2.c toobin.c toypop.c tp84.c tryout.c tubep.c tumbleb.c tumblep.c turbo.c tutankhm.c twin16.c tx1.c unico.c usgames.c vaportra.c vball.c vdc.c victory.c vigilant.c vindictr.c vsnes.c wecleman.c williams.c wolfpack.c xxmissio.c ygv608.c yunsung8.c zac2650.c
[src/mess]configms.c device.c eventlst.c filemngr.c image.c inputx.c messopts.c mscommon.c uimess.c
[src/mess/audio]arcadia.c channelf.c dai.c dave.c gb.c kaypro.c lynx.c mac.c mea8000.c odyssey2.c pc.c svision.c ted7360.c vc4000.c vic6560.c wswan.c
[src/mess/devices]appldriv.c cartslot.c cassette.c cococart.c
[src/mess/drivers]a2600.c a310.c adam.c amstrad.c apexc.c apf.c atarist.c avigo.c bbcbc.c coleco.c crvision.c einstein.c enterp.c ex800.c exelv.c ip22.c mk1.c mk2.c nc.c pcw.c pcw16.c psx.c ql.c saturn.c sg1000.c snes.c sord.c super80.c svision.c tm990189.c tutor.c vip.c x68k.c z88.c
[src/mess/includes]dgn_beta.h sms.h
[src/mess/machine]74145.c 99_dsk.c advision.c aim65.c amigacrt.c apple2.c apple2gs.c apple3.c applefdc.c astrocde.c at.c atarifdc.c atom.c bbc.c bebox.c c128.c c16.c c64.c cbm.c cbmb.c cgenie.c coco.c compis.c concept.c cpm_bios.c dai.c dgn_beta.c ds1315.c electron.c europc.c galaxy.c gamecom.c gb.c genesis.c geneve.c hd63450.c i82439tx.c ins8154.c kc.c lisa.c lviv.c lynx.c mac.c mbee.c microtan.c mm58274c.c msx.c mtx.c mz700.c nes.c nes_mmc.c oric.c osborne1.c pc.c pc8801.c pce.c pcf8593.c pdp1.c pet.c pmd85.c primo.c rp5c15.c sgi.c sms.c spectrum.c strata.c svi318.c sym1.c tandy1t.c thomson.c ti85.c ti990.c ti99_4x.c trs80.c vc1541.c vc20.c vectrex.c wd17xx.c wswan.c zx.c
[src/mess/osd/windows]dialog.c menu.c
[src/mess/tools/messtest]testmess.c
[src/mess/video]733_asr.c 911_vdt.c a7800.c amstrad.c apple1.c arcadia.c astrocde.c atarist.c bbc.c border.c cbmb.c cdp1861.c cdp1864.c cgenie.c coco.c coupe.c dgn_beta.c dl1416.c electron.c epnick.c gb.c i82720.c intv.c jupiter.c kc.c m6847.c mbee.c nes.c odyssey2.c oric.c pc8801.c pc_cga.c pc_mda.c pc_t1t.c pc_vga.c pc_video.c pcw16.c pdp1.c pet.c pmd85.c primo.c smsvdp.c spectrum.c ssystem3.c ted7360.c thomson.c tms3556.c tx0.c vc4000.c vdc8563.c vectrex.c vic4567.c vic6560.c vic6567.c vtech1.c wswan.c x68k.c zx.c zx8301.c
[src/osd/windows]debugwin.c drawd3d.c drawdd.c output.c sound.c video.c window.c windows.mak winmain.c

src/build/png2bdc.c
r1649r1650
11/***************************************************************************
22
3    png2bdc.c
4
35    Super-simple PNG to BDC file generator
46
57    Copyright Nicola Salmoria and the MAME Team.
src/build/build.mak
r1649r1650
2626FILE2STR = $(BUILDOUT)/file2str$(EXE)
2727PNG2BDC = $(BUILDOUT)/png2bdc$(EXE)
2828
29ifneq ($(CROSS_BUILD),1)
2930BUILD += \
3031   $(FILE2STR) \
3132   $(PNG2BDC) \
r1649r1650
5556$(PNG2BDC): $(PNG2BDCOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT)
5657   @echo Linking $@...
5758   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
59
60endif
61
src/mame/audio/cchasm.c
r1649r1650
66
77#include "driver.h"
88#include "streams.h"
9#include "deprecat.h"
910#include "cpu/z80/z80.h"
1011#include "machine/z80ctc.h"
1112#include "cchasm.h"
src/mame/audio/spacefb.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/i8039/i8039.h"
910#include "sound/dac.h"
1011#include "sound/samples.h"
src/mame/audio/jaguar.c
r1649r1650
143143****************************************************************************/
144144
145145#include "driver.h"
146#include "deprecat.h"
146147#include "includes/jaguar.h"
147148#include "cpu/jaguar/jaguar.h"
148149#include "sound/dac.h"
149#include <math.h>
150150
151151
152152/* Jerry registers */
src/mame/audio/phoenix.c
r1649r1650
88 ****************************************************************************/
99
1010
11#include <math.h>
1211#include "driver.h"
1312#include "streams.h"
13#include "deprecat.h"
1414#include "sound/custom.h"
1515#include "sound/tms36xx.h"
1616#include "phoenix.h"
src/mame/audio/n8080.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/i8039/i8039.h"
910#include "sound/sn76477.h"
1011#include "sound/dac.h"
1112#include "includes/n8080.h"
12#include <math.h>
1313
1414static int n8080_hardware;
1515
src/mame/audio/amiga.c
r1649r1650
1010
1111#include "driver.h"
1212#include "streams.h"
13#include "deprecat.h"
1314#include "includes/amiga.h"
1415#include "cpu/m68000/m68000.h"
1516
src/mame/audio/timeplt.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "sound/ay8910.h"
1516#include "sound/flt_rc.h"
1617#include "timeplt.h"
1718
18static READ8_HANDLER( timeplt_portB_r );
19static WRITE8_HANDLER( timeplt_filter_w );
2019
21ADDRESS_MAP_START( timeplt_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
22   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
23   AM_RANGE(0x2000, 0x23ff) AM_READ(MRA8_RAM)
24   AM_RANGE(0x3000, 0x33ff) AM_READ(MRA8_RAM)
25   AM_RANGE(0x4000, 0x4000) AM_READ(AY8910_read_port_0_r)
26   AM_RANGE(0x6000, 0x6000) AM_READ(AY8910_read_port_1_r)
27ADDRESS_MAP_END
20#define MASTER_CLOCK      XTAL_14_31818MHz
2821
29ADDRESS_MAP_START( timeplt_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
30   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
31   AM_RANGE(0x2000, 0x23ff) AM_WRITE(MWA8_RAM)
32   AM_RANGE(0x3000, 0x33ff) AM_WRITE(MWA8_RAM)
33   AM_RANGE(0x4000, 0x4000) AM_WRITE(AY8910_write_port_0_w)
34   AM_RANGE(0x5000, 0x5000) AM_WRITE(AY8910_control_port_0_w)
35   AM_RANGE(0x6000, 0x6000) AM_WRITE(AY8910_write_port_1_w)
36   AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_control_port_1_w)
37   AM_RANGE(0x8000, 0x8fff) AM_WRITE(timeplt_filter_w)
38ADDRESS_MAP_END
3922
40ADDRESS_MAP_START( locomotn_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
41   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
42   AM_RANGE(0x2000, 0x23ff) AM_READ(MRA8_RAM)
43   AM_RANGE(0x4000, 0x4000) AM_READ(AY8910_read_port_0_r)
44   AM_RANGE(0x6000, 0x6000) AM_READ(AY8910_read_port_1_r)
45ADDRESS_MAP_END
23static UINT8 timeplt_last_irq_state;
4624
47ADDRESS_MAP_START( locomotn_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
48   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
49   AM_RANGE(0x2000, 0x23ff) AM_WRITE(MWA8_RAM)
50   AM_RANGE(0x3000, 0x3fff) AM_WRITE(timeplt_filter_w)
51   AM_RANGE(0x4000, 0x4000) AM_WRITE(AY8910_write_port_0_w)
52   AM_RANGE(0x5000, 0x5000) AM_WRITE(AY8910_control_port_0_w)
53   AM_RANGE(0x6000, 0x6000) AM_WRITE(AY8910_write_port_1_w)
54   AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_control_port_1_w)
55ADDRESS_MAP_END
5625
26/*************************************
27 *
28 *  Initialization
29 *
30 *************************************/
5731
58const struct AY8910interface timeplt_ay8910_interface =
32static SOUND_START( timeplt )
5933{
60   soundlatch_r,
61   timeplt_portB_r
62};
34   timeplt_last_irq_state = 0;
35   state_save_register_global(timeplt_last_irq_state);
36}
6337
6438
39
40/*************************************
41 *
42 *  Sound timer
43 *
44 *************************************/
45
6546/* The timer clock which feeds the upper 4 bits of                      */
6647/* AY-3-8910 port A is based on the same clock                          */
6748/* feeding the sound CPU Z80.  It is a divide by                        */
r1649r1650
7960/* Bit 7 comes from the QA output of the LS90 producing a sequence of   */
8061/*       0, 0, 0, 0, 0, 1, 1, 1, 1, 1                                   */
8162
82static const int timeplt_timer[10] =
83{
84   0x00, 0x10, 0x20, 0x30, 0x40, 0x90, 0xa0, 0xb0, 0xa0, 0xd0
85};
86
8763static READ8_HANDLER( timeplt_portB_r )
8864{
89   /* need to protect from totalcycles overflow */
90   static int last_totalcycles = 0;
65   static const int timeplt_timer[10] =
66   {
67      0x00, 0x10, 0x20, 0x30, 0x40, 0x90, 0xa0, 0xb0, 0xa0, 0xd0
68   };
69   return timeplt_timer[(activecpu_gettotalcycles() / 512) % 10];
70}
9171
92   /* number of Z80 clock cycles to count */
93   static int clock;
9472
95   int current_totalcycles;
9673
97   current_totalcycles = activecpu_gettotalcycles();
98   clock = (clock + (current_totalcycles-last_totalcycles)) % 5120;
74/*************************************
75 *
76 *  Filter controls
77 *
78 *************************************/
9979
100   last_totalcycles = current_totalcycles;
101
102   return timeplt_timer[clock/512];
103}
104
105
10680static void filter_w(int chip, int channel, int data)
10781{
10882   int C = 0;
r1649r1650
11286   filter_rc_set_RC(3*chip + channel,FLT_RC_LOWPASS, 1000,5100,0,CAP_P(C));
11387}
11488
89
11590static WRITE8_HANDLER( timeplt_filter_w )
11691{
11792   filter_w(0, 0, (offset >>  6) & 3);
r1649r1650
12398}
12499
125100
101
102/*************************************
103 *
104 *  External interfaces
105 *
106 *************************************/
107
126108WRITE8_HANDLER( timeplt_sh_irqtrigger_w )
127109{
128   static int last;
129
130   if (last == 0 && data)
110   if (timeplt_last_irq_state == 0 && data)
131111   {
132112      /* setting bit 0 low then high triggers IRQ on the sound CPU */
133113      cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
134114   }
135115
136   last = data;
116   timeplt_last_irq_state = data;
137117}
138118
119
120
121/*************************************
122 *
123 *  Memory maps
124 *
125 *************************************/
126
127static ADDRESS_MAP_START( timeplt_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
128   AM_RANGE(0x0000, 0x2fff) AM_ROM
129   AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM
130   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0fff) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
131   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_WRITE(AY8910_control_port_0_w)
132   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
133   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_WRITE(AY8910_control_port_1_w)
134   AM_RANGE(0x8000, 0xffff) AM_WRITE(timeplt_filter_w)
135ADDRESS_MAP_END
136
137
138static ADDRESS_MAP_START( locomotn_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
139   AM_RANGE(0x0000, 0x1fff) AM_ROM
140   AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM
141   AM_RANGE(0x3000, 0x3fff) AM_WRITE(timeplt_filter_w)
142   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0fff) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
143   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_WRITE(AY8910_control_port_0_w)
144   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
145   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_WRITE(AY8910_control_port_1_w)
146ADDRESS_MAP_END
147
148
149
150/*************************************
151 *
152 *  Sound chip interfaces
153 *
154 *************************************/
155
156static const struct AY8910interface timeplt_ay8910_interface =
157{
158   soundlatch_r,
159   timeplt_portB_r
160};
161
162
163
164/*************************************
165 *
166 *  Machine drivers
167 *
168 *************************************/
169
170MACHINE_DRIVER_START( timeplt_sound )
171
172   /* basic machine hardware */
173   MDRV_CPU_ADD_TAG("tpsound",Z80,MASTER_CLOCK/8)
174   MDRV_CPU_PROGRAM_MAP(timeplt_sound_map,0)
175
176   MDRV_SOUND_START(timeplt)
177
178   /* sound hardware */
179   MDRV_SPEAKER_STANDARD_MONO("mono")
180
181   MDRV_SOUND_ADD(AY8910, MASTER_CLOCK/8)
182   MDRV_SOUND_CONFIG(timeplt_ay8910_interface)
183   MDRV_SOUND_ROUTE(0, "filter.0.0", 0.60)
184   MDRV_SOUND_ROUTE(1, "filter.0.1", 0.60)
185   MDRV_SOUND_ROUTE(2, "filter.0.2", 0.60)
186
187   MDRV_SOUND_ADD(AY8910, MASTER_CLOCK/8)
188   MDRV_SOUND_ROUTE(0, "filter.1.0", 0.60)
189   MDRV_SOUND_ROUTE(1, "filter.1.1", 0.60)
190   MDRV_SOUND_ROUTE(2, "filter.1.2", 0.60)
191
192   MDRV_SOUND_ADD_TAG("filter.0.0", FILTER_RC, 0)
193   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
194   MDRV_SOUND_ADD_TAG("filter.0.1", FILTER_RC, 0)
195   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
196   MDRV_SOUND_ADD_TAG("filter.0.2", FILTER_RC, 0)
197   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
198
199   MDRV_SOUND_ADD_TAG("filter.1.0", FILTER_RC, 0)
200   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
201   MDRV_SOUND_ADD_TAG("filter.1.1", FILTER_RC, 0)
202   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
203   MDRV_SOUND_ADD_TAG("filter.1.2", FILTER_RC, 0)
204   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
205MACHINE_DRIVER_END
206
207
208MACHINE_DRIVER_START( locomotn_sound )
209   MDRV_IMPORT_FROM(timeplt_sound)
210
211   /* basic machine hardware */
212   MDRV_CPU_MODIFY("tpsound")
213   MDRV_CPU_PROGRAM_MAP(locomotn_sound_map,0)
214MACHINE_DRIVER_END
src/mame/audio/cinemat.c
r1649r1650
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "cpu/ccpu/ccpu.h"
1920#include "cpu/z80/z80daisy.h"
2021#include "machine/z80ctc.h"
src/mame/audio/cyberbal.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/atarigen.h"
910#include "sound/dac.h"
1011#include "includes/cyberbal.h"
11#include <math.h>
1212
1313
1414static UINT8 *bank_base;
src/mame/audio/timeplt.h
r1649r1650
1ADDRESS_MAP_EXTERN(timeplt_sound_readmem);
2ADDRESS_MAP_EXTERN(timeplt_sound_writemem);
3ADDRESS_MAP_EXTERN(locomotn_sound_readmem);
4ADDRESS_MAP_EXTERN(locomotn_sound_writemem);
5extern const struct AY8910interface timeplt_ay8910_interface;
61WRITE8_HANDLER( timeplt_sh_irqtrigger_w );
2
3MACHINE_DRIVER_EXTERN( timeplt_sound );
4MACHINE_DRIVER_EXTERN( locomotn_sound );
src/mame/audio/galaxian.c
r1649r1650
11#include "driver.h"
22#include "streams.h"
3#include "deprecat.h"
34#include "sound/samples.h"
45#include "includes/galaxian.h"
56
src/mame/audio/trackfld.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "sound/vlm5030.h"
34#include "sound/msm5205.h"
45#include "sound/sn76496.h"
r1649r1650
2223
2324READ8_HANDLER( trackfld_sh_timer_r )
2425{
25    int clock = activecpu_gettotalcycles() / TIMER_RATE;
26    UINT32 clock = activecpu_gettotalcycles() / TIMER_RATE;
2627
2728    return clock & 0xF;
2829}
r1649r1650
5556
5657READ8_HANDLER( hyperspt_sh_timer_r )
5758{
58    int clock = activecpu_gettotalcycles() / TIMER_RATE;
59    UINT32 clock = activecpu_gettotalcycles() / TIMER_RATE;
5960
6061    return (clock & 0x3) | (VLM5030_BSY()? 0x04 : 0);
6162}
src/mame/audio/turbo.c
r1649r1650
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "turbo.h"
910#include "sound/samples.h"
1011
src/mame/audio/atarijsa.c
r1649r1650
3131****************************************************************************/
3232
3333#include "driver.h"
34#include "deprecat.h"
3435#include "cpu/m6502/m6502.h"
3536#include "sound/5220intf.h"
3637#include "sound/2151intf.h"
src/mame/audio/cage.c
r1649r1650
1010
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/tms32031/tms32031.h"
1415#include "sound/dmadac.h"
1516#include "cage.h"
src/mame/audio/namco54.c
r1649r1650
4949***************************************************************************/
5050
5151#include "driver.h"
52#include "deprecat.h"
5253#include "namco54.h"
5354#include "cpu/mb88xx/mb88xx.h"
5455
src/mame/audio/senjyo.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "machine/z80pio.h"
34#include "machine/z80ctc.h"
45#include "sound/samples.h"
5#include <math.h>
66
77
88/* z80 pio */
src/mame/audio/exidy440.c
r1649r1650
99
1010#include "driver.h"
1111#include "streams.h"
12#include "deprecat.h"
1213#include "exidy440.h"
13#include <math.h>
1414
1515
16#define MAKE_WAVES      0
1716#define   SOUND_LOG      0
1817#define   FADE_TO_ZERO   1
1918
r1649r1650
7069
7170
7271/* globals */
73UINT8 *exidy440_m6844_data;
74UINT8 *exidy440_sound_banks;
75UINT8 *exidy440_sound_volume;
7672UINT8 exidy440_sound_command;
7773UINT8 exidy440_sound_command_ack;
7874
7975/* local allocated storage */
76static UINT8 *sound_banks;
77static UINT8 *m6844_data;
78static UINT8 *sound_volume;
8079static INT32 *mixer_buffer_left;
8180static INT32 *mixer_buffer_right;
8281static sound_cache_entry *sound_cache;
r1649r1650
121120static void fir_filter(INT32 *input, INT16 *output, int count);
122121
123122
124/* debugging */
125#if MAKE_WAVES
126123
127#ifdef LSB_FIRST
128#define intelShort(x) (x)
129#define intelLong(x) (x)
130#else
131#define intelShort(x) (((x) << 8) | ((x) >> 8))
132#define intelLong(x) ((((x) << 24) | (((UINT32) (x)) >> 24) | (( (x) & 0x0000ff00) << 8) | (( (x) & 0x00ff0000) >> 8)))
133#endif
134
135static FILE *wavfile;
136static int wavlength;
137
138static void write_wav_header(int frequency);
139static void finish_wav_file(void);
140
141#endif
142
143
144
145124/*************************************
146125 *
147126 *  Initialize the sound system
148127 *
149128 *************************************/
150129
151void *exidy440_sh_start(int clock, const struct CustomSound_interface *config)
130static void *exidy440_sh_start(int clock, const struct CustomSound_interface *config)
152131{
153132   int i, length;
154133
r1649r1650
206185 *
207186 *************************************/
208187
209void exidy440_sh_stop(void *token)
188static void exidy440_sh_stop(void *token)
210189{
211190   if (SOUND_LOG && debuglog)
212191      fclose(debuglog);
r1649r1650
316295      samples = (left > channel->remaining) ? channel->remaining : left;
317296
318297      /* get a pointer to the sample data and copy to the left */
319      volume = exidy440_sound_volume[2 * ch + 0];
298      volume = sound_volume[2 * ch + 0];
320299      if (volume)
321300         add_and_scale_samples(ch, mixer_buffer_left, samples, volume);
322301
323302      /* get a pointer to the sample data and copy to the left */
324      volume = exidy440_sound_volume[2 * ch + 1];
303      volume = sound_volume[2 * ch + 1];
325304      if (volume)
326305         add_and_scale_samples(ch, mixer_buffer_right, samples, volume);
327306
r1649r1650
354333 *
355334 *************************************/
356335
357READ8_HANDLER( exidy440_sound_command_r )
336static READ8_HANDLER( sound_command_r )
358337{
359338   /* clear the FIRQ that got us here and acknowledge the read to the main CPU */
360339   cpunum_set_input_line(Machine, 1, 1, CLEAR_LINE);
r1649r1650
371350 *
372351 *************************************/
373352
374WRITE8_HANDLER( exidy440_sound_volume_w )
353static WRITE8_HANDLER( sound_volume_w )
375354{
376355   if (SOUND_LOG && debuglog)
377356      fprintf(debuglog, "Volume %02X=%02X\n", offset, data);
r1649r1650
380359   stream_update(stream);
381360
382361   /* set the new volume */
383   exidy440_sound_volume[offset] = ~data;
362   sound_volume[offset] = ~data;
384363}
385364
386365
r1649r1650
391370 *
392371 *************************************/
393372
394WRITE8_HANDLER( exidy440_sound_interrupt_clear_w )
373static WRITE8_HANDLER( sound_interrupt_clear_w )
395374{
396375   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
397376}
r1649r1650
411390}
412391
413392
414void m6844_finished(int ch)
393static void m6844_finished(int ch)
415394{
416395   m6844_channel_data *channel = &m6844_channel[ch];
417396
r1649r1650
435414 *
436415 *************************************/
437416
438READ8_HANDLER( exidy440_m6844_r )
417static READ8_HANDLER( m6844_r )
439418{
440419   int result = 0;
441420
r1649r1650
516495}
517496
518497
519WRITE8_HANDLER( exidy440_m6844_w )
498static WRITE8_HANDLER( m6844_w )
520499{
521500   int i;
522501
r1649r1650
623602 *
624603 *************************************/
625604
626void reset_sound_cache(void)
605static void reset_sound_cache(void)
627606{
628607   sound_cache_end = sound_cache;
629608}
630609
631610
632INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits, int frequency)
611static INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits, int frequency)
633612{
634613   sound_cache_entry *current = sound_cache_end;
635614
r1649r1650
656635}
657636
658637
659INT16 *find_or_add_to_sound_cache(int address, int length, int bits, int frequency)
638static INT16 *find_or_add_to_sound_cache(int address, int length, int bits, int frequency)
660639{
661640   sound_cache_entry *current;
662641
r1649r1650
675654 *
676655 *************************************/
677656
678void play_cvsd(int ch)
657static void play_cvsd(int ch)
679658{
680659   sound_channel_data *channel = &sound_channel[ch];
681660   int address = m6844_channel[ch].address;
r1649r1650
683662   INT16 *base;
684663
685664   /* add the bank number to the address */
686   if (exidy440_sound_banks[ch] & 1)
665   if (sound_banks[ch] & 1)
687666      address += 0x00000;
688   else if (exidy440_sound_banks[ch] & 2)
667   else if (sound_banks[ch] & 2)
689668      address += 0x08000;
690   else if (exidy440_sound_banks[ch] & 4)
669   else if (sound_banks[ch] & 4)
691670      address += 0x10000;
692   else if (exidy440_sound_banks[ch] & 8)
671   else if (sound_banks[ch] & 8)
693672      address += 0x18000;
694673
695674   /* compute the base address in the converted samples array */
r1649r1650
709688
710689   if (SOUND_LOG && debuglog)
711690      fprintf(debuglog, "Sound channel %d play at %02X,%04X, length = %04X, volume = %02X/%02X\n",
712            ch, exidy440_sound_banks[ch], m6844_channel[ch].address,
713            m6844_channel[ch].counter, exidy440_sound_volume[ch * 2], exidy440_sound_volume[ch * 2 + 1]);
691            ch, sound_banks[ch], m6844_channel[ch].address,
692            m6844_channel[ch].counter, sound_volume[ch * 2], sound_volume[ch * 2 + 1]);
714693
715694   /* set the pointer and count */
716695   channel->base = base;
r1649r1650
722701}
723702
724703
725void stop_cvsd(int ch)
704static void stop_cvsd(int ch)
726705{
727706   /* the DMA channel is marked inactive; that will kill the audio */
728707   sound_channel[ch].remaining = 0;
r1649r1650
740719 *
741720 *************************************/
742721
743void fir_filter(INT32 *input, INT16 *output, int count)
722static void fir_filter(INT32 *input, INT16 *output, int count)
744723{
745724   while (count--)
746725   {
r1649r1650
775754 *
776755 *************************************/
777756
778void decode_and_filter_cvsd(UINT8 *input, int bytes, int maskbits, int frequency, INT16 *output)
757static void decode_and_filter_cvsd(UINT8 *input, int bytes, int maskbits, int frequency, INT16 *output)
779758{
780759   INT32 buffer[SAMPLE_BUFFER_LENGTH + FIR_HISTORY_LENGTH];
781760   int total_samples = bytes * 8;
r1649r1650
785764   int steps;
786765   int chunk_start;
787766
788#if MAKE_WAVES
789{
790   static int file_index;
791   char file_name[100];
792   sprintf(file_name, "cvsd%03d.wav", file_index++);
793   wavfile = fopen(file_name, "wb");
794   write_wav_header(frequency);
795}
796#endif
797
798767   /* compute the charge, decay, and leak constants */
799768   charge = pow(exp(-1), 1.0 / (FILTER_CHARGE_TC * (double)frequency));
800769   decay = pow(exp(-1), 1.0 / (FILTER_DECAY_TC * (double)frequency));
r1649r1650
883852         }
884853      }
885854
886#if MAKE_WAVES
887      for (ind = 0; ind < chunk_bytes * 8; ind++)
888      {
889         int sample = buffer[FIR_HISTORY_LENGTH + ind];
890         INT16 temp;
891         if (sample > 32767) sample = 32767;
892         else if (sample < -32768) sample = -32768;
893         temp = intelShort(sample);
894         fwrite(&temp, 1, 2, wavfile);
895      }
896      wavlength += chunk_bytes * 8 * 2;
897#endif
898
899855      /* all done with this chunk, run the filter on it */
900856      fir_filter(&buffer[FIR_HISTORY_LENGTH], &output[chunk_start], chunk_bytes * 8);
901857
r1649r1650
903859      memcpy(&buffer[0], &buffer[SAMPLE_BUFFER_LENGTH], FIR_HISTORY_LENGTH * sizeof(INT32));
904860   }
905861
906#if MAKE_WAVES
907   finish_wav_file();
908   fclose(wavfile);
909#endif
910
911862   /* make sure the volume goes smoothly to 0 over the last 512 samples */
912863   if (FADE_TO_ZERO)
913864   {
r1649r1650
927878
928879/*************************************
929880 *
930 *  Debugging
881 *  Memory handlers
931882 *
932883 *************************************/
933884
934#if MAKE_WAVES
885static ADDRESS_MAP_START( exidy440_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
886   AM_RANGE(0x8000, 0x8016) AM_READWRITE(m6844_r, m6844_w) AM_BASE(&m6844_data)
887   AM_RANGE(0x8400, 0x8407) AM_READWRITE(MRA8_RAM, sound_volume_w) AM_BASE(&sound_volume)
888   AM_RANGE(0x8800, 0x8800) AM_READ(sound_command_r)
889   AM_RANGE(0x9400, 0x9403) AM_WRITE(MWA8_RAM) AM_BASE(&sound_banks)
890   AM_RANGE(0x9800, 0x9800) AM_READWRITE(MRA8_NOP, sound_interrupt_clear_w)
891   AM_RANGE(0xa000, 0xbfff) AM_RAM
892   AM_RANGE(0xe000, 0xffff) AM_ROM
893ADDRESS_MAP_END
935894
936static void write_wav_header(int frequency)
937{
938   UINT32 temp32;
939   UINT16 temp16;
940895
941   fwrite("RIFF", 1, 4, wavfile);
942   temp32 = intelLong(0);
943   fwrite(&temp32, 1, 4, wavfile);
944   fwrite("WAVE", 1, 4, wavfile);
945896
946   fwrite("fmt ", 1, 4, wavfile);
947   temp32 = intelLong(16);
948   fwrite(&temp32, 1, 4, wavfile);
949   temp16 = intelShort(1);            /* format: PCM */
950   fwrite(&temp16, 1, 2, wavfile);
951   temp16 = intelShort(1);            /* channels: 1 */
952   fwrite(&temp16, 1, 2, wavfile);
953   temp32 = intelLong(frequency);      /* sample rate */
954   fwrite(&temp32, 1, 4, wavfile);
955   temp32 = intelLong(frequency * 2);   /* bytes/second */
956   fwrite(&temp32, 1, 4, wavfile);
957   temp16 = intelShort(2);            /* block align */
958   fwrite(&temp16, 1, 2, wavfile);
959   temp16 = intelShort(16);         /* bits/sample */
960   fwrite(&temp16, 1, 2, wavfile);
897/*************************************
898 *
899 *  Audio definitions
900 *
901 *************************************/
961902
962   fwrite("data", 1, 4, wavfile);
963   temp32 = intelLong(0);
964   fwrite(&temp32, 1, 4, wavfile);
965}
903static const struct CustomSound_interface custom_interface =
904{
905   exidy440_sh_start,
906   exidy440_sh_stop
907};
966908
967909
968static void finish_wav_file(void)
969{
970   UINT32 temp32;
971910
972   fseek(wavfile, 4, SEEK_SET);
973   temp32 = intelLong(wavlength + 4 + 8 + 16 + 8);
974   fwrite(&temp32, 1, 4, wavfile);
911/*************************************
912 *
913 *  Machine driver
914 *
915 *************************************/
975916
976   fseek(wavfile, 40, SEEK_SET);
977   temp32 = intelLong(wavlength);
978   fwrite(&temp32, 1, 4, wavfile);
979}
917MACHINE_DRIVER_START( exidy440_audio )
980918
981#endif
919   MDRV_CPU_ADD(M6809,EXIDY440_MASTER_CLOCK/4/4)
920   MDRV_CPU_PROGRAM_MAP(exidy440_audio_map,0)
921   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
922
923   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
924
925   MDRV_SOUND_ADD(CUSTOM, EXIDY440_MASTER_CLOCK/256)
926   MDRV_SOUND_CONFIG(custom_interface)
927   MDRV_SOUND_ROUTE(0, "left", 1.0)
928   MDRV_SOUND_ROUTE(1, "right", 1.0)
929MACHINE_DRIVER_END
src/mame/audio/tx1.c
r1649r1650
44
55***************************************************************************/
66#include "driver.h"
7#include "streams.h"
8#include "deprecat.h"
79#include "includes/tx1.h"
810#include "video/resnet.h"
911#include "sound/custom.h"
10#include "streams.h"
1112
1213/*************************************
1314 *
src/mame/audio/mcr.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "audio/mcr.h"
1112#include "audio/williams.h"
1213#include "cpu/m6800/m6800.h"
src/mame/audio/segasnd.c
r1649r1650
11/***************************************************************************
22
3    segag80.c
3    segasnd.c
44
55    Sound boards for early Sega G-80 based games.
66
r1649r1650
1111
1212#include "driver.h"
1313#include "streams.h"
14#include "deprecat.h"
1415#include "segag80v.h"
1516#include "cpu/i8039/i8039.h"
1617#include "sound/sp0250.h"
1718#include "segasnd.h"
18#include <math.h>
1919
2020#define VERBOSE 0
2121#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
src/mame/audio/aztarac.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/z80/z80.h"
910#include "aztarac.h"
1011
src/mame/audio/taitosnd.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/z80/z80.h"
34#include "taitosnd.h"
45
src/mame/audio/mcr.h
r1649r1650
11/***************************************************************************
22
3    audio/mcr.c
3    audio/mcr.h
44
55    Functions to emulate general the various MCR sound cards.
66
src/mame/audio/irem.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "irem.h"
34#include "cpu/m6800/m6800.h"
45#include "sound/ay8910.h"
r1649r1650
9192
9293static WRITE8_HANDLER( irem_adpcm_w )
9394{
94   MSM5205_data_w(offset,data);
95   if (offset & 1)
96      MSM5205_data_w(0, data);
97   if (offset & 2)
98      MSM5205_data_w(1, data);
9599}
96100
97101static void irem_adpcm_int(int data)
r1649r1650
141145
142146
143147
144static ADDRESS_MAP_START( irem_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
145   AM_RANGE(0x0800, 0x0800) AM_WRITENOP
146   AM_RANGE(0x0801, 0x0802) AM_WRITE(irem_adpcm_w)
147   AM_RANGE(0x9000, 0x9000) AM_WRITE(irem_sound_irq_ack_w)
148/* complete address map verified from Moon Patrol/10 Yard Fight schematics */
149/* large map uses 8k ROMs, small map uses 4k ROMs; this is selected via a jumper */
150static ADDRESS_MAP_START( m52_small_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
151   ADDRESS_MAP_FLAGS( AMEF_ABITS(15) )
152   AM_RANGE(0x0000, 0x0fff) AM_WRITE(irem_adpcm_w)
153   AM_RANGE(0x1000, 0x1fff) AM_WRITE(irem_sound_irq_ack_w)
154   AM_RANGE(0x2000, 0x7fff) AM_ROM
155ADDRESS_MAP_END
156
157static ADDRESS_MAP_START( m52_large_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
158   AM_RANGE(0x0000, 0x1fff) AM_WRITE(irem_adpcm_w)
159   AM_RANGE(0x2000, 0x3fff) AM_WRITE(irem_sound_irq_ack_w)
148160   AM_RANGE(0x4000, 0xffff) AM_ROM
149161ADDRESS_MAP_END
150162
163
164/* complete address map verified from Kid Niki schematics */
165static ADDRESS_MAP_START( m62_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
166   AM_RANGE(0x0800, 0x0800) AM_MIRROR(0xf7fc) AM_WRITE(irem_sound_irq_ack_w)
167   AM_RANGE(0x0801, 0x0802) AM_MIRROR(0xf7fc) AM_WRITE(irem_adpcm_w)
168   AM_RANGE(0x4000, 0xffff) AM_ROM
169ADDRESS_MAP_END
170
171
151172static ADDRESS_MAP_START( irem_sound_portmap, ADDRESS_SPACE_IO, 8 )
152173   AM_RANGE(M6803_PORT1, M6803_PORT1) AM_READWRITE(irem_port1_r, irem_port1_w)
153174   AM_RANGE(M6803_PORT2, M6803_PORT2) AM_READWRITE(irem_port2_r, irem_port2_w)
154175ADDRESS_MAP_END
155176
156177
157MACHINE_DRIVER_START( irem_audio )
178MACHINE_DRIVER_START( irem_audio_base )
158179
159180   MDRV_SOUND_START(irem_audio)
160181
161182   /* basic machine hardware */
162   MDRV_CPU_ADD(M6803, XTAL_3_579545MHz) /* verified on pcb */
163   MDRV_CPU_PROGRAM_MAP(irem_sound_map,0)
183   MDRV_CPU_ADD_TAG("iremsound", M6803, XTAL_3_579545MHz) /* verified on pcb */
164184   MDRV_CPU_IO_MAP(irem_sound_portmap,0)
165185
166186   /* sound hardware */
r1649r1650
182202   MDRV_SOUND_CONFIG(irem_msm5205_interface_2)
183203   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
184204MACHINE_DRIVER_END
205
206
207MACHINE_DRIVER_START( m52_small_audio )
208   MDRV_IMPORT_FROM(irem_audio_base)
209
210   /* basic machine hardware */
211   MDRV_CPU_MODIFY("iremsound")
212   MDRV_CPU_PROGRAM_MAP(m52_small_sound_map,0)
213MACHINE_DRIVER_END
214
215
216MACHINE_DRIVER_START( m52_large_audio )   /* 10 yard fight */
217   MDRV_IMPORT_FROM(irem_audio_base)
218
219   /* basic machine hardware */
220   MDRV_CPU_MODIFY("iremsound")
221   MDRV_CPU_PROGRAM_MAP(m52_large_sound_map,0)
222MACHINE_DRIVER_END
223
224
225MACHINE_DRIVER_START( m62_audio )
226   MDRV_IMPORT_FROM(irem_audio_base)
227
228   /* basic machine hardware */
229   MDRV_CPU_MODIFY("iremsound")
230   MDRV_CPU_PROGRAM_MAP(m62_sound_map,0)
231MACHINE_DRIVER_END
232
233
src/mame/audio/leland.c
r1649r1650
7979
8080#include "driver.h"
8181#include "streams.h"
82#include "deprecat.h"
8283#include "cpu/i86/i186intf.h"
8384#include "cpu/z80/z80.h"
8485#include "leland.h"
src/mame/audio/carnival.c
r1649r1650
3737/*****************************************************************************/
3838
3939#include "driver.h"
40#include "deprecat.h"
4041#include "cpu/i8039/i8039.h"
4142#include "sound/ay8910.h"
4243#include "sound/samples.h"
src/mame/audio/irem.h
r1649r1650
44
55****************************************************************************/
66
7MACHINE_DRIVER_EXTERN( irem_audio );
7MACHINE_DRIVER_EXTERN( m52_small_audio );
8MACHINE_DRIVER_EXTERN( m52_large_audio );
9MACHINE_DRIVER_EXTERN( m62_audio );
810
911WRITE8_HANDLER( irem_sound_cmd_w );
src/mame/audio/dkong.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/i8039/i8039.h"
34#include "cpu/m6502/m6502.h"
45#include "sound/nes_apu.h"
src/mame/audio/taito_en.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "sound/es5506.h"
34#include "includes/taito_f3.h"
45#include "taito_en.h"
src/mame/audio/harddriv.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/tms32010/tms32010.h"
910#include "sound/dac.h"
1011#include "machine/atarigen.h"
r1649r1650
3940static UINT32 romsize;
4041static UINT16 *comram;
4142
42static UINT32 last_bio_cycles;
43static UINT64 last_bio_cycles;
4344
4445
4546
r1649r1650
308309
309310READ16_HANDLER( hdsnddsp_get_bio )
310311{
311   UINT32 cycles_since_last_bio = activecpu_gettotalcycles() - last_bio_cycles;
312   UINT64 cycles_since_last_bio = activecpu_gettotalcycles() - last_bio_cycles;
312313   INT32 cycles_until_bio = CYCLES_PER_BIO - cycles_since_last_bio;
313314
314315   /* if we're not at the next BIO yet, advance us there */
src/mame/audio/firetrk.c
r1649r1650
11/*************************************************************************
22
3    audio\atarifb.c
3    audio\firetrk.c
44
55*************************************************************************/
66
src/mame/audio/seibu.c
r1649r1650
3434
3535#include "driver.h"
3636#include "streams.h"
37#include "deprecat.h"
3738#include "audio/seibu.h"
3839#include "sound/3812intf.h"
3940#include "sound/2151intf.h"
src/mame/audio/gridlee.c
r1649r1650
77#include "driver.h"
88#include "streams.h"
99#include "gridlee.h"
10#include "deprecat.h"
1011#include "sound/custom.h"
1112#include "sound/samples.h"
1213
src/mame/audio/namcoc7x.c
r1649r1650
2727*/
2828
2929#include "driver.h"
30#include "deprecat.h"
3031#include "audio/namcoc7x.h"
3132
3233static UINT16 *namcoc7x_mcuram;
src/mame/audio/segag80r.c
r1649r1650
99
1010#include "driver.h"
1111#include "streams.h"
12#include "deprecat.h"
1213#include "cpu/i8039/i8039.h"
1314#include "segag80r.h"
1415#include "machine/8255ppi.h"
src/mame/audio/pleiads.c
r1649r1650
88 ****************************************************************************/
99#include "driver.h"
1010#include "streams.h"
11#include "deprecat.h"
1112#include "sound/custom.h"
1213#include "sound/tms36xx.h"
1314#include "includes/phoenix.h"
src/mame/audio/williams.c
r1649r1650
2323****************************************************************************/
2424
2525#include "driver.h"
26#include "deprecat.h"
2627#include "machine/6821pia.h"
2728#include "cpu/m6809/m6809.h"
2829#include "williams.h"
src/mame/audio/scramble.c
r1649r1650
1212***************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "cpu/z80/z80.h"
1617#include "machine/7474.h"
1718#include "sound/flt_rc.h"
r1649r1650
4647
4748READ8_HANDLER( scramble_portB_r )
4849{
49   /* need to protect from totalcycles overflow */
50   static int last_totalcycles = 0;
51
52   /* number of Z80 clock cycles to count */
53   static int clock;
54
55   int current_totalcycles;
56
57   current_totalcycles = activecpu_gettotalcycles();
58   clock = (clock + (current_totalcycles-last_totalcycles)) % 5120;
59
60   last_totalcycles = current_totalcycles;
61
62   return scramble_timer[clock/512];
50   return scramble_timer[(activecpu_gettotalcycles()/512) % 10];
6351}
6452
6553
r1649r1650
8876
8977READ8_HANDLER( frogger_portB_r )
9078{
91   /* need to protect from totalcycles overflow */
92   static int last_totalcycles = 0;
93
94   /* number of Z80 clock cycles to count */
95   static int clock;
96
97   int current_totalcycles;
98
99   current_totalcycles = activecpu_gettotalcycles();
100   clock = (clock + (current_totalcycles-last_totalcycles)) % 5120;
101
102   last_totalcycles = current_totalcycles;
103
104   return frogger_timer[clock/512];
79   return frogger_timer[(activecpu_gettotalcycles()/512) % 10];
10580}
10681
10782
src/mame/audio/system16.c
r1649r1650
11// system 16 - 7751 emulation, based on monster bash code.
22#include "driver.h"
3#include "deprecat.h"
34#include "cpu/i8039/i8039.h"
45#include "sound/dac.h"
56
src/mame/audio/redalert.c
r1649r1650
99
1010#include "driver.h"
1111#include "rescap.h"
12#include "deprecat.h"
1213#include "cpu/i8085/i8085.h"
1314#include "machine/6821pia.h"
1415#include "sound/ay8910.h"
src/mame/audio/starwars.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/m6809/m6809.h"
1213#include "sound/5220intf.h"
1314#include "includes/starwars.h"
src/mame/audio/mario.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/i8039/i8039.h"
34#include "sound/dac.h"
45#include "sound/ay8910.h"
src/mame/audio/gottlieb.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/m6502/m6502.h"
34#include "sound/samples.h"
45#include "sound/dac.h"
src/mame/audio/dcs.c
r1649r1650
150150****************************************************************************/
151151
152152#include "driver.h"
153#include "deprecat.h"
153154#include "cpu/adsp2100/adsp2100.h"
154155#include "dcs.h"
155156#include "sound/dmadac.h"
156157#include "machine/midwayic.h"
157158
158#include <math.h>
159159
160
161160#define LOG_DCS_TRANSFERS         (0)
162161#define LOG_DCS_IO               (0)
163162#define LOG_BUFFER_FILLING         (0)
r1649r1650
312311   UINT16      input_data;
313312   UINT16      output_data;
314313   UINT16      output_control;
315   UINT32      output_control_cycles;
314   UINT64      output_control_cycles;
316315   UINT8      last_output_full;
317316   UINT8      last_input_empty;
318317   void      (*output_full_cb)(int);
r1649r1650
16871686      return;
16881687
16891688   /* count cycles */
1690   elapsed_cycles = cpunum_gettotalcycles64(dcs.cpunum) - dcs.timer_start_cycles;
1689   elapsed_cycles = cpunum_gettotalcycles(dcs.cpunum) - dcs.timer_start_cycles;
16911690   elapsed_clocks = elapsed_cycles / dcs.timer_scale;
16921691
16931692   /* if we haven't counted past the initial count yet, just do that */
r1649r1650
17131712   /* we do this to avoid drifting */
17141713   dcs.timers_fired++;
17151714   target_cycles = dcs.timer_start_cycles + dcs.timer_scale * (dcs.timer_start_count + 1 + dcs.timers_fired * (dcs.timer_period + 1));
1716   target_cycles -= cpunum_gettotalcycles64(dcs.cpunum);
1715   target_cycles -= cpunum_gettotalcycles(dcs.cpunum);
17171716
17181717   /* set the next timer, but only if it's for a reasonable number */
17191718   if (!dcs.timer_ignore && (dcs.timer_period > 10 || dcs.timer_scale > 1))
r1649r1650
17291728      return;
17301729
17311730   /* compute the time until the first firing */
1732   dcs.timer_start_cycles = cpunum_gettotalcycles64(dcs.cpunum);
1731   dcs.timer_start_cycles = cpunum_gettotalcycles(dcs.cpunum);
17331732   dcs.timers_fired = 0;
17341733
17351734   /* if this is the first timer, check the IRQ routine for the DRAM refresh stub */
src/mame/audio/exidy.c
r1649r1650
77#include "driver.h"
88#include "rescap.h"
99#include "streams.h"
10#include "deprecat.h"
1011#include "cpu/m6502/m6502.h"
1112#include "machine/6821pia.h"
1213#include "sound/hc55516.h"
src/mame/audio/gyruss.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/i8039/i8039.h"
34#include "sound/flt_rc.h"
45
r1649r1650
2829
2930READ8_HANDLER( gyruss_portA_r )
3031{
31   /* need to protect from totalcycles overflow */
32   static int last_totalcycles = 0;
33
34   /* number of Z80 clock cycles to count */
35   static int clock;
36
37   int current_totalcycles;
38
39   current_totalcycles = activecpu_gettotalcycles();
40   clock = (clock + (current_totalcycles-last_totalcycles)) % 10240;
41
42   last_totalcycles = current_totalcycles;
43
44   return gyruss_timer[clock/1024];
32   return gyruss_timer[(activecpu_gettotalcycles()/1024) % 10];
4533}
4634
4735
src/mame/machine/nycaptor.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213static UINT8 from_main,from_mcu;
1314static int mcu_sent = 0,main_sent = 0;
src/mame/machine/rainbow.c
r1649r1650
4848*************************************************************************/
4949
5050#include "driver.h"
51#include "deprecat.h"
5152
5253static UINT8* CRAM[8];
5354
src/mame/machine/scudsp.c
r1649r1650
5050
5151******************************************************************************************/
5252#include "driver.h"
53#include "deprecat.h"
5354#include "machine/scudsp.h"
5455#include "osd_cpu.h"
5556
src/mame/machine/irem_cpu.c
r1649r1650
298298// 0x77 (0x18) opcode is right but arguments could be swapped
299299// 0xb8 (0x2b) not sure, could be 0x1b
300300
301
302301const UINT8 gussun_decryption_table[256] = {
303   0xcd,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0x20,xxxx,xxxx, /* 00 */
304//  !!!!                                     ^^^^ !!!!                !!!!
305   xxxx,xxxx,0x75,0x24,0x08,0x83,0x32,0xe9, xxxx,0x79,xxxx,0x8f,0x22,xxxx,0xac,xxxx, /* 10 */
306//                 !!!! ????      ^^^^            pppp      gggg !!!!      ^^^^
307   0x5d,0xa5,0x11,0x51,0x0a,xxxx,0x19,xxxx ,0xf8,0x98,0x91,0x40,0x28,0x10,0x03,0x5f, /* 20 */
308//            pppp      !!!!      ????       ^^^^ pppp ^^^^ gggg gggg pppp
309   0x26,xxxx,xxxx,0x8b,xxxx,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0xf1,0xb3,xxxx, /* 30 */
310//
311   xxxx,0x01,0xc6,xxxx,xxxx,0x3a,0x29,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,0x29,xxxx, /* 40 */
312//       ????                     ????                 !!!!                ????
313   xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x2c,0x76,0x2b,xxxx,xxxx,0xba,0x2a, /* 50 */
314//            !!!! ^^^^      ^^^^                 gggg ???? !!!!                !!!!
315   0xb0,xxxx,0x28,0x7d,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */
316//            ???? gggg                                !!!! ^^^^
302   0xcd,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0xa8,xxxx,xxxx, /* 00 */
303//  0x63                          gggg            gggg                gggg
304   xxxx,xxxx,0x75,0x24,0x08,0x83,0x32,0xe9, xxxx,0x7d,xxxx,0x8f,0x22,xxxx,0xac,xxxx, /* 10 */
305//                      ????                      pppp      gggg
306   0x5d,0xa5,0x11,0x51,0x0a,0x29,0x01,xxxx ,0xf8,0x98,0x91,0x40,0x28,0x00,0x03,0x5f, /* 20 */
307//            gggg           pppp ????       gggg gggg      gggg gggg pppp
308   0x26,xxxx,xxxx,0x8b,0x2f,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0xf1,0xb3,xxxx, /* 30 */
309//                      gggg                                          0x90
310   xxxx,0x19,0xc6,xxxx,xxxx,0x3a,0x01,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,0x01,xxxx, /* 40 */
311//       ????                     ????                                     ????
312   xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x2c,0x7e,0x2b,xxxx,xxxx,0xba,0x2a, /* 50 */
313//            gggg           ????                 gggg pppp gggg
314   0xb0,xxxx,0x28,0x79,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */
315//            ???? pppp           gggg                 gggg
317316   xxxx,0xea,0x72,0x73,0xad,0xd1,0x3b,0x5e, 0xe5,0x57,xxxx,0x0d,xxxx,xxxx,xxxx,0x3c, /* 70 */
318//                      ^^^^
319   xxxx,0x86,xxxx,0xb5,0x30,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */
320//                 ???? ????                           ^^^^      !!!!      !!!!
321   xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,0x01, /* 90 */
322//            !!!!                     ^^^^  !!!! ^^^^      !!!!                ????
323   xxxx,0xa3,xxxx,xxxx,xxxx,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,0x41,0x80,0x8c,0xd4,xxxx, /* a0 */
324//                                     gggg                 ????      gggg !!!!
325   xxxx,0x19,0x20,0x19,0x77,0x3d,0x3e,xxxx, xxxx,xxxx,0x4b,xxxx,xxxx,xxxx,xxxx,xxxx, /* b0 */
326//       ???? ???? ???? gggg                           pppp
317//                 gggg                                     ????
318   xxxx,0x86,0x76,0x7f,0x08,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */
319//            ???? pppp ????      ????       gggg
320   xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,0x19, /* 90 */
321//            ????                     gggg                                     ????
322   xxxx,0xa3,xxxx,xxxx,xxxx,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,0x48,0x80,0x8c,0xd4,xxxx, /* a0 */
323//                                     gggg                 ????      gggg gggg
324   xxxx,0x19,0x00,0x19,0x77,0x3d,0x3e,xxxx, xxxx,0xb6,0x4b,xxxx,xxxx,xxxx,xxxx,xxxx, /* b0 */
325//       ???? ???? ???? gggg      ????            ???? pppp
327326   xxxx,0xff,0x47,xxxx,0x55,0x1e,xxxx,0x59, 0x93,xxxx,xxxx,xxxx,0x88,0xc1,0x01,0xb2, /* c0 */
328//            ^^^^                           ^^^^                     ^^^^ ????
329   xxxx,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,xxxx,xxxx,0x1f,0x23,xxxx, /* d0 */
330//       ^^^^                                               ????
331   0xe8,xxxx,0x89,0xa1,0xd0,xxxx,0x19,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */
332//                                ????                      !!!!                !!!!
333   0xfb,xxxx,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,0x7c,0xf7,0xbd,0x39,0x7f,0xbf,xxxx, /* f0 */
334//  !!!!                                          ????      !!!!      gggg
327//            ????                                                         pppp
328   xxxx,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,0x4a,xxxx,0x1f,0x23,xxxx, /* d0 */
329//                                                          ????
330   0xe8,xxxx,0x89,0xa1,0xd0,xxxx,0x11,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */
331//                                ????                      ????                gggg
332   0xfb,xxxx,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,0x7d,0xf7,0xbd,0x39,0x71,0xbf,xxxx, /* f0 */
333//                                                pppp      gggg      pppp
335334};
336335
337
338336/*
339337missing opcode:
340N**14 -> 08? (2097b 20980 - routine from 2097a) (00 01 08 09 30 31) probably 08 - after the start and before the menu
341             - to handle the player number
342N++26 -> 29? (14ed_ , 198e_
343N--41 -> 19?
344N//46 -> 10? (1461b
345N--4e -> 19? (208ac -
346Y//5a -> 76? (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,71,77,79,7a,7b,7d,7f - ok 76 78 7c 7e
3471//62 -> 28? (1cf86 1cfa3 - routine from 1cf61 to 1cff4)  (water in level 1)
3481--83 -> b7? (194cd - routine from) no b7,b3,b4 ok b6,b5
3490**84 -> 18? (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,18,20,28,30)
350---9f -> 19? (
351///ab -> 42?
352---b1 -> 19?
353---b2 -> 20. (20a8b - 20acc             probably 20 - after the start and before the menu - to handle the player number
354///b3 -> 19? (216b6 - 216cf
35501+ce -> 01? (10236 - routine from 1017e to 10254) (01, 09, 19, 21, 29, 31) -> probably 01
356///db ->     (16992
357///eb ->
358///f9 -> 7c? (16598 - 165a1 - 18de7 - routine from 18dc4 to ) no 71,72,76,78 ok 70,73,77,79,7a
359338
339"    " -> checked against hasamu (i.e. you can compare gussun from 2002a and hasamu from 54a0)
340"gggg" -> very probably
341"pppp" -> probably
342"????" -> missing
343"0xHH" -> right code (not supported)
344
34514 -> 08 (2097b 20980 - routine from 2097a) (00 01 08 09 30 31) probably 08 - after the start and before the menu
346          - to handle the player number
347j19 -> 79 (1df45 routine from 1df27 / 2282f - routine from 2281f to 22871) no 70,71,76,77,78,7a,7b,7c,7e,7f(ok) ok 79,7d
348.26 -> 29 (14ed_ , 198e_
349.41 -> 19
350.46 -> 10 (1461b
351.4e -> 19 (208ac -
352j5a -> 7e (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,71(ok),77,79,7a,7b,7d,7f ok 76,78,7c,7e
353.62 -> 28 (1cf86 1cfa3 - routine from 1cf61 to 1cff4)  (water in level 1) (01 11 19 29)
354j63 -> 78 (1df7f, 1df8c, 1df95, 21f08 - routine from 1df27 to ) no 71(ok),77(ok),7f(ok) ok 70,76,78,79 7a,7b,7c,7d,7e
355j82 -> 76 (76,78,7c,7e) ->
356.84 -> 18 (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,18,28,30) (sprite animation)
357.9f -> 19 (
358ab -> 42
359.b1 -> 19
360.b2 -> 20 (20a8b - 20acc             probably 20 - after the start and before the menu - to handle the player number
361.b3 -> 19 (216b6 - 216cf
362b9 -> b5 (21210 - ) 2 bytes -
363db ->    (16992
364jf9 -> 7c (16d02(f 16cfa)-16598-165a1-18de7(f 18dc4) no 71,77(ok),(icons? 70,76,78,7a,7c,7e),7f maybe 79,7b,7d
365
360366rz probably:
36119 -> 79 (1df45 routine from 1df27 / 2282f - routine from 2281f to 22871) ok 79,7d,7f -> 79
36222 -> 11 (1deff - routine from 1dee8 to 1df26) -> 11 - to handle sprite animation
3632d -> 10 (1df1d - routine from 1dee8 to 1df26) -> 10 - to handle sprite animation
36429 -> 98 (1df22 - routine from 1dee8 to 1df26) -> 98 - to handle sprite animation
3672d -> 00 (1df1d - routine from 1dee8 to 1df26) -> 00 - to handle sprite animation
36883 -> 7f (194cd - routine from) no 70,71,76,78,79,7a,7c,7d,7e ok 77(no),7b(white rocks) ok 7f
369b4 -> 77 (1d03a, 1d57a - routine from 1d4df ) no 70,71,76,78,79,7a,7b,7c,7d,7e,7f ok 77
365370ba -> 4b (1094d, 10b28 - routine from 10948 to 10b73) one byte -> probably 4b
371c2 -> 47 (22881, 220ff - routine from 22872 to 22885) (4f?)
372ce -> 01 (10236 - routine from 1017e to 10254) (01, 09, 19, 21, 29, 31) -> probably 01
373fd -> 71 (1d659 - routine from 1d63c to 1d65e) no 70,76,77,78,79,7a,7b,7c,7d,7e,7f  ok 71
366374
367375rz guess:
3682b -> 40 (1d4d2 1db81 1dba9 - routine from 1d4b2 to 1d4de) (ok 40,48,96) -> 40
369         (no 0e,16,17,27,2f,37,3f,41,42,44,45,4a,4b,4c,4d,4e,4f,54,5c,6c,6d,92,94,95,97)
37606 -> b1 (22872 - routine from 22872 to 2289d)
37709 -> cd (22a17 - routine from 229ed to 22a1a)
3780d -> a8 (
3791b -> 8f (1d8f9 - routine from 1d8c7 to 1d8fc) - three bytes (pop instruction for the push in 1d8e6)
38022 -> 11 (1deff - routine from 1dee8 to 1df26) -> 11 - to handle sprite animation
38125 -> 29 (195a0 - routine from 194e1 to ) (19,29)
38228 -> f8 (
38329 -> 98 (1df22 - routine from 1dee8 to 1df26) -> 98 - to handle sprite animation
3842b -> 40 (1d4d2 1db81 1dba9 - routine from 1d4b2 to 1d4de) -> 40
3703852c -> 28 (20333 - routine from 2032a to 20366)
38634 -> 2f (20381 - routine from 2037b to 20391) - used to handle number of lives and game over
38752 -> a0
37138859 -> 2c (220cf - 2037f - routine from 2202f to ) 2bytes (2c,
37263 -> 7d (1df7f, 1df8c, 1df95,21f08 - routine from 1df1d to ) - two bytes j..
3731b -> 8f (1d8f9 - routine from 1d8c7 to 1d8fc) - three bytes (pop instruction for the push in 1d8e6)
3895b -> 2b (used in "Service Mode" / "CHARACTER menu")
39066 -> b5 (1daaf - routine from 1da61 to 1daca) - two bytes (colors effect)
3916a -> 27 (20368 - routine from 20368 to 2037a) - used to limit the max lives number
39273 -> 73 (1d4f7 - routine from 1d4df to 1d539) -> (no 70,71,72,74,75,76,77,78,79,7a,7b,7c,7d,7e,7f) - ok 73
39388 -> 9a
39497 -> cb
374395a7 -> b4 (2029a - routine from 20290 to
375ad -> 8c (1d559, 1d8d4 - routine from 1d547 - ; routine from 1d8b8 to 1d8fc)
376b4 -> 77 (1d03a, 1d57a - routine from 1d4df ) 7f,7d,7b  -  79 - "77"
377fd -> 7f (1d659 - routine from 1d63c to 1d65e) 77,7f
396ad -> 8c (1d559, 1d8d4 - routine from 1d547 - ; routine from 1d8b8 to 1d8fc) ..............................
397ae -> d4 (20215 - ) used when you insert a coin to handle the "coin number" in decimal
398ef -> 49 (dec CW) (used in "Service Mode" / "CHARACTER menu")
399fb -> bd
378400
379401missing V35+ core:
38040200    -> 63    not supported (229e2 - routine from 229da to 229ec) (for now we use cd instruction + hack)
3814030f 92 -> of 92 not supported (1011d before of STI instruction) (for now no effects)
382404
383above - c8 (inc aw) guess from stos code
3840xc5 -> 1e (push ds) guess (pop ds soon after) right?
3850xa9 -> 81 (not 0x82 PRE) guess from 237df
3860xcd -> c1 total guess (wrong but 3 bytes)
405-------------------------------------------------------------------------------------------------------------
387406
388407AS notes:
3894080x1e is lodsb not lds,noted from 2344f
r1649r1650
3954140x19 guess (0x82 PRE)
3964150xc2 guess,it could be dec iy...
397416
398RZ notes
3990xef -> 49 (dec CW) (used in "Service Mode" / "CHARACTER menu")
4000x24 -> (0a, 12) probably 0a (OR) (used in "Service Mode" / "CHARACTER menu")
4010x5b -> 2b (used in "Service Mode" / "CHARACTER menu")
4020x21 -> a5 (used in "Service Mode" / "CHARACTER menu")
403
404checked against "hasamu" code: hasamu and gussun share code (i.e. you can compare gussun from 2002a and hasamu from 54a0)
4050x09 -> cd (22a17 - routine from 229ed to 22a1a) - two bytes
4060x13 -> 24 (interrupt routine)
4070x1c -> 22 (interrupt routine)
4080x34 -> 2f (20381 - routine from 2037b to 20391) - used to handle number of lives and game over
4090x4a -> 61 (interrupt routine)
4100x66 -> b5 (1daaf - routine from 1da61 to 1daca) - two bytes (colors effect)
4110x6a -> 27 (20368 - routine from 20368 to 2037a) - used to limit the max lives number
4120x73 -> 73 (1d4f7 - routine from 1d4df to 1d539) -> (no 70,71,72,74,75,76,77,78,79,7a,7b,7c,7d,7e,7f) - ok 73
4130x8c -> a2 (interrupt routine)
4140x8e -> f6 (interrupt routine)
4150x9b -> 60 (interrupt routine)
4160xf0 -> fb guess (interrupt)
4170xae -> d4 (20215 - ) used when you insert a coin to handle the "coin number" in decimal
417above - c8 (inc aw) guess from stos code
4180xc5 -> 1e (push ds) guess (pop ds soon after) right?
4190xa9 -> 81 (not 0x82 PRE) guess from 237df
4200xcd -> c1 total guess (wrong but 3 bytes)
418421*/
419422
420423/*
r1649r1650
781784   for (A = 0;A < size; A++)
782785      irem_cpu_decrypted[A] = decryption_table[rom[A]];
783786
784   // Roberto Zandon? note:
787   // robiza note:
785788   // for "gussun" and "riskchal" is necessary an hack to not decrypt not encrypted routines
786789   // we need a real nec v25+/35+ core to support 0x63 (brkn for "break native") instruction
787790   // for now we use "cd" (int) instruction + hack
src/mame/machine/stactics.c
r1649r1650
11
22#include "driver.h"
3#include "deprecat.h"
34
45/* needed in video/stactics.c */
56int stactics_vert_pos;
src/mame/machine/playch10.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/ppu2c0x.h"
34#include "machine/rp5h01.h"
45
src/mame/machine/bublbobl.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/z80/z80.h"
1213
1314
src/mame/machine/s16fd.c
r1649r1650
99*/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213
1314#include "cpu/m68000/m68000.h"
1415#include "machine/fd1094.h"
r1649r1650
142143}
143144
144145
145#ifdef MAME_DEBUG
146#ifdef ENABLE_DEBUGGER
146147static void key_changed(void)
147148{
148149   int addr;
r1649r1650
187188   }
188189   fd1094_current_cacheposition = 0;
189190
190#ifdef MAME_DEBUG
191#ifdef ENABLE_DEBUGGER
191192   /* key debugging */
192193   if (Machine->debug_mode && memory_region(REGION_USER2) != NULL)
193194   {
src/mame/machine/galaxian.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "machine/7474.h"
1213#include "includes/galaxian.h"
1314
src/mame/machine/asic65.c
r1649r1650
55 *************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "includes/atarig42.h"
910#include "cpu/tms32010/tms32010.h"
1011#include "asic65.h"
11#include <math.h>
1212
1313
1414#define LOG_ASIC      0
src/mame/machine/docastle.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/z80/z80.h"
1213#include "includes/docastle.h"
1314
r1649r1650
3536*/
3637READ8_HANDLER( docastle_shared0_r )
3738{
38   if (offset == 8) logerror("CPU #0 shared0r  clock = %d\n",activecpu_gettotalcycles());
39   if (offset == 8) logerror("CPU #0 shared0r  clock = %d\n",(UINT32)activecpu_gettotalcycles());
3940   return buffer0[offset];
4041}
4142
4243
4344READ8_HANDLER( docastle_shared1_r )
4445{
45   if (offset == 8) logerror("CPU #1 shared1r  clock = %d\n",activecpu_gettotalcycles());
46   if (offset == 8) logerror("CPU #1 shared1r  clock = %d\n",(UINT32)activecpu_gettotalcycles());
4647   return buffer1[offset];
4748}
4849
r1649r1650
5051WRITE8_HANDLER( docastle_shared0_w )
5152{
5253   if (offset == 8) logerror("CPU #1 shared0w %02x %02x %02x %02x %02x %02x %02x %02x %02x clock = %d\n",
53      buffer0[0],buffer0[1],buffer0[2],buffer0[3],buffer0[4],buffer0[5],buffer0[6],buffer0[7],data,activecpu_gettotalcycles());
54      buffer0[0],buffer0[1],buffer0[2],buffer0[3],buffer0[4],buffer0[5],buffer0[6],buffer0[7],data,(UINT32)activecpu_gettotalcycles());
5455
5556   buffer0[offset] = data;
5657
r1649r1650
6768   if (offset == 8)
6869   {
6970      logerror("CPU #0 shared1w %02x %02x %02x %02x %02x %02x %02x %02x %02x clock = %d\n",
70            buffer1[0],buffer1[1],buffer1[2],buffer1[3],buffer1[4],buffer1[5],buffer1[6],buffer1[7],data,activecpu_gettotalcycles());
71            buffer1[0],buffer1[1],buffer1[2],buffer1[3],buffer1[4],buffer1[5],buffer1[6],buffer1[7],data,(UINT32)activecpu_gettotalcycles());
7172
7273      /* freeze execution of the master CPU until the slave has used the shared memory */
7374      cpu_spinuntil_trigger(500);
src/mame/machine/tnzs.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "cpu/i8x41/i8x41.h"
1718#include "includes/tnzs.h"
1819
src/mame/machine/atari.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/m6502/m6502.h"
1314#include "includes/atari.h"
1415#include "sound/pokey.h"
src/mame/machine/midyunit.c
r1649r1650
55**************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/tms34010/tms34010.h"
910#include "cpu/m6809/m6809.h"
1011#include "machine/6821pia.h"
src/mame/machine/flstory.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213extern UINT8 *onna34ro_workram;
1314extern UINT8 *victnine_workram;
src/mame/machine/slapfght.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213
1314UINT8 *slapfight_dpram;
src/mame/machine/fd1094.h
r1649r1650
55int fd1094_set_state(UINT8 *key,int state);
66int fd1094_decode(int address,int val,UINT8 *key,int vector_fetch);
77
8#ifdef MAME_DEBUG
8#ifdef ENABLE_DEBUGGER
99
1010typedef struct _fd1094_constraint fd1094_constraint;
1111struct _fd1094_constraint
src/mame/machine/mhavoc.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "video/avgdvg.h"
910#include "sound/5220intf.h"
1011#include "cpu/m6502/m6502.h"
src/mame/machine/equites.c
r1649r1650
1212// Directives
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "cpu/i8085/i8085.h"
1617#include "sound/ay8910.h"
1718#include "sound/msm5232.h"
src/mame/machine/decocass.c
r1649r1650
55 ***********************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/m6502/m6502.h"
910#include "cpu/i8x41/i8x41.h"
1011#include "machine/decocass.h"
src/mame/machine/twincobr.c
r1649r1650
44 ****************************************************************************/
55
66#include "driver.h"
7#include "deprecat.h"
78#include "cpu/m68000/m68000.h"
89#include "cpu/tms32010/tms32010.h"
910#include "twincobr.h"
src/mame/machine/konppc.c
r1649r1650
11/* Konami PowerPC-based 3D games common functions */
22
33#include "driver.h"
4#include "deprecat.h"
45#include "cpu/sharc/sharc.h"
56#include "video/voodoo.h"
67#include "konppc.h"
src/mame/machine/irobot.c
r1649r1650
66
77#include "driver.h"
88#include "profiler.h"
9#include "deprecat.h"
910#include "cpu/m6809/m6809.h"
1011#include "irobot.h"
1112
src/mame/machine/leland.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "machine/eeprom.h"
1112#include "cpu/z80/z80.h"
1213#include "leland.h"
r1649r1650
464465static TIMER_CALLBACK( leland_interrupt_callback )
465466{
466467   int scanline = param;
467   extern UINT8 leland_last_scanline_int;
468   leland_last_scanline_int = scanline;
469468
470469   /* interrupts generated on the VA10 line, which is every */
471470   /* 16 scanlines starting with scanline #8 */
r1649r1650
482481static TIMER_CALLBACK( ataxx_interrupt_callback )
483482{
484483   int scanline = param;
485   extern UINT8 leland_last_scanline_int;
486   leland_last_scanline_int = scanline;
487484
488485   /* interrupts generated according to the interrupt control register */
489486   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
r1649r1650
12141211      case 0x0d:   /* /BKXH */
12151212      case 0x0e:   /* /BKYL */
12161213      case 0x0f:   /* /BKYH */
1217         leland_gfx_port_w(offset - 0x0c, data);
1214         leland_scroll_w(offset - 0x0c, data);
12181215         break;
12191216
12201217      default:
r1649r1650
12561253      case 0x01:   /* /BKXH */
12571254      case 0x02:   /* /BKYL */
12581255      case 0x03:   /* /BKYH */
1259         leland_gfx_port_w(offset, data);
1256         leland_scroll_w(offset, data);
12601257         break;
12611258
12621259      case 0x04:   /* /MBNK */
r1649r1650
13731370
13741371WRITE8_HANDLER( leland_sound_port_w )
13751372{
1376   int gfx_banks = Machine->gfx[0]->total_elements / 0x400;
1377   int gfx_bank_mask = (gfx_banks - 1) << 4;
1378   int diff = data ^ leland_gfx_control;
1373    /* update the graphics banking */
1374      leland_gfx_port_w(0, data);
13791375
1380    /* update the graphics banking if necessary */
1381    if ((diff & 0x08) || (diff & gfx_bank_mask))
1382       leland_gfx_port_w(-1, data);
1383
13841376   /* set the new value */
13851377    leland_gfx_control = data;
13861378   leland_dac_control &= data & 3;
src/mame/machine/midwayic.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "debugger.h"
910#include "midwayic.h"
1011#include "machine/idectrl.h"
src/mame/machine/konamigx.c
r1649r1650
77 */
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "video/konamiic.h"
1112#include "machine/konamigx.h"
12#include <math.h>
1313
1414#define GX_DEBUG 0
1515
src/mame/machine/toaplan1.c
r1649r1650
44 ***************************************************************************/
55
66#include "driver.h"
7#include "deprecat.h"
78#include "cpu/m68000/m68000.h"
89#include "cpu/tms32010/tms32010.h"
910#include "includes/toaplan1.h"
src/mame/machine/daikaiju.c
r1649r1650
9898
9999***************************************************************************/
100100#include "driver.h"
101#include "deprecat.h"
101102#include "cpu/z80/z80.h"
102103
103104#define ID_DAIKAIJU 0x5a
src/mame/machine/namcoio.c
r1649r1650
133133***************************************************************************/
134134
135135#include "driver.h"
136#include "deprecat.h"
136137#include "machine/namcoio.h"
137138#include "machine/namco50.h"
138139#include "sound/namco52.h"
src/mame/machine/dc.c
r1649r1650
44
55*/
66
7#include "mamecore.h"
87#include "driver.h"
8#include "deprecat.h"
99#include "dc.h"
1010#include "cpu/sh4/sh4.h"
1111
src/mame/machine/pitnrun.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/m6805/m6805.h"
1213
1314
src/mame/machine/carpolo.c
r1649r1650
77****************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6502/m6502.h"
1112#include "machine/6821pia.h"
1213#include "machine/7474.h"
src/mame/machine/fddebug.c
r1649r1650
105105
106106***************************************************************************/
107107
108#ifdef MAME_DEBUG
108#ifdef ENABLE_DEBUGGER
109109
110110#include "driver.h"
111#include "deprecat.h"
111112#include "machine/fd1094.h"
112113#include "cpu/m68000/m68k.h"
113114
r1649r1650
22022203
22032204                        /* make sure we match the disassembler */
22042205                        {
2205                           char dummybuffer[256];
2206                           char dummybuffer[40];
22062207                           UINT8 instrbuffer[10];
22072208                           instrbuffer[0] = (opnum | eabits) >> 8;
22082209                           instrbuffer[1] = (opnum | eabits);
2210                           dummybuffer[0] = 0;
22092211                           assert(length == (m68k_disassemble_raw(dummybuffer, 0, instrbuffer, instrbuffer, M68K_CPU_TYPE_68000) & 0xff) / 2);
22102212                        }
22112213
src/mame/machine/namcos1.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "sound/ym2151.h"
34#include "sound/namco.h"
45
src/mame/machine/segaic16.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "segaic16.h"
910#include "video/resnet.h"
1011
src/mame/machine/buggychl.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/z80/z80.h"
34
45
src/mame/machine/n64.c
r1649r1650
11/* machine/n64.c - contains N64 hardware emulation shared between MAME and MESS */
22
33#include "driver.h"
4#include "deprecat.h"
45#include "cpu/mips/mips3.h"
56#include "sound/custom.h"
67#include "streams.h"
src/mame/machine/model3.c
r1649r1650
55*/
66
77#include "driver.h"
8#include "deprecat.h"
89
910static int m3_step;
1011
src/mame/machine/tait8741.c
r1649r1650
88*/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "tait8741.h"
1213
1314#define VERBOSE 0
src/mame/machine/balsente.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6809/m6809.h"
1112#include "balsente.h"
1213#include "sound/cem3394.h"
13#include <math.h>
1414
1515
1616#define LOG_CEM_WRITES      0
src/mame/machine/vsnes.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "video/ppu2c0x.h"
1213
1314/* Globals */
src/mame/machine/qix.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "qix.h"
1112#include "machine/6821pia.h"
1213#include "cpu/m6800/m6800.h"
src/mame/machine/mexico86.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34
45UINT8 *mexico86_protection_ram;
src/mame/machine/snes.c
r1649r1650
1212***************************************************************************/
1313#define __MACHINE_SNES_C
1414
15#include <math.h>
1615#include "driver.h"
16#include "deprecat.h"
1717#include "includes/snes.h"
1818#include "cpu/g65816/g65816.h"
1919#ifdef MESS
src/mame/machine/taitosj.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/m6805/m6805.h"
1213
1314
src/mame/machine/amiga.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "includes/amiga.h"
1314#include "cpu/m68000/m68000.h"
1415#include "machine/6526cia.h"
src/mame/machine/vertigo.c
r1649r1650
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "vertigo.h"
910#include "exidy440.h"
1011#include "machine/74148.h"
src/mame/machine/lkage.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213
1314static UINT8 from_main,from_mcu;
src/mame/machine/pcshare.c
r1649r1650
11/***************************************************************************
22
3    machine/pc.c
3    machine/pcshare.c
44
55    Functions to emulate general aspects of the machine
66    (RAM, ROM, interrupts, I/O ports)
r1649r1650
2121***************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "memconv.h"
2526#include "machine/8255ppi.h"
2627
src/mame/machine/atarigen.c
r1649r1650
88
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "atarigen.h"
1213#include "slapstic.h"
1314#include "cpu/m6502/m6502.h"
src/mame/machine/midwunit.c
r1649r1650
55**************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/tms34010/tms34010.h"
910#include "cpu/m6809/m6809.h"
1011#include "audio/dcs.h"
src/mame/machine/namcos2.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/m6809/m6809.h"
1415#include "cpu/m6805/m6805.h"
1516#include "namcos2.h"
src/mame/machine/namco50.c
r1649r1650
130130***************************************************************************/
131131
132132#include "driver.h"
133#include "deprecat.h"
133134#include "namco50.h"
134135#include "cpu/mb88xx/mb88xx.h"
135136
src/mame/machine/tx1.c
r1649r1650
44
55***************************************************************************/
66#include "driver.h"
7#include "deprecat.h"
78#include "debugger.h"
89#include "machine/8255ppi.h"
910#include "tx1.h"
src/mame/machine/decoprot.c
r1649r1650
7171***************************************************************************/
7272
7373#include "driver.h"
74#include "deprecat.h"
7475#include "machine/eeprom.h"
7576#include "decoprot.h"
7677
src/mame/machine/mcr.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/z80ctc.h"
910#include "machine/z80pio.h"
1011#include "machine/z80sio.h"
src/mame/machine/tatsumi.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "tatsumi.h"
34#include "sound/2151intf.h"
45#include "sound/okim6295.h"
src/mame/machine/retofinv.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/z80/z80.h"
34
45
src/mame/machine/harddriv.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/tms34010/tms34010.h"
910#include "cpu/tms34010/34010ops.h"
1011#include "cpu/adsp2100/adsp2100.h"
src/mame/machine/psx.c
r1649r1650
66
77***************************************************************************/
88
9#include <stdarg.h>
109#include "driver.h"
10#include "deprecat.h"
1111#include "cpu/mips/psx.h"
1212#include "includes/psx.h"
1313
r1649r1650
471471static UINT16 m_p_n_root_count[ 3 ];
472472static UINT16 m_p_n_root_mode[ 3 ];
473473static UINT16 m_p_n_root_target[ 3 ];
474static UINT32 m_p_n_root_start[ 3 ];
474static UINT64 m_p_n_root_start[ 3 ];
475475
476476#define RC_STOP ( 0x01 )
477477#define RC_RESET ( 0x04 ) /* guess */
r1649r1650
482482#define RC_CLC ( 0x100 )
483483#define RC_DIV ( 0x200 )
484484
485static UINT32 psxcpu_gettotalcycles( void )
485static UINT64 psxcpu_gettotalcycles( void )
486486{
487487   /* TODO: should return the start of the current tick. */
488488   return cpunum_gettotalcycles(0) * 2;
r1649r1650
514514   }
515515   else
516516   {
517      UINT32 n_current;
517      UINT64 n_current;
518518      n_current = psxcpu_gettotalcycles() - m_p_n_root_start[ n_counter ];
519519      n_current /= root_divider( n_counter );
520520      n_current += m_p_n_root_count[ n_counter ];
src/mame/machine/dec0.c
r1649r1650
77*******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "dec0.h"
1112#include "cpu/h6280/h6280.h"
1213
src/mame/machine/beezer.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/m6809/m6809.h"
34#include "machine/6522via.h"
45
src/mame/machine/lsasquad.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/z80/z80.h"
34
45
src/mame/machine/kaneko16.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "includes/kaneko16.h"
1718
1819#include "kanekotb.h"   // TOYBOX MCU trojaning results
src/mame/machine/williams.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "audio/williams.h"
910#include "cpu/m6800/m6800.h"
1011#include "cpu/m6809/m6809.h"
r1649r1650
269270   /* the IRQ signal comes into CB1, and is set to VA11 */
270271   pia_1_cb1_w(0, scanline & 0x20);
271272
272   /* update the screen while we're here */
273   video_screen_update_partial(0, scanline - 1);
274
275273   /* set a timer for the next update */
276   scanline++;
274   scanline += 0x20;
277275   if (scanline >= 256) scanline = 0;
278276   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
279277}
r1649r1650
401399   pia_0_cb1_w(0, scanline & 0x20);
402400   pia_1_ca1_w(0, scanline & 0x20);
403401
404   /* update the screen while we're here */
405   video_screen_update_partial(0, scanline);
406
407402   /* set a timer for the next update */
408   scanline++;
403   scanline += 0x20;
409404   if (scanline >= 256) scanline = 0;
410405   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
411406}
r1649r1650
513508
514509      /* page 3 accesses palette RAM; the remaining areas are as if page 1 ROM was selected */
515510      case 3:
516         memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, williams2_paletteram_r);
511         memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, MRA8_BANK4);
517512         memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, williams2_paletteram_w);
518513         memory_set_bank(1, 1 + ((vram_bank & 4) >> 1));
514         memory_set_bankptr(4, paletteram);
519515         break;
520516   }
521517}
src/mame/machine/system16.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "system16.h"
34#include "sound/upd7759.h"
45
src/mame/machine/namcond1.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/m6809/m6809.h"
1415#include "namcond1.h"
1516
src/mame/machine/cps2crpt.c
r1649r1650
111111*******************************************************************************/
112112
113113#include "driver.h"
114#include "deprecat.h"
114115#include "cpu/m68000/m68kmame.h"
115116#include "ui.h"
116117#include "includes/cps1.h"
src/mame/machine/starwars.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "starwars.h"
1213#include "video/avgdvg.h"
1314
src/mame/machine/atarifb.c
r1649r1650
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "atarifb.h"
910#include "sound/discrete.h"
1011
src/mame/machine/simpsons.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/konamiic.h"
34#include "cpu/konami/konami.h"
45#include "machine/eeprom.h"
src/mame/machine/model1.c
r1649r1650
33*/
44
55#include "driver.h"
6#include "deprecat.h"
67#include "debugger.h"
7#include <math.h>
88#include "cpu/mb86233/mb86233.h"
99
1010enum {FIFO_SIZE = 256};
src/mame/machine/slapstic.c
r1649r1650
179179*************************************************************************/
180180
181181#include "driver.h"
182#include "deprecat.h"
182183#include "slapstic.h"
183184#include "cpu/m68000/m68000.h"
184185
src/mame/machine/ajax.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/m6809/m6809.h"
1213#include "cpu/z80/z80.h"
1314#include "cpu/konami/konami.h"
src/mame/machine/bigevglf.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213
1314static UINT8 from_mcu;
src/mame/machine/nitedrvr.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "nitedrvr.h"
910#include "sound/discrete.h"
1011
src/mame/mamedriv.c
r1649r1650
340340   DRIVER( ckongalc )   /* bootleg */
341341   DRIVER( bigkong )   /* bootleg */
342342   DRIVER( monkeyd )   /* bootleg */
343   DRIVER( rpatrol )   /* Orca, from a suspicious set */
343344   DRIVER( rpatrolb )   /* bootleg */
344   DRIVER( rpatrolo )   /* Orca, from a suspicious set */
345345   DRIVER( silvland )   /* Falcon */
346346   DRIVER( yamato )   /* (c) 1983 Sega */
347347   DRIVER( yamato2 )   /* (c) 1983 Sega */
r1649r1650
69556955   DRIVER( hyprduel )   /* (c) 1993 Technosoft (World) */
69566956   DRIVER( hyprdelj )   /* (c) 1993 Technosoft (Japan) */
69576957   DRIVER( magerror )   /* (c) 199? Technosoft (Japan) */
6958   DRIVER( puzzlet )   /* (c) 2000 Yunizu Corporation (Japan) */
69586959
69596960   /* Venture Line games */
69606961   DRIVER( spcforce )   /* (c) 1980 Venture Line */
r1649r1650
73327333   /* Tatsumi Games */
73337334   DRIVER( tx1 )      /* (c) 1983 Tatsumi */
73347335   DRIVER( tx1a )      /* (c) 1983 Tatsumi */
7336   /* TX-1 V8 */      /* (c) 1984 Tatsumi */
73357337   DRIVER( buggyboy )   /* (c) 1985 Tatsumi */
73367338   DRIVER( buggybjr )   /* (c) 1986 Tatsumi */
73377339   DRIVER( lockon )   /* (c) 1986 Tatsumi */
7340   DRIVER( lockonc )   /* (c) 1986 Tatsumi */
73387341   /* Gray Out */      /* (c) 1987 Tatsumi */
73397342   DRIVER( apache3 )   /* (c) 1988 Tatsumi */
73407343   DRIVER( roundup5 )   /* (c) 1989 Tatsumi */
r1649r1650
73467349   DRIVER( stlforce )   /* (c) 1994 Electronic Devices (Italy) / Ecogames S.L. (Spain) */
73477350   DRIVER( fantland )   /* (c) 198? Electronic Devices Italy */
73487351   DRIVER( fantlnda )   /* (c) 198? Electronic Devices Italy */
7352   DRIVER( wheelrun )   /* (c) 1988? International Games */
73497353   DRIVER( galaxygn )   /* (c) 1989 Electronic Devices Italy */
73507354   DRIVER( borntofi )   /* (c) International Games? */
73517355   DRIVER( diverboy )   /* (c) 1992 Electronic Devices */
r1649r1650
76837687   DRIVER( promutrv )   /* (c) 1985 Enerdyne Technologies Inc */
76847688   DRIVER( promutra )   /* (c) 1985 Enerdyne Technologies Inc */
76857689   DRIVER( promutrb )   /* (c) 1985 Enerdyne Technologies Inc */
7690   DRIVER( promutrc )   /* (c) 1985 Enerdyne Technologies Inc */
76867691   DRIVER( strvmstr )   /* (c) 1986 Enerdyne Technologies Inc */
76877692   DRIVER( dorachan )   /* (c) 1980 Craul Denshi */
76887693   DRIVER( ladyfrog )   /* (c) 1990 Mondial Games */
r1649r1650
79187923   DRIVER( drw80pkr )
79197924   DRIVER( blazlaz )
79207925   DRIVER( paranoia )
7926   DRIVER( galgbios )  /* (c) 1998 Creative Electonics */
79217927
79227928#endif   /* DRIVER_RECURSIVE */
src/mame/includes/tutankhm.h
r0r1650
1/***************************************************************************
2
3    Tutankham
4
5***************************************************************************/
6
7/*----------- defined in video/tutankhm.c -----------*/
8
9extern UINT8 *tutankhm_scroll;
10
11WRITE8_HANDLER( tutankhm_flip_screen_x_w );
12WRITE8_HANDLER( tutankhm_flip_screen_y_w );
13
14VIDEO_START( tutankhm );
15VIDEO_UPDATE( tutankhm );
16
17WRITE8_HANDLER( junofrst_blitter_w );
src/mame/includes/m52.h
r0r1650
1/*************************************************************************
2
3    Irem M52 hardware
4
5*************************************************************************/
6
7/*----------- defined in video/m52.c -----------*/
8
9READ8_HANDLER( m52_protection_r );
10WRITE8_HANDLER( m52_scroll_w );
11WRITE8_HANDLER( m52_bg1xpos_w );
12WRITE8_HANDLER( m52_bg1ypos_w );
13WRITE8_HANDLER( m52_bg2xpos_w );
14WRITE8_HANDLER( m52_bg2ypos_w );
15WRITE8_HANDLER( m52_bgcontrol_w );
16WRITE8_HANDLER( m52_flipscreen_w );
17WRITE8_HANDLER( m52_videoram_w );
18WRITE8_HANDLER( m52_colorram_w );
19
20PALETTE_INIT( m52 );
21VIDEO_START( m52 );
22VIDEO_UPDATE( m52 );
23
24
src/mame/includes/lockon.h
r0r1650
1/*************************************************************************
2
3    Lock-On hardware
4
5*************************************************************************/
6
7/* Calculated from CRT controller writes */
8#define PIXEL_CLOCK         (XTAL_21MHz / 3)
9#define FRAMEBUFFER_CLOCK   XTAL_10MHz
10#define HBSTART            320
11#define HBEND            0
12#define HTOTAL            448
13#define VBSTART            240
14#define VBEND            0
15#define VTOTAL            280
16
17enum
18{
19   MAIN_CPU = 0,
20   GROUND_CPU,
21   OBJECT_CPU,
22   SOUND_CPU
23};
24
25/*----------- defined in drivers/lockon.c -----------*/
26extern UINT8  lockon_ctrl_reg;
27extern UINT32 lockon_main_inten;
28
29/*----------- defined in video/lockon.c -----------*/
30PALETTE_INIT( lockon );
31VIDEO_START( lockon );
32VIDEO_UPDATE( lockon );
33VIDEO_EOF( lockon );
34READ16_HANDLER( lockon_crtc_r );
35WRITE16_HANDLER( lockon_crtc_w );
36WRITE16_HANDLER( lockon_rotate_w );
37WRITE16_HANDLER( lockon_fb_clut_w );
38WRITE16_HANDLER( lockon_scene_h_scr_w );
39WRITE16_HANDLER( lockon_scene_v_scr_w );
40WRITE16_HANDLER( lockon_ground_ctrl_w );
41WRITE16_HANDLER( lockon_char_w );
42
43WRITE16_HANDLER( lockon_tza112_w );
44READ16_HANDLER( lockon_obj_4000_r );
45WRITE16_HANDLER( lockon_obj_4000_w );
46
47extern UINT16 *lockon_char_ram;
48extern UINT16 *lockon_scene_ram;
49extern UINT16 *lockon_object_ram;
50extern UINT16 *lockon_hud_ram;
51extern UINT16 *lockon_ground_ram;
52
53extern size_t lockon_hudram_size;
54extern size_t lockon_objectram_size;
55extern size_t lockon_groundram_size;
src/mame/includes/arabian.h
r1649r1650
88
99/*----------- defined in video/arabian.c -----------*/
1010
11extern UINT8 *arabian_blitter;
1112extern UINT8 arabian_video_control;
1213extern UINT8 arabian_flip_screen;
1314
src/mame/includes/leland.h
r1649r1650
127127extern UINT8 *ataxx_qram;
128128extern UINT8 leland_last_scanline_int;
129129
130VIDEO_START( leland );
131VIDEO_START( ataxx );
132
130WRITE8_HANDLER( leland_scroll_w );
133131WRITE8_HANDLER( leland_gfx_port_w );
134132
135133WRITE8_HANDLER( leland_master_video_addr_w );
r1649r1650
145143READ8_HANDLER( ataxx_mvram_port_r );
146144READ8_HANDLER( ataxx_svram_port_r );
147145
148VIDEO_EOF( leland );
149VIDEO_UPDATE( leland );
150VIDEO_UPDATE( ataxx );
146MACHINE_DRIVER_EXTERN( leland_video );
147MACHINE_DRIVER_EXTERN( ataxx_video );
src/mame/includes/m57.h
r0r1650
1/*************************************************************************
2
3    Irem M57 hardware
4
5*************************************************************************/
6
7/*----------- defined in video/m57.c -----------*/
8
9extern UINT8 *m57_scroll;
10
11WRITE8_HANDLER( m57_videoram_w );
12WRITE8_HANDLER( m57_flipscreen_w );
13
14PALETTE_INIT( m57 );
15VIDEO_START( m57 );
16VIDEO_UPDATE( m57 );
17
src/mame/includes/m62.h
r0r1650
1/*************************************************************************
2
3    Irem M62 hardware
4
5*************************************************************************/
6
7/*----------- defined in video/centiped.c -----------*/
8
9PALETTE_INIT( m62 );
10PALETTE_INIT( lotlot );
11PALETTE_INIT( battroad );
12PALETTE_INIT( spelunk2 );
13
14WRITE8_HANDLER( m62_tileram_w );
15WRITE8_HANDLER( m62_textram_w );
16WRITE8_HANDLER( m62_flipscreen_w );
17WRITE8_HANDLER( m62_hscroll_low_w );
18WRITE8_HANDLER( m62_hscroll_high_w );
19WRITE8_HANDLER( m62_vscroll_low_w );
20WRITE8_HANDLER( m62_vscroll_high_w );
21extern UINT8 *m62_tileram;
22extern UINT8 *m62_textram;
23
24VIDEO_START( kungfum );
25VIDEO_UPDATE( kungfum );
26WRITE8_HANDLER( kungfum_tileram_w );
27
28VIDEO_START( ldrun );
29VIDEO_UPDATE( ldrun );
30
31VIDEO_START( ldrun2 );
32
33VIDEO_START( battroad );
34VIDEO_UPDATE( battroad );
35
36VIDEO_START( ldrun4 );
37VIDEO_UPDATE( ldrun4 );
38
39VIDEO_START( lotlot );
40VIDEO_UPDATE( lotlot );
41
42WRITE8_HANDLER( kidniki_text_vscroll_low_w );
43WRITE8_HANDLER( kidniki_text_vscroll_high_w );
44WRITE8_HANDLER( kidniki_background_bank_w );
45VIDEO_START( kidniki );
46VIDEO_UPDATE( kidniki );
47
48WRITE8_HANDLER( spelunkr_palbank_w );
49VIDEO_START( spelunkr );
50VIDEO_UPDATE( spelunkr );
51
52WRITE8_HANDLER( spelunk2_gfxport_w );
53VIDEO_START( spelunk2 );
54VIDEO_UPDATE( spelunk2 );
55
56VIDEO_START( youjyudn );
57VIDEO_UPDATE( youjyudn );
58
59VIDEO_START( horizon );
60VIDEO_UPDATE( horizon );
61WRITE8_HANDLER( horizon_scrollram_w );
62extern UINT8 *horizon_scrollram;
src/mame/includes/jedi.h
r1649r1650
66
77/*----------- defined in video/jedi.c -----------*/
88
9extern UINT8 *jedi_foregroundram;
910extern UINT8 *jedi_backgroundram;
10extern size_t jedi_backgroundram_size;
11extern UINT8 *jedi_spriteram;
12extern UINT8 *jedi_paletteram;
13extern UINT8 *jedi_foreground_bank;
1114
1215VIDEO_START( jedi );
1316VIDEO_UPDATE( jedi );
src/mame/includes/kangaroo.h
r1649r1650
99/*----------- defined in video/kangaroo.c -----------*/
1010
1111extern UINT8 *kangaroo_video_control;
12extern UINT8 *kangaroo_bank_select;
13extern UINT8 *kangaroo_blitter;
14extern UINT8 *kangaroo_scroll;
1512
1613PALETTE_INIT( kangaroo );
1714VIDEO_START( kangaroo );
r1649r1650
2017WRITE8_HANDLER( kangaroo_blitter_w );
2118WRITE8_HANDLER( kangaroo_videoram_w );
2219WRITE8_HANDLER( kangaroo_video_control_w );
23WRITE8_HANDLER( kangaroo_bank_select_w );
24WRITE8_HANDLER( kangaroo_color_mask_w );
src/mame/includes/m58.h
r0r1650
1/*************************************************************************
2
3    Irem M58 hardware
4
5*************************************************************************/
6
7/*----------- defined in video/m58.c -----------*/
8
9extern UINT8 *yard_scroll_x_low;
10extern UINT8 *yard_scroll_x_high;
11extern UINT8 *yard_scroll_y_low;
12extern UINT8 *yard_score_panel_disabled;
13
14WRITE8_HANDLER( yard_videoram_w );
15WRITE8_HANDLER( yard_scroll_panel_w );
16
17PALETTE_INIT( yard );
18VIDEO_START( yard );
19VIDEO_UPDATE( yard );
src/mame/includes/timeplt.h
r0r1650
1/***************************************************************************
2
3    Time Pilot
4
5***************************************************************************/
6
7/*----------- defined in video/timeplt.c -----------*/
8
9READ8_HANDLER( timeplt_scanline_r );
10WRITE8_HANDLER( timeplt_videoram_w );
11WRITE8_HANDLER( timeplt_colorram_w );
12WRITE8_HANDLER( timeplt_flipscreen_w );
13VIDEO_START( timeplt );
14PALETTE_INIT( timeplt );
15VIDEO_UPDATE( timeplt );
16
17
src/mame/includes/exidy440.h
r1649r1650
77#include "sound/custom.h"
88
99
10#define EXIDY440_MASTER_CLOCK      (12979200)
10#define EXIDY440_MASTER_CLOCK      (XTAL_12_9792MHz)
1111#define EXIDY440_MAIN_CPU_CLOCK      (EXIDY440_MASTER_CLOCK / 8)
1212#define EXIDY440_PIXEL_CLOCK      (EXIDY440_MASTER_CLOCK / 2)
1313#define EXIDY440_HTOTAL            (0x1a0)
r1649r1650
3131void exidy440_bank_select(UINT8 bank);
3232
3333
34
3534/*----------- defined in audio/exidy440.c -----------*/
3635
3736extern UINT8 exidy440_sound_command;
3837extern UINT8 exidy440_sound_command_ack;
39extern UINT8 *exidy440_m6844_data;
40extern UINT8 *exidy440_sound_banks;
41extern UINT8 *exidy440_sound_volume;
4238
43void *exidy440_sh_start(int clock, const struct CustomSound_interface *config);
44void exidy440_sh_stop(void *token);
39MACHINE_DRIVER_EXTERN( exidy440_audio );
4540
46READ8_HANDLER( exidy440_m6844_r );
47WRITE8_HANDLER( exidy440_m6844_w );
48READ8_HANDLER( exidy440_sound_command_r );
49WRITE8_HANDLER( exidy440_sound_volume_w );
50WRITE8_HANDLER( exidy440_sound_interrupt_clear_w );
5141
52
5342/*----------- defined in video/exidy440.c -----------*/
5443
5544extern UINT8 *exidy440_imageram;
src/mame/includes/starfire.h
r1649r1650
1010#define STARFIRE_VBSTART      (0x100)
1111
1212
13/*----------- defined in drivers/starfire.c -----------*/
13/*----------- defined in video/starfire.c -----------*/
1414
1515extern UINT8 *starfire_videoram;
1616extern UINT8 *starfire_colorram;
1717
18
19/*----------- defined in video/starfire.c -----------*/
20
2118VIDEO_UPDATE( starfire );
2219VIDEO_START( starfire );
23void starfire_video_update(int scanline, int count);
2420
2521WRITE8_HANDLER( starfire_videoram_w );
2622READ8_HANDLER( starfire_videoram_r );
2723WRITE8_HANDLER( starfire_colorram_w );
28READ8_HANDLER( starfire_colorram_r );
2924WRITE8_HANDLER( starfire_vidctrl_w );
3025WRITE8_HANDLER( starfire_vidctrl1_w );
3126
src/mame/includes/cclimber.h
r1649r1650
1414extern UINT8 *cclimber_bigspriteram;
1515extern UINT8 *cclimber_column_scroll;
1616
17extern UINT8 *swimmer_bgcolor;
18extern UINT8 *swimmer_sidepanel_enabled;
19extern UINT8 *swimmer_palettebank;
20
1721extern UINT8 *toprollr_videoram2;
1822extern UINT8 *toprollr_videoram3;
1923extern UINT8 *toprollr_videoram4;
2024
2125WRITE8_HANDLER( cclimber_colorram_w );
22WRITE8_HANDLER( cclimber_bigsprite_videoram_w );
2326PALETTE_INIT( cclimber );
2427VIDEO_UPDATE( cclimber );
2528
r1649r1650
2932VIDEO_START( toprollr );
3033VIDEO_UPDATE( toprollr );
3134
32WRITE8_HANDLER( swimmer_bgcolor_w );
33WRITE8_HANDLER( swimmer_palettebank_w );
3435PALETTE_INIT( swimmer );
3536VIDEO_UPDATE( swimmer );
36WRITE8_HANDLER( swimmer_sidepanel_enable_w );
3737
3838
3939/*----------- defined in audio/cclimber.c -----------*/
src/mame/includes/centiped.h
r1649r1650
88
99extern UINT8 centiped_flipscreen, *bullsdrt_tiles_bankram;
1010
11PALETTE_INIT( centiped );
12PALETTE_INIT( milliped );
1311PALETTE_INIT( warlords );
1412
1513VIDEO_START( centiped );
src/mame/includes/crgolf.h
r1649r1650
1212extern UINT8 *crgolf_screenb_enable;
1313extern UINT8 *crgolf_screena_enable;
1414
15WRITE8_HANDLER( crgolf_videoram_bit0_w );
16WRITE8_HANDLER( crgolf_videoram_bit1_w );
17WRITE8_HANDLER( crgolf_videoram_bit2_w );
15WRITE8_HANDLER( crgolf_videoram_w );
16READ8_HANDLER( crgolf_videoram_r );
1817
19READ8_HANDLER( crgolf_videoram_bit0_r );
20READ8_HANDLER( crgolf_videoram_bit1_r );
21READ8_HANDLER( crgolf_videoram_bit2_r );
22
23PALETTE_INIT( crgolf );
24VIDEO_START( crgolf );
25VIDEO_UPDATE( crgolf );
18MACHINE_DRIVER_EXTERN( crgolf_video );
src/mame/includes/williams.h
r1649r1650
100100
101101
102102WRITE8_HANDLER( williams_blitter_w );
103WRITE8_HANDLER( williams_paletteram_w );
104103WRITE8_HANDLER( blaster_remap_select_w );
105WRITE8_HANDLER( blaster_palette_0_w );
106104WRITE8_HANDLER( blaster_video_control_w );
107WRITE8_HANDLER( blaster_scanline_control_w );
108105READ8_HANDLER( williams_video_counter_r );
109106READ8_HANDLER( williams2_video_counter_r );
110107
r1649r1650
118115
119116
120117WRITE8_HANDLER( williams2_tileram_w );
121READ8_HANDLER( williams2_paletteram_r );
122118WRITE8_HANDLER( williams2_paletteram_w );
123119WRITE8_HANDLER( williams2_fg_select_w );
124120WRITE8_HANDLER( williams2_bg_select_w );
src/mame/includes/20pacgal.h
r0r1650
1/***************************************************************************
2
3    Ms.Pac-Man/Galaga - 20 Year Reunion hardware
4
5    driver by Nicola Salmoria
6
7***************************************************************************/
8
9
10typedef struct __20pacgal_state _20pacgal_state;
11struct __20pacgal_state
12{
13   /* memory pointers */
14   UINT8 *char_gfx_ram;
15   UINT8 *sprite_gfx_ram;
16   UINT8 *video_ram;
17   UINT8 *sprite_ram;
18   UINT8 *sprite_color_lookup;
19   UINT8 *flip_screen;
20
21   /* machine state */
22   UINT8 game_selected;   /* 0 = Ms. Pac-Man, 1 = Galaga */
23};
24
25
26
27/*----------- defined in video/20pacgal.c -----------*/
28
29MACHINE_DRIVER_EXTERN( 20pacgal_video );
src/mame/includes/system16.h
r1649r1650
164164   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
165165   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
166166
167#define SYS16_COINAGE PORT_START_TAG("DSW0") \
168   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) \
167#define SYS16_COINAGE PORT_START_TAG("DSW1") \
168   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") \
169169   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) ) \
170170   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) ) \
171171   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) ) \
r1649r1650
182182   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) ) \
183183   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) \
184184   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" ) \
185   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) \
185   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") \
186186   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) ) \
187187   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) ) \
188188   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) ) \
src/mame/includes/pooyan.h
r0r1650
1/***************************************************************************
2
3    Pooyan
4
5***************************************************************************/
6
7/*----------- defined in video/pooyan.c -----------*/
8
9WRITE8_HANDLER( pooyan_videoram_w );
10WRITE8_HANDLER( pooyan_colorram_w );
11WRITE8_HANDLER( pooyan_flipscreen_w );
12
13PALETTE_INIT( pooyan );
14VIDEO_START( pooyan );
15VIDEO_UPDATE( pooyan );
src/mame/mame.mak
r1649r1650
755755   $(MACHINE)/pgmy2ks.o \
756756
757757$(MAMEOBJ)/irem.a: \
758   $(DRIVERS)/m52.o $(VIDEO)/m52.o \
759   $(DRIVERS)/m57.o $(VIDEO)/m57.o \
760   $(DRIVERS)/m58.o $(VIDEO)/m58.o \
758761   $(DRIVERS)/m62.o $(VIDEO)/m62.o \
759762   $(DRIVERS)/m72.o $(AUDIO)/m72.o $(VIDEO)/m72.o \
760763   $(DRIVERS)/m90.o $(VIDEO)/m90.o \
761764   $(DRIVERS)/m92.o $(VIDEO)/m92.o \
762765   $(DRIVERS)/m107.o $(VIDEO)/m107.o \
763   $(DRIVERS)/mpatrol.o $(VIDEO)/mpatrol.o \
764766   $(DRIVERS)/olibochu.o \
765767   $(DRIVERS)/redalert.o $(AUDIO)/redalert.o $(VIDEO)/redalert.o \
766768   $(DRIVERS)/shisen.o $(VIDEO)/shisen.o \
767769   $(DRIVERS)/skychut.o $(VIDEO)/skychut.o \
768770   $(DRIVERS)/travrusa.o $(VIDEO)/travrusa.o \
769   $(DRIVERS)/troangel.o $(VIDEO)/troangel.o \
770771   $(DRIVERS)/vigilant.o $(VIDEO)/vigilant.o \
771772   $(DRIVERS)/wilytowr.o \
772   $(DRIVERS)/yard.o $(VIDEO)/yard.o \
773773   $(MACHINE)/irem_cpu.o \
774774   $(AUDIO)/fghtbskt.o \
775775   $(AUDIO)/irem.o \
r1649r1650
12891289   $(DRIVERS)/ashnojoe.o $(VIDEO)/ashnojoe.o \
12901290   $(DRIVERS)/asuka.o $(MACHINE)/bonzeadv.o $(VIDEO)/asuka.o \
12911291   $(DRIVERS)/bigevglf.o $(MACHINE)/bigevglf.o $(VIDEO)/bigevglf.o \
1292   $(DRIVERS)/bking2.o $(VIDEO)/bking2.o \
1292   $(DRIVERS)/bking.o $(VIDEO)/bking.o \
12931293   $(DRIVERS)/bublbobl.o $(MACHINE)/bublbobl.o $(VIDEO)/bublbobl.o \
12941294   $(DRIVERS)/buggychl.o $(MACHINE)/buggychl.o $(VIDEO)/buggychl.o \
12951295   $(DRIVERS)/chaknpop.o $(MACHINE)/chaknpop.o $(VIDEO)/chaknpop.o \
r1649r1650
13571357   $(VIDEO)/taitoic.o \
13581358
13591359$(MAMEOBJ)/tatsumi.a: \
1360   $(DRIVERS)/lockon.o \
1360   $(DRIVERS)/tx1.o $(MACHINE)/tx1.o $(AUDIO)/tx1.o $(VIDEO)/tx1.o \
1361   $(DRIVERS)/lockon.o $(VIDEO)/lockon.o \
13611362   $(DRIVERS)/tatsumi.o $(MACHINE)/tatsumi.o $(VIDEO)/tatsumi.o \
1362   $(DRIVERS)/tx1.o $(MACHINE)/tx1.o $(AUDIO)/tx1.o $(VIDEO)/tx1.o \
13631363
13641364$(MAMEOBJ)/tch.a: \
13651365   $(DRIVERS)/kickgoal.o $(VIDEO)/kickgoal.o \
r1649r1650
15031503   $(DRIVERS)/acefruit.o \
15041504   $(DRIVERS)/adp.o \
15051505   $(DRIVERS)/ambush.o $(VIDEO)/ambush.o \
1506   $(DRIVERS)/ampoker.o $(VIDEO)/ampoker.o \
1506   $(DRIVERS)/ampoker2.o $(VIDEO)/ampoker2.o \
15071507   $(DRIVERS)/amspdwy.o $(VIDEO)/amspdwy.o \
15081508   $(DRIVERS)/artmagic.o $(VIDEO)/artmagic.o \
15091509   $(DRIVERS)/attckufo.o $(AUDIO)/attckufo.o $(VIDEO)/attckufo.o \
r1649r1650
15401540   $(DRIVERS)/fortecar.o \
15411541   $(DRIVERS)/freekick.o $(VIDEO)/freekick.o \
15421542   $(DRIVERS)/funworld.o $(VIDEO)/funworld.o \
1543   $(DRIVERS)/galgames.o \
15431544   $(DRIVERS)/gamecstl.o \
15441545   $(DRIVERS)/gdrawpkr.o $(VIDEO)/gdrawpkr.o \
15451546   $(DRIVERS)/gtipoker.o \
r1649r1650
16411642
16421643$(DRIVERS)/acefruit.o:   $(LAYOUT)/sidewndr.lh
16431644
1644$(DRIVERS)/ampoker.o:   $(LAYOUT)/ampoker.lh \
1645$(DRIVERS)/ampoker2.o:   $(LAYOUT)/ampoker2.lh \
16451646                  $(LAYOUT)/sigmapkr.lh \
16461647
16471648$(DRIVERS)/astrocde.o:   $(LAYOUT)/tenpindx.lh
src/mame/video/galspnbl.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34
45UINT16 *galspnbl_bgvideoram,*galspnbl_videoram,*galspnbl_colorram;
r1649r1650
113114
114115
115116   /* copy the temporary bitmap to the screen */
116   copyscrollbitmap(bitmap,tmpbitmap,1,&screenscroll,0,0,cliprect,TRANSPARENCY_NONE,0);
117   copyscrollbitmap(bitmap,tmpbitmap,1,&screenscroll,0,0,cliprect);
117118
118119   draw_sprites(machine,bitmap,cliprect,0);
119120
src/mame/video/blktiger.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34UINT8 *blktiger_txvideoram;
45
src/mame/video/dynduke.c
r1649r1650
11
22#include "driver.h"
3#include "deprecat.h"
34
45static tilemap *bg_layer,*fg_layer,*tx_layer;
56UINT16 *dynduke_back_data,*dynduke_fore_data,*dynduke_scroll_ram;
src/mame/video/deco_mlc.c
r1649r1650
99*/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213
1314extern int mlc_raster_table[9][256];
1415extern UINT32 mlc_clipper[32];
src/mame/video/tryout.c
r1649r1650
66****************************************************************/
77
88#include "driver.h"
9#include "deprecat.h"
910
1011static tilemap *fg_tilemap, *bg_tilemap;
1112static UINT8 vram_bank;
src/mame/video/madmotor.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT16 *madmotor_pf1_rowscroll;
1213UINT16 *madmotor_pf1_data,*madmotor_pf2_data,*madmotor_pf3_data;
src/mame/video/mainsnk.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34static UINT8 bg_color,  old_bg_color;
45#define mainsnk_offset 8
src/mame/video/midyunit.c
r1649r1650
55**************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "profiler.h"
910#include "cpu/tms34010/tms34010.h"
1011#include "cpu/tms34010/34010ops.h"
src/mame/video/ygv608.c
r1649r1650
2929 *    Everything else! :)
3030 */
3131
32#include <ctype.h>
3332#include "driver.h"
33#include "deprecat.h"
3434#include "namcond1.h"   // only while debugging
3535#include "video/ygv608.h"
3636
r1649r1650
895895                   TRANSPARENCY_NONE, 0, 0 );
896896  else
897897#endif
898    copybitmap( bitmap, work_bitmap, 0, 0, 0, 0,
899                cliprect,
900                TRANSPARENCY_NONE, 0 );
898    copybitmap( bitmap, work_bitmap, 0, 0, 0, 0, cliprect);
901899
902900  // for some reason we can't use an opaque tilemap_A
903901  // so use a transparent but clear the work bitmap first
r1649r1650
922920                   TRANSPARENCY_PEN, machine->pens[0], 0 );
923921  else
924922#endif
925    copybitmap( bitmap, work_bitmap, 0, 0, 0, 0,
926                cliprect,
927                TRANSPARENCY_PEN, machine->pens[0] );
923    copybitmap_trans( bitmap, work_bitmap, 0, 0, 0, 0, cliprect, machine->pens[0] );
928924
929925   if ((ygv608.regs.s.r11 & r11_prm) == PRM_SABDEX ||
930926      (ygv608.regs.s.r11 & r11_prm) == PRM_SEABDX)
r1649r1650
13801376    if( i%16 == 0 )
13811377      logerror( "%04X: ", offset );
13821378    logerror( "%02X ", data );
1383    ascii[i%16] = ( isprint( data ) ? data : '.' );
1379    ascii[i%16] = ( data > 0x20) ? data : '.' );
13841380    if( i%16 == 15 )
13851381      logerror( "| %-16.16s\n", ascii );
13861382  }
r1649r1650
16441640    if( i % 16 == 0 )
16451641      logerror( "$%04X : ", i );
16461642    logerror( "%02X ", ygv608.pattern_name_table[i] );
1647    if( isprint( ygv608.pattern_name_table[i] ) )
1643    if( ygv608.pattern_name_table[i] >= 0x20)
16481644      ascii[i%16] = ygv608.pattern_name_table[i];
16491645    else
16501646      ascii[i%16] = '.';
r1649r1650
16631659    if( i % 16 == 0 )
16641660      logerror( "$%04X : ", i );
16651661    logerror( "%02X ", ygv608.scroll_data_table[0][i] );
1666    if( isprint( ygv608.scroll_data_table[0][i] ) )
1662    if( ygv608.scroll_data_table[0][i] >= 0x20 )
16671663      ascii[i%16] = ygv608.scroll_data_table[0][i];
16681664    else
16691665      ascii[i%16] = '.';
src/mame/video/stvvdp1.c
r1649r1650
1717
1818
1919#include "driver.h"
20#include "deprecat.h"
2021
2122static int vdp1_sprite_log = 0;
2223
src/mame/video/nbmj9195.c
r1649r1650
88******************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213
1314#define   VRAM_MAX   2
r1649r1650
500501   }
501502
502503   if (nbmj9195_dispflag[0])
503   {
504504      // nbmj9195 1layer
505      copyscrollbitmap(bitmap, nbmj9195_tmpbitmap[0], SCANLINE_MAX, nbmj9195_scrollx_raster[0], 1, &scrolly[0], &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
506   }
505      copyscrollbitmap(bitmap, nbmj9195_tmpbitmap[0], SCANLINE_MAX, nbmj9195_scrollx_raster[0], 1, &scrolly[0], cliprect);
507506   else
508   {
509507      fillbitmap(bitmap, machine->pens[0x0ff], 0);
510   }
511508
512509   if (nbmj9195_dispflag[1])
513510   {
514511      if (gfxdraw_mode == 1)
515      {
516512         // nbmj9195 2layer
517         copyscrollbitmap(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], &machine->screen[0].visarea, TRANSPARENCY_PEN, machine->pens[0x0ff]);
518      }
513         copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, machine->pens[0x0ff]);
514
519515      if (gfxdraw_mode == 2)
520      {
521516         // nbmj9195 nb22090 2layer
522         copyscrollbitmap(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], &machine->screen[0].visarea, TRANSPARENCY_PEN, machine->pens[0x1ff]);
523      }
517         copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, machine->pens[0x1ff]);
524518   }
525519   return 0;
526520}
src/mame/video/simpl156.c
r1649r1650
33*/
44
55#include "driver.h"
6#include "deprecat.h"
67#include "deco16ic.h"
78
89/*
src/mame/video/hcastle.c
r1649r1650
1616
1717PALETTE_INIT( hcastle )
1818{
19   int i,chip,pal,clut;
19   int chip;
2020
21   for (chip = 0;chip < 2;chip++)
21   /* allocate the colortable */
22   machine->colortable = colortable_alloc(machine, 0x80);
23
24   for (chip = 0; chip < 2; chip++)
2225   {
23      for (pal = 0;pal < 8;pal++)
26      int pal;
27
28      for (pal = 0; pal < 8; pal++)
2429      {
25         clut = (pal & 1) + 2 * chip;
26         for (i = 0;i < 256;i++)
30         int i;
31         int clut = (chip << 1) | (pal & 1);
32
33         for (i = 0; i < 0x100; i++)
2734         {
28            if ((pal & 1) == 0)   /* sprites */
29            {
30               if (color_prom[256 * clut + i] == 0)
31                  *(colortable++) = 0;
32               else
33                  *(colortable++) = 16 * pal + color_prom[256 * clut + i];
34            }
35            UINT8 ctabentry;
36
37            if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0))
38               ctabentry = 0;
3539            else
36               *(colortable++) = 16 * pal + color_prom[256 * clut + i];
40               ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
41
42            colortable_entry_set_value(machine->colortable, (chip << 11) | (pal << 8) | i, ctabentry);
3743         }
3844      }
3945   }
4046}
4147
4248
49static void set_pens(running_machine *machine)
50{
51   int i;
4352
53   for (i = 0x00; i < 0x100; i += 2)
54   {
55      UINT16 data = paletteram[i | 1] | (paletteram[i] << 8);
4456
57      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
58
59      colortable_palette_set_color(machine->colortable, i >> 1, color);
60   }
61}
62
63
64
4565/***************************************************************************
4666
4767    Callbacks for the TileMap code
r1649r1650
181201static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, UINT8 *sbank, int bank )
182202{
183203   int bank_base = (bank == 0) ? 0x4000 * (gfx_bank & 1) : 0;
184   K007121_sprites_draw(machine,bank,bitmap,cliprect,sbank,(K007121_ctrlram[bank][6]&0x30)*2,0,bank_base,-1);
204   K007121_sprites_draw(bank,bitmap,machine->gfx,machine->colortable,cliprect,sbank,(K007121_ctrlram[bank][6]&0x30)*2,0,bank_base,-1);
185205}
186206
187207/*****************************************************************************/
r1649r1650
190210{
191211   static int old_pf1,old_pf2;
192212
213   set_pens(machine);
193214
194215   pf1_bankbase = 0x0000;
195216   pf2_bankbase = 0x4000 * ((gfx_bank & 2) >> 1);
src/mame/video/bking.c
r0r1650
1/***************************************************************************
2
3  bking.c
4
5  Functions to emulate the video hardware of the machine.
6
7***************************************************************************/
8
9#include "driver.h"
10#include "video/resnet.h"
11
12
13extern UINT8* bking_playfield_ram;
14
15
16static int pc3259_output[4];
17static int pc3259_mask;
18
19static UINT8 xld1;
20static UINT8 xld2;
21static UINT8 xld3;
22static UINT8 yld1;
23static UINT8 yld2;
24static UINT8 yld3;
25
26static int ball1_pic;
27static int ball2_pic;
28static int crow_pic;
29static int crow_flip;
30static int palette_bank;
31static int controller;
32static int hit;
33
34static mame_bitmap* helper0;
35static mame_bitmap* helper1;
36
37static tilemap* bg_tilemap;
38
39
40/***************************************************************************
41
42  Convert the color PROMs into a more useable format.
43
44  The palette PROM is connected to the RGB output this way:
45
46  bit 7 -- 390 ohm resistor  -- BLUE
47        -- 220 ohm resistor  -- BLUE
48        -- 820 ohm resistor  -- GREEN
49        -- 390 ohm resistor  -- GREEN
50        -- 220 ohm resistor  -- GREEN
51        -- 820 ohm resistor  -- RED
52        -- 390 ohm resistor  -- RED
53  bit 0 -- 220 ohm resistor  -- RED
54
55***************************************************************************/
56
57PALETTE_INIT( bking )
58{
59   static const int resistances_rg[3] = { 220, 390, 820 };
60   static const int resistances_b [2] = { 220, 390 };
61   double rweights[3], gweights[3], bweights[2];
62   int i;
63
64   /* compute the color output resistor weights */
65   compute_resistor_weights(0,   255, -1.0,
66         3, &resistances_rg[0], rweights, 0, 0,
67         3, &resistances_rg[0], gweights, 0, 0,
68         2, &resistances_b[0],  bweights, 0, 0);
69
70   for (i = 0; i < machine->drv->total_colors; i++)
71   {
72      UINT16 pen;
73      int bit0, bit1, bit2, r, g, b;
74
75      /* color PROM A7-A8 is the palette select */
76      if (i < 0x20)
77         /* characters - image bits go to A0-A2 of the color PROM */
78         pen = (((i - 0x00) << 4) & 0x180) | ((i - 0x00) & 0x07);
79      else if (i < 0x30)
80         /* crow - image bits go to A5-A6. */
81         pen = (((i - 0x20) << 5) & 0x180) | (((i - 0x20) & 0x03) << 5);
82      else if (i < 0x38)
83         /* ball #1 - image bit goes to A3 */
84         pen = (((i - 0x30) << 6) & 0x180) | (((i - 0x30) & 0x01) << 3);
85      else
86         /* ball #2 - image bit goes to A4 */
87         pen = (((i - 0x38) << 6) & 0x180) | (((i - 0x38) & 0x01) << 4);
88
89      /* red component */
90      bit0 = (color_prom[pen] >> 0) & 0x01;
91      bit1 = (color_prom[pen] >> 1) & 0x01;
92      bit2 = (color_prom[pen] >> 2) & 0x01;
93      r = combine_3_weights(rweights, bit0, bit1, bit2);
94
95      /* green component */
96      bit0 = (color_prom[pen] >> 3) & 0x01;
97      bit1 = (color_prom[pen] >> 4) & 0x01;
98      bit2 = (color_prom[pen] >> 5) & 0x01;
99      g = combine_3_weights(gweights, bit0, bit1, bit2);
100
101      /* blue component */
102      bit0 = (color_prom[pen] >> 6) & 0x01;
103      bit1 = (color_prom[pen] >> 7) & 0x01;
104      b = combine_2_weights(gweights, bit0, bit1);
105
106      palette_set_color(machine, i, MAKE_RGB(r, g, b));
107   }
108}
109
110
111WRITE8_HANDLER( bking_xld1_w )
112{
113   xld1 = -data;
114}
115
116WRITE8_HANDLER( bking_yld1_w )
117{
118   yld1 = -data;
119}
120
121WRITE8_HANDLER( bking_xld2_w )
122{
123   xld2 = -data;
124}
125
126WRITE8_HANDLER( bking_yld2_w )
127{
128   yld2 = -data;
129}
130
131WRITE8_HANDLER( bking_xld3_w )
132{
133   xld3 = -data;
134}
135
136WRITE8_HANDLER( bking_yld3_w )
137{
138   yld3 = -data;
139}
140
141
142WRITE8_HANDLER( bking_cont1_w )
143{
144   /* D0 = COIN LOCK */
145   /* D1 = BALL 5 (Controller selection) */
146   /* D2 = VINV (flip screen) */
147   /* D3 = Not Connected */
148   /* D4-D7 = CROW0-CROW3 (selects crow picture) */
149
150   coin_lockout_global_w(~data & 0x01);
151
152   flip_screen = data & 0x04;
153
154   tilemap_set_flip(ALL_TILEMAPS, flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
155
156   controller = data & 0x02;
157
158   crow_pic = (data >> 4) & 0x0f;
159}
160
161WRITE8_HANDLER( bking_cont2_w )
162{
163   /* D0-D2 = BALL10 - BALL12 (Selects player 1 ball picture) */
164   /* D3-D5 = BALL20 - BALL22 (Selects player 2 ball picture) */
165   /* D6 = HIT1 */
166   /* D7 = HIT2 */
167
168   ball1_pic = (data >> 0) & 0x07;
169   ball2_pic = (data >> 3) & 0x07;
170
171   hit = data >> 6;
172}
173
174WRITE8_HANDLER( bking_cont3_w )
175{
176   /* D0 = CROW INV (inverts Crow picture and coordinates) */
177   /* D1-D2 = COLOR 0 - COLOR 1 (switches 4 color palettes, global across all graphics) */
178   /* D3 = SOUND STOP */
179
180   crow_flip = ~data & 0x01;
181
182   if (palette_bank != ((data >> 1) & 0x03))
183   {
184      tilemap_mark_all_tiles_dirty(bg_tilemap);
185   }
186
187   palette_bank = (data >> 1) & 0x03;
188
189   sound_global_enable(~data & 0x08);
190}
191
192
193WRITE8_HANDLER( bking_msk_w )
194{
195   pc3259_mask++;
196}
197
198
199WRITE8_HANDLER( bking_hitclr_w )
200{
201   pc3259_mask = 0;
202
203   pc3259_output[0] = 0;
204   pc3259_output[1] = 0;
205   pc3259_output[2] = 0;
206   pc3259_output[3] = 0;
207}
208
209
210WRITE8_HANDLER( bking_playfield_w )
211{
212   bking_playfield_ram[offset] = data;
213   tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
214}
215
216
217READ8_HANDLER( bking_input_port_5_r )
218{
219   return readinputport(controller ? 7 : 5);
220}
221
222READ8_HANDLER( bking_input_port_6_r )
223{
224   return readinputport(controller ? 8 : 6);
225}
226
227READ8_HANDLER( bking_pos_r )
228{
229   return pc3259_output[offset / 8] << 4;
230}
231
232
233static TILE_GET_INFO( get_tile_info )
234{
235   UINT8 code0 = bking_playfield_ram[2 * tile_index + 0];
236   UINT8 code1 = bking_playfield_ram[2 * tile_index + 1];
237
238   int flags = 0;
239
240   if (code1 & 4) flags |= TILE_FLIPX;
241   if (code1 & 8) flags |= TILE_FLIPY;
242
243   SET_TILE_INFO(0, code0 + 256 * code1, palette_bank, flags);
244}
245
246
247VIDEO_START( bking )
248{
249   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 0, 8, 8, 32, 32);
250   helper0 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
251   helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
252}
253
254
255VIDEO_UPDATE( bking )
256{
257   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
258
259   /* draw the balls */
260
261   drawgfx(bitmap, machine->gfx[2],
262      ball1_pic,
263      palette_bank,
264      0, 0,
265      xld1, yld1,
266      cliprect, TRANSPARENCY_PEN, 0);
267
268   drawgfx(bitmap, machine->gfx[3],
269      ball2_pic,
270      palette_bank,
271      0, 0,
272      xld2, yld2,
273      cliprect, TRANSPARENCY_PEN, 0);
274
275   /* draw the crow */
276
277   drawgfx(bitmap, machine->gfx[1],
278      crow_pic,
279      palette_bank,
280      crow_flip, crow_flip,
281      crow_flip ? xld3 - 16 : 256 - xld3, crow_flip ? yld3 - 16 : 256 - yld3,
282      cliprect, TRANSPARENCY_PEN, 0);
283   return 0;
284}
285
286
287VIDEO_EOF( bking )
288{
289   static const rectangle rect = { 0, 7, 0, 15 };
290
291   int xld = 0;
292   int yld = 0;
293
294   UINT32 latch = 0;
295
296   if (pc3259_mask == 6)   /* player 1 */
297   {
298      xld = xld1;
299      yld = yld1;
300
301      drawgfx(helper1, machine->gfx[2],
302         ball1_pic,
303         0,
304         0, 0,
305         0, 0,
306         &rect, TRANSPARENCY_NONE, 0);
307
308      latch = 0x0C00;
309   }
310
311   if (pc3259_mask == 3)   /* player 2 */
312   {
313      xld = xld2;
314      yld = yld2;
315
316      drawgfx(helper1, machine->gfx[3],
317         ball2_pic,
318         0,
319         0, 0,
320         0, 0,
321         &rect, TRANSPARENCY_NONE, 0);
322
323      latch = 0x0400;
324   }
325
326   tilemap_set_scrollx(bg_tilemap, 0, flip_screen ? -xld : xld);
327   tilemap_set_scrolly(bg_tilemap, 0, flip_screen ? -yld : yld);
328
329   tilemap_draw(helper0, &rect, bg_tilemap, 0, 0);
330
331   tilemap_set_scrollx(bg_tilemap, 0, 0);
332   tilemap_set_scrolly(bg_tilemap, 0, 0);
333
334   if (latch != 0)
335   {
336      const UINT8* MASK = memory_region(REGION_USER1) + 8 * hit;
337
338      int x;
339      int y;
340
341      for (y = rect.min_y; y <= rect.max_y; y++)
342      {
343         const UINT16* p0 = BITMAP_ADDR16(helper0, y, 0);
344         const UINT16* p1 = BITMAP_ADDR16(helper1, y, 0);
345
346         for (x = rect.min_x; x <= rect.max_x; x++)
347         {
348            if (MASK[p0[x] & 7] && p1[x])
349            {
350               int col = (xld + x) / 8 + 1;
351               int row = (yld + y) / 8 + 0;
352
353               latch |= (flip_screen ? 31 - col : col) << 0;
354               latch |= (flip_screen ? 31 - row : row) << 5;
355
356               pc3259_output[0] = (latch >> 0x0) & 0xf;
357               pc3259_output[1] = (latch >> 0x4) & 0xf;
358               pc3259_output[2] = (latch >> 0x8) & 0xf;
359               pc3259_output[3] = (latch >> 0xc) & 0xf;
360
361               return;
362            }
363         }
364      }
365   }
366}
src/mame/video/arabian.c
r1649r1650
2121
2222
2323/* Globals */
24UINT8 *arabian_blitter;
2425UINT8 arabian_video_control;
2526UINT8 arabian_flip_screen;
2627
r1649r1650
3637{
3738   int i;
3839
39   /* there are effectively 6 bits of color: 2 red, 2 green, 2 blue */
40   for (i = 0; i < 64; i++)
41   {
42      palette_set_color_rgb(machine, i,
43         ((i >> 5) & 1) * (153*192/255) + ((i >> 4) & 1) * (102*192/255) + ((i & 0x30) ? 63 : 0),
44         ((i >> 3) & 1) * (156*192/255) + ((i >> 2) & 1) * (99*192/255) + ((i & 0x0c) ? 63 : 0),
45         ((i >> 1) & 1) * 192 + ((i >> 0) & 1) * 63);
46   }
47
4840   /* there are 13 color table bits */
4941   for (i = 0; i < (1 << 13); i++)
5042   {
43      int r, g, b;
44
5145      int ena = (i >> 12) & 1;
5246      int enb = (i >> 11) & 1;
5347      int abhf = (~i >> 10) & 1;
r1649r1650
146140      int bhi = ab;
147141      int bbase = (!abhf & az) ? 0 : ab;
148142
149      *colortable++ = (rhi << 5) | (rlo << 4) |
150                  (ghi << 3) | (glo << 2) |
151                  (bhi << 1) | bbase;
143      /* convert an RGB color -
144           there are effectively 6 bits of color: 2 red, 2 green, 2 blue */
145      r = ( rhi * (int)(((153.0 * 192) / 255) + 0.5)) +
146         ( rlo * (int)(((102.0 * 192) / 255) + 0.5)) +
147         ((rhi | rlo) ? 63 : 0);
148
149      g = ( ghi * (int)(((156.0 * 192) / 255) + 0.5)) +
150         ( glo * (int)((( 99.0 * 192) / 255) + 0.5)) +
151         ((ghi | glo) ? 63 : 0);
152
153      b = (bhi * 192) + (bbase * 63);
154
155      palette_set_color(machine, i, MAKE_RGB(r, g, b));
152156   }
153157}
154158
r1649r1650
272276WRITE8_HANDLER( arabian_blitter_w )
273277{
274278   /* write the data */
275   offset &= 7;
276   spriteram[offset] = data;
279   arabian_blitter[offset] = data;
277280
278281   /* watch for a write to offset 6 -- that triggers the blit */
279   if ((offset & 0x07) == 6)
282   if (offset == 6)
280283   {
281284      /* extract the data */
282      int plane = spriteram[offset - 6];
283      int src   = spriteram[offset - 5] | (spriteram[offset - 4] << 8);
284      int x     = spriteram[offset - 2] << 2;
285      int y     = spriteram[offset - 3];
286      int sx    = spriteram[offset - 0];
287      int sy    = spriteram[offset - 1];
285      int plane = arabian_blitter[0];
286      int src   = arabian_blitter[1] | (arabian_blitter[2] << 8);
287      int x     = arabian_blitter[4] << 2;
288      int y     = arabian_blitter[3];
289      int sx    = arabian_blitter[6];
290      int sy    = arabian_blitter[5];
288291
289292      /* blit it */
290293      blit_area(plane, src, x, y, sx, sy);
r1649r1650
304307   UINT8 *base;
305308   UINT8 x, y;
306309
307   /* determine X/Y and mark the area dirty */
310   /* determine X/Y */
308311   x = (offset >> 8) << 2;
309312   y = offset & 0xff;
310313
r1649r1650
324327    */
325328
326329   /* enable writes to AZ/AR */
327   if (spriteram[0] & 0x08)
330   if (arabian_blitter[0] & 0x08)
328331   {
329332      base[0] = (base[0] & ~0x03) | ((data & 0x10) >> 3) | ((data & 0x01) >> 0);
330333      base[1] = (base[1] & ~0x03) | ((data & 0x20) >> 4) | ((data & 0x02) >> 1);
r1649r1650
333336   }
334337
335338   /* enable writes to AG/AB */
336   if (spriteram[0] & 0x04)
339   if (arabian_blitter[0] & 0x04)
337340   {
338341      base[0] = (base[0] & ~0x0c) | ((data & 0x10) >> 1) | ((data & 0x01) << 2);
339342      base[1] = (base[1] & ~0x0c) | ((data & 0x20) >> 2) | ((data & 0x02) << 1);
r1649r1650
342345   }
343346
344347   /* enable writes to BZ/BR */
345   if (spriteram[0] & 0x02)
348   if (arabian_blitter[0] & 0x02)
346349   {
347350      base[0] = (base[0] & ~0x30) | ((data & 0x10) << 1) | ((data & 0x01) << 4);
348351      base[1] = (base[1] & ~0x30) | ((data & 0x20) << 0) | ((data & 0x02) << 3);
r1649r1650
351354   }
352355
353356   /* enable writes to BG/BB */
354   if (spriteram[0] & 0x01)
357   if (arabian_blitter[0] & 0x01)
355358   {
356359      base[0] = (base[0] & ~0xc0) | ((data & 0x10) << 3) | ((data & 0x01) << 6);
357360      base[1] = (base[1] & ~0xc0) | ((data & 0x20) << 2) | ((data & 0x02) << 5);
r1649r1650
370373
371374VIDEO_UPDATE( arabian )
372375{
373   const pen_t *colortable = &machine->remapped_colortable[(arabian_video_control >> 3) << 8];
376   const pen_t *pens = &machine->pens[(arabian_video_control >> 3) << 8];
374377   int y;
375378
376379   /* render the screen from the bitmap */
r1649r1650
378381   {
379382      /* non-flipped case */
380383      if (!arabian_flip_screen)
381         draw_scanline8(bitmap, 0, y, BITMAP_WIDTH, &main_bitmap[y * BITMAP_WIDTH], colortable, -1);
384         draw_scanline8(bitmap, 0, y, BITMAP_WIDTH, &main_bitmap[y * BITMAP_WIDTH], pens, -1);
382385
383386      /* flipped case */
384387      else
r1649r1650
387390         int x;
388391         for (x = 0; x < BITMAP_WIDTH; x++)
389392            scanline[BITMAP_WIDTH - 1 - x] = main_bitmap[y * BITMAP_WIDTH + x];
390         draw_scanline8(bitmap, 0, BITMAP_HEIGHT - 1 - y, BITMAP_WIDTH, scanline, colortable, -1);
393         draw_scanline8(bitmap, 0, BITMAP_HEIGHT - 1 - y, BITMAP_WIDTH, scanline, pens, -1);
391394      }
392395   }
393396   return 0;
src/mame/video/galpani2.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "kaneko16.h"
1213
1314/*
r1649r1650
170171   {
171172      int x = 0;
172173      int y = 0;
173      copyscrollbitmap(   bitmap, galpani2_bg15_bitmap,
174                     1, &x, 1, &y,
175                     cliprect,TRANSPARENCY_PEN,machine->pens[0x4200 + 0]);
174      copyscrollbitmap_trans(bitmap, galpani2_bg15_bitmap,
175                        1, &x, 1, &y,
176                        cliprect,machine->pens[0x4200 + 0]);
176177   }
177178
178179/*  test mode:
r1649r1650
185186   {
186187      int x = - ( *galpani2_bg8_0_scrollx + 0x200 - 0x0f5 );
187188      int y = - ( *galpani2_bg8_0_scrolly + 0x200 - 0x1be );
188      copyscrollbitmap(   bitmap, galpani2_bg8_bitmap_0,
189                     1, &x, 1, &y,
190                     cliprect,TRANSPARENCY_PEN,machine->pens[0x4000 + 0]);
189      copyscrollbitmap_trans(bitmap, galpani2_bg8_bitmap_0,
190                        1, &x, 1, &y,
191                        cliprect,machine->pens[0x4000 + 0]);
191192   }
192193
193194   if (layers_ctrl & 0x4)
194195   {
195196      int x = - ( *galpani2_bg8_1_scrollx + 0x200 - 0x0f5 );
196197      int y = - ( *galpani2_bg8_1_scrolly + 0x200 - 0x1be );
197      copyscrollbitmap(   bitmap, galpani2_bg8_bitmap_1,
198                     1, &x, 1, &y,
199                     cliprect,TRANSPARENCY_PEN,machine->pens[0x4000 + 0]);
198      copyscrollbitmap_trans(bitmap, galpani2_bg8_bitmap_1,
199                        1, &x, 1, &y,
200                        cliprect,machine->pens[0x4000 + 0]);
200201   }
201202
202203   if (layers_ctrl & 0x8)   kaneko16_draw_sprites(machine, bitmap, cliprect);
src/mame/video/labyrunr.c
r1649r1650
88
99PALETTE_INIT( labyrunr )
1010{
11   int i,pal;
11   int pal;
1212
13   for (pal = 0;pal < 8;pal++)
13   /* allocate the colortable */
14   machine->colortable = colortable_alloc(machine, 0x80);
15
16   for (pal = 0; pal < 8; pal++)
1417   {
15      if (pal & 1)   /* chars, no lookup table */
18      /* chars, no lookup table */
19      if (pal & 1)
1620      {
17         for (i = 0;i < 256;i++)
18            *(colortable++) = 16 * pal + (i & 0x0f);
21         int i;
22
23         for (i = 0; i < 0x100; i++)
24            colortable_entry_set_value(machine->colortable, (pal << 8) | i, (pal << 4) | (i & 0x0f));
1925      }
20      else   /* sprites */
26      /* sprites */
27      else
2128      {
22         for (i = 0;i < 256;i++)
29         int i;
30
31         for (i = 0; i < 0x100; i++)
32         {
33            UINT8 ctabentry;
34
2335            if (color_prom[i] == 0)
24               *(colortable++) = 0;
36               ctabentry = 0;
2537            else
26               *(colortable++) = 16 * pal + color_prom[i];
38               ctabentry = (pal << 4) | (color_prom[i] & 0x0f);
39
40            colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
41         }
2742      }
2843   }
2944}
3045
3146
47static void set_pens(running_machine *machine)
48{
49   int i;
50
51   for (i = 0x00; i < 0x100; i += 2)
52   {
53      UINT16 data = paletteram[i | 1] | (paletteram[i] << 8);
54
55      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
56
57      colortable_palette_set_color(machine->colortable, i >> 1, color);
58   }
59}
60
61
62
3263/***************************************************************************
3364
3465  Callbacks for the TileMap code
r1649r1650
142173{
143174   rectangle finalclip0, finalclip1;
144175
176   set_pens(machine);
177
145178   fillbitmap(priority_bitmap,0,cliprect);
146179   fillbitmap(bitmap,get_black_pen(machine),cliprect);
147180
r1649r1650
168201      }
169202
170203      tilemap_draw(bitmap,&finalclip0,layer0,TILEMAP_DRAW_OPAQUE,0);
171      K007121_sprites_draw(machine,0,bitmap,cliprect,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
204      K007121_sprites_draw(0,bitmap,machine->gfx,machine->colortable,cliprect,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
172205      /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */
173206      tilemap_draw(bitmap,&finalclip1,layer1,TILEMAP_DRAW_OPAQUE,0);
174207   }
r1649r1650
236269      tilemap_draw(bitmap,&finalclip1,layer1,0,1);
237270      if(use_clip3[1]) tilemap_draw(bitmap,&finalclip3,layer1,0,1);
238271
239      K007121_sprites_draw(machine,0,bitmap,cliprect,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
272      K007121_sprites_draw(0,bitmap,machine->gfx,machine->colortable,cliprect,spriteram,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
240273   }
241274   return 0;
242275}
src/mame/video/thief.c
r1649r1650
33*/
44
55#include "driver.h"
6#include "deprecat.h"
67
78static UINT8 thief_read_mask, thief_write_mask;
89static UINT8 thief_video_control;
src/mame/video/ccastles.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "ccastles.h"
910#include "video/resnet.h"
1011
src/mame/video/policetr.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/mips/r3000.h"
910#include "policetr.h"
1011
src/mame/video/seibuspi.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34static tilemap *text_layer;
45static tilemap *back_layer;
src/mame/video/midtunit.c
r1649r1650
55**************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "profiler.h"
910#include "cpu/tms34010/tms34010.h"
1011#include "cpu/tms34010/34010ops.h"
src/mame/video/carpolo.c
r1649r1650
1515
1616
1717/* the screen elements' priorties determine their color */
18#define BACKGROUND_COLOR   0
19#define FIELD_COLOR         1
20#define CAR1_COLOR         2
21#define LINE_COLOR         3
22#define CAR4_COLOR         4
23#define CAR3_COLOR         5
24#define CAR2_COLOR         6
25#define BALL_COLOR         7
26#define NET_COLOR         8
27#define LEFT_GOAL_COLOR      9
28#define RIGHT_GOAL_COLOR   10
29#define SPECIAL_CHAR_COLOR   11
30#define ALPHA0_COLOR      12
31#define ALPHA1_COLOR      13
32#define ALPHA2_COLOR      14
33#define ALPHA3_COLOR      15
18#define CHARSET_COLOR_BASE   (0x00)
19#define BACKGROUND_PEN      ((0x00 << 1) + 1)
20#define FIELD_PEN         ((0x01 << 1) + 1)
21#define CAR1_COLOR         (0x02)
22#define LINE_PEN         ((0x03 << 1) + 1)
23#define CAR4_COLOR         (0x04)
24#define CAR3_COLOR         (0x05)
25#define CAR2_COLOR         (0x06)
26#define BALL_COLOR         (0x07)
27#define NET_COLOR         (0x08)
28#define LEFT_GOAL_COLOR      (0x09)
29#define LEFT_GOAL_PEN      (0x18 + 0x08)
30#define LEFT_SCORE_PEN      (0x18 + 0x06)
31#define RIGHT_GOAL_COLOR   (0x0a)
32#define RIGHT_GOAL_PEN      (0x18 + 0x18)
33#define RIGHT_SCORE_PEN      (0x18 + 0x16)
34#define SPECIAL_CHAR_COLOR   (0x0b)
35#define ALPHA_COLOR_BASE   (0x0c)   /* 0x0c - 0x0f */
3436
35#define SCORE_COLOR         16   /* this is only used for collision detection purposes */
37#define SPRITE_WIDTH      (16)
38#define SPRITE_HEIGHT      (16)
39#define GOAL_WIDTH         (16)
40#define GOAL_HEIGHT         (64)
3641
37#define SPRITE_WIDTH      16
38#define SPRITE_HEIGHT      16
39#define GOAL_WIDTH         16
40#define GOAL_HEIGHT         64
42#define LEFT_GOAL_X         ((2 * 16) - 8)
43#define RIGHT_GOAL_X      ((13 * 16) - 8)
44#define GOAL_Y            (7 * 16)
4145
42#define LEFT_GOAL_X         2*16-8
43#define RIGHT_GOAL_X      13*16-8
44#define GOAL_Y            7*16
46#define TOP_BORDER         (16)
47#define BOTTOM_BORDER      (255)
48#define LEFT_BORDER         (0)
49#define RIGHT_BORDER      (239)
4550
46#define TOP_BORDER         16
47#define BOTTOM_BORDER      255
48#define LEFT_BORDER         0
49#define RIGHT_BORDER      239
5051
51
5252static mame_bitmap *sprite_sprite_collision_bitmap1;
5353static mame_bitmap *sprite_sprite_collision_bitmap2;
5454static mame_bitmap *sprite_goal_collision_bitmap1;
r1649r1650
7575
7676PALETTE_INIT( carpolo )
7777{
78   int i;
79
7880   /* thanks to Jarek Burczynski for analyzing the circuit */
79   //static const float MAX_VOLTAGE = 6.9620f;
81 /* static const float MAX_VOLTAGE = 6.9620f; */
8082   static const float MIN_VOLTAGE = 1.7434f;
8183   static const float MAX_VOLTAGE = 5.5266f;
8284
r1649r1650
8890   static const float g_voltage[] =
8991   {
9092      1.7434f, 2.1693f, 2.5823f, 3.0585f, 3.4811f, 4.0707f, 4.7415f, 5.4251f
91      //4.7871f, 5.0613f, 5.3079f, 5.6114f, 5.7940f, 6.1608f, 6.5436f, 6.9620f
93    /* 4.7871f, 5.0613f, 5.3079f, 5.6114f, 5.7940f, 6.1608f, 6.5436f, 6.9620f */
9294   };
9395
9496   static const float b_voltage[] =
r1649r1650
9799   };
98100
99101
100   int i;
101   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
102   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
103
104
105   /* the -1 is for the fake score color */
106   for (i = 0; i < machine->drv->total_colors - 1; i++)
102   for (i = 0; i < machine->drv->total_colors; i++)
107103   {
108      UINT8 r,g,b;
109      int bit0,bit1,bit2;
104      UINT8 pen, r, g, b;
105      int bit0, bit1, bit2;
110106
111      /* red component */
112      bit0 = (*color_prom >> 7) & 0x01;
113      bit1 = (*color_prom >> 6) & 0x01;
114      bit2 = (*color_prom >> 5) & 0x01;
115      //r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
116      r = ((r_voltage[*color_prom >> 5         ] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.;
117      /* green component */
118      bit0 = (*color_prom >> 4) & 0x01;
119      bit1 = (*color_prom >> 3) & 0x01;
120      bit2 = (*color_prom >> 2) & 0x01;
121      //g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
122      g = ((g_voltage[(*color_prom >> 2) & 0x07] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.;
123      /* blue component */
124      bit0 = (*color_prom >> 1) & 0x01;
125      bit1 = (*color_prom >> 0) & 0x01;
126      //b = 0x4f * bit0 + 0xa8 * bit1;
127      b = ((b_voltage[*color_prom & 0x03       ] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.;
107      if (i < 0x18)
108         /* sprites */
109         pen = ((i - 0x00) & 0x01) ? CHARSET_COLOR_BASE + ((i - 0x00) >> 1) : 0;
128110
111      else if (i < 0x38)
112         /* the bits in the goal gfx PROM are hooked up as follows (all active LO):
113               D3 - goal post
114               D2 - scoring area
115               D1 - net
116               D0 - n/c
117               I am only filling in the colors actually used. */
118         switch (i - 0x18)
119         {
120         case (0x00 | (0x07 ^ 0x0f)): pen = LEFT_GOAL_COLOR; break;
121         case (0x00 | (0x0d ^ 0x0f)): pen = NET_COLOR; break;
122         case (0x00 | (0x09 ^ 0x0f)): pen = NET_COLOR; break;  /* score */
123         case (0x10 | (0x07 ^ 0x0f)): pen = RIGHT_GOAL_COLOR; break;
124         case (0x10 | (0x0d ^ 0x0f)): pen = NET_COLOR; break;
125         case (0x10 | (0x09 ^ 0x0f)): pen = NET_COLOR; break; /* score */
126         default: pen = 0; break;
127         }
129128
130      palette_set_color(machine,i,MAKE_RGB(r,g,b));
129      else
130         /* alpha layer */
131         pen = ((i - 0x38) & 0x01) ? ALPHA_COLOR_BASE   + ((i - 0x38) >> 1) : 0;
131132
132      // score color is same as net color
133      if (i == NET_COLOR)
134      {
135         palette_set_color(machine,SCORE_COLOR,MAKE_RGB(r,g,b));
136      }
133      /* red component */
134      bit0 = (color_prom[pen] >> 7) & 0x01;
135      bit1 = (color_prom[pen] >> 6) & 0x01;
136      bit2 = (color_prom[pen] >> 5) & 0x01;
137      r = ((r_voltage[(color_prom[pen] >> 5) & 0x07] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.;
137138
138      color_prom++;
139   }
139      /* green component */
140      bit0 = (color_prom[pen] >> 4) & 0x01;
141      bit1 = (color_prom[pen] >> 3) & 0x01;
142      bit2 = (color_prom[pen] >> 2) & 0x01;
143      g = ((g_voltage[(color_prom[pen] >> 2) & 0x07] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.;
140144
145      /* blue component */
146      bit0 = (color_prom[pen] >> 1) & 0x01;
147      bit1 = (color_prom[pen] >> 0) & 0x01;
148      b = ((b_voltage[(color_prom[pen] >> 0) & 0x03] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.;
141149
142   /* sprite colors */
143   for (i = 0; i < TOTAL_COLORS(0) / 2; i++)
144   {
145      COLOR(0,i*2+1) = i;
150      palette_set_color(machine, i, MAKE_RGB(r, g, b));
146151   }
147
148
149   /* the bits in the goal gfx PROM are hooked as follows (all active LO):
150       Bit 3 - goal post
151       Bit 2 - scoring area
152       Bit 1 - net
153       Bit 0 - n/c
154
155       Below I am only filling in the colors actually used. */
156
157   /* left goal */
158   COLOR(1, (0x07 ^ 0x0f)) = LEFT_GOAL_COLOR;
159   COLOR(1, (0x0d ^ 0x0f)) = NET_COLOR;
160   COLOR(1, (0x09 ^ 0x0f)) = SCORE_COLOR;
161
162   /* right goal */
163   COLOR(1, (16 + (0x07 ^ 0x0f))) = RIGHT_GOAL_COLOR;
164   COLOR(1, (16 + (0x0d ^ 0x0f))) = NET_COLOR;
165   COLOR(1, (16 + (0x09 ^ 0x0f))) = SCORE_COLOR;
166
167   /* alpha layer */
168   COLOR(2, 0*2+1) = ALPHA0_COLOR;
169   COLOR(2, 1*2+1) = ALPHA1_COLOR;
170   COLOR(2, 2*2+1) = ALPHA2_COLOR;
171   COLOR(2, 3*2+1) = ALPHA3_COLOR;
172152}
173153
174154
r1649r1650
201181{
202182   int x;
203183
204
205184   for (x = 0; x < 32; x++)
206185   {
207186      UINT8 code, col;
r1649r1650
220199
221200static void remap_sprite_code(int bank, int code, int *remapped_code, int *flipy)
222201{
223   UINT8 *PROM;
202   UINT8* PROM = memory_region(REGION_USER1);
224203
225
226   PROM = memory_region(REGION_USER1);
227
228204   code = (bank << 4) | code;
229205   *remapped_code = PROM[code] & 0x0f;
230206   *flipy = (PROM[code] & 0x10) >> 4;
r1649r1650
236212{
237213   int remapped_code, flipy;
238214
239
240215   remap_sprite_code(bank, code, &remapped_code, &flipy);
241216
242217   x = 240 - x;
r1649r1650
259234
260235VIDEO_UPDATE( carpolo )
261236{
262   /* draw the playfield elements, in the correct priority order */
237   /* draw the playfield elements in the correct priority order */
263238
264239   /* score area - position determined by bit 4 of the vertical timing PROM */
265   plot_box(bitmap,0,0,RIGHT_BORDER+1,TOP_BORDER,machine->pens[BACKGROUND_COLOR]);
240   plot_box(bitmap,0,0,RIGHT_BORDER+1,TOP_BORDER,machine->pens[BACKGROUND_PEN]);
266241
267242   /* field */
268   plot_box(bitmap,0,TOP_BORDER,RIGHT_BORDER+1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[FIELD_COLOR]);
243   plot_box(bitmap,0,TOP_BORDER,RIGHT_BORDER+1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[FIELD_PEN]);
269244
270245   /* car 1 */
271246   draw_sprite(machine, bitmap, cliprect,
r1649r1650
273248            0, carpolo_spriteram[0x0c] & 0x0f, CAR1_COLOR);
274249
275250   /* border - position determined by bit 4 and 7 of the vertical timing PROM */
276   plot_box(bitmap,0,TOP_BORDER,   RIGHT_BORDER+1,1,machine->pens[LINE_COLOR]);
277   plot_box(bitmap,0,BOTTOM_BORDER,RIGHT_BORDER+1,1,machine->pens[LINE_COLOR]);
278   plot_box(bitmap,LEFT_BORDER,TOP_BORDER, 1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[LINE_COLOR]);
279   plot_box(bitmap,RIGHT_BORDER,TOP_BORDER,1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[LINE_COLOR]);
251   plot_box(bitmap,0,TOP_BORDER,   RIGHT_BORDER+1,1,machine->pens[LINE_PEN]);
252   plot_box(bitmap,0,BOTTOM_BORDER,RIGHT_BORDER+1,1,machine->pens[LINE_PEN]);
253   plot_box(bitmap,LEFT_BORDER,TOP_BORDER, 1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[LINE_PEN]);
254   plot_box(bitmap,RIGHT_BORDER,TOP_BORDER,1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[LINE_PEN]);
280255
281256   /* car 4 */
282257   draw_sprite(machine, bitmap, cliprect,
r1649r1650
318293   /* special char - bit 0 of 0x0f enables it,
319294                      bit 1 marked as WIDE, but never appears to be set */
320295   if (carpolo_spriteram[0x0f] & 0x02)
321   {
322      logerror("WIDE!\n");
323   }
296      popmessage("WIDE!\n");
324297
325298   if (carpolo_spriteram[0x0f] & 0x01)
326   {
327299      draw_sprite(machine, bitmap, cliprect,
328300               carpolo_spriteram[0x0a], carpolo_spriteram[0x0b],
329301               1, carpolo_spriteram[0x0e] >> 4, SPECIAL_CHAR_COLOR);
330   }
331302
332303
333304   /* draw the alpha layer */
r1649r1650
344315   draw_alpha_line(machine, bitmap, cliprect, 5, (1*4+2)*2+1);
345316   draw_alpha_line(machine, bitmap, cliprect, 6, (0*4+3)*2  );
346317   draw_alpha_line(machine, bitmap, cliprect, 7, (0*4+3)*2+1);
318
347319   return 0;
348320}
349321
r1649r1650
387359{
388360   int collided = 0;
389361
390
391362   x1 = 240 - x1;
392363   y1 = 240 - y1;
393364   x2 = 240 - x2;
394365   y2 = 240 - y2;
395366
396
397   // check if the two sprites are within collision range
367   /* check if the two sprites are even within collision range */
398368   if ((abs(x1 - x2) < SPRITE_WIDTH) && (abs(y1 - y2) < SPRITE_HEIGHT))
399369   {
400370      int x,y;
401371
402
403372      normalize_coordinates(&x1, &y1, &x2, &y2);
404373
405374      fillbitmap(sprite_sprite_collision_bitmap1, machine->pens[0], 0);
406375      fillbitmap(sprite_sprite_collision_bitmap2, machine->pens[0], 0);
407376
408377      drawgfx(sprite_sprite_collision_bitmap1,machine->gfx[0],
409            code1,1,
378            code1,0,
410379            0,flipy1,
411380            x1,y1,
412            0,TRANSPARENCY_PEN,0);
381            0,TRANSPARENCY_NONE,0);
413382
414383      drawgfx(sprite_sprite_collision_bitmap2,machine->gfx[0],
415            code2,1,
384            code2,0,
416385            0,flipy2,
417386            x2,y2,
418            0,TRANSPARENCY_PEN,0);
387            0,TRANSPARENCY_NONE,0);
419388
420
421389      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
422      {
423390         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
424         {
425391            if ((*BITMAP_ADDR16(sprite_sprite_collision_bitmap1, y, x) == machine->pens[1]) &&
426392                (*BITMAP_ADDR16(sprite_sprite_collision_bitmap2, y, x) == machine->pens[1]))
427393            {
r1649r1650
432398
433399               break;
434400            }
435         }
436      }
437401   }
438402
439403   return collided;
r1649r1650
446410{
447411   int collided = 0;
448412
449
450413   x1 = 240 - x1;
451414   y1 = 240 - y1;
452415
453
454   // check if the sprites is within the range of the goal
416   /* check if the sprite is even within the range of the goal */
455417   if (((y1 + 16) > GOAL_Y) && (y1 < (GOAL_Y + GOAL_HEIGHT)) &&
456418       ((x1 + 16) > LEFT_GOAL_X) && (x1 < (LEFT_GOAL_X + GOAL_WIDTH)))
457419   {
r1649r1650
468430      fillbitmap(sprite_goal_collision_bitmap2, machine->pens[0], 0);
469431
470432      drawgfx(sprite_goal_collision_bitmap1,machine->gfx[0],
471            code1,1,
433            code1,0,
472434            0,flipy1,
473435            x1,y1,
474            0,TRANSPARENCY_PEN,0);
436            0,TRANSPARENCY_NONE,0);
475437
476438      drawgfxzoom(sprite_goal_collision_bitmap2,machine->gfx[1],
477439               0,0,
r1649r1650
481443               0x20000,0x20000);
482444
483445      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
484      {
485446         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
486         {
487447            if ((*BITMAP_ADDR16(sprite_goal_collision_bitmap1, y, x) == machine->pens[1]))
488448            {
489449               pen_t pix = *BITMAP_ADDR16(sprite_goal_collision_bitmap2, y, x);
490450
491               if (pix == machine->pens[LEFT_GOAL_COLOR])
451               if (pix == machine->pens[LEFT_GOAL_PEN])
492452               {
493453                  collided = 1;
494454                  break;
495455               }
496456
497               if (!goalpost_only && (pix == machine->pens[SCORE_COLOR]))
457               if (!goalpost_only && (pix == machine->pens[LEFT_SCORE_PEN]))
498458               {
499459                  collided = 2;
500460                  break;
501461               }
502462            }
503         }
504      }
505463   }
506464
507465   return collided;
r1649r1650
512470{
513471   int collided = 0;
514472
515
516473   x1 = 240 - x1;
517474   y1 = 240 - y1;
518475
519
520   // check if the sprites is within the range of the goal
476   /* check if the sprite is even within the range of the goal */
521477   if (((y1 + 16) > GOAL_Y) && (y1 < (GOAL_Y + GOAL_HEIGHT)) &&
522478       ((x1 + 16) > RIGHT_GOAL_X) && (x1 < (RIGHT_GOAL_X + GOAL_WIDTH)))
523479   {
524480      int x,y;
525481      int x2,y2;
526482
527
528483      x2 = RIGHT_GOAL_X;
529484      y2 = GOAL_Y;
530485
r1649r1650
534489      fillbitmap(sprite_goal_collision_bitmap2, machine->pens[0], 0);
535490
536491      drawgfx(sprite_goal_collision_bitmap1,machine->gfx[0],
537            code1,1,
492            code1,0,
538493            0,flipy1,
539494            x1,y1,
540            0,TRANSPARENCY_PEN,0);
495            0,TRANSPARENCY_NONE,0);
541496
542497      drawgfxzoom(sprite_goal_collision_bitmap2,machine->gfx[1],
543498               0,1,
r1649r1650
547502               0x20000,0x20000);
548503
549504      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
550      {
551505         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
552         {
553506            if ((*BITMAP_ADDR16(sprite_goal_collision_bitmap1, y, x) == machine->pens[1]))
554507            {
555508               pen_t pix = *BITMAP_ADDR16(sprite_goal_collision_bitmap2, y, x);
556509
557               if (pix == machine->pens[RIGHT_GOAL_COLOR])
510               if (pix == machine->pens[RIGHT_GOAL_PEN])
558511               {
559512                  collided = 1;
560513                  break;
561514               }
562515
563               if (!goalpost_only && (pix == machine->pens[SCORE_COLOR]))
516               if (!goalpost_only && (pix == machine->pens[RIGHT_SCORE_PEN]))
564517               {
565518                  collided = 2;
566519                  break;
567520               }
568521            }
569         }
570      }
571522   }
572523
573524   return collided;
r1649r1650
581532   UINT8 x,y;
582533   int collided = 0;
583534
584
585535   x1 = 240 - x1;
586536   y1 = 240 - y1;
587537
588
589   fillbitmap(sprite_border_collision_bitmap, machine->pens[0], 0);
590
591538   drawgfx(sprite_border_collision_bitmap,machine->gfx[0],
592         code1,1,
539         code1,0,
593540         0,flipy1,
594541         0,0,
595         0,TRANSPARENCY_PEN,0);
542         0,TRANSPARENCY_NONE,0);
596543
597544   for (x = 0; x < SPRITE_WIDTH; x++)
598   {
599545      for (y = 0; y < SPRITE_HEIGHT; y++)
600      {
601546         if ((*BITMAP_ADDR16(sprite_border_collision_bitmap, y, x) == machine->pens[1]))
602547         {
603548            if (((UINT8)(x1 + x) == LEFT_BORDER) ||
r1649r1650
614559               break;
615560            }
616561         }
617      }
618   }
619562
620563   return collided;
621564}
r1649r1650
630573   int car1_flipy, car2_flipy, car3_flipy, car4_flipy, ball_flipy;
631574
632575
633   // check car-car collision first
576   /* check car-car collision first */
634577
635578   car1_x = carpolo_spriteram[0x00];
636579   car1_y = carpolo_spriteram[0x01];
r1649r1650
653596   remap_sprite_code(1, carpolo_spriteram[0x0e] & 0x0f, &ball_code, &ball_flipy);
654597
655598
656   // cars 1 and 2
599   /* cars 1 and 2 */
657600   if (check_sprite_sprite_collision(machine,
658601                             car1_x, car1_y, car1_code, car1_flipy,
659602                             car2_x, car2_y, car2_code, car2_flipy,
660603                             &col_x, &col_y))
661   {
662604      carpolo_generate_car_car_interrupt(0, 1);
663   }
664605
665   // cars 1 and 3
606   /* cars 1 and 3 */
666607   else if (check_sprite_sprite_collision(machine,
667608                                 car1_x, car1_y, car1_code, car1_flipy,
668609                                 car3_x, car3_y, car3_code, car3_flipy,
669610                                 &col_x, &col_y))
670   {
671611      carpolo_generate_car_car_interrupt(0, 2);
672   }
673612
674   // cars 1 and 4
613   /* cars 1 and 4 */
675614   else if (check_sprite_sprite_collision(machine,
676615                                 car1_x, car1_y, car1_code, car1_flipy,
677616                                 car4_x, car4_y, car4_code, car4_flipy,
678617                                 &col_x, &col_y))
679   {
680618      carpolo_generate_car_car_interrupt(0, 3);
681   }
682619
683   // cars 2 and 3
620   /* cars 2 and 3 */
684621   else if (check_sprite_sprite_collision(machine,
685622                                 car2_x, car2_y, car2_code, car2_flipy,
686623                                 car3_x, car3_y, car3_code, car3_flipy,
687624                                 &col_x, &col_y))
688   {
689625      carpolo_generate_car_car_interrupt(1, 2);
690   }
691626
692   // cars 2 and 4
627   /* cars 2 and 4 */
693628   else if (check_sprite_sprite_collision(machine,
694629                                 car2_x, car2_y, car2_code, car2_flipy,
695630                                 car4_x, car4_y, car4_code, car4_flipy,
696631                                 &col_x, &col_y))
697   {
698632      carpolo_generate_car_car_interrupt(1, 3);
699   }
700633
701   // cars 3 and 4
634   /* cars 3 and 4 */
702635   else if (check_sprite_sprite_collision(machine,
703636                                 car3_x, car3_y, car3_code, car3_flipy,
704637                                 car4_x, car4_y, car4_code, car4_flipy,
705638                                 &col_x, &col_y))
706   {
707639      carpolo_generate_car_car_interrupt(2, 3);
708   }
709640
710641
711642
712   // check car-ball collision
643   /* check car-ball collision */
713644   if (check_sprite_sprite_collision(machine,
714645                             car1_x, car1_y, car1_code, car1_flipy,
715646                             ball_x, ball_y, ball_code, ball_flipy,
716647                             &col_x, &col_y))
717   {
718648      carpolo_generate_car_ball_interrupt(0, col_x, col_y);
719   }
649
720650   else if (check_sprite_sprite_collision(machine,
721651                                 car2_x, car2_y, car2_code, car2_flipy,
722652                                   ball_x, ball_y, ball_code, ball_flipy,
723653                                 &col_x, &col_y))
724   {
725654      carpolo_generate_car_ball_interrupt(1, col_x, col_y);
726   }
655
727656   else if (check_sprite_sprite_collision(machine,
728657                                 car3_x, car3_y, car3_code, car3_flipy,
729658                                   ball_x, ball_y, ball_code, ball_flipy,
730659                                 &col_x, &col_y))
731   {
732660      carpolo_generate_car_ball_interrupt(2, col_x, col_y);
733   }
661
734662   else if (check_sprite_sprite_collision(machine,
735663                                 car4_x, car4_y, car4_code, car4_flipy,
736664                                   ball_x, ball_y, ball_code, ball_flipy,
737665                                 &col_x, &col_y))
738   {
739666      carpolo_generate_car_ball_interrupt(3, col_x, col_y);
740   }
741667
742668
743   // check car-goal collision
669   /* check car-goal collision */
744670   if (check_sprite_left_goal_collision(machine, car1_x, car1_y, car1_code, car1_flipy, 1))
745   {
746671      carpolo_generate_car_goal_interrupt(0, 0);
747   }
672
748673   else if (check_sprite_right_goal_collision(machine, car1_x, car1_y, car1_code, car1_flipy, 1))
749   {
750674      carpolo_generate_car_goal_interrupt(0, 1);
751   }
675
752676   else if (check_sprite_left_goal_collision(machine, car2_x, car2_y, car2_code, car2_flipy, 1))
753   {
754677      carpolo_generate_car_goal_interrupt(1, 0);
755   }
678
756679   else if (check_sprite_right_goal_collision(machine, car2_x, car2_y, car2_code, car2_flipy, 1))
757   {
758680      carpolo_generate_car_goal_interrupt(1, 1);
759   }
681
760682   else if (check_sprite_left_goal_collision(machine, car3_x, car3_y, car3_code, car3_flipy, 1))
761   {
762683      carpolo_generate_car_goal_interrupt(2, 0);
763   }
684
764685   else if (check_sprite_right_goal_collision(machine, car3_x, car3_y, car3_code, car3_flipy, 1))
765   {
766686      carpolo_generate_car_goal_interrupt(2, 1);
767   }
687
768688   else if (check_sprite_left_goal_collision(machine, car4_x, car4_y, car4_code, car4_flipy, 1))
769   {
770689      carpolo_generate_car_goal_interrupt(3, 0);
771   }
690
772691   else if (check_sprite_right_goal_collision(machine, car4_x, car4_y, car4_code, car4_flipy, 1))
773   {
774692      carpolo_generate_car_goal_interrupt(3, 1);
775   }
776693
777694
778   // check ball collision with static screen elements
695   /* check ball collision with static screen elements */
779696   {
780   int col;
697      int col;
781698
782   col = check_sprite_left_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0);
699      col = check_sprite_left_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0);
783700
784   if (col == 1)  carpolo_generate_ball_screen_interrupt(0x05);
785   if (col == 2)  carpolo_generate_ball_screen_interrupt(0x03);
701      if (col == 1)  carpolo_generate_ball_screen_interrupt(0x05);
702      if (col == 2)  carpolo_generate_ball_screen_interrupt(0x03);
786703
787704
788   col = check_sprite_right_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0);
705      col = check_sprite_right_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0);
789706
790   if (col == 1)  carpolo_generate_ball_screen_interrupt(0x05 | 0x08);
791   if (col == 2)  carpolo_generate_ball_screen_interrupt(0x03 | 0x08);
707      if (col == 1)  carpolo_generate_ball_screen_interrupt(0x05 | 0x08);
708      if (col == 2)  carpolo_generate_ball_screen_interrupt(0x03 | 0x08);
792709
793710
794   if (check_sprite_border_collision(machine, ball_x, ball_y, ball_code, ball_flipy))
795   {
796      carpolo_generate_ball_screen_interrupt(0x06);
711      if (check_sprite_border_collision(machine, ball_x, ball_y, ball_code, ball_flipy))
712         carpolo_generate_ball_screen_interrupt(0x06);
797713   }
798   }
799714
800715
801   // check car-border collision
716   /* check car-border collision */
802717   {
803   int col;
718      int col;
804719
805   col = check_sprite_border_collision(machine, car1_x, car1_y, car1_code, car1_flipy);
720      col = check_sprite_border_collision(machine, car1_x, car1_y, car1_code, car1_flipy);
806721
807   if (col)
808   {
809      carpolo_generate_car_border_interrupt(0, (col == 2));
810   }
811   else
812   {
813      col = check_sprite_border_collision(machine, car2_x, car2_y, car2_code, car2_flipy);
814
815722      if (col)
816      {
817         carpolo_generate_car_border_interrupt(1, (col == 2));
818      }
723         carpolo_generate_car_border_interrupt(0, (col == 2));
819724      else
820725      {
821         col = check_sprite_border_collision(machine, car3_x, car3_y, car3_code, car3_flipy);
726         col = check_sprite_border_collision(machine, car2_x, car2_y, car2_code, car2_flipy);
822727
823728         if (col)
824         {
825            carpolo_generate_car_border_interrupt(2, (col == 2));
826         }
729            carpolo_generate_car_border_interrupt(1, (col == 2));
827730         else
828731         {
829            col = check_sprite_border_collision(machine, car4_x, car4_y, car4_code, car4_flipy);
732            col = check_sprite_border_collision(machine, car3_x, car3_y, car3_code, car3_flipy);
830733
831734            if (col)
735               carpolo_generate_car_border_interrupt(2, (col == 2));
736            else
832737            {
833               carpolo_generate_car_border_interrupt(3, (col == 2));
738               col = check_sprite_border_collision(machine, car4_x, car4_y, car4_code, car4_flipy);
739
740               if (col)
741                  carpolo_generate_car_border_interrupt(3, (col == 2));
834742            }
835743         }
836744      }
837745   }
838   }
839746}
src/mame/video/system1.c
r1649r1650
88*************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "system1.h"
1213
1314UINT8 *system1_scroll_y;
r1649r1650
457458
458459      /* copy the temporary bitmap to the screen */
459460      if (flip_screen)
460         copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx_flip,1,&background_scrolly_flip,cliprect,TRANSPARENCY_NONE,0);
461         copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx_flip,1,&background_scrolly_flip,cliprect);
461462      else
462         copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx,1,&background_scrolly,cliprect,TRANSPARENCY_NONE,0);
463         copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx,1,&background_scrolly,cliprect);
463464   }
464465   else
465466   {
r1649r1650
607608            for (i = 0; i < 32; i++)
608609               scrollx_row_flip[31-i] = (256-scrollx_row[i]) & 0xff;
609610
610            copyscrollbitmap(bitmap,tmp_bitmap,32,scrollx_row_flip,0,0,cliprect,TRANSPARENCY_NONE,0);
611            copyscrollbitmap(bitmap,tmp_bitmap,32,scrollx_row_flip,0,0,cliprect);
611612         }
612613         else
613            copyscrollbitmap(bitmap,tmp_bitmap,32,scrollx_row,0,0,cliprect,TRANSPARENCY_NONE,0);
614            copyscrollbitmap(bitmap,tmp_bitmap,32,scrollx_row,0,0,cliprect);
614615      }
615616      else
616         copybitmap(bitmap,tmp_bitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
617         copybitmap(bitmap,tmp_bitmap,0,0,0,0,cliprect);
617618   }
618619   else
619620   {
src/mame/video/powerins.c
r1649r1650
3838**************************************************************************/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142
4243/* Variables that driver has access to: */
4344UINT16 *powerins_vram_0, *powerins_vctrl_0;
src/mame/video/niyanpai.c
r1649r1650
77******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112
1213#define   VRAM_MAX   3
r1649r1650
433434   }
434435
435436   if (niyanpai_dispflag[0])
436   {
437      copyscrollbitmap(bitmap, niyanpai_tmpbitmap[0], 1, &scrollx[0], 1, &scrolly[0], &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
438   }
437      copyscrollbitmap(bitmap, niyanpai_tmpbitmap[0], 1, &scrollx[0], 1, &scrolly[0], cliprect);
439438   else
440   {
441439      fillbitmap(bitmap, machine->pens[0x00ff], 0);
442   }
443440
444441   if (niyanpai_dispflag[1])
445   {
446      copyscrollbitmap(bitmap, niyanpai_tmpbitmap[1], 1, &scrollx[1], 1, &scrolly[1], &machine->screen[0].visarea, TRANSPARENCY_PEN, machine->pens[0x01ff]);
447   }
442      copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[1], 1, &scrollx[1], 1, &scrolly[1], cliprect, machine->pens[0x01ff]);
448443
449444   if (niyanpai_dispflag[2])
450   {
451      copyscrollbitmap(bitmap, niyanpai_tmpbitmap[2], 1, &scrollx[2], 1, &scrolly[2], &machine->screen[0].visarea, TRANSPARENCY_PEN, machine->pens[0x02ff]);
452   }
445      copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[2], 1, &scrollx[2], 1, &scrolly[2], cliprect, machine->pens[0x02ff]);
446
453447   return 0;
454448}
src/mame/video/stvvdp2.c
r1649r1650
8282#include "driver.h"
8383#include "eminline.h"
8484#include "profiler.h"
85#include "deprecat.h"
8586
8687UINT32* stv_vdp2_regs;
8788UINT32* stv_vdp2_vram;
src/mame/video/jedi.c
r1649r1650
22
33    Atari Return of the Jedi hardware
44
5    Return of the Jedi has a peculiar playfield/motion object
6    priority system. That is, there is no priority system ;-)
7    The color of the pixel which appears on screen depends on
8    all three of the foreground, background and motion objects.
9    The 1024 colors palette is appropriately set up by the program
10    to "emulate" a priority system, but it can also be used to display
11    completely different colors (see the palette test in service mode)
12
513***************************************************************************/
614
715#include "driver.h"
816#include "jedi.h"
917
1018
19#define NUM_PENS   (0x1000)
20
21
1122/* globals */
23UINT8 *jedi_foregroundram;
1224UINT8 *jedi_backgroundram;
13size_t jedi_backgroundram_size;
25UINT8 *jedi_spriteram;
26UINT8 *jedi_paletteram;
27UINT8 *jedi_foreground_bank;
1428
15
1629/* local variables */
1730static UINT32 jedi_vscroll;
1831static UINT32 jedi_hscroll;
19static UINT32 jedi_alpha_bank;
20static UINT8 video_off, smooth_table;
21static mame_bitmap *fgbitmap, *mobitmap, *bgbitmap, *bgexbitmap;
32static UINT8 video_off;
33static UINT8 smoothing_table;
2234
2335
2436
r1649r1650
3042
3143VIDEO_START( jedi )
3244{
33   /* allocate an 8bpp bitmap for the raw foreground characters */
34   fgbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
35
36   /* allocate an 8bpp bitmap for the motion objects */
37   mobitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
38   fillbitmap(mobitmap, 0, &machine->screen[0].visarea);
39
40   /* the background area is 256x256, doubled by the hardware*/
41   bgbitmap = auto_bitmap_alloc(256, 256, machine->screen[0].format);
42
43   /* the expanded background area is 512x512 */
44   bgexbitmap = auto_bitmap_alloc(512, 512, machine->screen[0].format);
45
46   /* reserve color 1024 for black (disabled display) */
47   palette_set_color(machine, 1024, MAKE_RGB(0, 0, 0));
48
4945   /* register for saving */
5046   state_save_register_global(jedi_vscroll);
5147   state_save_register_global(jedi_hscroll);
52   state_save_register_global(jedi_alpha_bank);
5348   state_save_register_global(video_off);
54   state_save_register_global(smooth_table);
49   state_save_register_global(smoothing_table);
5550}
5651
5752
r1649r1650
8277 *
8378 *************************************/
8479
85WRITE8_HANDLER( jedi_paletteram_w )
80static void get_pens(pen_t *pens)
8681{
87    int r, g, b, bits, intensity;
88    UINT32 color;
82   offs_t offs;
8983
90   paletteram[offset] = data;
91   color = paletteram[offset & 0x3FF] | (paletteram[offset | 0x400] << 8);
84   for (offs = 0; offs < NUM_PENS; offs++)
85   {
86      int r, g, b, bits, intensity;
9287
93   intensity = (color >> 9) & 7;
94   bits = (color >> 6) & 7;
95   r = 5 * bits * intensity;
96   bits = (color >> 3) & 7;
97   g = 5 * bits * intensity;
98   bits = (color >> 0) & 7;
99   b = 5 * bits * intensity;
88      UINT16 color = jedi_paletteram[offs] | (jedi_paletteram[offs | 0x400] << 8);
10089
101   palette_set_color(Machine, offset & 0x3ff, MAKE_RGB(r, g, b));
90      intensity = (color >> 9) & 7;
91      bits = (color >> 6) & 7;
92      r = 5 * bits * intensity;
93      bits = (color >> 3) & 7;
94      g = 5 * bits * intensity;
95      bits = (color >> 0) & 7;
96      b = 5 * bits * intensity;
97
98      pens[offs] = MAKE_RGB(r, g, b);
99   }
102100}
103101
104102
103static void do_pen_lookup(mame_bitmap *bitmap, const rectangle *cliprect)
104{
105   int y, x;
106   pen_t pens[NUM_PENS];
105107
106/*************************************
107 *
108 *  Foreground banking
109 *
110 *************************************/
108   get_pens(pens);
111109
112WRITE8_HANDLER( jedi_alpha_banksel_w )
113{
114   jedi_alpha_bank = 2 * (data & 0x80);
110   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
111      for(x = cliprect->min_x; x <= cliprect->max_x; x++)
112         *BITMAP_ADDR32(bitmap, y, x) = pens[*BITMAP_ADDR32(bitmap, y, x)];
115113}
116114
117115
r1649r1650
149147
150148WRITE8_HANDLER( jedi_PIXIRAM_w )
151149{
152   smooth_table = data & 0x03;
150   /* this should really be 0x07, but the PROMs were
151       dumped at half size */
152   smoothing_table = data & 0x03;
153153}
154154
155155
156156
157157/*************************************
158158 *
159 *  Background smoothing
159 *  Foreground drawing
160160 *
161161 *************************************/
162162
163static void update_smoothing(int bgtilerow)
163static void draw_foreground(mame_bitmap *bitmap)
164164{
165   UINT8 *prom = memory_region(REGION_PROMS) + smooth_table * 0x100;
166   UINT8 bgscan[2][256];
167   UINT8 *bgcurr = bgscan[0], *bglast = bgscan[1];
168   int x, y;
165   offs_t offs;
166    UINT32 *dst = BITMAP_ADDR32(bitmap, 0, 0);
169167
170   /*
171        smoothing notes:
172            * even scanlines blend the previous (Y-1) and current (Y) line
173            * odd scanlines are just taken from the current line (Y)
174            * therefore, if we modify source scanlines 8-15, we must update dest scanlines 16-32
175
176            * even pixels are just taken from the current pixel (X)
177            * odd pixels blend the current (X) and next (X+1) pixels
178            * therefore, if we modify source pixels 8-15, we must update dest pixels 15-31
179    */
180
181   /* extract the previous bg scanline */
182   extract_scanline8(bgbitmap, 0, ((bgtilerow * 16 - 1) & 0x1ff) / 2, 256, bgcurr);
183
184   /* loop over height */
185   for (y = 0; y <= 16; y++)
168   /* draw the bitmap 4 pixels at a time */
169    for (offs = 0; offs < 0x7c00; offs++)
186170   {
187      int curry = (bgtilerow * 16 + y) & 0x1ff;
171      UINT16 code = ((*jedi_foreground_bank & 0x80) << 1) |
172                 jedi_foregroundram[((offs & 0x7c00) >> 4) | ((offs & 0x7e) >> 1)];
188173
189      /* swap background buffers */
190      UINT8 *bgtemp = bgcurr;
191      bgcurr = bglast;
192      bglast = bgtemp;
174      UINT8 data = memory_region(REGION_GFX1)[(code << 4) | ((offs & 0x380) >> 6) | (offs & 0x01)];
193175
194      /* extract current bg scanline */
195      extract_scanline8(bgbitmap, 0, curry / 2, 256, bgcurr);
176      /* the background pixel determines pen address bits A8 and A9 */
177      dst[0] = (dst[0] & 0xff) | ((data & 0xc0) << 2);
178      dst[1] = (dst[1] & 0xff) | ((data & 0x30) << 4);
179      dst[2] = (dst[2] & 0xff) | ((data & 0x0c) << 6);
180      dst[3] = (dst[3] & 0xff) | ((data & 0x03) << 8);
196181
197      /* loop over columns */
198      for (x = -1; x <= 511; x++)
199      {
200         int tr = bglast[((x + 1) & 0x1ff) / 2];
201         int br = bgcurr[((x + 1) & 0x1ff) / 2];
202
203         /* smooth pixels */
204         if (x & 1)
205         {
206            int tl = bglast[(x & 0x1ff) / 2];
207            int bl = bgcurr[(x & 0x1ff) / 2];
208            int mixt = prom[16 * tl + tr];
209            int mixb = prom[16 * bl + br];
210            *BITMAP_ADDR16(bgexbitmap, curry, x & 0x1ff) = prom[0x400 + 16 * mixt + mixb];
211         }
212         else
213            *BITMAP_ADDR16(bgexbitmap, curry, x & 0x1ff) = prom[0x400 + 16 * tr + br];
214      }
182      dst = dst + 4;
215183   }
216184}
217185
r1649r1650
219187
220188/*************************************
221189 *
222 *  Core video refresh
190 *  Background drawing with smoothing
223191 *
224192 *************************************/
225193
226VIDEO_UPDATE( jedi )
194static void draw_and_smooth_background(mame_bitmap *bitmap, const rectangle *cliprect)
227195{
228   int offs;
196   int y;
197   UINT32 background_line_buffer[0x200];   /* RAM chip at 2A */
229198
199   UINT8 *prom1 = &memory_region(REGION_PROMS)[0x0000 | (smoothing_table << 8)];
200   UINT8 *prom2 = &memory_region(REGION_PROMS)[0x0800 | (smoothing_table << 8)];
230201
231   /* if no video, clear it all to black */
232   if (video_off)
202   memset(background_line_buffer, 0, 0x200 * sizeof(UINT32));
203
204   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
233205   {
234      fillbitmap(bitmap, machine->pens[1024], &machine->screen[0].visarea);
235      return 0;
236   }
206      int x;
207      UINT32 last_col = 0;
237208
238   /* Return of the Jedi has a peculiar playfield/motion object priority system. That */
239   /* is, there is no priority system ;-) The color of the pixel which appears on */
240   /* screen depends on all three of the foreground, background and motion objects. The */
241   /* 1024 colors palette is appropriately set up by the program to "emulate" a */
242   /* priority system, but it can also be used to display completely different */
243   /* colors (see the palette test in service mode) */
209      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
210      {
211         UINT32 col;
212         UINT32 tempcol;
213         offs_t gfx_offs;
214         UINT8 data1;
215         UINT8 data2;
244216
245    /* update foreground bitmap as a raw bitmap*/
246    for (offs = videoram_size - 1; offs >= 0; offs--)
247   {
248      int sx = offs % 64;
249      int sy = offs / 64;
217         int sy = y + jedi_vscroll;
218         int sx = x + jedi_hscroll;
250219
251      drawgfx(fgbitmap, machine->gfx[0], videoram[offs] + jedi_alpha_bank,
252            0, 0, 0, 8*sx, 8*sy, &machine->screen[0].visarea, TRANSPARENCY_NONE_RAW, 0);
253   }
220         offs_t backgroundram_offs = ((sy & 0x1f0) << 1) | ((sx & 0x1f0) >> 4);
254221
255    /* update background bitmap as a raw bitmap */
256   for (offs = jedi_backgroundram_size / 2 - 1; offs >= 0; offs--)
257   {
258      int sx = offs % 32;
259      int sy = offs / 32;
260      int code = (jedi_backgroundram[offs] & 0xFF);
261      int bank = (jedi_backgroundram[offs + 0x400] & 0x0F);
222         /* shuffle the bank bits in */
223         UINT8 bank = jedi_backgroundram[0x0400 | backgroundram_offs];
224         UINT16 code = jedi_backgroundram[0x0000 | backgroundram_offs] |
225                    ((bank & 0x01) << 8) |
226                    ((bank & 0x08) << 6) |
227                    ((bank & 0x02) << 9);
262228
263      /* shuffle the bank bits in */
264      code |= (bank & 0x01) << 8;
265      code |= (bank & 0x08) << 6;
266      code |= (bank & 0x02) << 9;
229         /* flip X */
230         if (bank & 0x04)
231            sx = sx ^ 0x0f;
267232
268      drawgfx(bgbitmap, machine->gfx[1], code,
269            0, bank & 0x04, 0, 8*sx, 8*sy, 0, TRANSPARENCY_NONE_RAW, 0);
233         /* get the pointer to the graphics */
234         gfx_offs = (code << 4) | (sy & 0x0e) | (((sx & 0x08) >> 3));
235
236         data1 = memory_region(REGION_GFX2)[0x0000 | gfx_offs];
237         data2 = memory_region(REGION_GFX2)[0x8000 | gfx_offs];
238
239         /* the foreground pixel determines pen address bits A0-A3 */
240         switch (sx & 0x06)
241         {
242         case 0x00:   col = ((data1 & 0x80) >> 4) | ((data1 & 0x08) >> 1) | ((data2 & 0x80) >> 6) | ((data2 & 0x08) >> 3); break;
243         case 0x02:   col = ((data1 & 0x40) >> 3) | ((data1 & 0x04) >> 0) | ((data2 & 0x40) >> 5) | ((data2 & 0x04) >> 2); break;
244         case 0x04:   col = ((data1 & 0x20) >> 2) | ((data1 & 0x02) << 1) | ((data2 & 0x20) >> 4) | ((data2 & 0x02) >> 1); break;
245         default:   col = ((data1 & 0x10) >> 1) | ((data1 & 0x01) << 2) | ((data2 & 0x10) >> 3) | ((data2 & 0x01) >> 0); break;
246         }
247
248         /* the first pixel is smoothed via a lookup using the current and last pixel value -
249               the next pixel just uses the current value directly. After we done with a pixel
250               save it for later in the line buffer RAM */
251         tempcol = prom1[(last_col << 4) | col];
252         *BITMAP_ADDR32(bitmap, y, x + 0) = prom2[(background_line_buffer[x + 0] << 4) | tempcol];
253         *BITMAP_ADDR32(bitmap, y, x + 1) = prom2[(background_line_buffer[x + 1] << 4) | col];
254         background_line_buffer[x + 0] = tempcol;
255         background_line_buffer[x + 1] = col;
256
257         last_col = col;
258      }
270259   }
260}
271261
272   /* update smoothed version of background */
273   for (offs = 0; offs < 32; offs++)
274      update_smoothing(offs);
275262
276   /* draw the motion objects */
277    for (offs = 0; offs < 0x30; offs++)
263
264/*************************************
265 *
266 *  Sprite drawing
267 *
268 *************************************/
269
270static void draw_sprites(mame_bitmap *bitmap)
271{
272   offs_t offs;
273
274   for (offs = 0x00; offs < 0x30; offs++)
278275   {
276      int sy;
277      int y_size;
278      UINT8 *gfx;
279
279280      /* coordinates adjustments made to match screenshot */
280      int x = spriteram[offs + 0x100] + ((spriteram[offs + 0x40] & 0x01) << 8) - 2;
281      int y = 240 - spriteram[offs + 0x80] + 1;
282      int flipx = spriteram[offs + 0x40] & 0x10;
283      int flipy = spriteram[offs + 0x40] & 0x20;
284      int tall = spriteram[offs + 0x40] & 0x08;
285      int code, bank;
281      UINT8 y = 240 - jedi_spriteram[offs + 0x80] + 1;
282      int flip_x = jedi_spriteram[offs + 0x40] & 0x10;
283      int flip_y = jedi_spriteram[offs + 0x40] & 0x20;
284      int tall = jedi_spriteram[offs + 0x40] & 0x08;
286285
287286      /* shuffle the bank bits in */
288      bank  = ((spriteram[offs + 0x40] & 0x02) >> 1);
289      bank |= ((spriteram[offs + 0x40] & 0x40) >> 5);
290      bank |=  (spriteram[offs + 0x40] & 0x04);
291      code = spriteram[offs] + (bank * 256);
287      UINT16 code = jedi_spriteram[offs] |
288                 ((jedi_spriteram[offs + 0x40] & 0x04) << 8) |
289                 ((jedi_spriteram[offs + 0x40] & 0x40) << 3) |
290                 ((jedi_spriteram[offs + 0x40] & 0x02) << 7);
292291
293292      /* adjust for double-height */
294293      if (tall)
295         code |= 1;
294      {
295         code &= ~1;
296         y_size = 0x20;
297         y = y - 0x10;
298      }
299      else
300         y_size = 0x10;
296301
297      /* draw motion object */
298      drawgfx(mobitmap, machine->gfx[2], code,
299            0, flipx, flipy, x, y, &machine->screen[0].visarea, TRANSPARENCY_PEN_RAW, 0);
302      gfx = &memory_region(REGION_GFX3)[code << 5];
300303
301      /* handle double-height */
302      if (tall)
303         drawgfx(mobitmap, machine->gfx[2], code - 1,
304               0, flipx, flipy, x, y - 16, &machine->screen[0].visarea, TRANSPARENCY_PEN_RAW, 0);
305    }
304      if (flip_y)
305         y = y + y_size - 1;
306306
307   /* compose the three layers */
308   {
309      int xscroll = -jedi_hscroll;
310      int yscroll = -jedi_vscroll;
311      copyscrollbitmap(bitmap, bgexbitmap, 1, &xscroll, 1, &yscroll, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
312      copybitmap(bitmap, mobitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_BLEND_RAW, 4);
313      copybitmap(bitmap, fgbitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_BLEND, 8);
307      for (sy = 0; sy < y_size; sy++)
308      {
309         int i;
310         UINT16 x = jedi_spriteram[offs + 0x100] + ((jedi_spriteram[offs + 0x40] & 0x01) << 8) - 2;
311
312         if (flip_x)
313            x = x + 7;
314
315         for (i = 0; i < 2; i++)
316         {
317            int sx;
318            UINT8 data1 = *(0x00000 + gfx);
319            UINT8 data2 = *(0x10000 + gfx);
320
321            for (sx = 0; sx < 4; sx++)
322            {
323               /* the sprite pixel determines pen address bits A4-A7 */
324               UINT32 col = ((data1 & 0x80) >> 0) | ((data1 & 0x08) << 3) | ((data2 & 0x80) >> 2) | ((data2 & 0x08) << 1);
325
326               x = x & 0x1ff;
327
328               if (col)
329                  *BITMAP_ADDR32(bitmap, y, x) = (*BITMAP_ADDR32(bitmap, y, x) & 0x30f) | col;
330
331               /* next pixel */
332               if (flip_x)
333                  x = x - 1;
334               else
335                  x = x + 1;
336
337               data1 = data1 << 1;
338               data2 = data2 << 1;
339            }
340
341            gfx = gfx + 1;
342         }
343
344         if (flip_y)
345            y = y - 1;
346         else
347            y = y + 1;
348      }
314349   }
350}
315351
316   /* erase the motion objects */
317    for (offs = 0; offs < 0x30; offs++)
352
353
354/*************************************
355 *
356 *  Core video refresh
357 *
358 *************************************/
359
360VIDEO_UPDATE( jedi )
361{
362   /* if no video, clear it all to black */
363   if (video_off)
364      fillbitmap(bitmap, RGB_BLACK, cliprect);
365   else
318366   {
319      /* coordinates adjustments made to match screenshot */
320      int x = spriteram[offs + 0x100] + ((spriteram[offs + 0x40] & 0x01) << 8) - 2;
321      int y = 240 - spriteram[offs + 0x80] + 1;
322      int tall = spriteram[offs + 0x40] & 0x08;
323      rectangle bounds;
367      /* draw the background - it needs to be done first */
368      draw_and_smooth_background(bitmap, cliprect);
324369
325      /* compute the bounds */
326      bounds.min_x = x;
327      bounds.max_x = x + 15;
328      bounds.min_y = tall ? (y - 16) : y;
329      bounds.max_y = y + (tall ? 31 : 15);
330      fillbitmap(mobitmap, 0, &bounds);
331    }
370      draw_foreground(bitmap);
371      draw_sprites(bitmap);
372
373      do_pen_lookup(bitmap, cliprect);
374   }
375
332376   return 0;
333377}
src/mame/video/suprnova.c
r1649r1650
1515*/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819
1920#define SUPRNOVA_DECODE_BUFFER_SIZE 0x2000
2021
src/mame/video/flkatck.c
r1649r1650
140140#endif
141141   if (k007121_flip_screen)
142142   {
143      k007121_clip[0] = Machine->screen[0].visarea;
143      k007121_clip[0] = machine->screen[0].visarea;
144144      k007121_clip[0].max_x -= 40;
145145
146      k007121_clip[1] = Machine->screen[0].visarea;
146      k007121_clip[1] = machine->screen[0].visarea;
147147      k007121_clip[1].min_x = k007121_clip[1].max_x-40;
148148
149149      tilemap_set_scrollx(k007121_tilemap[0],0,K007121_ctrlram[0][0x00] - 56 );
r1649r1650
172172
173173   /* draw the graphics */
174174   tilemap_draw(bitmap,&final_clip[0],k007121_tilemap[0],0,0);
175   K007121_sprites_draw(machine,0,bitmap,cliprect,&k007121_ram[0x1000],0,40,0,-1);
175   K007121_sprites_draw(0,bitmap,machine->gfx,NULL,cliprect,&k007121_ram[0x1000],0,40,0,-1);
176176   tilemap_draw(bitmap,&final_clip[1],k007121_tilemap[1],0,0);
177177   return 0;
178178}
src/mame/video/contra.c
r1649r1650
11/***************************************************************************
22
3  gryzor: video.c
3  video/contra.c
44
55***************************************************************************/
66
r1649r1650
3030
3131PALETTE_INIT( contra )
3232{
33   int i,chip,pal,clut;
33   int chip;
3434
35   for (chip = 0;chip < 2;chip++)
35   /* allocate the colortable */
36   machine->colortable = colortable_alloc(machine, 0x80);
37
38   for (chip = 0; chip < 2; chip++)
3639   {
37      for (pal = 0;pal < 8;pal++)
40      int pal;
41
42      for (pal = 0; pal < 8; pal++)
3843      {
39         clut = (pal & 1) + 2 * chip;
40         for (i = 0;i < 256;i++)
44         int i;
45         int clut = (chip << 1) | (pal & 1);
46
47         for (i = 0; i < 0x100; i++)
4148         {
42            if ((pal & 1) == 0)   /* sprites */
43            {
44               if (color_prom[256 * clut + i] == 0)
45                  *(colortable++) = 0;
46               else
47                  *(colortable++) = 16 * pal + color_prom[256 * clut + i];
48            }
49            UINT8 ctabentry;
50
51            if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0))
52               ctabentry = 0;
4953            else
50               *(colortable++) = 16 * pal + color_prom[256 * clut + i];
54               ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
55
56            colortable_entry_set_value(machine->colortable, (chip << 11) | (pal << 8) | i, ctabentry);
5157         }
5258      }
5359   }
5460}
5561
5662
63static void set_pens(running_machine *machine)
64{
65   int i;
5766
67   for (i = 0x00; i < 0x100; i += 2)
68   {
69      UINT16 data = paletteram[i] | (paletteram[i | 1] << 8);
70
71      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
72
73      colortable_palette_set_color(machine->colortable, i >> 1, color);
74   }
75}
76
77
78
5879/***************************************************************************
5980
6081    Callbacks for the TileMap code
r1649r1650
254275   if (bank==0) source=private_spriteram;
255276   else source=private_spriteram_2;
256277
257   K007121_sprites_draw(machine,bank,bitmap,cliprect,source,base_color,40,0,-1);
278   K007121_sprites_draw(bank,bitmap,machine->gfx,machine->colortable,cliprect,source,base_color,40,0,-1);
258279}
259280
260281VIDEO_UPDATE( contra )
r1649r1650
267288   sect_rect(&fg_finalclip, cliprect);
268289   sect_rect(&tx_finalclip, cliprect);
269290
291   set_pens(machine);
292
270293   tilemap_set_scrollx( fg_tilemap,0, K007121_ctrlram[0][0x00] - 40 );
271294   tilemap_set_scrolly( fg_tilemap,0, K007121_ctrlram[0][0x02] );
272295   tilemap_set_scrollx( bg_tilemap,0, K007121_ctrlram[1][0x00] - 40 );
src/mame/video/paradise.c
r1649r1650
2626***************************************************************************/
2727
2828#include "driver.h"
29#include "deprecat.h"
2930#include "paradise.h"
3031
3132/* Variables that driver has access to: */
r1649r1650
258259
259260   if (layers_ctrl&1)   tilemap_draw(bitmap,cliprect, tilemap_0, 0,0);
260261   if (layers_ctrl&2)   tilemap_draw(bitmap,cliprect, tilemap_1, 0,0);
261   if (layers_ctrl&4)   copybitmap(bitmap,tmpbitmap,flip_screen,flip_screen,0,0,cliprect,TRANSPARENCY_PEN, 0x80f);
262   if (layers_ctrl&4)   copybitmap_trans(bitmap,tmpbitmap,flip_screen,flip_screen,0,0,cliprect, 0x80f);
262263
263264   if (paradise_priority & 2)
264265   {
src/mame/video/balsente.c
r1649r1650
77****************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "balsente.h"
1112
1213
src/mame/video/itech32.c
r1649r1650
66***************************************************************************/
77
88#include "driver.h"
9#include "deprecat.h"
910#include "profiler.h"
1011#include "cpu/m68000/m68000.h"
1112#include "itech32.h"
src/mame/video/deco32.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "deco16ic.h"
34#include "deco32.h"
45
src/mame/video/midzeus.c
r1649r1650
55**************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "eminline.h"
910#include "includes/midzeus.h"
1011#include "video/poly.h"
src/mame/video/argus.c
r1649r1650
114114***************************************************************************/
115115
116116#include "driver.h"
117#include "deprecat.h"
117118
118119#include "jalblend.c"
119120
src/mame/video/grchamp.c
r1649r1650
11/*  Video hardware for Taito Grand Champion */
22
33/* updated by Hans Andersson, dec 2005     */
4#include <math.h>
54#include "driver.h"
5#include "deprecat.h"
66#include "video/resnet.h"
77#include "includes/grchamp.h"
88
src/mame/video/gaiden.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910UINT16 *gaiden_videoram,*gaiden_videoram2,*gaiden_videoram3;
1011int gaiden_sprite_sizey;
src/mame/video/fastfred.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "fastfred.h"
1112
1213extern UINT8 galaxian_stars_on;
src/mame/video/karnov.c
r1649r1650
136136      scrolly=scrolly+256;
137137      scrollx=scrollx+256;
138138   }
139   copyscrollbitmap(bitmap,bitmap_f,1,&scrollx,1,&scrolly,cliprect,TRANSPARENCY_NONE,0);
139   copyscrollbitmap(bitmap,bitmap_f,1,&scrollx,1,&scrolly,cliprect);
140140}
141141
142142static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
src/mame/video/punchout.c
r1649r1650
430430   }
431431}
432432
433static void drawbs2(mame_bitmap *bitmap, const rectangle *cliprect)
433static void drawbs2(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
434434{
435435   mame_bitmap *sprbitmap = tilemap_get_pixmap(spr2tilemap);
436436   int sx,sy;
r1649r1650
442442   sy = -punchout_bigsprite2[2] + 256 * (punchout_bigsprite2[3] & 1);
443443   sy += 3;   /* adjustment to match the screen shots */
444444
445   copybitmap(bitmap,sprbitmap,
446         punchout_bigsprite2[4] & 1,0,
447         sx,sy,
448         cliprect,TRANSPARENCY_COLOR,1024);
445   copybitmap_trans(bitmap,sprbitmap, punchout_bigsprite2[4] & 1, 0, sx, sy, cliprect, machine->pens[1024]);
449446}
450447
451448VIDEO_UPDATE( punchout )
r1649r1650
469466
470467      if (punchout_bigsprite1[7] & 2)   /* display in bottom monitor */
471468         draw_big_sprite(bitmap, cliprect);
472      drawbs2(bitmap, cliprect);
469      drawbs2(machine, bitmap, cliprect);
473470   }
474471   return 0;
475472}
r1649r1650
490487
491488      if (punchout_bigsprite1[7] & 2)   /* display in bottom monitor */
492489         armwrest_draw_big_sprite(bitmap, cliprect);
493      drawbs2(bitmap, cliprect);
490      drawbs2(machine, bitmap, cliprect);
494491
495492      tilemap_draw(bitmap, cliprect, fgtilemap, 0, 0);
496493   }
src/mame/video/finalizr.c
r1649r1650
114114
115115      scroll = -*finalizr_scroll + 16;
116116
117      copyscrollbitmap(bitmap,tmpbitmap,1,&scroll,0,0,cliprect,TRANSPARENCY_NONE,0);
117      copyscrollbitmap(bitmap,tmpbitmap,1,&scroll,0,0,cliprect);
118118   }
119119
120120
src/mame/video/galpanic.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "kan_pand.h"
34
45UINT16 *galpanic_bgvideoram,*galpanic_fgvideoram;
r1649r1650
104105VIDEO_UPDATE( galpanic )
105106{
106107   /* copy the temporary bitmap to the screen */
107   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
108   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect);
108109
109110   draw_fgbitmap(machine, bitmap, cliprect);
110111
r1649r1650
116117VIDEO_UPDATE( comad )
117118{
118119   /* copy the temporary bitmap to the screen */
119   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
120   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect);
120121
121122   draw_fgbitmap(machine,bitmap,cliprect);
122123
r1649r1650
130131//  {
131132//      /* keep sprites on the bitmap without clearing them */
132133//      comad_draw_sprites(machine,sprites_bitmap,0);
133//      copybitmap(bitmap,sprites_bitmap,0,0,0,0,cliprect,TRANSPARENCY_PEN,0);
134//      copybitmap_trans(bitmap,sprites_bitmap,0,0,0,0,cliprect,0);
134135//  }
135136   return 0;
136137}
src/mame/video/cclimber.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "includes/cclimber.h"
10#include "video/resnet.h"
1111
1212
1313UINT8 *cclimber_bsvideoram;
1414size_t cclimber_bsvideoram_size;
1515UINT8 *cclimber_bigspriteram;
1616UINT8 *cclimber_column_scroll;
17static int palettebank;
18static int sidepanel_enabled;
17UINT8 *swimmer_bgcolor;
18UINT8 *swimmer_sidepanel_enabled;
19UINT8 *swimmer_palettebank;
1920
2021
2122/***************************************************************************
r1649r1650
3738***************************************************************************/
3839PALETTE_INIT( cclimber )
3940{
41   static const int resistances_rg[3] = { 1000, 470, 220 };
42   static const int resistances_b [2] = { 470, 220 };
43   double rweights[3], gweights[3], bweights[2];
4044   int i;
41   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
42   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + (offs)])
4345
46   /* compute the color output resistor weights */
47   compute_resistor_weights(0,   255, -1.0,
48         3, &resistances_rg[0], rweights, 0, 0,
49         3, &resistances_rg[0], gweights, 0, 0,
50         2, &resistances_b[0],  bweights, 0, 0);
4451
45   for (i = 0;i < machine->drv->total_colors;i++)
52   for (i = 0;i < machine->drv->total_colors; i++)
4653   {
47      int bit0,bit1,bit2,r,g,b;
54      UINT8 data;
55      int bit0, bit1, bit2;
56      int r, g, b;
4857
58      if (i & 0x07)
59         data = color_prom[i];
60      else
61         /* River Patrol shows that background is pen 0 */
62         data = color_prom[0];
4963
5064      /* red component */
51      bit0 = (*color_prom >> 0) & 0x01;
52      bit1 = (*color_prom >> 1) & 0x01;
53      bit2 = (*color_prom >> 2) & 0x01;
54      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
65      bit0 = (data >> 0) & 0x01;
66      bit1 = (data >> 1) & 0x01;
67      bit2 = (data >> 2) & 0x01;
68      r = combine_3_weights(rweights, bit0, bit1, bit2);
69
5570      /* green component */
56      bit0 = (*color_prom >> 3) & 0x01;
57      bit1 = (*color_prom >> 4) & 0x01;
58      bit2 = (*color_prom >> 5) & 0x01;
59      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
71      bit0 = (data >> 3) & 0x01;
72      bit1 = (data >> 4) & 0x01;
73      bit2 = (data >> 5) & 0x01;
74      g = combine_3_weights(gweights, bit0, bit1, bit2);
75
6076      /* blue component */
61      bit0 = 0;
62      bit1 = (*color_prom >> 6) & 0x01;
63      bit2 = (*color_prom >> 7) & 0x01;
64      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
77      bit0 = (data >> 6) & 0x01;
78      bit1 = (data >> 7) & 0x01;
79      b = combine_2_weights(bweights, bit0, bit1);
6580
66      palette_set_color(machine,i,MAKE_RGB(r,g,b));
67      color_prom++;
81      palette_set_color(machine, i, MAKE_RGB(r, g, b));
6882   }
69
70
71   /* character and sprite lookup table */
72   /* they use colors 0-63 */
73   for (i = 0;i < TOTAL_COLORS(0);i++)
74   {
75      /* pen 0 always uses color 0 (background in River Patrol and Silver Land) */
76      if (i % 4 == 0) COLOR(0,i) = 0;
77      else COLOR(0,i) = i;
78   }
79
80   /* big sprite lookup table */
81   /* it uses colors 64-95 */
82   for (i = 0;i < TOTAL_COLORS(2);i++)
83   {
84      if (i % 4 == 0) COLOR(2,i) = 0;
85      else COLOR(2,i) = i + 64;
86   }
8783}
8884
8985
r1649r1650
123119
124120***************************************************************************/
125121
126#define BGPEN (256+32)
127#define SIDEPEN (256+32+1)
128
129122PALETTE_INIT( swimmer )
130123{
131124   int i;
132   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
133   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + (offs)])
134125
135
136   for (i = 0;i < 256;i++)
126   for (i = 0; i < 0x200; i++)
137127   {
138      int bit0,bit1,bit2,r,g,b;
128      rgb_t color;
139129
130      /* non-backgrond pens */
131      if (i & 0x07)
132      {
133         int bit0, bit1, bit2;
134         int r, g, b;
140135
141      /* red component */
142      bit0 = (color_prom[i] >> 0) & 0x01;
143      bit1 = (color_prom[i] >> 1) & 0x01;
144      bit2 = (color_prom[i] >> 2) & 0x01;
145      r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
146      /* green component */
147      bit0 = (color_prom[i] >> 3) & 0x01;
148      bit1 = (color_prom[i+256] >> 0) & 0x01;
149      bit2 = (color_prom[i+256] >> 1) & 0x01;
150      g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
151      /* blue component */
152      bit0 = 0;
153      bit1 = (color_prom[i+256] >> 2) & 0x01;
154      bit2 = (color_prom[i+256] >> 3) & 0x01;
155      b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
136         /* red component */
137         bit0 = (color_prom[(i & 0xff) + 0x000] >> 0) & 0x01;
138         bit1 = (color_prom[(i & 0xff) + 0x000] >> 1) & 0x01;
139         bit2 = (color_prom[(i & 0xff) + 0x000] >> 2) & 0x01;
140         r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
156141
157      palette_set_color(machine,i,MAKE_RGB(r,g,b));
142         /* green component */
143         bit0 = (color_prom[(i & 0xff) + 0x000] >> 3) & 0x01;
144         bit1 = (color_prom[(i & 0xff) + 0x100] >> 0) & 0x01;
145         bit2 = (color_prom[(i & 0xff) + 0x100] >> 1) & 0x01;
146         g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
158147
159      /* side panel */
160      if (i % 8)
161      {
162         COLOR(0,i) = i;
163          COLOR(0,i+256) = i;
148         /* blue component */
149         bit0 = 0;
150         bit1 = (color_prom[(i & 0xff) + 0x100] >> 2) & 0x01;
151         bit2 = (color_prom[(i & 0xff) + 0x100] >> 3) & 0x01;
152         b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
153
154         color = MAKE_RGB(r,g,b);
164155      }
156
157      /* backgrond pen */
165158      else
166159      {
167         /* background */
168         COLOR(0,i) = BGPEN;
169         COLOR(0,i+256) = SIDEPEN;
160         if (i & 0x100)
161            /* side panel */
162#if 0
163            // values calculated from the resistors don't seem to match the real board
164            color = MAKE_RGB(0x24, 0x5d, 0x4e);
165#endif
166            color = MAKE_RGB(0x20, 0x98, 0x79);
167         else
168            /* 'water' background -- will be modified dynamically later */
169            color = RGB_BLACK;
170170      }
171
172      palette_set_color(machine, i, color);
171173   }
172174
173   color_prom += 2 * 256;
175   color_prom += 0x200;
174176
175177   /* big sprite */
176   for (i = 0;i < 32;i++)
178   for (i = 0; i < 0x20; i++)
177179   {
178      int bit0,bit1,bit2,r,g,b;
180      int bit0, bit1, bit2;
181      int r, g, b;
179182
180
181183      /* red component */
182184      bit0 = (color_prom[i] >> 0) & 0x01;
183185      bit1 = (color_prom[i] >> 1) & 0x01;
184186      bit2 = (color_prom[i] >> 2) & 0x01;
185187      r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
188
186189      /* green component */
187190      bit0 = (color_prom[i] >> 3) & 0x01;
188191      bit1 = (color_prom[i] >> 4) & 0x01;
189192      bit2 = (color_prom[i] >> 5) & 0x01;
190193      g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
194
191195      /* blue component */
192196      bit0 = 0;
193197      bit1 = (color_prom[i] >> 6) & 0x01;
194198      bit2 = (color_prom[i] >> 7) & 0x01;
195199      b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
196200
197      palette_set_color(machine,i+256,MAKE_RGB(r,g,b));
198
199      if (i % 8 == 0) COLOR(2,i) = BGPEN;  /* enforce transparency */
200      else COLOR(2,i) = i+256;
201      palette_set_color(machine, i + 0x200, MAKE_RGB(r, g, b));
201202   }
202
203   /* background */
204   palette_set_color(machine,BGPEN,MAKE_RGB(0,0,0));
205   /* side panel background color */
206#if 0
207   // values calculated from the resistors don't seem to match the real board
208   palette_set_color(machine,SIDEPEN,MAKE_RGB(0x24,0x5d,0x4e));
209#endif
210   palette_set_color(machine,SIDEPEN,MAKE_RGB(0x20,0x98,0x79));
211203}
212204
213205
r1649r1650
228220  bit 0 -- 1  kohm resistor  -- BLUE
229221
230222***************************************************************************/
231WRITE8_HANDLER( swimmer_bgcolor_w )
223
224static void swimmer_set_background_pen(running_machine *machine)
232225{
233   int bit0,bit1,bit2;
234   int r,g,b;
226   int i;
227   pen_t color;
228   int bit0, bit1, bit2;
229   int r, g, b;
235230
236
237231   /* red component */
238232   bit0 = 0;
239   bit1 = (data >> 6) & 0x01;
240   bit2 = (data >> 7) & 0x01;
233   bit1 = (*swimmer_bgcolor >> 6) & 0x01;
234   bit2 = (*swimmer_bgcolor >> 7) & 0x01;
241235   r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
242236
243237   /* green component */
244   bit0 = (data >> 3) & 0x01;
245   bit1 = (data >> 4) & 0x01;
246   bit2 = (data >> 5) & 0x01;
238   bit0 = (*swimmer_bgcolor >> 3) & 0x01;
239   bit1 = (*swimmer_bgcolor >> 4) & 0x01;
240   bit2 = (*swimmer_bgcolor >> 5) & 0x01;
247241   g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
248242
249243   /* blue component */
250   bit0 = (data >> 0) & 0x01;
251   bit1 = (data >> 1) & 0x01;
252   bit2 = (data >> 2) & 0x01;
244   bit0 = (*swimmer_bgcolor >> 0) & 0x01;
245   bit1 = (*swimmer_bgcolor >> 1) & 0x01;
246   bit2 = (*swimmer_bgcolor >> 2) & 0x01;
253247   b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
254248
255   palette_set_color(Machine,BGPEN,MAKE_RGB(r,g,b));
249   color = MAKE_RGB(r, g, b);
250
251   /* set pen 0 if each color code */
252   for (i = 0; i < 0x100; i += 8)
253      palette_set_color(machine, i, color);
256254}
257255
258256
r1649r1650
262260   /* bit 5 of the address is not used for color memory. There is just */
263261   /* 512 bytes of memory; every two consecutive rows share the same memory */
264262   /* region. */
265   offset &= 0xffdf;
266
267263   colorram[offset] = data;
268   colorram[offset + 0x20] = data;
264   colorram[offset ^ 0x20] = data;
269265}
270266
271267
272268
273WRITE8_HANDLER( cclimber_bigsprite_videoram_w )
274{
275   cclimber_bsvideoram[offset] = data;
276}
277
278
279
280WRITE8_HANDLER( swimmer_palettebank_w )
281{
282   palettebank = data & 1;
283}
284
285
286
287WRITE8_HANDLER( swimmer_sidepanel_enable_w )
288{
289   sidepanel_enabled = data & 1;
290}
291
292
293
294269static void cclimber_draw_big_sprite(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
295270{
296271   int offs;
r1649r1650
394369         }
395370      }
396371
397      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect,TRANSPARENCY_NONE,0);
372      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect);
398373   }
399374
400375
r1649r1650
501476         }
502477      }
503478
504      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect,TRANSPARENCY_NONE,0);
479      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect);
505480   }
506481
507482
r1649r1650
552527{
553528   int offs;
554529
530   swimmer_set_background_pen(machine);
531
555532   for (offs = videoram_size - 1;offs >= 0;offs--)
556533   {
557534      int sx,sy,flipx,flipy,color;
r1649r1650
563540      /* vertical flipping flips two adjacent characters */
564541      if (flipy) sy ^= 1;
565542
566      color = (colorram[offs] & 0x0f) + 0x10 * palettebank;
567      if (sx >= 24 && sidepanel_enabled)
543      color = (colorram[offs] & 0x0f) + 0x10 * (*swimmer_palettebank & 0x01);
544      if (sx >= 24 && (*swimmer_sidepanel_enabled & 0x01))
568545      {
569546         color += 32;
570547      }
r1649r1650
605582            scroll[offs] = -cclimber_column_scroll[offs];
606583      }
607584
608      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect,TRANSPARENCY_NONE,0);
585      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect);
609586   }
610587
611588
r1649r1650
638615
639616      drawgfx(bitmap,machine->gfx[1],
640617            (spriteram[offs] & 0x3f) | (spriteram[offs + 1] & 0x10) << 2,
641            (spriteram[offs + 1] & 0x0f) + 0x10 * palettebank,
618            (spriteram[offs + 1] & 0x0f) + 0x10 * (*swimmer_palettebank & 0x01),
642619            flipx,flipy,
643620            sx,sy,
644621            cliprect,TRANSPARENCY_PEN,0);
r1649r1650
670647   }
671648
672649
650   fillbitmap(tmpbitmap, 0, NULL);
651
673652   for (offs = videoram_size - 1;offs >= 0;offs--)
674653   {
675654      int sx,sy,flipx,flipy;
r1649r1650
697676            colorram[offs] & 0x0f,
698677            flipx,flipy,
699678            8*sx,8*sy,
700            0,TRANSPARENCY_NONE,0);
679            NULL,TRANSPARENCY_PEN,0);
701680   }
702681
703682
r1649r1650
723702         }
724703      }
725704
726      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect,TRANSPARENCY_PEN,0);
705      copyscrollbitmap_trans(bitmap,tmpbitmap,0,0,32,scroll,cliprect,0);
727706   }
728707
729708
src/mame/video/cloak.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cloak.h"
910
1011static mame_bitmap *tmpbitmap2;
r1649r1650
225226VIDEO_UPDATE( cloak )
226227{
227228   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
228   copybitmap(bitmap, (bmap ? tmpbitmap2 : tmpbitmap),flip_screen,flip_screen,0,0,cliprect,TRANSPARENCY_COLOR,16);
229   copybitmap_trans(bitmap, (bmap ? tmpbitmap2 : tmpbitmap),flip_screen,flip_screen,0,0,cliprect,machine->pens[16]);
229230   draw_sprites(machine, bitmap, cliprect);
230231   return 0;
231232}
src/mame/video/gticlub.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/sharc/sharc.h"
34#include "machine/konppc.h"
45#include "video/poly.h"
src/mame/video/namcona1.c
r1649r1650
11/*  Namco System NA1/2 Video Hardware */
22
33#include "driver.h"
4#include "deprecat.h"
45#include "namcona1.h"
56
67#define NAMCONA1_NUM_TILEMAPS 4
src/mame/video/foodf.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/atarigen.h"
910#include "foodf.h"
1011#include "video/resnet.h"
src/mame/video/dkong.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "video/resnet.h"
1213#include "includes/dkong.h"
1314
src/mame/video/appoooh.c
r1649r1650
3333PALETTE_INIT( appoooh )
3434{
3535   int i;
36   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
37   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3836
39   for (i = 0;i < machine->drv->total_colors;i++)
37   for (i = 0; i < machine->drv->total_colors; i++)
4038   {
41      int bit0,bit1,bit2,r,g,b;
39      UINT8 pen;
40      int bit0, bit1, bit2, r, g, b;
4241
42      if (i < 0x100)
43         /* charset #1 */
44         pen = (color_prom[0x020 + (i - 0x000)] & 0x0f) | 0x00;
45      else
46         /* charset #2 */
47         pen = (color_prom[0x120 + (i - 0x100)] & 0x0f) | 0x10;
48
4349      /* red component */
44      bit0 = (*color_prom >> 0) & 0x01;
45      bit1 = (*color_prom >> 1) & 0x01;
46      bit2 = (*color_prom >> 2) & 0x01;
50      bit0 = (color_prom[pen] >> 0) & 0x01;
51      bit1 = (color_prom[pen] >> 1) & 0x01;
52      bit2 = (color_prom[pen] >> 2) & 0x01;
4753      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
54
4855      /* green component */
49      bit0 = (*color_prom >> 3) & 0x01;
50      bit1 = (*color_prom >> 4) & 0x01;
51      bit2 = (*color_prom >> 5) & 0x01;
56      bit0 = (color_prom[pen] >> 3) & 0x01;
57      bit1 = (color_prom[pen] >> 4) & 0x01;
58      bit2 = (color_prom[pen] >> 5) & 0x01;
5259      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
60
5361      /* blue component */
5462      bit0 = 0;
55      bit1 = (*color_prom >> 6) & 0x01;
56      bit2 = (*color_prom >> 7) & 0x01;
63      bit1 = (color_prom[pen] >> 6) & 0x01;
64      bit2 = (color_prom[pen] >> 7) & 0x01;
5765      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
5866
59      palette_set_color(machine,i,MAKE_RGB(r,g,b));
60      color_prom++;
67      palette_set_color(machine, i, MAKE_RGB(r, g, b));
6168   }
62
63   /* color_prom now points to the beginning of the lookup table */
64
65   /* charset #1 lookup table */
66   for (i = 0;i < TOTAL_COLORS(0);i++)
67      COLOR(0,i) = (*(color_prom++) & 0x0f)|CHR1_OFST;
68
69   /* charset #2 lookup table */
70   for (i = 0;i < TOTAL_COLORS(1);i++)
71      COLOR(1,i) = (*(color_prom++) & 0x0f)|CHR2_OFST;
72
73   /* TODO: the driver currently uses only 16 of the 32 color codes. */
74   /* 16-31 might be unused, but there might be a palette bank selector */
75   /* to use them somewhere in the game. */
7669}
7770
7871PALETTE_INIT( robowres )
7972{
8073   int i;
81   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
82   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
8374
84   for (i = 0;i < machine->drv->total_colors;i++)
75   for (i = 0; i < machine->drv->total_colors; i++)
8576   {
86      int bit0,bit1,bit2,r,g,b;
77      int bit0, bit1, bit2, r, g, b;
8778
79      UINT8 pen = color_prom[0x020 + i] & 0x0f;
80
8881      /* red component */
89      bit0 = (*color_prom >> 0) & 0x01;
90      bit1 = (*color_prom >> 1) & 0x01;
91      bit2 = (*color_prom >> 2) & 0x01;
82      bit0 = (color_prom[pen] >> 0) & 0x01;
83      bit1 = (color_prom[pen] >> 1) & 0x01;
84      bit2 = (color_prom[pen] >> 2) & 0x01;
9285      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
86
9387      /* green component */
94      bit0 = (*color_prom >> 3) & 0x01;
95      bit1 = (*color_prom >> 4) & 0x01;
96      bit2 = (*color_prom >> 5) & 0x01;
88      bit0 = (color_prom[pen] >> 3) & 0x01;
89      bit1 = (color_prom[pen] >> 4) & 0x01;
90      bit2 = (color_prom[pen] >> 5) & 0x01;
9791      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
92
9893      /* blue component */
9994      bit0 = 0;
100      bit1 = (*color_prom >> 6) & 0x01;
101      bit2 = (*color_prom >> 7) & 0x01;
95      bit1 = (color_prom[pen] >> 6) & 0x01;
96      bit2 = (color_prom[pen] >> 7) & 0x01;
10297      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
10398
104      palette_set_color(machine,i,MAKE_RGB(r,g,b));
105      color_prom++;
99      palette_set_color(machine, i, MAKE_RGB(r, g, b));
106100   }
107
108   /* color_prom now points to the beginning of the lookup table */
109
110   for (i = 0;i < 32*8;i++)
111      colortable[i]=(*(color_prom++) & 0x0f);
112
113101}
114102
115103
src/mame/video/psx.c
r1649r1650
1717
1818***************************************************************************/
1919
20#include <stdarg.h>
2120#include "driver.h"
21#include "deprecat.h"
2222#include "includes/psx.h"
2323
2424#define STOP_ON_ERROR ( 0 )
r1649r1650
511511{
512512   if( m_b_debugmesh )
513513   {
514      copybitmap( bitmap, debugmesh, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0 );
514      copybitmap( bitmap, debugmesh, 0, 0, 0, 0, cliprect );
515515   }
516516   m_b_debugclear = 1;
517517   return m_b_debugmesh;
src/mame/video/beezer.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/m6809/m6809.h"
34#include "machine/6522via.h"
45
src/mame/video/vdc.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/vdc.h"
34
45/* VDC segments */
r1649r1650
372373VIDEO_UPDATE( pce )
373374{
374375   /* copy our rendering buffer to the display */
375   copybitmap (bitmap,vce.bmp,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
376   copybitmap (bitmap,vce.bmp,0,0,0,0,cliprect);
376377   return 0;
377378}
378379
src/mame/video/kaneko16.c
r1649r1650
391391}
392392
393393// custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities
394static void kaneko16_draw_sprites_custom(mame_bitmap *dest_bmp,const gfx_element *gfx,
394static void kaneko16_draw_sprites_custom(running_machine *machine, mame_bitmap *dest_bmp,const gfx_element *gfx,
395395      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
396396      const rectangle *clip,int priority)
397397{
398   const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
398   const pen_t *pal = &machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
399399   UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
400400
401401   int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16;
r1649r1650
594594
595595      UINT32 primask = kaneko16_priority.sprite[curr_pri];
596596
597      kaneko16_draw_sprites_custom(   bitmap,machine->gfx[0],
597      kaneko16_draw_sprites_custom(   machine,
598                              bitmap,machine->gfx[0],
598599                              s->code,
599600                              s->color,
600601                              s->flipx, s->flipy,
r1649r1650
904905   {
905906      /* keep sprites on screen */
906907      kaneko16_draw_sprites(machine,sprites_bitmap,cliprect);
907      copybitmap(bitmap,sprites_bitmap,0,0,0,0,cliprect,TRANSPARENCY_PEN,0);
908      copybitmap_trans(bitmap,sprites_bitmap,0,0,0,0,cliprect,0);
908909   }
909910   else
910911   {
r1649r1650
927928      sx      =   (select & 0x1f) * 256;
928929      sy      =   0;
929930
930      copybitmap(
931         bitmap, kaneko16_bg15_bitmap,
932         flip, flip,
933         -sx, -sy,
934         cliprect, TRANSPARENCY_NONE,0 );
931      copybitmap(bitmap, kaneko16_bg15_bitmap, flip, flip, -sx, -sy, cliprect);
935932
936933//      flag = 0;
937934   }
src/mame/video/goldstar.c
r1649r1650
7777            0,TRANSPARENCY_NONE,0);
7878   }
7979
80   copybitmap(bitmap,tmpbitmap4,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
80   copybitmap(bitmap,tmpbitmap4,0,0,0,0,cliprect);
8181
8282
8383   for (offs = goldstar_video_size - 1;offs >= 0;offs--)
r1649r1650
114114      for (i= 0;i < 64;i++)
115115         scrolly[i] = -goldstar_scroll1[i];
116116
117      copyscrollbitmap(bitmap,tmpbitmap1,0,0,64,scrolly,&visible1,TRANSPARENCY_NONE,0);
118      copybitmap(bitmap,tmpbitmap4,0,0,0,0,&visible1,TRANSPARENCY_PEN,0);
117      copyscrollbitmap(bitmap,tmpbitmap1,0,0,64,scrolly,&visible1);
118      copybitmap_trans(bitmap,tmpbitmap4,0,0,0,0,&visible1,0);
119119
120120      for (i= 0;i < 64;i++)
121121         scrolly[i] = -goldstar_scroll2[i];
122122
123      copyscrollbitmap(bitmap,tmpbitmap2,0,0,64,scrolly,&visible2,TRANSPARENCY_NONE,0);
124      copybitmap(bitmap,tmpbitmap4,0,0,0,0,&visible2,TRANSPARENCY_PEN,0);
123      copyscrollbitmap(bitmap,tmpbitmap2,0,0,64,scrolly,&visible2);
124      copybitmap_trans(bitmap,tmpbitmap4,0,0,0,0,&visible2,0);
125125
126126      for (i= 0;i < 64;i++)
127127         scrolly[i] = -goldstar_scroll3[i];
128128
129      copyscrollbitmap(bitmap,tmpbitmap3,0,0,64,scrolly,&visible3,TRANSPARENCY_NONE,0);
130      copybitmap(bitmap,tmpbitmap4,0,0,0,0,&visible3,TRANSPARENCY_PEN,0);
129      copyscrollbitmap(bitmap,tmpbitmap3,0,0,64,scrolly,&visible3);
130      copybitmap_trans(bitmap,tmpbitmap4,0,0,0,0,&visible3,0);
131131   }
132132   return 0;
133133}
src/mame/video/ms32.c
r1649r1650
1313
1414
1515#include "driver.h"
16#include "deprecat.h"
1617
1718//UINT32 *ms32_fce00000;
1819UINT32 *ms32_roz_ctrl;
src/mame/video/darkseal.c
r1649r1650
8686***************************************************************************/
8787
8888#include "driver.h"
89#include "deprecat.h"
8990
9091UINT16 *darkseal_pf12_row,*darkseal_pf34_row;
9192UINT16 *darkseal_pf1_data,*darkseal_pf2_data,*darkseal_pf3_data;
src/mame/video/20pacgal.c
r1649r1650
1/***************************************************************************
2
3    Ms.Pac-Man/Galaga - 20 Year Reunion hardware
4
5    driver by Nicola Salmoria
6
7***************************************************************************/
8
19#include "driver.h"
10#include "20pacgal.h"
211
312
13#define SCREEN_HEIGHT   (224)
14#define SCREEN_WIDTH   (288)
15#define NUM_PENS      (0x1000)
416
5UINT8 *pacgal_charram,*pacgal_sprram;
6UINT8 *pacgal_videoram,*pacgal_videoram2;
717
8static mame_bitmap *chr_bitmap;
9static int palbank;
10static int active_game;
1118
19/*************************************
20 *
21 *  Palette handling
22 *
23 *************************************/
1224
13
14static void switch_palette(running_machine *machine)
25static void get_pens(const _20pacgal_state *state, pen_t *pens)
1526{
16   int i;
17   UINT8 *color_prom = memory_region(REGION_PROMS) + 0x1000 * palbank;
27   offs_t offs;
28   UINT8 *color_prom = memory_region(REGION_PROMS) + (NUM_PENS * state->game_selected);
1829
19   for (i = 0;i < machine->drv->total_colors;i++)
30   for (offs = 0; offs < NUM_PENS ;offs++)
2031   {
2132      int bit0,bit1,bit2,r,g,b;
2233
23
2434      /* red component */
2535      bit0 = (*color_prom >> 0) & 0x01;
2636      bit1 = (*color_prom >> 1) & 0x01;
2737      bit2 = (*color_prom >> 2) & 0x01;
2838      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
39
2940      /* green component */
3041      bit0 = (*color_prom >> 3) & 0x01;
3142      bit1 = (*color_prom >> 4) & 0x01;
3243      bit2 = (*color_prom >> 5) & 0x01;
3344      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
45
3446      /* blue component */
3547      bit0 = 0;
3648      bit1 = (*color_prom >> 6) & 0x01;
3749      bit2 = (*color_prom >> 7) & 0x01;
3850      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
3951
40      palette_set_color(machine,i,MAKE_RGB(r,g,b));
52      pens[offs] = MAKE_RGB(r, g, b);
53
4154      color_prom++;
4255   }
4356}
4457
45PALETTE_INIT( 20pacgal )
58
59 static void do_pen_lookup(const _20pacgal_state *state, mame_bitmap *bitmap, const rectangle *cliprect)
4660{
47   palbank = 0;
48   switch_palette(machine);
49}
61   int y, x;
62   pen_t pens[NUM_PENS];
5063
64   get_pens(state, pens);
5165
52
53VIDEO_START( 20pacgal )
54{
55   chr_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
66   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
67      for(x = cliprect->min_x; x <= cliprect->max_x; x++)
68         *BITMAP_ADDR32(bitmap, y, x) = pens[*BITMAP_ADDR32(bitmap, y, x)];
5669}
5770
5871
5972
60WRITE8_HANDLER( pacgal_lookup_w )
61{
62   /* palette hacks! */
63   ((UINT16 *)Machine->game_colortable)[offset] = data & 0x0f;
64   ((pen_t *)Machine->remapped_colortable)[offset] = Machine->pens[data & 0x0f];
65}
73/*************************************
74 *
75 *  Sprite drawing
76 *
77 *************************************/
6678
67WRITE8_HANDLER( pacgal_active_game_w )
79static void draw_sprite(const _20pacgal_state *state, mame_bitmap *bitmap, int y, int x,
80                  UINT8 code, UINT8 color, int flip_y, int flip_x)
6881{
69   active_game = data & 1;
82   int sy;
7083
71   if (!active_game)
72      memcpy(pacgal_videoram2,memory_region(REGION_CPU1)+0x8000,0x2000);
84   offs_t pen_base = (color & 0x3f) << 2;
7385
74   if (palbank != active_game)
86   if (flip_y)
87      y = y + 0x0f;
88
89   if (flip_x)
90      x = x + 0x0f;
91
92   /* for each row in the sprite */
93   for (sy = 0; sy < 0x10; sy++)
7594   {
76      palbank = active_game;
77      switch_palette(Machine);
78   }
79}
95      int x_sav = x;
8096
81WRITE8_HANDLER( pacgal_videoram2_w )
82{
83   if (active_game)
84      pacgal_videoram2[offset] = data;
85}
97      if ((y >= 0) && (y < SCREEN_HEIGHT))
98      {
99         int sx;
100         UINT32 data;
86101
87WRITE8_HANDLER( pacgal_charram_w )
88{
89   pacgal_charram[offset] = data;
102         offs_t gfx_offs = ((code & 0x7f) << 6) | (sy << 2);
90103
91   decodechar(Machine->gfx[0],offset/16,pacgal_charram);
92}
104         /* address mangling */
105         gfx_offs = (gfx_offs & 0x1f83) | ((gfx_offs & 0x003c) << 1) | ((gfx_offs & 0x0040) >> 4);
93106
94WRITE8_HANDLER( pacgal_sprram_w )
95{
96   offset = (offset & 0x1f83) | ((offset & 0x078) >> 1) | ((offset & 0x004) << 4);
97   pacgal_sprram[offset] = data;
107         data = (state->sprite_gfx_ram[gfx_offs + 0] << 24) |
108               (state->sprite_gfx_ram[gfx_offs + 1] << 16) |
109               (state->sprite_gfx_ram[gfx_offs + 2] << 8) |
110               (state->sprite_gfx_ram[gfx_offs + 3] << 0);
98111
99   decodechar(Machine->gfx[1],offset/64,pacgal_sprram);
112         /* for each pixel in the row */
113         for (sx = 0; sx < 0x10; sx++)
114         {
115            if ((x >= 0) && (x < SCREEN_WIDTH))
116            {
117               offs_t pen = (data & 0xc0000000) >> 30;
118               UINT8 col;
119
120               col = state->sprite_color_lookup[pen_base | pen] & 0x0f;
121
122               /* pen bits A0-A3 */
123               if (col)
124                  *BITMAP_ADDR32(bitmap, y, x) = (*BITMAP_ADDR32(bitmap, y, x) & 0xff0) | col;
125            }
126
127            /* next pixel */
128            if (flip_x)
129               x = x - 1;
130            else
131               x = x + 1;
132
133            data = data << 2;
134         }
135      }
136
137      /* next row */
138      if (flip_y)
139         y = y - 1;
140      else
141         y = y + 1;
142
143      x = x_sav;
144   }
100145}
101146
102147
103
104static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
148static void draw_sprites(const _20pacgal_state *state, mame_bitmap *bitmap)
105149{
106150   int offs;
107151
108
109   for (offs = 0x80-2;offs >= 0;offs-=2)
152   for (offs = 0x80 - 2; offs >= 0; offs -= 2)
110153   {
111      static const int gfx_offs[2][2] =
154      static const int code_offs[2][2] =
112155      {
113156         { 0, 1 },
114157         { 2, 3 }
115158      };
116      int sprite = spriteram[offs + 0x000] & 0x7f;
117      int color = spriteram[offs + 0x001] & 0x3f;
118      int sx = spriteram[offs + 0x081] - 41 + 0x100*(spriteram[offs + 0x101] & 3);
119      int sy = 256 - spriteram[offs + 0x080] + 1;
120      int flipx = (spriteram[offs + 0x100] & 0x01);
121      int flipy = (spriteram[offs + 0x100] & 0x02) >> 1;
122      int sizex = (spriteram[offs + 0x100] & 0x04) >> 2;
123      int sizey = (spriteram[offs + 0x100] & 0x08) >> 3;
124      int x,y;
159      int x, y;
125160
126      if (flip_screen)
127      {
128         flipx ^= 1;
129         flipy ^= 1;
130      }
161      UINT8 code = state->sprite_ram[offs + 0x000];
162      UINT8 color = state->sprite_ram[offs + 0x001];
131163
132      sy -= 16 * sizey;
133      sy = (sy & 0xff) - 32;   // fix wraparound
164      int sx = state->sprite_ram[offs + 0x081] - 41 + 0x100*(state->sprite_ram[offs + 0x101] & 3);
165      int sy = 256 - state->sprite_ram[offs + 0x080] + 1;
134166
135      for (y = 0;y <= sizey;y++)
167      int flip_x = (state->sprite_ram[offs + 0x100] & 0x01) >> 0;
168      int flip_y = (state->sprite_ram[offs + 0x100] & 0x02) >> 1;
169      int size_x = (state->sprite_ram[offs + 0x100] & 0x04) >> 2;
170      int size_y = (state->sprite_ram[offs + 0x100] & 0x08) >> 3;
171
172      sy = sy - (16 * size_y);
173      sy = (sy & 0xff) - 32;   /* fix wraparound */
174
175      /* only Galaga appears to be effected by the global flip state */
176      if (state->game_selected && (state->flip_screen[0] & 0x01))
136177      {
137         for (x = 0;x <= sizex;x++)
138         {
139            drawgfx(bitmap,machine->gfx[1],
140               sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
141               color,
142               flipx,flipy,
143               sx + 16*x, sy + 16*y,
144               cliprect,TRANSPARENCY_COLOR,0);
145         }
178         flip_x = !flip_x;
179         flip_y = !flip_y;
146180      }
181
182      for (y = 0; y <= size_y; y++)
183         for (x = 0; x <= size_x; x++)
184            draw_sprite(state, bitmap,
185                     sy + (16 * y), sx + (16 * x),
186                     code + code_offs[y ^ (size_y * flip_y)][x ^ (size_x * flip_x)],
187                     color,
188                     flip_y, flip_x);
147189   }
148190}
149191
150VIDEO_UPDATE( 20pacgal )
192
193
194/*************************************
195 *
196 *  Character map drawing
197 *
198 *************************************/
199
200static void draw_chars(const _20pacgal_state *state, mame_bitmap *bitmap)
151201{
152   int x,y;
202   offs_t offs;
153203
154   for (y = 0;y < 32;y++)
204   int flip = state->flip_screen[0] & 0x01;
205
206   /* for each byte in the video RAM */
207   for (offs = 0; offs < 0x400; offs++)
155208   {
156      for (x = 0;x < 32;x++)
209      int sy;
210      int y, x;
211
212      UINT8 *gfx = &state->char_gfx_ram[state->video_ram[0x0000 | offs] << 4];
213      UINT32 color_base = (state->video_ram[0x0400 | offs] & 0x3f) << 2;
214
215      /* map the offset to (x, y) character coordinates */
216      if ((offs & 0x03c0) == 0)
157217      {
158         int sx,sy;
159         if (y < 2)
218         y = (offs & 0x1f) - 2;
219         x = (offs >> 5) + 34;
220      }
221      else if ((offs & 0x03c0) == 0x3c0)
222      {
223         y = (offs & 0x1f) - 2;
224         x = (offs >> 5) - 30;
225      }
226      else
227      {
228         y = (offs >> 5) - 2;
229         x = (offs & 0x1f) + 2;
230      }
231
232      if ((y < 0) || (y > 27)) continue;
233
234      /* conver to pixel coordinates */
235      y = y << 3;
236      x = x << 3;
237
238      if (flip)
239      {
240         y = SCREEN_HEIGHT - 1 - y;
241         x = SCREEN_WIDTH - 1 - x;
242      }
243
244      /* for each row in the character */
245      for (sy = 0; sy < 8; sy++)
246      {
247         int sx;
248         int x_sav = x;
249
250         UINT16 data = (gfx[8] << 8) | gfx[0];
251
252         /* for each pixel in the row */
253         for (sx = 0; sx < 8; sx++)
160254         {
161            sy = x-2;
162            sx = 34+y;
255            UINT32 col = ((data & 0x8000) >> 14) | ((data & 0x0800) >> 11);
256
257            /* pen bits A4-A11 */
258            *BITMAP_ADDR32(bitmap, y, x) = (color_base | col) << 4;
259
260            /* next pixel */
261            if (flip)
262               x = x - 1;
263            else
264               x = x + 1;
265
266            if (sx == 0x03)
267               data = data << 5;
268            else
269               data = data << 1;
163270         }
164         else if (y >= 30)
165         {
166            sy = x-2;
167            sx = y-30;
168         }
271
272         /* next row */
273         if (flip)
274            y = y - 1;
169275         else
170         {
171            sy = y-2;
172            sx = x+2;
173         }
276            y = y + 1;
174277
175         if (active_game)
176         {
177            drawgfx(chr_bitmap,machine->gfx[0],
178                  pacgal_videoram2[y*32 + x] + 0xa00,
179                  (pacgal_videoram2[0x400 + y*32 + x] & 0x3f) * 4,
180                  0,0,
181                  8*sx,8*sy,
182                  cliprect,TRANSPARENCY_NONE_RAW,0);
183         }
184         else
185         {
186            drawgfx(chr_bitmap,machine->gfx[0],
187                  pacgal_videoram[y*32 + x] + 0xa00,
188                  (pacgal_videoram[0x400 + y*32 + x] & 0x3f) * 4,
189                  0,0,
190                  8*sx,8*sy,
191                  cliprect,TRANSPARENCY_NONE_RAW,0);
192         }
278         x = x_sav;
279
280         gfx = gfx + 1;
193281      }
194282   }
283}
195284
196   fillbitmap(bitmap,0,NULL);
197285
198   draw_sprites(machine,bitmap,cliprect);
199286
200   copybitmap(bitmap, chr_bitmap, flip_screen, flip_screen, 0, 0, cliprect, TRANSPARENCY_BLEND_RAW, 4);
287/*************************************
288 *
289 *  Video update
290 *
291 *************************************/
201292
293static VIDEO_UPDATE( 20pacgal )
294{
295   const _20pacgal_state *state = machine->driver_data;
296
297   draw_chars(state, bitmap);
298   draw_sprites(state, bitmap);
299   do_pen_lookup(state, bitmap, cliprect);
300
202301   return 0;
203302}
303
304
305
306/*************************************
307 *
308 *  Machine driver
309 *
310 *************************************/
311
312MACHINE_DRIVER_START( 20pacgal_video )
313
314   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
315   MDRV_VIDEO_UPDATE(20pacgal)
316
317   MDRV_SCREEN_REFRESH_RATE(60)
318   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
319   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
320   MDRV_SCREEN_SIZE(SCREEN_WIDTH, SCREEN_HEIGHT)
321   MDRV_SCREEN_VISIBLE_AREA(0, SCREEN_WIDTH - 1, 0, SCREEN_HEIGHT - 1)
322MACHINE_DRIVER_END
src/mame/video/system16.c
r1649r1650
8989
9090***************************************************************************/
9191#include "driver.h"
92#include "deprecat.h"
9293#include "system16.h"
9394#include "video/resnet.h"
9495
src/mame/video/deniam.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34
45UINT16 *deniam_videoram,*deniam_textram;
src/mame/video/mcr3.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "mcr.h"
910
1011
src/mame/video/stadhero.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314
1415UINT16 *stadhero_pf1_data;
1516static UINT16 *stadhero_pf2_data;
src/mame/video/model1.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/segaic24.h"
3#include <math.h>
44
55#define LOG_TGP_VIDEO 0
66
src/mame/video/actfancr.c
r1649r1650
55*******************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910
1011static UINT8 actfancr_control_1[0x20],actfancr_control_2[0x20];
src/mame/video/taito_b.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "profiler.h"
34
45UINT16 *taitob_scroll;
r1649r1650
611612    int scrolly = -pixel_scroll[1]; //+240;
612613    /* bit 15 of pixel_scroll[0] is probably flip screen */
613614
614    copyscrollbitmap(bitmap,pixel_bitmap,1,&scrollx,1,&scrolly,cliprect,TRANSPARENCY_COLOR,b_fg_color_base * 16);
615    copyscrollbitmap_trans(bitmap,pixel_bitmap,1,&scrollx,1,&scrolly,cliprect,machine->pens[b_fg_color_base * 16]);
615616  }
616617
617618  draw_framebuffer(machine, bitmap,cliprect,0);
src/mame/video/tank8.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "includes/tank8.h"
910
1011
src/mame/video/taitoic.c
r1649r1650
533533***************************************************************************/
534534
535535#include "driver.h"
536#include "deprecat.h"
536537#include "taitoic.h"
537538
538539#define TOPSPEED_ROAD_COLORS
src/mame/video/suna8.c
r1649r1650
7070***************************************************************************/
7171
7272#include "driver.h"
73#include "deprecat.h"
7374
7475#define TILEMAPS 0
7576
src/mame/video/vaportra.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "deco16ic.h"
1415
1516static UINT16 vaportra_priority[2];
src/mame/video/btime.c
r1649r1650
584584        scroll = (bnj_scroll1 & 0x02) * 128 + 511 - bnj_scroll2;
585585        if (!flip_screen)
586586            scroll = 767-scroll;
587        copyscrollbitmap (bitmap, background_bitmap, 1, &scroll, 0, 0, cliprect,TRANSPARENCY_NONE, 0);
587        copyscrollbitmap (bitmap, background_bitmap, 1, &scroll, 0, 0, cliprect);
588588
589589        /* copy the low priority characters followed by the sprites
590590           then the high priority characters */
src/mame/video/cps1.c
r1649r1650
177177***************************************************************************/
178178
179179#include "driver.h"
180#include "deprecat.h"
180181#include "cps1.h"
181182
182183#define VERBOSE 0
src/mame/video/stactics.c
r1649r1650
531531                    color_code,
532532                    0,0,
533533                    sx*8,sy*8,
534                    &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
534                    cliprect,TRANSPARENCY_NONE,0);
535535            dirty_videoram_d[offs] = 0;
536536        }
537537
r1649r1650
559559                    color_code,
560560                    0,0,
561561                    sx*8,sy*8,
562                    &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
562                    cliprect,TRANSPARENCY_NONE,0);
563563            dirty_videoram_e[offs] = 0;
564564        }
565565
r1649r1650
587587                    color_code,
588588                    0,0,
589589                    sx*8,sy*8,
590                    &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
590                    cliprect,TRANSPARENCY_NONE,0);
591591            dirty_videoram_f[offs] = 0;
592592        }
593593
r1649r1650
615615                    color_code,
616616                    0,0,
617617                    sx*8,sy*8,
618                    &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
618                    cliprect,TRANSPARENCY_NONE,0);
619619            dirty_videoram_b[offs] = 0;
620620        }
621621
r1649r1650
623623
624624    /* Now, composite the four layers together */
625625
626    copyscrollbitmap(tmpbitmap2,bitmap_D,0,0,1,&d_offset,
627                     &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
628    copyscrollbitmap(tmpbitmap2,bitmap_E,0,0,1,&e_offset,
629                     &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
630    copyscrollbitmap(tmpbitmap2,bitmap_F,0,0,1,&f_offset,
631                     &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
632    copybitmap(tmpbitmap2,bitmap_B,0,0,0,0,
633                     &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
626    copyscrollbitmap      (tmpbitmap2,bitmap_D,0,0,1,&d_offset,NULL);
627    copyscrollbitmap_trans(tmpbitmap2,bitmap_E,0,0,1,&e_offset,NULL,machine->pens[0]);
628    copyscrollbitmap_trans(tmpbitmap2,bitmap_F,0,0,1,&f_offset,NULL,machine->pens[0]);
629    copybitmap_trans      (tmpbitmap2,bitmap_B,0,0,0,0,NULL,machine->pens[0]);
634630
635631    /* Now flip X & simulate the monitor motion */
636    fillbitmap(bitmap, machine->pens[0], &machine->screen[0].visarea);
637    copybitmap(bitmap,tmpbitmap2,1,0,stactics_horiz_pos,stactics_vert_pos,
638                &visible_screen_area,TRANSPARENCY_NONE,0);
632    fillbitmap(bitmap, machine->pens[0], cliprect);
633    copybitmap(bitmap,tmpbitmap2,1,0,stactics_horiz_pos,stactics_vert_pos,&visible_screen_area);
639634
640635    /* Finally, draw stuff that is on the console or on top of the monitor (LED's) */
641636
r1649r1650
650645            0,
651646            0,0,
652647            pixel_x,pixel_y,
653            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
648            cliprect,TRANSPARENCY_NONE,0);
654649    pixel_x+=6;
655650    /* Draw a colon */
656651    drawgfx(bitmap,machine->gfx[5],
r1649r1650
658653            0,
659654            0,0,
660655            pixel_x,pixel_y,
661            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
656            cliprect,TRANSPARENCY_NONE,0);
662657    pixel_x+=6;
663658    /* Draw the digits */
664659    for(i=1;i<7;i++)
r1649r1650
668663                16,
669664                0,0,
670665                pixel_x,pixel_y,
671                &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
666                cliprect,TRANSPARENCY_NONE,0);
672667        pixel_x+=6;
673668    }
674669
r1649r1650
682677            0,
683678            0,0,
684679            pixel_x,pixel_y,
685            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
680            cliprect,TRANSPARENCY_NONE,0);
686681    pixel_x+=6;
687682    /* Draw a colon */
688683    drawgfx(bitmap,machine->gfx[5],
r1649r1650
690685            0,
691686            0,0,
692687            pixel_x,pixel_y,
693            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
688            cliprect,TRANSPARENCY_NONE,0);
694689    pixel_x+=6;
695690    /* Draw the pips */
696691    for(i=7;i<9;i++)
r1649r1650
700695                16,
701696                0,0,
702697                pixel_x,pixel_y,
703                &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
698                cliprect,TRANSPARENCY_NONE,0);
704699        pixel_x+=2;
705700    }
706701
r1649r1650
714709            0,
715710            0,0,
716711            pixel_x,pixel_y,
717            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
712            cliprect,TRANSPARENCY_NONE,0);
718713    pixel_x+=6;
719714    /* Draw a colon */
720715    drawgfx(bitmap,machine->gfx[5],
r1649r1650
722717            0,
723718            0,0,
724719            pixel_x,pixel_y,
725            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
720            cliprect,TRANSPARENCY_NONE,0);
726721    pixel_x+=6;
727722    /* Draw the pips */
728723    for(i=9;i<12;i++)
r1649r1650
732727                16,
733728                0,0,
734729                pixel_x,pixel_y,
735                &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
730                cliprect,TRANSPARENCY_NONE,0);
736731        pixel_x+=2;
737732    }
738733
r1649r1650
745740            0,
746741            0,0,
747742            pixel_x,pixel_y,
748            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
743            cliprect,TRANSPARENCY_NONE,0);
749744    pixel_x+=6;
750745    /* Draw a colon */
751746    drawgfx(bitmap,machine->gfx[5],
r1649r1650
753748            0,
754749            0,0,
755750            pixel_x,pixel_y,
756            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
751            cliprect,TRANSPARENCY_NONE,0);
757752    pixel_x+=6;
758753    /* Draw the pips */
759754    for(i=12;i<16;i++)
r1649r1650
763758                16,
764759                0,0,
765760                pixel_x,pixel_y,
766                &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
761                cliprect,TRANSPARENCY_NONE,0);
767762        pixel_x+=2;
768763    }
769764
r1649r1650
810805                    16*2,  /* Make it green */
811806                    0,0,
812807                    pixel_x,pixel_y,
813                    &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
808                    cliprect,TRANSPARENCY_COLOR,0);
814809            drawgfx(bitmap,machine->gfx[4],
815810                    beamdata[firebeam_state*8+i]&0x7f,
816811                    16*2,  /* Make it green */
817812                    1,0,
818813                    255-pixel_x,pixel_y,
819                    &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
814                    cliprect,TRANSPARENCY_COLOR,0);
820815            pixel_x+=14;
821816            pixel_y-=7;
822817        }
r1649r1650
828823                    16*2,  /* Make it green */
829824                    0,0,
830825                    pixel_x,pixel_y,
831                    &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
826                    cliprect,TRANSPARENCY_COLOR,0);
832827            drawgfx(bitmap,machine->gfx[4],
833828                    beamdata[firebeam_state*8+i],
834829                    16*2,  /* Make it green */
835830                    1,0,
836831                    255-pixel_x,pixel_y,
837                    &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
832                    cliprect,TRANSPARENCY_COLOR,0);
838833            pixel_x+=16;
839834            pixel_y-=8;
840835        }
r1649r1650
853848                16, /* red */
854849                0,0,
855850                pixel_x,pixel_y,
856                &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
851                cliprect,TRANSPARENCY_COLOR,0);
857852    }
858853
859854    /* Update vblank counter */
src/mame/video/gaelco3d.c
r1649r1650
77**************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "eminline.h"
1112#include "gaelco3d.h"
1213#include "cpu/tms32031/tms32031.h"
r1649r1650
489490   else
490491   {
491492      if (video_changed)
492         copybitmap(bitmap, screenbits, 0,1, 0,0, cliprect, TRANSPARENCY_NONE, 0);
493         copybitmap(bitmap, screenbits, 0,1, 0,0, cliprect);
493494      ret = video_changed;
494495      video_changed = FALSE;
495496   }
src/mame/video/lethalj.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/tms34010/tms34010.h"
910#include "lethalj.h"
1011
src/mame/video/itech8.c
r1649r1650
8888***************************************************************************/
8989
9090#include "driver.h"
91#include "deprecat.h"
9192#include "video/tms34061.h"
9293#include "video/tlc34076.h"
9394#include "cpu/m6809/m6809.h"
src/mame/video/galaxian.c
r1649r1650
17101710      clip.max_x = dambustr_bg_split_line;
17111711      clip.min_y = 0;
17121712      clip.max_y = 255;
1713      copybitmap(bitmap, dambustr_tmpbitmap, 0, 0, 0, 0, &clip, TRANSPARENCY_NONE, 0);
1713      copybitmap(bitmap, dambustr_tmpbitmap, 0, 0, 0, 0, &clip);
17141714   }
17151715   else
17161716   {
r1649r1650
17181718      clip.max_x = 254 - dambustr_bg_split_line;
17191719      clip.min_y = 0;
17201720      clip.max_y = 255;
1721      copybitmap(bitmap, dambustr_tmpbitmap, 0, 0, 0, 0, &clip, TRANSPARENCY_NONE, 0);
1721      copybitmap(bitmap, dambustr_tmpbitmap, 0, 0, 0, 0, &clip);
17221722   }
17231723}
17241724
r1649r1650
22142214   }
22152215
22162216   /* save the background for drawing it again later, if background has priority over characters */
2217   copybitmap(dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
2217   copybitmap(dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, &machine->screen[0].visarea);
22182218
22192219   tilemap_draw(bitmap, 0, bg_tilemap, 0, 0);
22202220
src/mame/video/snk.c
r1649r1650
105105
106106      drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
107107   }
108   copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect,TRANSPARENCY_NONE,0);
108   copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect);
109109}
110110
111111void tnk3_draw_text(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int bank, UINT8 *source )
r1649r1650
262262
263263      drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
264264   }
265   copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect,TRANSPARENCY_NONE,0);
265   copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect);
266266}
267267
268268VIDEO_UPDATE( sgladiat )
r1649r1650
386386      else
387387         drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
388388   }
389   copyscrollbitmap(bitmap,tmpbitmap,1,&xscroll,1,&yscroll,cliprect,TRANSPARENCY_NONE,0);
389   copyscrollbitmap(bitmap,tmpbitmap,1,&xscroll,1,&yscroll,cliprect);
390390}
391391
392392/*
src/mame/video/hyprduel.c
r1649r1650
5555***************************************************************************/
5656
5757#include "driver.h"
58#include "deprecat.h"
5859
5960#define RASTER_LINES 262
6061#define FIRST_VISIBLE_LINE 0
src/mame/video/cosmic.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112
1213static pen_t (*map_color)(UINT8 x, UINT8 y);
r1649r1650
2526
2627static pen_t panic_map_color(UINT8 x, UINT8 y)
2728{
28   offs_t offs;
29   pen_t pen;
29   offs_t offs = (color_registers[0] << 9) | (color_registers[2] << 10) | ((x >> 4) << 5) | (y >> 3);
30   pen_t pen = memory_region(REGION_USER1)[offs];
3031
31
32   offs = (color_registers[0] << 9) | (color_registers[2] << 10) | ((x >> 4) << 5) | (y >> 3);
33   pen = memory_region(REGION_USER1)[offs];
34
3532   if (color_registers[1])
3633      pen >>= 4;
3734
r1649r1650
4037
4138static pen_t cosmica_map_color(UINT8 x, UINT8 y)
4239{
43   offs_t offs;
44   pen_t pen;
40   offs_t offs = (color_registers[0] << 9) | ((x >> 4) << 5) | (y >> 3);
41   pen_t pen = memory_region(REGION_USER1)[offs];
4542
46
47   offs = (color_registers[0] << 9) | ((x >> 4) << 5) | (y >> 3);
48   pen = memory_region(REGION_USER1)[offs];
49
5043   if (color_registers[0])      /* yes, 0 again according to the schematics */
5144      pen >>= 4;
5245
r1649r1650
5548
5649static pen_t cosmicg_map_color(UINT8 x, UINT8 y)
5750{
58   offs_t offs;
59   pen_t pen;
51   offs_t offs = (color_registers[0] << 8) | (color_registers[1] << 9) | ((y >> 4) << 4) | (x >> 4);
52   pen_t pen = memory_region(REGION_USER1)[offs];
6053
61
62   offs = (color_registers[0] << 8) | (color_registers[1] << 9) | ((y >> 4) << 4) | (x >> 4);
63   pen = memory_region(REGION_USER1)[offs];
64
6554   /* the upper 4 bits are for cocktail mode support */
6655
6756   return pen & 0x0f;
6857}
6958
70static pen_t magspot2_map_color(UINT8 x, UINT8 y)
59static pen_t magspot_map_color(UINT8 x, UINT8 y)
7160{
72   offs_t offs;
73   pen_t pen;
61   offs_t offs = (color_registers[0] << 9) | ((x >> 3) << 4) | (y >> 4);
62   pen_t pen = memory_region(REGION_USER1)[offs];
7463
75
76   offs = (color_registers[0] << 9) | ((x >> 3) << 4) | (y >> 4);
77   pen = memory_region(REGION_USER1)[offs];
78
7964   if (color_registers[1])
8065      pen >>= 4;
8166
r1649r1650
9883PALETTE_INIT( panic )
9984{
10085   int i;
101   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
102   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
10386
104   for (i = 0;i < machine->drv->total_colors;i++)
87   /* allocate the colortable */
88   machine->colortable = colortable_alloc(machine, 0x10);
89
90   /* create a lookup table for the palette */
91   for (i = 0; i < 0x10; i++)
10592   {
106      int r = 0xff * ((i >> 0) & 1);
107      int g = 0xff * ((i >> 1) & 1);
108      int b;
109      if ((i & 0x0c) == 0x08)
110         b = 0xaa;
111      else
112         b = 0xff * ((i >> 2) & 1);
113      palette_set_color(machine,i,MAKE_RGB(r,g,b));
93      int r = pal1bit(i >> 0);
94      int g = pal1bit(i >> 1);
95      int b = ((i & 0x0c) == 0x08) ? 0xaa : pal1bit(i >> 2);
96
97      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
11498   }
11599
100   /* background uses colors 0x00-0x0f */
101   for (i = 0; i < 0x0f; i++)
102      colortable_entry_set_value(machine->colortable, i, i);
116103
117   for (i = 0;i < TOTAL_COLORS(0);i++)
118      COLOR(0,i) = *(color_prom++) & 0x07;
104   /* sprites use colors 0x00-0x07 */
105   for (i = 0x10; i < 0x30; i++)
106   {
107      UINT8 ctabentry = color_prom[i - 0x10] & 0x07;
108      colortable_entry_set_value(machine->colortable, i, ctabentry);
109   }
119110
120
121111    map_color = panic_map_color;
122112}
123113
r1649r1650
135125{
136126   int i;
137127
138   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
139   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
128   /* allocate the colortable */
129   machine->colortable = colortable_alloc(machine, 0x08);
140130
141   for (i = 0;i < machine->drv->total_colors;i++)
142      palette_set_color_rgb(machine,i,pal1bit(i >> 0),pal1bit(i >> 1),pal1bit(i >> 2));
131   /* create a lookup table for the palette */
132   for (i = 0; i < 0x08; i++)
133   {
134      rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
135      colortable_palette_set_color(machine->colortable, i, color);
136   }
143137
138   /* background and sprites use colors 0x00-0x07 */
139   for (i = 0; i < 0x08; i++)
140      colortable_entry_set_value(machine->colortable, i, i);
144141
145   for (i = 0;i < TOTAL_COLORS(0)/2;i++)
142   for (i = 0x08; i < 0x28; i++)
146143   {
147      COLOR(0,i)                     =  * color_prom          & 0x07;
148      COLOR(0,i+(TOTAL_COLORS(0)/2)) = (*(color_prom++) >> 4) & 0x07;
149   }
144      UINT8 ctabentry;
150145
146      ctabentry = (color_prom[i - 0x08] >> 0) & 0x07;
147      colortable_entry_set_value(machine->colortable, i + 0x00, ctabentry);
151148
149      ctabentry = (color_prom[i - 0x08] >> 4) & 0x07;
150      colortable_entry_set_value(machine->colortable, i + 0x20, ctabentry);
151   }
152
152153    map_color = cosmica_map_color;
153154}
154155
r1649r1650
162163 * It's possible that the background is dark gray and not black, as the
163164 * resistor chain would never drop to zero, Anybody know ?
164165 */
165
166166PALETTE_INIT( cosmicg )
167167{
168168   int i;
169169
170   for (i = 0;i < machine->drv->total_colors;i++)
170   for (i = 0; i < machine->drv->total_colors; i++)
171171   {
172      int r,g,b;
172      int r = (i > 8) ? 0xff : 0xaa * ((i >> 0) & 1);
173      int g = 0xaa * ((i >> 1) & 1);
174      int b = 0xaa * ((i >> 2) & 1);
173175
174       if (i > 8) r = 0xff;
175        else r = 0xaa * ((i >> 0) & 1);
176
177      g = 0xaa * ((i >> 1) & 1);
178      b = 0xaa * ((i >> 2) & 1);
179      palette_set_color(machine,i,MAKE_RGB(r,g,b));
176      palette_set_color(machine, i, MAKE_RGB(r, g, b));
180177   }
181178
182
183179    map_color = cosmicg_map_color;
184180}
185181
186PALETTE_INIT( magspot2 )
182
183PALETTE_INIT( magspot )
187184{
188185   int i;
189   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
190   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
191186
187   /* allocate the colortable */
188   machine->colortable = colortable_alloc(machine, 0x10);
192189
193   for (i = 0;i < machine->drv->total_colors;i++)
190   /* create a lookup table for the palette */
191   for (i = 0; i < 0x10; i++)
194192   {
195      int r,g,b;
193      int r = ((i & 0x09) == 0x08) ? 0xaa : pal1bit(i >> 0);
194      int g = pal1bit(i >> 1);
195      int b = pal1bit(i >> 2);
196196
197      if ((i & 0x09) == 0x08)
198         r = 0xaa;
199       else
200         r = 0xff * ((i >> 0) & 1);
201
202      g = 0xff * ((i >> 1) & 1);
203      b = 0xff * ((i >> 2) & 1);
204      palette_set_color(machine,i,MAKE_RGB(r,g,b));
197      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
205198   }
206199
200   /* background uses colors 0x00-0x0f */
201   for (i = 0; i < 0x0f; i++)
202      colortable_entry_set_value(machine->colortable, i, i);
207203
208   for (i = 0;i < TOTAL_COLORS(0);i++)
204   /* sprites use colors 0x00-0x0f */
205   for (i = 0x10; i < 0x30; i++)
209206   {
210      COLOR(0,i) = *(color_prom++) & 0x0f;
207      UINT8 ctabentry = color_prom[i - 0x10] & 0x0f;
208      colortable_entry_set_value(machine->colortable, i, ctabentry);
211209   }
212210
213
214    map_color = magspot2_map_color;
211    map_color = magspot_map_color;
215212    magspot_pen_mask = 0x0f;
216213}
217214
r1649r1650
219216PALETTE_INIT( nomnlnd )
220217{
221218   int i;
222   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
223   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
224219
220   /* allocate the colortable */
221   machine->colortable = colortable_alloc(machine, 0x10);
225222
226   for (i = 0;i < machine->drv->total_colors;i++)
227      palette_set_color_rgb(machine,i,pal1bit(i >> 0),pal1bit(i >> 1),pal1bit(i >> 2));
223   /* create a lookup table for the palette */
224   for (i = 0; i < 0x10; i++)
225   {
226      rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
227      colortable_palette_set_color(machine->colortable, i, color);
228   }
228229
230   /* background uses colors 0x00-0x07 */
231   for (i = 0; i < 0x07; i++)
232      colortable_entry_set_value(machine->colortable, i, i);
229233
230   for (i = 0;i < TOTAL_COLORS(0);i++)
234   /* sprites use colors 0x00-0x07 */
235   for (i = 0x10; i < 0x30; i++)
231236   {
232      COLOR(0,i) = *(color_prom++) & 0x07;
237      UINT8 ctabentry = color_prom[i - 0x10] & 0x07;
238      colortable_entry_set_value(machine->colortable, i, ctabentry);
233239   }
234240
235
236    map_color = magspot2_map_color;
241    map_color = magspot_map_color;
237242    magspot_pen_mask = 0x07;
238243}
239244
r1649r1650
248253{
249254   offs_t offs;
250255
251
252256   for (offs = 0; offs < videoram_size; offs++)
253257   {
258      int i;
254259      UINT8 data = videoram[offs];
255260
256      if (data != 0)   /* optimization, not absolutely neccessary */
257      {
258         int i;
259         UINT8 x = offs << 3;
260         UINT8 y = offs >> 5;
261      UINT8 x = offs << 3;
262      UINT8 y = offs >> 5;
261263
262         pen_t pen = machine->pens[map_color(x, y)];
264      pen_t pen = machine->pens[map_color(x, y)];
263265
264
265         for (i = 0; i < 8; i++)
266      for (i = 0; i < 8; i++)
267      {
268         if (data & 0x80)
266269         {
267            if (data & 0x80)
268            {
269               if (flip_screen)
270                  *BITMAP_ADDR16(bitmap, 255-y, 255-x) = pen;
271               else
272                  *BITMAP_ADDR16(bitmap, y, x) = pen;
273            }
274
275            x++;
276            data <<= 1;
270            if (flip_screen)
271               *BITMAP_ADDR16(bitmap, 255-y, 255-x) = pen;
272            else
273               *BITMAP_ADDR16(bitmap, y, x) = pen;
277274         }
275
276         x++;
277         data <<= 1;
278278      }
279279   }
280280}
r1649r1650
284284{
285285   int offs;
286286
287
288287   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
289288   {
290289      if (spriteram[offs] != 0)
r1649r1650
295294         color = ~spriteram[offs+3] & color_mask;
296295
297296         if (extra_sprites)
298         {
299297            code |= (spriteram[offs+3] & 0x08) << 3;
300         }
301298
302299            if (spriteram[offs] & 0x80)
303            {
304300                /* 16x16 sprite */
305
306301             drawgfx(bitmap,machine->gfx[0],
307302                   code, color,
308303                   0, ~spriteram[offs] & 0x40,
309304                   256-spriteram[offs+2],spriteram[offs+1],
310305                    cliprect,TRANSPARENCY_PEN,0);
311            }
312306            else
313            {
314307                /* 32x32 sprite */
315
316308             drawgfx(bitmap,machine->gfx[1],
317309                   code >> 2, color,
318310                   0, ~spriteram[offs] & 0x40,
319311                   256-spriteram[offs+2],spriteram[offs+1],
320312                    cliprect,TRANSPARENCY_PEN,0);
321            }
322313        }
323314   }
324315}
r1649r1650
330321   UINT8 map = 0;
331322   UINT8 *PROM = memory_region(REGION_USER2);
332323
333
334324   while (1)
335325   {
336326      int va  =  y       & 0x01;
337327      int vb  = (y >> 1) & 0x01;
338328
339
340329      UINT8 x = 0;
341330
342331      while (1)
r1649r1650
344333         UINT8 x1;
345334         int hc, hb_;
346335
347
348336         if (flip_screen)
349337            x1 = x - cpu_getcurrentframe();
350338         else
351339            x1 = x + cpu_getcurrentframe();
352340
353
354341         hc  = (x1 >> 2) & 0x01;
355342         hb_ = (x  >> 5) & 0x01;  /* not a bug, this one is the real x */
356343
357
358344         if ((x1 & 0x1f) == 0)
359         {
360345            // flip-flop at IC11 is clocked
361346            map = PROM[(x1 >> 5) | (y >> 1 << 3)];
362         }
363347
364
365348         if ((!(hc & va) & (vb ^ hb_)) &&         /* right network */
366349             (((x1 ^ map) & (hc | 0x1e)) == 0x1e))   /* left network */
367350         {
r1649r1650
371354            *BITMAP_ADDR16(bitmap, y, x) = machine->pens[col];
372355         }
373356
374
375357         x++;
376358         if (x == 0)  break;
377359      }
378360
379
380361      y++;
381362      if (y == 0)  break;
382363   }
r1649r1650
394375   UINT8 horz_data = 0;
395376   UINT8 vert_data;
396377
397
398378   for (y = 32; y < 224; y++)
399379   {
400380      UINT8 x = 0;
401381
402
403382      while (1)
404383      {
405384         int x1;
406385
407
408386         /* for the vertical lines, each bit indicates
409387               if there should be a line at the x position */
410388         vert_data = vert_PROM[x >> 3];
411389
412
413390         /* the horizontal (perspective) lines are RLE encoded.
414391               When the screen is flipped, the address should be
415392               decrementing.  But since it's just a mirrored image,
416393               this is easier. */
417394         if (count == 0)
418         {
419395            count = horz_PROM[horz_addr++];
420         }
421396
422397         count++;
423398
424399         if (count == 0)
425         {
426400            horz_data = horz_PROM[horz_addr++];
427         }
428401
429
430402         for (x1 = 0; x1 < 8; x1++)
431403         {
432404            if (!(vert_data & horz_data & 0x80))   /* NAND gate */
r1649r1650
445417            x++;
446418         }
447419
448
449420         if (x == 0)  break;
450421      }
451422   }
r1649r1650
458429   UINT8 water = cpu_getcurrentframe();
459430   UINT8 *PROM = memory_region(REGION_USER2);
460431
461
462432   /* all positioning is via logic gates:
463433
464434       tree is displayed where
465
466435       __          __
467436       HD' ^ HC' ^ HB'
468437
r1649r1650
470439        __          __              __
471440       (VB' ^ VC' ^ VD')  X  (VB' ^ VC' ^ VD')
472441
473
474442       water is displayed where
475443             __         __
476444       HD' ^ HC' ^ HB ^ HA'
477445
478446       and vertically the same equation as the trees,
479       but final result inverted.
447       but the final result is inverted.
480448
481449
482450       The colors are coded in logic gates:
r1649r1650
487455         G = Plane2              0  1  010
488456         B = Plane1 ^ ~Plane2    1  0  100
489457                                 1  1  011
490
491458       water:
492459                                P1 P2  BGR or
493460         R = Plane1 ^ Plane2     0  0  100 000
r1649r1650
497464
498465         Not sure about B, the logic seems convulated for such
499466         a simple result.
500
501467    */
502468
503469   while (1)
r1649r1650
508474
509475      UINT8 x = 0;
510476
511
512477      while (1)
513478      {
514479         int color = 0;
r1649r1650
519484         int hc_ = (x >> 6) & 0x01;
520485         int hd_ =  x >> 7;
521486
522
523487         if ((!vb_ & vc_ & !vd_) ^ (vb_ & !vc_ & vd_))
524488         {
525489            /* tree */
r1649r1650
558522            }
559523         }
560524
561
562525         if (color != 0)
563526         {
564527            pen_t pen = machine->pens[color];
r1649r1650
569532               *BITMAP_ADDR16(bitmap, y, x) = pen;
570533         }
571534
572
573535         x++;
574536         if (x == 0)  break;
575537      }
r1649r1650
577539
578540      // this is obviously wrong
579541//      if (vb_)
580//      {
581542         water++;
582//      }
583543
584
585544      y++;
586545      if (y == 0)  break;
587546   }
r1649r1650
621580}
622581
623582
624VIDEO_UPDATE( magspot2 )
583VIDEO_UPDATE( magspot )
625584{
626585   fillbitmap(bitmap, machine->pens[0], cliprect);
627586
r1649r1650
637596   fillbitmap(bitmap, machine->pens[0], cliprect);
638597
639598    if (background_enable)
640    {
641599       devzone_draw_grid(machine, bitmap, cliprect);
642   }
643600
644601   draw_bitmap(machine, bitmap, cliprect);
645602
r1649r1650
659616
660617   draw_sprites(machine, bitmap, cliprect, 0x07, 0);
661618
662    if (background_enable)
663    {
664       nomnlnd_draw_background(machine, bitmap, cliprect);
665   }
619   if (background_enable)
620      nomnlnd_draw_background(machine, bitmap, cliprect);
621
666622   return 0;
667623}
src/mame/video/tia.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "tia.h"
910#include "sound/tiaintf.h"
10#include <math.h>
1111
1212#define HMOVE_INACTIVE      -200
1313#define PLAYER_GFX_SLOTS   4
r1649r1650
2626static struct player_gfx p0gfx;
2727static struct player_gfx p1gfx;
2828
29static UINT32 frame_cycles;
30static UINT32 paddle_cycles;
29static UINT64 frame_cycles;
30static UINT64 paddle_cycles;
3131
3232static int horzP0;
3333static int horzP1;
r1649r1650
284284VIDEO_UPDATE( tia )
285285{
286286   screen_height = machine->screen[0].height;
287   copybitmap(bitmap, helper[2], 0, 0, 0, 0,
288      cliprect, TRANSPARENCY_NONE, 0);
287   copybitmap(bitmap, helper[2], 0, 0, 0, 0, cliprect);
289288   return 0;
290289}
291290
r1649r1650
16491648
16501649static READ8_HANDLER( INPT_r )
16511650{
1652   UINT32 elapsed = activecpu_gettotalcycles() - paddle_cycles;
1651   UINT64 elapsed = activecpu_gettotalcycles() - paddle_cycles;
16531652   int input = TIA_INPUT_PORT_ALWAYS_ON;
16541653
16551654   if ( tia_read_input_port )
src/mame/video/sshangha.c
r1649r1650
66***************************************************************************/
77
88#include "driver.h"
9#include "deprecat.h"
910
1011UINT16 *sshangha_pf2_data,*sshangha_pf1_data;
1112UINT16 *sshangha_pf1_rowscroll,*sshangha_pf2_rowscroll;
src/mame/video/leland.c
r1649r1650
88
99#include "driver.h"
1010#include "leland.h"
11#include "sound/dac.h"
1211
1312
1413/* constants */
15#define VRAM_SIZE   0x10000
16#define QRAM_SIZE   0x10000
14#define VRAM_SIZE      (0x10000)
15#define QRAM_SIZE      (0x10000)
1716
18#define VIDEO_WIDTH  0x28
19#define VIDEO_HEIGHT 0x1e
17#define VIDEO_WIDTH     (320)
2018
2119
2220/* debugging */
r1649r1650
3331
3432/* video RAM */
3533UINT8 *ataxx_qram;
36UINT8 leland_last_scanline_int;
37static mame_bitmap *fgbitmap;
3834static UINT8 *leland_video_ram;
3935
4036/* video RAM bitmap drawing */
4137static struct vram_state_data vram_state[2];
42static UINT8 sync_next_write;
4338
44/* partial screen updating */
45static int next_update_scanline;
46
4739/* scroll background registers */
4840static UINT16 xscroll;
4941static UINT16 yscroll;
r1649r1650
5749 *
5850 *************************************/
5951
60VIDEO_START( leland )
52static VIDEO_START( leland )
6153{
6254   /* allocate memory */
63    leland_video_ram = auto_malloc(VRAM_SIZE);
64    fgbitmap = auto_bitmap_alloc(VIDEO_WIDTH * 8, VIDEO_HEIGHT * 8, machine->screen[0].format);
55   leland_video_ram = auto_malloc(VRAM_SIZE);
6556
6657   /* reset videoram */
67    memset(leland_video_ram, 0, VRAM_SIZE);
58   memset(leland_video_ram, 0, VRAM_SIZE);
6859}
6960
7061
71VIDEO_START( ataxx )
62static VIDEO_START( ataxx )
7263{
7364   /* first do the standard stuff */
7465   VIDEO_START_CALL(leland);
r1649r1650
8879 *
8980 *************************************/
9081
91WRITE8_HANDLER( leland_gfx_port_w )
82WRITE8_HANDLER( leland_scroll_w )
9283{
9384   /* adjust the proper scroll value */
94    switch (offset)
95    {
96       case -1:
97          if (gfxbank != data)
98          {
99            video_screen_update_partial(0, leland_last_scanline_int);
100             gfxbank = data;
101         }
102          break;
103
85   switch (offset)
86   {
10487      case 0:
105         if ((xscroll & 0xff) != data)
106         {
107            video_screen_update_partial(0, leland_last_scanline_int);
108            xscroll = (xscroll & 0xff00) | (data & 0x00ff);
109         }
88         video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
89         xscroll = (xscroll & 0xff00) | (data & 0x00ff);
11090         break;
11191
11292      case 1:
113         if ((xscroll >> 8) != data)
114         {
115            video_screen_update_partial(0, leland_last_scanline_int);
116            xscroll = (xscroll & 0x00ff) | ((data << 8) & 0xff00);
117         }
93         video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
94         xscroll = (xscroll & 0x00ff) | ((data << 8) & 0xff00);
11895         break;
11996
12097      case 2:
121         if ((yscroll & 0xff) != data)
122         {
123            video_screen_update_partial(0, leland_last_scanline_int);
124            yscroll = (yscroll & 0xff00) | (data & 0x00ff);
125         }
98         video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
99         yscroll = (yscroll & 0xff00) | (data & 0x00ff);
126100         break;
127101
128102      case 3:
129         if ((yscroll >> 8) != data)
130         {
131            video_screen_update_partial(0, leland_last_scanline_int);
132            yscroll = (yscroll & 0x00ff) | ((data << 8) & 0xff00);
133         }
103         video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
104         yscroll = (yscroll & 0x00ff) | ((data << 8) & 0xff00);
134105         break;
106
107      default:
108         fatalerror("Unexpected leland_gfx_port_w");
109         break;
135110   }
136111}
137112
138113
114WRITE8_HANDLER( leland_gfx_port_w )
115{
116   video_screen_update_partial(0, video_screen_get_vpos(0));
117   gfxbank = data;
118}
139119
120
121
140122/*************************************
141123 *
142124 *  Video address setting
r1649r1650
151133      state->addr = (state->addr & 0xfe00) | ((data << 1) & 0x01fe);
152134   else
153135      state->addr = ((data << 9) & 0xfe00) | (state->addr & 0x01fe);
154
155   if (num == 0)
156      sync_next_write = (state->addr >= 0xf000);
157136}
158137
159138
160139
161140/*************************************
162141 *
163 *  Flush data from VRAM into our copy
164 *
165 *************************************/
166
167static void update_for_scanline(int scanline)
168{
169   int i, j;
170
171   /* skip if we're behind the times */
172   if (scanline <= next_update_scanline)
173      return;
174
175   /* update all scanlines */
176   for (i = next_update_scanline; i < scanline; i++)
177      if (i < VIDEO_HEIGHT * 8)
178      {
179         UINT8 scandata[VIDEO_WIDTH * 8];
180         UINT8 *dst = scandata;
181         UINT8 *src = &leland_video_ram[i * 256];
182
183         for (j = 0; j < VIDEO_WIDTH * 8 / 2; j++)
184         {
185            UINT8 pix = *src++;
186            *dst++ = pix >> 4;
187            *dst++ = pix & 15;
188         }
189         draw_scanline8(fgbitmap, 0, i, VIDEO_WIDTH * 8, scandata, NULL, -1);
190      }
191
192   /* also update the DACs */
193   if (scanline >= VIDEO_HEIGHT * 8)
194      scanline = 256;
195   for (i = next_update_scanline; i < scanline; i++)
196   {
197      if (!(leland_dac_control & 0x01))
198         leland_dac_update(0, leland_video_ram[i * 256 + 160]);
199      if (!(leland_dac_control & 0x02))
200         leland_dac_update(1, leland_video_ram[i * 256 + 161]);
201   }
202
203   /* set the new last update */
204   next_update_scanline = scanline;
205}
206
207
208
209/*************************************
210 *
211142 *  Common video RAM read
212143 *
213144 *************************************/
r1649r1650
217148   struct vram_state_data *state = vram_state + num;
218149   int addr = state->addr;
219150   int inc = (offset >> 2) & 2;
220    int ret;
151   int ret;
221152
222    switch (offset & 7)
223    {
224        case 3:   /* read hi/lo (alternating) */
225           ret = leland_video_ram[addr];
226           addr += inc & (addr << 1);
227           addr ^= 1;
228            break;
153   switch (offset & 7)
154   {
155      case 3:   /* read hi/lo (alternating) */
156         ret = leland_video_ram[addr];
157         addr += inc & (addr << 1);
158         addr ^= 1;
159         break;
229160
230        case 5:   /* read hi */
231          ret = leland_video_ram[addr | 1];
232          addr += inc;
233            break;
161      case 5:   /* read hi */
162         ret = leland_video_ram[addr | 1];
163         addr += inc;
164         break;
234165
235        case 6:   /* read lo */
236          ret = leland_video_ram[addr & ~1];
237          addr += inc;
238            break;
166      case 6:   /* read lo */
167         ret = leland_video_ram[addr & ~1];
168         addr += inc;
169         break;
239170
240        default:
241            logerror("CPU #%d %04x Warning: Unknown video port %02x read (address=%04x)\n",
242                        cpu_getactivecpu(),activecpu_get_pc(), offset, addr);
243            ret = 0;
244            break;
245    }
246    state->addr = addr;
171      default:
172         logerror("CPU #%d %04x Warning: Unknown video port %02x read (address=%04x)\n",
173                  cpu_getactivecpu(),activecpu_get_pc(), offset, addr);
174         ret = 0;
175         break;
176   }
177   state->addr = addr;
247178
248179   if (LOG_COMM && addr >= 0xf000)
249180      logerror("%04X:%s comm read %04X = %02X\n", activecpu_get_previouspc(), num ? "slave" : "master", addr, ret);
250181
251    return ret;
252}
182   return ret;
183   }
253184
254185
255186
r1649r1650
266197   int inc = (offset >> 2) & 2;
267198   int trans = (offset >> 4) & num;
268199
269   /* if we're writing "behind the beam", make sure we've cached what was there */
270   if (addr < 0xf000)
271   {
272      int cur_scanline = video_screen_get_vpos(0);
273      int mod_scanline = addr / 256;
200   /* don't fully understand why this is needed.  Isn't the
201       video RAM just one big RAM? */
202   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
274203
275      if (cur_scanline != next_update_scanline && mod_scanline < cur_scanline)
276         update_for_scanline(cur_scanline);
277   }
278
279204   if (LOG_COMM && addr >= 0xf000)
280205      logerror("%04X:%s comm write %04X = %02X\n", activecpu_get_previouspc(), num ? "slave" : "master", addr, data);
281206
282207   /* based on the low 3 bits of the offset, update the destination */
283    switch (offset & 7)
284    {
285        case 1:   /* write hi = data, lo = latch */
286           leland_video_ram[addr & ~1] = state->latch[0];
287           leland_video_ram[addr |  1] = data;
288           addr += inc;
289           break;
208   switch (offset & 7)
209   {
210      case 1:   /* write hi = data, lo = latch */
211         leland_video_ram[addr & ~1] = state->latch[0];
212         leland_video_ram[addr |  1] = data;
213         addr += inc;
214         break;
290215
291        case 2:   /* write hi = latch, lo = data */
292           leland_video_ram[addr & ~1] = data;
293           leland_video_ram[addr |  1] = state->latch[1];
294           addr += inc;
295           break;
216      case 2:   /* write hi = latch, lo = data */
217         leland_video_ram[addr & ~1] = data;
218         leland_video_ram[addr |  1] = state->latch[1];
219         addr += inc;
220         break;
296221
297        case 3:   /* write hi/lo = data (alternating) */
298           if (trans)
299           {
300              if (!(data & 0xf0)) data |= leland_video_ram[addr] & 0xf0;
301              if (!(data & 0x0f)) data |= leland_video_ram[addr] & 0x0f;
302           }
303             leland_video_ram[addr] = data;
304           addr += inc & (addr << 1);
305           addr ^= 1;
306            break;
222      case 3:   /* write hi/lo = data (alternating) */
223         if (trans)
224         {
225            if (!(data & 0xf0)) data |= leland_video_ram[addr] & 0xf0;
226            if (!(data & 0x0f)) data |= leland_video_ram[addr] & 0x0f;
227         }
228         leland_video_ram[addr] = data;
229         addr += inc & (addr << 1);
230         addr ^= 1;
231         break;
307232
308        case 5:   /* write hi = data */
309           state->latch[1] = data;
310           if (trans)
311           {
312              if (!(data & 0xf0)) data |= leland_video_ram[addr | 1] & 0xf0;
313              if (!(data & 0x0f)) data |= leland_video_ram[addr | 1] & 0x0f;
314           }
315          leland_video_ram[addr | 1] = data;
316          addr += inc;
317            break;
233      case 5:   /* write hi = data */
234         state->latch[1] = data;
235         if (trans)
236         {
237            if (!(data & 0xf0)) data |= leland_video_ram[addr | 1] & 0xf0;
238            if (!(data & 0x0f)) data |= leland_video_ram[addr | 1] & 0x0f;
239         }
240         leland_video_ram[addr | 1] = data;
241         addr += inc;
242         break;
318243
319        case 6:   /* write lo = data */
320           state->latch[0] = data;
321           if (trans)
322           {
323              if (!(data & 0xf0)) data |= leland_video_ram[addr & ~1] & 0xf0;
324              if (!(data & 0x0f)) data |= leland_video_ram[addr & ~1] & 0x0f;
325           }
326          leland_video_ram[addr & ~1] = data;
327          addr += inc;
328            break;
244      case 6:   /* write lo = data */
245         state->latch[0] = data;
246         if (trans)
247         {
248            if (!(data & 0xf0)) data |= leland_video_ram[addr & ~1] & 0xf0;
249            if (!(data & 0x0f)) data |= leland_video_ram[addr & ~1] & 0x0f;
250         }
251         leland_video_ram[addr & ~1] = data;
252         addr += inc;
253         break;
329254
330        default:
331            logerror("CPU #%d %04x Warning: Unknown video port write (address=%04x value=%02x)\n",
332                        cpu_getactivecpu(),activecpu_get_pc(), offset, addr);
333            break;
334    }
255      default:
256         logerror("CPU #%d %04x Warning: Unknown video port write (address=%04x value=%02x)\n",
257                  cpu_getactivecpu(),activecpu_get_pc(), offset, addr);
258         break;
259   }
335260
336    /* update the address and plane */
337    state->addr = addr;
261   /* update the address and plane */
262   state->addr = addr;
338263}
339264
340265
r1649r1650
347272
348273WRITE8_HANDLER( leland_master_video_addr_w )
349274{
350    leland_video_addr_w(offset, data, 0);
275   leland_video_addr_w(offset, data, 0);
351276}
352277
353278
r1649r1650
362287
363288WRITE8_HANDLER( leland_mvram_port_w )
364289{
365   if (sync_next_write)
366   {
367      timer_call_after_resynch(NULL, 0x00000 | (offset << 8) | data, leland_delayed_mvram_w);
368      sync_next_write = 0;
369   }
370   else
371       leland_vram_port_w(offset, data, 0);
290   timer_call_after_resynch(NULL, 0x00000 | (offset << 8) | data, leland_delayed_mvram_w);
372291}
373292
374293
375294READ8_HANDLER( leland_mvram_port_r )
376295{
377    return leland_vram_port_r(offset, 0);
296   return leland_vram_port_r(offset, 0);
378297}
379298
380299
r1649r1650
387306
388307WRITE8_HANDLER( leland_slave_video_addr_w )
389308{
390    leland_video_addr_w(offset, data, 1);
309   leland_video_addr_w(offset, data, 1);
391310}
392311
393312
394313WRITE8_HANDLER( leland_svram_port_w )
395314{
396    leland_vram_port_w(offset, data, 1);
315   leland_vram_port_w(offset, data, 1);
397316}
398317
399318
400319READ8_HANDLER( leland_svram_port_r )
401320{
402    return leland_vram_port_r(offset, 1);
321   return leland_vram_port_r(offset, 1);
403322}
404323
405324
r1649r1650
413332WRITE8_HANDLER( ataxx_mvram_port_w )
414333{
415334   offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
416   if (sync_next_write)
417   {
418      timer_call_after_resynch(NULL, 0x00000 | (offset << 8) | data, leland_delayed_mvram_w);
419      sync_next_write = 0;
420   }
421   else
422      leland_vram_port_w(offset, data, 0);
335   timer_call_after_resynch(NULL, 0x00000 | (offset << 8) | data, leland_delayed_mvram_w);
423336}
424337
425338
r1649r1650
440353READ8_HANDLER( ataxx_mvram_port_r )
441354{
442355   offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
443    return leland_vram_port_r(offset, 0);
356   return leland_vram_port_r(offset, 0);
444357}
445358
446359
447360READ8_HANDLER( ataxx_svram_port_r )
448361{
449362   offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
450    return leland_vram_port_r(offset, 1);
363   return leland_vram_port_r(offset, 1);
451364}
452365
453366
454367
455368/*************************************
456369 *
457 *  End-of-frame routine
370 *  Resets the DAC
458371 *
459372 *************************************/
460373
461static TIMER_CALLBACK( scanline_reset )
374static TIMER_CALLBACK( dac_reset )
462375{
463   /* flush the remaining scanlines */
464   next_update_scanline = 0;
465
466376   /* turn off the DACs at the start of the frame */
467377   leland_dac_control = 3;
468378}
469379
470380
471VIDEO_EOF( leland )
472{
473   /* update anything remaining */
474   update_for_scanline(VIDEO_HEIGHT * 8);
475381
476   /* set a timer to go off at the top of the frame */
477   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, scanline_reset);
478}
479
480
481
482382/*************************************
483383 *
484384 *  ROM-based refresh routine
485385 *
486386 *************************************/
487387
488VIDEO_UPDATE( leland )
388static VIDEO_UPDATE( leland )
489389{
490   const UINT8 *background_prom = memory_region(REGION_USER1);
491   const gfx_element *gfx = machine->gfx[0];
492   int char_bank = ((gfxbank >> 4) & 0x03) * 0x0400;
493   int prom_bank = ((gfxbank >> 3) & 0x01) * 0x2000;
494   int xcoarse = xscroll / 8;
495   int ycoarse = yscroll / 8;
496   int xfine = xscroll % 8;
497   int yfine = yscroll % 8;
498   int x, y;
390   int y;
499391
500   /* update anything remaining */
501   update_for_scanline(cliprect->max_y);
392   const UINT8 *bg_prom = memory_region(REGION_USER1);
393   const UINT8 *bg_gfx = memory_region(REGION_GFX1);
394   offs_t bg_gfx_bank_page_size = memory_region_length(REGION_GFX1) / 3;
395   offs_t char_bank = (((gfxbank >> 4) & 0x03) * 0x2000) & (bg_gfx_bank_page_size - 1);
396   offs_t prom_bank = ((gfxbank >> 3) & 0x01) * 0x2000;
502397
503   /* draw what's visible to the main bitmap */
504   for (y = cliprect->min_y / 8; y < cliprect->max_y / 8 + 2; y++)
398   /* for each scanline in the visible region */
399   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
505400   {
506      int ysum = ycoarse + y;
507      for (x = 0; x < VIDEO_WIDTH + 1; x++)
401      int x;
402      UINT8 fg_data = 0;
403
404      UINT16 *dst = BITMAP_ADDR16(bitmap, y, 0);
405      UINT8 *fg_src = &leland_video_ram[y << 8];
406
407      /* for each pixel on the scanline */
408      for (x = 0; x < VIDEO_WIDTH; x++)
508409      {
509         int xsum = xcoarse + x;
510         int offs = ((xsum << 0) & 0x000ff) |
511                    ((ysum << 8) & 0x01f00) |
512                    prom_bank |
513                    ((ysum << 9) & 0x1c000);
514         int code = background_prom[offs] |
515                    ((ysum << 2) & 0x300) |
516                    char_bank;
517         int color = (code >> 5) & 7;
410         /* compute the effective scrolled pixel coordinates */
411         UINT16 sx = (x + xscroll) & 0x07ff;
412         UINT16 sy = (y + yscroll) & 0x07ff;
518413
519         /* draw to the bitmap */
520         drawgfx(bitmap, gfx,
521               code, 8 * color, 0, 0,
522               8 * x - xfine, 8 * y - yfine,
523               cliprect, TRANSPARENCY_NONE_RAW, 0);
414         /* get the byte address this background pixel comes from */
415         offs_t bg_prom_offs = (sx >> 3) |
416                          ((sy << 5) & 0x01f00) |
417                          prom_bank |
418                          ((sy << 6) & 0x1c000);
419
420         offs_t bg_gfx_offs = (sy & 0x07) |
421                         (bg_prom[bg_prom_offs] << 3) |
422                         ((sy << 2) & 0x1800) |
423                         char_bank;
424
425         /* build the pen, background is d0-d5 */
426         pen_t pen = (((bg_gfx[bg_gfx_offs + (2 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 7) |   /* d0 */
427                  (((bg_gfx[bg_gfx_offs + (1 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 6) |   /* d1 */
428                  (((bg_gfx[bg_gfx_offs + (0 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 5) |   /* d2 */
429                  ((bg_prom[bg_prom_offs] & 0xe0) >> 2);                                       /* d3-d5 */
430
431         /* foreground is d6-d9 */
432         if (x & 0x01)
433            pen = pen | ((fg_data & 0x0f) << 6);
434         else
435         {
436            fg_data = *fg_src++;
437            pen = pen | ((fg_data & 0xf0) << 2);
438         }
439
440         *dst++ = pen;
524441      }
442
443      /* also update the DACs */
444      if (!(leland_dac_control & 0x01))
445         leland_dac_update(0, leland_video_ram[y * 256 + 160]);
446
447      if (!(leland_dac_control & 0x02))
448         leland_dac_update(1, leland_video_ram[y * 256 + 161]);
525449   }
526450
527   /* Merge the two bitmaps together */
528   copybitmap(bitmap, fgbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_BLEND, 6);
451   /* set a timer to go off at the top of the frame */
452   if (cliprect->max_y == machine->screen[screen].visarea.max_y)
453      timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, dac_reset);
454
529455   return 0;
530456}
531457
r1649r1650
537463 *
538464 *************************************/
539465
540VIDEO_UPDATE( ataxx )
466static VIDEO_UPDATE( ataxx )
541467{
542   const gfx_element *gfx = machine->gfx[0];
543   int xcoarse = xscroll / 8;
544   int ycoarse = yscroll / 8;
545   int xfine = xscroll % 8;
546   int yfine = yscroll % 8;
547   int x, y;
468   int y;
548469
549   /* update anything remaining */
550   update_for_scanline(cliprect->max_y);
470   const UINT8 *bg_gfx = memory_region(REGION_GFX1);
471   offs_t bg_gfx_bank_page_size = memory_region_length(REGION_GFX1) / 6;
472   offs_t bg_gfx_offs_mask = bg_gfx_bank_page_size - 1;
551473
552   /* draw what's visible to the main bitmap */
553   for (y = cliprect->min_y / 8; y < cliprect->max_y / 8 + 2; y++)
474   /* for each scanline in the visible region */
475   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
554476   {
555      int ysum = ycoarse + y;
556      for (x = 0; x < VIDEO_WIDTH + 1; x++)
477      int x;
478      UINT8 fg_data = 0;
479
480      UINT16 *dst = BITMAP_ADDR16(bitmap, y, 0);
481      UINT8 *fg_src = &leland_video_ram[y << 8];
482
483      /* for each pixel on the scanline */
484      for (x = 0; x < VIDEO_WIDTH; x++)
557485      {
558         int xsum = xcoarse + x;
559         int offs = ((ysum & 0x40) << 9) + ((ysum & 0x3f) << 8) + (xsum & 0xff);
560         int code = ataxx_qram[offs] | ((ataxx_qram[offs + 0x4000] & 0x7f) << 8);
486         /* compute the effective scrolled pixel coordinates */
487         UINT16 sx = (x + xscroll) & 0x07ff;
488         UINT16 sy = (y + yscroll) & 0x07ff;
561489
562         /* draw to the bitmap */
563         drawgfx(bitmap, gfx,
564               code, 0, 0, 0,
565               8 * x - xfine, 8 * y - yfine,
566               cliprect, TRANSPARENCY_NONE_RAW, 0);
490         /* get the byte address this background pixel comes from */
491         offs_t qram_offs = (sx >> 3) |
492                        ((sy << 5) & 0x3f00) |
493                        ((sy << 6) & 0x8000);
494
495         offs_t bg_gfx_offs = ((sy & 0x07) |
496                          (ataxx_qram[qram_offs] << 3) |
497                          ((ataxx_qram[0x4000 | qram_offs] & 0x7f) << 11)) & bg_gfx_offs_mask;
498
499         /* build the pen, background is d0-d5 */
500         pen_t pen = (((bg_gfx[bg_gfx_offs + (0 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 7) |   /* d0 */
501                  (((bg_gfx[bg_gfx_offs + (1 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 6) |   /* d1 */
502                  (((bg_gfx[bg_gfx_offs + (2 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 5) |   /* d2 */
503                  (((bg_gfx[bg_gfx_offs + (3 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 4) |   /* d3 */
504                  (((bg_gfx[bg_gfx_offs + (4 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 3) |   /* d4 */
505                  (((bg_gfx[bg_gfx_offs + (5 * bg_gfx_bank_page_size)] << (sx & 0x07)) & 0x80) >> 2);      /* d5 */
506
507         /* foreground is d6-d9 */
508         if (x & 0x01)
509            pen = pen | ((fg_data & 0x0f) << 6);
510         else
511         {
512            fg_data = *fg_src++;
513            pen = pen | ((fg_data & 0xf0) << 2);
514         }
515
516         *dst++ = pen;
567517      }
518
519      /* also update the DACs */
520      if (!(leland_dac_control & 0x01))
521         leland_dac_update(0, leland_video_ram[y * 256 + 160]);
522
523      if (!(leland_dac_control & 0x02))
524         leland_dac_update(1, leland_video_ram[y * 256 + 161]);
568525   }
569526
570   /* Merge the two bitmaps together */
571   copybitmap(bitmap, fgbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_BLEND, 6);
527   /* set a timer to go off at the top of the frame */
528   if (cliprect->max_y == machine->screen[screen].visarea.max_y)
529      timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, dac_reset);
530
572531   return 0;
573532}
533
534
535
536/*************************************
537 *
538 *  Machine drivers
539 *
540 *************************************/
541
542MACHINE_DRIVER_START( leland_video )
543
544   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_ALWAYS_UPDATE)
545   MDRV_VIDEO_START(leland)
546   MDRV_VIDEO_UPDATE(leland)
547
548   MDRV_PALETTE_LENGTH(1024)
549
550   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
551   MDRV_SCREEN_SIZE(40*8, 32*8)
552   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
553   MDRV_SCREEN_REFRESH_RATE(60)
554MACHINE_DRIVER_END
555
556
557MACHINE_DRIVER_START( ataxx_video )
558
559   MDRV_IMPORT_FROM(leland_video)
560
561   MDRV_VIDEO_START(ataxx)
562   MDRV_VIDEO_UPDATE(ataxx)
563MACHINE_DRIVER_END
src/mame/video/segaic24.c
r1649r1650
2323*/
2424
2525#include "driver.h"
26#include "deprecat.h"
2627#include "segaic24.h"
2728
2829
src/mame/video/popeye.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT8 *popeye_background_pos;
1213UINT8 *popeye_palettebank;
r1649r1650
303304   set_background_palette(machine, (*popeye_palettebank & 0x08) >> 3);
304305
305306   if (popeye_background_pos[1] == 0)   /* no background */
306   {
307307      fillbitmap(bitmap,machine->pens[0],cliprect);
308   }
309308   else
310309   {
311310      /* copy the background graphics */
r1649r1650
322321         scrolly = -scrolly;
323322      }
324323
325      copyscrollbitmap(bitmap,tmpbitmap2,1,&scrollx,1,&scrolly,cliprect,TRANSPARENCY_NONE,0);
324      copyscrollbitmap(bitmap,tmpbitmap2,1,&scrollx,1,&scrolly,cliprect);
326325   }
327326}
328327
src/mame/video/segaic24.h
r1649r1650
66   just made a copy & renamed them for now to avoid any conflicts
77*/
88
9//#include "vmixer.h"
10
119WRITE16_HANDLER (system24temp_sys16_paletteram1_w);
1210
1311// Tilemaps
src/mame/video/lordgun.c
r1649r1650
3636***************************************************************************/
3737
3838#include "driver.h"
39#include "deprecat.h"
3940
4041// Variables needed by driver:
4142
src/mame/video/lemmings.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "includes/lemmings.h"
1718
1819UINT16 *lemmings_pixel_0_data,*lemmings_pixel_1_data,*lemmings_vram_data,*lemmings_control_data;
r1649r1650
182183
183184   /* Pixel layer can be windowed in hardware (two player mode) */
184185   if ((lemmings_control_data[6]&2)==0) {
185      copyscrollbitmap(bitmap,bitmap0,1,&x1,1,&y,cliprect,TRANSPARENCY_PEN,0x100);
186      copyscrollbitmap_trans(bitmap,bitmap0,1,&x1,1,&y,cliprect,0x100);
186187   } else {
187188      rect.max_x=159;
188189      rect.min_x=0;
189      copyscrollbitmap(bitmap,bitmap0,1,&x0,1,&y,&rect,TRANSPARENCY_PEN,0x100);
190      copyscrollbitmap_trans(bitmap,bitmap0,1,&x0,1,&y,&rect,0x100);
190191      rect.max_x=319;
191192      rect.min_x=160;
192      copyscrollbitmap(bitmap,bitmap0,1,&x1,1,&y,&rect,TRANSPARENCY_PEN,0x100);
193      copyscrollbitmap_trans(bitmap,bitmap0,1,&x1,1,&y,&rect,0x100);
193194   }
194195   draw_sprites(machine,bitmap,cliprect,sprite_triple_buffer_0,0,0x0000);
195196   draw_sprites(machine,bitmap,cliprect,sprite_triple_buffer_1,1,0x2000);
src/mame/video/tiamc1.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213
1314UINT8 *tiamc1_tileram;
src/mame/video/toaplan1.c
r1649r1650
119119
120120
121121#include "driver.h"
122#include "deprecat.h"
122123#include "toaplan1.h"
123124#include "cpu/m68000/m68000.h"
124125
src/mame/video/segag80r.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "segag80r.h"
910#include "rescap.h"
1011#include "video/resnet.h"
src/mame/video/tmnt.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "machine/eeprom.h"
34#include "video/konamiic.h"
45
src/mame/video/jpmimpct.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/tms34010/tms34010.h"
910#include "jpmimpct.h"
1011
src/mame/video/taitojc.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/poly.h"
34
45UINT8 *taitojc_texture;
r1649r1650
264265      }
265266   }
266267
267   copybitmap(bitmap, framebuffer, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 0);
268   copybitmap_trans(bitmap, framebuffer, 0, 0, 0, 0, cliprect, 0);
268269
269270   for (i=(0xc00/4)-2; i >= 0; i-=2)
270271   {
src/mame/video/pitnrun.c
r1649r1650
280280   draw_sprites(machine,bitmap,&myclip);
281281
282282   if(pitnrun_ha&4)
283      copybitmap(bitmap,tmp_bitmap[pitnrun_ha&3],flip_screen_x,flip_screen_y,dx,dy,&myclip,TRANSPARENCY_PEN, 1);
283      copybitmap_trans(bitmap,tmp_bitmap[pitnrun_ha&3],flip_screen_x,flip_screen_y,dx,dy,&myclip, 1);
284284   tilemap_draw(bitmap,cliprect,fg, 0,0);
285285   return 0;
286286}
src/mame/video/segaic16.c
r1649r1650
351351***************************************************************************/
352352
353353#include "driver.h"
354#include "deprecat.h"
354355#include "segaic16.h"
355356#include "video/resnet.h"
356357
src/mame/video/liberatr.c
r1649r1650
11/***************************************************************************
22
3  liberator.c - 'video.c'
3    video/liberatr.c
44
55  Functions to emulate the video hardware of the machine.
66
src/mame/video/citycon.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112
1213
src/mame/video/playmark.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34UINT16 *bigtwin_bgvideoram;
45UINT16 *wbeachvl_videoram1,*wbeachvl_videoram2,*wbeachvl_videoram3;
src/mame/video/ampoker2.c
r0r1650
1/********************************************************************************
2
3
4    AMERICAN POKER 2 - VIDEO HARDWARE
5    ---------------------------------
6
7    Company:    Novomatic.
8    Year:       1990.
9
10    Original preliminary driver:   Curt Coder.
11    Rewrite and additional work:   Roberto Fresca, with a lot of help of Grull Osgo.
12
13
14    --- Supported Sets ---
15
16    Old name | New name | Relation | Description
17    --------------------------------------------
18    ampokr2b   ampoker2   parent     American Poker II.
19      ----     ampkr2b1   clone      American Poker II (bootleg, set 1).
20    ampokr2a   ampkr2b2   clone      American Poker II (bootleg, set 2).
21    ampoker2   ampkr2b3   clone      American Poker II (bootleg, set 3).
22    ampokr2c   pkrdewin   clone      Poker De Win.
23      ----     ampkr95    clone      American Poker 95.
24      ----     sigmapkr   parent     Sigma Poker.
25      ----     sigma2k    parent     Sigma Poker 2000.
26
27
28********************************************************************************/
29
30
31#include "driver.h"
32
33static tilemap *bg_tilemap;
34
35
36PALETTE_INIT( ampoker2 )
37{
38   int i;
39
40/*    - bits -
41      76543210
42      RRRGGGBB
43*/
44   for (i = 0; i < machine->drv->total_colors; i++)
45   {
46      int bit0, bit1, bit2, r, g, b;
47
48      /* blue component */
49      bit0 = 0;
50      bit1 = (*color_prom >> 0) & 0x01;
51      bit2 = (*color_prom >> 1) & 0x01;
52      b =  ( 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
53
54      /* green component */
55      bit0 = (*color_prom >> 2) & 0x01;
56      bit1 = (*color_prom >> 3) & 0x01;
57      bit2 = (*color_prom >> 4) & 0x01;
58      g =  ( 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
59
60      /* red component */
61      bit0 = (*color_prom >> 5) & 0x01;
62      bit1 = (*color_prom >> 6) & 0x01;
63      bit2 = (*color_prom >> 7) & 0x01;
64      r = ( 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
65
66      palette_set_color(machine, i, MAKE_RGB(r, g, b));
67
68      color_prom++;
69   }
70}
71
72WRITE8_HANDLER( ampoker2_videoram_w )
73{
74   videoram[offset] = data;
75   tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
76}
77
78static TILE_GET_INFO( get_bg_tile_info )
79{
80   int offs = tile_index * 2;
81   int attr = videoram[offs + 1];
82   int code = videoram[offs];
83   int color = attr;
84   code=code+(256*(color & 0x03));   /* code = color.bit1 + color.bit0 + code */
85   color= color >> 1;            /* color = color - bit0 (bit1..bit7) */
86
87   SET_TILE_INFO(0, code, color, 0);
88}
89
90static TILE_GET_INFO( s2k_get_bg_tile_info )
91{
92   int offs = tile_index * 2;
93   int attr = videoram[offs + 1];
94   int code = videoram[offs];
95   int color = attr;
96   code=code+(256*(color & 0x0f));   /* the game use 2 extra bits */
97   color= color >> 1;
98
99   SET_TILE_INFO(0, code, color, 0);
100}
101
102VIDEO_START(ampoker2)
103{
104   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
105      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
106}
107
108VIDEO_START(sigma2k)
109{
110   bg_tilemap = tilemap_create(s2k_get_bg_tile_info, tilemap_scan_rows,
111      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
112}
113
114VIDEO_UPDATE(ampoker2)
115{
116   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
117   return 0;
118}
src/mame/video/namcos21.c
r1649r1650
77*/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "namcos2.h"
1112#include "namcoic.h"
1213#include "namcos21.h"
src/mame/video/model3.c
r1649r1650
413413//          fillbitmap(bitmap3d, 0x8000, cliprect);
414414//          real3d_traverse_display_list();
415415//      }
416      copybitmap(bitmap, bitmap3d, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 0x8000);
416      copybitmap_trans(bitmap, bitmap3d, 0, 0, 0, 0, cliprect, 0x8000);
417417   }
418418
419419   if (!(debug_layer_disable & 0x2))
src/mame/video/ikki.c
r1649r1650
119119         col,
120120         f,f,
121121         px,py,
122         &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
122         cliprect,TRANSPARENCY_NONE,0);
123123   }
124124
125125/* draw sprites */
r1649r1650
156156         col,
157157         f,f,
158158         px,py,
159         &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
159         cliprect,TRANSPARENCY_COLOR,0);
160160   }
161161
162   copybitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_COLOR,256);
162   copybitmap_trans(bitmap,tmpbitmap,0,0,0,0,cliprect,machine->pens[256]);
163163
164164
165165   /* mask sprites */
r1649r1650
193193            col,
194194            f,f,
195195            px,py,
196            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
196            cliprect,TRANSPARENCY_NONE,0);
197197      }
198198   }
199199
src/mame/video/beathead.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "beathead.h"
910
1011
src/mame/video/st0016.c
r1649r1650
44************************************/
55
66#include "driver.h"
7#include "deprecat.h"
78#include "st0016.h"
89
910UINT8 *st0016_charram,*st0016_spriteram,*st0016_paletteram;
src/mame/video/cchasm.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "video/vector.h"
910#include "cchasm.h"
1011
src/mame/video/funkyjet.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "deco16ic.h"
910
1011/******************************************************************************/
src/mame/video/qix.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "qix.h"
1112#include "video/crtc6845.h"
1213
src/mame/video/atarirle.c
r1649r1650
1919***************************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "atarirle.h"
2324
2425
src/mame/video/battlex.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34static int battlex_scroll_lsb;
45static int battlex_scroll_msb;
src/mame/video/skullxbo.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/atarigen.h"
910#include "includes/skullxbo.h"
1011
src/mame/video/glass.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT16 *glass_spriteram;
1213UINT16 *glass_vregs;
r1649r1650
203204
204205   /* draw layers + sprites */
205206   fillbitmap(bitmap, get_black_pen(machine), cliprect);
206   copybitmap(bitmap,screen_bitmap,0,0,0x18,0x24,cliprect,TRANSPARENCY_NONE,0);
207   copybitmap(bitmap,screen_bitmap,0,0,0x18,0x24,cliprect);
207208   tilemap_draw(bitmap,cliprect,pant[1],0,0);
208209   tilemap_draw(bitmap,cliprect,pant[0],0,0);
209210   draw_sprites(machine,bitmap,cliprect);
src/mame/video/cinemat.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "video/vector.h"
910#include "cpu/ccpu/ccpu.h"
1011#include "cinemat.h"
src/mame/video/toaplan2.c
r1649r1650
145145***************************************************************************/
146146
147147#include "driver.h"
148#include "deprecat.h"
148149#include "cpu/m68000/m68000.h"
149150
150151
src/mame/video/wecleman.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "video/konamiic.h"
1213
1314#define BMP_PAD      8
src/mame/video/pastelg.c
r1649r1650
77******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "nb1413m3.h"
1112
1213
r1649r1650
292293   }
293294
294295   if (pastelg_dispflag)
295   {
296      copybitmap(bitmap, pastelg_tmpbitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
297   }
296      copybitmap(bitmap, pastelg_tmpbitmap, 0, 0, 0, 0, cliprect);
298297   else
299   {
300298      fillbitmap(bitmap, machine->pens[0x00], 0);
301   }
299
302300   return 0;
303301}
src/mame/video/crbaloon.c
r1649r1650
3535PALETTE_INIT( crbaloon )
3636{
3737   int i;
38   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
39   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4038
41
4239   for (i = 0; i < machine->drv->total_colors; i++)
4340   {
44      int h = (~i & 0x08) ? 0xff : 0x55;
41      UINT8 pen;
42      int h, r, g, b;
4543
46      int r = h * ((~i >> 0) & 1);
47      int g = h * ((~i >> 1) & 1);
48      int b = h * ((~i >> 2) & 1);
44      if (i & 0x01)
45         pen = i >> 1;
46      else
47         pen = 0x0f;
4948
49      h = (~pen & 0x08) ? 0xff : 0x55;
50      r = h * ((~pen >> 0) & 1);
51      g = h * ((~pen >> 1) & 1);
52      b = h * ((~pen >> 2) & 1);
53
5054      palette_set_color(machine, i, MAKE_RGB(r, g, b));
5155   }
52
53   for (i = 0; i < TOTAL_COLORS(0); i += 2)
54   {
55      COLOR(0, i + 0) = 0x0f;      /* black background */
56      COLOR(0, i + 1) = i / 2;   /* colored foreground */
57   }
5856}
5957
6058
r1649r1650
135133         /* draw the current pixel, but check collision first */
136134         if (bit)
137135         {
138            if (*BITMAP_ADDR16(bitmap, sy, sx) != 0x0f)
136            if (*BITMAP_ADDR16(bitmap, sy, sx) & 0x01)
139137               /* compute the collision address -- the +1 is via observation
140138                       of the game code, probably wrong for cocktail mode */
141139               crbaloon_collision_address = ((((sy ^ 0xff) >> 3) << 5) | ((sx ^ 0xff) >> 3)) + 1;
142140
143            *BITMAP_ADDR16(bitmap, sy, sx) = color;
141            *BITMAP_ADDR16(bitmap, sy, sx) = (color << 1) | 1;
144142         }
145143
146144         sx = sx + 1;
src/mame/video/munchmo.c
r1649r1650
124124      int scrollx = -(mnchmobl_vreg[6]*2+(mnchmobl_vreg[7]>>7))-64-128-16;
125125      int scrolly = 0;
126126
127      copyscrollbitmap(bitmap,tmpbitmap,
128         1,&scrollx,1,&scrolly,
129         cliprect,TRANSPARENCY_NONE,0);
127      copyscrollbitmap(bitmap,tmpbitmap, 1,&scrollx,1,&scrolly, cliprect);
130128   }
131129}
132130
src/mame/video/btoads.c
r1649r1650
77**************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/tms34010/tms34010.h"
1112#include "video/tlc34076.h"
1213#include "btoads.h"
src/mame/video/tetrisp2.c
r1649r1650
3939***************************************************************************/
4040
4141#include "driver.h"
42#include "deprecat.h"
4243
4344
4445extern UINT16 tetrisp2_systemregs[0x10];
src/mame/video/alpha68k.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910static tilemap *fix_tilemap;
1011static int bank_base,flipscreen;
r1649r1650
352353{
353354   int yshift = (alpha68k_microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off
354355
355   fillbitmap(bitmap,machine->pens[0],cliprect);
356   fillbitmap(bitmap,get_black_pen(machine),cliprect);
356357
357358   /* This appears to be correct priority */
358359   draw_sprites_I(machine, bitmap,cliprect,2,0x0800,yshift);
r1649r1650
365366
366367PALETTE_INIT( kyros )
367368{
368   int i,bit0,bit1,bit2,bit3,r,g,b;
369   int i;
369370
370   for (i = 0;i < 256;i++)
371   /* allocate the colortable */
372   machine->colortable = colortable_alloc(machine, 0x100);
373
374   /* create a lookup table for the palette */
375   for (i = 0; i < 0x100; i++)
371376   {
372      bit0 = (color_prom[0] >> 0) & 0x01;
373      bit1 = (color_prom[0] >> 1) & 0x01;
374      bit2 = (color_prom[0] >> 2) & 0x01;
375      bit3 = (color_prom[0] >> 3) & 0x01;
376      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
377      int r = pal4bit(color_prom[i + 0x000]);
378      int g = pal4bit(color_prom[i + 0x100]);
379      int b = pal4bit(color_prom[i + 0x200]);
377380
378      bit0 = (color_prom[0x100] >> 0) & 0x01;
379      bit1 = (color_prom[0x100] >> 1) & 0x01;
380      bit2 = (color_prom[0x100] >> 2) & 0x01;
381      bit3 = (color_prom[0x100] >> 3) & 0x01;
382      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
383
384      bit0 = (color_prom[0x200] >> 0) & 0x01;
385      bit1 = (color_prom[0x200] >> 1) & 0x01;
386      bit2 = (color_prom[0x200] >> 2) & 0x01;
387      bit3 = (color_prom[0x200] >> 3) & 0x01;
388      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
389
390      palette_set_color(machine,i,MAKE_RGB(r,g,b));
391      color_prom++;
381      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
392382   }
393383
394   color_prom += 0x200;
384   /* color_prom now points to the beginning of the lookup table */
385   color_prom += 0x300;
395386
396   for (i = 0;i < 256;i++)
387   for (i = 0; i < 0x100; i++)
397388   {
398      *colortable++ = ((color_prom[0] & 0x0f) << 4) | (color_prom[0x100] & 0x0f);
399      color_prom++;
389      UINT8 ctabentry = ((color_prom[i] & 0x0f) << 4) | (color_prom[i + 0x100] & 0x0f);
390      colortable_entry_set_value(machine->colortable, i, ctabentry);
400391   }
401392}
402393
403394PALETTE_INIT( paddlem )
404395{
405   int i,bit0,bit1,bit2,bit3,r,g,b;
396   int i;
406397
407   for (i = 0;i < 256;i++)
398   /* allocate the colortable */
399   machine->colortable = colortable_alloc(machine, 0x100);
400
401   /* create a lookup table for the palette */
402   for (i = 0; i < 0x100; i++)
408403   {
409      bit0 = (color_prom[0] >> 0) & 0x01;
410      bit1 = (color_prom[0] >> 1) & 0x01;
411      bit2 = (color_prom[0] >> 2) & 0x01;
412      bit3 = (color_prom[0] >> 3) & 0x01;
413      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
404      int r = pal4bit(color_prom[i + 0x000]);
405      int g = pal4bit(color_prom[i + 0x100]);
406      int b = pal4bit(color_prom[i + 0x200]);
414407
415      bit0 = (color_prom[0x100] >> 0) & 0x01;
416      bit1 = (color_prom[0x100] >> 1) & 0x01;
417      bit2 = (color_prom[0x100] >> 2) & 0x01;
418      bit3 = (color_prom[0x100] >> 3) & 0x01;
419      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
408      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
409   }
420410
421      bit0 = (color_prom[0x200] >> 0) & 0x01;
422      bit1 = (color_prom[0x200] >> 1) & 0x01;
423      bit2 = (color_prom[0x200] >> 2) & 0x01;
424      bit3 = (color_prom[0x200] >> 3) & 0x01;
425      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
411   /* color_prom now points to the beginning of the lookup table */
412   color_prom += 0x300;
426413
427      palette_set_color(machine,i,MAKE_RGB(r,g,b));
428      color_prom++;
414   for (i = 0; i < 0x400; i++)
415   {
416      UINT8 ctabentry = ((color_prom[i + 0x400] & 0x0f) << 4) | (color_prom[i] & 0x0f);
417      colortable_entry_set_value(machine->colortable, i, ctabentry);
429418   }
430
431   /* Fill in clut */
432   color_prom += 0x200;
433   for (i=0; i<1024; i++) colortable[i] = color_prom[i]|(color_prom[i+0x400]<<4);
434419}
435420
436421void kyros_video_banking(int *bank, int data)
r1649r1650
494479
495480VIDEO_UPDATE( kyros )
496481{
497   fillbitmap(bitmap,*videoram16 & 0xff,cliprect); //AT
482   colortable_entry_set_value(machine->colortable, 0x100, *videoram16 & 0xff);
483   fillbitmap(bitmap, machine->pens[0x100], cliprect); //AT
498484
499485   kyros_draw_sprites(machine, bitmap,cliprect,2,0x0800);
500486   kyros_draw_sprites(machine, bitmap,cliprect,3,0x0c00);
r1649r1650
551537
552538VIDEO_UPDATE( sstingry )
553539{
554   fillbitmap(bitmap,*videoram16 & 0xff,cliprect); //AT
540   colortable_entry_set_value(machine->colortable, 0x100, *videoram16 & 0xff);
541   fillbitmap(bitmap, machine->pens[0x100], cliprect); //AT
555542
556543   sstingry_draw_sprites(machine, bitmap,cliprect,2,0x0800);
557544   sstingry_draw_sprites(machine, bitmap,cliprect,3,0x0c00);
src/mame/video/starfire.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "includes/starfire.h"
98
10/* local allocated storage */
11static UINT8 *scanline_dirty;
129
10#define   NUM_PENS   (0x40)
11
12
13UINT8 *starfire_videoram;
14UINT8 *starfire_colorram;
15
16/* local allocated storage */
1317static UINT8 starfire_vidctrl;
1418static UINT8 starfire_vidctrl1;
1519static UINT8 starfire_color;
20static UINT16 starfire_colors[NUM_PENS];
1621
1722
1823
r1649r1650
2429
2530VIDEO_START( starfire )
2631{
27   /* make a temporary bitmap */
28   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
29
30   /* make a dirty array */
31   scanline_dirty = auto_malloc(STARFIRE_VTOTAL);
32
33   /* reset videoram */
34   memset(starfire_videoram, 0, 0x2000);
35   memset(starfire_colorram, 0, 0x2000);
36   memset(scanline_dirty, 1, 256);
32   /* register for state saving */
33   state_save_register_global(starfire_vidctrl);
34   state_save_register_global(starfire_vidctrl1);
35   state_save_register_global(starfire_color);
36   state_save_register_global_array(starfire_colors);
3737}
3838
3939
r1649r1650
7373      starfire_colorram[offset & ~0x100] = data;
7474      starfire_colorram[offset |  0x100] = data;
7575
76      /* don't modify the palette unless the TRANS bit is set */
7776      starfire_color = data & 0x1f;
78      if (!(starfire_vidctrl1 & 0x40))
79         return;
8077
81      palette_set_color_rgb(Machine, palette_index, pal3bit((data << 1) & 0x06) | ((offset >> 8) & 0x01), pal3bit(data >> 5), pal3bit(data >> 2));
78      /* don't modify the palette unless the TRANS bit is set */
79      if (starfire_vidctrl1 & 0x40)
80      {
81         video_screen_update_partial(0, video_screen_get_vpos(0));
82
83         starfire_colors[palette_index] = ((((data << 1) & 0x06) | ((offset >> 8) & 0x01)) << 6) |
84                                  (((data >> 5) & 0x07) << 3) |
85                                  ((data >> 2) & 0x07);
86      }
8287   }
8388
8489   /* handle writes to the rest of color RAM */
r1649r1650
8691   {
8792      /* set RAM based on CDRM */
8893      starfire_colorram[offset] = (starfire_vidctrl1 & 0x80) ? starfire_color : (data & 0x1f);
89      scanline_dirty[offset & 0xff] = 1;
9094      starfire_color = data & 0x1f;
9195   }
9296}
9397
94READ8_HANDLER( starfire_colorram_r )
95{
96   return starfire_colorram[offset];
97}
9898
9999
100
101100/*************************************
102101 *
103102 *  Video RAM read/writes
r1649r1650
173172   /* final output */
174173   starfire_videoram[offset1] = dalu >> 8;
175174   starfire_videoram[offset2] = dalu;
176   scanline_dirty[offset1 & 0xff] = 1;
177175
178176   /* color output */
179177   if (!(offset & 0x2000) && !(starfire_vidctrl1 & 0x80))
r1649r1650
219217
220218/*************************************
221219 *
222 *  Periodic screen refresh callback
220 *  Standard screen refresh callback
223221 *
224222 *************************************/
225223
226void starfire_video_update(int scanline, int count)
224static void get_pens(pen_t *pens)
227225{
228   UINT8 *pix = &starfire_videoram[scanline];
229   UINT8 *col = &starfire_colorram[scanline];
226   offs_t offs;
227
228   for (offs = 0; offs < NUM_PENS; offs++)
229   {
230      UINT16 color = starfire_colors[offs];
231
232      pens[offs] = MAKE_RGB(pal3bit(color >> 6), pal3bit(color >> 3), pal3bit(color >> 0));
233   }
234}
235
236
237VIDEO_UPDATE( starfire )
238{
239   pen_t pens[NUM_PENS];
240
241   UINT8 *pix = &starfire_videoram[cliprect->min_y - 32];
242   UINT8 *col = &starfire_colorram[cliprect->min_y - 32];
230243   int x, y;
231244
232   /* update any dirty scanlines in this range */
245   get_pens(pens);
246
233247   for (x = 0; x < 256; x += 8)
234248   {
235      for (y = 0; y < count; y++)
236         if ((scanline + y) < STARFIRE_VTOTAL && scanline_dirty[scanline + y])
237         {
238            int data = pix[y];
239            int color = col[y];
249      for (y = cliprect->min_y; y <= cliprect->max_y ; y++)
250      {
251         int data = pix[y];
252         int color = col[y];
240253
241            *BITMAP_ADDR16(tmpbitmap, scanline + y, x + 0) = color | ((data >> 2) & 0x20);
242            *BITMAP_ADDR16(tmpbitmap, scanline + y, x + 1) = color | ((data >> 1) & 0x20);
243            *BITMAP_ADDR16(tmpbitmap, scanline + y, x + 2) = color | ((data >> 0) & 0x20);
244            *BITMAP_ADDR16(tmpbitmap, scanline + y, x + 3) = color | ((data << 1) & 0x20);
245            *BITMAP_ADDR16(tmpbitmap, scanline + y, x + 4) = color | ((data << 2) & 0x20);
246            *BITMAP_ADDR16(tmpbitmap, scanline + y, x + 5) = color | ((data << 3) & 0x20);
247            *BITMAP_ADDR16(tmpbitmap, scanline + y, x + 6) = color | ((data << 4) & 0x20);
248            *BITMAP_ADDR16(tmpbitmap, scanline + y, x + 7) = color | ((data << 5) & 0x20);
249         }
254         *BITMAP_ADDR32(bitmap, y, x + 0) = pens[color | ((data >> 2) & 0x20)];
255         *BITMAP_ADDR32(bitmap, y, x + 1) = pens[color | ((data >> 1) & 0x20)];
256         *BITMAP_ADDR32(bitmap, y, x + 2) = pens[color | ((data >> 0) & 0x20)];
257         *BITMAP_ADDR32(bitmap, y, x + 3) = pens[color | ((data << 1) & 0x20)];
258         *BITMAP_ADDR32(bitmap, y, x + 4) = pens[color | ((data << 2) & 0x20)];
259         *BITMAP_ADDR32(bitmap, y, x + 5) = pens[color | ((data << 3) & 0x20)];
260         *BITMAP_ADDR32(bitmap, y, x + 6) = pens[color | ((data << 4) & 0x20)];
261         *BITMAP_ADDR32(bitmap, y, x + 7) = pens[color | ((data << 5) & 0x20)];
262      }
250263
251264      pix += 256;
252265      col += 256;
253266   }
254267
255   /* mark them not dirty anymore */
256   for (y = 0; y < count; y++)
257      if ((scanline + y) < STARFIRE_VTOTAL)
258         scanline_dirty[scanline + y] = 0;
259}
260
261
262
263/*************************************
264 *
265 *  Standard screen refresh callback
266 *
267 *************************************/
268
269VIDEO_UPDATE( starfire )
270{
271   /* copy the bitmap, remapping the colors */
272   copybitmap_remap(bitmap, tmpbitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
273268   return 0;
274269}
275
276
src/mame/video/cischeat.c
r1649r1650
5454***************************************************************************/
5555
5656#include "driver.h"
57#include "deprecat.h"
5758#include "megasys1.h"
5859
5960/* Variables only used here: */
src/mame/video/namcos22.c
r1649r1650
3434*/
3535
3636#include "driver.h"
37#include "deprecat.h"
3738#include "eminline.h"
3839#include "video/rgbutil.h"
3940#include "namcos22.h"
4041#include "video/poly.h"
41#include <math.h>
4242
4343// uncomment this line to render everything as quads
4444//#define RENDER_AS_QUADS
src/mame/video/rockola.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT8 *rockola_videoram2;
1213UINT8 *rockola_charram;
src/mame/video/centiped.c
r1649r1650
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "centiped.h"
910
1011
r1649r1650
5859
5960/*************************************
6061 *
62 *  Palette init
63 *
64 *************************************/
65
66static void init_penmask(void)
67{
68   int i;
69
70   for (i = 0; i < 64; i++)
71   {
72      UINT8 mask = 1;
73      if (((i >> 0) & 3) == 0) mask |= 2;
74      if (((i >> 2) & 3) == 0) mask |= 4;
75      if (((i >> 4) & 3) == 0) mask |= 8;
76      penmask[i] = mask;
77   }
78}
79
80
81
82/*************************************
83 *
6184 *  Video system start
6285 *
6386 *************************************/
r1649r1650
6689{
6790   bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
6891
92   init_penmask();
93
6994   centiped_flipscreen = 0;
7095
7196   state_save_register_global(centiped_flipscreen);
r1649r1650
87112{
88113   bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
89114
115   init_penmask();
116
90117   centiped_flipscreen = 0;
118
91119   state_save_register_global(centiped_flipscreen);
92120}
93121
r1649r1650
96124{
97125   bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
98126
127   init_penmask();
128
99129   centiped_flipscreen = 0;
100130}
101131
r1649r1650
155185
156186
157187
158/*************************************
159 *
160 *  Palette init
161 *
162 *************************************/
163
164static void init_penmask(void)
165{
166   int i;
167
168   for (i = 0; i < 64; i++)
169   {
170      UINT8 mask = 1;
171      if (((i >> 0) & 3) == 0) mask |= 2;
172      if (((i >> 2) & 3) == 0) mask |= 4;
173      if (((i >> 4) & 3) == 0) mask |= 8;
174      penmask[i] = mask;
175   }
176}
177
178
179
180188/***************************************************************************
181189
182190    Centipede doesn't have a color PROM. Eight RAM locations control
r1649r1650
191199    The alternate bit affects blue and green, not red. The way I weighted its
192200    effect might not be perfectly accurate, but is reasonably close.
193201
202    Centipede is unusual because the sprite color code specifies the
203    colors to use one by one, instead of a combination code.
204    bit 5-4 = color to use for pen 11
205    bit 3-2 = color to use for pen 10
206    bit 1-0 = color to use for pen 01
207    pen 00 is transparent
208
194209***************************************************************************/
195210
196#define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
197#define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
198
199PALETTE_INIT( centiped )
211WRITE8_HANDLER( centiped_paletteram_w )
200212{
201   int i;
213   paletteram[offset] = data;
202214
203   /* characters use colors 0-3 */
204   for (i = 0; i < TOTAL_COLORS(0); i++)
205      COLOR(0,i) = i;
206
207   /* Centipede is unusual because the sprite color code specifies the */
208   /* colors to use one by one, instead of a combination code. */
209   /* bit 5-4 = color to use for pen 11 */
210   /* bit 3-2 = color to use for pen 10 */
211   /* bit 1-0 = color to use for pen 01 */
212   /* pen 00 is transparent */
213   for (i = 0; i < TOTAL_COLORS(1); i += 4)
215   /* bit 2 of the output palette RAM is always pulled high, so we ignore */
216   /* any palette changes unless the write is to a palette RAM address */
217   /* that is actually used */
218   if (offset & 4)
214219   {
215      COLOR(1,i+0) = 0;
216      COLOR(1,i+1) = 4 + ((i >> 2) & 3);
217      COLOR(1,i+2) = 4 + ((i >> 4) & 3);
218      COLOR(1,i+3) = 4 + ((i >> 6) & 3);
219   }
220      rgb_t color;
220221
221   /* create a pen mask for sprite drawing */
222   init_penmask();
223}
222      int r = 0xff * ((~data >> 0) & 1);
223      int g = 0xff * ((~data >> 1) & 1);
224      int b = 0xff * ((~data >> 2) & 1);
224225
226      if (~data & 0x08) /* alternate = 1 */
227      {
228         /* when blue component is not 0, decrease it. When blue component is 0, */
229         /* decrease green component. */
230         if (b) b = 0xc0;
231         else if (g) g = 0xc0;
232      }
225233
226WRITE8_HANDLER( centiped_paletteram_w )
227{
228   int r, g, b;
234      color = MAKE_RGB(r, g, b);
229235
230   paletteram[offset] = data;
236      /* character colors, set directly */
237      if ((offset & 0x08) == 0)
238         palette_set_color(Machine, offset & 0x03, color);
231239
232   r = 0xff * ((~data >> 0) & 1);
233   g = 0xff * ((~data >> 1) & 1);
234   b = 0xff * ((~data >> 2) & 1);
240      /* sprite colors - set all the applicable ones */
241      else
242      {
243         int i;
235244
236   if (~data & 0x08) /* alternate = 1 */
237   {
238      /* when blue component is not 0, decrease it. When blue component is 0, */
239      /* decrease green component. */
240      if (b) b = 0xc0;
241      else if (g) g = 0xc0;
245         offset = offset & 0x03;
246
247         for (i = 0; i < 0x100; i += 4)
248         {
249            if (offset == ((i >> 2) & 0x03))
250               palette_set_color(Machine, i + 4 + 1, color);
251
252            if (offset == ((i >> 4) & 0x03))
253               palette_set_color(Machine, i + 4 + 2, color);
254
255            if (offset == ((i >> 6) & 0x03))
256               palette_set_color(Machine, i + 4 + 3, color);
257         }
258      }
242259   }
243
244   /* bit 2 of the output palette RAM is always pulled high, so we ignore */
245   /* any palette changes unless the write is to a palette RAM address */
246   /* that is actually used */
247   if (offset & 4)
248      palette_set_color(Machine, ((offset >> 1) & 4) | (offset & 3), MAKE_RGB(r, g, b));
249260}
250261
251262
r1649r1650
264275
265276PALETTE_INIT( warlords )
266277{
267   int i, j;
278   int i;
268279
269280   for (i = 0; i < machine->drv->total_colors; i++)
270281   {
271      int r = ((*color_prom >> 2) & 0x01) * 0xff;
272      int g = ((*color_prom >> 1) & 0x01) * 0xff;
273      int b = ((*color_prom >> 0) & 0x01) * 0xff;
282      UINT8 pen;
283      int r, g, b;
274284
275      /* Colors 0x40-0x7f are converted to grey scale as it's used on the
285      if (i < 0x20)
286         /* characters */
287         pen = (((i - 0x00) & 0x1c) << 2) | (((i - 0x00) & 0x03) << 0);
288      else
289         /* sprites */
290         pen = (((i - 0x20) & 0x1c) << 2) | (((i - 0x20) & 0x03) << 2);
291
292      r = ((color_prom[pen] >> 2) & 0x01) * 0xff;
293      g = ((color_prom[pen] >> 1) & 0x01) * 0xff;
294      b = ((color_prom[pen] >> 0) & 0x01) * 0xff;
295
296      /* colors 0x40-0x7f are converted to grey scale as it's used on the
276297           upright version that had an overlay */
277      if (i >= machine->drv->total_colors / 2)
298      if (pen >= 0x40)
278299      {
279         /* Use the standard ratios: r = 30%, g = 59%, b = 11% */
300         /* use the standard ratios: r = 30%, g = 59%, b = 11% */
280301         int grey = (r * 0x4d / 0xff) + (g * 0x96 / 0xff) + (b * 0x1c / 0xff);
281302         r = g = b = grey;
282303      }
283      palette_set_color(machine,i,MAKE_RGB(r,g,b));
284      color_prom++;
304
305      palette_set_color(machine, i, MAKE_RGB(r, g, b));
285306   }
286
287   for (i = 0; i < 8; i++)
288      for (j = 0; j < 4; j++)
289      {
290         COLOR(0,i*4+j) = i*16+j;
291         COLOR(1,i*4+j) = i*16+j*4;
292      }
293307}
294308
295309
r1649r1650
308322          blue
309323    bit 0 blue
310324
325    Millipede is unusual because the sprite color code specifies the
326    colors to use one by one, instead of a combination code.
327    bit 7-6 = palette bank (there are 4 groups of 4 colors)
328    bit 5-4 = color to use for pen 11
329    bit 3-2 = color to use for pen 10
330    bit 1-0 = color to use for pen 01
331    pen 00 is transparent
332
311333***************************************************************************/
312334
313PALETTE_INIT( milliped )
335static void melliped_mazeinv_set_color(running_machine *machine, offs_t offset, UINT8 data)
314336{
315   int i;
337   rgb_t color;
338   int bit0, bit1, bit2;
339   int r, g, b;
316340
317   /* characters use colors 0-15 */
318   for (i = 0; i < TOTAL_COLORS(0); i++)
319      COLOR(0,i) = i;
320
321   /* Millipede is unusual because the sprite color code specifies the */
322   /* colors to use one by one, instead of a combination code. */
323   /* bit 7-6 = palette bank (there are 4 groups of 4 colors) */
324   /* bit 5-4 = color to use for pen 11 */
325   /* bit 3-2 = color to use for pen 10 */
326   /* bit 1-0 = color to use for pen 01 */
327   /* pen 00 is transparent */
328   for (i = 0; i < TOTAL_COLORS(1); i += 4)
329   {
330      int base = 16 + 4 * ((i >> 8) & 3);
331      COLOR(1,i+0) = 0;
332      COLOR(1,i+1) = base + ((i >> 2) & 3);
333      COLOR(1,i+2) = base + ((i >> 4) & 3);
334      COLOR(1,i+3) = base + ((i >> 6) & 3);
335   }
336
337   /* create a pen mask for sprite drawing */
338   init_penmask();
339}
340
341
342WRITE8_HANDLER( milliped_paletteram_w )
343{
344   int bit0,bit1,bit2;
345   int r,g,b;
346
347   paletteram[offset] = data;
348
349341   /* red component */
350342   bit0 = (~data >> 5) & 0x01;
351343   bit1 = (~data >> 6) & 0x01;
r1649r1650
364356   bit2 = (~data >> 2) & 0x01;
365357   b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
366358
367   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
359   color = MAKE_RGB(r, g, b);
360
361   /* character colors, set directly */
362   if (offset < 0x10)
363      palette_set_color(machine, offset, color);
364
365   /* sprite colors - set all the applicable ones */
366   else
367   {
368      int i;
369
370      int base = offset & 0x0c;
371
372      offset = offset & 0x03;
373
374      for (i = (base << 6); i < (base << 6) + 0x100; i += 4)
375      {
376         if (offset == ((i >> 2) & 0x03))
377            palette_set_color(machine, i + 0x10 + 1, color);
378
379         if (offset == ((i >> 4) & 0x03))
380            palette_set_color(machine, i + 0x10 + 2, color);
381
382         if (offset == ((i >> 6) & 0x03))
383            palette_set_color(machine, i + 0x10 + 3, color);
384      }
385   }
368386}
369387
370388
371WRITE8_HANDLER( mazeinv_paletteram_w )
389WRITE8_HANDLER( milliped_paletteram_w )
372390{
373   int bit0,bit1,bit2;
374   int r,g,b;
375
376391   paletteram[offset] = data;
377   data = memory_region(REGION_PROMS)[~data & 0x0f];
378392
379   /* red component */
380   bit0 = (data >> 5) & 0x01;
381   bit1 = (data >> 6) & 0x01;
382   bit2 = (data >> 7) & 0x01;
383   r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
393   melliped_mazeinv_set_color(Machine, offset, data);
394}
384395
385   /* green component */
386   bit0 = 0;
387   bit1 = (data >> 3) & 0x01;
388   bit2 = (data >> 4) & 0x01;
389   g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
390396
391   /* blue component */
392   bit0 = (data >> 0) & 0x01;
393   bit1 = (data >> 1) & 0x01;
394   bit2 = (data >> 2) & 0x01;
395   b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
397WRITE8_HANDLER( mazeinv_paletteram_w )
398{
399   paletteram[offset] = data;
396400
397   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
401   /* the value passed in is a look-up index into the color PROM */
402   melliped_mazeinv_set_color(Machine, offset, ~memory_region(REGION_PROMS)[~data & 0x0f]);
398403}
399404
400405
src/mame/video/atarisy1.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/atarigen.h"
910#include "atarisy1.h"
1011
src/mame/video/dec0.c
r1649r1650
9595***************************************************************************/
9696
9797#include "driver.h"
98#include "deprecat.h"
9899#include "includes/dec0.h"
99100
100101static tilemap *pf1_tilemap_0,*pf1_tilemap_1,*pf1_tilemap_2;
src/mame/video/ssv.c
r1649r1650
136136***************************************************************************/
137137
138138#include "driver.h"
139#include "deprecat.h"
139140#include "seta.h"
140141#ifdef MAME_DEBUG
141142#include "ui.h"
src/mame/video/taitoair.c
r1649r1650
4646***************************************************************************/
4747
4848#include "driver.h"
49#include "deprecat.h"
4950#include "taitoic.h"
5051
5152
src/mame/video/tceptor.c
r1649r1650
44 */
55
66#include "driver.h"
7#include "deprecat.h"
78#include "namcoic.h"
89
910#define TX_TILE_OFFSET_CENTER   (32 * 2)
r1649r1650
512513         if (is_mask_spr[color])
513514         {
514515            if (!need_mask)
515            {
516516               // backup previous bitmap
517               copybitmap(temp_bitmap, bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
518            }
517               copybitmap(temp_bitmap, bitmap, 0, 0, 0, 0, cliprect);
519518
520519            need_mask = 1;
521520         }
src/mame/video/cop01.c
r1649r1650
2020PALETTE_INIT( cop01 )
2121{
2222   int i;
23   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
24   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
2523
26   for (i = 0;i < machine->drv->total_colors;i++)
24   /* allocate the colortable */
25   machine->colortable = colortable_alloc(machine, 0x100);
26
27   /* create a lookup table for the palette */
28   for (i = 0; i < 0x100; i++)
2729   {
28      int bit0,bit1,bit2,bit3,r,g,b;
30      int r = pal4bit(color_prom[i + 0x000]);
31      int g = pal4bit(color_prom[i + 0x100]);
32      int b = pal4bit(color_prom[i + 0x200]);
2933
30      bit0 = (color_prom[0] >> 0) & 0x01;
31      bit1 = (color_prom[0] >> 1) & 0x01;
32      bit2 = (color_prom[0] >> 2) & 0x01;
33      bit3 = (color_prom[0] >> 3) & 0x01;
34      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
35      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
36      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
37      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
38      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
39      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
40      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
41      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
42      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
43      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
44      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
45
46      palette_set_color(machine,i,MAKE_RGB(r,g,b));
47      color_prom++;
34      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
4835   }
4936
50   color_prom += 2*machine->drv->total_colors;
51   /* color_prom now points to the beginning of the lookup tables */
37   /* color_prom now points to the beginning of the lookup table */
38   color_prom += 0x300;
5239
53   /* characters use colors 0-15 (or 0-127, but the eight rows are identical) */
54   for (i = 0;i < TOTAL_COLORS(0);i++)
55      COLOR(0,i) = i;
40   /* characters use colors 0x00-0x0f (or 0x00-0x7f, but the eight rows are identical) */
41   for (i = 0; i < 0x10; i++)
42      colortable_entry_set_value(machine->colortable, i, i);
5643
57   /* background tiles use colors 192-255 */
44   /* background tiles use colors 0xc0-0xff */
5845   /* I don't know how much of the lookup table PROM is hooked up, */
5946   /* I'm only using the first 32 bytes because the rest is empty. */
60   for (i = 0;i < TOTAL_COLORS(1);i++)
61      COLOR(1,i) = 0xc0 + (i & 0x30) + (color_prom[((i & 0x40) >> 2) + (i & 0x0f)] & 0x0f);
62   color_prom += 256;
47   for (i = 0x10; i < 0x90; i++)
48   {
49      UINT8 ctabentry = 0xc0 | ((i - 0x10) & 0x30) |
50                    (color_prom[(((i - 0x10) & 0x40) >> 2) | ((i - 0x10) & 0x0f)] & 0x0f);
51      colortable_entry_set_value(machine->colortable, i, ctabentry);
52   }
6353
64   /* sprites use colors 128-143 (or 128-191, but the four rows are identical) */
65   for (i = 0;i < TOTAL_COLORS(2);i++)
66      COLOR(2,i) = 0x80 + (*(color_prom++) & 0x0f);
54   /* sprites use colors 0x80-0x8f (or 0x80-0xbf, but the four rows are identical) */
55   for (i = 0x90; i < 0x190; i++)
56   {
57      UINT8 ctabentry = 0x80 | (color_prom[i - 0x90 + 0x100] & 0x0f);
58      colortable_entry_set_value(machine->colortable, i, ctabentry);
59   }
6760}
6861
6962
src/mame/video/vindictr.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/atarigen.h"
910#include "vindictr.h"
1011#include "thunderj.h"
src/mame/video/metro.c
r1649r1650
5252***************************************************************************/
5353
5454#include "driver.h"
55#include "deprecat.h"
5556#include "video/konamiic.h"
5657
5758/* Variables that driver has access to: */
r1649r1650
905906   }
906907
907908
908#if 0
909#ifdef MAME_DEBUG
909910if (input_code_pressed(KEYCODE_Z))
910{   int msk = 0;
911{
912   int msk = 0;
911913   if (input_code_pressed(KEYCODE_Q))   msk |= 1;
912914   if (input_code_pressed(KEYCODE_W))   msk |= 2;
913915   if (input_code_pressed(KEYCODE_E))   msk |= 4;
r1649r1650
919921   popmessage("l %x-%x-%x r %04x %04x %04x",
920922            (metro_videoregs[0x10/2]&0x30)>>4,(metro_videoregs[0x10/2]&0xc)>>2,metro_videoregs[0x10/2]&3,
921923            metro_videoregs[0x02/2], metro_videoregs[0x12/2],
922            *metro_screenctrl);               }
924            *metro_screenctrl);
925}
923926#endif
924927
925928   if (has_zoom) K053936_0_zoom_draw(bitmap,cliprect,metro_K053936_tilemap,0,0);
src/mame/video/angelkds.c
r1649r1650
77*/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112
1213static tilemap *tx_tilemap,*bgbot_tilemap ,*bgtop_tilemap;
src/mame/video/circusc.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
1112
1213
r1649r1650
3637  bit 0 -- 1  kohm resistor  -- RED
3738
3839***************************************************************************/
40
3941PALETTE_INIT( circusc )
4042{
43   static const int resistances_rg[3] = { 1000, 470, 220 };
44   static const int resistances_b [2] = { 470, 220 };
45   double rweights[3], gweights[3], bweights[2];
4146   int i;
42   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
43   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4447
48   /* compute the color output resistor weights */
49   compute_resistor_weights(0,   255, -1.0,
50         3, &resistances_rg[0], rweights, 0, 0,
51         3, &resistances_rg[0], gweights, 0, 0,
52         2, &resistances_b[0],  bweights, 0, 0);
4553
46   for (i = 0;i < machine->drv->total_colors;i++)
54   /* allocate the colortable */
55   machine->colortable = colortable_alloc(machine, 32);
56
57   /* create a lookup table for the palette */
58   for (i = 0; i < 0x20; i++)
4759   {
48      int bit0,bit1,bit2,r,g,b;
60      int bit0, bit1, bit2;
61      int r, g, b;
4962
5063      /* red component */
51      bit0 = (*color_prom >> 0) & 0x01;
52      bit1 = (*color_prom >> 1) & 0x01;
53      bit2 = (*color_prom >> 2) & 0x01;
54      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
64      bit0 = (color_prom[i] >> 0) & 0x01;
65      bit1 = (color_prom[i] >> 1) & 0x01;
66      bit2 = (color_prom[i] >> 2) & 0x01;
67      r = combine_3_weights(rweights, bit0, bit1, bit2);
68
5569      /* green component */
56      bit0 = (*color_prom >> 3) & 0x01;
57      bit1 = (*color_prom >> 4) & 0x01;
58      bit2 = (*color_prom >> 5) & 0x01;
59      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
70      bit0 = (color_prom[i] >> 3) & 0x01;
71      bit1 = (color_prom[i] >> 4) & 0x01;
72      bit2 = (color_prom[i] >> 5) & 0x01;
73      g = combine_3_weights(gweights, bit0, bit1, bit2);
74
6075      /* blue component */
61      bit0 = 0;
62      bit1 = (*color_prom >> 6) & 0x01;
63      bit2 = (*color_prom >> 7) & 0x01;
64      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
76      bit0 = (color_prom[i] >> 6) & 0x01;
77      bit1 = (color_prom[i] >> 7) & 0x01;
78      b = combine_2_weights(bweights, bit0, bit1);
6579
66      palette_set_color(machine,i,MAKE_RGB(r,g,b));
67      color_prom++;
80      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6881   }
6982
7083   /* color_prom now points to the beginning of the lookup table */
84   color_prom += 32;
7185
72   /* sprites */
73   for (i = 0;i < TOTAL_COLORS(1);i++)
74      COLOR(1,i) = *(color_prom++) & 0x0f;
86   /* characters map to the upper 16 palette entries */
87   for (i = 0; i < 0x100; i++)
88   {
89      UINT8 ctabentry = color_prom[i] & 0x0f;
90      colortable_entry_set_value(machine->colortable, i, ctabentry + 0x10);
91   }
7592
76   /* characters */
77   for (i = 0;i < TOTAL_COLORS(0);i++)
78      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
93   /* sprites map to the lower 16 palette entries */
94   for (i = 0x100; i < 0x200; i++)
95   {
96      UINT8 ctabentry = color_prom[i] & 0x0f;
97      colortable_entry_set_value(machine->colortable, i, ctabentry);
98   }
7999}
80100
81101
r1649r1650
90110{
91111   UINT8 attr = circusc_colorram[tile_index];
92112   tileinfo->category = (attr & 0x10) >> 4;
93   SET_TILE_INFO(
94         0,
95         circusc_videoram[tile_index] + ((attr & 0x20) << 3),
96         attr & 0x0f,
97         TILE_FLIPYX((attr & 0xc0) >> 6));
113   tileinfo->group = attr & 0x0f;
114
115   SET_TILE_INFO(0,
116              circusc_videoram[tile_index] + ((attr & 0x20) << 3),
117              attr & 0x0f,
118              TILE_FLIPYX((attr & 0xc0) >> 6));
98119}
99120
100121
r1649r1650
153174
154175   if ((*circusc_spritebank & 0x01) != 0)
155176      sr = spriteram;
156   else sr = spriteram_2;
177   else
178      sr = spriteram_2;
157179
158180   for (offs = 0; offs < spriteram_size;offs += 4)
159181   {
160      int sx,sy,flipx,flipy;
182      int code = sr[offs + 0] + 8 * (sr[offs + 1] & 0x20);
183      int color = sr[offs + 1] & 0x0f;
184      int sx = sr[offs + 2];
185      int sy = sr[offs + 3];
186      int flipx = sr[offs + 1] & 0x40;
187      int flipy = sr[offs + 1] & 0x80;
161188
162
163      sx = sr[offs + 2];
164      sy = sr[offs + 3];
165      flipx = sr[offs + 1] & 0x40;
166      flipy = sr[offs + 1] & 0x80;
167189      if (flip_screen)
168190      {
169191         sx = 240 - sx;
r1649r1650
174196
175197
176198      drawgfx(bitmap,machine->gfx[1],
177            sr[offs + 0] + 8 * (sr[offs + 1] & 0x20),
178            sr[offs + 1] & 0x0f,
199            code, color,
179200            flipx,flipy,
180201            sx,sy,
181            cliprect,TRANSPARENCY_COLOR,0);
182
202            cliprect,TRANSPARENCY_PENS,
203            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
183204   }
184205}
185206
r1649r1650
192213   for (i = 10;i < 32;i++)
193214      tilemap_set_scrolly(bg_tilemap,i,*circusc_scroll);
194215
216   fillbitmap(bitmap, machine->pens[0], cliprect);
195217   tilemap_draw(bitmap,cliprect,bg_tilemap,1,0);
196218   draw_sprites(machine,bitmap,cliprect);
197219   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
src/mame/video/midvunit.c
r1649r1650
55**************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/tms34010/tms34010.h"
910#include "cpu/adsp2100/adsp2100.h"
1011#include "audio/williams.h"
src/mame/video/usgames.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34UINT8 *usg_videoram,*usg_charram;
45
src/mame/video/suna16.c
r1649r1650
5858***************************************************************************/
5959
6060#include "driver.h"
61#include "deprecat.h"
6162
6263static int color_bank;
6364
src/mame/video/eolith.c
r1649r1650
6969
7070VIDEO_UPDATE( eolith )
7171{
72   copybitmap(bitmap,bitmaps[eolith_buffer ^ 1],0,0,0,0,cliprect,TRANSPARENCY_NONE, 0);
72   copybitmap(bitmap,bitmaps[eolith_buffer ^ 1],0,0,0,0,cliprect);
7373   return 0;
7474}
src/mame/video/gtia.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/m6502/m6502.h"
1314#include "includes/atari.h"
1415#include "video/gtia.h"
src/mame/video/bigevglf.c
r1649r1650
66
77***************************************************************************/
88#include "driver.h"
9#include "deprecat.h"
910
1011
1112UINT8 *bigevglf_spriteram1;
r1649r1650
8990
9091VIDEO_UPDATE( bigevglf )
9192{
92   copybitmap(bitmap,tmp_bitmap[ plane_visible ],0,0,0,0,cliprect,TRANSPARENCY_NONE, 0);
93   copybitmap(bitmap,tmp_bitmap[ plane_visible ],0,0,0,0,cliprect);
9394   draw_sprites(machine,bitmap,cliprect);
9495   return 0;
9596}
src/mame/video/commando.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT8 *commando_videoram2, *commando_colorram2;
1213
src/mame/video/atarisy2.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/atarigen.h"
910#include "slapstic.h"
1011#include "atarisy2.h"
src/mame/video/ninjakd2.c
r1649r1650
443443
444444   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
445445
446   copybitmap(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 15);
446   copybitmap_trans(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, 15);
447447
448448   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
449449
r1649r1650
458458
459459   tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
460460
461   copybitmap(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 15);
461   copybitmap_trans(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, 15);
462462
463463   tilemap_draw(bitmap, cliprect, bg2_tilemap, 0, 0);
464464
r1649r1650
477477
478478   tilemap_draw(bitmap, cliprect, bg2_tilemap, 0, 0);
479479
480   copybitmap(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 15);
480   copybitmap_trans(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, 15);
481481
482482   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
483483
src/mame/video/mjsister.c
r1649r1650
88*****************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213int mjsister_screen_redraw;
1314int mjsister_flip_screen;
r1649r1650
102103            *BITMAP_ADDR16(bitmap, i, 256+j) = machine->pens[mjsister_colorbank * 0x20];
103104      }
104105
105      copybitmap(bitmap,mjsister_tmpbitmap0,f,f,0,0,cliprect,TRANSPARENCY_NONE,0);
106      copybitmap(bitmap,mjsister_tmpbitmap1,f,f,2,0,cliprect,TRANSPARENCY_PEN,0);
106      copybitmap      (bitmap,mjsister_tmpbitmap0,f,f,0,0,cliprect);
107      copybitmap_trans(bitmap,mjsister_tmpbitmap1,f,f,2,0,cliprect,0);
107108   }
108109   else
109110      fillbitmap(bitmap, get_black_pen(machine), &machine->screen[0].visarea);
src/mame/video/yunsung8.c
r1649r1650
2828***************************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3132
3233/* Variables that driver has access to: */
3334
src/mame/video/m52.c
r0r1650
1/***************************************************************************
2
3    Irem M52 hardware
4
5***************************************************************************/
6
7#include "driver.h"
8#include "m52.h"
9#include "video/resnet.h"
10
11#define BGHEIGHT 64
12
13static UINT8 bg1xpos;
14static UINT8 bg1ypos;
15static UINT8 bg2xpos;
16static UINT8 bg2ypos;
17static UINT8 bgcontrol;
18
19static tilemap* bg_tilemap;
20
21
22/*************************************
23 *
24 *  Palette configuration
25 *
26 *************************************/
27
28PALETTE_INIT( m52 )
29{
30   const UINT8 *char_pal = color_prom + 0x000;
31   const UINT8 *back_pal = color_prom + 0x200;
32   const UINT8 *sprite_pal = color_prom + 0x220;
33   const UINT8 *sprite_table = color_prom + 0x240;
34   static const int resistances_3[3] = { 1000, 470, 220 };
35   static const int resistances_2[2]  = { 470, 220 };
36   double weights_r[3], weights_g[3], weights_b[3], scale;
37   int i;
38
39   machine->colortable = colortable_alloc(machine, 512+32+32);
40
41   /* compute palette information for characters/backgrounds */
42   scale = compute_resistor_weights(0,   255, -1.0,
43         3, resistances_3, weights_r, 0, 0,
44         3, resistances_3, weights_g, 0, 0,
45         2, resistances_2, weights_b, 0, 0);
46
47   /* character palette */
48   for (i = 0; i < 512; i++)
49   {
50      UINT8 promval = char_pal[i];
51      int r = combine_3_weights(weights_r, BIT(promval,0), BIT(promval,1), BIT(promval,2));
52      int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
53      int b = combine_2_weights(weights_b, BIT(promval,6), BIT(promval,7));
54
55      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r,g,b));
56   }
57
58   /* background palette */
59   for (i = 0; i < 32; i++)
60   {
61      UINT8 promval = back_pal[i];
62      int r = combine_3_weights(weights_r, BIT(promval,0), BIT(promval,1), BIT(promval,2));
63      int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
64      int b = combine_2_weights(weights_b, BIT(promval,6), BIT(promval,7));
65
66      colortable_palette_set_color(machine->colortable, 512+i, MAKE_RGB(r,g,b));
67   }
68
69   /* compute palette information for sprites */
70   compute_resistor_weights(0,   255, scale,
71         2, resistances_2, weights_r, 470, 0,
72         3, resistances_3, weights_g, 470, 0,
73         3, resistances_3, weights_b, 470, 0);
74
75   /* sprite palette */
76   for (i = 0; i < 32; i++)
77   {
78      UINT8 promval = sprite_pal[i];
79      int r = combine_2_weights(weights_r, BIT(promval,6), BIT(promval,7));
80      int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
81      int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
82
83      colortable_palette_set_color(machine->colortable, 512+32+i, MAKE_RGB(r,g,b));
84   }
85
86   /* character lookup table */
87   for (i = 0; i < 512; i++)
88      colortable_entry_set_value(machine->colortable, i, i);
89
90   /* sprite lookup table */
91   for (i = 0; i < 16*4; i++)
92   {
93      UINT8 promval = sprite_table[(i & 3) | ((i & ~3) << 1)];
94      colortable_entry_set_value(machine->colortable, 512+i, 512+32+promval);
95   }
96
97   /* background */
98   /* the palette is a 32x8 PROM with many colors repeated. The address of */
99   /* the colors to pick is as follows: */
100   /* xbb00: mountains */
101   /* 0xxbb: hills */
102   /* 1xxbb: city */
103   colortable_entry_set_value(machine->colortable, 512+16*4+0*4+0, 512);
104   colortable_entry_set_value(machine->colortable, 512+16*4+0*4+1, 512+4);
105   colortable_entry_set_value(machine->colortable, 512+16*4+0*4+2, 512+8);
106   colortable_entry_set_value(machine->colortable, 512+16*4+0*4+3, 512+12);
107   colortable_entry_set_value(machine->colortable, 512+16*4+1*4+0, 512);
108   colortable_entry_set_value(machine->colortable, 512+16*4+1*4+1, 512+1);
109   colortable_entry_set_value(machine->colortable, 512+16*4+1*4+2, 512+2);
110   colortable_entry_set_value(machine->colortable, 512+16*4+1*4+3, 512+3);
111   colortable_entry_set_value(machine->colortable, 512+16*4+2*4+0, 512);
112   colortable_entry_set_value(machine->colortable, 512+16*4+2*4+1, 512+16+1);
113   colortable_entry_set_value(machine->colortable, 512+16*4+2*4+2, 512+16+2);
114   colortable_entry_set_value(machine->colortable, 512+16*4+2*4+3, 512+16+3);
115}
116
117
118
119/*************************************
120 *
121 *  Tilemap info callback
122 *
123 *************************************/
124
125static TILE_GET_INFO( get_tile_info )
126{
127   UINT8 video = videoram[tile_index];
128   UINT8 color = colorram[tile_index];
129
130   int flag = 0;
131   int code = 0;
132
133   code = video;
134
135   if (color & 0x80)
136   {
137      code |= 0x100;
138   }
139
140   if (tile_index / 32 <= 6)
141   {
142      flag |= TILE_FORCE_LAYER0; /* lines 0 to 6 are opaqe? */
143   }
144
145   SET_TILE_INFO(0, code, color & 0x3f, flag);
146}
147
148
149
150/*************************************
151 *
152 *  Video startup
153 *
154 *************************************/
155
156VIDEO_START( m52 )
157{
158   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
159
160   tilemap_set_transparent_pen(bg_tilemap, 0);
161   tilemap_set_scrolldx(bg_tilemap, 128 - 1, -1);
162   tilemap_set_scrolldy(bg_tilemap, 16, 16);
163   tilemap_set_scroll_rows(bg_tilemap, 4); /* only lines 192-256 scroll */
164
165   state_save_register_global(bg1xpos);
166   state_save_register_global(bg1ypos);
167   state_save_register_global(bg2xpos);
168   state_save_register_global(bg2ypos);
169   state_save_register_global(bgcontrol);
170}
171
172
173
174/*************************************
175 *
176 *  Scroll registers
177 *
178 *************************************/
179
180WRITE8_HANDLER( m52_scroll_w )
181{
182
183/*
184    According to the schematics there is only one video register that holds the X scroll value
185    with a NAND gate on the V64 and V128 lines to control when it's read, and when
186    255 (via 8 pull up resistors) is used.
187
188    So we set the first 3 quarters to 255 and the last to the scroll value
189*/
190   tilemap_set_scrollx(bg_tilemap, 0, 255);
191   tilemap_set_scrollx(bg_tilemap, 1, 255);
192   tilemap_set_scrollx(bg_tilemap, 2, 255);
193   tilemap_set_scrollx(bg_tilemap, 3, -data);
194}
195
196
197
198/*************************************
199 *
200 *  Video RAM write handlers
201 *
202 *************************************/
203
204WRITE8_HANDLER( m52_videoram_w )
205{
206   videoram[offset] = data;
207   tilemap_mark_tile_dirty(bg_tilemap, offset);
208}
209
210
211WRITE8_HANDLER( m52_colorram_w )
212{
213   colorram[offset] = data;
214   tilemap_mark_tile_dirty(bg_tilemap, offset);
215}
216
217
218
219/*************************************
220 *
221 *  Custom protection
222 *
223 *************************************/
224
225/* This looks like some kind of protection implemented by a custom chip on the
226   scroll board. It mangles the value written to the port m52_bg1xpos_w, as
227   follows: result = popcount(value & 0x7f) ^ (value >> 7) */
228READ8_HANDLER( m52_protection_r )
229{
230   int popcount = 0;
231   int temp;
232
233   for (temp = bg1xpos & 0x7f; temp != 0; temp >>= 1)
234      popcount += temp & 1;
235   return popcount ^ (bg1xpos >> 7);
236}
237
238
239
240/*************************************
241 *
242 *  Background control write handlers
243 *
244 *************************************/
245
246WRITE8_HANDLER( m52_bg1ypos_w )
247{
248   bg1ypos = data;
249}
250
251WRITE8_HANDLER( m52_bg1xpos_w )
252{
253   bg1xpos = data;
254}
255
256WRITE8_HANDLER( m52_bg2xpos_w )
257{
258   bg2xpos = data;
259}
260
261WRITE8_HANDLER( m52_bg2ypos_w )
262{
263   bg2ypos = data;
264}
265
266WRITE8_HANDLER( m52_bgcontrol_w )
267{
268   bgcontrol = data;
269}
270
271
272
273WRITE8_HANDLER( m52_flipscreen_w )
274{
275   coin_counter_w(0, data & 0x02);
276   coin_counter_w(1, data & 0x20);
277
278   /* screen flip is handled both by software and hardware */
279
280   flip_screen_set((data ^ ~readinputport(4)) & 1);
281}
282
283
284
285/*************************************
286 *
287 *  Background rendering
288 *
289 *************************************/
290
291static void draw_background(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int xpos, int ypos, int image)
292{
293   rectangle rect;
294
295   if (flip_screen)
296   {
297      xpos = 255 - xpos;
298      ypos = 255 - ypos - BGHEIGHT;
299   }
300
301   xpos += 128;
302
303   drawgfx(bitmap, machine->gfx[image],
304      0, 0,
305      flip_screen,
306      flip_screen,
307      xpos,
308      ypos,
309      cliprect,
310      TRANSPARENCY_PEN, 0);
311
312   drawgfx(bitmap, machine->gfx[image],
313      0, 0,
314      flip_screen,
315      flip_screen,
316      xpos - 256,
317      ypos,
318      cliprect,
319      TRANSPARENCY_PEN, 0);
320
321   rect.min_x = machine->screen[0].visarea.min_x;
322   rect.max_x = machine->screen[0].visarea.max_x;
323
324   if (flip_screen)
325   {
326      rect.min_y = ypos - BGHEIGHT;
327      rect.max_y = ypos - 1;
328   }
329   else
330   {
331      rect.min_y = ypos + BGHEIGHT;
332      rect.max_y = ypos + 2 * BGHEIGHT - 1;
333   }
334
335   fillbitmap(bitmap, machine->remapped_colortable[machine->gfx[image]->color_base + 3], &rect);
336}
337
338
339
340/*************************************
341 *
342 *  Video render
343 *
344 *************************************/
345
346VIDEO_UPDATE( m52 )
347{
348   int offs;
349
350   fillbitmap(bitmap, 0, cliprect);
351
352   if (!(bgcontrol & 0x20))
353   {
354      if (!(bgcontrol & 0x10))
355         draw_background(machine, bitmap, cliprect, bg2xpos, bg2ypos, 2); /* distant mountains */
356
357      if (!(bgcontrol & 0x02))
358         draw_background(machine, bitmap, cliprect, bg1xpos, bg1ypos, 3); /* hills */
359
360      if (!(bgcontrol & 0x04))
361         draw_background(machine, bitmap, cliprect, bg1xpos, bg1ypos, 4); /* cityscape */
362   }
363
364   tilemap_set_flip(bg_tilemap, flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
365
366   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
367
368   /* draw the sprites */
369   for (offs = 0xfc; offs >= 0; offs -= 4)
370   {
371      int sy = 257 - spriteram[offs];
372      int color = spriteram[offs + 1] & 0x3f;
373      int flipx = spriteram[offs + 1] & 0x40;
374      int flipy = spriteram[offs + 1] & 0x80;
375      int code = spriteram[offs + 2];
376      int sx = spriteram[offs + 3];
377      rectangle clip;
378
379      /* sprites from offsets $00-$7F are processed in the upper half of the frame */
380      /* sprites from offsets $80-$FF are processed in the lower half of the frame */
381      clip = *cliprect;
382      if (!(offs & 0x80))
383         clip.min_y = 0, clip.max_y = 127;
384      else
385         clip.min_y = 128, clip.max_y = 255;
386
387      /* adjust for flipping */
388      if (flip_screen)
389      {
390         int temp = clip.min_y;
391         clip.min_y = 255 - clip.max_y;
392         clip.max_y = 255 - temp;
393         flipx = !flipx;
394         flipy = !flipy;
395         sx = 240 - sx;
396         sy = 257 + 11 - sy;
397      }
398
399      sx += 128;
400
401      /* in theory anyways; in practice, some of the molecule-looking guys get clipped */
402#ifdef SPLIT_SPRITES
403      sect_rect(&clip, cliprect);
404#else
405      clip = *cliprect;
406#endif
407
408      drawgfx(bitmap, machine->gfx[1],
409         code, color, flipx, flipy, sx, sy,
410         &clip, TRANSPARENCY_PENS,
411         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 512+32));
412   }
413   return 0;
414}
src/mame/video/cbuster.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "deco16ic.h"
910
1011static int twocrude_pri;
src/mame/video/jaguar.c
r1649r1650
135135****************************************************************************/
136136
137137#include "driver.h"
138#include "deprecat.h"
138139#include "profiler.h"
139140#include "machine/atarigen.h"
140141#include "cpu/mips/r3000.h"
r1649r1650
837838   }
838839
839840   /* render the object list */
840   copybitmap(bitmap, screen_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
841   copybitmap(bitmap, screen_bitmap, 0, 0, 0, 0, cliprect);
841842   return 0;
842843}
843844
src/mame/video/ojankohs.c
r1649r1650
88******************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/z80/z80.h"
1213
1314
r1649r1650
328329      ojankoc_screen_refresh = 0;
329330   }
330331
331   copybitmap(bitmap, ojankoc_tmpbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
332   copybitmap(bitmap, ojankoc_tmpbitmap, 0, 0, 0, 0, cliprect);
332333   return 0;
333334}
src/mame/video/bfm_adr2.c
r1649r1650
9191***************************************************************************/
9292
9393#include "driver.h"
94#include "deprecat.h"
9495#include "cpu/m6809/m6809.h"
9596#include "machine/bfm_bd1.h"  // vfd
9697#include "video/bfm_adr2.h"
src/mame/video/n8080.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "includes/n8080.h"
9#include <math.h>
1010
1111int spacefev_red_screen;
1212int spacefev_red_cannon;
src/mame/video/nbmj8891.c
r1649r1650
77******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "nb1413m3.h"
1112
1213
r1649r1650
553554
554555      if (gfxdraw_mode)
555556      {
556         copyscrollbitmap(bitmap, nbmj8891_tmpbitmap0, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
557         copyscrollbitmap(bitmap, nbmj8891_tmpbitmap1, 0, 0, 1, &scrolly, &machine->screen[0].visarea, TRANSPARENCY_PEN, machine->pens[0xff]);
557         copyscrollbitmap      (bitmap, nbmj8891_tmpbitmap0, 0, 0, 0, 0, cliprect);
558         copyscrollbitmap_trans(bitmap, nbmj8891_tmpbitmap1, 0, 0, 1, &scrolly, cliprect, machine->pens[0xff]);
558559      }
559560      else
560      {
561         copyscrollbitmap(bitmap, nbmj8891_tmpbitmap0, 0, 0, 1, &scrolly, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
562      }
561         copyscrollbitmap(bitmap, nbmj8891_tmpbitmap0, 0, 0, 1, &scrolly, cliprect);
563562   }
564563   else
565   {
566564      fillbitmap(bitmap, machine->pens[0xff], 0);
567   }
565
568566   return 0;
569567}
src/mame/video/liberate.c
r1649r1650
1010*******************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/m6502/m6502.h"
1415
1516static int background_color,background_disable;
src/mame/video/spdodgeb.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/m6502/m6502.h"
34
45
src/mame/video/cvs.c
r1649r1650
288288    scroll[6] = 0;
289289    scroll[7] = 0;
290290
291   copyscrollbitmap(bitmap,background_bitmap,0,0,8,scroll,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
292   copyscrollbitmap(scrolled_background,cvs_collision_background,0,0,8,scroll,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
291   copyscrollbitmap(bitmap,background_bitmap,0,0,8,scroll,&machine->screen[0].visarea);
292   copyscrollbitmap(scrolled_background,cvs_collision_background,0,0,8,scroll,&machine->screen[0].visarea);
293293
294294    /* 2636's */
295295
src/mame/video/turbo.c
r1649r1650
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "turbo.h"
910#include "video/resnet.h"
10#include <math.h>
1111
1212
1313
src/mame/video/seta.c
r1649r1650
136136***************************************************************************/
137137
138138#include "driver.h"
139#include "deprecat.h"
139140#include "sound/x1_010.h"
140141#include "seta.h"
141142
src/mame/video/tp84.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT8 *tp84_videoram2, *tp84_colorram2;
1213
src/mame/video/rohga.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "deco16ic.h"
910
1011static UINT16 * rohga_spriteram;
src/mame/video/vball.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6502/m6502.h"
1112
1213int vb_scrollx_hi=0;
src/mame/video/nemesis.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include <math.h>
8#include "deprecat.h"
99
1010UINT16 *nemesis_videoram1b;
1111UINT16 *nemesis_videoram2b;
src/mame/video/magmax.c
r1649r1650
122122   /* copy the background graphics */
123123   if (magmax_vreg & 0x40)      /* background disable */
124124   {
125      fillbitmap(bitmap, machine->pens[0], &machine->screen[0].visarea);
125      fillbitmap(bitmap, machine->pens[0], cliprect);
126126   }
127127   else
128128   {
r1649r1650
334334               color,
335335               flipx, flipy,
336336               sx, sy,
337               &machine->screen[0].visarea, TRANSPARENCY_COLOR, 31);
337               cliprect, TRANSPARENCY_COLOR, 31);
338338      }
339339   }
340
340341   if (!(magmax_vreg & 0x40))      /* background disable */
341   {
342      copybitmap(bitmap, tmpbitmap, flipscreen,flipscreen,0,0, &machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
343   }
342      copybitmap_trans(bitmap, tmpbitmap, flipscreen,flipscreen,0,0, cliprect, 0);
344343
345344
346345   /* draw the foreground characters */
r1649r1650
366365               0,
367366               flipscreen, flipscreen,
368367               8 * sx, 8 * sy,
369               &machine->screen[0].visarea, TRANSPARENCY_PEN, 15);
368               cliprect, TRANSPARENCY_PEN, 15);
370369      }
371370   }
372371   return 0;
src/mame/video/deco16ic.c
r1649r1650
140140***************************************************************************/
141141
142142#include "driver.h"
143#include "deprecat.h"
143144#include "deco16ic.h"
144145#include "ui.h"
145146
src/mame/video/1942.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112
1213UINT8 *c1942_fgvideoram;
src/mame/video/fromanc2.c
r1649r1650
77******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112static int fromanc2_scrollx[2][4], fromanc2_scrolly[2][4];
1213static int fromanc2_gfxbank[2][4];
src/mame/video/unico.c
r1649r1650
3737***************************************************************************/
3838
3939#include "driver.h"
40#include "deprecat.h"
4041#include "unico.h"
4142
4243/* Variables needed by drivers: */
src/mame/video/realbrk.c
r1649r1650
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "realbrk.h"
2425
2526//UINT16 *realbrk_vram_0, *realbrk_vram_1, *realbrk_vram_2, *realbrk_vregs;
r1649r1650
323324                           (rot & 1 ? scaley : scalex) << 12, (rot & 1 ? scalex : scaley) << 12);
324325
325326               // peek at the unrotated sprite
326               // copybitmap( bitmap,tmpbitmap0, 0,0, 50+(x * xdim/0x10000),50+(y * ydim/0x10000), cliprect, TRANSPARENCY_PEN, 0 );
327               // copybitmap_trans( bitmap,tmpbitmap0, 0,0, 50+(x * xdim/0x10000),50+(y * ydim/0x10000), cliprect, 0 );
327328            }
328329
329330            switch( rot )
r1649r1650
341342                     currx = (sx - (y+1) * ydim) / 0x10000;
342343                     curry = (sy + x * xdim) / 0x10000;
343344
344                     copybitmap( bitmap,tmpbitmap1, 0,0, currx,curry, cliprect, TRANSPARENCY_PEN, 0 );
345                     copybitmap_trans( bitmap,tmpbitmap1, 0,0, currx,curry, cliprect, 0 );
345346                  break;
346347
347348               case 0x20: // rot 180
r1649r1650
357358                     currx = (sx - (x+1) * xdim) / 0x10000;
358359                     curry = (sy - (y+1) * ydim) / 0x10000;
359360
360                     copybitmap( bitmap,tmpbitmap1, 0,0, currx,curry, cliprect, TRANSPARENCY_PEN, 0 );
361                     copybitmap_trans( bitmap,tmpbitmap1, 0,0, currx,curry, cliprect, 0 );
361362                  break;
362363
363364               case 0x30: // rot 270
r1649r1650
373374                     currx = (sx + y * ydim) / 0x10000;
374375                     curry = (sy - (x+1) * xdim) / 0x10000;
375376
376                     copybitmap( bitmap,tmpbitmap1, 0,0, currx,curry, cliprect, TRANSPARENCY_PEN, 0 );
377                     copybitmap_trans( bitmap,tmpbitmap1, 0,0, currx,curry, cliprect, 0 );
377378                  break;
378379
379380               default:
src/mame/video/diverboy.c
r1649r1650
11/* Diver Boy - Video Hardware */
22
33#include "driver.h"
4#include "deprecat.h"
45
56UINT16 *diverboy_spriteram;
67size_t diverboy_spriteram_size;
src/mame/video/carjmbre.c
r1649r1650
44*/
55
66#include "driver.h"
7#include "deprecat.h"
78
89static tilemap *carjmbre_tilemap;
910
src/mame/video/battlera.c
r1649r1650
88*******************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/h6280/h6280.h"
1213
1314static int HuC6270_registers[20];
r1649r1650
364365   scrollx=-HuC6270_registers[7];
365366   scrolly=-HuC6270_registers[8]+clip->min_y-1;
366367
367   copyscrollbitmap(bitmap,tile_bitmap,1,&scrollx,1,&scrolly,clip,TRANSPARENCY_NONE,0);
368   copyscrollbitmap(bitmap,tile_bitmap,1,&scrollx,1,&scrolly,clip);
368369
369370   /* Todo:  Background enable (not used anyway) */
370371
r1649r1650
372373   if (sb_enable) draw_sprites(machine,bitmap,clip,0);
373374
374375   /* Render background over sprites */
375   copyscrollbitmap(bitmap,front_bitmap,1,&scrollx,1,&scrolly,clip,TRANSPARENCY_COLOR,256);
376   copyscrollbitmap_trans(bitmap,front_bitmap,1,&scrollx,1,&scrolly,clip,machine->pens[256]);
376377
377378   /* Render high priority sprites, if enabled */
378379   if (sb_enable) draw_sprites(machine,bitmap,clip,1);
src/mame/video/namcos1.c
r1649r1650
55*******************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910
1011/*
src/mame/video/gundealr.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112
1213
src/mame/video/m62.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "m62.h"
1718#include "video/resnet.h"
1819
1920UINT8 *m62_tileram;
r1649r1650
5152        -- 1  kohm resistor  -- RED/GREEN/BLUE
5253  bit 0 -- 2.2kohm resistor  -- RED/GREEN/BLUE
5354
55  The resistor values could be verified on a hires pcb picture (spelunkr).
56  The schematics also exhibit one pulldown for the sprite color guns.
57  Since only either the sprite or tile gun is active, i.e. the other is
58  in tri-state, this pulldown resistor also applies to the tile color guns.
59
60  Which of the sprite/tilemap color guns is in tri-state mode is determined
61  by a pal. There is no good dump of this pal. If both sprite and tilemap
62  should be active (i.e. not in tristate) at a time, this would due to the
63  pulldown resistor have slightly darker colors as a consequence.
64
65  This can explain the spelunkr bug m62_0116u4gre.
66
67  The kidnike bug kidniki0104u3gre even looks worse and may imho only explained
68  by subpixel effects, i.e. delays when switching the proms into tristate.
69
70  Since there are no dumps of the "priority" pal, the above is
71  speculation.
72
73  Priority PAL
74
75  The PAL is at location 4F on the "T" board. The PAL's input are 3 bits
76  from tilemap 0, 3 bits from tilemap 1 and A11-A14:
77
78  CB0A =>   7     20  GND
79  CB1A =>   8?    14  ==> PROM CS
80  CB2A =>   9  P  19  ==> Tilemap select 0/1 / to connector
81  C14A =>  12  A  11  <== Sprite priority out / to connector
82  C13A =>   4  L  18? ==> Sprite priority in / to connector
83  C12A =>   5     10  GND
84  C11A =>   6
85  CB0D =>   1
86  CB1D =>   2
87  CB2D =>   3
88
5489***************************************************************************/
5590
5691
r1649r1650
5893{
5994   RES_NET_VCC_5V | RES_NET_VIN_TTL_OUT,
6095   {
61      { RES_NET_AMP_NONE, 0, 0, 4, { 22000, 1000, 470, 220 } },
62      { RES_NET_AMP_NONE, 0, 0, 4, { 22000, 1000, 470, 220 } },
63      { RES_NET_AMP_NONE, 0, 0, 4, { 22000, 1000, 470, 220 } }
96      { RES_NET_AMP_NONE, 0, 470, 4, { 2200, 1000, 470, 220 } },
97      { RES_NET_AMP_NONE, 0, 470, 4, { 2200, 1000, 470, 220 } },
98      { RES_NET_AMP_NONE, 0, 470, 4, { 2200, 1000, 470, 220 } }
6499   }
65100};
66101
r1649r1650
69104{
70105   RES_NET_VCC_5V | RES_NET_VIN_TTL_OUT,
71106   {
72      { RES_NET_AMP_NONE, 0, 470, 4, { 22000, 1000, 470, 220 } },
73      { RES_NET_AMP_NONE, 0, 470, 4, { 22000, 1000, 470, 220 } },
74      { RES_NET_AMP_NONE, 0, 470, 4, { 22000, 1000, 470, 220 } }
107      { RES_NET_AMP_NONE, 0, 470, 4, { 2200, 1000, 470, 220 } },
108      { RES_NET_AMP_NONE, 0, 470, 4, { 2200, 1000, 470, 220 } },
109      { RES_NET_AMP_NONE, 0, 470, 4, { 2200, 1000, 470, 220 } }
75110   }
76111};
77112
src/mame/video/astrocde.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/z80/z80.h"
910#include "includes/astrocde.h"
1011#include "sound/astrocde.h"
src/mame/video/megazone.c
r1649r1650
141141      }
142142
143143
144      copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
144      copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect);
145145   }
146146
147147
r1649r1650
165165               spriteram[offs + 0] & 0x0f,
166166               flipx,flipy,
167167               sx,sy,
168               &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
168               cliprect,TRANSPARENCY_COLOR,0);
169169      }
170170   }
171171
r1649r1650
198198               (megazone_colorram2[offs] & 0x0f) + 0x10,
199199               flipx,flipy,
200200               8*sx,8*sy,
201               0,TRANSPARENCY_NONE,0);
201               cliprect,TRANSPARENCY_NONE,0);
202202         offs++;
203203      }
204204   }
src/mame/video/40love.c
r1649r1650
333333   }
334334
335335   if (pixram_sel)
336      copybitmap(bitmap,pixel_bitmap1,f,f,fortyl_xoffset,0,cliprect,TRANSPARENCY_NONE,0);
336      copybitmap(bitmap,pixel_bitmap1,f,f,fortyl_xoffset,0,cliprect);
337337   else
338      copybitmap(bitmap,pixel_bitmap2,f,f,fortyl_xoffset,0,cliprect,TRANSPARENCY_NONE,0);
338      copybitmap(bitmap,pixel_bitmap2,f,f,fortyl_xoffset,0,cliprect);
339339}
340340
341341VIDEO_UPDATE( fortyl )
src/mame/video/nbmj8688.c
r1649r1650
77******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "nb1413m3.h"
1112
1213
r1649r1650
697698      if (mjsikaku_flipscreen) scrolly =   mjsikaku_scrolly;
698699      else                     scrolly = (-mjsikaku_scrolly) & 0xff;
699700
700      copybitmap(bitmap, mjsikaku_tmpbitmap, 0, 0, 0, scrolly,       cliprect, TRANSPARENCY_NONE, 0);
701      copybitmap(bitmap, mjsikaku_tmpbitmap, 0, 0, 0, scrolly - 256, cliprect, TRANSPARENCY_NONE, 0);
701      copybitmap(bitmap, mjsikaku_tmpbitmap, 0, 0, 0, scrolly,       cliprect);
702      copybitmap(bitmap, mjsikaku_tmpbitmap, 0, 0, 0, scrolly - 256, cliprect);
702703   }
703704   else
704705   {
src/mame/video/psychic5.c
r1649r1650
66***************************************************************************/
77
88#include "driver.h"
9#include "deprecat.h"
910#include "jalblend.c"
1011
1112#define   BG_SCROLLX_LSB      0x308
src/mame/video/taito_h.c
r1649r1650
4646***************************************************************************/
4747
4848#include "driver.h"
49#include "deprecat.h"
4950#include "taitoic.h"
5051
5152
src/mame/video/ginganin.c
r1649r1650
5858**************************************************************************/
5959
6060#include "driver.h"
61#include "deprecat.h"
6162
6263/* Variables only used here */
6364static tilemap *bg_tilemap, *fg_tilemap, *tx_tilemap;
src/mame/video/quasar.c
r1649r1650
182182
183183    /* Update screen */
184184
185   copybitmap(bitmap,effect_bitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
186   copybitmap(bitmap,background_bitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN,0);
185   copybitmap      (bitmap,effect_bitmap,    0,0,0,0,cliprect);
186   copybitmap_trans(bitmap,background_bitmap,0,0,0,0,cliprect,0);
187187
188188    /* 2636's */
189189
src/mame/video/vsnes.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/ppu2c0x.h"
34
45/* from machine */
src/mame/video/victory.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "victory.h"
910
1011
src/mame/video/1943.c
r1649r1650
11#include "driver.h"
22
3#define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
4#define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
5
63UINT8 *c1943_scrollx;
74UINT8 *c1943_scrolly;
85UINT8 *c1943_bgscrollx;
r1649r1650
2522  bit 0 -- 2.2kohm resistor  -- RED/GREEN/BLUE
2623
2724***************************************************************************/
25
2826PALETTE_INIT( 1943 )
2927{
3028   int i;
3129
32   for (i = 0; i < machine->drv->total_colors; i++)
30   /* allocate the colortable */
31   machine->colortable = colortable_alloc(machine, 0x100);
32
33   for (i = 0; i < 0x100; i++)
3334   {
34      int bit0, bit1, bit2, bit3, r, g, b;
35      int bit0, bit1, bit2, bit3;
36      int r, g, b;
3537
36      bit0 = (color_prom[i] >> 0) & 0x01;
37      bit1 = (color_prom[i] >> 1) & 0x01;
38      bit2 = (color_prom[i] >> 2) & 0x01;
39      bit3 = (color_prom[i] >> 3) & 0x01;
40
38      /* red component */
39      bit0 = (color_prom[i + 0x000] >> 0) & 0x01;
40      bit1 = (color_prom[i + 0x000] >> 1) & 0x01;
41      bit2 = (color_prom[i + 0x000] >> 2) & 0x01;
42      bit3 = (color_prom[i + 0x000] >> 3) & 0x01;
4143      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
4244
43      bit0 = (color_prom[i + machine->drv->total_colors] >> 0) & 0x01;
44      bit1 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01;
45      bit2 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01;
46      bit3 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01;
47
45      /* green component */
46      bit0 = (color_prom[i + 0x100] >> 0) & 0x01;
47      bit1 = (color_prom[i + 0x100] >> 1) & 0x01;
48      bit2 = (color_prom[i + 0x100] >> 2) & 0x01;
49      bit3 = (color_prom[i + 0x100] >> 3) & 0x01;
4850      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
4951
50      bit0 = (color_prom[i + 2*machine->drv->total_colors] >> 0) & 0x01;
51      bit1 = (color_prom[i + 2*machine->drv->total_colors] >> 1) & 0x01;
52      bit2 = (color_prom[i + 2*machine->drv->total_colors] >> 2) & 0x01;
53      bit3 = (color_prom[i + 2*machine->drv->total_colors] >> 3) & 0x01;
54
52      /* blue component */
53      bit0 = (color_prom[i + 0x200] >> 0) & 0x01;
54      bit1 = (color_prom[i + 0x200] >> 1) & 0x01;
55      bit2 = (color_prom[i + 0x200] >> 2) & 0x01;
56      bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
5557      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
5658
57      palette_set_color(machine, i, MAKE_RGB(r, g, b));
59      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5860   }
5961
60   color_prom += 3*machine->drv->total_colors;
6162   /* color_prom now points to the beginning of the lookup table */
63   color_prom += 0x300;
6264
63   /* characters use colors 64-79 */
64   for (i = 0;i < TOTAL_COLORS(0);i++)
65      COLOR(0,i) = *(color_prom++) + 64;
66   color_prom += 128;   /* skip the bottom half of the PROM - not used */
65   /* characters use colors 0x40-0x4f */
66   for (i = 0x00; i < 0x80; i++)
67   {
68      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x40;
69      colortable_entry_set_value(machine->colortable, i, ctabentry);
70   }
6771
68   /* foreground tiles use colors 0-63 */
69   for (i = 0;i < TOTAL_COLORS(1);i++)
72   /* foreground tiles use colors 0x00-0x3f */
73   for (i = 0x80; i < 0x180; i++)
7074   {
71      /* color 0 MUST map to pen 0 in order for transparency to work */
72      if (i % machine->gfx[1]->color_granularity == 0)
73         COLOR(1,i) = 0;
74      else
75         COLOR(1,i) = color_prom[0] + 16 * (color_prom[256] & 0x03);
76      color_prom++;
75      UINT8 ctabentry = ((color_prom[0x200 + (i - 0x080)] & 0x03) << 4) |
76                      ((color_prom[0x100 + (i - 0x080)] & 0x0f) << 0);
77      colortable_entry_set_value(machine->colortable, i, ctabentry);
7778   }
78   color_prom += TOTAL_COLORS(1);
7979
80   /* background tiles use colors 0-63 */
81   for (i = 0;i < TOTAL_COLORS(2);i++)
80   /* background tiles also use colors 0x00-0x3f */
81   for (i = 0x180; i < 0x280; i++)
8282   {
83      COLOR(2,i) = color_prom[0] + 16 * (color_prom[256] & 0x03);
84      color_prom++;
83      UINT8 ctabentry = ((color_prom[0x400 + (i - 0x180)] & 0x03) << 4) |
84                      ((color_prom[0x300 + (i - 0x180)] & 0x0f) << 0);
85      colortable_entry_set_value(machine->colortable, i, ctabentry);
8586   }
86   color_prom += TOTAL_COLORS(2);
8787
88   /* sprites use colors 128-255 */
89   /* bit 3 of BMPROM.07 selects priority over the background, but we handle */
90   /* it differently for speed reasons */
91   for (i = 0;i < TOTAL_COLORS(3);i++)
88   /* sprites use colors 0x80-0xff
89       bit 3 of BMPROM.07 selects priority over the background,
90       but we handle it differently for speed reasons */
91   for (i = 0x280; i < 0x380; i++)
9292   {
93      COLOR(3,i) = color_prom[0] + 16 * (color_prom[256] & 0x07) + 128;
94      color_prom++;
93      UINT8 ctabentry = ((color_prom[0x600 + (i - 0x280)] & 0x07) << 4) |
94                      ((color_prom[0x500 + (i - 0x280)] & 0x0f) << 0) | 0x80;
95      colortable_entry_set_value(machine->colortable, i, ctabentry);
9596   }
96   color_prom += TOTAL_COLORS(3);
9797}
9898
9999WRITE8_HANDLER( c1943_videoram_w )
r1649r1650
165165   int color = (attr & 0x3c) >> 2;
166166   int flags = TILE_FLIPYX((attr & 0xc0) >> 6);
167167
168   tileinfo->group = color;
168169   SET_TILE_INFO(1, code, color, flags);
169170}
170171
r1649r1650
188189   fg_tilemap = tilemap_create(c1943_get_fg_tile_info, tilemap_scan_rows,
189190      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
190191
191   tilemap_set_transparent_pen(bg_tilemap, 0);
192   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[1], 0x0f);
192193   tilemap_set_transparent_pen(fg_tilemap, 0);
193194}
194195
src/mame/video/pacland.c
r1649r1650
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829
2930
3031UINT8 *pacland_videoram,*pacland_videoram2,*pacland_spriteram;
src/mame/video/cninja.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "deco16ic.h"
910#include "cninja.h"
1011
src/mame/video/popper.c
r1649r1650
44*/
55
66#include "driver.h"
7#include "deprecat.h"
78
89static tilemap *popper_p123_tilemap, *popper_p0_tilemap, *popper_ol_p123_tilemap, *popper_ol_p0_tilemap;
910UINT8 *popper_videoram, *popper_attribram, *popper_ol_videoram, *popper_ol_attribram, *popper_spriteram;
src/mame/video/ddrible.c
r1649r1650
2525PALETTE_INIT( ddrible )
2626{
2727   int i;
28   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
29   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3028
29   /* allocate the colortable */
30   machine->colortable = colortable_alloc(machine, 0x40);
3131
32   /* build the lookup table for sprites. Palette is dynamic. */
33   for (i = 0;i < TOTAL_COLORS(3);i++)
34      COLOR(3,i) = (*(color_prom++) & 0x0f);
32   for (i = 0x10; i < 0x40; i++)
33      colortable_entry_set_value(machine->colortable, i, i);
34
35   /* sprite #2 uses pens 0x00-0x0f */
36   for (i = 0x40; i < 0x140; i++)
37   {
38      UINT8 ctabentry = color_prom[i - 0x40] & 0x0f;
39      colortable_entry_set_value(machine->colortable, i, ctabentry);
40   }
3541}
3642
43
44static void set_pens(running_machine *machine)
45{
46   int i;
47
48   for (i = 0x00; i < 0x80; i += 2)
49   {
50      UINT16 data = paletteram[i | 1] | (paletteram[i] << 8);
51
52      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
53
54      colortable_palette_set_color(machine->colortable, i >> 1, color);
55   }
56}
57
58
3759WRITE8_HANDLER( K005885_0_w )
3860{
3961   switch (offset){
r1649r1650
230252
231253VIDEO_UPDATE( ddrible )
232254{
255   set_pens(machine);
256
233257   tilemap_set_flip(fg_tilemap, (ddribble_vregs[0][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
234258   tilemap_set_flip(bg_tilemap, (ddribble_vregs[1][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
235259
src/mame/video/djboy.c
r1649r1650
44 * video hardware for DJ Boy
55 */
66#include "driver.h"
7#include "deprecat.h"
78#include "kan_pand.h"
89
910static UINT8 djboy_videoreg, djboy_scrollx, djboy_scrolly;
src/mame/video/sidearms.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112extern int sidearms_gameid;
1213
src/mame/video/tumblep.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "deco16ic.h"
1819
1920static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
src/mame/video/dogfgt.c
r1649r1650
238238
239239   draw_sprites(machine, bitmap, cliprect);
240240
241   copybitmap(bitmap,pixbitmap,0,0,0,0,cliprect,TRANSPARENCY_COLOR,PIXMAP_COLOR_BASE + 8*pixcolor);
241   copybitmap_trans(bitmap,pixbitmap,0,0,0,0,cliprect,machine->pens[PIXMAP_COLOR_BASE + 8*pixcolor]);
242242   return 0;
243243}
src/mame/video/dietgo.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "deco16ic.h"
34
45static void draw_sprites(running_machine* machine, mame_bitmap *bitmap,const rectangle *cliprect)
src/mame/video/taitosj.c
r1649r1650
714714            scrolly[i]      = -taitosj_colscrolly[32 * which + i] - taitosj_scroll[2 * which + 1];
715715      }
716716
717      copyscrollbitmap(bitmap, taitosj_layer_bitmap[which], 1, &scrollx, 32, scrolly, cliprect, TRANSPARENCY_COLOR,0);
717      copyscrollbitmap_trans(bitmap, taitosj_layer_bitmap[which], 1, &scrollx, 32, scrolly, cliprect, machine->pens[0]);
718718
719719      /* store parts covered with sprites for sprites/layers collision detection */
720720      for (i = 0; i < 0x20; i++)
r1649r1650
722722         if ((i >= 0x10) && (i <= 0x17)) continue; /* no sprites here */
723723
724724         if (sprites_on[i])
725            copyscrollbitmap(sprite_layer_collbitmap2[which], taitosj_layer_bitmap[which], 1, &scrollx, 32, scrolly, &sprite_areas[i], TRANSPARENCY_NONE,0);
725            copyscrollbitmap(sprite_layer_collbitmap2[which], taitosj_layer_bitmap[which], 1, &scrollx, 32, scrolly, &sprite_areas[i]);
726726      }
727727   }
728728}
r1649r1650
758758      }
759759
760760      scrolly = taitosj_scroll[2 * which + 1];   /* always 0 */
761      copyscrollbitmap(bitmap, taitosj_layer_bitmap[which], 32 * 8, scrollx, 1, &scrolly, cliprect, TRANSPARENCY_COLOR, 0);
761      copyscrollbitmap_trans(bitmap, taitosj_layer_bitmap[which], 32 * 8, scrollx, 1, &scrolly, cliprect, machine->pens[0]);
762762
763763      /* store parts covered with sprites for sprites/layers collision detection */
764764      for (i = 0; i < 0x20; i++)
r1649r1650
766766         if ((i >= 0x10) && (i <= 0x17)) continue; /* no sprites here */
767767
768768         if (sprites_on[i])
769            copyscrollbitmap(sprite_layer_collbitmap2[which], taitosj_layer_bitmap[which], 32 * 8, scrollx, 1, &scrolly, &sprite_areas[i], TRANSPARENCY_NONE,0);
769            copyscrollbitmap(sprite_layer_collbitmap2[which], taitosj_layer_bitmap[which], 32 * 8, scrollx, 1, &scrolly, &sprite_areas[i]);
770770      }
771771   }
772772}
src/mame/video/vigilant.c
r1649r1650
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819
1920
2021static const rectangle bottomvisiblearea =
r1649r1650
228229      rear_refresh=0;
229230   }
230231
231   copyscrollbitmap(bitmap,bg_bitmap,1,&scrollx,0,0,&bottomvisiblearea,TRANSPARENCY_NONE,0);
232   copyscrollbitmap(bitmap,bg_bitmap,1,&scrollx,0,0,&bottomvisiblearea);
232233}
233234
234235
src/mame/video/avgdvg.c
r1649r1650
1212**************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "avgdvg.h"
1617#include "video/vector.h"
1718
src/mame/video/nbmj8991.c
r1649r1650
77******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "nb1413m3.h"
1112
1213
r1649r1650
334335         scrolly =  (( nbmj8991_scrolly) + 0x0f1) & 0x1ff;
335336      }
336337
337      copyscrollbitmap(bitmap, nbmj8991_tmpbitmap, 1, &scrollx, 1, &scrolly, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
338      copyscrollbitmap(bitmap, nbmj8991_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect);
338339   }
339340   else
340   {
341341      fillbitmap(bitmap, machine->pens[0x00], 0);
342   }
342
343343   return 0;
344344}
345345
r1649r1650
375375         scrolly =  (( nbmj8991_scrolly) + 0x0f1) & 0x1ff;
376376      }
377377
378      copyscrollbitmap(bitmap, nbmj8991_tmpbitmap, 1, &scrollx, 1, &scrolly, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
378      copyscrollbitmap(bitmap, nbmj8991_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect);
379379   }
380380   else
381   {
382381      fillbitmap(bitmap, machine->pens[0x00], 0);
383   }
382
384383   return 0;
385384}
src/mame/video/blockout.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34
45
r1649r1650
107108
108109VIDEO_UPDATE( blockout )
109110{
110   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
111   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect);
111112
112113   {
113114      int x,y;
src/mame/video/f1gp.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/konamiic.h"
3//#include "f1gp.h"
44
55
66UINT16 *f1gp_spr1vram,*f1gp_spr2vram,*f1gp_spr1cgram,*f1gp_spr2cgram;
src/mame/video/namcos2.c
r1649r1650
11/* video hardware for Namco System II */
22
33#include "driver.h"
4#include "deprecat.h"
45#include "namcos2.h"
56#include "namcoic.h"
67
src/mame/video/exidy440.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "exidy440.h"
910
1011#define SPRITE_COUNT      40
src/mame/video/tx1.c
r1649r1650
44
55****************************************************************************/
66#include "driver.h"
7#include "deprecat.h"
78#include "profiler.h"
89#include "render.h"
910#include "cpu/i86/i86.h"
src/mame/video/dassault.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "deco16ic.h"
910
1011/******************************************************************************/
src/mame/video/gotya.c
r1649r1650
11#include "driver.h"
2#include "video/resnet.h"
23
34UINT8 *gotya_scroll;
45UINT8 *gotya_videoram2;
r1649r1650
1112
1213  Convert the color PROMs into a more useable format.
1314
14  I'm using Pac Man resistor values
15
1615***************************************************************************/
1716PALETTE_INIT( gotya )
1817{
18   static const int resistances_rg[3] = { 1000, 470, 220 };
19   static const int resistances_b [2] = { 470, 220 };
20   double rweights[3], gweights[3], bweights[2];
1921   int i;
2022
21   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
22   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
23   /* compute the color output resistor weights */
24   compute_resistor_weights(0,   255, -1.0,
25         3, &resistances_rg[0], rweights, 0, 0,
26         3, &resistances_rg[0], gweights, 0, 0,
27         2, &resistances_b[0],  bweights, 0, 0);
2328
24   for (i = 0; i < machine->drv->total_colors; i++)
29   /* allocate the colortable */
30   machine->colortable = colortable_alloc(machine, 32);
31
32   /* create a lookup table for the palette */
33   for (i = 0; i < 0x20; i++)
2534   {
26      int bit0, bit1, bit2, r, g, b;
35      int bit0, bit1, bit2;
36      int r, g, b;
2737
2838      /* red component */
39      bit0 = (color_prom[i] >> 0) & 0x01;
40      bit1 = (color_prom[i] >> 1) & 0x01;
41      bit2 = (color_prom[i] >> 2) & 0x01;
42      r = combine_3_weights(rweights, bit0, bit1, bit2);
2943
30      bit0 = (*color_prom >> 0) & 0x01;
31      bit1 = (*color_prom >> 1) & 0x01;
32      bit2 = (*color_prom >> 2) & 0x01;
33
34      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
35
3644      /* green component */
45      bit0 = (color_prom[i] >> 3) & 0x01;
46      bit1 = (color_prom[i] >> 4) & 0x01;
47      bit2 = (color_prom[i] >> 5) & 0x01;
48      g = combine_3_weights(gweights, bit0, bit1, bit2);
3749
38      bit0 = (*color_prom >> 3) & 0x01;
39      bit1 = (*color_prom >> 4) & 0x01;
40      bit2 = (*color_prom >> 5) & 0x01;
41
42      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
43
4450      /* blue component */
51      bit0 = (color_prom[i] >> 6) & 0x01;
52      bit1 = (color_prom[i] >> 7) & 0x01;
53      b = combine_2_weights(bweights, bit0, bit1);
4554
46      bit0 = 0;
47      bit1 = (*color_prom >> 6) & 0x01;
48      bit2 = (*color_prom >> 7) & 0x01;
49
50      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
51
52      palette_set_color(machine, i, MAKE_RGB(r, g, b));
53
54      color_prom++;
55      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5556   }
5657
57   color_prom += 0x18;
5858   /* color_prom now points to the beginning of the lookup table */
59   color_prom += 32;
5960
60   /* character lookup table */
61   /* sprites use the same color lookup table as characters */
62
63   for (i = 0; i < TOTAL_COLORS(0); i++)
61   for (i = 0; i < 0x40; i++)
6462   {
65      COLOR(0, i) = *(color_prom++) & 0x07;
63      UINT8 ctabentry = color_prom[i] & 0x07;
64      colortable_entry_set_value(machine->colortable, i, ctabentry);
6665   }
6766}
6867
src/mame/video/tatsumi.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "tatsumi.h"
3#include <math.h>
44
55static tilemap *tx_layer;
66static tilemap *layer0, *layer1, *layer2, *layer3;
src/mame/video/supbtime.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "deco16ic.h"
1718
1819/******************************************************************************/
src/mame/video/konamiic.c
r1649r1650
11491149***************************************************************************/
11501150
11511151#include "driver.h"
1152#include "deprecat.h"
11521153#include "video/konamiic.h"
11531154
11541155#define VERBOSE 0
r1649r1650
12981299 *
12991300 */
13001301
1301void K007121_sprites_draw(running_machine *machine, int chip,mame_bitmap *bitmap,const rectangle *cliprect,
1302      const UINT8 *source,int base_color,int global_x_offset,int bank_base,
1303      UINT32 pri_mask)
1302void K007121_sprites_draw(int chip,mame_bitmap *bitmap,gfx_element **gfxs, colortable_t *ctable,
1303                    const rectangle *cliprect, const UINT8 *source,int base_color,
1304                    int global_x_offset,int bank_base, UINT32 pri_mask)
13041305{
1305   const gfx_element *gfx = machine->gfx[chip];
1306   const gfx_element *gfx = gfxs[chip];
13061307   int flipscreen = K007121_flipscreen[chip];
13071308   int i,num,inc,offs[5],trans;
1308   int is_flakatck = K007121_ctrlram[chip][0x06] & 0x04;   /* WRONG!!!! */
1309   int is_flakatck = (ctable == NULL);
13091310
13101311#if 0
13111312popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x  %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x",
r1649r1650
13501351      offs[2] = 0x02;
13511352      offs[3] = 0x03;
13521353      offs[4] = 0x04;
1353      trans = TRANSPARENCY_COLOR;
1354      trans = TRANSPARENCY_PENS;
13541355      /* when using priority buffer, draw front to back */
13551356      if (pri_mask != -1)
13561357      {
r1649r1650
13701371      int yflip = source[offs[4]] & 0x20;      /* flip y */
13711372      int color = base_color + ((source[offs[1]] & 0xf0) >> 4);
13721373      int width,height;
1374      int transparent_color;
13731375      static const int x_offset[4] = {0x0,0x1,0x4,0x5};
13741376      static const int y_offset[4] = {0x0,0x2,0x8,0xa};
13751377      int x,y, ex, ey;
r1649r1650
13811383      number = number << 2;
13821384      number += (sprite_bank >> 2) & 3;
13831385
1386      if (trans == TRANSPARENCY_PEN)
1387         transparent_color = 0;
1388      else
1389         transparent_color = colortable_get_transpen_mask(ctable, gfx, color, 0);
1390
13841391      if (!is_flakatck || source[0x00])   /* Flak Attack needs this */
13851392      {
13861393         number += bank_base;
r1649r1650
14121419                        color,
14131420                        !xflip,!yflip,
14141421                        248-(sx+x*8),248-(sy+y*8),
1415                        cliprect,trans,0,
1422                        cliprect,trans,transparent_color,
14161423                        pri_mask);
14171424                  else
14181425                     drawgfx(bitmap,gfx,
r1649r1650
14201427                        color,
14211428                        !xflip,!yflip,
14221429                        248-(sx+x*8),248-(sy+y*8),
1423                        cliprect,trans,0);
1430                        cliprect,trans,transparent_color);
14241431               }
14251432               else
14261433               {
r1649r1650
14301437                        color,
14311438                        xflip,yflip,
14321439                        global_x_offset+sx+x*8,sy+y*8,
1433                        cliprect,trans,0,
1440                        cliprect,trans,transparent_color,
14341441                        pri_mask);
14351442                  else
14361443                     drawgfx(bitmap,gfx,
r1649r1650
14381445                        color,
14391446                        xflip,yflip,
14401447                        global_x_offset+sx+x*8,sy+y*8,
1441                        cliprect,trans,0);
1448                        cliprect,trans,transparent_color);
14421449               }
14431450            }
14441451         }
src/mame/video/blmbycar.c
r1649r1650
2929***************************************************************************/
3030
3131#include "driver.h"
32#include "deprecat.h"
3233
3334/* Variables needed by driver: */
3435
src/mame/video/konamiic.h
r1649r1650
1111void K007121_ctrl_w(int chip,int offset,int data);
1212WRITE8_HANDLER( K007121_ctrl_0_w );
1313WRITE8_HANDLER( K007121_ctrl_1_w );
14void K007121_sprites_draw(running_machine *machine,int chip,mame_bitmap *bitmap,const rectangle *cliprect,
15      const UINT8 *source,int base_color,int global_x_offset,int bank_base,
16      UINT32 pri_mask);
14void K007121_sprites_draw(int chip,mame_bitmap *bitmap,gfx_element **gfxs, colortable_t *ctable,
15                    const rectangle *cliprect, const UINT8 *source,int base_color,
16                    int global_x_offset,int bank_base, UINT32 pri_mask);
1717
1818
1919void K007342_vh_start(int gfx_index, void (*callback)(int layer,int bank,int *code,int *color,int *flags));
src/mame/video/harddriv.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/tms34010/tms34010.h"
910#include "cpu/tms34010/34010ops.h"
1011#include "harddriv.h"
src/mame/video/m72.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "audio/m72.h"
34#include "m72.h"
45
src/mame/video/snk68.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617
1718static int sprite_flip, pow_charbase=0; //*
1819static tilemap *fix_tilemap;
src/mame/video/crgolf.c
r1649r1650
88#include "crgolf.h"
99
1010
11#define NUM_PENS      (0x20)
12#define VIDEORAM_SIZE   (0x2000 * 3)
13
14
1115/* globals */
1216UINT8 *crgolf_color_select;
1317UINT8 *crgolf_screen_flip;
r1649r1650
1721
1822
1923/* local variables */
20static mame_bitmap *screena;
21static mame_bitmap *screenb;
22static mame_bitmap *highbit;
24static UINT8 *crgolf_videoram_a;
25static UINT8 *crgolf_videoram_b;
2326
2427
2528
2629/*************************************
2730 *
28 *  Video RAM writes
31 *  Video RAM access
2932 *
3033 *************************************/
3134
32WRITE8_HANDLER( crgolf_videoram_bit0_w )
35WRITE8_HANDLER( crgolf_videoram_w )
3336{
34   mame_bitmap *screen = (*crgolf_screen_select & 1) ? screenb : screena;
35   int x = (offset % 32) * 8;
36   int y = offset / 32;
37   UINT16 *dest = (UINT16 *)screen->base + screen->rowpixels * y + x;
38
39   dest[0] = (dest[0] & ~0x01) | ((data >> 7) & 0x01);
40   dest[1] = (dest[1] & ~0x01) | ((data >> 6) & 0x01);
41   dest[2] = (dest[2] & ~0x01) | ((data >> 5) & 0x01);
42   dest[3] = (dest[3] & ~0x01) | ((data >> 4) & 0x01);
43   dest[4] = (dest[4] & ~0x01) | ((data >> 3) & 0x01);
44   dest[5] = (dest[5] & ~0x01) | ((data >> 2) & 0x01);
45   dest[6] = (dest[6] & ~0x01) | ((data >> 1) & 0x01);
46   dest[7] = (dest[7] & ~0x01) | ((data >> 0) & 0x01);
37   if (*crgolf_screen_select & 1)
38      crgolf_videoram_b[offset] = data;
39   else
40      crgolf_videoram_a[offset] = data;
4741}
4842
4943
50WRITE8_HANDLER( crgolf_videoram_bit1_w )
44READ8_HANDLER( crgolf_videoram_r )
5145{
52   mame_bitmap *screen = (*crgolf_screen_select & 1) ? screenb : screena;
53   int x = (offset % 32) * 8;
54   int y = offset / 32;
55   UINT16 *dest = (UINT16 *)screen->base + screen->rowpixels * y + x;
46   UINT8 ret;
5647
57   dest[0] = (dest[0] & ~0x02) | ((data >> 6) & 0x02);
58   dest[1] = (dest[1] & ~0x02) | ((data >> 5) & 0x02);
59   dest[2] = (dest[2] & ~0x02) | ((data >> 4) & 0x02);
60   dest[3] = (dest[3] & ~0x02) | ((data >> 3) & 0x02);
61   dest[4] = (dest[4] & ~0x02) | ((data >> 2) & 0x02);
62   dest[5] = (dest[5] & ~0x02) | ((data >> 1) & 0x02);
63   dest[6] = (dest[6] & ~0x02) | ((data >> 0) & 0x02);
64   dest[7] = (dest[7] & ~0x02) | ((data << 1) & 0x02);
65}
48   if (*crgolf_screen_select & 1)
49      ret = crgolf_videoram_b[offset];
50   else
51      ret = crgolf_videoram_a[offset];
6652
67
68WRITE8_HANDLER( crgolf_videoram_bit2_w )
69{
70   mame_bitmap *screen = (*crgolf_screen_select & 1) ? screenb : screena;
71   int x = (offset % 32) * 8;
72   int y = offset / 32;
73   UINT16 *dest = (UINT16 *)screen->base + screen->rowpixels * y + x;
74
75   dest[0] = (dest[0] & ~0x04) | ((data >> 5) & 0x04);
76   dest[1] = (dest[1] & ~0x04) | ((data >> 4) & 0x04);
77   dest[2] = (dest[2] & ~0x04) | ((data >> 3) & 0x04);
78   dest[3] = (dest[3] & ~0x04) | ((data >> 2) & 0x04);
79   dest[4] = (dest[4] & ~0x04) | ((data >> 1) & 0x04);
80   dest[5] = (dest[5] & ~0x04) | ((data >> 0) & 0x04);
81   dest[6] = (dest[6] & ~0x04) | ((data << 1) & 0x04);
82   dest[7] = (dest[7] & ~0x04) | ((data << 2) & 0x04);
53   return ret;
8354}
8455
8556
8657
8758/*************************************
8859 *
89 *  Video RAM reads
60 *  Palette handling
9061 *
9162 *************************************/
9263
93READ8_HANDLER( crgolf_videoram_bit0_r )
64static void get_pens(pen_t *pens)
9465{
95   mame_bitmap *screen = (*crgolf_screen_select & 1) ? screenb : screena;
96   int x = (offset % 32) * 8;
97   int y = offset / 32;
98   UINT16 *source = (UINT16 *)screen->base + screen->rowpixels * y + x;
66   offs_t offs;
9967
100   return   ((source[0] & 0x01) << 7) |
101         ((source[1] & 0x01) << 6) |
102         ((source[2] & 0x01) << 5) |
103         ((source[3] & 0x01) << 4) |
104         ((source[4] & 0x01) << 3) |
105         ((source[5] & 0x01) << 2) |
106         ((source[6] & 0x01) << 1) |
107         ((source[7] & 0x01) << 0);
108}
109
110
111READ8_HANDLER( crgolf_videoram_bit1_r )
112{
113   mame_bitmap *screen = (*crgolf_screen_select & 1) ? screenb : screena;
114   int x = (offset % 32) * 8;
115   int y = offset / 32;
116   UINT16 *source = (UINT16 *)screen->base + screen->rowpixels * y + x;
117
118   return   ((source[0] & 0x02) << 6) |
119         ((source[1] & 0x02) << 5) |
120         ((source[2] & 0x02) << 4) |
121         ((source[3] & 0x02) << 3) |
122         ((source[4] & 0x02) << 2) |
123         ((source[5] & 0x02) << 1) |
124         ((source[6] & 0x02) << 0) |
125         ((source[7] & 0x02) >> 1);
126}
127
128
129READ8_HANDLER( crgolf_videoram_bit2_r )
130{
131   mame_bitmap *screen = (*crgolf_screen_select & 1) ? screenb : screena;
132   int x = (offset % 32) * 8;
133   int y = offset / 32;
134   UINT16 *source = (UINT16 *)screen->base + screen->rowpixels * y + x;
135
136   return   ((source[0] & 0x04) << 5) |
137         ((source[1] & 0x04) << 4) |
138         ((source[2] & 0x04) << 3) |
139         ((source[3] & 0x04) << 2) |
140         ((source[4] & 0x04) << 1) |
141         ((source[5] & 0x04) << 0) |
142         ((source[6] & 0x04) >> 1) |
143         ((source[7] & 0x04) >> 2);
144}
145
146
147
148/*************************************
149 *
150 *  Color PROM decoding
151 *
152 *************************************/
153
154PALETTE_INIT( crgolf )
155{
156   int i;
157
158   for (i = 0; i < 32; i++)
68   for (offs = 0; offs < NUM_PENS; offs++)
15969   {
16070      int bit0, bit1, bit2, r, g, b;
16171
72      UINT8 data = memory_region(REGION_PROMS)[offs];
73
16274      /* red component */
163      bit0 = (*color_prom >> 0) & 0x01;
164      bit1 = (*color_prom >> 1) & 0x01;
165      bit2 = (*color_prom >> 2) & 0x01;
75      bit0 = (data >> 0) & 0x01;
76      bit1 = (data >> 1) & 0x01;
77      bit2 = (data >> 2) & 0x01;
16678      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
16779
16880      /* green component */
169      bit0 = (*color_prom >> 3) & 0x01;
170      bit1 = (*color_prom >> 4) & 0x01;
171      bit2 = (*color_prom >> 5) & 0x01;
81      bit0 = (data >> 3) & 0x01;
82      bit1 = (data >> 4) & 0x01;
83      bit2 = (data >> 5) & 0x01;
17284      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
17385
17486      /* blue component */
175      bit0 = (*color_prom >> 6) & 0x01;
176      bit1 = (*color_prom >> 7) & 0x01;
87      bit0 = (data >> 6) & 0x01;
88      bit1 = (data >> 7) & 0x01;
17789      b = 0x4f * bit0 + 0xa8 * bit1;
17890
179      palette_set_color(machine, i, MAKE_RGB(r, g, b));
180      color_prom++;
91      pens[offs] = MAKE_RGB(r, g, b);
18192   }
18293}
18394
r1649r1650
189100 *
190101 *************************************/
191102
192VIDEO_START( crgolf )
103static VIDEO_START( crgolf )
193104{
194   /* allocate temporary bitmaps */
195   screena = auto_bitmap_alloc(256, 256, machine->screen[0].format);
196   screenb = auto_bitmap_alloc(256, 256, machine->screen[0].format);
197   highbit = auto_bitmap_alloc(256, 256, machine->screen[0].format);
105   /* allocate memory for the two bitmaps */
106   crgolf_videoram_a = auto_malloc(VIDEORAM_SIZE);
107   crgolf_videoram_b = auto_malloc(VIDEORAM_SIZE);
198108
199   /* initialize the "high bit" bitmap */
200   fillbitmap(screena, 0, NULL);
201   fillbitmap(screenb, 8, NULL);
202   fillbitmap(highbit, 16, NULL);
203
204109   /* register for save states */
205   state_save_register_bitmap("video", 0, "screena", screena);
206   state_save_register_bitmap("video", 0, "screenb", screenb);
207   state_save_register_bitmap("video", 0, "highbit", highbit);
110   state_save_register_global_pointer(crgolf_videoram_a, VIDEORAM_SIZE);
111   state_save_register_global_pointer(crgolf_videoram_b, VIDEORAM_SIZE);
208112}
209113
210114
r1649r1650
215119 *
216120 *************************************/
217121
218VIDEO_UPDATE( crgolf )
122static VIDEO_UPDATE( crgolf )
219123{
220124   int flip = *crgolf_screen_flip & 1;
221125
222   /* draw screen b if enabled */
223   if (~*crgolf_screenb_enable & 1)
224      copybitmap(bitmap, screenb, flip, flip, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
225   else
226      fillbitmap(bitmap, 8, cliprect);
126   offs_t offs;
127   pen_t pens[NUM_PENS];
227128
228   /* draw screen a if enabled */
229   if (~*crgolf_screena_enable & 1)
230      copybitmap(bitmap, screena, flip, flip, 0, 0, cliprect, TRANSPARENCY_PEN, 0);
129   get_pens(pens);
231130
232   /* apply the color select bit */
233   if (*crgolf_color_select)
234      copybitmap(bitmap, highbit, 0, 0, 0, 0, cliprect, TRANSPARENCY_BLEND, 0);
131   /* for each byte in the video RAM */
132   for (offs = 0; offs < VIDEORAM_SIZE / 3; offs++)
133   {
134      int i;
135
136      UINT8 y = (offs & 0x1fe0) >> 5;
137      UINT8 x = (offs & 0x001f) << 3;
138
139      UINT8 data_a0 = crgolf_videoram_a[0x2000 | offs];
140      UINT8 data_a1 = crgolf_videoram_a[0x0000 | offs];
141      UINT8 data_a2 = crgolf_videoram_a[0x4000 | offs];
142      UINT8 data_b0 = crgolf_videoram_b[0x2000 | offs];
143      UINT8 data_b1 = crgolf_videoram_b[0x0000 | offs];
144      UINT8 data_b2 = crgolf_videoram_b[0x4000 | offs];
145
146      if (flip)
147      {
148         y = ~y;
149         x = ~x;
150      }
151
152      /* for each pixel in the byte */
153      for (i = 0; i < 8; i++)
154      {
155         offs_t color;
156         UINT8 data_b = 0;
157         UINT8 data_a = 0;
158
159         if (~*crgolf_screena_enable & 1)
160            data_a = ((data_a0 & 0x80) >> 7) | ((data_a1 & 0x80) >> 6) | ((data_a2 & 0x80) >> 5);
161
162         if (~*crgolf_screenb_enable & 1)
163            data_b = ((data_b0 & 0x80) >> 7) | ((data_b1 & 0x80) >> 6) | ((data_b2 & 0x80) >> 5);
164
165         /* screen A has priority over B */
166         if (data_a)
167            color = data_a;
168         else
169            color = data_b | 0x08;
170
171         /* add HI bit if enabled */
172         if (*crgolf_color_select)
173            color = color | 0x10;
174
175         *BITMAP_ADDR32(bitmap, y, x) = pens[color];
176
177         /* next pixel */
178         data_a0 = data_a0 << 1;
179         data_a1 = data_a1 << 1;
180         data_a2 = data_a2 << 1;
181         data_b0 = data_b0 << 1;
182         data_b1 = data_b1 << 1;
183         data_b2 = data_b2 << 1;
184
185         if (flip)
186            x = x - 1;
187         else
188            x = x + 1;
189      }
190   }
191
235192   return 0;
236193}
194
195
196
197/*************************************
198 *
199 *  Machine driver
200 *
201 *************************************/
202
203MACHINE_DRIVER_START( crgolf_video )
204
205   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
206   MDRV_VIDEO_START(crgolf)
207   MDRV_VIDEO_UPDATE(crgolf)
208
209   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
210   MDRV_SCREEN_SIZE(256, 256)
211   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 247)
212   MDRV_SCREEN_REFRESH_RATE(60)
213   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
214MACHINE_DRIVER_END
src/mame/video/fantland.c
r1649r1650
1/***************************************************************************
1/***************************************************************************************
22
33                      -= Electronic Devices / International Games =-
44
r1649r1650
77    This game has sprites only:
88
99    tiles are 16 x 16 x 6. There are 0x400 sprites, each one is allotted
10    8 bytes of memory in spriteram (but only 5 are used) :
10    8 bytes of memory (but only 5 are used) in spriteram (0x54000):
1111
1212    Offset:     Bits:           Value:
1313
r1649r1650
2828
2929    Then 2 tables follow, 0x400 bytes each:
3030
31    - the first table contains 1 byte per sprite: an index in the second table
32    - the second table is either an x,y offset or an index in spriteram_2:
31    - the first table  (0x56000) contains 1 byte per sprite: an index in the second table
32    - the second table (0x56400) is either an x,y offset or an index in spriteram_2 (0x60000):
3333
3434        0                       X offset (low bits)
3535
r1649r1650
4747
4848        0                       Y offset (low bits)
4949
50        1       7654 321-       Code offset
50        1       7--- ----       Flip X (xor with that in spriteram)
51                -6-- ----       Flip Y ""
52                --54 321-       Code offset
5153                ---- ---0       Y offset (high bit)
5254
5355        2                       X offset (low bits)
5456
5557        3                       X offset (high bit)
5658
57***************************************************************************/
59***************************************************************************************/
5860
5961#include "driver.h"
6062
r1649r1650
6567         *ram      =   spriteram,         // current sprite pointer in spriteram
6668         *ram2      =   indx_ram;         // current sprite pointer in indx_ram
6769
70   // wheelrun is the only game with a smaller visible area
71   int special = (machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y + 1) < 0x100;
72
6873   for ( ; ram < indx_ram; ram += 8,ram2++)
6974   {
7075      int attr,code,color, x,y,xoffs,yoffs,flipx,flipy, idx;
r1649r1650
7681      y      =   ram[4];
7782
7883      color   =   (attr & 0x03);
79      flipy   =   (attr & 0x10);
80      flipx   =   (attr & 0x20);
84      flipy   =   (attr & 0x10) ? 1 : 0;
85      flipx   =   (attr & 0x20) ? 1 : 0;
8186
8287      y      +=   (attr & 0x40) << 2;
8388      x      +=   (attr & 0x80) << 1;
r1649r1650
97102         yoffs   =   spriteram_2[idx + 0] + (spriteram_2[idx + 1] << 8);
98103         xoffs   =   spriteram_2[idx + 2] + (spriteram_2[idx + 3] << 8);
99104
100         code   +=   yoffs >> 9;
105         code   +=   (yoffs & 0x3e00) >> 9;
106         flipy   ^=   (yoffs & 0x4000) ? 1 : 0;
107         flipx   ^=   (yoffs & 0x8000) ? 1 : 0;
101108      }
102109      else
103110      {
r1649r1650
107114         xoffs   =   ((offs_ram[idx + 2] & 0x01) << 8) + offs_ram[idx + 0];
108115      }
109116
110      yoffs      =   (yoffs & 0xff) - (yoffs & 0x100);
111      xoffs      =   (xoffs & 0x1ff);
117      yoffs   =   (yoffs & 0xff) - (yoffs & 0x100);
118      xoffs   =   (xoffs & 0x1ff);
112119
113120      if (xoffs >= 0x180)      xoffs -= 0x200;
114121
115122      y      +=   yoffs;
116123      x      +=   xoffs;
117124
125      // wheelrun needs y=0xf0 & yoffs=0x50 to be rendered at screen y 0x40
126      if (special && y > 0)
127         y &= 0xff;
128
118129      y      =   (y & 0xff) - (y & 0x100);
119130      x      =   (x & 0x1ff);
120131
src/mame/video/atarig1.c
r1649r1650
220220   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
221221
222222   /* copy the motion objects on top */
223   copybitmap(bitmap, atarirle_get_vram(0, 0), 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 0);
223   copybitmap_trans(bitmap, atarirle_get_vram(0, 0), 0, 0, 0, 0, cliprect, 0);
224224
225225   /* add the alpha on top */
226226   tilemap_draw(bitmap, cliprect, atarigen_alpha_tilemap, 0, 0);
src/mame/video/bladestl.c
r1649r1650
44static int layer_colorbase[2];
55extern int bladestl_spritebank;
66
7
78PALETTE_INIT( bladestl )
89{
910   int i;
10   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
11   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
1211
13   /* build the lookup table for sprites. Palette is dynamic. */
14   for (i = 0;i < TOTAL_COLORS(1);i++)
15      COLOR(1,i) = 0x20 + (*(color_prom++) & 0x0f);
12   /* allocate the colortable */
13   machine->colortable = colortable_alloc(machine, 0x30);
14
15   /* characters use pens 0x00-0x1f, no look-up table */
16   for (i = 0; i < 0x20; i++)
17      colortable_entry_set_value(machine->colortable, i, i);
18
19   /* sprites use pens 0x20-0x2f */
20   for (i = 0x20; i < 0x120; i++)
21   {
22      UINT8 ctabentry = (color_prom[i - 0x20] & 0x0f) | 0x20;
23      colortable_entry_set_value(machine->colortable, i, ctabentry);
24   }
1625}
1726
27
28static void set_pens(running_machine *machine)
29{
30   int i;
31
32   for (i = 0x00; i < 0x60; i += 2)
33   {
34      UINT16 data = paletteram[i | 1] | (paletteram[i] << 8);
35
36      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
37
38      colortable_palette_set_color(machine->colortable, i >> 1, color);
39   }
40}
41
42
43
1844/***************************************************************************
1945
2046  Callback for the K007342
r1649r1650
6490
6591VIDEO_UPDATE( bladestl )
6692{
93   set_pens(machine);
94
6795   K007342_tilemap_update();
6896
6997   K007342_tilemap_draw( bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE ,0);
src/mame/video/toobin.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/atarigen.h"
910#include "toobin.h"
1011
src/mame/video/mcr68.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "mcr.h"
910
1011
src/mame/video/mario.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "video/resnet.h"
1112
1213#include "includes/mario.h"
src/mame/video/atarifb.c
r1649r1650
116116   scroll_x[0] = - *atarifb_scroll_register + 32 + playfield_x_offset;
117117   scroll_y[0] = 8 + playfield_y_offset;
118118
119   copybitmap(bitmap, tilemap_get_pixmap(alpha1_tilemap), 0, 0, 35*8, 1*8, NULL, TRANSPARENCY_NONE, 0);
120   copybitmap(bitmap, tilemap_get_pixmap(alpha2_tilemap), 0, 0,  0*8, 1*8, NULL, TRANSPARENCY_NONE, 0);
121   copyscrollbitmap(bitmap, tilemap_get_pixmap(field_tilemap),  1, scroll_x, 1, scroll_y, &bigfield_area, TRANSPARENCY_NONE, 0);
119   copybitmap(bitmap, tilemap_get_pixmap(alpha1_tilemap), 0, 0, 35*8, 1*8, NULL);
120   copybitmap(bitmap, tilemap_get_pixmap(alpha2_tilemap), 0, 0,  0*8, 1*8, NULL);
121   copyscrollbitmap(bitmap, tilemap_get_pixmap(field_tilemap),  1, scroll_x, 1, scroll_y, &bigfield_area);
122122}
123123
124124
src/mame/video/csk.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112#define CPK_VIDEO_SIZE   0x800
1213
src/mame/video/naughtyb.c
r1649r1650
285285   {
286286      int scrollx;
287287
288      copybitmap(bitmap,tmpbitmap,0,0,-66*8,0,&leftvisiblearea,TRANSPARENCY_NONE,0);
289      copybitmap(bitmap,tmpbitmap,0,0,-30*8,0,&rightvisiblearea,TRANSPARENCY_NONE,0);
288      copybitmap(bitmap,tmpbitmap,0,0,-66*8,0,&leftvisiblearea);
289      copybitmap(bitmap,tmpbitmap,0,0,-30*8,0,&rightvisiblearea);
290290
291291      scrollx = ( naughtyb_cocktail ) ? *naughtyb_scrollreg - 239 : -*naughtyb_scrollreg + 16;
292      copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea,TRANSPARENCY_NONE,0);
292      copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea);
293293   }
294294   return 0;
295295}
src/mame/video/runaway.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910
1011static tilemap *bg_tilemap;
src/mame/video/toypop.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT8 *toypop_videoram;
1213
src/mame/video/tumbleb.c
r1649r1650
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819
1920static UINT16 tumblepb_control_0[8];
2021UINT16 *tumblepb_pf1_data,*tumblepb_pf2_data;
src/mame/video/taito_z.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/taitoic.h"
34
45#define TC0100SCN_GFX_NUM 1
src/mame/video/superqix.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT8 *superqix_videoram;
1213UINT8 *superqix_bitmapram,*superqix_bitmapram2;
r1649r1650
253254VIDEO_UPDATE( superqix )
254255{
255256   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
256   copybitmap(bitmap,fg_bitmap[show_bitmap],flip_screen,flip_screen,0,0,cliprect,TRANSPARENCY_PEN,0);
257   copybitmap_trans(bitmap,fg_bitmap[show_bitmap],flip_screen,flip_screen,0,0,cliprect,0);
257258   superqix_draw_sprites(machine, bitmap,cliprect);
258259   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
259260   return 0;
src/mame/video/playch10.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/ppu2c0x.h"
34
45/* from machine */
src/mame/video/dday.c
r1649r1650
346346   if (sl_enable)
347347   {
348348      /* apply shadow */
349
350      mame_bitmap *sl_bitmap;
351349      int x, y;
352350
351      mame_bitmap *sl_bitmap = tilemap_get_pixmap(sl_tilemap);
353352
354      sl_bitmap = tilemap_get_pixmap(sl_tilemap);
355
356353      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
357      {
358354         for (y = cliprect->min_y; y <= cliprect->max_y; y++)
359355         {
360            UINT32 src_pixel;
356            UINT16 src_pixel = *BITMAP_ADDR16(main_bitmap, y, x);
361357
362
363            src_pixel = *BITMAP_ADDR16(main_bitmap, y, x);
364
365358            if (*BITMAP_ADDR16(sl_bitmap, y, x) == 0xff)
366            {
367359               src_pixel += machine->drv->total_colors;
368            }
369360
370361            *BITMAP_ADDR16(bitmap, y, x) = src_pixel;
371362         }
372      }
373363   }
374364   else
375   {
376      copybitmap(bitmap,main_bitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
377   }
365      copybitmap(bitmap,main_bitmap,0,0,0,0,cliprect);
366
378367   return 0;
379368}
src/mame/video/cyberbal.c
r1649r1650
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/atarigen.h"
910#include "cyberbal.h"
1011
src/mame/video/lockon.c
r0r1650
1/***************************************************************************
2
3    Lock-On video hardware
4
5***************************************************************************/
6
7#include "driver.h"
8#include "deprecat.h"
9#include "lockon.h"
10#include "video/resnet.h"
11#include "cpu/nec/nec.h"
12
13#define CURSOR_XPOS         168
14#define CURSOR_YPOS         239
15#define FRAMEBUFFER_MAX_X   431
16#define FRAMEBUFFER_MAX_Y   (UINT32)((FRAMEBUFFER_CLOCK / (float)(FRAMEBUFFER_MAX_X-1)) / ((float)PIXEL_CLOCK/(HTOTAL*VTOTAL)))
17
18
19/*************************************
20 *
21 *  Globals
22 *
23 *************************************/
24
25UINT16   *lockon_char_ram;
26UINT16   *lockon_hud_ram;
27UINT16   *lockon_scene_ram;
28UINT16   *lockon_ground_ram;
29UINT16   *lockon_object_ram;
30
31size_t   lockon_hudram_size;
32size_t   lockon_objectram_size;
33size_t   lockon_groundram_size;
34
35UINT8   *obj_pal_ram;
36
37/*************************************
38 *
39 *  Statics
40 *
41 *************************************/
42
43static tilemap *lockon_tilemap;
44static UINT8   ground_ctrl;
45static UINT16   scroll_h;
46static UINT16   scroll_v;
47
48static mame_bitmap   *front_buffer;
49static mame_bitmap   *back_buffer;
50static emu_timer   *bufend_timer;
51static emu_timer   *cursor_timer;
52
53/* Rotation Control */
54static UINT16   xsal;
55static UINT16   x0ll;
56static UINT16   dx0ll;
57static UINT16   dxll;
58static UINT16   ysal;
59static UINT16   y0ll;
60static UINT16   dy0ll;
61static UINT16   dyll;
62
63/* Object palette RAM control */
64static UINT32   iden;
65static UINT32   obj_pal_latch;
66static UINT32   obj_pal_addr;
67
68
69/*************************************
70 *
71 *  HD46505S-2 CRT Controller
72 *
73 *************************************/
74
75READ16_HANDLER( lockon_crtc_r )
76{
77   return 0xffff;
78}
79
80WRITE16_HANDLER( lockon_crtc_w )
81{
82#if 0
83   data &= 0xff;
84
85   if (offset == 0)
86   {
87      switch (data)
88      {
89         case 0x00: mame_printf_debug("Horizontal Total         "); break;
90         case 0x01: mame_printf_debug("Horizontal displayed     "); break;
91         case 0x02: mame_printf_debug("Horizontal sync position "); break;
92         case 0x03: mame_printf_debug("Horizontal sync width    "); break;
93         case 0x04: mame_printf_debug("Vertical total           "); break;
94         case 0x05: mame_printf_debug("Vertical total adjust    "); break;
95         case 0x06: mame_printf_debug("Vertical displayed       "); break;
96         case 0x07: mame_printf_debug("Vertical sync position   "); break;
97         case 0x08: mame_printf_debug("Interlace mode           "); break;
98         case 0x09: mame_printf_debug("Max. scan line address   "); break;
99         case 0x0a: mame_printf_debug("Cursror start            "); break;
100         case 0x0b: mame_printf_debug("Cursor end               "); break;
101         case 0x0c: mame_printf_debug("Start address (h)        "); break;
102         case 0x0d: mame_printf_debug("Start address (l)        "); break;
103         case 0x0e: mame_printf_debug("Cursor (h)               "); break;
104         case 0x0f: mame_printf_debug("Cursor (l)               "); break;
105         case 0x10: mame_printf_debug("Light pen (h))           "); break;
106         case 0x11: mame_printf_debug("Light pen (l)            "); break;
107      }
108   }
109   else if (offset == 1)
110   {
111      mame_printf_debug("0x%.2x, (%d)\n",data, data);
112   }
113#endif
114}
115
116static TIMER_CALLBACK( cursor_callback )
117{
118   if (lockon_main_inten)
119      cpunum_set_input_line_and_vector(machine, MAIN_CPU, 0, HOLD_LINE, 0xff);
120
121   timer_adjust(cursor_timer, video_screen_get_time_until_pos(0, CURSOR_YPOS, CURSOR_XPOS), 0, attotime_zero);
122}
123
124/*************************************
125 *
126 *  Palette decoding
127 *
128 *************************************/
129
130static const res_net_info lockon_net_info =
131{
132   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_TTL_OUT,
133   {
134      {RES_NET_AMP_NONE, 560, 0, 5, {4700, 2200, 1000, 470, 220}},
135      {RES_NET_AMP_NONE, 560, 0, 5, {4700, 2200, 1000, 470, 220}},
136      {RES_NET_AMP_NONE, 560, 0, 5, {4700, 2200, 1000, 470, 220}}
137   }
138};
139
140static const res_net_info lockon_pd_net_info =
141{
142   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_TTL_OUT,
143   {
144      {RES_NET_AMP_NONE, 560, 580, 5, {4700, 2200, 1000, 470, 220}},
145      {RES_NET_AMP_NONE, 560, 580, 5, {4700, 2200, 1000, 470, 220}},
146      {RES_NET_AMP_NONE, 560, 580, 5, {4700, 2200, 1000, 470, 220}}
147   }
148};
149
150PALETTE_INIT( lockon )
151{
152   int i;
153
154   for (i = 0; i < 1024; ++i)
155   {
156      UINT8 r, g, b;
157      UINT8 p1 = color_prom[i];
158      UINT8 p2 = color_prom[i + 0x400];
159
160      if (p2 & 0x80)
161      {
162         r = compute_res_net( (p2 >> 2) & 0x1f, 0, &lockon_net_info );
163         g = compute_res_net( ((p1 >> 5) & 0x7) | (p2 & 3) << 3, 1, &lockon_net_info );
164         b = compute_res_net( (p1 & 0x1f), 2, &lockon_net_info );
165      }
166      else
167      {
168         r = compute_res_net( (p2 >> 2) & 0x1f, 0, &lockon_pd_net_info );
169         g = compute_res_net( ((p1 >> 5) & 0x7) | (p2 & 3) << 3, 1, &lockon_pd_net_info );
170         b = compute_res_net( (p1 & 0x1f), 2, &lockon_pd_net_info );
171      }
172
173      palette_set_color(Machine, i, MAKE_RGB(r, g, b));
174   }
175}
176
177
178/*************************************
179 *
180 *  Character tilemap handling
181 *
182 *************************************/
183
184WRITE16_HANDLER( lockon_char_w )
185{
186   lockon_char_ram[offset] = data;
187   tilemap_mark_tile_dirty(lockon_tilemap, offset);
188}
189
190static TILE_GET_INFO( get_lockon_tile_info )
191{
192   UINT32 tileno = lockon_char_ram[tile_index] & 0x03ff;
193   UINT32 col = (lockon_char_ram[tile_index] >> 10) & 0x3f;
194
195   col = (col & 0x1f) + (col & 0x20 ? 64 : 0);
196   SET_TILE_INFO(0, tileno, col, 0);
197}
198
199
200/*******************************************************************************************
201
202  Scene tilemap hardware
203
204*******************************************************************************************/
205
206WRITE16_HANDLER( lockon_scene_h_scr_w )
207{
208   scroll_h = data & 0x1ff;
209}
210
211WRITE16_HANDLER( lockon_scene_v_scr_w )
212{
213   scroll_v = data & 0x81ff;
214}
215
216static void scene_draw(void)
217{
218   UINT32 y;
219
220   /* 3bpp characters */
221   const UINT8 *const gfx1 = memory_region(REGION_GFX2);
222   const UINT8 *const gfx2 = gfx1 + 0x10000;
223   const UINT8 *const gfx3 = gfx1 + 0x20000;
224   const UINT8 *const clut = gfx1 + 0x30000;
225
226   for (y = 0; y < FRAMEBUFFER_MAX_Y; ++y)
227   {
228      UINT32   x;
229      UINT32   d0 = 0, d1 = 0, d2 = 0;
230      UINT32   colour = 0;
231      UINT32   y_offs;
232      UINT32   x_offs;
233      UINT32   y_gran;
234      UINT16   *bmpaddr;
235      UINT32   ram_mask = 0x7ff;
236
237      y_offs = (y + scroll_v) & 0x1ff;
238
239      /* Clamp - stops tilemap wrapping when screen is rotated */
240      if (BIT(scroll_v, 15) && y_offs & 0x100)
241         ram_mask = 0x7;
242
243      x_offs = (scroll_h - 8) & 0x1ff;
244      y_gran = y_offs & 7;
245
246      if (x_offs & 7)
247      {
248         UINT32 tileidx;
249         UINT16 addr = ((y_offs & ~7) << 3) + ((x_offs >> 3) & 0x3f);
250         UINT16 ram_val = lockon_scene_ram[addr & ram_mask];
251
252         colour = (clut[ram_val & 0x7fff] & 0x3f) << 3;
253         tileidx = ((ram_val & 0x0fff) << 3) + y_gran;
254
255         d0 = *(gfx1 + tileidx);
256         d1 = *(gfx2 + tileidx);
257         d2 = *(gfx3 + tileidx);
258      }
259
260      bmpaddr = BITMAP_ADDR16(back_buffer, y, 0);
261
262      for (x = 0; x < FRAMEBUFFER_MAX_X; ++x)
263      {
264         UINT32 x_gran = (x_offs & 7) ^ 7;
265         UINT32 col;
266
267         if (!(x_offs & 7))
268         {
269            UINT32 tileidx;
270            UINT16 addr = ((y_offs & ~7) << 3) + ((x_offs >> 3) & 0x3f);
271            UINT16 ram_val = lockon_scene_ram[addr & ram_mask];
272
273            colour = (clut[ram_val & 0x7fff] & 0x3f) << 3;
274            tileidx = ((ram_val & 0x0fff) << 3) + y_gran;
275
276            d0 = *(gfx1 + tileidx);
277            d1 = *(gfx2 + tileidx);
278            d2 = *(gfx3 + tileidx);
279         }
280
281         col = colour
282             | (((d2 >> x_gran) & 1) << 2)
283             | (((d1 >> x_gran) & 1) << 1)
284             | ( (d0 >> x_gran) & 1);
285
286         *bmpaddr++ = Machine->pens[0xa00 + col];
287
288         x_offs = (x_offs + 1) & 0x1ff;
289      }
290
291   }
292}
293
294/*******************************************************************************************
295
296    Ground Hardware
297
298    Each framebuffer line corresponds to a three word entry in ground RAM,
299    starting from offset 3:
300
301       FEDCBA9876543210
302    0 |.............xxx|  Tile line (A0-A2 GFX ROMs)
303      |...........xx...|  Tile index (A6-A5 GFX ROMs)
304      |........xxx.....|  ROM lut address (A6-A4)
305      |.xxxxxxx........|  ROM lut address (A13-A7)
306      |x...............|  /Line enable
307
308    1 |........xxxxxxxx|  TZ2213 value
309      |xxxxxxxx........|  X offset
310
311    2 |........xxxxxxxx|  TZ2213 DX
312      |.......x........|  Carry
313      |x...............|  End of list marker
314
315    An 8-bit ground control register controls the following:
316
317       76543210
318      |......xx|  LUT ROM A15-A14
319      |....xx..|  LUT ROM select
320      |..xx....|  CLUT ROM A13-A12
321      |.x......|  GFX ROM A15, CLUT ROM A14
322      |x.......|  GFX ROM bank select (always 0 - only 1 bank is present)
323
324 *******************************************************************************************/
325
326WRITE16_HANDLER( lockon_ground_ctrl_w )
327{
328   ground_ctrl = data & 0xff;
329}
330
331static TIMER_CALLBACK( bufend_callback )
332{
333   cpunum_set_input_line_and_vector(Machine, GROUND_CPU, 0, HOLD_LINE, 0xff);
334   cpunum_set_input_line(Machine, OBJECT_CPU, NEC_INPUT_LINE_POLL, ASSERT_LINE);
335}
336
337/* Get data for a each 8x8x3 ground tile */
338#define GET_GROUND_DATA()                                                                \
339{                                                                                        \
340   UINT32 gfx_a4_3  = (ls163 & 0xc) << 1;                                               \
341   UINT32 lut_addr  = lut_address + ((ls163 >> 4) & 0xf);                               \
342   UINT32 gfx_a14_7 = lut_rom[lut_addr] << 7;                                           \
343   clut_addr = (lut_rom[lut_addr] << 4) | clut_a14_12 | clut_a4_3 | (ls163 & 0xc) >> 2; \
344   gfx_addr  = gfx_a15 | gfx_a14_7 | gfx_a6_5 | gfx_a4_3 | gfx_a2_0;                    \
345   pal = (clut_rom[clut_addr] << 3);                                                    \
346   rom_data1 = gfx_rom[gfx_addr];                                                       \
347   rom_data2 = gfx_rom[gfx_addr + 0x10000];                                             \
348   rom_data3 = gfx_rom[gfx_addr + 0x20000];                                             \
349}
350
351static void ground_draw(void)
352{
353   /* ROM pointers */
354   const UINT8 *const gfx_rom  = memory_region(REGION_GFX4);
355   const UINT8 *const lut_rom  = gfx_rom + 0x30000 + ((ground_ctrl >> 2) & 0x3 ? 0x10000 : 0);
356   const UINT8 *const clut_rom = gfx_rom + 0x50000;
357
358   UINT32 lut_a15_14   = (ground_ctrl & 0x3) << 14;
359   UINT32 clut_a14_12   = (ground_ctrl & 0x70) << 8;
360   UINT32 gfx_a15      = (ground_ctrl & 0x40) << 9;
361   UINT32 offs = 3;
362   UINT32 y;
363
364   /* TODO: Clean up and emulate CS of GFX ROMs? */
365   for (y = 0; y < FRAMEBUFFER_MAX_Y; ++y)
366   {
367      UINT16   *bmpaddr = BITMAP_ADDR16(back_buffer, y, 0);
368      UINT8   ls163;
369      UINT32   clut_addr;
370      UINT32   gfx_addr;
371      UINT8   rom_data1 = 0;
372      UINT8   rom_data2 = 0;
373      UINT8   rom_data3 = 0;
374      UINT32   pal = 0;
375      UINT32   x;
376
377      /* Draw this line? */
378      if (!(lockon_ground_ram[offs] & 0x8000))
379      {
380         UINT32   gfx_a2_0  =  lockon_ground_ram[offs] & 0x0007;
381         UINT32   gfx_a6_5  = (lockon_ground_ram[offs] & 0x0018) << 2;
382         UINT32   clut_a4_3 = (lockon_ground_ram[offs] & 0x0018) >> 1;
383         UINT8   tz2213_x  = lockon_ground_ram[offs + 1] & 0xff;
384         UINT8   tz2213_dx = lockon_ground_ram[offs + 2] & 0xff;
385
386         UINT32   lut_address = lut_a15_14 + ((lockon_ground_ram[offs] & 0x7fe0) >> 1);
387         UINT32   cy         = lockon_ground_ram[offs + 2] & 0x0100;
388         UINT32   color;
389         UINT32   gpbal2_0_prev;
390
391         ls163 = lockon_ground_ram[offs + 1] >> 8;
392
393         gpbal2_0_prev = ((ls163 & 3) << 1) | BIT(tz2213_x, 7);
394
395         if (gpbal2_0_prev)
396            GET_GROUND_DATA();
397
398         for (x = 0; x < FRAMEBUFFER_MAX_X; x++)
399         {
400            UINT32 tz2213_cy;
401            UINT32 gpbal2_0 = ((ls163 & 3) << 1) | BIT(tz2213_x, 7);
402
403            /* Stepped into a new tile? */
404            if (gpbal2_0 < gpbal2_0_prev)
405               GET_GROUND_DATA();
406
407            gpbal2_0_prev = gpbal2_0;
408
409            color = pal;
410            color += (rom_data1 >> gpbal2_0) & 0x1;
411            color += ((rom_data2 >> gpbal2_0) & 0x1) << 1;
412            color += ((rom_data3 >> gpbal2_0) & 0x1) << 2;
413
414            *bmpaddr++ = Machine->pens[0x800 + color];
415
416            /* Update the counters */
417            tz2213_cy = (UINT8)tz2213_dx > (UINT8)~(tz2213_x);
418            tz2213_x = (tz2213_x + tz2213_dx);
419
420            /* Carry? */
421            if (tz2213_cy || cy)
422               ++ls163;
423         }
424      }
425
426      offs += 3;
427
428      /* End of list marker */
429      if (lockon_ground_ram[offs + 2] & 0x8000)
430      {
431         timer_adjust(bufend_timer, attotime_mul(ATTOTIME_IN_HZ(FRAMEBUFFER_CLOCK), FRAMEBUFFER_MAX_X * y), 0, attotime_zero);
432      }
433   }
434}
435
436
437/*******************************************************************************************
438
439    Object hardware
440
441    Customs (4 each, 1 per bitplane)
442    TZA118 - Scaling
443    TZ4203 - Objects with integrated line buffer.
444
445       FEDCBA9876543210
446    0 |......xxxxxxxxxx|  Y position
447      |....xx..........|  Object Y size
448      |..xx............|  Object X size
449      |.x..............|  Y flip
450      |x...............|  X flip
451    1 |........xxxxxxxx|  X/Y scale
452      |.xxxxxxx........|  Colour
453      |x...............|  End of list marker
454    2 |xxxxxxxxxxxxxxxx|  Chunk ROM address
455    3 |.....xxxxxxxxxxx|  X position
456
457*******************************************************************************************/
458
459/*
460   There's logic to prevent shadow pixels from being drawn against the scene tilemap,
461   so that shadows don't appear against the sky.
462*/
463#define DRAW_OBJ_PIXEL(COLOR)                            \
464do {                                                     \
465   if (px < FRAMEBUFFER_MAX_X)                      \
466   if (COLOR != 0xf)                                    \
467   {                                                    \
468      UINT8 clr = obj_pal_ram[(pal << 4) + COLOR];     \
469      UINT16 *pix = (line + px);                   \
470      if (!(clr == 0xff && ((*pix & 0xe00) == 0xa00))) \
471         *pix = Machine->pens[0x400 + clr];          \
472   }                                                    \
473   px = (px + 1) & 0x7ff;                               \
474} while(0)
475
476static void objects_draw(void)
477{
478   UINT32 offs;
479
480   const UINT8  *const romlut = memory_region(REGION_USER1);
481   const UINT16 *const chklut = (UINT16*)memory_region(REGION_USER2);
482   const UINT8  *const gfxrom = memory_region(REGION_GFX5);
483   const UINT8  *const sproms = memory_region(REGION_PROMS) + 0x800;
484
485   for (offs = 0; offs < lockon_objectram_size; offs += 4)
486   {
487      UINT32 y;
488      UINT32 xpos;
489      UINT32 ypos;
490      UINT32 xsize;
491      UINT32 ysize;
492      UINT32 xflip;
493      UINT32 yflip;
494      UINT32 scale;
495      UINT32 pal;
496      UINT32 lines;
497      UINT32 opsta;
498      UINT32 opsta15_8;
499
500      /* Retrieve the object attributes */
501      ypos   = lockon_object_ram[offs] & 0x03ff;
502      xpos   = lockon_object_ram[offs + 3] & 0x07ff;
503      ysize   = (lockon_object_ram[offs] >> 10) & 0x3;
504      xsize   = (lockon_object_ram[offs] >> 12) & 0x3;
505      yflip   = BIT(lockon_object_ram[offs], 14);
506      xflip   = BIT(lockon_object_ram[offs], 15);
507      scale   = lockon_object_ram[offs + 1] & 0xff;
508      pal      = (lockon_object_ram[offs + 1] >> 8) & 0x7f;
509      opsta   = lockon_object_ram[offs + 2];
510
511      if (iden)
512      {
513         obj_pal_ram[(pal << 4) + obj_pal_addr] = obj_pal_latch;
514         break;
515      }
516
517      /* How many lines will this sprite occupy? The PAL @ IC154 knows... */
518      lines = scale >> (3 - ysize);
519
520      opsta15_8 = opsta & 0xff00;
521
522      /* Account for line buffering */
523      ypos -=1;
524
525      for (y = 0; y < FRAMEBUFFER_MAX_Y; y++)
526      {
527         UINT32   cy = (y + ypos) & 0x3ff;
528         UINT32   optab;
529         UINT32   lutaddr;
530         UINT32   tile;
531         UINT8   cnt;
532         UINT32   yidx;
533         UINT16   *line = BITMAP_ADDR16(back_buffer, y, 0);
534         UINT32   px = xpos;
535
536         /* Outside the limits? */
537         if (cy & 0x300)
538            continue;
539
540         if ((cy  & 0xff) >= lines)
541            break;
542
543         lutaddr = (scale & 0x80 ? 0x8000 : 0) | ((scale & 0x7f) << 8) | (cy & 0xff);
544         optab = romlut[lutaddr] & 0x7f;
545
546         if (yflip)
547            optab ^= 7;
548
549         yidx = (optab & 7);
550
551         /* Now calculate the lower 7-bits of the LUT ROM address. PAL @ IC157 does this */
552         cnt = (optab >> 3) * (1 << xsize);
553
554         if (xflip)
555            cnt ^= 7 >> (3 - xsize);
556         if (yflip)
557            cnt ^= (0xf >> (3 - ysize)) * (1 << xsize);
558
559         cnt = (cnt + (opsta & 0xff));
560
561         /* Draw! */
562         for (tile = 0; tile < (1 << xsize); ++tile)
563         {
564            UINT16   sc;
565            UINT16   scl;
566            UINT32   x;
567            UINT32   tileaddr;
568            UINT16   td0, td1, td2, td3;
569            UINT32   j;
570            UINT32   bank;
571
572            scl = scale & 0x7f;
573            tileaddr = (chklut[opsta15_8 + cnt] & 0x7fff);
574            bank = ((tileaddr >> 12) & 3) * 0x40000;
575            tileaddr = bank + ((tileaddr & ~0xf000) << 3);
576
577            if (xflip)
578               --cnt;
579            else
580               ++cnt;
581
582            /* Draw two 8x8 tiles */
583            for (j = 0; j < 2; ++j)
584            {
585               /* Get tile data */
586               UINT32 tileadd = tileaddr + (0x20000 * (j ^ xflip));
587
588               /* Retrieve scale values from PROMs */
589               sc = sproms[(scl << 4) + (tile * 2) + j];
590
591               /* Data from ROMs is inverted */
592               td3 = gfxrom[tileadd + yidx] ^ 0xff;
593               td2 = gfxrom[tileadd + 0x8000 + yidx] ^ 0xff;
594               td1 = gfxrom[tileadd + 0x10000 + yidx] ^ 0xff;
595               td0 = gfxrom[tileadd + 0x18000 + yidx] ^ 0xff;
596
597               if (scale & 0x80)
598               {
599                  for (x = 0; x < 8; ++x)
600                  {
601                     UINT8 col;
602                     UINT8 pix = x;
603
604                     if (!xflip)
605                        pix ^= 0x7;
606
607                     col = BIT(td0, pix)
608                        | (BIT(td1, pix) << 1)
609                        | (BIT(td2, pix) << 2)
610                        | (BIT(td3, pix) << 3);
611
612                     DRAW_OBJ_PIXEL(col);
613
614                     if ( BIT(sc, x) )
615                        DRAW_OBJ_PIXEL(col);
616                  }
617               }
618               else
619               {
620                  for (x = 0; x < 8; ++x)
621                  {
622                     UINT8 col;
623                     UINT8 pix = x;
624
625                     if ( BIT(sc, x) )
626                     {
627                        if (!xflip)
628                           pix ^= 0x7;
629
630                        col = BIT(td0, pix)
631                           | (BIT(td1, pix) << 1)
632                           | (BIT(td2, pix) << 2)
633                           | (BIT(td3, pix) << 3);
634
635                        DRAW_OBJ_PIXEL(col);
636                     }
637                  }
638               }
639            }
640         }
641      }
642
643      /* Check for the end of list marker */
644      if (lockon_object_ram[offs + 1] & 0x8000)
645         return;
646   }
647}
648
649/* The mechanism used by the object CPU to update the object ASICs palette RAM */
650WRITE16_HANDLER( lockon_tza112_w )
651{
652   if (iden)
653   {
654      obj_pal_latch = data & 0xff;
655      obj_pal_addr = offset & 0xf;
656      objects_draw();
657   }
658}
659
660READ16_HANDLER( lockon_obj_4000_r )
661{
662   cpunum_set_input_line(Machine, OBJECT_CPU, NEC_INPUT_LINE_POLL, CLEAR_LINE);
663   return 0xffff;
664}
665
666WRITE16_HANDLER( lockon_obj_4000_w )
667{
668   iden = data & 1;
669}
670
671
672/*******************************************************************************************
673
674    Frame buffer rotation hardware
675
676      FEDCBA9876543210
677    0 |........xxxxxxxx|  X start address
678      |.......x........|  Direction
679    1 |........xxxxxxxx|  TZ2213 IC65 value
680      |.......x........|  TZ2213 IC65 /enable
681    2 |........xxxxxxxx|  TZ2213 IC65 delta
682    3 |........xxxxxxxx|  TZ2213 IC106 delta
683      |.......x........|  TZ2213 IC106 enable
684    4 |.......xxxxxxxxx|  Y start address
685    5 |........xxxxxxxx|  TZ2213 IC66 value
686    6 |........xxxxxxxx|  TZ2213 IC66 delta
687      |.......x........|  TZ2213 IC65 /enable
688    7 |........xxxxxxxx|  TZ2213 IC107 delta
689      |.......x........|  TZ2213 /enable
690      |......x.........|  Direction
691
692*******************************************************************************************/
693
694WRITE16_HANDLER( lockon_fb_clut_w )
695{
696   rgb_t color;
697
698   color = palette_get_color(Machine, 0x300 + (data & 0xff));
699   palette_set_color(Machine, 0x400 + offset, color);
700}
701
702/* Rotation control register */
703WRITE16_HANDLER( lockon_rotate_w )
704{
705   switch (offset & 7)
706   {
707      case 0: xsal  = data & 0x1ff;   break;
708      case 1: x0ll  = data & 0xff;   break;
709      case 2: dx0ll = data & 0x1ff;   break;
710      case 3: dxll  = data & 0x1ff;   break;
711
712      case 4: ysal  = data & 0x1ff;   break;
713      case 5: y0ll  = data & 0xff;   break;
714      case 6: dy0ll =   data & 0x1ff;   break;
715      case 7: dyll  = data & 0x3ff;   break;
716   }
717}
718
719#define INCREMENT(ACC, CNT)              \
720do {                                     \
721   carry = (UINT8)d##ACC > (UINT8)~ACC; \
722   ACC += d##ACC;                       \
723   if (carry) ++CNT;                    \
724} while(0)
725
726#define DECREMENT(ACC, CNT)              \
727do {                                     \
728   carry = (UINT8)d##ACC > (UINT8)ACC;  \
729   ACC -= d##ACC;                       \
730   if (carry) --CNT;                    \
731} while(0)
732
733static void rotate_draw(mame_bitmap *bitmap, const rectangle *cliprect)
734{
735   UINT32 y;
736
737   /* Counters */
738   UINT32 cxy = xsal & 0xff;
739   UINT32 cyy = ysal & 0x1ff;
740
741   /* Accumulator values and deltas */
742   UINT8 axy  = x0ll & 0xff;
743   UINT8 daxy = dx0ll & 0xff;
744   UINT8 ayy  = y0ll & 0xff;
745   UINT8 dayy = dy0ll & 0xff;
746   UINT8 dayx = dyll & 0xff;
747   UINT8 daxx = dxll & 0xff;
748
749   UINT32 xy_up = BIT(xsal, 8);
750   UINT32 yx_up = BIT(dyll, 9);
751   UINT32 axx_en  = !BIT(dxll, 8);
752   UINT32 ayx_en  = !BIT(dyll, 8);
753   UINT32 axy_en  = !BIT(dx0ll, 8);
754   UINT32 ayy_en  = !BIT(dy0ll, 8);
755
756   for (y = 0; y <= cliprect->max_y; ++y)
757   {
758      UINT32 carry;
759      UINT16 *dst = BITMAP_ADDR16(bitmap, y, 0);
760      UINT32 x;
761
762      UINT32 cx = cxy;
763      UINT32 cy = cyy;
764
765      UINT8 axx = axy;
766      UINT8 ayx = ayy;
767
768      for (x = 0; x <= cliprect->max_x; ++x)
769      {
770         cx &= 0x1ff;
771         cy &= 0x1ff;
772
773         *dst++ = *BITMAP_ADDR16(front_buffer, cy, cx);
774
775         if (axx_en)
776            INCREMENT(axx, cx);
777         else
778            ++cx;
779
780         if (ayx_en)
781         {
782            if (yx_up)
783               INCREMENT(ayx, cy);
784            else
785               DECREMENT(ayx, cy);
786         }
787         else
788         {
789            if (yx_up)
790               ++cy;
791            else
792               --cy;
793         }
794      }
795
796      if (axy_en)
797      {
798         if (xy_up)
799            INCREMENT(axy, cxy);
800         else
801            DECREMENT(axy, cxy);
802      }
803      else
804      {
805         if (xy_up)
806            ++cxy;
807         else
808            --cxy;
809      }
810
811      if (ayy_en)
812         INCREMENT(ayy, cyy);
813      else
814         ++cyy;
815
816      cxy &= 0xff;
817      cyy &= 0x1ff;
818   }
819}
820
821
822/*******************************************************************************************
823
824    HUD Drawing Hardware
825
826    A sprite layer that uses 8x8x1bpp tiles to form bigger sprites
827
828    0  |.......xxxxxxxxx|  Y Position
829       |xxxxxxx.........|  Code
830    1  |.......xxxxxxxxx|  X Position
831       |....xxx.........|  Colour
832       |.xxx............|  Sprite width (0=8, 1=16, 2=24, 3=32 pixels, etc.)
833       |x...............|  End of list marker
834
835*******************************************************************************************/
836
837static void hud_draw(mame_bitmap *bitmap, const rectangle *cliprect)
838{
839   UINT8   *tile_rom = memory_region(REGION_GFX3);
840   UINT32   offs;
841
842   for (offs = 0x0; offs <= lockon_hudram_size; offs += 2)
843   {
844      UINT32   y;
845      UINT32   y_pos;
846      UINT32   x_pos;
847      UINT32   y_size;
848      UINT32   x_size;
849      UINT32   layout;
850      UINT16   colour;
851      UINT32   code;
852      UINT32   rom_a12_7;
853
854      /* End of sprite list marker */
855      if (lockon_hud_ram[offs + 1] & 0x8000)
856         break;
857
858      y_pos   = lockon_hud_ram[offs] & 0x1ff;
859      x_pos   = lockon_hud_ram[offs + 1] & 0x1ff;
860      x_size   = (lockon_hud_ram[offs + 1] >> 12) & 7;
861      code   = (lockon_hud_ram[offs] >> 9) & 0x7f;
862      colour   = Machine->pens[0x200 + ((lockon_hud_ram[offs + 1] >> 9) & 7)];
863      layout   = (code >> 5) & 3;
864
865      rom_a12_7 = (code & 0xfe) << 6;
866
867      /* Account for line buffering */
868      y_pos -= 1;
869
870      if (layout == 3)
871         y_size = 32;
872      else if (layout == 2)
873         y_size = 16;
874      else
875         y_size = 8;
876
877      for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
878      {
879         UINT32 xt;
880         UINT32 cy;
881
882         cy = y_pos + y;
883
884         if (cy < 0x200)
885            continue;
886
887         if ((cy & 0xff) == y_size)
888            break;
889
890         for (xt = 0; xt <= x_size; ++xt)
891         {
892            UINT32   rom_a6_3;
893            UINT32   px;
894            UINT8   gfx_strip;
895
896            if (layout == 3)
897               rom_a6_3 = (BIT(cy, 4) << 3) | (BIT(cy, 3) << 2) | (BIT(xt, 1) << 1) | BIT(xt, 0);
898            else if (layout == 2)
899               rom_a6_3 = ((BIT(code, 0) << 3) | (BIT(xt, 1) << 2) | (BIT(cy, 3) << 1) | (BIT(xt, 0)));
900            else
901               rom_a6_3 = (BIT(code, 0) << 3) | (xt & 7);
902
903            rom_a6_3 <<= 3;
904
905            /* Get tile data */
906            gfx_strip = tile_rom[rom_a12_7 | rom_a6_3 | (cy & 7)];
907
908            if (gfx_strip == 0)
909               continue;
910
911            /* Draw */
912            for (px = 0; px < 8; ++px)
913            {
914               UINT32 x = x_pos + (xt << 3) + px;
915
916               if (x <= cliprect->max_x)
917               {
918                  UINT16 *dst = BITMAP_ADDR16(bitmap, y, x);
919
920                  if (BIT(gfx_strip, px ^ 7) && *dst > 255)
921                     *dst = colour;
922               }
923            }
924         }
925      }
926   }
927}
928
929
930/*************************************
931 *
932 *  Driver video handlers
933 *
934 *************************************/
935
936VIDEO_START( lockon )
937{
938   lockon_tilemap = tilemap_create(get_lockon_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 64, 32);
939   tilemap_set_transparent_pen(lockon_tilemap, 0);
940
941   /* Allocate the two frame buffers for rotation */
942   back_buffer = auto_bitmap_alloc(512, 512, BITMAP_FORMAT_INDEXED16);
943   front_buffer = auto_bitmap_alloc(512, 512, BITMAP_FORMAT_INDEXED16);
944
945   /* 2kB of object ASIC palette RAM */
946   obj_pal_ram = auto_malloc(2048);
947
948   /* Timer for ground display list callback */
949   bufend_timer = timer_alloc(bufend_callback, NULL);
950
951   /* Timer for the CRTC cursor pulse */
952   cursor_timer = timer_alloc(cursor_callback, NULL);
953   timer_adjust(cursor_timer, video_screen_get_time_until_pos(0, CURSOR_YPOS, CURSOR_XPOS), 0, attotime_zero);
954}
955
956VIDEO_UPDATE( lockon )
957{
958   /* If screen output is disabled, fill with black */
959   if ( !BIT(lockon_ctrl_reg, 7) )
960   {
961      fillbitmap(bitmap, get_black_pen(machine), cliprect);
962      return 0;
963   }
964
965   /* Scan out the frame buffer in rotated order */
966   rotate_draw(bitmap, cliprect);
967
968   /* Draw the character tilemap */
969   tilemap_draw(bitmap, cliprect, lockon_tilemap, 0, 0);
970
971   /* Draw the HUD */
972   hud_draw(bitmap, cliprect);
973
974   return 0;
975}
976
977VIDEO_EOF( lockon )
978{
979   /* Swap the frame buffers */
980   mame_bitmap *tmp = front_buffer;
981   front_buffer = back_buffer;
982   back_buffer = tmp;
983
984   /* Draw the frame buffer layers */
985   scene_draw();
986   ground_draw();
987   objects_draw();
988
989}
src/mame/video/mappy.c
r1649r1650
538538
539539   fillbitmap(sprite_bitmap,15,cliprect);
540540   mappy_draw_sprites(machine,sprite_bitmap,cliprect,0,0,15);
541   copybitmap(bitmap,sprite_bitmap,0,0,0,0,cliprect,TRANSPARENCY_PEN,15);
541   copybitmap_trans(bitmap,sprite_bitmap,0,0,0,0,cliprect,15);
542542
543543   /* Redraw the high priority characters */
544544   tilemap_draw(bitmap,cliprect,bg_tilemap,1,0);
src/mame/video/atari.c
r1649r1650
77******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "includes/atari.h"
1112#include "video/gtia.h"
1213
src/mame/video/segas32.c
r1649r1650
142142*/
143143
144144#include "driver.h"
145#include "deprecat.h"
145146#include "profiler.h"
146147#include "segas32.h"
147148
src/mame/video/psikyosh.c
r1649r1650
9090*/
9191
9292#include "driver.h"
93#include "deprecat.h"
9394#include "profiler.h"
9495#include "psikyosh.h"
9596
r1649r1650
328329      }
329330      /* Only ever seems to use one linescroll value, ok for now */
330331      /* Disabled for now, as they doesn't even support alpha :( */
331//      copyscrollbitmap(bitmap,zoom_bitmap,1,bg_scrollx,512,bg_scrolly,cliprect,TRANSPARENCY_PEN,0);
332//      copyscrollbitmap(bitmap,zoom_bitmap,256,bg_scrollx,0,bg_scrolly,cliprect,TRANSPARENCY_PEN,0);
332//      copyscrollbitmap_trans(bitmap,zoom_bitmap,1,bg_scrollx,512,bg_scrolly,cliprect,0);
333//      copyscrollbitmap_trans(bitmap,zoom_bitmap,256,bg_scrollx,0,bg_scrolly,cliprect,0);
333334   }
334335}
335336
src/mame/video/quizdna.c
r1649r1650
1010******************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314
1415static UINT8 *quizdna_bg_ram;
1516static UINT8 *quizdna_fg_ram;
src/mame/video/kan_pand.c
r1649r1650
4545*/
4646
4747#include "driver.h"
48#include "deprecat.h"
4849#include "kan_pand.h"
4950
5051static UINT8* pandora_spriteram;
r1649r1650
6667      return;
6768   }
6869
69   copybitmap(bitmap,pandora_sprites_bitmap,0,0,0,0,cliprect,TRANSPARENCY_PEN,0);
70   copybitmap_trans(bitmap,pandora_sprites_bitmap,0,0,0,0,cliprect,0);
7071}
7172
7273
src/mame/video/boogwing.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "deco16ic.h"
34
45static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect, UINT16* spriteram_base, int gfx_region)
src/mame/video/decocass.c
r1649r1650
55 ***********************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/decocass.h"
910
1011static INT32 watchdog_count;
src/mame/video/fromance.c
r1649r1650
88******************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "fromance.h"
1213
1314
src/mame/video/irobot.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "irobot.h"
910
1011#define BITMAP_WIDTH   256
r1649r1650
4445PALETTE_INIT( irobot )
4546{
4647   int i;
47   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
48   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4948
50   /* Convert the color prom for the text palette */
51   for (i = 0;i < 32;i++)
49   /* convert the color prom for the text palette */
50   for (i = 0; i < 32; i++)
5251   {
53       int r,g,b;
54      int bits,intensity;
55       UINT32 color;
52       int intensity = color_prom[i] & 0x03;
5653
57       color = *color_prom;
58       intensity = color & 0x03;
59       bits = (color >> 6) & 0x03;
60       r = 28 * bits * intensity;
61       bits = (color >> 4) & 0x03;
62       g = 28 * bits * intensity;
63       bits = (color >> 2) & 0x03;
64       b = 28 * bits * intensity;
65      palette_set_color(machine,i+64,MAKE_RGB(r,g,b));
66      color_prom++;
67   }
54       int r = 28 * ((color_prom[i] >> 6) & 0x03) * intensity;
55       int g = 28 * ((color_prom[i] >> 4) & 0x03) * intensity;
56       int b = 28 * ((color_prom[i] >> 2) & 0x03) * intensity;
6857
69   /* polygons */
70    for (i = 0;i < 64;i++)
71         colortable[i] = i;
58      int swapped_i = BITSWAP8(i,7,6,5,4,3,0,1,2);
7259
73   /* text */
74    for (i = 0;i < TOTAL_COLORS(0);i++)
75   {
76      COLOR(0,i) = ((i & 0x18) | ((i & 0x01) << 2) | ((i & 0x06) >> 1)) + 64;
60      palette_set_color(machine, swapped_i + 64, MAKE_RGB(r, g, b));
7761   }
7862}
7963
r1649r1650
247231      polybitmap = polybitmap1;
248232
249233   lpnt=0;
250   while (lpnt < 0x7FF)
234   while (lpnt < 0x7ff)
251235   {
252236      d1 = combase16[lpnt++];
253      if (d1 == 0xFFFF) break;
254      spnt = d1 & 0x07FF;
255      shp = (d1 & 0xF000) >> 12;
237      if (d1 == 0xffff) break;
238      spnt = d1 & 0x07ff;
239      shp = (d1 & 0xf000) >> 12;
256240
257      /* Pixel */
241      /* pixel */
258242      if (shp == 0x8)
259243      {
260         while (spnt < 0x7FF)
244         while (spnt < 0x7ff)
261245         {
262246            sx = combase16[spnt];
263            if (sx == 0xFFFF) break;
247            if (sx == 0xffff) break;
264248            sy = combase16[spnt+1];
265            color = sy & 0x3F;
249            color = sy & 0x3f;
266250            sx = ROUND_TO_PIXEL(sx);
267251            sy = ROUND_TO_PIXEL(sy);
268252              if (sx >= ir_xmin && sx < ir_xmax && sy >= ir_ymin && sy < ir_ymax)
r1649r1650
271255         }//while object
272256      }//if point
273257
274      /* Line */
275      if (shp == 0xC)
258      /* line */
259      if (shp == 0xc)
276260      {
277         while (spnt < 0x7FF)
261         while (spnt < 0x7ff)
278262         {
279263            ey = combase16[spnt];
280            if (ey == 0xFFFF) break;
264            if (ey == 0xffff) break;
281265            ey = ROUND_TO_PIXEL(ey);
282266            sy = combase16[spnt+1];
283            color = sy & 0x3F;
267            color = sy & 0x3f;
284268            sy = ROUND_TO_PIXEL(sy);
285269            sx = combase16[spnt+3];
286270            word1 = (INT16)combase16[spnt+2];
r1649r1650
290274         }//while object
291275      }//if line
292276
293      /* Polygon */
277      /* polygon */
294278      if (shp == 0x4)
295279      {
296         spnt2 = combase16[spnt] & 0x7FF;
280         spnt2 = combase16[spnt] & 0x7ff;
297281
298282         sx = combase16[spnt+1];
299283         sx2 = combase16[spnt+2];
300284         sy = combase16[spnt+3];
301         color = sy & 0x3F;
285         color = sy & 0x3f;
302286         sy = ROUND_TO_PIXEL(sy);
303287         spnt+=4;
304288
305289         word1 = (INT16)combase16[spnt];
306290         ey = combase16[spnt+1];
307         if (word1 != -1 || ey != 0xFFFF)
291         if (word1 != -1 || ey != 0xffff)
308292         {
309293            ey = ROUND_TO_PIXEL(ey);
310294            spnt+=2;
r1649r1650
337321               {
338322                  word1 = (INT16)combase16[spnt];
339323                  ey = combase16[spnt+1];
340                  if (word1 == -1 && ey == 0xFFFF)
324                  if (word1 == -1 && ey == 0xffff)
341325                     break;
342326                  ey = ROUND_TO_PIXEL(ey);
343327                  spnt+=2;
r1649r1650
374358   /* redraw the non-zero characters in the alpha layer */
375359   for (y = offs = 0; y < 32; y++)
376360      for (x = 0; x < 32; x++, offs++)
377         if (videoram[offs] != 0)
378         {
379            int code = videoram[offs] & 0x3f;
380            int color = ((videoram[offs] & 0xC0) >> 6) | (irobot_alphamap >> 3);
381            int transp=color + 64;
361      {
362         int code = videoram[offs] & 0x3f;
363         int color = ((videoram[offs] & 0xc0) >> 6) | (irobot_alphamap >> 3);
382364
383            drawgfx(bitmap,machine->gfx[0],
384                  code, color,
385                  0,0,
386                  8*x,8*y,
387                  cliprect,TRANSPARENCY_COLOR,transp);
388         }
365         drawgfx(bitmap,machine->gfx[0],
366               code, color,
367               0,0,
368               8*x,8*y,
369               cliprect,TRANSPARENCY_PEN,0);
370      }
389371   return 0;
390372}
src/mame/video/gomoku.c
r1649r1650
167167   if (gomoku_bg_dispsw)
168168   {
169169      /* copy bg bitmap */
170      copybitmap(bitmap, gomoku_bg_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
170      copybitmap(bitmap, gomoku_bg_bitmap, 0, 0, 0, 0, cliprect);
171171
172172      // stone
173173      for (y = 0; y < 256; y++)
src/mame/video/m57.c
r0r1650
1/****************************************************************************
2
3    Irem M57 hardware
4
5****************************************************************************/
6
7#include "driver.h"
8#include "m57.h"
9
10
11UINT8 *m57_scroll;
12
13static int flipscreen;
14static tilemap *bg_tilemap;
15
16
17/***************************************************************************
18
19  Convert the color PROMs into a more useable format.
20
21  Tropical Angel has two 256x4 character palette PROMs, one 32x8 sprite
22  palette PROM, and one 256x4 sprite color lookup table PROM.
23
24  I don't know for sure how the palette PROMs are connected to the RGB
25  output, but it's probably something like this; note that RED and BLUE
26  are swapped wrt the usual configuration.
27
28  bit 7 -- 220 ohm resistor  -- RED
29        -- 470 ohm resistor  -- RED
30        -- 220 ohm resistor  -- GREEN
31        -- 470 ohm resistor  -- GREEN
32        -- 1  kohm resistor  -- GREEN
33        -- 220 ohm resistor  -- BLUE
34        -- 470 ohm resistor  -- BLUE
35  bit 0 -- 1  kohm resistor  -- BLUE
36
37***************************************************************************/
38PALETTE_INIT( m57 )
39{
40   int i;
41
42   machine->colortable = colortable_alloc(machine, 32*8+16);
43
44   /* character palette */
45   for (i = 0;i < 256;i++)
46   {
47      int bit0,bit1,bit2,r,g,b;
48
49      /* red component */
50      bit0 = 0;
51      bit1 = (color_prom[256] >> 2) & 0x01;
52      bit2 = (color_prom[256] >> 3) & 0x01;
53      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
54      /* green component */
55      bit0 = (color_prom[0] >> 3) & 0x01;
56      bit1 = (color_prom[256] >> 0) & 0x01;
57      bit2 = (color_prom[256] >> 1) & 0x01;
58      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
59      /* blue component */
60      bit0 = (color_prom[0] >> 0) & 0x01;
61      bit1 = (color_prom[0] >> 1) & 0x01;
62      bit2 = (color_prom[0] >> 2) & 0x01;
63      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
64
65      colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
66      colortable_entry_set_value(machine->colortable,i,i);
67      color_prom++;
68   }
69
70   color_prom += 256;
71   /* color_prom now points to the beginning of the sprite palette */
72
73   /* sprite palette */
74   for (i = 0;i < 16;i++)
75   {
76      int bit0,bit1,bit2,r,g,b;
77
78      /* red component */
79      bit0 = 0;
80      bit1 = (*color_prom >> 6) & 0x01;
81      bit2 = (*color_prom >> 7) & 0x01;
82      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
83      /* green component */
84      bit0 = (*color_prom >> 3) & 0x01;
85      bit1 = (*color_prom >> 4) & 0x01;
86      bit2 = (*color_prom >> 5) & 0x01;
87      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
88      /* blue component */
89      bit0 = (*color_prom >> 0) & 0x01;
90      bit1 = (*color_prom >> 1) & 0x01;
91      bit2 = (*color_prom >> 2) & 0x01;
92      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
93
94      colortable_palette_set_color(machine->colortable,i+256,MAKE_RGB(r,g,b));
95      color_prom++;
96   }
97
98   color_prom += 16;
99   /* color_prom now points to the beginning of the sprite lookup table */
100
101
102   /* sprite lookup table */
103   for (i = 0;i < 32*8;i++)
104   {
105      colortable_entry_set_value(machine->colortable,i+32*8,256 + (~*color_prom & 0x0f));
106      color_prom++;
107   }
108}
109
110
111static TILE_GET_INFO( get_tile_info )
112{
113   UINT8 attr = videoram[tile_index*2 + 0];
114   UINT16 code = videoram[tile_index*2 + 1] | ((attr & 0xc0) << 2);
115
116   SET_TILE_INFO(0, code, attr & 0x0f, TILE_FLIPXY(attr >> 4));
117}
118
119
120WRITE8_HANDLER( m57_videoram_w )
121{
122   videoram[offset] = data;
123   tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
124}
125
126
127VIDEO_START( m57 )
128{
129   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
130   tilemap_set_scroll_rows(bg_tilemap, 256);
131}
132
133
134WRITE8_HANDLER( m57_flipscreen_w )
135{
136   /* screen flip is handled both by software and hardware */
137   data ^= ~readinputport(4) & 1;
138
139   flipscreen = data & 1;
140   tilemap_set_flip(bg_tilemap, flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
141
142   coin_counter_w(0,data & 0x02);
143   coin_counter_w(1,data & 0x20);
144}
145
146
147
148
149static void draw_background(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
150{
151   int y;
152
153   for (y = 0; y < 256; y++)
154      tilemap_set_scrollx(bg_tilemap, y, (y < 64) ? 0 : (y < 128) ? m57_scroll[64] : m57_scroll[y]);
155   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
156}
157
158static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
159{
160   int offs;
161
162
163   for (offs = spriteram_size-4;offs >= 0;offs -= 4)
164   {
165      UINT8 attributes = spriteram[offs+1];
166      int sx = spriteram[offs+3];
167      int sy = ((224-spriteram[offs+0]-32)&0xff)+32;
168      int code = spriteram[offs+2];
169      int color = attributes&0x1f;
170      int flipy = attributes&0x80;
171      int flipx = attributes&0x40;
172
173      int tile_number = code + ((attributes & 0x20) << 3);
174
175      if (flipscreen)
176      {
177         sx = 240 - sx;
178         sy = 224 - sy;
179         flipx = !flipx;
180         flipy = !flipy;
181      }
182
183      drawgfx(bitmap,machine->gfx[1],
184         tile_number,
185         color,
186         flipx,flipy,
187         sx,sy,
188         cliprect,TRANSPARENCY_PENS,
189         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 256+15));
190   }
191}
192
193
194
195VIDEO_UPDATE( m57 )
196{
197   draw_background(machine, bitmap, cliprect);
198   draw_sprites(machine, bitmap, cliprect);
199   return 0;
200}
src/mame/video/konamigx.c
r1649r1650
44 */
55
66#include "driver.h"
7#include "deprecat.h"
78#include "video/konamiic.h"
89#include "machine/konamigx.h"
910
src/mame/video/ladybug.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112/* Use the Zero Hour star generator board */
1213extern void redclash_set_stars_enable( UINT8 on );
src/mame/video/combatsc.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "video/konamiic.h"
1112
1213static tilemap *bg_tilemap[2];
r1649r1650
2728
2829PALETTE_INIT( combasc )
2930{
30   int i,pal,clut = 0;
31   for( pal=0; pal<8; pal++ )
31   int pal;
32
33   /* allocate the colortable */
34   machine->colortable = colortable_alloc(machine, 0x80);
35
36   for (pal = 0; pal < 8; pal++)
3237   {
33      switch( pal )
38      int i, clut;
39
40      switch (pal)
3441      {
42         default:
3543         case 0: /* other sprites */
3644         case 2: /* other sprites(alt) */
3745         clut = 1;   /* 0 is wrong for Firing Range III targets */
r1649r1650
5361         break;
5462      }
5563
56      for( i=0; i<256; i++ )
64      for (i = 0; i < 0x100; i++)
5765      {
58         if ((pal & 1) == 0)   /* sprites */
59         {
60            if (color_prom[256 * clut + i] == 0)
61               *(colortable++) = 0;
62            else
63               *(colortable++) = 16 * pal + color_prom[256 * clut + i];
64         }
65         else   /* chars */
66            *(colortable++) = 16 * pal + color_prom[256 * clut + i];
66         UINT8 ctabentry;
67
68         if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0))
69            ctabentry = 0;
70         else
71            ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
72
73         colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
6774      }
6875   }
6976}
7077
78
7179PALETTE_INIT( combascb )
7280{
73   int i,pal;
74   for( pal=0; pal<8; pal++ )
81   int pal;
82
83   /* allocate the colortable */
84   machine->colortable = colortable_alloc(machine, 0x80);
85
86   for (pal = 0; pal < 8; pal++)
7587   {
76      for( i=0; i<256; i++ )
88      int i;
89
90      for (i = 0; i < 0x100; i++)
7791      {
78         if ((pal & 1) == 0)   /* sprites */
79            *(colortable++) = 16 * pal + (color_prom[i] ^ 0x0f);
80         else   /* chars */
81            *(colortable++) = 16 * pal + (i & 0x0f);   /* no lookup? */
92         UINT8 ctabentry;
93
94         if ((pal & 1) == 0)
95            /* sprites */
96            ctabentry = (pal << 4) | (~color_prom[i] & 0x0f);
97         else
98            /* chars - no lookup? */
99            ctabentry = (pal << 4) | (i & 0x0f);   /* no lookup? */
100
101         colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
82102      }
83103   }
84104}
85105
106
107static void set_pens(running_machine *machine)
108{
109   int i;
110
111   for (i = 0x00; i < 0x100; i += 2)
112   {
113      UINT16 data = paletteram[i] | (paletteram[i | 1] << 8);
114
115      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
116
117      colortable_palette_set_color(machine->colortable, i >> 1, color);
118   }
119}
120
121
122
86123/***************************************************************************
87124
88125    Callbacks for the TileMap code
r1649r1650
444481{
445482   int base_color = (circuit*4)*16+(K007121_ctrlram[circuit][6]&0x10)*2;
446483
447   K007121_sprites_draw(machine,circuit,bitmap,cliprect,source,base_color,0,0,pri_mask);
484   K007121_sprites_draw(circuit,bitmap,machine->gfx,machine->colortable,cliprect,source,base_color,0,0,pri_mask);
448485}
449486
450487
r1649r1650
452489{
453490   int i;
454491
492   set_pens(machine);
455493
456494   if (K007121_ctrlram[0][0x01] & 0x02)
457495   {
r1649r1650
611649{
612650   int i;
613651
652   set_pens(machine);
653
614654   for( i=0; i<32; i++ )
615655   {
616656      tilemap_set_scrollx( bg_tilemap[0],i, combasc_io_ram[0x040+i]+5 );
src/mame/video/blueprnt.c
r1649r1650
1919PALETTE_INIT( blueprnt )
2020{
2121   int i;
22   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
23   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
2422
25   for (i = 0;i < 16;i++)
23   for (i = 0; i < machine->drv->total_colors; i++)
2624   {
27      int r = ((i >> 0) & 1) * ((i & 0x08) ? 0xbf : 0xff);
28      int g = ((i >> 2) & 1) * ((i & 0x08) ? 0xbf : 0xff);
29      int b = ((i >> 1) & 1) * ((i & 0x08) ? 0xbf : 0xff);
30      palette_set_color(machine,i,MAKE_RGB(r,g,b));
31   }
25      UINT8 pen;
26      int r, g, b;
3227
33   /* chars */
34   for (i = 0;i < 128;i++)
35   {
36      int base =  (i & 0x40) ? 8 : 0;
37      COLOR(0,4*i+0) = base + 0;
38      COLOR(0,4*i+1) = base + ((i >> 0) & 7);
39      COLOR(0,4*i+2) = base + ((i >> 3) & 7);
40      COLOR(0,4*i+3) = base + (((i >> 0) & 7) | ((i >> 3) & 7));
41   }
28      if (i < 0x200)
29         /* characters */
30         pen = ((i & 0x100) >> 5) |
31              ((i & 0x002) ? ((i & 0x0e0) >> 5) : 0) |
32              ((i & 0x001) ? ((i & 0x01c) >> 2) : 0);
33      else
34         /* sprites */
35         pen = i - 0x200;
4236
43   /* sprites */
44   for (i = 0;i < 8;i++)
45      COLOR(1,i) = i;
37      r = ((pen >> 0) & 1) * ((pen & 0x08) ? 0xbf : 0xff);
38      g = ((pen >> 2) & 1) * ((pen & 0x08) ? 0xbf : 0xff);
39      b = ((pen >> 1) & 1) * ((pen & 0x08) ? 0xbf : 0xff);
40
41      palette_set_color(machine, i, MAKE_RGB(r, g, b));
42   }
4643}
4744
4845WRITE8_HANDLER( blueprnt_videoram_w )
src/mame/video/ppu2c0x.c
r1649r1650
2424
2525******************************************************************************/
2626
27#include <math.h>
2827#include "driver.h"
2928#include "profiler.h"
3029#include "video/ppu2c0x.h"
r1649r1650
798797            // with the palette entry at the VRAM address instead of the usual background
799798            // pen. Micro Machines makes use of this feature.
800799            int penNum;
800
801801            if (this_ppu->videoram_addr & 0x03)
802            {
803802               penNum = this_ppu->videoram[this_ppu->videoram_addr & 0x3f1f] & 0x3f;
804            }
805803            else
806            {
807804               penNum = this_ppu->videoram[this_ppu->videoram_addr & 0x3f00] & 0x3f;
808            }
805
809806            back_pen = chips[num].machine->pens[penNum + intf->color_base[num]];
810807         }
811808         else
r1649r1650
825822         UINT16 tmp;
826823         tmp = ( this_ppu->refresh_data & 0x03e0 ) + 0x20;
827824         this_ppu->refresh_data &= 0x7c1f;
825
828826         /* handle bizarro scrolling rollover at the 30th (not 32nd) vertical tile */
829827         if ( tmp == 0x03c0 )
830         {
831828            this_ppu->refresh_data ^= 0x0800;
832         }
833829         else
834         {
835830            this_ppu->refresh_data |= ( tmp & 0x03e0 );
836         }
831
837832//logerror("updating refresh_data: %04x\n", this_ppu->refresh_data);
838833       }
839834   }
r1649r1650
13241319   // Because the DMA is only useful during vblank, this may not be strictly necessary since
13251320   // the scanline timers should catch us up before drawing actually happens.
13261321#if 0
1327   scanline_callback(Machine, num);
1328   scanline_callback(Machine, num);
1329   scanline_callback(Machine, num);
1330   scanline_callback(Machine, num);
1322{
1323   ppu2c0x_chip* this_ppu = &chips[num];
1324
1325   scanline_callback(this_ppu->machine, num);
1326   scanline_callback(this_ppu->machine, num);
1327   scanline_callback(this_ppu->machine, num);
1328   scanline_callback(this_ppu->machine, num);
1329}
13311330#endif
13321331}
13331332
r1649r1650
13451344      return;
13461345   }
13471346
1348   copybitmap( bitmap, chips[num].bitmap, flipx, flipy, sx, sy, 0, TRANSPARENCY_NONE, 0 );
1347   copybitmap( bitmap, chips[num].bitmap, flipx, flipy, sx, sy, 0 );
13491348}
13501349
13511350/*************************************
src/mame/video/buggychl.c
r1649r1650
130130   for (offs = 0;offs < 256;offs++)
131131      scroll[offs] = -buggychl_scrollv[offs/8];
132132
133   copyscrollbitmap(tmpbitmap2,tmpbitmap1,1,&bg_scrollx,256,scroll,NULL,TRANSPARENCY_NONE,0);
133   copyscrollbitmap(tmpbitmap2,tmpbitmap1,1,&bg_scrollx,256,scroll,NULL);
134134
135135   /* then copy to the screen doing row scroll */
136136   for (offs = 0;offs < 256;offs++)
137137      scroll[offs] = -buggychl_scrollh[offs];
138138
139   copyscrollbitmap(bitmap,tmpbitmap2,256,scroll,0,0,cliprect,TRANSPARENCY_COLOR,32);
139   copyscrollbitmap_trans(bitmap,tmpbitmap2,256,scroll,0,0,cliprect,machine->pens[32]);
140140}
141141
142142
src/mame/video/starshp1.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "includes/starshp1.h"
9#include <math.h>
1010
1111UINT8* starshp1_playfield_ram;
1212UINT8* starshp1_hpos_ram;
src/mame/video/taito_f2.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/taitoic.h"
34#include "includes/taito_f2.h"
45
src/mame/video/gottlieb.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112UINT8 *gottlieb_charram;
1213
src/mame/video/tubep.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "includes/tubep.h"
1112#include "video/resnet.h"
1213
src/mame/video/homedata.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/m6809/m6809.h"
34#include "homedata.h"
45
src/mame/video/exidy.c
r1649r1650
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910
1011UINT8 *exidy_videoram;
r1649r1650
376377
377378   /* update the background and draw it */
378379   draw_background();
379   copybitmap(bitmap, background_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
380   copybitmap(bitmap, background_bitmap, 0, 0, 0, 0, cliprect);
380381
381382   /* draw the sprites */
382383   draw_sprites(machine, bitmap, NULL);
src/mame/video/xxmissio.c
r1649r1650
101101      sy = xxmissio_yscroll;
102102   }
103103
104   copyscrollbitmap(bitmap,tmpbitmap,1,&sx,1,&sy,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
104   copyscrollbitmap(bitmap,tmpbitmap,1,&sx,1,&sy,cliprect);
105105
106106/* draw sprites */
107107
r1649r1650
137137         col,
138138         fx,fy,
139139         px,py,
140         &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
140         cliprect,TRANSPARENCY_PEN,0);
141141      if (px>0x1e0)
142142         drawgfx(bitmap,machine->gfx[1],
143143            chr,
144144            col,
145145            fx,fy,
146146            px-0x200,py,
147            &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
147            cliprect,TRANSPARENCY_PEN,0);
148148
149149   }
150150
r1649r1650
175175            col,
176176            flipscreen,flipscreen,
177177            px,py,
178            &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
178            cliprect,TRANSPARENCY_PEN,0);
179179      }
180180   }
181181
src/mame/video/hyhoo.c
r1649r1650
239239VIDEO_UPDATE( hyhoo )
240240{
241241   if (hyhoo_dispflag)
242      copybitmap(bitmap, hyhoo_tmpbitmap, hyhoo_flipscreen, hyhoo_flipscreen, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
242      copybitmap(bitmap, hyhoo_tmpbitmap, hyhoo_flipscreen, hyhoo_flipscreen, 0, 0, cliprect);
243243   else
244244      fillbitmap(bitmap, RGB_BLACK, cliprect);
245245
src/mame/video/hng64.c
r1649r1650
10961096
10971097//  usrintf_showmessage("%d", hng64_hackTm3Count) ;
10981098
1099   if (hng64_hackTm3Count/4 < Machine->screen[0].visarea.max_y)
1099   if (hng64_hackTm3Count/4 < machine->screen[0].visarea.max_y)
11001100   {
11011101      for (i = 0; i < hng64_hackTm3Count/4; i++)
11021102      {
src/mame/video/macrossp.c
r1649r1650
22  see DRIVER file for notes */
33
44#include "driver.h"
5#include "deprecat.h"
56
67
78UINT32 *macrossp_scra_videoram, *macrossp_scra_videoregs;
src/mame/video/gladiatr.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910UINT8 *gladiatr_videoram, *gladiatr_colorram, *gladiatr_textram;
1011
src/mame/video/skychut.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "skychut.h"
1516
1617static tilemap *      tx_tilemap;
src/mame/video/taito_l.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34
45extern UINT8 *taitol_rambanks;
src/mame/video/gyruss.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
11#include "video/resnet.h"
1012
1113
1214static UINT8 flipscreen;
r1649r1650
3941***************************************************************************/
4042PALETTE_INIT( gyruss )
4143{
44   static const int resistances_rg[3] = { 1000, 470, 220 };
45   static const int resistances_b [2] = { 470, 220 };
46   double rweights[3], gweights[3], bweights[2];
4247   int i;
43   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
44   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4548
49   /* compute the color output resistor weights */
50   compute_resistor_weights(0,   255, -1.0,
51         3, &resistances_rg[0], rweights, 470, 0,
52         3, &resistances_rg[0], gweights, 470, 0,
53         2, &resistances_b[0],  bweights, 470, 0);
4654
47   for (i = 0;i < machine->drv->total_colors;i++)
55   /* allocate the colortable */
56   machine->colortable = colortable_alloc(machine, 32);
57
58   /* create a lookup table for the palette */
59   for (i = 0; i < 0x20; i++)
4860   {
49      int bit0,bit1,bit2,r,g,b;
61      int bit0, bit1, bit2;
62      int r, g, b;
5063
64      /* red component */
65      bit0 = (color_prom[i] >> 0) & 0x01;
66      bit1 = (color_prom[i] >> 1) & 0x01;
67      bit2 = (color_prom[i] >> 2) & 0x01;
68      r = combine_3_weights(rweights, bit0, bit1, bit2);
5169
52      /* red component */
53      bit0 = (*color_prom >> 0) & 0x01;
54      bit1 = (*color_prom >> 1) & 0x01;
55      bit2 = (*color_prom >> 2) & 0x01;
56      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
5770      /* green component */
58      bit0 = (*color_prom >> 3) & 0x01;
59      bit1 = (*color_prom >> 4) & 0x01;
60      bit2 = (*color_prom >> 5) & 0x01;
61      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
71      bit0 = (color_prom[i] >> 3) & 0x01;
72      bit1 = (color_prom[i] >> 4) & 0x01;
73      bit2 = (color_prom[i] >> 5) & 0x01;
74      g = combine_3_weights(gweights, bit0, bit1, bit2);
75
6276      /* blue component */
63      bit0 = 0;
64      bit1 = (*color_prom >> 6) & 0x01;
65      bit2 = (*color_prom >> 7) & 0x01;
66      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
77      bit0 = (color_prom[i] >> 6) & 0x01;
78      bit1 = (color_prom[i] >> 7) & 0x01;
79      b = combine_2_weights(bweights, bit0, bit1);
6780
68      palette_set_color(machine,i,MAKE_RGB(r,g,b));
69      color_prom++;
81      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
7082   }
7183
72   /* color_prom now points to the beginning of the sprite lookup table */
84   /* color_prom now points to the beginning of the lookup table */
85   color_prom += 32;
7386
74   /* sprites */
75   for (i = 0;i < TOTAL_COLORS(1);i++)
76      COLOR(1,i) = *(color_prom++) & 0x0f;
87   /* sprites map to the lower 16 palette entries */
88   for (i = 0; i < 0x100; i++)
89   {
90      UINT8 ctabentry = color_prom[i] & 0x0f;
91      colortable_entry_set_value(machine->colortable, i, ctabentry);
92   }
7793
78   /* characters */
79   for (i = 0;i < TOTAL_COLORS(0);i++)
80      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
94   /* characters map to the upper 16 palette entries */
95   for (i = 0x100; i < 0x140; i++)
96   {
97      UINT8 ctabentry = color_prom[i] & 0x0f;
98      colortable_entry_set_value(machine->colortable, i, ctabentry + 0x10);
99   }
81100}
82101
83102
r1649r1650
130149         sy = 241 - sr[offs + 3];
131150         if (sy > line-16 && sy <= line)
132151         {
133            drawgfx(bitmap,machine->gfx[1 + (sr[offs + 1] & 1)],
152            drawgfx(bitmap,machine->gfx[sr[offs + 1] & 1],
134153                  sr[offs + 1]/2 + 4*(sr[offs + 2] & 0x20),
135154                  sr[offs + 2] & 0x0f,
136155                  !(sr[offs + 2] & 0x40),sr[offs + 2] & 0x80,
r1649r1650
165184         flipy = !flipy;
166185      }
167186
168      drawgfx(bitmap,machine->gfx[0],
187      drawgfx(bitmap,machine->gfx[2],
169188            videoram[offs] + 8 * (colorram[offs] & 0x20),
170189            colorram[offs] & 0x0f,
171190            flipx,flipy,
r1649r1650
196215      }
197216
198217      if ((colorram[offs] & 0x10) != 0)
199         drawgfx(bitmap,machine->gfx[0],
218         drawgfx(bitmap,machine->gfx[2],
200219               videoram[offs] + 8 * (colorram[offs] & 0x20),
201220               colorram[offs] & 0x0f,
202221               flipx,flipy,
src/mame/video/fastlane.c
r1649r1650
88
99PALETTE_INIT( fastlane )
1010{
11   int pal,col;
11   int pal;
1212
13   for (pal = 0;pal < 16;pal++)
13   /* allocate the colortable */
14   machine->colortable = colortable_alloc(machine, 0x400);
15
16   for (pal = 0; pal < 0x10; pal++)
1417   {
15      for (col = 0;col < 1024;col++)
18      int i;
19
20      for (i = 0; i < 0x400; i++)
1621      {
17         *(colortable++) = (col & ~0x0f) | color_prom[16 * pal + (col & 0x0f)];
22         UINT8 ctabentry = (i & 0x3f0) | color_prom[(pal << 4) | (i & 0x0f)];
23         colortable_entry_set_value(machine->colortable, (pal << 10) | i, ctabentry);
1824      }
1925   }
2026}
2127
28
29static void set_pens(running_machine *machine)
30{
31   int i;
32
33   for (i = 0x00; i < 0x800; i += 2)
34   {
35      UINT16 data = paletteram[i | 1] | (paletteram[i] << 8);
36
37      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
38
39      colortable_palette_set_color(machine->colortable, i >> 1, color);
40   }
41}
42
43
44
2245/***************************************************************************
2346
2447  Callbacks for the TileMap code
r1649r1650
130153   sect_rect(&finalclip0, cliprect);
131154   sect_rect(&finalclip1, cliprect);
132155
156   set_pens(machine);
157
133158   /* set scroll registers */
134159   xoffs = K007121_ctrlram[0][0x00];
135160   for( i=0; i<32; i++ ){
r1649r1650
138163   tilemap_set_scrolly( layer0, 0, K007121_ctrlram[0][0x02] );
139164
140165   tilemap_draw(bitmap,&finalclip0,layer0,0,0);
141   K007121_sprites_draw(machine,0,bitmap,cliprect,spriteram,0,40,0,-1);
166   K007121_sprites_draw(0,bitmap,machine->gfx,machine->colortable,cliprect,spriteram,0,40,0,-1);
142167   tilemap_draw(bitmap,&finalclip1,layer1,0,0);
143168   return 0;
144169}
src/mame/video/kangaroo.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "kangaroo.h"
910
1011
1112UINT8 *kangaroo_video_control;
12UINT8 *kangaroo_bank_select;
13UINT8 *kangaroo_blitter;
14UINT8 *kangaroo_scroll;
1513
16static int screen_flipped;
17static mame_bitmap *tmpbitmap2;
1814
15static void blitter_execute(void);
1916
20/***************************************************************************
2117
22  Convert the color PROMs into a more useable format.
2318
24  Kangaroo doesn't have color PROMs, the playfield data is directly converted
25  into colors: 1 bit per gun, therefore only 8 possible colors, but there is
26  also a global mask register which controls intensities of the three guns,
27  separately for foreground and background. The fourth bit in the video RAM
28  data disables this mask, making the color display at full intensity
29  regardless of the mask value.
30  Actually the mask doesn't directly control intensity. The guns are rapidly
31  turned on and off at a subpixel rate, relying on the monitor to blend the
32  colors into a more or less uniform half intensity color.
19/*************************************
20 *
21 *  Video setup
22 *
23 *************************************/
3324
34  We use three groups of 8 pens: the first is fixed and contains the 8
35  possible colors; the other two are dynamically modified when the mask
36  register is written to, one is for the background, the other for sprites.
37
38***************************************************************************/
39
40PALETTE_INIT( kangaroo )
41{
42   int i;
43
44   for (i = 0;i < machine->drv->total_colors;i++)
45      palette_set_color_rgb(machine,i,pal1bit(i >> 2),pal1bit(i >> 1),pal1bit(i >> 0));
46}
47
48
49
50/***************************************************************************
51
52  Start the video hardware emulation.
53
54***************************************************************************/
55
5625VIDEO_START( kangaroo )
5726{
58   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
59   tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
60
61   videoram = auto_malloc(machine->screen[0].width*machine->screen[0].height);
27   videoram = auto_malloc(256 * 256);
28   state_save_register_global_pointer(videoram, 256 * 256);
6229}
6330
6431
6532
33/*************************************
34 *
35 *  Video control writes
36 *
37 *************************************/
38
6639WRITE8_HANDLER( kangaroo_video_control_w )
6740{
68   /* A & B bitmap control latch (A=playfield B=motion)
69          bit 5 FLIP A
70          bit 4 FLIP B
71          bit 3 EN A
72          bit 2 EN B
73          bit 1 PRI A
74          bit 0 PRI B */
41   kangaroo_video_control[offset] = data;
7542
76   if ((*kangaroo_video_control & 0x30) != (data & 0x30))
43   switch (offset)
7744   {
78      screen_flipped = 1;
79   }
45      case 5:   /* blitter start */
46         blitter_execute();
47         break;
8048
81   *kangaroo_video_control = data;
49      case 8:   /* bank select */
50         memory_set_bank(1, (data & 0x05) ? 0 : 1);
51         break;
52   }
8253}
8354
8455
85WRITE8_HANDLER( kangaroo_bank_select_w )
86{
87   UINT8 *RAM = memory_region(REGION_GFX1);
8856
57/*************************************
58 *
59 *  DMA blitter
60 *
61 *************************************/
8962
90   /* this is a VERY crude way to handle the banked ROMs - but it's */
91   /* correct enough to pass the self test */
92   if (data & 0x05)
93      memory_set_bankptr(1,&RAM[0x0000]);
94   else
95      memory_set_bankptr(1,&RAM[0x2000]);
96
97   *kangaroo_bank_select = data;
98}
99
100
101
102WRITE8_HANDLER( kangaroo_color_mask_w )
63static void blitter_execute(void)
10364{
104   int i;
65   int src,dest;
66   int x,y,width,height,old_bank_select,new_bank_select;
10567
68   src = kangaroo_video_control[0] + 256 * kangaroo_video_control[1];
69   dest = kangaroo_video_control[2] + 256 * kangaroo_video_control[3];
10670
107   /* color mask for A plane */
108   for (i = 0;i < 8;i++)
109   {
110      int r,g,b;
71   width = kangaroo_video_control[5];
72   height = kangaroo_video_control[4];
11173
74   old_bank_select = new_bank_select = kangaroo_video_control[8];
11275
113      r = ((i & 4) >> 2) * ((data & 0x20) ? 0xff : 0x7f);
114      g = ((i & 2) >> 1) * ((data & 0x10) ? 0xff : 0x7f);
115      b = ((i & 1) >> 0) * ((data & 0x08) ? 0xff : 0x7f);
76   if (new_bank_select & 0x0c)  new_bank_select |= 0x0c;
77   if (new_bank_select & 0x03)  new_bank_select |= 0x03;
11678
117      palette_set_color(Machine,8+i,MAKE_RGB(r,g,b));
118   }
79   kangaroo_video_control_w(8, new_bank_select & 0x05);
11980
120   /* color mask for B plane */
121   for (i = 0;i < 8;i++)
81   for (x = 0; x <= width; x++)
12282   {
123      int r,g,b;
83      for (y = 0; y <= height; y++)
84         program_write_byte(dest + y, program_read_byte(src++));
12485
125
126      r = ((i & 4) >> 2) * ((data & 0x04) ? 0xff : 0x7f);
127      g = ((i & 2) >> 1) * ((data & 0x02) ? 0xff : 0x7f);
128      b = ((i & 1) >> 0) * ((data & 0x01) ? 0xff : 0x7f);
129
130      palette_set_color(Machine,16+i,MAKE_RGB(r,g,b));
86      dest += 256;
13187   }
132}
13388
89   src = kangaroo_video_control[0] + 256 * kangaroo_video_control[1];
90   dest = kangaroo_video_control[2] + 256 * kangaroo_video_control[3];
13491
92   kangaroo_video_control_w(8, new_bank_select & 0x0a);
13593
136WRITE8_HANDLER( kangaroo_blitter_w )
137{
138   kangaroo_blitter[offset] = data;
139
140   if (offset == 5)    /* trigger DMA */
94   for (x = 0; x <= width; x++)
14195   {
142      int src,dest;
143      int x,y,xb,yb,old_bank_select,new_bank_select;
96      for (y = 0; y <= height; y++)
97         program_write_byte(dest + y, program_read_byte(src++));
14498
145      src = kangaroo_blitter[0] + 256 * kangaroo_blitter[1];
146      dest = kangaroo_blitter[2] + 256 * kangaroo_blitter[3];
147
148      xb = kangaroo_blitter[5];
149      yb = kangaroo_blitter[4];
150
151      old_bank_select = new_bank_select = *kangaroo_bank_select;
152
153      if (new_bank_select & 0x0c)  new_bank_select |= 0x0c;
154      if (new_bank_select & 0x03)  new_bank_select |= 0x03;
155      kangaroo_bank_select_w(0, new_bank_select & 0x05);
156
157      for (x = 0;x <= xb;x++)
158      {
159         for (y = 0;y <= yb;y++)
160         {
161            program_write_byte(dest++, program_read_byte(src++));
162         }
163
164         dest = dest - (yb + 1) + 256;
165      }
166
167      src = kangaroo_blitter[0] + 256 * kangaroo_blitter[1];
168      dest = kangaroo_blitter[2] + 256 * kangaroo_blitter[3];
169
170      kangaroo_bank_select_w(0, new_bank_select & 0x0a);
171
172      for (x = 0;x <= xb;x++)
173      {
174         for (y = 0;y <= yb;y++)
175         {
176            program_write_byte(dest++, program_read_byte(src++));
177         }
178
179         dest = dest - (yb + 1) + 256;
180      }
181
182      kangaroo_bank_select_w(0, old_bank_select);
99      dest += 256;
183100   }
184}
185101
186
187
188INLINE void kangaroo_plot_pixel(mame_bitmap *bitmap, int x, int y, int col, int color_base, int flip)
189{
190   if (flip)
191   {
192      x = bitmap->width - 1 - x;
193      y = bitmap->height - 1 - y;
194   }
195
196   *BITMAP_ADDR16(bitmap, y, x) = Machine->pens[((col & 0x08) ? 0 : color_base) + (col & 0x07)];
102   kangaroo_video_control_w(8, old_bank_select);
197103}
198104
199INLINE void kangaroo_redraw_4pixels(int x, int y)
200{
201   int offs, flipA, flipB;
202105
203106
204   offs = y * 256 + x;
107/*************************************
108 *
109 *  Video RAM writes
110 *
111 *************************************/
205112
206   flipA = *kangaroo_video_control & 0x20;
207   flipB = *kangaroo_video_control & 0x10;
208
209   kangaroo_plot_pixel(tmpbitmap , x  , y, videoram[offs  ] & 0x0f, 8,  flipA);
210   kangaroo_plot_pixel(tmpbitmap , x+1, y, videoram[offs+1] & 0x0f, 8,  flipA);
211   kangaroo_plot_pixel(tmpbitmap , x+2, y, videoram[offs+2] & 0x0f, 8,  flipA);
212   kangaroo_plot_pixel(tmpbitmap , x+3, y, videoram[offs+3] & 0x0f, 8,  flipA);
213   kangaroo_plot_pixel(tmpbitmap2, x  , y, videoram[offs  ] >> 4,   16, flipB);
214   kangaroo_plot_pixel(tmpbitmap2, x+1, y, videoram[offs+1] >> 4,   16, flipB);
215   kangaroo_plot_pixel(tmpbitmap2, x+2, y, videoram[offs+2] >> 4,   16, flipB);
216   kangaroo_plot_pixel(tmpbitmap2, x+3, y, videoram[offs+3] >> 4,   16, flipB);
217}
218
219113WRITE8_HANDLER( kangaroo_videoram_w )
220114{
221   int a_Z_R,a_G_B,b_Z_R,b_G_B;
222115   int sx, sy, offs;
223116
224   a_Z_R = *kangaroo_bank_select & 0x01;
225   a_G_B = *kangaroo_bank_select & 0x02;
226   b_Z_R = *kangaroo_bank_select & 0x04;
227   b_G_B = *kangaroo_bank_select & 0x08;
228
229
230117   sx = (offset / 256) * 4;
231118   sy = offset % 256;
232119   offs = sy * 256 + sx;
233120
234   if (a_G_B)
121   /* rearrange the bits to a more convenient pattern (from DCBADCBA to DDCCBBAA) */
122   data = BITSWAP8(data, 7,3,6,2,5,1,4,0);
123
124   /* B layer, green & blue bits */
125   if (kangaroo_video_control[8] & 0x08)
235126   {
236      videoram[offs  ] = (videoram[offs  ] & 0xfc) | ((data & 0x10) >> 3) | ((data & 0x01) >> 0);
237      videoram[offs+1] = (videoram[offs+1] & 0xfc) | ((data & 0x20) >> 4) | ((data & 0x02) >> 1);
238      videoram[offs+2] = (videoram[offs+2] & 0xfc) | ((data & 0x40) >> 5) | ((data & 0x04) >> 2);
239      videoram[offs+3] = (videoram[offs+3] & 0xfc) | ((data & 0x80) >> 6) | ((data & 0x08) >> 3);
127      videoram[offs  ] = (videoram[offs  ] & 0xcf) | (((data >> 0) & 3) << 4);
128      videoram[offs+1] = (videoram[offs+1] & 0xcf) | (((data >> 2) & 3) << 4);
129      videoram[offs+2] = (videoram[offs+2] & 0xcf) | (((data >> 4) & 3) << 4);
130      videoram[offs+3] = (videoram[offs+3] & 0xcf) | (((data >> 6) & 3) << 4);
240131   }
241132
242   if (a_Z_R)
133   /* B layer, Z & red bits */
134   if (kangaroo_video_control[8] & 0x04)
243135   {
244      videoram[offs  ] = (videoram[offs  ] & 0xf3) | ((data & 0x10) >> 1) | ((data & 0x01) << 2);
245      videoram[offs+1] = (videoram[offs+1] & 0xf3) | ((data & 0x20) >> 2) | ((data & 0x02) << 1);
246      videoram[offs+2] = (videoram[offs+2] & 0xf3) | ((data & 0x40) >> 3) | ((data & 0x04) >> 0);
247      videoram[offs+3] = (videoram[offs+3] & 0xf3) | ((data & 0x80) >> 4) | ((data & 0x08) >> 1);
136      videoram[offs  ] = (videoram[offs  ] & 0x3f) | (((data >> 0) & 3) << 6);
137      videoram[offs+1] = (videoram[offs+1] & 0x3f) | (((data >> 2) & 3) << 6);
138      videoram[offs+2] = (videoram[offs+2] & 0x3f) | (((data >> 4) & 3) << 6);
139      videoram[offs+3] = (videoram[offs+3] & 0x3f) | (((data >> 6) & 3) << 6);
248140   }
249141
250   if (b_G_B)
142   /* A layer, green & blue bits */
143   if (kangaroo_video_control[8] & 0x02)
251144   {
252      videoram[offs  ] = (videoram[offs  ] & 0xcf) | ((data & 0x10) << 1) | ((data & 0x01) << 4);
253      videoram[offs+1] = (videoram[offs+1] & 0xcf) | ((data & 0x20) >> 0) | ((data & 0x02) << 3);
254      videoram[offs+2] = (videoram[offs+2] & 0xcf) | ((data & 0x40) >> 1) | ((data & 0x04) << 2);
255      videoram[offs+3] = (videoram[offs+3] & 0xcf) | ((data & 0x80) >> 2) | ((data & 0x08) << 1);
145      videoram[offs  ] = (videoram[offs  ] & 0xfc) | (((data >> 0) & 3) << 0);
146      videoram[offs+1] = (videoram[offs+1] & 0xfc) | (((data >> 2) & 3) << 0);
147      videoram[offs+2] = (videoram[offs+2] & 0xfc) | (((data >> 4) & 3) << 0);
148      videoram[offs+3] = (videoram[offs+3] & 0xfc) | (((data >> 6) & 3) << 0);
256149   }
257150
258   if (b_Z_R)
151   /* A layer, Z & red bits */
152   if (kangaroo_video_control[8] & 0x01)
259153   {
260      videoram[offs  ] = (videoram[offs  ] & 0x3f) | ((data & 0x10) << 3) | ((data & 0x01) << 6);
261      videoram[offs+1] = (videoram[offs+1] & 0x3f) | ((data & 0x20) << 2) | ((data & 0x02) << 5);
262      videoram[offs+2] = (videoram[offs+2] & 0x3f) | ((data & 0x40) << 1) | ((data & 0x04) << 4);
263      videoram[offs+3] = (videoram[offs+3] & 0x3f) | ((data & 0x80) << 0) | ((data & 0x08) << 3);
154      videoram[offs  ] = (videoram[offs  ] & 0xf3) | (((data >> 0) & 3) << 2);
155      videoram[offs+1] = (videoram[offs+1] & 0xf3) | (((data >> 2) & 3) << 2);
156      videoram[offs+2] = (videoram[offs+2] & 0xf3) | (((data >> 4) & 3) << 2);
157      videoram[offs+3] = (videoram[offs+3] & 0xf3) | (((data >> 6) & 3) << 2);
264158   }
265
266   kangaroo_redraw_4pixels(sx, sy);
267159}
268160
269161
270162
163/*************************************
164 *
165 *  Video updater
166 *
167 *************************************/
168
271169VIDEO_UPDATE( kangaroo )
272170{
273   int scrollx, scrolly;
171   UINT8 scrolly = kangaroo_video_control[6];
172   UINT8 scrollx = kangaroo_video_control[7];
173   UINT8 maska = kangaroo_video_control[10] >> 3;
174   UINT8 maskb = kangaroo_video_control[10] >> 0;
175   UINT8 xora = (kangaroo_video_control[9] & 0x20) ? 0xff : 0x00;
176   UINT8 xorb = (kangaroo_video_control[9] & 0x10) ? 0xff : 0x00;
177   UINT8 enaa = (kangaroo_video_control[9] & 0x08);
178   UINT8 enab = (kangaroo_video_control[9] & 0x04);
179   UINT8 pria = (~kangaroo_video_control[9] & 0x02);
180   UINT8 prib = (~kangaroo_video_control[9] & 0x01);
181   rgb_t pens[8];
182   int x, y;
274183
275   if (screen_flipped)
184   /* build up the pens arrays */
185   for (x = 0; x < 8; x++)
186      pens[x] = MAKE_RGB(pal1bit(x >> 2), pal1bit(x >> 1), pal1bit(x >> 0));
187
188   /* iterate over pixels */
189   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
276190   {
277      int x, y;
191      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
278192
279      /* redraw bitmap */
280      for (x = 0; x < 256; x+=4)
193      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
281194      {
282         for (y = 0; y < 256; y++)
283         {
284            kangaroo_redraw_4pixels(x, y);
285         }
286      }
195         UINT8 effxa = scrollx + ((x / 2) ^ xora);
196         UINT8 effya = scrolly + (y ^ xora);
197         UINT8 effxb = (x / 2) ^ xorb;
198         UINT8 effyb = y ^ xorb;
199         UINT8 pixa = videoram[effya * 256 + effxa] & 0x0f;
200         UINT8 pixb = videoram[effyb * 256 + effxb] >> 4;
201         UINT8 finalpens;
287202
288      screen_flipped = 0;
289   }
203         finalpens = 0;
204         if (enaa && (pria || pixb == 0))
205            finalpens |= pixa;
206         if (enab && (prib || pixa == 0))
207            finalpens |= pixb;
290208
209         dest[x + 0] = pens[finalpens & 7];
291210
292   scrollx = kangaroo_scroll[1];
293   scrolly = kangaroo_scroll[0];
211         /* KOS1 alternates at 5MHz, offset from the pixel clock by 1/2 clock */
212         /* when 0, it enables the color mask for pixels with Z = 0 */
213         finalpens = 0;
214         if (enaa && (pria || pixb == 0))
215         {
216            if (!(pixa & 0x08)) pixa &= ~maska;
217            finalpens |= pixa;
218         }
219         if (enab && (prib || pixa == 0))
220         {
221            if (!(pixb & 0x08)) pixb &= ~maskb;
222            finalpens |= pixb;
223         }
294224
295   if (*kangaroo_bank_select & 0x01)
296   {
297      /* Plane B is primary */
298      copybitmap(bitmap,tmpbitmap2,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
299      copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_COLOR,8);
225         dest[x + 1] = pens[finalpens & 7];
226      }
300227   }
301   else
302   {
303      /* Plane A is primary */
304      copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
305      copybitmap(bitmap,tmpbitmap2,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_COLOR,16);
306   }
228
307229   return 0;
308230}
src/mame/video/m58.c
r0r1650
1/***************************************************************************
2
3    Irem M58 hardware
4
5***************************************************************************/
6
7#include "driver.h"
8#include "deprecat.h"
9#include "m58.h"
10#include "video/resnet.h"
11
12UINT8 *yard_scroll_x_low;
13UINT8 *yard_scroll_x_high;
14UINT8 *yard_scroll_y_low;
15UINT8 *yard_score_panel_disabled;
16static mame_bitmap *scroll_panel_bitmap;
17
18static tilemap *bg_tilemap;
19
20#define SCROLL_PANEL_WIDTH  (14*4)
21#define RADAR_PALETTE_BASE   (256)
22
23
24
25/*************************************
26 *
27 *  Palette configuration
28 *
29 *************************************/
30
31PALETTE_INIT( yard )
32{
33   const UINT8 *char_lopal = color_prom + 0x000;
34   const UINT8 *char_hipal = color_prom + 0x100;
35   const UINT8 *sprite_pal = color_prom + 0x200;
36   const UINT8 *sprite_table = color_prom + 0x220;
37   const UINT8 *radar_lopal = color_prom + 0x320;
38   const UINT8 *radar_hipal = color_prom + 0x420;
39   static const int resistances_3[3] = { 1000, 470, 220 };
40   static const int resistances_2[2]  = { 470, 220 };
41   double weights_r[3], weights_g[3], weights_b[3], scale;
42   int i;
43
44   machine->colortable = colortable_alloc(machine, 256+256+16);
45
46   /* compute palette information for characters/radar */
47   scale = compute_resistor_weights(0,   255, -1.0,
48         2, resistances_2, weights_r, 0, 0,
49         3, resistances_3, weights_g, 0, 0,
50         3, resistances_3, weights_b, 0, 0);
51
52   /* character palette */
53   for (i = 0; i < 256; i++)
54   {
55      UINT8 promval = (char_lopal[i] & 0x0f) | (char_hipal[i] << 4);
56      int r = combine_2_weights(weights_r, BIT(promval,6), BIT(promval,7));
57      int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
58      int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
59
60      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r,g,b));
61   }
62
63   /* radar palette */
64   for (i = 0; i < 256; i++)
65   {
66      UINT8 promval = (radar_lopal[i] & 0x0f) | (radar_hipal[i] << 4);
67      int r = combine_2_weights(weights_r, BIT(promval,6), BIT(promval,7));
68      int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
69      int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
70
71      colortable_palette_set_color(machine->colortable, 256+i, MAKE_RGB(r,g,b));
72   }
73
74   /* compute palette information for sprites */
75   scale = compute_resistor_weights(0,   255, scale,
76         2, resistances_2, weights_r, 470, 0,
77         3, resistances_3, weights_g, 470, 0,
78         3, resistances_3, weights_b, 470, 0);
79
80   /* sprite palette */
81   for (i = 0; i < 16; i++)
82   {
83      UINT8 promval = sprite_pal[i];
84      int r = combine_2_weights(weights_r, BIT(promval,6), BIT(promval,7));
85      int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
86      int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
87
88      colortable_palette_set_color(machine->colortable, 256+256+i, MAKE_RGB(r,g,b));
89   }
90
91   /* character lookup table */
92   for (i = 0; i < 256; i++)
93      colortable_entry_set_value(machine->colortable, i, i);
94
95   /* radar lookup table */
96   for (i = 0; i < 256; i++)
97      colortable_entry_set_value(machine->colortable, 256+i, 256+i);
98
99   /* sprite lookup table */
100   for (i = 0; i < 256; i++)
101   {
102      UINT8 promval = sprite_table[i] & 0x0f;
103      colortable_entry_set_value(machine->colortable, 256+256+i, 256+256+promval);
104   }
105}
106
107
108
109/*************************************
110 *
111 *  Video RAM access
112 *
113 *************************************/
114
115WRITE8_HANDLER( yard_videoram_w )
116{
117   videoram[offset] = data;
118   tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
119}
120
121
122WRITE8_HANDLER( yard_scroll_panel_w )
123{
124   int sx,sy,i;
125
126   sx = ( offset % 16 );
127   sy = ( offset / 16 );
128
129   if (sx < 1 || sx > 14)  return;
130
131   sx = 4 * (sx - 1);
132
133   for (i = 0;i < 4;i++)
134   {
135      int col;
136
137      col = (data >> i) & 0x11;
138      col = ((col >> 3) | col) & 3;
139
140      *BITMAP_ADDR16(scroll_panel_bitmap, sy, sx + i) = RADAR_PALETTE_BASE + (sy & 0xfc) + col;
141   }
142}
143
144
145
146/*************************************
147 *
148 *  Tilemap info callback
149 *
150 *************************************/
151
152static TILE_GET_INFO( yard_get_bg_tile_info )
153{
154   int offs = tile_index * 2;
155   int attr = videoram[offs + 1];
156   int code = videoram[offs] + ((attr & 0xc0) << 2);
157   int color = attr & 0x1f;
158   int flags = (attr & 0x20) ? TILE_FLIPX : 0;
159
160   SET_TILE_INFO(0, code, color, flags);
161}
162
163
164static UINT32 yard_tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows )
165{
166   /* logical (col,row) -> memory offset */
167   if (col >= 32)
168      return (row+32)*32 + col-32;
169   else
170      return row*32 + col;
171}
172
173
174
175/*************************************
176 *
177 *  Video startup
178 *
179 *************************************/
180
181VIDEO_START( yard )
182{
183   bg_tilemap = tilemap_create(yard_get_bg_tile_info, yard_tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
184   tilemap_set_scrolldx(bg_tilemap, machine->screen[0].visarea.min_x, machine->screen[0].width - (machine->screen[0].visarea.max_x + 1));
185   tilemap_set_scrolldy(bg_tilemap, machine->screen[0].visarea.min_y - 8, machine->screen[0].height + 16 - (machine->screen[0].visarea.max_y + 1));
186
187   scroll_panel_bitmap = auto_bitmap_alloc(SCROLL_PANEL_WIDTH, machine->screen[0].height, machine->screen[0].format);
188}
189
190
191
192/*************************************
193 *
194 *  Sprite rendering
195 *
196 *************************************/
197
198#define DRAW_SPRITE(code, sy) drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PENS, colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 512));
199
200static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
201{
202   int offs;
203
204   for (offs = spriteram_size - 4; offs >= 0; offs -= 4)
205   {
206      int attr = spriteram[offs + 1];
207      int bank = (attr & 0x20) >> 5;
208      int code1 = spriteram[offs + 2] & 0xbf;
209      int code2 = 0;
210      int color = attr & 0x1f;
211      int flipx = attr & 0x40;
212      int flipy = attr & 0x80;
213      int sx = spriteram[offs + 3];
214      int sy1 = 233 - spriteram[offs];
215      int sy2 = 0;
216
217      if (flipy)
218      {
219         code2 = code1;
220         code1 += 0x40;
221      }
222      else
223      {
224         code2 = code1 + 0x40;
225      }
226
227      if (flip_screen)
228      {
229         sx = 240 - sx;
230         sy2 = 192 - sy1;
231         sy1 = sy2 + 0x10;
232         flipx = !flipx;
233         flipy = !flipy;
234      }
235      else
236      {
237         sy2 = sy1 + 0x10;
238      }
239
240      DRAW_SPRITE(code1 + 256 * bank, machine->screen[0].visarea.min_y + sy1)
241      DRAW_SPRITE(code2 + 256 * bank, machine->screen[0].visarea.min_y + sy2)
242   }
243}
244
245
246
247/*************************************
248 *
249 *  Radar panel rendering
250 *
251 *************************************/
252
253static void draw_panel( running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
254{
255   if (! *yard_score_panel_disabled)
256   {
257      static const rectangle clippanel =
258      {
259         26*8, 32*8-1,
260         1*8, 31*8-1
261      };
262      static const rectangle clippanelflip =
263      {
264         0*8, 6*8-1,
265         1*8, 31*8-1
266      };
267      rectangle clip = flip_screen ? clippanelflip : clippanel;
268      int sx = flip_screen ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH;
269      int yoffs = flip_screen ? -40 : -16;
270
271      clip.min_y += machine->screen[0].visarea.min_y + yoffs;
272      clip.max_y += machine->screen[0].visarea.max_y + yoffs;
273
274      copybitmap(bitmap, scroll_panel_bitmap, flip_screen, flip_screen,
275               sx, machine->screen[0].visarea.min_y + yoffs, &clip);
276   }
277}
278
279
280
281/*************************************
282 *
283 *  Video update
284 *
285 *************************************/
286
287VIDEO_UPDATE( yard )
288{
289   tilemap_set_scrollx(bg_tilemap, 0, (*yard_scroll_x_high * 0x100) + *yard_scroll_x_low);
290   tilemap_set_scrolly(bg_tilemap, 0, *yard_scroll_y_low);
291
292   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
293   draw_sprites(machine, bitmap, cliprect);
294   draw_panel(machine, bitmap, cliprect);
295   return 0;
296}
src/mame/video/pktgaldx.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "deco16ic.h"
34
45UINT16* pcktgaldb_fgram;
src/mame/video/timeplt.c
r1649r1650
1/***************************************************************************
2
3    Time Pilot
4
5    driver by Nicola Salmoria
6
7***************************************************************************/
8
19#include "driver.h"
10#include "timeplt.h"
211
3UINT8 *timeplt_videoram,*timeplt_colorram;
412static tilemap *bg_tilemap;
513
6/*
7sprites are multiplexed, so we have to buffer the spriteram
8scanline by scanline.
9*/
10static UINT8 *sprite_mux_buffer,*sprite_mux_buffer_2;
11static int scanline;
1214
13
1415/***************************************************************************
1516
1617  Convert the color PROMs into a more useable format.
r1649r1650
3839  bit 0 -- not connected
3940
4041***************************************************************************/
42
4143PALETTE_INIT( timeplt )
4244{
45   rgb_t palette[32];
4346   int i;
44   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
45   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4647
47
48   for (i = 0;i < machine->drv->total_colors;i++)
48   for (i = 0;i < 32;i++)
4949   {
5050      int bit0,bit1,bit2,bit3,bit4,r,g,b;
5151
52
53      bit0 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01;
54      bit1 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01;
55      bit2 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01;
56      bit3 = (color_prom[i + machine->drv->total_colors] >> 4) & 0x01;
57      bit4 = (color_prom[i + machine->drv->total_colors] >> 5) & 0x01;
52      bit0 = (color_prom[i + 1*32] >> 1) & 0x01;
53      bit1 = (color_prom[i + 1*32] >> 2) & 0x01;
54      bit2 = (color_prom[i + 1*32] >> 3) & 0x01;
55      bit3 = (color_prom[i + 1*32] >> 4) & 0x01;
56      bit4 = (color_prom[i + 1*32] >> 5) & 0x01;
5857      r = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4;
59      bit0 = (color_prom[i + machine->drv->total_colors] >> 6) & 0x01;
60      bit1 = (color_prom[i + machine->drv->total_colors] >> 7) & 0x01;
61      bit2 = (color_prom[i] >> 0) & 0x01;
62      bit3 = (color_prom[i] >> 1) & 0x01;
63      bit4 = (color_prom[i] >> 2) & 0x01;
58      bit0 = (color_prom[i + 1*32] >> 6) & 0x01;
59      bit1 = (color_prom[i + 1*32] >> 7) & 0x01;
60      bit2 = (color_prom[i + 0*32] >> 0) & 0x01;
61      bit3 = (color_prom[i + 0*32] >> 1) & 0x01;
62      bit4 = (color_prom[i + 0*32] >> 2) & 0x01;
6463      g = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4;
65      bit0 = (color_prom[i] >> 3) & 0x01;
66      bit1 = (color_prom[i] >> 4) & 0x01;
67      bit2 = (color_prom[i] >> 5) & 0x01;
68      bit3 = (color_prom[i] >> 6) & 0x01;
69      bit4 = (color_prom[i] >> 7) & 0x01;
64      bit0 = (color_prom[i + 0*32] >> 3) & 0x01;
65      bit1 = (color_prom[i + 0*32] >> 4) & 0x01;
66      bit2 = (color_prom[i + 0*32] >> 5) & 0x01;
67      bit3 = (color_prom[i + 0*32] >> 6) & 0x01;
68      bit4 = (color_prom[i + 0*32] >> 7) & 0x01;
7069      b = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4;
7170
72      palette_set_color(machine,i,MAKE_RGB(r,g,b));
71      palette[i] = MAKE_RGB(r,g,b);
7372   }
7473
75   color_prom += 2*machine->drv->total_colors;
74   color_prom += 2*32;
7675   /* color_prom now points to the beginning of the lookup table */
7776
7877
7978   /* sprites */
80   for (i = 0;i < TOTAL_COLORS(1);i++)
81      COLOR(1,i) = *(color_prom++) & 0x0f;
79   for (i = 0;i < 64*4;i++)
80      palette_set_color(machine, 32*4 + i, palette[*color_prom++ & 0x0f]);
8281
8382   /* characters */
84   for (i = 0;i < TOTAL_COLORS(0);i++)
85      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
83   for (i = 0;i < 32*4;i++)
84      palette_set_color(machine, i, palette[(*color_prom++ & 0x0f) + 0x10]);
8685}
8786
8887
8988
90/***************************************************************************
89/*************************************
90 *
91 *  Tilemap info callback
92 *
93 *************************************/
9194
92  Callbacks for the TileMap code
93
94***************************************************************************/
95
9695static TILE_GET_INFO( get_tile_info )
9796{
98   UINT8 attr = timeplt_colorram[tile_index];
97   int attr = colorram[tile_index];
98   int code = videoram[tile_index] + 8 * (attr & 0x20);
99   int color = attr & 0x1f;
100   int flags = TILE_FLIPYX(attr >> 6);
101
99102   tileinfo->category = (attr & 0x10) >> 4;
100   SET_TILE_INFO(
101         0,
102         timeplt_videoram[tile_index] + ((attr & 0x20) << 3),
103         attr & 0x1f,
104         TILE_FLIPYX((attr & 0xc0) >> 6));
103   SET_TILE_INFO(0, code, color, flags);
105104}
106105
107106
108107
109/***************************************************************************
108/*************************************
109 *
110 *  Video startup
111 *
112 *************************************/
110113
111  Start the video hardware emulation.
112
113***************************************************************************/
114
115114VIDEO_START( timeplt )
116115{
117116   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
118
119   sprite_mux_buffer = auto_malloc(256 * spriteram_size);
120   sprite_mux_buffer_2 = auto_malloc(256 * spriteram_size);
121117}
122118
123119
124120
125/***************************************************************************
121/*************************************
122 *
123 *  Memory write handlers
124 *
125 *************************************/
126126
127  Memory handlers
128
129***************************************************************************/
130
131127WRITE8_HANDLER( timeplt_videoram_w )
132128{
133   timeplt_videoram[offset] = data;
129   videoram[offset] = data;
134130   tilemap_mark_tile_dirty(bg_tilemap,offset);
135131}
136132
133
137134WRITE8_HANDLER( timeplt_colorram_w )
138135{
139   timeplt_colorram[offset] = data;
136   colorram[offset] = data;
140137   tilemap_mark_tile_dirty(bg_tilemap,offset);
141138}
142139
140
143141WRITE8_HANDLER( timeplt_flipscreen_w )
144142{
145143   flip_screen_set(~data & 1);
146144}
147145
148/* Return the current video scan line */
146
149147READ8_HANDLER( timeplt_scanline_r )
150148{
151   return scanline;
149   return video_screen_get_vpos(0);
152150}
153151
154152
155153
156/***************************************************************************
154/*************************************
155 *
156 *  Sprite rendering
157 *
158 *************************************/
157159
158  Display refresh
159
160***************************************************************************/
161
162160static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
163161{
164   const gfx_element *gfx = machine->gfx[1];
165   rectangle clip = *cliprect;
166162   int offs;
167   int line;
168163
169
170   for (line = 0;line < 256;line++)
164   for (offs = 0x3e;offs >= 0x10;offs -= 2)
171165   {
172      if (line >= cliprect->min_y && line <= cliprect->max_y)
173      {
174         UINT8 *sr,*sr2;
166      int sx = spriteram[offs];
167      int sy = 241 - spriteram_2[offs + 1];
175168
176         sr = sprite_mux_buffer + line * spriteram_size;
177         sr2 = sprite_mux_buffer_2 + line * spriteram_size;
178         clip.min_y = clip.max_y = line;
169      int code = spriteram[offs + 1];
170      int color = spriteram_2[offs] & 0x3f;
171      int flipx = ~spriteram_2[offs] & 0x40;
172      int flipy = spriteram_2[offs] & 0x80;
179173
180         for (offs = spriteram_size - 2;offs >= 0;offs -= 2)
181         {
182            int code,color,sx,sy,flipx,flipy;
174      drawgfx(bitmap,machine->gfx[1],
175            code,
176            color,
177            flipx,flipy,
178            sx,sy,
179            cliprect,TRANSPARENCY_PEN,0);
180   }
181}
183182
184            sx = sr[offs];
185            sy = 241 - sr2[offs + 1];
186183
187            if (sy > line-16 && sy <= line)
188            {
189               code = sr[offs + 1];
190               color = sr2[offs] & 0x3f;
191               flipx = ~sr2[offs] & 0x40;
192               flipy = sr2[offs] & 0x80;
193184
194               drawgfx(bitmap,gfx,
195                     code,
196                     color,
197                     flipx,flipy,
198                     sx,sy,
199                     &clip,TRANSPARENCY_PEN,0);
200            }
201         }
202      }
203   }
204}
185/*************************************
186 *
187 *  Video update
188 *
189 *************************************/
205190
206191VIDEO_UPDATE( timeplt )
207192{
r1649r1650
210195   tilemap_draw(bitmap,cliprect,bg_tilemap,1,0);
211196   return 0;
212197}
213
214
215INTERRUPT_GEN( timeplt_interrupt )
216{
217   scanline = 255 - cpu_getiloops();
218
219   memcpy(sprite_mux_buffer + scanline * spriteram_size,spriteram,spriteram_size);
220   memcpy(sprite_mux_buffer_2 + scanline * spriteram_size,spriteram_2,spriteram_size);
221
222   if (scanline == 255)
223      nmi_line_pulse(machine, cpunum);
224}
src/mame/video/zac2650.c
r1649r1650
154154    CollisionBackground = 0;   /* Read from 0x1e80 bit 7 */
155155
156156   // for collision detection checking
157   copybitmap(tmpbitmap,bitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
157   copybitmap(tmpbitmap,bitmap,0,0,0,0,&machine->screen[0].visarea);
158158
159159    for(offs=0;offs<0x50;offs+=0x10)
160160    {
src/mame/video/shangha3.c
r1649r1650
5959***************************************************************************/
6060
6161#include "driver.h"
62#include "deprecat.h"
6263#include "profiler.h"
6364
6465
r1649r1650
263264
264265VIDEO_UPDATE( shangha3 )
265266{
266   copybitmap(bitmap,rawbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
267   copybitmap(bitmap,rawbitmap,0,0,0,0,cliprect);
267268   return 0;
268269}
src/mame/video/taito_f3.c
r1649r1650
204204***************************************************************************/
205205
206206#include "driver.h"
207#include "deprecat.h"
207208#include "taito_f3.h"
208209#include "ui.h"
209210
src/mame/video/gaelco2.c
r1649r1650
7777***************************************************************************/
7878
7979#include "driver.h"
80#include "deprecat.h"
8081
8182UINT16 *gaelco2_vregs;
8283static UINT16 *gaelco2_videoram;
src/mame/video/homerun.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34static int homerun_gfx_ctrl;
45static int homerun_gc_up,homerun_gc_down;
src/mame/video/champbas.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
11static int gfxbank;
12static UINT8 gfxbank;
13static UINT8 palette_bank;
1214
1315static tilemap *bg_tilemap;
1416
17
1518/***************************************************************************
1619
1720  Convert the color PROMs into a more useable format.
1821
19  Pac Man has a 16 bytes palette PROM and a 128 bytes color lookup table PROM.
20
21  Pengo has a 32 bytes palette PROM and a 256 bytes color lookup table PROM
22  (actually that's 512 bytes, but the high address bit is grounded).
23
2422  The palette PROM is connected to the RGB output this way:
2523
2624  bit 7 -- 220 ohm resistor  -- BLUE
r1649r1650
3331  bit 0 -- 1  kohm resistor  -- RED
3432
3533***************************************************************************/
34
3635PALETTE_INIT( champbas )
3736{
37   static const int resistances_rg[3] = { 1000, 470, 220 };
38   static const int resistances_b [2] = { 470, 220 };
39   double rweights[3], gweights[3], bweights[2];
3840   int i;
39   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
40   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4141
42   /* compute the color output resistor weights */
43   compute_resistor_weights(0,   255, -1.0,
44         3, &resistances_rg[0], rweights, 0, 0,
45         3, &resistances_rg[0], gweights, 0, 0,
46         2, &resistances_b[0],  bweights, 0, 0);
4247
43   for (i = 0;i < machine->drv->total_colors;i++)
48   /* allocate the colortable */
49   machine->colortable = colortable_alloc(machine, 32);
50
51   /* create a lookup table for the palette */
52   for (i = 0; i < 0x20; i++)
4453   {
45      int bit0,bit1,bit2,r,g,b;
54      int bit0, bit1, bit2;
55      int r, g, b;
4656
57      /* red component */
58      bit0 = (color_prom[i] >> 0) & 0x01;
59      bit1 = (color_prom[i] >> 1) & 0x01;
60      bit2 = (color_prom[i] >> 2) & 0x01;
61      r = combine_3_weights(rweights, bit0, bit1, bit2);
4762
48      /* red component */
49      bit0 = (*color_prom >> 0) & 0x01;
50      bit1 = (*color_prom >> 1) & 0x01;
51      bit2 = (*color_prom >> 2) & 0x01;
52      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
5363      /* green component */
54      bit0 = (*color_prom >> 3) & 0x01;
55      bit1 = (*color_prom >> 4) & 0x01;
56      bit2 = (*color_prom >> 5) & 0x01;
57      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
64      bit0 = (color_prom[i] >> 3) & 0x01;
65      bit1 = (color_prom[i] >> 4) & 0x01;
66      bit2 = (color_prom[i] >> 5) & 0x01;
67      g = combine_3_weights(gweights, bit0, bit1, bit2);
68
5869      /* blue component */
59      bit0 = 0;
60      bit1 = (*color_prom >> 6) & 0x01;
61      bit2 = (*color_prom >> 7) & 0x01;
62      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
70      bit0 = (color_prom[i] >> 6) & 0x01;
71      bit1 = (color_prom[i] >> 7) & 0x01;
72      b = combine_2_weights(bweights, bit0, bit1);
6373
64      palette_set_color(machine,i,MAKE_RGB(r,g,b));
65      color_prom++;
74      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6675   }
6776
6877   /* color_prom now points to the beginning of the lookup table */
78   color_prom += 32;
6979
70   /* TODO: there are 32 colors in the palette, but we are suing only 16 */
71   /* the only difference between the two banks is color #14, grey instead of green */
72
73   /* character lookup table */
74   /* sprites use the same color lookup table as characters */
75   for (i = 0;i < TOTAL_COLORS(0);i++)
76      COLOR(0,i) = (*(color_prom++) & 0x0f);
80   /* character lookup table - sprites use the same color lookup table as characters */
81   for (i = 0; i < 0x200; i++)
82   {
83      UINT8 ctabentry = ((i & 0x100) >> 4) | (color_prom[i & 0xff] & 0x0f);
84      colortable_entry_set_value(machine->colortable, i, ctabentry);
85   }
7786}
7887
7988WRITE8_HANDLER( champbas_videoram_w )
r1649r1650
97106   }
98107}
99108
109WRITE8_HANDLER( champbas_palette_bank_w )
110{
111   if (palette_bank != (data & 0x01))
112   {
113      palette_bank = data & 0x01;
114      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
115   }
116}
117
100118WRITE8_HANDLER( champbas_flipscreen_w )
101119{
102120   if (flip_screen != data)
r1649r1650
109127static TILE_GET_INFO( get_bg_tile_info )
110128{
111129   int code = videoram[tile_index];
112   int color = (colorram[tile_index] & 0x1f) + 32;
130   int color = (palette_bank << 6) | 0x20 | (colorram[tile_index] & 0x1f);
113131
114132   SET_TILE_INFO(gfxbank, code, color, 0);
115133}
116134
117135VIDEO_START( champbas )
118136{
119   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
120      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
137   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
121138}
122139
123140static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
r1649r1650
127144   for (offs = spriteram_size - 2; offs >= 0; offs -= 2)
128145   {
129146      int code = spriteram[offs] >> 2;
130      int color = spriteram[offs + 1];
147      int color = (palette_bank << 6) | (spriteram[offs + 1] & 0x3f);
131148      int flipx = spriteram[offs] & 0x01;
132149      int flipy = spriteram[offs] & 0x02;
133150      int sx = ((256 + 16 - spriteram_2[offs + 1]) & 0xff) - 16;
r1649r1650
139156         flipx, flipy,
140157         sx, sy,
141158         cliprect,
142         TRANSPARENCY_COLOR, 0);
159         TRANSPARENCY_PENS,
160         colortable_get_transpen_mask(machine->colortable, machine->gfx[2 + gfxbank], color, 0));
143161   }
144162}
145163
src/mame/video/ssozumo.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213UINT8 *ssozumo_videoram2;
1314UINT8 *ssozumo_colorram2;
src/mame/video/mcr.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "mcr.h"
910
1011
src/mame/video/segasyse.c
r1649r1650
88*******************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112
1213/*-- Variables --*/
1314
src/mame/video/matmania.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617
1718
1819
r1649r1650
180181
181182      scrolly = -*matmania_scroll;
182183      if (matmania_pageselect[0]&0x01) // maniach sets 0x20 sometimes, which must have a different meaning
183         copyscrollbitmap(bitmap,tmpbitmap2,0,0,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
184         copyscrollbitmap(bitmap,tmpbitmap2,0,0,1,&scrolly,cliprect);
184185      else
185         copyscrollbitmap(bitmap,tmpbitmap,0,0,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
186         copyscrollbitmap(bitmap,tmpbitmap,0,0,1,&scrolly,cliprect);
186187   }
187188
188189
r1649r1650
196197               (spriteram[offs] & 0x08) >> 3,
197198               spriteram[offs] & 0x04,spriteram[offs] & 0x02,
198199               239 - spriteram[offs+3],(240 - spriteram[offs+2]) & 0xff,
199               &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
200               cliprect,TRANSPARENCY_PEN,0);
200201      }
201202   }
202203
r1649r1650
215216            (matmania_colorram2[offs] & 0x30) >> 4,
216217            0,0,
217218            8*sx,8*sy,
218            &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
219            cliprect,TRANSPARENCY_PEN,0);
219220   }
220221   return 0;
221222}
r1649r1650
268269      scrolly = -*matmania_scroll;
269270
270271      if (matmania_pageselect[0]&0x01) // this sets 0x20 sometimes, which must have a different meaning
271         copyscrollbitmap(bitmap,tmpbitmap2,0,0,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
272         copyscrollbitmap(bitmap,tmpbitmap2,0,0,1,&scrolly,cliprect);
272273      else
273         copyscrollbitmap(bitmap,tmpbitmap,0,0,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
274         copyscrollbitmap(bitmap,tmpbitmap,0,0,1,&scrolly,cliprect);
274275   }
275276
276277
r1649r1650
284285               (spriteram[offs] & 0x08) >> 3,
285286               spriteram[offs] & 0x04,spriteram[offs] & 0x02,
286287               239 - spriteram[offs+3],(240 - spriteram[offs+2]) & 0xff,
287               &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
288               cliprect,TRANSPARENCY_PEN,0);
288289      }
289290   }
290291
r1649r1650
303304            (matmania_colorram2[offs] & 0x30) >> 4,
304305            0,0,
305306            8*sx,8*sy,
306            &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
307            cliprect,TRANSPARENCY_PEN,0);
307308   }
308309   return 0;
309310}
src/mame/video/arkanoid.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "includes/arkanoid.h"
1112
1213static UINT8 gfxbank, palettebank;
src/mame/video/twin16.c
r1649r1650
1414*/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718
1819extern UINT16 twin16_custom_video;
1920extern UINT16 *twin16_gfx_rom;
src/mame/video/megasys1.c
r1649r1650
192192***************************************************************************/
193193
194194#include "driver.h"
195#include "deprecat.h"
195196#include "megasys1.h"
196197
197198/* Variables defined here, that have to be shared: */
src/mame/video/pacman.c
r1649r1650
1717**************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021#include "includes/pacman.h"
2122#include "video/resnet.h"
2223
src/mame/video/clshroad.c
r1649r1650
6464PALETTE_INIT( firebatl )
6565{
6666   int i;
67   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
68   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
6967
68   /* allocate the colortable */
69   machine->colortable = colortable_alloc(machine, 0x100);
7070
71#if 1
72   for (i = 0;i < 256;i++)
71   /* create a lookup table for the palette */
72   for (i = 0; i < 0x100; i++)
7373   {
74      int bit0,bit1,bit2,bit3,r,g,b;
74      int r = pal4bit(color_prom[i + 0x000]);
75      int g = pal4bit(color_prom[i + 0x100]);
76      int b = pal4bit(color_prom[i + 0x200]);
7577
76
77      /* red component */
78      bit0 = (color_prom[i] >> 0) & 0x01;
79      bit1 = (color_prom[i] >> 1) & 0x01;
80      bit2 = (color_prom[i] >> 2) & 0x01;
81      bit3 = (color_prom[i] >> 3) & 0x01;
82      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
83      /* green component */
84      bit0 = (color_prom[i + 256] >> 0) & 0x01;
85      bit1 = (color_prom[i + 256] >> 1) & 0x01;
86      bit2 = (color_prom[i + 256] >> 2) & 0x01;
87      bit3 = (color_prom[i + 256] >> 3) & 0x01;
88      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
89      /* blue component */
90      bit0 = (color_prom[i + 2*256] >> 0) & 0x01;
91      bit1 = (color_prom[i + 2*256] >> 1) & 0x01;
92      bit2 = (color_prom[i + 2*256] >> 2) & 0x01;
93      bit3 = (color_prom[i + 2*256] >> 3) & 0x01;
94      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
95
96      palette_set_color(machine,i,MAKE_RGB(r,g,b));
78      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
9779   }
98#endif
9980
100   color_prom += 3*256;
10181   /* color_prom now points to the beginning of the lookup table */
82   color_prom += 0x300;
10283
84   for (i = 0; i < 0x200; i++)
85      colortable_entry_set_value(machine->colortable, i, i & 0xff);
10386
104   for (i = 0;i < TOTAL_COLORS(2);i++)
105      COLOR(2,i) = ((color_prom[i] & 0x0f) << 4) + (color_prom[i+256] & 0x0f);
87   for (i = 0x200; i < 0x300; i++)
88   {
89      UINT8 ctabentry = ((color_prom[(i - 0x200) + 0x000] & 0x0f) << 4) |
90                     (color_prom[(i - 0x200) + 0x100] & 0x0f);
91      colortable_entry_set_value(machine->colortable, i, ctabentry);
92   }
10693}
10794
10895
r1649r1650
200187static TILE_GET_INFO( get_tile_info_fb1 )
201188{
202189   UINT8 code   =   clshroad_vram_1[ tile_index + 0x000 ];
203   UINT8 color   =   clshroad_vram_1[ tile_index + 0x400 ];
190   UINT8 color   =   clshroad_vram_1[ tile_index + 0x400 ] & 0x3f;
191   tileinfo->group = color;
204192   SET_TILE_INFO(
205193         2,
206194         code,
207         color & 0x3f,
195         color,
208196         0);
209197}
210198
r1649r1650
229217VIDEO_START( firebatl )
230218{
231219   /* These 2 use the graphics and scroll value */
232   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,0x20,0x10);
220   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
233221   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
234222   /* Text (No scrolling) */
235   tilemap_1  = tilemap_create(get_tile_info_fb1,tilemap_scan_rows_extra,TILEMAP_TYPE_COLORTABLE,8,8,0x24,0x20);
223   tilemap_1  = tilemap_create(get_tile_info_fb1,tilemap_scan_rows_extra,TILEMAP_TYPE_PEN,8,8,0x24,0x20);
236224
237225   tilemap_set_scroll_rows( tilemap_0a, 1);
238226   tilemap_set_scroll_rows( tilemap_0b, 1);
r1649r1650
246234   tilemap_set_scrolldx( tilemap_0b, -0x30, -0xb5);
247235
248236   tilemap_set_transparent_pen( tilemap_0b, 0 );
249   tilemap_set_transparent_pen( tilemap_1, 0x0f );
237   colortable_configure_tilemap_groups(machine->colortable, tilemap_1, machine->gfx[2], 0x0f);
250238}
251239
252240VIDEO_START( clshroad )
253241{
254242   /* These 2 use the graphics and scroll value */
255   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,0x20,0x10);
243   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
256244   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
257245   /* Text (No scrolling) */
258246   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows_extra,TILEMAP_TYPE_PEN,8,8,0x24,0x20);
src/mame/video/bwing.c
r1649r1650
99// Directives
1010
1111#include "driver.h"
12#include "deprecat.h"
1213
1314#define BW_DEBUG 0
1415
src/mame/video/brkthru.c
r1649r1650
11/***************************************************************************
22
3    breakthru:video.c
3    video/brkthru.c
44
55***************************************************************************/
66
src/mame/video/williams.c
r1649r1650
9292***************************************************************************/
9393
9494#include "driver.h"
95#include "deprecat.h"
9596#include "video/resnet.h"
9697#include "williams.h"
9798
r1649r1650
128129 *
129130 *************************************/
130131
131/* RAM variable */
132static UINT8 *williams2_paletteram;
133
134132/* palette variables */
135133static rgb_t *palette_lookup;
136134
r1649r1650
142140static UINT8 *blitter_remap_lookup;
143141
144142/* Blaster-specific variables */
145static UINT8 blaster_color0;
143static rgb_t blaster_color0;
146144static UINT8 blaster_video_control;
147145
148146/* tilemap variables */
r1649r1650
205203   blitter_init(williams_blitter_config, NULL);
206204
207205   /* allocate paletteram */
208   williams2_paletteram = auto_malloc(0x400 * 2);
209   state_save_register_global_pointer(williams2_paletteram, 0x400 * 2);
206   paletteram = auto_malloc(0x400 * 2);
207   state_save_register_global_pointer(paletteram, 0x400 * 2);
210208
211209   /* create the tilemap */
212210   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 24,16, 128,16);
r1649r1650
225223
226224VIDEO_UPDATE( williams )
227225{
226   rgb_t pens[16];
228227   int x, y;
229228
229   /* precompute the palette */
230   for (x = 0; x < 16; x++)
231      pens[x] = palette_lookup[paletteram[x]];
232
230233   /* loop over rows */
231234   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
232235   {
233236      UINT8 *source = &williams_videoram[y];
234      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
237      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
235238
236239      /* loop over columns */
237240      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
238241      {
239242         int pix = source[(x/2) * 256];
240         dest[x+0] = pix >> 4;
241         dest[x+1] = pix & 0x0f;
243         dest[x+0] = pens[pix >> 4];
244         dest[x+1] = pens[pix & 0x0f];
242245      }
243246   }
244247   return 0;
r1649r1650
247250
248251VIDEO_UPDATE( blaster )
249252{
253   rgb_t pens[16];
250254   int x, y;
251255
256   /* precompute the palette */
257   for (x = 0; x < 16; x++)
258      pens[x] = palette_lookup[paletteram[x]];
259
252260   /* if we're blitting from the top, start with a 0 for color 0 */
253261   if (cliprect->min_y == machine->screen[0].visarea.min_y || !(blaster_video_control & 1))
254      blaster_color0 = 0;
262      blaster_color0 = pens[0];
255263
256264   /* loop over rows */
257265   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
258266   {
259267      int erase_behind = blaster_video_control & blaster_scanline_control[y] & 2;
260268      UINT8 *source = &williams_videoram[y];
261      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
269      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
262270
263271      /* latch a new color0 pen? */
264272      if (blaster_video_control & blaster_scanline_control[y] & 1)
265         blaster_color0 = 16 + y;
273         blaster_color0 = palette_lookup[blaster_palette_0[y] ^ 0xff];
266274
267275      /* loop over columns */
268276      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
r1649r1650
274282            source[(x/2) * 256] = 0;
275283
276284         /* now draw */
277         dest[x+0] = (pix & 0xf0) ? (pix >> 4) : blaster_color0;
278         dest[x+1] = (pix & 0x0f) ? (pix & 0x0f) : blaster_color0;
285         dest[x+0] = (pix & 0xf0) ? pens[pix >> 4] : blaster_color0;
286         dest[x+1] = (pix & 0x0f) ? pens[pix & 0x0f] : blaster_color0;
279287      }
280288   }
281289   return 0;
r1649r1650
284292
285293VIDEO_UPDATE( williams2 )
286294{
287   int x, y, basecolor;
295   rgb_t pens[16];
296   int x, y;
288297
289298   /* draw the background */
290299   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
291300
292   /* copy the bitmap data on top of that */
293   basecolor = williams2_fg_color * 16;
301   /* fetch the relevant pens */
302   for (x = 1; x < 16; x++)
303      pens[x] = palette_get_color(machine, williams2_fg_color * 16 + x);
294304
295305   /* loop over rows */
296306   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
297307   {
298308      UINT8 *source = &williams_videoram[y];
299      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
309      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
300310
301311      /* loop over columns */
302312      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
r1649r1650
304314         int pix = source[(x/2) * 256];
305315
306316         if (pix & 0xf0)
307            dest[x+0] = basecolor + (pix >> 4);
317            dest[x+0] = pens[pix >> 4];
308318         if (pix & 0x0f)
309            dest[x+1] = basecolor + (pix & 0x0f);
319            dest[x+1] = pens[pix & 0x0f];
310320      }
311321   }
312322   return 0;
r1649r1650
339349   palette_lookup = auto_malloc(256 * sizeof(*palette_lookup));
340350   for (i = 0; i < 256; i++)
341351   {
342      int bit0,bit1,bit2,r,g,b;
352      int r = combine_3_weights(weights_r, BIT(i,0), BIT(i,1), BIT(i,2));
353      int g = combine_3_weights(weights_g, BIT(i,3), BIT(i,4), BIT(i,5));
354      int b = combine_2_weights(weights_b, BIT(i,6), BIT(i,7));
343355
344      /* red component */
345      bit0 = (i >> 0) & 0x01;
346      bit1 = (i >> 1) & 0x01;
347      bit2 = (i >> 2) & 0x01;
348      r = combine_3_weights(weights_r, bit0, bit1, bit2);
349
350      /* green component */
351      bit0 = (i >> 3) & 0x01;
352      bit1 = (i >> 4) & 0x01;
353      bit2 = (i >> 5) & 0x01;
354      g = combine_3_weights(weights_g, bit0, bit1, bit2);
355
356      /* blue component */
357      bit0 = (i >> 6) & 0x01;
358      bit1 = (i >> 7) & 0x01;
359      b = combine_2_weights(weights_b, bit0, bit1);
360
361356      palette_lookup[i] = MAKE_RGB(r, g, b);
362357   }
363358}
364359
365360
366WRITE8_HANDLER( williams_paletteram_w )
367{
368   paletteram[offset] = data;
369   palette_set_color(Machine, offset, palette_lookup[data]);
370}
371
372
373READ8_HANDLER( williams2_paletteram_r )
374{
375   return williams2_paletteram[offset];
376}
377
378
379361WRITE8_HANDLER( williams2_paletteram_w )
380362{
381363   static const UINT8 ztable[16] =
r1649r1650
386368   UINT8 entry_lo, entry_hi, i, r, g, b;
387369
388370   /* set the new value */
389   williams2_paletteram[offset] = data;
371   paletteram[offset] = data;
390372
391373   /* pull the associated low/high bytes */
392   entry_lo = williams2_paletteram[offset & ~1];
393   entry_hi = williams2_paletteram[offset |  1];
374   entry_lo = paletteram[offset & ~1];
375   entry_hi = paletteram[offset |  1];
394376
395377   /* update the palette entry */
396378   i = ztable[(entry_hi >> 4) & 15];
r1649r1650
403385
404386WRITE8_HANDLER( williams2_fg_select_w )
405387{
406   video_screen_update_partial(0, video_screen_get_vpos(0));
407388   williams2_fg_color = data & 0x3f;
408389}
409390
r1649r1650
470451
471452WRITE8_HANDLER( williams2_bg_select_w )
472453{
473   video_screen_update_partial(0, video_screen_get_vpos(0));
474
475454   /* based on the tilemap config, only certain bits are used */
476455   /* the rest are determined by other factors */
477456   switch (williams2_tilemap_config)
r1649r1650
504483
505484WRITE8_HANDLER( williams2_xscroll_low_w )
506485{
507   video_screen_update_partial(0, video_screen_get_vpos(0));
508486   tilemap_xscroll = (tilemap_xscroll & ~0x00f) | ((data & 0x80) >> 4) | (data & 0x07);
509487   tilemap_set_scrollx(bg_tilemap, 0, (tilemap_xscroll & 7) + ((tilemap_xscroll >> 3) * 6));
510488}
r1649r1650
512490
513491WRITE8_HANDLER( williams2_xscroll_high_w )
514492{
515   video_screen_update_partial(0, video_screen_get_vpos(0));
516493   tilemap_xscroll = (tilemap_xscroll & 0x00f) | (data << 4);
517494   tilemap_set_scrollx(bg_tilemap, 0, (tilemap_xscroll & 7) + ((tilemap_xscroll >> 3) * 6));
518495}
r1649r1650
527504
528505WRITE8_HANDLER( blaster_remap_select_w )
529506{
530   video_screen_update_partial(0, video_screen_get_vpos(0));
531507   blitter_remap_index = data;
532508   blitter_remap = blitter_remap_lookup + data * 256;
533509}
r1649r1650
535511
536512WRITE8_HANDLER( blaster_video_control_w )
537513{
538   video_screen_update_partial(0, video_screen_get_vpos(0));
539514   blaster_video_control = data;
540515}
541516
542517
543WRITE8_HANDLER( blaster_scanline_control_w )
544{
545   video_screen_update_partial(0, video_screen_get_vpos(0));
546   blaster_scanline_control[offset] = data;
547}
548518
549
550WRITE8_HANDLER( blaster_palette_0_w )
551{
552   video_screen_update_partial(0, video_screen_get_vpos(0));
553   blaster_palette_0[offset] = data;
554   palette_set_color(Machine, 16 + offset, palette_lookup[data ^ 0xff]);
555}
556
557
558
559519/*************************************
560520 *
561521 *  Blitter setup and control
src/mame/video/dec8.c
r1649r1650
4141***************************************************************************/
4242
4343#include "driver.h"
44#include "deprecat.h"
4445
4546//static int scroll1[4];
4647static int scroll2[4];
src/mame/video/battlane.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910UINT8 *battlane_spriteram;
1011UINT8 *battlane_tileram;
src/mame/video/genesis.c
r1649r1650
88***********************************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "genesis.h"
1213
1314/* in video/segasyse.c */
src/mame/video/rpunch.c
r1649r1650
77****************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011
1112
1213#define BITMAP_WIDTH   304
src/mame/video/cloud9.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cloud9.h"
910#include "video/resnet.h"
1011
src/mame/video/changela.c
r1649r1650
1212***************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516
1617
1718extern UINT8 changela_tree0_col;
r1649r1650
742743
743744VIDEO_UPDATE( changela )
744745{
745   copybitmap(bitmap, river_bitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
746   copybitmap(bitmap, obj0_bitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
747   copybitmap(bitmap, tree0_bitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
748   copybitmap(bitmap, tree1_bitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
746   copybitmap      (bitmap, river_bitmap, 0, 0, 0, 0, cliprect);
747   copybitmap_trans(bitmap, obj0_bitmap,  0, 0, 0, 0, cliprect, 0);
748   copybitmap_trans(bitmap, tree0_bitmap, 0, 0, 0, 0, cliprect, 0);
749   copybitmap_trans(bitmap, tree1_bitmap, 0, 0, 0, 0, cliprect, 0);
749750   draw_obj1(machine, bitmap);
750751
751752   return 0;
src/mame/video/pooyan.c
r1649r1650
11/***************************************************************************
22
3  video.c
3    Pooyan
44
5  Functions to emulate the video hardware of the machine.
6
75***************************************************************************/
86
97#include "driver.h"
8#include "pooyan.h"
109
1110static tilemap *bg_tilemap;
1211
12
13
1314/***************************************************************************
1415
1516  Convert the color PROMs into a more useable format.
r1649r1650
2829  bit 0 -- 1  kohm resistor  -- RED
2930
3031***************************************************************************/
32
3133PALETTE_INIT( pooyan )
3234{
35   rgb_t palette[32];
3336   int i;
34   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
35   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3637
37
38   for (i = 0;i < machine->drv->total_colors;i++)
38   for (i = 0;i < 32;i++)
3939   {
4040      int bit0,bit1,bit2,r,g,b;
4141
42
4342      /* red component */
4443      bit0 = (*color_prom >> 0) & 0x01;
4544      bit1 = (*color_prom >> 1) & 0x01;
r1649r1650
5655      bit2 = (*color_prom >> 7) & 0x01;
5756      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
5857
59      palette_set_color(machine,i,MAKE_RGB(r,g,b));
58      palette[i] = MAKE_RGB(r,g,b);
6059      color_prom++;
6160   }
6261
6362   /* color_prom now points to the beginning of the char lookup table */
6463
6564   /* sprites */
66   for (i = 0;i < TOTAL_COLORS(1);i++)
67      COLOR(1,i) = *(color_prom++) & 0x0f;
65   for (i = 0;i < 16*16;i++)
66      palette_set_color(machine, 16*16+i, palette[*color_prom++ & 0x0f]);
6867
6968   /* characters */
70   for (i = 0;i < TOTAL_COLORS(0);i++)
71      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
69   for (i = 0;i < 16*16;i++)
70      palette_set_color(machine, i, palette[(*color_prom++ & 0x0f) + 0x10]);
7271}
7372
73
74
75/*************************************
76 *
77 *  Tilemap info callback
78 *
79 *************************************/
80
81static TILE_GET_INFO( get_bg_tile_info )
82{
83   int attr = colorram[tile_index];
84   int code = videoram[tile_index];
85   int color = attr & 0x0f;
86   int flags = TILE_FLIPYX(attr >> 6);
87
88   SET_TILE_INFO(0, code, color, flags);
89}
90
91
92
93/*************************************
94 *
95 *  Video startup
96 *
97 *************************************/
98
99VIDEO_START( pooyan )
100{
101   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
102}
103
104
105
106/*************************************
107 *
108 *  Memory write handlers
109 *
110 *************************************/
111
74112WRITE8_HANDLER( pooyan_videoram_w )
75113{
76114   videoram[offset] = data;
77115   tilemap_mark_tile_dirty(bg_tilemap, offset);
78116}
79117
118
80119WRITE8_HANDLER( pooyan_colorram_w )
81120{
82121   colorram[offset] = data;
83122   tilemap_mark_tile_dirty(bg_tilemap, offset);
84123}
85124
125
86126WRITE8_HANDLER( pooyan_flipscreen_w )
87127{
88   if (flip_screen != (data & 0x01))
89   {
90      flip_screen_set(data & 0x01);
91      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
92   }
128   flip_screen_set(~data & 0x01);
93129}
94130
95static TILE_GET_INFO( get_bg_tile_info )
96{
97   int attr = colorram[tile_index];
98   int code = videoram[tile_index] + 8 * (attr & 0x20);
99   int color = attr & 0x0f;
100   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
101131
102   SET_TILE_INFO(0, code, color, flags);
103}
104132
105VIDEO_START( pooyan )
106{
107   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
108      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
109}
133/*************************************
134 *
135 *  Sprite rendering
136 *
137 *************************************/
110138
111139static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
112140{
113141   int offs;
114142
115   for (offs = 0;offs < spriteram_size;offs += 2)
143   for (offs = 0x10;offs < 0x40;offs += 2)
116144   {
117      /* TRANSPARENCY_COLOR is needed for the scores */
145      int sx = spriteram[offs];
146      int sy = 240 - spriteram_2[offs + 1];
147
148      int code = spriteram[offs + 1];
149      int color = spriteram_2[offs] & 0x0f;
150      int flipx = ~spriteram_2[offs] & 0x40;
151      int flipy = spriteram_2[offs] & 0x80;
152
118153      /* Sprite flipscreen is supported by software */
119154      drawgfx(bitmap,machine->gfx[1],
120         spriteram[offs + 1],
121         spriteram_2[offs] & 0x0f,
122         spriteram_2[offs] & 0x40, ~spriteram_2[offs] & 0x80,
123         240-spriteram[offs], spriteram_2[offs + 1],
155         code,
156         color,
157         flipx, flipy,
158         sx, sy,
124159         cliprect,
125         TRANSPARENCY_COLOR, 0);
160         TRANSPARENCY_PEN, 0);
126161   }
127162}
128163
164
165
166/*************************************
167 *
168 *  Video update
169 *
170 *************************************/
171
129172VIDEO_UPDATE( pooyan )
130173{
131174   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
src/mame/video/wolfpack.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910int wolfpack_collision;
1011
src/mame/video/crospang.c
r1649r1650
1010*/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314
1415static int xsproff, ysproff; // sprite offsets
1516static tilemap *bg_layer,*fg_layer;
src/mame/video/subs.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "subs.h"
910#include "sound/discrete.h"
1011
src/mame/video/darkmist.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34/*defined in drivers/darkmist.c */
45
src/mame/video/funybubl.c
r1649r1650
66
77
88#include "driver.h"
9#include "deprecat.h"
910
1011UINT8* funybubl_banked_videoram;
1112UINT8 *funybubl_paletteram;
src/mame/video/shisen.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34static int gfxbank;
45
src/mame/video/tutankhm.c
r1649r1650
88
99
1010#include "driver.h"
11#include "tutankhm.h"
1112
1213
1314#define NUM_PENS   (0x10)
1415
1516
16UINT8 *tutankhm_videoram;
17size_t tutankhm_videoram_size;
18UINT8 *tutankhm_paletteram;
1917UINT8 *tutankhm_scroll;
2018
2119static UINT8 junofrst_blitterdata[4];
r1649r1650
2422
2523
2624
25/*************************************
26 *
27 *  Write handlers
28 *
29 *************************************/
30
2731WRITE8_HANDLER( tutankhm_flip_screen_x_w )
2832{
2933   tutankhm_flip_screen_x = data & 0x01;
r1649r1650
3640}
3741
3842
43
44/*************************************
45 *
46 *  Palette management
47 *
48 *************************************/
49
3950static void get_pens(pen_t *pens)
4051{
4152   offs_t i;
4253
4354   for (i = 0; i < NUM_PENS; i++)
4455   {
45      UINT8 data = tutankhm_paletteram[i];
56      UINT8 data = paletteram[i];
4657
4758      pens[i] = MAKE_RGB(pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
4859   }
4960}
5061
5162
63
64/*************************************
65 *
66 *  Video startup
67 *
68 *************************************/
69
70VIDEO_START( tutankhm )
71{
72   state_save_register_global_array(junofrst_blitterdata);
73   state_save_register_global(tutankhm_flip_screen_x);
74   state_save_register_global(tutankhm_flip_screen_y);
75}
76
77
78
79/*************************************
80 *
81 *  Video update
82 *
83 *************************************/
84
5285VIDEO_UPDATE( tutankhm )
5386{
87   int xorx = tutankhm_flip_screen_x ? 255 : 0;
88   int xory = tutankhm_flip_screen_y ? 255 : 0;
5489   pen_t pens[NUM_PENS];
55   offs_t offs;
90   int x, y;
5691
5792   get_pens(pens);
5893
59   for (offs = 0; offs < tutankhm_videoram_size; offs++)
94   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
6095   {
61      int i;
96      UINT32 *dst = BITMAP_ADDR32(bitmap, y, 0);
6297
63      UINT8 data = tutankhm_videoram[offs];
64
65      UINT8 y = offs >> 7;
66      UINT8 x = offs << 1;
67
68      for (i = 0; i < 2; i++)
98      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
6999      {
70         UINT8 sy = y;
71         UINT8 sx = x;
72
73         pen_t pen = pens[data & 0x0f];
74
75         /* adjust for scrolling */
76         if (x < 192)
77         {
78            sy = sy - *tutankhm_scroll;
79         }
80
81         if (tutankhm_flip_screen_y)   sy = 255 - sy;
82         if (tutankhm_flip_screen_x)   sx = 255 - sx;
83
84         *BITMAP_ADDR32(bitmap, sy, sx) = pen;
85
86         x = x + 1;
87         data = data >> 4;
100         UINT8 effx = x ^ xorx;
101         UINT8 yscroll = (effx < 192) ? *tutankhm_scroll : 0;
102         UINT8 effy = (y ^ xory) + yscroll;
103         UINT8 vrambyte = videoram[effy * 128 + effx / 2];
104         UINT8 shifted = vrambyte >> (4 * (effx % 2));
105         dst[x] = pens[shifted & 0x0f];
88106      }
89107   }
90108
r1649r1650
150168                  data = 0;
151169
152170               if (dest & 1)
153                  tutankhm_videoram[dest >> 1] = (tutankhm_videoram[dest >> 1] & 0x0f) | (data << 4);
171                  videoram[dest >> 1] = (videoram[dest >> 1] & 0x0f) | (data << 4);
154172               else
155                  tutankhm_videoram[dest >> 1] = (tutankhm_videoram[dest >> 1] & 0xf0) | data;
173                  videoram[dest >> 1] = (videoram[dest >> 1] & 0xf0) | data;
156174            }
157175
158176            dest = dest + 1;
src/mame/video/nmk16.c
r1649r1650
800800      }
801801   }
802802
803   copyscrollbitmap(bitmap,background_bitmap,1,&scrollx,1,&scrolly,cliprect,TRANSPARENCY_NONE,0);
803   copyscrollbitmap(bitmap,background_bitmap,1,&scrollx,1,&scrolly,cliprect);
804804   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
805805
806806   nmk16_draw_sprites(machine, bitmap,cliprect,3);
r1649r1650
854854   memcpy(spriteram_old2,nmk16_mainram+0x8000/2,0x1000);
855855}
856856
857VIDEO_EOF( strahl )
858{
859   /* sprites are DMA'd from Main RAM to a private buffer automatically
860       (or at least this is how I interpret the datasheet) */
857861
862   /* -- I actually see little evidence to support this, sprite lag
863          in some games should be checked on real boards */
858864
865   /* strahl sprites are allocated in memory range FF000-FFFFF */
866
867   memcpy(spriteram_old2,nmk16_mainram+0xF000/2,0x1000);
868}
869
870
871
859872/* Variables needed by drivers: */
860873
861874UINT16 *afega_vram_0, *afega_scroll_0;
src/mame/layout/ampoker2.lay
r0r1650
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="L0" defstate="1">
4      <rect>
5         <color red="1.0" green="1.0" blue="1.0" />
6      </rect>
7      <text string="DEAL/TAKE" state="1">
8         <color red="0.0" green="0.0" blue="0.0" />
9         <bounds x="0" y="0.1" width="1" height="0.8" />
10      </text>
11   </element>
12
13   <element name="L1" defstate="1">
14      <rect>
15         <color red="1.0" green="1.0" blue="1.0" />
16      </rect>
17      <text string="BET/RED" state="1">
18         <color red="0.0" green="0.0" blue="0.0" />
19         <bounds x="0" y="0.1" width="1" height="0.8" />
20      </text>
21   </element>
22
23   <element name="L2" defstate="1">
24      <rect>
25         <color red="1.0" green="1.0" blue="1.0" />
26      </rect>
27      <text string="BLACK" state="1">
28         <color red="0.0" green="0.0" blue="0.0" />
29         <bounds x="0" y="0.1" width="1" height="0.8" />
30      </text>
31   </element>
32
33   <element name="L3" defstate="1">
34      <rect>
35         <color red="1.0" green="0.0" blue="0.0" />
36      </rect>
37      <text string="HOLD1" state="1">
38         <color red="0.0" green="0.0" blue="0.0" />
39         <bounds x="0" y="0.1" width="1" height="0.8" />
40      </text>
41   </element>
42
43   <element name="L4" defstate="1">
44      <rect>
45         <color red="1.0" green="0.0" blue="0.0" />
46      </rect>
47      <text string="HOLD2" state="1">
48         <color red="0.0" green="0.0" blue="0.0" />
49         <bounds x="0" y="0.1" width="1" height="0.8" />
50      </text>
51   </element>
52
53   <element name="L5" defstate="1">
54      <rect>
55         <color red="1.0" green="0.0" blue="0.0" />
56      </rect>
57      <text string="HOLD3" state="1">
58         <color red="0.0" green="0.0" blue="0.0" />
59         <bounds x="0" y="0.1" width="1" height="0.8" />
60      </text>
61   </element>
62
63   <element name="L6" defstate="1">
64      <rect>
65         <color red="1.0" green="0.0" blue="0.0" />
66      </rect>
67      <text string="HOLD4" state="1">
68         <color red="0.0" green="0.0" blue="0.0" />
69         <bounds x="0" y="0.1" width="1" height="0.8" />
70      </text>
71   </element>
72
73   <element name="L7" defstate="1">
74      <rect>
75         <color red="1.0" green="0.0" blue="0.0" />
76      </rect>
77      <text string="HOLD5" state="1">
78         <color red="0.0" green="0.0" blue="0.0" />
79         <bounds x="0" y="0.1" width="1" height="0.8" />
80      </text>
81   </element>
82
83   <view name="Button Lamps">
84      <screen index="0">
85         <bounds left="0" top="0" right="4" bottom="3" />
86      </screen>
87      <bezel name="lamp0" element="L0">
88         <bounds x="0" y="3.13" width="0.40" height="0.24" />
89      </bezel>
90      <bezel name="lamp1" element="L1">
91         <bounds x="0.5" y="3.13" width="0.40" height="0.24" />
92      </bezel>
93      <bezel name="lamp2" element="L2">
94         <bounds x="1.0" y="3.13" width="0.40" height="0.24" />
95      </bezel>
96      <bezel name="lamp3" element="L3">
97         <bounds x="1.6" y="3.13" width="0.40" height="0.24" />
98      </bezel>
99      <bezel name="lamp4" element="L4">
100         <bounds x="2.1" y="3.13" width="0.40" height="0.24" />
101      </bezel>
102      <bezel name="lamp5" element="L5">
103         <bounds x="2.6" y="3.13" width="0.40" height="0.24" />
104      </bezel>
105      <bezel name="lamp6" element="L6">
106         <bounds x="3.1" y="3.13" width="0.40" height="0.24" />
107      </bezel>
108      <bezel name="lamp7" element="L7">
109         <bounds x="3.6" y="3.13" width="0.40" height="0.24" />
110      </bezel>
111   </view>
112</mamelayout>
src/mame/drivers/bfcobra.c
r1649r1650
7171
7272******************************************************************************/
7373#include "driver.h"
74#include "debugger.h"
74#include "deprecat.h"
7575#include "machine/6850acia.h"
7676#include "machine/meters.h"
7777#include "cpu/z80/z80.h"
src/mame/drivers/sbugger.c
r1649r1650
288288   ROM_LOAD( "spbugger.gfx", 0x0000, 0x1000, CRC(d3f345b5) SHA1(a5082ffc3043352e9b731af95770bdd62fb928bf) )
289289ROM_END
290290
291GAME( 1981, sbugger, 0, sbugger, sbugger, 0, ROT270, "Game-A-Tron", "Space Bugger (set 1)", GAME_NOT_WORKING )
292GAME( 1981, sbuggera, sbugger, sbugger, sbugger, 0, ROT270, "Game-A-Tron", "Space Bugger (set 2)", GAME_IMPERFECT_COLORS )
293
291GAME( 1981, sbugger,  0,        sbugger,  sbugger,  0, ROT270, "Game-A-Tron", "Space Bugger (set 1)", GAME_NOT_WORKING )
292GAME( 1981, sbuggera, sbugger,  sbugger,  sbugger,  0, ROT270, "Game-A-Tron", "Space Bugger (set 2)", GAME_IMPERFECT_COLORS )
src/mame/drivers/intrscti.c
r1649r1650
1212*/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516
1617static READ8_HANDLER( unk_r )
1718{
src/mame/drivers/nycaptor.c
r1649r1650
146146//#define USE_MCU
147147
148148
149#include <math.h>
150149#include "driver.h"
150#include "deprecat.h"
151151#include "cpu/z80/z80.h"
152152#include "cpu/m6805/m6805.h"
153153#include "sound/ay8910.h"
src/mame/drivers/mitchell.c
r1649r1650
7878
7979
8080#include "driver.h"
81#include "deprecat.h"
8182#include "machine/eeprom.h"
8283#include "sound/okim6295.h"
8384#include "sound/3812intf.h"
src/mame/drivers/rainbow.c
r1649r1650
237237***************************************************************************/
238238
239239#include "driver.h"
240#include "deprecat.h"
240241#include "taitoipt.h"
241242#include "video/taitoic.h"
242243#include "audio/taitosnd.h"
src/mame/drivers/galspnbl.c
r1649r1650
1919***************************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "cpu/z80/z80.h"
2324#include "sound/okim6295.h"
2425#include "sound/3812intf.h"
src/mame/drivers/blktiger.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "cpu/z80/z80.h"
1819#include "sound/2203intf.h"
1920
src/mame/drivers/mgolf.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910static UINT8* mgolf_video_ram;
1011
src/mame/drivers/deco_mlc.c
r1649r1650
9696***************************************************************************/
9797
9898#include "driver.h"
99#include "deprecat.h"
99100#include "machine/eeprom.h"
100101#include "sound/ymz280b.h"
101102#include "decoprot.h"
src/mame/drivers/tryout.c
r1649r1650
1313****************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "sound/2203intf.h"
1718
1819extern UINT8 *tryout_gfx_control;
src/mame/drivers/pasha2.c
r1649r1650
7272*********************************************************************/
7373
7474#include "driver.h"
75#include "deprecat.h"
7576#include "machine/eeprom.h"
7677#include "sound/okim6295.h"
7778
src/mame/drivers/rungun.c
r1649r1650
3636*/
3737
3838#include "driver.h"
39#include "deprecat.h"
3940
4041#include "video/konamiic.h"
4142#include "cpu/m68000/m68000.h"
src/mame/drivers/crystal.c
r1649r1650
117117*/
118118
119119#include "driver.h"
120#include "deprecat.h"
120121#include "cpu/se3208/se3208.h"
121122#include "video/vrender0.h"
122123#include "machine/ds1302.h"
src/mame/drivers/tempest.c
r1649r1650
278278***************************************************************************/
279279
280280#include "driver.h"
281#include "deprecat.h"
281282#include "machine/mathbox.h"
282283#include "video/avgdvg.h"
283284#include "video/vector.h"
src/mame/drivers/madmotor.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "cpu/h6280/h6280.h"
1718#include "sound/2203intf.h"
1819#include "sound/2151intf.h"
src/mame/drivers/eprom.c
r1649r1650
2020
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "machine/atarigen.h"
2425#include "audio/atarijsa.h"
2526#include "eprom.h"
src/mame/drivers/bublbobl.c
r1649r1650
269269***************************************************************************/
270270
271271#include "driver.h"
272#include "deprecat.h"
272273#include "sound/2203intf.h"
273274#include "sound/3812intf.h"
274275#include "cpu/m6805/m6805.h"
src/mame/drivers/chinsan.c
r1649r1650
4040*/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "machine/mc8123.h"
4445#include "sound/2203intf.h"
4546
src/mame/drivers/cshooter.c
r1649r1650
8484*/
8585
8686#include "driver.h"
87#include "deprecat.h"
8788#include "audio/seibu.h"
8889
8990static UINT8* cshooter_txram;
src/mame/drivers/aerofgt.c
r1649r1650
5959***************************************************************************/
6060
6161#include "driver.h"
62#include "deprecat.h"
6263#include "cpu/z80/z80.h"
6364#include "sound/2610intf.h"
6465#include "sound/3812intf.h"
src/mame/drivers/rocnrope.c
r1649r1650
225225   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
226226   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
227227
228   MDRV_CPU_ADD(Z80,14318180/8)
229   /* audio CPU */   /* 1.789772727 MHz */                  \
230   MDRV_CPU_PROGRAM_MAP(timeplt_sound_readmem,timeplt_sound_writemem)
231
232228   MDRV_SCREEN_REFRESH_RATE(60)
233229   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
234230
r1649r1650
246242   MDRV_VIDEO_UPDATE(rocnrope)
247243
248244   /* sound hardware */
249   MDRV_SPEAKER_STANDARD_MONO("mono")
250
251   MDRV_SOUND_ADD(AY8910, 14318180/8)
252   MDRV_SOUND_CONFIG(timeplt_ay8910_interface)
253   MDRV_SOUND_ROUTE(0, "filter.0.0", 0.60)
254   MDRV_SOUND_ROUTE(1, "filter.0.1", 0.60)
255   MDRV_SOUND_ROUTE(2, "filter.0.2", 0.60)
256
257   MDRV_SOUND_ADD(AY8910, 14318180/8)
258   MDRV_SOUND_ROUTE(0, "filter.1.0", 0.60)
259   MDRV_SOUND_ROUTE(1, "filter.1.1", 0.60)
260   MDRV_SOUND_ROUTE(2, "filter.1.2", 0.60)
261
262   MDRV_SOUND_ADD_TAG("filter.0.0", FILTER_RC, 0)
263   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
264   MDRV_SOUND_ADD_TAG("filter.0.1", FILTER_RC, 0)
265   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
266   MDRV_SOUND_ADD_TAG("filter.0.2", FILTER_RC, 0)
267   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
268
269   MDRV_SOUND_ADD_TAG("filter.1.0", FILTER_RC, 0)
270   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
271   MDRV_SOUND_ADD_TAG("filter.1.1", FILTER_RC, 0)
272   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
273   MDRV_SOUND_ADD_TAG("filter.1.2", FILTER_RC, 0)
274   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
245   MDRV_IMPORT_FROM(timeplt_sound)
275246MACHINE_DRIVER_END
276247
277248/***************************************************************************
src/mame/drivers/fgoal.c
r1649r1650
1717***************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021#include "includes/fgoal.h"
2122
2223UINT8* fgoal_video_ram;
src/mame/drivers/expro02.c
r1649r1650
119119*/
120120
121121#include "driver.h"
122#include "deprecat.h"
122123#include "includes/kaneko16.h"
123124#include "sound/okim6295.h"
124125
src/mame/drivers/ultrsprt.c
r1649r1650
55*/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/powerpc/ppc.h"
910#include "sound/k054539.h"
1011#include "machine/eeprom.h"
src/mame/drivers/mainsnk.c
r1649r1650
7171*/
7272
7373#include "driver.h"
74#include "deprecat.h"
7475#include "sound/ay8910.h"
7576#include "sound/namco.h"
7677
src/mame/drivers/mystston.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "sound/ay8910.h"
1819
1920
src/mame/drivers/hitme.c
r1649r1650
1515*/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "hitme.h"
1920#include "sound/discrete.h"
2021
src/mame/drivers/rampart.c
r1649r1650
2323
2424
2525#include "driver.h"
26#include "deprecat.h"
2627#include "machine/atarigen.h"
2728#include "rampart.h"
2829#include "sound/okim6295.h"
src/mame/drivers/senjyo.c
r1649r1650
6969***************************************************************************/
7070
7171#include "driver.h"
72#include "deprecat.h"
7273#include "machine/z80ctc.h"
7374#include "machine/z80pio.h"
7475#include "sound/sn76496.h"
src/mame/drivers/murogem.c
r1649r1650
257257
258258ROM_END
259259
260GAME( 198?,   murogem, 0, murogem, murogem, 0, ROT0, "unknown", "Muroge Monaco (set 1)",GAME_NO_SOUND|GAME_WRONG_COLORS )
261GAME( 198?, murogema, murogem, murogem, murogem, 0, ROT0, "unknown", "Muroge Monaco (set 2)",GAME_NO_SOUND|GAME_WRONG_COLORS )
262GAME( 198?, lasvegas, murogem, murogem, murogem, 0, ROT0, "hack", "Las Vegas, Nevada",GAME_NO_SOUND|GAME_WRONG_COLORS )
260GAME( 198?,   murogem,  0,       murogem, murogem, 0, ROT0, "unknown", "Muroge Monaco (set 1)", GAME_NO_SOUND|GAME_WRONG_COLORS )
261GAME( 198?, murogema, murogem, murogem, murogem, 0, ROT0, "unknown", "Muroge Monaco (set 2)", GAME_NO_SOUND|GAME_WRONG_COLORS )
262GAME( 198?, lasvegas, murogem, murogem, murogem, 0, ROT0, "hack", "Las Vegas, Nevada", GAME_NO_SOUND|GAME_WRONG_COLORS )
src/mame/drivers/snowbros.c
r1649r1650
6363***************************************************************************/
6464
6565#include "driver.h"
66#include "deprecat.h"
6667#include "cpu/m68000/m68000.h"
6768#include "cpu/z80/z80.h"
6869#include "sound/2151intf.h"
src/mame/drivers/segaxbd.c
r1649r1650
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "system16.h"
2425#include "cpu/m68000/m68000.h"
2526#include "machine/segaic16.h"
src/mame/drivers/nbmj9195.c
r1649r1650
2020******************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "machine/z80ctc.h"
2425#include "sound/3812intf.h"
2526#include "sound/dac.h"
r1649r1650
50325033GAME( 1993, mjlaman,  0,        mjlaman,  mjlaman,  nbmj9195, ROT0,   "Nichibutsu/AV JAPAN", "Mahjong La Man (Japan)", 0 )
50335034GAME( 1993, mkeibaou, 0,        mkeibaou, mkeibaou, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Keibaou (Japan)", 0 )
50345035GAME( 1993, pachiten, 0,        pachiten, pachiten, nbmj9195, ROT0,   "Nichibutsu/MIKI SYOUJI/AV JAPAN", "Medal Mahjong Pachi-Slot Tengoku [BET] (Japan)", 0 )
5035GAME( 1993, sailorws, 0,        sailorws, sailorws, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Sailor Wars (Japan)", 0 )
5036GAME( 1993, sailorwa, sailorws, sailorws, sailorws, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Sailor Wars (Japan) (set 2)", 0 )
5036GAME( 1993, sailorws, 0,        sailorws, sailorws, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Sailor Wars (Japan set 1)", 0 )
5037GAME( 1993, sailorwa, sailorws, sailorws, sailorws, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Sailor Wars (Japan set 2)", 0 )
50375038GAME( 1993, sailorwr, sailorws, sailorwr, sailorwr, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Sailor Wars-R [BET] (Japan)", 0 )
50385039GAME( 1993, wcatcher, 0,        otatidai, wcatcher, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Wakuwaku Catcher (Japan)", 0 )
50395040GAME( 1993, jituroku, 0,        jituroku, jituroku, nbmj9195, ROT180, "Windom", "Jitsuroku Maru-chi Mahjong (Japan)", 0 )
r1649r1650
50465047GAME( 1991, mjgottsu, 0,        mjgottsu, mjgottsu, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Gottsu ee-kanji (Japan)", 0 )
50475048GAME( 1991, bakuhatu, mjgottsu, bakuhatu, bakuhatu, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Bakuhatsu Junjouden (Japan)", 0 )
50485049GAME( 1992, cmehyou,  0,        cmehyou,  cmehyou,  nbmj9195, ROT0,   "Nichibutsu/Kawakusu", "Mahjong Circuit no Mehyou (Japan)", 0 )
5049GAME( 1992, mjkoiura, 0,        mjkoiura, mjkoiura, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Koi Uranai (Japan)", 0 )
5050GAME( 1992, mkoiuraa, mjkoiura, mkoiuraa, mjkoiura, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Koi Uranai (set 2) (Japan)", 0 )
5050GAME( 1992, mjkoiura, 0,        mjkoiura, mjkoiura, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Koi Uranai (Japan set 1)", 0 )
5051GAME( 1992, mkoiuraa, mjkoiura, mkoiuraa, mjkoiura, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Koi Uranai (Japan set 2)", 0 )
50515052
50525053GAME( 1994, mscoutm,  0,        mscoutm,  mscoutm,  nbmj9195, ROT0,   "SPHINX/AV JAPAN", "Mahjong Scout Man (Japan)", 0 )
50535054GAME( 1994, imekura,  0,        imekura,  imekura,  nbmj9195, ROT0,   "SPHINX/AV JAPAN", "Imekura Mahjong (Japan)", 0 )
src/mame/drivers/sonson.c
r1649r1650
4848***************************************************************************/
4949
5050#include "driver.h"
51#include "deprecat.h"
5152#include "cpu/m6809/m6809.h"
5253#include "sound/ay8910.h"
5354
src/mame/drivers/sslam.c
r1649r1650
8181
8282
8383#include "driver.h"
84#include "deprecat.h"
8485#include "cpu/i8051/i8051.h"
8586#include "sound/okim6295.h"
8687
src/mame/drivers/simpl156.c
r1649r1650
9191extern void decrypt156(void);
9292
9393#include "driver.h"
94#include "deprecat.h"
9495#include "decocrpt.h"
9596#include "deco32.h"
9697#include "cpu/arm/arm.h"
src/mame/drivers/hcastle.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/konami/konami.h"
1112#include "cpu/z80/z80.h"
1213#include "sound/3812intf.h"
r1649r1650
7576   AM_RANGE(0x040c, 0x040c) AM_WRITE(watchdog_reset_w)
7677   AM_RANGE(0x0410, 0x0410) AM_WRITE(hcastle_coin_w)
7778   AM_RANGE(0x0418, 0x0418) AM_WRITE(hcastle_gfxbank_w)
78   AM_RANGE(0x0600, 0x06ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)
79   AM_RANGE(0x0600, 0x06ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
7980   AM_RANGE(0x0700, 0x1fff) AM_WRITE(MWA8_RAM)
8081   AM_RANGE(0x2000, 0x2fff) AM_WRITE(hcastle_pf1_video_w) AM_BASE(&hcastle_pf1_videoram)
8182   AM_RANGE(0x3000, 0x3fff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
r1649r1650
283284   MDRV_SCREEN_SIZE(32*8, 32*8)
284285   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
285286   MDRV_GFXDECODE(hcastle)
286   MDRV_PALETTE_LENGTH(128)
287   MDRV_COLORTABLE_LENGTH(2*8*16*16)
287   MDRV_PALETTE_LENGTH(2*8*16*16)
288288
289289   MDRV_PALETTE_INIT(hcastle)
290290   MDRV_VIDEO_START(hcastle)
src/mame/drivers/deadang.c
r1649r1650
3535*/
3636
3737#include "driver.h"
38#include "deprecat.h"
3839#include "audio/seibu.h"
3940#include "sound/2203intf.h"
4041#include "sound/msm5205.h"
src/mame/drivers/cliffhgr.c
r1649r1650
7575
7676#include "driver.h"
7777#include "render.h"
78#include "deprecat.h"
7879#include "machine/laserdsc.h"
7980#include "video/tms9928a.h"
8081#include "sound/discrete.h"
src/mame/drivers/artmagic.c
r1649r1650
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "cpu/tms34010/tms34010.h"
2021#include "video/tlc34076.h"
2122#include "artmagic.h"
src/mame/drivers/cntsteer.c
r1649r1650
2626*******************************************************************************/
2727
2828#include "driver.h"
29#include "deprecat.h"
2930#include "cpu/m6809/m6809.h"
3031#include "sound/ay8910.h"
3132#include "sound/2203intf.h"
src/mame/drivers/twincobr.c
r1649r1650
188188
189189
190190#include "driver.h"
191#include "deprecat.h"
191192#include "cpu/m68000/m68000.h"
192193#include "cpu/tms32010/tms32010.h"
193194#include "twincobr.h"
src/mame/drivers/hexion.c
r1649r1650
7979***************************************************************************/
8080
8181#include "driver.h"
82#include "deprecat.h"
8283#include "sound/okim6295.h"
8384#include "sound/k051649.h"
8485
src/mame/drivers/bking.c
r0r1650
1/***************************************************************************
2
3
4Birdie King / Birdie King II / Birdie King III Memory Map
5---------------------------------------------------------
6
70000-7fff ROM
88000-83ff Scratch RAM
98400-8fff (Scratch RAM again, address lines AB10, AB11 ignored)
109000-97ff Playfield RAM
11a000-bfff Unused?
12
13DIP Locations verified for:
14    - bking2
15
16***************************************************************************/
17
18#include "driver.h"
19#include "deprecat.h"
20#include "cpu/m6805/m6805.h"
21#include "sound/ay8910.h"
22#include "sound/dac.h"
23
24
25/* bking3 mcu communication */
26extern MACHINE_RESET( buggychl );
27extern READ8_HANDLER( buggychl_68705_portA_r );
28extern WRITE8_HANDLER( buggychl_68705_portA_w );
29extern WRITE8_HANDLER( buggychl_68705_ddrA_w );
30extern READ8_HANDLER( buggychl_68705_portB_r );
31extern WRITE8_HANDLER( buggychl_68705_portB_w );
32extern WRITE8_HANDLER( buggychl_68705_ddrB_w );
33extern READ8_HANDLER( buggychl_68705_portC_r );
34extern WRITE8_HANDLER( buggychl_68705_portC_w );
35extern WRITE8_HANDLER( buggychl_68705_ddrC_w );
36extern WRITE8_HANDLER( buggychl_mcu_w );
37extern READ8_HANDLER( buggychl_mcu_r );
38extern READ8_HANDLER( buggychl_mcu_status_r );
39
40extern PALETTE_INIT( bking );
41
42extern VIDEO_START( bking );
43extern VIDEO_UPDATE( bking );
44extern VIDEO_EOF( bking );
45
46extern WRITE8_HANDLER( bking_xld1_w );
47extern WRITE8_HANDLER( bking_yld1_w );
48extern WRITE8_HANDLER( bking_xld2_w );
49extern WRITE8_HANDLER( bking_yld2_w );
50extern WRITE8_HANDLER( bking_xld3_w );
51extern WRITE8_HANDLER( bking_yld3_w );
52extern WRITE8_HANDLER( bking_msk_w );
53extern WRITE8_HANDLER( bking_cont1_w );
54extern WRITE8_HANDLER( bking_cont2_w );
55extern WRITE8_HANDLER( bking_cont3_w );
56extern WRITE8_HANDLER( bking_hitclr_w );
57extern WRITE8_HANDLER( bking_playfield_w );
58
59extern READ8_HANDLER( bking_input_port_5_r );
60extern READ8_HANDLER( bking_input_port_6_r );
61extern READ8_HANDLER( bking_pos_r );
62
63UINT8 *bking_playfield_ram;
64
65static int bking3_addr_h, bking3_addr_l;
66static int sndnmi_enable = 1;
67
68static READ8_HANDLER( bking_sndnmi_disable_r )
69{
70   sndnmi_enable = 0;
71   return 0;
72}
73
74static WRITE8_HANDLER( bking_sndnmi_enable_w )
75{
76   sndnmi_enable = 1;
77}
78
79static WRITE8_HANDLER( bking_soundlatch_w )
80{
81   int i,code;
82
83   code = 0;
84   for (i = 0;i < 8;i++)
85      if (data & (1 << i)) code |= 0x80 >> i;
86
87   soundlatch_w(offset,code);
88   if (sndnmi_enable) cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
89}
90
91static WRITE8_HANDLER( bking3_addr_l_w )
92{
93   bking3_addr_l = data;
94}
95
96static WRITE8_HANDLER( bking3_addr_h_w )
97{
98   bking3_addr_h = data;
99}
100
101static READ8_HANDLER( bking3_extrarom_r )
102{
103   UINT8 *rom = memory_region(REGION_USER2);
104   return rom[bking3_addr_h * 256 + bking3_addr_l];
105}
106
107static WRITE8_HANDLER( unk_w )
108{
109/*
110    0 = finished reading extra rom
111    1 = started reading extra rom
112*/
113}
114
115static READ8_HANDLER( bking3_ext_check_r )
116{
117   return 0x31; //no "bad rom.", no "bad ext."
118}
119
120static ADDRESS_MAP_START( bking_map, ADDRESS_SPACE_PROGRAM, 8 )
121   AM_RANGE(0x0000, 0x7fff) AM_ROM
122   AM_RANGE(0x8000, 0x83ff) AM_RAM
123   AM_RANGE(0x9000, 0x97ff) AM_RAM AM_WRITE(bking_playfield_w) AM_BASE(&bking_playfield_ram)
124ADDRESS_MAP_END
125
126static ADDRESS_MAP_START( bking_io_map, ADDRESS_SPACE_IO, 8 )
127   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
128   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, bking_xld1_w)
129   AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, bking_yld1_w)
130   AM_RANGE(0x02, 0x02) AM_READWRITE(input_port_2_r, bking_xld2_w)
131   AM_RANGE(0x03, 0x03) AM_READWRITE(input_port_3_r, bking_yld2_w)
132   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_4_r, bking_xld3_w)
133   AM_RANGE(0x05, 0x05) AM_READWRITE(bking_input_port_5_r, bking_yld3_w)
134   AM_RANGE(0x06, 0x06) AM_READWRITE(bking_input_port_6_r, bking_msk_w)
135   AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w)
136   AM_RANGE(0x08, 0x08) AM_WRITE(bking_cont1_w)
137   AM_RANGE(0x09, 0x09) AM_WRITE(bking_cont2_w)
138   AM_RANGE(0x0a, 0x0a) AM_WRITE(bking_cont3_w)
139   AM_RANGE(0x0b, 0x0b) AM_WRITE(bking_soundlatch_w)
140//  AM_RANGE(0x0c, 0x0c) AM_WRITE(bking_eport2_w)   this is not shown to be connected anywhere
141   AM_RANGE(0x0d, 0x0d) AM_WRITE(bking_hitclr_w)
142   AM_RANGE(0x07, 0x1f) AM_READ(bking_pos_r)
143ADDRESS_MAP_END
144
145static ADDRESS_MAP_START( bking3_io_map, ADDRESS_SPACE_IO, 8 )
146   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
147   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, bking_xld1_w)
148   AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, bking_yld1_w)
149   AM_RANGE(0x02, 0x02) AM_READWRITE(input_port_2_r, bking_xld2_w)
150   AM_RANGE(0x03, 0x03) AM_READWRITE(input_port_3_r, bking_yld2_w)
151   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_4_r, bking_xld3_w)
152   AM_RANGE(0x05, 0x05) AM_READWRITE(bking_input_port_5_r, bking_yld3_w)
153   AM_RANGE(0x06, 0x06) AM_READWRITE(bking_input_port_6_r, bking_msk_w)
154   AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w)
155   AM_RANGE(0x08, 0x08) AM_WRITE(bking_cont1_w)
156   AM_RANGE(0x09, 0x09) AM_WRITE(bking_cont2_w)
157   AM_RANGE(0x0a, 0x0a) AM_WRITE(bking_cont3_w)
158   AM_RANGE(0x0b, 0x0b) AM_WRITE(bking_soundlatch_w)
159//  AM_RANGE(0x0c, 0x0c) AM_WRITE(bking_eport2_w)   this is not shown to be connected anywhere
160   AM_RANGE(0x0d, 0x0d) AM_WRITE(bking_hitclr_w)
161   AM_RANGE(0x07, 0x1f) AM_READ(bking_pos_r)
162   AM_RANGE(0x2f, 0x2f) AM_READWRITE(buggychl_mcu_r, buggychl_mcu_w)
163   AM_RANGE(0x4f, 0x4f) AM_READWRITE(buggychl_mcu_status_r, unk_w)
164   AM_RANGE(0x60, 0x60) AM_READ(bking3_extrarom_r)
165   AM_RANGE(0x6f, 0x6f) AM_READWRITE(bking3_ext_check_r, bking3_addr_h_w)
166   AM_RANGE(0x8f, 0x8f) AM_WRITE(bking3_addr_l_w)
167ADDRESS_MAP_END
168
169static ADDRESS_MAP_START( bking_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
170   AM_RANGE(0x0000, 0x1fff) AM_ROM
171   AM_RANGE(0x2000, 0x2fff) AM_ROM //only bking3
172   AM_RANGE(0x4000, 0x43ff) AM_RAM
173   AM_RANGE(0x4400, 0x4400) AM_WRITE(AY8910_control_port_0_w)
174   AM_RANGE(0x4401, 0x4401) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
175   AM_RANGE(0x4402, 0x4402) AM_WRITE(AY8910_control_port_1_w)
176   AM_RANGE(0x4403, 0x4403) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
177   AM_RANGE(0x4800, 0x4800) AM_READ(soundlatch_r)
178   AM_RANGE(0x4802, 0x4802) AM_READWRITE(bking_sndnmi_disable_r, bking_sndnmi_enable_w)
179   AM_RANGE(0xe000, 0xefff) AM_ROM   /* Space for diagnostic ROM */
180ADDRESS_MAP_END
181
182#if 0
183static UINT8 portA_in,portA_out,ddrA;
184
185static READ8_HANDLER( bking3_68705_portA_r )
186{
187   //printf("portA_r = %02X\n",(portA_out & ddrA) | (portA_in & ~ddrA));
188   return (portA_out & ddrA) | (portA_in & ~ddrA);
189}
190
191static WRITE8_HANDLER( bking3_68705_portA_w )
192{
193   portA_out = data;
194//  printf("portA_out = %02X\n",data);
195}
196
197static WRITE8_HANDLER( bking3_68705_ddrA_w )
198{
199   ddrA = data;
200}
201
202static UINT8 portB_in,portB_out,ddrB;
203
204static READ8_HANDLER( bking3_68705_portB_r )
205{
206   return (portB_out & ddrB) | (portB_in & ~ddrB);
207}
208
209static WRITE8_HANDLER( bking3_68705_portB_w )
210{
211//  if(data != 0xff)
212//      printf("portB_out = %02X\n",data);
213
214   if (~data & 0x02)
215   {
216      portA_in = from_main;
217      if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
218      main_sent = 0;
219   }
220
221   if (~data & 0x04)
222   {
223      /* 68705 is writing data for the Z80 */
224      from_mcu = portA_out;
225      mcu_sent = 1;
226   }
227
228   if(data != 0xff && data != 0xfb && data != 0xfd)
229      printf("portB_w = %X\n",data);
230
231   portB_out = data;
232}
233
234static WRITE8_HANDLER( bking3_68705_ddrB_w )
235{
236   ddrB = data;
237}
238
239static READ8_HANDLER( bking3_68705_portC_r )
240{
241   int portC_in = 0;
242   if (main_sent) portC_in |= 0x01;
243   if (!mcu_sent) portC_in |= 0x02;
244//logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),portC_in);
245   return portC_in;
246}
247#endif
248static ADDRESS_MAP_START( m68705_map, ADDRESS_SPACE_PROGRAM, 8 )
249   ADDRESS_MAP_FLAGS( AMEF_ABITS(11) )
250   AM_RANGE(0x0000, 0x0000) AM_READWRITE(buggychl_68705_portA_r, buggychl_68705_portA_w)
251   AM_RANGE(0x0001, 0x0001) AM_READWRITE(buggychl_68705_portB_r, buggychl_68705_portB_w)
252   AM_RANGE(0x0002, 0x0002) AM_READWRITE(buggychl_68705_portC_r, buggychl_68705_portC_w)
253   AM_RANGE(0x0004, 0x0004) AM_WRITE(buggychl_68705_ddrA_w)
254   AM_RANGE(0x0005, 0x0005) AM_WRITE(buggychl_68705_ddrB_w)
255   AM_RANGE(0x0006, 0x0006) AM_WRITE(buggychl_68705_ddrC_w)
256   AM_RANGE(0x0010, 0x007f) AM_RAM
257   AM_RANGE(0x0080, 0x07ff) AM_ROM
258ADDRESS_MAP_END
259
260static INPUT_PORTS_START( bking )
261   PORT_START  /* IN0 */
262   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
263   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
264   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
265
266   PORT_START  /* IN1 */
267   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
268   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
269   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) /* Continue 1 */
270   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) /* Continue 2 */
271   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
272   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
273   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) /* Not Connected */
274
275   PORT_START_TAG("DSWA")  /* IN2 - DIP Switch A */
276   PORT_DIPNAME( 0x01, 0x00, "Holes Awarded" ) PORT_DIPLOCATION("SWA:1")
277   PORT_DIPSETTING(    0x00, "Par Play: 0 Holes/Birdie: 1 Hole/Eagle: 2 Holes/Double Eagle: 4 Holes" )
278   PORT_DIPSETTING(    0x01, "Par Play: 1 Hole/Birdie: 2 Holes/Eagle: 3 Holes/Double Eagle: 4 Holes" )
279   PORT_DIPNAME( 0x02, 0x02, "Holes Awarded For Hole-in-One" ) PORT_DIPLOCATION("SWA:2")
280   PORT_DIPSETTING(    0x00, "3 Holes" )
281   PORT_DIPSETTING(    0x02, "9 Holes" )
282   PORT_DIPNAME( 0x04, 0x04, DEF_STR(Free_Play) ) PORT_DIPLOCATION("SWA:3")
283   PORT_DIPSETTING(    0x04, DEF_STR(Off))
284   PORT_DIPSETTING(    0x00, DEF_STR(On))
285   PORT_DIPNAME( 0x18, 0x18, "Holes Per Play" ) PORT_DIPLOCATION("SWA:4,5")
286   PORT_DIPSETTING(    0x18, "3" )
287   PORT_DIPSETTING(    0x08, "4" )
288   PORT_DIPSETTING(    0x10, "5" )
289   PORT_DIPSETTING(    0x00, "9" )
290   PORT_DIPNAME( 0x20, 0x20, "Self Test" ) PORT_DIPLOCATION("SWA:6")
291   PORT_DIPSETTING(    0x20, DEF_STR(Off))
292   PORT_DIPSETTING(    0x00, DEF_STR(On))
293   PORT_DIPNAME( 0x40, 0x40, DEF_STR(Flip_Screen) ) PORT_DIPLOCATION("SWA:7")
294   PORT_DIPSETTING(    0x40, DEF_STR(Off))
295   PORT_DIPSETTING(    0x00, DEF_STR(On))
296   PORT_DIPNAME( 0x80, 0x00, DEF_STR(Cabinet) ) PORT_DIPLOCATION("SWA:8")
297   PORT_DIPSETTING(    0x00, DEF_STR(Upright) )
298   PORT_DIPSETTING(    0x80, DEF_STR(Cocktail) )
299
300   PORT_START_TAG("DSWB")  /* IN3 - DIP Switch B */
301   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWB:1,2,3,4")
302   PORT_DIPSETTING(    0x0f, DEF_STR( 9C_1C ) )
303   PORT_DIPSETTING(    0x0e, DEF_STR( 8C_1C ) )
304   PORT_DIPSETTING(    0x0d, DEF_STR( 7C_1C ) )
305   PORT_DIPSETTING(    0x0c, DEF_STR( 6C_1C ) )
306   PORT_DIPSETTING(    0x0b, DEF_STR( 5C_1C ) )
307   PORT_DIPSETTING(    0x0a, DEF_STR( 4C_1C ) )
308   PORT_DIPSETTING(    0x09, DEF_STR( 3C_1C ) )
309   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
310   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
311   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
312   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
313   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
314   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
315   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
316   PORT_DIPSETTING(    0x06, DEF_STR( 1C_7C ) )
317   PORT_DIPSETTING(    0x07, DEF_STR( 1C_8C ) )
318   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWB:5,6,7,8")
319   PORT_DIPSETTING(    0xf0, DEF_STR( 9C_1C ) )
320   PORT_DIPSETTING(    0xe0, DEF_STR( 8C_1C ) )
321   PORT_DIPSETTING(    0xd0, DEF_STR( 7C_1C ) )
322   PORT_DIPSETTING(    0xc0, DEF_STR( 6C_1C ) )
323   PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) )
324   PORT_DIPSETTING(    0xa0, DEF_STR( 4C_1C ) )
325   PORT_DIPSETTING(    0x90, DEF_STR( 3C_1C ) )
326   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
327   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
328   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
329   PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
330   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
331   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
332   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
333   PORT_DIPSETTING(    0x60, DEF_STR( 1C_7C ) )
334   PORT_DIPSETTING(    0x70, DEF_STR( 1C_8C ) )
335
336   PORT_START_TAG("DSWC")  /* IN4 - DIP Switch C */
337   PORT_DIPNAME( 0x01, 0x01, "Appearance of Crow" ) PORT_DIPLOCATION("SWC:1")
338   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
339   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
340   PORT_DIPNAME( 0x06, 0x02, "Crow Flight Pattern" ) PORT_DIPLOCATION("SWC:2,3") /* "The hole from which a crow appears and flys with drawing a circle or a 8-shape in the air." */
341   PORT_DIPSETTING(    0x00, "1" ) /* Circle 1,7,11,15,18 / 8-shape 3,5,9,13,17 */
342   PORT_DIPSETTING(    0x02, "2" ) /* Circle 1,10,16,18 / 8-shape 4,7,13,17 */
343   PORT_DIPSETTING(    0x04, "3" ) /* Circle 4,7,13,18 / 8-shape 1,10,16,17 */
344   PORT_DIPSETTING(    0x06, "4" ) /* Circle 3,5,9,13,18 / 8-shape 1,7,11,15,17 */
345   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SWC:4" ) /* Listed as "Unused" */
346   PORT_DIPNAME( 0x10, 0x10, "Coin Display" ) PORT_DIPLOCATION("SWC:5")
347   PORT_DIPSETTING(    0x00, DEF_STR(Off))
348   PORT_DIPSETTING(    0x10, DEF_STR(On))
349   PORT_DIPNAME( 0x20, 0x20, "Year Display" ) PORT_DIPLOCATION("SWC:6")
350   PORT_DIPSETTING(    0x00, DEF_STR(Off))
351   PORT_DIPSETTING(    0x20, DEF_STR(On))
352   PORT_DIPNAME( 0x40, 0x40, "Check" ) PORT_DIPLOCATION("SWC:7")
353   PORT_DIPSETTING(    0x00, "Check" )
354   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
355   PORT_DIPNAME( 0x80, 0x00, "Coin System" ) PORT_DIPLOCATION("SWC:8") /* Default is "1 Way" according to manual */
356   PORT_DIPSETTING(    0x00, "1 Way" )
357   PORT_DIPSETTING(    0x80, "2 Way" )
358
359   PORT_START  /* IN5 */
360   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) /* Sensitivity, clip, min, max */
361
362   PORT_START  /* IN6 */
363   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_REVERSE /* Sensitivity, clip, min, max */
364
365   PORT_START  /* IN7 */
366   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_COCKTAIL /* Sensitivity, clip, min, max */
367
368   PORT_START  /* IN8 */
369   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_REVERSE PORT_COCKTAIL /* Sensitivity, clip, min, max */
370INPUT_PORTS_END
371
372static INPUT_PORTS_START( bking2 )
373   PORT_INCLUDE( bking )
374
375   PORT_MODIFY("DSWA")
376   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SWA:6" ) /* Listed as "Unused" */
377INPUT_PORTS_END
378
379static const gfx_layout charlayout =
380{
381   8,8,    /* 8*8 characters */
382   1024,   /* 1024 characters */
383   3,      /* 3 bits per pixel */
384   { 0*1024*8*8, 1*1024*8*8, 2*1024*8*8 }, /* the bitplanes are separated */
385   { 7, 6, 5, 4, 3, 2, 1, 0 }, /* reverse layout */
386   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
387   8*8     /* every char takes 8 consecutive bytes */
388};
389
390static const gfx_layout crowlayout =
391{
392   16,32,   /* 16*32 characters */
393   16,      /* 16 characters */
394   2,      /* 2 bits per pixel */
395   { 0, 4 },
396   { 3*32*8+3, 3*32*8+2, 3*32*8+1, 3*32*8+0,
397     2*32*8+3, 2*32*8+2, 2*32*8+1, 2*32*8+0,
398       32*8+3,   32*8+2,   32*8+1,   32*8+0,
399           3,        2,        1,        0 }, /* reverse layout */
400   { 31*8, 30*8, 29*8, 28*8, 27*8, 26*8, 25*8, 24*8,
401     23*8, 22*8, 21*8, 20*8, 19*8, 18*8, 17*8, 16*8,
402     15*8, 14*8, 13*8, 12*8, 11*8, 10*8,  9*8,  8*8,
403      7*8,  6*8,  5*8,  4*8,  3*8,  2*8,  1*8,  0*8 },
404   128*8    /* every sprite takes 128 consecutive bytes */
405};
406
407static const gfx_layout balllayout =
408{
409   8,16,  /* 8*16 sprites */
410   8,     /* 8 sprites */
411   1,  /* 1 bit per pixel */
412   { 0 },
413   { 7, 6, 5, 4, 3, 2, 1, 0 },   /* pretty straightforward layout */
414   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
415     8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
416   16*8    /* every sprite takes 16 consecutive bytes */
417};
418
419static GFXDECODE_START( bking )
420   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0,           4  ) /* playfield */
421   GFXDECODE_ENTRY( REGION_GFX2, 0, crowlayout, 4*8,         4  ) /* crow */
422   GFXDECODE_ENTRY( REGION_GFX3, 0, balllayout, 4*8+4*4,     4  ) /* ball 1 */
423   GFXDECODE_ENTRY( REGION_GFX4, 0, balllayout, 4*8+4*4+4*2, 4  ) /* ball 2 */
424GFXDECODE_END
425
426
427static WRITE8_HANDLER( portb_w )
428{
429   /* don't know what this is... could be a filter */
430   if (data != 0x00) logerror("portB = %02x\n",data);
431}
432
433static const struct AY8910interface ay8910_interface =
434{
435   0,
436   0,
437   DAC_0_signed_data_w,
438   portb_w
439};
440
441static MACHINE_DRIVER_START( bking )
442
443   /* basic machine hardware */
444   MDRV_CPU_ADD_TAG("main_cpu", Z80, XTAL_12MHz/4)   /* 3 MHz */
445   MDRV_CPU_PROGRAM_MAP(bking_map,0)
446   MDRV_CPU_IO_MAP(bking_io_map,0)
447   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
448
449   MDRV_CPU_ADD(Z80, XTAL_6MHz/2)   /* 3 MHz */
450   /* audio CPU */
451   MDRV_CPU_PROGRAM_MAP(bking_audio_map,0)
452   /* interrupts (from Jungle King hardware, might be wrong): */
453   /* - no interrupts synced with vblank */
454   /* - NMI triggered by the main CPU */
455   /* - periodic IRQ, with frequency 6000000/(4*16*16*10*16) = 36.621 Hz, */
456   MDRV_CPU_PERIODIC_INT(irq0_line_hold, (double)6000000/(4*16*16*10*16))
457
458   MDRV_SCREEN_REFRESH_RATE(60)
459   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
460
461   /* video hardware */
462   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
463   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
464   MDRV_SCREEN_SIZE(32*8, 32*8)
465   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
466   MDRV_GFXDECODE(bking)
467   MDRV_PALETTE_LENGTH(4*8+4*4+4*2+4*2)
468
469   MDRV_PALETTE_INIT(bking)
470   MDRV_VIDEO_START(bking)
471   MDRV_VIDEO_UPDATE(bking)
472   MDRV_VIDEO_EOF(bking)
473
474   /* sound hardware */
475   MDRV_SPEAKER_STANDARD_MONO("mono")
476
477   MDRV_SOUND_ADD(AY8910, XTAL_6MHz/4)
478   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
479
480   MDRV_SOUND_ADD(AY8910, XTAL_6MHz/4)
481   MDRV_SOUND_CONFIG(ay8910_interface)
482   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
483
484   MDRV_SOUND_ADD(DAC, 0)
485   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
486MACHINE_DRIVER_END
487
488static MACHINE_DRIVER_START( bking3 )
489   MDRV_IMPORT_FROM(bking)
490
491   MDRV_CPU_MODIFY("main_cpu")
492   MDRV_CPU_IO_MAP(bking3_io_map,0)
493
494   MDRV_CPU_ADD(M68705, XTAL_3MHz)      /* xtal is 3MHz, divided by 4 internally */
495   MDRV_CPU_PROGRAM_MAP(m68705_map,0)
496
497   MDRV_MACHINE_RESET(buggychl)
498
499   MDRV_INTERLEAVE(100)
500MACHINE_DRIVER_END
501
502/***************************************************************************
503
504  Game driver(s)
505
506***************************************************************************/
507
508ROM_START( bking )
509   ROM_REGION( 0x10000, REGION_CPU1, 0 )
510   ROM_LOAD( "dm_11.f13", 0x0000, 0x1000, CRC(d84fe4f7) SHA1(3ad1641d05e4faca2be28052ccae8f81bc2255bb) )
511   ROM_LOAD( "dm_12.f11", 0x1000, 0x1000, CRC(e065bbe6) SHA1(8d6d3334977c1eea1bf238817d59c25acd9d99f0) )
512   ROM_LOAD( "dm_13.f10", 0x2000, 0x1000, CRC(aac7cddd) SHA1(12a8887bd8d3334e0d740a7f54374b0e48021140) )
513   ROM_LOAD( "dm_14.f8",  0x3000, 0x1000, CRC(1179d074) SHA1(23df9a7e3e1bf42d6ea3a2d85629d27bd68e9af4) )
514   ROM_LOAD( "dm_15.f7",  0x4000, 0x1000, CRC(fda31475) SHA1(784ffa089b7bd4ab4cbd454f4c1c26553a11fc48) )
515   ROM_LOAD( "dm_16.f5",  0x5000, 0x1000, CRC(b6c3c3ed) SHA1(6c7f67d5eba35e32b556b531e848ef375123de78) )
516
517   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound ROMs */
518   ROM_LOAD( "dm_17.f4",  0x0000, 0x1000, CRC(54840bc3) SHA1(225daf7ff8a4095b0e69ce6ccce6d8eab26ec1c8) )
519   ROM_LOAD( "dm_18.d4",  0x1000, 0x1000, CRC(2abadd42) SHA1(d921d333ec9b9140a7d3ce7aaddab35f45fae018) )
520
521   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
522   ROM_LOAD( "dm_10.a5",  0x0000, 0x1000, CRC(fe96dd67) SHA1(11014602f926cf6edbf06e7b2acef92036b2f30a) )
523   ROM_LOAD( "dm_09.a7",  0x1000, 0x1000, CRC(80c675d7) SHA1(e590a71a15ea485abf099eceaa16d5a1dbe0c3dc) )
524   ROM_LOAD( "dm_08.a8",  0x2000, 0x1000, CRC(d9bd6b60) SHA1(3c790b6a69472e0a37f45baa00ce5c7d09e7b588) )
525   ROM_LOAD( "dm_07.a10", 0x3000, 0x1000, CRC(65f7a0e4) SHA1(034dbf2fe384cb69963936e9f3029aa54e032e4a) )
526   ROM_LOAD( "dm_06.a11", 0x4000, 0x1000, CRC(00fdbafc) SHA1(b2a8d9c96415fecee52f1c4691a5f10c96f484b1) )
527   ROM_LOAD( "dm_05.a13", 0x5000, 0x1000, CRC(3e4fe925) SHA1(9ed73601c8b34ea8889717cbb3ee4a00ab7ab458) )
528
529   ROM_REGION( 0x0800, REGION_GFX2, ROMREGION_DISPOSE )
530   ROM_LOAD( "dm_01.e10", 0x0000, 0x0800, CRC(e5663f0b) SHA1(b0fed8c4cdff7b12bb220e51d5b7188933934a34) ) /* crow graphics */
531
532   ROM_REGION( 0x0800, REGION_GFX3, ROMREGION_DISPOSE )
533   ROM_LOAD( "dm_02.e7",  0x0000, 0x0800, CRC(fc9cec31) SHA1(5ab1c9b3b15334c6ec06826005ecb66b34d8879a) ) /* ball 1 graphics. Only the first 128 bytes used */
534
535   ROM_REGION( 0x0800, REGION_GFX4, ROMREGION_DISPOSE )
536   ROM_LOAD( "dm_02.e9",  0x0000, 0x0800, CRC(fc9cec31) SHA1(5ab1c9b3b15334c6ec06826005ecb66b34d8879a) ) /* ball 2 graphics. Only the first 128 bytes used */
537
538   ROM_REGION( 0x0020, REGION_USER1, 0 )
539   ROM_LOAD( "dm04.c2",   0x0000, 0x0020, CRC(4cb5bd32) SHA1(8851bae033ba67516d5ff6888e5daef10c2116ee) )  /* collision detection */
540
541   ROM_REGION( 0x0200, REGION_PROMS, 0 )
542   ROM_LOAD( "dm_03.d1",  0x0000, 0x0200, CRC(61b7a9ff) SHA1(4302de0c0dad2b871ad4719ad934beaee05a0c40) ) /* palette */
543ROM_END
544
545ROM_START( bking2 )
546   ROM_REGION( 0x10000, REGION_CPU1, 0 )
547   ROM_LOAD( "01.13f",       0x0000, 0x1000, CRC(078ada3f) SHA1(5e82a6d27c65fe29d664dbfc2ede547c0f4869f0) )
548   ROM_LOAD( "02.11f",       0x1000, 0x1000, CRC(c37d110a) SHA1(7aec6c949d1cf136c3037140bd86597feaf29108) )
549   ROM_LOAD( "03.10f",       0x2000, 0x1000, CRC(2ba5c681) SHA1(d0df24f5e52e6162b40308d8aa38b0348a100f37) )
550   ROM_LOAD( "04.8f",        0x3000, 0x1000, CRC(8fad54e8) SHA1(55edc185914686d42efd848a402f78884d42292b) )
551   ROM_LOAD( "05.7f",        0x4000, 0x1000, CRC(b4de6b58) SHA1(f62bdc3128b226454b1f00a4cbe382e1219a11b0) )
552   ROM_LOAD( "06.5f",        0x5000, 0x1000, CRC(9ac43b87) SHA1(dd562fee01c81317978d1bd8a0178e3d9be6145a) )
553   ROM_LOAD( "07.4f",        0x6000, 0x1000, CRC(b3ed40b7) SHA1(d481094c0381234314f797928e3cdb22f36f4e32) )
554   ROM_LOAD( "08.2f",        0x7000, 0x1000, CRC(8fddb2e8) SHA1(6ee5f09d154440851f370a97b35450e3726e14e7) )
555
556   ROM_REGION( 0x10000, REGION_CPU2, 0 )         /* Sound ROMs */
557   ROM_LOAD( "15",           0x0000, 0x1000, CRC(f045d0fe) SHA1(3b34081fa6cd0423236d09b6f23e8cf8cfd627c5) )
558   ROM_LOAD( "16",           0x1000, 0x1000, CRC(92d50410) SHA1(e6f4c27031744bbc832a1eb121a7dba4da5286c4) )
559
560   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
561   ROM_LOAD( "14.5a",        0x0000, 0x1000, CRC(52636a94) SHA1(185c4455bd9bb23d14aa2f6f7baa74959da08fc2) )
562   ROM_LOAD( "13.7a",        0x1000, 0x1000, CRC(6b9e0564) SHA1(6cdd3820caa3825e98b61fe260960cc05c04d032) )
563   ROM_LOAD( "12.8a",        0x2000, 0x1000, CRC(c6d685d9) SHA1(2dd2fda365e6bdf9aa26de90650f4a2588ea0515) )
564   ROM_LOAD( "11.10a",       0x3000, 0x1000, CRC(2b949987) SHA1(a94666c4f2fdc25399f7976ed2c25fd454387be6) )
565   ROM_LOAD( "10.11a",       0x4000, 0x1000, CRC(eb96f948) SHA1(295ba5a620a8a85a121d3e823804adceeeef64d9) )
566   ROM_LOAD( "09.13a",       0x5000, 0x1000, CRC(595e3dd4) SHA1(9dd3388ce704dd5473af034716cd8d48df3dc495) )
567
568   ROM_REGION( 0x0800, REGION_GFX2, ROMREGION_DISPOSE )
569   ROM_LOAD( "17",           0x0000, 0x0800, CRC(e5663f0b) SHA1(b0fed8c4cdff7b12bb220e51d5b7188933934a34) )   /* crow graphics */
570
571   ROM_REGION( 0x0800, REGION_GFX3, ROMREGION_DISPOSE )
572   ROM_LOAD( "18",           0x0000, 0x0800, CRC(fc9cec31) SHA1(5ab1c9b3b15334c6ec06826005ecb66b34d8879a) )   /* ball 1 graphics. Only the first 128 bytes used */
573
574   ROM_REGION( 0x0800, REGION_GFX4, ROMREGION_DISPOSE )
575   ROM_LOAD( "19",           0x0000, 0x0800, CRC(fc9cec31) SHA1(5ab1c9b3b15334c6ec06826005ecb66b34d8879a) )  /* ball 2 graphics. Only the first 128 bytes used */
576
577   ROM_REGION( 0x0020, REGION_USER1, 0 )
578   ROM_LOAD( "mb7051.2c",    0x0000, 0x0020, CRC(4cb5bd32) SHA1(8851bae033ba67516d5ff6888e5daef10c2116ee) )  /* collision detection */
579
580   ROM_REGION( 0x0200, REGION_PROMS, 0 )
581   ROM_LOAD( "82s141.2d",    0x0000, 0x0200, CRC(61b7a9ff) SHA1(4302de0c0dad2b871ad4719ad934beaee05a0c40) )   /* palette */
582
583   ROM_REGION( 0x0600, REGION_PLDS, ROMREGION_DISPOSE )
584   ROM_LOAD( "pal16l8.1",  0x0000, 0x0104, CRC(e75d19f5) SHA1(d51cbb247760312b8884bbd0478a321eee05034f) )
585   ROM_LOAD( "pal16l8.2",  0x0200, 0x0104, CRC(0302b683) SHA1(91bfba22c883adb15309d9ec0c42b5b744887c77) )
586   ROM_LOAD( "pal16l8.3",  0x0400, 0x0104, CRC(a609d0cf) SHA1(7a18040720646c2dff4c1dc6f272c6a69e538c47) )
587ROM_END
588
589/*
590Birdie King 3
591Taito, 1984
592
593A golf game using a trackball. Uses same harness/pinout as
594Elevator Action, Victorious Nine, Jolly Jogger (etc)
595
596PCB Layouts
597(Note! There are no PALs on ANY of the PCBs)
598
599Top PCB
600-------
601DMO70003A
602K1000173B (sticker)
603 |------------------------|
604 |                        |
605|-|                       |
606| |  Z80        2114      |
607| |             2114      |
608| |N                      |
609| |  A24_18.4F            |
610| |      A24_19.4D        |
611|-|           A24_20.4B   |
612 |                        |
613 |  AY3-8910              |
614 |                        |
615 |      AY3-8910          |
616 |                        |
617 |                        |
618 |                   6MHz |
619 |                        |
620 |                        |
621 |                        |
622 | LM3900  LM3900  LM3900 |
623 |------------------------|
624Notes:
625      Z80      - Clock 3.000MHz [6/2]
626      AY3-8910 - Clock 1.500MHz [6/4]
627      2114     - 1kx4 SRAM (DIP18)
628      N        - Flat cable connector, joins to main board
629      LM3900   - National LM3900 Quad, dual-input amplifier IC (DIP14)
630      plus many resistors/capacitors below the AY3-8910's
631
632
633Sub PCB (below Top PCB)
634-----------------------
635SUB PCB J910 0010 A
636        K910 0018 A
637|------------------------|
638|           *            |
639|                        |
640|                        |
641|                        |
642|                        |
643|                        |
644|                        |
645|                        |
646|                        |
647|                        |
648|                        |
649|                        |
650|                        |
651|A24_21.IC25             |
652|                        |
653|                   S2   |
654|                        |
655|         3MHz         S1|
656|T    A24_22.IC17        |
657|------------------------|
658Notes:
659      A24_22.IC17 - Motorola 68705P5 Microcontroller, clock 3.000MHz
660      A24_21.IC25 - 2732 EPROM
661      *           - DIP24 socket with flat cable below PCB, joins to main board
662      T           - 4-pin power connector (5 volts) coming from main board
663      S1          - Flat cable connector, joins to main PCB to connector S
664      S2          - Flat cable connector, joins to bottom PCB to connector S
665
666
667
668Main PCB
669--------
670J1100001A
671K1100001A
672M4300001D (sticker)
673K1100032A (sticker)
674|--------------------------------------------------------------|
675|      M3712    VOL             A24_03.2D             M53354   |
676|H                                        DM-04.2C            |-|
677|                     N                                  *    | |
678|           MC14584                                          R| |
679|                                                             | |
680|                                                             | |
681|                                                             | |
682|                                                             |-|
683|                                                              |
684|G          LM3900                                             |
685|    MC14093                                                   |
686|                   A24_01.7E                                 |-|
687|                                                             | |
688|                   A24_01.9E                                 | |
689|    MC14584                                                 S| |
690|                   A24_02.10E                                | |
691|    MC14584                    MC1455                        | |
692|                                                             |-|
693|    DSWC   DSWB   DSWA                                        |
694|--------------------------------------------------------------|
695Notes:
696      M53354    - ?, maybe 74LS154? (DIP24)
697      MC1455    - Motorola MC1455 Monolithic Timing Circuit (NE555 compatible)
698      A24_01/02 - 2716 EPROMs
699      A24_03    - Signetics 82S141 PROM (DIP24)
700      DM-04     - Signetics 82S123 PROM (DIP8)
701      *         - DIP24 socket with flat cable, joins to SUB PCB DIP24 socket
702      R/S       - Flat cable connector, R joins to main board, S joins to SUB PCB
703      G         - 22-way Edge Connector
704      N         - Flat cable connector, joins to TOP PCB
705      H         - 12-pin power connector
706      VSync     - 60Hz
707      HSync     - 15.67kHz
708
709
710Bottom PCB
711----------
712DMO70002A
713DMN00002A
714K1000172B (sticker)
715|--------------------------------------------------------------|
716|   A24_17.13A         2114    Z80             A24_04.13F      |
717|                                                             |-|
718|   A24_16.11A         2114                    A24_05.11F     | |
719|                                                            S| |
720|   A24_15.10A                                 A24_06.10F     | |
721|                                                             | |
722|   A24_14.8A                                  A24_07.8F      | |
723|                                                             |-|
724|T  A24_13.7A                                  A24_08.7F       |
725|                                                              |
726|   A24_12.5A                                  A24_09.5F       |
727|                                                             |-|
728|                                              A24_10.4F      | |
729|            2114                                             | |
730|                                              A24_11.2F     R| |
731|            2114                                             | |
732|                                                             | |
733|            2114                                             |-|
734|                                                    12MHz     |
735|--------------------------------------------------------------|
736Notes:
737      R/S   - Flat cable connector, R joins to main board, S joins to SUB PCB
738      T     - 18-Way Edge Connector (for +5V/GND only)
739      A24_* - 2732 EPROMs
740      Z80   - Clock 3.000MHz [12/4]
741      2114  - 1kx4 SRAM (DIP18)
742*/
743
744ROM_START( bking3 )
745   ROM_REGION( 0x10000, REGION_CPU1, 0 )
746   ROM_LOAD( "a24-04.13f",   0x0000, 0x1000, CRC(a0c319a6) SHA1(6b79667288113fde43975fcfd05e93d8e45bf92d) )
747   ROM_LOAD( "a24-05.11f",   0x1000, 0x1000, CRC(fedc9b4a) SHA1(3ac22c3ca09df9983f3c8c05e807ecf5999c9fc5) )
748   ROM_LOAD( "a24-06.10f",   0x2000, 0x1000, CRC(6a116ebf) SHA1(e58b1f75eb75027749a900b27107930e9072ca5a) )
749   ROM_LOAD( "a24-07.8f",    0x3000, 0x1000, CRC(75a74d2d) SHA1(d433e8fcf3819b845936e7e107fef414f72bfc16) )
750   ROM_LOAD( "a24-08.7f",    0x4000, 0x1000, CRC(9fe07cf9) SHA1(23fdae48e519a171bf4adeeadf2fdfedfd56f4ea) )
751   ROM_LOAD( "a24-09.5f",    0x5000, 0x1000, CRC(51545ced) SHA1(4addad527c6fd675506bf584ec8670a23767787c) )
752   ROM_LOAD( "a24-10.4f",    0x6000, 0x1000, CRC(a86b3e62) SHA1(f97a13e31e622b5ac55c23458c65a49c2998196a) )
753   ROM_LOAD( "a24-11.2f",    0x7000, 0x1000, CRC(b39db430) SHA1(4f48a34f3aaa1e998a4a5656bc3f399d9e6633c4) )
754
755   ROM_REGION( 0x10000, REGION_CPU2, 0 )      /* Sound ROMs */
756   ROM_LOAD( "a24-18.4f",    0x0000, 0x1000, CRC(fa3bfa98) SHA1(733924e154e301a9d692d80b485afc4ab0e200c1) )
757   ROM_LOAD( "a24-19.4d",    0x1000, 0x1000, CRC(817f9c2a) SHA1(7365ecf2700e1fd13016408f5493f8d51aab5bbd) )
758   ROM_LOAD( "a24-20.4b",    0x2000, 0x1000, CRC(0e9e16d6) SHA1(43c69602a8d9c34c527ce54472db84168acc4ef4) )
759
760   ROM_REGION( 0x0800, REGION_CPU3, 0 )   /* 2k for the microcontroller */
761   ROM_LOAD( "a24_22.ic17",  0x000000, 0x000800, CRC(27c497d5) SHA1(c6c72bbf0537da53148fa0a56d412ab46129d29c) )  //M68705P5S uC 3MHz xtal
762
763   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE ) /* Tiles */
764   ROM_LOAD( "a24-12.5a",    0x0000, 0x1000, CRC(c5fe4817) SHA1(fbf82d9d85e18b76c7e939932df074a545e73f42) )
765   ROM_LOAD( "a24-13.7a",    0x1000, 0x1000, CRC(728bac57) SHA1(3daa246f95b31c971e5418f55b821616d0bce25d) )
766   ROM_LOAD( "a24-14.8a",    0x2000, 0x1000, CRC(63cd0009) SHA1(10fcfeec70b23e2206c4f4bf686dc6a48ecba1ce) )
767   ROM_LOAD( "a24-15.10a",   0x3000, 0x1000, CRC(590275d0) SHA1(563bebb344c606ca3a2124fc7a8804935a011e90) )
768   ROM_LOAD( "a24-16.11a",   0x4000, 0x1000, CRC(728d069e) SHA1(b4adb14281e4874bab7cec7f38ade70b5b7c6b8f) )
769   ROM_LOAD( "a24-17.13a",   0x5000, 0x1000, CRC(4c04c4f2) SHA1(8e9eee6d89e91910b398d42ac86597ef91baad96) )
770
771   ROM_REGION( 0x0800, REGION_GFX2, ROMREGION_DISPOSE )
772   ROM_LOAD( "a24-02.10e",   0x0000, 0x0800, CRC(8560da46) SHA1(56f249f0b56336daac1a3624ef9b71354bb8ca40) ) /* crow graphics */
773
774   ROM_REGION( 0x0800, REGION_GFX3, ROMREGION_DISPOSE )
775   ROM_LOAD( "a24-01.7e",    0x0000, 0x0800, CRC(369c01e1) SHA1(196e12d0bcaf74cefe4cad3fccb69d104aab061e) ) /* ball 1 graphics. Only the first 128 bytes used */
776
777   ROM_REGION( 0x0800, REGION_GFX4, ROMREGION_DISPOSE )
778   ROM_LOAD( "a24-01.9e",    0x0000, 0x0800, CRC(369c01e1) SHA1(196e12d0bcaf74cefe4cad3fccb69d104aab061e) ) /* ball 2 graphics. Only the first 128 bytes used */
779
780   ROM_REGION( 0x0020, REGION_USER1, 0 )
781   ROM_LOAD( "82s123.2c",    0x0000, 0x0020, CRC(4cb5bd32) SHA1(8851bae033ba67516d5ff6888e5daef10c2116ee) ) /* collision detection */
782
783   ROM_REGION( 0x0200, REGION_PROMS, 0 )
784   ROM_LOAD( "a24_03.2d",    0x0000, 0x0200, CRC(599a6cbe) SHA1(eed8592aaba7b2b6d06f26a2b8720a288f9ad90f) )   /* palette */
785
786   ROM_REGION( 0x1000, REGION_USER2, 0 )
787   ROM_LOAD( "a24-21.25",    0x0000, 0x1000, CRC(3106fcac) SHA1(08454adfb58e5df84140d86ed52fa4ef684df9f1) ) /* extra rom on the same SUB PCB where is the mcu */
788ROM_END
789
790GAME( 1982, bking,  0, bking,  bking,  0, ROT270, "Taito Corporation", "Birdie King", 0 )
791GAME( 1983, bking2, 0, bking,  bking2, 0, ROT90,  "Taito Corporation", "Birdie King 2", 0 )
792GAME( 1984, bking3, 0, bking3, bking2, 0, ROT90,  "Taito Corporation", "Birdie King 3", 0 )
src/mame/drivers/battlnts.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "cpu/hd6309/hd6309.h"
1516#include "cpu/z80/z80.h"
1617#include "video/konamiic.h"
src/mame/drivers/dblewing.c
r1649r1650
1010*/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/m68000/m68000.h"
1415#include "decocrpt.h"
1516#include "deco16ic.h"
src/mame/drivers/galpani2.c
r1649r1650
2222***************************************************************************/
2323
2424#include "driver.h"
25#include "deprecat.h"
2526#include "machine/eeprom.h"
2627#include "kaneko16.h"
2728#include "sound/okim6295.h"
r1649r1650
217218}
218219
219220
220static ADDRESS_MAP_START( galpani2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
221   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM               )   // ROM
222   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_RAM               )   // Work RAM
223   AM_RANGE(0x300000, 0x301fff) AM_READ(MRA16_RAM               )   // ?
224   AM_RANGE(0x302000, 0x303fff) AM_READ(MRA16_RAM               )   // Sprites
225   AM_RANGE(0x304000, 0x30401f) AM_READ(MRA16_RAM               )   // Sprites Regs
226   AM_RANGE(0x310000, 0x3101ff) AM_READ(MRA16_RAM               )   // Background Palette
227   AM_RANGE(0x318000, 0x318001) AM_READ(galpani2_eeprom_r         )   // EEPROM
228   AM_RANGE(0x380000, 0x38ffff) AM_READ(MRA16_RAM               )   // ? + Sprites Palette
229   AM_RANGE(0x400000, 0x43ffff) AM_READ(MRA16_RAM               )   // Background 0
230   AM_RANGE(0x440000, 0x440001) AM_READ(MRA16_RAM               )   // Background 0 Scroll X
231   AM_RANGE(0x480000, 0x480001) AM_READ(MRA16_RAM               )   // Background 0 Scroll Y
232   AM_RANGE(0x500000, 0x53ffff) AM_READ(MRA16_RAM               )   // Background 1
233   AM_RANGE(0x540000, 0x540001) AM_READ(MRA16_RAM               )   // Background 1 Scroll X
234   AM_RANGE(0x580000, 0x580001) AM_READ(MRA16_RAM               )   // Background 1 Scroll Y
235   AM_RANGE(0x780000, 0x780001) AM_READ(input_port_0_word_r      )   // Input Ports
236   AM_RANGE(0x780002, 0x780003) AM_READ(input_port_1_word_r      )   //
237   AM_RANGE(0x780004, 0x780005) AM_READ(input_port_2_word_r      )   //
238   AM_RANGE(0x780006, 0x780007) AM_READ(input_port_3_word_r      )   //
239   AM_RANGE(0xc00000, 0xc00001) AM_READ(OKIM6295_status_0_lsb_r   )   // 2 x OKIM6295
240   AM_RANGE(0xc40000, 0xc40001) AM_READ(OKIM6295_status_1_lsb_r   )   //
241ADDRESS_MAP_END
242
243static ADDRESS_MAP_START( galpani2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
244   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(MWA16_ROM                        )   // ROM
245   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(MWA16_RAM) AM_BASE(&galpani2_ram            )   // Work RAM
246   AM_RANGE(0x300000, 0x301fff) AM_WRITE(MWA16_RAM                        )   // ?
247   AM_RANGE(0x302000, 0x303fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size         )   // Sprites
248   AM_RANGE(0x304000, 0x30401f) AM_WRITE(kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs   )   // Sprites Regs
221static ADDRESS_MAP_START( galpani2_mem1, ADDRESS_SPACE_PROGRAM, 16 )
222   AM_RANGE(0x000000, 0x0fffff) AM_ROM                                    // ROM
223   AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_BASE(&galpani2_ram            )      // Work RAM
224   AM_RANGE(0x300000, 0x301fff) AM_RAM                                    // ?
225   AM_RANGE(0x302000, 0x303fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
226   AM_RANGE(0x304000, 0x30401f) AM_READWRITE(MRA16_RAM, kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs   )   // Sprites Regs
227//  AM_RANGE(0x308000, 0x308001) AM_WRITE(MWA16_NOP                             )   // ? 0 at startup
249228   AM_RANGE(0x30c000, 0x30c001) AM_WRITE(MWA16_NOP                        )   // ? hblank effect ?
250   AM_RANGE(0x310000, 0x3101ff) AM_WRITE(galpani2_palette_0_w) AM_BASE(&galpani2_palette_0      )   // ?
229   AM_RANGE(0x310000, 0x3101ff) AM_READWRITE(MRA16_RAM, galpani2_palette_0_w) AM_BASE(&galpani2_palette_0   )   // ?
251230   AM_RANGE(0x314000, 0x314001) AM_WRITE(MWA16_NOP                        )   // ? flip backgrounds ?
252   AM_RANGE(0x318000, 0x318001) AM_WRITE(galpani2_eeprom_w                  )   // EEPROM
253   AM_RANGE(0x380000, 0x387fff) AM_WRITE(MWA16_RAM                        )   // Palette?
254   AM_RANGE(0x388000, 0x38ffff) AM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16   )   // Palette
255   AM_RANGE(0x400000, 0x43ffff) AM_WRITE(galpani2_bg8_0_w) AM_BASE(&galpani2_bg8_0      )   // Background 0
256   AM_RANGE(0x440000, 0x440001) AM_WRITE(MWA16_RAM) AM_BASE(&galpani2_bg8_0_scrollx   )   // Background 0 Scroll X
257   AM_RANGE(0x480000, 0x480001) AM_WRITE(MWA16_RAM) AM_BASE(&galpani2_bg8_0_scrolly   )   // Background 0 Scroll Y
231   AM_RANGE(0x318000, 0x318001) AM_READWRITE(galpani2_eeprom_r, galpani2_eeprom_w   )   // EEPROM
232   AM_RANGE(0x380000, 0x387fff) AM_RAM                                    // Palette?
233   AM_RANGE(0x388000, 0x38ffff) AM_READWRITE(MRA16_RAM, paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16   )   // Palette
234   AM_RANGE(0x400000, 0x43ffff) AM_READWRITE(MRA16_RAM, galpani2_bg8_0_w) AM_BASE(&galpani2_bg8_0   )   // Background 0
235   AM_RANGE(0x440000, 0x440001) AM_RAM AM_BASE(&galpani2_bg8_0_scrollx   )         // Background 0 Scroll X
236   AM_RANGE(0x480000, 0x480001) AM_RAM AM_BASE(&galpani2_bg8_0_scrolly   )         // Background 0 Scroll Y
258237   AM_RANGE(0x4c0000, 0x4c0001) AM_WRITE(MWA16_NOP                        )   // ? 0 at startup only
259   AM_RANGE(0x500000, 0x53ffff) AM_WRITE(galpani2_bg8_1_w) AM_BASE(&galpani2_bg8_1      )   // Background 1
260   AM_RANGE(0x540000, 0x540001) AM_WRITE(MWA16_RAM) AM_BASE(&galpani2_bg8_1_scrollx   )   // Background 1 Scroll X
261   AM_RANGE(0x580000, 0x580001) AM_WRITE(MWA16_RAM) AM_BASE(&galpani2_bg8_1_scrolly   )   // Background 1 Scroll Y
238   AM_RANGE(0x500000, 0x53ffff) AM_READWRITE(MRA16_RAM, galpani2_bg8_1_w) AM_BASE(&galpani2_bg8_1   )   // Background 1
239   AM_RANGE(0x540000, 0x540001) AM_RAM AM_BASE(&galpani2_bg8_1_scrollx   )         // Background 1 Scroll X
240   AM_RANGE(0x580000, 0x580001) AM_RAM AM_BASE(&galpani2_bg8_1_scrolly   )         // Background 1 Scroll Y
262241   AM_RANGE(0x5c0000, 0x5c0001) AM_WRITE(MWA16_NOP                        )   // ? 0 at startup only
263242   AM_RANGE(0x600000, 0x600001) AM_WRITE(MWA16_NOP                        )   // Watchdog
264243//  AM_RANGE(0x640000, 0x640001) AM_WRITE(MWA16_NOP                             )   // ? 0 before resetting and at startup
265//  AM_RANGE(0x680000, 0x680001) AM_WRITE(MWA16_NOP                             )   // ? 0 -> 1 -> 0 (lev 5) / 0 -> $10 -> 0
266AM_RANGE(0x680000, 0x680001) AM_WRITE(galpani2_mcu_nmi_w   )   // ? 0 -> 1 -> 0 (lev 5) / 0 -> $10 -> 0
244    AM_RANGE(0x680000, 0x680001) AM_WRITE(galpani2_mcu_nmi_w   )               // ? 0 -> 1 -> 0 (lev 5) / 0 -> $10 -> 0
267245   AM_RANGE(0x6c0000, 0x6c0001) AM_WRITE(galpani2_coin_lockout_w            )   // Coin + Card Lockout
268   AM_RANGE(0xc00000, 0xc00001) AM_WRITE(OKIM6295_data_0_lsb_w               )   // 2 x OKIM6295
269   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(OKIM6295_data_1_lsb_w               )   //
246   AM_RANGE(0x780000, 0x780001) AM_READ(input_port_0_word_r      )            // Input Ports
247   AM_RANGE(0x780002, 0x780003) AM_READ(input_port_1_word_r      )            //
248   AM_RANGE(0x780004, 0x780005) AM_READ(input_port_2_word_r      )            //
249   AM_RANGE(0x780006, 0x780007) AM_READ(input_port_3_word_r      )            //
250   AM_RANGE(0xc00000, 0xc00001) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w   )   // 2 x OKIM6295
251   AM_RANGE(0xc40000, 0xc40001) AM_READWRITE(OKIM6295_status_1_lsb_r, OKIM6295_data_1_lsb_w   )   //
270252   AM_RANGE(0xc80000, 0xc80001) AM_WRITE(galpani2_oki_0_bank_w               )   //
271253   AM_RANGE(0xcc0000, 0xcc0001) AM_WRITE(galpani2_oki_1_bank_w               )   //
272254ADDRESS_MAP_END
r1649r1650
293275   else            return 0xffff;
294276}
295277
296
297static ADDRESS_MAP_START( galpani2_readmem2, ADDRESS_SPACE_PROGRAM, 16 )
298   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM               )   // ROM
299   AM_RANGE(0x100000, 0x13ffff) AM_READ(MRA16_RAM               )   // Work RAM
300   AM_RANGE(0x400000, 0x4fffff) AM_READ(MRA16_RAM               )   // bg15
301   AM_RANGE(0x500000, 0x5fffff) AM_READ(MRA16_RAM               )   // bg15
302   AM_RANGE(0x800000, 0xffffff) AM_READ(galpani2_bankedrom_r      )   // Banked ROM
303ADDRESS_MAP_END
304
305static ADDRESS_MAP_START( galpani2_writemem2, ADDRESS_SPACE_PROGRAM, 16 )
306   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM                  )   // ROM
307   AM_RANGE(0x100000, 0x13ffff) AM_WRITE(MWA16_RAM) AM_BASE(&galpani2_ram2      )   // Work RAM
308   AM_RANGE(0x400000, 0x4fffff) AM_WRITE(galpani2_bg15_w) AM_BASE(&galpani2_bg15   )   // bg15
309   AM_RANGE(0x500000, 0x5fffff) AM_WRITE(MWA16_RAM                     )   // bg15
278static ADDRESS_MAP_START( galpani2_mem2, ADDRESS_SPACE_PROGRAM, 16 )
279   AM_RANGE(0x000000, 0x03ffff) AM_ROM                                                // ROM
280   AM_RANGE(0x100000, 0x13ffff) AM_RAM AM_BASE(&galpani2_ram2)                              // Work RAM
281   AM_RANGE(0x400000, 0x4fffff) AM_READWRITE(MRA16_RAM, galpani2_bg15_w) AM_BASE(&galpani2_bg15)   // bg15
282   AM_RANGE(0x500000, 0x5fffff) AM_RAM                                                // bg15
310283   AM_RANGE(0x600000, 0x600001) AM_WRITE(MWA16_NOP                  )   // ? 0 at startup only
311284   AM_RANGE(0x640000, 0x640001) AM_WRITE(MWA16_NOP                  )   // ? 0 at startup only
312285   AM_RANGE(0x680000, 0x680001) AM_WRITE(MWA16_NOP                  )   // ? 0 at startup only
r1649r1650
314287   AM_RANGE(0x700000, 0x700001) AM_WRITE(MWA16_NOP                  )   // Watchdog
315288   AM_RANGE(0x780000, 0x780001) AM_WRITE(MWA16_NOP                  )   // ? 0 -> 1 -> 0 (lev 5)
316289   AM_RANGE(0x7c0000, 0x7c0001) AM_WRITE(MWA16_RAM) AM_BASE(&galpani2_rombank   )   // Rom Bank
290   AM_RANGE(0x800000, 0xffffff) AM_READ(galpani2_bankedrom_r      )      // Banked ROM
317291ADDRESS_MAP_END
318292
319
320293/***************************************************************************
321294
322295
r1649r1650
326299***************************************************************************/
327300
328301static INPUT_PORTS_START( galpani2 )
329   PORT_START_TAG("IN0")   // IN0 - DSW + Player - 780000.w
330   PORT_DIPNAME( 0x0007, 0x0007, "Unknown 2-0&1&2*" )
331   PORT_DIPSETTING(      0x007, "7" )
332   PORT_DIPSETTING(      0x006, "6" )
333   PORT_DIPSETTING(      0x005, "5" )
334   PORT_DIPSETTING(      0x004, "4" )
335   PORT_DIPSETTING(      0x003, "3" )
336   PORT_DIPSETTING(      0x002, "2" )
337   PORT_DIPSETTING(      0x001, "1" )
338   PORT_DIPSETTING(      0x000, "0" )
339   PORT_DIPNAME( 0x0008, 0x0008, "Unknown 2-3*" )
340   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
341   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
342   PORT_DIPNAME( 0x0030, 0x0030, "Unknown 2-4&5" )   // from?
343   PORT_DIPSETTING(      0x0030, "3" )   // 2
344   PORT_DIPSETTING(      0x0020, "2" )   // 0
345   PORT_DIPSETTING(      0x0010, "1" )   // 3
346   PORT_DIPSETTING(      0x0000, "0" )   // 4
347   PORT_DIPNAME( 0x00c0, 0x00c0, "Unknown 2-6&7" )   // to?
348   PORT_DIPSETTING(      0x00c0, "3" )   // 9
349   PORT_DIPSETTING(      0x0080, "2" )   // 1
350   PORT_DIPSETTING(      0x0040, "1" )   // 4
351   PORT_DIPSETTING(      0x0000, "0" )   // 6
302   PORT_START_TAG("IN0")   // IN0 - DSW + Player 1 - 780000.w
303   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Difficulty ) )
304   PORT_DIPSETTING(      0x007, DEF_STR( Normal ) )
305   PORT_DIPSETTING(      0x006, DEF_STR( Very_Easy ) )
306   PORT_DIPSETTING(      0x005, DEF_STR( Easy ) )
307   PORT_DIPSETTING(      0x004, "Normal +" )
308   PORT_DIPSETTING(      0x003, DEF_STR( Hard ) )
309   PORT_DIPSETTING(      0x002, DEF_STR( Very_Hard ) )
310   PORT_DIPSETTING(      0x001, "Ultra Hard" )
311   PORT_DIPSETTING(      0x000, "God Hands" )
312   PORT_DIPNAME( 0x0008, 0x0008, "Picture Mode" )
313   PORT_DIPSETTING(      0x0008, DEF_STR( Normal ) )
314   PORT_DIPSETTING(      0x0000, "Adult" )
315   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
316   PORT_DIPSETTING(      0x0030, "3" )
317   PORT_DIPSETTING(      0x0020, "1" )
318   PORT_DIPSETTING(      0x0010, "4" )
319   PORT_DIPSETTING(      0x0000, "5" )
320   PORT_DIPNAME( 0x00c0, 0x00c0, "Max Unit of Players" )
321   PORT_DIPSETTING(      0x00c0, "9" )
322   PORT_DIPSETTING(      0x0080, "1" )
323   PORT_DIPSETTING(      0x0040, "4" )
324   PORT_DIPSETTING(      0x0000, "6" )
352325
353326   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
354327   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
r1649r1650
359332   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START1  )
360333   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
361334
362   PORT_START_TAG("IN1")   // IN1 - DSW + Player - 780002.w
335   PORT_START_TAG("IN1")   // IN1 - DSW + Player 2 - 780002.w
363336   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) )
364337   PORT_DIPSETTING(      0x000f, "1 Coin/1 Credit  1/1" )
365338   PORT_DIPSETTING(      0x000e, "2 Coin/1 Credit  2/1" )
r1649r1650
377350   PORT_DIPSETTING(      0x0002, "1 Coin/2 Credit  1/2" )
378351   PORT_DIPSETTING(      0x0001, "1 Coin/3 Credit  1/3" )
379352   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
380   PORT_DIPNAME( 0x0010, 0x0010, "Unknown 1-4*" )
381   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
382   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
353   PORT_DIPNAME( 0x0010, 0x0010, "Card Dispenser" )
354   PORT_DIPSETTING(      0x0010, "Used" )
355   PORT_DIPSETTING(      0x0000, DEF_STR( Unused ) )
383356   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Flip_Screen ) )
384357   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
385358   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r1649r1650
431404***************************************************************************/
432405
433406/*
434    16x16x8 made of four 8x8x8 tiles arrenged like: 01
407    16x16x8 made of four 8x8x8 tiles arranged like: 01
435408                                                    23
436409*/
437410static const gfx_layout layout_16x16x8 =
r1649r1650
488461
489462   /* basic machine hardware */
490463   MDRV_CPU_ADD(M68000, 16000000)   /* 16MHz */
491   MDRV_CPU_PROGRAM_MAP(galpani2_readmem,galpani2_writemem)
464   MDRV_CPU_PROGRAM_MAP(galpani2_mem1, 0)
492465   MDRV_CPU_VBLANK_INT(galpani2_interrupt,GALPANI2_INTERRUPTS_NUM)
493466
494467   MDRV_CPU_ADD(M68000, 16000000)   /* 16MHz */
495   MDRV_CPU_PROGRAM_MAP(galpani2_readmem2,galpani2_writemem2)
468   MDRV_CPU_PROGRAM_MAP(galpani2_mem2, 0)
496469   MDRV_CPU_VBLANK_INT(galpani2_interrupt2,GALPANI2_INTERRUPTS_NUM2)
497470
498471   MDRV_SCREEN_REFRESH_RATE(60)
r1649r1650
534507
535508***************************************************************************/
536509
510//POST's displayed checksums
511//
512//galpani2 = 6A6C
513//galpan2g = 15A3
514//galpan2t = 18A3
515//galpan2j = 08E1 / A582
516//gp2quiz  = 78D6 / 84A0
517//gp2se    = 6D8C / FCE4
518
537519/***************************************************************************
538520
539521                                Gals Panic II
r1649r1650
599581   ROM_LOAD16_BYTE( "g003a2.u63-1", 0x000001, 0x020000, CRC(0d30725d) SHA1(d4614f9ffb930c4ea36cb3fbacffe63060e92402) )
600582
601583   ROM_REGION16_BE( 0x1500000, REGION_USER1, 0 )   /* Backgrounds (CPU2) */
602   ROM_LOAD16_BYTE( "gp2-300b.053", 0x0000000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
603   ROM_LOAD16_BYTE( "gp2-300a.052", 0x0000001, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
584   ROM_LOAD( "gp2-300a.052", 0x0000000, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
585   ROM_LOAD( "gp2-300b.053", 0x0100000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
604586   ROM_LOAD( "gp2-301.035", 0x0200000, 0x200000, CRC(e71e749d) SHA1(420c4c085e89d9641a84e34fa870df2bc02165b6) )
605587   ROM_LOAD( "gp2-302.036", 0x0400000, 0x200000, CRC(832ebbb0) SHA1(a753285d874fcab979e70d6a289cf9fcd48affc6) )
606588   ROM_LOAD( "gp2-303.037", 0x0600000, 0x200000, CRC(36c872d0) SHA1(e0aa3089dfa1765ba70ce60e8696b1ba87c95703) )
r1649r1650
696678   ROM_LOAD16_BYTE( "g003t1.126", 0x000001, 0x020000, CRC(20d3a2ad) SHA1(93450e5a23456c242ebf1a3560013a17c6b05354) )
697679
698680   ROM_REGION16_BE( 0x1500000, REGION_USER1, 0 )   /* Backgrounds (CPU2) */
699   ROM_LOAD16_BYTE( "gp2-300b.053", 0x0000000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
700   ROM_LOAD16_BYTE( "gp2-300a.052", 0x0000001, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
681   ROM_LOAD( "gp2-300a.052", 0x0000000, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
682   ROM_LOAD( "gp2-300b.053", 0x0100000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
701683   ROM_LOAD( "gp2-301.035", 0x0200000, 0x200000, CRC(e71e749d) SHA1(420c4c085e89d9641a84e34fa870df2bc02165b6) )
702684   ROM_LOAD( "gp2-302.036", 0x0400000, 0x200000, CRC(832ebbb0) SHA1(a753285d874fcab979e70d6a289cf9fcd48affc6) )
703685   ROM_LOAD( "gp2-303.037", 0x0600000, 0x200000, CRC(36c872d0) SHA1(e0aa3089dfa1765ba70ce60e8696b1ba87c95703) )
r1649r1650
883865GAME( 1993, galpani2, 0,        galpani2, galpani2, 0, ROT90, "Kaneko", "Gals Panic II (Asia)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
884866GAME( 1993, galpan2g, galpani2, galpani2, galpani2, 0, ROT90, "Kaneko", "Gals Panic II (German)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
885867GAME( 1993, galpan2t, galpani2, galpani2, galpani2, 0, ROT90, "Kaneko", "Gals Panic II (Taiwan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
886GAME( 1993, galpan2j, galpani2, galpani2, galpani2, 0, ROT90, "Kaneko", "Gals Panic II (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) // was previously 'quiz edition' but the title screen doesn't say that??
868GAME( 1993, galpan2j, galpani2, galpani2, galpani2, 0, ROT90, "Kaneko", "Gals Panic II (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) // it is a 'quiz edition' but the title screen doesn't say that??
887869GAME( 1993, gp2quiz,  0,        galpani2, galpani2, 0, ROT90, "Kaneko", "Gals Panic II - Quiz Version (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) // this one has 'quiz edition' on the title screen
888870GAME( 1994, gp2se,    0,        galpani2, galpani2, 0, ROT90, "Kaneko", "Gals Panic II' - Special Edition (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
src/mame/drivers/arabian.c
r1649r1650
212212
213213static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
214214   AM_RANGE(0x0000, 0x7fff) AM_ROM
215   AM_RANGE(0x8000, 0xbfff) AM_WRITE(arabian_videoram_w) AM_BASE(&videoram)
216   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r)
217   AM_RANGE(0xc200, 0xc200) AM_READ(input_port_1_r)
215   AM_RANGE(0x8000, 0xbfff) AM_WRITE(arabian_videoram_w)
216   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x01ff) AM_READ(input_port_0_r)
217   AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x01ff) AM_READ(input_port_1_r)
218218   AM_RANGE(0xd000, 0xd7ef) AM_RAM AM_BASE(&custom_cpu_ram)
219219   AM_RANGE(0xd7f0, 0xd7ff) AM_READWRITE(custom_cpu_r, MWA8_RAM)
220   AM_RANGE(0xe000, 0xe07f) AM_WRITE(arabian_blitter_w) AM_BASE(&spriteram)
220   AM_RANGE(0xe000, 0xe007) AM_MIRROR(0x0ff8) AM_WRITE(arabian_blitter_w) AM_BASE(&arabian_blitter)
221221ADDRESS_MAP_END
222222
223223
r1649r1650
229229 *************************************/
230230
231231static ADDRESS_MAP_START( main_io_map, ADDRESS_SPACE_IO, 8 )
232   AM_RANGE(0xc800, 0xc800) AM_WRITE(AY8910_control_port_0_w)
233   AM_RANGE(0xca00, 0xca00) AM_WRITE(AY8910_write_port_0_w)
232   AM_RANGE(0xc800, 0xc800) AM_MIRROR(0x01ff) AM_WRITE(AY8910_control_port_0_w)
233   AM_RANGE(0xca00, 0xca00) AM_MIRROR(0x01ff) AM_WRITE(AY8910_write_port_0_w)
234234ADDRESS_MAP_END
235235
236236
r1649r1650
363363   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
364364   MDRV_SCREEN_SIZE(256, 256)
365365   MDRV_SCREEN_VISIBLE_AREA(0, 255, 11, 244)
366   MDRV_PALETTE_LENGTH(64)
367   MDRV_COLORTABLE_LENGTH(256*32)
366   MDRV_PALETTE_LENGTH(256*32)
368367
369368   MDRV_PALETTE_INIT(arabian)
370369   MDRV_VIDEO_START(arabian)
src/mame/drivers/labyrunr.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/hd6309/hd6309.h"
1314#include "video/konamiic.h"
1415#include "sound/2203intf.h"
r1649r1650
7980   AM_RANGE(0x0c00, 0x0c00) AM_WRITE(labyrunr_bankswitch_w)
8081   AM_RANGE(0x0d00, 0x0d1f) AM_WRITE(K051733_w)            /* 051733 (protection) */
8182   AM_RANGE(0x0e00, 0x0e00) AM_WRITE(watchdog_reset_w)
82   AM_RANGE(0x1000, 0x10ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)
83   AM_RANGE(0x1000, 0x10ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
8384   AM_RANGE(0x1800, 0x1fff) AM_WRITE(MWA8_RAM)
8485   AM_RANGE(0x2000, 0x2fff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram)   /* Sprite RAM */
8586   AM_RANGE(0x3000, 0x37ff) AM_WRITE(labyrunr_vram1_w) AM_BASE(&labyrunr_videoram1)
r1649r1650
251252   MDRV_SCREEN_SIZE(37*8, 32*8)
252253   MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
253254   MDRV_GFXDECODE(labyrunr)
254   MDRV_PALETTE_LENGTH(128)
255   MDRV_COLORTABLE_LENGTH(2*8*16*16)
255   MDRV_PALETTE_LENGTH(2*8*16*16)
256256
257257   MDRV_PALETTE_INIT(labyrunr)
258258   MDRV_VIDEO_START(labyrunr)
src/mame/drivers/shougi.c
r1649r1650
8787
8888
8989
90#include <math.h>
9190#include "driver.h"
91#include "deprecat.h"
9292#include "cpu/z80/z80.h"
9393#include "sound/ay8910.h"
9494#include "video/resnet.h"
src/mame/drivers/hornet.c
r1649r1650
212212*/
213213
214214#include "driver.h"
215#include "deprecat.h"
215216#include "cpu/powerpc/ppc.h"
216217#include "cpu/sharc/sharc.h"
217218#include "machine/konppc.h"
src/mame/drivers/pipedrm.c
r1649r1650
104104
105105
106106#include "driver.h"
107#include "deprecat.h"
107108#include "cpu/z80/z80.h"
108109#include "fromance.h"
109110#include "sound/2608intf.h"
110111#include "sound/2610intf.h"
111#include <math.h>
112112
113113
114114static UINT8 pending_command;
src/mame/drivers/ccastles.c
r1649r1650
120120***************************************************************************/
121121
122122#include "driver.h"
123#include "deprecat.h"
123124#include "sound/pokey.h"
124125#include "ccastles.h"
125126
src/mame/drivers/ddragon3.c
r1649r1650
2424
2525
2626#include "driver.h"
27#include "deprecat.h"
2728#include "cpu/z80/z80.h"
2829#include "cpu/m68000/m68000.h"
2930#include "sound/2151intf.h"
src/mame/drivers/exterm.c
r1649r1650
6161****************************************************************************/
6262
6363#include "driver.h"
64#include "deprecat.h"
6465#include "cpu/tms34010/tms34010.h"
6566#include "cpu/m6502/m6502.h"
6667#include "sound/dac.h"
src/mame/drivers/discoboy.c
r1649r1650
3636
3737
3838#include "driver.h"
39#include "deprecat.h"
3940#include "sound/msm5205.h"
4041#include "sound/3812intf.h"
4142
src/mame/drivers/mediagx.c
r1649r1650
6464*/
6565
6666#include "driver.h"
67#include "deprecat.h"
6768#include "memconv.h"
6869#include "machine/8237dma.h"
6970#include "machine/pic8259.h"
src/mame/drivers/policetr.c
r1649r1650
106106static UINT32 bsmt_data_offset;
107107
108108static UINT32 *speedup_data;
109static UINT32 last_cycles;
109static UINT64 last_cycles;
110110static UINT32 loop_count;
111111
112112static offs_t speedup_pc;
r1649r1650
243243   /* see if the PC matches */
244244   if ((activecpu_get_previouspc() & 0x1fffffff) == speedup_pc)
245245   {
246      UINT32 curr_cycles = activecpu_gettotalcycles();
246      UINT64 curr_cycles = activecpu_gettotalcycles();
247247
248248      /* if less than 50 cycles from the last time, count it */
249249      if (curr_cycles - last_cycles < 50)
src/mame/drivers/seibuspi.c
r1649r1650
669669*/
670670
671671#include "driver.h"
672#include "deprecat.h"
672673#include "machine/ds2404.h"
673674#include "machine/eeprom.h"
674675#include "machine/intelfsh.h"
r1649r1650
30193020
30203021
30213022/* SPI */
3022GAME( 1995, senkyu,    0,       spi,      spi_3button, senkyu,   ROT0,   "Seibu Kaihatsu", "Senkyu (Japan)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3023GAME( 1995, senkyu,    0,       spi,      spi_3button, senkyu,   ROT0,   "Seibu Kaihatsu", "Senkyu (Japan, set 1)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
30233024GAME( 1995, senkyua,   senkyu,  spi,      spi_3button, senkyua,  ROT0,   "Seibu Kaihatsu", "Senkyu (Japan, set 2)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
30243025GAME( 1995, batlball,  senkyu,  spi,      spi_3button, batlball, ROT0,   "Seibu Kaihatsu (Tuning License)", "Battle Balls (Germany)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
30253026GAME( 1995, batlbala,  senkyu,  spi,      spi_3button, batlball, ROT0,   "Seibu Kaihatsu (Metrotainment License)", "Battle Balls (Asia)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
src/mame/drivers/coolpool.c
r1649r1650
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829#include "cpu/tms34010/tms34010.h"
2930#include "cpu/tms34010/34010ops.h"
3031#include "cpu/tms32025/tms32025.h"
src/mame/drivers/mwarr.c
r1649r1650
3939*/
4040
4141#include "driver.h"
42#include "deprecat.h"
4243#include "sound/okim6295.h"
4344
4445static tilemap *bg_tilemap, *mlow_tilemap, *mhigh_tilemap, *tx_tilemap;
src/mame/drivers/sauro.c
r1649r1650
7474***************************************************************************/
7575
7676#include "driver.h"
77#include "deprecat.h"
7778#include "cpu/z80/z80.h"
7879#include "sound/3812intf.h"
7980#include "sound/sp0256.h"
src/mame/drivers/gaplus.c
r1649r1650
150150***************************************************************************/
151151
152152#include "driver.h"
153#include "deprecat.h"
153154#include "machine/namcoio.h"
154155#include "sound/namco.h"
155156#include "sound/samples.h"
src/mame/drivers/carpolo.c
r1649r1650
253253   MDRV_SCREEN_SIZE(256, 256)
254254   MDRV_SCREEN_VISIBLE_AREA(0, 239, 0, 255)
255255   MDRV_GFXDECODE(carpolo)
256   MDRV_PALETTE_LENGTH(16+1)   /* extra color for score area */
257   MDRV_COLORTABLE_LENGTH(12*2+2*16+4*2)
256   MDRV_PALETTE_LENGTH(12*2+2*16+4*2)
258257
259258   MDRV_PALETTE_INIT(carpolo)
260259   MDRV_VIDEO_START(carpolo)
src/mame/drivers/vroulet.c
r1649r1650
3535*/
3636
3737#include "driver.h"
38#include "deprecat.h"
3839#include "machine/8255ppi.h"
3940#include "sound/ay8910.h"
4041
src/mame/drivers/system1.c
r1649r1650
88Up'n Down, Mister Viking, Flicky, SWAT, Water Match and Bull Fight are known
99to run on IDENTICAL hardware (they were sold by Bally-Midway as ROM swaps).
1010
11DIP locations verified from manual for:
12      - wboy
13      - chplft
14
1115TODO: - background is misplaced in wbmlju
1216      - sprites stick in Pitfall II
1317      - sprite priorities are probably wrong
r1649r1650
1721******************************************************************************/
1822
1923#include "driver.h"
24#include "deprecat.h"
2025#include "video/system1.h"
2126#include "cpu/z80/z80.h"
2227#include "machine/segacrpt.h"
r1649r1650
416421   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
417422
418423#define DSW1_PORT \
419   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) \
424   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW A:1,2,3,4") \
420425   PORT_DIPSETTING(   0x07, DEF_STR( 4C_1C ) ) \
421426   PORT_DIPSETTING(   0x08, DEF_STR( 3C_1C ) ) \
422427   PORT_DIPSETTING(   0x09, DEF_STR( 2C_1C ) ) \
423   PORT_DIPSETTING(   0x05, "2 Coins/1 Credit 5/3 6/4" ) \
428   PORT_DIPSETTING(   0x05, "2 Coins/1 Credit 4/2 5/3 6/4" ) \
424429   PORT_DIPSETTING(   0x04, "2 Coins/1 Credit 4/3" ) \
425430   PORT_DIPSETTING(   0x0f, DEF_STR( 1C_1C ) ) \
431/*  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) Not allowed by mame coinage sorting, but valid */ \
426432   PORT_DIPSETTING(   0x03, "1 Coin/1 Credit 5/6" ) \
427433   PORT_DIPSETTING(   0x02, "1 Coin/1 Credit 4/5" ) \
428434   PORT_DIPSETTING(   0x01, "1 Coin/1 Credit 2/3" ) \
r1649r1650
432438   PORT_DIPSETTING(   0x0c, DEF_STR( 1C_4C ) ) \
433439   PORT_DIPSETTING(   0x0b, DEF_STR( 1C_5C ) ) \
434440   PORT_DIPSETTING(   0x0a, DEF_STR( 1C_6C ) ) \
435/*  PORT_DIPSETTING(    0x00, "1/1" ) */ \
436   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) \
441   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW A:5,6,7,8") \
437442   PORT_DIPSETTING(   0x70, DEF_STR( 4C_1C ) ) \
438443   PORT_DIPSETTING(   0x80, DEF_STR( 3C_1C ) ) \
439444   PORT_DIPSETTING(   0x90, DEF_STR( 2C_1C ) ) \
440   PORT_DIPSETTING(   0x50, "2 Coins/1 Credit 5/3 6/4" ) \
445   PORT_DIPSETTING(   0x50, "2 Coins/1 Credit 4/2 5/3 6/4" ) \
441446   PORT_DIPSETTING(   0x40, "2 Coins/1 Credit 4/3" ) \
442447   PORT_DIPSETTING(   0xf0, DEF_STR( 1C_1C ) ) \
448/*  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) Not allowed by mame coinage sorting, but valid */ \
443449   PORT_DIPSETTING(   0x30, "1 Coin/1 Credit 5/6" ) \
444450   PORT_DIPSETTING(   0x20, "1 Coin/1 Credit 4/5" ) \
445451   PORT_DIPSETTING(   0x10, "1 Coin/1 Credit 2/3" ) \
r1649r1650
449455   PORT_DIPSETTING(   0xc0, DEF_STR( 1C_4C ) ) \
450456   PORT_DIPSETTING(   0xb0, DEF_STR( 1C_5C ) ) \
451457   PORT_DIPSETTING(   0xa0, DEF_STR( 1C_6C ) )
452/*  PORT_DIPSETTING(    0x00, "1/1" ) */
453458
454459/* If you don't like the description, feel free to change it */
455460#define DSW0_BIT7 \
r1649r1650
15671572   PORT_START  /* IN0 */
15681573   IN0_PORT
15691574
1575   PORT_START     /* DSW0 */
1576   DSW1_PORT
1577
15701578   PORT_START  /* DSW1 */
1571   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1579   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
15721580   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
15731581   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1574   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1582   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
15751583   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
15761584   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1577   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1585   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
15781586   PORT_DIPSETTING(   0x08, "2" )
15791587   PORT_DIPSETTING(   0x0c, "3" )
15801588   PORT_DIPSETTING(   0x04, "4" )
1581   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1582   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1583   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
1589   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1590   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
1591   PORT_DIPSETTING(   0x10, "20k 70k 120k 170k" )
1592   PORT_DIPSETTING(   0x00, "50k 100k 150k 200k" )
1593   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:6")
1594   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1595   PORT_DIPSETTING(   0x20, DEF_STR( Easy ) )
1596   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW B:7")
1597   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
15841598   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1585   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
1586   PORT_DIPSETTING(   0x00, "20000 70000" )
1587   PORT_DIPSETTING(   0x20, "50000 100000" )
1588   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) )
1589   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
1590   PORT_DIPSETTING(   0x40, DEF_STR( Hard ) )
1591   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1599   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW B:8")
15921600   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
15931601   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1594
1595   PORT_START     /* DSW0 */
1596   DSW1_PORT
15971602INPUT_PORTS_END
15981603
15991604static INPUT_PORTS_START( 4dwarrio )
r1649r1650
18301835   DSW1_PORT
18311836
18321837   PORT_START  /* DSW0 */
1833   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1838   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
18341839   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
18351840   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1836   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1841   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
18371842   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
18381843   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1839   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1844   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
18401845   PORT_DIPSETTING(   0x0c, "3" )
18411846   PORT_DIPSETTING(   0x08, "4" )
18421847   PORT_DIPSETTING(   0x04, "5" )
1843   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1844   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )
1848   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1849   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
18451850   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
18461851   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
1847   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) )
1852   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW B:6")
18481853   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
18491854   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
1850   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
1855   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:7")
18511856   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
18521857   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1853   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1858   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW B:8")
18541859   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
18551860   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
18561861INPUT_PORTS_END
18571862
1863static INPUT_PORTS_START( wboy3 )
1864   PORT_START  /* IN1 */
1865   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1866   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1867   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1868   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1869   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1870   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1871   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1872   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
1873
1874   PORT_START  /* IN2 */
1875   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1876   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1877   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1878   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1879   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1880   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1881   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1882   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1883
1884   PORT_START  /* IN0 */
1885   IN0_PORT
1886
1887   PORT_START     /* DSW1 */
1888   DSW1_PORT
1889
1890   PORT_START  /* DSW0 */
1891   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
1892   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1893   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1894   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
1895   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
1896   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1897   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
1898   PORT_DIPSETTING(   0x0c, "1" )
1899   PORT_DIPSETTING(   0x08, "2" )
1900   PORT_DIPSETTING(   0x04, "3" )
1901   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1902   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
1903   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
1904   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
1905   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW B:6")
1906   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
1907   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
1908   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:7")
1909   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
1910   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1911   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW B:8")
1912   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1913   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1914INPUT_PORTS_END
1915
18581916static INPUT_PORTS_START( wboysys2 )
18591917   PORT_START  /* IN1 */
18601918   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1649r1650
18801938   IN0_PORT
18811939
18821940   PORT_START  /* DSW0 */
1883   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1941   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
18841942   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
18851943   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1886   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1944   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
18871945   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
18881946   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1889   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1947   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
18901948   PORT_DIPSETTING(   0x0c, "3" )
18911949   PORT_DIPSETTING(   0x08, "4" )
18921950   PORT_DIPSETTING(   0x04, "5" )
1893   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1894   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )
1951   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1952   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
18951953   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
18961954   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
1897   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) )
1955   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW B:6")
18981956   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
18991957   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
1900   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
1958   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:7")
19011959   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
19021960   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1903   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1961   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW B:8")
19041962   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
19051963   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
19061964
r1649r1650
19381996   DSW1_PORT
19391997
19401998   PORT_START  /* DSW0 */
1941   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1999   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
19422000   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
19432001   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1944   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2002   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
19452003   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
19462004   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1947   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
2005   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
19482006   PORT_DIPSETTING(   0x0c, "3" )
19492007   PORT_DIPSETTING(   0x08, "4" )
19502008   PORT_DIPSETTING(   0x04, "5" )
1951   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1952   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )
2009   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
2010   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
19532011   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
19542012   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
1955   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) )
2013   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW B:6")
19562014   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
19572015   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
1958   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
2016   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:7")
19592017   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
19602018   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1961   PORT_DIPNAME( 0x80, 0x00, "Energy Consumption" )
2019   PORT_DIPNAME( 0x80, 0x00, "Energy Consumption" ) PORT_DIPLOCATION("SW B:8")
19622020   PORT_DIPSETTING(   0x00, "Slow" )
19632021   PORT_DIPSETTING(   0x80, "Fast" )
19642022INPUT_PORTS_END
r1649r1650
48704928GAME( 1986, wboyo,    wboy,     system1,  wboy,     hvymetal, ROT0,   "Sega (Escape license)", "Wonder Boy (set 1, 315-5135)", GAME_SUPPORTS_SAVE )
48714929GAME( 1986, wboy2,    wboy,     system1,  wboy,     wboy2,    ROT0,   "Sega (Escape license)", "Wonder Boy (set 2, 315-5178)", GAME_SUPPORTS_SAVE )
48724930GAME( 1986, wboy2u,   wboy,     system1,  wboy,     0,        ROT0,   "Sega (Escape license)", "Wonder Boy (set 2, not encrypted)", GAME_SUPPORTS_SAVE )
4873GAME( 1986, wboy3,    wboy,     system1,  wboy,     hvymetal, ROT0,   "Sega (Escape license)", "Wonder Boy (set 3, 315-5135)", GAME_SUPPORTS_SAVE )
4931GAME( 1986, wboy3,    wboy,     system1,  wboy3,    hvymetal, ROT0,   "Sega (Escape license)", "Wonder Boy (set 3, 315-5135)", GAME_SUPPORTS_SAVE )
48744932GAME( 1986, wboy4,    wboy,     system1,  wboy,     4dwarrio, ROT0,   "Sega (Escape license)", "Wonder Boy (set 4, 315-5162)", GAME_SUPPORTS_SAVE )
48754933GAME( 1986, wboyu,    wboy,     system1,  wboyu,    0,        ROT0,   "Sega (Escape license)", "Wonder Boy (not encrypted)", GAME_SUPPORTS_SAVE )
48764934GAME( 1986, wboysys2, wboy,     wbml,     wboysys2, wboy,     ROT0,   "Sega (Escape license)", "Wonder Boy (system 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/tetriunk.c
r1649r1650
99*/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213
1314static int crtindex;
1415static int crtdata[256];
src/mame/drivers/powerins.c
r1649r1650
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829#include "machine/nmk112.h"
2930#include "sound/okim6295.h"
3031#include "sound/2203intf.h"
src/mame/drivers/quizo.c
r1649r1650
9999         }
100100      }
101101   }
102   copybitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
102   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect);
103103   dirty=0;
104104   return 0;
105105}
src/mame/drivers/niyanpai.c
r1649r1650
3333******************************************************************************/
3434
3535#include "driver.h"
36#include "deprecat.h"
3637#include "machine/m68kfmly.h"
3738#include "machine/z80ctc.h"
3839#include "nb1413m3.h"
src/mame/drivers/exedexes.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "sound/ay8910.h"
1415#include "sound/sn76496.h"
1516
src/mame/drivers/jedi.c
r1649r1650
88        * Return of the Jedi
99
1010    Known bugs:
11        * none at this time
11        * smoothing PROMs were dumped at half size
1212
1313****************************************************************************
1414
r1649r1650
109109***************************************************************************/
110110
111111#include "driver.h"
112#include "deprecat.h"
112113#include "cpu/m6502/m6502.h"
113114#include "sound/5220intf.h"
114115#include "sound/pokey.h"
r1649r1650
307308
308309static WRITE8_HANDLER( jedi_coin_counter_w )
309310{
310   coin_counter_w(offset, data >> 7);
311   coin_counter_w(offset, data);
311312}
312313
313314
r1649r1650
381382   AM_RANGE(0x1e00, 0x1e00) AM_WRITE(main_irq_ack_w)
382383   AM_RANGE(0x1e80, 0x1e81) AM_WRITE(jedi_coin_counter_w)
383384   AM_RANGE(0x1e82, 0x1e83) AM_WRITE(MWA8_NOP)   /* LED control; not used */
384   AM_RANGE(0x1e84, 0x1e84) AM_WRITE(jedi_alpha_banksel_w)
385   AM_RANGE(0x1e84, 0x1e84) AM_WRITE(MWA8_RAM) AM_BASE(&jedi_foreground_bank)
385386   AM_RANGE(0x1e86, 0x1e86) AM_WRITE(sound_reset_w)
386387   AM_RANGE(0x1e87, 0x1e87) AM_WRITE(jedi_video_off_w)
387388   AM_RANGE(0x1f00, 0x1f00) AM_WRITE(sound_latch_w)
388389   AM_RANGE(0x1f80, 0x1f80) AM_WRITE(rom_banksel_w)
389   AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE(&jedi_backgroundram) AM_SIZE(&jedi_backgroundram_size)
390   AM_RANGE(0x2800, 0x2fff) AM_READWRITE(MRA8_RAM, jedi_paletteram_w) AM_BASE(&paletteram)
391   AM_RANGE(0x3000, 0x37bf) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
392   AM_RANGE(0x37c0, 0x3bff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
390   AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE(&jedi_backgroundram)
391   AM_RANGE(0x2800, 0x2fff) AM_RAM AM_BASE(&jedi_paletteram)
392   AM_RANGE(0x3000, 0x37bf) AM_RAM AM_BASE(&jedi_foregroundram)
393   AM_RANGE(0x37c0, 0x3bff) AM_RAM AM_BASE(&jedi_spriteram)
393394   AM_RANGE(0x3c00, 0x3c01) AM_WRITE(jedi_vscroll_w)
394395   AM_RANGE(0x3d00, 0x3d01) AM_WRITE(jedi_hscroll_w)
395396   AM_RANGE(0x3e00, 0x3fff) AM_WRITE(jedi_PIXIRAM_w)
r1649r1650
458459
459460/*************************************
460461 *
461 *  Graphics layouts
462 *
463 *************************************/
464
465static const gfx_layout charlayout =
466{
467   8,8,
468   RGN_FRAC(1,1),
469   2,
470   { 0, 1 },
471   { 0, 2, 4, 6, 8, 10, 12, 14 },
472   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
473   16*8
474};
475
476
477static const gfx_layout pflayout =
478{
479   8,8,
480   RGN_FRAC(1,2),
481   4,
482   { 0, 4, RGN_FRAC(1,2), RGN_FRAC(1,2)+4 },
483   { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
484   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
485   16*8
486};
487
488
489static const gfx_layout spritelayout =
490{
491   8,16,
492   RGN_FRAC(1,2),
493   4,
494   { 0, 4, RGN_FRAC(1,2), RGN_FRAC(1,2)+4 },
495   { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3},
496   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
497         8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
498   32*8
499};
500
501
502static GFXDECODE_START( jedi )
503   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 1 )
504   GFXDECODE_ENTRY( REGION_GFX2, 0, pflayout,     0, 1 )
505   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,  0, 1 )
506GFXDECODE_END
507
508
509
510/*************************************
511 *
512462 *  Machine driver
513463 *
514464 *************************************/
r1649r1650
531481
532482   /* video hardware */
533483   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
534   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
535   MDRV_SCREEN_SIZE(37*8, 262) /* verify vert size */
484   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
485   MDRV_SCREEN_SIZE(64*8, 262) /* verify vert size */
536486   MDRV_SCREEN_VISIBLE_AREA(0*8, 37*8-1, 0*8, 30*8-1)
537   MDRV_GFXDECODE(jedi)
538   MDRV_PALETTE_LENGTH(1024+1)
539487
540488   MDRV_VIDEO_START(jedi)
541489   MDRV_VIDEO_UPDATE(jedi)
r1649r1650
582530   ROM_LOAD( "136030-133.01c",  0x8000, 0x4000, CRC(6c601c69) SHA1(618b77800bbbb4db34a53ca974a71bdaf89b5930) )
583531   ROM_LOAD( "136030-134.01a",  0xC000, 0x4000, CRC(5e36c564) SHA1(4b0afceb9a1d912f1d5c1f26928d244d5b14ea4a) )
584532
585   ROM_REGION( 0x02000, REGION_GFX1, ROMREGION_DISPOSE )
533   ROM_REGION( 0x02000, REGION_GFX1,0 )
586534   ROM_LOAD( "136030-215.11t",  0x00000, 0x2000, CRC(3e49491f) SHA1(ade5e846069c2fa6edf667469d13ce5a6a45c06d) ) /* Alphanumeric */
587535
588   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE )
536   ROM_REGION( 0x10000, REGION_GFX2,0 )
589537   ROM_LOAD( "136030-126.06r",  0x00000, 0x8000, CRC(9c55ece8) SHA1(b8faa23314bb0d199ef46199bfabd9cb17510dd3) ) /* Playfield */
590538   ROM_LOAD( "136030-127.06n",  0x08000, 0x8000, CRC(4b09dcc5) SHA1(d46b5f4fb69c4b8d823dd9c4d92f8713badfa44a) )
591539
592   ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE )
540   ROM_REGION( 0x20000, REGION_GFX3, 0 )
593541   ROM_LOAD( "136030-130.01h",  0x00000, 0x8000, CRC(2646a793) SHA1(dcb5fd50eafbb27565bce099a884be83a9d82285) ) /* Sprites */
594542   ROM_LOAD( "136030-131.01f",  0x08000, 0x8000, CRC(60107350) SHA1(ded03a46996d3f2349df7f59fd435a7ad6ed465e) )
595543   ROM_LOAD( "136030-128.01m",  0x10000, 0x8000, CRC(24663184) SHA1(5eba142ed926671ee131430944e59f21a55a5c57) )
596544   ROM_LOAD( "136030-129.01k",  0x18000, 0x8000, CRC(ac86b98c) SHA1(9f86c8801a7293fa46e9432f1651dd85bf00f4b9) )
597545
598   ROM_REGION( 0x0800, REGION_PROMS, 0 )   /* background smoothing */
599   ROM_LOAD( "136030-117.bin",   0x0000, 0x0400, CRC(9831bd55) SHA1(12945ef2d1582914125b9ee591567034d71d6573) )
600   ROM_LOAD( "136030-118.bin",   0x0400, 0x0400, CRC(261fbfe7) SHA1(efc65a74a3718563a07b718e34d8a7aa23339a69) )
546   ROM_REGION( 0x1000, REGION_PROMS, 0 )   /* background smoothing */
547   ROM_LOAD( "136030-117.bin",   0x0000, 0x0800, BAD_DUMP CRC(9831bd55) SHA1(12945ef2d1582914125b9ee591567034d71d6573) )
548   ROM_LOAD( "136030-118.bin",   0x0800, 0x0800, BAD_DUMP CRC(261fbfe7) SHA1(efc65a74a3718563a07b718e34d8a7aa23339a69) )
601549ROM_END
602550
603551
r1649r1650
608556 *
609557 *************************************/
610558
611GAME( 1984, jedi, 0, jedi, jedi, 0, ROT0, "Atari", "Return of the Jedi", GAME_SUPPORTS_SAVE )
559GAME( 1984, jedi, 0, jedi, jedi, 0, ROT0, "Atari", "Return of the Jedi", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
src/mame/drivers/bfm_sc2.c
r1649r1650
137137***************************************************************************/
138138
139139#include "driver.h"
140#include "deprecat.h"
140141#include "cpu/m6809/m6809.h"
141142
142143#include "video/bfm_adr2.h"
r1649r1650
145146#include "sound/upd7759.h"
146147
147148/* fruit machines only */
148//#include "video/bfm_dm01.h"
149//#include "video/awpvid.h"
150149#include "machine/steppers.h" // stepper motor
151150
152151#include "machine/bfm_bd1.h"  // vfd
r1649r1650
173172#define UART_LOG(x) do { if (VERBOSE) logerror x; } while (0)
174173#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
175174
175#ifndef AWP_VIDEO //Defined for fruit machines with mechanical reels
176#define draw_reel(x)
177#else
178#define draw_reel(x) awp_draw_reel x
179#endif
180
176181#define MASTER_CLOCK      (XTAL_8MHz)
177182
178183// local prototypes ///////////////////////////////////////////////////////
r1649r1650
524529
525530///////////////////////////////////////////////////////////////////////////
526531
527#ifdef UNUSED_FUNCTION
528static WRITE8_HANDLER( reel12_w )
529{
530   reel12_latch = data;
531
532   if ( Stepper_update(0, data   ) ) reel_changed |= 0x01;
533   if ( Stepper_update(1, data>>4) ) reel_changed |= 0x02;
534
535   if ( Stepper_optic_state(0) ) optic_pattern |=  0x01;
536   else                          optic_pattern &= ~0x01;
537   if ( Stepper_optic_state(1) ) optic_pattern |=  0x02;
538   else                          optic_pattern &= ~0x02;
539}
540#endif
541
542///////////////////////////////////////////////////////////////////////////
543
544532static WRITE8_HANDLER( reel12_vid_w )  // in a video cabinet this is used to drive a hopper
545533{
546534   reel12_latch = data;
r1649r1650
587575   else                          optic_pattern &= ~0x04;
588576   if ( Stepper_optic_state(3) ) optic_pattern |=  0x08;
589577   else                          optic_pattern &= ~0x08;
578
579   draw_reel((2));
580   draw_reel((3));
590581}
591582
592583///////////////////////////////////////////////////////////////////////////
r1649r1650
602593   else                          optic_pattern &= ~0x10;
603594   if ( Stepper_optic_state(5) ) optic_pattern |=  0x20;
604595   else                          optic_pattern &= ~0x20;
596
597   draw_reel((4));
598   draw_reel((5));
605599}
606600
607601///////////////////////////////////////////////////////////////////////////
r1649r1650
610604
611605static WRITE8_HANDLER( mmtr_w )
612606{
607   int i;
613608   int  changed = mmtr_latch ^ data;
614609   long cycles  = ATTOTIME_TO_CYCLES(0, timer_get_time() );
615610
616611   mmtr_latch = data;
617612
618   if ( changed & 0x01 )
619   {
620      if ( Mechmtr_update(0, cycles, data & 0x01 ) )
621      {
622         sc2gui_update_mmtr |= 0x01;
623      }
624   }
625
626   if ( changed & 0x02 )
627   {
628      if ( Mechmtr_update(1, cycles, data & 0x02 ) )
629      {
630         sc2gui_update_mmtr |= 0x02;
631      }
632   }
633
634   if ( changed & 0x04 )
635   {
636      if ( Mechmtr_update(2, cycles, data & 0x04 ) )
637      {
638         sc2gui_update_mmtr |= 0x04;
639      }
640   }
641
642   if ( changed & 0x08 )
643   {
644      if ( Mechmtr_update(3, cycles, data & 0x08 ) )
645      {
646         sc2gui_update_mmtr |= 0x08;
647      }
648   }
649
650
651   if ( changed & 0x10 )
652   {
653      if ( Mechmtr_update(4, cycles, data & 0x10 ) )
654      {
655         sc2gui_update_mmtr |= 0x10;
656      }
657   }
658
659   if ( changed & 0x20 )
660   {
661      if ( Mechmtr_update(5, cycles, data & 0x20 ) )
662      {
663         sc2gui_update_mmtr |= 0x20;
664      }
665   }
666
667   if ( changed & 0x40 )
668   {
669      if ( Mechmtr_update(6, cycles, data & 0x40 ) )
670      {
671         sc2gui_update_mmtr |= 0x40;
672      }
673   }
674
675   if ( changed & 0x80 )
676   {
677      if ( Mechmtr_update(7, cycles, data & 0x80 ) )
678      {
679         sc2gui_update_mmtr |= 0x80;
680      }
681   }
682
613   for (i = 0; i<8; i++)
614    {
615      if ( changed & (1 << i) )
616       {
617         if ( Mechmtr_update(i, cycles, data & (1 << i) ) )
618         {
619            sc2gui_update_mmtr |= (1 << i);
620         }
621       }
622    }
683623   if ( data & 0x1F ) cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE );
684624}
685625
r1649r1650
952892
953893///////////////////////////////////////////////////////////////////////////
954894
955#ifdef UNUSED_FUNCTION
956static READ8_HANDLER( direct_input_r )
957{
958   return 0;
959}
960#endif
961
962///////////////////////////////////////////////////////////////////////////
963
964895static READ8_HANDLER( coin_input_r )
965896{
966897   return input_port_0_r(0);
r1649r1650
30652996   MDRV_VIDEO_UPDATE(addersc2)
30662997
30672998   MDRV_PALETTE_LENGTH(16)
3068   MDRV_COLORTABLE_LENGTH(16)
30692999   MDRV_PALETTE_INIT(adder2)
30703000   MDRV_GFXDECODE(adder2)
30713001
src/mame/drivers/suprnova.c
r1649r1650
174174*/
175175
176176#include "driver.h"
177#include "deprecat.h"
177178#include "sound/ymz280b.h"
178179
179180#define BIOS_SKIP 1 // Skip Bios as it takes too long and doesn't complete atm.
src/mame/drivers/seta2.c
r1649r1650
1111            DX-101              Sprites
1212            DX-102 x3
1313
14OSC:    50.0000MHz
15        32.5304MHz
14OSC:    50.00000MHz
15        32.53047MHz
1616
1717*   The Toshiba TMP68301 is a 68HC000 + serial I/O, parallel I/O,
1818    3 timers, address decoder, wait generator, interrupt controller,
r1649r1650
108108Notes:
109109      *: unknown QFP208 (has large heatsink on it). Should be similar to other known
110110         graphics chips used on Seta hardware of this era.
111      68301 clock: 16.000MHz
111      68301 clock: 16.000MHz (?? From what OSC + divider??)
112112      VSync: 60Hz
113113
114114***************************************************************************/
r1649r1650
159159                            Penguin Brothers (Japan)
160160
161161(c)2000 Subsino
162Board:  P0-142A
163CPU:    TMP68301 (68000 core)
164162
165OSC:    50.0000MHz
166        32.5304MHz
167        28.0000MHz
163   CPU: Toshiba TMP68301AF-16 (100 Pin PQFP)
164 Video: NEC DX-101 (240 Pin PQFP)
165        NEC DX-102 (52 Pin PQFP x3)
166 Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP)
167   OSC: 50MHz, 32.53047MHz & 28MHz
168 Other: 8 Position Dipswitch x 2
169        Lattice ispLSI2032
168170
169Chips.: DX-101
170        DX-102 x3
171Sound:  X1-010
171PCB Number: P0-142A
172+-----------------------------------------------------------+
173|                VOL                       +------+         |
174|                                          |Seta  |     M1  |
175|   +---+ +---+                            |X1-010|         |
176|   |   | |   |   M   M                    |      |  +---+  |
177+-+ | U | | U |   1   1                    +------+  |   |  |
178  | | 0 | | 0 |                    74HC00            |   |  |
179+-+ | 7 | | 6 |   M   M                              | U |  |
180|   |   | |   |   1   1                              | 1 |  |
181|   +---+ +---+                                      | 8 |  |
182|                                          Lattice   |   |  |
183|   D D  +---+                            ispLSI2032 |   |  |
184|   S S  |DX |                  +-------+            +---+  |
185|   W W  |102|                  |Toshiba|     CN2           |
186|   1 2  +---+      BAT1*       |  TMP  |                   |
187|                               | 68301 |  U50*             |
188|                               +-------+                   |
189|                                                           |
190|                  50MHz        +----------+     28MHz      |
191|     +---+                     |          |                |
192|     |DX |     SW1             |   NEC    |    M   M       |
193|     |102|                     |  DX-101  |    2   2       |
194|     +---+         M  M        |          |                |
195|                   1  1        |          |                |
196|                               +----------+                |
197|                                                           |
198|                             +---+      +---++---++---+    |
199|                             |   |      |   ||   ||   |    |
200|     +---+                   |   |      |   ||   ||   |    |
201+-+   |DX |                   | U |      | U || U || U |    |
202  |   |102|     32.53047MHz   | 4 |      | 4 || 3 || 3 |    |
203+-+   +---+                   | 0 |      | 1 || 8 || 9 |    |
204|                             |   |      |   ||   ||   |    |
205|                             |   |      |   ||   ||   |    |
206|                             +---+      +---++---++---+    |
207+-----------------------------------------------------------+
172208
173Notes:  pzlbowl PCB with extra parts:
209Notes:  pzlbowl PCB with these extra parts:
174210        28MHz OSC
175211        2x 62256 SRAM
176212        74HC00
177213
214U50*  Unpopulated 93LC46BX EEPROM
215BAT1* Unpopulated CR2032 3Volt battery
216
217Ram M1 are NEC D43001GU-70LL
218Ram M2 are LGS GM76C8128ALLFW70
219
178220***************************************************************************/
179221
180222/***************************************************************************
181223
224                            Puzzle De Bowling (Japan)
225
226(c)1999 Nihon System / Moss
227
228   CPU: Toshiba TMP68301AF-16 (100 Pin PQFP)
229 Video: NEC DX-101 (240 Pin PQFP)
230        NEC DX-102 (52 Pin PQFP x3)
231 Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP)
232   OSC: 50MHz & 32.53047MHz
233 Other: 8 Position Dipswitch x 2
234        Lattice ispLSI2032 - stamped "KUDEC"
235
236PCB Number: P0-142A
237+-----------------------------------------------------------+
238|                VOL                       +------+         |
239|                                          |Seta  |     M1  |
240|   +---+ +---+                            |X1-010|         |
241|   |   | |   |  U4*  M                    |      |  +---+  |
242+-+ | U | | U |       1                    +------+  | K |  |
243  | | 0 | | 0 |                     U30*             | U |  |
244+-+ | 7 | | 6 |  U5*  M                              | S |  |
245|   |   | |   |       1                              |   |  |
246|   +---+ +---+                                      | U |  |
247|                                          Lattice   | 1 |  |
248|   D D  +---+                            ispLSI2032 | 8 |  |
249|   S S  |DX |                  +-------+            +---+  |
250|   W W  |102|                  |Toshiba|     CN2           |
251|   1 2  +---+      BAT1*       |  TMP  |                   |
252|                               | 68301 |  U50*             |
253|                               +-------+                   |
254|                                                           |
255|                  50MHz        +----------+     XM2*       |
256|     +---+                     |          |                |
257|     |DX |     SW1             |   NEC    |    M   M       |
258|     |102|                     |  DX-101  |    2   2       |
259|     +---+         M  M        |          |                |
260|                   1  1        |          |                |
261|                               +----------+                |
262|                                                           |
263|                             +---+      +---++---++---+    |
264|                             | K |      | K || K || K |    |
265|     +---+                   | U |      | U || U || U |    |
266+-+   |DX |                   | C |      | C || C || C |    |
267  |   |102|     32.53047MHz   |   |      |   ||   ||   |    |
268+-+   +---+                   | U |      | U || U || U |    |
269|                             | 4 |      | 4 || 3 || 3 |    |
270|                             | 0 |      | 1 || 8 || 9 |    |
271|                             +---+      +---++---++---+    |
272+-----------------------------------------------------------+
273
274* Unpopulated:
275  U4 & U5 RAM HM62256 equivalent
276  U50 93LC46BX EEPROM
277  U30 74HC00
278  BAT1 CR2032 3Volt battery
279  XM2 OSC
280
281Ram M1 are NEC D43001GU-70LL
282Ram M2 are LGS GM76C8128ALLFW70
283
284KUP-U06-I03 U06 Program rom ST27C4001 (even)
285KUP-U07-I03 U07 Program rom ST27C4001 (odd)
286
287KUS-U18-I00 U18 Mask rom (Samples 23C32000 32Mbit)
288
289KUC-U38-I00 U38 Mask rom (Graphics 23C32000 32Mbit)
290KUC-U39-I00 U39 Mask rom (Graphics 23C32000 32Mbit)
291KUC-U40-I00 U40 Mask rom (Graphics 23C32000 32Mbit)
292KUC-U41-I00 U41 Mask rom (Graphics 23C32000 32Mbit)
293
294***************************************************************************/
295
296/***************************************************************************
297
182298Sammy USA Outdoor Shooting Series PCB
183299
184300PCB B0-003A (or B0-003B):
r1649r1650
291407***************************************************************************/
292408
293409#include "driver.h"
410#include "deprecat.h"
294411#include "machine/tmp68301.h"
295412#include "machine/eeprom.h"
296413#include "sound/x1_010.h"
r1649r1650
10421159static INPUT_PORTS_START( myangel )
10431160   PORT_START_TAG("IN0")   // $700300.w
10441161   PORT_SERVICE_DIPLOC(  0x0001, IP_ACTIVE_LOW, "SW1:1" )
1045   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:2" ) /* Listed as "Unused" */
1046   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:3" ) /* Listed as "Unused" */
1162   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW1:2" ) /* Listed as "Unused" */
1163   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) /* Listed as "Unused" */
10471164   PORT_DIPNAME( 0x0008, 0x0008, "Increase Lives While Playing" ) PORT_DIPLOCATION("SW1:4")
10481165   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
10491166   PORT_DIPSETTING(      0x0008, DEF_STR( Yes ) )
r1649r1650
11281245static INPUT_PORTS_START( myangel2 )
11291246   PORT_START_TAG("IN0") //$600300.w
11301247   PORT_SERVICE_DIPLOC(  0x0001, IP_ACTIVE_LOW, "SW1:1" )
1131   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:2" ) /* Listed as "Unused" */
1132   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:3" ) /* Listed as "Unused" */
1248   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW1:2" ) /* Listed as "Unused" */
1249   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) /* Listed as "Unused" */
11331250   PORT_DIPNAME( 0x0008, 0x0008, "Increase Lives While Playing" ) PORT_DIPLOCATION("SW1:4")
11341251   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
11351252   PORT_DIPSETTING(      0x0008, DEF_STR( Yes ) )
r1649r1650
16951812static MACHINE_DRIVER_START( mj4simai )
16961813
16971814   /* basic machine hardware */
1698   MDRV_CPU_ADD_TAG("main",M68000,32530400 / 2)         /* !! TMP68301 !! */
1815   MDRV_CPU_ADD_TAG("main",M68000,50000000/3)         /* !! TMP68301 @ 16.666666MHz !! */
16991816   MDRV_CPU_PROGRAM_MAP(mj4simai_readmem,mj4simai_writemem)
17001817   MDRV_CPU_VBLANK_INT(seta2_interrupt,1)
17011818
r1649r1650
17301847   /* basic machine hardware */
17311848   MDRV_IMPORT_FROM(mj4simai)
17321849   MDRV_CPU_MODIFY("main")
1733   MDRV_CPU_REPLACE("main",M68000,16000000)
17341850   MDRV_CPU_PROGRAM_MAP(gundamex_readmem,gundamex_writemem)
17351851
17361852   MDRV_NVRAM_HANDLER(93C46_gundamex)
src/mame/drivers/witch.c
r1649r1650
190190*/
191191
192192#include "driver.h"
193#include "deprecat.h"
193194#include "sound/es8712.h"
194195#include "sound/2203intf.h"
195196
src/mame/drivers/flkatck.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "cpu/z80/z80.h"
1516#include "cpu/hd6309/hd6309.h"
1617#include "sound/2151intf.h"
src/mame/drivers/dynax.c
r1649r1650
7171*********************************************************************************************************************/
7272
7373#include "driver.h"
74#include "deprecat.h"
7475#include "includes/dynax.h"
7576#include "cpu/tlcs90/tlcs90.h"
7677#include "machine/msm6242.h"
src/mame/drivers/shootout.c
r1649r1650
3838*/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "cpu/m6502/m6502.h"
4243#include "sound/2203intf.h"
4344
src/mame/drivers/contra.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "cpu/m6809/m6809.h"
1819#include "sound/2151intf.h"
1920
r1649r1650
8788   AM_RANGE(0x001c, 0x001c) AM_WRITE(cpu_sound_command_w)
8889   AM_RANGE(0x001e, 0x001e) AM_WRITE(MWA8_NOP)   /* ? */
8990   AM_RANGE(0x0060, 0x0067) AM_WRITE(contra_K007121_ctrl_1_w)
90   AM_RANGE(0x0c00, 0x0cff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram)
91   AM_RANGE(0x0c00, 0x0cff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
9192   AM_RANGE(0x1000, 0x1fff) AM_WRITE(MWA8_RAM)
9293   AM_RANGE(0x2000, 0x23ff) AM_WRITE(contra_fg_cram_w) AM_BASE(&contra_fg_cram)
9394   AM_RANGE(0x2400, 0x27ff) AM_WRITE(contra_fg_vram_w) AM_BASE(&contra_fg_vram)
r1649r1650
264265   MDRV_SCREEN_SIZE(37*8, 32*8)
265266   MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
266267   MDRV_GFXDECODE(contra)
267   MDRV_PALETTE_LENGTH(128)
268   MDRV_COLORTABLE_LENGTH(2*8*16*16)
268   MDRV_PALETTE_LENGTH(2*8*16*16)
269269
270270   MDRV_PALETTE_INIT(contra)
271271   MDRV_VIDEO_START(contra)
src/mame/drivers/zn.c
r1649r1650
88
99***************************************************************************/
1010
11#include <stdarg.h>
1211#include "driver.h"
12#include "deprecat.h"
1313#include "cpu/mips/psx.h"
1414#include "cpu/z80/z80.h"
1515#include "includes/psx.h"
src/mame/drivers/volfied.c
r1649r1650
4040********************************************************************/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "taitoipt.h"
4445#include "video/taitoic.h"
4546#include "audio/taitosnd.h"
src/mame/drivers/dribling.c
r1649r1650
2626***************************************************************************/
2727
2828#include "driver.h"
29#include "deprecat.h"
2930#include "machine/8255ppi.h"
3031#include "dribling.h"
3132
src/mame/drivers/balsente.c
r1649r1650
25052505GAME( 1985, minigol2, minigolf, balsente, minigol2, minigol2, ROT0, "Bally/Sente", "Mini Golf (set 2)", GAME_SUPPORTS_SAVE )
25062506GAME( 1985, toggle,   0,        balsente, toggle,   toggle,   ROT0, "Bally/Sente", "Toggle (prototype)", GAME_SUPPORTS_SAVE )
25072507GAME( 1986, nametune, 0,        balsente, nametune, nametune, ROT0, "Bally/Sente", "Name That Tune", GAME_SUPPORTS_SAVE )
2508GAME( 1986, nstocker, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker", GAME_SUPPORTS_SAVE )
2508GAME( 1986, nstocker, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 1)", GAME_SUPPORTS_SAVE )
25092509GAME( 1986, nstockr2, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 2)", GAME_SUPPORTS_SAVE )
25102510GAME( 1986, sfootbal, 0,        balsente, sfootbal, sfootbal, ROT0, "Bally/Sente", "Street Football", GAME_SUPPORTS_SAVE )
25112511GAME( 1986, spiker,   0,        balsente, spiker,   spiker,   ROT0, "Bally/Sente", "Spiker", GAME_SUPPORTS_SAVE )
src/mame/drivers/megadriv.c
r1649r1650
4343*/
4444
4545#include "driver.h"
46#include "deprecat.h"
4647#include "sound/sn76496.h"
4748#include "sound/2612intf.h"
4849#include "sound/upd7759.h"
r1649r1650
26082609VIDEO_UPDATE(megadriv)
26092610{
26102611   /* Copy our screen buffer here */
2611   copybitmap(bitmap, render_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
2612   copybitmap(bitmap, render_bitmap, 0, 0, 0, 0, cliprect);
26122613
26132614//  int xxx;
26142615   /* reference */
src/mame/drivers/galpani3.c
r1649r1650
6464*/
6565
6666#include "driver.h"
67#include "deprecat.h"
6768#include "sound/ymz280b.h"
6869
6970extern UINT32* skns_spc_regs;
src/mame/drivers/itech32.c
r1649r1650
211211****************************************************************************/
212212
213213#include "driver.h"
214#include "deprecat.h"
214215#include "cpu/m6809/m6809.h"
215216#include "cpu/m68000/m68000.h"
216217#include "machine/6522via.h"
src/mame/drivers/fitfight.c
r1649r1650
8282*/
8383
8484#include "driver.h"
85#include "deprecat.h"
8586#include "cpu/upd7810/upd7810.h"
8687#include "sound/okim6295.h"
8788
src/mame/drivers/sspeedr.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910#include "sspeedr.lh"
1011
src/mame/drivers/filetto.c
r1649r1650
6262******************************************************************************************/
6363
6464#include "driver.h"
65#include "deprecat.h"
6566#include "video/generic.h"
6667#include "machine/pit8253.h"
6768#include "machine/8255ppi.h"
src/mame/drivers/ashnojoe.c
r1649r1650
7777*************************************************************************/
7878
7979#include "driver.h"
80#include "deprecat.h"
8081#include "sound/2203intf.h"
8182#include "sound/msm5205.h"
8283
src/mame/drivers/findout.c
r1649r1650
6262static READ8_HANDLER( portC_r )
6363{
6464   return 4;
65//  return (mame_rand(Machine)&2);
6665}
6766
6867static READ8_HANDLER( port1_r )
src/mame/drivers/mouser.c
r1649r1650
1313*******************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "sound/ay8910.h"
1718
1819static UINT8 mouser_sound_byte;
src/mame/drivers/undrfire.c
r1649r1650
118118***************************************************************************/
119119
120120#include "driver.h"
121#include "deprecat.h"
121122#include "cpu/m68000/m68000.h"
122123#include "video/taitoic.h"
123124#include "audio/taitosnd.h"
src/mame/drivers/deco32.c
r1649r1650
224224***************************************************************************/
225225
226226#include "driver.h"
227#include "deprecat.h"
227228#include "cpu/arm/arm.h"
228229#include "cpu/h6280/h6280.h"
229230#include "cpu/m6809/m6809.h"
src/mame/drivers/vertigo.c
r1649r1650
1515#include "exidy440.h"
1616#include "machine/pit8253.h"
1717
18
19
1820/*************************************
1921 *
2022 *  Main CPU memory handlers
2123 *
2224 *************************************/
2325
24static ADDRESS_MAP_START( vertigo_main, ADDRESS_SPACE_PROGRAM, 16 )
26static ADDRESS_MAP_START( vertigo_map, ADDRESS_SPACE_PROGRAM, 16 )
2527   AM_RANGE(0x000000, 0x000007) AM_ROM
2628   AM_RANGE(0x000008, 0x001fff) AM_RAM AM_MIRROR(0x010000)
2729   AM_RANGE(0x002000, 0x003fff) AM_RAM AM_BASE(&vertigo_vectorram)
r1649r1650
3840   AM_RANGE(0x800000, 0x81ffff) AM_ROM
3941ADDRESS_MAP_END
4042
41/*************************************
42 *
43 *  Sound CPU memory handlers
44 *
45 *************************************/
4643
47static ADDRESS_MAP_START( vertigo_sound, ADDRESS_SPACE_PROGRAM, 8 )
48   AM_RANGE(0x8000, 0x8016) AM_READWRITE(exidy440_m6844_r,exidy440_m6844_w) AM_BASE(&exidy440_m6844_data)
49   AM_RANGE(0x8400, 0x8407) AM_READWRITE(MRA8_RAM, exidy440_sound_volume_w) AM_BASE(&exidy440_sound_volume)
50   AM_RANGE(0x8800, 0x8800) AM_READ(exidy440_sound_command_r)
51   AM_RANGE(0x9400, 0x9403) AM_RAM AM_BASE(&exidy440_sound_banks)
52   AM_RANGE(0x9800, 0x9800) AM_READWRITE(MRA8_NOP,exidy440_sound_interrupt_clear_w)
53   AM_RANGE(0xa000, 0xa7ff) AM_RAM
54   AM_RANGE(0xe000, 0xffff) AM_ROM
55ADDRESS_MAP_END
5644
5745/*************************************
5846 *
r1649r1650
6755ADDRESS_MAP_END
6856#endif
6957
58
59
7060/*************************************
7161 *
7262 *  Port definitions
r1649r1650
10191
10292INPUT_PORTS_END
10393
104/*************************************
105 *
106 *  Sound definitions
107 *
108 *************************************/
10994
110static const struct CustomSound_interface custom_interface =
111{
112   exidy440_sh_start,
113   exidy440_sh_stop
114};
11595
11696/*************************************
11797 *
118 *  Machine drivers
98 *  Machine driver
11999 *
120100 *************************************/
121101
r1649r1650
123103
124104   /* basic machine hardware */
125105   MDRV_CPU_ADD(M68000, 8000000)
126   MDRV_CPU_PROGRAM_MAP(vertigo_main,0)
106   MDRV_CPU_PROGRAM_MAP(vertigo_map,0)
127107   MDRV_CPU_PERIODIC_INT(vertigo_interrupt,60)
128108
129   /* audio CPU */
130   MDRV_CPU_ADD(M6809, 1000000)
131   MDRV_CPU_PROGRAM_MAP(vertigo_sound,0)
109   MDRV_IMPORT_FROM(exidy440_audio)
132110
133111   /* motor controller */
134112   /*
r1649r1650
141119   MDRV_MACHINE_RESET(vertigo)
142120   MDRV_NVRAM_HANDLER(generic_0fill)
143121
144
145122   /* video hardware */
146123   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_VECTOR )
147124   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
r1649r1650
151128
152129   MDRV_VIDEO_START(vector)
153130   MDRV_VIDEO_UPDATE(vector)
131MACHINE_DRIVER_END
154132
155   /* sound hardware */
156   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
157133
158   MDRV_SOUND_ADD(CUSTOM, 1000000/16)
159   MDRV_SOUND_CONFIG(custom_interface)
160   MDRV_SOUND_ROUTE(0, "left", 1.0)
161   MDRV_SOUND_ROUTE(1, "right", 1.0)
162134
163MACHINE_DRIVER_END
164
165135/*************************************
166136 *
167 *  ROM definitions
137 *  ROM definition
168138 *
169139 *************************************/
170140
r1649r1650
227197   ROM_LOAD( "vga3_4.bd1",    0x080, 0x780, CRC(a50dde56) SHA1(ef13f4cf01c9d483f2dc829a2e23965a6053f37a) )
228198ROM_END
229199
200
201
230202/*************************************
231203 *
232 *  Game drivers
204 *  Game driver
233205 *
234206 *************************************/
235207
src/mame/drivers/midzeus.c
r1649r1650
2525**************************************************************************/
2626
2727#include "driver.h"
28#include "debugger.h"
28#include "deprecat.h"
2929#include "cpu/tms34010/tms34010.h"
3030#include "cpu/adsp2100/adsp2100.h"
3131#include "includes/midzeus.h"
src/mame/drivers/grchamp.c
r1649r1650
4242***************************************************************************/
4343
4444#include "driver.h"
45#include "deprecat.h"
4546#include "cpu/z80/z80.h"
4647#include "sound/ay8910.h"
4748#include "grchamp.h"
src/mame/drivers/argus.c
r1649r1650
8484
8585
8686#include "driver.h"
87#include "deprecat.h"
8788#include "sound/2203intf.h"
8889
8990
src/mame/drivers/lkage.c
r1649r1650
2727***************************************************************************/
2828
2929#include "driver.h"
30#include "deprecat.h"
3031#include "cpu/z80/z80.h"
3132#include "cpu/m6805/m6805.h"
3233#include "sound/2203intf.h"
src/mame/drivers/superdq.c
r1649r1650
2222
2323#include "driver.h"
2424#include "render.h"
25#include "deprecat.h"
2526#include "sound/sn76496.h"
2627#include "sound/custom.h"
2728#include "machine/laserdsc.h"
src/mame/drivers/goodejan.c
r1649r1650
5252*******************************************************************************************/
5353
5454#include "driver.h"
55#include "deprecat.h"
5556#include "audio/seibu.h"
5657#include "sound/3812intf.h"
5758
src/mame/drivers/gaiden.c
r1649r1650
125125
126126
127127#include "driver.h"
128#include "deprecat.h"
128129#include "cpu/m68000/m68000.h"
129130#include "cpu/z80/z80.h"
130131#include "sound/2203intf.h"
src/mame/drivers/zaxxon.c
r1649r1650
1010        * Ixion
1111        * Congo Bongo
1212
13    DIP locations verified from manual for:
14        * Zaxxon
15        * Congo Bongo
16
1317    Known bugs:
1418        * discrete sound emulation
1519
r1649r1650
301305***************************************************************************/
302306
303307#include "driver.h"
308#include "deprecat.h"
304309#include "machine/segacrpt.h"
305310#include "machine/8255ppi.h"
306311#include "audio/segasnd.h"
r1649r1650
565570   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH )
566571
567572   PORT_START_TAG("DSW02")
568   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) )
573   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!1,!2")
569574   PORT_DIPSETTING(    0x03, "10000" )
570575   PORT_DIPSETTING(    0x01, "20000" )
571576   PORT_DIPSETTING(    0x02, "30000" )
572577   PORT_DIPSETTING(    0x00, "40000" )
573   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
574   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
578   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:!3")
579   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
580   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
581   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:!4")
582   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
583   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
584   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!5,!6")
575585   PORT_DIPSETTING(    0x30, "3" )
576586   PORT_DIPSETTING(    0x10, "4" )
577587   PORT_DIPSETTING(    0x20, "5" )
578588   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
579   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
589   PORT_DIPNAME( 0x40, 0x40, "Sound" ) PORT_DIPLOCATION("SW1:!7")
580590   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
581591   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
582   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
592   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!8")
583593   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
584594   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
585595
586596   PORT_START_TAG("DSW03")
587   PORT_DIPNAME( 0x0f, 0x03, DEF_STR ( Coin_B ) )
597   PORT_DIPNAME( 0x0f, 0x03, DEF_STR ( Coin_B ) ) PORT_DIPLOCATION("SW2:!1,!2,!3,!4")
588598   PORT_DIPSETTING(    0x0f, DEF_STR ( 4C_1C ) )
589599   PORT_DIPSETTING(    0x07, DEF_STR ( 3C_1C ) )
590600   PORT_DIPSETTING(    0x0b, DEF_STR ( 2C_1C ) )
r1649r1650
601611   PORT_DIPSETTING(    0x09, DEF_STR ( 1C_4C ) )
602612   PORT_DIPSETTING(    0x01, DEF_STR ( 1C_5C ) )
603613   PORT_DIPSETTING(    0x0e, DEF_STR ( 1C_6C ) )
604   PORT_DIPNAME( 0xf0, 0x30, DEF_STR ( Coin_A ) )
614   PORT_DIPNAME( 0xf0, 0x30, DEF_STR ( Coin_A ) ) PORT_DIPLOCATION("SW2:!5,!6,!7,!8")
605615   PORT_DIPSETTING(    0xf0, DEF_STR ( 4C_1C ) )
606616   PORT_DIPSETTING(    0x70, DEF_STR ( 3C_1C ) )
607617   PORT_DIPSETTING(    0xb0, DEF_STR ( 2C_1C ) )
r1649r1650
873883   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
874884   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
875885
876   PORT_START_TAG("DSW02")
877   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Difficulty ) )
886   PORT_MODIFY("DSW02")
887   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!3,!4")
878888   PORT_DIPSETTING(    0x0c, DEF_STR( Easy ) )
879889   PORT_DIPSETTING(    0x04, DEF_STR( Medium ) )
880890   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
src/mame/drivers/shangkid.c
r1649r1650
4949*/
5050
5151#include "driver.h"
52#include "deprecat.h"
5253#include "cpu/z80/z80.h"
5354#include "sound/ay8910.h"
5455#include "sound/dac.h"
src/mame/drivers/astrof.c
r1649r1650
4949
5050
5151#include "driver.h"
52#include "deprecat.h"
5253#include "astrof.h"
5354
5455
src/mame/drivers/karnov.c
r1649r1650
3838*******************************************************************************/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "sound/2203intf.h"
4243#include "sound/3812intf.h"
4344
src/mame/drivers/maxaflex.c
r1649r1650
1313******************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "cpu/m6502/m6502.h"
1718#include "cpu/m6805/m6805.h"
1819#include "includes/atari.h"
r1649r1650
2021#include "sound/pokey.h"
2122#include "machine/6821pia.h"
2223#include "video/gtia.h"
23#include "ui.h"
2424
2525#include "maxaflex.lh"
2626
src/mame/drivers/punchout.c
r1649r1650
9898***************************************************************************/
9999
100100#include "driver.h"
101#include "deprecat.h"
101102#include "cpu/m6502/m6502.h"
102103#include "sound/vlm5030.h"
103104#include "sound/nes_apu.h"
src/mame/drivers/vegas.c
r1649r1650
273273**************************************************************************/
274274
275275#include "driver.h"
276#include "deprecat.h"
276277#include "cpu/adsp2100/adsp2100.h"
277278#include "cpu/mips/mips3.h"
278279#include "audio/dcs.h"
src/mame/drivers/kopunch.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34extern UINT8 *kopunch_videoram2;
45
src/mame/drivers/tecmo.c
r1649r1650
4646
4747***************************************************************************/
4848#include "driver.h"
49#include "deprecat.h"
4950#include "cpu/z80/z80.h"
5051#include "sound/3812intf.h"
5152#include "sound/msm5205.h"
src/mame/drivers/galpanic.c
r1649r1650
118118***************************************************************************/
119119
120120#include "driver.h"
121#include "deprecat.h"
121122#include "includes/kaneko16.h"
122123#include "sound/okim6295.h"
123124#include "video/kan_pand.h"
src/mame/drivers/finalizr.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6809/m6809.h"
1112#include "cpu/i8039/i8039.h"
1213#include "sound/sn76496.h"
src/mame/drivers/segaybd.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "system16.h"
1415#include "cpu/m68000/m68000.h"
1516#include "machine/segaic16.h"
src/mame/drivers/shuuz.c
r1649r1650
1818
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/atarigen.h"
2223#include "shuuz.h"
2324#include "sound/okim6295.h"
src/mame/drivers/cclimber.c
r1649r1650
126126***************************************************************************/
127127
128128#include "driver.h"
129#include "deprecat.h"
129130#include "sound/ay8910.h"
130131#include "sound/samples.h"
131132#include "includes/cclimber.h"
r1649r1650
183184   AM_RANGE(0x0000, 0x5fff) AM_ROM
184185   AM_RANGE(0x6000, 0x6bff) AM_RAM            /* Crazy Kong only */
185186   AM_RANGE(0x8000, 0x83ff) AM_RAM
186   AM_RANGE(0x8800, 0x88ff) AM_READWRITE(MRA8_RAM, cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
187   AM_RANGE(0x8800, 0x88ff) AM_RAM AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
187188   AM_RANGE(0x8900, 0x8bff) AM_RAM            /* not used, but initialized */
188189   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
189190   /* 9800-9bff and 9c00-9fff share the same RAM, interleaved */
r1649r1650
210211   AM_RANGE(0x6000, 0x6bff) AM_RAM             /* Crazy Kong only, Cannon Ball also */
211212   AM_RANGE(0x8000, 0x83ff) AM_RAM
212213   AM_RANGE(0x8800, 0x8800) AM_READNOP          /* must not return what's written (game will reset after coin insert if it returns 0xff)*/
213   AM_RANGE(0x8800, 0x88ff) AM_READWRITE(MRA8_RAM, cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
214   AM_RANGE(0x8800, 0x88ff) AM_RAM AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
214215//AM_RANGE(0x8900, 0x8bff) AM_WRITE(MWA8_RAM)  /* not used, but initialized */
215216   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
216217   /* 9800-9bff and 9c00-9fff share the same RAM, interleaved */
r1649r1650
232233static ADDRESS_MAP_START( swimmer_map, ADDRESS_SPACE_PROGRAM, 8 )
233234   AM_RANGE(0x0000, 0x7fff) AM_ROM
234235   AM_RANGE(0x8000, 0x87ff) AM_RAM
235   AM_RANGE(0x8800, 0x88ff) AM_MIRROR(0x0100) AM_WRITE(cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
236   AM_RANGE(0x8800, 0x88ff) AM_MIRROR(0x0100) AM_RAM AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
236237   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
237238   AM_RANGE(0x9800, 0x981f) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_column_scroll)
238239   AM_RANGE(0x9880, 0x989f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
r1649r1650
241242   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)
242243   AM_RANGE(0xa001, 0xa001) AM_WRITE(flip_screen_x_w)
243244   AM_RANGE(0xa002, 0xa002) AM_WRITE(flip_screen_y_w)
244   AM_RANGE(0xa003, 0xa003) AM_WRITE(swimmer_sidepanel_enable_w)
245   AM_RANGE(0xa004, 0xa004) AM_WRITE(swimmer_palettebank_w)
245   AM_RANGE(0xa003, 0xa003) AM_WRITE(MWA8_RAM) AM_BASE(&swimmer_sidepanel_enabled)
246   AM_RANGE(0xa004, 0xa004) AM_WRITE(MWA8_RAM) AM_BASE(&swimmer_palettebank)
246247   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, swimmer_sh_soundlatch_w)
247248   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
248   AM_RANGE(0xb800, 0xb800) AM_READWRITE(input_port_3_r, swimmer_bgcolor_w)  /* river color in Swimmer */
249   AM_RANGE(0xb800, 0xb800) AM_READWRITE(input_port_3_r, MWA8_RAM) AM_BASE(&swimmer_bgcolor)
249250   AM_RANGE(0xb880, 0xb880) AM_READ(input_port_4_r)
250251   AM_RANGE(0xc000, 0xc7ff) AM_RAM               /* ??? used by Guzzler */
251252   AM_RANGE(0xe000, 0xffff) AM_ROM               /* Guzzler only */
r1649r1650
503504   CKONGIN2
504505INPUT_PORTS_END
505506
506static INPUT_PORTS_START( rpatrolb )
507static INPUT_PORTS_START( rpatrol )
507508   PORT_START_TAG("IN0")
508509   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
509510   PORT_BIT( 0x3e, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r1649r1650
797798   MDRV_SCREEN_SIZE(32*8, 32*8)
798799   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
799800   MDRV_GFXDECODE(cclimber)
800   MDRV_PALETTE_LENGTH(96)
801   MDRV_COLORTABLE_LENGTH(16*4+8*4)
801   MDRV_PALETTE_LENGTH(16*4+8*4)
802802
803803   MDRV_PALETTE_INIT(cclimber)
804804   MDRV_VIDEO_START(generic)
r1649r1650
851851   MDRV_SCREEN_SIZE(32*8, 32*8)
852852   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
853853   MDRV_GFXDECODE(swimmer)
854   MDRV_PALETTE_LENGTH(256+32+2)
855   MDRV_COLORTABLE_LENGTH(64*8+4*8)
854   MDRV_PALETTE_LENGTH(64*8+4*8)
856855
857856   MDRV_PALETTE_INIT(swimmer)
858857   MDRV_VIDEO_START(generic)
r1649r1650
13091308   I think the board was a half-converted board as 'Water Gage' and 'Bon Voyage' don't really fit the theme
13101309   of Silver Land so I'm loading the River Patrol GFX instead as they fit better
13111310*/
1312ROM_START( rpatrolo )
1311ROM_START( rpatrol )
13131312   ROM_REGION( 0x10000, REGION_CPU1, 0 )
13141313   ROM_LOAD( "sci1.bin",       0x0000, 0x1000, CRC(33b01c90) SHA1(9c8da6dd963bfb0544ef99b8fdedcf86c32cdb6b) )
13151314   ROM_LOAD( "sci2.bin",       0x1000, 0x1000, CRC(03f53340) SHA1(35336945f4b634fc4c7791ac9c9e6643c8cd8006) )
r1649r1650
15491548GAME( 1980, cclimbrj, cclimber, cclimber, cclimbrj, cclimbrj, ROT0,   "Nichibutsu", "Crazy Climber (Japan)", 0 )
15501549GAME( 1980, ccboot,   cclimber, cclimber, cclimber, cclimbrj, ROT0,   "bootleg", "Crazy Climber (bootleg set 1)", 0 )
15511550GAME( 1980, ccboot2,  cclimber, cclimber, cclimber, cclimbrj, ROT0,   "bootleg", "Crazy Climber (bootleg set 2)", 0 )
1552GAME( 1981, ckong,    0,        cclimber, ckong,    0,        ROT270, "Falcon", "Crazy Kong (set 1)", 0 )
1553GAME( 1981, ckonga,   ckong,    cclimber, ckong,    0,        ROT270, "Falcon", "Crazy Kong (set 2)", 0 )
1554GAME( 1981, ckongjeu, ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Crazy Kong (Jeutel bootleg)", 0 )
1551GAME( 1981, ckong,    0,        cclimber, ckong,    0,        ROT270, "Falcon", "Crazy Kong Part II (set 1)", 0 )
1552GAME( 1981, ckonga,   ckong,    cclimber, ckong,    0,        ROT270, "Falcon", "Crazy Kong Part II (set 2)", 0 )
1553GAME( 1981, ckongjeu, ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Crazy Kong Part II (Jeutel bootleg)", 0 )
15551554GAME( 1981, ckongo,   ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Crazy Kong (Orca bootleg)", 0 )
15561555GAME( 1981, ckongalc, ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Crazy Kong (Alca bootleg)", 0 )
15571556GAME( 198?, bigkong,  ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Big Kong", 0 )
15581557GAME( 1981, monkeyd,  ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Monkey Donkey", 0 )
1559GAME( 198?, ckongb,   ckong,    cclimber, ckongb,   ckongb,   ROT270, "bootleg", "Crazy Kong (Alternative levels)", 0 )
1558GAME( 198?, ckongb,   ckong,    cclimber, ckongb,   ckongb,   ROT270, "bootleg", "Crazy Kong Part II (alternative levels)", 0 )
15601559
1561GAME( 1981, rpatrolb, 0,        cclimber, rpatrolb, 0,        ROT0,   "bootleg", "River Patrol (bootleg)", 0 )
1562GAME( 1981, rpatrolo, rpatrolb, cclimber, rpatrolb, 0,        ROT0,   "Orca",  "River Patrol (Orca)", 0 )
1563GAME( 1981, silvland, rpatrolb, cclimber, rpatrolb, 0,        ROT0,   "Falcon", "Silver Land", 0 )
1560GAME( 1981, rpatrol,  0,        cclimber, rpatrol,  0,        ROT0,   "Orca", "River Patrol (Orca)", 0 )
1561GAME( 1981, rpatrolb, rpatrol,  cclimber, rpatrol,  0,        ROT0,   "bootleg", "River Patrol (bootleg)", 0 )
1562GAME( 1981, silvland, rpatrol,  cclimber, rpatrol,  0,        ROT0,   "Falcon", "Silver Land", 0 )
15641563
15651564GAME( 1985, cannonb,  cannonbp, cannonb,  cannonb,  cannonb,  ROT90,  "Soft", "Cannon Ball (bootleg on Crazy Climber hardware, set 1)" , GAME_IMPERFECT_GRAPHICS )
15661565GAME( 1985, cannonb2, cannonbp, cannonb,  cannonb,  cannonb2, ROT90,  "TV Game Gruenberg", "Cannon Ball (bootleg on Crazy Climber hardware, set 2)", 0 )
src/mame/drivers/speedspn.c
r1649r1650
2121******************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "sound/okim6295.h"
2526
2627/*** README INFO **************************************************************
src/mame/drivers/enigma2.c
r1649r1650
1919*********************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "sound/ay8910.h"
2324
2425
src/mame/drivers/cowrace.c
r1649r1650
77*************************************************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "sound/okim6295.h"
1112#include "sound/2203intf.h"
1213
src/mame/drivers/segaorun.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "system16.h"
1819#include "machine/segaic16.h"
1920#include "machine/8255ppi.h"
src/mame/drivers/gticlub.c
r1649r1650
3535*/
3636
3737#include "driver.h"
38#include "deprecat.h"
3839#include "machine/eeprom.h"
3940#include "cpu/powerpc/ppc.h"
4041#include "cpu/sharc/sharc.h"
src/mame/drivers/cloak.c
r1649r1650
108108*/
109109
110110#include "driver.h"
111#include "deprecat.h"
111112#include "sound/pokey.h"
112113
113114static int cloak_nvram_enabled;
src/mame/drivers/mazerbla.c
r1649r1650
3636****************************************************************************/
3737
3838#include "driver.h"
39#include "deprecat.h"
3940#include "sound/ay8910.h"
4041
4142static UINT8 *cfb_ram;
r1649r1650
139140
140141
141142   if (planes_enabled[3])
142      copybitmap(bitmap,tmpbitmaps[3],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE, 0 );
143      copybitmap(bitmap,tmpbitmaps[3],0,0,0,0,cliprect);
143144
144145
145146   if (planes_enabled[2])
146      copybitmap(bitmap,tmpbitmaps[2],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[color_base] );
147      copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,machine->pens[color_base] );
147148   fillbitmap(tmpbitmaps[2],machine->pens[color_base],NULL);
148149
149150
150151   if (planes_enabled[1])
151      copybitmap(bitmap,tmpbitmaps[1],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[color_base] );
152      copybitmap_trans(bitmap,tmpbitmaps[1],0,0,0,0,cliprect,machine->pens[color_base] );
152153   fillbitmap(tmpbitmaps[1],machine->pens[color_base],NULL);
153154
154155
155156   if (planes_enabled[0])
156      copybitmap(bitmap,tmpbitmaps[0],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[color_base] );
157      copybitmap_trans(bitmap,tmpbitmaps[0],0,0,0,0,cliprect,machine->pens[color_base] );
157158   fillbitmap(tmpbitmaps[0],machine->pens[color_base],NULL);
158159
159160   if (input_code_pressed_once(KEYCODE_1))   /* plane 1 */
r1649r1650
249250
250251//fillbitmap(bitmap,0,NULL);
251252
252   copybitmap(bitmap,tmpbitmaps[3],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE, 0 );
253   copybitmap(bitmap,tmpbitmaps[2],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[color_base] );
254   copybitmap(bitmap,tmpbitmaps[1],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[color_base] );
255   copybitmap(bitmap,tmpbitmaps[0],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[color_base] );
253   copybitmap      (bitmap,tmpbitmaps[3],0,0,0,0,cliprect);
254   copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,machine->pens[color_base] );
255   copybitmap_trans(bitmap,tmpbitmaps[1],0,0,0,0,cliprect,machine->pens[color_base] );
256   copybitmap_trans(bitmap,tmpbitmaps[0],0,0,0,0,cliprect,machine->pens[color_base] );
256257   return 0;
257258}
258259
r1649r1650
269270
270271//fillbitmap(bitmap,0,NULL);
271272
272   copybitmap(bitmap,tmpbitmaps[3],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE, 0 ); //text
273   copybitmap(bitmap,tmpbitmaps[2],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[0] );
274   copybitmap(bitmap,tmpbitmaps[1],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[0] ); //haircross
275   copybitmap(bitmap,tmpbitmaps[0],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN, machine->pens[0] ); //sprites
273   copybitmap      (bitmap,tmpbitmaps[3],0,0,0,0,cliprect); //text
274   copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,machine->pens[0] );
275   copybitmap_trans(bitmap,tmpbitmaps[1],0,0,0,0,cliprect,machine->pens[0] ); //haircross
276   copybitmap_trans(bitmap,tmpbitmaps[0],0,0,0,0,cliprect,machine->pens[0] ); //sprites
276277   return 0;
277278}
278279
src/mame/drivers/namcona1.c
r1649r1650
173173***************************************************************************/
174174
175175#include "driver.h"
176#include "deprecat.h"
176177#include "namcona1.h"
177178#include "sound/c140.h"
178179#include "sound/namcona.h"
src/mame/drivers/armedf.c
r1649r1650
14171417}
14181418
14191419
1420/*     YEAR, NAME,   PARENT,   MACHINE,  INPUT,    INIT,     MONITOR, COMPANY,     FULLNAME, FLAGS */
1420/*     YEAR, NAME,    PARENT,   MACHINE,  INPUT,    INIT,     MONITOR, COMPANY,     FULLNAME, FLAGS */
14211421GAME( 1987, legion,   0,        legion,   legion,   legion,   ROT270, "Nichibutsu", "Legion (ver 2.03)",  GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
14221422GAME( 1987, legiono,  legion,   legiono,  legion,   legiono,  ROT270, "Nichibutsu", "Legion (ver 1.05)",  GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
1423GAME( 1987, terraf,   0,        terraf,   terraf,   terraf,   ROT0,   "Nichibutsu", "Terra Force",  GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
1423GAME( 1987, terraf,   0,        terraf,   terraf,   terraf,   ROT0,   "Nichibutsu", "Terra Force (set 1)",  GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
14241424GAME( 1987, terrafa,  terraf,   terraf,   terraf,   terrafu,  ROT0,   "Nichibutsu", "Terra Force (set 2)",  GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
14251425GAME( 1987, terrafu,  terraf,   terraf,   terraf,   terrafu,  ROT0,   "Nichibutsu USA", "Terra Force (US)",  GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
14261426GAME( 1987, kodure,   0,        kodure,   kodure,   kodure,   ROT0,   "Nichibutsu", "Kodure Ookami (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
1427GAME(  1988, cclimbr2, 0,        cclimbr2, cclimbr2, cclimbr2, ROT0,   "Nichibutsu", "Crazy Climber 2 (Japan)", 0)
1428GAME(  1988, cclmbr2a, cclimbr2, cclimbr2, cclimbr2, cclimbr2, ROT0,   "Nichibutsu", "Crazy Climber 2 (Japan Harder)", 0)
1429GAME(  1988, armedf,   0,        armedf,   armedf,   armedf,   ROT270, "Nichibutsu", "Armed Formation", 0)
1427GAME( 1988, cclimbr2, 0,        cclimbr2, cclimbr2, cclimbr2, ROT0,   "Nichibutsu", "Crazy Climber 2 (Japan)", 0)
1428GAME( 1988, cclmbr2a, cclimbr2, cclimbr2, cclimbr2, cclimbr2, ROT0,   "Nichibutsu", "Crazy Climber 2 (Japan, Harder)", 0)
1429GAME( 1988, armedf,   0,        armedf,   armedf,   armedf,   ROT270, "Nichibutsu", "Armed Formation", 0)
src/mame/drivers/dkong.c
r1649r1650
248248***************************************************************************/
249249
250250#include "driver.h"
251#include "deprecat.h"
251252#include "cpu/s2650/s2650.h"
252253#include "cpu/m6502/m6502.h"
253254#include "includes/dkong.h"
254255#include "machine/8257dma.h"
255256#include "machine/z80dma.h"
256#include <math.h>
257257
258258/*************************************
259259 *
src/mame/drivers/appoooh.c
r1649r1650
241241   MDRV_SCREEN_SIZE(32*8, 32*8)
242242   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
243243   MDRV_GFXDECODE(appoooh)
244   MDRV_PALETTE_LENGTH(32)
245   MDRV_COLORTABLE_LENGTH(32*8+32*8)
244   MDRV_PALETTE_LENGTH(32*8+32*8)
246245
247246   MDRV_PALETTE_INIT(appoooh)
248247   MDRV_VIDEO_START(appoooh)
r1649r1650
486485   MDRV_SCREEN_SIZE(32*8, 32*8)
487486   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
488487   MDRV_GFXDECODE(robowres)
489   MDRV_PALETTE_LENGTH(32)
490   MDRV_COLORTABLE_LENGTH(32*8+32*8)
488   MDRV_PALETTE_LENGTH(32*8+32*8)
491489
492490   MDRV_PALETTE_INIT(robowres)
493491   MDRV_VIDEO_START(appoooh)
src/mame/drivers/travrusa.c
r1649r1650
6565
6666
6767
68static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
69   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
70   AM_RANGE(0x8000, 0x8fff) AM_READ(MRA8_RAM)        /* Video and Color ram */
68static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
69   AM_RANGE(0x0000, 0x7fff) AM_ROM
70   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(MRA8_RAM, travrusa_videoram_w) AM_BASE(&travrusa_videoram)
71   AM_RANGE(0x9000, 0x9000) AM_WRITE(travrusa_scroll_x_low_w)
72   AM_RANGE(0xa000, 0xa000) AM_WRITE(travrusa_scroll_x_high_w)
73   AM_RANGE(0xc800, 0xc9ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
74   AM_RANGE(0xd000, 0xd000) AM_WRITE(irem_sound_cmd_w)
75   AM_RANGE(0xd001, 0xd001) AM_WRITE(travrusa_flipscreen_w)   /* + coin counters - not written by shtrider */
7176   AM_RANGE(0xd000, 0xd000) AM_READ(input_port_0_r)   /* IN0 */
7277   AM_RANGE(0xd001, 0xd001) AM_READ(input_port_1_r)   /* IN1 */
7378   AM_RANGE(0xd002, 0xd002) AM_READ(input_port_2_r)   /* IN2 */
7479   AM_RANGE(0xd003, 0xd003) AM_READ(input_port_3_r)   /* DSW1 */
7580   AM_RANGE(0xd004, 0xd004) AM_READ(input_port_4_r)   /* DSW2 */
76   AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_RAM)
81   AM_RANGE(0xe000, 0xefff) AM_RAM
7782ADDRESS_MAP_END
7883
79static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
80   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
81   AM_RANGE(0x8000, 0x8fff) AM_WRITE(travrusa_videoram_w) AM_BASE(&travrusa_videoram)
82   AM_RANGE(0x9000, 0x9000) AM_WRITE(travrusa_scroll_x_low_w)
83   AM_RANGE(0xa000, 0xa000) AM_WRITE(travrusa_scroll_x_high_w)
84   AM_RANGE(0xc800, 0xc9ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
85   AM_RANGE(0xd000, 0xd000) AM_WRITE(irem_sound_cmd_w)
86   AM_RANGE(0xd001, 0xd001) AM_WRITE(travrusa_flipscreen_w)   /* + coin counters - not written by shtrider */
87   AM_RANGE(0xe000, 0xefff) AM_WRITE(MWA8_RAM)
88ADDRESS_MAP_END
89
9084#define TRAV_COMMON\
9185   PORT_START_TAG("IN0")\
9286   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )\
r1649r1650
333327
334328   /* basic machine hardware */
335329   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz (?) */
336   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
330   MDRV_CPU_PROGRAM_MAP(main_map,0)
337331   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
338332
339333   MDRV_SCREEN_REFRESH_RATE(56.75)
r1649r1650
356350   MDRV_VIDEO_UPDATE(travrusa)
357351
358352   /* sound hardware */
359   MDRV_IMPORT_FROM(irem_audio)
353   MDRV_IMPORT_FROM(m52_small_audio)
360354MACHINE_DRIVER_END
361355
362356static MACHINE_DRIVER_START( shtrider )
r1649r1650
385379   ROM_LOAD( "zr1-6a.k3", 0x4000, 0x2000, CRC(e1b51383) SHA1(34f4476c1bcc28c53c8ffa7b614f443a329aae13) )
386380   ROM_LOAD( "zr1-7.j3", 0x6000, 0x2000, CRC(85cd1a51) SHA1(7eb046514845cb9d2507ee24d1b2f7cc5402ac02) )
387381
388   ROM_REGION( 0x10000, REGION_CPU2, 0 )
389   ROM_LOAD( "mr10.1a",      0xf000, 0x1000, CRC(a02ad8a0) SHA1(aff80b506dbecabed2a36eb743693940f6a22d16) )
382   ROM_REGION( 0x8000, REGION_CPU2, 0 )
383   ROM_LOAD( "mr10.1a",      0x7000, 0x1000, CRC(a02ad8a0) SHA1(aff80b506dbecabed2a36eb743693940f6a22d16) )
390384
391385   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
392386   ROM_LOAD( "zippyrac.001", 0x00000, 0x2000, CRC(aa8994dd) SHA1(9b326ce52a03d723e5c3c1b5fd4aa8fa7f70f904) )
r1649r1650
411405   ROM_LOAD( "mr2.3k",       0x4000, 0x2000, CRC(8a2374ec) SHA1(7159731f5ef2485e3c822e3e8e51e9583dd1c6bc) )
412406   ROM_LOAD( "mr3.3j",       0x6000, 0x2000, CRC(2f04c341) SHA1(ae990d9d4abdd7d6ef9d21aa62125fe2e0067623) )
413407
414   ROM_REGION( 0x10000, REGION_CPU2, 0 )
415   ROM_LOAD( "mr10.1a",      0xf000, 0x1000, CRC(a02ad8a0) SHA1(aff80b506dbecabed2a36eb743693940f6a22d16) )
408   ROM_REGION( 0x8000, REGION_CPU2, 0 )
409   ROM_LOAD( "mr10.1a",      0x7000, 0x1000, CRC(a02ad8a0) SHA1(aff80b506dbecabed2a36eb743693940f6a22d16) )
416410
417411   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
418412   ROM_LOAD( "mr7.3e",       0x00000, 0x2000, CRC(492a60be) SHA1(9a3d6407b834eb7c3e3c8bb292ff124550a2787c) )
r1649r1650
438432   ROM_LOAD( "sr03a.bin", 0x4000, 0x2000, CRC(3ade11b9) SHA1(70b9dbd510cf6192194acf6876856d4c19bdf279) )
439433   ROM_LOAD( "sr04a.bin", 0x6000, 0x2000, CRC(02b96eaa) SHA1(ba4d61cf57142192684c45dd22720234d3521241) )
440434
441   ROM_REGION( 0x10000, REGION_CPU2, 0 )
442   ROM_LOAD( "sr11a.bin", 0xe000, 0x2000, CRC(a8396b76) SHA1(614151fb1d25930e9fee4ab290a63f8fe97adbe6) )
435   ROM_REGION( 0x8000, REGION_CPU2, 0 )
436   ROM_LOAD( "sr11a.bin", 0x6000, 0x2000, CRC(a8396b76) SHA1(614151fb1d25930e9fee4ab290a63f8fe97adbe6) )
443437
444438   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
445439   ROM_LOAD( "sr05a.bin", 0x0000, 0x2000, CRC(34449f79) SHA1(30aa9da07bf32282d213f63e50c564a336fd0102) )
r1649r1650
465459   ROM_LOAD( "3.bin",   0x4000, 0x2000, CRC(78d051cd) SHA1(e1dc2dcfc4af35bdd5245d23977e8640d81a43f1) )
466460   ROM_LOAD( "4.bin",   0x6000, 0x2000, CRC(02b96eaa) SHA1(ba4d61cf57142192684c45dd22720234d3521241) )
467461
468   ROM_REGION( 0x10000, REGION_CPU2, 0 )
469   ROM_LOAD( "11.bin",   0xe000, 0x2000, CRC(a8396b76) SHA1(614151fb1d25930e9fee4ab290a63f8fe97adbe6) )
462   ROM_REGION( 0x8000, REGION_CPU2, 0 )
463   ROM_LOAD( "11.bin",   0x6000, 0x2000, CRC(a8396b76) SHA1(614151fb1d25930e9fee4ab290a63f8fe97adbe6) )
470464
471465   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
472466   ROM_LOAD( "5.bin",   0x0000, 0x2000, CRC(34449f79) SHA1(30aa9da07bf32282d213f63e50c564a336fd0102) )
src/mame/drivers/metlclsh.c
r1649r1650
3232***************************************************************************/
3333
3434#include "driver.h"
35#include "deprecat.h"
3536#include "cpu/m6809/m6809.h"
3637#include "sound/2203intf.h"
3738#include "sound/3812intf.h"
src/mame/drivers/aliens.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1213#include "video/konamiic.h"
1314#include "sound/k007232.h"
src/mame/drivers/88games.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/konami/konami.h"
910#include "cpu/z80/z80.h"
1011#include "video/konamiic.h"
src/mame/drivers/ddenlovr.c
r1649r1650
9393***************************************************************************/
9494
9595#include "driver.h"
96#include "deprecat.h"
9697#include "cpu/z80/z80.h"
9798#include "sound/ay8910.h"
9899#include "sound/okim6295.h"
r1649r1650
12101211
12111212VIDEO_UPDATE(ddenlovr)
12121213{
1213   copybitmap(bitmap,framebuffer,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
1214   copybitmap(bitmap,framebuffer,0,0,0,0,cliprect);
12141215   return 0;
12151216}
12161217
r1649r1650
84878488GAME( 1993, quizchql, quizchq,  quizchq,  quizchq,  0,        ROT0, "Nakanihon (Laxan license)",                   "Quiz Channel Question (Ver 1.23) (Taiwan?)",         GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
84888489GAME( 1993, animaljr, 0,        mmpanic,  animaljr, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "Animalandia Jr.",                                    GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
84898490GAME( 1994, hginga,   0,        hginga,   hginga,   0,        ROT0, "Dynax",                                       "Hanafuda Hana Ginga",                                GAME_NO_COCKTAIL )
8490GAME( 1994, mjmyster, 0,        mjmyster, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World",                      GAME_NO_COCKTAIL )
8491GAME( 1994, mjmyster, 0,        mjmyster, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World (set 1)",               GAME_NO_COCKTAIL )
84918492GAME( 1994, mjmywrld, mjmyster, mjmywrld, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World (set 2)",               GAME_NO_COCKTAIL )
84928493GAME( 1994, mjmyornt, 0,        mjmyornt, mjmyornt, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Orient",                      GAME_NO_COCKTAIL )
84938494GAME( 1994, mjmyuniv, 0,        mjmyuniv, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Universe",                    GAME_NO_COCKTAIL )
src/mame/drivers/chinagat.c
r1649r1650
6969
7070
7171#include "driver.h"
72#include "deprecat.h"
7273#include "cpu/m6809/m6809.h"
7374#include "cpu/z80/z80.h"
7475#include "cpu/i8039/i8039.h"
src/mame/drivers/kaneko16.c
r1649r1650
5757- Finish the Inputs (different wheels and pedals)
5858- Find infos about the communication stuff (even if it won't be supported)
5959
60Dip locations verified from manual for:
61
62- berlwall
63- mgcrystl
64- blazeon
65- bakubrkr
66- bloodwar
67- gtmr
68- gtmr2
69- shogwarr
70
6071***************************************************************************/
6172
6273#include "driver.h"
74#include "deprecat.h"
6375#include "machine/eeprom.h"
6476#include "includes/kaneko16.h"
6577#include "sound/2203intf.h"
r1649r1650
868880
869881static INPUT_PORTS_START( bakubrkr )
870882   PORT_START   // IN0 - Player 1 + DSW - e00000.w
871   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
883   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
872884   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
873885   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
874   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
875   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) /* All other game settings done through the test mode */
876   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
877   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
878   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
879   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
880   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
881   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
882   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
883   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
884   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
885   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
886   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
887   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
888   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
889   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
890   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
891   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
892   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
886   PORT_SERVICE_DIPLOC(  0x0002, IP_ACTIVE_LOW, "SW1:2" )
887   /* All other game settings done through the test mode */
888   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) /* Listed as "Unused" */
889   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" ) /* Listed as "Unused" */
890   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" ) /* Listed as "Unused" */
891   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" ) /* Listed as "Unused" */
892   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" ) /* Listed as "Unused" */
893   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) /* Listed as "Unused" */
893894
894895   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
895896   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r1649r1650
977978   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
978979   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
979980
980   PORT_START   // IN4 - DSW 1 - $200018.b <- ! $80001d.b
981   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
981   PORT_START_TAG("DSW1")   // IN4 - DSW 1 - $200018.b <- ! $80001d.b
982   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
982983   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
983984   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
984   PORT_DIPNAME( 0x02, 0x02, "Reserved" )
985   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
986   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
987   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_A ) )
985   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:2" ) /* Listed as "Unused" */
986   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,4,5")
988987   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
989988   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
990989   PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ) )
r1649r1650
993992   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
994993   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
995994   PORT_DIPSETTING(    0x10, DEF_STR( 1C_4C ) )
996   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_B ) )
995   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:6,7,8")
997996   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
998997   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
999998   PORT_DIPSETTING(    0x40, DEF_STR( 2C_3C ) )
r1649r1650
10031002   PORT_DIPSETTING(    0x20, DEF_STR( 1C_5C ) )
10041003   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
10051004
1006   PORT_START   // IN5 - DSW 2 - $200019.b <- $80001f.b
1007   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
1005   PORT_START_TAG("DSW2")   // IN5 - DSW 2 - $200019.b <- $80001f.b
1006   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
10081007   PORT_DIPSETTING(    0x02, DEF_STR( Easy )    )
10091008   PORT_DIPSETTING(    0x03, DEF_STR( Normal )  )
10101009   PORT_DIPSETTING(    0x01, DEF_STR( Hard )    )
10111010   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1012   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )   // 1p lives at 202982.b
1013   PORT_DIPSETTING(    0x00, "1" )
1014   PORT_DIPSETTING(    0x0c, "2" )
1015   PORT_DIPSETTING(    0x08, "3" )
1011   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")   // 1p lives at 202982.b
1012   PORT_DIPSETTING(    0x08, "2" )
1013   PORT_DIPSETTING(    0x0c, "3" )
10161014   PORT_DIPSETTING(    0x04, "5" )
1017   PORT_DIPNAME( 0x30, 0x30, "Country"   )
1015   PORT_DIPSETTING(    0x00, "7" )
1016   PORT_DIPNAME( 0x30, 0x30, "Country" ) PORT_DIPLOCATION("SW2:5,6")
10181017   PORT_DIPSETTING(    0x30, "England" )
10191018   PORT_DIPSETTING(    0x20, "Italy"   )
10201019   PORT_DIPSETTING(    0x10, "Germany" )
1021   PORT_DIPSETTING(    0x00, "Freeze Screen" )
1022   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
1020   PORT_DIPSETTING(    0x00, "Freeze Screen" ) // Not documented
1021   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
10231022   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10241023   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1025   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1024   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW2:8" )
10261025INPUT_PORTS_END
10271026
10281027
r1649r1650
10331032//  Same as berlwall, but for a different lives setting
10341033
10351034static INPUT_PORTS_START( berlwalt )
1036   PORT_START   // IN0 - Player 1 - 680000.w
1037   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1038   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1039   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1040   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1041   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1042   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1043   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1044   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1035   PORT_INCLUDE(berlwall)
1036   PORT_MODIFY("DSW2")
10451037
1046   PORT_START   // IN1 - Player 2 - 680002.w
1047   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1048   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1049   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1050   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1051   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1052   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1053   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1054   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1055
1056   PORT_START   // IN2 - Coins - 680004.w
1057   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
1058   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )
1059   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1060   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1061   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1062   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1063   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1064   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
1065
1066   PORT_START   // IN3 - ? - 680006.w
1067   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1068   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1069   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1070   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1071   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1072   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1073   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1074   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1075
1076   PORT_START   // IN4 - DSW 1 - $80001d.b
1077   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
1078   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1079   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1080   PORT_DIPNAME( 0x02, 0x02, "Reserved" )
1081   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1082   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1083   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_A ) )
1084   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1085   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
1086   PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ) )
1087   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
1088   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) )
1089   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
1090   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
1091   PORT_DIPSETTING(    0x10, DEF_STR( 1C_4C ) )
1092   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_B ) )
1093   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
1094   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
1095   PORT_DIPSETTING(    0x40, DEF_STR( 2C_3C ) )
1096   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
1097   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
1098   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1099   PORT_DIPSETTING(    0x20, DEF_STR( 1C_5C ) )
1100   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
1101
1102   PORT_START   // IN5 - DSW 2 - $80001f.b
1103   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
1104   PORT_DIPSETTING(    0x02, DEF_STR( Easy )    )
1105   PORT_DIPSETTING(    0x03, DEF_STR( Normal )  )
1106   PORT_DIPSETTING(    0x01, DEF_STR( Hard )    )
1107   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1108   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1109   PORT_DIPSETTING(    0x00, "7" )
1038   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1039   PORT_DIPSETTING(    0x00, "1" )
1040   PORT_DIPSETTING(    0x0c, "2" )
1041   PORT_DIPSETTING(    0x08, "3" )
11101042   PORT_DIPSETTING(    0x04, "5" )
1111   PORT_DIPSETTING(    0x0c, "3" )
1112   PORT_DIPSETTING(    0x08, "2" )
1113   PORT_DIPNAME( 0x30, 0x30, "Country"   )
1114   PORT_DIPSETTING(    0x30, "England" )
1115   PORT_DIPSETTING(    0x20, "Italy"   )
1116   PORT_DIPSETTING(    0x10, "Germany" )
1117   PORT_DIPSETTING(    0x00, "Freeze Screen" )
1118   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
1119   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1120   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1121   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
11221043INPUT_PORTS_END
11231044
11241045
r1649r1650
11281049
11291050static INPUT_PORTS_START( blazeon )
11301051   PORT_START   // IN0 - Player 1 + DSW - c00000.w
1131   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
1132   PORT_DIPSETTING(      0x0002, DEF_STR( Easy )    )
1133   PORT_DIPSETTING(      0x0003, DEF_STR( Normal )  )
1134   PORT_DIPSETTING(      0x0001, DEF_STR( Hard )    )
1135   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1136   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) )
1137   PORT_DIPSETTING(      0x0000, "2" )
1138   PORT_DIPSETTING(      0x000c, "3" )
1139   PORT_DIPSETTING(      0x0008, "4" )
1140   PORT_DIPSETTING(      0x0004, "5" )
1141   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Demo_Sounds ) )
1142   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1143   PORT_DIPSETTING(      0x0010, DEF_STR( On ) )
1144   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1145   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1146   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1147   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1148   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1149   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1150   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1052   PORT_DIPNAME( 0x0003,  0x0003, DEF_STR( Difficulty )  ) PORT_DIPLOCATION("SW2:1,2")
1053   PORT_DIPSETTING(       0x0002, DEF_STR( Easy )        )
1054   PORT_DIPSETTING(       0x0003, DEF_STR( Normal )      )
1055   PORT_DIPSETTING(       0x0001, DEF_STR( Hard )        )
1056   PORT_DIPSETTING(       0x0000, DEF_STR( Hardest )     )
1057   PORT_DIPNAME( 0x000c,  0x000c, DEF_STR( Lives )       ) PORT_DIPLOCATION("SW2:3,4")
1058   PORT_DIPSETTING(       0x0000, "2"                    )
1059   PORT_DIPSETTING(       0x000c, "3"                    )
1060   PORT_DIPSETTING(       0x0008, "4"                    )
1061   PORT_DIPSETTING(       0x0004, "5"                    )
1062   PORT_DIPNAME( 0x0010,  0x0010, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:5")
1063   PORT_DIPSETTING(       0x0000, DEF_STR( Off )         )
1064   PORT_DIPSETTING(       0x0010, DEF_STR( On )          )
1065   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6"        ) /* Listed as "Unused" */
1066   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7"        ) /* Listed as "Unused" */
1067   PORT_SERVICE_DIPLOC(   0x0080, IP_ACTIVE_LOW, "SW2:8" )
11511068
1152   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1153   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1154   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1155   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1156   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1157   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1158   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START1                       )
1159   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1069   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(1)
1070   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(1)
1071   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(1)
1072   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1073   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1        ) PORT_PLAYER(1)
1074   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2        ) PORT_PLAYER(1)
1075   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START1         )
1076   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1          ) PORT_IMPULSE(2)
11601077
11611078   PORT_START   // IN1 - Player 2 - c00002.w
1162   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) )
1163   PORT_DIPSETTING(      0x0007, DEF_STR( 4C_1C ) )
1164   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
1079   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A )   ) PORT_DIPLOCATION("SW1:1,2,3,4")
1080   PORT_DIPSETTING(      0x0007, DEF_STR( 4C_1C )    )
1081   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C )    )
11651082   PORT_DIPSETTING(      0x0005, "6 Coins/3 Credits" )
1166   PORT_DIPSETTING(      0x0009, DEF_STR( 2C_1C ) )
1167   PORT_DIPSETTING(      0x0004, DEF_STR( 4C_3C ) )
1168   PORT_DIPSETTING(      0x000f, DEF_STR( 1C_1C ) )
1169//  PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
1083   PORT_DIPSETTING(      0x0009, DEF_STR( 2C_1C )    )
1084   PORT_DIPSETTING(      0x0004, DEF_STR( 4C_3C )    )
1085   PORT_DIPSETTING(      0x000f, DEF_STR( 1C_1C )    )
1086//  PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C )    )
11701087   PORT_DIPSETTING(      0x0003, "5 Coins/6 Credits" )
1171   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_5C ) )
1172   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C ) )
1173//  PORT_DIPSETTING(      0x0001, DEF_STR( 2C_3C ) )
1174   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_2C ) )
1175   PORT_DIPSETTING(      0x000d, DEF_STR( 1C_3C ) )
1176   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_4C ) )
1177   PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ) )
1178   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
1088   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_5C )    )
1089   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C )    )
1090//  PORT_DIPSETTING(      0x0001, DEF_STR( 2C_3C )    )
1091   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_2C )    )
1092   PORT_DIPSETTING(      0x000d, DEF_STR( 1C_3C )    )
1093   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_4C )    )
1094   PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C )    )
1095   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C )    )
11791096
1180   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) )
1181   PORT_DIPSETTING(      0x0070, DEF_STR( 4C_1C ) )
1182   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ) )
1097   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B )   ) PORT_DIPLOCATION("SW1:5,6,7,8")
1098   PORT_DIPSETTING(      0x0070, DEF_STR( 4C_1C )    )
1099   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C )    )
11831100   PORT_DIPSETTING(      0x0050, "6 Coins/3 Credits" )
1184   PORT_DIPSETTING(      0x0090, DEF_STR( 2C_1C ) )
1185   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_3C ) )
1186   PORT_DIPSETTING(      0x00f0, DEF_STR( 1C_1C ) )
1187//  PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
1101   PORT_DIPSETTING(      0x0090, DEF_STR( 2C_1C )    )
1102   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_3C )    )
1103   PORT_DIPSETTING(      0x00f0, DEF_STR( 1C_1C )    )
1104//  PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C )    )
11881105   PORT_DIPSETTING(      0x0030, "5 Coins/6 Credits" )
1189   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_5C ) )
1190   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C ) )
1191//  PORT_DIPSETTING(      0x0010, DEF_STR( 2C_3C ) )
1192   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_2C ) )
1193   PORT_DIPSETTING(      0x00d0, DEF_STR( 1C_3C ) )
1194   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_4C ) )
1195   PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ) )
1196   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_6C ) )
1106   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_5C )    )
1107   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C )    )
1108//  PORT_DIPSETTING(      0x0010, DEF_STR( 2C_3C )    )
1109   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_2C )    )
1110   PORT_DIPSETTING(      0x00d0, DEF_STR( 1C_3C )    )
1111   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_4C )    )
1112   PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C )    )
1113   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_6C )    )
11971114
1198   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1199   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1200   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1201   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1202   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1203   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1204   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START2                       )
1205   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1115   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(2)
1116   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(2)
1117   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(2)
1118   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1119   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1        ) PORT_PLAYER(2)
1120   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2        ) PORT_PLAYER(2)
1121   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2         )
1122   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2          ) PORT_IMPULSE(2)
12061123
12071124   PORT_START   // IN2 - ? - c00004.w
1208   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
1125   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
12091126
12101127   PORT_START   // IN3 - Other Buttons - c00006.w
1211   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1212   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1213   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1214   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1215   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1216   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1217   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_TILT  )
1218   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_SERVICE1 )
1128   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1129   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1130   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1131   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1132   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1133   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_SERVICE  ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1134   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_TILT     )
1135   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE1 )
12191136INPUT_PORTS_END
12201137
12211138/***************************************************************************
r1649r1650
12641181   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12651182
12661183   PORT_START   // IN4 - DSW from the MCU - $10497e.b <- $208000.b
1267   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) )
1268   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
1269   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1270   PORT_SERVICE( 0x0200, IP_ACTIVE_LOW )
1271   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Flip_Screen ) )
1184   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1")
1185   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1186   PORT_DIPSETTING(      0x0100, DEF_STR( On ) )
1187   PORT_SERVICE_DIPLOC(  0x0200, IP_ACTIVE_LOW, "SW1:2" )
1188   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:3")
12721189   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
12731190   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1274   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Difficulty ) )
1191   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5,6")
12751192   PORT_DIPSETTING(      0x3800, "1 Easy" )
12761193   PORT_DIPSETTING(      0x3000, "2" )
12771194   PORT_DIPSETTING(      0x2800, "3" )
r1649r1650
12801197   PORT_DIPSETTING(      0x1000, "6" )
12811198   PORT_DIPSETTING(      0x0800, "7" )
12821199   PORT_DIPSETTING(      0x0000, "8 Hard" )
1283   PORT_DIPNAME( 0x4000, 0x4000, "Join During Game" )
1284   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1285   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
1286   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Allow_Continue ) )
1287   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1288   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1200   PORT_DIPNAME( 0x4000, 0x4000, "Can Join During Game" ) PORT_DIPLOCATION("SW1:7")
1201   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
1202   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
1203   PORT_DIPNAME( 0x8000, 0x8000, "Start 2 Credits/Continue 1 Credit" ) PORT_DIPLOCATION("SW1:8")
1204   PORT_DIPSETTING(      0x8000, DEF_STR( No ) )
1205   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
12891206INPUT_PORTS_END
12901207
12911208/***************************************************************************
r1649r1650
14051322   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14061323
14071324   PORT_START   // IN4 - DSW from the MCU - 101265.b <- 206000.b
1408   PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )
1409   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
1325   PORT_SERVICE_DIPLOC(  0x0100, IP_ACTIVE_LOW, "SW1:1" )
1326   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
14101327   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
1411   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
1412   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Cabinet )  )
1413   PORT_DIPSETTING(      0x0400, DEF_STR( Upright )  )
1328   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1329   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:3")
1330   PORT_DIPSETTING(      0x0400, DEF_STR( Upright ) )
14141331   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
1415   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Controls )    )
1416   PORT_DIPSETTING(      0x1800, "1 Joystick"  )
1417   PORT_DIPSETTING(      0x0800, "2 Joysticks" )
1418   PORT_DIPSETTING(      0x1000, "Wheel (360)" )
1419   PORT_DIPSETTING(      0x0000, "Wheel (270)" )
1420   PORT_DIPNAME( 0x2000, 0x2000, "Use Brake"    )
1332   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Controller ) ) PORT_DIPLOCATION("SW1:4")
1333   PORT_DIPSETTING(      0x0800, DEF_STR( Joystick )  )
1334   PORT_DIPSETTING(      0x0000, "Wheel" )
1335   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:5")
1336   PORT_DIPSETTING(      0x1000, "1P Side" )    /* 360 degree wheel if SW1:4 set to wheel */
1337   PORT_DIPSETTING(      0x0000, "Both Sides" ) /* 270 degree wheel if SW1:4 set to wheel */
1338   PORT_DIPNAME( 0x2000, 0x2000, "Use Brake" ) PORT_DIPLOCATION("SW1:6") /* Valid only when joystick is used */
14211339   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1422   PORT_DIPSETTING(      0x2000, DEF_STR( On )  )
1423   PORT_DIPNAME( 0xc000, 0xc000, "National Anthem & Flag" )
1424   PORT_DIPSETTING(      0xc000, "Use Memory"  )
1340   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
1341   PORT_DIPNAME( 0xc000, 0xc000, "National Anthem & Flag" ) PORT_DIPLOCATION("SW1:7,8")
1342   PORT_DIPSETTING(      0xc000, "Use Memory" )
14251343   PORT_DIPSETTING(      0x8000, "Anthem Only" )
1426   PORT_DIPSETTING(      0x4000, "Flag Only"   )
1427   PORT_DIPSETTING(      0x0000, DEF_STR( None )        )
1344   PORT_DIPSETTING(      0x4000, "Flag Only" )
1345   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
14281346
14291347   PORT_START   // IN5 - Wheel - 100015.b <- ffffe.b
14301348   PORT_BIT ( 0x00ff, 0x0080, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(1)
r1649r1650
14771395   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14781396
14791397   PORT_START   // IN4 - DSW from the MCU - 1016f7.b <- 206000.b
1480   PORT_DIPNAME( 0x0700, 0x0700, "Communication" )
1481   PORT_DIPSETTING(      0x0700, DEF_STR( None ) )
1482   PORT_DIPSETTING(      0x0600, "Machine 1" )
1483   PORT_DIPSETTING(      0x0500, "Machine 2" )
1484   PORT_DIPSETTING(      0x0400, "Machine 3" )
1485   PORT_DIPSETTING(      0x0300, "Machine 4" )
1398   PORT_DIPNAME( 0x0700, 0x0700, "Linked Operation Board Number" ) PORT_DIPLOCATION("SW1:6,7,8")
1399   PORT_DIPSETTING(      0x0700, "No Communication" )
1400   PORT_DIPSETTING(      0x0600, "Board #1" )
1401   PORT_DIPSETTING(      0x0500, "Board #2" )
1402   PORT_DIPSETTING(      0x0400, "Board #3" )
1403   PORT_DIPSETTING(      0x0300, "Board #4" )
14861404   /* 0x0000 to 0x0200 : "Machine 4"
14871405    PORT_DIPSETTING(      0x0200, "Machine 4 (0x0200)" )
14881406    PORT_DIPSETTING(      0x0100, "Machine 4 (0x0100)" )
14891407    PORT_DIPSETTING(      0x0000, "Machine 4 (0x0000)" )
14901408    */
1491   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Controls ) )
1409   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:4,5")
14921410   PORT_DIPSETTING(      0x1800, DEF_STR( Joystick ) )
14931411   PORT_DIPSETTING(      0x0800, "Wheel (360)" )         // Not working correctly in race
14941412   PORT_DIPSETTING(      0x1000, "Wheel (270D)" )         // Not working correctly !
14951413   PORT_DIPSETTING(      0x0000, "Wheel (270A)" )         // Not working correctly in race
1496   PORT_DIPNAME( 0x2000, 0x2000, "Pedal Function" )
1497   PORT_DIPSETTING(      0x2000, "Microswitch" )
1498//  PORT_DIPSETTING(      0x0000, "Potentiometer" )         // Not implemented yet
1499   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Flip_Screen ) )
1414   PORT_DIPNAME( 0x2000, 0x2000, "Optional Mode Of Pedal Function" ) PORT_DIPLOCATION("SW1:3")
1415   PORT_DIPSETTING(      0x2000, "Microswitch" )         // "This mode also corresponds to the two buttons used with joystick."
1416   PORT_DIPSETTING(      0x0000, "Potentiometer" )         // Not implemented yet
1417   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
15001418   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
15011419   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
1502   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
1420   PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:1" )
15031421
15041422   PORT_START   // IN5 - Wheel (270A) - 100019.b <- fffff.b
15051423   PORT_BIT ( 0x00ff, 0x0080, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(1)
r1649r1650
15281446
15291447static INPUT_PORTS_START( mgcrystl )
15301448   PORT_START   // IN0 - Player 1 + DSW - c00000.w
1531   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1532   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1533   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1534   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
1535   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) /* All other game settings done through the test mode */
1536   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
1537   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1538   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
1539   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1540   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1541   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
1542   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1543   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1544   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1545   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1546   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1547   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )   // TESTED!
1548   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1549   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1550   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
1551   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1552   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1449   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
1450   PORT_DIPSETTING(      0x0001, DEF_STR( Off )         )
1451   PORT_DIPSETTING(      0x0000, DEF_STR( On )          )
1452   PORT_SERVICE_DIPLOC(  0x0002, IP_ACTIVE_LOW, "SW1:2" )
1453   /* All other game settings done through the test mode */
1454   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) /* Listed as "Unused" */
1455   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" ) /* Listed as "Unused" */
1456   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" ) /* Listed as "Unused" */
1457   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" ) /* Listed as "Unused" */
1458   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" ) /* Listed as "Unused" */
1459   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) /* Listed as "Unused" */
15531460
15541461   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
15551462   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
r1649r1650
15611468   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15621469
15631470   PORT_START   // IN1 - Player 2 - c00002.b
1564   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
1565   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1566   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1567   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) )
1568   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1569   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1570   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
1571   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
1572   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1573   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
1574   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1575   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1576   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
1577   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1578   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1579   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1580   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1581   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1582   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1583   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1584   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1585   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
1586   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1587   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1471   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1472   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1473   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1474   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1475   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1476   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1477   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1478   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
15881479
15891480   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
15901481   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
r1649r1650
15961487   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15971488
15981489   PORT_START   // IN2 - Other Buttons - c00004.b
1599   PORT_BIT ( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1600   PORT_BIT ( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
1601   PORT_BIT ( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
1490   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1491   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
1492   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
16021493   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
16031494   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
16041495   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1605   PORT_BIT ( 0x2000, IP_ACTIVE_LOW, IPT_TILT     )
1606   PORT_BIT ( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
1607   PORT_BIT ( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1496   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT     )
1497   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
1498   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
16081499INPUT_PORTS_END
16091500
16101501
r1649r1650
16371528   PORT_START   // IN2 - Coins - b80004.w
16381529   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
16391530   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )
1640   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1641   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1642   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1531   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1532   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1533   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
16431534   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT      )
16441535   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
16451536   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )   // ? tested
r1649r1650
16551546   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
16561547
16571548   PORT_START   // IN4 - DSW from the MCU - 102e15.b <- 200059.b
1658   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
1549   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
16591550   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16601551   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1661   PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
1662   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
1552   PORT_SERVICE_DIPLOC(0x02, IP_ACTIVE_LOW, "SW1:2" )
1553   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3")
16631554   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16641555   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1665   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Difficulty ) )
1666   PORT_DIPSETTING(    0x38, "1" )   // easy
1556   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5,6")
1557   PORT_DIPSETTING(    0x38, "1 Easy" )
16671558   PORT_DIPSETTING(    0x30, "2" )
16681559   PORT_DIPSETTING(    0x28, "3" )
1669   PORT_DIPSETTING(    0x20, "4" )
1560   PORT_DIPSETTING(    0x20, "4 Normal" )
16701561   PORT_DIPSETTING(    0x18, "5" )
16711562   PORT_DIPSETTING(    0x10, "6" )
16721563   PORT_DIPSETTING(    0x08, "7" )
1673   PORT_DIPSETTING(    0x00, "8" )
1674   PORT_DIPNAME( 0x40, 0x40, "Can Join During Game" )
1564   PORT_DIPSETTING(    0x00, "8 Hard" )
1565   PORT_DIPNAME( 0x40, 0x40, "Can Join During Game" ) PORT_DIPLOCATION("SW1:7")
16751566   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )   //  2 credits       winner vs computer
16761567   PORT_DIPSETTING(    0x40, DEF_STR( On ) )   //  1 credit        game over
1677   PORT_DIPNAME( 0x80, 0x80, "Special Continue Mode" )
1568   PORT_DIPNAME( 0x80, 0x80, "Continue Coin" ) PORT_DIPLOCATION("SW1:8")
16781569   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16791570   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16801571INPUT_PORTS_END
src/mame/drivers/dbz.c
r1649r1650
5151*/
5252
5353#include "driver.h"
54#include "deprecat.h"
5455
5556#include "video/konamiic.h"
5657#include "cpu/m68000/m68000.h"
src/mame/drivers/cybertnk.c
r1649r1650
170170*******************************************************************************************/
171171
172172#include "driver.h"
173#include "deprecat.h"
173174#include "sound/3812intf.h"
174175
175176static tilemap *tx_tilemap;
src/mame/drivers/wc90.c
r1649r1650
5252*/
5353
5454#include "driver.h"
55#include "deprecat.h"
5556#include "cpu/z80/z80.h"
5657#include "sound/2608intf.h"
5758
src/mame/drivers/gauntlet.c
r1649r1650
119119
120120
121121#include "driver.h"
122#include "deprecat.h"
122123#include "machine/atarigen.h"
123124#include "sound/5220intf.h"
124125#include "sound/2151intf.h"
src/mame/drivers/ms32.c
r1649r1650
165165/********** BITS & PIECES **********/
166166
167167#include "driver.h"
168#include "deprecat.h"
168169#include "sound/ymf271.h"
169170
170171extern UINT32 *ms32_fce00000;
src/mame/drivers/mpu4.c
r1649r1650
246246#include "machine/6840ptm.h"
247247
248248// MPU4
249#include "ui.h"
249#include "deprecat.h"
250250#include "timer.h"
251251#include "cpu/m6809/m6809.h"
252252#include "sound/ay8910.h"
r1649r1650
255255#include "machine/meters.h"
256256
257257#ifdef MAME_DEBUG
258#define VERBOSE 1
258#define MPU4VERBOSE 1
259259#else
260#define VERBOSE 0
260#define MPU4VERBOSE 0
261261#endif
262262
263#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
264#define LOG_CHR(x)   do { if (VERBOSE) logerror x; } while (0)
265#define LOG_CHR_FULL(x)   do { if (VERBOSE) logerror x; } while (0)
266#define LOG_IC3(x)   do { if (VERBOSE) logerror x; } while (0)
267#define LOG_IC8(x)   do { if (VERBOSE) logerror x; } while (0)
263#define LOG(x)   do { if (MPU4VERBOSE) logerror x; } while (0)
264#define LOG_CHR(x)   do { if (MPU4VERBOSE) logerror x; } while (0)
265#define LOG_CHR_FULL(x)   do { if (MPU4VERBOSE) logerror x; } while (0)
266#define LOG_IC3(x)   do { if (MPU4VERBOSE) logerror x; } while (0)
267#define LOG_IC8(x)   do { if (MPU4VERBOSE) logerror x; } while (0)
268268
269269#ifndef AWP_VIDEO //Defined for fruit machines with mechanical reels
270270#define draw_reel(x)
r1649r1650
376376
377377}
378378
379// palette initialisation /////////////////////////////////////////////////
380
381static PALETTE_INIT( mpu4 )
382{
383   int i;
384   static const rgb_t color[16] =
385   {
386      MAKE_RGB(0x00,0x00,0x00), MAKE_RGB(0x00,0x00,0xFF), MAKE_RGB(0x00,0xFF,0x00), MAKE_RGB(0x00,0xFF,0xFF),
387      MAKE_RGB(0xFF,0x00,0x00), MAKE_RGB(0xFF,0x00,0xFF), MAKE_RGB(0xFF,0xFF,0x00), MAKE_RGB(0xFF,0xFF,0xFF),
388      MAKE_RGB(0x80,0x80,0x80), MAKE_RGB(0x00,0x00,0x80), MAKE_RGB(0x00,0x80,0x00), MAKE_RGB(0x00,0x80,0x80),
389      MAKE_RGB(0x80,0x00,0x00), MAKE_RGB(0x80,0x00,0x80), MAKE_RGB(0x80,0x80,0x00), MAKE_RGB(0x80,0x80,0x80)
390   };
391
392   for (i=0; i<16; i++)
393      palette_set_color(machine, i, color[i]);
394}
395
396379///////////////////////////////////////////////////////////////////////////
397380// called if board is reset ///////////////////////////////////////////////
398381///////////////////////////////////////////////////////////////////////////
r1649r1650
441424
442425///////////////////////////////////////////////////////////////////////////
443426
444static void pia_cpu0_irq(int state)
427static void cpu0_irq(int state)
445428{
429   // The PIA and PTM IRQ lines are all connected to a common PCB track,
430   // leading directly to the 6809 IRQ line.
446431   int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0) |
447432                   pia_get_irq_a(1) | pia_get_irq_b(1) |
448433                   pia_get_irq_a(2) | pia_get_irq_b(2) |
449434                   pia_get_irq_a(3) | pia_get_irq_b(3) |
450435                   pia_get_irq_a(4) | pia_get_irq_b(4) |
451                   pia_get_irq_a(5) | pia_get_irq_b(5);
436                   pia_get_irq_a(5) | pia_get_irq_b(5) |
437                   ptm6840_get_irq(0);
452438
453439   if (!serial_card_connected)
454440   {
r1649r1650
462448   }
463449}
464450
465
466static void ptm_cpu0_irq(int state)
467{
468   if (!serial_card_connected)
469   {
470      cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
471      LOG(("6809 int%d \n", state));
472   }
473   else
474   {
475      cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
476      LOG(("6809 fint%d \n", state));
477   }
478}
479
480
481451///////////////////////////////////////////////////////////////////////////
482452static WRITE8_HANDLER( bankswitch_w )
483453{
r1649r1650
513483   MPU4_MASTER_CLOCK/4,
514484   { 0,0,0 },
515485   { ic2_o1_callback, ic2_o2_callback, ic2_o3_callback },
516   ptm_cpu0_irq
486   cpu0_irq
517487};
518488
519489/***************************************************************************
r1649r1650
565535{
566536   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
567537   /*outputs: A/B,CA/B2       */ pia_ic3_porta_w, pia_ic3_portb_w, pia_ic3_ca2_w, pia_ic3_cb2_w,
568   /*irqs   : A/B             */ pia_cpu0_irq, pia_cpu0_irq
538   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
569539};
570540
571541/*---------------------------------------
r1649r1650
695665{
696666   /*inputs : A/B,CA/B1,CA/B2 */ 0, pia_ic4_portb_r, 0, 0, 0, 0,
697667   /*outputs: A/B,CA/B2       */ pia_ic4_porta_w, 0, pia_ic4_ca2_w, 0,
698   /*irqs   : A/B             */ pia_cpu0_irq, pia_cpu0_irq
668   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
699669};
700670
701671//IC5
r1649r1650
791761{
792762   /*inputs : A/B,CA/B1,CA/B2 */ pia_ic5_porta_r, pia_ic5_portb_r, 0, 0, 0, 0,
793763   /*outputs: A/B,CA/B2       */ 0, 0, pia_ic5_ca2_w,  pia_ic5_cb2_w,
794   /*irqs   : A/B             */ pia_cpu0_irq, pia_cpu0_irq
764   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
795765};
796766
797767//IC6
r1649r1650
849819{
850820   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
851821   /*outputs: A/B,CA/B2       */ pia_ic6_porta_w, pia_ic6_portb_w, pia_ic6_ca2_w, pia_ic6_cb2_w,
852   /*irqs   : A/B             */ pia_cpu0_irq, pia_cpu0_irq
822   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
853823};
854824
855825//IC7
r1649r1650
925895{
926896   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
927897   /*outputs: A/B,CA/B2       */ pia_ic7_porta_w, pia_ic7_portb_w, pia_ic7_ca2_w, pia_ic7_cb2_w,
928   /*irqs   : A/B             */ pia_cpu0_irq, pia_cpu0_irq
898   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
929899};
930900
931901static READ8_HANDLER( pia_ic8_porta_r )
r1649r1650
973943{
974944   /*inputs : A/B,CA/B1,CA/B2 */ pia_ic8_porta_r, 0, 0, 0, 0, 0,
975945   /*outputs: A/B,CA/B2       */ 0, pia_ic8_portb_w, pia_ic8_ca2_w, pia_ic8_cb2_w,
976   /*irqs   : A/B             */ pia_cpu0_irq, pia_cpu0_irq
946   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
977947};
978948
979949
r1649r1650
14001370   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
14011371
14021372   MDRV_NVRAM_HANDLER(generic_0fill)               // load/save nv RAM
1403   MDRV_DEFAULT_LAYOUT(layout_mpu4)
1404   /* video hardware */
1405   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1406   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
14071373
1408   MDRV_SCREEN_SIZE(288, 34)
1409   MDRV_SCREEN_VISIBLE_AREA(0, 288-1, 0, 34-1)
1410   MDRV_SCREEN_REFRESH_RATE(50)
1411
1412   MDRV_PALETTE_LENGTH(16)
1413   MDRV_COLORTABLE_LENGTH(16)
1414   MDRV_PALETTE_INIT(mpu4)
1374   /* video hardware */
1375   MDRV_DEFAULT_LAYOUT(layout_mpu4)
1376   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_NONE)
1377   /* dummy values */
1378   MDRV_SCREEN_REFRESH_RATE(60)
1379   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
14151380MACHINE_DRIVER_END
14161381
14171382   const UINT8 MPU4_chr_lut[72]= {   0x00,0x1A,0x04,0x10,0x18,0x0F,0x13,0x1B,
src/mame/drivers/skylncr.c
r1649r1650
99*************************************************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "sound/ay8910.h"
1314
1415static tilemap *tmap, *tmap2;
src/mame/drivers/darkseal.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "cpu/h6280/h6280.h"
1516#include "sound/2203intf.h"
1617#include "sound/2151intf.h"
src/mame/drivers/20pacgal.c
r1649r1650
11/***************************************************************************
22
3Ms.Pac-Man/Galaga - 20 Year Reunion
3    Ms.Pac-Man/Galaga - 20 Year Reunion hardware
44
5driver by Nicola Salmoria
5    driver by Nicola Salmoria
66
7Notes:
8- There are four start buttons: the first two are for Ms. Pac-Man, the other two
9  for Galaga.
7    Notes:
8        * There are four start buttons: the first two are for Ms. Pac-Man, the other two
9          for Galaga.
10        * To play Pac-Man instead of Ms. Pac-Man, insert coins then enter the following
11          sequence: U U U D D D L R L R L. A sound will play and the ghost will change
12          from red to pink.
13        * Writes to the Z180 ASCI port:
14          MS PAC-MAN/GALAGA
15          arcade video system
16          version 1.01
17          (c) 2000 Cosmodog, Ltd.
18          >
19          and it listens for incoming characters.
20        * CPU is a Z8S18020VSC (20MHz part), OSC is 73.728MHz
1021
11- To play Pac-Man instead of Ms. Pac-Man, insert coins then enter the following
12  sequence: U U U D D D L R L R L. A sound will play and the ghost will change
13  from red to pink.
22    Known issues/to-do's:
23        * ROM banking is not understood.  Shouldn't require copying and other
24          trickey
25        * Starfield missing
26        * Check the ASCI interface, there probably is fully working debug code.
27        * The timed interrupt is a kludge; it is supposed to be generated internally by
28          the Z180, but the cpu core doesn't support that yet.
29        * Is the clock divide 3 or 4?
1430
15- Writes to the Z180 ASCI port:
16  MS PAC-MAN/GALAGA
17  arcade video system
18  version 1.01
19  (c) 2000 Cosmodog, Ltd.
20  >
21  and it listens for incoming characters.
31***************************************************************************/
2232
33#include "driver.h"
34#include "deprecat.h"
35#include "machine/eeprom.h"
36#include "sound/namco.h"
37#include "sound/dac.h"
38#include "20pacgal.h"
2339
24TODO:
25- Starfield.
2640
27- Convert to tilemaps & optimize video rendering, I was just too lazy to do it for now.
2841
29- Check the ASCI interface, there probably is fully working debug code.
42/*************************************
43 *
44 *  Clocks
45 *
46 *************************************/
3047
31- The timed interrupt is a kludge; it is supposed to be generated internally by
32  the Z180, but the cpu core doesn't support that yet.
48#define MASTER_CLOCK      (XTAL_73_728MHz)
49#define MAIN_CPU_CLOCK      (MASTER_CLOCK / 4)  /* divider is either 3 or 4 */
50#define NAMCO_AUDIO_CLOCK   (MASTER_CLOCK / 4 /  6 / 32)
3351
34- Correct CPU speed... Zilog says Z180 comes in 6, 8, 10, 20 & 33MHz.
35  20MHz is used as it "seems" right based on the music in Galaga
3652
37***************************************************************************/
3853
39#include "driver.h"
40#include "machine/eeprom.h"
41#include "cpu/z180/z180.h"
42#include "pacman.h"
43#include "sound/namco.h"
44#include "sound/dac.h"
54/*************************************
55 *
56 *  Interrupt system
57 *
58 *************************************/
4559
46extern UINT8 *pacgal_charram,*pacgal_sprram;
47extern UINT8 *pacgal_videoram,*pacgal_videoram2;
48PALETTE_INIT( 20pacgal );
49VIDEO_START( 20pacgal );
50WRITE8_HANDLER( pacgal_lookup_w );
51WRITE8_HANDLER( pacgal_active_game_w );
52WRITE8_HANDLER( pacgal_videoram2_w );
53WRITE8_HANDLER( pacgal_charram_w );
54WRITE8_HANDLER( pacgal_sprram_w );
55VIDEO_UPDATE( 20pacgal );
60static WRITE8_HANDLER( irqack_w )
61{
62   int bit = data & 1;
5663
64   cpu_interrupt_enable(0, bit);
5765
66   if (!bit)
67      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE );
68}
5869
70
71
72/*************************************
73 *
74 *  Audio
75 *
76 *************************************/
77
78static const struct namco_interface namco_interface =
79{
80   3,   /* number of voices */
81   -1,   /* memory region */
82};
83
84
85static WRITE8_HANDLER( _20pacgal_dac_w )
86{
87   DAC_signed_data_w(0, data);
88}
89
90
91
92/*************************************
93 *
94 *  Non-volatile memory
95 *
96 *************************************/
97
5998static const struct EEPROM_interface eeprom_interface =
6099{
61100   7,            /* address bits */
62101   8,            /* data bits */
63   "*110",         /* read command */
102   "*110",         /* read command */
64103   "*101",         /* write command */
65104   0,            /* erase command */
66105   "*10000xxxxx",   /* lock command */
67106   "*10011xxxxx",   /* unlock command */
68107};
69108
109
70110static NVRAM_HANDLER( eeprom )
71111{
72112   if (read_or_write)
r1649r1650
80120   }
81121}
82122
123
83124static READ8_HANDLER( eeprom_r )
84125{
85   int res;
86
87126   /* bit 7 is EEPROM data */
88   res = EEPROM_read_bit() << 7;
89   return res;
127   return EEPROM_read_bit() << 7;
90128}
91129
130
92131static WRITE8_HANDLER( eeprom_w )
93132{
94133   /* bit 7 is data */
r1649r1650
99138   EEPROM_set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
100139}
101140
102static WRITE8_HANDLER( irqack_w )
141
142
143/*************************************
144 *
145 *  Coin counter
146 *
147 *************************************/
148
149static WRITE8_HANDLER( _20pacgal_coin_counter_w )
103150{
104   int bit = data & 1;
105   cpu_interrupt_enable(0,bit);
106   if (!bit)
107      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE );
151   coin_counter_w(0, data & 1);
108152}
109153
110static WRITE8_HANDLER( flipscreen_w )
154
155
156/*************************************
157 *
158 *  ROM banking - FIXME
159 *
160 *************************************/
161
162WRITE8_HANDLER( rom_bank_select_w )
111163{
112   flip_screen_set(data & 1);
164   _20pacgal_state *state = Machine->driver_data;
165
166   state->game_selected = data & 1;
167
168   if (state->game_selected == 0)
169      memcpy(memory_region(REGION_CPU1)+0x48000, memory_region(REGION_CPU1)+0x8000, 0x2000);
113170}
114171
115static WRITE8_HANDLER( pacgal_dac_w )
172
173WRITE8_HANDLER( rom_48000_w )
116174{
117   DAC_signed_data_w(0, data);
118}
175   _20pacgal_state *state = Machine->driver_data;
119176
120static WRITE8_HANDLER( coin_w )
121{
122   coin_counter_w(0,data & 1);
177   if (state->game_selected)
178   {
179      if (offset < 0x0800)
180         state->video_ram[offset & 0x07ff] = data;
181
182      memory_region(REGION_CPU1)[0x48000 + offset] = data;
183   }
123184}
124185
125186
126187
188/*************************************
189 *
190 *  Memory handlers
191 *
192 *************************************/
193
127194static ADDRESS_MAP_START( 20pacgal_map, ADDRESS_SPACE_PROGRAM, 8 )
128195   AM_RANGE(0x00000, 0x03fff) AM_ROM
129196   AM_RANGE(0x08000, 0x09fff) AM_ROM
130197   AM_RANGE(0x0a000, 0x0ffff) AM_MIRROR(0x40000) AM_ROM
131198   AM_RANGE(0x10000, 0x3ffff) AM_ROM
132   AM_RANGE(0x44000, 0x447ff) AM_RAM AM_BASE(&pacgal_videoram)                  // mspacman tilemap
199   AM_RANGE(0x44000, 0x447ff) AM_RAM AM_BASE_MEMBER(_20pacgal_state, video_ram)
133200   AM_RANGE(0x45040, 0x4505f) AM_WRITE(pacman_sound_w) AM_BASE(&namco_soundregs)
134201   AM_RANGE(0x44800, 0x45eff) AM_RAM
135   AM_RANGE(0x45f00, 0x45fff) AM_WRITE(_20pacgal_wavedata_w) AM_BASE(&namco_wavedata) // sound wave data
136   AM_RANGE(0x46000, 0x46fff) AM_WRITE(pacgal_charram_w) AM_BASE(&pacgal_charram)   // char gfx data
137   AM_RANGE(0x47100, 0x47100) AM_RAM                  // leftover from original Galaga code
138   AM_RANGE(0x48000, 0x49fff) AM_ROM AM_BASE(&pacgal_videoram2)
139   AM_RANGE(0x48000, 0x49fff) AM_WRITE(pacgal_videoram2_w)                     // ROM or galaga tilemap (banked)
140   AM_RANGE(0x4c000, 0x4dfff) AM_WRITE(pacgal_sprram_w) AM_BASE(&pacgal_sprram)   // sprite gfx data
141   AM_RANGE(0x4e000, 0x4e17f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram)            // sprite registers
142   AM_RANGE(0x4ff00, 0x4ffff) AM_WRITE(pacgal_lookup_w)                     // sprite color lookup table
202   AM_RANGE(0x45f00, 0x45fff) AM_WRITE(_20pacgal_wavedata_w) AM_BASE(&namco_wavedata)
203   AM_RANGE(0x46000, 0x46fff) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(_20pacgal_state, char_gfx_ram)
204   AM_RANGE(0x47100, 0x47100) AM_RAM   /* leftover from original Galaga code */
205   AM_RANGE(0x48000, 0x49fff) AM_READWRITE(MRA8_ROM, rom_48000_w)   /* this should be a mirror of 08000-09ffff */
206   AM_RANGE(0x4c000, 0x4dfff) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(_20pacgal_state, sprite_gfx_ram)
207   AM_RANGE(0x4e000, 0x4e17f) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(_20pacgal_state, sprite_ram)
208   AM_RANGE(0x4ff00, 0x4ffff) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(_20pacgal_state, sprite_color_lookup)
143209ADDRESS_MAP_END
144210
145static ADDRESS_MAP_START( 20pacgal_port, ADDRESS_SPACE_IO, 8 )
211
212
213/*************************************
214 *
215 *  I/O port handlers
216 *
217 *************************************/
218
219static ADDRESS_MAP_START( 20pacgal_io_map, ADDRESS_SPACE_IO, 8 )
146220   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
147221   AM_RANGE(0x00, 0x3f) AM_NOP /* Z180 internal registers */
148222   AM_RANGE(0x40, 0x7f) AM_NOP   /* Z180 internal registers */
r1649r1650
150224   AM_RANGE(0x81, 0x81) AM_READ(input_port_1_r)
151225   AM_RANGE(0x82, 0x82) AM_READ(input_port_2_r)
152226   AM_RANGE(0x80, 0x80) AM_WRITE(watchdog_reset_w)
153   AM_RANGE(0x81, 0x81) AM_WRITE(MWA8_NOP)            // ??? pulsed by the timer irq
227   AM_RANGE(0x81, 0x81) AM_WRITE(MWA8_NOP)            /* ??? pulsed by the timer irq */
154228   AM_RANGE(0x82, 0x82) AM_WRITE(irqack_w)
155   AM_RANGE(0x85, 0x86) AM_WRITE(MWA8_NOP)            // stars: rng seed (lo/hi)
229   AM_RANGE(0x85, 0x86) AM_WRITE(MWA8_NOP)            /* stars: rng seed (lo/hi) */
156230   AM_RANGE(0x87, 0x87) AM_READWRITE(eeprom_r, eeprom_w)
157   AM_RANGE(0x88, 0x88) AM_WRITE(pacgal_active_game_w)
158   AM_RANGE(0x89, 0x89) AM_WRITE(pacgal_dac_w)
159   AM_RANGE(0x8a, 0x8a) AM_WRITE(MWA8_NOP)            // stars: bits 3-4 = active set; bit 5 = enable
160   AM_RANGE(0x8b, 0x8b) AM_WRITE(flipscreen_w)
161   AM_RANGE(0x8f, 0x8f) AM_WRITE(coin_w)            // coin counter
231   AM_RANGE(0x88, 0x88) AM_WRITE(rom_bank_select_w)
232   AM_RANGE(0x89, 0x89) AM_WRITE(_20pacgal_dac_w)
233   AM_RANGE(0x8a, 0x8a) AM_WRITE(MWA8_NOP)            /* stars: bits 3-4 = active set; bit 5 = enable */
234   AM_RANGE(0x8b, 0x8b) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(_20pacgal_state, flip_screen)
235   AM_RANGE(0x8f, 0x8f) AM_WRITE(_20pacgal_coin_counter_w)
162236ADDRESS_MAP_END
163237
164238
165239
240/*************************************
241 *
242 *  Port definitions
243 *
244 *************************************/
245
166246static INPUT_PORTS_START( 20pacgal )
167247   PORT_START
168248   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    )
r1649r1650
179259   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_COCKTAIL
180260   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
181261   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_COCKTAIL
182   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 )
183   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
184   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
185   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
262   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 ) PORT_NAME( "Right 1 Player Start" )
263   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME( "Left 1 Player Start" )
264   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME( "Left 2 Players Start" )
265   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) PORT_NAME( "Right 2 Players Start" )
186266
187267   PORT_START
188268   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1649r1650
197277
198278
199279
200static const gfx_layout charlayout =
201{
202   8,8,
203   256,
204   2,
205   { 0, 4 },
206   { 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 },
207   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
208   16*8
209};
280/*************************************
281 *
282 *  Machine driver
283 *
284 *************************************/
210285
286static MACHINE_DRIVER_START( 20pacgal )
211287
212static const gfx_layout spritelayout =
213{
214   16,16,
215   128,
216   2,
217   { 0, 1 },
218   { 0*2, 1*2, 2*2, 3*2, 4*2, 5*2, 6*2, 7*2, 8*2, 9*2, 10*2, 11*2, 12*2, 13*2, 14*2, 15*2 },
219   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
220   16*32
221};
288   MDRV_DRIVER_DATA(_20pacgal_state)
222289
223static GFXDECODE_START( 20pacgal )
224   /* the game dynamically modifies these */
225   GFXDECODE_ENTRY( 0, 0, charlayout,   0, 64 )
226   GFXDECODE_ENTRY( 0, 0, spritelayout, 0, 64 )
227GFXDECODE_END
228
229static const struct namco_interface namco_interface =
230{
231   3,   /* number of voices */
232   -1,   /* memory region */
233};
234
235static MACHINE_DRIVER_START( 20pacgal )
236
237290   /* basic machine hardware */
238   MDRV_CPU_ADD(Z180,20000000)   /* 20MHz ??? Needs to be verified! */
291   MDRV_CPU_ADD(Z180, MAIN_CPU_CLOCK)
239292   MDRV_CPU_PROGRAM_MAP(20pacgal_map,0)
240   MDRV_CPU_IO_MAP(20pacgal_port,0)
293   MDRV_CPU_IO_MAP(20pacgal_io_map,0)
241294   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
242295
243   MDRV_SCREEN_REFRESH_RATE(60)
244   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
245
246296   MDRV_NVRAM_HANDLER(eeprom)
247297
248298   /* video hardware */
249   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
250   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
251   MDRV_SCREEN_SIZE(36*8, 28*8)
252   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
253   MDRV_GFXDECODE(20pacgal)
254   MDRV_PALETTE_LENGTH(0x1000)
255   MDRV_COLORTABLE_LENGTH(0x100)
256   MDRV_PALETTE_INIT(20pacgal)
257   MDRV_VIDEO_START(20pacgal)
258   MDRV_VIDEO_UPDATE(20pacgal)
299   MDRV_IMPORT_FROM(20pacgal_video)
259300
260301   /* sound hardware */
261302   MDRV_SPEAKER_STANDARD_MONO("mono")
262303
263   MDRV_SOUND_ADD(NAMCO, 18432000/6/32)
304   MDRV_SOUND_ADD(NAMCO, NAMCO_AUDIO_CLOCK)
264305   MDRV_SOUND_CONFIG(namco_interface)
265306   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
266307
r1649r1650
270311
271312
272313
273/***************************************************************************
314/*************************************
315 *
316 *  ROM definition
317 *
318 *************************************/
274319
275  Game driver(s)
276
277***************************************************************************/
278
279320ROM_START( 20pacgal )
280   ROM_REGION( 0x100000, REGION_CPU1, 0 )   /* 1024k for Z180 address space */
321   ROM_REGION( 0x100000, REGION_CPU1, 0 )
281322   ROM_LOAD( "20th_101.u13", 0x00000, 0x40000, CRC(77159582) SHA1(c05e005a941cbdc806dcd76b315069362c792a72) )
282323
283324   ROM_REGION( 0x8000, REGION_PROMS, 0 )   /* palette */
r1649r1650
286327
287328
288329
330/*************************************
331 *
332 *  Game driver
333 *
334 *************************************/
335
289336GAME( 2000, 20pacgal, 0, 20pacgal, 20pacgal, 0, ROT90, "Namco", "Ms. Pac-Man/Galaga - 20 Year Reunion", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/seicross.c
r1649r1650
4343***************************************************************************/
4444
4545#include "driver.h"
46#include "deprecat.h"
4647#include "sound/ay8910.h"
4748#include "sound/dac.h"
4849
src/mame/drivers/spbactn.c
r1649r1650
126126*******************************************************************************/
127127
128128#include "driver.h"
129#include "deprecat.h"
129130#include "sound/okim6295.h"
130131#include "sound/3812intf.h"
131132
src/mame/drivers/system16.c
r1649r1650
3535  as fpointbl uses fpoint ROMs (it's parent), it's own, and the sound ROM from fpointbj.
3636  So add fpoint.001 to fpointbl.zip for it to work.
3737  I made fpointbl the parent of fpointbj so it would use the proper memory map for the sound hardware.
38*/
3938
39DIP locations verified from manual for:
40- aliensyn
41- bayroute
42- ddux
43- eswat
44- fpoint
45- goldnaxe
46- passsht
47- shinobi
48- tetris
49- wb3
50
51  */
52
4053/***************************************************************************/
4154/*
4255  ASTORMBL
r1649r1650
142155        MVP
143156        Ryukyu
144157        Super Leagu
145        Turbo Outrun
146        Turbo Outrun (Set 2)
158        Turbo Outrun (set 1)
159        Turbo Outrun (set 2)
147160*/
148161
149162#include "driver.h"
163#include "deprecat.h"
150164#include "cpu/z80/z80.h"
151165#include "cpu/i8039/i8039.h"
152166#include "system16.h"
r1649r1650
569583   SYS16_SERVICE
570584   SYS16_COINAGE
571585
572   PORT_START_TAG("DSW1")
573   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
574   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
575   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
576   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
586   PORT_START_TAG("DSW2")
587   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
588   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
577589   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
578590   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
579   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
591   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
580592   PORT_DIPSETTING(    0x08, "2" )
581593   PORT_DIPSETTING(    0x0c, "3" )
582594   PORT_DIPSETTING(    0x04, "4" )
583   PORT_DIPSETTING(    0x00, "127 (Cheat)")
584   PORT_DIPNAME( 0x30, 0x30, "Timer" )
595   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
596   PORT_DIPNAME( 0x30, 0x30, "Timer" ) PORT_DIPLOCATION("SW2:5,6")
585597   PORT_DIPSETTING(    0x00, "120" )
586598   PORT_DIPSETTING(    0x10, "130" )
587599   PORT_DIPSETTING(    0x20, "140" )
588600   PORT_DIPSETTING(    0x30, "150" )
589   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
601   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
590602   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
591603   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
592604   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
663675   SYS16_SERVICE
664676   SYS16_COINAGE
665677
666   PORT_START_TAG("DSW1")
667   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
668   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
669   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
670   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
678   PORT_START_TAG("DSW2")
679   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:1")
680   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
681   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
682   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
671683   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
672684   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
673   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
685   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
674686   PORT_DIPSETTING(    0x04, "1" )
675687   PORT_DIPSETTING(    0x0c, "3" )
676688   PORT_DIPSETTING(    0x08, "5" )
677   PORT_DIPSETTING(    0x00, "Unlimited (Cheat)")
678   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
679   PORT_DIPSETTING(    0x30, "10000" )
680   PORT_DIPSETTING(    0x20, "15000" )
681   PORT_DIPSETTING(    0x10, "20000" )
689   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
690   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6")
691   PORT_DIPSETTING(    0x30, "100k" )
692   PORT_DIPSETTING(    0x20, "150k" )
693   PORT_DIPSETTING(    0x10, "200k" )
682694   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
683   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Unknown ) )
684   PORT_DIPSETTING(    0xc0, "A" )
685   PORT_DIPSETTING(    0x80, "B" )
686   PORT_DIPSETTING(    0x40, "C" )
687   PORT_DIPSETTING(    0x00, "D" )
688
695   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
696   PORT_DIPSETTING(    0xc0, DEF_STR( Easy ) )
697   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
698   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
699   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
689700INPUT_PORTS_END
690701
691702/***************************************************************************/
r1649r1650
823834   SYS16_SERVICE
824835   SYS16_COINAGE
825836
826   PORT_START_TAG("DSW1")
827   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
837   PORT_START_TAG("DSW2")
838   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
828839   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
829840   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
830   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )
841   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,3")
831842   PORT_DIPSETTING(    0x04, DEF_STR( Easy ) )
832843   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
833844   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
834845   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
835   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) )
846   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4,5")
836847   PORT_DIPSETTING(    0x10, "2" )
837848   PORT_DIPSETTING(    0x18, "3" )
838849   PORT_DIPSETTING(    0x08, "4" )
839850   PORT_DIPSETTING(    0x00, "5" )
840   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) )
841   PORT_DIPSETTING(    0x40, "150000" )
842   PORT_DIPSETTING(    0x60, "200000" )
843   PORT_DIPSETTING(    0x20, "300000" )
844   PORT_DIPSETTING(    0x00, "400000" )
845   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
846   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
847   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
848
851   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:6,7")
852   PORT_DIPSETTING(    0x40, "150k" )
853   PORT_DIPSETTING(    0x60, "200k" )
854   PORT_DIPSETTING(    0x20, "300k" )
855   PORT_DIPSETTING(    0x00, "400k" )
856   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
849857INPUT_PORTS_END
850858
851859/***************************************************************************/
r1649r1650
952960   SYS16_SERVICE
953961   SYS16_COINAGE
954962
955   PORT_START_TAG("DSW1")
956   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" )
957   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
958   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
959   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
963   PORT_START_TAG("DSW2")
964   PORT_DIPNAME( 0x01, 0x01, "Credits To Start" ) PORT_DIPLOCATION("SW2:1")
965   PORT_DIPSETTING(    0x01, "1 Credit" )
966   PORT_DIPSETTING(    0x00, "2 Credits" )
967   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
960968   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
961969   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
962   PORT_DIPNAME( 0x04, 0x04, "Display Flip" )
970   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:3")
963971   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
964972   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
965   PORT_DIPNAME( 0x08, 0x08, "Time" )
973   PORT_DIPNAME( 0x08, 0x08, "Timer" ) PORT_DIPLOCATION("SW2:4")
966974   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
967975   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
968   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
976   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
969977   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
970978   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
971979   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
972980   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
973   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
981   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7,8")
974982   PORT_DIPSETTING(    0x00, "1" )
975983   PORT_DIPSETTING(    0x40, "2" )
976984   PORT_DIPSETTING(    0xc0, "3" )
r1649r1650
10941102   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
10951103   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
10961104
1097   PORT_START_TAG("DSW1")
1098   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1099   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1100   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1101   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1105   PORT_START_TAG("DSW2")
1106   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
1107   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
11021108   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11031109   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1104   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1105   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1106   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1107   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1108   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1109   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1110   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
1110   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) /* Listed as "Unused" */
1111   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) /* Listed as "Unused" */
1112   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
11111113   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
11121114   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
11131115   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
11141116   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1115   PORT_DIPNAME( 0x40, 0x40, "Clear round allowed" ) /* Use button 3 */
1117   PORT_DIPNAME( 0x40, 0x40, "Clear Round Allowed" ) PORT_DIPLOCATION("SW2:7") /* Use button 3 */
11161118   PORT_DIPSETTING(    0x00, "1" )
11171119   PORT_DIPSETTING(    0x40, "2" )
1118   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1119   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1120   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1120   /* The mode in which a block falls at twice [ usual ] speed as this when playing 25 minutes or more on one coin. */
1121   PORT_DIPNAME( 0x80, 0x80, "2 Cell Move" ) PORT_DIPLOCATION("SW2:8")
1122   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1123   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
11211124
11221125   SYS16_COINAGE
11231126INPUT_PORTS_END
r1649r1650
11461149   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
11471150   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
11481151
1149   PORT_START_TAG("DSW1")
1150   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) /* not used according to manual */
1151   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1152   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1153   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1152   PORT_START_TAG("DSW2")
1153   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
1154   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
11541155   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11551156   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1156   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* not used according to manual */
1157   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1158   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1159   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) /* not used according to manual */
1160   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1161   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1162   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
1157   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) /* Listed as "Unused" */
1158   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) /* Listed as "Unused" */
1159   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
11631160   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
11641161   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
11651162   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
11661163   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1167   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) /* not used according to manual */
1168   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1169   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1170   PORT_DIPNAME( 0x80, 0x80, "2 Cell Move Mode" )
1171   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1172   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1164   PORT_DIPNAME( 0x40, 0x40, "Clear Round Allowed" ) PORT_DIPLOCATION("SW2:7") /* Use button 3 */
1165   PORT_DIPSETTING(    0x00, "1" )
1166   PORT_DIPSETTING(    0x40, "2" )
1167   /* SW2:8 The mode in which a block falls at twice [ usual ] speed as this when playing 25 minutes or more on one coin. */
1168   PORT_DIPNAME( 0x80, 0x80, "2 Cell Move" ) PORT_DIPLOCATION("SW2:8")
1169   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1170   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
11731171
11741172   SYS16_COINAGE
11751173INPUT_PORTS_END
r1649r1650
13081306   SYS16_SERVICE
13091307   SYS16_COINAGE
13101308
1311   PORT_START_TAG("DSW1")
1312   PORT_DIPNAME( 0x01, 0x01, "Credits needed" )
1313   PORT_DIPSETTING(    0x01, "1 to start, 1 to continue" )
1314   PORT_DIPSETTING(    0x00, "2 to start, 1 to continue" )
1315   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1309   PORT_START_TAG("DSW2")
1310   PORT_DIPNAME( 0x01, 0x01, "Credits Needed" ) PORT_DIPLOCATION("SW2:1")
1311   PORT_DIPSETTING(    0x01, "1 Credit To Start" )
1312   PORT_DIPSETTING(    0x00, "2 Credits To Start" )
1313   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
13161314   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
13171315   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1318   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1319   PORT_DIPSETTING(    0x08, "1" )
1320   PORT_DIPSETTING(    0x0c, "2" )
1321   PORT_DIPSETTING(    0x04, "3" )
1322   PORT_DIPSETTING(    0x00, "5" )
1323   PORT_DIPNAME( 0x30, 0x30, "Energy Meter" )
1324   PORT_DIPSETTING(    0x20, "2" )
1325   PORT_DIPSETTING(    0x30, "3" )
1326   PORT_DIPSETTING(    0x10, "4" )
1327   PORT_DIPSETTING(    0x00, "5" )
1328   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
1329   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1330   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1331   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
1332   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1333   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1316   PORT_DIPNAME( 0x3c, 0x3c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4,5,6") /* Definition according to manual */
1317   PORT_DIPSETTING(    0x00, "Special" )
1318   PORT_DIPSETTING(    0x14, DEF_STR( Easiest ) )
1319   PORT_DIPSETTING(    0x1c, DEF_STR( Easier ) )
1320   PORT_DIPSETTING(    0x34, DEF_STR( Easy ) )
1321   PORT_DIPSETTING(    0x3c, DEF_STR( Normal ) )
1322   PORT_DIPSETTING(    0x38, DEF_STR( Hard ) )
1323   PORT_DIPSETTING(    0x2c, DEF_STR( Harder ) )
1324   PORT_DIPSETTING(    0x28, DEF_STR( Hardest ) )
1325   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) /* Listed as "Unused" */
1326   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
1327
1328/*  PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1329    PORT_DIPSETTING(    0x08, "1" )
1330    PORT_DIPSETTING(    0x0c, "2" )
1331    PORT_DIPSETTING(    0x04, "3" )
1332    PORT_DIPSETTING(    0x00, "5" )
1333    PORT_DIPNAME( 0x30, 0x30, "Energy Meter" ) PORT_DIPLOCATION("SW2:5,6")
1334    PORT_DIPSETTING(    0x20, "2" )
1335    PORT_DIPSETTING(    0x30, "3" )
1336    PORT_DIPSETTING(    0x10, "4" )
1337    PORT_DIPSETTING(    0x00, "5" )
1338*/
13341339INPUT_PORTS_END
13351340
13361341/***************************************************************************/
r1649r1650
15441549   SYS16_SERVICE
15451550   SYS16_COINAGE
15461551
1547   PORT_START_TAG("DSW1")
1548   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
1552   PORT_START_TAG("DSW2")
1553   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
15491554   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
15501555   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1551   PORT_DIPNAME( 0x0e, 0x0e, "Initial Point" )
1556   PORT_DIPNAME( 0x0e, 0x0e, "Initial Point" ) PORT_DIPLOCATION("SW2:2,3,4")
15521557   PORT_DIPSETTING(    0x06, "2000" )
15531558   PORT_DIPSETTING(    0x0a, "3000" )
15541559   PORT_DIPSETTING(    0x0c, "4000" )
r1649r1650
15571562   PORT_DIPSETTING(    0x04, "7000" )
15581563   PORT_DIPSETTING(    0x02, "8000" )
15591564   PORT_DIPSETTING(    0x00, "9000" )
1560   PORT_DIPNAME( 0x30, 0x30, "Point Table" )
1565   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SW2:5,6")
15611566   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
15621567   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
15631568   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
15641569   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1565   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
1570   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
15661571   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
15671572   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
15681573   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
16021607
16031608   SYS16_COINAGE
16041609
1605   PORT_START_TAG("DSW1")
1606   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
1610   PORT_START_TAG("DSW2")
1611   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
16071612   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16081613   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1609   PORT_DIPNAME( 0x0e, 0x0e, "Initial Point" )
1614   PORT_DIPNAME( 0x0e, 0x0e, "Initial Point" ) PORT_DIPLOCATION("SW2:2,3,4")
16101615   PORT_DIPSETTING(    0x06, "2000" )
16111616   PORT_DIPSETTING(    0x0a, "3000" )
16121617   PORT_DIPSETTING(    0x0c, "4000" )
r1649r1650
16151620   PORT_DIPSETTING(    0x04, "7000" )
16161621   PORT_DIPSETTING(    0x02, "8000" )
16171622   PORT_DIPSETTING(    0x00, "9000" )
1618   PORT_DIPNAME( 0x30, 0x30, "Point Table" )
1623   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SW2:5,6")
16191624   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
16201625   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
16211626   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
16221627   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1623   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
1628   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
16241629   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
16251630   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
16261631   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
16881693   SYS16_SERVICE
16891694   SYS16_COINAGE
16901695
1691   PORT_START_TAG("DSW1")
1692   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1696   PORT_START_TAG("DSW2")
1697   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
16931698   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
16941699   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1695   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1700   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
16961701   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
16971702   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1698   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1703   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
16991704   PORT_DIPSETTING(    0x08, "2" )
17001705   PORT_DIPSETTING(    0x0c, "3" )
17011706   PORT_DIPSETTING(    0x04, "5" )
1702   PORT_DIPSETTING(    0x00, "240 (Cheat)")
1703   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
1707   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1708   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
17041709   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
17051710   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
17061711   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
17071712   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1708   PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" )
1713   PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" ) PORT_DIPLOCATION("SW2:7")
17091714   PORT_DIPSETTING(    0x40, "Slow" )
17101715   PORT_DIPSETTING(    0x00, "Fast" )
1711   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
1716   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:8")
17121717   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
17131718   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
1714
17151719INPUT_PORTS_END
17161720
17171721/***************************************************************************/
r1649r1650
18691873   SYS16_SERVICE
18701874   SYS16_COINAGE /* unconfirmed */
18711875
1872   PORT_START_TAG("DSW1")
1873   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1874   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1875   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1876   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1876   PORT_START_TAG("DSW2")
1877   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
1878   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
18771879   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
18781880   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1879   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) )   // from the code it looks like some kind of difficulty
1880   PORT_DIPSETTING(    0x0c, "A" )               // level, but all 4 levels points to the same place
1881   PORT_DIPSETTING(    0x08, "B" )               // so it doesn't actually change anything!!
1882   PORT_DIPSETTING(    0x04, "C" )
1883   PORT_DIPSETTING(    0x00, "D" )
1884   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
1881   /* From the code SW2:3,4 looks like some kind of difficulty level,
1882    but all 4 levels points to the same place so it doesn't actually change anything!! */
1883   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) /* Listed as "Unused" */
1884   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) /* Listed as "Unused" */
1885   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
18851886   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
18861887   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
18871888   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
18881889   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1889   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1890   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1891   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1892   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1893   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1894   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1890   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) /* Listed as "Unused" */
1891   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
18951892INPUT_PORTS_END
18961893
18971894/***************************************************************************/
r1649r1650
19561953   SYS16_SERVICE
19571954   SYS16_COINAGE
19581955
1959   PORT_START_TAG("DSW1")
1960   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Continues ) )
1956   PORT_START_TAG("DSW2")
1957   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Continues ) ) PORT_DIPLOCATION("SW2:1,2")
19611958   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
19621959   PORT_DIPSETTING(    0x01, "3" )
19631960   PORT_DIPSETTING(    0x02, "Unlimited" )
19641961   PORT_DIPSETTING(    0x03, "Unlimited" )
1965   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
1962   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
19661963   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
19671964   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
19681965   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
19691966   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1970   PORT_DIPNAME( 0x30, 0x20, "Starting Energy" )
1967   PORT_DIPNAME( 0x30, 0x20, "Starting Energy" ) PORT_DIPLOCATION("SW2:5,6")
19711968   PORT_DIPSETTING(    0x00, "3" )
19721969   PORT_DIPSETTING(    0x10, "4" )
19731970   PORT_DIPSETTING(    0x20, "6" )
19741971   PORT_DIPSETTING(    0x30, "8" )
1975   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
1972   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
19761973   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
19771974   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1978   PORT_DIPNAME( 0x80, 0x00, "Bonus Energy" )
1975   PORT_DIPNAME( 0x80, 0x00, "Bonus Energy" ) PORT_DIPLOCATION("SW2:8")
19791976   PORT_DIPSETTING(    0x80, "1" )
19801977   PORT_DIPSETTING(    0x00, "2" )
19811978INPUT_PORTS_END
r1649r1650
21102107   SYS16_SERVICE
21112108   SYS16_COINAGE
21122109
2113   PORT_START_TAG("DSW1")
2114   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
2115   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2116   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2117   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2110   PORT_START_TAG("DSW2")
2111   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
2112   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
21182113   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
21192114   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2120   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
2115   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
21212116   PORT_DIPSETTING(    0x00, "2" )
21222117   PORT_DIPSETTING(    0x0c, "3" )
21232118   PORT_DIPSETTING(    0x08, "4" )
21242119   PORT_DIPSETTING(    0x04, "5" )
2125   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )      //??
2126   PORT_DIPSETTING(    0x10, "5000/10000/18000/30000" )
2127   PORT_DIPSETTING(    0x00, "5000/15000/30000" )
2128   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
2129   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2130   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2131   PORT_DIPNAME( 0x40, 0x40, "Allow Round Select" )
2132   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
2133   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )         // no collision though
2134   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
2135   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2136   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2120   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5")
2121   PORT_DIPSETTING(    0x10, "50k/100k/180k/300k" )
2122   PORT_DIPSETTING(    0x00, "50k/150k/300k" )
2123   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6")
2124   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
2125   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2126   PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) PORT_DIPLOCATION("SW2:7")
2127   PORT_DIPSETTING(    0x40, DEF_STR( No ) )   /* Normal game */
2128   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )   /* Levels are selectable / Player is Invincible */
2129   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
21372130INPUT_PORTS_END
21382131
21392132/***************************************************************************/
r1649r1650
27842777
27852778/* System16A */
27862779/*          rom       parent    machine   inp       init */
2787GAME( 1987, shinoblb,   shinobi,  shinob2,  shinobi,  shinobl,  ROT0,   "[Sega] (Beta bootleg)", "Shinobi (Beta bootleg)", 0 )
2788GAME( 1987, shinobld,   shinobi,  shinob2,  shinobi,  shinobl,  ROT0,   "[Sega] (Datsu bootleg)", "Shinobi (Datsu bootleg)", 0 )
2780GAME( 1987, shinoblb, shinobi,  shinob2,  shinobi,  shinobl,  ROT0,   "[Sega] (Beta bootleg)", "Shinobi (Beta bootleg)", 0 )
2781GAME( 1987, shinobld, shinobi,  shinob2,  shinobi,  shinobl,  ROT0,   "[Sega] (Datsu bootleg)", "Shinobi (Datsu bootleg)", 0 )
27892782
27902783/* System16B */
27912784/*          rom       parent    machine   inp       init */
src/mame/drivers/deniam.c
r1649r1650
3232***************************************************************************/
3333
3434#include "driver.h"
35#include "deprecat.h"
3536#include "cpu/z80/z80.h"
3637#include "sound/okim6295.h"
3738#include "sound/3812intf.h"
src/mame/drivers/nyny.c
r1649r1650
6363
6464#include "driver.h"
6565#include "rescap.h"
66#include "deprecat.h"
6667#include "machine/6821pia.h"
6768#include "machine/74123.h"
6869#include "video/crtc6845.h"
src/mame/drivers/limenko.c
r1649r1650
2424*/
2525
2626#include "driver.h"
27#include "deprecat.h"
2728#include "sound/okim6295.h"
2829#include "machine/eeprom.h"
2930
src/mame/drivers/redalert.c
r1649r1650
6868****************************************************************************/
6969
7070#include "driver.h"
71#include "deprecat.h"
7172#include "cpu/m6502/m6502.h"
7273#include "redalert.h"
7374
src/mame/drivers/mcr3.c
r1649r1650
8383
8484
8585#include "driver.h"
86#include "deprecat.h"
8687#include "machine/z80ctc.h"
8788#include "audio/mcr.h"
8889#include "mcr.h"
src/mame/drivers/pipeline.c
r1649r1650
4848*/
4949
5050#include "driver.h"
51#include "deprecat.h"
5152#include "machine/z80ctc.h"
5253#include "sound/2203intf.h"
5354#include "machine/8255ppi.h"
src/mame/drivers/stadhero.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6502/m6502.h"
1112#include "sound/2203intf.h"
1213#include "sound/3812intf.h"
r1649r1650
154155   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
155156   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
156157   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
157   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
158   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
158159   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
159160   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
160   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
161   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
162   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
161   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
162   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
163   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
163164   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
164165   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
165166   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/prehisle.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "sound/upd7759.h"
1314#include "sound/3812intf.h"
1415
src/mame/drivers/simpsons.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1314#include "cpu/z80/z80.h"
1415#include "video/konamiic.h"
src/mame/drivers/marvins.c
r1649r1650
2525*/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829#include "cpu/z80/z80.h"
2930#include "snk.h"
3031#include "sound/ay8910.h"
src/mame/drivers/wwfsstar.c
r1649r1650
5050*******************************************************************************/
5151
5252#include "driver.h"
53#include "deprecat.h"
5354#include "cpu/m68000/m68000.h"
5455#include "cpu/z80/z80.h"
5556#include "sound/2151intf.h"
src/mame/drivers/actfancr.c
r1649r1650
2323*******************************************************************************/
2424
2525#include "driver.h"
26#include "deprecat.h"
2627#include "cpu/m6502/m6502.h"
2728#include "cpu/h6280/h6280.h"
2829#include "sound/2203intf.h"
src/mame/drivers/model1.c
r1649r1650
625625*/
626626
627627#include "driver.h"
628#include "deprecat.h"
628629#include "machine/eeprom.h"
629630#include "system16.h"
630631#include "video/segaic24.h"
src/mame/drivers/polepos.c
r1649r1650
211211***************************************************************************/
212212
213213#include "driver.h"
214#include "deprecat.h"
214215#include "machine/namcoio.h"
215216#include "sound/namco.h"
216217#include "sound/namco52.h"
src/mame/drivers/taito_b.c
r1649r1650
8585    Ryujin                          (YM2610 sound)
8686
8787    Violence Fight                  (YM2203 sound, 1xMSM6295 )
88    Hit The Ice                     (YM2203 sound, 2xMSM6295 )
88    Hit The Ice                     (YM2203 sound, 1xMSM6295 )
8989    Master of Weapons               (YM2203 sound)
9090
9191    Quiz Sekai wa SHOW by shobai    (YM2610-B sound, MB87078 - electronic volume control)
r1649r1650
168168***************************************************************************/
169169
170170#include "driver.h"
171#include "deprecat.h"
171172#include "cpu/m68000/m68000.h"
172173#include "video/taitoic.h"
173174#include "machine/eeprom.h"
r1649r1650
10331034   AM_RANGE(0xf200, 0xf200) AM_WRITE(bankswitch_w)
10341035ADDRESS_MAP_END
10351036
1036static ADDRESS_MAP_START( hitice_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1037static ADDRESS_MAP_START( viofight_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
10371038   AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
10381039   AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1)
10391040   AM_RANGE(0x8000, 0x8fff) AM_READ(MRA8_RAM)
r1649r1650
10421043   AM_RANGE(0xa001, 0xa001) AM_READ(taitosound_slave_comm_r)
10431044ADDRESS_MAP_END
10441045
1045static ADDRESS_MAP_START( hitice_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1046   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
1047   AM_RANGE(0x8000, 0x8fff) AM_WRITE(MWA8_RAM)
1048   AM_RANGE(0x9000, 0x9000) AM_WRITE(YM2203_control_port_0_w)
1049   AM_RANGE(0x9001, 0x9001) AM_WRITE(YM2203_write_port_0_w)
1050   AM_RANGE(0xb000, 0xb000) AM_WRITE(OKIM6295_data_0_w)
1051   AM_RANGE(0xb001, 0xb001) AM_WRITE(OKIM6295_data_1_w)
1052   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
1053   AM_RANGE(0xa001, 0xa001) AM_WRITE(taitosound_slave_comm_w)
1054ADDRESS_MAP_END
1055
10561046static ADDRESS_MAP_START( viofight_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
10571047   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
10581048   AM_RANGE(0x8000, 0x8fff) AM_WRITE(MWA8_RAM)
r1649r1650
28342824
28352825   /* basic machine hardware */
28362826   MDRV_CPU_ADD(M68000, 12000000)   /* 12 MHz */
2837   MDRV_CPU_PROGRAM_MAP(hitice_readmem,hitice_writemem)
2827   MDRV_CPU_PROGRAM_MAP(hitice_readmem, hitice_writemem)
28382828   MDRV_CPU_VBLANK_INT(hitice_interrupt,1)
28392829
28402830   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz */
2841   MDRV_CPU_PROGRAM_MAP(hitice_sound_readmem,hitice_sound_writemem)
2831   MDRV_CPU_PROGRAM_MAP(viofight_sound_readmem, viofight_sound_writemem)
28422832
28432833   MDRV_SCREEN_REFRESH_RATE(60)
28442834   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
r1649r1650
28702860   MDRV_SOUND_ADD(OKIM6295, 1056000)
28712861   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
28722862   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
2873
2874   MDRV_SOUND_ADD(OKIM6295, 1056000)
2875   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
2876   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.65)
28772863MACHINE_DRIVER_END
28782864
28792865
r1649r1650
31163102   MDRV_CPU_VBLANK_INT(viofight_interrupt,1)
31173103
31183104   MDRV_CPU_ADD(Z80, 6000000)   /* 6 MHz verified */
3119   MDRV_CPU_PROGRAM_MAP(hitice_sound_readmem, viofight_sound_writemem)
3105   MDRV_CPU_PROGRAM_MAP(viofight_sound_readmem, viofight_sound_writemem)
31203106
31213107   MDRV_SCREEN_REFRESH_RATE(60)
31223108   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
src/mame/drivers/tank8.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "tank8.h"
910#include "sound/discrete.h"
1011
r1649r1650
537538}
538539
539540
540 GAME( 1976, tank8,  0,     tank8, tank8, 0,     ROT0, "Atari", "Tank 8 (set 1)", 0)
541GAME( 1976, tank8a, tank8, tank8, tank8, decode, ROT0, "Atari", "Tank 8 (set 2)",  GAME_NOT_WORKING )
542GAME( 1976, tank8b, tank8, tank8, tank8, decode, ROT0, "Atari", "Tank 8 (set 3)",  GAME_NOT_WORKING )
543GAME( 1976, tank8c, tank8, tank8, tank8, 0,      ROT0, "Atari", "Tank 8 (set 4)",  GAME_NOT_WORKING )
544GAME( 1976, tank8d, tank8, tank8, tank8, 0,      ROT0, "Atari", "Tank 8 (set 5)",  GAME_NOT_WORKING )
541GAME( 1976, tank8,    0,        tank8,    tank8,    0,         ROT0, "Atari", "Tank 8 (set 1)", 0)
542GAME( 1976, tank8a,   tank8,    tank8,    tank8,    decode,   ROT0, "Atari", "Tank 8 (set 2)",  GAME_NOT_WORKING )
543GAME( 1976, tank8b,   tank8,    tank8,    tank8,    decode,   ROT0, "Atari", "Tank 8 (set 3)",  GAME_NOT_WORKING )
544GAME( 1976, tank8c,   tank8,    tank8,    tank8,    0,        ROT0, "Atari", "Tank 8 (set 4)",  GAME_NOT_WORKING )
545GAME( 1976, tank8d,   tank8,    tank8,    tank8,    0,        ROT0, "Atari", "Tank 8 (set 5)",  GAME_NOT_WORKING )
src/mame/drivers/namcos86.c
r1649r1650
175175*******************************************************************/
176176
177177#include "driver.h"
178#include "deprecat.h"
178179#include "cpu/m6800/m6800.h"
179180#include "sound/2151intf.h"
180181#include "sound/namco.h"
src/mame/drivers/suna8.c
r1649r1650
3636***************************************************************************/
3737
3838#include "driver.h"
39#include "deprecat.h"
3940#include "cpu/z80/z80.h"
4041#include "sound/ay8910.h"
4142#include "sound/2203intf.h"
src/mame/drivers/vaportra.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/h6280/h6280.h"
1314#include "sound/2203intf.h"
1415#include "sound/2151intf.h"
src/mame/drivers/btime.c
r1649r1650
4747***************************************************************************/
4848
4949#include "driver.h"
50#include "deprecat.h"
5051#include "cpu/m6502/m6502.h"
5152#include "sound/ay8910.h"
5253
src/mame/drivers/qdrmfgp.c
r1649r1650
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "cpu/m68000/m68000.h"
2425#include "machine/idectrl.h"
2526#include "sound/k054539.h"
src/mame/drivers/cps1.c
r1649r1650
153153***************************************************************************/
154154
155155#include "driver.h"
156#include "deprecat.h"
156157#include "machine/eeprom.h"
157158#include "sound/2151intf.h"
158159#include "sound/okim6295.h"
src/mame/drivers/yunsun16.c
r1649r1650
8585***************************************************************************/
8686
8787#include "driver.h"
88#include "deprecat.h"
8889#include "sound/okim6295.h"
8990#include "sound/3812intf.h"
9091
src/mame/drivers/gaelco3d.c
r1649r1650
143143**************************************************************************/
144144
145145#include "driver.h"
146#include "deprecat.h"
146147#include "gaelco3d.h"
147148#include "cpu/tms32031/tms32031.h"
148149#include "cpu/adsp2100/adsp2100.h"
src/mame/drivers/itech8.c
r1649r1650
453453
454454
455455#include "driver.h"
456#include "deprecat.h"
456457#include "cpu/m6809/m6809.h"
457458#include "machine/6821pia.h"
458459#include "machine/6522via.h"
src/mame/drivers/galaxian.c
r1649r1650
355355***************************************************************************/
356356
357357#include "driver.h"
358#include "deprecat.h"
358359#include "cpu/z80/z80.h"
359360#include "cpu/s2650/s2650.h"
360361#include "galaxian.h"
src/mame/drivers/othldrby.c
r1649r1650
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "sound/okim6295.h"
1920
2021
src/mame/drivers/bbusters.c
r1649r1650
171171***************************************************************************/
172172
173173#include "driver.h"
174#include "deprecat.h"
174175#include "sound/2608intf.h"
175176#include "sound/2610intf.h"
176177
src/mame/drivers/gstriker.c
r1649r1650
3333******************************************************************************/
3434
3535#include "driver.h"
36#include "deprecat.h"
3637#include "gstriker.h"
3738#include "sound/2610intf.h"
3839
r1649r1650
663664GAME( 1993, gstriker, 0,        gstriker, gstriker, 0,        ROT0, "Human", "Grand Striker", GAME_IMPERFECT_GRAPHICS )
664665
665666/* Similar, but not identical hardware, appear to be protected by an MCU :-( */
666GAME( 199?, vgoalsoc, 0,        gstriker, gstriker, 0,        ROT0, "Tecmo", "V Goal Soccer", GAME_NOT_WORKING )
667GAME( 199?, vgoalsca, vgoalsoc, gstriker, gstriker, 0,        ROT0, "Tecmo", "V Goal Soccer (alt)", GAME_NOT_WORKING )
668GAME( 1994, twrldc94, 0,        twrldc94, gstriker, twrldc94,        ROT0, "Tecmo", "Tecmo World Cup '94", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
669GAME( 1994, twrdc94a, twrldc94,        twrldc94, gstriker, twrldc94,        ROT0, "Tecmo", "Tecmo World Cup '94 (set 2)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
670
671
667GAME( 199?, vgoalsoc, 0,        gstriker, gstriker, 0,        ROT0, "Tecmo", "V Goal Soccer (set 1)", GAME_NOT_WORKING )
668GAME( 199?, vgoalsca, vgoalsoc, gstriker, gstriker, 0,        ROT0, "Tecmo", "V Goal Soccer (set 2)", GAME_NOT_WORKING )
669GAME( 1994, twrldc94, 0,        twrldc94, gstriker, twrldc94, ROT0, "Tecmo", "Tecmo World Cup '94 (set 1)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
670GAME( 1994, twrdc94a, twrldc94, twrldc94, gstriker, twrldc94, ROT0, "Tecmo", "Tecmo World Cup '94 (set 2)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/snk.c
r1649r1650
216216***************************************************************************/
217217
218218#include "driver.h"
219#include "deprecat.h"
219220#include "cpu/z80/z80.h"
220221#include "snk.h"
221222#include "sound/3812intf.h"
src/mame/drivers/hyprduel.c
r1649r1650
2727***************************************************************************/
2828
2929#include "driver.h"
30#include "deprecat.h"
3031#include "sound/2151intf.h"
3132#include "sound/okim6295.h"
3233#include "sound/2413intf.h"
src/mame/drivers/arcadecl.c
r1649r1650
6767
6868
6969#include "driver.h"
70#include "deprecat.h"
7071#include "machine/atarigen.h"
7172#include "arcadecl.h"
7273#include "sound/okim6295.h"
src/mame/drivers/namconb1.c
r1649r1650
270270                    Custom 169     (120 pin PQFP)
271271*/
272272#include "driver.h"
273#include "deprecat.h"
273274#include "namconb1.h"
274275#include "namcos2.h"
275276#include "namcoic.h"
src/mame/drivers/flstory.c
r1649r1650
1212
1313***************************************************************************/
1414
15#include <math.h>
1615#include "driver.h"
16#include "deprecat.h"
1717#include "cpu/z80/z80.h"
1818#include "cpu/m6805/m6805.h"
1919#include "sound/ay8910.h"
src/mame/drivers/suprslam.c
r1649r1650
8181******************************************************************************/
8282
8383#include "driver.h"
84#include "deprecat.h"
8485#include "video/konamiic.h"
8586#include "sound/2610intf.h"
8687
src/mame/drivers/strnskil.c
r1649r1650
1515*****************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "sound/sn76496.h"
1920
2021static UINT8 *strnskil_sharedram;
src/mame/drivers/atetris.c
r1649r1650
4848
4949
5050#include "driver.h"
51#include "deprecat.h"
5152#include "cpu/m6502/m6502.h"
5253#include "slapstic.h"
5354#include "atetris.h"
r1649r1650
522523GAME( 1988, atetris,  0,       atetris,  atetris,  atetris, ROT0,   "Atari Games", "Tetris (set 1)", GAME_SUPPORTS_SAVE )
523524GAME( 1988, atetrisa, atetris, atetris,  atetris,  atetris, ROT0,   "Atari Games", "Tetris (set 2)", GAME_SUPPORTS_SAVE )
524525GAME( 1988, atetrisb, atetris, atetris,  atetris,  atetris, ROT0,   "bootleg",     "Tetris (bootleg set 1)", GAME_SUPPORTS_SAVE )
525GAME( 1988, atetrsb2, atetris, atetrsb2, atetris,  atetris, ROT0,   "bootleg",   "Tetris (bootleg set 2)", GAME_SUPPORTS_SAVE )
526GAME( 1989, atetcktl, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (Cocktail set 1)", GAME_SUPPORTS_SAVE )
527GAME( 1989, atetckt2, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (Cocktail set 2)", GAME_SUPPORTS_SAVE )
526GAME( 1988, atetrsb2, atetris, atetrsb2, atetris,  atetris, ROT0,   "bootleg",     "Tetris (bootleg set 2)", GAME_SUPPORTS_SAVE )
527GAME( 1989, atetcktl, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (cocktail set 1)", GAME_SUPPORTS_SAVE )
528GAME( 1989, atetckt2, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (cocktail set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/dgpix.c
r1649r1650
313313
314314static VIDEO_UPDATE( dgpix )
315315{
316   copybitmap(bitmap,bitmaps[vbuffer ^ 1],0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
316   copybitmap(bitmap,bitmaps[vbuffer ^ 1],0,0,0,0,cliprect);
317317   return 0;
318318}
319319
src/mame/drivers/cosmic.c
r1649r1650
1212
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "cpu/z80/z80.h"
1617#include "sound/samples.h"
1718#include "sound/dac.h"
r1649r1650
2021PALETTE_INIT( panic );
2122PALETTE_INIT( cosmica );
2223PALETTE_INIT( cosmicg );
23PALETTE_INIT( magspot2 );
24PALETTE_INIT( magspot );
2425PALETTE_INIT( nomnlnd );
2526VIDEO_UPDATE( panic );
26VIDEO_UPDATE( magspot2 );
27VIDEO_UPDATE( magspot );
2728VIDEO_UPDATE( devzone );
2829VIDEO_UPDATE( cosmica );
2930VIDEO_UPDATE( cosmicg );
r1649r1650
224225      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
225226}
226227
227static INTERRUPT_GEN( magspot2_interrupt )
228static INTERRUPT_GEN( magspot_interrupt )
228229{
229230   /* Coin 1 causes an IRQ, Coin 2 an NMI */
230231   if (input_port_4_r(0) & 0x01)
r1649r1650
254255   return (input_port_0_r(0) & 0xf0) | ((video_screen_get_vpos(0) & 0xf0) >> 4);
255256}
256257
257static READ8_HANDLER( magspot2_coinage_dip_r )
258static READ8_HANDLER( magspot_coinage_dip_r )
258259{
259260   return (input_port_5_r(0) & (1 << (7 - offset))) ? 0 : 1;
260261}
r1649r1650
353354ADDRESS_MAP_END
354355
355356
356static ADDRESS_MAP_START( magspot2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
357static ADDRESS_MAP_START( magspot_readmem, ADDRESS_SPACE_PROGRAM, 8 )
357358   AM_RANGE(0x0000, 0x2fff) AM_READ(MRA8_ROM)
358   AM_RANGE(0x3800, 0x3807) AM_READ(magspot2_coinage_dip_r)
359   AM_RANGE(0x3800, 0x3807) AM_READ(magspot_coinage_dip_r)
359360   AM_RANGE(0x5000, 0x5000) AM_READ(input_port_0_r)
360361   AM_RANGE(0x5001, 0x5001) AM_READ(input_port_1_r)
361362   AM_RANGE(0x5002, 0x5002) AM_READ(input_port_2_r)
r1649r1650
363364   AM_RANGE(0x6000, 0x7fff) AM_READ(MRA8_RAM)
364365ADDRESS_MAP_END
365366
366static ADDRESS_MAP_START( magspot2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
367static ADDRESS_MAP_START( magspot_writemem, ADDRESS_SPACE_PROGRAM, 8 )
367368   AM_RANGE(0x0000, 0x2fff) AM_WRITE(MWA8_ROM)
368369   AM_RANGE(0x4000, 0x401f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
369370   AM_RANGE(0x4800, 0x4800) AM_WRITE(DAC_0_data_w)
r1649r1650
537538INPUT_PORTS_END
538539
539540
540static INPUT_PORTS_START( magspot2 )
541static INPUT_PORTS_START( magspot )
541542   PORT_START   /* IN0 */
542543   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
543544   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
r1649r1650
922923
923924
924925static GFXDECODE_START( panic )
925   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout16,  0, 8 )
926   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout32,  0, 8 )
926   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout16, 16, 8 )
927   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout32, 16, 8 )
927928GFXDECODE_END
928929
929930static GFXDECODE_START( cosmica )
930   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout16,  0, 16 )
931   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout32,  0, 16 )
931   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout16,  8, 16 )
932   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout32,  8, 16 )
932933GFXDECODE_END
933934
934935
r1649r1650
10091010
10101011   /* video hardware */
10111012   MDRV_GFXDECODE(panic)
1012   MDRV_PALETTE_LENGTH(16)
1013   MDRV_COLORTABLE_LENGTH(8*4)
1013   MDRV_PALETTE_LENGTH(16+8*4)
10141014
10151015   MDRV_PALETTE_INIT(panic)
10161016   MDRV_VIDEO_UPDATE(panic)
r1649r1650
10381038
10391039   /* video hardware */
10401040   MDRV_GFXDECODE(cosmica)
1041   MDRV_PALETTE_LENGTH(8)
1042   MDRV_COLORTABLE_LENGTH(16*4)
1041   MDRV_PALETTE_LENGTH(8+16*4)
10431042
10441043   MDRV_PALETTE_INIT(cosmica)
10451044   MDRV_VIDEO_UPDATE(cosmica)
r1649r1650
10821081MACHINE_DRIVER_END
10831082
10841083
1085static MACHINE_DRIVER_START( magspot2 )
1084static MACHINE_DRIVER_START( magspot )
10861085
10871086   /* basic machine hardware */
10881087   MDRV_IMPORT_FROM(cosmic)
10891088   MDRV_CPU_MODIFY("main")
10901089
1091   MDRV_CPU_PROGRAM_MAP(magspot2_readmem,magspot2_writemem)
1092   MDRV_CPU_VBLANK_INT(magspot2_interrupt,1)
1090   MDRV_CPU_PROGRAM_MAP(magspot_readmem,magspot_writemem)
1091   MDRV_CPU_VBLANK_INT(magspot_interrupt,1)
10931092
10941093   /* video hardware */
10951094   MDRV_GFXDECODE(panic)
1096   MDRV_PALETTE_LENGTH(16)
1097   MDRV_COLORTABLE_LENGTH(8*4)
1095   MDRV_PALETTE_LENGTH(16+8*4)
10981096
1099   MDRV_PALETTE_INIT(magspot2)
1100   MDRV_VIDEO_UPDATE(magspot2)
1097   MDRV_PALETTE_INIT(magspot)
1098   MDRV_VIDEO_UPDATE(magspot)
11011099
11021100   /* sound hardware */
11031101   MDRV_SPEAKER_STANDARD_MONO("mono")
r1649r1650
11101108static MACHINE_DRIVER_START( devzone )
11111109
11121110   /* basic machine hardware */
1113   MDRV_IMPORT_FROM(magspot2)
1111   MDRV_IMPORT_FROM(magspot)
11141112
11151113   /* video hardware */
11161114   MDRV_VIDEO_UPDATE(devzone)
r1649r1650
11231121   MDRV_IMPORT_FROM(cosmic)
11241122   MDRV_CPU_MODIFY("main")
11251123
1126   MDRV_CPU_PROGRAM_MAP(magspot2_readmem,magspot2_writemem)
1124   MDRV_CPU_PROGRAM_MAP(magspot_readmem,magspot_writemem)
11271125   MDRV_CPU_VBLANK_INT(nomnlnd_interrupt,1)
11281126
11291127   /* video hardware */
11301128   MDRV_GFXDECODE(panic)
1131   MDRV_PALETTE_LENGTH(8)
1132   MDRV_COLORTABLE_LENGTH(8*4)
1129   MDRV_PALETTE_LENGTH(16+8*4)
11331130
11341131   MDRV_PALETTE_INIT(nomnlnd)
11351132   MDRV_VIDEO_UPDATE(nomnlnd)
r1649r1650
14771474
14781475        memory_region(REGION_CPU1)[offs] = normal;
14791476    }
1480
1481
1482    /* Patch to avoid crash - Seems like duff romcheck routine */
1483    /* I would expect it to be bitrot, but have two romsets    */
1484    /* from different sources with the same problem!           */
1485    memory_region(REGION_CPU1)[0x1e9e] = 0x04;
1486    memory_region(REGION_CPU1)[0x1e9f] = 0xc0;
14871477}
14881478
14891479
r1649r1650
15101500GAME( 1980, panic3,   panic,   panic,    panic,    0,       ROT270, "Universal", "Space Panic (set 3)", 0 )
15111501GAME( 1980, panich,   panic,   panic,    panic,    0,       ROT270, "Universal", "Space Panic (harder)", 0 )
15121502GAME( 1980, panicger, panic,   panic,    panic,    0,       ROT270, "Universal (ADP Automaten license)", "Space Panic (German)", 0 )
1513GAME( 1980, magspot,  0,      magspot2, magspot2, 0,       ROT270, "Universal", "Magical Spot", GAME_IMPERFECT_SOUND )
1514GAME( 1980, magspot2, 0,       magspot2, magspot2, 0,       ROT270, "Universal", "Magical Spot II", GAME_IMPERFECT_SOUND )
1503GAME( 1980, magspot,  0,      magspot,  magspot,  0,       ROT270, "Universal", "Magical Spot", GAME_IMPERFECT_SOUND )
1504GAME( 1980, magspot2, 0,       magspot,  magspot,  0,       ROT270, "Universal", "Magical Spot II", GAME_IMPERFECT_SOUND )
15151505GAME( 1980, devzone,  0,       devzone,  devzone,  devzone, ROT270, "Universal", "Devil Zone", GAME_IMPERFECT_SOUND )
15161506GAME( 1980, devzone2, devzone, devzone,  devzone2, devzone, ROT270, "Universal", "Devil Zone (easier)", GAME_IMPERFECT_SOUND )
15171507GAME( 1980, nomnlnd,  0,       nomnlnd,  nomnlnd,  nomnlnd, ROT270, "Universal", "No Man's Land", GAME_IMPERFECT_SOUND )
src/mame/drivers/sangho.c
r1649r1650
4747*/
4848
4949#include "driver.h"
50#include "deprecat.h"
5051#include "cpu/z80/z80.h"
5152#include "video/v9938.h"
5253#include "sound/2413intf.h"
src/mame/drivers/shaolins.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "sound/sn76496.h"
1112
1213
src/mame/drivers/model2.c
r1649r1650
4949*/
5050
5151#include "driver.h"
52#include "deprecat.h"
5253#include "machine/eeprom.h"
5354#include "video/segaic24.h"
5455#include "cpu/i960/i960.h"
src/mame/drivers/bmcbowl.c
r1649r1650
104104*/
105105
106106#include "driver.h"
107#include "deprecat.h"
107108#include "cpu/m68000/m68000.h"
108109#include "machine/6522via.h"
109110#include "sound/ay8910.h"
src/mame/drivers/ataxx.c
r1649r1650
287287
288288/*************************************
289289 *
290 *  Graphics definitions
291 *
292 *************************************/
293
294static const gfx_layout bklayout =
295{
296   8,8,
297   RGN_FRAC(1,6),
298   6,
299   { RGN_FRAC(5,6), RGN_FRAC(4,6), RGN_FRAC(3,6), RGN_FRAC(2,6), RGN_FRAC(1,6), RGN_FRAC(0,6) },
300   { 0, 1, 2, 3, 4, 5, 6, 7 },
301   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
302   8*8
303};
304
305static GFXDECODE_START( ataxx )
306   GFXDECODE_ENTRY( REGION_GFX1, 0, bklayout, 0, 1 )
307GFXDECODE_END
308
309
310
311/*************************************
312 *
313290 *  Sound definitions
314291 *
315292 *************************************/
r1649r1650
343320   MDRV_CPU_PROGRAM_MAP(leland_80186_map_program,0)
344321   MDRV_CPU_IO_MAP(ataxx_80186_map_io,0)
345322
346   MDRV_SCREEN_REFRESH_RATE(60)
347
348323   MDRV_MACHINE_START(ataxx)
349324   MDRV_MACHINE_RESET(ataxx)
350325   MDRV_NVRAM_HANDLER(ataxx)
351326
352327   /* video hardware */
353   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
354   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
355   MDRV_SCREEN_SIZE(40*8, 32*8)
356   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
357   MDRV_GFXDECODE(ataxx)
358   MDRV_PALETTE_LENGTH(1024)
328   MDRV_IMPORT_FROM(ataxx_video)
359329
360   MDRV_VIDEO_START(ataxx)
361   MDRV_VIDEO_EOF(leland)
362   MDRV_VIDEO_UPDATE(ataxx)
363
364330   /* sound hardware */
365331   MDRV_SPEAKER_STANDARD_MONO("mono")
366332
r1649r1650
407373   ROM_LOAD16_BYTE( "e-302-31002-01.u2",  0x60000, 0x20000, CRC(ca06a394) SHA1(0858908bd150dd7354536e10b2a386b45f17ac9f) )
408374   ROM_RELOAD(                    0xc0000, 0x20000 )
409375
410   ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE )
376   ROM_REGION( 0xc0000, REGION_GFX1, 0 )
411377   ROM_LOAD( "e-302-31006-01.u98",  0x00000, 0x20000, CRC(59d0f2ae) SHA1(8da5dc006e192af98458227e79421b6a07ac1cdc) )
412378   ROM_LOAD( "e-302-31007-01.u99",  0x20000, 0x20000, CRC(6ab7db25) SHA1(25c2fa23b99ac4bab5a9b851c2087de44512a5c2) )
413379   ROM_LOAD( "e-302-31008-01.u100",  0x40000, 0x20000, CRC(2352849e) SHA1(f49394b6efb6a87d86516ec0a5ddd582f96f7e5d) )
r1649r1650
438404   ROM_LOAD16_BYTE( "e-302-31002-01.u2",  0x60000, 0x20000, CRC(ca06a394) SHA1(0858908bd150dd7354536e10b2a386b45f17ac9f) )
439405   ROM_RELOAD(                    0xc0000, 0x20000 )
440406
441   ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE )
407   ROM_REGION( 0xc0000, REGION_GFX1, 0 )
442408   ROM_LOAD( "e-302-31006-01.u98",  0x00000, 0x20000, CRC(59d0f2ae) SHA1(8da5dc006e192af98458227e79421b6a07ac1cdc) )
443409   ROM_LOAD( "e-302-31007-01.u99",  0x20000, 0x20000, CRC(6ab7db25) SHA1(25c2fa23b99ac4bab5a9b851c2087de44512a5c2) )
444410   ROM_LOAD( "e-302-31008-01.u100",  0x40000, 0x20000, CRC(2352849e) SHA1(f49394b6efb6a87d86516ec0a5ddd582f96f7e5d) )
r1649r1650
469435   ROM_LOAD16_BYTE( "ataxxj.u2", 0x60000, 0x20000, CRC(1b63b882) SHA1(cb04e641fc173f787a0f48c98f5198db265c26d8) )
470436   ROM_RELOAD(                    0xc0000, 0x20000 )
471437
472   ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE )
438   ROM_REGION( 0xc0000, REGION_GFX1, 0 )
473439   ROM_LOAD( "e-302-31006-01.u98",  0x00000, 0x20000, CRC(59d0f2ae) SHA1(8da5dc006e192af98458227e79421b6a07ac1cdc) )
474440   ROM_LOAD( "e-302-31007-01.u99",  0x20000, 0x20000, CRC(6ab7db25) SHA1(25c2fa23b99ac4bab5a9b851c2087de44512a5c2) )
475441   ROM_LOAD( "e-302-31008-01.u100",  0x40000, 0x20000, CRC(2352849e) SHA1(f49394b6efb6a87d86516ec0a5ddd582f96f7e5d) )
r1649r1650
506472   ROM_LOAD16_BYTE( "30019-01.u5",  0x60000, 0x20000, CRC(2881f73b) SHA1(414d974018fb4518c46b913184b07add69251724) )
507473   ROM_RELOAD(                      0xc0000, 0x20000 )
508474
509   ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE )
475   ROM_REGION( 0x60000, REGION_GFX1, 0 )
510476   ROM_LOAD( "30011-02.145",  0x00000, 0x10000, CRC(6153569b) SHA1(b6a106c8b87a9a3f01eff3854d0c1f2c4a64fd94) )
511477   ROM_LOAD( "30012-02.146",  0x10000, 0x10000, CRC(52d65e21) SHA1(25f63aa29dc7e7673043e1f43e357a5232a1be9e) )
512478   ROM_LOAD( "30013-02.147",  0x20000, 0x10000, CRC(b3afda12) SHA1(52bf780c642f0092114aeb994e6571c034f198a0) )
r1649r1650
551517   ROM_LOAD16_BYTE( "u5_27c.010",  0x60000, 0x20000, CRC(198285d4) SHA1(8f6b3cba2bc729f2e0623578b13720ead91333e4) )
552518   ROM_RELOAD(                     0xc0000, 0x20000 )
553519
554   ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE )
520   ROM_REGION( 0xc0000, REGION_GFX1, 0 )
555521   ROM_LOAD( "u145_27c.010",  0x00000, 0x20000, CRC(612d4bf8) SHA1(035cc8723524e2c6aa79ffa7d7c1f6fb0a25cc51) )
556522   ROM_LOAD( "u146_27c.010",  0x20000, 0x20000, CRC(77a725f6) SHA1(9bb521ed7202387bbf2670f9b1ae3cbe5064ae03) )
557523   ROM_LOAD( "u147_27c.010",  0x40000, 0x20000, CRC(d6aac372) SHA1(49f5f5d6c2a82ea15905086a2f8e3ea061d37dfc) )
r1649r1650
597563   ROM_LOAD16_BYTE( "u5",  0x60000, 0x20000, CRC(cbdb914b) SHA1(813640fa291c1245d04a628ee62afc95d5c67a03) )
598564   ROM_RELOAD(             0xc0000, 0x20000 )
599565
600   ROM_REGION( 0x180000, REGION_GFX1, ROMREGION_DISPOSE )
566   ROM_REGION( 0x180000, REGION_GFX1, 0 )
601567   ROM_LOAD( "u145",  0x000000, 0x40000, CRC(c3d20d24) SHA1(a75217b0d1887c64bf5570ff7a461c8cf47c5e85) )
602568   ROM_LOAD( "u146",  0x040000, 0x40000, CRC(43e9dd87) SHA1(0694803a5b33c074858770c7e4cd884402c263f8) )
603569   ROM_LOAD( "u147",  0x080000, 0x40000, CRC(fb855ce8) SHA1(839bca2d8e344d43fad8978b812c9246a89054a8) )
r1649r1650
651617   ROM_LOAD16_BYTE( "asy-65.5",  0x60000, 0x20000, CRC(5814b307) SHA1(6db97804d58941a5543424d8c4658cb3edab1e43) )
652618   ROM_RELOAD(             0xc0000, 0x20000 )
653619
654   ROM_REGION( 0x180000, REGION_GFX1, ROMREGION_DISPOSE )
620   ROM_REGION( 0x180000, REGION_GFX1, 0 )
655621   ROM_LOAD( "asy-chr0.145",  0x000000, 0x40000, CRC(4dbcae49) SHA1(0aa54daa099d6590a41df4a24a27bf6463b3e116) )
656622   ROM_LOAD( "asy-chr1.146",  0x040000, 0x40000, CRC(34e7762d) SHA1(2d63971effc237846481bed7d829fa924b4bea31) )
657623   ROM_LOAD( "asy-chr2.147",  0x080000, 0x40000, CRC(f9b0d375) SHA1(305172d8cdf390d9566c2c6f32d8da44b165022a) )
src/mame/drivers/sshangha.c
r1649r1650
5252***************************************************************************/
5353
5454#include "driver.h"
55#include "deprecat.h"
5556#include "sound/2203intf.h"
5657#include "sound/okim6295.h"
5758
src/mame/drivers/wiping.c
r1649r1650
3434
3535***************************************************************************/
3636#include "driver.h"
37#include "deprecat.h"
3738#include "cpu/z80/z80.h"
3839#include "sound/custom.h"
3940
src/mame/drivers/kyugo.c
r1649r1650
2222***************************************************************************/
2323
2424#include "driver.h"
25#include "deprecat.h"
2526#include "kyugo.h"
2627#include "sound/ay8910.h"
2728
r1649r1650
12721273GAME( 1986, srdmissn, 0,        srdmissn, srdmissn, srdmissn, ROT90, "Taito Corporation", "S.R.D. Mission", 0 )
12731274GAME( 1986, fx,       srdmissn, srdmissn, srdmissn, srdmissn, ROT90, "bootleg", "F-X", 0 )
12741275GAME( 1986?,legend,   0,        legend,   legend,   srdmissn, ROT0,  "Sega / Coreland ?", "Legend", 0 )
1275GAME( 1987, airwolf,  0,        srdmissn, airwolf,  srdmissn, ROT0,  "Kyugo", "Airwolf (set 1)", 0 )
1276GAME( 1987, airwolf,  0,        srdmissn, airwolf,  srdmissn, ROT0,  "Kyugo", "Airwolf", 0 )
12761277GAME( 1987, airwolfa, airwolf,  srdmissn, airwolf,  srdmissn, ROT0,  "Kyugo (UA Theatre license)", "Airwolf (US)", 0 )
12771278GAME( 1987, skywolf,  airwolf,  srdmissn, skywolf,  srdmissn, ROT0,  "bootleg", "Sky Wolf (set 1)", 0 )
12781279GAME( 1987, skywolf2, airwolf,  srdmissn, airwolf,  srdmissn, ROT0,  "bootleg", "Sky Wolf (set 2)", 0 )
src/mame/drivers/leland.c
r1649r1650
667667
668668/*************************************
669669 *
670 *  Graphics definitions
671 *
672 *************************************/
673
674static const gfx_layout bklayout =
675{
676   8,8,
677   RGN_FRAC(1,3),
678   3,
679   { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
680   { 0, 1, 2, 3, 4, 5, 6, 7 },
681   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
682   8*8
683};
684
685static GFXDECODE_START( leland )
686   GFXDECODE_ENTRY( REGION_GFX1, 0, bklayout, 0, 8 )
687GFXDECODE_END
688
689
690
691/*************************************
692 *
693670 *  Sound definitions
694671 *
695672 *************************************/
r1649r1650
748725   MDRV_CPU_PROGRAM_MAP(slave_small_map_program,0)
749726   MDRV_CPU_IO_MAP(slave_map_io,0)
750727
751   MDRV_SCREEN_REFRESH_RATE(60)
752
753728   MDRV_MACHINE_START(leland)
754729   MDRV_MACHINE_RESET(leland)
755730   MDRV_NVRAM_HANDLER(leland)
756731
757732   /* video hardware */
758   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
759   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
760   MDRV_SCREEN_SIZE(40*8, 32*8)
761   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
762   MDRV_GFXDECODE(leland)
763   MDRV_PALETTE_LENGTH(1024)
733   MDRV_IMPORT_FROM(leland_video)
764734
765   MDRV_VIDEO_START(leland)
766   MDRV_VIDEO_EOF(leland)
767   MDRV_VIDEO_UPDATE(leland)
768
769735   /* sound hardware */
770736   MDRV_SPEAKER_STANDARD_MONO("mono")
771737
r1649r1650
850816   ROM_LOAD( "3-23u8",  0x0a000, 0x02000, CRC(dbabdbde) SHA1(906ff8f91eaf01f0435d7ac1291af62073568d2f) )
851817   ROM_LOAD( "3-23u9",  0x0c000, 0x02000, CRC(eb992385) SHA1(0951d6fb5ff8508ef7184e9c26be6c20b85bad72) )
852818
853   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
819   ROM_REGION( 0x06000, REGION_GFX1, 0 )
854820   ROM_LOAD( "3-23u93", 0x00000, 0x02000, CRC(14a1a4b0) SHA1(aad63e368a09497188f8112d1ca0ac0d0366ac61) )
855821   ROM_LOAD( "3-23u94", 0x02000, 0x02000, CRC(207a1709) SHA1(c7fbb80a83a5684b6b35750df68d51091e8747e4) )
856822   ROM_LOAD( "3-23u95", 0x04000, 0x02000, CRC(e9c86267) SHA1(c7f3a4725824da1e2793160409821017bd0bd956) )
r1649r1650
896862   ROM_LOAD( "13214.9",  0x1a000, 0x02000, CRC(96f3e8d9) SHA1(e0a663c3c9dc77f2ec10c71a9d227ec3ea765c6e) )
897863   ROM_CONTINUE(         0x26000, 0x02000 )
898864
899   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
865   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
900866   ROM_LOAD( "13204.93", 0x00000, 0x04000, CRC(de183518) SHA1(080cd45c2c7d81b8edd5170aa6a587ae6e7e54fb) )
901867   ROM_LOAD( "13205.94", 0x04000, 0x04000, CRC(c61f63ac) SHA1(c52fe331391720796556a7eab7d145fd1dacf6ed) )
902868   ROM_LOAD( "13206.95", 0x08000, 0x04000, CRC(8e7bd2fd) SHA1(ccd97ef604be6d4479a8a91fccecb5d71a4d82af) )
r1649r1650
940906   ROM_LOAD( "13317.008",  0x18000, 0x02000, CRC(a081a031) SHA1(c7eef2022bc623bb3399895e092d6cb56c50b5e3) )
941907   ROM_CONTINUE(           0x24000, 0x02000 )
942908
943   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
909   ROM_REGION( 0x06000, REGION_GFX1, 0 )
944910   ROM_LOAD( "13302.093", 0x00000, 0x02000, CRC(9beaa403) SHA1(02af1fb98f61b3e7758524978deba094224c8a5d) )
945911   ROM_LOAD( "13303.094", 0x02000, 0x02000, CRC(2bf711d0) SHA1(bf20177e1b07b12b4ef833072b313a2917d1b65e) )
946912   ROM_LOAD( "13304.095", 0x04000, 0x02000, CRC(06b8675b) SHA1(8b25a473c03f8210f5d8542c0dc6643c499a0afa) )
r1649r1650
988954   ROM_LOAD( "13422-00.u9",  0x1a000, 0x02000, CRC(222e8405) SHA1(a1cc700e06df43847b635858d21ff2e45d8e00ab) )
989955   ROM_CONTINUE(             0x26000, 0x02000 )
990956
991   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
957   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
992958   ROM_LOAD( "13401-00.u93", 0x00000, 0x04000, CRC(4ea3e641) SHA1(7628fbf25b5e36d06818d2f9cdc66e2fb15cba4f) )
993959   ROM_LOAD( "13402-00.u94", 0x04000, 0x04000, CRC(71a8a56c) SHA1(b793a9641dd5d4cd122fb8f5cf1eef5dc3fd475c) )
994960   ROM_LOAD( "13403-00.u95", 0x08000, 0x04000, CRC(8077ae25) SHA1(15bb1f99e8aea67b9057ef5ef8570f33470a24a3) )
r1649r1650
10361002   ROM_LOAD( "009",  0x1a000, 0x02000, CRC(6d74274e) SHA1(10bb04243eabeb8178884b4e0691c5e1765a1dc4) )
10371003   ROM_CONTINUE(     0x26000, 0x02000 )
10381004
1039   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
1005   ROM_REGION( 0x06000, REGION_GFX1, 0 )
10401006   ROM_LOAD( "093", 0x00000, 0x02000, CRC(54456e6f) SHA1(be41711f57b5b9bd6651399f0df00c538ca1a3a5) )
10411007   ROM_LOAD( "094", 0x02000, 0x02000, CRC(edc240da) SHA1(a812ab0cccb20cd68e9dbe283d4aab92f540af24) )
10421008   ROM_LOAD( "095", 0x04000, 0x02000, CRC(19793ed0) SHA1(2a3cb81726977b29c88d47c90d6e15a7e287c836) )
r1649r1650
10841050   ROM_LOAD( "uya-u9.bin",  0x1a000, 0x02000, CRC(6d74274e) SHA1(10bb04243eabeb8178884b4e0691c5e1765a1dc4) )
10851051   ROM_CONTINUE(            0x26000, 0x02000 )
10861052
1087   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1053   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
10881054   ROM_LOAD( "uya-u93.bin", 0x00000, 0x04000, CRC(e8addd70) SHA1(6fd6a09fbdbe866440c3205b103e4bede7e4b2d5) )
10891055   ROM_LOAD( "uya-u94.bin", 0x04000, 0x04000, CRC(3fd3be09) SHA1(abdafbf9472fe3320be1a3effd13407dadf66709) )
10901056   ROM_LOAD( "uya-u95.bin", 0x08000, 0x04000, CRC(37088dd1) SHA1(35e4a3b338baceae2e4b8ac6d95691af49ebc3c1) )
r1649r1650
11191085   ROM_LOAD( "13821.8",   0x18000, 0x02000, CRC(92f3e006) SHA1(134a2412ddc700473b70aec6331b1a65db3c7e29) )
11201086   ROM_CONTINUE(          0x24000, 0x02000 )
11211087
1122   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1088   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
11231089   ROM_LOAD( "13801.93", 0x00000, 0x04000, CRC(f9ff55ec) SHA1(2eab55b3708def97f22a1f13d1faa0bfe19c18e9) )
11241090   ROM_LOAD( "13802.94", 0x04000, 0x04000, CRC(d4adbcbb) SHA1(dfd427d5a0db309cc7e056857c3b63a1b6e7769b) )
11251091   ROM_LOAD( "13803.95", 0x08000, 0x04000, CRC(9178ed76) SHA1(f05568eea53c38f46b16217e63b73194d3a3c500) )
r1649r1650
11721138   ROM_LOAD( "14106-01.u9",  0x1a000, 0x02000, CRC(b9656baa) SHA1(41b25ee6127981b703859c07f730e94f5694faff) )
11731139   ROM_CONTINUE(             0x26000, 0x02000 )
11741140
1175   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1141   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
11761142   ROM_LOAD( "14112-00.u93", 0x00000, 0x04000, CRC(8ccb1404) SHA1(28ef5a7da1b9edf7ecbba0fd473599df5d181602) )
11771143   ROM_LOAD( "14113-00.u94", 0x04000, 0x04000, CRC(9941a55b) SHA1(6917b70bb2a7a23c0517fde43e9375a7dbd64c18) )
11781144   ROM_LOAD( "14114-00.u95", 0x08000, 0x04000, CRC(b68baf47) SHA1(ea1d5efe696af56ef5b9161c00957b2a9c7ce372) )
r1649r1650
12271193   ROM_LOAD( "15006-01.u09",  0x1a000, 0x02000, CRC(ab3aac49) SHA1(699a6a66e6b35f1b287ff1ab3a12365dbdc16041) )
12281194   ROM_CONTINUE(              0x26000, 0x02000 )
12291195
1230   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1196   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
12311197   ROM_LOAD( "15015-01.u93", 0x00000, 0x04000, CRC(8ccb1404) SHA1(28ef5a7da1b9edf7ecbba0fd473599df5d181602) )
12321198   ROM_LOAD( "15016-01.u94", 0x04000, 0x04000, CRC(9941a55b) SHA1(6917b70bb2a7a23c0517fde43e9375a7dbd64c18) )
12331199   ROM_LOAD( "15017-01.u95", 0x08000, 0x04000, CRC(b68baf47) SHA1(ea1d5efe696af56ef5b9161c00957b2a9c7ce372) )
r1649r1650
12821248   ROM_LOAD( "strkzone.u9",  0x1a000, 0x02000, CRC(ab3aac49) SHA1(699a6a66e6b35f1b287ff1ab3a12365dbdc16041) )
12831249   ROM_CONTINUE(             0x26000, 0x02000 )
12841250
1285   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1251   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
12861252   ROM_LOAD( "strkzone.u93", 0x00000, 0x04000, CRC(8ccb1404) SHA1(28ef5a7da1b9edf7ecbba0fd473599df5d181602) )
12871253   ROM_LOAD( "strkzone.u94", 0x04000, 0x04000, CRC(9941a55b) SHA1(6917b70bb2a7a23c0517fde43e9375a7dbd64c18) )
12881254   ROM_LOAD( "strkzone.u95", 0x08000, 0x04000, CRC(b68baf47) SHA1(ea1d5efe696af56ef5b9161c00957b2a9c7ce372) )
r1649r1650
13231289   ROM_LOAD16_BYTE( "17t",    0x0e0001, 0x10000, CRC(8d26f221) SHA1(cd5b1d88fec0ff1ab7af554a9fcffc43d33a12e7) )
13241290   ROM_LOAD16_BYTE( "28t",    0x0e0000, 0x10000, CRC(7aa21b2c) SHA1(5fd9f49d4bb1dc28393b9df76dfa19e28677639b) )
13251291
1326   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1292   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
13271293   ROM_LOAD( "13930-01.u93", 0x00000, 0x04000, CRC(0721f42e) SHA1(fe3d447316b1e6c7c1b6849319fad1aebe5e6aa1) )
13281294   ROM_LOAD( "13929-01.u94", 0x04000, 0x04000, CRC(1522e7b2) SHA1(540fc55013a22a5afb32a89b42ef9b11dbe36d97) )
13291295   ROM_LOAD( "13928-01.u95", 0x08000, 0x04000, CRC(c321b5d1) SHA1(d1524165e71fe200cab6fd6f6327da0e6efc6868) )
r1649r1650
13381304   ROM_LOAD( "13926-01.u67",  0x18000, 0x4000, CRC(daa30add) SHA1(e9c066406c2d50ab3fc8eea8a97a181ad8c950c7) )
13391305   ROM_LOAD( "13927-01.u89",  0x1c000, 0x4000, CRC(30e60fb5) SHA1(374c84358d2b7ae7c74321996797af9adbc2a155) )
13401306
1341   ROM_REGION( 0x0300, REGION_PLDS, ROMREGION_DISPOSE )
1307   ROM_REGION( 0x0300, REGION_PLDS, 0 )
13421308   ROM_LOAD( "pal16l8-2601.25t", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */
13431309   ROM_LOAD( "pl20x10-0501.u21", 0x0200, 0x00cc, CRC(09ef7a46) SHA1(c37b10d268bf730a68748eee085b9d3757ee45b3) )
13441310ROM_END
r1649r1650
13721338   ROM_LOAD16_BYTE( "15220-02.43t", 0x0e0001, 0x10000, CRC(48a8a018) SHA1(f50d66feeab32f1edc47f4b3f33e579c06fd979e) )
13731339   ROM_LOAD16_BYTE( "15223-02.60t", 0x0e0000, 0x10000, CRC(6a299766) SHA1(4e5b1f930f668302496a314bbe8876a21012fb20) )
13741340
1375   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1341   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
13761342   ROM_LOAD( "15215-01.u93", 0x00000, 0x04000, CRC(4fb678d7) SHA1(ca729ca8d2ba1e22a7b650ddfc330e85e294e48f) )
13771343   ROM_LOAD( "lelqb.94",     0x04000, 0x04000, CRC(7b57a44c) SHA1(b28ecdc8b1579e677a58a4b5257d5d754783148f) )
13781344   ROM_LOAD( "lelqb.95",     0x08000, 0x04000, CRC(29bc33fd) SHA1(e85d20b24144c5b0f6ffa6dc96f1abb35bce437a) )
r1649r1650
14171383   ROM_LOAD16_BYTE( "15220-01.43t", 0x0e0001, 0x10000, CRC(ccb6c8d7) SHA1(bafe1ba6259f396cfa91fc6d2ff7832199763f3e) )
14181384   ROM_LOAD16_BYTE( "15223-01.60t", 0x0e0000, 0x10000, CRC(c0ee425d) SHA1(4edbd62b8bb7f814e7ffa3111e6fb1e8b6615ae8) )
14191385
1420   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1386   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
14211387   ROM_LOAD( "15215-01.u93", 0x00000, 0x04000, CRC(4fb678d7) SHA1(ca729ca8d2ba1e22a7b650ddfc330e85e294e48f) )
14221388   ROM_LOAD( "lelqb.94",     0x04000, 0x04000, CRC(7b57a44c) SHA1(b28ecdc8b1579e677a58a4b5257d5d754783148f) )
14231389   ROM_LOAD( "lelqb.95",     0x08000, 0x04000, CRC(29bc33fd) SHA1(e85d20b24144c5b0f6ffa6dc96f1abb35bce437a) )
r1649r1650
14531419   ROM_LOAD16_BYTE( "15618-02.43t", 0x0e0001, 0x10000, CRC(5562e0c3) SHA1(4c7b0cedc5adc4e24a1cd6010591205ddb16d554) )
14541420   ROM_LOAD16_BYTE( "15621-02.60t", 0x0e0000, 0x10000, CRC(cb468f2b) SHA1(f37596c781b1d7c49d8f62d289c15a2ae0d752cc) )
14551421
1456   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1422   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
14571423   ROM_LOAD( "15609-01.u93", 0x00000, 0x04000, CRC(08ad92e9) SHA1(6eaffd58f03db3a67871ce7390b01754842e2574) )
14581424   ROM_LOAD( "15610-01.u94", 0x04000, 0x04000, CRC(d4e56dfb) SHA1(0fc83847b8629534b15f9366f197c87e3c81c61a) )
14591425   ROM_LOAD( "15611-01.u95", 0x08000, 0x04000, CRC(3a2c46fb) SHA1(e96849447852a9922e72f7f1908c76fea3c603c4) )
r1649r1650
14931459   ROM_LOAD16_BYTE( "15625-01.27t", 0x0e0001, 0x10000, CRC(ac442523) SHA1(d05dcc413eb39b0938890ef80ec7b636773bb1a3) )
14941460   ROM_LOAD16_BYTE( "15622-01.15t", 0x0e0000, 0x10000, CRC(9e84509a) SHA1(4c3a3e5192ba6c38d8391eedf817350795bddb8f) )
14951461
1496   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1462   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
14971463   ROM_LOAD( "15615-01.u93", 0x00000, 0x04000, CRC(a7ea6a87) SHA1(5cfd9ed6a5ffc8e86d18b7d8496761b9086b6368) )
14981464   ROM_LOAD( "15616-01.u94", 0x04000, 0x04000, CRC(4a9b3900) SHA1(00398cc5056c999673604e414c9c0338d83b13d4) )
14991465   ROM_LOAD( "15617-01.u95", 0x08000, 0x04000, CRC(2cd95edb) SHA1(939ff97562535b05f427186b085a74a8fe5a332a) )
r1649r1650
15331499   ROM_LOAD16_BYTE( "15625-01.27t", 0x0e0001, 0x10000, CRC(ac442523) SHA1(d05dcc413eb39b0938890ef80ec7b636773bb1a3) )
15341500   ROM_LOAD16_BYTE( "15622-01.15t", 0x0e0000, 0x10000, CRC(9e84509a) SHA1(4c3a3e5192ba6c38d8391eedf817350795bddb8f) )
15351501
1536   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1502   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
15371503   ROM_LOAD( "15615-01.u93", 0x00000, 0x04000, CRC(a7ea6a87) SHA1(5cfd9ed6a5ffc8e86d18b7d8496761b9086b6368) )
15381504   ROM_LOAD( "15616-01.u94", 0x04000, 0x04000, CRC(4a9b3900) SHA1(00398cc5056c999673604e414c9c0338d83b13d4) )
15391505   ROM_LOAD( "15617-01.u95", 0x08000, 0x04000, CRC(2cd95edb) SHA1(939ff97562535b05f427186b085a74a8fe5a332a) )
r1649r1650
15731539    ROM_LOAD16_BYTE( "24021-01.u27", 0x0e0001, 0x10000, CRC(94081899) SHA1(289eb2f494d1110d169552e8898296e4a47fcb1d) )
15741540    ROM_LOAD16_BYTE( "24018-01.u15", 0x0e0000, 0x10000, CRC(76eb6077) SHA1(255731c63f4a846bb01d4203a786eb34a4734e66) )
15751541
1576   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1542   ROM_REGION( 0x0c000, REGION_GFX1, 0 )
15771543   ROM_LOAD( "03-28008.u93", 0x00000, 0x04000, NO_DUMP )
15781544   ROM_LOAD( "03-28009.u94", 0x04000, 0x04000, CRC(669791ac) SHA1(e8b7bdec313ea9d40f89f13499a31f0b125951a8) )
15791545   ROM_LOAD( "03-28010.u95", 0x08000, 0x04000, CRC(bd62aa8a) SHA1(c8a177a11ec94671bb3bd5883b40692495c049a2) )
r1649r1650
16131579    ROM_LOAD16_BYTE( "24021-01.u27", 0x0e0001, 0x10000, CRC(94081899) SHA1(289eb2f494d1110d169552e8898296e4a47fcb1d) )
16141580    ROM_LOAD16_BYTE( "24018-01.u15", 0x0e0000, 0x10000, CRC(76eb6077) SHA1(255731c63f4a846bb01d4203a786eb34a4734e66) )
16151581
1616   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1582   ROM_REGION( 0x18000, REGION_GFX1, 0 )
16171583   ROM_LOAD( "24011-02.u93", 0x00000, 0x08000, CRC(71f4425b) SHA1(074c79d709bf9e927f538932ef05b13e5e649197) )
16181584   ROM_LOAD( "24012-02.u94", 0x08000, 0x08000, CRC(b2499547) SHA1(cf5979e56cc307133cbdbfdba448cdf3087eaf8c) )
16191585   ROM_LOAD( "24013-02.u95", 0x10000, 0x08000, CRC(0a604e0d) SHA1(08917c3e9fb408b8e128fe2e3617c8c17d964d66) )
r1649r1650
16531619    ROM_LOAD16_BYTE( "24021-01.u27", 0x0e0001, 0x10000, CRC(94081899) SHA1(289eb2f494d1110d169552e8898296e4a47fcb1d) )
16541620    ROM_LOAD16_BYTE( "24018-01.u15", 0x0e0000, 0x10000, CRC(76eb6077) SHA1(255731c63f4a846bb01d4203a786eb34a4734e66) )
16551621
1656   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1622   ROM_REGION( 0x18000, REGION_GFX1, 0 )
16571623   ROM_LOAD( "24011-02.u93", 0x00000, 0x08000, CRC(71f4425b) SHA1(074c79d709bf9e927f538932ef05b13e5e649197) )
16581624   ROM_LOAD( "24012-02.u94", 0x08000, 0x08000, CRC(b2499547) SHA1(cf5979e56cc307133cbdbfdba448cdf3087eaf8c) )
16591625   ROM_LOAD( "24013-02.u95", 0x10000, 0x08000, CRC(0a604e0d) SHA1(08917c3e9fb408b8e128fe2e3617c8c17d964d66) )
r1649r1650
16931659    ROM_LOAD16_BYTE( "24021-01.u27", 0x0e0001, 0x10000, CRC(94081899) SHA1(289eb2f494d1110d169552e8898296e4a47fcb1d) )
16941660    ROM_LOAD16_BYTE( "24018-01.u15", 0x0e0000, 0x10000, CRC(76eb6077) SHA1(255731c63f4a846bb01d4203a786eb34a4734e66) )
16951661
1696   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1662   ROM_REGION( 0x18000, REGION_GFX1, 0 )
16971663   ROM_LOAD( "24011-02.u93", 0x00000, 0x08000, CRC(71f4425b) SHA1(074c79d709bf9e927f538932ef05b13e5e649197) )
16981664   ROM_LOAD( "24012-02.u94", 0x08000, 0x08000, CRC(b2499547) SHA1(cf5979e56cc307133cbdbfdba448cdf3087eaf8c) )
16991665   ROM_LOAD( "24013-02.u95", 0x10000, 0x08000, CRC(0a604e0d) SHA1(08917c3e9fb408b8e128fe2e3617c8c17d964d66) )
r1649r1650
17331699    ROM_LOAD16_BYTE( "22118-03.u27", 0x0e0001, 0x10000, CRC(806ccf8b) SHA1(7335a85fc84d5c2f7537548c3856c9cd2f267609) )
17341700    ROM_LOAD16_BYTE( "22115-03.u15", 0x0e0000, 0x10000, CRC(c8439a7a) SHA1(9a8bb1fca8d3414dcfd4839bc0c4289e4d810943) )
17351701
1736   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1702   ROM_REGION( 0x18000, REGION_GFX1, 0 )
17371703   ROM_LOAD( "22105-01.u93", 0x00000, 0x08000, CRC(4426e367) SHA1(298203112d724feb9a75a7bfc34b3dbb4d7fffe7) )
17381704   ROM_LOAD( "22106-02.u94", 0x08000, 0x08000, CRC(687dc1fc) SHA1(876c72561d942ebc5f3a148d3d3efdceb39c9e2e) )
17391705   ROM_LOAD( "22107-02.u95", 0x10000, 0x08000, CRC(cee6ee5f) SHA1(3f1c6e8d9eb9de207cabca7c9d6d8d633bd69681) )
r1649r1650
17751741   ROM_LOAD16_BYTE( "ortpu27.bin", 0x0e0001, 0x10000, CRC(b80c5f99) SHA1(6b0657db870fb4e14e20cbd955655d0990dd7bda) )
17761742   ROM_LOAD16_BYTE( "ortpu15.bin", 0x0e0000, 0x10000, CRC(2a1a1c3c) SHA1(990328240a2dba7264bb5add5ea8cae2752327d9) )
17771743
1778   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1744   ROM_REGION( 0x18000, REGION_GFX1, 0 )
17791745   ROM_LOAD( "ortpu93b.bin", 0x00000, 0x08000, CRC(f0c1d8b0) SHA1(aa6e53b56474fa97b17b60ef1123a28442482b80) )
17801746   ROM_LOAD( "ortpu94b.bin", 0x08000, 0x08000, CRC(7460d8c0) SHA1(9e3560056da89108c58b320125deeed0e009d0a8) )
17811747   ROM_LOAD( "ortpu95b.bin", 0x10000, 0x08000, CRC(081ee7a8) SHA1(2b884a8ed4173b64f7890edf9a6954c62b5ba012) )
r1649r1650
18161782   ROM_LOAD16_BYTE( "poutu27t.bin", 0x0e0001, 0x10000, CRC(37a8156e) SHA1(a0b44b1ba6701daaa26576c6c892fd97ec82d5e3) )
18171783   ROM_LOAD16_BYTE( "poutu15t.bin", 0x0e0000, 0x10000, CRC(1c60d58b) SHA1(93f83a231d06cd958d3539a528e6ee6c2d9904ed) )
18181784
1819   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1785   ROM_REGION( 0x18000, REGION_GFX1, 0 )
18201786   ROM_LOAD( "poutu93.bin", 0x000000, 0x08000, CRC(f102a04d) SHA1(3ecc0ab34a5d6e760679dc5fd7d32dd439f797d5) )
18211787   ROM_LOAD( "poutu94.bin", 0x008000, 0x08000, CRC(ec63c015) SHA1(10010a17ffda468dbe2940fae6aae49c56e1ad78) )
18221788   ROM_LOAD( "poutu95.bin", 0x010000, 0x08000, CRC(ba6e797e) SHA1(135f905b7663026a99fd9aca8e0247a72bf43cdb) )
r1649r1650
18571823   ROM_LOAD16_BYTE( "poutu27t.bin", 0x0e0001, 0x10000, CRC(37a8156e) SHA1(a0b44b1ba6701daaa26576c6c892fd97ec82d5e3) )
18581824   ROM_LOAD16_BYTE( "poutu15t.bin", 0x0e0000, 0x10000, CRC(1c60d58b) SHA1(93f83a231d06cd958d3539a528e6ee6c2d9904ed) )
18591825
1860   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1826   ROM_REGION( 0x18000, REGION_GFX1, 0 )
18611827   ROM_LOAD( "poutu93.bin", 0x000000, 0x08000, CRC(f102a04d) SHA1(3ecc0ab34a5d6e760679dc5fd7d32dd439f797d5) )
18621828   ROM_LOAD( "poutu94.bin", 0x008000, 0x08000, CRC(ec63c015) SHA1(10010a17ffda468dbe2940fae6aae49c56e1ad78) )
18631829   ROM_LOAD( "poutu95.bin", 0x010000, 0x08000, CRC(ba6e797e) SHA1(135f905b7663026a99fd9aca8e0247a72bf43cdb) )
r1649r1650
25472513 *************************************/
25482514
25492515/* small master banks, small slave banks */
2550GAME( 1985, cerberus, 0,       leland,  cerberus, cerberus, ROT0,   "Cinematronics", "Cerberus", 0 )
2551GAME( 1985, mayhem,   0,       leland,  mayhem,   mayhem,   ROT0,   "Cinematronics", "Mayhem 2002", 0 )
2552GAME( 1985, powrplay, 0,       leland,  mayhem,   powrplay, ROT0,   "Cinematronics", "Power Play", 0 )
2553GAME( 1985, wseries,  0,       leland,  wseries,  wseries,  ROT0,   "Cinematronics", "World Series: The Season", 0 )
2554GAME( 1986, alleymas, 0,       leland,  alleymas, alleymas, ROT270, "Cinematronics", "Alley Master", 0 )
2555GAME( 1987, upyoural, 0,       leland,  upyoural, upyoural, ROT270, "Cinematronics", "Up Your Alley", 0 )
2516GAME( 1985, cerberus, 0,       leland,   cerberus, cerberus, ROT0,   "Cinematronics", "Cerberus", 0 )
2517GAME( 1985, mayhem,   0,       leland,   mayhem,   mayhem,   ROT0,   "Cinematronics", "Mayhem 2002", 0 )
2518GAME( 1985, powrplay, 0,       leland,   mayhem,   powrplay, ROT0,   "Cinematronics", "Power Play", 0 )
2519GAME( 1985, wseries,  0,       leland,   wseries,  wseries,  ROT0,   "Cinematronics", "World Series: The Season", 0 )
2520GAME( 1986, alleymas, 0,       leland,   alleymas, alleymas, ROT270, "Cinematronics", "Alley Master", 0 )
2521GAME( 1987, upyoural, 0,       leland,   upyoural, upyoural, ROT270, "Cinematronics", "Up Your Alley", 0 )
25562522
25572523/* odd master banks, small slave banks */
2558GAME( 1986, dangerz,  0,       leland,  dangerz,  dangerz,  ROT0,   "Cinematronics", "Danger Zone", 0 )
2524GAME( 1986, dangerz,  0,       leland,  dangerz,  dangerz,  ROT0,   "Cinematronics", "Danger Zone", 0 )
25592525
25602526/* small master banks + extra top board, small slave banks */
2561GAME( 1987, basebal2, 0,       leland,  basebal2, basebal2, ROT0,   "Cinematronics", "Baseball The Season II", 0 )
2562GAME( 1987, dblplay,  0,       leland,  basebal2, dblplay,  ROT0,   "Leland Corp. / Tradewest", "Super Baseball Double Play Home Run Derby", 0 )
2563GAME( 1988, strkzone, 0,       leland,  basebal2, strkzone, ROT0,   "Leland Corp.", "Strike Zone Baseball", 0 )
2527GAME( 1987, basebal2, 0,       leland,   basebal2, basebal2, ROT0,   "Cinematronics", "Baseball: The Season II", 0 )
2528GAME( 1987, dblplay,  0,       leland,   basebal2, dblplay,  ROT0,   "Leland Corp. / Tradewest", "Super Baseball Double Play Home Run Derby", 0 )
2529GAME( 1988, strkzone, 0,       leland,   basebal2, strkzone, ROT0,   "Leland Corp.", "Strike Zone Baseball", 0 )
25642530
25652531/* large master banks, small slave banks, 80186 sound */
2566GAME( 1987, redlin2p, 0,       redline, redline,  redlin2p, ROT270, "Cinematronics (Tradewest license)", "Redline Racer (2 players)", 0 )
2567GAME( 1987, quarterb, 0,       quarterb,quarterb, quarterb, ROT270, "Leland Corp.", "Quarterback", 0 )
2568GAME( 1987, quartrba, quarterb,quarterb,quarterb, quarterb, ROT270, "Leland Corp.", "Quarterback (set 2)", 0 )
2532GAME( 1987, redlin2p, 0,       redline,  redline,  redlin2p, ROT270, "Cinematronics (Tradewest license)", "Redline Racer (2 players)", 0 )
2533GAME( 1987, quarterb, 0,       quarterb, quarterb, quarterb, ROT270, "Leland Corp.", "Quarterback (set 1)", 0 )
2534GAME( 1987, quartrba, quarterb,quarterb, quarterb, quarterb, ROT270, "Leland Corp.", "Quarterback (set 2)", 0 )
25692535
25702536/* large master banks, large slave banks, 80186 sound */
2571GAME( 1988, viper,    0,       lelandi, dangerz,  viper,    ROT0,   "Leland Corp.", "Viper", 0 )
2572GAME( 1988, teamqb,   0,       lelandi, teamqb,   teamqb,   ROT270, "Leland Corp.", "John Elway's Team Quarterback", 0 )
2573GAME( 1988, teamqb2,  teamqb,  lelandi, teamqb,   teamqb,   ROT270, "Leland Corp.", "John Elway's Team Quarterback (set 2)", 0 )
2574GAME( 1989, aafb,     0,       lelandi, teamqb,   aafb,     ROT270, "Leland Corp.", "All American Football (rev E)", 0 )
2575GAME( 1989, aafbd2p,  aafb,    lelandi, aafb2p,   aafbd2p,  ROT270, "Leland Corp.", "All American Football (rev D, 2 Players)", 0 )
2576GAME( 1989, aafbc,    aafb,    lelandi, teamqb,   aafbb,    ROT270, "Leland Corp.", "All American Football (rev C)", 0 )
2577GAME( 1989, aafbb,    aafb,    lelandi, teamqb,   aafbb,    ROT270, "Leland Corp.", "All American Football (rev B)", 0 )
2537GAME( 1988, viper,    0,       lelandi,  dangerz,  viper,    ROT0,   "Leland Corp.", "Viper", 0 )
2538GAME( 1988, teamqb,   0,       lelandi,  teamqb,   teamqb,   ROT270, "Leland Corp.", "John Elway's Team Quarterback (set 1)", 0 )
2539GAME( 1988, teamqb2,  teamqb,  lelandi,  teamqb,   teamqb,   ROT270, "Leland Corp.", "John Elway's Team Quarterback (set 2)", 0 )
2540GAME( 1989, aafb,     0,       lelandi,  teamqb,   aafb,     ROT270, "Leland Corp.", "All American Football (rev E)", 0 )
2541GAME( 1989, aafbd2p,  aafb,    lelandi,  aafb2p,   aafbd2p,  ROT270, "Leland Corp.", "All American Football (rev D, 2 Players)", 0 )
2542GAME( 1989, aafbc,    aafb,    lelandi,  teamqb,   aafbb,    ROT270, "Leland Corp.", "All American Football (rev C)", 0 )
2543GAME( 1989, aafbb,    aafb,    lelandi,  teamqb,   aafbb,    ROT270, "Leland Corp.", "All American Football (rev B)", 0 )
25782544
25792545/* huge master banks, large slave banks, 80186 sound */
2580GAME( 1989, offroad,  0,       lelandi, offroad,  offroad,  ROT0,   "Leland Corp.", "Ironman Stewart's Super Off-Road", 0 )
2581GAME( 1989, offroadt, 0,       lelandi, offroad,  offroadt, ROT0,   "Leland Corp.", "Ironman Stewart's Super Off-Road Track Pack", 0 )
2582GAME( 1990, pigout,   0,       lelandi, pigout,   pigout,   ROT0,   "Leland Corp.", "Pigout", 0 )
2583GAME( 1990, pigouta,  pigout,  lelandi, pigout,   pigout,   ROT0,   "Leland Corp.", "Pigout (alternate)", 0 )
2546GAME( 1989, offroad,  0,       lelandi,  offroad,  offroad,  ROT0,   "Leland Corp.", "Ironman Ivan Stewart's Super Off-Road", 0 )
2547GAME( 1989, offroadt, 0,       lelandi,  offroad,  offroadt, ROT0,   "Leland Corp.", "Ironman Ivan Stewart's Super Off-Road Track-Pak", 0 )
2548GAME( 1990, pigout,   0,       lelandi,  pigout,   pigout,   ROT0,   "Leland Corp.", "Pig Out: Dine Like a Swine! (set 1)", 0 )
2549GAME( 1990, pigouta,  pigout,  lelandi,  pigout,   pigout,   ROT0,   "Leland Corp.", "Pig Out: Dine Like a Swine! (set 2)", 0 )
src/mame/drivers/gstream.c
r1649r1650
9595*********************************************************************/
9696
9797#include "driver.h"
98#include "deprecat.h"
9899#include "sound/okim6295.h"
99100
100101static UINT32 *gstream_vram;
src/mame/drivers/compgolf.c
r1649r1650
1111****************************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "sound/2203intf.h"
1516
1617extern UINT8 *compgolf_bg_ram;
src/mame/drivers/cps2.c
r1649r1650
545545***************************************************************************/
546546
547547#include "driver.h"
548#include "deprecat.h"
548549#include "machine/eeprom.h"
549550#include "cpu/m68000/m68000.h"
550551#include "sound/qsound.h"
551#include "ui.h"
552552#include "chd.h"
553553
554554#include "cps1.h"       /* External CPS1 definitions */
r1649r1650
13321332static MACHINE_DRIVER_START( cps2 )
13331333
13341334   /* basic machine hardware */
1335   MDRV_CPU_ADD(M68000, 11800000)
1335   MDRV_CPU_ADD(M68000, 16000000)
13361336   MDRV_CPU_CONFIG(cps2_encryption)
13371337   MDRV_CPU_PROGRAM_MAP(cps2_readmem,cps2_writemem)
13381338   MDRV_CPU_VBLANK_INT(cps2_interrupt,262)   // 262  /* ??? interrupts per frame */
r1649r1650
71917191   /* Decrypt the game - see machine/cps2crpt.c */
71927192   DRIVER_INIT_CALL(cps2crpt);
71937193   cps2networkpresent = 0;
7194
7195   cpunum_set_clockscale(machine, 0, 0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
71947196}
71957197
71967198static DRIVER_INIT( ssf2tb )
src/mame/drivers/lordgun.c
r1649r1650
2626***************************************************************************/
2727
2828#include "driver.h"
29#include "deprecat.h"
2930#include "machine/8255ppi.h"
3031#include "machine/eeprom.h"
3132#include "sound/3812intf.h"
src/mame/drivers/lemmings.c
r1649r1650
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "lemmings.h"
2021#include "sound/2151intf.h"
2122#include "sound/okim6295.h"
src/mame/drivers/pushman.c
r1649r1650
2222***************************************************************************/
2323
2424#include "driver.h"
25#include "deprecat.h"
2526#include "cpu/z80/z80.h"
2627#include "cpu/m6805/m6805.h"
2728#include "sound/2203intf.h"
src/mame/drivers/zerozone.c
r1649r1650
2727
2828***************************************************************************/
2929#include "driver.h"
30#include "deprecat.h"
3031#include "sound/okim6295.h"
3132
3233VIDEO_START( zerozone );
src/mame/drivers/espial.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "espial.h"
1213#include "cpu/z80/z80.h"
1314#include "sound/ay8910.h"
src/mame/drivers/toaplan1.c
r1649r1650
5959***************************************************************************/
6060
6161#include "driver.h"
62#include "deprecat.h"
6263#include "cpu/tms32010/tms32010.h"
6364#include "toaplan1.h"
6465#include "sound/3812intf.h"
src/mame/drivers/segag80r.c
r1649r1650
104104***************************************************************************/
105105
106106#include "driver.h"
107#include "deprecat.h"
107108#include "cpu/z80/z80.h"
108109#include "machine/8255ppi.h"
109110#include "machine/segacrpt.h"
r1649r1650
410411   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )               /* P1.21 */
411412
412413   PORT_START_TAG("D3D2")
413   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:8")
414   PORT_DIPSETTING(   0x01, DEF_STR( Off ))
415   PORT_DIPSETTING(   0x00, DEF_STR( On ))
416   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:7")
417   PORT_DIPSETTING(   0x02, DEF_STR( Off ))
418   PORT_DIPSETTING(   0x00, DEF_STR( On ))
419   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:6")
420   PORT_DIPSETTING(   0x04, DEF_STR( Off ))
421   PORT_DIPSETTING(   0x00, DEF_STR( On ))
422   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:5")
423   PORT_DIPSETTING(   0x08, DEF_STR( Off ))
424   PORT_DIPSETTING(   0x00, DEF_STR( On ))
425   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:4")
426   PORT_DIPSETTING(   0x10, DEF_STR( Off ))
427   PORT_DIPSETTING(   0x00, DEF_STR( On ))
428   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:3")
429   PORT_DIPSETTING(   0x20, DEF_STR( Off ))
430   PORT_DIPSETTING(   0x00, DEF_STR( On ))
431   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:2")
432   PORT_DIPSETTING(   0x40, DEF_STR( Off ))
433   PORT_DIPSETTING(   0x00, DEF_STR( On ))
434   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:1")
435   PORT_DIPSETTING(   0x80, DEF_STR( Off ))
436   PORT_DIPSETTING(   0x00, DEF_STR( On ))
414   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:8" ) /* Listed as "Unused" (astrob) */
415   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:7" ) /* Listed as "Unused" (astrob) */
416   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:6" ) /* Listed as "Unused" (astrob) */
417   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:5" ) /* Listed as "Unused" (astrob) */
418   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:4" ) /* Listed as "Unused" (astrob) */
419   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:3" ) /* Listed as "Unused" (astrob) */
420   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:2" ) /* Listed as "Unused" (astrob) */
421   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:1" ) /* Listed as "Unused" (astrob) */
437422
438423   PORT_START_TAG("D1D0")
439424   PORT_DIPNAME( 0x0f, 0x03, DEF_STR( Coin_A )) PORT_DIPLOCATION("SW2:8,7,6,5")
r1649r1650
511496   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet )) PORT_DIPLOCATION("SW1:6")
512497   PORT_DIPSETTING(    0x04, DEF_STR( Upright ))
513498   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ))
514   PORT_DIPNAME( 0x08, 0x00, "Demo Speech" ) PORT_DIPLOCATION("SW1:5")
499   PORT_DIPNAME( 0x08, 0x00, "Demo Speech" ) PORT_DIPLOCATION("SW1:5") /* Listed as "Unused" */
515500   PORT_DIPSETTING(    0x08, DEF_STR( Off ))
516501   PORT_DIPSETTING(    0x00, DEF_STR( On ))
517502
r1649r1650
535520INPUT_PORTS_END
536521
537522
538static INPUT_PORTS_START( astrob1 )
539   PORT_INCLUDE(astrob)
540
541   PORT_MODIFY("D3D2")
542   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:5")
543   PORT_DIPSETTING(    0x08, DEF_STR( Off ))
544   PORT_DIPSETTING(    0x00, DEF_STR( On ))
545INPUT_PORTS_END
546
547
548523static INPUT_PORTS_START( 005 )
549524   PORT_INCLUDE(g80r_generic)
550525
r1649r1650
566541   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet )) PORT_DIPLOCATION("SW1:6")
567542   PORT_DIPSETTING(    0x04, DEF_STR( Upright ))
568543   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ))
569   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:5" )
570   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:4" )
571   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:3" )
572   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:2" )
573   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:1" )
574544
575545   PORT_MODIFY("FC")
576546   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
r1649r1650
15831553GAME( 1981, astrob,   0,       astrob,   astrob,   astrob,   ROT270, "Sega", "Astro Blaster (version 3)", 0 )
15841554GAME( 1981, astrob2,  astrob,  astrob,   astrob2,  astrob,   ROT270, "Sega", "Astro Blaster (version 2)", 0 )
15851555GAME( 1981, astrob2a, astrob,  astrob,   astrob2,  astrob,   ROT270, "Sega", "Astro Blaster (version 2a)", 0 )
1586GAME( 1981, astrob1,  astrob,  astrob,   astrob1,  astrob,   ROT270, "Sega", "Astro Blaster (version 1)", GAME_NOT_WORKING )
1556GAME( 1981, astrob1,  astrob,  astrob,   astrob,   astrob,   ROT270, "Sega", "Astro Blaster (version 1)", GAME_NOT_WORKING )
15871557GAME( 1981, 005,      0,       005,      005,      005,      ROT270, "Sega", "005", GAME_IMPERFECT_SOUND )
15881558
15891559/* basic G-80 system with individual background boards */
src/mame/drivers/magic10.c
r1649r1650
1818*/
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "sound/okim6295.h"
2223
2324static tilemap *layer0_tilemap, *layer1_tilemap, *layer2_tilemap;
src/mame/drivers/shanghai.c
r1649r1650
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "audio/seibu.h"
2425
2526/* the on-chip FIFO is 16 bytes long, but we use a larger one to simplify */
src/mame/drivers/tmnt.c
r1649r1650
6464
6565***************************************************************************/
6666
67#include <math.h>
6867#include "driver.h"
68#include "deprecat.h"
6969#include "video/konamiic.h"
7070#include "machine/eeprom.h"
7171#include "cpu/m68000/m68000.h"
src/mame/drivers/jpmimpct.c
r1649r1650
7878****************************************************************************/
7979
8080#include "driver.h"
81#include "deprecat.h"
8182#include "cpu/tms34010/tms34010.h"
8283#include "cpu/tms34010/34010ops.h"
8384#include "sound/upd7759.h"
src/mame/drivers/namcos12.c
r1649r1650
921921      Point Blank 2 (GNB5/VER.A)
922922*/
923923
924#include <stdarg.h>
925924#include "driver.h"
925#include "deprecat.h"
926926#include "cpu/mips/psx.h"
927927#include "cpu/h83002/h83002.h"
928928#include "includes/psx.h"
src/mame/drivers/scramble.c
r1649r1650
33733373GAME( 1983, newsin7,  0,        newsin7,  newsin7,  mars,         ROT90, "ATW USA, Inc.", "New Sinbad 7", GAME_SUPPORTS_SAVE )
33743374GAME( 1984, mrkougar, 0,        mrkougar, mrkougar, mrkougar,     ROT90, "ATW", "Mr. Kougar", GAME_SUPPORTS_SAVE )
33753375GAME( 1983, mrkougr2, mrkougar, mrkougar, mrkougar, mrkougar,     ROT90, "ATW", "Mr. Kougar (earlier)", GAME_SUPPORTS_SAVE )
3376GAME( 1983, mrkougb,  mrkougar, mrkougb,  mrkougar, mrkougb,      ROT90, "bootleg", "Mr. Kougar (bootleg)", GAME_SUPPORTS_SAVE )
3377GAME( 1983, mrkougb2, mrkougar, mrkougb,  mrkougar, mrkougb,      ROT90, "bootleg", "Mr. Kougar (bootleg Set 2)", GAME_SUPPORTS_SAVE )
3376GAME( 1983, mrkougb,  mrkougar, mrkougb,  mrkougar, mrkougb,      ROT90, "bootleg", "Mr. Kougar (bootleg set 1)", GAME_SUPPORTS_SAVE )
3377GAME( 1983, mrkougb2, mrkougar, mrkougb,  mrkougar, mrkougb,      ROT90, "bootleg", "Mr. Kougar (bootleg set 2)", GAME_SUPPORTS_SAVE )
33783378GAME( 1982, hotshock, 0,        hotshock, hotshock, hotshock,     ROT90, "E.G. Felaco", "Hot Shocker", GAME_SUPPORTS_SAVE )
33793379GAME( 1982, conquer,  0,        hotshock, hotshock, 0,            ROT90, "<unknown>", "Conquer", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE)
33803380GAME( 1983, hunchbks, hunchbak, hunchbks, hunchbks, scramble_ppi, ROT90, "Century Electronics", "Hunchback (Scramble hardware)", GAME_SUPPORTS_SAVE )
src/mame/drivers/mogura.c
r1649r1650
11/* Mogura Desse */
22
33#include "driver.h"
4#include "deprecat.h"
45#include "sound/dac.h"
56
67static UINT8 *mogura_tileram;
src/mame/drivers/system18.c
r1649r1650
6262*/
6363
6464#include "driver.h"
65#include "deprecat.h"
6566#include "cpu/z80/z80.h"
6667#include "system16.h"
6768#include "cpu/m68000/m68000.h"
src/mame/drivers/taitojc.c
r1649r1650
350350*/
351351
352352#include "driver.h"
353#include "deprecat.h"
353354#include "taito_f3.h"
354355#include "cpu/mc68hc11/mc68hc11.h"
355356#include "sound/es5506.h"
src/mame/drivers/missb2.c
r1649r1650
1414*/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "sound/okim6295.h"
1819#include "sound/3812intf.h"
1920
src/mame/drivers/ddealer.c
r1649r1650
103103
104104
105105#include "driver.h"
106#include "deprecat.h"
106107
107108static UINT16 *shared_ram;
108109
src/mame/drivers/tehkanwc.c
r1649r1650
9595***************************************************************************/
9696
9797#include "driver.h"
98#include "deprecat.h"
9899#include "cpu/z80/z80.h"
99100#include "sound/ay8910.h"
100101#include "sound/msm5205.h"
src/mame/drivers/bionicc.c
r1649r1650
5454********************************************************************/
5555
5656#include "driver.h"
57#include "deprecat.h"
5758#include "sound/2151intf.h"
5859
5960
src/mame/drivers/suprridr.c
r1649r1650
8080***************************************************************************/
8181
8282#include "driver.h"
83#include "deprecat.h"
8384#include "suprridr.h"
8485#include "sound/ay8910.h"
8586
src/mame/drivers/spy.c
r1649r1650
1818***************************************************************************/
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "cpu/m6809/m6809.h"
2223#include "video/konamiic.h"
2324#include "sound/3812intf.h"
src/mame/drivers/psikyo.c
r1649r1650
6161*****/
6262
6363#include "driver.h"
64#include "deprecat.h"
6465#include "sound/2610intf.h"
6566#include "sound/ymf278b.h"
6667
src/mame/drivers/ampoker2.c
r0r1650
1/********************************************************************************
2
3
4    AMERICAN POKER 2
5    ----------------
6
7    Company:    Novomatic.
8    Year:       1990.
9
10    Original preliminary driver:   Curt Coder.
11    Rewrite and additional work:   Roberto Fresca, with a lot of help of Grull Osgo.
12
13
14    --- Supported Sets ---
15
16    Old name | New name | Relation | Description
17    --------------------------------------------
18    ampokr2b   ampoker2   parent     American Poker II.
19      ----     ampkr2b1   clone      American Poker II (bootleg, set 1).
20    ampokr2a   ampkr2b2   clone      American Poker II (bootleg, set 2).
21    ampoker2   ampkr2b3   clone      American Poker II (bootleg, set 3).
22    ampokr2c   pkrdewin   clone      Poker De Win.
23      ----     ampkr95    clone      American Poker 95.
24      ----     sigmapkr   parent     Sigma Poker.
25      ----     sigma2k    parent     Sigma Poker 2000.
26
27
28*********************************************************************************
29
30
31    Game Notes...
32    -------------
33
34    American Poker II uses a standard deck of 52 cards plus 1 Joker card.
35    The Joker card substitutes for any card. The player places a bet for
36    the 1st hand deal and can then choose to buy a 2nd draw.
37
38    The win combination Jacks or Better is only paid if a 2nd draw is bought.
39
40
41    Operation...
42
43    To 'init' (boot) the machine:
44    1) Turn ON the Operator Key (9).
45    2) Keep pressed the DOOR key (W). You are entering the Operator Mode.
46    3) Turn OFF the Operator Key (9).
47    4) Reset the machine. (you must reset manually the machine due to watchdog issues).
48
49    The set ampkr2b3 has a special init code/key:
50
51    1) Turn ON the Supervisor Key (0).
52    2) Enter the following sequence: HOLD1, HOLD5, HOLD4, HOLD3, HOLD2 and HOLD3.
53    3) Wait till the Supervisor Mode appear, and turn OFF the Supervisor Key (0).
54    4) Reset the machine. (you must reset manually the machine due to watchdog issues).
55
56    ...The key is produced taking 6 bytes at offset 0x5d40 XORed with their respective pairs
57    at offset 0x5d50, resulting the sequence of HOLD keys to init the machine.
58
59
60    Operator Mode:
61    Press '9' once to turn ON the Operator Key. You can find the interim meters (Page 1).
62    Press HOLD3 to clear the meters. Press '9' again to turn OFF the Operator Key.
63    Reset the machine to enter the Game Mode.
64
65    Supervisor Mode:
66    Press '0' once to turn ON the Supervisor Key. You can find the permanent meters (Page 1 to 5).
67    HOLD1, HOLD3 and HOLD5 are the valid keys to navigate through the mode. Press '0' again to turn
68    OFF the Operator Key.
69    Reset the machine to enter the Game Mode.
70
71    To access both modes, no credits should be placed in the machine.
72
73
74    From Novomatic web site:
75
76    "1990 - American Poker II kommt auf den Markt und wird als
77    'The Legend' in die Geschichte des Gl?cksspiels eingehen."
78
79    "1990 - American Poker II comes on the market and is known as
80    'The Legend' in the history of gaming."
81
82
83    ----
84
85
86    Sigma Poker:
87
88    This poker game was also sold as "upgrade kit" for American Poker II taiwanese boards.
89    The game has a lot of improvements. New graphics, sounds, bonus, and a totally new
90    'double-up' feature. Very addictive, in fact.
91
92    Sigma only released 2 games for this hardware: Sigma Poker and Sigma Poker 2000.
93    Both games need some modifications to the original board to be installed.
94    The rest of Sigma poker games (2001 onwards) were developed for B-52 mainboards.
95    (2x 6809; HD63484 video controller).
96
97    Sigma 2000 has better graphics and use 4 times more tiles than other games running
98    on this hardware. To manage this, the game use 2 extra bits from the color RAM.
99
100
101
102*********************************************************************************
103
104
105    --- Technical Notes (in progress) ---
106
107
108
109    DIP Switches
110    ------------
111
112    DIP1       Remote Credits
113    OFF        x100
114    ON         x50
115
116    DIP2       Auto Hold
117    OFF        Off
118    ON         On
119
120    DIP3 DIP4  Rate Tables (*)
121    OFF  OFF   RATE: 1 2 3 4 5 10 20 30 40 50
122    OFF  ON    RATE: 5 10 15 20 25 30 35 40 50 100
123    ON   OFF   RATE: 5 10 15 20 25 30 35 40 45 50
124    ON   ON    RATE: 10 20 30 40 50 60 70 80 90 100
125
126    DIP6       Take Winnings (On Double Up)
127    OFF        Take Part (10 Credits steps)
128    ON         Take All
129
130    DIP8       Jackpot
131    OFF        Off
132    ON         On
133
134
135    (*) Working only in ampkr95.
136
137
138
139    Hardware Notes:
140    --------------
141
142
143    - CPU:            1x Z80@4MHZ or compatible.
144    - Video:          TTL Logic Raster - 6 Mhz Dot Clock
145    - Osc:            6.000 Mhz Xtal.
146    - RAM:            1x 6116 (4Kx8) Static RAM.
147    - VRAM            2x 2016 (4Kx8) Static RAM.
148    - I/O:            8x 74251 ; 8x 74259 (Multiplex 8 Ports > 1 Bit).
149    - PRG ROMs:       1x 27c512 (64Kx8) EPROM or similar.
150    - GFX ROMs:       1x 27c128 (16Kx8) EPROM or similar.
151    - Color PROM:     1x 82S147AN.
152    - Sound:          1x AY-3-8910.
153    - Backup Battery: 1x 3.6 Volt Ni-CD.
154    - DIP Switches:   1x 8 Positions.
155    - Watchdog:       1x TL7705 (Texas Instruments) Refresh: 200 Ms.
156
157
158    Taiwanese PCB Layout:
159     ________________________________________________________________________________
160    |                                                                                |
161    |  ______   _________    _________    ______________    _________   __________   |
162    | | XTAL | | 74LS04  |  | 74LS138 |  |              |  | 74LS163 | |PALCE16V8H|  |
163    | | 6MHz | |_________|  |_________|  |  UM6116-2    |  |_________| |__________|  |
164    | |______|  _________    _________   |______________|   _________   ________  __ |
165    |          | 74LS74A |  | DM7407N |  _______________   | 74LS163 | | 74LS00 ||74||
166    |          |_________|  |_________| |               |  |_________| |________||LS||
167    |  ___________________   _________  |    27C512     |   _________   ________ |08||
168    | |                   | | MC14020 | |_______________|  | 74LS163 | | 74LS157||__||
169    | |BATTERY NI-CD 3.6V | |_________|                    |_________| |________|    |
170    | |___________________|  ___________   _____________    _________   ________     |
171    |____                   | 74LS244   | |   74LS245   |  | 74LS163 | | 74LS157|    |
172         |                  |___________| |_____________|  |_________| |________|    |
173     ____|                                                                           |
174    |_28_                         ______________________    _________   ________     |
175    |____                        |       - Z80A -       |  | 74LS74  | | 74LS157|    |
176    |____                        |     TMPZ84C00AP-6    |  |_________| |________|    |
177    |____                        |______________________|   __________  __________   |
178    |____                     ___________    ____________  |PALCE16V8H||D4016CX-20|  |
179    |____                    | 74LS244N  |  |  74LS259N  | |__________||__________|  |
180    |____                    |___________|  |____________|  ________    __________   |
181    |____                     ___________     __________   | 74LS02 |  |D4016CX-20|  |
182    |____                    | TD62003AP |   | 74LS251P |  |________|  |__________|  |
183    |____                    |___________|   |__________|   __________________       |
184    |____                     ___________     __________   | AY-3-8910        |      |
185    |____                    | 74LS259N  |   | 74LS251P |  | KC89C72 / YM2149F|      |
186    |____                    |___________|   |__________|  |__________________|      |
187    |____                     ___________     __________    _________   __________   |
188    |____                    | 74LS259N  |   | 74LS251P |  | 82S147AN| | 74LS245  |  |
189    |____                    |___________|   |__________|  |_________| |__________|  |
190    |____                     ___________     __________    _________                |
191    |____                    | 74LS259N  |   | 74LS251P |  | 74LS377 |               |
192    |____                    |___________|   |__________|  |_________|               |
193    |____                     ___________     __________    _________                |
194    |____        ________    | TD62003AP |   | 74LS251P |  | 74LS377 |               |
195    |____       |12345678|   |___________|   |__________|  |_________|               |
196    |____       |________|                    __________    _________   _________    |
197    |____          DSW1                      | 74LS194  |  | 74LS194 | | 74LS245 |   |
198    |____                                    |__________|  |_________| |_________|   |
199    |____                                                                            |
200    |____         ______        ________________         _____________   _________   |
201    |_01_        |TL7705|      |01 oooooooooo 10|       |   27C128    | | 74LS377 |  |
202         |       |______|      |________________|       |   D27128D   | |_________|  |
203     ____|                         CONNECTOR1           |_____________|              |
204    |                                                                                |
205    |________________________________________________________________________________|
206
207
208
209
210*********************************************************************************
211
212
213    Dumper Notes (old)
214    ------------------
215
216    American Poker
217    WB 5300 IS SAME AS Winbond WF19054 and YM2149F (AY891X?)
218    CPU TMPZ84C00AP OR LH0080A
219    XTAL 6.000
220    1 DIP x 8
221    RAM 6116
222    LH 5116D X2
223
224    ---------------------------------------------
225
226    Crystal 6.000 MHz
227    CPU         Sharp LH0080B Z80B-CPU 9241 1 B
228    Sound       OKI M5255 9203
229    RAM         2x TMM2015AP-15 (2048x8)
230    PAL         PAL?????16VE??? 022J????  P.M.REG
231    PROM        Philips N82S147AN PTH6708 9518nl
232    EPROM       Intel D27128-4 T8180760S
233                AMD AM27C512-205DC 916LADL
234    Chip?       Sanyo ?????
235
236    7 unmarked chips
237
238*********************************************************************************
239
240
241    --- DRIVER UPDATES ---
242
243
244    [2007-11-15]
245
246    ******** REWRITE ********
247
248    - Crystal documented via #define.
249    - CPU and sound clocks derived from #defined crystal value.
250    - Reworked TILE_GET_INFO to handle the proper tiles/color codes.
251    - Added the correct GFX dump to sigma2k.
252    - Added proper TILE_GET_INFO, VIDEO_START, GFX_LAYOUT, GFXDECODE and MACHINE to sigma2k.
253    - Fixed interrupts (NMI).
254    - Corrected AY8910 frequency to 1.5 MHz to match the real thing.
255    - Arranged the AY8910 volume in all games avoiding clips.
256    - Corrected the screen visible area.
257    - Added NVRAM support.
258    - Reworked the memory map, mapping all the hardware I/O ports.
259    - Reworked the Inputs for all sets.
260    - Added implementation of Operator and Supervisor Keys.
261    - Fixed some timing troubles.
262    - Mapped the input buttons in the same way I mapped them in other poker games.
263    - Added partial DIP switch support with diplocations to all sets.
264
265    - Removed the hack in DRIVER_INIT.
266    - Hooked write handlers for output ports.
267    - Added watchdog routines.
268    - Dumped, hooked, wired and decoded the color PROM in all sets. Colors are perfect.
269    - Modified the refresh rate to 60 fps according to hardware measurements.
270    - Cleaned up and renamed all sets, defining parent-clone relationship.
271    - Wired the lamps for all sets. Created their respective layouts.
272    - Updated flags in game drivers.
273    - Splitted the driver to driver/video.
274    - Other minor fixes.
275
276    - New set dumped/added: American Poker 95.
277    - New set dumped/added: American Poker 2 (bootleg, set 1).
278    - New set dumped/added: Sigma Poker.
279    - New set dumped/added: Sigma Poker 2000.
280
281    - Rewritten the technical notes from the scratch (still in progress).
282    - Added a PCB layout to the technical notes.
283
284
285
286    *** TO DO ***
287
288    - Find why the watchdog sometimes stop to work.
289    - Analyze the write to port 0x21 after reset.
290
291
292
293*********************************************************************************/
294
295
296#define MASTER_CLOCK   6000000    /* 6 Mhz */
297
298#include "driver.h"
299#include "sound/ay8910.h"
300#include "ampoker2.lh"
301#include "sigmapkr.lh"
302
303/* from video */
304extern WRITE8_HANDLER( ampoker2_videoram_w );
305extern PALETTE_INIT( ampoker2 );
306extern VIDEO_START( ampoker2 );
307extern VIDEO_START( sigma2k );
308extern VIDEO_UPDATE( ampoker2 );
309
310
311/**********************
312* Read/Write Handlers *
313*  - Output Ports -   *
314***********************
315
316
317  There are only five bits wired for each Port
318
319  PORT   ADDRESS    BIT0      BIT1      BIT2      BIT3      BIT4
320  -------------------------------------------------------------------
321
322  0x30 - 0xc000     ----      ----      ----      ----      ----
323  0x31 - 0xc001     ----    L.Bet/Red  L.Hold4   L.Hold2   Twr.Yell
324  0x32 - 0xc002     ----      ----      ----     L.Hold3    ----
325  0x33 - 0xc003     ----      ----      ----      ----      ----
326  0x34 - 0xc004     ----      ----      ----      ----     L.Black
327  0x35 - 0xc005     ----      ----      ----      ----      ----
328  0x36 - 0xc006   Twr.Grn.   L.Hold5   L.Deal    L.Hold1    ----
329  0x37 - 0xc007     ----      ----      ----     WatchDog   ----
330
331
332  --- Lamps wiring (done) ---
333
334    L0 = DEAL / TAKE
335    L1 = RED / BET
336    L2 = BLACK
337    L3 = HOLD 1
338    L4 = HOLD 2
339    L5 = HOLD 3
340    L6 = HOLD 4
341    L7 = HOLD 5
342    L8 = TOWER YELLOW (not in lay)
343    L9 = TOWER GREEN  (not in lay)
344
345
346  --- Counters wiring ---
347
348    C0 = METER 1 - REMOTE IN
349    C1 = METER 2 - TOTAL OUT
350    C2 = METER 3 - TOTAL IN
351    C3 = METER 4 - BILLS
352    C4 = METER 5 - JACKPOT
353    C5 = METER 6 - CASH BOX
354    C6 = METER 7 - GAMES
355    C7 = METER 8 - ?
356
357
358  --- Devices wiring ---
359
360    D0 = Enable Coin to Hopper / Diverter
361    D1 = Enable Coin 1 / Acceptor
362    D2 = Enable Coin 2
363    D3 = Enable Coin 3
364    D4 = Enable Coin 4 / Bill Reader
365    D5 = Hopper 1 Enable
366    D6 = Hopper 2 Enable (Optional)
367    D7 = Hopper 1 2 Enable
368
369
370  --- Unused wiring ---
371
372    U0 = Pin 15A (ULN2064)
373    U1 = Pin 17C (ULN2064)
374    U2 = Pin 19A (ULN2064)
375    U3 = Pin  6C (ULN2064)
376    U4 = Pin 13C
377    U5 = Pin 14A
378
379*/
380
381static WRITE8_HANDLER( ampoker2_port30_w )
382/*-------------------------------------------------
383    PORT_30 C000H         ;OUTPUT PORT 30H
384---------------------------------------------------
385    BIT 0 =
386    BIT 1 =
387    BIT 2 =
388    BIT 3 =
389    BIT 4 =
390--------------------------------------------------*/
391{
392}
393
394
395static WRITE8_HANDLER( ampoker2_port31_w )
396/*-------------------------------------------------
397    PORT_31 C001H         ;OUTPUT PORT 31H
398---------------------------------------------------
399    BIT 0 =
400    BIT 1 = LAMP_1        ;Lamp 1  (RED)
401    BIT 2 = LAMP_6        ;Lamp 6  (HOLD4)
402    BIT 3 = LAMP_4        ;Lamp 4  (HOLD2)
403    BIT 4 = TWL_YELL      ;Tower Light YELLOW
404--------------------------------------------------*/
405{
406   output_set_lamp_value(1, ((data >> 1) & 1));   /* Lamp 1 - BET/RED */
407   output_set_lamp_value(6, ((data >> 2) & 1));   /* Lamp 6 - HOLD 4 */
408   output_set_lamp_value(4, ((data >> 3) & 1));   /* Lamp 4 - HOLD 2 */
409   output_set_lamp_value(8, ((data >> 4) & 1));   /* Lamp 8 - TWR.YELLOW */
410}
411
412
413static WRITE8_HANDLER( ampoker2_port32_w )
414/*-------------------------------------------------
415    PORT_32 C002H         ;OUTPUT PORT 32H
416---------------------------------------------------
417    BIT 0 =
418    BIT 1 =
419    BIT 2 =
420    BIT 3 = LAMP_5        ;Lamp 5  (HOLD3)
421    BIT 4 =
422--------------------------------------------------*/
423{
424   output_set_lamp_value(5, ((data >> 3) & 1));   /* Lamp 5 - HOLD 3 */
425}
426
427
428static WRITE8_HANDLER( ampoker2_port33_w )
429/*-------------------------------------------------
430    PORT_33 C003H         ;OUTPUT PORT 33H
431---------------------------------------------------
432    BIT 0 =
433    BIT 1 =
434    BIT 2 =
435    BIT 3 =
436    BIT 4 =
437--------------------------------------------------*/
438{
439}
440
441
442static WRITE8_HANDLER( ampoker2_port34_w )
443/*-------------------------------------------------
444    PORT_34 C004H         ;OUTPUT PORT 34H
445---------------------------------------------------
446    BIT 0 =
447    BIT 1 =
448    BIT 2 =
449    BIT 3 =
450    BIT 4 = LAMP_2        ;Lamp 3  (BLACK)
451--------------------------------------------------*/
452{
453   output_set_lamp_value(2, ((data >> 4) & 1));   /* Lamp 2 - BLACK */
454}
455
456
457static WRITE8_HANDLER( ampoker2_port35_w )
458/*-------------------------------------------------
459    PORT_35 C005H         ;OUTPUT PORT 35H
460---------------------------------------------------
461    BIT 0 =
462    BIT 1 =
463    BIT 2 =
464    BIT 3 =
465    BIT 4 =
466--------------------------------------------------*/
467{
468}
469
470
471static WRITE8_HANDLER( ampoker2_port36_w )
472/*-------------------------------------------------
473    PORT_36 C006H         ;OUTPUT PORT 36H
474---------------------------------------------------
475    BIT 0 = TWL_GREEN     ;Tower Light GREEN
476    BIT 1 =
477    BIT 2 = LAMP_9        ;Lamp 9  (HOLD5)
478    BIT 3 = LAMP_0        ;Lamp 0  (DEAL)
479    BIT 4 = LAMP_3        ;Lamp 3  (HOLD1)
480--------------------------------------------------*/
481{
482   output_set_lamp_value(9, (data & 1));         /* Lamp 9 - TWR.GREEN */
483   output_set_lamp_value(7, ((data >> 2) & 1));   /* Lamp 7 - HOLD 5 */
484   output_set_lamp_value(0, ((data >> 3) & 1));   /* Lamp 0 - DEAL */
485   output_set_lamp_value(3, ((data >> 4) & 1));   /* Lamp 3 - HOLD 1 */
486}
487
488
489static WRITE8_HANDLER( ampoker2_watchdog_reset_w )
490/*-------------------------------------------------
491    PORT_37 C007H         ;OUTPUT PORT 37H
492---------------------------------------------------
493    BIT 3 = W_DOG         ;WATCHDOG.
494--------------------------------------------------*/
495{
496   /* watchdog sometimes stop to work */
497   if (( (data >> 3) & 0x01) == 0)      /* check for refresh value (0x08h) */
498   {
499      watchdog_reset_w(0,0);
500//      fprintf(stdout,"Watchdog\n");
501   }
502}
503
504
505/*************************
506* Memory map information *
507*************************/
508
509static ADDRESS_MAP_START( ampoker2_map, ADDRESS_SPACE_PROGRAM, 8 )
510   AM_RANGE(0x0000, 0xbfff) AM_ROM
511   AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
512   AM_RANGE(0xe000, 0xefff) AM_RAM AM_WRITE(ampoker2_videoram_w) AM_BASE(&videoram)
513ADDRESS_MAP_END
514
515static ADDRESS_MAP_START( ampoker2_io_map, ADDRESS_SPACE_IO, 8 )
516   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
517   AM_RANGE(0x08, 0x0f) AM_WRITENOP            /* inexistent in the real hardware */
518   AM_RANGE(0x10, 0x10) AM_READ(input_port_0_r)
519   AM_RANGE(0x11, 0x11) AM_READ(input_port_1_r)
520   AM_RANGE(0x12, 0x12) AM_READ(input_port_2_r)
521   AM_RANGE(0x13, 0x13) AM_READ(input_port_3_r)
522   AM_RANGE(0x14, 0x14) AM_READ(input_port_4_r)
523   AM_RANGE(0x15, 0x15) AM_READ(input_port_5_r)
524   AM_RANGE(0x16, 0x16) AM_READ(input_port_6_r)
525   AM_RANGE(0x17, 0x17) AM_READ(input_port_7_r)
526//  AM_RANGE(0x21, 0x21) AM_WRITENOP                    /* undocumented, write 0x1a after each reset */
527   AM_RANGE(0x30, 0x30) AM_WRITE (ampoker2_port30_w)   /* see write handlers */
528   AM_RANGE(0x31, 0x31) AM_WRITE (ampoker2_port31_w)   /* see write handlers */
529   AM_RANGE(0x32, 0x32) AM_WRITE (ampoker2_port32_w)   /* see write handlers */
530   AM_RANGE(0x33, 0x33) AM_WRITE (ampoker2_port33_w)   /* see write handlers */
531   AM_RANGE(0x34, 0x34) AM_WRITE (ampoker2_port34_w)   /* see write handlers */
532   AM_RANGE(0x35, 0x35) AM_WRITE (ampoker2_port35_w)   /* see write handlers */
533   AM_RANGE(0x36, 0x36) AM_WRITE (ampoker2_port36_w)   /* see write handlers */
534   AM_RANGE(0x37, 0x37) AM_WRITE(ampoker2_watchdog_reset_w)
535   AM_RANGE(0x38, 0x38) AM_WRITE(AY8910_control_port_0_w)
536   AM_RANGE(0x39, 0x39) AM_WRITE(AY8910_write_port_0_w)
537   AM_RANGE(0x3A, 0x3A) AM_READ(AY8910_read_port_0_r)
538ADDRESS_MAP_END
539
540
541
542/*************************
543*      Input ports       *
544*************************/
545
546static INPUT_PORTS_START( ampoker2 )
547   PORT_START_TAG("IN0")
548   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
549   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
550   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
551   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper 1") PORT_CODE(KEYCODE_Y)
552   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_IMPULSE(2)
553   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
554   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
555   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
556   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_IMPULSE(2)
557
558   PORT_START_TAG("IN1")
559   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
560   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
561   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
562   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
563   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Operator Key") PORT_TOGGLE PORT_CODE(KEYCODE_9)
564   PORT_DIPNAME( 0x08, 0x08, "Remote Mode" )
565   PORT_DIPSETTING(    0x08, "Mode 1" )
566   PORT_DIPSETTING(    0x00, "Mode 2" )
567   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
568
569   PORT_START_TAG("IN2")
570   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
571   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
572   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
573   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("RTS") PORT_CODE(KEYCODE_U)
574   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Door Switch") PORT_CODE(KEYCODE_W)
575   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
576   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
577   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
578   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q)
579
580   PORT_START_TAG("IN3")
581   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_I)
582   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
583   PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
584   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
585   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
586   PORT_DIPSETTING(    0x08, "Cred x  20" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
587   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00)
588   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Black Card") PORT_CODE(KEYCODE_S)
589
590   PORT_START_TAG("IN4")
591   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) /* not used */
592   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper Low") PORT_CODE(KEYCODE_H)
593   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
594   PORT_DIPNAME( 0x08, 0x08, "Auto Hold" )      PORT_DIPLOCATION("SW1:2") /* DSW2 */
595   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
596   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
597   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Deal / Take") PORT_CODE(KEYCODE_1)
598
599   PORT_START_TAG("IN5")
600   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
601   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
602   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
603   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Return Line") PORT_CODE(KEYCODE_J)
604   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("TILT") PORT_CODE(KEYCODE_K)
605   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
606   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
607   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
608   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
609
610   PORT_START_TAG("IN6")
611   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
612   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
613   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
614   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet / Red Card") PORT_CODE(KEYCODE_A)
615   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
616   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
617   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
618   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
619   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE(2)
620
621   PORT_START_TAG("IN7")
622   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) /* not used */
623   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Remote Credits") PORT_IMPULSE(12) PORT_CODE(KEYCODE_3)
624   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 )   PORT_IMPULSE(2)
625   PORT_DIPNAME( 0x08, 0x08, "Jackpot" )        PORT_DIPLOCATION("SW1:8") /* DSW8 */
626   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
627   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
628   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Clear Credits") PORT_CODE(KEYCODE_4)
629INPUT_PORTS_END
630
631static INPUT_PORTS_START( ampkr95 )
632   PORT_START_TAG("IN0")
633   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
634   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
635   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
636   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper 1") PORT_CODE(KEYCODE_Y)
637   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_IMPULSE(2)
638   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
639   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
640   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
641   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_IMPULSE(2)
642
643   PORT_START_TAG("IN1")
644   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
645   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
646   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
647   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
648   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Operator Key") PORT_TOGGLE PORT_CODE(KEYCODE_9)
649   PORT_DIPNAME( 0x08, 0x08, "Remote Mode" )
650   PORT_DIPSETTING(    0x08, "Mode 1" )
651   PORT_DIPSETTING(    0x00, "Mode 2" )
652   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
653
654   PORT_START_TAG("IN2")
655   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
656   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
657   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
658   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("RTS") PORT_CODE(KEYCODE_U)
659   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Door Switch") PORT_CODE(KEYCODE_W)
660   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
661   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
662   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
663   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q)
664
665   PORT_START_TAG("IN3")
666   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_I)
667   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
668   PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
669   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
670   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
671   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
672   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00)
673   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Black Card") PORT_CODE(KEYCODE_S)
674
675   PORT_START_TAG("IN4")
676   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) /* not used */
677   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper Low") PORT_CODE(KEYCODE_H)
678   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
679   PORT_DIPNAME( 0x08, 0x08, "Auto Hold" )      PORT_DIPLOCATION("SW1:2") /* DSW2 */
680   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
681   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
682   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Deal / Take") PORT_CODE(KEYCODE_1)
683
684   PORT_START_TAG("IN5")
685   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
686   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
687   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
688   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Return Line") PORT_CODE(KEYCODE_J)
689   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("TILT") PORT_CODE(KEYCODE_K)
690   PORT_DIPNAME( 0x08, 0x08, "Rate Table SW1" ) PORT_DIPLOCATION("SW1:3") /* DSW3 (should be arranged with DSW4) */
691   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
693   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
694
695   PORT_START_TAG("IN6")
696   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
697   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
698   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
699   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet / Red") PORT_CODE(KEYCODE_A)
700   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
701   PORT_DIPNAME( 0x08, 0x08, "Rate Table SW2" ) PORT_DIPLOCATION("SW1:4") /* DSW4 (should be arranged with DSW3) */
702   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
703   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
704   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE(2)
705
706   PORT_START_TAG("IN7")
707   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) /* not used */
708   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Remote Credits") PORT_IMPULSE(12) PORT_CODE(KEYCODE_3)
709   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 )   PORT_IMPULSE(2)
710   PORT_DIPNAME( 0x08, 0x08, "Jackpot" )        PORT_DIPLOCATION("SW1:8") /* DSW8 */
711   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
712   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
713   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Clear Credits") PORT_CODE(KEYCODE_4)
714INPUT_PORTS_END
715
716static INPUT_PORTS_START( sigmapkr )
717   PORT_START_TAG("IN0")
718   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
719   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
720   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
721   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper 1") PORT_CODE(KEYCODE_Y)
722   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_IMPULSE(2)
723   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
724   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
725   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
726   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_IMPULSE(2)
727
728   PORT_START_TAG("IN1")
729   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
730   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
731   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
732   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
733   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Operator Key") PORT_TOGGLE PORT_CODE(KEYCODE_9)
734   PORT_DIPNAME( 0x08, 0x08, "Remote Mode" )
735   PORT_DIPSETTING(    0x08, "Mode 1" )
736   PORT_DIPSETTING(    0x00, "Mode 2" )
737   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
738
739   PORT_START_TAG("IN2")
740   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
741   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
742   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
743   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("RTS") PORT_CODE(KEYCODE_U)
744   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Door Switch") PORT_CODE(KEYCODE_W)
745   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
746   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
747   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
748   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q)
749
750   PORT_START_TAG("IN3")
751   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_I)
752   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
753   PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
754   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
755   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
756   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
757   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00)
758   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double") PORT_CODE(KEYCODE_S)
759
760   PORT_START_TAG("IN4")
761   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) /* not used */
762   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper Low") PORT_CODE(KEYCODE_H)
763   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
764   PORT_DIPNAME( 0x08, 0x08, "Auto Hold" )      PORT_DIPLOCATION("SW1:2") /* DSW2 */
765   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
766   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
767   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Deal / Take") PORT_CODE(KEYCODE_1)
768
769   PORT_START_TAG("IN5")
770   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
771   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
772   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
773   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Return Line") PORT_CODE(KEYCODE_J)
774   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("TILT") PORT_CODE(KEYCODE_K)
775   PORT_DIPNAME( 0x08, 0x08, "Rate Table SW1" ) PORT_DIPLOCATION("SW1:3") /* DSW3 (should be arranged with DSW4) */
776   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
777   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
778   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
779
780   PORT_START_TAG("IN6")
781   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
782   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
783   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
784   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_A)
785   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
786   PORT_DIPNAME( 0x08, 0x08, "Rate Table SW2" ) PORT_DIPLOCATION("SW1:4") /* DSW4 (should be arranged with DSW3) */
787   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
788   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
789   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE(2)
790
791   PORT_START_TAG("IN7")
792   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) /* not used */
793   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Remote Credits") PORT_IMPULSE(12) PORT_CODE(KEYCODE_3)
794   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 )   PORT_IMPULSE(2)
795   PORT_DIPNAME( 0x08, 0x08, "Jackpot" )        PORT_DIPLOCATION("SW1:8") /* DSW8 */
796   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
797   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
798   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Clear Credits") PORT_CODE(KEYCODE_4)
799INPUT_PORTS_END
800
801
802/*************************
803*    Graphics Layouts    *
804*************************/
805
806static const gfx_layout charlayout =
807{
808   8, 8,
809   1024,
810   2,
811   { 0, 4 },
812   { 0, 1, 2, 3, 8, 9, 10, 11 },
813   { 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8 },
814   16*8
815};
816
817static const gfx_layout s2k_charlayout =
818{
819   8, 8,
820   4096,
821   2,
822   { 0, 4 },
823   { 0, 1, 2, 3, 8, 9, 10, 11 },
824   { 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8 },
825   16*8
826};
827
828
829/******************************
830* Graphics Decode Information *
831******************************/
832
833static GFXDECODE_START( ampoker2 )
834   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 16 )
835GFXDECODE_END
836
837static GFXDECODE_START( sigma2k )
838   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2k_charlayout, 0, 16 )
839GFXDECODE_END
840
841
842/*******************
843* AY8910 Interfase *
844*******************/
845
846static const struct AY8910interface ay8910_interface =
847{
8480, 0, 0, 0   /* no ports used */
849};
850
851
852/*************************
853*     Machine Driver     *
854*************************/
855
856static MACHINE_DRIVER_START( ampoker2 )
857
858   /* basic machine hardware */
859   MDRV_CPU_ADD(Z80, MASTER_CLOCK/2)      /* 3 MHz */
860   MDRV_CPU_PROGRAM_MAP(ampoker2_map, 0)
861   MDRV_CPU_IO_MAP(ampoker2_io_map, 0)
862   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 1536)
863   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_HZ( 5 ))   /* 200 ms, measured */
864   //MDRV_WATCHDOG_VBLANK_INIT(8)
865   MDRV_SCREEN_REFRESH_RATE(60)
866   /*  if VBLANK is used, the watchdog timer stop to work.
867    MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
868    */
869   MDRV_NVRAM_HANDLER(generic_0fill)
870
871   /* video hardware */
872   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
873   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
874   MDRV_SCREEN_SIZE(64*8, 32*8)
875   MDRV_SCREEN_VISIBLE_AREA(20*8, 56*8-1, 2*8, 32*8-1)
876
877   MDRV_GFXDECODE(ampoker2)
878   MDRV_PALETTE_LENGTH(512)
879
880   MDRV_PALETTE_INIT(ampoker2)
881   MDRV_VIDEO_START(ampoker2)
882   MDRV_VIDEO_UPDATE(ampoker2)
883
884   /* sound hardware */
885   MDRV_SPEAKER_STANDARD_MONO("mono")
886   MDRV_SOUND_ADD(AY8910,MASTER_CLOCK/4)   /* 1.5 MHz, verified against the real thing */
887   MDRV_SOUND_CONFIG(ay8910_interface)
888   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
889MACHINE_DRIVER_END
890
891static MACHINE_DRIVER_START( sigma2k )
892   /* basic machine hardware */
893   MDRV_IMPORT_FROM(ampoker2)
894
895   /* video hardware */
896   MDRV_GFXDECODE(sigma2k)
897   MDRV_VIDEO_START(sigma2k)
898MACHINE_DRIVER_END
899
900
901/*************************
902*        Rom Load        *
903*************************/
904
905ROM_START( ampoker2 )
906   ROM_REGION( 0x10000, REGION_CPU1, 0 )
907   ROM_LOAD( "poker9.003", 0x4000, 0x8000, CRC(a31221fc) SHA1(4a8bdd8ce8d5bff7e7cfc4ae91e27c1d366dc54d) )
908   ROM_COPY( REGION_CPU1, 0x8000, 0x0000, 0x4000 ) /* poker9.003 contains the 16K halves swapped around */
909   ROM_LOAD( "poker9.002", 0x8000, 0x4000, CRC(bfde5bce) SHA1(c7c7ca2268694015e8ec673e8fa5c48043086d3f) )
910
911   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
912   ROM_LOAD( "poker9.028", 0x0000, 0x4000, CRC(65bccb40) SHA1(75f154a2aaf9f9be62e0e1dd8cbe630b9ea0145c) )
913
914   ROM_REGION( 0x200, REGION_PROMS, 0 )
915   ROM_LOAD( "82s147an.u48", 0x0000, 0x0200, CRC(9bc8e543) )
916ROM_END
917
918ROM_START( ampkr2b1 )
919   ROM_REGION( 0x10000, REGION_CPU1, 0 )
920   ROM_LOAD( "airl-v00.512", 0x0000, 0x10000, CRC(e5953bf4) SHA1(291367431e3b21b57704228c63e4da853e6d25b7) )
921
922   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
923   ROM_LOAD( "ampoker.u47", 0x0000, 0x4000, CRC(cefed6c7) SHA1(79591339eab2712b432dfe89929dbc97000a13d2) )
924
925   ROM_REGION( 0x200, REGION_PROMS, 0 )
926   ROM_LOAD( "82s147an.u48", 0x0000, 0x0200, CRC(9bc8e543) )
927ROM_END
928
929ROM_START( ampkr2b2 )
930   ROM_REGION( 0x10000, REGION_CPU1, 0 )
931   ROM_LOAD( "rom9.u6", 0x0000, 0x10000, CRC(820a491d) SHA1(36654aacac010e7c086dd18d4e0ca5d959b9044f) )
932
933   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
934   ROM_LOAD( "rom0.u47", 0x0000, 0x4000, CRC(cefed6c7) SHA1(79591339eab2712b432dfe89929dbc97000a13d2) )
935
936   ROM_REGION( 0x200, REGION_PROMS, 0 )
937   ROM_LOAD( "82s147an.u48", 0x0000, 0x0200, CRC(9bc8e543) )
938ROM_END
939
940ROM_START( ampkr2b3 )
941   ROM_REGION( 0x10000, REGION_CPU1, 0 )
942   ROM_LOAD( "ampoker.u6", 0x0000, 0x10000, CRC(d7b055bd) SHA1(f5231d2ec80f740eabedaba07547ccbb977accc1) )
943
944   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
945   ROM_LOAD( "ampoker.u47", 0x0000, 0x4000, CRC(cefed6c7) SHA1(79591339eab2712b432dfe89929dbc97000a13d2) )
946
947   ROM_REGION( 0x200, REGION_PROMS, 0 )
948   ROM_LOAD( "82s147an.u48", 0x0000, 0x0200, CRC(9bc8e543) )
949ROM_END
950
951ROM_START( ampkr95 )
952   ROM_REGION( 0x10000, REGION_CPU1, 0 )
953   ROM_LOAD( "amp95rus.u6", 0x0000, 0x10000, CRC(6ec74b2b) SHA1(2dca05bc111071f1407dd524b67b5a3dc5848c70) )
954
955   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
956   ROM_LOAD( "ampoker.u47", 0x0000, 0x4000, CRC(cefed6c7) SHA1(79591339eab2712b432dfe89929dbc97000a13d2) )
957
958   ROM_REGION( 0x200, REGION_PROMS, 0 )
959   ROM_LOAD( "82s147an.u48", 0x0000, 0x0200, CRC(9bc8e543) )
960ROM_END
961
962ROM_START( pkrdewin )
963   ROM_REGION( 0x14000, REGION_CPU1, 0 )
964   ROM_LOAD( "poker7.001", 0x4000, 0x10000, CRC(eca16b9e) SHA1(5063d733721457ab3b08caafbe8d33b2cbe4f88b) )
965   ROM_COPY( REGION_CPU1,   0x8000, 0x0000, 0x4000 ) /* poker7.001 contains the 1st and 2nd 16K quarters swapped */
966   ROM_COPY( REGION_CPU1, 0x10000, 0x8000, 0x4000 ) /* poker7.001 contains the 1st and 2nd 16K quarters swapped */
967
968   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
969   ROM_LOAD( "poker7.002", 0x0000, 0x4000, CRC(65bccb40) SHA1(75f154a2aaf9f9be62e0e1dd8cbe630b9ea0145c) )
970
971   ROM_REGION( 0x200, REGION_PROMS, 0 )
972   ROM_LOAD( "82s147an.u48", 0x0000, 0x0200, CRC(9bc8e543) )
973ROM_END
974
975ROM_START( sigmapkr )
976   ROM_REGION( 0x10000, REGION_CPU1, 0 )
977   ROM_LOAD( "sigmapkr.u6", 0x0000, 0x10000, CRC(aa3f429a) SHA1(8c82e86de7280590ba157860cbf9783f893f8554) )
978
979   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
980   ROM_LOAD( "sigmapkr.u47", 0x0000, 0x4000, CRC(49eb69a8) SHA1(22be5870d501d229aa56fb18146ec0d8f8eea72e) )
981
982   ROM_REGION( 0x200, REGION_PROMS, 0 )
983   ROM_LOAD( "82s147an_spkr.u48", 0x0000, 0x0200, CRC(3d8683d0) )
984ROM_END
985
986ROM_START( sigma2k )
987   ROM_REGION( 0x10000, REGION_CPU1, 0 )
988   ROM_LOAD( "sigma2k.u6", 0x0000, 0x10000, CRC(608d1771) SHA1(0ec94d780565472c7e68da7e3ce19aea3f1ab4a5) )
989
990   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
991   ROM_LOAD( "sigma2k.u47", 0x0000, 0x10000, CRC(3ed7b9df) SHA1(788a90ffa6cb0bfebf607815a695a5afe930945c) )
992
993   ROM_REGION( 0x200, REGION_PROMS, 0 )
994   ROM_LOAD( "82s147an_s2k.u48", 0x0000, 0x0200, CRC(715361cc) )
995ROM_END
996
997
998/*************************
999*      Game Drivers      *
1000*************************/
1001
1002/*     YEAR  NAME      PARENT    MACHINE   INPUT     INIT  ROT    COMPANY       FULLNAME                             FLAGS             LAYOUT      */
1003GAMEL( 1990, ampoker2, 0,        ampoker2, ampoker2, 0,    ROT0, "Novomatic",  "American Poker II",                  0,                layout_ampoker2 )
1004GAMEL( 1990, ampkr2b1, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "American Poker II (bootleg, set 1)", 0,                layout_ampoker2 )
1005GAMEL( 1990, ampkr2b2, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "American Poker II (bootleg, set 2)", 0,                layout_ampoker2 )
1006GAMEL( 1994, ampkr2b3, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "American Poker II (bootleg, set 3)", 0,                layout_ampoker2 )
1007GAMEL( 1995, ampkr95,  ampoker2, ampoker2, ampkr95,  0,    ROT0, "Bootleg",    "American Poker 95",                  0,                layout_ampoker2 )
1008GAMEL( 1990, pkrdewin, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "Poker De Win",                       0,                layout_ampoker2 )
1009GAMEL( 1995, sigmapkr, 0,        ampoker2, sigmapkr, 0,    ROT0, "Sigma Inc.", "Sigma Poker",                        0,                layout_sigmapkr )
1010GAMEL( 1998, sigma2k,  0,        sigma2k,  sigmapkr, 0,    ROT0, "Sigma Inc.", "Sigma Poker 2000",                   GAME_NOT_WORKING, layout_sigmapkr )
src/mame/drivers/dacholer.c
r1649r1650
1212******************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516
1617static UINT8 *bgvideoram,*fgvideoram;
1718static int bg_bank = 0;
src/mame/drivers/esd16.c
r1649r1650
3030***************************************************************************/
3131
3232#include "driver.h"
33#include "deprecat.h"
3334#include "machine/eeprom.h"
3435#include "sound/okim6295.h"
3536#include "sound/3812intf.h"
src/mame/drivers/model3.c
r1649r1650
359359*/
360360
361361#include "driver.h"
362#include "deprecat.h"
362363#include "cpu/powerpc/ppc.h"
363364#include "machine/eeprom.h"
364365#include "machine/53c810.h"
src/mame/drivers/namcos21.c
r1649r1650
271271  JP3
272272*/
273273#include "driver.h"
274#include "deprecat.h"
274275#include "namcos2.h"
275276#include "cpu/m6809/m6809.h"
276277#include "cpu/tms32025/tms32025.h"
src/mame/drivers/pgm.c
r1649r1650
281281#define PGMARM7SPEEDHACK 1
282282
283283#include "driver.h"
284#include "deprecat.h"
284285#include "sound/ics2115.h"
285286#include "cpu/arm7/arm7core.h"
286287
src/mame/drivers/iqblock.c
r1649r1650
5050***************************************************************************/
5151
5252#include "driver.h"
53#include "deprecat.h"
5354#include "machine/8255ppi.h"
5455#include "iqblock.h"
5556#include "sound/2413intf.h"
src/mame/drivers/gameplan.c
r1649r1650
6464****************************************************************************/
6565
6666#include "driver.h"
67#include "deprecat.h"
6768#include "machine/6532riot.h"
6869#include "machine/6522via.h"
6970#include "sound/ay8910.h"
src/mame/drivers/ikki.c
r1649r1650
99*****************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "sound/sn76496.h"
1314
1415PALETTE_INIT( ikki );
src/mame/drivers/capbowl.c
r1649r1650
8888***************************************************************************/
8989
9090#include "driver.h"
91#include "deprecat.h"
9192#include "machine/ticket.h"
9293#include "cpu/m6809/m6809.h"
9394#include "capbowl.h"
src/mame/drivers/darius.c
r1649r1650
126126
127127***************************************************************************/
128128
129#include <stdarg.h>
130#include <math.h>
131129#include "driver.h"
130#include "deprecat.h"
132131#include "video/taitoic.h"
133132#include "cpu/z80/z80.h"
134133#include "audio/taitosnd.h"
src/mame/drivers/kinst.c
r1649r1650
129129***************************************************************************/
130130
131131#include "driver.h"
132#include "deprecat.h"
132133#include "cpu/mips/mips3.h"
133134#include "cpu/adsp2100/adsp2100.h"
134135#include "machine/idectrl.h"
src/mame/drivers/beathead.c
r1649r1650
9898
9999
100100#include "driver.h"
101#include "deprecat.h"
101102#include "cpu/asap/asap.h"
102103#include "machine/atarigen.h"
103104#include "audio/atarijsa.h"
src/mame/drivers/st0016.c
r1649r1650
88*/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/z80/z80.h"
1213#include "sound/st0016.h"
1314#include "st0016.h"
src/mame/drivers/cchasm.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "video/vector.h"
1718#include "machine/6840ptm.h"
1819#include "machine/z80ctc.h"
src/mame/drivers/sbasketb.c
r1649r1650
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "cpu/m6809/m6809.h"
2021#include "sound/vlm5030.h"
2122#include "sound/dac.h"
src/mame/drivers/smstrv.c
r1649r1650
8686*/
8787
8888#include "driver.h"
89#include "deprecat.h"
8990#include "sound/ay8910.h"
9091#include "machine/8255ppi.h"
9192
src/mame/drivers/funkyjet.c
r1649r1650
8888***************************************************************************/
8989
9090#include "driver.h"
91#include "deprecat.h"
9192#include "cpu/h6280/h6280.h"
9293#include "sound/2151intf.h"
9394#include "sound/okim6295.h"
src/mame/drivers/suprgolf.c
r1649r1650
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "sound/2203intf.h"
1920
2021static tilemap *suprgolf_tilemap;
src/mame/drivers/xexex.c
r1649r1650
6262***************************************************************************/
6363
6464#include "driver.h"
65
65#include "deprecat.h"
6666#include "video/konamiic.h"
6767#include "cpu/z80/z80.h"
6868#include "machine/eeprom.h"
src/mame/drivers/marinedt.c
r1649r1650
501501   fillbitmap(bitmap, machine->pens[0], NULL);
502502
503503   if (marinedt_pd & 0x02)
504      copybitmap(bitmap, obj2, 0, 0, OBJ_X(marinedt_obj2_x), OBJ_Y(marinedt_obj2_y), cliprect, TRANSPARENCY_COLOR, machine->pens[0]);
504      copybitmap_trans(bitmap, obj2, 0, 0, OBJ_X(marinedt_obj2_x), OBJ_Y(marinedt_obj2_y), cliprect, machine->pens[0]);
505505
506506   if (marinedt_pd & 0x01)
507      copybitmap(bitmap, obj1, 0, 0, OBJ_X(marinedt_obj1_x), OBJ_Y(marinedt_obj1_y), cliprect, TRANSPARENCY_COLOR, machine->pens[0]);
507      copybitmap_trans(bitmap, obj1, 0, 0, OBJ_X(marinedt_obj1_x), OBJ_Y(marinedt_obj1_y), cliprect, machine->pens[0]);
508508
509   copybitmap(bitmap, tile, 0, 0, 0, 0, cliprect, TRANSPARENCY_COLOR, machine->pens[0]);
509   copybitmap_trans(bitmap, tile, 0, 0, 0, 0, cliprect, machine->pens[0]);
510510
511511   coll = cx = cyr = cyq = 0;
512512   if (marinedt_pd & 0x01)
src/mame/drivers/ironhors.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6809/m6809.h"
1112#include "sound/2203intf.h"
1213#include "sound/flt_rc.h"
src/mame/drivers/skullxbo.c
r1649r1650
1818
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/atarigen.h"
2223#include "audio/atarijsa.h"
2324#include "skullxbo.h"
src/mame/drivers/sliver.c
r1649r1650
6565*/
6666
6767#include "driver.h"
68#include "deprecat.h"
6869#include "sound/okim6295.h"
6970#include "cpu/i8051/i8051.h"
7071
r1649r1650
446447
447448static VIDEO_UPDATE(sliver)
448449{
449   copybitmap(bitmap, sliver_bitmap_bg, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
450   copybitmap(bitmap, sliver_bitmap_fg, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 0);
450   copybitmap      (bitmap, sliver_bitmap_bg, 0, 0, 0, 0, cliprect);
451   copybitmap_trans(bitmap, sliver_bitmap_fg, 0, 0, 0, 0, cliprect, 0);
451452   return 0;
452453}
453454
src/mame/drivers/konamigq.c
r1649r1650
4646*/
4747
4848#include "driver.h"
49#include "deprecat.h"
4950#include "cpu/mips/psx.h"
5051#include "includes/psx.h"
5152#include "machine/konamigx.h"
src/mame/drivers/mrflea.c
r1649r1650
4040******************************************************************/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "cpu/z80/z80.h"
4445#include "sound/ay8910.h"
4546
src/mame/drivers/cps3.c
r1649r1650
330330
331331#include "driver.h"
332332#include "cdrom.h"
333#include "deprecat.h"
333334#include "cpu/sh2/sh2.h"
334335#include "machine/intelfsh.h"
335336#include "includes/cps3.h"
src/mame/drivers/glass.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/m68000/m68000.h"
1314#include "sound/okim6295.h"
1415
r1649r1650
337338   glass_ROM16_split(REGION_GFX2, REGION_GFX1, 0x0200000, 0x0200000, 0x0200000, 0x0300000);
338339}
339340
340GAME( 1993, glass, 0, glass,glass, glass, ROT0, "Gaelco", "Glass (Ver 1.1)", GAME_UNEMULATED_PROTECTION )
341GAME( 1993, glass10 , glass, glass,glass, glass, ROT0, "Gaelco", "Glass (Ver 1.0)", GAME_UNEMULATED_PROTECTION )
342GAME( 1993, glass10a, glass, glass,glass, glass, ROT0, "Gaelco", "Glass (Ver 1.0 set 2)", GAME_UNEMULATED_PROTECTION )
341GAME( 1993, glass,    0,     glass, glass, glass, ROT0, "Gaelco", "Glass (Ver 1.1)",        GAME_UNEMULATED_PROTECTION )
342GAME( 1993, glass10,  glass, glass, glass, glass, ROT0, "Gaelco", "Glass (Ver 1.0, set 1)", GAME_UNEMULATED_PROTECTION )
343GAME( 1993, glass10a, glass, glass, glass, glass, ROT0, "Gaelco", "Glass (Ver 1.0, set 2)", GAME_UNEMULATED_PROTECTION )
src/mame/drivers/spiders.c
r1649r1650
189189
190190#include "driver.h"
191191#include "rescap.h"
192#include "deprecat.h"
192193#include "cpu/m6800/m6800.h"
193194#include "cpu/m6809/m6809.h"
194195#include "video/crtc6845.h"
src/mame/drivers/mcatadv.c
r1649r1650
136136******************************************************************************/
137137
138138#include "driver.h"
139#include "deprecat.h"
139140#include "sound/2610intf.h"
140141
141142VIDEO_UPDATE( mcatadv );
src/mame/drivers/cinemat.c
r1649r1650
3030***************************************************************************/
3131
3232#include "driver.h"
33#include "deprecat.h"
3334#include "video/vector.h"
3435#include "cpu/ccpu/ccpu.h"
3536#include "cinemat.h"
src/mame/drivers/toaplan2.c
r1649r1650
276276
277277
278278#include "driver.h"
279#include "deprecat.h"
279280#include "cpu/m68000/m68000.h"
280281#include "cpu/z80/z80.h"
281282#include "machine/eeprom.h"
src/mame/drivers/jchan.c
r1649r1650
199199*/
200200
201201#include "driver.h"
202#include "deprecat.h"
202203#include "sound/ymz280b.h"
203204
204205extern UINT32* skns_spc_regs;
src/mame/drivers/sgladiat.c
r1649r1650
2020*/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "cpu/z80/z80.h"
2425#include "snk.h"
2526#include "sound/ay8910.h"
src/mame/drivers/mlanding.c
r1649r1650
44*/
55
66#include "driver.h"
7#include "deprecat.h"
78#include "audio/taitosnd.h"
89#include "sound/2151intf.h"
910#include "sound/msm5205.h"
r1649r1650
269270      int i;
270271      for(i=0;i<7;i++)
271272      {
272         copybitmap(bitmap,ml_bitmap[i], 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 0);
273         copybitmap_trans(bitmap,ml_bitmap[i], 0, 0, 0, 0, cliprect, 0);
273274      }
274275   }
275276   status_bit=0;
src/mame/drivers/gaelco.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6809/m6809.h"
1112#include "cpu/m68000/m68000.h"
1213#include "sound/okim6295.h"
src/mame/drivers/wecleman.c
r1649r1650
270270***************************************************************************/
271271
272272#include "driver.h"
273#include "deprecat.h"
273274#include "video/konamiic.h"
274275#include "cpu/m6809/m6809.h"
275276#include "sound/2151intf.h"
src/mame/drivers/crbaloon.c
r1649r1650
375375   MDRV_VIDEO_UPDATE(crbaloon)
376376
377377   MDRV_GFXDECODE(crbaloon)
378   MDRV_PALETTE_LENGTH(16)
378   MDRV_PALETTE_LENGTH(32)
379379   MDRV_PALETTE_INIT(crbaloon)
380   MDRV_COLORTABLE_LENGTH(16*2)
381380
382381   MDRV_SCREEN_REFRESH_RATE(60)
383382   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
src/mame/drivers/dmndrby.c
r1649r1650
3636*/
3737
3838#include "driver.h"
39#include "deprecat.h"
3940
4041static UINT8* dderby_vid;
4142
src/mame/drivers/seattle.c
r1649r1650
183183**************************************************************************/
184184
185185#include "driver.h"
186#include "deprecat.h"
186187#include "cpu/adsp2100/adsp2100.h"
187188#include "cpu/mips/mips3.h"
188189#include "audio/dcs.h"
src/mame/drivers/munchmo.c
r1649r1650
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "cpu/z80/z80.h"
1920#include "sound/ay8910.h"
2021
src/mame/drivers/btoads.c
r1649r1650
77**************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/tms34010/tms34010.h"
1112#include "video/tlc34076.h"
1213#include "btoads.h"
src/mame/drivers/tetrisp2.c
r1649r1650
2828
2929Notes:
3030
31-   The Japan set doesn't seem to have (or use) NVRAM. I can't enter
32    a test mode or use the service coin either !?
31-   The Japan set of Tetris Plus 2 doesn't seem to have (or use) NVRAM. I can't
32    enter a test mode or use the service coin either !?
3333
3434***************************************************************************/
3535
3636#include "driver.h"
37#include "deprecat.h"
3738#include "sound/ymz280b.h"
3839#include "rocknms.lh"
3940
r1649r1650
594595                            Tetris Plus 2 (World)
595596***************************************************************************/
596597
597#define TETPLUS2_COMMON\
598   PORT_START_TAG("IN0") /*$be0002.w*/ \
599   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)\
600   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)\
601   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)\
602   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)\
603   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)\
604   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)\
605   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)\
606   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNUSED )\
607   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)\
608   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)\
609   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)\
610   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)\
611   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)\
612   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)\
613   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)\
614   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNUSED )\
615   PORT_START_TAG("IN1") /*$be0004.w*/\
616   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN  )\
617   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  )\
618   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_START1   )\
619   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_START2   )\
620   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN  )\
621   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )\
622   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_COIN1    )\
623   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_COIN2    )\
624   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_SPECIAL  )   /* ?*/\
625   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_SPECIAL  )   /* ?*/\
626   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )\
627   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )\
628   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )\
629   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )\
630   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN  )\
631   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
598static INPUT_PORTS_START( tetrisp2 )
632599
600   PORT_START_TAG("IN0") /*$be0002.w*/
601   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
602   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
603   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
604   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
605   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
606   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
607   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
608   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
609   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
610   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
611   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
612   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
613   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
614   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
615   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
616   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
633617
634static INPUT_PORTS_START( tetrisp2 )
635TETPLUS2_COMMON
618   PORT_START_TAG("IN1") /*$be0004.w*/
619   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN  )
620   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  )
621   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_START1   )
622   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_START2   )
623   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN  )
624   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
625   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_COIN1    )
626   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_COIN2    )
627   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_SPECIAL  )   /* ?*/
628   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_SPECIAL  )   /* ?*/
629   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
630   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
631   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
632   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
633   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
634   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
636635
637636   PORT_START_TAG("IN2") //$be0008.w
638   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
637   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
639638   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
640639   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
641640   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
r1649r1650
644643   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
645644   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
646645   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
647   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
646   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6")
648647   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
649648   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
650649   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
r1649r1650
653652   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
654653   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
655654   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
656   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) )
655   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:7")
657656   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
658657   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
659   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
660   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
658   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW1:8" )
659   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
661660   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
662661   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
663662   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
664663   PORT_DIPSETTING(      0x0200, DEF_STR( Hardest ) )
665   PORT_DIPNAME( 0x0400, 0x0400, "Vs Mode Rounds" )
664   PORT_DIPNAME( 0x0400, 0x0400, "Vs Mode Rounds" ) PORT_DIPLOCATION("SW2:3")
666665   PORT_DIPSETTING(      0x0000, "1" )
667666   PORT_DIPSETTING(      0x0400, "3" )
668   PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Language ) )
667   PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:4")
669668   PORT_DIPSETTING(      0x0800, DEF_STR( Japanese ) )
670669   PORT_DIPSETTING(      0x0000, DEF_STR( English ) )
671   PORT_DIPNAME( 0x1000, 0x1000, "F.B.I Logo" )
670   PORT_DIPNAME( 0x1000, 0x1000, "F.B.I Logo" ) PORT_DIPLOCATION("SW2:5")
672671   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
673672   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
674   PORT_DIPNAME( 0x2000, 0x2000, "Voice" )
673   PORT_DIPNAME( 0x2000, 0x2000, "Voice" ) PORT_DIPLOCATION("SW2:6")
675674   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
676675   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
677   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
676   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
678677   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
679678   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
680   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Flip_Screen ) )
679   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
681680   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
682681   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
683682
r1649r1650
686685
687686/***************************************************************************
688687                            Tetris Plus 2 (Japan)
688
689    The code for checking the "service mode" and "free play"
690    DSWs is (deliberately?) bugged in this set
691
689692***************************************************************************/
690693
691
692694static INPUT_PORTS_START( teplus2j )
693TETPLUS2_COMMON
695   PORT_INCLUDE(tetrisp2)
694696
695/*
696    The code for checking the "service mode" and "free play" DSWs
697    is (deliberately?) bugged in this set
698*/
699   PORT_START_TAG("IN2")   // $be0008.w
700   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
701   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
702   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
703   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
704   PORT_DIPSETTING(      0x0003, DEF_STR( 2C_1C ) )
705   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
706   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
707   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
708   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
709   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
710   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
711   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
712   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
713   PORT_DIPSETTING(      0x0018, DEF_STR( 2C_1C ) )
714   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
715   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
716   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
717   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
718   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 1-6" )
697   PORT_MODIFY("IN2")   // $be0008.w
698   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 1-7" ) PORT_DIPLOCATION("SW1:7") /* Free Play in "World" set */
719699   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
720700   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
721   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 1-7" )
701   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 1-8" ) PORT_DIPLOCATION("SW1:8") /* Test Mode in "World" set */
722702   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
723703   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
724   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
725   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
726   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
727   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
728   PORT_DIPSETTING(      0x0200, DEF_STR( Hardest ) )
729   PORT_DIPNAME( 0x0400, 0x0400, "Vs Mode Rounds" )
730   PORT_DIPSETTING(      0x0000, "1" )
731   PORT_DIPSETTING(      0x0400, "3" )
732   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNUSED  ) // Language dip
733   PORT_DIPNAME( 0x1000, 0x1000, "Unknown 2-4" )   // F.B.I. Logo (in the USA set?)
704   PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0010, "SW2:4" ) /* Language Select in "World" set */
705   PORT_DIPNAME( 0x1000, 0x1000, "Unknown 2-5" ) PORT_DIPLOCATION("SW2:5") /* F.B.I. Logo in "World" set */
734706   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
735707   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
736   PORT_DIPNAME( 0x2000, 0x2000, "Voice" )
737   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
738   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
739   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
740   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
741   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
742   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Flip_Screen ) )
743   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
744   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
745
746708INPUT_PORTS_END
747709
748710
r1649r1650
12281190
12291191/***************************************************************************
12301192
1231                                Tetris Plus 2
1193                            Tetris Plus 2 (World & Japan sets)
12321194
1233(C) Jaleco 1996
1195(c)1997 Jaleco / The Tetris Company
12341196
12351197TP-97222
1236119896019 EB-00-20117-0
r1649r1650
12381200
12391201BRIEF HARDWARE OVERVIEW
12401202
1241Toshiba TMP68HC000P-12
1242Yamaha YMZ280B-F
1243OSC: 12.000MHz, 48.000MHz, 16.9344MHz
1203CPU:    Toshiba TMP68HC000P-12
1204Sound:  Yamaha YMZ280B-F & Yamaha  YAC516-M
1205OSC:    12.000MHz
1206        48.0000MHz
1207        16.9344MHz
1208DIPS:   Two 8-way dipswitches
12441209
1245Listing of custom chips. (Some on scan are hard to read).
1210Listing of custom chips:
12461211
12471212IC38    JALECO SS91022-03 9428XX001
12481213IC31    JALECO SS91022-05 9347EX002
r1649r1650
12511216IC39    XILINX XC5210 PQ240C X68710M AKJ9544
12521217IC49    XILINX XC7336 PC44ACK9633 A63458A
12531218
1219World set:
1220  Supports English or Japanese language
1221  Optional showing of US FBI Logo
1222  Full Test Mode via dipswitch
1223  EEPROM used
1224
1225Japan Set:
1226  Japanese language only
1227  No optional FBI Logo
1228  No way to enter a Test Mode
1229  No support for EEPROM
1230
12541231***************************************************************************/
12551232
1256ROM_START( tetrisp2 )
1257
1233ROM_START( tetrisp2 ) /* Unknown version */
12581234   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
12591235   ROM_LOAD16_BYTE( "t2p_04.rom", 0x000000, 0x080000, CRC(e67f9c51) SHA1(d8b2937699d648267b163c7c3f591426877f3701) )
12601236   ROM_LOAD16_BYTE( "t2p_01.rom", 0x000001, 0x080000, CRC(5020a4ed) SHA1(9c0f02fe3700761771ac026a2e375144e86e5eb7) )
r1649r1650
12621238   ROM_REGION( 0x800000, REGION_GFX1, ROMREGION_DISPOSE )   /* 8x8x8 (Sprites) */
12631239   ROM_LOAD32_WORD( "96019-01.9", 0x000000, 0x400000, CRC(06f7dc64) SHA1(722c51b707b9854c0293afdff18b27ec7cae6719) )
12641240   ROM_LOAD32_WORD( "96019-02.8", 0x000002, 0x400000, CRC(3e613bed) SHA1(038b5e43fa3d69654107c8093126eeb2e8fa4ddc) )
1265   /* If t2p_m01&2 from this board were correctly read, since they
1266       hold the same data of the above but with swapped halves, it
1267       means they had to invert the top bit of the "page select"
1268       register in the sprite's hardware on this board! */
12691241
1242   /* If t2p_m01&2 from this board were correctly read, since they hold the same data of the above but with swapped halves, it
1243           means they had to invert the top bit of the "page select" register in the sprite's hardware on this board! */
1244
12701245   ROM_REGION( 0x800000, REGION_GFX2, ROMREGION_DISPOSE )   /* 16x16x8 (Background) */
12711246   ROM_LOAD( "96019-06.13", 0x000000, 0x400000, CRC(16f7093c) SHA1(2be77c6a692c5d762f5553ae24e8c415ab194cc6) )
12721247   ROM_LOAD( "96019-04.6",  0x400000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) )
r1649r1650
12791254
12801255   ROM_REGION( 0x400000, REGION_SOUND1, 0 )   /* Samples */
12811256   ROM_LOAD( "96019-07.7", 0x000000, 0x400000, CRC(a8a61954) SHA1(86c3db10b348ba1f44ff696877b8b20845fa53de) )
1257ROM_END
12821258
1259ROM_START( teplus2j ) /* Version 2.2 */
1260   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
1261   ROM_LOAD16_BYTE( "tet2-4v2.2", 0x000000, 0x080000, CRC(5bfa32c8) SHA1(55fb2872695fcfbad13f5c0723302e72da69e44a) )
1262   ROM_LOAD16_BYTE( "tet2-1v2.2", 0x000001, 0x080000, CRC(919116d0) SHA1(3e1c0fd4c9175b2900a4717fbb9e8b591c5f534d) )
1263
1264   ROM_REGION( 0x800000, REGION_GFX1, ROMREGION_DISPOSE )   /* 8x8x8 (Sprites) */
1265   ROM_LOAD32_WORD( "96019-01.9", 0x000000, 0x400000, CRC(06f7dc64) SHA1(722c51b707b9854c0293afdff18b27ec7cae6719) )
1266   ROM_LOAD32_WORD( "96019-02.8", 0x000002, 0x400000, CRC(3e613bed) SHA1(038b5e43fa3d69654107c8093126eeb2e8fa4ddc) )
1267
1268   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE )   /* 16x16x8 (Background) */
1269   ROM_LOAD( "96019-06.13", 0x000000, 0x400000, CRC(16f7093c) SHA1(2be77c6a692c5d762f5553ae24e8c415ab194cc6) )
1270
1271   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )   /* 16x16x8 (Rotation) */
1272   ROM_LOAD( "96019-04.6",  0x000000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) )
1273
1274   ROM_REGION( 0x080000, REGION_GFX4, ROMREGION_DISPOSE )   /* 8x8x8 (Foreground) */
1275   ROM_LOAD( "tetp2-10.bin", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) )   // 11111xxxxxxxxxxxxxx = 0xFF
1276
1277   ROM_REGION( 0x400000, REGION_SOUND1, 0 )   /* Samples */
1278   ROM_LOAD( "96019-07.7", 0x000000, 0x400000, CRC(a8a61954) SHA1(86c3db10b348ba1f44ff696877b8b20845fa53de) )
12831279ROM_END
12841280
1285
12861281/***************************************************************************
12871282
1288                            Tetris Plus 2 (Japan)
1283                            Rock'n Tread 1 (Japan)
1284                            Rock'n Tread 2 (Japan)
1285                            Rock'n MegaSession (Japan)
1286                            Rock'n 3 (Japan)
1287                            Rock'n 4 (Japan)
12891288
1290(c)1997 Jaleco / The Tetris Company
1289(c)1999-2000 Jaleco
12911290
1292TP-97222
129396019 EB-00-20117-0
1291Main board marked in copper and silk screen:
12941292
1295CPU:    68000-12
1296Sound:  YMZ280B-F
1297OSC:    12.000MHz
1293    JALECO VJ-98344
1294    98053 EB-00-20120-0
1295    MADE IN JAPAN
1296
1297CPU:    TMP68HC000P-12
1298Sound:  YMZ280B-F / YAC516-M (on sound rom board)
1299OSC:    12.0000MHz (next to 68000)
12981300        48.0000MHz
1299        16.9344MHz
1301        16.9344MHz (on sound rom board)
1302DIPS:   Two 8-way dipswitches
1303BAT:    CR-2032
13001304
13011305Custom: SS91022-03
13021306        GS91022-04
13031307        GS91022-05
13041308        SS91022-05
13051309
1306***************************************************************************/
1310Other:  Sigma XILINX XCS30
1311        Sigma XILINX XC9536 (socketted and stamped SL4)
13071312
1308ROM_START( teplus2j )
13091313
1310   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
1311   ROM_LOAD16_BYTE( "tet2-4v2.2", 0x000000, 0x080000, CRC(5bfa32c8) SHA1(55fb2872695fcfbad13f5c0723302e72da69e44a) )   // v2.2
1312   ROM_LOAD16_BYTE( "tet2-1v2.2", 0x000001, 0x080000, CRC(919116d0) SHA1(3e1c0fd4c9175b2900a4717fbb9e8b591c5f534d) )
1314PCB Layout for sound rom board (from Rock'n 3):
13131315
1314   ROM_REGION( 0x800000, REGION_GFX1, ROMREGION_DISPOSE )   /* 8x8x8 (Sprites) */
1315   ROM_LOAD32_WORD( "96019-01.9", 0x000000, 0x400000, CRC(06f7dc64) SHA1(722c51b707b9854c0293afdff18b27ec7cae6719) )
1316   ROM_LOAD32_WORD( "96019-02.8", 0x000002, 0x400000, CRC(3e613bed) SHA1(038b5e43fa3d69654107c8093126eeb2e8fa4ddc) )
1316JALECO 99004 SL-99352 EB-00-20128-0
1317+------------------------------------------------------+
1318|                                                      |
1319| mr99029-02 mr99029-10 mr99029-18 mr99029-01  IC36*   |
1320| mr99029-03 mr99029-11 mr99029-19  IC29*      IC37*   |
1321| mr99029-04 mr99029-12 mr99029-20                     |
1322| mr99029-05 mr99029-13 mr99029-21                     |
1323| mr99029-06 mr99029-14  IC23*        YMZ280B-F        |
1324| mr99029-07 mr99029-15  IC24*      16.9344MHz         |
1325| mr99029-08 mr99029-16  IC25*        XC9572           |
1326| mr99029-09 mr99029-17  IC26*                         |
1327|                       YAC516-M                       |
1328|   CN1        CN2                       CN4           |
1329+-||||||||---||||||||----------------------------------+
13171330
1318   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE )   /* 16x16x8 (Background) */
1319   ROM_LOAD( "96019-06.13", 0x000000, 0x400000, CRC(16f7093c) SHA1(2be77c6a692c5d762f5553ae24e8c415ab194cc6) )
1331Notes:
1332  All chip sockets are marked as 27C3200 (read as 27C322)
1333  Chips are OKI M72C3252C2 mounted on Jaleco PCB EB-00-40051-0 42 pin converters
13201334
1321   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )   /* 16x16x8 (Rotation) */
1322   ROM_LOAD( "96019-04.6",  0x000000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) )
1335* Unpopulated sockets
13231336
1324   ROM_REGION( 0x080000, REGION_GFX4, ROMREGION_DISPOSE )   /* 8x8x8 (Foreground) */
1325   ROM_LOAD( "tetp2-10.bin", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) )   // 11111xxxxxxxxxxxxxx = 0xFF
1337Sound chips: Yamaha YMZ280B-F & Yamaha YAC516-M
1338 Other chip: Sigma XILINX XC9572
1339        OSC: 16.9344MHz
13261340
1327   ROM_REGION( 0x400000, REGION_SOUND1, 0 )   /* Samples */
1328   ROM_LOAD( "96019-07.7", 0x000000, 0x400000, CRC(a8a61954) SHA1(86c3db10b348ba1f44ff696877b8b20845fa53de) )
1341  CN1 - 8 pin header
1342  CN2 - 8 pin header
1343  CN4 - 34 pin dual row ribbon connection
13291344
1330ROM_END
1345***************************************************************************/
13311346
1332/***
1347/***  Rock 'n' Tread  ***/
13331348
1334Rock 'n' Tread
1335
1336***/
13371349ROM_START( rockn )
1338
13391350   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
1340   ROM_LOAD16_BYTE( "98344_1.bin", 0x000001, 0x80000, CRC(4cf79e58) SHA1(f50e596d43c9ab2072ae0476169eee2a8512fd8d) )
1341   ROM_LOAD16_BYTE( "98344_4.bin", 0x000000, 0x80000, CRC(caa33f79) SHA1(8ccff67091dac5ad871cae6cdb31e1fc37c1a4c2) )
1351   ROM_LOAD16_BYTE( "rock_n_1_vj-98344_1.bin", 0x000001, 0x80000, CRC(4cf79e58) SHA1(f50e596d43c9ab2072ae0476169eee2a8512fd8d) )
1352   ROM_LOAD16_BYTE( "rock_n_1_vj-98344_4.bin", 0x000000, 0x80000, CRC(caa33f79) SHA1(8ccff67091dac5ad871cae6cdb31e1fc37c1a4c2) )
13421353
13431354   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )   /* 8x8x8 (Sprites) */
1344   ROM_LOAD32_WORD( "98344_8.bin", 0x000002, 0x200000, CRC(fa3f6f9c) SHA1(586dcc690a1a4aa7c97932ad496382def6a074a4) )
1345   ROM_LOAD32_WORD( "98344_9.bin", 0x000000, 0x200000, CRC(3d12a688) SHA1(356b2ea81d960838b604c5a17cc77e79fb0e40ce) )
1355   ROM_LOAD32_WORD( "rock_n_1_vj-98344_8.bin", 0x000002, 0x200000, CRC(fa3f6f9c) SHA1(586dcc690a1a4aa7c97932ad496382def6a074a4) )
1356   ROM_LOAD32_WORD( "rock_n_1_vj-98344_9.bin", 0x000000, 0x200000, CRC(3d12a688) SHA1(356b2ea81d960838b604c5a17cc77e79fb0e40ce) )
13461357
13471358   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )   /* 16x16x8 (Background) */
1348   ROM_LOAD16_WORD( "98344_13.bin", 0x000000, 0x200000, CRC(261b99a0) SHA1(7b3c768ae9d7429e2559fe32c1a4ff220d727e7e) )
1359   ROM_LOAD16_WORD( "rock_n_1_vj-98344_13.bin", 0x000000, 0x200000, CRC(261b99a0) SHA1(7b3c768ae9d7429e2559fe32c1a4ff220d727e7e) )
13491360
13501361   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )   /* 16x16x8 (Rotation) */
1351   ROM_LOAD( "98344_6.bin", 0x000000, 0x100000, CRC(5551717f) SHA1(64943a9a68ad4074f3f5128d7796e4f03baa14d5) )
1362   ROM_LOAD( "rock_n_1_vj-98344_6.bin", 0x000000, 0x100000, CRC(5551717f) SHA1(64943a9a68ad4074f3f5128d7796e4f03baa14d5) )
13521363
13531364   ROM_REGION( 0x080000, REGION_GFX4, ROMREGION_DISPOSE )   /* 8x8x8 (Foreground) */
1354   ROM_LOAD( "98344_10.bin", 0x000000, 0x080000, CRC(918663a8) SHA1(aedacb741c986ef8159385cfef866cb7e3ef6cb6) )
1365   ROM_LOAD( "rock_n_1_vj-98344_10.bin", 0x000000, 0x080000, CRC(918663a8) SHA1(aedacb741c986ef8159385cfef866cb7e3ef6cb6) )
13551366
13561367   /* from the bootleg set, are they right for this? */
13571368   ROM_REGION( 0x7000000, REGION_SOUND1, 0 )   /* Samples */
r1649r1650
13731384   ROM_LOAD( "sound14", 0x4400000, 0x0400000, CRC(b26f9a81) SHA1(0d1c8e382eb5877f9a748ff289be97cbdb73b0cc)  ) // bank 4
13741385ROM_END
13751386
1376/***************************************************************************
1377
1378                            Rock'n Tread 1 (Japan)
1379                            Rock'n Tread 2 (Japan)
1380                            Rock'n MegaSession (Japan)
1381                            Rock'n 3 (Japan)
1382                            Rock'n 4 (Japan)
1383
1384(c)1997 Jaleco
1385
1386CPU:    68000-12
1387Sound:  YMZ280B-F
1388OSC:    12.000MHz
1389        48.0000MHz
1390        16.9344MHz
1391
1392Custom: SS91022-03
1393        GS91022-04
1394        GS91022-05
1395        SS91022-05
1396
1397***************************************************************************/
1398
13991387ROM_START( rockna )
14001388   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
1401   ROM_LOAD16_BYTE( "prg1", 0x000001, 0x80000, CRC(6078fa48) SHA1(e98c1a1abf026f2d5b5035ccbc9d412a08ca1f02) )
1402   ROM_LOAD16_BYTE( "prg0", 0x000000, 0x80000, CRC(c8310bd0) SHA1(1efee954cc94b668b7d9f28a099b8d1c83d3093f) )
1389   ROM_LOAD16_BYTE( "rock_n_1_vj-98344_1", 0x000001, 0x80000, CRC(6078fa48) SHA1(e98c1a1abf026f2d5b5035ccbc9d412a08ca1f02) )
1390   ROM_LOAD16_BYTE( "rock_n_1_vj-98344_4", 0x000000, 0x80000, CRC(c8310bd0) SHA1(1efee954cc94b668b7d9f28a099b8d1c83d3093f) )
14031391
14041392   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )   /* 8x8x8 (Sprites) */
1405   ROM_LOAD32_WORD( "98344_8.bin", 0x000002, 0x200000, CRC(fa3f6f9c) SHA1(586dcc690a1a4aa7c97932ad496382def6a074a4) )
1406   ROM_LOAD32_WORD( "98344_9.bin", 0x000000, 0x200000, CRC(3d12a688) SHA1(356b2ea81d960838b604c5a17cc77e79fb0e40ce) )
1393   ROM_LOAD32_WORD( "rock_n_1_vj-98344_8.bin", 0x000002, 0x200000, CRC(fa3f6f9c) SHA1(586dcc690a1a4aa7c97932ad496382def6a074a4) )
1394   ROM_LOAD32_WORD( "rock_n_1_vj-98344_9.bin", 0x000000, 0x200000, CRC(3d12a688) SHA1(356b2ea81d960838b604c5a17cc77e79fb0e40ce) )
14071395
14081396   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )   /* 16x16x8 (Background) */
1409   ROM_LOAD16_WORD( "98344_13.bin", 0x000000, 0x200000, CRC(261b99a0) SHA1(7b3c768ae9d7429e2559fe32c1a4ff220d727e7e) )
1397   ROM_LOAD16_WORD( "rock_n_1_vj-98344_13.bin", 0x000000, 0x200000, CRC(261b99a0) SHA1(7b3c768ae9d7429e2559fe32c1a4ff220d727e7e) )
14101398
14111399   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )   /* 16x16x8 (Rotation) */
1412   ROM_LOAD( "98344_6.bin", 0x000000, 0x100000, CRC(5551717f) SHA1(64943a9a68ad4074f3f5128d7796e4f03baa14d5) )
1400   ROM_LOAD( "rock_n_1_vj-98344_6.bin", 0x000000, 0x100000, CRC(5551717f) SHA1(64943a9a68ad4074f3f5128d7796e4f03baa14d5) )
14131401
14141402   ROM_REGION( 0x080000, REGION_GFX4, ROMREGION_DISPOSE )   /* 8x8x8 (Foreground) */
1415   ROM_LOAD( "98344_10.bin", 0x000000, 0x080000, CRC(918663a8) SHA1(aedacb741c986ef8159385cfef866cb7e3ef6cb6) )
1403   ROM_LOAD( "rock_n_1_vj-98344_10.bin", 0x000000, 0x080000, CRC(918663a8) SHA1(aedacb741c986ef8159385cfef866cb7e3ef6cb6) )
14161404
14171405   ROM_REGION( 0x7000000, REGION_SOUND1, 0 )   /* Samples */
14181406   ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(c354f753) SHA1(bf538c02e2162a93d8c6793a1211e21480156223)  ) // COMMON AREA
r1649r1650
14311419   ROM_LOAD( "sound12", 0x3c00000, 0x0400000, CRC(aae8d59c) SHA1(ccca1f511ce0ea8d452f3b1d24350b5cee402ad2)  ) // bank 3
14321420   ROM_LOAD( "sound13", 0x4000000, 0x0400000, CRC(9ec1459b) SHA1(10e08a47636dec431cdb8e105cf61287fe9c6637)  ) // bank 4
14331421   ROM_LOAD( "sound14", 0x4400000, 0x0400000, CRC(b26f9a81) SHA1(0d1c8e382eb5877f9a748ff289be97cbdb73b0cc)  ) // bank 4
1434
14351422ROM_END
14361423
1437
14381424ROM_START( rockn2 )
14391425   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
1440   ROM_LOAD16_BYTE( "prg1", 0x000001, 0x80000, CRC(854b5a45) SHA1(91496bc511fef1d552d2bd00b82d2470eae94528) )
1441   ROM_LOAD16_BYTE( "prg0", 0x000000, 0x80000, CRC(4665bbd2) SHA1(3562c67b81a32d178a8bcb872e676bf7284855d7) )
1426   ROM_LOAD16_BYTE( "rock_n_2_vj-98344_1_v1.0", 0x000001, 0x80000, CRC(854b5a45) SHA1(91496bc511fef1d552d2bd00b82d2470eae94528) )
1427   ROM_LOAD16_BYTE( "rock_n_2_vj-98344_4_v1.0", 0x000000, 0x80000, CRC(4665bbd2) SHA1(3562c67b81a32d178a8bcb872e676bf7284855d7) )
14421428
14431429   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )   /* 8x8x8 (Sprites) */
1444   ROM_LOAD32_WORD( "spr1", 0x000002, 0x200000, CRC(673ce2c2) SHA1(6c0a13de386b02a7f3a86e8128374938ede2525c) )
1445   ROM_LOAD32_WORD( "spr0", 0x000000, 0x200000, CRC(9d3968cf) SHA1(11c96e7685ab8c1b416396238ec5c12e7819385f) )
1430   ROM_LOAD32_WORD( "rock_n_2_vj-98344_8_v1.0", 0x000002, 0x200000, CRC(673ce2c2) SHA1(6c0a13de386b02a7f3a86e8128374938ede2525c) )
1431   ROM_LOAD32_WORD( "rock_n_2_vj-98344_9_v1.0", 0x000000, 0x200000, CRC(9d3968cf) SHA1(11c96e7685ab8c1b416396238ec5c12e7819385f) )
14461432
14471433   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )   /* 16x16x8 (Background) */
1448   ROM_LOAD16_WORD( "back", 0x000000, 0x200000, CRC(e35c55b3) SHA1(a18367c28befc3f71823f1d4ab2126ad6f8a28fc)  )
1434   ROM_LOAD16_WORD( "rock_n_2_vj-98344_13_v1.0", 0x000000, 0x200000, CRC(e35c55b3) SHA1(a18367c28befc3f71823f1d4ab2126ad6f8a28fc)  )
14491435
14501436   ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE )   /* 16x16x8 (Rotation) */
1451   ROM_LOAD( "rot", 0x000000, 0x200000, CRC(241d7449) SHA1(9fcc2d128d7be273836460313c0e73c81e33c9cb)  )
1437   ROM_LOAD( "rock_n_2_vj-98344_6_v1.0", 0x000000, 0x200000, CRC(241d7449) SHA1(9fcc2d128d7be273836460313c0e73c81e33c9cb)  )
14521438
14531439   ROM_REGION( 0x080000, REGION_GFX4, ROMREGION_DISPOSE )   /* 8x8x8 (Foreground) */
1454   ROM_LOAD( "front", 0x000000, 0x080000, CRC(ae74d5b3) SHA1(07aa6ee540a783e3f2a8710a7095d922cff1d443)  )
1440   ROM_LOAD( "rock_n_2_vj-98344_10_v1.0", 0x000000, 0x080000, CRC(ae74d5b3) SHA1(07aa6ee540a783e3f2a8710a7095d922cff1d443)  )
14551441
14561442   ROM_REGION( 0x7000000, REGION_SOUND1, 0 )   /* Samples */
14571443   ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(4e9611a3) SHA1(2a9b1d5afc0ea9a3285f9fc6b49a1c3abd8cd2a5)  ) // COMMON AREA
1458   ROM_FILL(              0x0400000, 0x0c00000, 0xff )         // BANK AREA
1444   ROM_FILL(            0x0400000, 0x0c00000, 0xff )      // BANK AREA
14591445   ROM_LOAD( "sound01", 0x1000000, 0x0400000, CRC(ec600f13) SHA1(151cb0a16782c8bba223d0f6881b80c1e43bc9bc)  ) // bank 0
14601446   ROM_LOAD( "sound02", 0x1400000, 0x0400000, CRC(8306f302) SHA1(8c0437d7ab8d74d4d15f4a641d30602e39cdd99d)  ) // bank 0
14611447   ROM_LOAD( "sound03", 0x1800000, 0x0400000, CRC(3fda842c) SHA1(2b9e7c548b689bab491237e36a2dcf4782a81d79)  ) // bank 0
r1649r1650
14771463   ROM_LOAD( "sound19", 0x5800000, 0x0400000, CRC(33c89e53) SHA1(7d216f5db6b30c9b05a9a77030498ff68ae6fbad)  ) // bank 6
14781464   ROM_LOAD( "sound20", 0x5c00000, 0x0400000, CRC(89c1b088) SHA1(9b4118815959a5fb65b2a293015f592a46f4126f)  ) // bank 6
14791465   ROM_LOAD( "sound21", 0x6000000, 0x0400000, CRC(13db74bd) SHA1(ab87438bbac97d46b1b8195b61dca1d72172a621)  ) // bank 6
1480
1466//  ROM_LOAD( "sound22", 0x6400000, 0x0400000 ) // bank 7 ( ** unpopulated **  -  IC24)
1467//  ROM_LOAD( "sound23", 0x6800000, 0x0400000 ) // bank 7 ( ** unpopulated **  -  IC25)
1468//  ROM_LOAD( "sound24", 0x6c00000, 0x0400000 ) // bank 7 ( ** unpopulated **  -  IC26)
14811469ROM_END
14821470
1471/***************************************************************************
14831472
1473Jaleco Rock'n 3
1474
1475Labeled on the chips like:
1476
1477    Rock'n 3
1478    VJ-98344
1479    10
1480    Ver 1.0
1481
1482
1483ROM ID       Label                    Rom type
1484----------------------------------------------
1485IC19    Rock'n 3 VJ-98344 10 Ver 1.0    27C040
1486IC59    Rock'n 3 VJ-98344 4  Ver 1.0    27C040
1487IC65    Rock'n 3 VJ-98344 1  Ver 1.0    27C040
1488
1489IC10    Rock'n 3 VJ-98344 13 Ver 1.0    27C160
1490IC33    Rock'n 3 VJ-98344 9  Ver 1.0    27C160
1491IC32    Rock'n 3 VJ-98344 8  Ver 1.0    27C160
1492IC38    Rock'n 3 VJ-98344 6  Ver 1.0    27C160
1493
1494IC57    PS96019-01              ICT 18CV8P PAL
1495IC14    PS96019-02              ICT 18CV8P PAL
1496IC58    PS96019-04              ICT 18CV8P PAL
1497
1498IC43   (no label) XILINX 17S30PC  Serial Config rom
1499
1500***************************************************************************/
1501
14841502ROM_START( rockn3 )
14851503   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
1486   ROM_LOAD16_BYTE( "prg1", 0x000001, 0x80000, CRC(abc6ab4a) SHA1(2f1983b95cd9e42d709edac5613b1f0b450df4ba) )
1487   ROM_LOAD16_BYTE( "prg0", 0x000000, 0x80000, CRC(3ecba46e) SHA1(64ff5b7932a8d8dc01c649b9dcc1d55cf1e43387) )
1504   ROM_LOAD16_BYTE( "rock_n_3_vj-98344_1_v1.0", 0x000001, 0x80000, CRC(abc6ab4a) SHA1(2f1983b95cd9e42d709edac5613b1f0b450df4ba) ) /* IC65 (alt PCB number 1) */
1505   ROM_LOAD16_BYTE( "rock_n_3_vj-98344_4_v1.0", 0x000000, 0x80000, CRC(3ecba46e) SHA1(64ff5b7932a8d8dc01c649b9dcc1d55cf1e43387) ) /* IC59 (alt PCB number 4) */
14881506
14891507   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )   /* 8x8x8 (Sprites) */
1490   ROM_LOAD32_WORD( "spr1", 0x000002, 0x200000, CRC(468bf696) SHA1(d58e399ff876ab0f4ef52aaa85d86d72db307b6a) )
1491   ROM_LOAD32_WORD( "spr0", 0x000000, 0x200000, CRC(8a61fc18) SHA1(4e895a2014e711d044ed5d8bff8a91766f14b307) )
1508   ROM_LOAD32_WORD( "rock_n_3_vj-98344_8_v1.0", 0x000002, 0x200000, CRC(468bf696) SHA1(d58e399ff876ab0f4ef52aaa85d86d72db307b6a) ) /* IC32 (alt PCB number 8) */
1509   ROM_LOAD32_WORD( "rock_n_3_vj-98344_9_v1.0", 0x000000, 0x200000, CRC(8a61fc18) SHA1(4e895a2014e711d044ed5d8bff8a91766f14b307) ) /* IC33 (alt PCB number 9) */
14921510
14931511   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )   /* 16x16x8 (Background) */
1494   ROM_LOAD16_WORD( "back", 0x000000, 0x200000, CRC(e01bf471) SHA1(4485c71770bdb8800ded4afb37814c2d287b78be)  )
1512   ROM_LOAD16_WORD( "rock_n_3_vj-98344_13_v1.0", 0x000000, 0x200000, CRC(e01bf471) SHA1(4485c71770bdb8800ded4afb37814c2d287b78be)  ) /* IC10 (alt PCB number 13) */
14951513
14961514   ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE )   /* 16x16x8 (Rotation) */
1497   ROM_LOAD( "rot", 0x000000, 0x200000, CRC(4e146de5) SHA1(5971cbb91da5fde652786d82d0143197518bad9b)  )
1515   ROM_LOAD( "rock_n_3_vj-98344_6_v1.0", 0x000000, 0x200000, CRC(4e146de5) SHA1(5971cbb91da5fde652786d82d0143197518bad9b)  ) /* IC38 (alt PCB number 6) */
14981516
14991517   ROM_REGION( 0x080000, REGION_GFX4, ROMREGION_DISPOSE )   /* 8x8x8 (Foreground) */
1500   ROM_LOAD( "front", 0x000000, 0x080000, CRC(8100039e) SHA1(e07b1e2f3cbcb1c086edd628d20423ecd4f74860)  )
1518   ROM_LOAD( "rock_n_3_vj-98344_10_v1.0", 0x000000, 0x080000, CRC(8100039e) SHA1(e07b1e2f3cbcb1c086edd628d20423ecd4f74860)  ) /* IC19 (alt PCB number 10) */
15011519
1502   ROM_REGION( 0x7000000, REGION_SOUND1, 0 )   /* Samples */
1503   ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(e2f69042) SHA1(deb361a53ed6a9033e21c2f805f327cc3e9b11c6)  ) // COMMON AREA
1504   ROM_FILL(                 0x0400000, 0x0c00000, 0xff )        // BANK AREA
1505   ROM_LOAD( "sound01", 0x1000000, 0x0400000, CRC(b328b18f) SHA1(22edebcabd6c8ed65d8c9e501621991d404c430d)  ) // bank 0
1506   ROM_LOAD( "sound02", 0x1400000, 0x0400000, CRC(f46438e3) SHA1(718f54fc0e3689f5ab29bef2ec13eb2aa9b117fc)  ) // bank 0
1507   ROM_LOAD( "sound03", 0x1800000, 0x0400000, CRC(b979e887) SHA1(10852ceb1b9e24fb87cf9339bc9fb4ae066a1221)  ) // bank 0
1508   ROM_LOAD( "sound04", 0x1c00000, 0x0400000, CRC(0bb2c212) SHA1(4f8ab3c96c3e1aa337a3fe871cffc04ec603f8c0)  ) // bank 1
1509   ROM_LOAD( "sound05", 0x2000000, 0x0400000, CRC(3116e437) SHA1(f1b06592a6f0eba92eb4511d3ca03a3bb51e8c9d)  ) // bank 1
1510   ROM_LOAD( "sound06", 0x2400000, 0x0400000, CRC(26b37ef6) SHA1(f7090f3ec81f0c651c53d460b476e63f52dd06dc)  ) // bank 1
1511   ROM_LOAD( "sound07", 0x2800000, 0x0400000, CRC(1dd3f4e3) SHA1(8474e00b962368164c717e5fe2e926852f3b4426)  ) // bank 2
1512   ROM_LOAD( "sound08", 0x2c00000, 0x0400000, CRC(a1b03d67) SHA1(95f89a37e97d62706e15fd5571ff2e70dd98fee2)  ) // bank 2
1513   ROM_LOAD( "sound09", 0x3000000, 0x0400000, CRC(35107aac) SHA1(d56a66e15c46c33cf6c9c28edf48b730b681d21a)  ) // bank 2
1514   ROM_LOAD( "sound10", 0x3400000, 0x0400000, CRC(059ec592) SHA1(205210af558eb7e8e1399b2a506ef0285c5feda3)  ) // bank 3
1515   ROM_LOAD( "sound11", 0x3800000, 0x0400000, CRC(84d4badb) SHA1(fc20f97a008f000a49e7cadd559789516643704a)  ) // bank 3
1516   ROM_LOAD( "sound12", 0x3c00000, 0x0400000, CRC(4527a9b7) SHA1(a73ebece5c84bf14f8d25bbd869b7b43b1fcd042)  ) // bank 3
1517   ROM_LOAD( "sound13", 0x4000000, 0x0400000, CRC(bfa4b7ce) SHA1(4100f2deabb8994e8e3ff897a1db13693ab64c11)  ) // bank 4
1518   ROM_LOAD( "sound14", 0x4400000, 0x0400000, CRC(a2ccd2ce) SHA1(fc6325219f7b8e68c22a129f5ec4e900e326fb9d)  ) // bank 4
1519   ROM_LOAD( "sound15", 0x4800000, 0x0400000, CRC(95baf678) SHA1(f7b39a3379f16df0560a22d4f42165ebbe05cebe)  ) // bank 4
1520   ROM_LOAD( "sound16", 0x4c00000, 0x0400000, CRC(5883c84b) SHA1(54aec4e1e2f5edc198aebc4788caf5062f9a5b6c)  ) // bank 5
1521   ROM_LOAD( "sound17", 0x5000000, 0x0400000, CRC(f92098ce) SHA1(9b13cd37ad5d7baf36b20218c4bced956084ec45)  ) // bank 5
1522   ROM_LOAD( "sound18", 0x5400000, 0x0400000, CRC(dbb2c228) SHA1(f7cd24026236e2c616376c695b9e986cc221f36d)  ) // bank 5
1523   ROM_LOAD( "sound19", 0x5800000, 0x0400000, CRC(9efdae1c) SHA1(6158a1804fbaa9ce27ae7e12cfda5f49084b4998)  ) // bank 6
1524   ROM_LOAD( "sound20", 0x5c00000, 0x0400000, CRC(5f301b83) SHA1(e24e85c43a62871360545aa42dfa439045334b79)  ) // bank 6
1525
1520   ROM_REGION( 0x7000000, REGION_SOUND1, 0 )   /* Samples - On seperate ROM board with YMZ280B-F sound chip */
1521   ROM_LOAD( "mr99029-01.ic28", 0x0000000, 0x0400000, CRC(e2f69042) SHA1(deb361a53ed6a9033e21c2f805f327cc3e9b11c6)  ) // COMMON AREA  (alt PCB number 25)
1522   ROM_FILL(                    0x0400000, 0x0c00000, 0xff )      // BANK AREA (unpopulated IC29, IC36 & IC37 (alt PCB numbers 26, 27 & 28 repectively)
1523   ROM_LOAD( "mr99029-02.ic1",  0x1000000, 0x0400000, CRC(b328b18f) SHA1(22edebcabd6c8ed65d8c9e501621991d404c430d)  ) // bank 0 (alt PCB number 1)
1524   ROM_LOAD( "mr99029-03.ic2",  0x1400000, 0x0400000, CRC(f46438e3) SHA1(718f54fc0e3689f5ab29bef2ec13eb2aa9b117fc)  ) // bank 0 (alt PCB number 2)
1525   ROM_LOAD( "mr99029-04.ic3",  0x1800000, 0x0400000, CRC(b979e887) SHA1(10852ceb1b9e24fb87cf9339bc9fb4ae066a1221)  ) // bank 0 (alt PCB number 3)
1526   ROM_LOAD( "mr99029-05.ic4",  0x1c00000, 0x0400000, CRC(0bb2c212) SHA1(4f8ab3c96c3e1aa337a3fe871cffc04ec603f8c0)  ) // bank 1 (alt PCB number 4)
1527   ROM_LOAD( "mr99029-06.ic5",  0x2000000, 0x0400000, CRC(3116e437) SHA1(f1b06592a6f0eba92eb4511d3ca03a3bb51e8c9d)  ) // bank 1 (alt PCB number 5)
1528   ROM_LOAD( "mr99029-07.ic6",  0x2400000, 0x0400000, CRC(26b37ef6) SHA1(f7090f3ec81f0c651c53d460b476e63f52dd06dc)  ) // bank 1 (alt PCB number 6)
1529   ROM_LOAD( "mr99029-08.ic7",  0x2800000, 0x0400000, CRC(1dd3f4e3) SHA1(8474e00b962368164c717e5fe2e926852f3b4426)  ) // bank 2 (alt PCB number 7)
1530   ROM_LOAD( "mr99029-09.ic8",  0x2c00000, 0x0400000, CRC(a1b03d67) SHA1(95f89a37e97d62706e15fd5571ff2e70dd98fee2)  ) // bank 2 (alt PCB number 8)
1531   ROM_LOAD( "mr99029-10.ic10", 0x3000000, 0x0400000, CRC(35107aac) SHA1(d56a66e15c46c33cf6c9c28edf48b730b681d21a)  ) // bank 2 (alt PCB number 9)
1532   ROM_LOAD( "mr99029-11.ic11", 0x3400000, 0x0400000, CRC(059ec592) SHA1(205210af558eb7e8e1399b2a506ef0285c5feda3)  ) // bank 3 (alt PCB number 10)
1533   ROM_LOAD( "mr99029-12.ic12", 0x3800000, 0x0400000, CRC(84d4badb) SHA1(fc20f97a008f000a49e7cadd559789516643704a)  ) // bank 3 (alt PCB number 11)
1534   ROM_LOAD( "mr99029-13.ic13", 0x3c00000, 0x0400000, CRC(4527a9b7) SHA1(a73ebece5c84bf14f8d25bbd869b7b43b1fcd042)  ) // bank 3 (alt PCB number 12)
1535   ROM_LOAD( "mr99029-14.ic14", 0x4000000, 0x0400000, CRC(bfa4b7ce) SHA1(4100f2deabb8994e8e3ff897a1db13693ab64c11)  ) // bank 4 (alt PCB number 13)
1536   ROM_LOAD( "mr99029-15.ic15", 0x4400000, 0x0400000, CRC(a2ccd2ce) SHA1(fc6325219f7b8e68c22a129f5ec4e900e326fb9d)  ) // bank 4 (alt PCB number 14)
1537   ROM_LOAD( "mr99029-16.ic16", 0x4800000, 0x0400000, CRC(95baf678) SHA1(f7b39a3379f16df0560a22d4f42165ebbe05cebe)  ) // bank 4 (alt PCB number 15)
1538   ROM_LOAD( "mr99029-17.ic17", 0x4c00000, 0x0400000, CRC(5883c84b) SHA1(54aec4e1e2f5edc198aebc4788caf5062f9a5b6c)  ) // bank 5 (alt PCB number 16)
1539   ROM_LOAD( "mr99029-18.ic19", 0x5000000, 0x0400000, CRC(f92098ce) SHA1(9b13cd37ad5d7baf36b20218c4bced956084ec45)  ) // bank 5 (alt PCB number 17)
1540   ROM_LOAD( "mr99029-19.ic20", 0x5400000, 0x0400000, CRC(dbb2c228) SHA1(f7cd24026236e2c616376c695b9e986cc221f36d)  ) // bank 5 (alt PCB number 18)
1541   ROM_LOAD( "mr99029-20.ic21", 0x5800000, 0x0400000, CRC(9efdae1c) SHA1(6158a1804fbaa9ce27ae7e12cfda5f49084b4998)  ) // bank 6 (alt PCB number 19)
1542   ROM_LOAD( "mr99029-21.ic22", 0x5c00000, 0x0400000, CRC(5f301b83) SHA1(e24e85c43a62871360545aa42dfa439045334b79)  ) // bank 6 (alt PCB number 20)
1543//  ROM_LOAD( "ic23",            0x6000000, 0x0400000 ) // bank 6 ( ** unpopulated **  -  alt PCB number 21)
1544//  ROM_LOAD( "ic24",            0x6400000, 0x0400000 ) // bank 7 ( ** unpopulated **  -  alt PCB number 22)
1545//  ROM_LOAD( "ic25",            0x6800000, 0x0400000 ) // bank 7 ( ** unpopulated **  -  alt PCB number 23)
1546//  ROM_LOAD( "ic26",            0x6c00000, 0x0400000 ) // bank 7 ( ** unpopulated **  -  alt PCB number 24)
15261547ROM_END
15271548
1528
1529ROM_START( rockn4 )
1549ROM_START( rockn4 ) /* Prototype */
15301550   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
1531   ROM_LOAD16_BYTE( "prg1", 0x000001, 0x80000, CRC(c666caea) SHA1(57018de40d71fe214a6b5cc33c8ad5e88622d010) )
1532   ROM_LOAD16_BYTE( "prg0", 0x000000, 0x80000, CRC(cc94e557) SHA1(d38abed04239d9eecf1b1be7a9f765a1b7aa0d8d) )
1551   ROM_LOAD16_BYTE( "rock_n_4_vj-98344_1.bin", 0x000001, 0x80000, CRC(c666caea) SHA1(57018de40d71fe214a6b5cc33c8ad5e88622d010) )
1552   ROM_LOAD16_BYTE( "rock_n_4_vj-98344_4.bin", 0x000000, 0x80000, CRC(cc94e557) SHA1(d38abed04239d9eecf1b1be7a9f765a1b7aa0d8d) )
15331553
15341554   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )   /* 8x8x8 (Sprites) */
1535   ROM_LOAD32_WORD( "spr1", 0x000002, 0x200000, CRC(5eeae537) SHA1(6bb8c658a2985c3919f0590a0147eead995c01c9) )
1536   ROM_LOAD32_WORD( "spr0", 0x000000, 0x200000, CRC(3fedddc9) SHA1(4bd8f402ecf8e6255326927e825179fa6d300e73) )
1555   ROM_LOAD32_WORD( "rock_n_4_vj-98344_8.bin", 0x000002, 0x200000, CRC(5eeae537) SHA1(6bb8c658a2985c3919f0590a0147eead995c01c9) )
1556   ROM_LOAD32_WORD( "rock_n_4_vj-98344_9.bin", 0x000000, 0x200000, CRC(3fedddc9) SHA1(4bd8f402ecf8e6255326927e825179fa6d300e73) )
15371557
15381558   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )   /* 16x16x8 (Background) */
1539   ROM_LOAD16_WORD( "back", 0x000000, 0x200000, CRC(ead41e79) SHA1(9c24b1e52b6ed43d5b5a1caf48f2974b8fa61f4a)  )
1559   ROM_LOAD16_WORD( "rock_n_4_vj-98344_13.bin", 0x000000, 0x200000, CRC(ead41e79) SHA1(9c24b1e52b6ed43d5b5a1caf48f2974b8fa61f4a)  )
15401560
15411561   ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE )   /* 16x16x8 (Rotation) */
1542   ROM_LOAD( "rot", 0x000000, 0x200000, CRC(eb16fc67) SHA1(5be40f2c9a5693785268eafcfcf348f147533463)  )
1562   ROM_LOAD( "rock_n_4_vj-98344_6.bin", 0x000000, 0x200000, CRC(eb16fc67) SHA1(5be40f2c9a5693785268eafcfcf348f147533463)  )
15431563
15441564   ROM_REGION( 0x100000, REGION_GFX4, ROMREGION_DISPOSE )   /* 8x8x8 (Foreground) */
1545   ROM_LOAD( "front", 0x000000, 0x100000, CRC(37d50259) SHA1(fd02f98a981470c47889f0b2f813ce59373a4b42)  )
1565   ROM_LOAD( "rock_n_4_vj-98344_10.bin", 0x000000, 0x100000, CRC(37d50259) SHA1(fd02f98a981470c47889f0b2f813ce59373a4b42)  )
15461566
15471567   ROM_REGION( 0x7000000, REGION_SOUND1, 0 )   /* Samples */
15481568   ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(918ea8eb) SHA1(0cd82859634635b6ce49db36fb91ed3365a101eb)  ) // COMMON AREA
1549   ROM_FILL(              0x0400000, 0x0c00000, 0xff )         // BANK AREA
1569   ROM_FILL(            0x0400000, 0x0c00000, 0xff )         // BANK AREA
15501570   ROM_LOAD( "sound01", 0x1000000, 0x0400000, CRC(c548e51e) SHA1(4fe1e35c9ed4366dce98b4f4c00f94e202ef15dc)  ) // bank 0
15511571   ROM_LOAD( "sound02", 0x1400000, 0x0400000, CRC(ffda0253) SHA1(9b8ae98accc2f72a1cd881086f89e647e4904ad9)  ) // bank 0
15521572   ROM_LOAD( "sound03", 0x1800000, 0x0400000, CRC(1f813af5) SHA1(a72d842e39b9fc955a2fc6721673b34b1b591e4a)  ) // bank 0
r1649r1650
15581578   ROM_LOAD( "sound09", 0x3000000, 0x0400000, CRC(39fa512f) SHA1(d07426bc74492496756b67b8ded1b507726720c7)  ) // bank 2
15591579ROM_END
15601580
1561
15621581ROM_START( rocknms )
15631582   ROM_REGION( 0x100000, REGION_CPU1, 0 )      /* 68000 Code */
15641583   ROM_LOAD16_BYTE( "mast_prg1", 0x000001, 0x80000, CRC(c36674f8) SHA1(8aeb19fcd6f786c9d76a72abee4b607d29fb7d56) )
r1649r1650
16271646
16281647***************************************************************************/
16291648
1630GAME( 1997, tetrisp2, 0,        tetrisp2, tetrisp2, 0,       ROT0,   "Jaleco / The Tetris Company", "Tetris Plus 2 (World?)", GAME_SUPPORTS_SAVE )
1649GAME( 1997, tetrisp2, 0,        tetrisp2, tetrisp2, 0,       ROT0,   "Jaleco / The Tetris Company", "Tetris Plus 2 (World)", GAME_SUPPORTS_SAVE )
16311650GAME( 1997, teplus2j, tetrisp2, tetrisp2, teplus2j, 0,       ROT0,   "Jaleco / The Tetris Company", "Tetris Plus 2 (Japan)", GAME_SUPPORTS_SAVE )
16321651
16331652GAME( 1999, rockn,    0,        rockn,    rockn,   rockn,    ROT270, "Jaleco", "Rock'n Tread (Japan)", GAME_SUPPORTS_SAVE)
16341653GAME( 1999, rockna,   rockn,    rockn,    rockn,   rockn1,   ROT270, "Jaleco", "Rock'n Tread (Japan, alternate)", GAME_SUPPORTS_SAVE)
16351654GAME( 1999, rockn2,   0,        rockn2,   rockn,   rockn2,   ROT270, "Jaleco", "Rock'n Tread 2 (Japan)", GAME_SUPPORTS_SAVE)
1636GAME( 1999, rocknms,  0,        rocknms,  rocknms, rocknms,  ROT0, "Jaleco", "Rock'n MegaSession (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1655GAME( 1999, rocknms,  0,        rocknms,  rocknms, rocknms,  ROT0,   "Jaleco", "Rock'n MegaSession (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
16371656GAME( 1999, rockn3,   0,        rockn2,   rockn,   rockn3,   ROT270, "Jaleco", "Rock'n 3 (Japan)", GAME_SUPPORTS_SAVE)
16381657GAME( 2000, rockn4,   0,        rockn2,   rockn,   rockn3,   ROT270, "Jaleco (PCCWJ)", "Rock'n 4 (Japan, prototype)", GAME_SUPPORTS_SAVE)
src/mame/drivers/lastduel.c
r1649r1650
1717**************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021#include "sound/2203intf.h"
2122#include "sound/okim6295.h"
2223
src/mame/drivers/alpha68k.c
r1649r1650
174174***************************************************************************/
175175
176176#include "driver.h"
177#include "deprecat.h"
177178#include "cpu/z80/z80.h"
178179#include "sound/ay8910.h"
179180#include "sound/dac.h"
r1649r1650
20762077   MDRV_SCREEN_SIZE(32*8, 32*8)
20772078   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
20782079   MDRV_GFXDECODE(sstingry)
2079   MDRV_PALETTE_LENGTH(256)
2080   MDRV_PALETTE_LENGTH(256 + 1)
20802081//AT
2081   MDRV_COLORTABLE_LENGTH(256)
20822082   MDRV_PALETTE_INIT(kyros)
20832083//ZT
20842084   MDRV_VIDEO_UPDATE(sstingry)
r1649r1650
21272127   MDRV_SCREEN_SIZE(32*8, 32*8)
21282128   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
21292129   MDRV_GFXDECODE(kyros)
2130   MDRV_PALETTE_LENGTH(256)
2131   MDRV_COLORTABLE_LENGTH(256)
2130   MDRV_PALETTE_LENGTH(256 + 1)
21322131
21332132   MDRV_PALETTE_INIT(kyros)
21342133   MDRV_VIDEO_UPDATE(kyros)
r1649r1650
21752174   MDRV_SCREEN_SIZE(32*8, 32*8)
21762175   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
21772176   MDRV_GFXDECODE(jongbou)
2178   MDRV_PALETTE_LENGTH(256)
2179   MDRV_COLORTABLE_LENGTH(256)
2177   MDRV_PALETTE_LENGTH(256 + 1)
21802178
21812179   MDRV_PALETTE_INIT(kyros)
21822180   MDRV_VIDEO_UPDATE(kyros)
r1649r1650
22102208   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
22112209   MDRV_GFXDECODE(paddle)
22122210//AT
2213   MDRV_PALETTE_LENGTH(256)
2214   MDRV_COLORTABLE_LENGTH(1024)
2211   MDRV_PALETTE_LENGTH(1024)
22152212   MDRV_PALETTE_INIT(paddlem)
22162213//ZT
22172214   MDRV_VIDEO_UPDATE(alpha68k_I)
r1649r1650
24282425   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
24292426   MDRV_GFXDECODE(tnexspce)
24302427
2431   MDRV_PALETTE_LENGTH(256)
2432   MDRV_COLORTABLE_LENGTH(1024)
2428   MDRV_PALETTE_LENGTH(1024)
24332429   MDRV_PALETTE_INIT(paddlem)
24342430   MDRV_VIDEO_UPDATE(alpha68k_I)
24352431
src/mame/drivers/lucky8.c
r1649r1650
3131
3232static PALETTE_INIT( lucky8 )
3333{
34   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
35
3634   int i;
3735
3836   for (i = 0; i < machine->drv->total_colors; i++)
3937   {
4038      int bit0, bit1, bit2, r, g, b;
4139
42      // red component
40      UINT8 pen = color_prom[0x20 + i] & 0x0f;
4341
44      bit0 = (*color_prom >> 0) & 0x01;
45      bit1 = (*color_prom >> 1) & 0x01;
46      bit2 = (*color_prom >> 2) & 0x01;
47
42      /* red component */
43      bit0 = (color_prom[pen] >> 0) & 0x01;
44      bit1 = (color_prom[pen] >> 1) & 0x01;
45      bit2 = (color_prom[pen] >> 2) & 0x01;
4846      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
4947
50      // green component
48      /* green component */
49      bit0 = (color_prom[pen] >> 3) & 0x01;
50      bit1 = (color_prom[pen] >> 4) & 0x01;
51      bit2 = (color_prom[pen] >> 5) & 0x01;
5152
52      bit0 = (*color_prom >> 3) & 0x01;
53      bit1 = (*color_prom >> 4) & 0x01;
54      bit2 = (*color_prom >> 5) & 0x01;
55
5653      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
5754
58      // blue component
59
55      /* blue component */
6056      bit0 = 0;
61      bit1 = (*color_prom >> 6) & 0x01;
62      bit2 = (*color_prom >> 7) & 0x01;
63
57      bit1 = (color_prom[pen] >> 6) & 0x01;
58      bit2 = (color_prom[pen] >> 7) & 0x01;
6459      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
6560
6661      palette_set_color(machine, i, MAKE_RGB(r, g, b));
67
68      color_prom++;
6962   }
70
71   for (i = 0; i < 0x100; i++)
72   {
73      COLOR(0, i) = (*color_prom) & 0x0f;
74      color_prom++;
75   }
7663}
7764
7865static WRITE8_HANDLER( lucky8_videoram_w )
r1649r1650
381368   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
382369
383370   MDRV_GFXDECODE(lucky8)
384   MDRV_PALETTE_LENGTH(32)
385   MDRV_COLORTABLE_LENGTH(256)
371   MDRV_PALETTE_LENGTH(256)
386372
387373   MDRV_PALETTE_INIT(lucky8)
388374   MDRV_VIDEO_START(lucky8)
src/mame/drivers/boxer.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213
1314extern UINT8* boxer_tile_ram;
1415extern UINT8* boxer_sprite_ram;
src/mame/drivers/starfire.c
r1649r1650
4949
5050
5151
52UINT8 *starfire_videoram;
53UINT8 *starfire_colorram;
54
5552static UINT8 fireone_select;
5653static read8_handler input_read;
5754
r1649r1650
5956
6057/*************************************
6158 *
62 *  Video updates
63 *
64 *************************************/
65
66#define SCANLINE_UPDATE_CHUNK   8
67
68static TIMER_CALLBACK( update_callback )
69{
70   int scanline = param;
71
72   /* update the previous chunk of scanlines */
73   starfire_video_update(scanline, SCANLINE_UPDATE_CHUNK);
74   scanline += SCANLINE_UPDATE_CHUNK;
75   if (scanline >= machine->screen[0].height)
76      scanline = 32;
77   timer_set(video_screen_get_time_until_pos(0, scanline + SCANLINE_UPDATE_CHUNK - 1, 0), NULL, scanline, update_callback);
78}
79
80
81static MACHINE_RESET( starfire )
82{
83   timer_set(video_screen_get_time_until_pos(0, 32 + SCANLINE_UPDATE_CHUNK - 1, 0), NULL, 32, update_callback);
84}
85
86
87
88/*************************************
89 *
9059 *  Scratch RAM, mapped into video RAM
9160 *
9261 *************************************/
r1649r1650
181150 *
182151 *************************************/
183152
184static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
185   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
186   AM_RANGE(0x8000, 0x9fff) AM_READ(starfire_scratch_r)
187   AM_RANGE(0xa000, 0xbfff) AM_READ(starfire_colorram_r)
188   AM_RANGE(0xc000, 0xffff) AM_READ(starfire_videoram_r)
153static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
154   AM_RANGE(0x0000, 0x7fff) AM_ROM
155   AM_RANGE(0x8000, 0x9fff) AM_READWRITE(starfire_scratch_r, starfire_scratch_w)
156   AM_RANGE(0xa000, 0xbfff) AM_READWRITE(MRA8_RAM, starfire_colorram_w) AM_BASE(&starfire_colorram)
157   AM_RANGE(0xc000, 0xffff) AM_READWRITE(starfire_videoram_r, starfire_videoram_w) AM_BASE(&starfire_videoram)
189158ADDRESS_MAP_END
190159
191static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
192   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
193   AM_RANGE(0x8000, 0x9fff) AM_WRITE(starfire_scratch_w)
194   AM_RANGE(0xa000, 0xbfff) AM_WRITE(starfire_colorram_w) AM_BASE(&starfire_colorram)
195   AM_RANGE(0xc000, 0xffff) AM_WRITE(starfire_videoram_w) AM_BASE(&starfire_videoram)
196ADDRESS_MAP_END
197160
198161
199
200162/*************************************
201163 *
202164 *  Port definitions
r1649r1650
302264
303265   /* basic machine hardware */
304266   MDRV_CPU_ADD(Z80, STARFIRE_CPU_CLOCK)
305   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
267   MDRV_CPU_PROGRAM_MAP(main_map,0)
306268   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
307269
308   MDRV_MACHINE_RESET(starfire)
309
310270   /* video hardware */
311271   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
312   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
272   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
313273   MDRV_SCREEN_RAW_PARAMS(STARFIRE_PIXEL_CLOCK, STARFIRE_HTOTAL, STARFIRE_HBEND, STARFIRE_HBSTART, STARFIRE_VTOTAL, STARFIRE_VBEND, STARFIRE_VBSTART)
314   MDRV_PALETTE_LENGTH(64)
315274
316275   MDRV_VIDEO_START(starfire)
317276   MDRV_VIDEO_UPDATE(starfire)
318277
319   /* sound hardware */
278   /* audio hardware */
320279MACHINE_DRIVER_END
321280
322281
r1649r1650
406365static DRIVER_INIT( fireone )
407366{
408367   input_read = fireone_input_r;
368
369   /* register for state saving */
370   state_save_register_global(fireone_select);
409371}
410372
411373
r1649r1650
416378 *
417379 *************************************/
418380
419GAME( 1979, starfire, 0,        starfire, starfire, starfire, ROT0, "Exidy", "Star Fire (set 1)", GAME_NO_SOUND )
420GAME( 1979, starfira, starfire, starfire, starfire, starfire, ROT0, "Exidy", "Star Fire (set 2)", GAME_NO_SOUND )
421GAME( 1979, fireone,  0,        starfire, fireone,  fireone,  ROT0, "Exidy", "Fire One", GAME_NO_SOUND )
422GAME( 1979, starfir2, 0,        starfire, starfire, starfire, ROT0, "Exidy", "Star Fire 2", GAME_NO_SOUND )
381GAME( 1979, starfire, 0,        starfire, starfire, starfire, ROT0, "Exidy", "Star Fire (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
382GAME( 1979, starfira, starfire, starfire, starfire, starfire, ROT0, "Exidy", "Star Fire (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
383GAME( 1979, fireone,  0,        starfire, fireone,  fireone,  ROT0, "Exidy", "Fire One", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
384GAME( 1979, starfir2, 0,        starfire, starfire, starfire, ROT0, "Exidy", "Star Fire 2", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/tmaster.c
r1649r1650
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829#include "sound/okim6295.h"
2930
3031/***************************************************************************
r1649r1650
141142static VIDEO_UPDATE( tmaster )
142143{
143144   // double buffering
144   copybitmap(bitmap,tmaster_bitmap[(tmaster_regs[0x02/2]>>8)&1],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
145   copybitmap(bitmap,tmaster_bitmap[(tmaster_regs[0x02/2]>>8)&1],0,0,0,0,cliprect);
145146
146147   show_touchscreen();
147148   return 0;
src/mame/drivers/cischeat.c
r1649r1650
162162***************************************************************************/
163163
164164#include "driver.h"
165#include "deprecat.h"
165166#include "megasys1.h"
166167#include "sound/2151intf.h"
167168#include "sound/okim6295.h"
src/mame/drivers/namcos22.c
r1649r1650
144144 */
145145
146146#include "driver.h"
147#include "deprecat.h"
147148#include "namcos22.h"
148149#include "cpu/tms32025/tms32025.h"
149150#include "cpu/m37710/m37710.h"
src/mame/drivers/redclash.c
r1649r1650
2121***************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425
2526
2627extern WRITE8_HANDLER( redclash_videoram_w );
r1649r1650
234235   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:5")
235236   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
236237   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
237   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,3")
238   PORT_DIPSETTING(    0x00, "5000" )
239   PORT_DIPSETTING(    0x10, "8000" )
240   PORT_DIPSETTING(    0x20, "10000" )
241   PORT_DIPSETTING(    0x30, "No Bonus" )
238   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,3")   /* Also determines the default topscore, 0 for "No Bonus" */
239   PORT_DIPSETTING(    0x00, "No Bonus" )
240   PORT_DIPSETTING(    0x30, "5000" )
241   PORT_DIPSETTING(    0x20, "8000" )
242   PORT_DIPSETTING(    0x10, "10000" )
242243   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1")
243244   PORT_DIPSETTING(    0x00, "2" )
244245   PORT_DIPSETTING(    0xc0, "3" )
src/mame/drivers/vicdual.c
r1649r1650
5252****************************************************************************/
5353
5454#include "driver.h"
55#include "deprecat.h"
5556#include "vicdual.h"
5657
5758
src/mame/drivers/rockola.c
r1649r1650
77
88    Games supported:
99        * Sasuke vs. Commander
10        * Satan of Saturn
11        * Zarzon
10        * Satan of Saturn          [2 sets]
11        * Zarzon (clone of 'satansat')
12        * Vanguard                 [3 sets]
13        * Fantasy                  [3 sets]       G-202
14        * Pioneer Balloon                         G-204
15        * Nibbler                  [4 sets]       G-208
16
17    DIP locations verified from manual for:
18        * Zarzon    (Satan of Saturn uses the same code, so I guess locations are the same)
1219        * Vanguard
13        * Fantasy                   G-202
14        * Pioneer Balloon               G-204
15        * Nibbler                   G-208
20        * Nibbler
1621
1722****************************************************************************
1823
r1649r1650
2833read:
29343104      IN0
30353105      IN1
313106      DSW ??
363106      DSW
32373107      IN2
3338
3439write
r1649r1650
84897000-7fff ROM 4        IC10
85908000-8fff ROM 5        IC14
86919000-9fff ROM 6        IC15
92
8793read:
8894b104      IN0
8995b105      IN1
r1649r1650
104110
105111Interrupts: VBlank causes an IRQ. Coin insertion causes a NMI.
106112
113****************************************************************************
114
115Stephh's notes (based on the games M6502 code and some tests) :
116
1171a) 'vanguard'
118
119  - There are 5 different coinage settings according to the game code
120    which are based on DSW bits 1 to 3 :
121
122      bit 3   bit 2   bit 1    effect
123       OFF     OFF     OFF      1C_1C
124       OFF     OFF     ON       2C_1C   (manual tells this is the default setting)
125       OFF     ON      OFF      1C_3C
126       ON      OFF     OFF      1C_2C
127       ON      ON      OFF      1C_6C
128
129    The 3 other combinaisons give 1C_1C
130  - From the manual, it says that DSW bit 6 determines the cost of a game :
131      * bit 6 = 0 : "25c / game"
132      * bit 6 = 1 : "50c / game"
133    When you look at the game code, it appears to be some of "Bonus Coinage" :
134      * bit 6 = 0 : you get an additional credit each time you insert 1 coin
135      * bit 6 = 1 : you get an additional credit each time you insert 2 coins
136  - So, instead of having something like this :
137        PORT_DIPNAME( 0x0e, 0x02, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!2,!3,!4")
138        PORT_DIPSETTING(    0x02, "25c= 1C/1C 2C/3C 50c= 2C/2C" )
139        PORT_DIPSETTING(    0x00, "25c= 1C/2C 50c= 1C/1C 2C/3C" )
140        PORT_DIPSETTING(    0x08, "25c= 1C/3C 50c= 1C/2C 2C/5C" )
141        PORT_DIPSETTING(    0x04, "25c= 1C/4C 50c= 1C/3C 2C/7C" )
142        PORT_DIPSETTING(    0x0c, "25c= 1C/7C 50c= 1C/6C 2C/13C" )
143        duplicate settings - untested in game code
144        PORT_DIPSETTING(    0x06, "25c= 1C/2C 50c= 1C/1C 2C/3C" )
145        PORT_DIPSETTING(    0x0a, "25c= 1C/2C 50c= 1C/1C 2C/3C" )
146        PORT_DIPSETTING(    0x0e, "25c= 1C/2C 50c= 1C/1C 2C/3C" )
147        ...
148        PORT_DIPNAME( 0x40, 0x00, "Game Cost" ) PORT_DIPLOCATION("SW1:!7")
149        PORT_DIPSETTING(    0x00, "25c / game" )
150        PORT_DIPSETTING(    0x40, "50c / game" )
151    or using conditional Dip Switches, I've coded this the way I did.
152  - You can always continue, provided you're on the 1st pattern.
153    The continue text is in English !
154  - 10 letters when you enter your initials
155
1561b) 'vangrdce'
157
158  - Code for coinage is the same as for 'vanguard'.
159  - You can always continue, provided you're on the 1st pattern.
160    The continue text is in English !
161  - 3 letters when you enter your initials
162
1631c) 'vanguarj'
164
165  - Code for coinage is the same as for 'vanguard'.
166  - You can always continue, provided you're on the 1st pattern.
167    The continue text is in Japanese !
168  - 10 letters when you enter your initials
169
1702a) 'fantasy'
171
172  - Code for coinage is the same as for 'vanguard'.
173  - You can always continue, provided you're on the 1st pattern.
174    Note that the continue text is in German !
175  - 3 letters when you enter your initials
176  - I can't tell if it's an ingame bug or not, but there's a mix
177    between "COIN" and "CREDIT" ("COCR" is displayed)
178
1792b) 'fantasyu'
180
181  - Code for coinage is the same as for 'vanguard'.
182  - This version seems easier than 'fantasy', especially on level 2
183    where you have a sword and an easier maze.
184  - Code has been added to test DSW bit 7 to allow or not a continue play.
185    Note that the continue play is only available on the 1st pattern.
186  - 3 letters when you enter your initials
187  - "Fantasy" is written with different "font" and color
188  - "CREDIT" is displayed instead of "COIN"
189
1902b) 'fantasyj'
191
192  - Code for coinage is the same as for 'vanguard'.
193  - This version seems easier than 'fantasy', especially on level 2
194    where you have a sword and an easier maze.
195  - Code has been added to test DSW bit 7 to allow or not a continue play.
196    Note that the continue play is only available on the 1st pattern.
197    Also note that the continue text is still in English !
198  - 3 letters when you enter your initials
199  - "COIN" is correctly displayed.
200
2013)  'pballoon'
202
203  - Code for coinage is the same as for 'vanguard'.
204  - The "Language" Dip Switch only has an effect at the end of the pattern
205    when it displays "LAND HERE" or what I suppose to be same in Japanese.
206  - 3 letters when you enter your initials
207  - "CREDIT" is displayed
208
2094a) 'nibbler'
210
211  - "Lives settings" : 3, 4, 5 or 6 (table at 0x4edf)
212  - Bonus life every 4 levels
213  - Simplified instructions
214  - DSW bit 2 determines what happens when the snake touches a corner (code at 0x3c91) :
215      * bit 2 = 0 : pause for 13 frames
216      * bit 2 = 1 : no pause
217
2184b) 'nibblera'
219
220  - "Lives settings" : 3, 4, 5 or 6 (table at 0x5bf0)
221  - Bonus life every 4 levels
222  - Detailed instructions
223  - DSW bit 2 is no more tested when the snake touches a corner (code at 0x3b3c);
224    this means that the snake ALWAYS pauses for 13 frames.
225    However, there is extra code where it is tested to determine difficulty
226    (code at 0x31b4 and 0x32f5 - tables at 0x3391 and 0x33b2)
227
2284c) 'nibblerb'
229
230  - code based on 'nibblera'
231  - "Lives settings" : 2, 3, 4 or 5 (table at 0x5be7)
232  - Bonus life every 4 levels
233  - Detailed instructions
234  - The snake ALWAYS pauses for 13 frames (code at 0x3b38) when it touches a corner
235    and DSW bit 2 determines difficulty as in 'nibblera'
236    (code at 0x31b0 and 0x32f1 - tables at 0x338d and 0x33ae)
237
2384d) 'nibblero'
239
240  - code is the same as 'nibblerb' (same routines, same code and tables addresses)
241  - "Lives settings" : 2, 3, 4 or 5 (table at 0x5be7)
242  - Bonus life every 8 levels
243  - Detailed instructions
244  - The snake ALWAYS pauses for 13 frames (code at 0x3b38) when it touches a corner
245    and DSW bit 2 determines difficulty as in 'nibblera'
246    (code at 0x31b0 and 0x32f1 - tables at 0x338d and 0x33ae)
247  - The game is harder than 'nibblerb' because the tables at 0x338d and 0x33ae
248    have higher values; so the snake goes faster and grows longer.
249
107250***************************************************************************/
108251
109252/*
r1649r1650
114257    - vanguard/fantasy speech (hd38880/hd38882 emulation)
115258    - music freq (Satan of Saturn and clone)
116259    - correct music waveform/volume control
117    - clean up dips/inputs for all games
118260    - correct ROM names
119261    - fantasy is German? (the continue text is in German)
120262
121263*/
122264
123265#include "driver.h"
266#include "deprecat.h"
124267#include "cpu/m6502/m6502.h"
125268#include "video/crtc6845.h"
126269#include "sound/sn76477.h"
127270#include "sound/custom.h"
128271#include "sound/samples.h"
129272
273
274/* Change to 1 to allow fake debug buttons */
275#define NIBBLER_HACK   0
276
277
130278#ifndef M_LN2
131279#define M_LN2      0.69314718055994530942
132280#endif
r1649r1650
193341}
194342
195343
196/* IN1 + music0 playing */
197static READ8_HANDLER( sasuke_port_1_r )
198{
199   return readinputport(1) | (rockola_music0_playing() ? 0x80 : 0x00);
200}
344/*************************************
345 *
346 *  Custom input ports
347 *
348 *************************************/
201349
202/* IN2 + binary counter */
203static READ8_HANDLER( sasuke_port_3_r )
350static CUSTOM_INPUT( rockola_music0_r )
204351{
205   return readinputport(3) | sasuke_counter;
352   return (rockola_music0_playing() ? 0x01 : 0x00);
206353}
207354
208/* IN2 + music0 playing */
209static READ8_HANDLER( vanguard_port_3_r )
355static CUSTOM_INPUT( sasuke_count_r )
210356{
211   return readinputport(3) | (rockola_music0_playing() ? 0x10 : 0x00);
357   return (sasuke_counter >> 4);
212358}
213359
214360
215/* Memory Maps */
361/*************************************
362 *
363 *  Memory maps
364 *
365 *************************************/
216366
217367static ADDRESS_MAP_START( sasuke_map, ADDRESS_SPACE_PROGRAM, 8 )
218368   AM_RANGE(0x0000, 0x03ff) AM_RAM
r1649r1650
226376   AM_RANGE(0xb000, 0xb001) AM_WRITE(sasuke_sound_w)
227377   AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w)   /* flip screen & irq enable */
228378   AM_RANGE(0xb003, 0xb003) AM_WRITE(satansat_backcolor_w)
229   AM_RANGE(0xb004, 0xb004) AM_READ(input_port_0_r)   // IN0
230   AM_RANGE(0xb005, 0xb005) AM_READ(sasuke_port_1_r)   // IN1 + music0 playing
231   AM_RANGE(0xb006, 0xb006) AM_READ(input_port_2_r)   /* DSW */
232   AM_RANGE(0xb007, 0xb007) AM_READ(sasuke_port_3_r)   // IN2 + binary counter
379   AM_RANGE(0xb004, 0xb004) AM_READ_PORT("IN0")
380   AM_RANGE(0xb005, 0xb005) AM_READ_PORT("IN1")
381   AM_RANGE(0xb006, 0xb006) AM_READ_PORT("DSW")
382   AM_RANGE(0xb007, 0xb007) AM_READ_PORT("IN2")
233383   AM_RANGE(0xf800, 0xffff) AM_ROM
234384ADDRESS_MAP_END
235385
r1649r1650
245395   AM_RANGE(0xb000, 0xb001) AM_WRITE(satansat_sound_w)
246396   AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w)   /* flip screen & irq enable */
247397   AM_RANGE(0xb003, 0xb003) AM_WRITE(satansat_backcolor_w)
248   AM_RANGE(0xb004, 0xb004) AM_READ(input_port_0_r)   // IN0
249   AM_RANGE(0xb005, 0xb005) AM_READ(sasuke_port_1_r)   // IN1 + music0 playing
250   AM_RANGE(0xb006, 0xb006) AM_READ(input_port_2_r)   /* DSW */
251   AM_RANGE(0xb007, 0xb007) AM_READ(sasuke_port_3_r)   // IN2 + binary counter
398   AM_RANGE(0xb004, 0xb004) AM_READ_PORT("IN0")
399   AM_RANGE(0xb005, 0xb005) AM_READ_PORT("IN1")
400   AM_RANGE(0xb006, 0xb006) AM_READ_PORT("DSW")
401   AM_RANGE(0xb007, 0xb007) AM_READ_PORT("IN2")
252402   AM_RANGE(0xf800, 0xffff) AM_ROM
253403ADDRESS_MAP_END
254404
r1649r1650
262412   AM_RANGE(0x3001, 0x3001) AM_WRITE(crtc6845_register_w)
263413   AM_RANGE(0x3100, 0x3102) AM_WRITE(vanguard_sound_w)
264414   AM_RANGE(0x3103, 0x3103) AM_WRITE(rockola_flipscreen_w)
265   AM_RANGE(0x3104, 0x3104) AM_READ(input_port_0_r)   // IN0
266   AM_RANGE(0x3105, 0x3105) AM_READ(input_port_1_r)   // IN1
267   AM_RANGE(0x3106, 0x3106) AM_READ(input_port_2_r)   /* DSW */
268   AM_RANGE(0x3107, 0x3107) AM_READ(vanguard_port_3_r)   // IN2 + music0 playing
415   AM_RANGE(0x3104, 0x3104) AM_READ_PORT("IN0")
416   AM_RANGE(0x3105, 0x3105) AM_READ_PORT("IN1")
417   AM_RANGE(0x3106, 0x3106) AM_READ_PORT("DSW")
418   AM_RANGE(0x3107, 0x3107) AM_READ_PORT("IN2")
269419   AM_RANGE(0x3200, 0x3200) AM_WRITE(rockola_scrollx_w)
270420   AM_RANGE(0x3300, 0x3300) AM_WRITE(rockola_scrolly_w)
271421   AM_RANGE(0x3400, 0x3400) AM_WRITE(vanguard_speech_w)   // speech
r1649r1650
282432   AM_RANGE(0x2000, 0x2000) AM_WRITE(crtc6845_address_w)
283433   AM_RANGE(0x2001, 0x2001) AM_WRITE(crtc6845_register_w)
284434   AM_RANGE(0x2100, 0x2103) AM_WRITE(fantasy_sound_w)
285   AM_RANGE(0x2104, 0x2104) AM_READ(input_port_0_r)   // IN0
286   AM_RANGE(0x2105, 0x2105) AM_READ(input_port_1_r)   // IN1
287   AM_RANGE(0x2106, 0x2106) AM_READ(input_port_2_r)   /* DSW */
288   AM_RANGE(0x2107, 0x2107) AM_READ(input_port_3_r)   // IN2
435   AM_RANGE(0x2104, 0x2104) AM_READ_PORT("IN0")
436   AM_RANGE(0x2105, 0x2105) AM_READ_PORT("IN1")
437   AM_RANGE(0x2106, 0x2106) AM_READ_PORT("DSW")
438   AM_RANGE(0x2107, 0x2107) AM_READ_PORT("IN2")
289439   AM_RANGE(0x2200, 0x2200) AM_WRITE(rockola_scrollx_w)
290440   AM_RANGE(0x2300, 0x2300) AM_WRITE(rockola_scrolly_w)
291441   AM_RANGE(0x2400, 0x2400) AM_WRITE(fantasy_speech_w)   // speech
r1649r1650
303453   AM_RANGE(0xb000, 0xb000) AM_WRITE(crtc6845_address_w)
304454   AM_RANGE(0xb001, 0xb001) AM_WRITE(crtc6845_register_w)
305455   AM_RANGE(0xb100, 0xb103) AM_WRITE(fantasy_sound_w)
306   AM_RANGE(0xb104, 0xb104) AM_READ(input_port_0_r)   // IN0
307   AM_RANGE(0xb105, 0xb105) AM_READ(input_port_1_r)   // IN1
308   AM_RANGE(0xb106, 0xb106) AM_READ(input_port_2_r)   /* DSW */
309   AM_RANGE(0xb107, 0xb107) AM_READ(input_port_3_r)   // IN2
456   AM_RANGE(0xb104, 0xb104) AM_READ_PORT("IN0")
457   AM_RANGE(0xb105, 0xb105) AM_READ_PORT("IN1")
458   AM_RANGE(0xb106, 0xb106) AM_READ_PORT("DSW")
459   AM_RANGE(0xb107, 0xb107) AM_READ_PORT("IN2")
310460   AM_RANGE(0xb200, 0xb200) AM_WRITE(rockola_scrollx_w)
311461   AM_RANGE(0xb300, 0xb300) AM_WRITE(rockola_scrolly_w)
312462   AM_RANGE(0xf000, 0xffff) AM_ROM
313463ADDRESS_MAP_END
314464
315/* Input Ports */
316465
317/* Derived from Zarzon. Might not reflect the actual hardware. */
318static INPUT_PORTS_START( sasuke )
319   PORT_START  // IN0
320   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
321   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
322   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
323   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
324   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
325   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
326   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
327   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
466/*************************************
467 *
468 *  Port definitions
469 *
470 *************************************/
328471
329   PORT_START   // IN1
472static INPUT_PORTS_START( rockola_generic_joy8way )
473   PORT_START_TAG("IN0")
330474   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
331475   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
332   PORT_BIT( 0x7C, IP_ACTIVE_HIGH, IPT_UNKNOWN )
333   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* music0 playing */
476   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
477   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
478   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_8WAY
479   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_8WAY
480   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
481   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
334482
335   PORT_START  /* DSW */
336   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
337   PORT_DIPSETTING(    0x01, DEF_STR( Upright ))
483   PORT_START_TAG("IN1")
484   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
485   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
486   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
487   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
488   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
489   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
490   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
491   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
492
493   PORT_START_TAG("IN2")
494   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
495   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
496   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
497   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
498   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
499   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
500   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
501   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
502
503   PORT_START_TAG("DSW")
504   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!1")
505   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
338506   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
339   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
507   PORT_DIPNAME( 0x0e, 0x02, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!2,!3,!4")
508   PORT_DIPSETTING (   0x02, DEF_STR( 2C_1C ) )
340509   PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
341   PORT_DIPSETTING (   0x02, DEF_STR( 1C_2C ) )
342   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
343   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
344   PORT_DIPSETTING (   0x04, DEF_STR( On ) )
345   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
346   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
347   PORT_DIPSETTING (   0x08, DEF_STR( On ) )
348   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
349   PORT_DIPSETTING (   0x00, "3" )
350   PORT_DIPSETTING (   0x10, "4" )
351   PORT_DIPSETTING (   0x20, "5" )
352   /* 0x30 gives 3 again */
353   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
354   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
355   PORT_DIPSETTING (   0x40, DEF_STR( On ) )
356   PORT_DIPNAME( 0x80, 0x00, "RAM Test" )
357   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
358   PORT_DIPSETTING (   0x80, DEF_STR( On ) )
359
360   PORT_START  // IN2
361   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
362   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* NC */
363   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* connected to a binary counter */
510   PORT_DIPSETTING (   0x08, DEF_STR( 1C_2C ) )
511   PORT_DIPSETTING (   0x04, DEF_STR( 1C_3C ) )
512   PORT_DIPSETTING (   0x0c, DEF_STR( 1C_6C ) )
513/*  PORT_DIPSETTING (   0x06, DEF_STR( 1C_1C ) ) */
514/*  PORT_DIPSETTING (   0x0a, DEF_STR( 1C_1C ) ) */
515/*  PORT_DIPSETTING (   0x0e, DEF_STR( 1C_1C ) ) */
516   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!5,!6")
517   PORT_DIPSETTING(    0x00, "3" )
518   PORT_DIPSETTING(    0x10, "4" )
519   PORT_DIPSETTING(    0x20, "5" )
520/*  PORT_DIPSETTING(    0x30, "3" ) */
521   PORT_DIPNAME( 0x40, 0x00, "Coinage Bonus" ) PORT_DIPLOCATION("SW1:!7")      /* see notes */
522   PORT_DIPSETTING (   0x40, DEF_STR( 2C_1C ) )
523   PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
524   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW1:!8" )
364525INPUT_PORTS_END
365526
366527static INPUT_PORTS_START( satansat )
367   PORT_START  // IN0
528   PORT_START_TAG("IN0")
368529   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
369530   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
370531   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
r1649r1650
374535   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
375536   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
376537
377   PORT_START   // IN1
538   PORT_START_TAG("IN1")
378539   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
379540   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
380   PORT_BIT( 0x7C, IP_ACTIVE_HIGH, IPT_UNKNOWN )
381   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* music0 playing */
541   PORT_BIT( 0x7c, IP_ACTIVE_HIGH, IPT_UNKNOWN )
542   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(rockola_music0_r, NULL)     /* music0 playing */
382543
383   PORT_START  /* DSW */
384   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
385   PORT_DIPSETTING(    0x01, DEF_STR( Upright ))
544   PORT_START_TAG("IN2")
545   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
546   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNKNOWN )                                         /* NC */
547   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sasuke_count_r, NULL)       /* connected to a binary counter */
548
549   PORT_START_TAG("DSW")
550   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!1")
551   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
386552   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
387   PORT_DIPNAME( 0x0a, 0x00, DEF_STR( Coinage ) )
553   PORT_DIPNAME( 0x0a, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!2,!4")
388554   PORT_DIPSETTING (   0x08, DEF_STR( 2C_1C ) )
389555   PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
390556   PORT_DIPSETTING (   0x02, DEF_STR( 1C_2C ) )
391   /* 0x0a gives 2/1 again */
392   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
393   PORT_DIPSETTING (   0x00, "5000" )
394   PORT_DIPSETTING (   0x04, "10000" )
395   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
557/*  PORT_DIPSETTING (   0x0a, DEF_STR( 2C_1C ) ) */
558   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!3")
559   PORT_DIPSETTING (   0x04, "5000" )
560   PORT_DIPSETTING (   0x00, "10000" )
561   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!5,!6") /* manual says 4 is the default value */
396562   PORT_DIPSETTING (   0x00, "3" )
397563   PORT_DIPSETTING (   0x10, "4" )
398564   PORT_DIPSETTING (   0x20, "5" )
399   /* 0x30 gives 3 again */
400   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
565/*  PORT_DIPSETTING(    0x30, "3" ) */
566   PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_HIGH, "SW1:!7" )
567   PORT_DIPNAME( 0x80, 0x00, "RAM Test" ) PORT_DIPLOCATION("SW1:!8") /* unused according to manual */
401568   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
402   PORT_DIPSETTING (   0x40, DEF_STR( On ) )
403   PORT_DIPNAME( 0x80, 0x00, "RAM Test" )
404   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
405569   PORT_DIPSETTING (   0x80, DEF_STR( On ) )
570INPUT_PORTS_END
406571
407   PORT_START  // IN2
408   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
409   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* NC */
410   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* connected to a binary counter */
572/* Derived from 'satansat'. Might not reflect the actual hardware. Dip Swicthes verified from game code though. */
573static INPUT_PORTS_START( sasuke )
574   PORT_INCLUDE(satansat)
575
576   PORT_MODIFY("IN0")
577   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
578   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
579
580   PORT_MODIFY("IN1")
581   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
582   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
583
584   PORT_MODIFY("DSW")
585   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!2")
586   PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
587   PORT_DIPSETTING (   0x02, DEF_STR( 1C_2C ) )
588   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_HIGH, "SW1:!4" )
411589INPUT_PORTS_END
412590
413591static INPUT_PORTS_START( vanguard )
414   PORT_START   // IN0
415   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 )
416   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4 )
417   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )
418   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
419   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
420   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
421   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
422   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
592   PORT_INCLUDE(rockola_generic_joy8way)
423593
424   PORT_START   // IN1
425   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL
426   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_COCKTAIL
427   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
428   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
429   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
430   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
431   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
432   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
594   PORT_MODIFY("IN0")
595   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 )                /* fire down */
596   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4 )                /* fire up */
597   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )                /* fire right */
598   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )                /* fire left */
433599
434   PORT_START   // DSW0
435   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
436   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
437   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
438   PORT_DIPNAME( 0x4e, 0x02, DEF_STR( Coinage ) )
439   PORT_DIPSETTING(    0x42, DEF_STR( 2C_1C ) )
440   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 2/3" )
441   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
442   PORT_DIPSETTING(    0x48, "1 Coin/2 Credits 2/5" )
443   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
444   PORT_DIPSETTING(    0x44, "1 Coin/3 Credits 2/7" )
445   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
446   PORT_DIPSETTING(    0x4c, "1 Coin/6 Credits 2/13" )
447   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_7C ) )
448/*
449    PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
450    PORT_DIPSETTING(    0x0a, DEF_STR( 1C_2C ) )
451    PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
452    PORT_DIPSETTING(    0x40, "1 Coin/1 Credit + Bonus" )
453    PORT_DIPSETTING(    0x46, "1 Coin/1 Credit + Bonus" )
454    PORT_DIPSETTING(    0x4a, "1 Coin/1 Credit + Bonus" )
455    PORT_DIPSETTING(    0x4e, "1 Coin/1 Credit + Bonus" )
456*/
457   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
458   PORT_DIPSETTING(    0x00, "3" )
459   PORT_DIPSETTING(    0x10, "4" )
460   PORT_DIPSETTING(    0x20, "5" )
461/*  PORT_DIPSETTING(    0x30, "3" ) */
462   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
600   PORT_MODIFY("IN1")
601   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL  /* fire down */
602   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_COCKTAIL  /* fire up */
603   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL  /* fire right */
604   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL  /* fire left */
463605
464   PORT_START   // IN2
465   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
466   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
467   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
468   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
469   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* music0 playing */
470   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
471   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
472   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
606   PORT_MODIFY("IN2")
607   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(rockola_music0_r, NULL)     /* music0 playing */
473608INPUT_PORTS_END
474609
475610static INPUT_PORTS_START( fantasy )
476   PORT_START   // IN0
477   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
478   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
479   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
480   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
481   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_8WAY
482   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_8WAY
483   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
484   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
611   PORT_INCLUDE(rockola_generic_joy8way)
612INPUT_PORTS_END
485613
486   PORT_START   // IN1
487   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
488   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
489   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
490   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
491   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
492   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
493   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
494   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
614static INPUT_PORTS_START( fantasyu )
615   PORT_INCLUDE(fantasy)
495616
496   PORT_START   // DSW0
497   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
498   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
499   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
500   PORT_DIPNAME( 0x4e, 0x02, DEF_STR( Coinage ) )
501   PORT_DIPSETTING(    0x42, DEF_STR( 2C_1C ) )
502   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 2/3" )
503   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
504   PORT_DIPSETTING(    0x48, "1 Coin/2 Credits 2/5" )
505   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
506   PORT_DIPSETTING(    0x44, "1 Coin/3 Credits 2/7" )
507   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
508   PORT_DIPSETTING(    0x4c, "1 Coin/6 Credits 2/13" )
509   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_7C ) )
510/*
511    PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
512    PORT_DIPSETTING(    0x0a, DEF_STR( 1C_2C ) )
513    PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
514    PORT_DIPSETTING(    0x40, "1 Coin/1 Credit + Bonus" )
515    PORT_DIPSETTING(    0x46, "1 Coin/1 Credit + Bonus" )
516    PORT_DIPSETTING(    0x4a, "1 Coin/1 Credit + Bonus" )
517    PORT_DIPSETTING(    0x4e, "1 Coin/1 Credit + Bonus" )
518*/
519   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
520   PORT_DIPSETTING(    0x00, "3" )
521   PORT_DIPSETTING(    0x10, "4" )
522   PORT_DIPSETTING(    0x20, "5" )
523/*  PORT_DIPSETTING(    0x30, "3" ) */
524   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
617   PORT_MODIFY("DSW")
618   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:!8")
525619   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
526   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
620   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )              /* 1st pattern only */
621INPUT_PORTS_END
527622
528   PORT_START   // IN2
529   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
530   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
531   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
532   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
533   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
534   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
535   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
536   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
623static INPUT_PORTS_START( pballoon )
624   PORT_INCLUDE(rockola_generic_joy8way)
625
626   PORT_MODIFY("IN0")
627   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
628
629   PORT_MODIFY("IN1")
630   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
631
632   PORT_MODIFY("DSW")
633   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:!8")  /* code at 0x6c83 */
634   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
635   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
537636INPUT_PORTS_END
538637
539638static INPUT_PORTS_START( nibbler )
540   PORT_START   // IN0
541   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 0") PORT_CODE(KEYCODE_Z) // slow down
542   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 1") PORT_CODE(KEYCODE_X)
543   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 2") PORT_CODE(KEYCODE_C)
544   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 3") PORT_CODE(KEYCODE_V)
545   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_8WAY
546   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_8WAY
547   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
548   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
639   PORT_INCLUDE(rockola_generic_joy8way)
549640
550   PORT_START   // IN1
551   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 4") PORT_CODE(KEYCODE_B) // pause
552   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 5") PORT_CODE(KEYCODE_N) // unpause
553   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 6") PORT_CODE(KEYCODE_M) // end game
554   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 7") PORT_CODE(KEYCODE_K)
555   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
556   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
557   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
558   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
641   /* There are no buttons on a real "Nibbler" cabinet, but I guess that the game was tested
642       with a "Vanguard" cabinet so they have been mapped with debug features. */
643#if NIBBLER_HACK
644   PORT_MODIFY("IN0")
645   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 0") PORT_CODE(KEYCODE_Z) // slow down
646   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 1") PORT_CODE(KEYCODE_X)
647   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 2") PORT_CODE(KEYCODE_C)
648   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 3") PORT_CODE(KEYCODE_V)
559649
560   PORT_START   // DSW0
561   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
650   PORT_MODIFY("IN1")
651   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 4") PORT_CODE(KEYCODE_B) // pause
652   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 5") PORT_CODE(KEYCODE_N) // unpause
653   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 6") PORT_CODE(KEYCODE_M) // end game
654   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 7") PORT_CODE(KEYCODE_K)
655#endif
656
657   PORT_MODIFY("DSW")
658   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!1,!2")
562659   PORT_DIPSETTING(    0x00, "3" )
563660   PORT_DIPSETTING(    0x01, "4" )
564661   PORT_DIPSETTING(    0x02, "5" )
565662   PORT_DIPSETTING(    0x03, "6" )
566   PORT_DIPNAME( 0x04, 0x00, "Pause at Corners" )
663   PORT_DIPNAME( 0x04, 0x00, "Pause at Corners" ) PORT_DIPLOCATION("SW1:!3")
567664   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
568665   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
569   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
666   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!4")
570667   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
571668   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
572   PORT_SERVICE( 0x10, IP_ACTIVE_HIGH )
573   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Free_Play ) )
669   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW1:!5")
574670   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
671   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
672   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:!6")
673   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
575674   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
576   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
675   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!7,!8")
577676   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
578   PORT_DIPSETTING(    0xc0, DEF_STR( 4C_3C ) )
677   PORT_DIPSETTING(    0xc0, "2 Coins/1 Credit 4/3" )
579678   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
580   PORT_DIPSETTING(    0x80, DEF_STR( 2C_3C ) )
581
582   PORT_START   // IN2
583   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
584   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
585   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
586   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
587   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
588   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
589   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
590   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
679   PORT_DIPSETTING(    0x80, "1 Coin/1 Credit 2/3" )
591680INPUT_PORTS_END
592681
593static INPUT_PORTS_START( pballoon )
594   PORT_START   // IN0
595   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
596   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
597   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
598   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
599   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
600   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
601   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
602   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
682static INPUT_PORTS_START( nibblera )
683   PORT_INCLUDE(nibbler)
603684
604   PORT_START   // IN1
605   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
606   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
607   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
608   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
609   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
610   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
611   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
612   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
685   PORT_MODIFY("DSW")
686   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!3")
687   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
688   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
689INPUT_PORTS_END
613690
614   PORT_START   // DSW0
615   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
616   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
617   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
618   PORT_DIPNAME( 0x4e, 0x02, DEF_STR( Coinage ) )
619   PORT_DIPSETTING(    0x42, DEF_STR( 2C_1C ) )
620   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 2/3" )
621   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
622   PORT_DIPSETTING(    0x48, "1 Coin/2 Credits 2/5" )
623   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
624   PORT_DIPSETTING(    0x44, "1 Coin/3 Credits 2/7" )
625   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
626   PORT_DIPSETTING(    0x4c, "1 Coin/6 Credits 2/11" )
627   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_7C ) )
628/*
629    PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
630    PORT_DIPSETTING(    0x0a, DEF_STR( 1C_2C ) )
631    PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
632    PORT_DIPSETTING(    0x40, "1 Coin/1 Credit + Bonus" )
633    PORT_DIPSETTING(    0x46, "1 Coin/1 Credit + Bonus" )
634    PORT_DIPSETTING(    0x4a, "1 Coin/1 Credit + Bonus" )
635    PORT_DIPSETTING(    0x4e, "1 Coin/1 Credit + Bonus" )
636*/
637   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
638   PORT_DIPSETTING(    0x00, "3" )
639   PORT_DIPSETTING(    0x10, "4" )
640   PORT_DIPSETTING(    0x20, "5" )
641/*  PORT_DIPSETTING(    0x30, "3" ) */
642   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
643   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
644   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
691static INPUT_PORTS_START( nibblerb )
692   PORT_INCLUDE(nibblera)
645693
646   PORT_START   // IN2
647   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
648   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
649   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
650   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
651   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
652   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
653   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
654   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
694   PORT_MODIFY("DSW")
695   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!1,!2")
696   PORT_DIPSETTING(    0x00, "2" )
697   PORT_DIPSETTING(    0x01, "3" )
698   PORT_DIPSETTING(    0x02, "4" )
699   PORT_DIPSETTING(    0x03, "5" )
655700INPUT_PORTS_END
656701
657/* Graphics Layouts */
658702
703/*************************************
704 *
705 *  Graphics layouts
706 *
707 *************************************/
708
659709static const gfx_layout swapcharlayout =
660710{
661711   8,8,    /* 8*8 characters */
r1649r1650
689739   8*8     /* every char takes 8 consecutive bytes */
690740};
691741
692/* Graphics Decode Information */
693742
694743static GFXDECODE_START( sasuke )
695744   GFXDECODE_ENTRY( 0,           0x1000, swapcharlayout,      0, 4 )   /* the game dynamically modifies this */
r1649r1650
706755   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,        8*4, 8 )
707756GFXDECODE_END
708757
709/* Sound Interfaces */
710758
759/*************************************
760 *
761 *  Sound Interfaces
762 *
763 *************************************/
764
711765static const struct CustomSound_interface custom_interface =
712766{
713767   rockola_sh_start
r1649r1650
935989   // BOMB     GND:    2,9,26,27       +5V: 15,25
936990};
937991
938/* Interrupt Generators */
939992
993/*************************************
994 *
995 *  Interrupt Generators
996 *
997 *************************************/
998
940999static INTERRUPT_GEN( satansat_interrupt )
9411000{
9421001   if (cpu_getiloops() != 0)
9431002   {
944      UINT8 val = readinputport(3);
1003      UINT8 val = readinputportbytag("IN2");
9451004
9461005      coin_counter_w(0, val & 1);
9471006
r1649r1650
9571016{
9581017   if (cpu_getiloops() != 0)
9591018   {
960      UINT8 val = readinputport(3);
1019      UINT8 val = readinputportbytag("IN2");
9611020
9621021      coin_counter_w(0, val & 1);
9631022      coin_counter_w(1, val & 2);
r1649r1650
9701029      cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, HOLD_LINE);   /* one IRQ per frame */
9711030}
9721031
973/* Machine Initialization */
9741032
1033/*************************************
1034 *
1035 *  Machine initialisation
1036 *
1037 *************************************/
1038
9751039static MACHINE_RESET( sasuke )
9761040{
9771041   //rockola_set_music_clock(M_LN2 * (RES_K(1) + RES_K(10) * 2) * CAP_U(1));
r1649r1650
10041068   rockola_set_music_clock(1 / 40.3);
10051069}
10061070
1007/* Machine Drivers */
10081071
1072/*************************************
1073 *
1074 *  Machine drivers
1075 *
1076 *************************************/
1077
10091078static MACHINE_DRIVER_START( sasuke )
10101079   // basic machine hardware
10111080   MDRV_CPU_ADD_TAG("main", M6502, 11289000/16) // 700 kHz
r1649r1650
11591228   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
11601229MACHINE_DRIVER_END
11611230
1162/* ROMs */
11631231
1232/*************************************
1233 *
1234 *  ROM definitions
1235 *
1236 *************************************/
1237
11641238ROM_START( sasuke )
11651239   ROM_REGION( 0x10000, REGION_CPU1, 0 )
11661240   ROM_LOAD( "sc1",          0x4000, 0x0800, CRC(34cbbe03) SHA1(3d643e11370e61dde0c42c7761a856c5cf53d621) )
r1649r1650
15921666   ROM_LOAD( "g-0959-45.ic53", 0x1000, 0x0800, CRC(33189917) SHA1(01a1b1693db0172609780daeb60430fa0c8bcec2) )
15931667ROM_END
15941668
1595/* Game Drivers */
15961669
1670/*************************************
1671 *
1672 *  Game drivers
1673 *
1674 *************************************/
1675
15971676GAME( 1980, sasuke,   0,        sasuke,   sasuke,   0, ROT90, "SNK", "Sasuke vs. Commander", 0 )
15981677GAME( 1981, satansat, 0,        satansat, satansat, 0, ROT90, "SNK", "Satan of Saturn (set 1)", GAME_IMPERFECT_SOUND )
15991678GAME( 1981, satansaa, satansat, satansat, satansat, 0, ROT90, "SNK", "Satan of Saturn (set 2)", GAME_IMPERFECT_SOUND )
16001679GAME( 1981, zarzon,   satansat, satansat, satansat, 0, ROT90, "[SNK] (Taito America license)", "Zarzon", GAME_IMPERFECT_SOUND )
16011680GAME( 1981, vanguard, 0,        vanguard, vanguard, 0, ROT90, "SNK", "Vanguard (SNK)", 0 )
16021681GAME( 1981, vangrdce, vanguard, vanguard, vanguard, 0, ROT90, "SNK (Centuri license)", "Vanguard (Centuri)", 0 )
1603GAME( 1981, vanguarj, vanguard, vanguard, vanguard, 0, ROT90, "SNK", "Vanguard (Japan)", 0 )
1682GAME( 1981, vanguarj, vanguard, vanguard, vanguard, 0, ROT90, "SNK", "Vanguard (Japan)", 0 )
16041683GAME( 1981, fantasy,  0,        fantasy,  fantasy,  0, ROT90, "SNK", "Fantasy (World)", 0 )
1605GAME( 1981, fantasyu, fantasy,  fantasy,  fantasy,  0, ROT90, "[SNK] (Rock-Ola license)", "Fantasy (US)", 0 )
1606GAME( 1981, fantasyj, fantasy,  fantasy,  fantasy,  0, ROT90, "SNK", "Fantasy (Japan)", 0 )
1684GAME( 1981, fantasyu, fantasy,  fantasy,  fantasyu, 0, ROT90, "[SNK] (Rock-Ola license)", "Fantasy (US)", 0 )
1685GAME( 1981, fantasyj, fantasy,  fantasy,  fantasyu, 0, ROT90, "SNK", "Fantasy (Japan)", 0 )
16071686GAME( 1982, pballoon, 0,        pballoon, pballoon, 0, ROT90, "SNK", "Pioneer Balloon", 0 )
16081687GAME( 1982, nibbler,  0,        nibbler,  nibbler,  0, ROT90, "Rock-Ola", "Nibbler (set 1)", 0 )
1609GAME( 1982, nibblera, nibbler,  nibbler,  nibbler,  0, ROT90, "Rock-Ola", "Nibbler (set 2)", 0 )
1610GAME( 1982, nibblerb, nibbler,  nibbler,  nibbler,  0, ROT90, "Rock-Ola", "Nibbler (set 3)", 0 )
1611GAME( 1983, nibblero, nibbler,  nibbler,  nibbler,  0, ROT90, "Olympia",  "Nibbler (Olympia)", 0 )
1688GAME( 1982, nibblera, nibbler,  nibbler,  nibblera, 0, ROT90, "Rock-Ola", "Nibbler (set 2)", 0 )
1689GAME( 1982, nibblerb, nibbler,  nibbler,  nibblerb, 0, ROT90, "Rock-Ola", "Nibbler (set 3)", 0 )
1690GAME( 1983, nibblero, nibbler,  nibbler,  nibblerb, 0, ROT90, "Olympia",  "Nibbler (Olympia)", 0 )
src/mame/drivers/centiped.c
r1649r1650
99        * Maze Invaders (prototype)
1010        * Bulls Eye Darts
1111
12    Centipede sync-prom added by HIGHWAYMAN.
13    The prom pcb location is:P4 and is 256x4
14    (i need to update the dump, this one is read in 8bit-mode)
12    Known ROMs (listed in the manual) that need to be dumped/verified:
1513
16Known roms (listed in the manual) that need to be dumped/verified:
14    Centipede:
15      136001-203.d1  <-- Are these the proper labels for the timed version???
16      136001-204.e1
17      136001-205.fh1
18      136001-206.j1
1719
18Centipede:
19  136001-203.d1  <-- Are these the proper labels for the timed version???
20  136001-204.e1
21  136001-205.fh1
22  136001-206.j1
20      136001-303.d1  <-- Revision 3 set for the above listed roms
21      136001-304.e1
22      136001-305.fh1
23      136001-306.j1
2324
24  136001-303.d1  <-- Revision 3 set for the above listed roms
25  136001-304.e1
26  136001-305.fh1
27  136001-306.j1
25    Milipede:
26      136013-109.5p
27      136013-110.5r
2828
29Milipede:
30  136013-109.5p
31  136013-110.5r
32
3329****************************************************************************
3430
3531    Main clock: XTAL = 12.096 MHz
r1649r1650
421417***************************************************************************/
422418
423419#include "driver.h"
420#include "deprecat.h"
424421#include "cpu/s2650/s2650.h"
425422#include "machine/atari_vg.h"
426423#include "centiped.h"
r1649r1650
16461643   MDRV_SCREEN_SIZE(32*8, 32*8)
16471644   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
16481645   MDRV_GFXDECODE(centiped)
1649   MDRV_PALETTE_LENGTH(4+4)
1650   MDRV_COLORTABLE_LENGTH(4+4*4*4*4)
1646   MDRV_PALETTE_LENGTH(4+4*4*4*4)
16511647
1652   MDRV_PALETTE_INIT(centiped)
16531648   MDRV_VIDEO_START(centiped)
16541649   MDRV_VIDEO_UPDATE(centiped)
16551650
r1649r1650
16821677   /* sound hardware */
16831678   MDRV_SOUND_REPLACE("pokey", AY8910, 12096000/8)
16841679   MDRV_SOUND_CONFIG(centipdb_ay8910_interface)
1685   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1680   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 10.0)
16861681MACHINE_DRIVER_END
16871682
16881683
r1649r1650
16951690   /* sound hardware */
16961691   MDRV_SOUND_REPLACE("pokey", AY8910, 12096000/8)
16971692   MDRV_SOUND_CONFIG(centipdb_ay8910_interface)
1698   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1693   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 15.0)
16991694MACHINE_DRIVER_END
17001695
17011696
r1649r1650
17081703
17091704   /* video hardware */
17101705   MDRV_GFXDECODE(milliped)
1711   MDRV_PALETTE_LENGTH(4*4+4*4)
1712   MDRV_COLORTABLE_LENGTH(4*4+4*4*4*4*4)
1706   MDRV_PALETTE_LENGTH(4*4+4*4*4*4*4)
17131707
1714   MDRV_PALETTE_INIT(milliped)
17151708   MDRV_VIDEO_START(milliped)
17161709   MDRV_VIDEO_UPDATE(milliped)
17171710
r1649r1650
17351728
17361729   /* video hardware */
17371730   MDRV_GFXDECODE(warlords)
1738   MDRV_PALETTE_LENGTH(128)
1739   MDRV_COLORTABLE_LENGTH(8*4+8*4)
1731   MDRV_PALETTE_LENGTH(8*4+8*4)
17401732
17411733   MDRV_PALETTE_INIT(warlords)
17421734   MDRV_VIDEO_START(warlords)
r1649r1650
17761768   MDRV_SCREEN_SIZE(32*8, 32*8)
17771769   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
17781770   MDRV_GFXDECODE(centiped)
1779   MDRV_PALETTE_LENGTH(4+4)
1780   MDRV_COLORTABLE_LENGTH(4+4*4*4*4)
1781   MDRV_PALETTE_INIT(centiped)
1771   MDRV_PALETTE_LENGTH(4+4*4*4*4)
17821772
17831773   MDRV_VIDEO_START(bullsdrt)
17841774   MDRV_VIDEO_UPDATE(bullsdrt)
r1649r1650
18781868   ROM_LOAD( "136001-213.p4",   0x0000, 0x0100, CRC(6fa3093a) SHA1(2b7aeca74c1ae4156bf1878453a047330f96f0a8) )
18791869ROM_END
18801870
1871
18811872ROM_START( millpac )
18821873   ROM_REGION( 0x10000, REGION_CPU1, 0 )
18831874   ROM_LOAD( "millpac1.1d",  0x2000, 0x0800, CRC(4dd6913d) SHA1(9eca634e1a827f9bbcf3c532d44e175ac4751755) )
r1649r1650
19251916
19261917
19271918ROM_START( mazeinv )
1928   ROM_REGION( 0x10000, REGION_CPU1, 0 )   /* 64k for code */
1919   ROM_REGION( 0x10000, REGION_CPU1, 0 )
19291920   ROM_LOAD( "005.011",      0x3000, 0x1000, CRC(37129536) SHA1(356cb986a40b332100e00fb72194fd4dade2cba7) )
19301921   ROM_LOAD( "004.011",      0x4000, 0x1000, CRC(2d0fbf2f) SHA1(9d4c2bc9f80604d1ff5c5bf5a4a78378efdd8b33) )
19311922   ROM_LOAD( "003.011",      0x5000, 0x1000, CRC(0ff3747c) SHA1(1a7e1c487c24875dada967fb3a9ceaca25b7e2a7) )
r1649r1650
20272018GAME( 1980, warlords, 0,        warlords, warlords, 0,        ROT0,   "Atari",   "Warlords", GAME_SUPPORTS_SAVE )
20282019GAME( 1981, mazeinv,  0,        mazeinv,  mazeinv,  0,        ROT270, "Atari",   "Maze Invaders (prototype)", 0 )
20292020
2030GAME( 1985, bullsdrt, 0,        bullsdrt, bullsdrt, bullsdrt, ROT270, "Shinkai Inc. (Magic Eletronics Inc. licence)", "Bulls Eye Darts", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
2021GAME( 1985, bullsdrt, 0,        bullsdrt, bullsdrt, bullsdrt, ROT270, "Shinkai Inc. (Magic Eletronics Inc. licence)", "Bulls Eye Darts", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
src/mame/drivers/wgp.c
r1649r1650
394394***************************************************************************/
395395
396396#include "driver.h"
397#include "deprecat.h"
397398#include "taitoipt.h"
398399#include "cpu/m68000/m68000.h"
399400#include "video/taitoic.h"
src/mame/drivers/turbosub.c
r1649r1650
4545***********************************************************************/
4646
4747#include "driver.h"
48#include "deprecat.h"
4849#include "cpu/m6809/m6809.h"
4950
5051/* Set to 1 to display test results and skip on errors */
src/mame/drivers/welltris.c
r1649r1650
313313#define WELLTRIS_4P_HACK 0
314314
315315#include "driver.h"
316#include "deprecat.h"
316317#include "sound/2610intf.h"
317318
318319UINT16 *welltris_spriteram;
src/mame/drivers/sprint8.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "includes/sprint8.h"
910
1011static int steer_dir[8];
src/mame/drivers/getrivia.c
r1649r1650
729729   ROM_LOAD( "horserace_icb_1-1-87",      0x12000, 0x2000, CRC(6d5092e3) SHA1(ef99d1b858aef3c438c61c2b17e371dc6aca6623) )
730730ROM_END
731731
732GAME( 1982, m075,     0,        gselect,  gselect,  0, ROT0, "Greyhound Electronics", "M075 Poker (Version 16.03B)",            GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
733GAME( 1982, superbwl, 0,        gselect,  gselect,  0, ROT0, "Greyhound Electronics", "Super Bowl (Version 16.03B)",            GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
732GAME( 1982, m075,     0,        gselect,  gselect,  0, ROT0, "Greyhound Electronics", "M075 Poker (Version 16.03B)",             GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
733GAME( 1982, superbwl, 0,        gselect,  gselect,  0, ROT0, "Greyhound Electronics", "Super Bowl (Version 16.03B)",             GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
734734
735GAME( 1982, gs4002,   0,        gselect,  gselect,  0, ROT0, "Greyhound Electronics", "Selection (Version 40.02TMB) set 1",     GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
736GAME( 1982, gs4002a,  gs4002,   gselect,  gselect,  0, ROT0, "Greyhound Electronics", "Selection (Version 40.02TMB) set 2",     GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
735GAME( 1982, gs4002,   0,        gselect,  gselect,  0, ROT0, "Greyhound Electronics", "Selection (Version 40.02TMB, set 1)",     GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
736GAME( 1982, gs4002a,  gs4002,   gselect,  gselect,  0, ROT0, "Greyhound Electronics", "Selection (Version 40.02TMB, set 2)",     GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
737737
738GAME( 1984, gepoker,  0,        gepoker,  gepoker,  0, ROT0, "Greyhound Electronics", "Poker (Version 50.02 ICB)",              GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
739GAME( 1984, gepoker1, 0,        gepoker,  gepoker,  0, ROT0, "Greyhound Electronics", "Poker (Version 50.08 IAM)",              GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
740GAME( 1984, gepoker2, gepoker,  gepoker,  gepoker,  0, ROT0, "Greyhound Electronics", "Poker (Version 50.02 ICB set 2)",        GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
741GAME( 1984, gepoker3, gepoker,  gepoker,  gepoker,  0, ROT0, "Greyhound Electronics", "Poker (Version 50.02 ICB set 3)",        GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
738GAME( 1984, gepoker,  0,        gepoker,  gepoker,  0, ROT0, "Greyhound Electronics", "Poker (Version 50.02 ICB, set 1)",        GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
739GAME( 1984, gepoker1, 0,        gepoker,  gepoker,  0, ROT0, "Greyhound Electronics", "Poker (Version 50.08 IAM)",               GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
740GAME( 1984, gepoker2, gepoker,  gepoker,  gepoker,  0, ROT0, "Greyhound Electronics", "Poker (Version 50.02 ICB, set 2)",        GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
741GAME( 1984, gepoker3, gepoker,  gepoker,  gepoker,  0, ROT0, "Greyhound Electronics", "Poker (Version 50.02 ICB, set 3)",        GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
742742
743GAME( 1984, gt102c,   0,        getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02C)",                 GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
744GAME( 1984, gt102b,   gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02B)",                 GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
745GAME( 1984, gt101c,   gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.01C)",                 GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
746GAME( 1984, gt101c1,  gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.01C Alt questions 1)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
747GAME( 1984, gt102c1,  gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02C Alt questions 1)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
748GAME( 1984, gt102c2,  gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02C Alt questions 2)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
749GAME( 1984, gt102c3,  gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02C Alt questions 3)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
743GAME( 1984, gt102c,   0,        getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02C)",                  GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
744GAME( 1984, gt102b,   gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02B)",                  GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
745GAME( 1984, gt101c,   gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.01C)",                  GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
746GAME( 1984, gt101c1,  gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.01C, Alt questions 1)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
747GAME( 1984, gt102c1,  gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02C, Alt questions 1)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
748GAME( 1984, gt102c2,  gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02C, Alt questions 2)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
749GAME( 1984, gt102c3,  gt102c,   getrivia, getrivia, 0, ROT0, "Greyhound Electronics", "Trivia (Version 1.02C, Alt questions 3)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
750750
751GAME( 1985, sextriv1, 0,        getrivia, sextriv1, 0, ROT0, "Kinky Kit and Game Co.", "Sexual Trivia (Version 1.02SB set 1)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
752GAME( 1985, sextriv2, sextriv1, getrivia, sextriv1, 0, ROT0, "Kinky Kit and Game Co.", "Sexual Trivia (Version 1.02SB set 2)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
751GAME( 1985, sextriv1, 0,        getrivia, sextriv1, 0, ROT0, "Kinky Kit and Game Co.", "Sexual Trivia (Version 1.02SB, set 1)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
752GAME( 1985, sextriv2, sextriv1, getrivia, sextriv1, 0, ROT0, "Kinky Kit and Game Co.", "Sexual Trivia (Version 1.02SB, set 2)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
src/mame/drivers/dec0.c
r1649r1650
3939***************************************************************************/
4040
4141#include "driver.h"
42#include "deprecat.h"
4243#include "cpu/m6502/m6502.h"
4344#include "cpu/h6280/h6280.h"
4445#include "dec0.h"
src/mame/drivers/ssv.c
r1649r1650
180180***************************************************************************/
181181
182182#include "driver.h"
183#include "deprecat.h"
183184#include "machine/eeprom.h"
184185#include "sound/es5506.h"
185186#include "seta.h"
186187
187#include <math.h>
188
189188/***************************************************************************
190189
191190
src/mame/drivers/taitoair.c
r1649r1650
216216****************************************************************************/
217217
218218#include "driver.h"
219#include "deprecat.h"
219220#include "taitoipt.h"
220221#include "audio/taitosnd.h"
221222#include "video/taitoic.h"
src/mame/drivers/atarig42.c
r1649r1650
1919
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "machine/atarigen.h"
2324#include "machine/asic65.h"
2425#include "audio/atarijsa.h"
src/mame/drivers/cop01.c
r1649r1650
5050
5151***************************************************************************/
5252#include "driver.h"
53#include "deprecat.h"
5354#include "sound/ay8910.h"
5455#include "sound/3812intf.h"
5556
r1649r1650
433434   MDRV_SCREEN_SIZE(32*8, 32*8)
434435   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
435436   MDRV_GFXDECODE(cop01)
436   MDRV_PALETTE_LENGTH(256)
437   MDRV_COLORTABLE_LENGTH(16+8*16+16*16)
437   MDRV_PALETTE_LENGTH(16+8*16+16*16)
438438
439439   MDRV_PALETTE_INIT(cop01)
440440   MDRV_VIDEO_START(cop01)
r1649r1650
475475   MDRV_SCREEN_SIZE(32*8, 32*8)
476476   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
477477   MDRV_GFXDECODE(cop01)
478   MDRV_PALETTE_LENGTH(256)
479   MDRV_COLORTABLE_LENGTH(16+8*16+16*16)
478   MDRV_PALETTE_LENGTH(16+8*16+16*16)
480479
481480   MDRV_PALETTE_INIT(cop01)
482481   MDRV_VIDEO_START(cop01)
src/mame/drivers/mpu4drvr.c
r1649r1650
182182#include "video/crtc6845.h"
183183
184184#ifdef MAME_DEBUG
185#define VERBOSE 1
185#define MPU4VIDVERBOSE 1
186186#else
187#define VERBOSE 0
187#define MPU4VIDVERBOSE 0
188188#endif
189189
190#define LOGSTUFF(x) do { if (VERBOSE) logerror x; } while (0)
190#define LOGSTUFF(x) do { if (MPU4VIDVERBOSE) logerror x; } while (0)
191191
192192#define VIDEO_MASTER_CLOCK (10000000)
193193
src/mame/drivers/aquarium.c
r1649r1650
5050
5151
5252#include "driver.h"
53#include "deprecat.h"
5354#include "sound/2151intf.h"
5455#include "sound/okim6295.h"
5556
src/mame/drivers/metro.c
r1649r1650
55                    driver by   Luca Elia (l.elia@tin.it)
66
77
8Main  CPU    :  MC68000
8Main  CPU    :  MC68000 Or H8/3007
99
1010Video Chips  :  Imagetek 14100 052 9227KK701    Or
1111                Imagetek 14220 071 9338EK707    Or
r1649r1650
454598  Mahjong Gakuensai 2         VG340-A     14300       No sound CPU
464696  Mouja                       VG410-B     14300       No sound CPU
474799  Battle Bubble v2.00         LM2D-Y      14220       No sound CPU
4800  Puzzlet                     VG2200-(B)  14300       PIC? Protection?
4849---------------------------------------------------------------------------
4950
5051Not dumped yet:
r1649r1650
8081***************************************************************************/
8182
8283#include "driver.h"
83#include "video/konamiic.h"
84#include "deprecat.h"
85#include "cpu/h83002/h83002.h"
8486#include "cpu/upd7810/upd7810.h"
8587#include "machine/eeprom.h"
88#include "video/konamiic.h"
8689#include "sound/2610intf.h"
8790#include "sound/2151intf.h"
8891#include "sound/2413intf.h"
r1649r1650
206209   if (ACCESSING_LSB)
207210   {
208211      data &= ~*metro_irq_enable;
212
209213      if (data & 0x01)   requested_int[0] = 0;
210214      if (data & 0x02)   requested_int[1] = 0;   // DAITORIDE, BALCUBE, KARATOUR, MOUJA
211215      if (data & 0x04)   requested_int[2] = 0;
r1649r1650
20882092
20892093
20902094/***************************************************************************
2095                                Puzzlet
2096***************************************************************************/
20912097
2098static READ16_HANDLER( puzzlet_dsw_r )
2099{
2100   return readinputport(3);
2101}
20922102
2103static WRITE16_HANDLER( puzzlet_irq_enable_w )
2104{
2105   if (ACCESSING_LSB)
2106      *metro_irq_enable = data^0xffff;
2107}
2108
2109// H8/3007 CPU
2110static ADDRESS_MAP_START( puzzlet_map, ADDRESS_SPACE_PROGRAM, 16 )
2111   AM_RANGE( 0x000000, 0x1fffff ) AM_ROM
2112   AM_RANGE( 0x430000, 0x433fff ) AM_RAM
2113   AM_RANGE( 0x470000, 0x47dfff ) AM_RAM
2114
2115   AM_RANGE( 0x500000, 0x500001 ) AM_READWRITE( OKIM6295_status_0_msb_r, OKIM6295_data_0_msb_w )
2116   AM_RANGE( 0x580000, 0x580001 ) AM_WRITE( YM2413_register_port_0_msb_w )
2117   AM_RANGE( 0x580002, 0x580003 ) AM_WRITE( YM2413_data_port_0_msb_w )
2118
2119   AM_RANGE( 0x700000, 0x71ffff ) AM_READWRITE( MRA16_RAM, metro_vram_0_w ) AM_BASE( &metro_vram_0 )   // Layer 0
2120   AM_RANGE( 0x720000, 0x73ffff ) AM_READWRITE( MRA16_RAM, metro_vram_1_w ) AM_BASE( &metro_vram_1 )   // Layer 1
2121   AM_RANGE( 0x740000, 0x75ffff ) AM_READWRITE( MRA16_RAM, metro_vram_2_w ) AM_BASE( &metro_vram_2 )   // Layer 2
2122   AM_RANGE( 0x774000, 0x774fff ) AM_RAM   AM_BASE( &spriteram16 )   AM_SIZE( &spriteram_size )         // Sprites
2123
2124   AM_RANGE( 0x760000, 0x76ffff ) AM_READ( metro_bankedrom_r )   // Banked ROM
2125
2126//  AM_RANGE( 0x772000, 0x773fff ) AM_RAM
2127   AM_RANGE( 0x770000, 0x773fff ) AM_READWRITE( MRA16_RAM, metro_paletteram_w ) AM_BASE( &paletteram16 )   // Palette
2128
2129   AM_RANGE( 0x775000, 0x777fff ) AM_RAM
2130
2131   AM_RANGE( 0x778000, 0x7787ff ) AM_READWRITE( MRA16_RAM, MWA16_RAM )   AM_BASE(&metro_tiletable) AM_SIZE(&metro_tiletable_size      )   // Tiles Set
2132   AM_RANGE( 0x778800, 0x778813 ) AM_WRITE( MWA16_RAM )      AM_BASE( &metro_videoregs )   // Video Registers
2133   AM_RANGE( 0x778840, 0x77884f ) AM_WRITE( metro_blitter_w )   AM_BASE( &metro_blitter_regs )   // Tiles Blitter
2134   AM_RANGE( 0x778860, 0x77886b ) AM_WRITE( metro_window_w )   AM_BASE( &metro_window )   // Tilemap Window
2135   AM_RANGE( 0x778870, 0x77887b ) AM_WRITE( MWA16_RAM )      AM_BASE( &metro_scroll )   // Scroll
2136   AM_RANGE( 0x778890, 0x778891 ) AM_WRITE( MWA16_NOP )   // ? increasing
2137   AM_RANGE( 0x7788a2, 0x7788a3 ) AM_WRITE( metro_irq_cause_w )   // IRQ Cause
2138   AM_RANGE( 0x7788a4, 0x7788a5 ) AM_WRITE( puzzlet_irq_enable_w ) AM_BASE( &metro_irq_enable )   // IRQ Enable
2139
2140   AM_RANGE( 0x7788aa, 0x7788ab ) AM_WRITE( MWA16_RAM )      AM_BASE( &metro_rombank   )      // Rom Bank
2141   AM_RANGE( 0x7788ac, 0x7788ad ) AM_WRITE( MWA16_RAM )      AM_BASE( &metro_screenctrl )   // Screen Control
2142
2143   AM_RANGE( 0x7f2000, 0x7f3fff ) AM_RAM
2144
2145   AM_RANGE( 0x7f8880, 0x7f8881 ) AM_READ(   input_port_1_word_r )
2146   AM_RANGE( 0x7f8884, 0x7f8885 ) AM_READ( puzzlet_dsw_r )
2147   AM_RANGE( 0x7f8886, 0x7f8887 ) AM_READ( puzzlet_dsw_r )
2148
2149   AM_RANGE( 0x7f88a2, 0x7f88a3 ) AM_READ( metro_irq_cause_r )   // IRQ Cause
2150ADDRESS_MAP_END
2151
2152static READ8_HANDLER( puzzlet_port7_r )
2153{
2154   return input_port_2_word_r(0,0);
2155}
2156
2157static READ8_HANDLER( puzzlet_serB_r )
2158{
2159   return input_port_0_word_r(0,0);   // coin
2160}
2161
2162static WRITE8_HANDLER( puzzlet_portb_w )
2163{
2164//  popmessage("PORTB %02x",data);
2165}
2166
2167static ADDRESS_MAP_START( puzzlet_io_map, ADDRESS_SPACE_IO, 8 )
2168   AM_RANGE( H8_PORT7,      H8_PORT7   )   AM_READ( puzzlet_port7_r )
2169   AM_RANGE( H8_SERIAL_B,   H8_SERIAL_B   )   AM_READ( puzzlet_serB_r )
2170   AM_RANGE( H8_PORTB,      H8_PORTB   )   AM_READWRITE( input_port_3_r, puzzlet_portb_w )
2171ADDRESS_MAP_END
2172
2173
2174/***************************************************************************
2175
2176
20932177                                Input Ports
20942178
20952179
r1649r1650
33003384
33013385
33023386/***************************************************************************
3387                                Puzzlet
3388***************************************************************************/
3389
3390static INPUT_PORTS_START( puzzlet )
3391   PORT_START   // IN0 - ser B
3392   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
3393   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
3394   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
3395   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 )
3396   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
3397   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
3398   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_START1 )
3399   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
3400
3401   PORT_START   // IN1 - 7f8880.w
3402   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
3403   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
3404   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
3405   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   // Next
3406   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
3407   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
3408   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
3409   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
3410
3411   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
3412   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
3413   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   // Rotate CW
3414   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
3415   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   // Push
3416   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
3417   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
3418   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
3419
3420   PORT_START   // IN2 - port 7
3421   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
3422   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3423   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(1)
3424   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3425   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(1)
3426   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
3427   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3428   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3429
3430   PORT_START   // IN3 - dsw?
3431   PORT_DIPUNKNOWN( 0x0001, 0x0001 )
3432   PORT_DIPUNKNOWN( 0x0002, 0x0002 )
3433   PORT_DIPUNKNOWN( 0x0004, 0x0004 )
3434   PORT_DIPUNKNOWN( 0x0008, 0x0008 )
3435   PORT_DIPUNKNOWN( 0x0010, 0x0010 )
3436   PORT_DIPUNKNOWN( 0x0020, 0x0020 )
3437   PORT_DIPUNKNOWN( 0x0040, 0x0040 )
3438   PORT_DIPUNKNOWN( 0x0080, 0x0080 )
3439
3440   PORT_DIPUNKNOWN( 0x0100, 0x0100 )
3441   PORT_DIPUNKNOWN( 0x0200, 0x0200 )
3442   PORT_DIPUNKNOWN( 0x0400, 0x0400 )
3443   PORT_DIPUNKNOWN( 0x0800, 0x0800 )
3444   PORT_DIPUNKNOWN( 0x1000, 0x1000 )
3445   PORT_DIPUNKNOWN( 0x2000, 0x2000 )
3446   PORT_DIPUNKNOWN( 0x4000, 0x4000 )
3447   PORT_DIPUNKNOWN( 0x8000, 0x8000 )
3448INPUT_PORTS_END
3449
3450
3451/***************************************************************************
33033452                                Puzzli
33043453***************************************************************************/
33053454
r1649r1650
45004649MACHINE_DRIVER_END
45014650
45024651
4652static INTERRUPT_GEN( puzzlet_interrupt )
4653{
4654   switch ( cpu_getiloops() )
4655   {
4656      case 0:
4657         requested_int[1] = 1;
4658         update_irq_state();
4659         break;
4660
4661      case 1:
4662         requested_int[3] = 1;
4663         update_irq_state();
4664         break;
4665
4666      case 2:
4667         requested_int[5] = 1;
4668         update_irq_state();
4669         break;
4670
4671      case 3:
4672         requested_int[2] = 1;
4673         update_irq_state();
4674         break;
4675
4676      default:
4677         // timer
4678         h8_3002_InterruptRequest(24);
4679         break;
4680   }
4681}
4682static MACHINE_DRIVER_START( puzzlet )
4683
4684   /* basic machine hardware */
4685   MDRV_CPU_ADD(H83007, XTAL_20MHz)   // H8/3007 - Hitachi HD6413007F20 CPU. Clock 20MHz
4686
4687   MDRV_CPU_PROGRAM_MAP(puzzlet_map,0)
4688   MDRV_CPU_IO_MAP(puzzlet_io_map,0)
4689   MDRV_CPU_VBLANK_INT(puzzlet_interrupt, 5)
4690
4691   MDRV_SCREEN_REFRESH_RATE(58)
4692   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
4693
4694   MDRV_MACHINE_RESET(metro)
4695
4696   /* video hardware */
4697   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
4698   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
4699   MDRV_SCREEN_SIZE(320, 256-32)
4700   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1)
4701   MDRV_GFXDECODE(14300)
4702   MDRV_PALETTE_LENGTH(8192)
4703
4704   MDRV_VIDEO_START(metro_14300)
4705   MDRV_VIDEO_UPDATE(metro)
4706
4707   /* sound hardware */
4708   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
4709
4710   MDRV_SOUND_ADD(OKIM6295, XTAL_20MHz/5)
4711   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low)
4712   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
4713   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
4714
4715   MDRV_SOUND_ADD(YM2413, XTAL_20MHz/5)
4716   MDRV_SOUND_ROUTE(0, "left", 0.90)
4717   MDRV_SOUND_ROUTE(1, "right", 0.90)
4718MACHINE_DRIVER_END
4719
4720
45034721/***************************************************************************
45044722
45054723
r1649r1650
46414859   blitter_bit = 3;
46424860}
46434861
4862static DRIVER_INIT( puzzlet )
4863{
4864   metro_common();
4865   irq_line = 0;
4866   blitter_bit = 0;
4867}
46444868
46454869/***************************************************************************
46464870
r1649r1650
56215845
56225846/***************************************************************************
56235847
5848Puzzlet
58492000 Yunizu Corporation
5850
5851Very small PCB using Metro-like hardware with
5852Imagetek GFX chip and H8/3007 CPU
5853
5854PCB Layout
5855----------
5856VG2200-(B)
5857|--------------------------------------------|
5858|TA7222     YM2413B  SOUND4   PRG1           |
5859|  VOL  JRC3403              DSW1(8)         |
5860|             M6295          DSW2(8) CG2 CG3 |
5861|          20MHz                             |
5862|  MM1035             |---------|            |
5863|      H8/3007        |IMAGETEK |    CY7C199 |
5864|TD62307     HM6216255|14300    |            |
5865|TD62064              |         | CY7C199    |
5866|                     |         |            |
5867|  DIP18              |---------| CY7C199    |
5868|        JAMMA              26.666MHz        |
5869|--------------------------------------------|
5870Notes:
5871      H8/3007   - Hitachi HD6413007F20 CPU. Clock 20MHz
5872      M6295     - Clock 4MHz [20/5]. Pin7 LOW
5873      14300     - Imagetek 14300 Graphics Generator IC
5874      VSync     - 58Hz
5875      HSync     - 15.26kHz
5876      DIP18     - unknown chip with scratched surface. Probably a PIC.
5877      HM6216255 - Hitachi 4M high speed SRAM (256-kword x16-bit)
5878      CY7C199   - 32k x8 SRAM
5879      YM2413B   - Clock 4MHz [20/5]
5880      MM1035    - System Reset IC with Watchdog Timer
5881      TD62307   - 7 Channel Low Saturation Driver
5882      TD62064   - 4 Channel High Current Darlington Driver
5883      TA7222    - 40V 4.5A 12.5W 5.8W Audio Power Amplifier IC
5884
5885      All ROMs 27C160
5886
5887***************************************************************************/
5888
5889ROM_START( puzzlet )
5890   ROM_REGION( 0x200000, REGION_CPU1, 0 )   /* H8/3007 Code */
5891   ROM_LOAD16_WORD_SWAP( "prg1_ver2.u9", 0x000000, 0x200000, CRC(592760da) SHA1(08f7493d2e50831438f53bbf0ae211ec40057da7) )
5892
5893   ROM_REGION( 0x400000, REGION_GFX1, 0 )   /* Gfx + Data (Addressable by CPU & Blitter) */
5894   ROMX_LOAD( "cg2.u2", 0x000000, 0x200000, CRC(7720f2d8) SHA1(8e0ccd1e8efe00df909327aefdb1e23e50487524), ROM_GROUPWORD | ROM_SKIP(2))
5895   ROMX_LOAD( "cg3.u1", 0x000002, 0x200000, CRC(77d39d12) SHA1(4bb339e479f0425931cff4eef3a6bc6ad1fac1f5), ROM_GROUPWORD | ROM_SKIP(2))
5896
5897   ROM_REGION( 0x200000, REGION_SOUND1, 0 )   /* Samples */
5898   ROM_LOAD( "sound4.u23", 0x000000, 0x200000, CRC(9a611369) SHA1(97b9188354292b120a1bd0f01b4d884461bfa298) )
5899ROM_END
5900
5901
5902/***************************************************************************
5903
56245904Puzzli
56255905Metro/Banpresto 1995
56265906
r1649r1650
58766156
58776157***************************************************************************/
58786158
5879/*     year  rom       clone     machine   inputs    init */
5880GAME( 1992, karatour, 0,        karatour, karatour, karatour, ROT0,   "Mitchell",                   "The Karate Tournament",           GAME_IMPERFECT_GRAPHICS )
5881GAME( 1992, pangpoms, 0,        pangpoms, pangpoms, metro,    ROT0,   "Metro",                      "Pang Pom's"                         , 0 )
5882GAME( 1992, pangpomm, pangpoms, pangpoms, pangpoms, metro,    ROT0,   "Metro (Mitchell license)",   "Pang Pom's (Mitchell)"              , 0 )
5883GAME( 1992, skyalert, 0,        skyalert, skyalert, metro,    ROT270, "Metro",                      "Sky Alert"                          , 0 )
5884GAME( 1993?,ladykill, 0,        karatour, ladykill, karatour, ROT90,  "Yanyaka (Mitchell license)", "Lady Killer",                     GAME_IMPERFECT_GRAPHICS )
5885GAME( 1993?,moegonta, ladykill, karatour, moegonta, karatour, ROT90,  "Yanyaka",                    "Moeyo Gonta!! (Japan)",           GAME_IMPERFECT_GRAPHICS )
5886GAME( 1993, poitto,   0,        poitto,   poitto,   metro,    ROT0,   "Metro / Able Corp.",         "Poitto!"                            , 0 )
5887GAME( 1994, dharma,   0,        dharma,   dharma,   metro,    ROT0,   "Metro",                      "Dharma Doujou"                      , 0 )
5888GAME( 1994, dharmak,  dharma,   dharma,   dharma,   dharmak,  ROT0,   "Metro",                      "Dharma Doujou (Korea)"              , 0 )
5889GAME( 1994, lastfort, 0,        lastfort, lastfort, metro,    ROT0,   "Metro",                      "Last Fortress - Toride"             , 0 )
5890GAME( 1994, lastfero, lastfort, lastfort, lastfero, metro,    ROT0,   "Metro",                      "Last Fortress - Toride (Erotic)"    , 0 )
5891GAME( 1994, lastforg, lastfort, lastforg, ladykill, metro,    ROT0,   "Metro",                      "Last Fortress - Toride (German)"    , 0 )
5892GAME( 1994, toride2g, 0,        toride2g, toride2g, metro,    ROT0,   "Metro",                      "Toride II Adauchi Gaiden",        GAME_IMPERFECT_GRAPHICS )
5893GAME( 1994, torid2gg, toride2g, toride2g, toride2g, metro,    ROT0,   "Metro",                      "Toride II Adauchi Gaiden (German)", GAME_IMPERFECT_GRAPHICS )
5894GAME( 1994, toride2j, toride2g, toride2g, toride2g, metro,    ROT0,   "Metro",                      "Toride II (Japan)", GAME_IMPERFECT_GRAPHICS )
5895GAME( 1994, gunmast,  0,        pururun,  gunmast,  daitorid, ROT0,   "Metro",                      "Gun Master"                      , 0 )
5896GAME( 1995, daitorid, 0,        daitorid, daitorid, daitorid, ROT0,   "Metro",                      "Daitoride",                       GAME_IMPERFECT_GRAPHICS )
5897GAME( 1995, dokyusei, 0,        dokyusei, dokyusei, gakusai,  ROT0,   "Make Software / Elf / Media Trading", "Mahjong Doukyuusei"        , 0 )
5898GAME( 1995, dokyusp,  0,        dokyusp,  gakusai,  gakusai,  ROT0,   "Make Software / Elf / Media Trading", "Mahjong Doukyuusei Special", 0 )
5899GAME( 1995, pururun,  0,        pururun,  pururun,  daitorid, ROT0,   "Metro / Banpresto",          "Pururun"                            , 0 )
5900GAME( 1995, puzzli,   0,        daitorid, puzzli,   daitorid, ROT0,   "Metro / Banpresto",          "Puzzli",                          GAME_IMPERFECT_GRAPHICS )
5901GAME( 1996, 3kokushi, 0,        3kokushi, 3kokushi, karatour, ROT0,   "Mitchell",                   "Sankokushi (Japan)",              GAME_IMPERFECT_GRAPHICS )
5902GAME( 1996, balcube,  0,        balcube,  balcube,  balcube,  ROT0,   "Metro",                      "Bal Cube"                           , 0 )
5903GAME( 1996, bangball, 0,        bangball, bangball, balcube,  ROT0,   "Banpresto / Kunihiko Tashiro+Goodhouse", "Bang Bang Ball (v1.05)" , 0 )
5904GAME( 1999, batlbubl, bangball, batlbubl, batlbubl, balcube,  ROT0,   "Limenko",                    "Battle Bubble (v2.00)" , 0 )
5905GAME( 1996, mouja,    0,        mouja,    mouja,    mouja,    ROT0,   "Etona",                      "Mouja (Japan)",                   GAME_NO_COCKTAIL )
5906GAME( 1997, gakusai,  0,        gakusai,  gakusai,  gakusai,  ROT0,   "MakeSoft",                   "Mahjong Gakuensai (Japan)",       GAME_IMPERFECT_GRAPHICS )
5907GAME( 1998, gakusai2, 0,        gakusai2, gakusai,  gakusai,  ROT0,   "MakeSoft",                   "Mahjong Gakuensai 2 (Japan)"        , 0 )
5908
5909GAME( 1994, blzntrnd, 0,        blzntrnd, blzntrnd, blzntrnd, ROT0,   "Human Amusement",            "Blazing Tornado",                 GAME_IMPERFECT_GRAPHICS )
5910GAME( 1996, gstrik2,  0,        gstrik2,  gstrik2,  blzntrnd, ROT0,   "Human Amusement",            "Grand Striker 2 (Japan)",         GAME_IMPERFECT_GRAPHICS ) // priority between rounds
6159GAME( 1992, karatour, 0,        karatour, karatour, karatour, ROT0,   "Mitchell",                               "The Karate Tournament",             GAME_IMPERFECT_GRAPHICS )
6160GAME( 1992, pangpoms, 0,        pangpoms, pangpoms, metro,    ROT0,   "Metro",                                  "Pang Pom's",                        0 )
6161GAME( 1992, pangpomm, pangpoms, pangpoms, pangpoms, metro,    ROT0,   "Metro (Mitchell license)",               "Pang Pom's (Mitchell)",             0 )
6162GAME( 1992, skyalert, 0,        skyalert, skyalert, metro,    ROT270, "Metro",                                  "Sky Alert",                         0 )
6163GAME( 1993?,ladykill, 0,        karatour, ladykill, karatour, ROT90,  "Yanyaka (Mitchell license)",             "Lady Killer",                       GAME_IMPERFECT_GRAPHICS )
6164GAME( 1993?,moegonta, ladykill, karatour, moegonta, karatour, ROT90,  "Yanyaka",                                "Moeyo Gonta!! (Japan)",             GAME_IMPERFECT_GRAPHICS )
6165GAME( 1993, poitto,   0,        poitto,   poitto,   metro,    ROT0,   "Metro / Able Corp.",                     "Poitto!",                           0 )
6166GAME( 1994, blzntrnd, 0,        blzntrnd, blzntrnd, blzntrnd, ROT0,   "Human Amusement",                        "Blazing Tornado",                   GAME_IMPERFECT_GRAPHICS )
6167GAME( 1994, dharma,   0,        dharma,   dharma,   metro,    ROT0,   "Metro",                                  "Dharma Doujou",                     0 )
6168GAME( 1994, dharmak,  dharma,   dharma,   dharma,   dharmak,  ROT0,   "Metro",                                  "Dharma Doujou (Korea)",             0 )
6169GAME( 1994, lastfort, 0,        lastfort, lastfort, metro,    ROT0,   "Metro",                                  "Last Fortress - Toride",            0 )
6170GAME( 1994, lastfero, lastfort, lastfort, lastfero, metro,    ROT0,   "Metro",                                  "Last Fortress - Toride (Erotic)",   0 )
6171GAME( 1994, lastforg, lastfort, lastforg, ladykill, metro,    ROT0,   "Metro",                                  "Last Fortress - Toride (German)",   0 )
6172GAME( 1994, toride2g, 0,        toride2g, toride2g, metro,    ROT0,   "Metro",                                  "Toride II Adauchi Gaiden",          GAME_IMPERFECT_GRAPHICS )
6173GAME( 1994, torid2gg, toride2g, toride2g, toride2g, metro,    ROT0,   "Metro",                                  "Toride II Adauchi Gaiden (German)", GAME_IMPERFECT_GRAPHICS )
6174GAME( 1994, toride2j, toride2g, toride2g, toride2g, metro,    ROT0,   "Metro",                                  "Toride II (Japan)",                 GAME_IMPERFECT_GRAPHICS )
6175GAME( 1994, gunmast,  0,        pururun,  gunmast,  daitorid, ROT0,   "Metro",                                  "Gun Master",                        0 )
6176GAME( 1995, daitorid, 0,        daitorid, daitorid, daitorid, ROT0,   "Metro",                                  "Daitoride",                         GAME_IMPERFECT_GRAPHICS )
6177GAME( 1995, dokyusei, 0,        dokyusei, dokyusei, gakusai,  ROT0,   "Make Software / Elf / Media Trading",    "Mahjong Doukyuusei",                0 )
6178GAME( 1995, dokyusp,  0,        dokyusp,  gakusai,  gakusai,  ROT0,   "Make Software / Elf / Media Trading",    "Mahjong Doukyuusei Special",        0 )
6179GAME( 1995, pururun,  0,        pururun,  pururun,  daitorid, ROT0,   "Metro / Banpresto",                      "Pururun",                           0 )
6180GAME( 1995, puzzli,   0,        daitorid, puzzli,   daitorid, ROT0,   "Metro / Banpresto",                      "Puzzli",                            GAME_IMPERFECT_GRAPHICS )
6181GAME( 1996, 3kokushi, 0,        3kokushi, 3kokushi, karatour, ROT0,   "Mitchell",                               "Sankokushi (Japan)",                GAME_IMPERFECT_GRAPHICS )
6182GAME( 1996, balcube,  0,        balcube,  balcube,  balcube,  ROT0,   "Metro",                                  "Bal Cube",                          0 )
6183GAME( 1996, bangball, 0,        bangball, bangball, balcube,  ROT0,   "Banpresto / Kunihiko Tashiro+Goodhouse", "Bang Bang Ball (v1.05)",            0 )
6184GAME( 1996, gstrik2,  0,        gstrik2,  gstrik2,  blzntrnd, ROT0,   "Human Amusement",                        "Grand Striker 2 (Japan)",           GAME_IMPERFECT_GRAPHICS ) // priority between rounds
6185GAME( 1999, batlbubl, bangball, batlbubl, batlbubl, balcube,  ROT0,   "Limenko",                                "Battle Bubble (v2.00)",             0 )
6186GAME( 1996, mouja,    0,        mouja,    mouja,    mouja,    ROT0,   "Etona",                                  "Mouja (Japan)",                     GAME_NO_COCKTAIL )
6187GAME( 1997, gakusai,  0,        gakusai,  gakusai,  gakusai,  ROT0,   "MakeSoft",                               "Mahjong Gakuensai (Japan)",         GAME_IMPERFECT_GRAPHICS )
6188GAME( 1998, gakusai2, 0,        gakusai2, gakusai,  gakusai,  ROT0,   "MakeSoft",                               "Mahjong Gakuensai 2 (Japan)",       0 )
6189GAME( 2000, puzzlet,  0,        puzzlet,  puzzlet,  puzzlet,  ROT0,   "Yunizu Corporation",                     "Puzzlet (Japan)",                   GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/angelkds.c
r1649r1650
127127
128128
129129#include "driver.h"
130#include "deprecat.h"
130131#include "cpu/z80/z80.h"
131132#include "machine/segacrpt.h"
132133#include "sound/2203intf.h"
src/mame/drivers/jrpacman.c
r1649r1650
9999***************************************************************************/
100100
101101#include "driver.h"
102#include "deprecat.h"
102103#include "pacman.h"
103104#include "sound/namco.h"
104105
src/mame/drivers/hshavoc.c
r1649r1650
3535
3636
3737#include "driver.h"
38#include "deprecat.h"
3839#include "genesis.h"
3940
4041#define MASTER_CLOCK      53693100
src/mame/drivers/circusc.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "cpu/m6809/m6809.h"
1819#include "sound/dac.h"
1920#include "sound/sn76496.h"
r1649r1650
320321   MDRV_SCREEN_SIZE(32*8, 32*8)
321322   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
322323   MDRV_GFXDECODE(circusc)
323   MDRV_PALETTE_LENGTH(32)
324   MDRV_COLORTABLE_LENGTH(16*16+16*16)
324   MDRV_PALETTE_LENGTH(16*16+16*16)
325325
326326   MDRV_PALETTE_INIT(circusc)
327327   MDRV_VIDEO_START(circusc)
r1649r1650
382382
383383   ROM_REGION( 0x0220, REGION_PROMS, 0 )
384384   ROM_LOAD( "380_j18.2a",   0x0000, 0x020, CRC(10dd4eaa) SHA1(599acd25f36445221c553510a5de23ddba5ecc15) ) /* palette */
385   ROM_LOAD( "380_j16.10c",  0x0020, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* character lookup table */
386   ROM_LOAD( "380_j17.7b",   0x0120, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* sprite lookup table */
385   ROM_LOAD( "380_j17.7b",   0x0020, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* character lookup table */
386   ROM_LOAD( "380_j16.10c",  0x0120, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* sprite lookup table */
387387ROM_END
388388
389389ROM_START( circusc2 )
r1649r1650
412412
413413   ROM_REGION( 0x0220, REGION_PROMS, 0 )
414414   ROM_LOAD( "380_j18.2a",   0x0000, 0x020, CRC(10dd4eaa) SHA1(599acd25f36445221c553510a5de23ddba5ecc15) ) /* palette */
415   ROM_LOAD( "380_j16.10c",  0x0020, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* character lookup table */
416   ROM_LOAD( "380_j17.7b",   0x0120, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* sprite lookup table */
415   ROM_LOAD( "380_j17.7b",   0x0020, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* character lookup table */
416   ROM_LOAD( "380_j16.10c",  0x0120, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* sprite lookup table */
417417ROM_END
418418
419419ROM_START( circusc3 )
r1649r1650
442442
443443   ROM_REGION( 0x0220, REGION_PROMS, 0 )
444444   ROM_LOAD( "380_j18.2a",   0x0000, 0x020, CRC(10dd4eaa) SHA1(599acd25f36445221c553510a5de23ddba5ecc15) ) /* palette */
445   ROM_LOAD( "380_j16.10c",  0x0020, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* character lookup table */
446   ROM_LOAD( "380_j17.7b",   0x0120, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* sprite lookup table */
445   ROM_LOAD( "380_j17.7b",   0x0020, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* character lookup table */
446   ROM_LOAD( "380_j16.10c",  0x0120, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* sprite lookup table */
447447ROM_END
448448
449449ROM_START( circuscc ) /* Version U */
r1649r1650
472472
473473   ROM_REGION( 0x0220, REGION_PROMS, 0 )
474474   ROM_LOAD( "380_j18.2a",   0x0000, 0x020, CRC(10dd4eaa) SHA1(599acd25f36445221c553510a5de23ddba5ecc15) ) /* palette */
475   ROM_LOAD( "380_j16.10c",  0x0020, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* character lookup table */
476   ROM_LOAD( "380_j17.7b",   0x0120, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* sprite lookup table */
475   ROM_LOAD( "380_j17.7b",   0x0020, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* character lookup table */
476   ROM_LOAD( "380_j16.10c",  0x0120, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* sprite lookup table */
477477ROM_END
478478
479479ROM_START( circusce ) /* Version P */
r1649r1650
502502
503503   ROM_REGION( 0x0220, REGION_PROMS, 0 )
504504   ROM_LOAD( "380_j18.2a",   0x0000, 0x020, CRC(10dd4eaa) SHA1(599acd25f36445221c553510a5de23ddba5ecc15) ) /* palette */
505   ROM_LOAD( "380_j16.10c",  0x0020, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* character lookup table */
506   ROM_LOAD( "380_j17.7b",   0x0120, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* sprite lookup table */
505   ROM_LOAD( "380_j17.7b",   0x0020, 0x100, CRC(13989357) SHA1(0d61d468f6d3e1570fd18d236ec8cab92db4ed5c) ) /* character lookup table */
506   ROM_LOAD( "380_j16.10c",  0x0120, 0x100, CRC(c244f2aa) SHA1(86df21c8e0b1ed51a0a4bd33dbb33f6efdea7d39) ) /* sprite lookup table */
507507ROM_END
508508
509509
r1649r1650
513513}
514514
515515
516GAME( 1984, circusc,  0,       circusc, circusc, circusc, ROT90, "Konami", "Circus Charlie (Selectable level set 1)", GAME_SUPPORTS_SAVE )
517GAME( 1984, circusc2, circusc, circusc, circusc, circusc, ROT90, "Konami", "Circus Charlie (Selectable level set 2)", GAME_SUPPORTS_SAVE )
518GAME( 1984, circusc3, circusc, circusc, circusc, circusc, ROT90, "Konami", "Circus Charlie (No level select)", GAME_SUPPORTS_SAVE )
516GAME( 1984, circusc,  0,       circusc, circusc, circusc, ROT90, "Konami", "Circus Charlie (level select, set 1)", GAME_SUPPORTS_SAVE )
517GAME( 1984, circusc2, circusc, circusc, circusc, circusc, ROT90, "Konami", "Circus Charlie (level select, set 2)", GAME_SUPPORTS_SAVE )
518GAME( 1984, circusc3, circusc, circusc, circusc, circusc, ROT90, "Konami", "Circus Charlie (no level select)", GAME_SUPPORTS_SAVE )
519519GAME( 1984, circuscc, circusc, circusc, circusc, circusc, ROT90, "Konami (Centuri license)", "Circus Charlie (Centuri)", GAME_SUPPORTS_SAVE )
520520GAME( 1984, circusce, circusc, circusc, circusc, circusc, ROT90, "Konami (Centuri license)", "Circus Charlie (Centuri, earlier)", GAME_SUPPORTS_SAVE )
src/mame/drivers/laserbas.c
r1649r1650
1717********************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021
2122static UINT8 *vram1,*vram2;
2223static int vrambank=0;
src/mame/drivers/mikie.c
r1649r1650
1717***************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021#include "cpu/m6809/m6809.h"
2122#include "sound/sn76496.h"
2223
src/mame/drivers/midvunit.c
r1649r1650
1919**************************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "cpu/tms32031/tms32031.h"
2324#include "cpu/adsp2100/adsp2100.h"
2425#include "audio/dcs.h"
src/mame/drivers/kingpin.c
r1649r1650
2020*/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "video/tms9928a.h"
2425#include "sound/ay8910.h"
2526
src/mame/drivers/opwolf.c
r1649r1650
9494***************************************************************************/
9595
9696#include "driver.h"
97#include "deprecat.h"
9798#include "taitoipt.h"
9899#include "video/taitoic.h"
99100#include "audio/taitosnd.h"
src/mame/drivers/surpratk.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1314#include "video/konamiic.h"
1415#include "sound/2151intf.h"
src/mame/drivers/suna16.c
r1649r1650
2222***************************************************************************/
2323
2424#include "driver.h"
25#include "deprecat.h"
2526#include "sound/dac.h"
2627#include "sound/2151intf.h"
2728#include "sound/ay8910.h"
src/mame/drivers/zaccaria.c
r1649r1650
3434***************************************************************************/
3535
3636#include "driver.h"
37#include "deprecat.h"
3738#include "machine/6821pia.h"
3839#include "machine/8255ppi.h"
3940#include "sound/ay8910.h"
src/mame/drivers/shadfrce.c
r1649r1650
7777*/
7878
7979#include "driver.h"
80#include "deprecat.h"
8081#include "sound/2151intf.h"
8182#include "sound/okim6295.h"
8283
src/mame/drivers/littlerb.c
r1649r1650
5959*/
6060
6161#include "driver.h"
62#include "deprecat.h"
6263
6364static UINT16 littlerb_vdp_address_low;
6465static UINT16 littlerb_vdp_address_high;
src/mame/drivers/firebeat.c
r1649r1650
109109*/
110110
111111#include "driver.h"
112#include "deprecat.h"
112113#include "cpu/powerpc/ppc.h"
113114#include "machine/intelfsh.h"
114115#include "machine/scsicd.h"
src/mame/drivers/tagteam.c
r1649r1650
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829#include "cpu/m6502/m6502.h"
2930#include "sound/ay8910.h"
3031#include "sound/dac.h"
src/mame/drivers/eolith.c
r1649r1650
5252 *********************************************************************/
5353
5454#include "driver.h"
55#include "deprecat.h"
5556#include "machine/eeprom.h"
5657
5758READ32_HANDLER(eolith_vram_r);
src/mame/drivers/bigevglf.c
r1649r1650
5656***************************************************************************/
5757
5858#include "driver.h"
59#include "deprecat.h"
5960#include "sound/ay8910.h"
6061#include "sound/msm5232.h"
6162#include "cpu/m6805/m6805.h"
src/mame/drivers/namcos23.c
r1649r1650
324324
325325
326326#include "driver.h"
327#include "deprecat.h"
327328#include "cpu/mips/mips3.h"
328329#include "cpu/h83002/h83002.h"
329330#include "sound/c352.h"
src/mame/drivers/inufuku.c
r1649r1650
6868******************************************************************************/
6969
7070#include "driver.h"
71#include "deprecat.h"
7172#include "cpu/m68000/m68000.h"
7273#include "cpu/z80/z80.h"
7374#include "machine/eeprom.h"
src/mame/drivers/atarisy2.c
r1649r1650
124124
125125
126126#include "driver.h"
127#include "deprecat.h"
127128#include "cpu/t11/t11.h"
128129#include "machine/atarigen.h"
129130#include "slapstic.h"
r1649r1650
131132#include "sound/5220intf.h"
132133#include "sound/2151intf.h"
133134#include "sound/pokey.h"
134#include <math.h>
135135
136136
137137#define MASTER_CLOCK      XTAL_20MHz
src/mame/drivers/ninjakd2.c
r1649r1650
122122******************************************************************************/
123123
124124#include "driver.h"
125#include "deprecat.h"
125126#include "sound/2203intf.h"
126127#include "sound/samples.h"
127128#include "machine/mc8123.h"
r1649r1650
14721473GAME( 1987, mnight,   0,        mnight,   mnight,   mnight,   ROT0,   "UPL (Kawakus license)", "Mutant Night", GAME_IMPERFECT_GRAPHICS )
14731474GAME( 1987, arkarea,  0,        mnight,   arkarea,  mnight,   ROT0,   "UPL", "Ark Area", 0 )
14741475GAME( 1988, robokid,  0,        robokid,  robokid,  0,        ROT0,   "UPL", "Atomic Robo-kid", 0 )
1475GAME( 1988, robokidj, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, Set 1)", 0 )
1476GAME( 1988, robokdj2, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, Set 2)", 0 )
1476GAME( 1988, robokidj, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, set 1)", 0 )
1477GAME( 1988, robokdj2, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, set 2)", 0 )
14771478GAME( 1989, omegaf,   0,        omegaf,   omegaf,   0,        ROT270, "UPL", "Omega Fighter", 0 )
14781479GAME( 1989, omegafs,  omegaf,   omegaf,   omegaf,   0,        ROT270, "UPL", "Omega Fighter Special", 0 )
src/mame/drivers/yunsung8.c
r1649r1650
3030***************************************************************************/
3131
3232#include "driver.h"
33#include "deprecat.h"
3334#include "cpu/z80/z80.h"
3435#include "sound/3812intf.h"
3536#include "sound/msm5205.h"
src/mame/drivers/m52.c
r0r1650
1/***************************************************************************
2
3    Irem M52 hardware
4
5****************************************************************************
6
7    Moon Patrol memory map
8
9    driver by Nicola Salmoria
10
11    0000-3fff ROM
12    8000-83ff Video RAM
13    8400-87ff Color RAM
14    e000-e7ff RAM
15
16
17    read:
18    8800      protection
19    d000      IN0
20    d001      IN1
21    d002      IN2
22    d003      DSW1
23    d004      DSW2
24
25    write:
26    c800-c8ff sprites
27    d000      sound command
28    d001      flip screen
29
30    I/O ports
31    write:
32    10-1f     scroll registers
33    40        background #1 x position
34    60        background #1 y position
35    80        background #2 x position
36    a0        background #2 y position
37    c0        background control
38
39    NOTE: It may be possible to remove the fake port now that conditional DIPS
40    are supported. What should really be filled in for each mode?
41
42***************************************************************************/
43
44#include "driver.h"
45#include "m52.h"
46#include "audio/irem.h"
47#include "cpu/z80/z80.h"
48
49
50#define MASTER_CLOCK      XTAL_18_432MHz
51
52
53
54/*************************************
55 *
56 *  Custom input ports
57 *
58 *************************************/
59
60static CUSTOM_INPUT( coin_mode )
61{
62   /* Based on the coin mode fill in the upper bits */
63   UINT8 port5 = readinputport(5);
64   return (readinputport(4) & 0x04) ? (port5 & 0x0f) : (port5 >> 4);
65}
66
67
68
69/*************************************
70 *
71 *  Memory maps
72 *
73 *************************************/
74
75static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
76   AM_RANGE(0x0000, 0x3fff) AM_ROM
77   AM_RANGE(0x8000, 0x83ff) AM_READWRITE(MRA8_RAM, m52_videoram_w) AM_BASE(&videoram)
78   AM_RANGE(0x8400, 0x87ff) AM_READWRITE(MRA8_RAM, m52_colorram_w) AM_BASE(&colorram)
79   AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x07ff) AM_READ(m52_protection_r)
80   AM_RANGE(0xc800, 0xcbff) AM_MIRROR(0x0400) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
81   AM_RANGE(0xd000, 0xd000) AM_MIRROR(0x07fc) AM_WRITE(irem_sound_cmd_w)
82   AM_RANGE(0xd001, 0xd001) AM_MIRROR(0x07fc) AM_WRITE(m52_flipscreen_w)   /* + coin counters */
83   AM_RANGE(0xd000, 0xd000) AM_MIRROR(0x07f8) AM_READ_PORT("IN0")
84   AM_RANGE(0xd001, 0xd001) AM_MIRROR(0x07f8) AM_READ_PORT("IN1")
85   AM_RANGE(0xd002, 0xd002) AM_MIRROR(0x07f8) AM_READ_PORT("IN2")
86   AM_RANGE(0xd003, 0xd003) AM_MIRROR(0x07f8) AM_READ_PORT("DSW0")
87   AM_RANGE(0xd004, 0xd004) AM_MIRROR(0x07f8) AM_READ_PORT("DSW1")
88   AM_RANGE(0xe000, 0xe7ff) AM_RAM
89ADDRESS_MAP_END
90
91
92static ADDRESS_MAP_START( alpha1v_map, ADDRESS_SPACE_PROGRAM, 8 )
93   AM_RANGE(0x0000, 0x6fff) AM_ROM
94   AM_RANGE(0x8000, 0x83ff) AM_READWRITE(MRA8_RAM, m52_videoram_w) AM_BASE(&videoram)
95   AM_RANGE(0x8400, 0x87ff) AM_READWRITE(MRA8_RAM, m52_colorram_w) AM_BASE(&colorram)
96   AM_RANGE(0xc800, 0xc9ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) AM_SHARE(1) // bigger or mirrored?
97   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("IN0") AM_WRITE(irem_sound_cmd_w)
98   AM_RANGE(0xd001, 0xd001) AM_READ_PORT("IN1") AM_WRITE(m52_flipscreen_w)   /* + coin counters */
99   AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN2")
100   AM_RANGE(0xd003, 0xd003) AM_READ_PORT("DSW0")
101   AM_RANGE(0xd004, 0xd004) AM_READ_PORT("DSW1")
102   AM_RANGE(0xe000, 0xefff) AM_RAM // bigger or mirrored?
103ADDRESS_MAP_END
104
105
106static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 )
107   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
108   AM_RANGE(0x00, 0x00) AM_MIRROR(0x1f) AM_WRITE(m52_scroll_w)
109   AM_RANGE(0x40, 0x40) AM_MIRROR(0x1f) AM_WRITE(m52_bg1xpos_w)
110   AM_RANGE(0x60, 0x60) AM_MIRROR(0x1f) AM_WRITE(m52_bg1ypos_w)
111   AM_RANGE(0x80, 0x80) AM_MIRROR(0x1f) AM_WRITE(m52_bg2xpos_w)
112   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1f) AM_WRITE(m52_bg2ypos_w)
113   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1f) AM_WRITE(m52_bgcontrol_w)
114ADDRESS_MAP_END
115
116
117
118/*************************************
119 *
120 *  Port definitions
121 *
122 *************************************/
123
124static INPUT_PORTS_START( mpatrol )
125   PORT_START_TAG("IN0")
126   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
127   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
128   /* coin input must be active for ? frames to be consistently recognized */
129   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(17)
130   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
131   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
132
133   PORT_START_TAG("IN1")
134   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
135   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
136   PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNKNOWN )
137   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
138   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
139   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
140
141   PORT_START_TAG("IN2")
142   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
143   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
144   PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN )
145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
147   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
149
150   PORT_START_TAG("DSW0")
151   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
152   PORT_DIPSETTING(    0x00, "1" )
153   PORT_DIPSETTING(    0x01, "2" )
154   PORT_DIPSETTING(    0x02, "3" )
155   PORT_DIPSETTING(    0x03, "5" )
156   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
157   PORT_DIPSETTING(    0x0c, "10000 30000 50000" )
158   PORT_DIPSETTING(    0x08, "20000 40000 60000" )
159   PORT_DIPSETTING(    0x04, "10000" )
160   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
161   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(coin_mode, NULL)
162       /* Gets filled in based on the coin mode */
163
164   PORT_START_TAG("DSW1")
165   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
166   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
167   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
168   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
169   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
170   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
171   PORT_DIPNAME( 0x04, 0x04, "Coin Mode" )
172   PORT_DIPSETTING(    0x04, "Mode 1" )
173   PORT_DIPSETTING(    0x00, "Mode 2" )
174   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
175   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
176   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
177   /* In stop mode, press 2 to stop and 1 to restart */
178   PORT_DIPNAME( 0x10, 0x10, "Stop Mode (Cheat)")
179   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
180   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
181   PORT_DIPNAME( 0x20, 0x20, "Sector Selection (Cheat)")
182   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
183   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
184   PORT_DIPNAME( 0x40, 0x40, "Invulnerability (Cheat)")
185   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
186   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
187   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
188
189   /* Fake port to support the two different coin modes */
190   PORT_START_TAG("FAKE")
191   PORT_DIPNAME( 0x0f, 0x0f, "Coinage Mode 1" )   /* mapped on coin mode 1 */
192   PORT_DIPSETTING(    0x09, DEF_STR( 7C_1C ) )
193   PORT_DIPSETTING(    0x0a, DEF_STR( 6C_1C ) )
194   PORT_DIPSETTING(    0x0b, DEF_STR( 5C_1C ) )
195   PORT_DIPSETTING(    0x0c, DEF_STR( 4C_1C ) )
196   PORT_DIPSETTING(    0x0d, DEF_STR( 3C_1C ) )
197   PORT_DIPSETTING(    0x0e, DEF_STR( 2C_1C ) )
198   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
199   PORT_DIPSETTING(    0x07, DEF_STR( 1C_2C ) )
200   PORT_DIPSETTING(    0x06, DEF_STR( 1C_3C ) )
201   PORT_DIPSETTING(    0x05, DEF_STR( 1C_4C ) )
202   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
203   PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) )
204   PORT_DIPSETTING(    0x02, DEF_STR( 1C_7C ) )
205   PORT_DIPSETTING(    0x01, DEF_STR( 1C_8C ) )
206   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
207    PORT_DIPNAME( 0x30, 0x30, "Coin A  Mode 2" )   /* mapped on coin mode 2 */
208   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
209   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
210   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
211   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
212   PORT_DIPNAME( 0xc0, 0xc0, "Coin B  Mode 2" )
213   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
214   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
215   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
216   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
217INPUT_PORTS_END
218
219
220static INPUT_PORTS_START( mpatrolw )
221   PORT_INCLUDE(mpatrol)
222
223   PORT_MODIFY("DSW0")
224   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
225   PORT_DIPSETTING(    0x00, "2" )
226   PORT_DIPSETTING(    0x01, "3" )
227   PORT_DIPSETTING(    0x02, "4" )
228   PORT_DIPSETTING(    0x03, "5" )
229INPUT_PORTS_END
230
231
232static INPUT_PORTS_START( alpha1v )
233   PORT_INCLUDE(mpatrol)
234
235   PORT_MODIFY("IN1")
236   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
237   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
238   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
239   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
240   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
241
242   PORT_MODIFY("IN2")
243   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
244   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
245   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
246   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL
247
248   PORT_MODIFY("DSW0")
249   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
250   PORT_DIPSETTING(    0x00, "2" )
251   PORT_DIPSETTING(    0x01, "3" )
252   PORT_DIPSETTING(    0x02, "4" )
253   PORT_DIPSETTING(    0x03, "5" )
254INPUT_PORTS_END
255
256
257
258/*************************************
259 *
260 *  Graphics layouts
261 *
262 *************************************/
263
264static const gfx_layout charlayout =
265{
266   8,8,
267   RGN_FRAC(1,2),
268   2,
269   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
270   { STEP8(0,1) },
271   { STEP8(0,8) },
272   8*8
273};
274
275static const gfx_layout spritelayout =
276{
277   16,16,
278   RGN_FRAC(1,2),
279   2,
280   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
281   { STEP8(0,1), STEP8(16*8,1) },
282   { STEP16(0,8) },
283   32*8
284};
285
286static const UINT32 bgcharlayout_xoffset[256] =
287{
288   STEP4(0x000,1), STEP4(0x008,1), STEP4(0x010,1), STEP4(0x018,1),
289   STEP4(0x020,1), STEP4(0x028,1), STEP4(0x030,1), STEP4(0x038,1),
290   STEP4(0x040,1), STEP4(0x048,1), STEP4(0x050,1), STEP4(0x058,1),
291   STEP4(0x060,1), STEP4(0x068,1), STEP4(0x070,1), STEP4(0x078,1),
292   STEP4(0x080,1), STEP4(0x088,1), STEP4(0x090,1), STEP4(0x098,1),
293   STEP4(0x0a0,1), STEP4(0x0a8,1), STEP4(0x0b0,1), STEP4(0x0b8,1),
294   STEP4(0x0c0,1), STEP4(0x0c8,1), STEP4(0x0d0,1), STEP4(0x0d8,1),
295   STEP4(0x0e0,1), STEP4(0x0e8,1), STEP4(0x0f0,1), STEP4(0x0f8,1),
296   STEP4(0x100,1), STEP4(0x108,1), STEP4(0x110,1), STEP4(0x118,1),
297   STEP4(0x120,1), STEP4(0x128,1), STEP4(0x130,1), STEP4(0x138,1),
298   STEP4(0x140,1), STEP4(0x148,1), STEP4(0x150,1), STEP4(0x158,1),
299   STEP4(0x160,1), STEP4(0x168,1), STEP4(0x170,1), STEP4(0x178,1),
300   STEP4(0x180,1), STEP4(0x188,1), STEP4(0x190,1), STEP4(0x198,1),
301   STEP4(0x1a0,1), STEP4(0x1a8,1), STEP4(0x1b0,1), STEP4(0x1b8,1),
302   STEP4(0x1c0,1), STEP4(0x1c8,1), STEP4(0x1d0,1), STEP4(0x1d8,1),
303   STEP4(0x1e0,1), STEP4(0x1e8,1), STEP4(0x1f0,1), STEP4(0x1f8,1)
304};
305
306static const UINT32 bgcharlayout_yoffset[64] =
307{
308   STEP32(0x0000,0x200), STEP32(0x4000,0x200)
309};
310
311static const gfx_layout bgcharlayout =
312{
313   256, 64, /* 256x64 image format */
314   1,       /* 1 image */
315   2,       /* 2 bits per pixel */
316   { 4, 0 },       /* the two bitplanes for 4 pixels are packed into one byte */
317   EXTENDED_XOFFS,
318   EXTENDED_YOFFS,
319   0x8000,
320   bgcharlayout_xoffset,
321   bgcharlayout_yoffset
322};
323
324
325static GFXDECODE_START( m52 )
326   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,                0, 128 )
327   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,          128*4,  16 )
328   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, bgcharlayout, 128*4+16*4+0*4,   1 )
329   GFXDECODE_ENTRY( REGION_GFX4, 0x0000, bgcharlayout, 128*4+16*4+1*4,   1 )
330   GFXDECODE_ENTRY( REGION_GFX5, 0x0000, bgcharlayout, 128*4+16*4+2*4,   1 )
331GFXDECODE_END
332
333
334
335/*************************************
336 *
337 *  Machine drivers
338 *
339 *************************************/
340
341static MACHINE_DRIVER_START( m52 )
342
343   /* basic machine hardware */
344   MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/6)
345   MDRV_CPU_PROGRAM_MAP(main_map,0)
346   MDRV_CPU_IO_MAP(main_portmap,0)
347   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
348
349   /* video hardware */
350   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
351   MDRV_GFXDECODE(m52)
352   MDRV_PALETTE_LENGTH(128*4+16*4+3*4)
353
354   MDRV_SCREEN_ADD("main", 0)
355   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 136, 376, 282, 22, 274)
356   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
357
358   MDRV_PALETTE_INIT(m52)
359   MDRV_VIDEO_START(m52)
360   MDRV_VIDEO_UPDATE(m52)
361
362   /* sound hardware */
363   MDRV_IMPORT_FROM(m52_small_audio)
364MACHINE_DRIVER_END
365
366
367static MACHINE_DRIVER_START( alpha1v )
368   MDRV_IMPORT_FROM(m52)
369
370   /* basic machine hardware */
371   MDRV_CPU_MODIFY("main")
372   MDRV_CPU_PROGRAM_MAP(alpha1v_map,0)
373MACHINE_DRIVER_END
374
375
376
377/*************************************
378 *
379 *  ROM definitions
380 *
381 *************************************/
382
383ROM_START( mpatrol )
384   ROM_REGION( 0x10000, REGION_CPU1, 0 )
385   ROM_LOAD( "mpa-1.3m",      0x0000, 0x1000, CRC(5873a860) SHA1(8c03726d6e049c3edbc277440184e31679f78258) )
386   ROM_LOAD( "mpa-2.3l",      0x1000, 0x1000, CRC(f4b85974) SHA1(dfb2efb57378a20af6f20569f4360cde95596f93) )
387   ROM_LOAD( "mpa-3.3k",      0x2000, 0x1000, CRC(2e1a598c) SHA1(112c3c9678db8a8540a8df3708020c87fd10c91b) )
388   ROM_LOAD( "mpa-4.3j",      0x3000, 0x1000, CRC(dd05b587) SHA1(727961b0dafa4a96b580d51013336db2a18aff1e) )
389
390   ROM_REGION( 0x8000, REGION_CPU2, 0 )
391   ROM_LOAD( "mp-s1.1a",     0x7000, 0x1000, CRC(561d3108) SHA1(4998c68a9e9a8002251fa8f07aa1082444a9dc80) )
392
393   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
394   ROM_LOAD( "mpe-5.3e",     0x0000, 0x1000, CRC(e3ee7f75) SHA1(b03d0d56150d3e9da4a4c871338097b4f450b649) )       /* chars */
395   ROM_LOAD( "mpe-4.3f",     0x1000, 0x1000, CRC(cca6d023) SHA1(fecb3059fb09897a096add9452b50aec55c07545) )
396
397   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
398   ROM_LOAD( "mpb-2.3m",     0x0000, 0x1000, CRC(707ace5e) SHA1(93c682e13e74bce29ced3a87bffb29569c114c3b) )       /* sprites */
399   ROM_LOAD( "mpb-1.3n",     0x1000, 0x1000, CRC(9b72133a) SHA1(1393ef92ae1ad58a4b62ca1660c0793d30a8b5e2) )
400
401   ROM_REGION( 0x1000, REGION_GFX3, ROMREGION_DISPOSE )
402   ROM_LOAD( "mpe-1.3l",     0x0000, 0x1000, CRC(c46a7f72) SHA1(8bb7c9acaf6833fb6c0575b015991b873a305a84) )       /* background graphics */
403
404   ROM_REGION( 0x1000, REGION_GFX4, ROMREGION_DISPOSE )
405   ROM_LOAD( "mpe-2.3k",     0x0000, 0x1000, CRC(c7aa1fb0) SHA1(14c6c76e1d0db2c0745e5d6d33ea6945fac8e9ee) )
406
407   ROM_REGION( 0x1000, REGION_GFX5, ROMREGION_DISPOSE )
408   ROM_LOAD( "mpe-3.3h",     0x0000, 0x1000, CRC(a0919392) SHA1(8a090cb8d483a3d67c7360058e3fdd70e151cd62) )
409
410   ROM_REGION( 0x0340, REGION_PROMS, 0 )
411   ROM_LOAD( "mpc-4.2a",     0x0000, 0x0200, CRC(07f99284) SHA1(dfc52958f2520e1ce4446dd4c84c91413bbacf76) )
412   ROM_LOAD( "mpc-3.1m",     0x0200, 0x0020, CRC(6a57eff2) SHA1(2d1c12dab5915da2ccd466e39436c88be434d634) ) /* background palette */
413   ROM_LOAD( "mpc-1.1f",     0x0220, 0x0020, CRC(26979b13) SHA1(8c41a8cce4f3384c392a9f7a223a50d7be0e14a5) ) /* sprite palette */
414   ROM_LOAD( "mpc-2.2h",     0x0240, 0x0100, CRC(7ae4cd97) SHA1(bc0662fac82ffe65f02092d912b2c2b0c7a8ac2b) ) /* sprite lookup table */
415ROM_END
416
417ROM_START( mpatrolw )
418   ROM_REGION( 0x10000, REGION_CPU1, 0 )
419   ROM_LOAD( "mpa-1w.3m",    0x0000, 0x1000, CRC(baa1a1d4) SHA1(7968a7f221e7f4c9c81ddc8de17f6568e17b9ea8) )
420   ROM_LOAD( "mpa-2w.3l",    0x1000, 0x1000, CRC(52459e51) SHA1(ae685b7848baa1b87a3f2bce97356286171e16d4) )
421   ROM_LOAD( "mpa-3w.3k",    0x2000, 0x1000, CRC(9b249fe5) SHA1(c01e0d572c4c163f3cf4b2aa9f4246427811b78d) )
422   ROM_LOAD( "mpa-4w.3j",    0x3000, 0x1000, CRC(fee76972) SHA1(c3166b027f89f61964ead804d3c2da387454c4c2) )
423
424   ROM_REGION( 0x8000, REGION_CPU2, 0 )
425   ROM_LOAD( "mp-s1.1a",     0x7000, 0x1000, CRC(561d3108) SHA1(4998c68a9e9a8002251fa8f07aa1082444a9dc80) )
426
427   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
428   ROM_LOAD( "mpe-5w.3e",    0x0000, 0x1000, CRC(f56e01fe) SHA1(93f582d63b9cd5c6dca207aa57b213c939cdda1d) )       /* chars */
429   ROM_LOAD( "mpe-4w.3f",    0x1000, 0x1000, CRC(caaba2d9) SHA1(7016a26c2d01e3209749598e993cd8ce91f12c88) )
430
431   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
432   ROM_LOAD( "mpb-2.3m",     0x0000, 0x1000, CRC(707ace5e) SHA1(93c682e13e74bce29ced3a87bffb29569c114c3b) )       /* sprites */
433   ROM_LOAD( "mpb-1.3n",     0x1000, 0x1000, CRC(9b72133a) SHA1(1393ef92ae1ad58a4b62ca1660c0793d30a8b5e2) )
434
435   ROM_REGION( 0x1000, REGION_GFX3, ROMREGION_DISPOSE )
436   ROM_LOAD( "mpe-1.3l",     0x0000, 0x1000, CRC(c46a7f72) SHA1(8bb7c9acaf6833fb6c0575b015991b873a305a84) )       /* background graphics */
437
438   ROM_REGION( 0x1000, REGION_GFX4, ROMREGION_DISPOSE )
439   ROM_LOAD( "mpe-2.3k",     0x0000, 0x1000, CRC(c7aa1fb0) SHA1(14c6c76e1d0db2c0745e5d6d33ea6945fac8e9ee) )
440
441   ROM_REGION( 0x1000, REGION_GFX5, ROMREGION_DISPOSE )
442   ROM_LOAD( "mpe-3.3h",     0x0000, 0x1000, CRC(a0919392) SHA1(8a090cb8d483a3d67c7360058e3fdd70e151cd62) )
443
444   ROM_REGION( 0x0340, REGION_PROMS, 0 )
445   ROM_LOAD( "mpc-4a.2a",    0x0000, 0x0200, CRC(cb0a5ff3) SHA1(d3f88b4e0c4858abac8b52105656ecece0cf4df9) )
446   ROM_LOAD( "mpc-3.1m",     0x0200, 0x0020, CRC(6a57eff2) SHA1(2d1c12dab5915da2ccd466e39436c88be434d634) ) /* background palette */
447   ROM_LOAD( "mpc-1.1f",     0x0220, 0x0020, CRC(26979b13) SHA1(8c41a8cce4f3384c392a9f7a223a50d7be0e14a5) ) /* sprite palette */
448   ROM_LOAD( "mpc-2.2h",     0x0240, 0x0100, CRC(7ae4cd97) SHA1(bc0662fac82ffe65f02092d912b2c2b0c7a8ac2b) ) /* sprite lookup table */
449ROM_END
450
451
452ROM_START( alpha1v )
453   ROM_REGION( 0x10000, REGION_CPU1, 0 )
454   ROM_LOAD( "2-m3",      0x0000, 0x1000, CRC(3a679d34) SHA1(1a54a43070c56dc91d4d258f29e29613bb309f1c) )
455   ROM_LOAD( "3-l3",      0x1000, 0x1000, CRC(2f09df64) SHA1(e91602e9e41ad24dd1d7f384ed81b9bdaadd03e1) )
456   ROM_LOAD( "4-k3",      0x2000, 0x1000, CRC(64fb9c8a) SHA1(735fd00cc42193a417e6cde75f12b4cf2e804942) )
457   ROM_LOAD( "5-j3",      0x3000, 0x1000, CRC(d1643d18) SHA1(7c794b82e17e2ba0a6237e3fc20d8314f6c2481c) )
458   ROM_LOAD( "6-h3",      0x4000, 0x1000, CRC(cf34ab51) SHA1(3696da71e2bc7edd1ee7aeaac87be5386608c09e) )
459   ROM_LOAD( "7-f3",      0x5000, 0x1000, CRC(99db9781) SHA1(a56a675cc4cbc9681bfe8052f51f19336eb2a0a6) )
460   ROM_LOAD( "7a e3",     0x6000, 0x1000, CRC(3b0b4b0d) SHA1(0d8eea1e2db269943611289b3490a578ee347f85) )
461
462   ROM_REGION( 0x8000, REGION_CPU2, 0 )
463   ROM_LOAD( "1-a1",      0x7000, 0x1000, CRC(9e07fdd5) SHA1(ed4f462fcfe91fa8e88bfeaaba0a0c11fa0b4601) )
464
465   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
466   ROM_LOAD( "14-e3",     0x0000, 0x1000, CRC(cf00c737) SHA1(415e90289039cac4d04cb1d559f1378ca6a32132) )       /* chars */
467   ROM_LOAD( "13-f3",     0x1000, 0x1000, CRC(4b799229) SHA1(42cbdcf787b08b041d30504d699a12c378224933) )
468
469   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE ) // 3bpp? (mpatrol is 2bpp..)
470   ROM_LOAD( "15-n3",     0x0000, 0x1000, CRC(dc26df76) SHA1(dd1cff7935f5559f9d1b440e02d5e5aa521b0054) )
471   ROM_LOAD( "16-l3",     0x1000, 0x1000, CRC(39b9863b) SHA1(da9da9a1066188f050c422dfed1bbbd3ba612ccc) )
472   ROM_LOAD( "17-k3",     0x2000, 0x1000, CRC(cfd90773) SHA1(052e126888b6de636db9c521a090699c282b620b) )
473
474   /* all the background roms just contain stars.. */
475   ROM_REGION( 0x1000, REGION_GFX3, ROMREGION_DISPOSE )
476   ROM_LOAD( "11-k3",     0x0000, 0x1000, CRC(7659440a) SHA1(2efd27c82913513dd03e799f1ed3c10b0863677d) ) // these two match..
477   ROM_LOAD( "12-jh3",    0x0000, 0x1000, CRC(7659440a) SHA1(2efd27c82913513dd03e799f1ed3c10b0863677d) )
478
479   ROM_REGION( 0x1000, REGION_GFX4, ROMREGION_DISPOSE )
480   ROM_LOAD( "9-n3",     0x0000, 0x1000, CRC(0fdb7d13) SHA1(e828254a4f94df633d338b5772719276d41c6b7f) )
481
482   ROM_REGION( 0x1000, REGION_GFX5, ROMREGION_DISPOSE )
483   ROM_LOAD( "10-lm3",     0x0000, 0x1000, CRC(9dde3a75) SHA1(293d093485be19bfb20685d76a08ac78e24062bf) )
484
485   ROM_REGION( 0x0340, REGION_PROMS, 0 )
486   ROM_LOAD( "63s481-a2",     0x0000, 0x0200, CRC(58678ea8) SHA1(b13a78a5bca8ad5bdec1293512b53654768a7a7a) )
487   ROM_LOAD( "18s030-m1",     0x0200, 0x0020, CRC(6a57eff2) SHA1(2d1c12dab5915da2ccd466e39436c88be434d634) ) /* background palette */
488   ROM_LOAD( "mb7051-f1",     0x0220, 0x0020, CRC(d8bdd0df) SHA1(ca522428927911808214d319af314f601497ded4) ) /* sprite palette */
489   ROM_LOAD( "mb7052-h2",     0x0240, 0x0100, CRC(ce9f0ef9) SHA1(3afb94ed033f272983bbed22a59856df7824ef8a) ) /* sprite lookup table */
490ROM_END
491
492
493
494/*************************************
495 *
496 *  Game drivers
497 *
498 *************************************/
499
500GAME( 1982, mpatrol,  0,       m52,     mpatrol,  0, ROT0, "Irem", "Moon Patrol", GAME_SUPPORTS_SAVE )
501GAME( 1982, mpatrolw, mpatrol, m52,     mpatrolw, 0, ROT0, "Irem (Williams license)", "Moon Patrol (Williams)", GAME_SUPPORTS_SAVE )
502GAME( 1988, alpha1v,  0,       alpha1v, alpha1v,  0, ROT0, "Vision Electronics", "Alpha One (Vision Electronics / Kyle Hodgetts)", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/warpwarp.c
r1649r1650
127127***************************************************************************/
128128
129129#include "driver.h"
130#include "deprecat.h"
130131#include "sound/custom.h"
131132#include "includes/warpwarp.h"
132133#include "geebee.lh"
src/mame/drivers/cubocd32.c
r1649r1650
4848#include "sound/custom.h"
4949#include "includes/amiga.h"
5050#include "includes/cubocd32.h"
51//#include "memconv.h"
5251
5352//READWRITE16BETO32BE(amiga_cia32,amiga_cia_r,amiga_cia_w)
5453//READWRITE16BETO32BE(amiga_custom32,amiga_custom_r,amiga_custom_w)
src/mame/drivers/wheelfir.c
r1649r1650
4949
5050
5151#include "driver.h"
52#include "deprecat.h"
53
5254static int toggle_bit;
5355
5456static READ16_HANDLER( wheelfir_rand1 )
r1649r1650
299301    if (base<0x000000) base = 0x000000;
300302    if (base>0x3c0000) base = 0x3c0000;
301303
302    copybitmap(bitmap, wheelfir_tmp_bitmap[2], 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
303    //copybitmap(bitmap, wheelfir_tmp_bitmap[1], 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 0);
304    copybitmap(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 0);
304    copybitmap(bitmap, wheelfir_tmp_bitmap[2], 0, 0, 0, 0, cliprect);
305    //copybitmap_trans(bitmap, wheelfir_tmp_bitmap[1], 0, 0, 0, 0, cliprect, 0);
306    copybitmap_trans(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, 0);
305307    fillbitmap(wheelfir_tmp_bitmap[0], 0,&machine->screen[0].visarea);
306308
307309    if ( input_code_pressed(KEYCODE_R) )
r1649r1650
323325    }
324326    */
325327
326   copybitmap(bitmap, render_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
327   copybitmap(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 0);
328   copybitmap(bitmap, render_bitmap, 0, 0, 0, 0, cliprect);
329   copybitmap_trans(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, 0);
328330
329331   {
330332      int x;
src/mame/drivers/steaser.c
r1649r1650
3535
3636
3737#include "driver.h"
38#include "deprecat.h"
3839
3940static VIDEO_START(steaser)
4041{
src/mame/drivers/cbuster.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "cpu/h6280/h6280.h"
1819#include "sound/2203intf.h"
1920#include "sound/2151intf.h"
src/mame/drivers/dunhuang.c
r1649r1650
5050*********************************************************************************************************************/
5151
5252#include "driver.h"
53#include "deprecat.h"
5354#include "sound/ay8910.h"
5455#include "sound/okim6295.h"
5556#include "sound/2413intf.h"
src/mame/drivers/onetwo.c
r1649r1650
3636*/
3737
3838#include "driver.h"
39#include "deprecat.h"
3940#include "sound/okim6295.h"
4041#include "sound/3812intf.h"
4142
src/mame/drivers/ojankohs.c
r1649r1650
3232******************************************************************************/
3333
3434#include "driver.h"
35#include "deprecat.h"
3536#include "cpu/z80/z80.h"
3637#include "sound/ay8910.h"
3738#include "sound/msm5205.h"
src/mame/drivers/wc90b.c
r1649r1650
7171*/
7272
7373#include "driver.h"
74#include "deprecat.h"
7475#include "cpu/z80/z80.h"
7576#include "sound/2203intf.h"
7677#include "sound/msm5205.h"
src/mame/drivers/kncljoe.c
r1649r1650
3737extern UINT8 *kncljoe_scrollregs;
3838
3939
40static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
41   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
42   AM_RANGE(0xc000, 0xcfff) AM_READ(MRA8_RAM)      /* videoram */
40static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
41   AM_RANGE(0x0000, 0xbfff) AM_ROM
42   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(MRA8_RAM, kncljoe_videoram_w) AM_BASE(&videoram)
43   AM_RANGE(0xd000, 0xd001) AM_WRITE(kncljoe_scroll_w) AM_BASE(&kncljoe_scrollregs)
4344   AM_RANGE(0xd800, 0xd800) AM_READ(input_port_0_r) /* IN 0 */
4445   AM_RANGE(0xd801, 0xd801) AM_READ(input_port_1_r) /* IN 1 */
4546   AM_RANGE(0xd802, 0xd802) AM_READ(input_port_2_r) /* IN 2 */
4647   AM_RANGE(0xd803, 0xd803) AM_READ(input_port_3_r)   /* DSW A */
4748   AM_RANGE(0xd804, 0xd804) AM_READ(input_port_4_r)   /* DSW B */
49   AM_RANGE(0xd800, 0xd800) AM_WRITE(irem_sound_cmd_w)
50   AM_RANGE(0xd801, 0xd803) AM_WRITE(kncljoe_control_w)
4851   AM_RANGE(0xd807, 0xd807) AM_READ(MRA8_NOP)      /* unknown read */
4952   AM_RANGE(0xd817, 0xd817) AM_READ(MRA8_NOP)      /* unknown read */
50   AM_RANGE(0xe800, 0xefff) AM_READ(MRA8_RAM)      /* spriteram */
51   AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_RAM)
53   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
54   AM_RANGE(0xf000, 0xffff) AM_RAM
5255ADDRESS_MAP_END
5356
54static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
55   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
56   AM_RANGE(0xc000, 0xcfff) AM_WRITE(kncljoe_videoram_w) AM_BASE(&videoram)
57   AM_RANGE(0xd000, 0xd001) AM_WRITE(kncljoe_scroll_w) AM_BASE(&kncljoe_scrollregs)
58   AM_RANGE(0xd800, 0xd800) AM_WRITE(irem_sound_cmd_w)
59   AM_RANGE(0xd801, 0xd803) AM_WRITE(kncljoe_control_w)
60   AM_RANGE(0xe800, 0xefff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
61   AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_RAM)
62ADDRESS_MAP_END
63
6457/******************************************************************************/
6558
6659static INPUT_PORTS_START( kncljoe )
r1649r1650
181174   /* basic machine hardware */
182175//  MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */
183176   MDRV_CPU_ADD(Z80, 5500000) /* 4 MHz is too low. The game loop never finishes a frame in time. */
184   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
177   MDRV_CPU_PROGRAM_MAP(main_map,0)
185178   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
186179
187180   MDRV_SCREEN_REFRESH_RATE(60)
r1649r1650
201194   MDRV_VIDEO_UPDATE(kncljoe)
202195
203196   /* sound hardware */
204   MDRV_IMPORT_FROM(irem_audio)
197   MDRV_IMPORT_FROM(m52_small_audio)
205198MACHINE_DRIVER_END
206199
207200
r1649r1650
212205   ROM_LOAD( "kj-2.bin", 0x4000, 0x4000, CRC(cb11514b) SHA1(c75d4019d1617493ff074ce8187a81ad70d9b60c) )
213206   ROM_LOAD( "kj-3.bin", 0x8000, 0x4000, CRC(0f50697b) SHA1(412c6aba270824299ca2a74e9bea42b83e69797b) )
214207
215   ROM_REGION( 0x10000, REGION_CPU2, 0 )  /* 64k for audio code */
216   ROM_LOAD( "kj-13.bin",0xe000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) )
208   ROM_REGION( 0x8000, REGION_CPU2, 0 )  /* 64k for audio code */
209   ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) )
217210
218211   ROM_REGION( 0xc000, REGION_GFX1, ROMREGION_DISPOSE )   /* tiles */
219212   ROM_LOAD( "kj-10.bin", 0x0000,  0x4000, CRC(74d3ba33) SHA1(c7887d690cb7f7a7b24d59d490ffc088fb6cc49c) )
r1649r1650
244237   ROM_LOAD( "kj-2.bin", 0x4000, 0x4000, CRC(cb11514b) SHA1(c75d4019d1617493ff074ce8187a81ad70d9b60c) )
245238   ROM_LOAD( "kj-3.bin", 0x8000, 0x4000, CRC(0f50697b) SHA1(412c6aba270824299ca2a74e9bea42b83e69797b) )
246239
247   ROM_REGION( 0x10000, REGION_CPU2, 0 )  /* 64k for audio code */
248   ROM_LOAD( "kj-13.bin",0xe000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) )
240   ROM_REGION( 0x8000, REGION_CPU2, 0 )  /* 64k for audio code */
241   ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) )
249242
250243   ROM_REGION( 0xc000, REGION_GFX1, ROMREGION_DISPOSE )   /* tiles */
251244   ROM_LOAD( "kj-10.bin", 0x0000,  0x4000, CRC(74d3ba33) SHA1(c7887d690cb7f7a7b24d59d490ffc088fb6cc49c) )
r1649r1650
276269   ROM_LOAD( "bcrush2.bin", 0x4000, 0x4000, CRC(1be4c731) SHA1(11f3a33263d66172902dfb6f3fe2d0ab5cad38d7) )
277270   ROM_LOAD( "bcrush3.bin", 0x8000, 0x4000, CRC(0772d993) SHA1(430f0319bd4765add2f1ee197e7217fdf9ae79c8) )
278271
279   ROM_REGION( 0x10000, REGION_CPU2, 0 )  /* 64k for audio code */
280   ROM_LOAD( "kj-13.bin",0xe000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) )
272   ROM_REGION( 0x8000, REGION_CPU2, 0 )  /* 64k for audio code */
273   ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) )
281274
282275   ROM_REGION( 0xc000, REGION_GFX1, ROMREGION_DISPOSE )   /* tiles */
283276   ROM_LOAD( "bcrush10.bin", 0x0000,  0x4000, CRC(a62f4572) SHA1(4e38e175e25a955e5f83cac8c935163e2e861e94) )
src/mame/drivers/spdodgeb.c
r1649r1650
2222***************************************************************************/
2323
2424#include "driver.h"
25#include "deprecat.h"
2526#include "cpu/m6809/m6809.h"
2627#include "sound/3812intf.h"
2728#include "sound/msm5205.h"
src/mame/drivers/cvs.c
r1649r1650
8383***************************************************************************/
8484
8585#include "driver.h"
86#include "deprecat.h"
8687#include "cpu/s2650/s2650.h"
8788#include "sound/dac.h"
8889#include "sound/5110intf.h"
src/mame/drivers/turbo.c
r1649r1650
145145**************************************************************************/
146146
147147#include "driver.h"
148#include "deprecat.h"
148149#include "machine/8255ppi.h"
149150#include "turbo.h"
150151#include "machine/segacrpt.h"
r1649r1650
162163 *
163164 *************************************/
164165
165#define MASTER_CLOCK      (19968000)
166#define MASTER_CLOCK      (XTAL_19_968MHz)
166167
167168#define PIXEL_CLOCK         (MASTER_CLOCK/4*TURBO_X_SCALE)
168169
src/mame/drivers/seta.c
r1649r1650
8181- The NEC D4701 used by Caliber 50 is a mouse interface IC (uPD4701c).
8282  Of course it's used to control the spinner. DownTown probably has it as well.
8383
84DIP Locations verified from manuals for:
85- Zing Zing Zip
86- Extreme Downhill
87
8488TODO:
8589- I think the best way to correctly align tilemaps and sprites and account for
8690  both flipping and different visible areas is to have a table with per game
r1649r1650
8993  Current issues: metafox test grid not aligned when screen flipped, madshark & utoukond
9094  ("floating tilemaps" sprites when flipped)
9195  krzybowl not aligned vertically when screen flipped
96  zombraid not aligned when flipped vertically or horizantally
9297
9398- bad sound in sokonuke?
9499- in msgunda1, colors for the score display screw up after the second animation
r1649r1650
12831288***************************************************************************/
12841289
12851290#include "driver.h"
1291#include "deprecat.h"
12861292#include "seta.h"
12871293#include "machine/6821pia.h"
12881294#include "machine/6850acia.h"
r1649r1650
33453351   PORT_BIT(  0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN )
33463352
33473353   PORT_START_TAG("IN3")   // 2 DSWs - $e00001 & 3.b
3348   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
3354   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
33493355   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
33503356   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
33513357   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
r1649r1650
33543360   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
33553361   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
33563362   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
3357   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
3363   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
33583364   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
33593365   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
33603366   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
r1649r1650
33633369   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
33643370   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
33653371   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
3366   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) )
3372   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
33673373   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
33683374   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
3369   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 2-7" )   // manual: unused
3370   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
3371   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3375   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW2:8" ) /* Listed as "Unused" */
33723376
3373   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) )
3377   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
33743378   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
33753379   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3376   PORT_SERVICE( 0x0200, IP_ACTIVE_LOW )
3377   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
3380   PORT_SERVICE_DIPLOC(  0x0200, IP_ACTIVE_LOW, "SW1:2" )
3381   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
33783382   PORT_DIPSETTING(      0x0800, DEF_STR( Easy )    )
33793383   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal )  )
33803384   PORT_DIPSETTING(      0x0400, DEF_STR( Hard )    )
33813385   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3382   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Lives ) )
3386   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6")
33833387   PORT_DIPSETTING(      0x0000, "2" )
33843388   PORT_DIPSETTING(      0x3000, "3" )
33853389   PORT_DIPSETTING(      0x1000, "4" )
33863390   PORT_DIPSETTING(      0x2000, "5" )
3387   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Bonus_Life ) )
3391   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7,8")
33883392   PORT_DIPSETTING(      0xc000, DEF_STR( None ) )
33893393   PORT_DIPSETTING(      0x0000, "20K Only" )
33903394   PORT_DIPSETTING(      0x8000, "20K, Every 30K" )
r1649r1650
34143418   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
34153419
34163420   PORT_START_TAG("IN3")   //2 DSWs - $600001 & 3.b
3417   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Demo_Sounds ) )
3421   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
34183422   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
34193423   PORT_DIPSETTING(      0x0001, DEF_STR( On ) )
3420   PORT_DIPNAME( 0x0002, 0x0002, "Coinage Type" )   // not supported
3424   PORT_DIPNAME( 0x0002, 0x0002, "Coinage Type" ) PORT_DIPLOCATION("SW2:2")   // not supported
34213425   PORT_DIPSETTING(      0x0002, "1" )
34223426   PORT_DIPSETTING(      0x0000, "2" )
3423   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_A ) )
3427   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,4,5")
34243428   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
34253429   PORT_DIPSETTING(      0x000c, DEF_STR( 2C_1C ) )
34263430   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_1C ) )
r1649r1650
34293433   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_5C ) )
34303434   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
34313435   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
3432   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_B ) )
3436   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,7,8")
34333437   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
34343438   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_4C ) )
34353439   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )
3436   PORT_DIPSETTING(      0x0080, "3 Coins/7 Credit" )
3440   PORT_DIPSETTING(      0x0080, "3 Coins/7 Credits" )
34373441   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_5C ) )
34383442   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_6C ) )
34393443   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
34403444   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
34413445
3442   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
3446   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
34433447   PORT_DIPSETTING(      0x0200, "1" )
34443448   PORT_DIPSETTING(      0x0300, "2" )
34453449   PORT_DIPSETTING(      0x0100, "3" )
34463450   PORT_DIPSETTING(      0x0000, "4" )
3447   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
3451   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
34483452   PORT_DIPSETTING(      0x0800, DEF_STR( Easy )    )
34493453   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal )  )
34503454   PORT_DIPSETTING(      0x0400, DEF_STR( Hard )    )
34513455   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3452   PORT_DIPNAME( 0x1000, 0x1000, "2 Player Game" )
3456   PORT_DIPNAME( 0x1000, 0x1000, "2 Player Game" ) PORT_DIPLOCATION("SW1:5")
34533457   PORT_DIPSETTING(      0x1000, "2 Credits" )
34543458   PORT_DIPSETTING(      0x0000, "1 Credit"  )
3455   PORT_DIPNAME( 0x2000, 0x2000, "Continue" )
3459   PORT_DIPNAME( 0x2000, 0x2000, "Continue" ) PORT_DIPLOCATION("SW1:6")
34563460   PORT_DIPSETTING(      0x2000, "1 Credit" )
34573461   PORT_DIPSETTING(      0x0000, "1 Coin"   )
3458   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Flip_Screen ) )
3462   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
34593463   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
34603464   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3461   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
3465   PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" )
34623466INPUT_PORTS_END
34633467
34643468
r1649r1650
34793483   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
34803484   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
34813485   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_TILT     )
3482   PORT_DIPNAME( 0x0010, 0x0000, "Title" )
3486   PORT_DIPNAME( 0x0010, 0x0000, "Title" )      /* This is a jumper pad */
34833487   PORT_DIPSETTING(      0x0010, "Thunder & Lightning 2" )
34843488   PORT_DIPSETTING(      0x0000, "Block Carnival" )
34853489
34863490   PORT_START_TAG("IN3")   //2 DSWs - $300003 & 1.b
3487   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
3491   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
34883492   PORT_DIPSETTING(      0x0002, DEF_STR( Easy )    )
34893493   PORT_DIPSETTING(      0x0003, DEF_STR( Normal )  )
34903494   PORT_DIPSETTING(      0x0001, DEF_STR( Hard )    )
34913495   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3492   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) )
3496   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4")
34933497   PORT_DIPSETTING(      0x000c, "20K, Every 50K" )
34943498   PORT_DIPSETTING(      0x0004, "20K, Every 70K" )
34953499   PORT_DIPSETTING(      0x0008, "30K, Every 60K" )
34963500   PORT_DIPSETTING(      0x0000, "30K, Every 90K" )
3497   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
3501   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:5,6")
34983502   PORT_DIPSETTING(      0x0000, "1" )
34993503   PORT_DIPSETTING(      0x0030, "2" )
35003504   PORT_DIPSETTING(      0x0020, "3" )
35013505   PORT_DIPSETTING(      0x0010, "4" )
3502   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 2-6" )
3503   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
3504   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3505   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )
3506   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */
3507   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:8") /* Listed as "Unused" */
35063508   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
35073509   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
35083510
3509   PORT_DIPNAME( 0x0100, 0x0100, "Unknown 1-0" )
3510   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
3511   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3512   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
3511   PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW1:1" ) /* Listed as "Unused" */
3512   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
35133513   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
35143514   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3515   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) )
3515   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3")
35163516   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
35173517   PORT_DIPSETTING(      0x0400, DEF_STR( On ) )
3518   PORT_DIPNAME( 0x0800, 0x0800, "Unknown 1-3" )   // service mode, according to a file in the archive
3518   PORT_DIPNAME( 0x0800, 0x0800, "Unknown 1-3" ) PORT_DIPLOCATION("SW1:4")   // service mode, according to a file in the archive
35193519   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
35203520   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3521   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )
3521   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
35223522   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )
35233523   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )
35243524   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
35253525   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )
3526   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) )
3526   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
35273527   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )
35283528   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )
35293529   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
r1649r1650
36373637   PORT_DIPSETTING(      0x0000, "Japan (2 buttons)" )
36383638
36393639   PORT_START_TAG("IN3")
3640   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
3640   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
36413641   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
36423642   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
36433643   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
r1649r1650
36463646   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
36473647   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
36483648   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
3649   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
3650   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ))
3649   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
3650   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
36513651   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
36523652   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
36533653   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
r1649r1650
36553655   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
36563656   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
36573657   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
3658   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) )
3658   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
36593659   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
36603660   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
3661   PORT_DIPNAME( 0x0080, 0x0000, "Auto Shot" )
3661   PORT_DIPNAME( 0x0080, 0x0000, "Auto Shot" ) PORT_DIPLOCATION("SW2:8")
36623662   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
36633663   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
36643664
3665   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) )
3665   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
36663666   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
36673667   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3668   PORT_SERVICE( 0x0200, IP_ACTIVE_LOW )
3669   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
3668   PORT_SERVICE_DIPLOC(  0x0200, IP_ACTIVE_LOW, "SW1:2" )
3669   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
36703670   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
36713671   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
36723672   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
36733673   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3674   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Lives ) )
3674   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6")
36753675   PORT_DIPSETTING(      0x0000, "1" )
36763676   PORT_DIPSETTING(      0x1000, "2" )
36773677   PORT_DIPSETTING(      0x3000, "3" )
36783678   PORT_DIPSETTING(      0x2000, "5" )
3679   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Bonus_Life ) )
3679   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7,8")
36803680   PORT_DIPSETTING(      0x8000, "300k and every 800k" )
36813681   PORT_DIPSETTING(      0xc000, "500k and every 1000k" )
36823682   PORT_DIPSETTING(      0x4000, "800k and 2000k only" )
r1649r1650
37223722   PORT_DIPSETTING(      0x0000, "Seta USA / Romstar" )
37233723
37243724   PORT_START_TAG("IN3")   //2 DSWs - $600001 & 3.b
3725   PORT_DIPNAME( 0x0003, 0x0002, DEF_STR( Difficulty ) )
3725   PORT_DIPNAME( 0x0003, 0x0002, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:1,2")
37263726   PORT_DIPSETTING(      0x0003, DEF_STR( Easy ) )
37273727   PORT_DIPSETTING(      0x0002, DEF_STR( Normal ) )
37283728   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
37293729   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3730   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) )
3730   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:3,4")
37313731   PORT_DIPSETTING(      0x0008, "150K, Every 300K" )
37323732   PORT_DIPSETTING(      0x000c, "200K, Every 400K" )
37333733   PORT_DIPSETTING(      0x0004, "300K, Every 500K" )
37343734   PORT_DIPSETTING(      0x0000, "400K Only" )
3735   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
3735   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6")
37363736   PORT_DIPSETTING(      0x0000, "1" )
37373737   PORT_DIPSETTING(      0x0010, "2" )
37383738   PORT_DIPSETTING(      0x0030, "3" )
37393739   PORT_DIPSETTING(      0x0020, "5" )
3740   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 1-6" )   /* Labeled "Don't Touch" in manual */
3741   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
3742   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3743   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 1-7*" )   /* Labeled "Don't Touch" in manual */
3740   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" )   /* Labeled "Don't Touch" in manual */
3741   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 1-8*" ) PORT_DIPLOCATION("SW1:8")   /* Labeled "Don't Touch" in manual (seems to be used though) */
37443742   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
37453743   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
37463744
3747   PORT_DIPNAME( 0x0100, 0x0100, "Unknown 2-0" )   /* Labeled "Don't Touch" in manual */
3748   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
3749   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3750   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
3745   PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW2:1" )   /* Labeled "Don't Touch" in manual */
3746   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:2")
37513747   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
37523748   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3753   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) )
3749   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
37543750   PORT_DIPSETTING(      0x0400, "1 of 4 Scenes" )
37553751   PORT_DIPSETTING(      0x0000, "1 of 8 Scenes" )
3756   PORT_SERVICE( 0x0800, IP_ACTIVE_LOW )
3757   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )
3752   PORT_SERVICE_DIPLOC(  0x0800, IP_ACTIVE_LOW, "SW2:4" )
3753   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:5,6")
37583754   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )
37593755   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )
37603756   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
37613757   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )
3762   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) )
3758   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:7,8")
37633759   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )
37643760   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )
37653761   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
r1649r1650
37903786   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
37913787
37923788   PORT_START_TAG("IN3")   //2 DSWs - $600001 & 3.b
3793   PORT_DIPNAME( 0x0001, 0x0000, "Sales" )         /* Manual for USA version says "Always Off" */
3789   PORT_DIPNAME( 0x0001, 0x0000, "Sales" )   PORT_DIPLOCATION("SW1:1")      /* Manual for USA version says "Always Off" */
37943790   PORT_DIPSETTING(      0x0001, "Japan Only" )
37953791   PORT_DIPSETTING(      0x0000, DEF_STR( World ) )
3796   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )
3792   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
37973793   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
37983794   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3799   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
3800   PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Demo_Sounds ) )
3795   PORT_SERVICE_DIPLOC(  0x0004, IP_ACTIVE_LOW, "SW1:3" )
3796   PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4")
38013797   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
38023798   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3803   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )
3799   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
38043800   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
38053801   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
38063802   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
38073803   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )
3808   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )
3804   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
38093805   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )
38103806   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )
38113807   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
38123808   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )
38133809// other coinage
38143810#if 0
3815   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )
3811   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
38163812   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
38173813   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
38183814   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
38193815   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
3820   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )
3816   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
38213817   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )
38223818   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )
38233819   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )
38243820   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
38253821#endif
38263822
3827   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) )
3823   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
38283824   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
38293825   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
38303826   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
38313827   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3832   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) )
3828   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4")
38333829   PORT_DIPSETTING(      0x0c00, "Never" )
38343830   PORT_DIPSETTING(      0x0800, "50K Only" )
38353831   PORT_DIPSETTING(      0x0400, "100K Only" )
38363832   PORT_DIPSETTING(      0x0000, "50K, Every 150K" )
3837   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Lives ) )
3833   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:5,6")
38383834   PORT_DIPSETTING(      0x1000, "2" )
38393835   PORT_DIPSETTING(      0x3000, "3" )
38403836   PORT_DIPSETTING(      0x0000, "4" )
38413837   PORT_DIPSETTING(      0x2000, "5" )
3842   PORT_DIPNAME( 0x4000, 0x0000, "World License" ) /* Manual for USA version says "Unused" */
3838   PORT_DIPNAME( 0x4000, 0x0000, "World License" ) PORT_DIPLOCATION("SW2:7") /* Manual for USA version says "Unused" */
38433839   PORT_DIPSETTING(      0x4000, "Romstar" )
38443840   PORT_DIPSETTING(      0x0000, "Taito" )
3845   PORT_DIPNAME( 0x8000, 0x8000, "Coinage Type" ) /* Manual for USA version says "Unused", but currently not implemented */
3841   PORT_DIPNAME( 0x8000, 0x8000, "Coinage Type" ) PORT_DIPLOCATION("SW2:8") /* Manual for USA version says "Unused", but currently not implemented */
38463842   PORT_DIPSETTING(      0x8000, "1" )
38473843   PORT_DIPSETTING(      0x0000, "2" )
38483844
r1649r1650
38773873   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
38783874
38793875   PORT_START_TAG("IN3")   //2 DSWs - $600001 & 3.b
3880   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
3876   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
38813877   PORT_DIPSETTING(      0x0004, DEF_STR( 4C_1C ) )
38823878   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
38833879   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_1C ) )
r1649r1650
38863882   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_3C ) )
38873883   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_4C ) )
38883884   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
3889   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
3885   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
38903886   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_1C ) )
38913887   PORT_DIPSETTING(      0x0028, DEF_STR( 3C_1C ) )
38923888   PORT_DIPSETTING(      0x0030, DEF_STR( 2C_1C ) )
r1649r1650
38953891   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
38963892   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_4C ) )
38973893   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
3898   PORT_DIPNAME( 0x0040, 0x0040, "Shared Credits" )
3894   PORT_DIPNAME( 0x0040, 0x0040, "Shared Credits" ) PORT_DIPLOCATION("SW2:7")
38993895   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
39003896   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
3901   PORT_DIPNAME( 0x0080, 0x0080, "Credits To Start" )
3897   PORT_DIPNAME( 0x0080, 0x0080, "Credits To Start" ) PORT_DIPLOCATION("SW2:8")
39023898   PORT_DIPSETTING(      0x0080, "1" )
39033899   PORT_DIPSETTING(      0x0000, "2" )
39043900
3905   PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )
3906   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
3901   PORT_SERVICE_DIPLOC(  0x0100, IP_ACTIVE_LOW, "SW1:1" )
3902   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
39073903   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
39083904   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3909   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Demo_Sounds ) )
3905   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3")
39103906   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
39113907   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3912   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) )
3908   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5")
39133909   PORT_DIPSETTING(      0x1000, DEF_STR( Easy ) )
39143910   PORT_DIPSETTING(      0x1800, DEF_STR( Normal ) )
39153911   PORT_DIPSETTING(      0x0800, DEF_STR( Hard ) )
39163912   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3917   PORT_DIPNAME( 0x6000, 0x6000, DEF_STR( Lives ) )
3913   PORT_DIPNAME( 0x6000, 0x6000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:6,7")
39183914   PORT_DIPSETTING(      0x4000, "2" )
39193915   PORT_DIPSETTING(      0x6000, "3" )
39203916   PORT_DIPSETTING(      0x2000, "4" )
39213917   PORT_DIPSETTING(      0x0000, "5" )
3922   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Language ) )
3918   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:8")
39233919   PORT_DIPSETTING(      0x0000, DEF_STR( English ) )
39243920   PORT_DIPSETTING(      0x8000, DEF_STR( Japanese ) )
39253921INPUT_PORTS_END
r1649r1650
39703966   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
39713967
39723968   PORT_START_TAG("IN3") //2 DSWs - $400009 & b.b
3973   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
3969   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
39743970   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
39753971   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3976   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) )
3972   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
39773973   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
39783974   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
3979   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
3975   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
39803976   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
39813977   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
39823978   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
39833979   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3984   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Free_Play ) )
3980   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:5")
39853981   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
39863982   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3987   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Cabinet ) )
3983   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:6")
39883984   PORT_DIPSETTING(      0x0020, DEF_STR( Upright ) )
39893985   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
3990   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Controls ) )
3986   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW2:7")
39913987   PORT_DIPSETTING(      0x0040, "2" )
39923988   PORT_DIPSETTING(      0x0000, "1" )
3993   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
3989   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW2:8" )
39943990
3995   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
3991   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
39963992   PORT_DIPSETTING(      0x0500, DEF_STR( 3C_1C ) )
39973993   PORT_DIPSETTING(      0x0600, DEF_STR( 2C_1C ) )
39983994   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
r1649r1650
40013997   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_4C ) )
40023998   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_5C ) )
40033999   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
4004   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
4000   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6")
40054001   PORT_DIPSETTING(      0x2800, DEF_STR( 3C_1C ) )
40064002   PORT_DIPSETTING(      0x3000, DEF_STR( 2C_1C ) )
40074003   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
r1649r1650
40104006   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_4C ) )
40114007   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_5C ) )
40124008   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
4013   PORT_DIPNAME( 0x4000, 0x4000, "Cheap Continue" )
4014   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
4015   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
4016   PORT_DIPNAME( 0x8000, 0x8000, "Game Mode" )
4009   PORT_DIPNAME( 0x4000, 0x4000, "Continue Coin" ) PORT_DIPLOCATION("SW1:7")
4010   PORT_DIPSETTING(      0x4000, "Normal: Start 1C / Continue 1C" )
4011   PORT_DIPSETTING(      0x0000, "Half Continue: Start 2C / Continue 1C" )
4012   PORT_DIPNAME( 0x8000, 0x8000, "Game Mode" ) PORT_DIPLOCATION("SW1:8")
40174013   PORT_DIPSETTING(      0x8000, "Finals Only" )
40184014   PORT_DIPSETTING(      0x0000, "Semi-Finals & Finals" )
40194015INPUT_PORTS_END
r1649r1650
40424038   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
40434039
40444040   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
4045   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) )
4041   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3,4")
40464042   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
40474043   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
40484044   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
r1649r1650
40594055   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
40604056   PORT_DIPSETTING(      0x0009, DEF_STR( 1C_7C ) )
40614057   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
4062   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_B ) )
4058   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,6")
40634059   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
40644060   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
40654061   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
40664062   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )
4067   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Language ) ) /* Yes, the shows it takes both switches */
4063   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:7,8") /* Yes, the manual shows it takes both switches */
40684064   PORT_DIPSETTING(      0x00c0, DEF_STR( Japanese ) )
40694065   PORT_DIPSETTING(      0x0000, DEF_STR( English ) )
40704066
4071   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
4067   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:1,2")
40724068   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
40734069   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
40744070   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
40754071   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
4076   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Lives ) )
4072   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:3,4")
40774073   PORT_DIPSETTING(      0x0800, "1" )
40784074   PORT_DIPSETTING(      0x0c00, "2" )
40794075   PORT_DIPSETTING(      0x0400, "3" )
40804076   PORT_DIPSETTING(      0x0000, "4" )
4081   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Bonus_Life ) )
4077   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:5,6")
40824078   PORT_DIPSETTING(      0x3000, "200K" )
40834079   PORT_DIPSETTING(      0x2000, "200K, Every 200K" )
40844080   PORT_DIPSETTING(      0x1000, "400K" )
40854081   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
4086   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
4082   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7")
40874083   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
40884084   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
4089   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
4085   PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" )
40904086INPUT_PORTS_END
40914087
40924088/***************************************************************************
r1649r1650
41254121   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
41264122
41274123   PORT_START_TAG("IN3")
4128   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
4124   PORT_DIPNAME( 0x0001, 0x0001, "Vertical Screen Flip" ) PORT_DIPLOCATION("SW2:1")
41294125   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
41304126   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4131   PORT_DIPNAME( 0x0002, 0x0000, "Mirror" )
4127   PORT_DIPNAME( 0x0002, 0x0000, "Horizontal Screen Flip" ) PORT_DIPLOCATION("SW2:2")
41324128   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
41334129   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
4134   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Demo_Sounds ) )
4130   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
41354131   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
41364132   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
4137   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) )
4133   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,5")
41384134   PORT_DIPSETTING(      0x0010, DEF_STR( Easy )    )
41394135   PORT_DIPSETTING(      0x0018, DEF_STR( Normal )  )
41404136   PORT_DIPSETTING(      0x0008, DEF_STR( Hard )    )
41414137   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
4142   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) )
4138   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:6")
41434139   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
41444140   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
4145   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
4146   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
4147   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4148   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
4141   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */
4142   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW2:8" )
41494143
4150   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
4144   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
41514145   PORT_DIPSETTING(      0x0500, DEF_STR( 3C_1C ) )
41524146   PORT_DIPSETTING(      0x0600, DEF_STR( 2C_1C ) )
41534147   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
r1649r1650
41564150   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_4C ) )
41574151   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_5C ) )
41584152   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
4159   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
4153   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6")
41604154   PORT_DIPSETTING(      0x2800, DEF_STR( 3C_1C ) )
41614155   PORT_DIPSETTING(      0x3000, DEF_STR( 2C_1C ) )
41624156   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
r1649r1650
41654159   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_4C ) )
41664160   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_5C ) )
41674161   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
4168   PORT_DIPNAME( 0x4000, 0x4000, "2 Coins to Start, 1 to Continue" )
4162   PORT_DIPNAME( 0x4000, 0x4000, "2 Coins to Start, 1 to Continue" ) PORT_DIPLOCATION("SW1:7")
41694163   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
41704164   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
4171   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )
4172   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
4173   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4165   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW1:8" ) /* Listed as "Unused" */
41744166
41754167   /* Gun on screen left=0xc0, right=0x40, top=0x48, bottom=0xa8 */
41764168   PORT_START_TAG("IN5")   /* Player 1 Gun X       ($f00003) */
r1649r1650
42074199   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
42084200
42094201   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
4210   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
4202   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
42114203   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
42124204   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
42134205   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
r1649r1650
42164208   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
42174209   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
42184210   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
4219   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
4211   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
42204212   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
42214213   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
42224214   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
r1649r1650
42254217   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
42264218   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
42274219   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
4228   PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) )
4220   PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
42294221   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
42304222   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4231   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 2-7" )   // ?? screen related
4223   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 2-8" ) PORT_DIPLOCATION("SW2:8")   // ?? screen related
42324224   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
42334225   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
42344226
4235   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) )
4227   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
42364228   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
42374229   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4238   PORT_SERVICE( 0x0200, IP_ACTIVE_LOW )
4239   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
4230   PORT_SERVICE_DIPLOC(  0x0200, IP_ACTIVE_LOW, "SW1:2" )
4231   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
42404232   PORT_DIPSETTING(      0x0800, DEF_STR( Easy )    )
42414233   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal )  )
42424234   PORT_DIPSETTING(      0x0400, DEF_STR( Hard )    )
42434235   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
4244   PORT_DIPNAME( 0x3000, 0x3000, "Energy" )
4236   PORT_DIPNAME( 0x3000, 0x3000, "Energy" ) PORT_DIPLOCATION("SW1:5,6")
42454237   PORT_DIPSETTING(      0x2000, "2" )
42464238   PORT_DIPSETTING(      0x3000, "3" )
42474239   PORT_DIPSETTING(      0x1000, "4" )
42484240   PORT_DIPSETTING(      0x0000, "5" )
4249   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Bonus_Life ) )
4241   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7,8")
42504242   PORT_DIPSETTING(      0x8000, "20K, Every 100K" )
42514243   PORT_DIPSETTING(      0xc000, "50K, Every 200K" )
42524244   PORT_DIPSETTING(      0x4000, "70K, 200K Only" )
r1649r1650
43614353   PORT_BIT(  0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN )
43624354
43634355   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
4364   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
4356   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
43654357   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
43664358   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4367   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) )
4359   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:2")
43684360   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
43694361   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
4370   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
4362   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
43714363   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
43724364   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
43734365   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
43744366   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
4375   PORT_DIPNAME( 0x0010, 0x0010, "Frames" )
4367   PORT_DIPNAME( 0x0010, 0x0010, "Frames" ) PORT_DIPLOCATION("SW1:5")
43764368   PORT_DIPSETTING(      0x0010, "10" )
43774369   PORT_DIPSETTING(      0x0000, "5" )
4378   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Cabinet ) )
4370   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:6")
43794371   PORT_DIPSETTING(      0x0020, DEF_STR( Upright ) )
43804372   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
4381   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Controls ) )
4373   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:7")
43824374   PORT_DIPSETTING(      0x0040, DEF_STR( Trackball ) )
43834375   PORT_DIPSETTING(      0x0000, DEF_STR( Joystick ) )
4384   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
4376   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
43854377
4386   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
4378   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
43874379   PORT_DIPSETTING(      0x0500, DEF_STR( 3C_1C ) )
43884380   PORT_DIPSETTING(      0x0600, DEF_STR( 2C_1C ) )
43894381   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
r1649r1650
43924384   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_4C ) )
43934385   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_5C ) )
43944386   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
4395   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
4387   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
43964388   PORT_DIPSETTING(      0x2800, DEF_STR( 3C_1C ) )
43974389   PORT_DIPSETTING(      0x3000, DEF_STR( 2C_1C ) )
43984390   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
r1649r1650
44014393   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_4C ) )
44024394   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_5C ) )
44034395   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
4404   PORT_DIPNAME( 0x4000, 0x4000, "Force Coinage" )
4396   PORT_DIPNAME( 0x4000, 0x4000, "Force Coinage" ) PORT_DIPLOCATION("SW2:7")
44054397   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
44064398   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_1C ) )
4407   PORT_DIPNAME( 0x8000, 0x8000, "Unknown 2-7" )
4399   PORT_DIPNAME( 0x8000, 0x8000, "Unknown 2-8" ) PORT_DIPLOCATION("SW2:8")
44084400   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
44094401   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
44104402
r1649r1650
44534445   PORT_DIPSETTING(      0x0000, DEF_STR( World ) )
44544446
44554447   PORT_START_TAG("IN3") //2 DSWs
4456   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
4448   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
44574449   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
44584450   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4459   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) )
4451   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
44604452   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
44614453   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
4462   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
4463   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
4464   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4465   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Bonus_Life ) )
4454   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW2:3" )
4455   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4,5")
44664456   PORT_DIPSETTING(      0x0018, "1000k" )
44674457   PORT_DIPSETTING(      0x0008, "1000k 2000k" )
44684458   PORT_DIPSETTING(      0x0010, "1500k 3000k" )
44694459   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
4470   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
4460   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7")
44714461   PORT_DIPSETTING(      0x0040, DEF_STR( Easy ) )
44724462   PORT_DIPSETTING(      0x0060, DEF_STR( Normal ) )
44734463   PORT_DIPSETTING(      0x0020, DEF_STR( Hard ) )
44744464   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
4475   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
4465   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW2:8" )
44764466
4477   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
4467   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
44784468   PORT_DIPSETTING(      0x0200, "2" )
44794469   PORT_DIPSETTING(      0x0300, "3" )
44804470   PORT_DIPSETTING(      0x0100, "4" )
44814471   PORT_DIPSETTING(      0x0000, "5" )
4482   PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_A ) )
4472   PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,4,5")
44834473   PORT_DIPSETTING(      0x0400, DEF_STR( 4C_1C ) )
44844474   PORT_DIPSETTING(      0x0800, DEF_STR( 3C_1C ) )
44854475   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )
r1649r1650
44884478   PORT_DIPSETTING(      0x1800, DEF_STR( 1C_2C ) )
44894479   PORT_DIPSETTING(      0x1400, DEF_STR( 1C_3C ) )
44904480   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )
4491   PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coin_A ) )
4481   PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:6,7,8")
44924482   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_1C ) )
44934483   PORT_DIPSETTING(      0x4000, DEF_STR( 3C_1C ) )
44944484   PORT_DIPSETTING(      0x8000, DEF_STR( 2C_1C ) )
r1649r1650
45934583   PORT_DIPSETTING(      0x0000, DEF_STR( Japanese ) )
45944584
45954585   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
4596   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
4586   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
45974587   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
45984588   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
45994589   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
r1649r1650
46024592   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
46034593   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_4C ) )
46044594   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_5C ) )
4605   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
4595   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
46064596   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
46074597   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
46084598   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
r1649r1650
46114601   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
46124602   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_4C ) )
46134603   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_5C ) )
4614   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 2-6" )
4604   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 2-7" ) PORT_DIPLOCATION("SW2:7")
46154605   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
46164606   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4617   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )
4607   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:8")
46184608   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
46194609   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
46204610
4621   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) )
4611   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1")
46224612   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
46234613   PORT_DIPSETTING(      0x0100, DEF_STR( On ) )
4624   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Difficulty ) )   // unverified, from the manual
4625   PORT_DIPSETTING(      0x0400, DEF_STR( Easy )    )
4626   PORT_DIPSETTING(      0x0600, DEF_STR( Normal )  )
4627   PORT_DIPSETTING(      0x0200, DEF_STR( Hard )    )
4614   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:2,3")   // unverified, from the manual
4615   PORT_DIPSETTING(      0x0400, DEF_STR( Easy ) )
4616   PORT_DIPSETTING(      0x0600, DEF_STR( Normal ) )
4617   PORT_DIPSETTING(      0x0200, DEF_STR( Hard ) )
46284618   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
4629   PORT_DIPNAME( 0x0800, 0x0800, "Unknown 1-3" )
4619   PORT_DIPNAME( 0x0800, 0x0800, "Unknown 1-4" ) PORT_DIPLOCATION("SW1:4")
46304620   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
46314621   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4632   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) )
4622   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:5")
46334623   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
46344624   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4635   PORT_DIPNAME( 0x2000, 0x2000, "Memory Check" )
4625   PORT_DIPNAME( 0x2000, 0x2000, "Memory Check" ) PORT_DIPLOCATION("SW1:6")
46364626   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
46374627   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4638   PORT_DIPNAME( 0x4000, 0x4000, "Unknown 1-6" )
4628   PORT_DIPNAME( 0x4000, 0x4000, "Unknown 1-7" ) PORT_DIPLOCATION("SW1:7")
46394629   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
46404630   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4641   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
4631   PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" )
46424632INPUT_PORTS_END
46434633
46444634static INPUT_PORTS_START( msgunda1 )
4645   PORT_START_TAG("IN0") //Player 1 - $400000.w
4646   JOY_TYPE1_2BUTTONS(1)
4635   PORT_INCLUDE(msgundam)
46474636
4648   PORT_START_TAG("IN1") //Player 2 - $400002.w
4649   JOY_TYPE1_2BUTTONS(2)
4650
4651   PORT_START   // IN2 - Coins - $400004.w
4652   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
4653   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
4654   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
4655   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_TILT     )
4656   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN  )
4657   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN  )
4658   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
4637   PORT_MODIFY("IN2") // IN2 - Coins - $400004.w
46594638   /* this set seems to be a japan set, english mode doesn't work correctly */
46604639   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Language ) )
46614640//  PORT_DIPSETTING(      0x0080, DEF_STR( English ) )
46624641   PORT_DIPSETTING(      0x0000, DEF_STR( Japanese ) )
4663
4664   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
4665   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
4666   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
4667   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
4668   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
4669   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
4670   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
4671   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
4672   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_4C ) )
4673   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_5C ) )
4674   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
4675   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
4676   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
4677   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
4678   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
4679   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
4680   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
4681   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_4C ) )
4682   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_5C ) )
4683   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 2-6" )
4684   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
4685   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4686   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )
4687   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
4688   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4689
4690   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) )
4691   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
4692   PORT_DIPSETTING(      0x0100, DEF_STR( On ) )
4693   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Difficulty ) )   // unverified, from the manual
4694   PORT_DIPSETTING(      0x0400, DEF_STR( Easy )    )
4695   PORT_DIPSETTING(      0x0600, DEF_STR( Normal )  )
4696   PORT_DIPSETTING(      0x0200, DEF_STR( Hard )    )
4697   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
4698   PORT_DIPNAME( 0x0800, 0x0800, "Unknown 1-3" )
4699   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
4700   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4701   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) )
4702   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
4703   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4704   PORT_DIPNAME( 0x2000, 0x2000, "Memory Check" )
4705   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
4706   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4707   PORT_DIPNAME( 0x4000, 0x4000, "Unknown 1-6" )
4708   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
4709   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4710   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
47114642INPUT_PORTS_END
47124643
47134644
r1649r1650
47334664   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
47344665
47354666   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
4736   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
4667   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
47374668   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
47384669   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
47394670   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
47404671   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
4741   PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Demo_Sounds ) )
4672   PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
47424673   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
47434674   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4744   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) ) /* Manual States dips 4-7 are unused */
4745   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
4746   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4747   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
4748   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
4749   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4750   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
4751   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
4752   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4753   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
4754   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
4755   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4756   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
4675   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW2:4" ) /* Manual States dips 4-7 are unused */
4676   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) /* Listed as "Unused" */
4677   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */
4678   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */
4679   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW2:8" )
47574680
4758   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
4681   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
47594682   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
47604683   PORT_DIPSETTING(      0x0100, DEF_STR( 4C_1C ) )
47614684   PORT_DIPSETTING(      0x0200, DEF_STR( 3C_1C ) )
r1649r1650
47644687   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_2C ) )
47654688   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )
47664689   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
4767   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
4690   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6")
47684691   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
47694692   PORT_DIPSETTING(      0x0800, DEF_STR( 4C_1C ) )
47704693   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )
r1649r1650
47734696   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_2C ) )
47744697   PORT_DIPSETTING(      0x2800, DEF_STR( 1C_3C ) )
47754698   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
4776   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) ) /* Manual States this dip is unused */
4777   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
4778   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4699   PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW1:7" ) /* Listed as "Unused" */
4700   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW1:8" ) /* Listed as "Unused" */
47794701INPUT_PORTS_END
47804702
47814703
r1649r1650
47944716   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(5)
47954717
47964718   PORT_START_TAG("IN3") //2 DSWs - $e00001 & 3.b
4797   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
4719   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
47984720   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
47994721   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
48004722   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
r1649r1650
48034725   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
48044726   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
48054727   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
4806   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
4728   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
48074729   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
48084730   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
48094731   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
r1649r1650
48124734   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
48134735   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
48144736   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
4815   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) )
4737   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
48164738   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
48174739   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
4818   PORT_DIPNAME( 0x0080, 0x0080, "Player's TSUMO" )
4740   PORT_DIPNAME( 0x0080, 0x0080, "Player's TSUMO" ) PORT_DIPLOCATION("SW2:8")
48194741   PORT_DIPSETTING(      0x0080, "Manual" )
48204742   PORT_DIPSETTING(      0x0000, "Auto"   )
48214743
4822   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) )
4744   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
48234745   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
48244746   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
48254747   PORT_SERVICE( 0x0200, IP_ACTIVE_LOW )
4826   PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Difficulty ) )
4748   PORT_SERVICE_DIPLOC(  0x0200, IP_ACTIVE_LOW, "SW1:2" )
4749   PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4,5")
48274750   PORT_DIPSETTING(      0x1c00, DEF_STR( None ) )
48284751   PORT_DIPSETTING(      0x1800, "Prelim  1" )
48294752   PORT_DIPSETTING(      0x1400, "Prelim  2" )
r1649r1650
48324755   PORT_DIPSETTING(      0x0800, "Final   3" )
48334756   PORT_DIPSETTING(      0x0400, "Qrt Final" )
48344757   PORT_DIPSETTING(      0x0000, "SemiFinal" )
4835   PORT_DIPNAME( 0xe000, 0xe000, "Points Gap" )
4758   PORT_DIPNAME( 0xe000, 0xe000, "Points Gap" ) PORT_DIPLOCATION("SW1:6,7,8")
48364759   PORT_DIPSETTING(      0xe000, DEF_STR( None ) )
48374760   PORT_DIPSETTING(      0xc000, "+6000" )
48384761   PORT_DIPSETTING(      0xa000, "+4000" )
r1649r1650
50764999   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
50775000
50785001   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
5079   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
5002   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
50805003   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
50815004   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5082   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) )
5005   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
50835006   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
50845007   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
5085   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
5086   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
5087   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5088   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Cabinet ) )
5008   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW2:3" ) /* Listed as "Unused" */
5009   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:4,5")
50895010   PORT_DIPSETTING(      0x0000, "Upright 1 Controller" )
50905011   PORT_DIPSETTING(      0x0018, "Upright 2 Controllers" )
50915012   PORT_DIPSETTING(      0x0008, DEF_STR( Cocktail ) )
50925013//  PORT_DIPSETTING(      0x0010, "10" )                /* Unused / Not Defined */
5093   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
5094   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
5095   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5096   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
5097   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
5098   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5099   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
5014   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */
5015   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */
5016   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW2:8" )
51005017
5101   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
5018   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
51025019   PORT_DIPSETTING(      0x0200, "2" )
51035020   PORT_DIPSETTING(      0x0300, "3" )
51045021   PORT_DIPSETTING(      0x0100, "4" )
51055022   PORT_DIPSETTING(      0x0000, "5" )
5106   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
5023   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
51075024   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
51085025   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
51095026   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
51105027   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
5111   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) )
5028   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
51125029   PORT_DIPSETTING(      0xa000, DEF_STR( 6C_1C ) )
51135030   PORT_DIPSETTING(      0xb000, DEF_STR( 5C_1C ) )
51145031   PORT_DIPSETTING(      0xc000, DEF_STR( 4C_1C ) )
r1649r1650
53085225       title logo, but the table is filled with just 1 value */
53095226
53105227   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
5311   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
5228   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
53125229   PORT_DIPSETTING(      0x0002, DEF_STR( Easy )    ) // 0
53135230   PORT_DIPSETTING(      0x0003, DEF_STR( Normal )  ) // 4
53145231   PORT_DIPSETTING(      0x0001, DEF_STR( Hard )    ) // 8
53155232   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) ) // b
5316   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
5317   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
5318   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5319   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
5320   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
5321   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5322   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
5233   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW2:3" )
5234   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW2:4" )
5235   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:5,6")
53235236   PORT_DIPSETTING(      0x0010, "1" )
53245237   PORT_DIPSETTING(      0x0000, "2" )
53255238   PORT_DIPSETTING(      0x0030, "3" )
53265239   PORT_DIPSETTING(      0x0020, "5" )
5327   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
5328   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
5329   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5330   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
5331   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
5332   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5240   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" )
5241   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW2:8" )
53335242
5334   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unused ) )
5243   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1")
53355244   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
53365245   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5337   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
5246   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
53385247   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
53395248   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5340   PORT_SERVICE( 0x0400, IP_ACTIVE_LOW )
5341   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) )
5342   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
5343   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5344   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )
5249   PORT_SERVICE_DIPLOC(  0x0400, IP_ACTIVE_LOW, "SW1:3" )
5250   PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0800, "SW1:4" )
5251   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
53455252   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )
53465253   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )
53475254   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
53485255   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )
5349   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
5256   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7")
53505257   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
53515258   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
5352   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )
5353   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
5354   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5259   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW1:8" )
53555260INPUT_PORTS_END
53565261
53575262
r1649r1650
53865291//  PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
53875292
53885293   PORT_START_TAG("IN3") //2 DSWs - $600003 & 1.b
5389   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) )
5294   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3,4")
53905295   PORT_DIPSETTING(      0x000c, DEF_STR( 4C_1C ) )
53915296   PORT_DIPSETTING(      0x000d, DEF_STR( 3C_1C ) )
53925297   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_2C ) )
r1649r1650
54035308   PORT_DIPSETTING(      0x000b, DEF_STR( 1C_2C ) )
54045309   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_3C ) )
54055310   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_4C ) )
5406   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) )
5311   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,6,7,8")
54075312   PORT_DIPSETTING(      0x00c0, DEF_STR( 4C_1C ) )
54085313   PORT_DIPSETTING(      0x00d0, DEF_STR( 3C_1C ) )
54095314   PORT_DIPSETTING(      0x0080, DEF_STR( 4C_2C ) )
r1649r1650
54215326   PORT_DIPSETTING(      0x0070, DEF_STR( 1C_3C ) )
54225327   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_4C ) )
54235328
5424   PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )
5425   PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Flip_Screen ) )
5329   PORT_SERVICE_DIPLOC(  0x0100, IP_ACTIVE_LOW, "SW1:1" )
5330   PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
54265331   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      // WEIRD!
54275332   PORT_DIPSETTING(      0x0200, DEF_STR( On ) )
5428   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Cabinet ) )
5333   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:3")
54295334   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
54305335   PORT_DIPSETTING(      0x0400, DEF_STR( Cocktail ) )
5431   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Controls ) )
5336   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:4")
54325337   PORT_DIPSETTING(      0x0800, "2" )
54335338   PORT_DIPSETTING(      0x0000, "1" )
5434   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Demo_Sounds ) )
5339   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5")
54355340   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
54365341   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5437   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Lives ) )
5342   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:6")
54385343   PORT_DIPSETTING(      0x2000, "3" )
54395344   PORT_DIPSETTING(      0x0000, "2" )
5440   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) )
5345   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7,8")
54415346   PORT_DIPSETTING(      0x8000, DEF_STR( Easy ) )
54425347   PORT_DIPSETTING(      0xc000, DEF_STR( Normal ) )
54435348   PORT_DIPSETTING(      0x4000, DEF_STR( Hard ) )
r1649r1650
54685373   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
54695374
54705375   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
5471   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
5376   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
54725377   PORT_DIPSETTING(      0x0002, DEF_STR( Easy )    )
54735378   PORT_DIPSETTING(      0x0003, DEF_STR( Normal )  )
54745379   PORT_DIPSETTING(      0x0001, DEF_STR( Hard )    )
54755380   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
5476   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) )
5381   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4")
54775382   PORT_DIPSETTING(      0x000c, "50K  Only" )
54785383   PORT_DIPSETTING(      0x0004, "50K, Every 150K" )
54795384   PORT_DIPSETTING(      0x0000, "70K, Every 200K" )
54805385   PORT_DIPSETTING(      0x0008, "100K Only" )
5481   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
5386   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:5,6")
54825387   PORT_DIPSETTING(      0x0010, "1" )
54835388   PORT_DIPSETTING(      0x0000, "2" )
54845389   PORT_DIPSETTING(      0x0030, "3" )
54855390   PORT_DIPSETTING(      0x0020, "5" )
5486   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Allow_Continue ) )
5391   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7")
54875392   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
54885393   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
5489   PORT_DIPNAME( 0x0080, 0x0000, "Licensed To" )   // + coin mode (not supported)
5394   PORT_DIPNAME( 0x0080, 0x0000, "Licensed To" ) PORT_DIPLOCATION("SW2:8")   // + coin mode (not supported)
54905395   PORT_DIPSETTING(      0x0080, "Taito America Corp." )
54915396   PORT_DIPSETTING(      0x0000, "Taito Corp. Japan" )
54925397
5493   PORT_DIPNAME( 0x0100, 0x0100, "Title" )
5398   PORT_DIPNAME( 0x0100, 0x0100, "Title" ) PORT_DIPLOCATION("SW1:1")
54945399   PORT_DIPSETTING(      0x0100, "Thundercade" )
54955400   PORT_DIPSETTING(      0x0000, "Twin Formation" )
5496   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
5401   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
54975402   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
54985403   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5499   PORT_SERVICE( 0x0400, IP_ACTIVE_LOW )
5500   PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) )
5404   PORT_SERVICE_DIPLOC(  0x0400, IP_ACTIVE_LOW, "SW1:3" )
5405   PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4")
55015406   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
55025407   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5503   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )
5408   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
55045409   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )
55055410   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )
55065411   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
55075412   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )
5508   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) )
5413   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
55095414   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )
55105415   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )
55115416   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
r1649r1650
55185423***************************************************************************/
55195424
55205425static INPUT_PORTS_START( tndrcadj )
5521   PORT_START_TAG("IN0") //Player 1
5522   JOY_TYPE1_2BUTTONS(1)
5426   PORT_INCLUDE(tndrcade)
55235427
5524   PORT_START_TAG("IN1") //Player 2
5525   JOY_TYPE1_2BUTTONS(2)
5526
5527   PORT_START_TAG("IN2") //Coins
5528   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
5529   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
5530   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_START1   )
5531   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_START2   )
5532   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
5533   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_TILT     )
5534   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
5535   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
5536
5537   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
5538   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
5539   PORT_DIPSETTING(      0x0002, DEF_STR( Easy )    )
5540   PORT_DIPSETTING(      0x0003, DEF_STR( Normal )  )
5541   PORT_DIPSETTING(      0x0001, DEF_STR( Hard )    )
5542   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
5543   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) )
5544   PORT_DIPSETTING(      0x000c, "50K  Only" )
5545   PORT_DIPSETTING(      0x0004, "50K, Every 150K" )
5546   PORT_DIPSETTING(      0x0000, "70K, Every 200K" )
5547   PORT_DIPSETTING(      0x0008, "100K Only" )
5548   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
5549   PORT_DIPSETTING(      0x0010, "1" )
5550   PORT_DIPSETTING(      0x0000, "2" )
5551   PORT_DIPSETTING(      0x0030, "3" )
5552   PORT_DIPSETTING(      0x0020, "5" )
5553   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Allow_Continue ) )
5554   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
5555   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
5556   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )
5428   PORT_MODIFY("IN3") //2 DSWs - $600001 & 3.b
5429   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:8")
55575430   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
55585431   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
55595432
5560   PORT_DIPNAME( 0x0100, 0x0100, "Invulnerability (Cheat)")
5433   PORT_DIPNAME( 0x0100, 0x0100, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW1:1")
55615434   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
55625435   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5563   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
5564   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
5565   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5566   PORT_SERVICE( 0x0400, IP_ACTIVE_LOW )
5567   PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) )
5568   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
5569   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5570   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )
5571   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )
5572   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )
5573   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
5574   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )
5575   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) )
5576   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )
5577   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )
5578   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
5579   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_2C ) )
55805436INPUT_PORTS_END
55815437
55825438
r1649r1650
57535609   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
57545610
57555611   PORT_START_TAG("IN3") //2 DSWs
5756   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) )
5612   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3,4")
57575613   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
57585614   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
57595615   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
r1649r1650
57705626   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
57715627   PORT_DIPSETTING(      0x0009, DEF_STR( 1C_7C ) )
57725628   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
5773   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) )
5629   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,6,7,8")
57745630   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_1C ) )
57755631   PORT_DIPSETTING(      0x0050, DEF_STR( 3C_1C ) )
57765632   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )
r1649r1650
57885644   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_6C ) )
57895645   PORT_DIPSETTING(      0x0090, DEF_STR( 1C_7C ) )
57905646
5791   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
5647   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
57925648   PORT_DIPSETTING(      0x0000, "1" )
57935649   PORT_DIPSETTING(      0x0200, "2" )
57945650   PORT_DIPSETTING(      0x0300, "3" )
57955651   PORT_DIPSETTING(      0x0100, "4" )
5796   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
5652   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
57975653   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
57985654   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
57995655   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
58005656   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
5801   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) )
5657   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:5")
58025658   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
58035659   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5804   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ) )
5660   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
58055661   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
58065662   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
5807   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Bonus_Life ) )
5663   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7")
58085664   PORT_DIPSETTING(      0x4000, "100k" )
58095665   PORT_DIPSETTING(      0x0000, "150k" )
5810   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
5666   PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" )
58115667INPUT_PORTS_END
58125668
58135669/***************************************************************************
r1649r1650
58435699   PORT_BIT(  0x0080, IP_ACTIVE_HIGH, IPT_TILT     )
58445700
58455701   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
5846   PORT_DIPNAME( 0x0001, 0x0001, "Credits For 9-Hole" )
5702   PORT_DIPNAME( 0x0001, 0x0001, "Credits For 9-Hole" ) PORT_DIPLOCATION("SW2:1")
58475703   PORT_DIPSETTING(      0x0001, "2" )
58485704   PORT_DIPSETTING(      0x0000, "3" )
5849   PORT_DIPNAME( 0x0002, 0x0002, "Game Type" )
5705   PORT_DIPNAME( 0x0002, 0x0002, "Game Type" ) PORT_DIPLOCATION("SW2:2")
58505706   PORT_DIPSETTING(      0x0002, "Domestic" )
58515707   PORT_DIPSETTING(      0x0000, "Foreign" )
5852   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) )
5708   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
58535709   PORT_DIPSETTING(      0x0004, "1" )
58545710   PORT_DIPSETTING(      0x0008, "2" )
58555711   PORT_DIPSETTING(      0x000c, "3" )
58565712   PORT_DIPSETTING(      0x0000, "4" )
5857   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )
5713   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:5,6")
58585714   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
58595715   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
58605716   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
58615717   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )
5862   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )
5718   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:7,8")
58635719   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )
58645720   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )
58655721   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
58665722   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )
58675723
5868   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Cabinet ) )
5724   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
58695725   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
58705726   PORT_DIPSETTING(      0x0100, DEF_STR( Cocktail ) )
5871   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
5727   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
58725728   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
58735729   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5874   PORT_SERVICE( 0x0400, IP_ACTIVE_LOW )
5875   PORT_DIPNAME( 0x3800, 0x3800, "Flight Distance" )
5730   PORT_SERVICE_DIPLOC(  0x0400, IP_ACTIVE_LOW, "SW1:3" )
5731   PORT_DIPNAME( 0x3800, 0x3800, "Flight Distance" ) PORT_DIPLOCATION("SW1:4,5,6")
58765732   PORT_DIPSETTING(      0x3800, DEF_STR( Normal ) )
58775733   PORT_DIPSETTING(      0x3000, "-30 Yards" )
58785734   PORT_DIPSETTING(      0x2800, "+10 Yards" )
r1649r1650
58815737   PORT_DIPSETTING(      0x1000, "+40 Yards" )
58825738   PORT_DIPSETTING(      0x0800, "+50 Yards" )
58835739   PORT_DIPSETTING(      0x0000, "+60 Yards" )
5884   PORT_DIPNAME( 0xc000, 0xc000, "Licensed To"     )
5885   PORT_DIPSETTING(      0xc000, "Romstar"       )
5886   PORT_DIPSETTING(      0x8000, "None (Japan)"  )
5887   PORT_DIPSETTING(      0x4000, "Taito"         )
5740   PORT_DIPNAME( 0xc000, 0xc000, "Licensed To" ) PORT_DIPLOCATION("SW1:7,8")
5741   PORT_DIPSETTING(      0xc000, "Romstar" )
5742   PORT_DIPSETTING(      0x8000, "None (Japan)" )
5743   PORT_DIPSETTING(      0x4000, "Taito" )
58885744   PORT_DIPSETTING(      0x0000, "Taito America" )
58895745INPUT_PORTS_END
58905746
r1649r1650
59135769   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
59145770
59155771   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
5916   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
5772   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
59175773   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
59185774   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5919   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) )
5775   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:2")
59205776   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
59215777   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
5922   PORT_DIPNAME( 0x0004, 0x0004, "Unknown 1-2*" )   // tested
5778   PORT_DIPNAME( 0x0004, 0x0004, "Unknown 1-3*" ) PORT_DIPLOCATION("SW1:3")   // tested...Manual states "Unused"
59235779   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
59245780   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5925   PORT_DIPNAME( 0x0008, 0x0008, "Stage & Weapon Select (Cheat)") // P2 Start Is Freeze Screen...
5781   PORT_DIPNAME( 0x0008, 0x0008, "Stage & Weapon Select (Cheat)") PORT_DIPLOCATION("SW1:4") // P2 Start Is Freeze Screen...Manual states "Unused"
59265782   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
59275783   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5928   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) /* Manual states dips 3-7 are "Unused" */
5929   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
5930   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5931   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
5932   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
5933   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5934   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
5935   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
5936   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
5937   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
5784   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" ) /* Listed as "Unused" */
5785   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" ) /* Listed as "Unused" */
5786   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" ) /* Listed as "Unused" */
5787   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW1:8" )
59385788
5939   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
5789   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
59405790   PORT_DIPSETTING(      0x0200, "2" )
59415791   PORT_DIPSETTING(      0x0300, "3" )
59425792   PORT_DIPSETTING(      0x0100, "4" )
59435793   PORT_DIPSETTING(      0x0000, "5" )
5944   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
5794   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
59455795   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
59465796   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
59475797   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
59485798   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
5949   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) )
5799   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:5,6,7,8")
59505800   PORT_DIPSETTING(      0xa000, DEF_STR( 6C_1C ) )
59515801   PORT_DIPSETTING(      0xb000, DEF_STR( 5C_1C ) )
59525802   PORT_DIPSETTING(      0xc000, DEF_STR( 4C_1C ) )
r1649r1650
59965846   PORT_DIPSETTING(      0x0000, "Athena (Japan Only)" )
59975847
59985848   PORT_START_TAG("IN3") //2 DSWs - $600003 & 1.b
5999   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
5849   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
60005850   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
60015851   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
60025852   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
60035853   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
6004   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) )
5854   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4")
60055855   PORT_DIPSETTING(      0x0008, "150k, 350k" )
60065856   PORT_DIPSETTING(      0x000c, "200k, 500k" )
60075857   PORT_DIPSETTING(      0x0004, "300k, 600k" )
60085858   PORT_DIPSETTING(      0x0000, "400k" )
6009   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
5859   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:5,6")
60105860   PORT_DIPSETTING(      0x0000, "1" )
60115861   PORT_DIPSETTING(      0x0010, "2" )
60125862   PORT_DIPSETTING(      0x0030, "3" )
60135863   PORT_DIPSETTING(      0x0020, "5" )
6014   PORT_DIPNAME( 0x0040, 0x0040, "Play Mode" )
5864   PORT_DIPNAME( 0x0040, 0x0040, "Play Mode" ) PORT_DIPLOCATION("SW2:7")
60155865   PORT_DIPSETTING(      0x0040, "2 Players" )
60165866   PORT_DIPSETTING(      0x0000, "4 Players" )
6017   PORT_DIPNAME( 0x0080, 0x0080, "CPU Player During Multi-Player Game" )
5867   PORT_DIPNAME( 0x0080, 0x0080, "CPU Player During Multi-Player Game" ) PORT_DIPLOCATION("SW2:8")
60185868   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
60195869   PORT_DIPSETTING(      0x0080, DEF_STR( Yes ) )
60205870
6021   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Cabinet ) )
5871   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
60225872   PORT_DIPSETTING(      0x0100, DEF_STR( Upright ) )
60235873   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
6024   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) )
5874   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
60255875   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
60265876   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6027   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) )
5877   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3")
60285878   PORT_DIPSETTING(      0x0400, "Every 3rd Loop" )
60295879   PORT_DIPSETTING(      0x0000, "Every 7th Loop" )
6030   PORT_SERVICE( 0x0800, IP_ACTIVE_LOW )
6031   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )
5880   PORT_SERVICE_DIPLOC(  0x0800, IP_ACTIVE_LOW, "SW1:4" )
5881   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
60325882   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
60335883   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )
60345884   PORT_DIPSETTING(      0x2000, DEF_STR( 2C_1C ) )
60355885   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )
6036   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) )
5886   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
60375887   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_2C ) )
60385888   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_3C ) )
60395889   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_4C ) )
r1649r1650
60695919   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
60705920
60715921   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
6072   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
5922   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
60735923   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
60745924   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6075   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) )
5925   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
60765926   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
60775927   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
6078   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
6079   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
6080   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6081   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
6082   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
6083   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6084   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
6085   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
6086   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6087   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
6088   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
6089   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6090   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
6091   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
6092   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6093   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
5928   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW2:3" ) /* Manual States dips 3-7 are unused */
5929   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW2:4" ) /* Listed as "Unused" */
5930   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) /* Listed as "Unused" */
5931   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */
5932   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */
5933   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW2:8" )
60945934
6095   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
5935   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
60965936   PORT_DIPSETTING(      0x0200, "2" )
60975937   PORT_DIPSETTING(      0x0300, "3" )
60985938   PORT_DIPSETTING(      0x0100, "4" )
60995939   PORT_DIPSETTING(      0x0000, "5" )
6100   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
5940   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
61015941   PORT_DIPSETTING(      0x0800, DEF_STR( Easy )    )
61025942   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal )  )
61035943   PORT_DIPSETTING(      0x0400, DEF_STR( Hard )    )
61045944   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
6105   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) )
5945   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
61065946   PORT_DIPSETTING(      0xa000, DEF_STR( 6C_1C ) )
61075947   PORT_DIPSETTING(      0xb000, DEF_STR( 5C_1C ) )
61085948   PORT_DIPSETTING(      0xc000, DEF_STR( 4C_1C ) )
r1649r1650
61225962INPUT_PORTS_END
61235963
61245964/*************************************
6125  Pairs Love
5965        Pairs Love
61265966*************************************/
61275967
61285968static INPUT_PORTS_START( pairlove )
r1649r1650
61395979   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_TILT     )
61405980
61415981   PORT_START_TAG("DSW")    // 2 DIP switches
6142   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
5982   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
61435983   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
61445984   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6145   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
5985   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
61465986   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
61475987   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6148   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
6149   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
6150   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6151   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
6152   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
6153   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6154   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
6155   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
6156   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6157   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
6158   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
6159   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6160   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
6161   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
6162   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6163   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
5988   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW2:3" ) /* Listed as "Unused" */
5989   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW2:4" ) /* Listed as "Unused" */
5990   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) /* Listed as "Unused" */
5991   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */
5992   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */
5993   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW2:8" )
61645994
6165   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unused )  )
6166   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
6167   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6168   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unused ) )
6169   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
6170   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6171   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
5995   PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW1:1" ) /* Listed as "Unused" */
5996   PORT_DIPUNUSED_DIPLOC( 0x0200, 0x0200, "SW1:2" ) /* Listed as "Unused" */
5997   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
61725998   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
61735999   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
61746000   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
61756001   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
6176   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) )
6002   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
61776003   PORT_DIPSETTING(      0xa000, DEF_STR( 6C_1C ) )
61786004   PORT_DIPSETTING(      0xb000, DEF_STR( 5C_1C ) )
61796005   PORT_DIPSETTING(      0xc000, DEF_STR( 4C_1C ) )
r1649r1650
62146040   PORT_BIT(  0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN )
62156041
62166042   PORT_START_TAG("IN3") //2 DSWs - $600001 & 3.b
6217   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
6043   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
62186044   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
62196045   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6220   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) )
6046   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
62216047   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
62226048   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
6223   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
6049   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
62246050   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
62256051   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
62266052   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
62276053   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
6228   PORT_DIPNAME( 0x0010, 0x0010, "Stock" )
6054   PORT_DIPNAME( 0x0010, 0x0010, "Stock" ) PORT_DIPLOCATION("SW2:5")
62296055   PORT_DIPSETTING(      0x0010, "1" )
62306056   PORT_DIPSETTING(      0x0000, "2" )
6231   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Level_Select ) )
6057   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW2:6")
62326058   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
62336059   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6234   PORT_DIPNAME( 0x0040, 0x0040, "Timer speed" )
6060   PORT_DIPNAME( 0x0040, 0x0040, "Timer speed" ) PORT_DIPLOCATION("SW2:7")
62356061   PORT_DIPSETTING(      0x0040, DEF_STR( Normal ) )
62366062   PORT_DIPSETTING(      0x0000, "Fast" )
6237   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
6063   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW2:8" )
62386064
6239   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
6065   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
62406066   PORT_DIPSETTING(      0x0500, DEF_STR( 3C_1C ) )
62416067   PORT_DIPSETTING(      0x0600, DEF_STR( 2C_1C ) )
62426068   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
r1649r1650
62456071   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_4C ) )
62466072   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_5C ) )
62476073   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
6248   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
6074   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6")
62496075   PORT_DIPSETTING(      0x2800, DEF_STR( 3C_1C ) )
62506076   PORT_DIPSETTING(      0x3000, DEF_STR( 2C_1C ) )
62516077   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
r1649r1650
62546080   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_4C ) )
62556081   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_5C ) )
62566082   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
6257   PORT_DIPNAME( 0x4000, 0x4000, "Force Coinage (Half Coinn)" )
6083   PORT_DIPNAME( 0x4000, 0x4000, "Force Coinage (Half Coin)" ) PORT_DIPLOCATION("SW1:7")
62586084   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
62596085   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_1C ) )
6260   PORT_DIPNAME( 0x8000, 0x8000, "Unknown 2-7" )
6086   PORT_DIPNAME( 0x8000, 0x8000, "Unknown 1-8" ) PORT_DIPLOCATION("SW1:8")
62616087   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
62626088   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
62636089INPUT_PORTS_END
r1649r1650
62986124   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE1 )   // ticket
62996125
63006126   PORT_START_TAG("IN3") //2 DSWs - $630001 & 3.b
6301   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
6127   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
63026128   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
63036129   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
63046130   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
r1649r1650
63076133   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
63086134   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
63096135   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_5C ) )
6310   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
6136   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
63116137   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
63126138   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
63136139   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
r1649r1650
63166142   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
63176143   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
63186144   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_5C ) )
6319   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Unknown ) )
6145   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7,8")
63206146   PORT_DIPSETTING(      0x00c0, "5" )
63216147   PORT_DIPSETTING(      0x0080, "10" )
63226148   PORT_DIPSETTING(      0x0040, "15" )
63236149   PORT_DIPSETTING(      0x0000, "20" )
63246150
6325   PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )
6326   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
6151   PORT_SERVICE_DIPLOC(  0x0100, IP_ACTIVE_LOW, "SW1:1" )
6152   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2")
63276153   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
63286154   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6329   PORT_DIPNAME( 0x0c00, 0x0c00, "Difficulty?" )
6155   PORT_DIPNAME( 0x0c00, 0x0c00, "Difficulty?" ) PORT_DIPLOCATION("SW1:3,4")
63306156   PORT_DIPSETTING(      0x0c00, "0" )
63316157   PORT_DIPSETTING(      0x0800, "1" )
63326158   PORT_DIPSETTING(      0x0400, "2" )
63336159   PORT_DIPSETTING(      0x0000, "3" )
6334   PORT_DIPNAME( 0x3000, 0x3000, "Energy" )
6160   PORT_DIPNAME( 0x3000, 0x3000, "Energy" ) PORT_DIPLOCATION("SW1:5,6")
63356161   PORT_DIPSETTING(      0x1000, "24" )
63366162   PORT_DIPSETTING(      0x2000, "32" )
63376163   PORT_DIPSETTING(      0x3000, "48" )
63386164   PORT_DIPSETTING(      0x0000, "100" )
6339   PORT_DIPNAME( 0xc000, 0xc000, "Bonus?" )
6165   PORT_DIPNAME( 0xc000, 0xc000, "Bonus?" ) PORT_DIPLOCATION("SW1:7,8")
63406166   PORT_DIPSETTING(      0xc000, "0" )
63416167   PORT_DIPSETTING(      0x8000, "1" )
63426168   PORT_DIPSETTING(      0x4000, "2" )
src/mame/drivers/laserbat.c
r1649r1650
1717*/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021#include "cpu/s2650/s2650.h"
2122#include "machine/6821pia.h"
2223#include "video/s2636.h"
src/mame/drivers/trvquest.c
r1649r1650
3535*/
3636
3737#include "driver.h"
38#include "deprecat.h"
3839#include "machine/6522via.h"
3940#include "sound/ay8910.h"
4041
src/mame/drivers/tnzs.c
r1649r1650
218218***************************************************************************/
219219
220220#include "driver.h"
221#include "deprecat.h"
221222#include "cpu/i8x41/i8x41.h"
222223#include "sound/2203intf.h"
223224#include "sound/dac.h"
src/mame/drivers/tp84.c
r1649r1650
8282***************************************************************************/
8383
8484#include "driver.h"
85#include "deprecat.h"
8586#include "sound/sn76496.h"
8687#include "sound/flt_rc.h"
8788
src/mame/drivers/rohga.c
r1649r1650
108108***************************************************************************/
109109
110110#include "driver.h"
111#include "deprecat.h"
111112#include "cpu/h6280/h6280.h"
112113#include "decocrpt.h"
113114#include "decoprot.h"
src/mame/drivers/vball.c
r1649r1650
8888  *********************************************************************************************************************/
8989
9090#include "driver.h"
91#include "deprecat.h"
9192#include "cpu/m6502/m6502.h"
9293#include "cpu/z80/z80.h"
9394#include "sound/2151intf.h"
src/mame/drivers/higemaru.c
r1649r1650
77****************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "sound/ay8910.h"
1112
1213
src/mame/drivers/plygonet.c
r1649r1650
4444*/
4545
4646#include "driver.h"
47
47#include "deprecat.h"
4848#include "video/konamiic.h"
4949#include "cpu/m68000/m68000.h"
5050#include "cpu/z80/z80.h"
src/mame/drivers/batman.c
r1649r1650
1818
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/atarigen.h"
2223#include "audio/atarijsa.h"
2324#include "batman.h"
src/mame/drivers/naomi.c
r1649r1650
710710
711711EPR-21576g - NAOMI BOOT ROM 2001 09/10  1.70 (Japan)
712712EPR-21577e - NAOMI BOOT ROM 2000 08/25  1.50 (USA)
713EPR-21577d - NAOMI BOOT ROM 1999 06/04  1.40 (USA)
713714EPR-21578e - NAOMI BOOT ROM 2000 08/25  1.50 (Export)
714715EPR-21578d - NAOMI BOOT ROM 1999 06/04  1.40 (Export)
715716EPR-21578a - NAOMI BOOT ROM 1999 02/15  1.20 (Export)
r1649r1650
745746   ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-21578a.bin",  0x000000, 0x200000, CRC(6c9aad83) SHA1(555918de76d8dbee2a97d8a95297ef694b3e803f) ) \
746747   ROM_SYSTEM_BIOS( 3, "bios3", "epr-21577e" ) \
747748   ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-21577e.bin",  0x000000, 0x200000, CRC(cf36e97b) SHA1(b085305982e7572e58b03a9d35f17ae319c3bbc6) ) \
748   ROM_SYSTEM_BIOS( 4, "bios4", "epr-21576g" ) \
749   ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-21576g.bin",  0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) \
750   ROM_SYSTEM_BIOS( 5, "bios5", "epr-22851" ) \
751   ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-22851.bin",   0x000000, 0x200000, CRC(62483677) SHA1(3e3bcacf5f972c376b569f45307ee7fd0b5031b7) ) \
749   ROM_SYSTEM_BIOS( 4, "bios4", "epr-21577d" ) \
750   ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-21577d.bin",  0x000000, 0x200000, CRC(60ddcbbe) SHA1(58b15096d269d6df617ca1810b66b47deb184958) ) \
751   ROM_SYSTEM_BIOS( 5, "bios5", "epr-21576g" ) \
752   ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-21576g.bin",  0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) \
753   ROM_SYSTEM_BIOS( 6, "bios6", "epr-22851"  ) \
754   ROM_LOAD16_WORD_SWAP_BIOS( 6, "epr-22851.bin",   0x000000, 0x200000, CRC(62483677) SHA1(3e3bcacf5f972c376b569f45307ee7fd0b5031b7) ) \
755   ROM_SYSTEM_BIOS( 7, "bios7", "Naomi Dev BIOS" ) \
756   ROM_LOAD16_WORD_SWAP_BIOS( 7, "dcnaodev.bios",   0x000000, 0x080000, CRC(7a50fab9) SHA1(ef79f448e0bf735d1264ad4f051d24178822110f) ) /* This one comes from a dev / beta board. The eprom was a 27C4096 */
752757
753758
754759/* NAOMI2 BIOS:
755760
756EPR-23609  - NAOMI BOOT ROM 2001 01/19  1.50
761EPR-23605  - NAOMI BOOT ROM 2001 01/19  1.50
762EPR-23607  - NAOMI BOOT ROM 2001 01/19  1.50
763EPR-23608  - NAOMI BOOT ROM 2001 01/19  1.50
757764EPR-2360xB - NAOMI BOOT ROM 2001 09/10  1.70
758765
759EPR-23605B, EPR-23607B & EPR-23608B all differ by 6 bytes:
766EPR-23605B, EPR-23607B & EPR-23608B all differ by 8 bytes:
760767
7617680x0553a0 is the first region byte
7627690x1ecf40 is a second region byte (value is the same as the first region byte )
7630x1fffc-1ffff is the BIOS rom checksum (might be 0x1ffffa-0x1fffff)
7700x1fffa-1ffff is the BIOS rom checksum
764771
765EPR-23609  - Japan  (region = 0x00)
772EPR-23605  - Japan  (region = 0x00)
766773EPR-23605b - Japan  (region = 0x00)
774EPR-23607  - USA    (region = 0x01)
767775EPR-23607b - USA    (region = 0x01)
768776EPR-23608b - Export (region = 0x02)
777EPR-23608  - Export (region = 0x02)
769778
770779*/
771780
772781#define NAOMI2_BIOS \
773782   ROM_SYSTEM_BIOS( 0, "bios0", "epr-23608b" ) \
774783   ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-23608b.bin",   0x000000, 0x200000, CRC(a554b1e3) SHA1(343b727a3619d1c75a9b6d4cc156a9050447f155) ) \
775   ROM_SYSTEM_BIOS( 1, "bios1", "epr-23607b" ) \
776   ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-23607b.bin",   0x000000, 0x200000, CRC(f308c5e9) SHA1(5470ab1cee6afecbd8ca8cf40f8fbe4ec2cb1471) ) \
777   ROM_SYSTEM_BIOS( 2, "bios2", "epr-23605b" ) \
778   ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-23605b.bin",   0x000000, 0x200000, CRC(3a3242d4) SHA1(aaca4df51ef91d926f8191d372f3dfe1d20d9484) ) \
779   ROM_SYSTEM_BIOS( 3, "bios3", "epr-23609" ) \
780   ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-23609.bin",    0x000000, 0x200000, CRC(5731e446) SHA1(787b0844fc408cf124c12405c095c59948709ea6) ) \
784   ROM_SYSTEM_BIOS( 1, "bios1", "epr-23608"  ) \
785   ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-23608.bin",    0x000000, 0x200000, CRC(929cc3a6) SHA1(47d00c818de23f733a4a33b1bbc72eb8aa729246) ) \
786   ROM_SYSTEM_BIOS( 2, "bios2", "epr-23607b" ) \
787   ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-23607b.bin",   0x000000, 0x200000, CRC(f308c5e9) SHA1(5470ab1cee6afecbd8ca8cf40f8fbe4ec2cb1471) ) \
788   ROM_SYSTEM_BIOS( 3, "bios3", "epr-23607"  ) \
789   ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-23607.bin",    0x000000, 0x200000, CRC(2b55add2) SHA1(547de5f97d3183c8cd069c4fa3c09f13d8b637d9) ) \
790   ROM_SYSTEM_BIOS( 4, "bios4", "epr-23605b" ) \
791   ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-23605b.bin",   0x000000, 0x200000, CRC(3a3242d4) SHA1(aaca4df51ef91d926f8191d372f3dfe1d20d9484) ) \
792   ROM_SYSTEM_BIOS( 5, "bios5", "epr-23605"  ) \
793   ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-23605.bin",    0x000000, 0x200000, CRC(5731e446) SHA1(787b0844fc408cf124c12405c095c59948709ea6) )
781794
782795/* this is one flashrom, however the second half looks like it's used for game settings, may differ between dumps, and may not be needed / could be blanked */
783796#define AW_BIOS \
784797   ROM_SYSTEM_BIOS( 0, "bios0", "Atomiswave BIOS" ) \
785798   ROM_LOAD16_WORD_SWAP_BIOS( 0, "bios.ic23_l",                         0x000000, 0x010000, BAD_DUMP CRC(e5693ce3) SHA1(1bde3ed87af64b0f675ebd47f12a53e1fc5709c1) ) /* Might be bad.. especially. bytes 0x0000, 0x6000, 0x8000 which gave different reads */ \
786   ROM_LOAD16_WORD_SWAP_BIOS( 0, "bios.ic23_h-dolhpin_blue_settings",   0x010000, 0x010000, BAD_DUMP CRC(5d5687c7) SHA1(2600ce09c44872d1793f6b55bf44342673da5ad1) ) /* it appears to flash settings game data here */ \
799   ROM_LOAD16_WORD_SWAP_BIOS( 0, "bios.ic23_h-dolhpin_blue_settings",   0x010000, 0x010000, BAD_DUMP CRC(5d5687c7) SHA1(2600ce09c44872d1793f6b55bf44342673da5ad1) ) /* it appears to flash settings game data here */ /* this is one flashrom, however the second half looks like it's used for game settings, may differ between dumps, and may not be needed / could be blanked */
787800
788801
789802ROM_START( naomi )
r1649r1650
21192132*/
21202133
21212134/* Naomi & Naomi GD-ROM */
2122GAME( 1998, naomi,    0, naomi, naomi, 0, ROT0, "Sega",         "Naomi Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2135GAME( 1998, naomi,    0,        naomi,    naomi,    0, ROT0, "Sega",            "Naomi Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
21232136// Complete Dumps
2124GAME( 2001, csmash,   naomi, naomi, naomi, 0, ROT0, "Sega",         "Cosmic Smash (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2125GAME( 1999, suchie3,  naomi, naomi, naomi, 0, ROT0, "Jaleco",         "Idol Janshi Suchie-Pai 3 (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
2126GAME( 1999, vs2_2k,   naomi, naomi, naomi, 0, ROT0, "Sega",         "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2127GAME( 1999, vs2_2ka,  vs2_2k, naomi, naomi, 0, ROT0, "Sega",         "Virtua Striker 2 Ver. 2000 (set 2) (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2128GAME( 1999, smarinef, naomi, naomi, naomi, 0, ROT0, "Sega",         "Sega Marine Fishing", GAME_NO_SOUND|GAME_NOT_WORKING )
2137GAME( 2001, csmash,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Cosmic Smash (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2138GAME( 1999, suchie3,  naomi,    naomi,    naomi,    0, ROT0, "Jaleco",          "Idol Janshi Suchie-Pai 3 (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
2139GAME( 1999, vs2_2k,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS) (set 1)", GAME_NO_SOUND|GAME_NOT_WORKING )
2140GAME( 1999, vs2_2ka,  vs2_2k,   naomi,    naomi,    0, ROT0, "Sega",            "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS) (set 2)", GAME_NO_SOUND|GAME_NOT_WORKING )
2141GAME( 1999, smarinef, naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Sega Marine Fishing", GAME_NO_SOUND|GAME_NOT_WORKING )
21292142// Incomplete Dumps (just IC22)
2130GAME( 2000, cspike,   naomi, naomi, naomi, 0, ROT0, "Psikyo / Capcom","Gun Spike (JPN) / Cannon Spike (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2131GAME( 2000, capsnk,   naomi, naomi, naomi, 0, ROT0, "Capcom / SNK",   "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2132GAME( ????, derbyoc,  naomi, naomi, naomi, 0, ROT0, "Sega",           "Derby Owners Club (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2133GAME( 1998, dybb99,   naomi, naomi, naomi, 0, ROT0, "Sega",           "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2134GAME( 2000, gram2000, naomi, naomi, naomi, 0, ROT0, "Sega",           "Giant Gram 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2135GAME( 1999, ggram2,   naomi, naomi, naomi, 0, ROT0, "Sega",           "Giant Gram (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING ) // strings in rom don't contain '2'
2136GAME( 2001, hmgeo,    naomi, naomi, naomi, 0, ROT0, "Capcom",         "Heavy Metal Geomatrix (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2137GAME( 2000, gwing2,   naomi, naomi, naomi, 0, ROT0, "Takumi / Capcom","Giga Wing 2 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2138GAME( 2000, pjustic,  naomi, naomi, naomi, 0, ROT0, "Capcom",           "Moero Justice Gakuen (JPN) / Project Justice (USA, EXP, KOR, AUS) ", GAME_NO_SOUND|GAME_NOT_WORKING )
2139GAME( 1999, pstone,   naomi, naomi, naomi, 0, ROT0, "Capcom",         "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2140GAME( 2000, pstone2,  naomi, naomi, naomi, 0, ROT0, "Capcom",         "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2141GAME( 1999, otrigger, naomi, naomi, naomi, 0, ROT0, "Sega",           "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2142GAME( 1999, samba,    naomi, naomi, naomi, 0, ROT0, "Sega",           "Samba De Amigo (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
2143GAME( 2000, slasho,   naomi, naomi, naomi, 0, ROT0, "Sega",           "Slashout (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2144GAME( 1999, spawn,    naomi, naomi, naomi, 0, ROT0, "Capcom",         "Spawn (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2145GAME( 2000, virnba,   naomi, naomi, naomi, 0, ROT0, "Sega",           "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2146GAME( 1999, vtennis,  naomi, naomi, naomi, 0, ROT0, "Sega",           "Power Smash (JPN) / Virtua Tennis (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2147GAME( 1999, zombrvn,  naomi, naomi, naomi, 0, ROT0, "Sega",           "Zombie Revenge (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2148GAME( 1999, doa2,     naomi, naomi, naomi, 0, ROT0, "Tecmo",          "Dead or Alive 2 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2149GAME( 2000, doa2m,    doa2, naomi, naomi, 0, ROT0, "Tecmo",          "Dead or Alive 2 Millennium (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2150GAME( 1998, dybbnao,  naomi, naomi, naomi, 0, ROT0, "Sega",           "Dynamite Baseball NAOMI (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
2143GAME( 2000, cspike,   naomi,    naomi,    naomi,    0, ROT0, "Psikyo / Capcom", "Gun Spike (JPN) / Cannon Spike (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2144GAME( 2000, capsnk,   naomi,    naomi,    naomi,    0, ROT0, "Capcom / SNK",    "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2145GAME( ????, derbyoc,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Derby Owners Club (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2146GAME( 1998, dybb99,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2147GAME( 2000, gram2000, naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Giant Gram 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2148GAME( 1999, ggram2,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Giant Gram (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING ) // strings in rom don't contain '2'
2149GAME( 2001, hmgeo,    naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Heavy Metal Geomatrix (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2150GAME( 2000, gwing2,   naomi,    naomi,    naomi,    0, ROT0, "Takumi / Capcom", "Giga Wing 2 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2151GAME( 2000, pjustic,  naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Moero Justice Gakuen (JPN) / Project Justice (USA, EXP, KOR, AUS) ", GAME_NO_SOUND|GAME_NOT_WORKING )
2152GAME( 1999, pstone,   naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2153GAME( 2000, pstone2,  naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2154GAME( 1999, otrigger, naomi,    naomi,    naomi,    0, ROT0, "Sega",            "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2155GAME( 1999, samba,    naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Samba De Amigo (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
2156GAME( 2000, slasho,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Slashout (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2157GAME( 1999, spawn,    naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Spawn (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2158GAME( 2000, virnba,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2159GAME( 1999, vtennis,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Power Smash (JPN) / Virtua Tennis (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2160GAME( 1999, zombrvn,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Zombie Revenge (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2161GAME( 1999, doa2,     naomi,    naomi,    naomi,    0, ROT0, "Tecmo",           "Dead or Alive 2 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2162GAME( 2000, doa2m,    doa2,     naomi,    naomi,    0, ROT0, "Tecmo",           "Dead or Alive 2 Millennium (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2163GAME( 1998, dybbnao,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Dynamite Baseball NAOMI (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
21512164
21522165
21532166
21542167// No GD-Rom Sets Supported */
21552168
21562169/* Naomi 2 & Naomi 2 GD-ROM */
2157GAME( 2001, naomi2,   0,naomi, naomi, 0, ROT0, "Sega",         "Naomi 2 Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2170GAME( 2001, naomi2,   0,        naomi,    naomi,    0, ROT0, "Sega",            "Naomi 2 Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
21582171// No Supported Sets
21592172
21602173/* Atomiswave */
2161GAME( 2001, awbios,   0,naomi, naomi, 0, ROT0, "Sammy",        "Atomiswave Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2162// No Supported Setas
2174GAME( 2001, awbios,   0,        naomi,    naomi,    0, ROT0, "Sammy",           "Atomiswave Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2175// No Supported Sets
src/mame/drivers/nemesis.c
r1649r1650
3737***************************************************************************/
3838
3939#include "driver.h"
40#include "deprecat.h"
4041#include "cpu/z80/z80.h"
4142#include "sound/ay8910.h"
4243#include "sound/2151intf.h"
src/mame/drivers/magmax.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/m68000/m68000.h"
1314#include "sound/ay8910.h"
1415
src/mame/drivers/stv.c
r1649r1650
166166*/
167167
168168#include "driver.h"
169#include "deprecat.h"
169170#include "machine/eeprom.h"
170171#include "cpu/sh2/sh2.h"
171172#include "machine/stvcd.h"
src/mame/drivers/megatech.c
r1649r1650
7878
7979*/
8080#include "driver.h"
81#include "deprecat.h"
8182#include "genesis.h"
8283#include "rendlay.h"
8384#include "megadriv.h"
r1649r1650
306307#ifdef UNUSED_FUNCTION
307308READ8_HANDLER( md_sms_ioport_dc_r )
308309{
309   return 0xff;//mame_rand(Machine);
310   return 0xff;
310311}
311312
312313READ8_HANDLER( md_sms_ioport_dd_r )
313314{
314   return 0xff;//mame_rand(Machine);
315   return 0xff;
315316}
316317#endif
317318
src/mame/drivers/timelimt.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "sound/ay8910.h"
1516
1617/* from video */
src/mame/drivers/talbot.c
r1649r1650
88*/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "sound/ay8910.h"
1213
1314static tilemap *bg_tilemap;
src/mame/drivers/warriorb.c
r1649r1650
144144***************************************************************************/
145145
146146#include "driver.h"
147#include "deprecat.h"
147148#include "taitoipt.h"
148149#include "rendlay.h"
149150#include "cpu/m68000/m68000.h"
src/mame/drivers/igs_blit.c
r1649r1650
3535***************************************************************************/
3636
3737#include "driver.h"
38#include "deprecat.h"
3839#include "sound/okim6295.h"
3940#include "sound/2413intf.h"
4041#include "sound/3812intf.h"
r1649r1650
30073008
30083009***************************************************************************/
30093010
3010GAME( 1995, lhb,      0,        lhb,      lhb,      lhb,      ROT0, "IGS",        "Long Hu Bang",                   0 )
3011GAME( 1995, lhb,      0,        lhb,      lhb,      lhb,      ROT0, "IGS",        "Long Hu Bang (set 1)",            0 )
30113012// the screenshot in the zip shows a 1995 copyright, but only 199 is displayed in MAME?  todo: verify protection patch is correct for this set
30123013GAME( 1995, lhba,     lhb,      lhb,      lhb,      lhb,      ROT0, "IGS",        "Long Hu Bang (set 2)",            0 )
30133014GAME( 199?, dbc,      0,        lhb,      lhb,      0,        ROT0, "IGS",        "Da Ban Cheng",                    GAME_NOT_WORKING ) // needs decrypting / prot patches
src/mame/drivers/goal92.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "sound/2203intf.h"
1213#include "sound/okim6295.h"
1314#include "sound/msm5205.h"
src/mame/drivers/bishi.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "video/konamiic.h"
1516#include "cpu/m68000/m68000.h"
1617#include "sound/ymz280b.h"
src/mame/drivers/vamphalf.c
r1649r1650
2828*********************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3132#include "machine/eeprom.h"
3233#include "sound/2151intf.h"
3334#include "sound/okim6295.h"
src/mame/drivers/1942.c
r1649r1650
7373***************************************************************************/
7474
7575#include "driver.h"
76#include "deprecat.h"
7677#include "sound/ay8910.h"
7778
7879
r1649r1650
168169   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
169170
170171   PORT_START_TAG("DSWA")
171   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:8,7,6")
172   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWA:8,7,6")
172173   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
173174   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
174175   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
r1649r1650
177178   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
178179   PORT_DIPSETTING(    0x05, DEF_STR( 1C_4C ) )
179180   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
180   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW1:5")
181   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWA:5")
181182   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
182183   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
183   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4,3")
184   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWA:4,3")
184185   PORT_DIPSETTING(    0x30, "20K 80K 80K+" )
185186   PORT_DIPSETTING(    0x20, "20K 100K 100K+" )
186187   PORT_DIPSETTING(    0x10, "30K 80K 80K+" )
187188   PORT_DIPSETTING(    0x00, "30K 100K 100K+" )
188   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:2,1")
189   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWA:2,1")
189190   PORT_DIPSETTING(    0x80, "1" )
190191   PORT_DIPSETTING(    0x40, "2" )
191192   PORT_DIPSETTING(    0xc0, "3" )
192193   PORT_DIPSETTING(    0x00, "5" )
193194
194195   PORT_START_TAG("DSWB")
195   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW2:8,7,6")
196   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWB:8,7,6")
196197   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
197198   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
198199   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
r1649r1650
201202   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
202203   PORT_DIPSETTING(    0x05, DEF_STR( 1C_4C ) )
203204   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
204   PORT_SERVICE_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW2:5" )
205   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW2:4")
205   PORT_SERVICE_DIPLOC(0x08, IP_ACTIVE_LOW, "SWB:5" )
206   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SWB:4")
206207   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
207208   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
208   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:3,2")
209   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:3,2")
209210   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
210211   PORT_DIPSETTING(    0x60, DEF_STR( Normal ) )
211212   PORT_DIPSETTING(    0x20, "Difficult" )
212213   PORT_DIPSETTING(    0x00, "Very Difficult" )
213   PORT_DIPNAME( 0x80, 0x80, "Freeze" )            PORT_DIPLOCATION("SW2:1")
214   PORT_DIPNAME( 0x80, 0x80, "Screen Stop" )            PORT_DIPLOCATION("SWB:1")
214215   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
215216   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
216217INPUT_PORTS_END
src/mame/drivers/poolshrk.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "poolshrk.h"
910#include "sound/discrete.h"
1011
src/mame/drivers/alg.c
r1649r1650
2222
2323#include "driver.h"
2424#include "render.h"
25#include "deprecat.h"
2526#include "includes/amiga.h"
2627#include "machine/laserdsc.h"
2728
src/mame/drivers/vegaeo.c
r1649r1650
1313 *********************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "machine/at28c16.h"
1718#include "eolithsp.h"
1819
src/mame/drivers/fromanc2.c
r1649r1650
2222******************************************************************************/
2323
2424#include "driver.h"
25#include "deprecat.h"
2526#include "cpu/m68000/m68000.h"
2627#include "cpu/z80/z80.h"
2728#include "machine/eeprom.h"
src/mame/drivers/rallyx.c
r1649r1650
180180***************************************************************************/
181181
182182#include "driver.h"
183#include "deprecat.h"
183184#include "audio/timeplt.h"
184185#include "sound/namco.h"
185186#include "sound/samples.h"
r1649r1650
876877   MDRV_CPU_PROGRAM_MAP(locomotn_map,0)
877878   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
878879
879   MDRV_CPU_ADD(Z80, 14318180/8)   /* 1.789772727 MHz */
880   /* audio CPU */
881   MDRV_CPU_PROGRAM_MAP(locomotn_sound_readmem,locomotn_sound_writemem)
882
883880   MDRV_SCREEN_REFRESH_RATE(60)
884881   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION   /* frames per second, vblank duration */)
885882
r1649r1650
897894   MDRV_VIDEO_UPDATE(rallyx)
898895
899896   /* sound hardware */
900   MDRV_SPEAKER_STANDARD_MONO("mono")
901
902   MDRV_SOUND_ADD(AY8910, 14318180/8)
903   MDRV_SOUND_CONFIG(timeplt_ay8910_interface)
904   MDRV_SOUND_ROUTE(0, "filter.0.0", 0.60)
905   MDRV_SOUND_ROUTE(1, "filter.0.1", 0.60)
906   MDRV_SOUND_ROUTE(2, "filter.0.2", 0.60)
907
908   MDRV_SOUND_ADD(AY8910, 14318180/8)
909   MDRV_SOUND_ROUTE(0, "filter.1.0", 0.60)
910   MDRV_SOUND_ROUTE(1, "filter.1.1", 0.60)
911   MDRV_SOUND_ROUTE(2, "filter.1.2", 0.60)
912
913   MDRV_SOUND_ADD_TAG("filter.0.0", FILTER_RC, 0)
914   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
915   MDRV_SOUND_ADD_TAG("filter.0.1", FILTER_RC, 0)
916   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
917   MDRV_SOUND_ADD_TAG("filter.0.2", FILTER_RC, 0)
918   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
919
920   MDRV_SOUND_ADD_TAG("filter.1.0", FILTER_RC, 0)
921   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
922   MDRV_SOUND_ADD_TAG("filter.1.1", FILTER_RC, 0)
923   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
924   MDRV_SOUND_ADD_TAG("filter.1.2", FILTER_RC, 0)
925   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
897   MDRV_IMPORT_FROM(locomotn_sound)
926898MACHINE_DRIVER_END
927899
928900
src/mame/drivers/bnstars.c
r1649r1650
8787*/
8888
8989#include "driver.h"
90#include "deprecat.h"
9091#include "sound/ymf271.h"
9192#include "rendlay.h"
9293
r1649r1650
117118   int tileno, colour;
118119
119120   tileno = ms32_tx0_ram[tile_index *2+0] & 0x0000ffff;
120   colour = ms32_tx0_ram[tile_index *2+1] & 0x000000f0;
121   colour = ms32_tx0_ram[tile_index *2+1] & 0x0000000f;
121122
122123   SET_TILE_INFO(3,tileno,colour,0);
123124}
r1649r1650
127128   int tileno, colour;
128129
129130   tileno = ms32_tx1_ram[tile_index *2+0] & 0x0000ffff;
130   colour = ms32_tx1_ram[tile_index *2+1] & 0x000000f0;
131   colour = ms32_tx1_ram[tile_index *2+1] & 0x0000000f;
131132
132133   SET_TILE_INFO(7,tileno,colour,0);
133134}
r1649r1650
151152   int tileno,colour;
152153
153154   tileno = ms32_bg0_ram[tile_index *2+0] & 0x0000ffff;
154   colour = ms32_bg0_ram[tile_index *2+1] & 0x000000f0;
155   colour = ms32_bg0_ram[tile_index *2+1] & 0x0000000f;
155156
156157   SET_TILE_INFO(2,tileno,colour,0);
157158}
r1649r1650
161162   int tileno,colour;
162163
163164   tileno = ms32_bg1_ram[tile_index *2+0] & 0x0000ffff;
164   colour = ms32_bg1_ram[tile_index *2+1] & 0x000000f0;
165   colour = ms32_bg1_ram[tile_index *2+1] & 0x0000000f;
165166
166167   SET_TILE_INFO(6,tileno,colour,0);
167168}
r1649r1650
270271   int tileno,colour;
271272
272273   tileno = ms32_roz0_ram[tile_index *2+0] & 0x0000ffff;
273   colour = ms32_roz0_ram[tile_index *2+1] & 0x000000f0;
274   colour = ms32_roz0_ram[tile_index *2+1] & 0x0000000f;
274275
275276   SET_TILE_INFO(1,tileno,colour,0);
276277}
r1649r1650
280281   int tileno,colour;
281282
282283   tileno = ms32_roz1_ram[tile_index *2+0] & 0x0000ffff;
283   colour = ms32_roz1_ram[tile_index *2+1] & 0x000000f0;
284   colour = ms32_roz1_ram[tile_index *2+1] & 0x0000000f;
284285
285286   SET_TILE_INFO(5,tileno,colour,0);
286287}
r1649r1650
14051406   ROM_LOAD32_WORD( "mr96004-08.31",   0x0c00002, 0x200000, CRC(f6df27b2) SHA1(60590976020d86bdccd4eaf57b349ea31bec6830) )
14061407
14071408   /* Roz Tiles #1 (Screen 1) */
1408   ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* roz tiles, don't dispose since we use GFX_RAW */
1409   ROM_LOAD( "mr96004-09.1", 0x000000, 0x200000, BAD_DUMP CRC(603143e8) SHA1(197ff72d4a6bf9cc5e89505c1a25edad104a9a65) )
1409   ROM_REGION( 0x400000, REGION_GFX2, 0 ) /* roz tiles, don't dispose since we use GFX_RAW */
1410   ROM_LOAD( "mr96004-09.1", 0x000000, 0x400000, CRC(7f8ea9f0) SHA1(f1fe682dcb884f1aa4a5536e17ab94157a99f519) )
14101411
14111412   /* Roz Tiles #2 (Screen 2) */
1412   ROM_REGION( 0x200000, REGION_GFX3, 0 ) /* roz tiles, don't dispose since we use GFX_RAW */
1413   ROM_LOAD( "mr96004-09.7", 0x000000, 0x200000, BAD_DUMP CRC(603143e8) SHA1(197ff72d4a6bf9cc5e89505c1a25edad104a9a65) )
1413   ROM_REGION( 0x400000, REGION_GFX3, 0 ) /* roz tiles, don't dispose since we use GFX_RAW */
1414   ROM_LOAD( "mr96004-09.7", 0x000000, 0x400000, CRC(7f8ea9f0) SHA1(f1fe682dcb884f1aa4a5536e17ab94157a99f519) )
14141415
14151416   /* BG Tiles #1 (Screen 1?) */
14161417   ROM_REGION( 0x200000, REGION_GFX4, 0 ) /* bg tiles, don't dispose since we use GFX_RAW */
r1649r1650
14351436
14361437   /* Samples #1 (Screen 1?) */
14371438   ROM_REGION( 0x400000, REGION_SOUND1, 0 ) /* samples - 8-bit signed PCM */
1438   ROM_LOAD( "mr96004-10.1",  0x000000, 0x200000, BAD_DUMP CRC(125661cd) SHA1(7c5fd952fb756364cc0ab6a53072f5cf8a04486c) )
1439   ROM_LOAD( "mr96004-10.1",  0x000000, 0x400000, CRC(83f4303a) SHA1(90ee010591afe1d35744925ef0e8d9a7e2ef3378) )
14391440
14401441   /* Samples #2 (Screen 2?) */
14411442   ROM_REGION( 0x400000, REGION_SOUND2, 0 ) /* samples - 8-bit signed PCM */
1442   ROM_LOAD( "mr96004-10.1",  0x000000, 0x200000, BAD_DUMP CRC(125661cd) SHA1(7c5fd952fb756364cc0ab6a53072f5cf8a04486c) )
1443   ROM_LOAD( "mr96004-10.1",  0x000000, 0x400000, CRC(83f4303a) SHA1(90ee010591afe1d35744925ef0e8d9a7e2ef3378) )
14431444ROM_END
14441445
14451446
src/mame/drivers/unico.c
r1649r1650
2323***************************************************************************/
2424
2525#include "driver.h"
26#include "deprecat.h"
2627#include "machine/eeprom.h"
2728#include "unico.h"
2829#include "sound/2151intf.h"
src/mame/drivers/blockhl.c
r1649r1650
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
2425#include "video/konamiic.h"
2526#include "sound/2151intf.h"
src/mame/drivers/realbrk.c
r1649r1650
4141***************************************************************************/
4242
4343#include "driver.h"
44#include "deprecat.h"
4445#include "machine/tmp68301.h"
4546#include "realbrk.h"
4647#include "sound/2413intf.h"
src/mame/drivers/diverboy.c
r1649r1650
4747*/
4848
4949#include "driver.h"
50#include "deprecat.h"
5051#include "sound/okim6295.h"
5152
5253extern UINT16 *diverboy_spriteram;
src/mame/drivers/segag80v.c
r1649r1650
133133***************************************************************************/
134134
135135#include "driver.h"
136#include "deprecat.h"
136137#include "sound/ay8910.h"
137138#include "sound/samples.h"
138139#include "audio/segasnd.h"
src/mame/drivers/carjmbre.c
r1649r1650
204204   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
205205   MDRV_GFXDECODE(carjmbre)
206206   MDRV_PALETTE_LENGTH(64)
207   MDRV_COLORTABLE_LENGTH(64)
208207
209208   MDRV_PALETTE_INIT(carjmbre)
210209   MDRV_VIDEO_START(carjmbre)
src/mame/drivers/ace.c
r1649r1650
3838****************************************************************************/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142
4243
4344static UINT8 *ace_scoreram;
r1649r1650
330331   MDRV_SCREEN_VISIBLE_AREA(4*8, 32*8-1, 2*8, 32*8-1)
331332   MDRV_GFXDECODE(ace)
332333   MDRV_PALETTE_LENGTH(2)
333   MDRV_COLORTABLE_LENGTH(2*2)
334334
335335   MDRV_PALETTE_INIT(ace)
336336   MDRV_VIDEO_UPDATE(ace)
src/mame/drivers/vmetal.c
r1649r1650
112112
113113static READ16_HANDLER ( varia_random )
114114{
115//  return mame_rand(Machine);  // dips etc.. weird
116115   return 0xffff;
117116}
118117
src/mame/drivers/superchs.c
r1649r1650
3434***************************************************************************/
3535
3636#include "driver.h"
37#include "deprecat.h"
3738#include "cpu/m68000/m68000.h"
3839#include "video/taitoic.h"
3940#include "audio/taitosnd.h"
src/mame/drivers/bottom9.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/m6809/m6809.h"
1314#include "video/konamiic.h"
1415#include "sound/k007232.h"
src/mame/drivers/flower.c
r1649r1650
3333*/
3434
3535#include "driver.h"
36#include "deprecat.h"
3637#include "sound/custom.h"
3738
3839extern UINT8 *flower_textram, *flower_bg0ram, *flower_bg1ram, *flower_bg0_scroll, *flower_bg1_scroll;
src/mame/drivers/battlera.c
r1649r1650
2121**********************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "cpu/h6280/h6280.h"
2526#include "sound/2203intf.h"
2627#include "sound/msm5205.h"
src/mame/drivers/dreamwld.c
r1649r1650
3737*/
3838
3939#include "driver.h"
40#include "deprecat.h"
4041#include "sound/okim6295.h"
4142
4243#define MASTER_CLOCK 32000000
src/mame/drivers/xain.c
r1649r1650
142142***************************************************************************/
143143
144144#include "driver.h"
145#include "deprecat.h"
145146#include "cpu/m6809/m6809.h"
146147#include "cpu/m6805/m6805.h"
147148#include "sound/2203intf.h"
src/mame/drivers/gundealr.c
r1649r1650
4747***************************************************************************/
4848
4949#include "driver.h"
50#include "deprecat.h"
5051#include "sound/2203intf.h"
5152
5253
src/mame/drivers/namcos1.c
r1649r1650
339339***********************************************************************/
340340
341341#include "driver.h"
342#include "deprecat.h"
342343#include "cpu/m6809/m6809.h"
343344#include "cpu/m6800/m6800.h"
344345#include "sound/2151intf.h"
src/mame/drivers/mainevt.c
r1649r1650
2121***************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "video/konamiic.h"
2526#include "cpu/m6809/m6809.h"
2627#include "sound/2151intf.h"
src/mame/drivers/m62.c
r1649r1650
6060**************************************************************************/
6161
6262#include "driver.h"
63#include "m62.h"
6364#include "audio/irem.h"
6465
6566
66PALETTE_INIT( m62 );
67PALETTE_INIT( lotlot );
68PALETTE_INIT( battroad );
69PALETTE_INIT( spelunk2 );
70
71WRITE8_HANDLER( m62_tileram_w );
72WRITE8_HANDLER( m62_textram_w );
73WRITE8_HANDLER( m62_flipscreen_w );
74WRITE8_HANDLER( m62_hscroll_low_w );
75WRITE8_HANDLER( m62_hscroll_high_w );
76WRITE8_HANDLER( m62_vscroll_low_w );
77WRITE8_HANDLER( m62_vscroll_high_w );
78extern UINT8 *m62_tileram;
79extern UINT8 *m62_textram;
80
81VIDEO_START( kungfum );
82VIDEO_UPDATE( kungfum );
83WRITE8_HANDLER( kungfum_tileram_w );
84
85VIDEO_START( ldrun );
86VIDEO_UPDATE( ldrun );
87
88VIDEO_START( ldrun2 );
89
90VIDEO_START( battroad );
91VIDEO_UPDATE( battroad );
92
93VIDEO_START( ldrun4 );
94VIDEO_UPDATE( ldrun4 );
95
96VIDEO_START( lotlot );
97VIDEO_UPDATE( lotlot );
98
99WRITE8_HANDLER( kidniki_text_vscroll_low_w );
100WRITE8_HANDLER( kidniki_text_vscroll_high_w );
101WRITE8_HANDLER( kidniki_background_bank_w );
102VIDEO_START( kidniki );
103VIDEO_UPDATE( kidniki );
104
105WRITE8_HANDLER( spelunkr_palbank_w );
106VIDEO_START( spelunkr );
107VIDEO_UPDATE( spelunkr );
108
109WRITE8_HANDLER( spelunk2_gfxport_w );
110VIDEO_START( spelunk2 );
111VIDEO_UPDATE( spelunk2 );
112
113VIDEO_START( youjyudn );
114VIDEO_UPDATE( youjyudn );
115
116VIDEO_START( horizon );
117VIDEO_UPDATE( horizon );
118WRITE8_HANDLER( horizon_scrollram_w );
119extern UINT8 *horizon_scrollram;
120
121
12267/* Lode Runner 2 seems to have a simple protection on the bank switching */
12368/* circuitry. It writes data to ports 0x80 and 0x81, then reads port 0x80 */
12469/* a variable number of times (discarding the result) and finally retrieves */
r1649r1650
13811326   MDRV_VIDEO_UPDATE(ldrun)
13821327
13831328   /* sound hardware */
1384   MDRV_IMPORT_FROM(irem_audio)
1329   MDRV_IMPORT_FROM(m62_audio)
13851330MACHINE_DRIVER_END
13861331
13871332
src/mame/drivers/astrocde.c
r1649r1650
101101****************************************************************************/
102102
103103#include "driver.h"
104#include "deprecat.h"
104105#include "cpu/z80/z80daisy.h"
105106#include "includes/astrocde.h"
106107#include "machine/z80ctc.h"
src/mame/drivers/megazone.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6809/m6809.h"
1112#include "cpu/i8039/i8039.h"
1213#include "cpu/z80/z80.h"
src/mame/drivers/deco156.c
r1649r1650
1616extern void decrypt156(void);
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "decocrpt.h"
2021#include "deco32.h"
2122#include "machine/eeprom.h"
src/mame/drivers/toki.c
r1649r1650
3535***************************************************************************/
3636
3737#include "driver.h"
38#include "deprecat.h"
3839#include "cpu/z80/z80.h"
3940#include "audio/seibu.h"
4041#include "sound/3812intf.h"
src/mame/drivers/dwarfd.c
r1649r1650
8181*/
8282
8383#include "driver.h"
84#include "deprecat.h"
8485#include "cpu/i8085/i8085.h"
8586#include "sound/ay8910.h"
8687
src/mame/drivers/40love.c
r1649r1650
216216
217217*/
218218
219#include <math.h>
220219#include "driver.h"
220#include "deprecat.h"
221221#include "cpu/z80/z80.h"
222222#include "cpu/m6805/m6805.h"
223223#include "sound/ay8910.h"
src/mame/drivers/junofrst.c
r1649r1650
7878
7979
8080#include "driver.h"
81#include "deprecat.h"
82#include "tutankhm.h"
8183#include "cpu/m6809/m6809.h"
8284#include "cpu/i8039/i8039.h"
8385#include "cpu/z80/z80.h"
r1649r1650
8890
8991void konami1_decode(void);
9092
91extern UINT8 *tutankhm_videoram;
92extern size_t tutankhm_videoram_size;
93extern UINT8 *tutankhm_paletteram;
94extern UINT8 *tutankhm_scroll;
95
9693static int i8039_status;
9794
98WRITE8_HANDLER( tutankhm_flip_screen_x_w );
99WRITE8_HANDLER( tutankhm_flip_screen_y_w );
100WRITE8_HANDLER( junofrst_blitter_w );
101VIDEO_UPDATE( tutankhm );
102
10395WRITE8_HANDLER( tutankhm_sh_irqtrigger_w );
10496
10597
r1649r1650
189181
190182
191183static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
192   AM_RANGE(0x0000, 0x7fff) AM_RAM AM_BASE(&tutankhm_videoram) AM_SIZE(&tutankhm_videoram_size)
193   AM_RANGE(0x8000, 0x800f) AM_RAM AM_BASE(&tutankhm_paletteram)
184   AM_RANGE(0x0000, 0x7fff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
185   AM_RANGE(0x8000, 0x800f) AM_RAM AM_BASE(&paletteram)
194186   AM_RANGE(0x8010, 0x8010) AM_READ(input_port_0_r)   /* DSW2 (inverted bits) */
195187   AM_RANGE(0x801c, 0x801c) AM_READ(watchdog_reset_r)
196188   AM_RANGE(0x8020, 0x8020) AM_READ(input_port_1_r)   /* IN0 I/O: Coin slots, service, 1P/2P buttons */
r1649r1650
365357   MDRV_SCREEN_SIZE(32*8, 32*8)
366358   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)   /* not sure about the visible area */
367359
360   MDRV_VIDEO_START(tutankhm)
368361   MDRV_VIDEO_UPDATE(tutankhm)
369362
370363   /* sound hardware */
src/mame/drivers/renegade.c
r1649r1650
101101
102102#include "driver.h"
103103#include "streams.h"
104#include "deprecat.h"
104105#include "cpu/m6502/m6502.h"
105106#include "cpu/m6809/m6809.h"
106107#include "sound/3812intf.h"
src/mame/drivers/sg1000a.c
r1649r1650
112112******************************************************/
113113
114114#include "driver.h"
115#include "deprecat.h"
115116#include "sound/sn76496.h"
116117#include "video/tms9928a.h"
117118#include "machine/segacrpt.h"
src/mame/drivers/galaga.c
r1649r1650
697697***************************************************************************/
698698
699699#include "driver.h"
700#include "deprecat.h"
700701#include "machine/atari_vg.h"
701702#include "machine/namcoio.h"
702703#include "machine/namco50.h"
src/mame/drivers/panicr.c
r1649r1650
6060*/
6161
6262#include "driver.h"
63#include "deprecat.h"
6364#include "audio/t5182.h"
6465
6566static tilemap *bgtilemap, *txttilemap;
src/mame/drivers/istellar.c
r1649r1650
2222*/
2323
2424#include "driver.h"
25#include "deprecat.h"
2526#include "render.h"
2627#include "machine/laserdsc.h"
2728
src/mame/drivers/lasso.c
r1649r1650
2323***************************************************************************/
2424
2525#include "driver.h"
26#include "deprecat.h"
2627#include "cpu/z80/z80.h"
2728#include "lasso.h"
2829#include "sound/dac.h"
src/mame/drivers/sbowling.c
r1649r1650
3838***********************************************************/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "cpu/i8039/i8039.h"
4243#include "video/resnet.h"
4344#include "sound/ay8910.h"
r1649r1650
9596{
9697   fillbitmap(bitmap,machine->pens[0x18],cliprect);
9798   tilemap_draw(bitmap,cliprect,sb_tilemap,0,0);
98   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect, TRANSPARENCY_PEN, color_prom_address);
99   copybitmap_trans(bitmap,tmpbitmap,0,0,0,0,cliprect, color_prom_address);
99100   return 0;
100101}
101102
src/mame/drivers/psychic5.c
r1649r1650
310310*/
311311
312312#include "driver.h"
313#include "deprecat.h"
313314#include "sound/2203intf.h"
314315
315316
src/mame/drivers/taito_h.c
r1649r1650
128128
129129
130130#include "driver.h"
131#include "deprecat.h"
131132#include "taitoipt.h"
132133#include "audio/taitosnd.h"
133134#include "video/taitoic.h"
src/mame/drivers/8080bw.c
r1649r1650
7777/****************************************************************************/
7878
7979#include "driver.h"
80#include "deprecat.h"
8081#include "8080bw.h"
8182#include "mw8080bw.h"
8283#include "machine/mb14241.h"
src/mame/drivers/othunder.c
r1649r1650
231231***************************************************************************/
232232
233233#include "driver.h"
234#include "deprecat.h"
234235#include "taitoipt.h"
235236#include "cpu/m68000/m68000.h"
236237#include "machine/eeprom.h"
src/mame/drivers/ginganin.c
r1649r1650
4949***************************************************************************/
5050
5151#include "driver.h"
52#include "deprecat.h"
5253#include "sound/ay8910.h"
5354#include "sound/3812intf.h"
5455
src/mame/drivers/tail2nos.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "video/konamiic.h"
1415#include "cpu/z80/z80.h"
1516#include "sound/2608intf.h"
src/mame/drivers/slapshot.c
r1649r1650
132132***************************************************************************/
133133
134134#include "driver.h"
135#include "deprecat.h"
135136#include "cpu/m68000/m68000.h"
136137#include "video/taitoic.h"
137138#include "audio/taitosnd.h"
src/mame/drivers/ertictac.c
r1649r1650
2727
2828**********************************************************************/
2929#include "driver.h"
30#include "deprecat.h"
3031#include "cpu/arm/arm.h"
3132
3233static UINT32 *ertictac_mainram;
src/mame/drivers/vsnes.c
r1649r1650
28182818GAME( 1986, suprmria, suprmrio, vsnes,   suprmrio, suprmrio, ROT0, "Nintendo",  "Vs. Super Mario Bros. (alt)", 0 )
28192819GAME( 1985, vsskykid, 0,        vsnes,   vsskykid, MMC3,    ROT0, "Namco",     "Vs. Super SkyKid" , 0 )
28202820GAME( 1987, tkoboxng, 0,        vsnes,   tkoboxng, tkoboxng, ROT0, "Namco LTD.","Vs. TKO Boxing", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
2821GAME( 1984, smgolf,   0,        vsnes,   golf4s,   machridr, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Men Version)", 0 )
2821GAME( 1984, smgolf,   0,        vsnes,   golf4s,   machridr, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Men Version, set 1)", 0 )
28222822GAME( 1984, smgolfj,  smgolf,   vsnes,   golf,     vsnormal, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Men Version) (Japan)", 0 )
28232823GAME( 1984, ladygolf, smgolf,   vsnes,   golf,     machridr, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Ladies Version)", 0 )
28242824GAME( 1984, vspinbal, 0,        vsnes,   vspinbal, vspinbal, ROT0, "Nintendo",  "Vs. Pinball", 0 )
r1649r1650
28482848GAME( 1984, iceclmrj, 0,        vsdual,  iceclmrj, iceclmrj, ROT0, "Nintendo",  "Vs. Ice Climber Dual (Japan)" , 0 )
28492849
28502850/* Not Working (bad dumps) */
2851GAME( 1985, smgolfb,  smgolf,   vsnes,   golf,     machridr, ROT0, "Nintendo",   "Vs. Stroke & Match Golf (Men set 2)", GAME_NOT_WORKING )
2851GAME( 1985, smgolfb,  smgolf,   vsnes,   golf,     machridr, ROT0, "Nintendo",   "Vs. Stroke & Match Golf (Men Version, set 2)", GAME_NOT_WORKING )
28522852GAME( 1984, vsbbaljb, vsbball,  vsdual,  vsbballj, vsbball,  ROT0, "Nintendo of America",  "Vs. BaseBall (Japan set 3)", GAME_NOT_WORKING )
src/mame/drivers/xyonix.c
r1649r1650
2020******************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "cpu/z80/z80.h"
2425#include "sound/sn76496.h"
2526
src/mame/drivers/1943.c
r1649r1650
120120   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
121121   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
122122
123   PORT_START_TAG("DSW0")
124   PORT_DIPNAME( 0x0f, 0x08, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW1:5,6,7,8")
123   PORT_START_TAG("DSWA")
124   PORT_DIPNAME( 0x0f, 0x08, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SWA:5,6,7,8")
125125   PORT_DIPSETTING(    0x0f, "1 (Easy)" )
126126   PORT_DIPSETTING(    0x0e, "2" )
127127   PORT_DIPSETTING(    0x0d, "3" )
r1649r1650
138138   PORT_DIPSETTING(    0x02, "14" )
139139   PORT_DIPSETTING(    0x01, "15" )
140140   PORT_DIPSETTING(    0x00, "16 (Difficult)" )
141   PORT_DIPNAME( 0x10, 0x10, "2 Player Game" )            PORT_DIPLOCATION("SW1:4")
141   PORT_DIPNAME( 0x10, 0x10, "2 Player Game" )            PORT_DIPLOCATION("SWA:4")
142142   PORT_DIPSETTING(    0x00, "1 Credit/2 Players" )
143143   PORT_DIPSETTING(    0x10, "2 Credits/2 Players" )
144   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )      PORT_DIPLOCATION("SW1:3")
145   PORT_DIPSETTING(    0x20, DEF_STR( Off ))
146   PORT_DIPSETTING(    0x00, DEF_STR( On ))
147   PORT_DIPNAME( 0x40, 0x40, "Freeze" )               PORT_DIPLOCATION("SW1:2")
144   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )         PORT_DIPLOCATION("SWA:3")
145   PORT_DIPSETTING(    0x20, DEF_STR( Upright ))
146   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ))
147   PORT_DIPNAME( 0x40, 0x40, "Screen Stop" )            PORT_DIPLOCATION("SWA:2")
148148   PORT_DIPSETTING(    0x40, DEF_STR( Off ))
149149   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
150   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:1" )
150   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SWA:1" )
151151
152   PORT_START_TAG("DSW1")
153   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SW2:6,7,8")
152   PORT_START_TAG("DSWB")
153   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SWB:6,7,8")
154154   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ))
155155   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
156156   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
r1649r1650
159159   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
160160   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
161161   PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C ) )
162   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )         PORT_DIPLOCATION("SW2:3,4,5")
162   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )         PORT_DIPLOCATION("SWB:3,4,5")
163163   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ))
164164   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
165165   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
r1649r1650
168168   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
169169   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
170170   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
171   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SW2:2")
171   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:2")
172172   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
173173   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
174   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
174   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SWB:1")
175175   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
176176   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
177177INPUT_PORTS_END
r1649r1650
267267   MDRV_SCREEN_SIZE(32*8, 32*8)
268268   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
269269   MDRV_GFXDECODE(1943)
270   MDRV_PALETTE_LENGTH(256)
271   MDRV_COLORTABLE_LENGTH(32*4+16*16+16*16+16*16)
270   MDRV_PALETTE_LENGTH(32*4+16*16+16*16+16*16)
272271
273272   MDRV_PALETTE_INIT(1943)
274273   MDRV_VIDEO_START(1943)
src/mame/drivers/cninja.c
r1649r1650
4141***************************************************************************/
4242
4343#include "driver.h"
44#include "deprecat.h"
4445#include "cninja.h"
4546#include "cpu/h6280/h6280.h"
4647#include "deco16ic.h"
src/mame/drivers/pacland.c
r1649r1650
173173***************************************************************************/
174174
175175#include "driver.h"
176#include "deprecat.h"
176177#include "cpu/m6800/m6800.h"
177178#include "sound/namco.h"
178179
src/mame/drivers/psikyo4.c
r1649r1650
127127----------------------------------------------------------------*/
128128
129129#include "driver.h"
130#include "deprecat.h"
130131
131132#include "cpu/sh2/sh2.h"
132133#include "machine/eeprom.h"
src/mame/drivers/wardner.c
r1649r1650
124124
125125
126126#include "driver.h"
127#include "deprecat.h"
127128#include "video/crtc6845.h"
128129#include "cpu/tms32010/tms32010.h"
129130#include "twincobr.h"
src/mame/drivers/jcross.c
r1649r1650
1717*/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021#include "cpu/z80/z80.h"
2122#include "snk.h"
2223#include "sound/ay8910.h"
src/mame/drivers/mirage.c
r1649r1650
3131*/
3232
3333#include "driver.h"
34#include "deprecat.h"
3435#include "decocrpt.h"
3536#include "decoprot.h"
3637#include "deco16ic.h"
src/mame/drivers/missile.c
r1649r1650
239239******************************************************************************************/
240240
241241#include "driver.h"
242#include "deprecat.h"
242243#include "sound/pokey.h"
243244
244245
src/mame/drivers/ddrible.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/m6809/m6809.h"
1112#include "sound/2203intf.h"
1213#include "sound/vlm5030.h"
r1649r1650
135136static ADDRESS_MAP_START( writemem_cpu0, ADDRESS_SPACE_PROGRAM, 8 )
136137   AM_RANGE(0x0000, 0x0004) AM_WRITE(K005885_0_w)                        /* video registers (005885 #1) */
137138   AM_RANGE(0x0800, 0x0804) AM_WRITE(K005885_1_w)                        /* video registers (005885 #2) */
138   AM_RANGE(0x1800, 0x187f) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)/* seems wrong, MSB is used as well */
139   AM_RANGE(0x1800, 0x187f) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
139140   AM_RANGE(0x2000, 0x2fff) AM_WRITE(ddrible_fg_videoram_w) AM_BASE(&ddrible_fg_videoram)/* Video RAM 1 */
140141   AM_RANGE(0x3000, 0x3fff) AM_WRITE(MWA8_RAM) AM_BASE(&ddrible_spriteram_1)            /* Object RAM 1 */
141142   AM_RANGE(0x4000, 0x5fff) AM_WRITE(MWA8_RAM) AM_BASE(&ddrible_sharedram)            /* shared RAM with CPU #1 */
r1649r1650
362363/*  MDRV_SCREEN_SIZE(64*8, 32*8)
363364    MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) */
364365   MDRV_GFXDECODE(ddrible)
365   MDRV_PALETTE_LENGTH(64)
366   MDRV_COLORTABLE_LENGTH(64 + 256)
366   MDRV_PALETTE_LENGTH(64 + 256)
367367
368368   MDRV_PALETTE_INIT(ddrible)
369369   MDRV_VIDEO_START(ddrible)
src/mame/drivers/popper.c
r1649r1650
7979*/
8080
8181#include "driver.h"
82#include "deprecat.h"
8283#include "sound/ay8910.h"
8384
8485extern UINT8 *popper_videoram, *popper_attribram, *popper_ol_videoram, *popper_ol_attribram, *popper_spriteram;
src/mame/drivers/ladyfrog.c
r1649r1650
4747#define ladyfrog_scr_size 0
4848
4949#include "driver.h"
50#include "deprecat.h"
5051#include "sound/ay8910.h"
5152#include "sound/msm5232.h"
5253
src/mame/drivers/djboy.c
r1649r1650
154154*/
155155
156156#include "driver.h"
157#include "deprecat.h"
157158#include "cpu/z80/z80.h"
158159#include "sound/2203intf.h"
159160#include "sound/okim6295.h"
src/mame/drivers/sidearms.c
r1649r1650
3636***************************************************************************/
3737
3838#include "driver.h"
39#include "deprecat.h"
3940#include "sound/2203intf.h"
4041#include "sound/2151intf.h"
4142
src/mame/drivers/taito_x.c
r1649r1650
311311***************************************************************************/
312312
313313#include "driver.h"
314#include "deprecat.h"
314315#include "taitoipt.h"
315316#include "audio/taitosnd.h"
316317#include "seta.h"
src/mame/drivers/jack.c
r1649r1650
4242***************************************************************************/
4343
4444#include "driver.h"
45#include "deprecat.h"
4546#include "cpu/z80/z80.h"
4647#include "sound/ay8910.h"
4748
src/mame/drivers/tumblep.c
r1649r1650
4040***************************************************************************/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "cpu/h6280/h6280.h"
4445#include "decocrpt.h"
4546#include "sound/2151intf.h"
src/mame/drivers/dogfgt.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "dogfgt.h"
1213#include "sound/ay8910.h"
1314
src/mame/drivers/dietgo.c
r1649r1650
1010*/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/h6280/h6280.h"
1415#include "sound/2151intf.h"
1516#include "sound/okim6295.h"
src/mame/drivers/taitosj.c
r1649r1650
164164***************************************************************************/
165165
166166#include "driver.h"
167#include "deprecat.h"
167168#include "cpu/z80/z80.h"
168169#include "cpu/m6805/m6805.h"
169170#include "sound/ay8910.h"
src/mame/drivers/kingobox.c
r1649r1650
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "sound/ay8910.h"
2021#include "sound/dac.h"
2122
src/mame/drivers/galivan.c
r1649r1650
2828***************************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3132#include "sound/dac.h"
3233#include "sound/3812intf.h"
3334
src/mame/drivers/blockout.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/z80/z80.h"
1112#include "sound/2151intf.h"
1213#include "sound/okim6295.h"
src/mame/drivers/tsamurai.c
r1649r1650
4242****************************************************************************/
4343
4444#include "driver.h"
45#include "deprecat.h"
4546#include "cpu/z80/z80.h"
4647#include "sound/ay8910.h"
4748#include "sound/dac.h"
src/mame/drivers/ettrivia.c
r1649r1650
1515
1616 driver by Pierpaolo Prazzoli, thanks to Tomasz Slanina too.
1717
18Notes:
19
20 You can swap the question ROMs arbitrarily on these boards. This means
21  the ROMsets in this driver aren't true sets per se, they're just how
22  boards were found "in the wild."
23 ROMs with music questions come in hi|lo pairs.
24
1825*/
1926
2027#include "driver.h"
r1649r1650
343350   ROM_LOAD( "pal16l8a-ep-0.u9",  0x0200, 0x0104, CRC(180e95ad) SHA1(9c8dbe159aaf2595b9934fd4afff16b2e9ab584c) )
344351ROM_END
345352
353ROM_START( promutrc )
354   ROM_REGION( 0x10000, REGION_CPU1, 0 )
355   ROM_LOAD( "u16.u16",      0x0000, 0x8000, CRC(e37d48be) SHA1(1d700cff0c28e50fa2851e0c46de21aa47a23416) )
356
357   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
358   ROM_LOAD( "mt44.ic44",    0x0000, 0x1000, CRC(8d543ea4) SHA1(86ab848a45851540d5d3315e15b92f7b2ac0b77c) )
359   ROM_LOAD( "mt46.ic46",    0x1000, 0x1000, CRC(6d6e1f68) SHA1(e8196ecd915a2528122407d31a7078f177be0beb) )
360
361   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
362   ROM_LOAD( "mt48.ic48",    0x0000, 0x1000, CRC(f2efe300) SHA1(419e889b2f4d038ae64e3ccf4e2498add80b4c9f) )
363   ROM_LOAD( "mt50.ic50",    0x1000, 0x1000, CRC(ee89d24e) SHA1(e3536df549278040255657201433ab23e0386533) )
364
365   ROM_REGION( 0x0200, REGION_PROMS, 0 )
366   ROM_LOAD( "dm74s287n.ic63",     0x0000, 0x0100, CRC(749da5a8) SHA1(8e30f5b014bc8ff2dc4986ef35a979e525681cb9) ) /* palette low bits */
367   ROM_LOAD( "dm74s287n.ic64",     0x0100, 0x0100, CRC(1cf9c914) SHA1(4c39b10c1be889d6ef4313b2112f4216d34f7327) ) /* palette high bits */
368
369   ROM_REGION( 0x40000, REGION_USER1, 0 ) /* Question roms */
370   ROM_LOAD( "sports.lo0.u8",   0x00000, 0x8000, CRC(bb28fa92) SHA1(a3c4c67be0e31793d68b0b048f3a73e9ce1d5859) )
371   ROM_LOAD( "sports2.hi0.u7",  0x08000, 0x8000, CRC(4d0107d7) SHA1(4cbef1bc5faaca52ce6bb490560f213d60a96191) )
372   ROM_LOAD( "expert.lo1.u6",   0x10000, 0x8000, CRC(19153d1a) SHA1(a2f2bbabbd1c68aae58ff29a43cb02b0e8867f5a) )
373   ROM_LOAD( "potpouri.hi1.u5", 0x18000, 0x8000, CRC(cbfa6491) SHA1(74120ea6b3678d54737c37ec3b4b309c346c460e) )
374   ROM_LOAD( "country.lo2.u4",  0x20000, 0x8000, CRC(44673138) SHA1(4e5a3181300bd5f0e9336c2d0ddf900a9b4256d9) )
375   ROM_LOAD( "country.hi2.u3",  0x28000, 0x8000, CRC(3d35a612) SHA1(9d17477c8097b1110ed752caa6d280160368eac1) )
376   ROM_LOAD( "sex3.lo3.u2",     0x30000, 0x8000, CRC(1a2322be) SHA1(22f930dc29e2b9a2c5fbf16479bc213e94df5620) )
377   ROM_LOAD( "geninfo.hi3.u1",  0x38000, 0x8000, CRC(2747fd74) SHA1(d34ac30349dc965ecd8b05b3f1cb7ee24627f369) )
378
379   ROM_REGION( 0x0400, REGION_PLDS, 0 )
380   ROM_LOAD( "pal16l8a-ep-0.u10", 0x0000, 0x0104, CRC(ccbd5f41) SHA1(49e815dc3377b7ed4312c3c9c215c1a6fbce2769) )
381   ROM_LOAD( "pal16l8a-ep-0.u9",  0x0200, 0x0104, CRC(180e95ad) SHA1(9c8dbe159aaf2595b9934fd4afff16b2e9ab584c) )
382ROM_END
383
346384ROM_START( strvmstr )
347385   ROM_REGION( 0x10000, REGION_CPU1, 0 )
348386   ROM_LOAD( "stm16.u16",    0x0000, 0x8000, CRC(ae734db9) SHA1(1bacdfdebaa1f250bfbd49053c3910f1396afe11) )
r1649r1650
373411GAME( 1985, promutrv, 0,        ettrivia, ettrivia, 0, ROT270, "Enerdyne Technologies Inc.", "Progressive Music Trivia (Question set 1)", 0 )
374412GAME( 1985, promutra, promutrv, ettrivia, ettrivia, 0, ROT270, "Enerdyne Technologies Inc.", "Progressive Music Trivia (Question set 2)", 0 )
375413GAME( 1985, promutrb, promutrv, ettrivia, ettrivia, 0, ROT270, "Enerdyne Technologies Inc.", "Progressive Music Trivia (Question set 3)", 0 )
414GAME( 1985, promutrc, promutrv, ettrivia, ettrivia, 0, ROT270, "Enerdyne Technologies Inc.", "Progressive Music Trivia (Question set 4)", 0 )
376415GAME( 1986, strvmstr, 0,        ettrivia, ettrivia, 0, ROT270, "Enerdyne Technologies Inc.", "Super Trivia Master", GAME_WRONG_COLORS )
src/mame/drivers/splash.c
r1649r1650
4242***************************************************************************/
4343
4444#include "driver.h"
45#include "deprecat.h"
4546#include "cpu/z80/z80.h"
4647#include "cpu/m68000/m68000.h"
4748#include "sound/2203intf.h"
r1649r1650
942943GAME( 1992, splash10, splash,   splash,   splash,   splash10, ROT0, "Gaelco",    "Splash! (Ver. 1.0 World)", 0 )
943944GAME( 1992, paintlad, splash,   splash,   splash,   splash,   ROT0, "Gaelco",    "Painted Lady (Splash) (Ver. 1.3 US)", 0 )
944945
945GAME( 1993, roldfrog, 0,        roldfrog, splash,   roldfrog, ROT0, "Microhard", "The Return of Lady Frog", GAME_NO_SOUND )
946GAME( 1993, roldfrog, 0,        roldfrog, splash,   roldfrog, ROT0, "Microhard", "The Return of Lady Frog (set 1)", GAME_NO_SOUND )
946947GAME( 1993, roldfrga, roldfrog, roldfrog, splash,   roldfrog, ROT0, "Microhard", "The Return of Lady Frog (set 2)", GAME_NO_SOUND )
947948GAME( 1995, rebus,    0,        roldfrog, splash,   rebus,    ROT0, "Microhard", "Rebus", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND )
948GAME( 199?, funystrp, 0,        funystrp, funystrp, funystrp, ROT0, "Microhard / MagicGames",    "Funny Strip",GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND )
949GAME( 199?, puckpepl, funystrp, funystrp, funystrp, funystrp, ROT0, "Microhard",    "Puck People",GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND )
949GAME( 199?, funystrp, 0,        funystrp, funystrp, funystrp, ROT0, "Microhard / MagicGames", "Funny Strip", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND )
950GAME( 199?, puckpepl, funystrp, funystrp, funystrp, funystrp, ROT0, "Microhard", "Puck People", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND )
src/mame/drivers/f1gp.c
r1649r1650
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "video/konamiic.h"
2425#include "f1gp.h"
2526#include "sound/2610intf.h"
src/mame/drivers/route16.c
r1649r1650
953953 *
954954 *************************************/
955955
956GAME( 1981, route16,  0,        route16,  route16,  route16,  ROT270, "Tehkan/Sun (Centuri license)", "Route 16", 0 )
956GAME( 1981, route16,  0,        route16,  route16,  route16,  ROT270, "Tehkan/Sun (Centuri license)", "Route 16 (set 1)", 0 )
957957GAME( 1981, route16a, route16,  route16,  route16,  route16a, ROT270, "Tehkan/Sun (Centuri license)", "Route 16 (set 2)", 0 )
958958GAME( 1981, route16b, route16,  route16,  route16,  0,        ROT270, "bootleg", "Route 16 (bootleg)", 0 )
959959GAME( 1981, routex,   route16,  routex,   route16,  0,        ROT270, "bootleg", "Route X (bootleg)", 0 )
src/mame/drivers/tecmosys.c
r1649r1650
102102*/
103103
104104#include "driver.h"
105#include "deprecat.h"
105106#include "machine/eeprom.h"
106107#include "cpu/m68000/m68k.h"
107108#include "sound/okim6295.h"
src/mame/drivers/polyplay.c
r1649r1650
7979***************************************************************************/
8080
8181#include "driver.h"
82#include "deprecat.h"
8283#include "cpu/z80/z80.h"
8384#include "sound/samples.h"
8485
src/mame/drivers/exzisus.c
r1649r1650
2828****************************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3132#include "taitoipt.h"
3233#include "audio/taitosnd.h"
3334#include "sound/2151intf.h"
src/mame/drivers/exidy440.c
r1649r1650
215215***************************************************************************/
216216
217217#include "driver.h"
218#include "deprecat.h"
218219#include "exidy440.h"
219220
220221
r1649r1650
520521 *
521522 *************************************/
522523
523static ADDRESS_MAP_START( cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
524static ADDRESS_MAP_START( exidy440_map, ADDRESS_SPACE_PROGRAM, 8 )
524525   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE(&exidy440_imageram)
525526   AM_RANGE(0x2000, 0x209f) AM_READWRITE(MRA8_RAM, exidy440_spriteram_w) AM_BASE(&spriteram)
526527   AM_RANGE(0x20a0, 0x29ff) AM_RAM
r1649r1650
540541
541542/*************************************
542543 *
543 *  Sound CPU memory handlers
544 *
545 *************************************/
546
547static ADDRESS_MAP_START( cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
548   AM_RANGE(0x8000, 0x8016) AM_READWRITE(exidy440_m6844_r, exidy440_m6844_w) AM_BASE(&exidy440_m6844_data)
549   AM_RANGE(0x8400, 0x8407) AM_READWRITE(MRA8_RAM, exidy440_sound_volume_w) AM_BASE(&exidy440_sound_volume)
550   AM_RANGE(0x8800, 0x8800) AM_READ(exidy440_sound_command_r)
551   AM_RANGE(0x9400, 0x9403) AM_WRITE(MWA8_RAM) AM_BASE(&exidy440_sound_banks)
552   AM_RANGE(0x9800, 0x9800) AM_READWRITE(MRA8_NOP, exidy440_sound_interrupt_clear_w)
553   AM_RANGE(0xa000, 0xbfff) AM_RAM
554   AM_RANGE(0xe000, 0xffff) AM_ROM
555ADDRESS_MAP_END
556
557
558
559/*************************************
560 *
561544 *  Port definitions
562545 *
563546 *************************************/
r1649r1650
10361019
10371020/*************************************
10381021 *
1039 *  Sound definitions
1022 *  Machine drivers
10401023 *
10411024 *************************************/
10421025
1043static const struct CustomSound_interface custom_interface =
1044{
1045   exidy440_sh_start,
1046   exidy440_sh_stop
1047};
1048
1049
1050
1051/*************************************
1052 *
1053 *  Machine driver
1054 *
1055 *************************************/
1056
10571026static MACHINE_DRIVER_START( exidy440 )
10581027
10591028   /* basic machine hardware */
10601029   MDRV_CPU_ADD(M6809,EXIDY440_MAIN_CPU_CLOCK)
1061   MDRV_CPU_PROGRAM_MAP(cpu1_map,0)
1030   MDRV_CPU_PROGRAM_MAP(exidy440_map,0)
10621031   MDRV_CPU_VBLANK_INT(main_interrupt,1)
10631032
1064   MDRV_CPU_ADD(M6809,12979200/4/4)
1065   MDRV_CPU_PROGRAM_MAP(cpu2_map,0)
1066   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
1067
10681033   MDRV_MACHINE_RESET(exidy440)
10691034   MDRV_NVRAM_HANDLER(exidy440)
10701035
r1649r1650
10781043   MDRV_VIDEO_EOF(exidy440)
10791044   MDRV_VIDEO_UPDATE(exidy440)
10801045
1081   /* sound hardware */
1082   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1083
1084   MDRV_SOUND_ADD(CUSTOM, 12979200/256)
1085   MDRV_SOUND_CONFIG(custom_interface)
1086   MDRV_SOUND_ROUTE(0, "left", 1.0)
1087   MDRV_SOUND_ROUTE(1, "right", 1.0)
1046   /* audio hardware */
1047   MDRV_IMPORT_FROM(exidy440_audio)
10881048MACHINE_DRIVER_END
10891049
10901050
src/mame/drivers/tx1.c
r1649r1650
4141***************************************************************************/
4242
4343#include "driver.h"
44#include "deprecat.h"
4445#include "sound/ay8910.h"
4546#include "sound/custom.h"
4647#include "cpu/i86/i86.h"
src/mame/drivers/thayers.c
r1649r1650
1515
1616#include "driver.h"
1717#include "render.h"
18#include "deprecat.h"
1819#include "machine/laserdsc.h"
1920#include "cpu/cop400/cop400.h"
2021
src/mame/drivers/topshoot.c
r1649r1650
134134*/
135135
136136#include "driver.h"
137#include "deprecat.h"
137138#include "genesis.h"
138139
139140
src/mame/drivers/merit.c
r1649r1650
3131*/
3232
3333#include "driver.h"
34#include "deprecat.h"
3435#include "machine/8255ppi.h"
3536#include "sound/ay8910.h"
3637
src/mame/drivers/dassault.c
r1649r1650
119119***************************************************************************/
120120
121121#include "driver.h"
122#include "deprecat.h"
122123#include "cpu/h6280/h6280.h"
123124#include "deco16ic.h"
124125#include "sound/2203intf.h"
src/mame/drivers/pingpong.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "sound/sn76496.h"
34
45extern WRITE8_HANDLER( pingpong_videoram_w );
src/mame/drivers/blstroid.c
r1649r1650
1818
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/atarigen.h"
2223#include "audio/atarijsa.h"
2324#include "blstroid.h"
src/mame/drivers/gotya.c
r1649r1650
211211   MDRV_SCREEN_SIZE(36*8, 32*8)
212212   MDRV_SCREEN_VISIBLE_AREA(0, 36*8-1, 2*8, 30*8-1)
213213   MDRV_GFXDECODE(gotya)
214   MDRV_PALETTE_LENGTH(8)
215   MDRV_COLORTABLE_LENGTH(16*4)
214   MDRV_PALETTE_LENGTH(16*4)
216215
217216   MDRV_PALETTE_INIT(gotya)
218217   MDRV_VIDEO_START(gotya)
src/mame/drivers/gtipoker.c
r1649r1650
22/* Nothing else is known about this set / game */
33
44#include "driver.h"
5#include "deprecat.h"
56
67static VIDEO_START(gtipoker)
78{
src/mame/drivers/tatsumi.c
r1649r1650
138138***************************************************************************/
139139
140140#include "driver.h"
141#include "deprecat.h"
141142#include "tatsumi.h"
142143#include "sound/2151intf.h"
143144#include "sound/okim6295.h"
src/mame/drivers/supbtime.c
r1649r1650
2121***************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "cpu/h6280/h6280.h"
2526#include "sound/2151intf.h"
2627#include "sound/okim6295.h"
src/mame/drivers/blmbycar.c
r1649r1650
2424***************************************************************************/
2525
2626#include "driver.h"
27#include "deprecat.h"
2728#include "sound/okim6295.h"
2829
2930/* Variables defined in video: */
src/mame/drivers/toratora.c
r1649r1650
1818***************************************************************************/
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/6821pia.h"
2223#include "sound/sn76477.h"
2324
src/mame/drivers/retofinv.c
r1649r1650
2929***************************************************************************/
3030
3131#include "driver.h"
32#include "deprecat.h"
3233#include "cpu/m6805/m6805.h"
3334#include "sound/sn76496.h"
3435
src/mame/drivers/gbusters.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1213#include "video/konamiic.h"
1314#include "sound/2151intf.h"
src/mame/drivers/megaplay.c
r1649r1650
4040*/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "genesis.h"
4445#include "megadriv.h"
4546
src/mame/drivers/meadows.c
r1649r1650
132132 *
133133 *************************************/
134134
135static UINT32 cycles_at_vsync;
135static UINT64 cycles_at_vsync;
136136static UINT8 main_sense_state;
137137static UINT8 sound_sense_state;
138138static UINT8 coin1_state;
src/mame/drivers/srmp2.c
r1649r1650
5656
5757
5858#include "driver.h"
59#include "deprecat.h"
5960#include "sound/ay8910.h"
6061#include "sound/msm5205.h"
6162
src/mame/drivers/m72.c
r1649r1650
35573557GAME( 1988, imgfight, 0,        m72,      imgfight, imgfight, ROT270, "Irem", "Image Fight (Japan)", 0 )
35583558GAME( 1989, loht,     0,        m72,      loht,     loht,     ROT0,   "Irem", "Legend of Hero Tonma", GAME_NO_COCKTAIL )
35593559GAME( 1989, lohtj,    loht,     m72,      loht,     loht,     ROT0,   "Irem", "Legend of Hero Tonma (Japan)", GAME_NO_COCKTAIL )
3560GAME( 1989, lohtb,    loht,     m72,      loht,     0,        ROT0,   "Irem", "Legend of Hero Tonma (bootleg)", GAME_NOT_WORKING| GAME_NO_COCKTAIL )
3560GAME( 1989, lohtb,    loht,     m72,      loht,     0,        ROT0,   "Irem", "Legend of Hero Tonma (bootleg, set 1)", GAME_NOT_WORKING| GAME_NO_COCKTAIL )
35613561GAME( 1989, lohtb2,   loht,     m72_8751, loht,     loht_mcu, ROT0,   "Irem", "Legend of Hero Tonma (bootleg, set 2)", GAME_NO_COCKTAIL )
35623562GAME( 1989, xmultipl, 0,        xmultipl, xmultipl, xmultipl, ROT0,   "Irem", "X Multiply (Japan)", GAME_NO_COCKTAIL )
35633563GAME( 1989, dbreed,   0,        dbreed,   dbreed,   0,        ROT0,   "Irem", "Dragon Breed (M81 pcb version)", GAME_NO_COCKTAIL )
src/mame/drivers/r2dtank.c
r1649r1650
3131********************************************************************/
3232
3333#include "driver.h"
34#include "deprecat.h"
3435#include "rescap.h"
3536#include "machine/6821pia.h"
3637#include "machine/74123.h"
src/mame/drivers/pokechmp.c
r1649r1650
4545*/
4646
4747#include "driver.h"
48#include "deprecat.h"
4849#include "cpu/m6502/m6502.h"
4950#include "sound/2203intf.h"
5051#include "sound/3812intf.h"
51//#include "sound/msm5205.h"
5252#include "sound/okim6295.h"
5353
5454extern WRITE8_HANDLER( pokechmp_videoram_w );
src/mame/drivers/snk68.c
r1649r1650
3434***************************************************************************/
3535
3636#include "driver.h"
37#include "deprecat.h"
3738#include "cpu/z80/z80.h"
3839#include "sound/3812intf.h"
3940#include "sound/upd7759.h"
src/mame/drivers/madalien.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "video/crtc6845.h"
1112#include "sound/ay8910.h"
1213
r1649r1650
320321      }
321322   }
322323
323   copybitmap(bitmap, tmp_bitmap, flip_screen, flip_screen,
324      0, 0, cliprect, TRANSPARENCY_NONE, 0);
324   copybitmap(bitmap, tmp_bitmap, flip_screen, flip_screen, 0, 0, cliprect);
325325
326326   return 0;
327327}
src/mame/drivers/igs_180.c
r1649r1650
22/* also see iqblock.c and tarzan.c */
33
44#include "driver.h"
5#include "deprecat.h"
56#include "cpu/z180/z180.h"
67#include "sound/2413intf.h"
78#include "sound/okim6295.h"
src/mame/drivers/firetrap.c
r1649r1650
5757***************************************************************************/
5858
5959#include "driver.h"
60#include "deprecat.h"
6061#include "cpu/m6502/m6502.h"
6162#include "sound/3812intf.h"
6263#include "sound/msm5205.h"
src/mame/drivers/crgolf.c
r1649r1650
2727***************************************************************************/
2828
2929#include "driver.h"
30#include "deprecat.h"
3031#include "crgolf.h"
3132#include "sound/ay8910.h"
3233#include "sound/msm5205.h"
r1649r1650
238239   AM_RANGE(0x8007, 0x8007) AM_WRITE(MWA8_RAM) AM_BASE(&crgolf_screena_enable)
239240   AM_RANGE(0x8800, 0x8800) AM_READWRITE(sound_to_main_r, main_to_sound_w)
240241   AM_RANGE(0x9000, 0x9000) AM_WRITE(rom_bank_select_w)
241   AM_RANGE(0xa000, 0xbfff) AM_READWRITE(crgolf_videoram_bit1_r, crgolf_videoram_bit1_w)
242   AM_RANGE(0xc000, 0xdfff) AM_READWRITE(crgolf_videoram_bit0_r, crgolf_videoram_bit0_w)
243   AM_RANGE(0xe000, 0xffff) AM_READWRITE(crgolf_videoram_bit2_r, crgolf_videoram_bit2_w)
242   AM_RANGE(0xa000, 0xffff) AM_READWRITE(crgolf_videoram_r, crgolf_videoram_w)
244243ADDRESS_MAP_END
245244
246245
r1649r1650
371370   MDRV_CPU_PROGRAM_MAP(sound_map,0)
372371   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
373372
374   MDRV_SCREEN_REFRESH_RATE(60)
375   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
376
377373   MDRV_MACHINE_START(crgolf)
378374   MDRV_INTERLEAVE(100)
379375
380376   /* video hardware */
381   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
382   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
383   MDRV_SCREEN_SIZE(256, 256)
384   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 247)
385   MDRV_PALETTE_LENGTH(32)
377   MDRV_IMPORT_FROM(crgolf_video)
386378
387   MDRV_PALETTE_INIT(crgolf)
388   MDRV_VIDEO_START(crgolf)
389   MDRV_VIDEO_UPDATE(crgolf)
390
391379   /* sound hardware */
392380   MDRV_SPEAKER_STANDARD_MONO("mono")
393381   MDRV_SOUND_ADD(AY8910, MASTER_CLOCK/3/2/2)
src/mame/drivers/mastboy.c
r1649r1650
434434*/
435435
436436#include "driver.h"
437#include "deprecat.h"
437438#include "sound/saa1099.h"
438439#include "sound/msm5205.h"
439440
src/mame/drivers/thedeep.c
r1649r1650
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829#include "thedeep.h"
2930#include "sound/2203intf.h"
3031
src/mame/drivers/oneshot.c
r1649r1650
3030*/
3131
3232#include "driver.h"
33#include "deprecat.h"
3334#include "sound/okim6295.h"
3435#include "sound/3812intf.h"
3536
src/mame/drivers/topspeed.c
r1649r1650
230230***************************************************************************/
231231
232232#include "driver.h"
233#include "deprecat.h"
233234#include "taitoipt.h"
234235#include "cpu/m68000/m68000.h"
235236#include "video/taitoic.h"
src/mame/drivers/zr107.c
r1649r1650
4040*/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "cpu/powerpc/ppc.h"
4445#include "cpu/sharc/sharc.h"
4546#include "sound/k054539.h"
src/mame/drivers/amspdwy.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "sound/2151intf.h"
1819
1920/* Variables & functions defined in video: */
src/mame/drivers/segae.c
r1649r1650
296296*/
297297
298298#include "driver.h"
299#include "deprecat.h"
299300#include "sound/sn76496.h"
300301#include "machine/mc8123.h"
301302#include "machine/segacrpt.h"
src/mame/drivers/fantland.c
r1649r1650
1/***************************************************************************
1/***************************************************************************************
22
33                      -= Electronic Devices / International Games =-
44
r1649r1650
1212----------------------------------------------------------------------------------------
1313Year + Game             Main CPU    Sound CPU    Sound            Video
1414----------------------------------------------------------------------------------------
15>=1987  Born To Fight   8086?       8086?        YM2151 + DAC     ?
16>=1987  Fantasy Land    V20         8088         4 x MSM5205      2 x I.G.1BB 48844758V
15>=1987  Born To Fight   V20         8088         4 x MSM5205      2 x I.G.1BB 48844758V
16>=1987  Fantasy Land    8086?       8086?        YM2151 + DAC     ?
171988?   Wheels Runner   V20         Z80          YM3526 + ?       2 x PLCC84 FPGA
17181989    Galaxy Gunners  8086?       8086?        YM2151           ?
1819----------------------------------------------------------------------------------------
1920
r1649r1650
3536- Verify sound. Also speech is a bit garbled / low volume (rom 15)
3637- Trackball controls don't work well
3738
38***************************************************************************/
39[wheelrun]
3940
41- On a car hit / crash the game tries to produce sound through ports b000 & c000,
42  probably connected to the EP1210. This is not emulated.
43
44***************************************************************************************/
45
4046#include "driver.h"
47#include "deprecat.h"
4148#include "sound/2151intf.h"
49#include "sound/3812intf.h"
4250#include "sound/dac.h"
4351#include "sound/msm5205.h"
4452
r1649r1650
108116      spriteram_2[2*offset+1] = data >> 8;
109117}
110118
111static ADDRESS_MAP_START( fantland_readmem, ADDRESS_SPACE_PROGRAM, 16 )
112   AM_RANGE(0xa4000, 0xa67ff) AM_READ(spriteram_16_r         )   // not actually read
113   AM_RANGE(0xc0000, 0xcffff) AM_READ(spriteram2_16_r         )   // ""
114   AM_RANGE(0xe0000, 0xfffff) AM_READ(MRA16_ROM         )
115ADDRESS_MAP_END
119static ADDRESS_MAP_START( fantland_map, ADDRESS_SPACE_PROGRAM, 16 )
120   AM_RANGE( 0x00000, 0x07fff ) AM_RAM
121   AM_RANGE( 0x08000, 0x7ffff ) AM_ROM
116122
117static ADDRESS_MAP_START( fantland_writemem, ADDRESS_SPACE_PROGRAM, 16 )
118   AM_RANGE(0x00000, 0x07fff) AM_RAM
119   AM_RANGE(0x00000, 0x7ffff) AM_ROM
120   AM_RANGE(0xa2000, 0xa21ff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16 )
121   AM_RANGE(0xa3000, 0xa3001) AM_READ(input_port_0_word_r   )
122   AM_RANGE(0xa3002, 0xa3003) AM_READ(input_port_1_word_r   )
123   AM_RANGE(0xa3000, 0xa3001) AM_WRITE(fantland_nmi_enable_16_w)
124   AM_RANGE(0xa3002, 0xa3003) AM_WRITE(fantland_soundlatch_16_w)
125   AM_RANGE(0xa4000, 0xa67ff) AM_WRITE(spriteram_16_w) AM_BASE((UINT16 **)&spriteram)
126   AM_RANGE(0xc0000, 0xcffff) AM_WRITE(spriteram2_16_w) AM_BASE((UINT16 **)&spriteram_2)
123   AM_RANGE( 0xa2000, 0xa21ff ) AM_READWRITE( MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w ) AM_BASE( &paletteram16 )
124
125   AM_RANGE( 0xa3000, 0xa3001 ) AM_READWRITE( input_port_0_word_r, fantland_nmi_enable_16_w )
126   AM_RANGE( 0xa3002, 0xa3003 ) AM_READWRITE( input_port_1_word_r, fantland_soundlatch_16_w )
127
128   AM_RANGE( 0xa4000, 0xa67ff ) AM_READWRITE( spriteram_16_r,  spriteram_16_w  ) AM_BASE( (UINT16 **)&spriteram   )
129   AM_RANGE( 0xc0000, 0xcffff ) AM_READWRITE( spriteram2_16_r, spriteram2_16_w ) AM_BASE( (UINT16 **)&spriteram_2 )
130
131   AM_RANGE( 0xe0000, 0xfffff ) AM_ROM
127132ADDRESS_MAP_END
128133
129134
r1649r1650
131136                                Galaxy Gunners
132137***************************************************************************/
133138
134static ADDRESS_MAP_START( galaxygn_readmem, ADDRESS_SPACE_PROGRAM, 8 )
135   AM_RANGE(0x00000, 0x07fff) AM_READ(MRA8_RAM         )
136   AM_RANGE(0x10000, 0x2ffff) AM_READ(MRA8_ROM         )
137   AM_RANGE(0x52000, 0x521ff) AM_READ(MRA8_RAM         )   // not actually read
138   AM_RANGE(0x53000, 0x53000) AM_READ(input_port_0_r   )
139   AM_RANGE(0x53001, 0x53001) AM_READ(input_port_1_r   )
140   AM_RANGE(0x53002, 0x53002) AM_READ(input_port_2_r   )
141   AM_RANGE(0x53003, 0x53003) AM_READ(input_port_3_r   )
142   AM_RANGE(0x54000, 0x567ff) AM_READ(MRA8_RAM         )   // not actually read
143   AM_RANGE(0x60000, 0x6ffff) AM_READ(MRA8_RAM         )   // ""
144   AM_RANGE(0x70000, 0x7ffff) AM_READ(MRA8_ROM         )
145   AM_RANGE(0xf0000, 0xfffff) AM_READ(MRA8_ROM         )
146ADDRESS_MAP_END
139static ADDRESS_MAP_START( galaxygn_map, ADDRESS_SPACE_PROGRAM, 8 )
140   AM_RANGE( 0x00000, 0x07fff ) AM_RAM
141   AM_RANGE( 0x10000, 0x2ffff ) AM_ROM
147142
148static ADDRESS_MAP_START( galaxygn_writemem, ADDRESS_SPACE_PROGRAM, 8 )
149   AM_RANGE(0x00000, 0x07fff) AM_WRITE(MWA8_RAM               )
150   AM_RANGE(0x52000, 0x521ff) AM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_BASE(&paletteram   )
151   AM_RANGE(0x53000, 0x53000) AM_WRITE(fantland_nmi_enable_w   )
152   AM_RANGE(0x53002, 0x53002) AM_WRITE(fantland_soundlatch_w   )
153   AM_RANGE(0x54000, 0x567ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram   )
154   AM_RANGE(0x60000, 0x6ffff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2   )
143   AM_RANGE( 0x52000, 0x521ff ) AM_READWRITE( MRA8_RAM, paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_BASE( &paletteram )
144
145   AM_RANGE( 0x53000, 0x53000 ) AM_READWRITE( input_port_0_r, fantland_nmi_enable_w )
146   AM_RANGE( 0x53001, 0x53001 ) AM_READ( input_port_1_r )
147   AM_RANGE( 0x53002, 0x53002 ) AM_READWRITE( input_port_2_r, fantland_soundlatch_w )
148   AM_RANGE( 0x53003, 0x53003 ) AM_READ( input_port_3_r)
149
150   AM_RANGE( 0x54000, 0x567ff ) AM_RAM AM_BASE( &spriteram )
151   AM_RANGE( 0x60000, 0x6ffff ) AM_RAM AM_BASE( &spriteram_2 )
152
153   AM_RANGE( 0x70000, 0x7ffff ) AM_ROM
154   AM_RANGE( 0xf0000, 0xfffff ) AM_ROM
155155ADDRESS_MAP_END
156156
157157
r1649r1650
215215   return ret[offset];
216216}
217217
218static ADDRESS_MAP_START( borntofi_readmem, ADDRESS_SPACE_PROGRAM, 8 )
219   AM_RANGE(0x00000, 0x07fff) AM_READ( MRA8_RAM         )
220   AM_RANGE(0x10000, 0x2ffff) AM_READ( MRA8_ROM         )
221//  AM_RANGE(0x52000, 0x521ff) AM_READ( MRA8_RAM            )   // not actually read
222   AM_RANGE(0x53000, 0x53001) AM_READ( borntofi_inputs_r   )
223   AM_RANGE(0x53002, 0x53002) AM_READ( input_port_6_r      )
224   AM_RANGE(0x53003, 0x53003) AM_READ( input_port_7_r      )
225//  AM_RANGE(0x54000, 0x567ff) AM_READ( MRA8_RAM            )   // not actually read
226   AM_RANGE(0x57000, 0x57000) AM_READ( input_port_8_r      )
227   AM_RANGE(0x57001, 0x57001) AM_READ( input_port_9_r      )
228   AM_RANGE(0x57002, 0x57002) AM_READ( input_port_10_r      )
229   AM_RANGE(0x57003, 0x57003) AM_READ( input_port_11_r      )
230//  AM_RANGE(0x60000, 0x6ffff) AM_READ( MRA8_RAM            )   // not actually read
231   AM_RANGE(0x70000, 0x7ffff) AM_READ( MRA8_ROM         )
232   AM_RANGE(0xf0000, 0xfffff) AM_READ( MRA8_ROM         )
218static ADDRESS_MAP_START( borntofi_map, ADDRESS_SPACE_PROGRAM, 8 )
219   AM_RANGE( 0x00000, 0x07fff ) AM_RAM
220   AM_RANGE( 0x10000, 0x2ffff ) AM_ROM
221
222   AM_RANGE( 0x52000, 0x521ff ) AM_READWRITE( MRA8_RAM, paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_BASE( &paletteram )
223   AM_RANGE( 0x53000, 0x53001 ) AM_READWRITE( borntofi_inputs_r, borntofi_nmi_enable_w )
224   AM_RANGE( 0x53002, 0x53002 ) AM_READWRITE( input_port_6_r,    fantland_soundlatch_w )
225   AM_RANGE( 0x53003, 0x53003 ) AM_READ( input_port_7_r )
226
227   AM_RANGE( 0x54000, 0x567ff ) AM_RAM AM_BASE( &spriteram )
228
229   AM_RANGE( 0x57000, 0x57000 ) AM_READ( input_port_8_r  )
230   AM_RANGE( 0x57001, 0x57001 ) AM_READ( input_port_9_r  )
231   AM_RANGE( 0x57002, 0x57002 ) AM_READ( input_port_10_r )
232   AM_RANGE( 0x57003, 0x57003 ) AM_READ( input_port_11_r )
233
234   AM_RANGE( 0x60000, 0x6ffff ) AM_RAM AM_BASE( &spriteram_2 )
235
236   AM_RANGE( 0x70000, 0x7ffff ) AM_ROM
237   AM_RANGE( 0xf0000, 0xfffff ) AM_ROM
233238ADDRESS_MAP_END
234239
235static ADDRESS_MAP_START( borntofi_writemem, ADDRESS_SPACE_PROGRAM, 8 )
236   AM_RANGE(0x00000, 0x07fff) AM_WRITE( MWA8_RAM                  )
237   AM_RANGE(0x52000, 0x521ff) AM_WRITE( paletteram_xRRRRRGGGGGBBBBB_le_w   ) AM_BASE(&paletteram   )
238   AM_RANGE(0x53000, 0x53000) AM_WRITE( borntofi_nmi_enable_w         )
239   AM_RANGE(0x53002, 0x53002) AM_WRITE( fantland_soundlatch_w         )
240   AM_RANGE(0x54000, 0x567ff) AM_WRITE( MWA8_RAM                  ) AM_BASE(&spriteram   )
241   AM_RANGE(0x60000, 0x6ffff) AM_WRITE( MWA8_RAM                  ) AM_BASE(&spriteram_2   )
240
241/***************************************************************************
242                           Wheels Runner
243***************************************************************************/
244
245static ADDRESS_MAP_START( wheelrun_map, ADDRESS_SPACE_PROGRAM, 8 )
246   AM_RANGE(0x00000, 0x07fff) AM_RAM
247
248   AM_RANGE(0x30000, 0x3ffff) AM_ROM
249   AM_RANGE(0x70000, 0x7ffff) AM_ROM
250
251   AM_RANGE(0x52000, 0x521ff) AM_READWRITE(MRA8_RAM, paletteram_xRRRRRGGGGGBBBBB_le_w   ) AM_BASE(&paletteram   )
252
253   AM_RANGE(0x53000, 0x53000) AM_READWRITE( input_port_0_r, borntofi_nmi_enable_w )
254   AM_RANGE(0x53001, 0x53001) AM_READ( input_port_1_r )
255   AM_RANGE(0x53002, 0x53002) AM_READWRITE( input_port_2_r, fantland_soundlatch_w )
256   AM_RANGE(0x53003, 0x53003) AM_READWRITE( input_port_3_r, MWA8_NOP)
257
258   AM_RANGE(0x54000, 0x567ff) AM_RAM AM_BASE(&spriteram   )
259   AM_RANGE(0x60000, 0x6ffff) AM_RAM AM_BASE(&spriteram_2   )
260
261   AM_RANGE(0xf0000, 0xfffff) AM_ROM
242262ADDRESS_MAP_END
243263
244264
265
245266/***************************************************************************
246267
247268                            Memory Maps - Sound CPU
248269
249270***************************************************************************/
250271
251static ADDRESS_MAP_START( fantland_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
252   AM_RANGE(0x00000, 0x01fff) AM_READ(MRA8_RAM)
253   AM_RANGE(0x80000, 0x9ffff) AM_READ(MRA8_ROM   )
254   AM_RANGE(0xc0000, 0xfffff) AM_READ(MRA8_ROM   )
272static ADDRESS_MAP_START( fantland_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
273   AM_RANGE( 0x00000, 0x01fff ) AM_RAM
274   AM_RANGE( 0x80000, 0x9ffff ) AM_ROM
275   AM_RANGE( 0xc0000, 0xfffff ) AM_ROM
255276ADDRESS_MAP_END
256277
257static ADDRESS_MAP_START( fantland_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
258   AM_RANGE(0x00000, 0x01fff) AM_WRITE(MWA8_RAM   )
259   AM_RANGE(0x80000, 0x9ffff) AM_WRITE(MWA8_ROM   )
260   AM_RANGE(0xc0000, 0xfffff) AM_WRITE(MWA8_ROM   )
278static ADDRESS_MAP_START( fantland_sound_iomap, ADDRESS_SPACE_IO, 8 )
279   AM_RANGE( 0x0080, 0x0080 ) AM_READ( soundlatch_r )
280   AM_RANGE( 0x0100, 0x0100 ) AM_WRITE( YM2151_register_port_0_w )
281   AM_RANGE( 0x0101, 0x0101 ) AM_READWRITE( YM2151_status_port_0_r, YM2151_data_port_0_w )
282   AM_RANGE( 0x0180, 0x0180 ) AM_WRITE( DAC_0_data_w )
261283ADDRESS_MAP_END
262284
263static ADDRESS_MAP_START( fantland_sound_readport, ADDRESS_SPACE_IO, 8 )
264   AM_RANGE(0x0080, 0x0080) AM_READ(soundlatch_r            )
265   AM_RANGE(0x0101, 0x0101) AM_READ(YM2151_status_port_0_r   )
266ADDRESS_MAP_END
267285
268static ADDRESS_MAP_START( fantland_sound_writeport, ADDRESS_SPACE_IO, 8 )
269   AM_RANGE(0x0100, 0x0100) AM_WRITE(YM2151_register_port_0_w   )
270   AM_RANGE(0x0101, 0x0101) AM_WRITE(YM2151_data_port_0_w      )
271   AM_RANGE(0x0180, 0x0180) AM_WRITE(DAC_0_data_w            )
272ADDRESS_MAP_END
273
274
275286/***************************************************************************
276287                           Born To Fight
277288***************************************************************************/
r1649r1650
357368   }
358369}
359370
360static ADDRESS_MAP_START( borntofi_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
361   AM_RANGE(0x00000, 0x003ff) AM_READ( MRA8_RAM      )
362   AM_RANGE(0x04000, 0x04000) AM_READ( soundlatch_r   )
363   AM_RANGE(0x08000, 0x0ffff) AM_READ( MRA8_ROM      )
364   AM_RANGE(0xf8000, 0xfffff) AM_READ( MRA8_ROM      )
371static ADDRESS_MAP_START( borntofi_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
372   AM_RANGE( 0x00000, 0x003ff ) AM_RAM
373   AM_RANGE( 0x04000, 0x04000 ) AM_READ( soundlatch_r   )
374   AM_RANGE( 0x04000, 0x0401f ) AM_WRITE( borntofi_msm5205_w )
375   AM_RANGE( 0x08000, 0x0ffff ) AM_ROM
376   AM_RANGE( 0xf8000, 0xfffff ) AM_ROM
365377ADDRESS_MAP_END
366378
367static ADDRESS_MAP_START( borntofi_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
368   AM_RANGE(0x00000, 0x003ff) AM_WRITE( MWA8_RAM         )
369   AM_RANGE(0x04000, 0x0401f) AM_WRITE( borntofi_msm5205_w   )
379
380/***************************************************************************
381                           Wheels Runner
382***************************************************************************/
383
384static ADDRESS_MAP_START( wheelrun_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
385   AM_RANGE(0x0000, 0x7fff) AM_ROM
386   AM_RANGE(0x8000, 0x87ff) AM_RAM
387   AM_RANGE(0xa000, 0xa000) AM_READWRITE( YM3526_status_port_0_r, YM3526_control_port_0_w )
388   AM_RANGE(0xa001, 0xa001) AM_WRITE( YM3526_write_port_0_w )
389
390   AM_RANGE(0xb000, 0xb000) AM_WRITE( MWA8_NOP )   // on a car crash / hit
391   AM_RANGE(0xc000, 0xc000) AM_WRITE( MWA8_NOP )   // ""
392
393   AM_RANGE(0xd000, 0xd000) AM_READ( soundlatch_r )   // during NMI
370394ADDRESS_MAP_END
371395
372396
r1649r1650
385409   PORT_START   /* IN0 - a3000 */
386410   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1         )
387411   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START1         )
388   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      )
412   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   )
389413   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN   )
390414   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT   )
391415   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   )
392   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1         )
393   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON2         )
416   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1      )
417   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON2      )
394418
395419   /* IN1 - a3001 */
396420   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN2         )
397421   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2         )
398   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(2)   // used in test mode only
422   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   ) PORT_PLAYER(2)   // used in test mode only
399423   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN   ) PORT_PLAYER(2)
400424   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT   ) PORT_PLAYER(2)
401425   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(2)
402   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(2)
403   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(2)
426   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1      ) PORT_PLAYER(2)
427   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON2      ) PORT_PLAYER(2)
404428
405429   PORT_START   /* IN2 - a3002 */
406430   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
r1649r1650
666690
667691
668692/***************************************************************************
693                           Wheels Runner
694***************************************************************************/
669695
696static CUSTOM_INPUT( wheelrun_wheel_r )
697{
698   int player = (FPTR)param;
699   int delta = readinputport(4 + player);
700   delta = (delta & 0x7f) - (delta & 0x80) + 4;
701
702   if      (delta > 7)   delta = 7;
703   else if   (delta < 1)   delta = 1;
704
705//  if (player == 0)    popmessage("%x",delta);
706   return delta;
707}
708
709static INPUT_PORTS_START( wheelrun )
710   PORT_START   /* IN0 - 53000 */
711   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1   )
712   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1)
713   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
714   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
715   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(wheelrun_wheel_r, 0)
716   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
717
718   PORT_START   /* IN1 - 53001 */
719   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN2   )
720   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(2)
721   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
722   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
723   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(wheelrun_wheel_r, 1)
724   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
725
726   PORT_START   /* IN2 - 53002 */
727   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
728   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
729   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
730   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
731   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
732   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
733   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
734   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
735   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
736   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
737   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
738   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
739   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
740   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
741   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
742   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
743   PORT_DIPSETTING(    0x60, DEF_STR( Normal ) )
744   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
745   PORT_DIPSETTING(    0x20, DEF_STR( Harder ) )
746   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
747   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
748
749   PORT_START   /* IN3 - 53003 */
750   PORT_DIPNAME( 0xff, 0xdf, "Wheel Sensitivity" )
751   PORT_DIPSETTING(    0x7f, "0" )
752   PORT_DIPSETTING(    0xbf, "1" )
753   PORT_DIPSETTING(    0xdf, "2" )
754   PORT_DIPSETTING(    0xef, "3" )
755   PORT_DIPSETTING(    0xf7, "4" )
756   PORT_DIPSETTING(    0xfb, "5" )
757   PORT_DIPSETTING(    0xfd, "6" )
758   PORT_DIPSETTING(    0xfe, "7" )
759
760   PORT_START   /* IN4 */
761   PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_RESET PORT_REVERSE PORT_PLAYER(1)
762   PORT_START   /* IN5 */
763   PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_RESET PORT_REVERSE PORT_PLAYER(2)
764INPUT_PORTS_END
765
766
767/***************************************************************************
768
670769                            Graphics Layouts
671770
672771***************************************************************************/
r1649r1650
711810static MACHINE_DRIVER_START( fantland )
712811   /* basic machine hardware */
713812   MDRV_CPU_ADD(I8086, 8000000)        // ?
714   MDRV_CPU_PROGRAM_MAP(fantland_readmem, fantland_writemem)
813   MDRV_CPU_PROGRAM_MAP(fantland_map, 0)
715814   MDRV_CPU_VBLANK_INT(fantland_irq,1)
716815
717816   /* audio CPU */
718817   MDRV_CPU_ADD(I8088, 8000000)        // ?
719   MDRV_CPU_PROGRAM_MAP(fantland_sound_readmem, fantland_sound_writemem)
720   MDRV_CPU_IO_MAP(fantland_sound_readport,fantland_sound_writeport)
818   MDRV_CPU_PROGRAM_MAP(fantland_sound_map, 0)
819   MDRV_CPU_IO_MAP(fantland_sound_iomap, 0)
721820   MDRV_CPU_PERIODIC_INT(fantland_sound_irq, 8000)
722821   // NMI when soundlatch is written
723822
r1649r1650
763862static MACHINE_DRIVER_START( galaxygn )
764863   /* basic machine hardware */
765864   MDRV_CPU_ADD(I8088, 8000000)        // ?
766   MDRV_CPU_PROGRAM_MAP(galaxygn_readmem, galaxygn_writemem)
865   MDRV_CPU_PROGRAM_MAP(galaxygn_map, 0)
767866   MDRV_CPU_VBLANK_INT(fantland_irq,1)
768867
769868   /* audio CPU */
770869   MDRV_CPU_ADD(I8088, 8000000)        // ?
771   MDRV_CPU_PROGRAM_MAP(fantland_sound_readmem, fantland_sound_writemem)
772   MDRV_CPU_IO_MAP(fantland_sound_readport,fantland_sound_writeport)
870   MDRV_CPU_PROGRAM_MAP(fantland_sound_map, 0)
871   MDRV_CPU_IO_MAP(fantland_sound_iomap, 0)
773872   // IRQ by YM2151, NMI when soundlatch is written
774873
775874   MDRV_SCREEN_REFRESH_RATE(60)
r1649r1650
817916static MACHINE_DRIVER_START( borntofi )
818917   /* basic machine hardware */
819918   MDRV_CPU_ADD(V20, 16000000/2)        // D701080C-8 - NEC D70108C-8 V20 CPU, running at 8.000MHz [16/2]
820   MDRV_CPU_PROGRAM_MAP(borntofi_readmem, borntofi_writemem)
919   MDRV_CPU_PROGRAM_MAP(borntofi_map, 0)
821920   MDRV_CPU_VBLANK_INT(fantland_irq,1)
822921
823922   /* audio CPU */
824923   MDRV_CPU_ADD(I8088, 18432000/3)        // 8088 - AMD P8088-2 CPU, running at 6.144MHz [18.432/3]
825   MDRV_CPU_PROGRAM_MAP(borntofi_sound_readmem, borntofi_sound_writemem)
924   MDRV_CPU_PROGRAM_MAP(borntofi_sound_map, 0)
826925
827926   MDRV_SCREEN_REFRESH_RATE(54)   // 54 Hz
828927   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
r1649r1650
848947   MDRV_SOUND_ADD(MSM5205, 384000) MDRV_SOUND_CONFIG(msm5205_interface) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
849948MACHINE_DRIVER_END
850949
950
951
952static void wheelrun_ym3526_irqhandler(int state)
953{
954   cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, state);
955}
956
957static const struct YM3526interface wheelrun_ym3526_interface =
958{
959   wheelrun_ym3526_irqhandler
960};
961
962static MACHINE_DRIVER_START( wheelrun )
963   /* basic machine hardware */
964   MDRV_CPU_ADD(V20, XTAL_18MHz/2)      // D701080C-8 (V20)
965   MDRV_CPU_PROGRAM_MAP(wheelrun_map, 0)
966   MDRV_CPU_VBLANK_INT(fantland_irq,1)
967
968   /* audio CPU */
969   MDRV_CPU_ADD(Z80, XTAL_18MHz/2)      // Z8400BB1 (Z80B)
970   MDRV_CPU_PROGRAM_MAP(wheelrun_sound_map, 0)
971   // IRQ by YM3526, NMI when soundlatch is written
972
973   MDRV_SCREEN_REFRESH_RATE(60)
974   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
975
976   MDRV_MACHINE_RESET(fantland)
977
978   /* video hardware */
979   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
980   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
981   MDRV_SCREEN_SIZE(256,224)
982   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 224-1)
983   MDRV_GFXDECODE(fantland)
984   MDRV_PALETTE_LENGTH(256)
985
986   MDRV_VIDEO_UPDATE(fantland)
987
988   /* sound hardware */
989   MDRV_SPEAKER_STANDARD_MONO("mono")
990
991   MDRV_SOUND_ADD(YM3526, XTAL_14MHz/4)
992   MDRV_SOUND_CONFIG(wheelrun_ym3526_interface)
993   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
994MACHINE_DRIVER_END
995
996
851997/***************************************************************************
852998
853999                                ROMs Loading
r1649r1650
11171263   ROMX_LOAD( "63.bin",  0x1b0000, 0x10000, CRC(5f530559) SHA1(d1d3edc2082985ccec9fe8ca0b27810623cb5b89), ROM_SKIP(2) )
11181264ROM_END
11191265
1120GAME( 19??, borntofi, 0,        borntofi, borntofi, 0, ROT0,  "International Games",      "Born To Fight"       , 0 )
1121GAME( 19??, fantland, 0,        fantland, fantland, 0, ROT0,  "Electronic Devices Italy", "Fantasy Land (set 1)", 0 )
1122GAME( 19??, fantlnda, fantland, fantland, fantland, 0, ROT0,  "Electronic Devices Italy", "Fantasy Land (set 2)", 0 )
1123GAME( 1989, galaxygn, 0,        galaxygn, galaxygn, 0, ROT90, "Electronic Devices Italy", "Galaxy Gunners"      , 0 )
1266/***************************************************************************
1267
1268Wheels Runner by International Games
1269
1270PCB:
1271(revision 8801)
1272
12731x NEC D70108C-8 (NEC V20)
12741x SGS Z8400BB1 (Z80B)
12751x YM3526 (sound)
12761x Y3014B (DAC)
12771x LM324A (sound)
12781x TDA2002 (sound)
12791x oscillator 18.000
12801x oscillator 14.000
12811x ALTERA EP1210PC
12822x INGA (black quad chips with 84 legs, maybe FPGA)
1283
1284ROMs:
1285
128615x M27512
12873x PAL16R6CN (read protected)
12882x PAL20L8aCNS (read protected)
12895x TIBPAL16l8-25CN (read protected)
12904x TIBPAL16r4-25CN (read protected)
12911x TIBPAL16r8-25CN (read protected)
1292eprom location 2,5,6 are empty
1293
1294Notes:
1295
12961x JAMMA edge connector
12971x trimmer (volume)
12982x 8 bit dip switch
1299
1300Hardware info by f205v
1301
1302***************************************************************************/
1303
1304ROM_START( wheelrun )
1305   ROM_REGION( 0x100000, REGION_CPU1, 0 ) // V20
1306   ROM_LOAD( "4.4", 0x30000, 0x10000, CRC(359303df) SHA1(583b70f65b775e99856ffda61334be3b85046ed1) )
1307   ROM_LOAD( "3.3", 0x70000, 0x10000, CRC(c28d0b31) SHA1(add8c4ffe529755c101b72a3b0530e796948876b) )
1308   ROM_COPY( REGION_CPU1, 0x70000, 0xf0000, 0x10000 )
1309
1310   ROM_REGION( 0x100000, REGION_CPU2, 0 ) // Z80
1311   ROM_LOAD( "1.1", 0x00000, 0x10000, CRC(67b5f31f) SHA1(5553b132077686221fb7a21a0246fd55cb443332) )   // 1xxxxxxxxxxxxxxx = 0xFF
1312
1313   ROM_REGION( 0xc0000, REGION_GFX1,0 ) // gfx
1314   ROMX_LOAD( "7.7",   0x00000, 0x10000, CRC(e0e5ff64) SHA1(e2ed5ea5b75ed627a9d305864196160267cad438), ROM_SKIP(2) )
1315   ROMX_LOAD( "11.11", 0x00001, 0x10000, CRC(ce9718fb) SHA1(ade47deedd5d0c927fdf8626aa1b0fac470f03a0), ROM_SKIP(2) )
1316   ROMX_LOAD( "15.15", 0x00002, 0x10000, CRC(f6665f31) SHA1(e308a049697622bcda9d3c630e061d30c2b70687), ROM_SKIP(2) )
1317
1318   ROMX_LOAD( "8.8",   0x30000, 0x10000, CRC(fa1ec091) SHA1(bd436788651fc2f679897ccd0f7ec51014eb9e90), ROM_SKIP(2) )
1319   ROMX_LOAD( "12.12", 0x30001, 0x10000, CRC(8923dce4) SHA1(a8f8aeb6f214454c6125a36043aebdf7cc79c253), ROM_SKIP(2) )
1320   ROMX_LOAD( "16.16", 0x30002, 0x10000, CRC(49801733) SHA1(4d8f79afbb5bf33787ad437d04b95a17e4008894), ROM_SKIP(2) )
1321
1322   ROMX_LOAD( "9.9",   0x60000, 0x10000, CRC(9fea30d0) SHA1(308caa360f556e085ce05f35e26856d6944b03af), ROM_SKIP(2) )
1323   ROMX_LOAD( "13.13", 0x60001, 0x10000, CRC(8b0aae8d) SHA1(413821fdbf599004b57f3588360ccf881547e104), ROM_SKIP(2) )
1324   ROMX_LOAD( "17.17", 0x60002, 0x10000, CRC(be8ab48d) SHA1(1520d70eb9c65f84deddc2d7c8de7ae2cbb1ec09), ROM_SKIP(2) )
1325
1326   ROMX_LOAD( "10.10", 0x90000, 0x10000, CRC(c5bdd367) SHA1(c432762d23b8799643fd5f1775a44d31582e7290), ROM_SKIP(2) )   // 1111xxxxxxxxxxxx = 0x00
1327   ROMX_LOAD( "14.14", 0x90001, 0x10000, CRC(e592302f) SHA1(d4f668d259ec649e3126db27d990a2e5fa9cad8d), ROM_SKIP(2) )
1328   ROMX_LOAD( "18.18", 0x90002, 0x10000, CRC(6bd42d8e) SHA1(0745428a54da85707d4435f20cc2094576a95e5b), ROM_SKIP(2) )   // 1111xxxxxxxxxxxx = 0x00
1329
1330   ROM_REGION( 0x144, REGION_PLDS,0 ) // pals
1331   ROM_LOAD( "pal16r6cn.pal3",        0x000, 0x104, NO_DUMP )
1332   ROM_LOAD( "pal16r6cn.pal4",        0x000, 0x104, NO_DUMP )
1333   ROM_LOAD( "pal16r6cn.pal5",        0x000, 0x104, NO_DUMP )
1334   ROM_LOAD( "tibpal16l8-25cn.pal1",  0x000, 0x104, NO_DUMP )
1335   ROM_LOAD( "tibpal16l8-25cn.pal13", 0x000, 0x104, NO_DUMP )
1336   ROM_LOAD( "tibpal16l8-25cn.pal14", 0x000, 0x104, NO_DUMP )
1337   ROM_LOAD( "tibpal16l8-25cn.pal7",  0x000, 0x104, NO_DUMP )
1338   ROM_LOAD( "tibpal16l8-25cn.pal8",  0x000, 0x104, NO_DUMP )
1339   ROM_LOAD( "tibpal16r4-25cn.pal10", 0x000, 0x104, NO_DUMP )
1340   ROM_LOAD( "tibpal16r4-25cn.pal15", 0x000, 0x104, NO_DUMP )
1341   ROM_LOAD( "tibpal16r4-25cn.pal6",  0x000, 0x104, NO_DUMP )
1342   ROM_LOAD( "tibpal16r4-25cn.pal9",  0x000, 0x104, NO_DUMP )
1343   ROM_LOAD( "tibpal16r8-25cn.pal2",  0x000, 0x104, NO_DUMP )
1344   ROM_LOAD( "pal20l8acns.pal11",     0x000, 0x144, NO_DUMP )
1345   ROM_LOAD( "pal20l8acns.pal12",     0x000, 0x144, NO_DUMP )
1346ROM_END
1347
1348
1349GAME( 19??, borntofi, 0,        borntofi, borntofi, 0, ROT0,  "International Games",       "Born To Fight",        0 )
1350GAME( 19??, fantland, 0,        fantland, fantland, 0, ROT0,  "Electronic Devices Italy",  "Fantasy Land (set 1)", 0 )
1351GAME( 19??, fantlnda, fantland, fantland, fantland, 0, ROT0,  "Electronic Devices Italy",  "Fantasy Land (set 2)", 0 )
1352GAME( 19??, wheelrun, 0,        wheelrun, wheelrun, 0, ROT0,  "International Games",       "Wheels Runner",        0 )
1353GAME( 1989, galaxygn, 0,        galaxygn, galaxygn, 0, ROT90, "Electronics Devices Italy", "Galaxy Gunners",       GAME_IMPERFECT_SOUND )
src/mame/drivers/dominob.c
r1649r1650
151151/* I don't know if this has a purpose - also read in 'arkatayt' but not handled */
152152static READ8_HANDLER( dominob_unk_port02_r )
153153{
154   return 0xff;//mame_rand(Machine);
154   return 0xff;
155155}
156156
157157static ADDRESS_MAP_START( portmap, ADDRESS_SPACE_IO, 8 )
src/mame/drivers/ksys573.c
r1649r1650
11141114static UINT16 m_p_n_root_count[ 3 ];
11151115static UINT16 m_p_n_root_mode[ 3 ];
11161116static UINT16 m_p_n_root_target[ 3 ];
1117static UINT32 m_p_n_root_start[ 3 ];
1117static UINT64 m_p_n_root_start[ 3 ];
11181118
11191119#define RC_STOP ( 0x01 )
11201120#define RC_RESET ( 0x04 ) /* guess */
r1649r1650
11251125#define RC_CLC ( 0x100 )
11261126#define RC_DIV ( 0x200 )
11271127
1128static UINT32 psxcpu_gettotalcycles( void )
1128static UINT64 psxcpu_gettotalcycles( void )
11291129{
11301130   /* TODO: should return the start of the current tick. */
11311131   return cpunum_gettotalcycles(0) * 2;
r1649r1650
11571157   }
11581158   else
11591159   {
1160      UINT32 n_current;
1160      UINT64 n_current;
11611161      n_current = psxcpu_gettotalcycles() - m_p_n_root_start[ n_counter ];
11621162      n_current /= root_divider( n_counter );
11631163      n_current += m_p_n_root_count[ n_counter ];
src/mame/drivers/sbrkout.c
r1649r1650
3131***************************************************************************/
3232
3333#include "driver.h"
34#include "deprecat.h"
3435#include "sound/dac.h"
3536
3637#include "sbrkout.lh"
src/mame/drivers/bladestl.c
r1649r1650
2626***************************************************************************/
2727
2828#include "driver.h"
29#include "deprecat.h"
2930#include "cpu/m6809/m6809.h"
3031#include "cpu/hd6309/hd6309.h"
3132#include "video/konamiic.h"
r1649r1650
3435
3536/* from video */
3637int bladestl_spritebank;
38PALETTE_INIT( bladestl );
3739VIDEO_START( bladestl );
3840VIDEO_UPDATE( bladestl );
39PALETTE_INIT( bladestl );
4041WRITE8_HANDLER( bladestl_vreg_w );
4142
4243static INTERRUPT_GEN( bladestl_interrupt )
r1649r1650
124125   AM_RANGE(0x0000, 0x1fff) AM_WRITE(K007342_w)            /* Color RAM + Video RAM */
125126   AM_RANGE(0x2000, 0x21ff) AM_WRITE(K007420_w)            /* Sprite RAM */
126127   AM_RANGE(0x2200, 0x23ff) AM_WRITE(K007342_scroll_w)      /* Scroll RAM */
127   AM_RANGE(0x2400, 0x245f) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)/* palette */
128   AM_RANGE(0x2400, 0x245f) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)/* palette */
128129   AM_RANGE(0x2600, 0x2607) AM_WRITE(K007342_vreg_w)         /* Video Registers */
129130   AM_RANGE(0x2e80, 0x2e80) AM_WRITE(bladestl_sh_irqtrigger_w)/* cause interrupt on audio CPU */
130131   AM_RANGE(0x2ec0, 0x2ec0) AM_WRITE(watchdog_reset_w)      /* watchdog reset */
r1649r1650
449450   MDRV_SCREEN_SIZE(32*8, 32*8)
450451   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
451452   MDRV_GFXDECODE(bladestl)
452   MDRV_PALETTE_LENGTH(48)
453   MDRV_COLORTABLE_LENGTH(48 + 16*16)
453   MDRV_PALETTE_INIT(bladestl)
454   MDRV_PALETTE_LENGTH(32 + 16*16)
454455
455   MDRV_PALETTE_INIT(bladestl)
456456   MDRV_VIDEO_START(bladestl)
457457   MDRV_VIDEO_UPDATE(bladestl)
458458
src/mame/drivers/toobin.c
r1649r1650
1818
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/atarigen.h"
2223#include "audio/atarijsa.h"
2324#include "toobin.h"
src/mame/drivers/bwidow.c
r1649r1650
214214***************************************************************************/
215215
216216#include "driver.h"
217#include "deprecat.h"
217218#include "video/vector.h"
218219#include "video/avgdvg.h"
219220#include "machine/atari_vg.h"
src/mame/drivers/srumbler.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/m6809/m6809.h"
1314#include "sound/2203intf.h"
1415
src/mame/drivers/legionna.c
r1649r1650
9191***************************************************************************/
9292
9393#include "driver.h"
94#include "deprecat.h"
9495#include "cpu/z80/z80.h"
9596#include "audio/seibu.h"
9697#include "sound/3812intf.h"
r1649r1650
43784379GAME( 1993, sdgndmrb, 0,        sdgndmrb, sdgndmrb, 0,         ROT0, "Banpresto", "SD Gundam Sangokushi Rainbow Tairiku Senki", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
43794380GAME( 1993, denjinmk, 0,        denjinmk, godzilla, 0,        ROT0, "Banpresto", "Denjin Makai", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
43804381
4381GAME( 1992, cupsoc,   0,        cupsoc,  cupsoc,    0,        ROT0, "Seibu", "Seibu Cup Soccer", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4382GAME( 1992, cupsoc,   0,        cupsoc,  cupsoc,    0,        ROT0, "Seibu", "Seibu Cup Soccer (set 1)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
43824383GAME( 1992, cupsoc2,  cupsoc,   cupsoc,  cupsoc,    0,        ROT0, "Seibu", "Seibu Cup Soccer (set 2)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
43834384GAME( 1992, olysoc92, cupsoc,   cupsoc,  cupsoc,    0,        ROT0, "Seibu", "Olympic Soccer '92", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4384GAME( 1992, cupsocbl, cupsoc,   cupsocbl, cupsoc,   cupsoc, ROT0, "bootleg", "Seibu Cup Soccer (bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND )
4385GAME( 1992, cupsocbl, cupsoc,   cupsocbl, cupsoc,   cupsoc,   ROT0, "bootleg", "Seibu Cup Soccer (bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/pbaction.c
r1649r1650
3434***************************************************************************/
3535
3636#include "driver.h"
37#include "deprecat.h"
3738#include "sound/ay8910.h"
3839#include "machine/segacrpt.h"
3940
src/mame/drivers/overdriv.c
r1649r1650
1919***************************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "video/konamiic.h"
2324#include "machine/eeprom.h"
2425#include "cpu/m6809/m6809.h"
src/mame/drivers/thunderx.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1314#include "video/konamiic.h"
1415#include "sound/2151intf.h"
r1649r1650
10581059
10591060GAME( 1988, scontra,  0,        scontra,  scontra,  scontra, ROT90, "Konami", "Super Contra", 0 )
10601061GAME( 1988, scontraj, scontra,  scontra,  scontra,  scontra, ROT90, "Konami", "Super Contra (Japan)", 0 )
1061GAME( 1988, thunderx, 0,        thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross", 0 )
1062GAME( 1988, thnderxa, thunderx, thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (Set 2)", 0 )
1063GAME( 1988, thnderxb, thunderx, thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (Set 3)", 0 )
1062GAME( 1988, thunderx, 0,        thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (set 1)", 0 )
1063GAME( 1988, thnderxa, thunderx, thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (set 2)", 0 )
1064GAME( 1988, thnderxb, thunderx, thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (set 3)", 0 )
10641065GAME( 1988, thnderxj, thunderx, thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (Japan)", 0 )
src/mame/drivers/jackpool.c
r1649r1650
99*/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "sound/okim6295.h"
1314
1415
r1649r1650
7576
7677static READ16_HANDLER( jackpool_io_r )
7778{
78//  return mame_rand(Machine);
7979   return 0xffff;
8080}
8181
src/mame/drivers/spcforce.c
r1649r1650
3232***************************************************************************/
3333
3434#include "driver.h"
35#include "deprecat.h"
3536#include "cpu/i8085/i8085.h"
3637#include "cpu/i8039/i8039.h"
3738#include "sound/sn76496.h"
r1649r1650
365366ROM_END
366367
367368
368GAME( 1980, spcforce, 0,        spcforce, spcforce, 0, ROT270, "Venture Line", "Space Force", GAME_IMPERFECT_COLORS )
369GAME( 1980, spcforce, 0,        spcforce, spcforce, 0, ROT270, "Venture Line", "Space Force (set 1)", GAME_IMPERFECT_COLORS )
369370GAME( 19??, spcforc2, spcforce, spcforce, spcforc2, 0, ROT270, "Elcon (bootleg?)", "Space Force (set 2)", GAME_IMPERFECT_COLORS )
370371GAME( 1981, meteor,   spcforce, spcforce, spcforc2, 0, ROT270, "Venture Line", "Meteoroids", GAME_IMPERFECT_COLORS )
src/mame/drivers/gsword.c
r1649r1650
142142******************************************/
143143
144144#include "driver.h"
145#include "deprecat.h"
145146#include "cpu/z80/z80.h"
146147#include "machine/tait8741.h"
147148#include "sound/ay8910.h"
src/mame/drivers/nmg5.c
r1649r1650
220220*/
221221
222222#include "driver.h"
223#include "deprecat.h"
223224#include "sound/okim6295.h"
224225#include "sound/3812intf.h"
225226
src/mame/drivers/mario.c
r1649r1650
9090***************************************************************************/
9191
9292#include "driver.h"
93#include "deprecat.h"
9394#include "machine/z80dma.h"
9495
9596#include "mario.h"
r1649r1650
182183static ADDRESS_MAP_START( masao_map, ADDRESS_SPACE_PROGRAM, 8 )
183184   AM_RANGE(0x0000, 0x5fff) AM_ROM
184185   AM_RANGE(0x6000, 0x6fff) AM_RAM
185   AM_RANGE(0x7000, 0x73ff) AM_RAM   AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* physical sprite ram */
186   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, mario_videoram_w) AM_BASE(&videoram)
186   AM_RANGE(0x7000, 0x73ff) AM_RAM   AM_BASE_MEMBER(mario_state, spriteram) AM_SIZE_MEMBER(mario_state, spriteram_size) /* physical sprite ram */
187   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, mario_videoram_w) AM_BASE_MEMBER(mario_state, videoram)
187188   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0")
188189   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1")
189190   AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w)
src/mame/drivers/xmen.c
r1649r1650
1414
1515***************************************************************************/
1616#include "driver.h"
17#include "deprecat.h"
1718#include "video/konamiic.h"
1819#include "machine/eeprom.h"
1920#include "cpu/z80/z80.h"
src/mame/drivers/silkroad.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "sound/2151intf.h"
34#include "sound/okim6295.h"
45
src/mame/drivers/wink.c
r1649r1650
1212*/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "sound/ay8910.h"
1617
1718static tilemap *bg_tilemap;
src/mame/drivers/lethal.c
r1649r1650
165165***************************************************************************/
166166
167167#include "driver.h"
168#include "deprecat.h"
168169#include "video/konamiic.h"
169170#include "cpu/m6809/m6809.h"
170171#include "cpu/hd6309/hd6309.h"
src/mame/drivers/videopin.c
r1649r1650
1111*************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "videopin.h"
1516#include "videopin.lh"
1617#include "sound/discrete.h"
src/mame/drivers/exprraid.c
r1649r1650
6161***************************************************************************/
6262
6363#include "driver.h"
64#include "deprecat.h"
6465#include "cpu/m6809/m6809.h"
6566#include "sound/2203intf.h"
6667#include "sound/3812intf.h"
r1649r1650
612613}
613614
614615
615GAME( 1986, exprraid, 0,        exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US)", 0 )
616GAME( 1986, exprraid, 0,        exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US set 1)", 0 )
616617GAME( 1986, exprrada, exprraid, exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US set 2)", 0 )
617618GAME( 1986, wexpress, exprraid, exprraid, exprraid, wexpress, ROT0, "Data East Corporation", "Western Express (World?)", 0 )
618619GAME( 1986, wexpresb, exprraid, exprraid, exprraid, wexpresb, ROT0, "bootleg", "Western Express (bootleg set 1)", 0 )
src/mame/drivers/tecmo16.c
r1649r1650
2424******************************************************************************/
2525
2626#include "driver.h"
27#include "deprecat.h"
2728#include "cpu/m68000/m68000.h"
2829#include "cpu/z80/z80.h"
2930#include "sound/2151intf.h"
src/mame/drivers/2mindril.c
r1649r1650
5151*/
5252
5353#include "driver.h"
54#include "deprecat.h"
5455#include "sound/2610intf.h"
5556
5657static UINT16 *unkram;
src/mame/drivers/runaway.c
r1649r1650
1111****************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "machine/atari_vg.h"
1516#include "sound/pokey.h"
1617
src/mame/drivers/taitowlf.c
r1649r1650
55
66#include "driver.h"
77#include "memconv.h"
8#include "deprecat.h"
89#include "machine/8237dma.h"
910#include "machine/pic8259.h"
1011#include "machine/pit8253.h"
src/mame/drivers/toypop.c
r1649r1650
3030****************************************/
3131
3232#include "driver.h"
33#include "deprecat.h"
3334#include "machine/namcoio.h"
3435#include "sound/namco.h"
3536
src/mame/drivers/tumbleb.c
r1649r1650
262262***************************************************************************/
263263
264264#include "driver.h"
265#include "deprecat.h"
265266#include "cpu/h6280/h6280.h"
266267#include "decocrpt.h"
267268#include "sound/2151intf.h"
src/mame/drivers/micro3d.c
r1649r1650
2222/*====================================================================*/
2323
2424#include "driver.h"
25//#include "machine/ds1215.h"
25#include "deprecat.h"
2626#include "cpu/tms34010/tms34010.h"
2727#include "cpu/tms34010/34010ops.h"
2828#include "cpu/i8051/i8051.h"
src/mame/drivers/kchamp.c
r1649r1650
6262
6363***************************************************************************/
6464#include "driver.h"
65#include "deprecat.h"
6566#include "cpu/z80/z80.h"
6667#include "sound/ay8910.h"
6768#include "sound/dac.h"
src/mame/drivers/olibochu.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "sound/ay8910.h"
1516
1617static tilemap *bg_tilemap;
r1649r1650
1819static PALETTE_INIT( olibochu )
1920{
2021   int i;
21   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
22   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
2322
24
25   for (i = 0;i < machine->drv->total_colors;i++)
23   for (i = 0; i < machine->drv->total_colors; i++)
2624   {
27      int bit0,bit1,bit2,r,g,b;
25      UINT8 pen;
26      int bit0, bit1, bit2, r, g, b;
2827
28      if (i < 0x100)
29         /* characters */
30         pen = (color_prom[0x020 + (i - 0x000)] & 0x0f) | 0x10;
31      else
32         /* sprites */
33         pen = (color_prom[0x120 + (i - 0x100)] & 0x0f) | 0x00;
2934
3035      /* red component */
31      bit0 = (*color_prom >> 0) & 0x01;
32      bit1 = (*color_prom >> 1) & 0x01;
33      bit2 = (*color_prom >> 2) & 0x01;
36      bit0 = (color_prom[pen] >> 0) & 0x01;
37      bit1 = (color_prom[pen] >> 1) & 0x01;
38      bit2 = (color_prom[pen] >> 2) & 0x01;
3439      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
40
3541      /* green component */
36      bit0 = (*color_prom >> 3) & 0x01;
37      bit1 = (*color_prom >> 4) & 0x01;
38      bit2 = (*color_prom >> 5) & 0x01;
42      bit0 = (color_prom[pen] >> 3) & 0x01;
43      bit1 = (color_prom[pen] >> 4) & 0x01;
44      bit2 = (color_prom[pen] >> 5) & 0x01;
3945      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
46
4047      /* blue component */
41      bit0 = (*color_prom >> 6) & 0x01;
42      bit1 = (*color_prom >> 7) & 0x01;
48      bit0 = (color_prom[pen] >> 6) & 0x01;
49      bit1 = (color_prom[pen] >> 7) & 0x01;
4350      b = 0x4f * bit0 + 0xa8 * bit1;
4451
45      palette_set_color(machine,i,MAKE_RGB(r,g,b));
46      color_prom++;
52      palette_set_color(machine, i, MAKE_RGB(r, g, b));
4753   }
48
49   /* color_prom now points to the beginning of the lookup table */
50
51
52   /* characters */
53   for (i = 0;i < TOTAL_COLORS(0);i++)
54      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
55
56   /* sprites */
57   for (i = 0;i < TOTAL_COLORS(1);i++)
58      COLOR(1,i) = (*(color_prom++) & 0x0f);
5954}
6055
6156static WRITE8_HANDLER( olibochu_videoram_w )
r1649r1650
389384   MDRV_SCREEN_SIZE(32*8, 32*8)
390385   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
391386   MDRV_GFXDECODE(olibochu)
392   MDRV_PALETTE_LENGTH(32)
393   MDRV_COLORTABLE_LENGTH(512)
387   MDRV_PALETTE_LENGTH(512)
394388
395389   MDRV_PALETTE_INIT(olibochu)
396390   MDRV_VIDEO_START(olibochu)
src/mame/drivers/gunbustr.c
r1649r1650
4545***************************************************************************/
4646
4747#include "driver.h"
48#include "deprecat.h"
4849#include "cpu/m68000/m68000.h"
4950#include "video/taitoic.h"
5051#include "audio/taitosnd.h"
src/mame/drivers/scotrsht.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "sound/2203intf.h"
1112
1213extern UINT8 *scotrsht_scroll;
src/mame/drivers/taito_z.c
r1649r1650
771771***************************************************************************/
772772
773773#include "driver.h"
774#include "deprecat.h"
774775#include "cpu/m68000/m68000.h"
775776#include "machine/eeprom.h"
776777#include "video/taitoic.h"
src/mame/drivers/lastfght.c
r1649r1650
6363*********************************************************************************************************************/
6464
6565#include "driver.h"
66#include "deprecat.h"
6667#include "cpu/h83002/h83002.h"
6768
6869/***************************************************************************
r1649r1650
119120#endif
120121#endif
121122
122   copybitmap(bitmap,lastfght_bitmap[lastfght_dest^1],0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
123   copybitmap(bitmap,lastfght_bitmap[lastfght_dest^1],0,0,0,0,cliprect);
123124
124125   return 0;
125126}
r1649r1650
460461}
461462
462463static MACHINE_DRIVER_START( lastfght )
463   MDRV_CPU_ADD(H83002, 32000000/2)
464   MDRV_CPU_ADD(H83044, 32000000/2)
464465   MDRV_CPU_PROGRAM_MAP( lastfght_map, 0 )
465466   MDRV_CPU_VBLANK_INT(unknown_interrupt,2)
466467
src/mame/drivers/msisaac.c
r1649r1650
66
77****************************************************************************/
88
9#include <math.h>
109#include "driver.h"
10#include "deprecat.h"
1111#include "cpu/z80/z80.h"
1212#include "cpu/m6805/m6805.h"
1313#include "sound/ay8910.h"
src/mame/drivers/superqix.c
r1649r1650
107107***************************************************************************/
108108
109109#include "driver.h"
110#include "deprecat.h"
110111#include "cpu/m6805/m6805.h"
111112#include "sound/ay8910.h"
112113#include "sound/samples.h"
src/mame/drivers/cojag.c
r1649r1650
540540
541541static UINT32 *main_speedup;
542542static int main_speedup_hits;
543static UINT32 main_speedup_last_cycles;
544static UINT32 main_speedup_max_cycles;
543static UINT64 main_speedup_last_cycles;
544static UINT64 main_speedup_max_cycles;
545545
546546static READ32_HANDLER( cojagr3k_main_speedup_r )
547547{
548   UINT32 curcycles = activecpu_gettotalcycles();
548   UINT64 curcycles = activecpu_gettotalcycles();
549549
550550   /* if it's been less than main_speedup_max_cycles cycles since the last time */
551551   if (curcycles - main_speedup_last_cycles < main_speedup_max_cycles)
r1649r1650
620620
621621static WRITE32_HANDLER( area51_main_speedup_w )
622622{
623   UINT32 curcycles = activecpu_gettotalcycles();
623   UINT64 curcycles = activecpu_gettotalcycles();
624624
625625   /* store the data */
626626   COMBINE_DATA(main_speedup);
r1649r1650
654654
655655static WRITE32_HANDLER( area51mx_main_speedup_w )
656656{
657   UINT32 curcycles = activecpu_gettotalcycles();
657   UINT64 curcycles = activecpu_gettotalcycles();
658658
659659   /* store the data */
660660   COMBINE_DATA(&main_speedup[offset]);
src/mame/drivers/cyberbal.c
r1649r1650
2020
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "rendlay.h"
2425#include "machine/atarigen.h"
2526#include "audio/atarijsa.h"
src/mame/drivers/lockon.c
r1649r1650
1/*====================================================================
2                        Lock-On (Tatsumi 1986)
3                        ======================
1/***************************************************************************
42
5                 Preliminary Driver by Philip J Bennett
6                 ======================================
3    Tatsumi Lock-On hardware
74
8To do
9======
5    driver by Phil Bennett
106
11Almost everything video related :)
7    Known bugs:
8        * None
129
13o Scene tilemap scrolling
14o Colours
15o Objects
16o HUD layer
17o Ground layer
18o Layer mixing
10***************************************************************************/
1911
20=====================================================================*/
21
2212#include "driver.h"
13#include "deprecat.h"
2314#include "sound/2203intf.h"
15#include "sound/flt_vol.h"
16#include "lockon.h"
2417
25static UINT16 *lockon_vram0;
26static UINT16 *lockon_vram1;
27static UINT16 *lockon_vram2;
28static UINT16 *object_ram;
29static UINT16 *ground_ram;
30static UINT8 *z80_ram;
31static UINT16 *v30_gnd;
32static UINT16 *v30_obj;
33static UINT16 *clut_ram;
18#define V30_GND_ADDR   ((lockon_ctrl_reg & 0x3) << 16)
19#define V30_OBJ_ADDR   ((lockon_ctrl_reg & 0x18) << 13)
3420
35static int v30_obj_addr=0;
36static int v30_gnd_addr=0;
37static int main_inten=0;
3821
39static size_t objectram_size;
40static size_t lockon_ground_size;
22/*************************************
23 *
24 *  Forward definitions
25 *
26 *************************************/
4127
42static tilemap *lockon_tilemap0;
43static tilemap *lockon_tilemap1;
44static tilemap *lockon_tilemap2;
28static WRITE8_HANDLER( sound_vol );
29static READ8_HANDLER( adc_r );
4530
4631
47/*
48Three sources are mixed at the RGB output PROMs:
32/*************************************
33 *
34 *  Globals
35 *
36 *************************************/
4937
50* Characters
51* HUD
52* Objects/scene/ground
38UINT32   lockon_main_inten;
39UINT8   lockon_ctrl_reg;
5340
54A = !( ((VCDDB6 || VCDDB1) && !VCDDB7) || HUDPT0 )
55B = !( (!HUDPT0 || !VCDDB7) && (VCDDB6 || VCDDB1) )
5641
57A B   Layer                  Colours
580 0   Characters             0-255
590 1   Characters             256-511
601 0   HUD                    512-767
611 1   Objects/scene/ground   768-1023
62*/
42/*************************************
43 *
44 *  Machine functions
45 *
46 *************************************/
6347
64/* Very preliminary! */
65static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
66{
67        int offs=0;
68        int index_x=0, index_y=0;
6948
70        UINT16 *ROM_LUTA = (UINT16 *)memory_region(REGION_USER1);
71        UINT8  *ROM_LUTB = (UINT8 *)memory_region(REGION_USER2);
72        UINT8  *ROM_LUTC = (UINT8 *)memory_region(REGION_USER2)+0x8000;   // Selected by bit 7...
49/*************************************
7350
74          for (offs = 0x0; offs <= (objectram_size/2); offs += 4)
75      {
76          int offs0 = (object_ram[offs+3] & 0x3f) << 8;              // Lower 6-bits go into upper ROM portion
77          int bit7  = (object_ram[offs+3] >> 7) & 0x1;      // Selects which ROM to use in calculating lookup
78          int lut;
51    Main control register
7952
80        if(!object_ram[offs+2])
81           continue;
82         if((object_ram[offs+3] >> 8) == 0xfc || (object_ram[offs+3] >> 8) == 0xff)   // ?
83            break;
53     76543210
54    |......xx|  Ground CPU A17-A16
55    |.....x..|  /Ground CPU bus req.
56    |...xx...|  Object CPU A17-A16
57    |..x.....|  /Object CPU bus req.
58    |.x......|  /Z80 bus req.
59    |x.......|  Display enable
8460
85          if(!bit7)
86              lut = (ROM_LUTC[offs0 | (index_y<<4) | index_x]) & 0x7f;
87          else
88              lut = (ROM_LUTB[offs0 | (index_y<<4) | index_x]) & 0x7f;
61*************************************/
8962
90        // Bits 12,13,14 = bank
91        // Bits 0-11 obj
92        for(index_y=0; index_y<8; index_y++)
93        {
94         int index_x;
95         for(index_x=0; index_x<8; index_x++)
96         {
97
98            /* Index into the object lookup table */
99            int ref = object_ram[offs+2] + lut;
100
101            int pix = ROM_LUTA[ref+index_x+(16*index_y)];       // ???
102
103            int flip_x = 0;//(object_ram[offs+1] >> 7) & 0x1;  // Bit 15
104            int flip_y = 0;//(object_ram[offs+1] >> 6) & 0x1;  // Bit 14
105
106            int scale_x = 0xffff; //+ object_ram[offs+1] & 0xff; //0x1ffff;
107            int scale_y = 0xffff; //+ object_ram[offs+1] >> 8; //0x1ffff;
108
109            int sy = 255-(object_ram[offs] & 0xff)+(index_y*8)*(scale_y/0xffff);
110            int sx = (object_ram[offs] >> 8)+(index_x*8)*(scale_x/0xffff);
111
112            int bank = ((pix >> 12) & 0x7);
113            int index = pix & 0xfff;
114
115            int color = 1;
116
117            const gfx_element *gfx = machine->gfx[bank];
118
119            drawgfxzoom(bitmap, gfx,
120               index,
121               color,
122               flip_x,flip_y,            // FlipX, flipY
123               sx,sy,
124               cliprect,TRANSPARENCY_PEN,1,
125                             scale_x,scale_y);
126         }
127        }
128   }
129}
130
131/* Characters */
132static WRITE16_HANDLER( lockon_vram_0_w )
63static WRITE16_HANDLER( adrst_w )
13364{
134    COMBINE_DATA(&lockon_vram0[offset]);
135      tilemap_mark_tile_dirty(lockon_tilemap0,offset);
136}
65   lockon_ctrl_reg = data & 0xff;
13766
138/* Scene */
139static WRITE16_HANDLER( lockon_vram_1_w )
140{
141   COMBINE_DATA(&lockon_vram1[offset]);
142   tilemap_mark_tile_dirty(lockon_tilemap1,offset);
67   /* Bus mastering for shared access */
68   cpunum_set_input_line(Machine, GROUND_CPU, INPUT_LINE_HALT, data & 0x04 ? ASSERT_LINE : CLEAR_LINE);
69   cpunum_set_input_line(Machine, OBJECT_CPU, INPUT_LINE_HALT, data & 0x20 ? ASSERT_LINE : CLEAR_LINE);
70   cpunum_set_input_line(Machine, SOUND_CPU,  INPUT_LINE_HALT, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);
14371}
14472
145/* HUD */
146static WRITE16_HANDLER( lockon_vram_2_w )
73static READ16_HANDLER( main_gnd_r )
14774{
148   COMBINE_DATA(&lockon_vram2[offset]);
149   tilemap_mark_tile_dirty(lockon_tilemap2,offset);
150}
75   UINT16 result;
15176
152/* 8*8 characters */
153static TILE_GET_INFO( get_lockon_tile_info0 )
154{
155   int tileno, color;
156   tileno = lockon_vram0[tile_index];
157   color = 0;
77   cpuintrf_push_context(GROUND_CPU);
78   result = program_read_word(V30_GND_ADDR | offset * 2);
79   cpuintrf_pop_context();
15880
159   SET_TILE_INFO(4,tileno,color,0);
81   return result;
16082}
16183
162/* Scene tiles */
163static TILE_GET_INFO( get_lockon_tile_info1 )
84static WRITE16_HANDLER( main_gnd_w )
16485{
165     int tileno, color;
166   tileno = lockon_vram1[tile_index];
167   color = 0;
86   cpuintrf_push_context(GROUND_CPU);
16887
169   SET_TILE_INFO(5,tileno,color,0);
170}
171
172/* HUD tiles */
173static TILE_GET_INFO( get_lockon_tile_info2 )
174{
175     int tileno, color;
176   tileno = lockon_vram2[tile_index];
177   color = 0;
178
179   SET_TILE_INFO(6,tileno,color,0);
180}
181
182
183static VIDEO_START( lockon )
184{
185   lockon_tilemap0 = tilemap_create(get_lockon_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,64,32);
186   lockon_tilemap1 = tilemap_create(get_lockon_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,64,32);
187   lockon_tilemap2 = tilemap_create(get_lockon_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,16,16); // HUD -> wrong
188   tilemap_set_transparent_pen(lockon_tilemap0,0x00);
189}
190
191static VIDEO_UPDATE( lockon )
192{
193   tilemap_draw(bitmap,cliprect,lockon_tilemap1,0,0);       // Scene
194   tilemap_draw(bitmap,cliprect,lockon_tilemap0,0,0);       // Characters
195   //tilemap_draw(bitmap,cliprect,lockon_tilemap2,0,0);       // HUD
196   draw_sprites(machine,bitmap,cliprect);
197   return 0;
198}
199
200/* Wrong last time I checked */
201static INPUT_PORTS_START( lockon )
202   PORT_START_TAG("DSW")
203   PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Lives ) )
204   PORT_DIPSETTING(      0x0000, "5"    )
205   PORT_DIPSETTING(      0x0001, "4"  )
206   PORT_DIPSETTING(      0x0002, "2"    )
207   PORT_DIPSETTING(      0x0003, "3" )
208
209   PORT_DIPNAME( 0x0006, 0x0008, DEF_STR( Difficulty ) )
210   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
211   PORT_DIPSETTING(      0x0006, DEF_STR( Normal ) )
212   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
213   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
214
215   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) )
216   PORT_DIPSETTING(      0x0010, "150K & every 200K"  )
217   PORT_DIPSETTING(      0x0000, "200K & every 200K"  )
218
219   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) )
220   PORT_DIPSETTING(      0x0020, DEF_STR( No )  )
221   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
222
223   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) )
224   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
225   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
226
227   PORT_DIPNAME( 0x0300, 0x0000, "Coins" )
228   PORT_DIPSETTING(      0x0000, "Free" )
229   PORT_DIPSETTING(      0x0100, "4"  )
230   PORT_DIPSETTING(      0x0200, "2"  )
231   PORT_DIPSETTING(      0x0300, "3"  )
232
233   PORT_START
234   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
235   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
236   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )     // Service coin
237   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
238   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1  ) // 'Trigger A'
239   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2  ) // 'Trigger B'
240   PORT_DIPNAME( 0x40, 0x00, "Jumper 1" )
241   PORT_DIPSETTING(      0x40, DEF_STR( Off ) )
242   PORT_DIPSETTING(      0x00, DEF_STR( On ) )
243   PORT_DIPNAME( 0x80, 0x00, "Jumper 0" )
244   PORT_DIPSETTING(      0x80, DEF_STR( Off ) )
245   PORT_DIPSETTING(      0x00, DEF_STR( On ) )
246
247   PORT_START_TAG("analog_bank")
248   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
249
250   PORT_START_TAG("analog_pitch")
251   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
252
253   PORT_START_TAG("analog_missile")
254   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON3 )         // Digital input read by ADC
255
256   PORT_START_TAG("analog_hover")
257   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON4 )         // Digital input read by ADC
258INPUT_PORTS_END
259
260
261static READ8_HANDLER(adc_r)
262{
263   switch(offset)
264   {
265      case 0: return readinputportbytag("analog_bank");
266      case 1: return readinputportbytag("analog_pitch");
267      case 2: return readinputportbytag("analog_missile");
268      case 3: return readinputportbytag("analog_hover");
269      default: return 0;
270   }
271}
272
273static READ16_HANDLER(unk_read)
274{
275   return 1;                    // Main CPU jumps to 18002 otherwise
276}
277
278
279static INTERRUPT_GEN( lockon_irq )
280{
281        if(main_inten)
282           cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x60/4);
283
284          // Ground CPU takes an interrupt on BUFEND - this is incorrect.
285          cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0x60/4);
286}
287
288/*
289   Main CPU control register
290   -------------------------
291
292   Bit 0 = MGAB16     Ground CPU A16
293   Bit 1 = MGAB17     Ground CPU A17
294   Bit 2 = MGABREQ    Object CPU Bus Request
295   Bit 3 = MOAB16     Object CPU A16
296
297   Bit 4 = MOAB17     Object CPU A17
298   Bit 5 = OMLBRQ     Object CPU Bus Request
299   Bit 6 = /ZBRQ      Z80 Bus Request
300   Bit 7 = /ZCCLR     Clear screen
301*/
302
303static WRITE16_HANDLER(adrst_w)
304{
30588   if (ACCESSING_LSB)
306   {
307      v30_gnd_addr = (data & 0x3);
308      v30_obj_addr = (data & 0x18) >> 3;
89      program_write_byte(V30_GND_ADDR | (offset * 2 + 0), data);
90   if (ACCESSING_MSB)
91      program_write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8);
30992
310      if (data & 0x04)
311         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
312      else
313         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
314
315      if (data & 0x20)
316         cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE);
317      else
318         cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
319
320      /* Suspend the Z80 when writing to shared RAM */
321      if (data & 0x40)
322         cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, CLEAR_LINE);
323      else
324         cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, ASSERT_LINE);
325   }
93   cpuintrf_pop_context();
32694}
32795
328static READ16_HANDLER(z80_shared_r)
96static READ16_HANDLER( main_obj_r )
32997{
330   return z80_ram[offset] | 0xff00;
331}
332
333static WRITE16_HANDLER(z80_shared_w)
334{
335   if (ACCESSING_LSB)
336      z80_ram[offset] = data;
337}
338
339static READ16_HANDLER(main_gnd_r)
340{
34198   UINT16 result;
342   cpuintrf_push_context(1);
343   result = program_read_word((offset * 2) | (v30_gnd_addr << 16));
344   cpuintrf_pop_context();
345   return result;
346}
34799
348static WRITE16_HANDLER(main_gnd_w)
349{
350   cpuintrf_push_context(1);
351   if (ACCESSING_LSB)
352      program_write_byte((offset * 2 + 0) | (v30_gnd_addr << 16), data);
353   if (ACCESSING_MSB)
354      program_write_byte((offset * 2 + 1) | (v30_gnd_addr << 16), data >> 8);
100   cpuintrf_push_context(OBJECT_CPU);
101   result = program_read_word(V30_OBJ_ADDR | offset * 2);
355102   cpuintrf_pop_context();
356}
357103
358static READ16_HANDLER(main_obj_r)
359{
360   UINT16 result;
361   cpuintrf_push_context(2);
362   result = program_read_word((offset * 2) | (v30_obj_addr << 16));
363   cpuintrf_pop_context();
364104   return result;
365105}
366106
367static WRITE16_HANDLER(main_obj_w)
107static WRITE16_HANDLER( main_obj_w )
368108{
369   cpuintrf_push_context(2);
109   cpuintrf_push_context(OBJECT_CPU);
110
370111   if (ACCESSING_LSB)
371      program_write_byte((offset * 2 + 0) | (v30_obj_addr << 16), data);
112      program_write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data);
372113   if (ACCESSING_MSB)
373      program_write_byte((offset * 2 + 1) | (v30_obj_addr << 16), data >> 8);
114      program_write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
115
374116   cpuintrf_pop_context();
375117}
376118
377
378static WRITE16_HANDLER(testcs_w)
119static WRITE16_HANDLER( tst_w )
379120{
380   if (offset < 0x400)
121   if (offset < 0x800)
381122   {
382      cpuintrf_push_context(1);
123      cpuintrf_push_context(GROUND_CPU);
383124      if (ACCESSING_LSB)
384         program_write_byte((offset*2+0) | (v30_gnd_addr << 16), data);
125         program_write_byte(V30_GND_ADDR | (offset * 2 + 0), data);
385126      if (ACCESSING_MSB)
386         program_write_byte((offset*2+1) | (v30_gnd_addr << 16), data >> 8);
127         program_write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8);
387128      cpuintrf_pop_context();
388129
389      cpuintrf_push_context(2);
130      cpuintrf_push_context(OBJECT_CPU);
390131      if (ACCESSING_LSB)
391         program_write_byte((offset*2+0) | (v30_obj_addr << 16), data);
132         program_write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data);
392133      if (ACCESSING_MSB)
393         program_write_byte((offset*2+1) | (v30_obj_addr << 16), data >> 8);
134         program_write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
394135      cpuintrf_pop_context();
395136   }
396137}
397138
398/*
399The ground register is as follows:
139static READ16_HANDLER( main_z80_r )
140{
141   UINT16 val;
400142
4010 27512x4 A14
4021 27512x4 A15
4032 Select 27512 A
4043 Select 27512 B
4054 LO3_04A A12
4065 LO3_04A A13
4076 LO3_04A A14
4087 CS - ROMs
409*/
410static WRITE16_HANDLER(ground_bank_w)
411{
412// Nothing here yet
143   cpuintrf_push_context(SOUND_CPU);
144   val = program_read_byte(offset);
145   cpuintrf_pop_context();
146
147   return 0xff00 | val;
413148}
414149
415
416#ifdef UNUSED_FUNCTION
417/* Allow /CUDISP to interrupt main CPU */
418static WRITE8_HANDLER(sound_atten)
150static WRITE16_HANDLER( main_z80_w )
419151{
420       mame_printf_debug("%x\n",data);
152   cpuintrf_push_context(SOUND_CPU);
153   program_write_byte(offset, data);
154   cpuintrf_pop_context();
421155}
422#endif
423156
424/* Allow /CUDISP to interrupt main CPU */
425static WRITE16_HANDLER(inten_w)
157static WRITE16_HANDLER( inten_w )
426158{
427   main_inten = TRUE;
159   lockon_main_inten = 1;
428160}
429161
430/* Reset watchdog and mask /CUDISP interrupt */
431static WRITE16_HANDLER(emres_w)
162static WRITE16_HANDLER( emres_w )
432163{
433   // Implement watchdog reset here.
434   main_inten = FALSE;
164   watchdog_reset_r(0);
165   lockon_main_inten = 0;
435166}
436167
437168
169/*************************************
170 *
171 *  CPU memory maps
172 *
173 *************************************/
174
438175static ADDRESS_MAP_START( main_v30, ADDRESS_SPACE_PROGRAM, 16 )
439   AM_RANGE(0x00000, 0x03fff) AM_RAM              // IC69/IC70
440   AM_RANGE(0x04000, 0x04003) AM_NOP              // CRT Controller
441   AM_RANGE(0x06000, 0x06001) AM_READ_PORT("DSW")
442   AM_RANGE(0x08000, 0x081ff) AM_READWRITE(MRA16_RAM,lockon_vram_2_w) AM_BASE(&lockon_vram2)  // HUD RAM (IC30/IC31)
443   AM_RANGE(0x09000, 0x09fff) AM_READWRITE(MRA16_RAM,lockon_vram_0_w) AM_BASE(&lockon_vram0)  // Character RAM
444   AM_RANGE(0x0a000, 0x0a001) AM_WRITE(adrst_w)            // /ADRST: CPU access register
445   AM_RANGE(0x0b000, 0x0bfff) AM_RAM                       // /BKBCS - ground control registers
446   AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_BASE(&clut_ram)    // /CCRS - 8kB palette RAM - write only
447   AM_RANGE(0x0e000, 0x0e001) AM_WRITE(inten_w)            // /INTEN: /CUDISP interrupt enable
448   AM_RANGE(0x0f000, 0x0f001) AM_WRITE(emres_w)            // /EMRES: Watchdog reset and interrupt mask
449   AM_RANGE(0x10000, 0x1ffff) AM_WRITE(testcs_w)           // /TESTCS: Write to both object and ground CPU RAM
450   AM_RANGE(0x18000, 0x18001) AM_READ(unk_read)            // Not sure what this is
451   AM_RANGE(0x20000, 0x2dfff) AM_ROM                                        // Z80 ROM
452   AM_RANGE(0x2f000, 0x2ffff) AM_READWRITE(z80_shared_r, z80_shared_w)      // Z80 shared RAM
453   AM_RANGE(0x30000, 0x3ffff) AM_READWRITE(main_gnd_r, main_gnd_w)          // Ground CPU memory access
454   AM_RANGE(0x40000, 0x4ffff) AM_READWRITE(main_obj_r, main_obj_w)          // Object CPU memory access
455   AM_RANGE(0x50000, 0x5ffff) AM_ROM              // IC76/IC77
456   AM_RANGE(0x60000, 0x6ffff) AM_ROM              // IC88/IC89
457   AM_RANGE(0xf0000, 0xfffff) AM_ROM              // IC95/IC96
176   ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) )
177   AM_RANGE(0x00000, 0x03fff) AM_RAM
178   AM_RANGE(0x04000, 0x04003) AM_READWRITE(lockon_crtc_r, lockon_crtc_w)
179   AM_RANGE(0x06000, 0x06001) AM_READ(input_port_0_word_r)
180   AM_RANGE(0x08000, 0x081ff) AM_RAM AM_BASE(&lockon_hud_ram) AM_SIZE(&lockon_hudram_size)
181   AM_RANGE(0x09000, 0x09fff) AM_READWRITE(MRA16_RAM, lockon_char_w) AM_BASE(&lockon_char_ram)
182   AM_RANGE(0x0a000, 0x0a001) AM_WRITE(adrst_w)
183   AM_RANGE(0x0b000, 0x0bfff) AM_WRITE(lockon_rotate_w)
184   AM_RANGE(0x0c000, 0x0cfff) AM_WRITE(lockon_fb_clut_w)
185   AM_RANGE(0x0e000, 0x0e001) AM_WRITE(inten_w)
186   AM_RANGE(0x0f000, 0x0f001) AM_WRITE(emres_w)
187   AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(MRA16_NOP, tst_w)
188   AM_RANGE(0x20000, 0x2ffff) AM_READWRITE(main_z80_r, main_z80_w)
189   AM_RANGE(0x30000, 0x3ffff) AM_READWRITE(main_gnd_r, main_gnd_w)
190   AM_RANGE(0x40000, 0x4ffff) AM_READWRITE(main_obj_r, main_obj_w)
191   AM_RANGE(0x50000, 0x5ffff) AM_MIRROR(0x80000) AM_ROM
192   AM_RANGE(0x60000, 0x6ffff) AM_MIRROR(0x80000) AM_ROM
193   AM_RANGE(0x70000, 0x7ffff) AM_MIRROR(0x80000) AM_ROM
458194ADDRESS_MAP_END
459195
196
460197static ADDRESS_MAP_START( ground_v30, ADDRESS_SPACE_PROGRAM, 16 )
461198   ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) )
462   AM_RANGE(0x00000, 0x03fff) AM_RAM AM_BASE(&v30_gnd)        // IC31/IC34)
463   AM_RANGE(0x04000, 0x04fff) AM_READWRITE(MRA16_RAM,lockon_vram_1_w) AM_BASE(&lockon_vram1)   // Scene RAM (IC112/IC113)
464   AM_RANGE(0x08000, 0x08fff) AM_RAM AM_BASE(&ground_ram) AM_SIZE(&lockon_ground_size)        // Ground RAM (IC98/IC99)
465   AM_RANGE(0x0c000, 0x0c001) AM_RAM                                          // /SHNH CS: Horizontal Scroll
466   AM_RANGE(0x0c002, 0x0c003) AM_RAM                                          // /SHNV CS: Vertical Scroll
467   AM_RANGE(0x0c004, 0x0c005) AM_RAM AM_WRITE(ground_bank_w)                  // /UNB CS:  Ground ROM Bank select
468   AM_RANGE(0x20000, 0x2ffff) AM_ROM                                          // Ground ROM (IC30/IC33)
469   AM_RANGE(0x30000, 0x3ffff) AM_ROM                                          // Program ROM mirror (use macros?)
470   AM_RANGE(0xe0000, 0xeffff) AM_ROM                                          // Ground ROM mirror
471   AM_RANGE(0xf0000, 0xfffff) AM_ROM
199   AM_RANGE(0x00000, 0x03fff) AM_RAM
200   AM_RANGE(0x04000, 0x04fff) AM_RAM AM_BASE(&lockon_scene_ram)
201   AM_RANGE(0x08000, 0x08fff) AM_RAM AM_BASE(&lockon_ground_ram) AM_SIZE(&lockon_groundram_size)
202   AM_RANGE(0x0C000, 0x0C001) AM_WRITE(lockon_scene_h_scr_w)
203   AM_RANGE(0x0C002, 0x0C003) AM_WRITE(lockon_scene_v_scr_w)
204   AM_RANGE(0x0C004, 0x0C005) AM_WRITE(lockon_ground_ctrl_w)
205   AM_RANGE(0x20000, 0x2ffff) AM_MIRROR(0xc0000) AM_ROM
206   AM_RANGE(0x30000, 0x3ffff) AM_MIRROR(0xc0000) AM_ROM
472207ADDRESS_MAP_END
473208
209
474210static ADDRESS_MAP_START( object_v30, ADDRESS_SPACE_PROGRAM, 16 )
475   AM_RANGE(0x00000, 0x03fff) AM_RAM AM_BASE(&v30_obj)          // Work RAM (IC29, IC44)
476   AM_RANGE(0x04000, 0x04001) AM_RAM              // Read = assert CPU /POLL input (halt on WAIT instruction)
477   AM_RANGE(0x08000, 0x081ff) AM_RAM              // TZA112 sprite chip write?
478   AM_RANGE(0x0c000, 0x0c1ff) AM_RAM AM_BASE(&object_ram) AM_SIZE(&objectram_size)     // Object RAM (IC39/IC54)
479   AM_RANGE(0x20000, 0x2ffff) AM_ROM             // Program ROM mirror
480   AM_RANGE(0xf0000, 0xfffff) AM_ROM             // Program ROM
211   ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) )
212   AM_RANGE(0x00000, 0x03fff) AM_RAM
213   AM_RANGE(0x04000, 0x04001) AM_READWRITE(lockon_obj_4000_r, lockon_obj_4000_w)
214   AM_RANGE(0x08000, 0x08fff) AM_WRITE(lockon_tza112_w)
215   AM_RANGE(0x0c000, 0x0c1ff) AM_RAM AM_BASE(&lockon_object_ram) AM_SIZE(&lockon_objectram_size)
216   AM_RANGE(0x30000, 0x3ffff) AM_MIRROR(0xc0000) AM_ROM
481217ADDRESS_MAP_END
482218
219
483220static ADDRESS_MAP_START( sound_prg, ADDRESS_SPACE_PROGRAM, 8 )
484   AM_RANGE(0x0000, 0x1fff) AM_ROM
485   AM_RANGE(0xf810, 0xf810) AM_WRITE(MWA8_NOP)           // /TS
486   AM_RANGE(0x7000, 0x7000) AM_WRITE(MWA8_NOP)           // Attenuate YM3014 output (not used?)
487   AM_RANGE(0x7400, 0x7403) AM_READWRITE(adc_r,MWA8_NOP) // M58990 ADC
488   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_BASE(&z80_ram)
221   ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) )
222   AM_RANGE(0x0000, 0x6fff) AM_ROM
223   AM_RANGE(0x7000, 0x7000) AM_WRITE(sound_vol)
224   AM_RANGE(0x7400, 0x7403) AM_READWRITE(adc_r, MWA8_NOP)
225   AM_RANGE(0x7800, 0x7fff) AM_MIRROR(0x8000) AM_RAM
489226ADDRESS_MAP_END
490227
491228static ADDRESS_MAP_START( sound_io, ADDRESS_SPACE_IO, 8 )
492229   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
493230   AM_RANGE(0x00, 0x00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
494231   AM_RANGE(0x01, 0x01) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
232   AM_RANGE(0x02, 0x02) AM_NOP
495233ADDRESS_MAP_END
496234
497235
236/*************************************
237 *
238 *  Port definitions
239 *
240 *************************************/
241
242static INPUT_PORTS_START( lockon )
243   PORT_START_TAG("DSW")
244   /* DSW 1 - verified on PCB as a 8 position dipswitch block */
245   PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
246   PORT_DIPSETTING(      0x0001, "2" )
247   PORT_DIPSETTING(      0x0000, "3" )
248   PORT_DIPSETTING(      0x0002, "4" )
249   PORT_DIPSETTING(      0x0003, "5" )
250   PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
251   PORT_DIPSETTING(      0x0004, DEF_STR( Easy ) )
252   PORT_DIPSETTING(      0x0000, DEF_STR( Medium ) )
253   PORT_DIPSETTING(      0x0008, DEF_STR( Hard ) )
254   PORT_DIPSETTING(      0x000c, DEF_STR( Hardest ) )
255
256   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:5")
257   PORT_DIPSETTING(      0x0000, "150K & every 200K" )
258   PORT_DIPSETTING(      0x0010, "200K & every 200K" )
259
260   PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6")
261   PORT_DIPSETTING(      0x0020, DEF_STR( No ) )
262   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
263
264   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7")
265   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
266   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
267
268   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" )
269
270   /* DSW 2 - verified on PCB as a 6 position dipswitch block */
271   PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
272   PORT_DIPSETTING(      0x0200, DEF_STR( 3C_1C ) )
273   PORT_DIPSETTING(      0x0100, DEF_STR( 2C_1C ) )
274   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
275   PORT_DIPSETTING(      0x0600, DEF_STR( 2C_3C ) )
276   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_2C ) )
277   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_5C ) )
278   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_6C ) )
279   PORT_DIPSETTING(      0x0700, DEF_STR( Free_Play ) )
280
281    PORT_DIPNAME( 0x3800, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6")
282    PORT_DIPSETTING(      0x3000, DEF_STR( 4C_1C ) )
283    PORT_DIPSETTING(      0x0800, DEF_STR( 2C_1C ) )
284    PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
285    PORT_DIPSETTING(      0x1000, DEF_STR( 1C_2C ) )
286    PORT_DIPSETTING(      0x2000, DEF_STR( 1C_3C ) )
287    PORT_DIPSETTING(      0x2800, DEF_STR( 1C_4C ) )
288    PORT_DIPSETTING(      0x1800, DEF_STR( 1C_5C ) )
289    PORT_DIPSETTING(      0x3800, DEF_STR( 1C_6C ) )
290
291   /*
292        Wire jumper beside the dipswitches on PCB TF011.
293        To access the menu, press the service coin during
294        test mode.
295    */
296   PORT_DIPNAME( 0x4000, 0x4000, "Enable H/W Tests Menu" )
297   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
298   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
299
300PORT_START_TAG("YM2203")
301   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
302   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
303   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
304   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
305   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1  )
306   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2  )
307   PORT_DIPNAME( 0x40, 0x00, "Jumper 1" )
308   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
309   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
310   PORT_DIPNAME( 0x80, 0x00, "Jumper 0" )
311   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
312   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
313
314PORT_START_TAG("ADC_BANK")
315   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_MINMAX(0,0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15)
316PORT_START_TAG("ADC_PITCH")
317   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_MINMAX(0,0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15)
318PORT_START_TAG("ADC_MISSILE")
319   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON3 )
320PORT_START_TAG("ADC_HOVER")
321   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON4 )
322INPUT_PORTS_END
323
324
325static INPUT_PORTS_START( lockone )
326   PORT_INCLUDE( lockon )
327
328   PORT_MODIFY("DSW")
329   PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coin_A ) )
330   PORT_DIPSETTING(      0x0300, DEF_STR( 4C_1C ) )
331   PORT_DIPSETTING(      0x0200, DEF_STR( 3C_1C ) )
332   PORT_DIPSETTING(      0x0100, DEF_STR( 2C_1C ) )
333   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
334   PORT_DIPSETTING(      0x0600, DEF_STR( 2C_3C ) )
335   PORT_DIPSETTING(      0x0700, DEF_STR( 2C_4C ) )
336   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_2C ) )
337   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )
338
339    PORT_DIPNAME( 0x0800, 0x0000, "Buy-In" )
340    PORT_DIPSETTING(      0x0800, DEF_STR( 2C_1C ) )
341    PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
342
343   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unused ) )
344   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
345   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
346   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unused ) )
347    PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
348   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
349INPUT_PORTS_END
350
351
352/*************************************
353 *
354 *  M58990P ADC
355 *
356 *************************************/
357
358static READ8_HANDLER( adc_r )
359{
360   switch (offset)
361   {
362      case 0:  return readinputportbytag("ADC_BANK");
363      case 1:  return readinputportbytag("ADC_PITCH");
364      case 2:  return readinputportbytag("ADC_MISSILE");
365      case 3:  return readinputportbytag("ADC_HOVER");
366      default: return 0;
367   }
368}
369
370/*************************************
371 *
372 *  Graphics definitions
373 *
374 *************************************/
375
498376static const gfx_layout char_layout =
499377{
500378   8,8,
501379   1024,
502380   2,
503381   { 0, 8*8*1024 },
504   { 0,1,2,3,4,5,6,7 },
382   { 0, 1, 2, 3, 4, 5, 6, 7 },
505383   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
506384   8*8
507385};
508386
509static const gfx_layout object_layout =
510{
511   8,8,
512   4096,
513   8,
514   { 0, 0x8000*8, 0x8000*2*8, 0x8000*3*8, 0x8000*4*8, 0x8000*5*8, 0x8000*6*8, 0x8000*7*8 },
515   { 0,1,2,3,4,5,6,7 },
516   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
517   8*8
518};
387static GFXDECODE_START( lockon )
388   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout,  0, 128 )
389GFXDECODE_END
519390
520static const gfx_layout scene_layout =
521{
522   8,8,
523   4096,
524   3,
525   { 0, 0x10000*8, 0x20000*8 },
526   { 0,1,2,3,4,5,6,7 },
527   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
528   8*8
529};
530391
531static const gfx_layout hud_layout =
532{
533   8,8,
534   1024,
535   1,
536   { 0 },
537   { 0,1,2,3,4,5,6,7 },
538   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
539   8*8
540};
392/*************************************
393 *
394 *  Sound related
395 *
396 *************************************/
541397
542static const gfx_layout ground_layout =
398static WRITE8_HANDLER( sound_vol )
543399{
544   8,8,
545   8192,
546   3,
547   { 0, 0x10000*8, 0x20000*8 },
548   { 0,1,2,3,4,5,6,7 },
549   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
550   8*8
551};
400#define LO_SHUNT   250.0
401#define LO_R0      5600.0
402#define LO_R1      10000.0
403#define LO_R2      22000.0
404#define LO_R3      47000.0
405#define LO_R0S      (1/(1/LO_SHUNT + 1/LO_R0))
406#define LO_R1S      (1/(1/LO_SHUNT + 1/LO_R1))
407#define LO_R2S      (1/(1/LO_SHUNT + 1/LO_R2))
408#define LO_R3S      (1/(1/LO_SHUNT + 1/LO_R3))
409#define LO_RI      100000.0
410#define LO_RP      100000.0
552411
412   static const double gains[16] =
413   {
414      -( 1 / (1/LO_RP + 1/(LO_R3   + LO_R2   + LO_R1   + LO_R0))  ) / LO_RI,
415      -( 1 / (1/LO_RP + 1/(LO_R3   + LO_R2   + LO_R1   + LO_R0S)) ) / LO_RI,
416      -( 1 / (1/LO_RP + 1/(LO_R3   + LO_R2   + LO_R1S  + LO_R0))  ) / LO_RI,
417      -( 1 / (1/LO_RP + 1/(LO_R3   + LO_R2   + LO_R1S  + LO_R0S)) ) / LO_RI,
418      -( 1 / (1/LO_RP + 1/(LO_R3   + LO_R2S  + LO_R1   + LO_R0))  ) / LO_RI,
419      -( 1 / (1/LO_RP + 1/(LO_R3   + LO_R2S  + LO_R1   + LO_R0S)) ) / LO_RI,
420      -( 1 / (1/LO_RP + 1/(LO_R3   + LO_R2S  + LO_R1S  + LO_R0))  ) / LO_RI,
421      -( 1 / (1/LO_RP + 1/(LO_R3   + LO_R2S  + LO_R1S  + LO_R0S)) ) / LO_RI,
422      -( 1 / (1/LO_RP + 1/(LO_R3S  + LO_R2   + LO_R1   + LO_R0))  ) / LO_RI,
423      -( 1 / (1/LO_RP + 1/(LO_R3S  + LO_R2   + LO_R1   + LO_R0S)) ) / LO_RI,
424      -( 1 / (1/LO_RP + 1/(LO_R3S  + LO_R2   + LO_R1S  + LO_R0))  ) / LO_RI,
425      -( 1 / (1/LO_RP + 1/(LO_R3S  + LO_R2   + LO_R1S  + LO_R0S)) ) / LO_RI,
426      -( 1 / (1/LO_RP + 1/(LO_R3S  + LO_R2S  + LO_R1   + LO_R0))  ) / LO_RI,
427      -( 1 / (1/LO_RP + 1/(LO_R3S  + LO_R2S  + LO_R1   + LO_R0S)) ) / LO_RI,
428      -( 1 / (1/LO_RP + 1/(LO_R3S  + LO_R2S  + LO_R1S  + LO_R0))  ) / LO_RI,
429      -( 1 / (1/LO_RP + 1/(LO_R3S  + LO_R2S  + LO_R1S  + LO_R0S)) ) / LO_RI,
430   };
553431
554static GFXDECODE_START( lockon )
555   GFXDECODE_ENTRY( REGION_GFX1, 0, object_layout,  0, 16 )
556   GFXDECODE_ENTRY( REGION_GFX2, 0, object_layout,  0, 16 )
557   GFXDECODE_ENTRY( REGION_GFX3, 0, object_layout,  0, 16 )
558   GFXDECODE_ENTRY( REGION_GFX4, 0, object_layout,  0, 16 )
559   GFXDECODE_ENTRY( REGION_GFX5, 0, char_layout,    0, 16 )
560   GFXDECODE_ENTRY( REGION_GFX6, 0, scene_layout,   0, 16 )
561   GFXDECODE_ENTRY( REGION_GFX7, 0, hud_layout,     0, 16 )
562   GFXDECODE_ENTRY( REGION_GFX8, 0, ground_layout,  0, 16 )
563GFXDECODE_END
432   double lgain = gains[data & 0xf];
433   double rgain = gains[data >> 4];
564434
565static void YM2203_irq(int irq)
435   flt_volume_set_volume(0, lgain);
436   flt_volume_set_volume(2, lgain);
437   flt_volume_set_volume(4, lgain);
438
439   flt_volume_set_volume(1, rgain);
440   flt_volume_set_volume(3, rgain);
441   flt_volume_set_volume(5, rgain);
442}
443
444static void ym2203_irq(int irq)
566445{
567   cpunum_set_input_line(Machine, 3, 0, irq ? ASSERT_LINE : CLEAR_LINE );
446   cpunum_set_input_line(Machine, SOUND_CPU, 0, irq ? ASSERT_LINE : CLEAR_LINE );
568447}
569448
570static WRITE8_HANDLER(YM2203_out_b)
449static WRITE8_HANDLER( ym2203_out_b )
571450{
572        coin_counter_w(0,data & 0x80);
573        coin_counter_w(1,data & 0x40);
574        coin_counter_w(2,data & 0x20);
575        set_led_status(1,!(data & 0x10));            // 'LOCK-ON' lamp
451   coin_counter_w(0, data & 0x80);
452   coin_counter_w(1, data & 0x40);
453   coin_counter_w(2, data & 0x20);
454
455   /* 'Lock-On' lamp */
456   set_led_status(1, !(data & 0x10));
576457}
577458
578459static const struct YM2203interface ym2203_interface =
579460{
580   input_port_2_r,
461   input_port_1_r,
581462   0,
582463   0,
583   YM2203_out_b,
584   YM2203_irq
464   ym2203_out_b,
465   ym2203_irq
585466};
586467
468
469/*************************************
470 *
471 *  Machine driver
472 *
473 *************************************/
474
587475static MACHINE_DRIVER_START( lockon )
588   MDRV_CPU_ADD(V30,8000000)
589   MDRV_CPU_PROGRAM_MAP(main_v30,0)
476   MDRV_CPU_ADD(V30, XTAL_16MHz / 2)
477   MDRV_CPU_PROGRAM_MAP(main_v30, 0)
590478
591   MDRV_CPU_ADD(V30,8000000)
592   MDRV_CPU_PROGRAM_MAP(ground_v30,0)
479   MDRV_CPU_ADD(V30, XTAL_16MHz / 2)
480   MDRV_CPU_PROGRAM_MAP(ground_v30, 0)
593481
594   MDRV_CPU_ADD(V30,8000000)
595   MDRV_CPU_PROGRAM_MAP(object_v30,0)
482   MDRV_CPU_ADD(V30, XTAL_16MHz / 2)
483   MDRV_CPU_PROGRAM_MAP(object_v30, 0)
596484
597   MDRV_CPU_ADD(Z80,4000000)
598   MDRV_CPU_PROGRAM_MAP(sound_prg,0)
599   MDRV_CPU_IO_MAP(sound_io,0)
485   MDRV_CPU_ADD(Z80, XTAL_16MHz / 4)
486   MDRV_CPU_PROGRAM_MAP(sound_prg, 0)
487   MDRV_CPU_IO_MAP(sound_io, 0)
600488
601   MDRV_CPU_VBLANK_INT(lockon_irq,1)
602   MDRV_SCREEN_REFRESH_RATE(60)
603   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
604   MDRV_INTERLEAVE(100)
489   MDRV_WATCHDOG_TIME_INIT(attotime_mul(PERIOD_OF_555_ASTABLE(10000, 4700, 10000e-12), 4096))
490   MDRV_INTERLEAVE(10)
605491
606   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
492   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_AFTER_VBLANK)
607493   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
608   MDRV_SCREEN_SIZE(320, 240)
609   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
494   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
495
610496   MDRV_GFXDECODE(lockon)
497   MDRV_PALETTE_INIT(lockon)
498   MDRV_PALETTE_LENGTH(1024 + 2048)
611499
612   MDRV_PALETTE_LENGTH(1024)
613
614500   MDRV_VIDEO_START(lockon)
615501   MDRV_VIDEO_UPDATE(lockon)
502   MDRV_VIDEO_EOF(lockon)
616503
617   MDRV_SPEAKER_STANDARD_STEREO("left","right")
504   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
618505
619   MDRV_SOUND_ADD(YM2203, 4000000)
506   MDRV_SOUND_ADD(YM2203, XTAL_16MHz / 4)
620507   MDRV_SOUND_CONFIG(ym2203_interface)
621   MDRV_SOUND_ROUTE(0, "left",  0.2)
622   MDRV_SOUND_ROUTE(1, "left",  0.4)
623   MDRV_SOUND_ROUTE(2, "left",  0.4)
624   MDRV_SOUND_ROUTE(3, "left",  0.4)
625   MDRV_SOUND_ROUTE(0, "right",  0.2)
626   MDRV_SOUND_ROUTE(1, "right",  0.4)
627   MDRV_SOUND_ROUTE(2, "right",  0.4)
628   MDRV_SOUND_ROUTE(3, "right",  0.4)
508   MDRV_SOUND_ROUTE(0, "left", 0.40)
509   MDRV_SOUND_ROUTE(0, "right", 0.40)
510   MDRV_SOUND_ROUTE(1, "f2203.1l", 1.0)
511   MDRV_SOUND_ROUTE(1, "f2203.1r", 1.0)
512   MDRV_SOUND_ROUTE(2, "f2203.2l", 1.0)
513   MDRV_SOUND_ROUTE(2, "f2203.2r", 1.0)
514   MDRV_SOUND_ROUTE(3, "f2203.3l", 1.0)
515   MDRV_SOUND_ROUTE(3, "f2203.3r", 1.0)
516
517   MDRV_SOUND_ADD_TAG("f2203.1l", FILTER_VOLUME, 0)
518   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
519   MDRV_SOUND_ADD_TAG("f2203.1r", FILTER_VOLUME, 0)
520   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
521   MDRV_SOUND_ADD_TAG("f2203.2l", FILTER_VOLUME, 0)
522   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
523   MDRV_SOUND_ADD_TAG("f2203.2r", FILTER_VOLUME, 0)
524   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
525   MDRV_SOUND_ADD_TAG("f2203.3l", FILTER_VOLUME, 0)
526   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
527   MDRV_SOUND_ADD_TAG("f2203.3r", FILTER_VOLUME, 0)
528   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
629529MACHINE_DRIVER_END
630530
631531
532/*************************************
533 *
534 *  ROM definition(s)
535 *
536 *************************************/
537
538
632539ROM_START( lockon )
540   /* TF012 V30 (Main) */
633541   ROM_REGION( 0x100000, REGION_CPU1, 0 )
634   ROM_LOAD16_BYTE( "lo1_02c", 0x50000, 0x8000, CRC(bbf17263) SHA1(96821a0ecd6efe6764380fef094f87c1d6e1d299) )
635   ROM_LOAD16_BYTE( "lo1_03c", 0x50001, 0x8000, CRC(fa58fd36) SHA1(16af24027610bf6d3fdc4c3df3bf6d94c6776420) )
542   ROM_LOAD16_BYTE( "lo1_02c.89", 0x60000, 0x8000, CRC(bbf17263) SHA1(96821a0ecd6efe6764380fef094f87c1d6e1d299) )
543   ROM_LOAD16_BYTE( "lo1_03c.88", 0x60001, 0x8000, CRC(fa58fd36) SHA1(16af24027610bf6d3fdc4c3df3bf6d94c6776420) )
636544
637   ROM_LOAD16_BYTE( "lo1_04c", 0x60000, 0x8000, CRC(4a88576e) SHA1(80a8bd89cedebf080b2c08a6e81d3c2754024d8a) )
638   ROM_LOAD16_BYTE( "lo1_05c", 0x60001, 0x8000, CRC(5a171b02) SHA1(f41f641136574e6af67c2245eb5a84799984474a) )
545   ROM_LOAD16_BYTE( "lo1_04c.77", 0x50000, 0x8000, CRC(4a88576e) SHA1(80a8bd89cedebf080b2c08a6e81d3c2754024d8a) )
546   ROM_LOAD16_BYTE( "lo1_05c.76", 0x50001, 0x8000, CRC(5a171b02) SHA1(f41f641136574e6af67c2245eb5a84799984474a) )
639547
640   ROM_LOAD16_BYTE( "lo1_00c", 0xf0000, 0x8000, CRC(e2db493b) SHA1(7491c634b698973ea54c25612d1e79c7efea8a45) )
641   ROM_LOAD16_BYTE( "lo1_01c", 0xf0001, 0x8000, CRC(3e6065e0) SHA1(d870f5b466fab90d5c51dd27ecc807e7b38b5f79))
548   ROM_LOAD16_BYTE( "lo1_00e.96", 0x70000, 0x8000, CRC(25eec97f) SHA1(884d4e75111d532afed9755bd678cb7678385a86) )
549   ROM_LOAD16_BYTE( "lo1_01e.95", 0x70001, 0x8000, CRC(03f0391d) SHA1(53795eab8f1b33c86a72d2f0f1cbcf7faab0011b) )
642550
643   // Z80
644   ROM_LOAD16_BYTE( "lo1_08b", 0x20000, 0x8000, CRC(73860ec9) SHA1(a94afa274321b9f9ac2184e133132f9829fb9485) )
551   /* TF013 V30 (Ground) */
552   ROM_REGION( 0x100000, REGION_CPU2, 0 )
553   ROM_LOAD16_BYTE( "lo3_01a.30", 0x20000, 0x8000, CRC(3eacdb6b) SHA1(7934c36dac9253dec4d8910954f6f2ae85951fe9) )
554   ROM_LOAD16_BYTE( "lo3_03a.33", 0x20001, 0x8000, CRC(4ce96d71) SHA1(cedbc33e86a93d11d5e11c2ef18bcf6390790a88) )
555   ROM_LOAD16_BYTE( "lo3_00b.29", 0x30000, 0x8000, CRC(1835dccb) SHA1(8dfb0fea61a3e61f4da3b7f0da02cd19df2e68be) )
556   ROM_LOAD16_BYTE( "lo3_02b.32", 0x30001, 0x8000, CRC(2b8931d3) SHA1(f6f40b7857f3d47da8626450b1c1d3c46a1072ab) )
645557
646   // TF013 V30 (Ground)
558   /* TF014 V30 (Object)  */
559   ROM_REGION( 0x100000, REGION_CPU3, 0 )
560   ROM_LOAD16_BYTE( "lo4_00b", 0x30000, 0x8000, CRC(5f6b5a50) SHA1(daf82cafcae86d05587c191b0ff194ca7950e130) )
561   ROM_LOAD16_BYTE( "lo4_01b", 0x30001, 0x8000, CRC(7e88bcf2) SHA1(d541458ba6178ec3bce0e9b872b9fa1d8edb107c) )
562
563   /* TF014 Z80 (Sound) */
564   ROM_REGION( 0x10000, REGION_CPU4, 0 )
565   ROM_LOAD( "lo1_08b.24", 0x00000, 0x8000, CRC(73860ec9) SHA1(a94afa274321b9f9ac2184e133132f9829fb9485) )
566
567   /* 8x8x2 characters */
568   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
569   ROM_LOAD( "lo1_07a", 0x00000, 0x2000, CRC(73673b79) SHA1(246b80f0c465cefb7ce1c87dc90a58f0f0ea3e0d) )
570   ROM_LOAD( "lo1_06a", 0x02000, 0x2000, CRC(c8205913) SHA1(c791ff14418873ce68b502440c3d7ccc1f9cc00e) )
571
572   /* 8x8x3 scene tiles and CLUT */
573   ROM_REGION( 0x40000, REGION_GFX2, 0 )
574   ROM_LOAD( "lo3_12a.120", 0x00000, 0x10000, CRC(a34262a7) SHA1(08204a4474ab1b07b9114da8af03442737922d3b) )
575   ROM_LOAD( "lo3_11a.119", 0x10000, 0x10000, CRC(018efa36) SHA1(99eec3f06146627c7f7177b854424e7162ab7c8e) )
576   ROM_LOAD( "lo3_10a.118", 0x20000, 0x10000, CRC(d5f4a8f3) SHA1(fcfaef46ef89c4b97970418a75d110271e94d55f) )
577   ROM_LOAD( "lo3_13a.121", 0x30000, 0x10000, CRC(e44774a7) SHA1(010d95ea497690ddd2406b8fef1b0aee375a165e) )
578
579   /* 8x8x1 HUD sprites */
580   ROM_REGION( 0x2000, REGION_GFX3, 0 )
581   ROM_LOAD( "lo2_00.53", 0x00000, 0x2000, CRC(8affea15) SHA1(b7bcf0abde9c933e3f2c75c1f5e2ca3417d50ca1) )
582
583   /* Ground GFX and LUTs */
584   ROM_REGION( 0x60000, REGION_GFX4, 0 )
585   ROM_LOAD( "lo3_07a.94", 0x00000, 0x10000, CRC(cebc50e1) SHA1(f8b06ce576c3d41b0a8e2cc3ac60d3515d434812) )
586   ROM_LOAD( "lo3_06a.92", 0x10000, 0x10000, CRC(f6b6ebdd) SHA1(30e92da3bf83c4bb30faf00cbf01664b993f137c) )
587   ROM_LOAD( "lo3_05a.90", 0x20000, 0x10000, CRC(5b6f4c8e) SHA1(fc8b2c929c60fb0177ed3e407e3f0aacc5df8401) )
588   ROM_LOAD( "lo3_08.104", 0x30000, 0x10000, CRC(f418cecd) SHA1(6cf2d13c9df86bad9c24609cb8387e817b5d4281) )
589   ROM_LOAD( "lo3_09.105", 0x40000, 0x10000, CRC(3c245568) SHA1(9ff6a23d83627f55c9d4f68e0bd89927bfe10664) )
590   ROM_LOAD( "lo3_04a.88", 0x50000, 0x10000, CRC(80b67ba9) SHA1(fdbef463b26cd13c43596310f585432c6e0896d0) )
591
592   /* 8x8x4 object tiles */
593   ROM_REGION( 0x100000, REGION_GFX5, 0 )
594   ROM_LOAD( "lo5_28a.76", 0x00000, 0x8000, CRC(1186f9b4) SHA1(55598552dafa8cccfb423fc3b65a7fa15831d75b) )
595   ROM_LOAD( "lo5_20a.48", 0x08000, 0x8000, CRC(3c1a67b5) SHA1(399935830b32a457ad0de243dd3eb4d368d5c6a6) )
596   ROM_LOAD( "lo5_08a.58", 0x10000, 0x8000, CRC(9dedeff5) SHA1(53b0917a4fde4053182d38ea7f99f66e52543c10) )
597   ROM_LOAD( "lo5_00a.14", 0x18000, 0x8000, CRC(e9f23ce6) SHA1(4030384a0e8f47e8eea9483482ed1be264aec992) )
598   ROM_LOAD( "lo5_24a.62", 0x20000, 0x8000, CRC(1892d083) SHA1(8ee92be93ac222ecc2d9f4fcda3099b1db67516c) )
599   ROM_LOAD( "lo5_16a.32", 0x28000, 0x8000, CRC(c4500159) SHA1(e695e31e363cc954aab449f9d3dbc027e27fe7bf) )
600   ROM_LOAD( "lo5_04a.28", 0x30000, 0x8000, CRC(099323bc) SHA1(001d30f4c3c27277fadac89dcf616ff89eb0ea1c) )
601   ROM_LOAD( "lo5_12a.8",  0x38000, 0x8000, CRC(2f5164ab) SHA1(df775b9e1c3c605a85d44404e4db42e33e80e664) )
602
603   ROM_LOAD( "lo5_29a.77", 0x40000, 0x8000, CRC(45353d8d) SHA1(45cacd36700d24ae9f6eeaebed2fc860ef2d2978) )
604   ROM_LOAD( "lo5_21a.49", 0x48000, 0x8000, CRC(39ce2000) SHA1(05f8e6f364ad714232fcea5b535ed5e181febd1e) )
605   ROM_LOAD( "lo5_10a.72", 0x50000, 0x8000, CRC(23eeec5a) SHA1(08edd997d773684d329ef554776bc7acff1ac4ce) )
606   ROM_LOAD( "lo5_01a.15", 0x58000, 0x8000, CRC(528d1395) SHA1(0221f81900757c10f288807f5c9549b9fdf5390f) )
607   ROM_LOAD( "lo5_25a.93", 0x60000, 0x8000, CRC(7f3418bd) SHA1(5e595500f996b71aa73c637a6fddced30d78e222) )
608   ROM_LOAD( "lo5_17a.33", 0x68000, 0x8000, CRC(ccf138d3) SHA1(971e7abe5b4d1a9dc8fc71b1ded5d2b81bcffaf2) )
609   ROM_LOAD( "lo5_06a.44", 0x70000, 0x8000, CRC(be539b01) SHA1(1eebcbc592c51a676409b5be6c5d6609cd7118c9) )
610   ROM_LOAD( "lo5_14a.22", 0x78000, 0x8000, CRC(e63cd59e) SHA1(0518461acdc6c65dca8f21ca29bf528197e7cabe) )
611
612   ROM_LOAD( "lo5_30a.78", 0x80000, 0x8000, CRC(7d3993c5) SHA1(fb18daffcfc46bc1e1cfdee928eea861494af221) )
613   ROM_LOAD( "lo5_22a.50", 0x88000, 0x8000, CRC(b1ed0361) SHA1(4bdf439026a858fdd929d5a7baac7d76f51550c5) )
614   ROM_LOAD( "lo5_09a.59", 0x90000, 0x8000, CRC(953289bc) SHA1(197066af45c1193c36cd59b4b72b14f1c3bdd33e) )
615   ROM_LOAD( "lo5_02a.16", 0x98000, 0x8000, CRC(07aa32a1) SHA1(712b1983747acdd754d3abe934642cbc02ee13f2) )
616   ROM_LOAD( "lo5_26a.64", 0xa0000, 0x8000, CRC(a0b5c040) SHA1(ef63f89a368bc73eb77fc02d83b499a0231c1989) )
617   ROM_LOAD( "lo5_18a.34", 0xa8000, 0x8000, CRC(89884b24) SHA1(23c1fcc97f3a1abcaad413f4448db26f7c55fd5e) )
618   ROM_LOAD( "lo5_05a.29", 0xb0000, 0x8000, CRC(f6b775a2) SHA1(e0146866f2e89675181c5d9d5aba23116daac420) )
619   ROM_LOAD( "lo5_13a.9",  0xb8000, 0x8000, CRC(67fbb061) SHA1(78b071cd54642ee7b6d7b9f6b759a1412bb9eef5) )
620
621   ROM_LOAD( "lo5_31a.79", 0xc0000, 0x8000, CRC(d3595292) SHA1(9c45be919296626796b07f70b871fba5d444dbb3) )
622   ROM_LOAD( "lo5_23a.51", 0xc8000, 0x8000, CRC(1487895b) SHA1(9d617f37932ca17d902307a97d16cf3b4bb5bc4e) )
623   ROM_LOAD( "lo5_11a.73", 0xd0000, 0x8000, CRC(9df0b287) SHA1(6ea3b32a7826186c854cc079711ddea4ebf2ab7c) )
624   ROM_LOAD( "lo5_03a.17", 0xd8000, 0x8000, CRC(7aca5d83) SHA1(95456b6c5adc5b776fbd33fd95cc62d4a83c34b6) )
625   ROM_LOAD( "lo5_27a.65", 0xe0000, 0x8000, CRC(119ff70a) SHA1(e64d41bc7822c9e99fd025b771551a6c511d13f2) )
626   ROM_LOAD( "lo5_19a.35", 0xe8000, 0x8000, CRC(5aaa6a53) SHA1(f8ff547979883ac9a969e76d90d028ec4286ec4c) )
627   ROM_LOAD( "lo5_07a.45", 0xf0000, 0x8000, CRC(313f127f) SHA1(0782b8dd5f3a3384c3e7bc9cacaadf6804e06a38) )
628   ROM_LOAD( "lo5_15a.23", 0xf8000, 0x8000, CRC(66f9c5db) SHA1(cc68da9312ee0a3441b62d14107e1b7de9b04de3) )
629
630   /* Object LUTs */
631   ROM_REGION( 0x10000, REGION_USER1, 0 )
632   ROM_LOAD( "lo4_02.109", 0x0000, 0x8000, CRC(0832edde) SHA1(77f9efbe029773417dbc3836a36687e37b5bee4b) )
633   ROM_LOAD( "lo4_03.108", 0x8000, 0x8000, CRC(1efac891) SHA1(faf305a30cab1c6bf8a9d6e2682b2c3745aec956) )
634
635   /* Object chunk LUTs */
636   ROM_REGION16_LE( 0x20000, REGION_USER2, 0 )
637   ROM_LOAD16_BYTE( "lo4_04a.119", 0x00000, 0x10000, CRC(098f4151) SHA1(cf38e3c5f3442fbfa97870d25f7c89c465f847a9) )
638   ROM_LOAD16_BYTE( "lo4_05a.118", 0x00001, 0x10000, CRC(3b21667c) SHA1(b8337f733ede35145602ee3f0de25c2d4db1b2a5) )
639
640   /* Colour PROMs */
641   ROM_REGION( 0x1800, REGION_PROMS, 0 )
642   ROM_LOAD( "lo1a.5", 0x000, 0x400, CRC(82391f30) SHA1(d7153c1f3a3e54de4d4d6f432fbcd66449b96b6e) )
643   ROM_LOAD( "lo2a.2", 0x400, 0x400, CRC(2bfc6288) SHA1(03d293ddc0c614b606be823826a4375b3d35901f) )
644
645   /* Object scale PROMs */
646   ROM_LOAD_NIB_LOW ( "lo_3.69", 0x800, 0x800, CRC(9d9c41a9) SHA1(aabeefe95274f10400b4b7810ea50afcc4f19fde) )
647   ROM_LOAD_NIB_HIGH( "lo_4.68", 0x800, 0x800, CRC(ca4874ef) SHA1(c742f79729b0dc4d227379e9109c7ed21b4c38bb) )
648ROM_END
649
650
651ROM_START( lockonc )
652   /* TF012 V30 (Main) */
653   ROM_REGION( 0x100000, REGION_CPU1, 0 )
654   ROM_LOAD16_BYTE( "lo1_02c.89", 0x60000, 0x8000, CRC(bbf17263) SHA1(96821a0ecd6efe6764380fef094f87c1d6e1d299) )
655   ROM_LOAD16_BYTE( "lo1_03c.88", 0x60001, 0x8000, CRC(fa58fd36) SHA1(16af24027610bf6d3fdc4c3df3bf6d94c6776420) )
656
657   ROM_LOAD16_BYTE( "lo1_04c.77", 0x50000, 0x8000, CRC(4a88576e) SHA1(80a8bd89cedebf080b2c08a6e81d3c2754024d8a) )
658   ROM_LOAD16_BYTE( "lo1_05c.76", 0x50001, 0x8000, CRC(5a171b02) SHA1(f41f641136574e6af67c2245eb5a84799984474a) )
659
660   ROM_LOAD16_BYTE( "lo1_00c.96", 0x70000, 0x8000, CRC(e2db493b) SHA1(7491c634b698973ea54c25612d1e79c7efea8a45) )
661   ROM_LOAD16_BYTE( "lo1_01c.95", 0x70001, 0x8000, CRC(3e6065e0) SHA1(d870f5b466fab90d5c51dd27ecc807e7b38b5f79) )
662
663   /* TF013 V30 (Ground) */
647664   ROM_REGION( 0x100000, REGION_CPU2, 0 )
648   ROM_LOAD16_BYTE( "lo3_01a", 0x20000, 0x8000, CRC(3eacdb6b) SHA1(7934c36dac9253dec4d8910954f6f2ae85951fe9) )
649   ROM_RELOAD(                 0xe0000, 0x8000 )
650   ROM_LOAD16_BYTE( "lo3_03a", 0x20001, 0x8000, CRC(4ce96d71) SHA1(cedbc33e86a93d11d5e11c2ef18bcf6390790a88) )
651   ROM_RELOAD(                 0xe0001, 0x8000 )
665   ROM_LOAD16_BYTE( "lo3_01a.30", 0x20000, 0x8000, CRC(3eacdb6b) SHA1(7934c36dac9253dec4d8910954f6f2ae85951fe9) )
666   ROM_LOAD16_BYTE( "lo3_03a.33", 0x20001, 0x8000, CRC(4ce96d71) SHA1(cedbc33e86a93d11d5e11c2ef18bcf6390790a88) )
667   ROM_LOAD16_BYTE( "lo3_00b.29", 0x30000, 0x8000, CRC(1835dccb) SHA1(8dfb0fea61a3e61f4da3b7f0da02cd19df2e68be) )
668   ROM_LOAD16_BYTE( "lo3_02b.32", 0x30001, 0x8000, CRC(2b8931d3) SHA1(f6f40b7857f3d47da8626450b1c1d3c46a1072ab) )
652669
653   ROM_LOAD16_BYTE( "lo3_00b", 0xf0000, 0x8000, CRC(1835dccb) SHA1(8dfb0fea61a3e61f4da3b7f0da02cd19df2e68be) )
654   ROM_RELOAD(                 0x30000, 0x8000 )
655   ROM_LOAD16_BYTE( "lo3_02b", 0xf0001, 0x8000, CRC(2b8931d3) SHA1(f6f40b7857f3d47da8626450b1c1d3c46a1072ab) )
656   ROM_RELOAD(                 0x30001, 0x8000 )
657
658   // TF014 V30 (Object)
670   /* TF014 V30 (Object)  */
659671   ROM_REGION( 0x100000, REGION_CPU3, 0 )
660   ROM_LOAD16_BYTE( "lo4_00b", 0xf0000, 0x8000, CRC(5f6b5a50) SHA1(daf82cafcae86d05587c191b0ff194ca7950e130) )
661   ROM_RELOAD(                 0x30000, 0x8000 )
672   ROM_LOAD16_BYTE( "lo4_00b", 0x30000, 0x8000, CRC(5f6b5a50) SHA1(daf82cafcae86d05587c191b0ff194ca7950e130) )
673   ROM_LOAD16_BYTE( "lo4_01b", 0x30001, 0x8000, CRC(7e88bcf2) SHA1(d541458ba6178ec3bce0e9b872b9fa1d8edb107c) )
662674
663   ROM_LOAD16_BYTE( "lo4_01b", 0xf0001, 0x8000, CRC(7e88bcf2) SHA1(d541458ba6178ec3bce0e9b872b9fa1d8edb107c) )
664   ROM_RELOAD(                 0x30001, 0x8000 )
665
666   // TF014 Z80 (Sound)
675   /* TF014 Z80 (Sound) */
667676   ROM_REGION( 0x10000, REGION_CPU4, 0 )
668   ROM_LOAD( "lo1_08b", 0x00000, 0x8000, CRC(73860ec9) SHA1(a94afa274321b9f9ac2184e133132f9829fb9485) )
677   ROM_LOAD( "lo1_08b.24", 0x00000, 0x8000, CRC(73860ec9) SHA1(a94afa274321b9f9ac2184e133132f9829fb9485) )
669678
670   // 8x8x8 object chunks
671   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )
672   ROM_LOAD( "lo5_00a", 0x00000, 0x8000, CRC(e9f23ce6) SHA1(4030384a0e8f47e8eea9483482ed1be264aec992) )
673   ROM_LOAD( "lo5_04a", 0x08000, 0x8000, CRC(099323bc) SHA1(001d30f4c3c27277fadac89dcf616ff89eb0ea1c) )
674   ROM_LOAD( "lo5_08a", 0x10000, 0x8000, CRC(9dedeff5) SHA1(53b0917a4fde4053182d38ea7f99f66e52543c10) )
675   ROM_LOAD( "lo5_12a", 0x18000, 0x8000, CRC(2f5164ab) SHA1(df775b9e1c3c605a85d44404e4db42e33e80e664) )
676   ROM_LOAD( "lo5_16a", 0x20000, 0x8000, CRC(c4500159) SHA1(e695e31e363cc954aab449f9d3dbc027e27fe7bf) )
677   ROM_LOAD( "lo5_20a", 0x28000, 0x8000, CRC(3c1a67b5) SHA1(399935830b32a457ad0de243dd3eb4d368d5c6a6) )
678   ROM_LOAD( "lo5_24a", 0x30000, 0x8000, CRC(1892d083) SHA1(8ee92be93ac222ecc2d9f4fcda3099b1db67516c) )
679   ROM_LOAD( "lo5_28a", 0x38000, 0x8000, CRC(1186f9b4) SHA1(55598552dafa8cccfb423fc3b65a7fa15831d75b) )
679   /* 8x8x2 characters */
680   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
681   ROM_LOAD( "lo1_07a", 0x00000, 0x2000, CRC(73673b79) SHA1(246b80f0c465cefb7ce1c87dc90a58f0f0ea3e0d) )
682   ROM_LOAD( "lo1_06a", 0x02000, 0x2000, CRC(c8205913) SHA1(c791ff14418873ce68b502440c3d7ccc1f9cc00e) )
680683
681   // 8x8x8 object chunks
682   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE )
683   ROM_LOAD( "lo5_01a", 0x00000, 0x8000, CRC(528d1395) SHA1(0221f81900757c10f288807f5c9549b9fdf5390f) )
684   ROM_LOAD( "lo5_06a", 0x08000, 0x8000, CRC(be539b01) SHA1(1eebcbc592c51a676409b5be6c5d6609cd7118c9) )
685   ROM_LOAD( "lo5_10a", 0x10000, 0x8000, CRC(23eeec5a) SHA1(08edd997d773684d329ef554776bc7acff1ac4ce) )
686   ROM_LOAD( "lo5_14a", 0x18000, 0x8000, CRC(e63cd59e) SHA1(0518461acdc6c65dca8f21ca29bf528197e7cabe) )
687   ROM_LOAD( "lo5_17a", 0x20000, 0x8000, CRC(ccf138d3) SHA1(971e7abe5b4d1a9dc8fc71b1ded5d2b81bcffaf2) )
688   ROM_LOAD( "lo5_21a", 0x28000, 0x8000, CRC(39ce2000) SHA1(05f8e6f364ad714232fcea5b535ed5e181febd1e) )
689   ROM_LOAD( "lo5_25a", 0x30000, 0x8000, CRC(7f3418bd) SHA1(5e595500f996b71aa73c637a6fddced30d78e222) )
690   ROM_LOAD( "lo5_29a", 0x38000, 0x8000, CRC(45353d8d) SHA1(45cacd36700d24ae9f6eeaebed2fc860ef2d2978) )
684   /* 8x8x3 scene tiles and CLUT */
685   ROM_REGION( 0x40000, REGION_GFX2, 0 )
686   ROM_LOAD( "lo3_12a.120", 0x00000, 0x10000, CRC(a34262a7) SHA1(08204a4474ab1b07b9114da8af03442737922d3b) )
687   ROM_LOAD( "lo3_11a.119", 0x10000, 0x10000, CRC(018efa36) SHA1(99eec3f06146627c7f7177b854424e7162ab7c8e) )
688   ROM_LOAD( "lo3_10a.118", 0x20000, 0x10000, CRC(d5f4a8f3) SHA1(fcfaef46ef89c4b97970418a75d110271e94d55f) )
689   ROM_LOAD( "lo3_13a.121", 0x30000, 0x10000, CRC(e44774a7) SHA1(010d95ea497690ddd2406b8fef1b0aee375a165e) )
691690
692   // 8x8x8 object chunks
693   ROM_REGION( 0x400000, REGION_GFX3, ROMREGION_DISPOSE )
694   ROM_LOAD( "lo5_02a", 0x00000, 0x8000, CRC(07aa32a1) SHA1(712b1983747acdd754d3abe934642cbc02ee13f2) )
695   ROM_LOAD( "lo5_05a", 0x08000, 0x8000, CRC(f6b775a2) SHA1(e0146866f2e89675181c5d9d5aba23116daac420) )
696   ROM_LOAD( "lo5_09a", 0x10000, 0x8000, CRC(953289bc) SHA1(197066af45c1193c36cd59b4b72b14f1c3bdd33e) )
697   ROM_LOAD( "lo5_13a", 0x18000, 0x8000, CRC(67fbb061) SHA1(78b071cd54642ee7b6d7b9f6b759a1412bb9eef5) )
698   ROM_LOAD( "lo5_18a", 0x20000, 0x8000, CRC(89884b24) SHA1(23c1fcc97f3a1abcaad413f4448db26f7c55fd5e) )
699   ROM_LOAD( "lo5_22a", 0x28000, 0x8000, CRC(b1ed0361) SHA1(4bdf439026a858fdd929d5a7baac7d76f51550c5) )
700   ROM_LOAD( "lo5_26a", 0x30000, 0x8000, CRC(a0b5c040) SHA1(ef63f89a368bc73eb77fc02d83b499a0231c1989) )
701   ROM_LOAD( "lo5_30a", 0x38000, 0x8000, CRC(7d3993c5) SHA1(fb18daffcfc46bc1e1cfdee928eea861494af221) )
691   /* 8x8x1 HUD sprites */
692   ROM_REGION( 0x2000, REGION_GFX3, 0 )
693   ROM_LOAD( "lo2_00.53", 0x00000, 0x2000, CRC(8affea15) SHA1(b7bcf0abde9c933e3f2c75c1f5e2ca3417d50ca1) )
702694
703   // 8x8x8 object chunks
704   ROM_REGION( 0x400000, REGION_GFX4, ROMREGION_DISPOSE )
705   ROM_LOAD( "lo5_03a", 0x00000, 0x8000, CRC(7aca5d83) SHA1(95456b6c5adc5b776fbd33fd95cc62d4a83c34b6) )
706   ROM_LOAD( "lo5_07a", 0x08000, 0x8000, CRC(313f127f) SHA1(0782b8dd5f3a3384c3e7bc9cacaadf6804e06a38) )
707   ROM_LOAD( "lo5_11a", 0x10000, 0x8000, CRC(9df0b287) SHA1(6ea3b32a7826186c854cc079711ddea4ebf2ab7c) )
708   ROM_LOAD( "lo5_15a", 0x18000, 0x8000, CRC(66f9c5db) SHA1(cc68da9312ee0a3441b62d14107e1b7de9b04de3) )
709   ROM_LOAD( "lo5_19a", 0x20000, 0x8000, CRC(5aaa6a53) SHA1(f8ff547979883ac9a969e76d90d028ec4286ec4c) )
710   ROM_LOAD( "lo5_23a", 0x28000, 0x8000, CRC(1487895b) SHA1(9d617f37932ca17d902307a97d16cf3b4bb5bc4e) )
711   ROM_LOAD( "lo5_27a", 0x30000, 0x8000, CRC(119ff70a) SHA1(e64d41bc7822c9e99fd025b771551a6c511d13f2) )
712   ROM_LOAD( "lo5_31a", 0x38000, 0x8000, CRC(d3595292) SHA1(9c45be919296626796b07f70b871fba5d444dbb3) )
695   /* Ground GFX and LUTs */
696   ROM_REGION( 0x60000, REGION_GFX4, 0 )
697   ROM_LOAD( "lo3_07a.94", 0x00000, 0x10000, CRC(cebc50e1) SHA1(f8b06ce576c3d41b0a8e2cc3ac60d3515d434812) )
698   ROM_LOAD( "lo3_06a.92", 0x10000, 0x10000, CRC(f6b6ebdd) SHA1(30e92da3bf83c4bb30faf00cbf01664b993f137c) )
699   ROM_LOAD( "lo3_05a.90", 0x20000, 0x10000, CRC(5b6f4c8e) SHA1(fc8b2c929c60fb0177ed3e407e3f0aacc5df8401) )
700   ROM_LOAD( "lo3_08.104", 0x30000, 0x10000, CRC(f418cecd) SHA1(6cf2d13c9df86bad9c24609cb8387e817b5d4281) )
701   ROM_LOAD( "lo3_09.105", 0x40000, 0x10000, CRC(3c245568) SHA1(9ff6a23d83627f55c9d4f68e0bd89927bfe10664) )
702   ROM_LOAD( "lo3_04a.88", 0x50000, 0x10000, CRC(80b67ba9) SHA1(fdbef463b26cd13c43596310f585432c6e0896d0) )
713703
714   // 8x8x2 characters
715   ROM_REGION( 0x20000, REGION_GFX5, ROMREGION_DISPOSE )
716   ROM_LOAD( "lo1_06a", 0x00000, 0x2000, CRC(c8205913) SHA1(c791ff14418873ce68b502440c3d7ccc1f9cc00e) )
717   ROM_LOAD( "lo1_07a", 0x02000, 0x2000, CRC(73673b79) SHA1(246b80f0c465cefb7ce1c87dc90a58f0f0ea3e0d) )
704   /* 8x8x4 object tiles */
705   ROM_REGION( 0x100000, REGION_GFX5, 0 )
706   ROM_LOAD( "lo5_28a.76", 0x00000, 0x8000, CRC(1186f9b4) SHA1(55598552dafa8cccfb423fc3b65a7fa15831d75b) )
707   ROM_LOAD( "lo5_20a.48", 0x08000, 0x8000, CRC(3c1a67b5) SHA1(399935830b32a457ad0de243dd3eb4d368d5c6a6) )
708   ROM_LOAD( "lo5_08a.58", 0x10000, 0x8000, CRC(9dedeff5) SHA1(53b0917a4fde4053182d38ea7f99f66e52543c10) )
709   ROM_LOAD( "lo5_00a.14", 0x18000, 0x8000, CRC(e9f23ce6) SHA1(4030384a0e8f47e8eea9483482ed1be264aec992) )
710   ROM_LOAD( "lo5_24a.62", 0x20000, 0x8000, CRC(1892d083) SHA1(8ee92be93ac222ecc2d9f4fcda3099b1db67516c) )
711   ROM_LOAD( "lo5_16a.32", 0x28000, 0x8000, CRC(c4500159) SHA1(e695e31e363cc954aab449f9d3dbc027e27fe7bf) )
712   ROM_LOAD( "lo5_04a.28", 0x30000, 0x8000, CRC(099323bc) SHA1(001d30f4c3c27277fadac89dcf616ff89eb0ea1c) )
713   ROM_LOAD( "lo5_12a.8",  0x38000, 0x8000, CRC(2f5164ab) SHA1(df775b9e1c3c605a85d44404e4db42e33e80e664) )
718714
719   // 8x8x3 'scene' tiles
720   ROM_REGION( 0x40000, REGION_GFX6, ROMREGION_DISPOSE )
721   ROM_LOAD( "lo3_10a", 0x00000, 0x10000, CRC(d5f4a8f3) SHA1(fcfaef46ef89c4b97970418a75d110271e94d55f) )
722   ROM_LOAD( "lo3_11a", 0x10000, 0x10000, CRC(018efa36) SHA1(99eec3f06146627c7f7177b854424e7162ab7c8e) )
723   ROM_LOAD( "lo3_12a", 0x20000, 0x10000, CRC(a34262a7) SHA1(08204a4474ab1b07b9114da8af03442737922d3b) )
715   ROM_LOAD( "lo5_29a.77", 0x40000, 0x8000, CRC(45353d8d) SHA1(45cacd36700d24ae9f6eeaebed2fc860ef2d2978) )
716   ROM_LOAD( "lo5_21a.49", 0x48000, 0x8000, CRC(39ce2000) SHA1(05f8e6f364ad714232fcea5b535ed5e181febd1e) )
717   ROM_LOAD( "lo5_10a.72", 0x50000, 0x8000, CRC(23eeec5a) SHA1(08edd997d773684d329ef554776bc7acff1ac4ce) )
718   ROM_LOAD( "lo5_01a.15", 0x58000, 0x8000, CRC(528d1395) SHA1(0221f81900757c10f288807f5c9549b9fdf5390f) )
719   ROM_LOAD( "lo5_25a.93", 0x60000, 0x8000, CRC(7f3418bd) SHA1(5e595500f996b71aa73c637a6fddced30d78e222) )
720   ROM_LOAD( "lo5_17a.33", 0x68000, 0x8000, CRC(ccf138d3) SHA1(971e7abe5b4d1a9dc8fc71b1ded5d2b81bcffaf2) )
721   ROM_LOAD( "lo5_06a.44", 0x70000, 0x8000, CRC(be539b01) SHA1(1eebcbc592c51a676409b5be6c5d6609cd7118c9) )
722   ROM_LOAD( "lo5_14a.22", 0x78000, 0x8000, CRC(e63cd59e) SHA1(0518461acdc6c65dca8f21ca29bf528197e7cabe) )
724723
725   // 8x8x1 HUD tiles
726   ROM_REGION( 0x40000, REGION_GFX7, ROMREGION_DISPOSE )
727   ROM_LOAD( "lo2_00", 0x00000, 0x2000, CRC(8affea15) SHA1(b7bcf0abde9c933e3f2c75c1f5e2ca3417d50ca1) )
724   ROM_LOAD( "lo5_30a.78", 0x80000, 0x8000, CRC(7d3993c5) SHA1(fb18daffcfc46bc1e1cfdee928eea861494af221) )
725   ROM_LOAD( "lo5_22a.50", 0x88000, 0x8000, CRC(b1ed0361) SHA1(4bdf439026a858fdd929d5a7baac7d76f51550c5) )
726   ROM_LOAD( "lo5_09a.59", 0x90000, 0x8000, CRC(953289bc) SHA1(197066af45c1193c36cd59b4b72b14f1c3bdd33e) )
727   ROM_LOAD( "lo5_02a.16", 0x98000, 0x8000, CRC(07aa32a1) SHA1(712b1983747acdd754d3abe934642cbc02ee13f2) )
728   ROM_LOAD( "lo5_26a.64", 0xa0000, 0x8000, CRC(a0b5c040) SHA1(ef63f89a368bc73eb77fc02d83b499a0231c1989) )
729   ROM_LOAD( "lo5_18a.34", 0xa8000, 0x8000, CRC(89884b24) SHA1(23c1fcc97f3a1abcaad413f4448db26f7c55fd5e) )
730   ROM_LOAD( "lo5_05a.29", 0xb0000, 0x8000, CRC(f6b775a2) SHA1(e0146866f2e89675181c5d9d5aba23116daac420) )
731   ROM_LOAD( "lo5_13a.9",  0xb8000, 0x8000, CRC(67fbb061) SHA1(78b071cd54642ee7b6d7b9f6b759a1412bb9eef5) )
728732
729   // 8x8 ground GFX
730   ROM_REGION( 0x400000, REGION_GFX8, ROMREGION_DISPOSE )
731   ROM_LOAD( "lo3_05a", 0x00000, 0x10000, CRC(5b6f4c8e) SHA1(fc8b2c929c60fb0177ed3e407e3f0aacc5df8401) )
732   ROM_LOAD( "lo3_06a", 0x10000, 0x10000, CRC(f6b6ebdd) SHA1(30e92da3bf83c4bb30faf00cbf01664b993f137c) )
733   ROM_LOAD( "lo3_07a", 0x20000, 0x10000, CRC(cebc50e1) SHA1(f8b06ce576c3d41b0a8e2cc3ac60d3515d434812) )
733   ROM_LOAD( "lo5_31a.79", 0xc0000, 0x8000, CRC(d3595292) SHA1(9c45be919296626796b07f70b871fba5d444dbb3) )
734   ROM_LOAD( "lo5_23a.51", 0xc8000, 0x8000, CRC(1487895b) SHA1(9d617f37932ca17d902307a97d16cf3b4bb5bc4e) )
735   ROM_LOAD( "lo5_11a.73", 0xd0000, 0x8000, CRC(9df0b287) SHA1(6ea3b32a7826186c854cc079711ddea4ebf2ab7c) )
736   ROM_LOAD( "lo5_03a.17", 0xd8000, 0x8000, CRC(7aca5d83) SHA1(95456b6c5adc5b776fbd33fd95cc62d4a83c34b6) )
737   ROM_LOAD( "lo5_27a.65", 0xe0000, 0x8000, CRC(119ff70a) SHA1(e64d41bc7822c9e99fd025b771551a6c511d13f2) )
738   ROM_LOAD( "lo5_19a.35", 0xe8000, 0x8000, CRC(5aaa6a53) SHA1(f8ff547979883ac9a969e76d90d028ec4286ec4c) )
739   ROM_LOAD( "lo5_07a.45", 0xf0000, 0x8000, CRC(313f127f) SHA1(0782b8dd5f3a3384c3e7bc9cacaadf6804e06a38) )
740   ROM_LOAD( "lo5_15a.23", 0xf8000, 0x8000, CRC(66f9c5db) SHA1(cc68da9312ee0a3441b62d14107e1b7de9b04de3) )
734741
735   // Object chunk LUTs
736   ROM_REGION( 0x30000, REGION_USER1, 0 )
737   ROM_LOAD16_BYTE( "lo4_04a", 0x00000, 0x10000, CRC(098f4151) SHA1(cf38e3c5f3442fbfa97870d25f7c89c465f847a9) )
738   ROM_LOAD16_BYTE( "lo4_05a", 0x00001, 0x10000, CRC(3b21667c) SHA1(b8337f733ede35145602ee3f0de25c2d4db1b2a5) )
742   /* Object LUTs */
743   ROM_REGION( 0x10000, REGION_USER1, 0 )
744   ROM_LOAD( "lo4_02.109", 0x0000, 0x8000, CRC(0832edde) SHA1(77f9efbe029773417dbc3836a36687e37b5bee4b) )
745   ROM_LOAD( "lo4_03.108", 0x8000, 0x8000, CRC(1efac891) SHA1(faf305a30cab1c6bf8a9d6e2682b2c3745aec956) )
739746
740   // Object LUTs
741   ROM_REGION( 0x30000, REGION_USER2, 0 )
742   ROM_LOAD( "lo4_02",  0x0000, 0x8000, CRC(0832edde) SHA1(77f9efbe029773417dbc3836a36687e37b5bee4b) )
743   ROM_LOAD( "lo4_03",  0x8000, 0x8000, CRC(1efac891) SHA1(faf305a30cab1c6bf8a9d6e2682b2c3745aec956) )
747   /* Object chunk LUTs */
748   ROM_REGION16_LE( 0x20000, REGION_USER2, 0 )
749   ROM_LOAD16_BYTE( "lo4_04a.119", 0x00000, 0x10000, CRC(098f4151) SHA1(cf38e3c5f3442fbfa97870d25f7c89c465f847a9) )
750   ROM_LOAD16_BYTE( "lo4_05a.118", 0x00001, 0x10000, CRC(3b21667c) SHA1(b8337f733ede35145602ee3f0de25c2d4db1b2a5) )
744751
745   // Ground LUTs
746   ROM_REGION( 0x30000, REGION_USER3, 0 )
747   ROM_LOAD( "lo3_08",  0x00000, 0x10000, CRC(f418cecd) SHA1(6cf2d13c9df86bad9c24609cb8387e817b5d4281) )
748   ROM_LOAD( "lo3_09",  0x10000, 0x10000, CRC(3c245568) SHA1(9ff6a23d83627f55c9d4f68e0bd89927bfe10664) )
749   ROM_LOAD( "lo3_04a", 0x00000, 0x10000, CRC(80b67ba9) SHA1(fdbef463b26cd13c43596310f585432c6e0896d0) )
752   /* Colour PROMs */
753   ROM_REGION( 0x1800, REGION_PROMS, 0 )
754   ROM_LOAD( "lo1a.5", 0x000, 0x400, CRC(82391f30) SHA1(d7153c1f3a3e54de4d4d6f432fbcd66449b96b6e) )
755   ROM_LOAD( "lo2a.2", 0x400, 0x400, CRC(2bfc6288) SHA1(03d293ddc0c614b606be823826a4375b3d35901f) )
750756
751   // Scene tiles CLUT
752   ROM_REGION( 0x10000, REGION_USER4, 0 )
753   ROM_LOAD( "lo3_13a", 0x0000, 0x10000, CRC(e44774a7) SHA1(010d95ea497690ddd2406b8fef1b0aee375a165e) )
754
755   // Colour PROMs
756   ROM_REGION( 0x1000, REGION_PROMS, 0 )
757   ROM_LOAD( "lo1a", 0x400,  0x400, CRC(82391f30) SHA1(d7153c1f3a3e54de4d4d6f432fbcd66449b96b6e) )
758   ROM_LOAD( "lo2a", 0x000,  0x400, CRC(2bfc6288) SHA1(03d293ddc0c614b606be823826a4375b3d35901f) )
757   /* Object scale PROMs */
758   ROM_LOAD_NIB_LOW ( "lo_3.69", 0x800, 0x800, CRC(9d9c41a9) SHA1(aabeefe95274f10400b4b7810ea50afcc4f19fde) )
759   ROM_LOAD_NIB_HIGH( "lo_4.68", 0x800, 0x800, CRC(ca4874ef) SHA1(c742f79729b0dc4d227379e9109c7ed21b4c38bb) )
759760ROM_END
760761
761GAME( 1986, lockon, 0, lockon, lockon, 0, ROT0, "Tatsumi", "Lock-On", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS )
762762
763/*************************************
764 *
765 *  Game driver(s)
766 *
767 *************************************/
768
769GAME( 1986, lockon,  0,      lockon,  lockon,  0, ROT0, "Tatsumi", "Lock-On (rev. E)", 0 )
770GAME( 1986, lockonc, lockon, lockon,  lockone, 0, ROT0, "Tatsumi", "Lock-On (rev. C)", 0 )
src/mame/drivers/mappy.c
r1649r1650
547547***************************************************************************/
548548
549549#include "driver.h"
550#include "deprecat.h"
550551#include "machine/namcoio.h"
551552#include "sound/dac.h"
552553#include "sound/namco.h"
src/mame/drivers/rastan.c
r1649r1650
159159***************************************************************************/
160160
161161#include "driver.h"
162#include "deprecat.h"
162163#include "taitoipt.h"
163164#include "video/taitoic.h"
164165#include "audio/taitosnd.h"
src/mame/drivers/pntnpuzl.c
r1649r1650
121121*/
122122
123123#include "driver.h"
124#include "deprecat.h"
124125#include "machine/eeprom.h"
125126
126127
src/mame/drivers/gijoe.c
r1649r1650
3737***************************************************************************/
3838
3939#include "driver.h"
40#include "deprecat.h"
4041#include "video/konamiic.h"
4142#include "cpu/z80/z80.h"
4243#include "machine/eeprom.h"
src/mame/drivers/uapce.c
r1649r1650
2424*/
2525
2626#include "driver.h"
27#include "deprecat.h"
2728#include "machine/pcecommn.h"
2829#include "video/vdc.h"
2930#include "cpu/h6280/h6280.h"
src/mame/drivers/tigeroad.c
r1649r1650
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "cpu/z80/z80.h"
2425#include "sound/2203intf.h"
2526#include "sound/msm5205.h"
src/mame/drivers/wilytowr.c
r1649r1650
2222***************************************************************************/
2323
2424#include "driver.h"
25#include "deprecat.h"
2526#include "cpu/i8039/i8039.h"
2627#include "sound/ay8910.h"
2728#include "sound/samples.h"
src/mame/drivers/spaceg.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/z80/z80.h"
34#include "sound/dac.h"
45#include "sound/sn76496.h"
src/mame/drivers/looping.c
r1649r1650
5252*/
5353
5454#include "driver.h"
55#include "deprecat.h"
5556#include "sound/ay8910.h"
5657#include "sound/dac.h"
5758#include "sound/5220intf.h"
src/mame/drivers/segas32.c
r1649r1650
292292***************************************************************************/
293293
294294#include "driver.h"
295#include "deprecat.h"
295296#include "rendlay.h"
296297#include "segas32.h"
297298#include "machine/eeprom.h"
src/mame/drivers/slapfght.c
r1649r1650
16761676}
16771677
16781678
1679/*   ( YEAR  NAME      PARENT    MACHINE   INPUT     INIT    MONITOR COMPANY    FULLNAME     FLAGS ) */
1680GAME( 1985, perfrman, 0,        perfrman, perfrman, 0,        ROT270, "[Toaplan] Data East Corporation","Performan (Japan)", 0 )
1681GAME( 1985, perfrmau, perfrman, perfrman, perfrman, 0,        ROT270, "[Toaplan] Data East USA",        "Performan (US)", 0 )
1679/*   ( YEAR  NAME      PARENT    MACHINE   INPUT     INIT    MONITOR  COMPANY    FULLNAME     FLAGS ) */
1680GAME( 1985, perfrman, 0,        perfrman, perfrman, 0,        ROT270, "[Toaplan] Data East Corporation", "Performan (Japan)", 0 )
1681GAME( 1985, perfrmau, perfrman, perfrman, perfrman, 0,        ROT270, "[Toaplan] Data East USA",         "Performan (US)", 0 )
16821682GAME( 1985, tigerh,   0,        tigerh,   tigerh,   tigerh,   ROT270, "Taito America Corp.", "Tiger Heli (US)", GAME_NO_COCKTAIL )
1683GAME( 1985, tigerh2,  tigerh,   tigerh,   tigerh,   tigerh,   ROT270, "Taito Corp.",         "Tiger Heli (Japan set 1)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1684GAME( 1985, tigerhj,  tigerh,   tigerh,   tigerh,   tigerh,   ROT270, "Taito Corp.",         "Tiger Heli (Japan set 2)", GAME_NO_COCKTAIL )
1685GAME( 1985, tigerhb1, tigerh,   tigerhb,  tigerh,   0,        ROT270, "bootleg",             "Tiger Heli (bootleg set 1)", 0 )
1686GAME( 1985, tigerhb2, tigerh,    tigerhb,  tigerh,   0,        ROT270, "bootleg",             "Tiger Heli (bootleg set 2)", GAME_NO_COCKTAIL )
1687GAME( 1986, slapfigh, 0,        slapfigh, slapfigh, slapfigh, ROT270, "Taito",    "Slap Fight (set 1)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1688GAME( 1986, slapfiga, slapfigh, slapfigh, slapfigh, slapfigh,  ROT270, "Taito",    "Slap Fight (set 2)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1689GAME( 1986, slapbtjp, slapfigh, slapfigh, slapfigh, 0,        ROT270, "bootleg",  "Slap Fight (Japan bootleg)", GAME_NO_COCKTAIL )
1690GAME( 1986, slapbtuk, slapfigh, slapbtuk, slapfigh, 0,        ROT270, "bootleg",  "Slap Fight (English bootleg)", GAME_NO_COCKTAIL )
1691GAME( 1986, slapfgtr, slapfigh, slapbtuk, slapfigh, 0,        ROT270, "bootleg",  "Slap Fight (bootleg)", GAME_NO_COCKTAIL ) // PCB labeled 'slap fighter'
1692GAME( 1986, alcon,    slapfigh, slapfigh, slapfigh, slapfigh, ROT270, "Taito America Corp.","Alcon", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1693GAME( 1986, getstar,  0,        slapfigh, getstar,  getstar,  ROT0,   "Taito",  "Guardian", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1694GAME( 1986, getstarj, getstar,  slapfigh, getstar,  getstar,  ROT0,   "Taito",  "Get Star (Japan)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1695GAME( 1986, getstarb, getstar,  slapfigh, getstar,  getstarb, ROT0,   "bootleg","Get Star (bootleg, set 1)", GAME_NO_COCKTAIL )
1696GAME( 1986, gtstarba, getstar,  slapfigh, gtstarba, gtstarba, ROT0,   "bootleg","Get Star (bootleg, set 2)", GAME_NO_COCKTAIL )
1683GAME( 1985, tigerh2,  tigerh,   tigerh,   tigerh,   tigerh,   ROT270, "Taito",   "Tiger Heli (Japan set 1)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1684GAME( 1985, tigerhj,  tigerh,   tigerh,   tigerh,   tigerh,   ROT270, "Taito",   "Tiger Heli (Japan set 2)", GAME_NO_COCKTAIL )
1685GAME( 1985, tigerhb1, tigerh,   tigerhb,  tigerh,   0,        ROT270, "bootleg", "Tiger Heli (bootleg set 1)", 0 )
1686GAME( 1985, tigerhb2, tigerh,    tigerhb,  tigerh,   0,        ROT270, "bootleg", "Tiger Heli (bootleg set 2)", GAME_NO_COCKTAIL )
1687GAME( 1986, slapfigh, 0,        slapfigh, slapfigh, slapfigh, ROT270, "Taito",   "Slap Fight (set 1)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1688GAME( 1986, slapfiga, slapfigh, slapfigh, slapfigh, slapfigh, ROT270, "Taito",   "Slap Fight (set 2)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1689GAME( 1986, slapbtjp, slapfigh, slapfigh, slapfigh, 0,        ROT270, "bootleg", "Slap Fight (Japan bootleg)", GAME_NO_COCKTAIL )
1690GAME( 1986, slapbtuk, slapfigh, slapbtuk, slapfigh, 0,        ROT270, "bootleg", "Slap Fight (English bootleg)", GAME_NO_COCKTAIL )
1691GAME( 1986, slapfgtr, slapfigh, slapbtuk, slapfigh, 0,        ROT270, "bootleg", "Slap Fight (bootleg)", GAME_NO_COCKTAIL ) // PCB labeled 'slap fighter'
1692GAME( 1986, alcon,    slapfigh, slapfigh, slapfigh, slapfigh, ROT270, "Taito America Corp.", "Alcon", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1693GAME( 1986, getstar,  0,        slapfigh, getstar,  getstar,  ROT0,   "Taito",   "Guardian", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1694GAME( 1986, getstarj, getstar,  slapfigh, getstar,  getstar,  ROT0,   "Taito",   "Get Star (Japan)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1695GAME( 1986, getstarb, getstar,  slapfigh, getstar,  getstarb, ROT0,   "bootleg", "Get Star (bootleg set 1)", GAME_NO_COCKTAIL )
1696GAME( 1986, gtstarba, getstar,  slapfigh, gtstarba, gtstarba, ROT0,   "bootleg", "Get Star (bootleg set 2)", GAME_NO_COCKTAIL )
src/mame/drivers/psikyosh.c
r1649r1650
270270*/
271271
272272#include "driver.h"
273#include "deprecat.h"
273274
274275#include "cpu/sh2/sh2.h"
275276#include "machine/eeprom.h"
src/mame/drivers/boogwing.c
r1649r1650
7575*/
7676
7777#include "driver.h"
78#include "deprecat.h"
7879#include "cpu/m68000/m68000.h"
7980#include "cpu/h6280/h6280.h"
8081#include "decocrpt.h"
src/mame/drivers/supertnk.c
r1649r1650
9696
9797
9898#include "driver.h"
99#include "deprecat.h"
99100#include "sound/ay8910.h"
100101
101102
src/mame/drivers/darkhors.c
r1649r1650
5555***************************************************************************/
5656
5757#include "driver.h"
58#include "deprecat.h"
5859#include "machine/eeprom.h"
5960#include "sound/okim6295.h"
6061
src/mame/drivers/bishjan.c
r1649r1650
4646*********************************************************************************************************************/
4747
4848#include "driver.h"
49#include "deprecat.h"
4950#include "cpu/h83002/h83002.h"
5051
5152#define BISHJAN_DEBUG   0
r1649r1650
439440}
440441
441442static MACHINE_DRIVER_START( bishjan )
442   MDRV_CPU_ADD(H83002, 44100000/3)
443   MDRV_CPU_ADD(H83044, 44100000/3)
443444   MDRV_CPU_PROGRAM_MAP( bishjan_map, 0 )
444445   MDRV_CPU_VBLANK_INT(bishjan_interrupt,2)
445446
src/mame/drivers/offtwall.c
r1649r1650
1818
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/atarigen.h"
2223#include "audio/atarijsa.h"
2324#include "offtwall.h"
src/mame/drivers/equites.c
r1649r1650
130130// Directives
131131
132132#include "driver.h"
133#include "deprecat.h"
133134
134135#define HVOLTAGE_HACK   0
135136#define EASY_TEST_MODE   1
r1649r1650
141142// Imports
142143
143144// Common Hardware Start
144#define EQUITES_ADD_SOUNDBOARD7 \
145   MDRV_CPU_ADD(8085A, XTAL_6_144MHz) /* verified on pcb */ \
146   /* audio CPU */ \
147   MDRV_CPU_PROGRAM_MAP(equites_s_readmem, equites_s_writemem) \
148   MDRV_CPU_IO_MAP(0, equites_s_writeport) \
149   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 4000) \
150   MDRV_SPEAKER_STANDARD_MONO("mono") \
151   \
152   MDRV_SOUND_ADD(MSM5232, XTAL_6_144MHz/2) \
153/* OSC is connected to a pot which varies the frequency of M5232 from 6.144mhz to few Khz. Here I assume a value which gives a good pitch */ \
154   MDRV_SOUND_CONFIG(equites_5232intf) \
155   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) \
156   \
157   MDRV_SOUND_ADD(AY8910, XTAL_6_144MHz/4) /* verified on pcb */ \
158   MDRV_SOUND_CONFIG(equites_8910intf) \
159   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) \
160   \
161   MDRV_SOUND_ADD(DAC, 0) \
162   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) \
163   \
164   MDRV_SOUND_ADD(DAC, 0) \
165   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) \
166
167145extern void equites_8404init(void);
168146extern void equites_8404rule(unsigned pc, int offset, int data);
169147
r1649r1650
178156extern struct MSM5232interface equites_5232intf;
179157extern struct AY8910interface equites_8910intf;
180158
181static ADDRESS_MAP_START( equites_s_readmem, ADDRESS_SPACE_PROGRAM, 8 )
182   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM) // sound program
159static ADDRESS_MAP_START( equites_s_map, ADDRESS_SPACE_PROGRAM, 8 )
160   AM_RANGE(0x0000, 0xbfff) AM_ROM
183161   AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r)
184   AM_RANGE(0xe000, 0xe0ff) AM_READ(MRA8_RAM) // stack and variables
185ADDRESS_MAP_END
186
187static ADDRESS_MAP_START( equites_s_writemem, ADDRESS_SPACE_PROGRAM, 8 )
188   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM) // sound program
189162   AM_RANGE(0xc080, 0xc08d) AM_WRITE(equites_5232_w)
190163   AM_RANGE(0xc0a0, 0xc0a0) AM_WRITE(equites_8910data_w)
191164   AM_RANGE(0xc0a1, 0xc0a1) AM_WRITE(equites_8910control_w)
r1649r1650
195168   AM_RANGE(0xc0e0, 0xc0e0) AM_WRITE(equites_dac1_w)
196169   AM_RANGE(0xc0f8, 0xc0fe) AM_WRITE(MWA8_NOP) // soundboard I/O, ignored
197170   AM_RANGE(0xc0ff, 0xc0ff) AM_WRITE(soundlatch_clear_w)
198   AM_RANGE(0xe000, 0xe0ff) AM_WRITE(MWA8_RAM) // stack and variables
171   AM_RANGE(0xe000, 0xe0ff) AM_RAM
199172ADDRESS_MAP_END
200173
201static ADDRESS_MAP_START( equites_s_writeport, ADDRESS_SPACE_IO, 8 )
174static ADDRESS_MAP_START( equites_s_portmap, ADDRESS_SPACE_IO, 8 )
202175   AM_RANGE(0x00e0, 0x00e5) AM_WRITE(MWA8_NOP) // soundboard I/O, ignored
203176ADDRESS_MAP_END
177
178static MACHINE_DRIVER_START( equites_sound )
179
180   /* basic machine hardware */
181   MDRV_CPU_ADD(8085A, XTAL_6_144MHz) /* verified on pcb */
182   MDRV_CPU_PROGRAM_MAP(equites_s_map,0)
183   MDRV_CPU_IO_MAP(equites_s_portmap,0)
184   MDRV_CPU_PERIODIC_INT(nmi_line_pulse,4000)
185
186   /* sound hardware */
187   MDRV_SPEAKER_STANDARD_MONO("mono")
188
189   MDRV_SOUND_ADD(MSM5232, XTAL_6_144MHz/2)
190      /* OSC is connected to a pot which varies the frequency of M5232
191           from 6.144mhz to few Khz. Here I assume a value which gives a good pitch */
192   MDRV_SOUND_CONFIG(equites_5232intf)
193   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
194
195   MDRV_SOUND_ADD(AY8910, XTAL_6_144MHz/4) /* verified on pcb */
196   MDRV_SOUND_CONFIG(equites_8910intf)
197   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
198
199   MDRV_SOUND_ADD(DAC, 0)
200   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
201
202   MDRV_SOUND_ADD(DAC, 0)
203   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
204MACHINE_DRIVER_END
205
204206// Common Hardware End
205207
206208// Equites Hardware
r1649r1650
326328// Main CPU Memory Map
327329
328330// Equites Hardware
329static ADDRESS_MAP_START( equites_readmem, ADDRESS_SPACE_PROGRAM, 16 )
330   AM_RANGE(0x000000, 0x00ffff) AM_READ(MRA16_ROM) // main program
331   AM_RANGE(0x040000, 0x040fff) AM_READ(MRA16_RAM) // work RAM
332   AM_RANGE(0x080000, 0x080fff) AM_READ(MRA16_RAM) // char RAM
333   AM_RANGE(0x0c0000, 0x0c0fff) AM_READ(MRA16_RAM) // scroll RAM
334   AM_RANGE(0x100000, 0x100fff) AM_READ(equites_spriteram_r) // sprite RAM
335   AM_RANGE(0x140000, 0x1407ff) AM_READ(equites_8404_r) // 8404 RAM
336   AM_RANGE(0x180000, 0x180001) AM_READ(input_port_1_word_r) // MSB: DIP switches
337   AM_RANGE(0x1c0000, 0x1c0001) AM_READ(equites_joyport_r) // joyport[2211] (shares the same addr with scrollreg)
338ADDRESS_MAP_END
339
340static ADDRESS_MAP_START( equites_writemem, ADDRESS_SPACE_PROGRAM, 16 )
341   AM_RANGE(0x000000, 0x00ffff) AM_WRITE(MWA16_NOP) // ROM area is written several times (dev system?)
342   AM_RANGE(0x040000, 0x040fff) AM_WRITE(MWA16_RAM) AM_BASE(&equites_workram)
343   AM_RANGE(0x080000, 0x080fff) AM_WRITE(equites_charram_w) AM_BASE(&videoram16)
344   AM_RANGE(0x0c0000, 0x0c0fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16_2)
345   AM_RANGE(0x100000, 0x100fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
346   AM_RANGE(0x140000, 0x1407ff) AM_WRITE(MWA16_RAM) AM_BASE(&equites_8404ram)
347   AM_RANGE(0x180000, 0x180001) AM_WRITE(soundlatch_word_w) // LSB: sound latch
331static ADDRESS_MAP_START( equites_map, ADDRESS_SPACE_PROGRAM, 16 )
332   AM_RANGE(0x000000, 0x00ffff) AM_ROM AM_WRITENOP // ROM area is written several times (dev system?)
333   AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&equites_workram)
334   AM_RANGE(0x080000, 0x080fff) AM_READWRITE(MRA16_RAM, equites_charram_w) AM_BASE(&videoram16)
335   AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM AM_BASE(&spriteram16_2)
336   AM_RANGE(0x100000, 0x100fff) AM_READWRITE(equites_spriteram_r, MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
337   AM_RANGE(0x140000, 0x1407ff) AM_READWRITE(equites_8404_r, MWA16_RAM) AM_BASE(&equites_8404ram)
338   AM_RANGE(0x180000, 0x180001) AM_READWRITE(input_port_1_word_r, soundlatch_word_w) // LSB: sound latch
348339   AM_RANGE(0x184000, 0x184001) AM_WRITE(equites_flip0_w) // [MMLL] MM: normal screen, LL: use joystick 1 only
349340   AM_RANGE(0x188000, 0x188001) AM_WRITE(MWA16_NOP) // 8404 control port1
350341   AM_RANGE(0x18c000, 0x18c001) AM_WRITE(MWA16_NOP) // 8404 control port2
351342   AM_RANGE(0x1a4000, 0x1a4001) AM_WRITE(equites_flip1_w) // [MMLL] MM: flip screen, LL: use both joysticks
352343   AM_RANGE(0x1a8000, 0x1a8001) AM_WRITE(MWA16_NOP) // 8404 control port3
353344   AM_RANGE(0x1ac000, 0x1ac001) AM_WRITE(MWA16_NOP) // 8404 control port4
354   AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(equites_scrollreg_w) // scroll register[XXYY]
345   AM_RANGE(0x1c0000, 0x1c0001) AM_READWRITE(equites_joyport_r, equites_scrollreg_w) // scroll register[XXYY]
355346   AM_RANGE(0x380000, 0x380001) AM_WRITE(equites_bgcolor_w) // bg color register[CC--]
356347   AM_RANGE(0x780000, 0x780001) AM_WRITE(MWA16_NOP) // watchdog
357348ADDRESS_MAP_END
358349
359350// Splendor Blast Hardware
360static ADDRESS_MAP_START( splndrbt_readmem, ADDRESS_SPACE_PROGRAM, 16 )
361   AM_RANGE(0x000000, 0x00ffff) AM_READ(MRA16_ROM) // main program
362   AM_RANGE(0x040000, 0x040fff) AM_READ(MRA16_RAM) // work RAM
351static ADDRESS_MAP_START( splndrbt_map, ADDRESS_SPACE_PROGRAM, 16 )
352   AM_RANGE(0x000000, 0x00ffff) AM_ROM
353   AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&equites_workram) // work RAM
363354   AM_RANGE(0x080000, 0x080001) AM_READ(input_port_0_word_r) // joyport [2211]
364   AM_RANGE(0x0c0000, 0x0c0001) AM_READ(input_port_1_word_r) // MSB: DIP switches LSB: not used
365   AM_RANGE(0x100000, 0x100001) AM_READ(MRA16_RAM) // no read
366   AM_RANGE(0x1c0000, 0x1c0001) AM_READ(MRA16_RAM) // LSB: watchdog
367   AM_RANGE(0x180000, 0x1807ff) AM_READ(equites_8404_r) // 8404 RAM
368   AM_RANGE(0x200000, 0x200fff) AM_READ(MRA16_RAM) // char page 0
369   AM_RANGE(0x201000, 0x201fff) AM_READ(splndrbt_bankedchar_r) // banked char page 1, 2
370   AM_RANGE(0x400000, 0x400fff) AM_READ(MRA16_RAM) // scroll RAM 0,1
371   AM_RANGE(0x600000, 0x6001ff) AM_READ(MRA16_RAM) // sprite RAM 0,1,2
372ADDRESS_MAP_END
373
374static ADDRESS_MAP_START( splndrbt_writemem, ADDRESS_SPACE_PROGRAM, 16 )
375   AM_RANGE(0x000000, 0x00ffff) AM_WRITE(MWA16_NOP)
376   AM_RANGE(0x040000, 0x040fff) AM_WRITE(MWA16_RAM) AM_BASE(&equites_workram) // work RAM
377   AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(splndrbt_flip0_w) // [MMLL] MM: bg color register, LL: normal screen
355   AM_RANGE(0x0c0000, 0x0c0001) AM_READWRITE(input_port_1_word_r, splndrbt_flip0_w) // [MMLL] MM: bg color register, LL: normal screen
378356   AM_RANGE(0x0c4000, 0x0c4001) AM_WRITE(MWA16_NOP) // 8404 control port1
379357   AM_RANGE(0x0c8000, 0x0c8001) AM_WRITE(MWA16_NOP) // 8404 control port2
380358   AM_RANGE(0x0cc000, 0x0cc001) AM_WRITE(splndrbt_selchar0_w) // select active char map
r1649r1650
382360   AM_RANGE(0x0e4000, 0x0e4001) AM_WRITE(MWA16_NOP) // 8404 control port3
383361   AM_RANGE(0x0e8000, 0x0e8001) AM_WRITE(MWA16_NOP) // 8404 control port4
384362   AM_RANGE(0x0ec000, 0x0ec001) AM_WRITE(splndrbt_selchar1_w) // select active char map
385   AM_RANGE(0x100000, 0x100001) AM_WRITE(MWA16_RAM) AM_BASE(&splndrbt_scrollx) // scrollx
363   AM_RANGE(0x100000, 0x100001) AM_RAM AM_BASE(&splndrbt_scrollx) // scrollx
386364   AM_RANGE(0x140000, 0x140001) AM_WRITE(soundlatch_word_w) // LSB: sound command
387   AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(MWA16_RAM) AM_BASE(&splndrbt_scrolly) // scrolly
388   AM_RANGE(0x180000, 0x1807ff) AM_WRITE(MWA16_RAM) AM_BASE(&equites_8404ram) // 8404 RAM
389   AM_RANGE(0x200000, 0x200fff) AM_WRITE(splndrbt_charram_w) AM_BASE(&videoram16) AM_SIZE(&videoram_size) // char RAM page 0
390   AM_RANGE(0x201000, 0x201fff) AM_WRITE(splndrbt_bankedchar_w) // banked char RAM page 1,2
391   AM_RANGE(0x400000, 0x400fff) AM_WRITE(splndrbt_scrollram_w) AM_BASE(&spriteram16_2) // scroll RAM 0,1
392   AM_RANGE(0x600000, 0x6001ff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // sprite RAM 0,1,2
365   AM_RANGE(0x1c0000, 0x1c0001) AM_RAM AM_BASE(&splndrbt_scrolly) // scrolly
366   AM_RANGE(0x180000, 0x1807ff) AM_READWRITE(equites_8404_r, MWA16_RAM) AM_BASE(&equites_8404ram) // 8404 RAM
367   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(MRA16_RAM, splndrbt_charram_w) AM_BASE(&videoram16) AM_SIZE(&videoram_size) // char RAM page 0
368   AM_RANGE(0x201000, 0x201fff) AM_READWRITE(splndrbt_bankedchar_r, splndrbt_bankedchar_w) // banked char RAM page 1,2
369   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, splndrbt_scrollram_w) AM_BASE(&spriteram16_2) // scroll RAM 0,1
370   AM_RANGE(0x600000, 0x6001ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // sprite RAM 0,1,2
393371ADDRESS_MAP_END
394372
395373/******************************************************************************/
r1649r1650
687665
688666   /* basic machine hardware */
689667   MDRV_CPU_ADD(M68000, XTAL_12MHz/4) /* 68000P8 running at 3mhz! verified on pcb */
690   MDRV_CPU_PROGRAM_MAP(equites_readmem, equites_writemem)
668   MDRV_CPU_PROGRAM_MAP(equites_map,0)
691669   MDRV_CPU_VBLANK_INT(equites_interrupt, 2)
692670
693671   MDRV_SCREEN_REFRESH_RATE(60)
r1649r1650
706684   MDRV_VIDEO_UPDATE(equites)
707685
708686   /* sound hardware */
709   EQUITES_ADD_SOUNDBOARD7
687   MDRV_IMPORT_FROM(equites_sound)
710688
711689MACHINE_DRIVER_END
712690
r1649r1650
714692
715693   /* basic machine hardware */
716694   MDRV_CPU_ADD(M68000, XTAL_24MHz/4) /* 68000P8 running at 6mhz, verified on pcb */
717   MDRV_CPU_PROGRAM_MAP(splndrbt_readmem, splndrbt_writemem)
695   MDRV_CPU_PROGRAM_MAP(splndrbt_map, 0)
718696   MDRV_CPU_VBLANK_INT(splndrbt_interrupt, 2)
719697
720698   MDRV_SCREEN_REFRESH_RATE(60)
r1649r1650
734712   MDRV_VIDEO_UPDATE(splndrbt)
735713
736714   /* sound hardware */
737   EQUITES_ADD_SOUNDBOARD7
715   MDRV_IMPORT_FROM(equites_sound)
738716
739717MACHINE_DRIVER_END
740718
src/mame/drivers/esh.c
r1649r1650
2323*/
2424
2525#include "driver.h"
26#include "render.h"
26#include "deprecat.h"
2727#include "machine/laserdsc.h"
2828
2929/* From daphne */
r1649r1650
373373}
374374
375375/*    YEAR  NAME  PARENT   MACHINE  INPUT  INIT  MONITOR  COMPANY          FULLNAME                     FLAGS) */
376GAME( 1983, esh,  0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla",         GAME_NOT_WORKING|GAME_NO_SOUND)
376GAME( 1983, esh,  0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (set 1)",  GAME_NOT_WORKING|GAME_NO_SOUND)
377377GAME( 1983, esha, 0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (Set 2)",  GAME_NOT_WORKING|GAME_NO_SOUND)
378378GAME( 1983, eshb, 0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (Set 3)",  GAME_NOT_WORKING|GAME_NO_SOUND)
src/mame/drivers/neodrvr.c
r1649r1650
71277127
71287128
71297129
7130/*     YEAR  NAME      PARENT    BIOS    MACHINE   INPUT    INIT      MONITOR  */
7131GAME( 1990, neogeo, 0, neogeo, neogeo, neogeo, ROT0, "SNK", "Neo-Geo", GAME_IS_BIOS_ROOT )
7130/*    YEAR  NAME      PARENT    MACHINE   INPUT     INIT      MONITOR  */
7131GAME( 1990, neogeo,   0,        neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Neo-Geo", GAME_IS_BIOS_ROOT )
71327132
71337133/* SNK */
7134GAME( 1990, nam1975,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "NAM-1975", 0 )
7135GAME( 1990, bstars,   neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Baseball Stars Professional", 0 )
7136GAME( 1990, tpgolf,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Top Player's Golf", 0 )
7137GAME( 1990, mahretsu, neogeo, neogeo, mjneogeo,neogeo,   ROT0, "SNK", "Mahjong Kyoretsuden", 0 )
7138GAME( 1990, ridhero,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Riding Hero (set 1)", 0 )
7139GAME( 1990, ridheroh, ridhero, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Riding Hero (set 2)", 0 )
7140GAME( 1991, alpham2,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Alpha Mission II / ASO II - Last Guardian", 0 )
7141GAME( 1990, cyberlip, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Cyber-Lip", 0 )
7142GAME( 1990, superspy, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The Super Spy", 0 )
7143GAME( 1992, mutnat,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Mutation Nation", 0 )
7144GAME( 1991, kotm,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters (set 1)", 0 )
7145GAME( 1991, kotmh,    kotm, neogeo, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters (set 2)", 0 )
7146GAME( 1991, sengoku,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Sengoku / Sengoku Denshou (set 1)", 0 )
7147GAME( 1991, sengokh,  sengoku, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Sengoku / Sengoku Denshou (set 2)", 0 )
7148GAME( 1991, burningf, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Burning Fight (set 1)", 0 )
7149GAME( 1991, burningh, burningf, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Burning Fight (set 2)", 0 )
7150GAME( 1990, lbowling, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "League Bowling", 0 )
7151GAME( 1991, gpilots,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Ghost Pilots", 0 )
7152GAME( 1990, joyjoy,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Puzzled / Joy Joy Kid", 0 )
7153GAME( 1991, quizdais, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Quiz Daisousa Sen - The Last Count Down", 0 )
7154GAME( 1992, lresort,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Last Resort", 0 )
7155GAME( 1991, eightman, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK / Pallas", "Eight Man", 0 )
7156GAME( 1991, legendos, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Legend of Success Joe / Ashitano Joe Densetsu", 0 )
7157GAME( 1991, 2020bb,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 1)", 0 )
7158GAME( 1991, 2020bba,  2020bb, neogeo, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 2)", 0 )
7159GAME( 1991, 2020bbh,  2020bb, neogeo, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 3)", 0 )
7160GAME( 1991, socbrawl, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Soccer Brawl (set 1)", 0 )
7161GAME( 1991, socbrala, socbrawl, neogeo, neogeo,  neogeo, ROT0, "SNK", "Soccer Brawl (set 2)", 0 )
7162GAME( 1991, fatfury1, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai", 0 )
7163GAME( 1991, roboarmy, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Robo Army (set 1)", 0 )
7164GAME( 1991, roboarma, roboarmy, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Robo Army (set 2)", 0 )
7165GAME( 1992, fbfrenzy, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Football Frenzy", 0 )
7166GAME( 1992, kotm2,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters 2 - The Next Thing", 0 )
7167GAME( 1993, sengoku2, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Sengoku 2 / Sengoku Denshou 2", 0 )
7168GAME( 1992, bstars2,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Baseball Stars 2", 0 )
7169GAME( 1992, quizdai2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Quiz Meitantei Neo & Geo - Quiz Daisousa Sen part 2", 0 )
7170GAME( 1993, 3countb,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "3 Count Bout / Fire Suplex", 0 )
7171GAME( 1992, aof,      neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting / Ryuuko no Ken", 0 )
7172GAME( 1993, samsho,   neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown / Samurai Spirits", 0 )
7173GAME( 1994, tophuntr, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 1)", 0 )
7174GAME( 1994, tophunta, tophuntr, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 2)", 0 )
7175GAME( 1992, fatfury2, neogeo, neogeo,   neogeo,  fatfury2, ROT0, "SNK", "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai", 0 )
7176GAME( 1992, ssideki,  neogeo, neogeo, neogeo,  fatfury2, ROT0, "SNK", "Super Sidekicks / Tokuten Ou", 0 )
7177GAME( 1994, kof94,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '94", 0 )
7178GAME( 1994, aof2,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 1)", 0 )
7179GAME( 1994, aof2a,    aof2, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 2)", 0 )
7180GAME( 1993, fatfursp, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 1)", 0 )
7181GAME( 1993, fatfursa, fatfursp, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 2)", 0 )
7182GAME( 1995, savagere, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Savage Reign / Fu'un Mokushiroku - kakutou sousei", 0 )
7183GAME( 1994, ssideki2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Super Sidekicks 2 - The World Championship / Tokuten Ou 2 - real fight football", 0 )
7184GAME( 1994, samsho2,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen", 0 )
7134GAME( 1990, nam1975,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "NAM-1975", 0 )
7135GAME( 1990, bstars,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Baseball Stars Professional", 0 )
7136GAME( 1990, tpgolf,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Top Player's Golf", 0 )
7137GAME( 1990, mahretsu, neogeo,   neogeo,   mjneogeo, neogeo,   ROT0, "SNK", "Mahjong Kyoretsuden", 0 )
7138GAME( 1990, ridhero,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Riding Hero (set 1)", 0 )
7139GAME( 1990, ridheroh, ridhero,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Riding Hero (set 2)", 0 )
7140GAME( 1991, alpham2,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Alpha Mission II / ASO II - Last Guardian", 0 )
7141GAME( 1990, cyberlip, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Cyber-Lip", 0 )
7142GAME( 1990, superspy, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The Super Spy", 0 )
7143GAME( 1992, mutnat,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Mutation Nation", 0 )
7144GAME( 1991, kotm,     neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "King of the Monsters (set 1)", 0 )
7145GAME( 1991, kotmh,    kotm,     neogeo,   neogeo,   neogeo,   ROT0, "SNK", "King of the Monsters (set 2)", 0 )
7146GAME( 1991, sengoku,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Sengoku / Sengoku Denshou (set 1)", 0 )
7147GAME( 1991, sengokh,  sengoku,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Sengoku / Sengoku Denshou (set 2)", 0 )
7148GAME( 1991, burningf, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Burning Fight (set 1)", 0 )
7149GAME( 1991, burningh, burningf, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Burning Fight (set 2)", 0 )
7150GAME( 1990, lbowling, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "League Bowling", 0 )
7151GAME( 1991, gpilots,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Ghost Pilots", 0 )
7152GAME( 1990, joyjoy,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Puzzled / Joy Joy Kid", 0 )
7153GAME( 1991, quizdais, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Quiz Daisousa Sen - The Last Count Down", 0 )
7154GAME( 1992, lresort,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Last Resort", 0 )
7155GAME( 1991, eightman, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK / Pallas", "Eight Man", 0 )
7156GAME( 1991, legendos, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Legend of Success Joe / Ashitano Joe Densetsu", 0 )
7157GAME( 1991, 2020bb,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 1)", 0 )
7158GAME( 1991, 2020bba,  2020bb,   neogeo,   neogeo,   neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 2)", 0 )
7159GAME( 1991, 2020bbh,  2020bb,   neogeo,   neogeo,   neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 3)", 0 )
7160GAME( 1991, socbrawl, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Soccer Brawl (set 1)", 0 )
7161GAME( 1991, socbrala, socbrawl, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Soccer Brawl (set 2)", 0 )
7162GAME( 1991, fatfury1, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai", 0 )
7163GAME( 1991, roboarmy, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Robo Army (set 1)", 0 )
7164GAME( 1991, roboarma, roboarmy, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Robo Army (set 2)", 0 )
7165GAME( 1992, fbfrenzy, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Football Frenzy", 0 )
7166GAME( 1992, kotm2,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "King of the Monsters 2 - The Next Thing", 0 )
7167GAME( 1993, sengoku2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Sengoku 2 / Sengoku Denshou 2", 0 )
7168GAME( 1992, bstars2,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Baseball Stars 2", 0 )
7169GAME( 1992, quizdai2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Quiz Meitantei Neo & Geo - Quiz Daisousa Sen part 2", 0 )
7170GAME( 1993, 3countb,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "3 Count Bout / Fire Suplex", 0 )
7171GAME( 1992, aof,      neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Art of Fighting / Ryuuko no Ken", 0 )
7172GAME( 1993, samsho,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown / Samurai Spirits", 0 )
7173GAME( 1994, tophuntr, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 1)", 0 )
7174GAME( 1994, tophunta, tophuntr, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 2)", 0 )
7175GAME( 1992, fatfury2, neogeo,   neogeo,   neogeo,   fatfury2, ROT0, "SNK", "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai", 0 )
7176GAME( 1992, ssideki,  neogeo,   neogeo,   neogeo,   fatfury2, ROT0, "SNK", "Super Sidekicks / Tokuten Ou", 0 )
7177GAME( 1994, kof94,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '94", 0 )
7178GAME( 1994, aof2,     neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 1)", 0 )
7179GAME( 1994, aof2a,    aof2,     neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 2)", 0 )
7180GAME( 1993, fatfursp, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 1)", 0 )
7181GAME( 1993, fatfursa, fatfursp, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 2)", 0 )
7182GAME( 1995, savagere, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Savage Reign / Fu'un Mokushiroku - kakutou sousei", 0 )
7183GAME( 1994, ssideki2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Super Sidekicks 2 - The World Championship / Tokuten Ou 2 - real fight football", 0 )
7184GAME( 1994, samsho2,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen", 0 )
71857185/* Jin Saulabi Tu Hon (Samurai shodown 2) - Korean censored version - http://www.kmrb.or.kr/Game_Image/1999/%EC%A0%9C1273%ED%98%B8.jpg */
7186GAME( 1995, fatfury3, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai", 0 )
7187GAME( 1995, ssideki3, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Super Sidekicks 3 - The Next Glory / Tokuten Ou 3 - eikoue no michi", 0 )
7188GAME( 1995, kof95,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 1)", 0 )
7189GAME( 1995, kof95a,   kof95, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 2)", 0 )
7190GAME( 1995, samsho3,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 1)", 0 )
7191GAME( 1995, samsho3a, samsho3, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", 0 )
7192GAME( 1995, fswords,  samsho3, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Fighters Swords (Korean release of Samurai Shodown III)", 0 )
7193GAME( 1995, rbff1,    neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu", 0 )
7194GAME( 1996, aof3,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden", 0 )
7195GAME( 1996, aof3k,    aof3, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior (Korean release)", 0 ) // no Japanese title / mode
7196GAME( 1996, kof96,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 1)", 0 )
7197GAME( 1996, kof96h,   kof96, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 2)", 0 )
7198GAME( 1996, ssideki4, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero, The", 0 )
7199GAME( 1996, kizuna,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle", 0 )
7200GAME( 1996, samsho4,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin", 0 )
7186GAME( 1995, fatfury3, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai", 0 )
7187GAME( 1995, ssideki3, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Super Sidekicks 3 - The Next Glory / Tokuten Ou 3 - eikoue no michi", 0 )
7188GAME( 1995, kof95,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 1)", 0 )
7189GAME( 1995, kof95a,   kof95,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 2)", 0 )
7190GAME( 1995, samsho3,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 1)", 0 )
7191GAME( 1995, samsho3a, samsho3,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", 0 )
7192GAME( 1995, fswords,  samsho3,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fighters Swords (Korean release of Samurai Shodown III)", 0 )
7193GAME( 1995, rbff1,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu", 0 )
7194GAME( 1996, aof3,     neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden", 0 )
7195GAME( 1996, aof3k,    aof3,     neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior (Korean release)", 0 ) // no Japanese title / mode
7196GAME( 1996, kof96,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 1)", 0 )
7197GAME( 1996, kof96h,   kof96,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 2)", 0 )
7198GAME( 1996, ssideki4, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero, The", 0 )
7199GAME( 1996, kizuna,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle", 0 )
7200GAME( 1996, samsho4,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin", 0 )
72017201/* Pae Wang Jeon Seol / Legend of Warrior - Korean / Chinese censored version of SamSho4, see http://www.kmrb.or.kr/Game_Image/1999/%EC%A0%9C2064%ED%98%B8.jpg */
7202GAME( 1996, rbffspec, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special", 0 )
7203GAME( 1997, kof97,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '97 (set 1)", 0 )
7204GAME( 1997, kof97a,   kof97, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '97 (set 2)", 0 )
7205GAME( 1997, kof97pls, kof97, neogeo, neogeo,  neogeo,   ROT0, "bootleg", "The King of Fighters '97 Plus (bootleg)", 0 )
7206GAME( 1997, kog,      kof97, neogeo, kog,     kog,      ROT0, "bootleg", "King of Gladiator (The King of Fighters '97 bootleg)", GAME_NOT_WORKING) // protected bootleg
7207GAME( 1997, lastblad, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 1)", 0 )
7208GAME( 1997, lastbldh, lastblad, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 2)", 0 )
7209GAME( 1997, lastsold, lastblad, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "The Last Soldier (Korean release of The Last Blade)", 0 )
7210GAME( 1997, irrmaze,  neogeo, neogeo, irrmaze, neogeo,   ROT0, "SNK / Saurus", "The Irritating Maze / Ultra Denryu Iraira Bou", 0 )
7211GAME( 1998, rbff2,    neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 1)", 0 )
7212GAME( 1998, rbff2h,   rbff2, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 2)", 0 )
7213GAME( 1998, rbff2k,   rbff2, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers (Korean release)", 0 ) // no Japanese title / mode
7214GAME( 1998, mslug2,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Metal Slug 2 - Super Vehicle-001/II", 0 )
7215GAME( 1998, kof98,    neogeo, neogeo, neogeo,  kof98,    ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends", 0 )
7216GAME( 1998, kof98k,   kof98, neogeo, neogeo,  kof98,    ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board)", 0 )
7217GAME( 1998, kof98n,   kof98, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (not encrypted)", 0 )
7218GAME( 1998, lastbld2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi, The", 0 )
7219GAME( 1998, neocup98, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Neo-Geo Cup '98 - The Road to the Victory", 0 )
7220GAME( 1999, mslugx,   neogeo, neogeo, neogeo,  mslugx,   ROT0, "SNK", "Metal Slug X - Super Vehicle-001", 0 )
7221GAME( 1999, kof99,    neogeo, neogeo, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 1)" , 0 ) /* Encrypted Code & GFX */
7222GAME( 1999, kof99a,   kof99, neogeo, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 2)" , 0 ) /* Encrypted Code & GFX, crashes going into attract demo */
7223GAME( 1999, kof99e,   kof99, neogeo, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (earlier)" , 0 ) /* Encrypted Code & GFX */
7224GAME( 1999, kof99n,   kof99, neogeo, neogeo,  kof99n,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (not encrypted)" , 0 )   /* Encrypted GFX */
7225GAME( 1999, kof99p,   kof99, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (prototype)", 0 )
7226GAME( 1999, garou,    neogeo, neogeo,   neogeo,  garou,    ROT0, "SNK", "Garou - Mark of the Wolves (set 1)" , 0 ) /* Encrypted Code & GFX */
7227GAME( 1999, garouo,   garou, neogeo,   neogeo,  garouo,   ROT0, "SNK", "Garou - Mark of the Wolves (set 2)" , 0 ) /* Encrypted Code & GFX */
7228GAME( 1999, garoup,   garou, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Garou - Mark of the Wolves (prototype)", 0 )
7229GAME( 1999, garoubl,  garou, neogeo,   neogeo,  garoubl,  ROT0, "bootleg", "Garou - Mark of the Wolves (bootleg)", 0 ) /* Bootleg of garoup */
7230GAME( 2000, mslug3,   neogeo, neogeo, neogeo,  mslug3,   ROT0, "SNK", "Metal Slug 3" , 0 ) /* Encrypted Code & GFX */
7231GAME( 2000, mslug3n,  mslug3, neogeo, neogeo,  mslug3n,  ROT0, "SNK", "Metal Slug 3 (not encrypted)" , 0 ) /* Encrypted GFX */
7232GAME( 2000, mslug3b6, mslug3, neogeo,   neogeo,  mslug3b6, ROT0, "bootleg", "Metal Slug 6 (Metal Slug 3 bootleg)", 0 ) /* real Metal Slug 6 is an Atomiswave HW game, see atomswav.c ;-) */
7233GAME( 2000, kof2000,  neogeo, neogeo, neogeo,  kof2000,  ROT0, "SNK", "The King of Fighters 2000" , 0 ) /* Encrypted Code & GFX */
7234GAME( 2000, kof2000n, kof2000, neogeo, neogeo,  kof2000n, ROT0, "SNK", "The King of Fighters 2000 (not encrypted)" , 0 ) /* Encrypted GFX */
7235GAME( 2001, zupapa,   neogeo, neogeo, neogeo,  zupapa,   ROT0, "SNK", "Zupapa!" , 0 )   /* Encrypted GFX */
7236GAME( 2001, sengoku3, neogeo, neogeo,   neogeo,  sengoku3, ROT0, "SNK", "Sengoku 3" , 0 )   /* Encrypted GFX */
7237GAME( 2001, kof2001,  neogeo, neogeo, neogeo,  kof2001,  ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 1)" , 0 ) /* Encrypted GFX */
7238GAME( 2001, kof2001h, kof2001, neogeo, neogeo,  kof2001,  ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 2)" , 0 ) /* Encrypted GFX */
7239GAME( 2003, cthd2003, kof2001, neogeo, neogeo,  cthd2003, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */
7240GAME( 2003, ct2k3sp,  kof2001, neogeo, neogeo,  ct2k3sp,  ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */
7241GAME( 2003, ct2k3sa,  kof2001, neogeo, neogeo,  ct2k3sa,  ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus alternate (The King of Fighters 2001 bootleg)", 0 ) /* Hack / Bootleg of kof2001 */
7242GAME( 2002, kof2002,  neogeo, neogeo, neogeo,  kof2002,  ROT0, "Eolith / Playmore", "The King of Fighters 2002" , 0 ) /* Encrypted GFX */
7243GAME( 2002, kf2k2pls, kof2002, neogeo, neogeo,  kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (set 1, bootleg)" , 0 ) /* Encrypted GFX */
7244GAME( 2002, kf2k2pla, kof2002, neogeo, neogeo,  kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (set 2, bootleg)" , 0 ) /* Encrypted GFX */
7245GAME( 2002, kf2k2mp,  kof2002, neogeo, neogeo,  kf2k2mp,  ROT0, "bootleg", "The King of Fighters 2002 Magic Plus (bootleg)" , 0 ) /* Encrypted GFX */
7246GAME( 2002, kf2k2mp2, kof2002, neogeo, neogeo,  kof2km2,  ROT0, "bootleg", "The King of Fighters 2002 Magic Plus II (bootleg)" , 0 ) /* Encrypted GFX */
7247GAME( 2002, kof10th,  kof2002, neogeo, neogeo,  kof10th,  ROT0, "bootleg", "The King of Fighters 10th Anniversary (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7248GAME( 2004, kf2k5uni, kof2002, neogeo, neogeo,  kf2k5uni, ROT0, "bootleg", "The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7249GAME( 2005, kf10thep, kof2002, neogeo, neogeo,  kf10thep, ROT0, "bootleg", "The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7250GAME( 2004, kof2k4se, kof2002, neogeo, neogeo,  kof2k4se, ROT0, "bootleg", "The King of Fighters Special Edition 2004 (The King of Fighters 2002 bootleg)", 0 ) /* Hack / Bootleg of kof2002 */
7251GAME( 2003, mslug5,   neogeo, neogeo, neogeo,  mslug5,   ROT0, "SNK Playmore", "Metal Slug 5", 0 )
7252GAME( 2003, ms5pcb,   0,                neogeo, neogeo,  ms5pcb,   ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", 0 )
7253GAME( 2003, ms5plus,  mslug5, neogeo, neogeo,  ms5plus,  ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)",0 )
7254GAME( 2003, svcpcb,   0,                neogeo, svcpcb,  svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7255GAME( 2003, svcpcba,  svcpcb,           neogeo, svcpcb,  svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 2)" , 0 ) /* Encrypted Code */
7256GAME( 2003, svc,      neogeo, neogeo, neogeo,  svc,      ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS", 0 )
7257GAME( 2003, svcboot,  svc, neogeo, neogeo,  svcboot,  ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS (bootleg)", 0 )
7258GAME( 2003, svcplus,  svc, neogeo, neogeo,  svcplus,  ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (set 1, bootleg)", 0 )
7259GAME( 2003, svcplusa, svc, neogeo, neogeo,  svcplusa, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (set 2, bootleg)", 0 )
7260GAME( 2003, svcsplus, svc, neogeo, neogeo,  svcsplus, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg)", 0 )
7261GAME( 2003, samsho5,  neogeo, neogeo, neogeo,  samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 1)", 0 )
7262GAME( 2003, samsho5h, samsho5, neogeo, neogeo,  samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 2)", 0 )
7263GAME( 2003, samsho5b, samsho5, neogeo, neogeo,  samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", 0 ) // different program scrambling
7264GAME( 2003, kf2k3pcb, 0,                neogeo, neogeo,  kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7265GAME( 2003, kof2003,  neogeo, neogeo, neogeo,  kof2003,  ROT0, "SNK Playmore", "The King of Fighters 2003 (World / US, MVS)", 0 )
7266GAME( 2003, kf2k3bl,  kof2003, neogeo, neogeo,  kof2003b, ROT0, "bootleg", "The King of Fighters 2003 (bootleg, set 1)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?)
7267GAME( 2003, kf2k3bla, kof2003, neogeo, neogeo,  kof2k3pl, ROT0, "bootleg", "The King of Fighters 2003 (bootleg, set 2)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7268GAME( 2003, kf2k3pl,  kof2003, neogeo, neogeo,  kof2k3pl, ROT0, "bootleg", "The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7269GAME( 2003, kf2k3upl, kof2003, neogeo, neogeo,  kof2k3up, ROT0, "bootleg", "The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7270GAME( 2003, samsh5sp, neogeo, neogeo, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 1, uncensored)", 0 )
7271GAME( 2003, samsh5sh, samsh5sp, neogeo, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 2, censored)", 0 )
7272GAME( 2003, samsh5sn, samsh5sp, neogeo, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 3, less censored)", 0 )
7202GAME( 1996, rbffspec, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special", 0 )
7203GAME( 1997, kof97,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '97 (set 1)", 0 )
7204GAME( 1997, kof97a,   kof97,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '97 (set 2)", 0 )
7205GAME( 1997, kof97pls, kof97,    neogeo,   neogeo,   neogeo,   ROT0, "bootleg", "The King of Fighters '97 Plus (bootleg)", 0 )
7206GAME( 1997, kog,      kof97,    neogeo,   kog,      kog,      ROT0, "bootleg", "King of Gladiator (The King of Fighters '97 bootleg)", GAME_NOT_WORKING) // protected bootleg
7207GAME( 1997, lastblad, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 1)", 0 )
7208GAME( 1997, lastbldh, lastblad, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 2)", 0 )
7209GAME( 1997, lastsold, lastblad, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The Last Soldier (Korean release of The Last Blade)", 0 )
7210GAME( 1997, irrmaze,  neogeo,   neogeo,   irrmaze,  neogeo,   ROT0, "SNK / Saurus", "The Irritating Maze / Ultra Denryu Iraira Bou", 0 )
7211GAME( 1998, rbff2,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 1)", 0 )
7212GAME( 1998, rbff2h,   rbff2,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 2)", 0 )
7213GAME( 1998, rbff2k,   rbff2,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers (Korean release)", 0 ) // no Japanese title / mode
7214GAME( 1998, mslug2,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Metal Slug 2 - Super Vehicle-001/II", 0 )
7215GAME( 1998, kof98,    neogeo,   neogeo,   neogeo,   kof98,    ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends", 0 )
7216GAME( 1998, kof98k,   kof98,    neogeo,   neogeo,   kof98,    ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board)", 0 )
7217GAME( 1998, kof98n,   kof98,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (not encrypted)", 0 )
7218GAME( 1998, lastbld2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi, The", 0 )
7219GAME( 1998, neocup98, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Neo-Geo Cup '98 - The Road to the Victory", 0 )
7220GAME( 1999, mslugx,   neogeo,   neogeo,   neogeo,   mslugx,   ROT0, "SNK", "Metal Slug X - Super Vehicle-001", 0 )
7221GAME( 1999, kof99,    neogeo,   neogeo,   neogeo,   kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 1)" , 0 ) /* Encrypted Code & GFX */
7222GAME( 1999, kof99a,   kof99,    neogeo,   neogeo,   kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 2)" , 0 ) /* Encrypted Code & GFX, crashes going into attract demo */
7223GAME( 1999, kof99e,   kof99,    neogeo,   neogeo,   kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (earlier)" , 0 ) /* Encrypted Code & GFX */
7224GAME( 1999, kof99n,   kof99,    neogeo,   neogeo,   kof99n,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (not encrypted)" , 0 )   /* Encrypted GFX */
7225GAME( 1999, kof99p,   kof99,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (prototype)", 0 )
7226GAME( 1999, garou,    neogeo,   neogeo,   neogeo,   garou,    ROT0, "SNK", "Garou - Mark of the Wolves (set 1)" , 0 ) /* Encrypted Code & GFX */
7227GAME( 1999, garouo,   garou,    neogeo,   neogeo,   garouo,   ROT0, "SNK", "Garou - Mark of the Wolves (set 2)" , 0 ) /* Encrypted Code & GFX */
7228GAME( 1999, garoup,   garou,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Garou - Mark of the Wolves (prototype)", 0 )
7229GAME( 1999, garoubl,  garou,    neogeo,   neogeo,   garoubl,  ROT0, "bootleg", "Garou - Mark of the Wolves (bootleg)", 0 ) /* Bootleg of garoup */
7230GAME( 2000, mslug3,   neogeo,   neogeo,   neogeo,   mslug3,   ROT0, "SNK", "Metal Slug 3" , 0 ) /* Encrypted Code & GFX */
7231GAME( 2000, mslug3n,  mslug3,   neogeo,   neogeo,   mslug3n,  ROT0, "SNK", "Metal Slug 3 (not encrypted)" , 0 ) /* Encrypted GFX */
7232GAME( 2000, mslug3b6, mslug3,   neogeo,   neogeo,   mslug3b6, ROT0, "bootleg", "Metal Slug 6 (Metal Slug 3 bootleg)", 0 ) /* real Metal Slug 6 is an Atomiswave HW game, see atomswav.c ;-) */
7233GAME( 2000, kof2000,  neogeo,   neogeo,   neogeo,   kof2000,  ROT0, "SNK", "The King of Fighters 2000" , 0 ) /* Encrypted Code & GFX */
7234GAME( 2000, kof2000n, kof2000,  neogeo,   neogeo,   kof2000n, ROT0, "SNK", "The King of Fighters 2000 (not encrypted)" , 0 ) /* Encrypted GFX */
7235GAME( 2001, zupapa,   neogeo,   neogeo,   neogeo,   zupapa,   ROT0, "SNK", "Zupapa!" , 0 )   /* Encrypted GFX */
7236GAME( 2001, sengoku3, neogeo,   neogeo,   neogeo,   sengoku3, ROT0, "SNK", "Sengoku 3" , 0 )   /* Encrypted GFX */
7237GAME( 2001, kof2001,  neogeo,   neogeo,   neogeo,   kof2001,  ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 1)" , 0 ) /* Encrypted GFX */
7238GAME( 2001, kof2001h, kof2001,  neogeo,   neogeo,   kof2001,  ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 2)" , 0 ) /* Encrypted GFX */
7239GAME( 2003, cthd2003, kof2001,  neogeo,   neogeo,   cthd2003, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */
7240GAME( 2003, ct2k3sp,  kof2001,  neogeo,   neogeo,   ct2k3sp,  ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */
7241GAME( 2003, ct2k3sa,  kof2001,  neogeo,   neogeo,   ct2k3sa,  ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus alternate (The King of Fighters 2001 bootleg)", 0 ) /* Hack / Bootleg of kof2001 */
7242GAME( 2002, kof2002,  neogeo,   neogeo,   neogeo,   kof2002,  ROT0, "Eolith / Playmore", "The King of Fighters 2002" , 0 ) /* Encrypted GFX */
7243GAME( 2002, kf2k2pls, kof2002,  neogeo,   neogeo,   kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (bootleg set 1)" , 0 ) /* Encrypted GFX */
7244GAME( 2002, kf2k2pla, kof2002,  neogeo,   neogeo,   kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (bootleg set 2)" , 0 ) /* Encrypted GFX */
7245GAME( 2002, kf2k2mp,  kof2002,  neogeo,   neogeo,   kf2k2mp,  ROT0, "bootleg", "The King of Fighters 2002 Magic Plus (bootleg)" , 0 ) /* Encrypted GFX */
7246GAME( 2002, kf2k2mp2, kof2002,  neogeo,   neogeo,   kof2km2,  ROT0, "bootleg", "The King of Fighters 2002 Magic Plus II (bootleg)" , 0 ) /* Encrypted GFX */
7247GAME( 2002, kof10th,  kof2002,  neogeo,   neogeo,   kof10th,  ROT0, "bootleg", "The King of Fighters 10th Anniversary (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7248GAME( 2004, kf2k5uni, kof2002,  neogeo,   neogeo,   kf2k5uni, ROT0, "bootleg", "The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7249GAME( 2005, kf10thep, kof2002,  neogeo,   neogeo,   kf10thep, ROT0, "bootleg", "The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7250GAME( 2004, kof2k4se, kof2002,  neogeo,   neogeo,   kof2k4se, ROT0, "bootleg", "The King of Fighters Special Edition 2004 (The King of Fighters 2002 bootleg)", 0 ) /* Hack / Bootleg of kof2002 */
7251GAME( 2003, mslug5,   neogeo,   neogeo,   neogeo,   mslug5,   ROT0, "SNK Playmore", "Metal Slug 5", 0 )
7252GAME( 2003, ms5pcb,   0,        neogeo,   neogeo,   ms5pcb,   ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", 0 )
7253GAME( 2003, ms5plus,  mslug5,   neogeo,   neogeo,   ms5plus,  ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)",0 )
7254GAME( 2003, svcpcb,   0,        neogeo,   svcpcb,   svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 1)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7255GAME( 2003, svcpcba,  svcpcb,   neogeo,   svcpcb,   svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 2)" , 0 ) /* Encrypted Code */
7256GAME( 2003, svc,      neogeo,   neogeo,   neogeo,   svc,      ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS", 0 )
7257GAME( 2003, svcboot,  svc,      neogeo,   neogeo,   svcboot,  ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS (bootleg)", 0 )
7258GAME( 2003, svcplus,  svc,      neogeo,   neogeo,   svcplus,  ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 1)", 0 )
7259GAME( 2003, svcplusa, svc,      neogeo,   neogeo,   svcplusa, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 2)", 0 )
7260GAME( 2003, svcsplus, svc,      neogeo,   neogeo,   svcsplus, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg)", 0 )
7261GAME( 2003, samsho5,  neogeo,   neogeo,   neogeo,   samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 1)", 0 )
7262GAME( 2003, samsho5h, samsho5,  neogeo,   neogeo,   samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 2)", 0 )
7263GAME( 2003, samsho5b, samsho5,  neogeo,   neogeo,   samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", 0 ) // different program scrambling
7264GAME( 2003, kf2k3pcb, 0,        neogeo,   neogeo,   kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7265GAME( 2003, kof2003,  neogeo,   neogeo,   neogeo,   kof2003,  ROT0, "SNK Playmore", "The King of Fighters 2003 (World / US, MVS)", 0 )
7266GAME( 2003, kf2k3bl,  kof2003,  neogeo,   neogeo,   kof2003b, ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 1)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?)
7267GAME( 2003, kf2k3bla, kof2003,  neogeo,   neogeo,   kof2k3pl, ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 2)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7268GAME( 2003, kf2k3pl,  kof2003,  neogeo,   neogeo,   kof2k3pl, ROT0, "bootleg", "The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7269GAME( 2003, kf2k3upl, kof2003,  neogeo,   neogeo,   kof2k3up, ROT0, "bootleg", "The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7270GAME( 2003, samsh5sp, neogeo,   neogeo,   neogeo,   samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 1, uncensored)", 0 )
7271GAME( 2003, samsh5sh, samsh5sp, neogeo,   neogeo,   samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 2, censored)", 0 )
7272GAME( 2003, samsh5sn, samsh5sp, neogeo,   neogeo,   samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 3, less censored)", 0 )
72737273
72747274/* there are other bootlegs kof2002b etc. kof96ep, matrimbl?, kf2k1pls -- work out which should be supported */
72757275
72767276/* Alpha Denshi Co. / ADK (changed name in 1993) */
7277GAME( 1990, maglord,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Magician Lord (set 1)", 0 )
7278GAME( 1990, maglordh, maglord, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Magician Lord (set 2)", 0 )
7279GAME( 1990, ncombat,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Combat (set 1)", 0 )
7280GAME( 1990, ncombath, ncombat, neogeo, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Combat (set 2)", 0 )
7281GAME( 1990, bjourney, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Blue's Journey / Raguy", 0 )
7282GAME( 1991, crsword,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Crossed Swords", 0 )
7283GAME( 1991, trally,   neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Thrash Rally", 0 )
7284GAME( 1992, ncommand, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Commando", 0 )
7285GAME( 1992, wh1,      neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 1)", 0 )
7286GAME( 1992, wh1h,     wh1, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 2)", 0 )
7287GAME( 1992, wh1ha,    wh1, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 3)", 0 )
7288GAME( 1993, wh2,      neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK",              "World Heroes 2", 0 )
7289GAME( 1994, wh2j,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK / SNK",        "World Heroes 2 Jet (set 1)", 0 )
7290GAME( 1994, wh2jh,    wh2j, neogeo, neogeo,  neogeo,   ROT0, "ADK / SNK",        "World Heroes 2 Jet (set 2)", 0 )
7291GAME( 1994, aodk,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK / SNK",        "Aggressors of Dark Kombat / Tsuukai GANGAN Koushinkyoku", 0 )
7292GAME( 1995, whp,      neogeo, neogeo,   neogeo,  neogeo,   ROT0, "ADK / SNK",        "World Heroes Perfect", 0 )
7293GAME( 1995, mosyougi, neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK / SNK",        "Syougi No Tatsujin - Master of Syougi", 0 )
7294GAME( 1996, overtop,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK",              "Over Top", 0 )
7295GAME( 1996, ninjamas, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "ADK / SNK",        "Ninja Master's - haoh-ninpo-cho", 0 )
7296GAME( 1996, twinspri, neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK",              "Twinkle Star Sprites", 0 )
7297GAME( 1996, zintrckb, neogeo, neogeo, neogeo,  neogeo,   ROT0, "hack / bootleg",   "Zintrick / Oshidashi Zentrix (hack / bootleg)", 0 )
7277GAME( 1990, maglord,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "Magician Lord (set 1)", 0 )
7278GAME( 1990, maglordh, maglord,  neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "Magician Lord (set 2)", 0 )
7279GAME( 1990, ncombat,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Combat (set 1)", 0 )
7280GAME( 1990, ncombath, ncombat,  neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Combat (set 2)", 0 )
7281GAME( 1990, bjourney, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "Blue's Journey / Raguy", 0 )
7282GAME( 1991, crsword,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "Crossed Swords", 0 )
7283GAME( 1991, trally,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "Thrash Rally", 0 )
7284GAME( 1992, ncommand, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Commando", 0 )
7285GAME( 1992, wh1,      neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 1)", 0 )
7286GAME( 1992, wh1h,     wh1,      neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 2)", 0 )
7287GAME( 1992, wh1ha,    wh1,      neogeo,   neogeo,   neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 3)", 0 )
7288GAME( 1993, wh2,      neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "ADK",              "World Heroes 2", 0 )
7289GAME( 1994, wh2j,     neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "ADK / SNK",        "World Heroes 2 Jet (set 1)", 0 )
7290GAME( 1994, wh2jh,    wh2j,     neogeo,   neogeo,   neogeo,   ROT0, "ADK / SNK",        "World Heroes 2 Jet (set 2)", 0 )
7291GAME( 1994, aodk,     neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "ADK / SNK",        "Aggressors of Dark Kombat / Tsuukai GANGAN Koushinkyoku", 0 )
7292GAME( 1995, whp,      neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "ADK / SNK",        "World Heroes Perfect", 0 )
7293GAME( 1995, mosyougi, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "ADK / SNK",        "Syougi No Tatsujin - Master of Syougi", 0 )
7294GAME( 1996, overtop,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "ADK",              "Over Top", 0 )
7295GAME( 1996, ninjamas, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "ADK / SNK",        "Ninja Master's - haoh-ninpo-cho", 0 )
7296GAME( 1996, twinspri, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "ADK",              "Twinkle Star Sprites", 0 )
7297GAME( 1996, zintrckb, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "hack / bootleg",   "Zintrick / Oshidashi Zentrix (hack / bootleg)", 0 )
72987298
72997299/* Aicom */
7300GAME( 1994, janshin,  neogeo, neogeo,   mjneogeo,neogeo,   ROT0, "Aicom", "Jyanshin Densetsu - Quest of Jongmaster", 0 )
7301GAME( 1995, pulstar,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Aicom", "Pulstar", 0 )
7300GAME( 1994, janshin,  neogeo,   neogeo,   mjneogeo, neogeo,   ROT0, "Aicom", "Jyanshin Densetsu - Quest of Jongmaster", 0 )
7301GAME( 1995, pulstar,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Aicom", "Pulstar", 0 )
73027302
73037303/* Data East Corporation */
7304GAME( 1993, spinmast, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Spin Master / Miracle Adventure", 0 )
7305GAME( 1994, wjammers, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Windjammers / Flying Power Disc", 0 )
7306GAME( 1994, karnovr,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Karnov's Revenge / Fighter's History Dynamite", 0 )
7307GAME( 1994, strhoop,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Street Hoop / Street Slam / Dunk Dream", 0 )
7308GAME( 1996, ghostlop, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Ghostlop (prototype)", 0 )
7309GAME( 1996, magdrop2, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Magical Drop II", 0 )
7310GAME( 1997, magdrop3, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Magical Drop III", 0 )
7304GAME( 1993, spinmast, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Data East Corporation", "Spin Master / Miracle Adventure", 0 )
7305GAME( 1994, wjammers, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Data East Corporation", "Windjammers / Flying Power Disc", 0 )
7306GAME( 1994, karnovr,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Data East Corporation", "Karnov's Revenge / Fighter's History Dynamite", 0 )
7307GAME( 1994, strhoop,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Data East Corporation", "Street Hoop / Street Slam / Dunk Dream", 0 )
7308GAME( 1996, ghostlop, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Data East Corporation", "Ghostlop (prototype)", 0 )
7309GAME( 1996, magdrop2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Data East Corporation", "Magical Drop II", 0 )
7310GAME( 1997, magdrop3, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Data East Corporation", "Magical Drop III", 0 )
73117311
73127312/* Eleven */
7313GAME( 2000, nitd,     neogeo, neogeo,   neogeo,  nitd,     ROT0, "Eleven / Gavaking", "Nightmare in the Dark" , 0 ) /* Encrypted GFX */
7314GAME( 2001, nitdbl,   nitd,   neogeo,   neogeo,  neogeo,   ROT0, "bootleg", "Nightmare in the Dark (bootleg)" , 0 )
7313GAME( 2000, nitd,     neogeo,   neogeo,   neogeo,   nitd,     ROT0, "Eleven / Gavaking", "Nightmare in the Dark" , 0 ) /* Encrypted GFX */
7314GAME( 2001, nitdbl,   nitd,     neogeo,   neogeo,   neogeo,   ROT0, "bootleg", "Nightmare in the Dark (bootleg)" , 0 )
73157315
73167316/* Face */
7317GAME( 1994, gururin,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Face", "Gururin", 0 )
7318GAME( 1997, miexchng, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Face", "Money Puzzle Exchanger / Money Idol Exchanger", 0 )
7317GAME( 1994, gururin,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Face", "Gururin", 0 )
7318GAME( 1997, miexchng, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Face", "Money Puzzle Exchanger / Money Idol Exchanger", 0 )
73197319
73207320/* Hudson Soft */
7321GAME( 1994, panicbom, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Eighting / Hudson", "Panic Bomber", 0 )
7322GAME( 1995, kabukikl, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Hudson", "Far East of Eden - Kabuki Klash / Tengai Makyou - Shin Den", 0 )
7323GAME( 1997, neobombe, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Hudson", "Neo Bomberman", 0 )
7321GAME( 1994, panicbom, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Eighting / Hudson", "Panic Bomber", 0 )
7322GAME( 1995, kabukikl, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Hudson", "Far East of Eden - Kabuki Klash / Tengai Makyou - Shin Den", 0 )
7323GAME( 1997, neobombe, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Hudson", "Neo Bomberman", 0 )
73247324
73257325/* Monolith Corp. */
7326GAME( 1990, minasan,  neogeo, neogeo, mjneogeo,neogeo,   ROT0, "Monolith Corp.", "Minnasanno Okagesamadesu", 0 )
7327GAME( 1991, bakatono, neogeo, neogeo, mjneogeo,neogeo,   ROT0, "Monolith Corp.", "Bakatonosama Mahjong Manyuki", 0 )
7326GAME( 1990, minasan,  neogeo,   neogeo,   mjneogeo, neogeo,   ROT0, "Monolith Corp.", "Minnasanno Okagesamadesu", 0 )
7327GAME( 1991, bakatono, neogeo,   neogeo,   mjneogeo, neogeo,   ROT0, "Monolith Corp.", "Bakatonosama Mahjong Manyuki", 0 )
73287328
73297329/* Nazca */
7330GAME( 1996, turfmast, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Nazca", "Neo Turf Masters / Big Tournament Golf", 0 )
7331GAME( 1996, mslug,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "Nazca", "Metal Slug - Super Vehicle-001", 0 )
7330GAME( 1996, turfmast, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Nazca", "Neo Turf Masters / Big Tournament Golf", 0 )
7331GAME( 1996, mslug,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Nazca", "Metal Slug - Super Vehicle-001", 0 )
73327332
73337333/* NMK */
7334GAME( 1994, zedblade, neogeo, neogeo, neogeo,  neogeo,   ROT0, "NMK", "Zed Blade / Operation Ragnarok", 0 )
7334GAME( 1994, zedblade, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "NMK", "Zed Blade / Operation Ragnarok", 0 )
73357335
73367336/* Psikyo */
7337GAME( 1999, s1945p,   neogeo, neogeo,   neogeo,  s1945p,   ROT0, "Psikyo", "Strikers 1945 Plus" , 0 )   /* Encrypted GFX */
7337GAME( 1999, s1945p,   neogeo,   neogeo,   neogeo,   s1945p,   ROT0, "Psikyo", "Strikers 1945 Plus" , 0 )   /* Encrypted GFX */
73387338
73397339/* Sammy */
7340GAME( 1992, viewpoin, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Sammy", "Viewpoint", 0 )
7340GAME( 1992, viewpoin, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Sammy", "Viewpoint", 0 )
73417341
73427342/* Saurus */
7343GAME( 1995, quizkof,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Quiz King of Fighters", 0 )
7344GAME( 1995, stakwin,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Saurus", "Stakes Winner / Stakes Winner - GI kinzen seihae no michi", 0 )
7345GAME( 1996, ragnagrd, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Saurus", "Ragnagard / Shin-Oh-Ken", 0 )
7346GAME( 1996, pgoal,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Pleasure Goal / Futsal - 5 on 5 Mini Soccer", 0 )
7347GAME( 1996, stakwin2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Saurus", "Stakes Winner 2", 0 )
7348GAME( 1997, shocktro, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers (set 1)", 0 )
7349GAME( 1997, shocktra, shocktro, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers (set 2)", 0 )
7350GAME( 1998, shocktr2, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers - 2nd Squad", 0 )
7351GAME( 1998, lans2004, shocktr2, neogeo, neogeo,  lans2004, ROT0, "bootleg", "Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg)", 0 )
7343GAME( 1995, quizkof,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Saurus", "Quiz King of Fighters", 0 )
7344GAME( 1995, stakwin,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Saurus", "Stakes Winner / Stakes Winner - GI kinzen seihae no michi", 0 )
7345GAME( 1996, ragnagrd, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Saurus", "Ragnagard / Shin-Oh-Ken", 0 )
7346GAME( 1996, pgoal,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Saurus", "Pleasure Goal / Futsal - 5 on 5 Mini Soccer", 0 )
7347GAME( 1996, stakwin2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Saurus", "Stakes Winner 2", 0 )
7348GAME( 1997, shocktro, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Saurus", "Shock Troopers (set 1)", 0 )
7349GAME( 1997, shocktra, shocktro, neogeo,   neogeo,   neogeo,   ROT0, "Saurus", "Shock Troopers (set 2)", 0 )
7350GAME( 1998, shocktr2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Saurus", "Shock Troopers - 2nd Squad", 0 )
7351GAME( 1998, lans2004, shocktr2, neogeo,   neogeo,   lans2004, ROT0, "bootleg", "Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg)", 0 )
73527352
73537353/* Sunsoft */
7354GAME( 1995, galaxyfg, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Sunsoft", "Galaxy Fight - Universal Warriors", 0 )
7355GAME( 1996, wakuwak7, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Sunsoft", "Waku Waku 7", 0 )
7354GAME( 1995, galaxyfg, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Sunsoft", "Galaxy Fight - Universal Warriors", 0 )
7355GAME( 1996, wakuwak7, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Sunsoft", "Waku Waku 7", 0 )
73567356
73577357/* Taito */
7358GAME( 1994, pbobblen, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 1)", 0 )
7359GAME( 1994, pbobblna, pbobblen, neogeo,   neogeo,  neogeo,   ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 2)", 0 )
7360GAME( 1999, pbobbl2n, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Taito (SNK license)", "Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo)", 0 )
7361GAME( 2003, pnyaa,    neogeo, neogeo, neogeo,  pnyaa,    ROT0, "Aiky / Taito", "Pochi and Nyaa", 0 )
7358GAME( 1994, pbobblen, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 1)", 0 )
7359GAME( 1994, pbobblna, pbobblen, neogeo,   neogeo,   neogeo,   ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 2)", 0 )
7360GAME( 1999, pbobbl2n, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Taito (SNK license)", "Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo)", 0 )
7361GAME( 2003, pnyaa,    neogeo,   neogeo,   neogeo,   pnyaa,    ROT0, "Aiky / Taito", "Pochi and Nyaa", 0 )
73627362
73637363/* Takara */
7364GAME( 1995, marukodq, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Takara", "Chibi Marukochan Deluxe Quiz", 0 )
7364GAME( 1995, marukodq, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Takara", "Chibi Marukochan Deluxe Quiz", 0 )
73657365
73667366/* Technos */
7367GAME( 1995, doubledr, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Technos", "Double Dragon (Neo-Geo)", 0 )
7368GAME( 1995, gowcaizr, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Technos", "Voltage Fighter - Gowcaizer / Choujin Gakuen Gowcaizer", 0 )
7369GAME( 1996, sdodgeb,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Technos", "Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu", 0 )
7367GAME( 1995, doubledr, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Technos", "Double Dragon (Neo-Geo)", 0 )
7368GAME( 1995, gowcaizr, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Technos", "Voltage Fighter - Gowcaizer / Choujin Gakuen Gowcaizer", 0 )
7369GAME( 1996, sdodgeb,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Technos", "Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu", 0 )
73707370
73717371/* Tecmo */
7372GAME( 1996, tws96,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "Tecmo", "Tecmo World Soccer '96", 0 )
7372GAME( 1996, tws96,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Tecmo", "Tecmo World Soccer '96", 0 )
73737373
73747374/* Yumekobo */
7375GAME( 1998, blazstar, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Yumekobo", "Blazing Star", 0 )
7376GAME( 1999, preisle2, neogeo, neogeo, neogeo,  preisle2, ROT0, "Yumekobo", "Prehistoric Isle 2" , 0 ) /* Encrypted GFX */
7375GAME( 1998, blazstar, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Yumekobo", "Blazing Star", 0 )
7376GAME( 1999, preisle2, neogeo,   neogeo,   neogeo,   preisle2, ROT0, "Yumekobo", "Prehistoric Isle 2" , 0 ) /* Encrypted GFX */
73777377
73787378/* Viccom */
7379GAME( 1994, fightfev, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Viccom", "Fight Fever (set 1)", 0 )
7380GAME( 1994, fightfva, fightfev, neogeo, neogeo,  neogeo,   ROT0, "Viccom", "Fight Fever (set 2)", 0 )
7379GAME( 1994, fightfev, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Viccom", "Fight Fever (set 1)", 0 )
7380GAME( 1994, fightfva, fightfev, neogeo,   neogeo,   neogeo,   ROT0, "Viccom", "Fight Fever (set 2)", 0 )
73817381
73827382/* Video System Co. */
7383GAME( 1994, pspikes2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Video System Co.", "Power Spikes II", 0 )
7384GAME( 1994, sonicwi2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Video System Co.", "Aero Fighters 2 / Sonic Wings 2", 0 )
7385GAME( 1995, sonicwi3, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Video System Co.", "Aero Fighters 3 / Sonic Wings 3", 0 )
7386GAME( 1997, popbounc, neogeo, neogeo, popbounc,neogeo,   ROT0, "Video System Co.", "Pop 'n Bounce / Gapporin", 0 )
7383GAME( 1994, pspikes2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Video System Co.", "Power Spikes II", 0 )
7384GAME( 1994, sonicwi2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Video System Co.", "Aero Fighters 2 / Sonic Wings 2", 0 )
7385GAME( 1995, sonicwi3, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Video System Co.", "Aero Fighters 3 / Sonic Wings 3", 0 )
7386GAME( 1997, popbounc, neogeo,   neogeo,   popbounc, neogeo,   ROT0, "Video System Co.", "Pop 'n Bounce / Gapporin", 0 )
73877387
73887388/* Visco */
7389GAME( 1992, androdun, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Andro Dunos", 0 )
7390GAME( 1995, puzzledp, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Taito (Visco license)", "Puzzle De Pon!", 0 )
7391GAME( 1996, neomrdo,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Neo Mr. Do!", 0 )
7392GAME( 1995, goalx3,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Goal! Goal! Goal!", 0 )
7393GAME( 1996, neodrift, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Neo Drift Out - New Technology", 0 )
7394GAME( 1996, breakers, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Visco", "Breakers", 0 )
7395GAME( 1997, puzzldpr, puzzledp, neogeo, neogeo,  neogeo,   ROT0, "Taito (Visco license)", "Puzzle De Pon! R!", 0 )
7396GAME( 1998, breakrev, breakers, neogeo,   neogeo,  neogeo,   ROT0, "Visco", "Breakers Revenge", 0 )
7397GAME( 1998, flipshot, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Battle Flip Shot", 0 )
7398GAME( 1999, ctomaday, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Captain Tomaday", 0 )
7399GAME( 1999, ganryu,   neogeo, neogeo, neogeo,  ganryu,   ROT0, "Visco", "Ganryu / Musashi Ganryuki" , 0 )   /* Encrypted GFX */
7400GAME( 2000, bangbead, neogeo, neogeo, neogeo,  bangbead, ROT0, "Visco", "Bang Bead", 0 )
7401//GAME( 2000, bangbedp, bangbead, neogeo,   neogeo,  neogeo,   ROT0, "Visco", "Bang Bead (prototype)", 0 )
7389GAME( 1992, androdun, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Andro Dunos", 0 )
7390GAME( 1995, puzzledp, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Taito (Visco license)", "Puzzle De Pon!", 0 )
7391GAME( 1996, neomrdo,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Neo Mr. Do!", 0 )
7392GAME( 1995, goalx3,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Goal! Goal! Goal!", 0 )
7393GAME( 1996, neodrift, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Neo Drift Out - New Technology", 0 )
7394GAME( 1996, breakers, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Breakers", 0 )
7395GAME( 1997, puzzldpr, puzzledp, neogeo,   neogeo,   neogeo,   ROT0, "Taito (Visco license)", "Puzzle De Pon! R!", 0 )
7396GAME( 1998, breakrev, breakers, neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Breakers Revenge", 0 )
7397GAME( 1998, flipshot, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Battle Flip Shot", 0 )
7398GAME( 1999, ctomaday, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Captain Tomaday", 0 )
7399GAME( 1999, ganryu,   neogeo,   neogeo,   neogeo,   ganryu,   ROT0, "Visco", "Ganryu / Musashi Ganryuki" , 0 )   /* Encrypted GFX */
7400GAME( 2000, bangbead, neogeo,   neogeo,   neogeo,   bangbead, ROT0, "Visco", "Bang Bead", 0 )
7401//GAME( 2000, bangbedp, bangbead, neogeo,   neogeo,   neogeo,   ROT0, "Visco", "Bang Bead (prototype)", 0 )
74027402
74037403/* Mega Enterprise */
7404GAME( 2002, mslug4,   neogeo, neogeo, neogeo,  mslug4,   ROT0, "Mega", "Metal Slug 4", 0 )
7405GAME( 2002, ms4plus,  mslug4, neogeo, neogeo,  neogeo,   ROT0, "bootleg", "Metal Slug 4 Plus (bootleg)", 0 )
7404GAME( 2002, mslug4,   neogeo,   neogeo,   neogeo,   mslug4,   ROT0, "Mega", "Metal Slug 4", 0 )
7405GAME( 2002, ms4plus,  mslug4,   neogeo,   neogeo,   neogeo,   ROT0, "bootleg", "Metal Slug 4 Plus (bootleg)", 0 )
74067406
74077407/* Evoga */
7408GAME( 2002, rotd,     neogeo, neogeo,   neogeo,  rotd,     ROT0, "Evoga / Playmore", "Rage of the Dragons", 0 )
7408GAME( 2002, rotd,     neogeo,   neogeo,   neogeo,   rotd,     ROT0, "Evoga / Playmore", "Rage of the Dragons", 0 )
74097409
74107410/* Atlus */
7411GAME( 2002, matrim,   neogeo, neogeo,   neogeo,  matrim,   ROT0, "Noise Factory / Atlus", "Matrimelee / Shin Gouketsuji Ichizoku Toukon", 0 )
7411GAME( 2002, matrim,   neogeo,   neogeo,   neogeo,   matrim,   ROT0, "Noise Factory / Atlus", "Matrimelee / Shin Gouketsuji Ichizoku Toukon", 0 )
74127412
74137413/* Breezasoft */
7414GAME( 2001, jockeygp, neogeo, neogeo, jockeygp,jockeygp, ROT0, "Sun Amusement / BrezzaSoft", "Jockey Grand Prix", 0 )
7415GAME( 2001, vliner,   neogeo, neogeo, vliner,  vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 1)", 0 )
7416GAME( 2001, vlinero,  vliner, neogeo, vliner,  vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 2)", 0 )
7414GAME( 2001, jockeygp, neogeo,   neogeo,   jockeygp, jockeygp, ROT0, "Sun Amusement / BrezzaSoft", "Jockey Grand Prix", 0 )
7415GAME( 2001, vliner,   neogeo,   neogeo,   vliner,   vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 1)", 0 )
7416GAME( 2001, vlinero,  vliner,   neogeo,   vliner,   vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 2)", 0 )
74177417
74187418/* Kyle Hodgetts */
7419GAME( 2000, diggerma, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Kyle Hodgetts", "Digger Man (prototype)", 0 )
7419GAME( 2000, diggerma, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Kyle Hodgetts", "Digger Man (prototype)", 0 )
74207420
src/mame/drivers/gradius3.c
r1649r1650
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "video/konamiic.h"
2021#include "cpu/m68000/m68000.h"
2122#include "cpu/z80/z80.h"
src/mame/drivers/omegrace.c
r1649r1650
217217***************************************************************************/
218218
219219#include "driver.h"
220#include "deprecat.h"
220221#include "video/vector.h"
221222#include "video/avgdvg.h"
222223#include "sound/ay8910.h"
src/mame/drivers/eolithsp.c
r1649r1650
99*/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "includes/eolithsp.h"
1314
1415static int eolith_speedup_address;
src/mame/drivers/mystwarr.c
r1649r1650
2222 */
2323
2424#include "driver.h"
25#include "deprecat.h"
2526
2627#include "video/konamiic.h"
2728#include "machine/konamigx.h"
src/mame/drivers/fromance.c
r1649r1650
4040******************************************************************************/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "cpu/z80/z80.h"
4445#include "fromance.h"
4546#include "sound/ay8910.h"
src/mame/drivers/dlair.c
r1649r1650
3434
3535#include "driver.h"
3636#include "render.h"
37#include "deprecat.h"
3738#include "cpu/z80/z80daisy.h"
3839#include "machine/laserdsc.h"
3940#include "machine/z80ctc.h"
src/mame/drivers/irobot.c
r1649r1650
7575****************************************************************************/
7676
7777#include "driver.h"
78#include "deprecat.h"
7879#include "cpu/m6809/m6809.h"
7980#include "sound/pokey.h"
8081#include "irobot.h"
r1649r1650
312313   MDRV_SCREEN_SIZE(32*8, 32*8)
313314   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 29*8-1)
314315   MDRV_GFXDECODE(irobot)
315   MDRV_PALETTE_LENGTH(64 + 32)
316   MDRV_COLORTABLE_LENGTH(64 + 32)   /* 64 for polygons, 32 for text */
316   MDRV_PALETTE_LENGTH(64 + 32)   /* 64 for polygons, 32 for text */
317317
318318   MDRV_PALETTE_INIT(irobot)
319319   MDRV_VIDEO_START(irobot)
src/mame/drivers/skykid.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "cpu/m6800/m6800.h"
1819#include "sound/namco.h"
1920
src/mame/drivers/halleys.c
r1649r1650
158158// Compiler Directives
159159
160160#include "driver.h"
161#include "deprecat.h"
161162#include "cpu/m6809/m6809.h"
162163#include "sound/ay8910.h"
163164
src/mame/drivers/djmain.c
r1649r1650
3838 */
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "cpu/m68000/m68000.h"
4243#include "machine/idectrl.h"
4344#include "sound/k054539.h"
src/mame/drivers/ssfindo.c
r1649r1650
121121*/
122122
123123#include "driver.h"
124#include "deprecat.h"
124125#include "cpu/arm7/arm7core.h"
125126
126127enum
src/mame/drivers/m57.c
r0r1650
1/****************************************************************************
2
3    Irem M57 hardware
4
5*****************************************************************************
6
7    Tropical Angel
8
9    driver by Phil Stroffolino
10
11    IREM M57 board stack with a M52-SOUND-E sound PCB.
12
13    M57-A-A:
14     TA-A-xx roms and proms
15     NEC D780C (Z80) CPU
16     NANAO KNA6032601 custom chip
17     NANAO KNA6032701 custom chip
18     8-way dipswitch (x2)
19     M58725P RAM (x3)
20     CN1 - Ribbon cable connector
21     CN2 - Ribbon cable connector
22     Ribbon cable connector to sound PCB
23
24    M57-B-A:
25     TA-B-xx roms and proms
26     18.432 MHz OSC
27     CN1 - Ribbon cable connector
28     CN2 - Ribbon cable connector
29
30    M52:
31     HD6803 CPU
32     AY-3-9810 (x2) sound chips
33     MSM5205 OKI sound chip (and an unpopulated socket for a second MSM5202)
34     3.579545 MHz OSC
35     2764 Program rom labeled "TA S-1A-"
36     Ribbon cable connector to M57-A-A PCB
37
38    New Tropical Angel:
39     Roms where found on an official IREM board with genuine IREM Tropical Angel
40     license seal and genuine IREM serial number sticker.
41     The "new" roms have hand written labels, while those that match the current
42     Tropical Angel set look to be factory labeled chips.
43
44****************************************************************************/
45
46#include "driver.h"
47#include "m57.h"
48#include "audio/irem.h"
49
50
51#define MASTER_CLOCK      XTAL_18_432MHz
52
53
54
55/*************************************
56 *
57 *  Memory maps
58 *
59 *************************************/
60
61static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
62   AM_RANGE(0x0000, 0x7fff) AM_ROM
63   AM_RANGE(0x8000, 0x87ff) AM_READWRITE(MRA8_RAM, m57_videoram_w) AM_BASE(&videoram)
64   AM_RANGE(0x9000, 0x91ff) AM_RAM AM_BASE(&m57_scroll)
65   AM_RANGE(0xc820, 0xc8ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
66   AM_RANGE(0xd000, 0xd000) AM_WRITE(irem_sound_cmd_w)
67   AM_RANGE(0xd001, 0xd001) AM_WRITE(m57_flipscreen_w)   /* + coin counters */
68   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("IN0")
69   AM_RANGE(0xd001, 0xd001) AM_READ_PORT("IN1")
70   AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN2")
71   AM_RANGE(0xd003, 0xd003) AM_READ_PORT("DSW1")
72   AM_RANGE(0xd004, 0xd004) AM_READ_PORT("DSW2")
73   AM_RANGE(0xe000, 0xe7ff) AM_RAM
74ADDRESS_MAP_END
75
76
77
78/*************************************
79 *
80 *  Port definitions
81 *
82 *************************************/
83
84static INPUT_PORTS_START( troangel )
85   PORT_START_TAG("IN0")
86   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
87   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
88   /* coin input must be active for 19 frames to be consistently recognized */
89   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(19)
90   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
91   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
92
93   PORT_START_TAG("IN1")
94   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
95   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
96   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
97   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
98   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
99   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
100   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
101   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
102
103   PORT_START_TAG("IN2")
104   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
105   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
106   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
107   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
108   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
109   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
110   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
111   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
112
113   PORT_START_TAG("DSW1")
114   PORT_DIPNAME( 0x03, 0x03, "Time" )
115   PORT_DIPSETTING(    0x03, "180 160 140" )
116   PORT_DIPSETTING(    0x02, "160 140 120" )
117   PORT_DIPSETTING(    0x01, "140 120 100" )
118   PORT_DIPSETTING(    0x00, "120 100 100" )
119   PORT_DIPNAME( 0x04, 0x04, "Crash Loss Time" )
120   PORT_DIPSETTING(    0x04, "5" )
121   PORT_DIPSETTING(    0x00, "10" )
122   PORT_DIPNAME( 0x08, 0x08, "Background Sound" )
123   PORT_DIPSETTING(    0x08, "Boat Motor" )
124   PORT_DIPSETTING(    0x00, "Music" )
125   /* TODO: support the different settings which happen in Coin Mode 2 */
126   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) /* mapped on coin mode 1 */
127   PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) )
128   PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) )
129   PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
130   PORT_DIPSETTING(    0xd0, DEF_STR( 3C_1C ) )
131   PORT_DIPSETTING(    0xe0, DEF_STR( 2C_1C ) )
132   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
133   PORT_DIPSETTING(    0x70, DEF_STR( 1C_2C ) )
134   PORT_DIPSETTING(    0x60, DEF_STR( 1C_3C ) )
135   PORT_DIPSETTING(    0x50, DEF_STR( 1C_4C ) )
136   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
137   PORT_DIPSETTING(    0x30, DEF_STR( 1C_6C ) )
138   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
139   /* settings 0x10, 0x20, 0x80, 0x90 all give 1 Coin/1 Credit */
140
141   PORT_START_TAG("DSW2")
142   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
143   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
144   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
145   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
146   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
147   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
148/* This activates a different coin mode. Look at the dip switch setting schematic */
149   PORT_DIPNAME( 0x04, 0x04, "Coin Mode" )
150   PORT_DIPSETTING(    0x04, "Mode 1" )
151   PORT_DIPSETTING(    0x00, "Mode 2" )
152/* TODO: the following enables an analog accelerator input read from 0xd003 */
153/* however that is the DSW1 input so it must be multiplexed some way */
154   PORT_DIPNAME( 0x08, 0x08, "Analog Accelarator" )
155   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
156   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
157   /* In stop mode, press 2 to stop and 1 to restart */
158   PORT_DIPNAME( 0x10, 0x10, "Stop Mode (Cheat)")
159   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
160   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
161   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
162   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
163   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
164   PORT_DIPNAME( 0x40, 0x40, "Invulnerability (Cheat)")
165   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
166   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
167   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
168INPUT_PORTS_END
169
170
171
172/*************************************
173 *
174 *  Graphics layouts
175 *
176 *************************************/
177
178static const gfx_layout spritelayout =
179{
180   16,32,
181   RGN_FRAC(1,3),
182   3,
183   { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
184   { STEP8(0,1), STEP8(16*8,1) },
185   { STEP16(0,8), STEP16(256*64,8) },
186   32*8
187};
188
189static GFXDECODE_START( m57 )
190   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, gfx_8x8x3_planar,    0, 32 )
191   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,     32*8, 32 )
192GFXDECODE_END
193
194
195
196/*************************************
197 *
198 *  Machine drivers
199 *
200 *************************************/
201
202static MACHINE_DRIVER_START( m57 )
203
204   /* basic machine hardware */
205   MDRV_CPU_ADD(Z80, XTAL_18_432MHz/6)   /* verified on pcb */
206   MDRV_CPU_PROGRAM_MAP(main_map,0)
207   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
208
209   MDRV_SCREEN_REFRESH_RATE(57)
210   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1790)   /* accurate frequency, measured on a Moon Patrol board, is 56.75Hz. */)
211            /* the Lode Runner manual (similar but different hardware) */
212            /* talks about 55Hz and 1790ms vblank duration. */
213
214   /* video hardware */
215   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
216   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
217   MDRV_SCREEN_SIZE(32*8, 32*8)
218   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
219   MDRV_GFXDECODE(m57)
220   MDRV_PALETTE_LENGTH(32*8+32*8)
221
222   MDRV_PALETTE_INIT(m57)
223   MDRV_VIDEO_START(m57)
224   MDRV_VIDEO_UPDATE(m57)
225
226   /* sound hardware */
227   MDRV_IMPORT_FROM(m52_small_audio)
228MACHINE_DRIVER_END
229
230
231
232/*************************************
233 *
234 *  ROM definitions
235 *
236 *************************************/
237
238ROM_START( troangel )
239   ROM_REGION( 0x10000, REGION_CPU1, 0 )   /* main CPU */
240   ROM_LOAD( "ta-a-3k", 0x0000, 0x2000, CRC(f21f8196) SHA1(7cbf74b77a559ee70312b799e707394d9b849f5b) )
241   ROM_LOAD( "ta-a-3m", 0x2000, 0x2000, CRC(58801e55) SHA1(91bdda778f2c4486001bc4ad26d6f21ba275ae08) )
242   ROM_LOAD( "ta-a-3n", 0x4000, 0x2000, CRC(de3dea44) SHA1(1290755ffc04dc3b3667e063118669a0eab6fb79) )
243   ROM_LOAD( "ta-a-3q", 0x6000, 0x2000, CRC(fff0fc2a) SHA1(82f3f5a8817e956192323eb555daa85b7766676d) )
244
245   ROM_REGION(  0x8000 , REGION_CPU2, 0 )   /* sound CPU */
246   ROM_LOAD( "ta-s-1a", 0x6000, 0x2000, CRC(15a83210) SHA1(8ada510db689ffa372b2f4dc4bd1b1c69a0c5307) )
247
248   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
249   ROM_LOAD( "ta-a-3e", 0x00000, 0x2000, CRC(e49f7ad8) SHA1(915de1084fd3c5fc81dd8c80107c28cc57b33226) )
250   ROM_LOAD( "ta-a-3d", 0x02000, 0x2000, CRC(06eef241) SHA1(4f327a54169046d8d84b5f5cf5d9f45e1df4dae6) )
251   ROM_LOAD( "ta-a-3c", 0x04000, 0x2000, CRC(7ff5482f) SHA1(fe8c181fed113007d69d11e8aa467e86a6357ffb) )   /* characters */
252
253   ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
254   ROM_LOAD( "ta-b-5j", 0x00000, 0x2000, CRC(86895c0c) SHA1(b42b041e3e20dadd8411805d492133d371426ebf) )   /* sprites */
255   ROM_LOAD( "ta-b-5h", 0x02000, 0x2000, CRC(f8cff29d) SHA1(dabf3bbf50f73a381056131c2239c84dd966b63e) )
256   ROM_LOAD( "ta-b-5e", 0x04000, 0x2000, CRC(8b21ee9a) SHA1(1272722211d22d5b153e9415cc189a5aa9028543) )
257   ROM_LOAD( "ta-b-5d", 0x06000, 0x2000, CRC(cd473d47) SHA1(854cb532bd62851a206da2affd66a1257b7085b6) )
258   ROM_LOAD( "ta-b-5c", 0x08000, 0x2000, CRC(c19134c9) SHA1(028660e66fd033473c468b694e870c633ca05ec6) )
259   ROM_LOAD( "ta-b-5a", 0x0a000, 0x2000, CRC(0012792a) SHA1(b4380f5fbe5e9ce9b44f87ce48a8b402bab58b52) )
260
261   ROM_REGION( 0x0320, REGION_PROMS, 0 )
262   ROM_LOAD( "ta-a-5a", 0x0000, 0x0100, CRC(01de1167) SHA1(b9070f8c70eb362fc4d6a0a92235ce0a5b2ab858) ) /* chars palette low 4 bits */
263   ROM_LOAD( "ta-a-5b", 0x0100, 0x0100, CRC(efd11d4b) SHA1(7c7c356063ab35e4ffb8d65cd20c27c2a4b36537) ) /* chars palette high 4 bits */
264   ROM_LOAD( "ta-b-1b", 0x0200, 0x0020, CRC(f94911ea) SHA1(ad61a323476a97156a255a72048a28477b421284) ) /* sprites palette */
265   ROM_LOAD( "ta-b-3d", 0x0220, 0x0100, CRC(ed3e2aa4) SHA1(cfdfc151803080d1ecdd04af1bfea3dbdce8dca0) ) /* sprites lookup table */
266ROM_END
267
268ROM_START( newtangl ) /* Offical "upgrade" or hack? */
269   ROM_REGION( 0x10000, REGION_CPU1, 0 )   /* main CPU */
270   ROM_LOAD( "3k",   0x0000, 0x2000, CRC(3c6299a8) SHA1(a21a8452b75ce6174076878128d4f20b39b6d69d) )
271   ROM_LOAD( "3m",   0x2000, 0x2000, CRC(8d09056c) SHA1(4d2585103cc6e6c04015501d3c9e1578a8f9c0f5) )
272   ROM_LOAD( "3n",   0x4000, 0x2000, CRC(17b5a775) SHA1(d85c3371080bea82f19ac96fa0f1b332e1c86e27) )
273   ROM_LOAD( "3q",   0x6000, 0x2000, CRC(2e5fa773) SHA1(9a34fa43bde021fc7b00d8c3762c248e7b96dbf1) )
274
275   ROM_REGION(  0x8000 , REGION_CPU2, 0 )   /* sound CPU */
276   ROM_LOAD( "ta-s-1a-", 0x6000, 0x2000, CRC(ea8a05cb) SHA1(5683e4dca93066ee788287ab73a766fa303ebe84) )
277
278   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
279   ROM_LOAD( "ta-a-3e", 0x00000, 0x2000, CRC(e49f7ad8) SHA1(915de1084fd3c5fc81dd8c80107c28cc57b33226) )
280   ROM_LOAD( "ta-a-3d", 0x02000, 0x2000, CRC(06eef241) SHA1(4f327a54169046d8d84b5f5cf5d9f45e1df4dae6) )
281   ROM_LOAD( "ta-a-3c", 0x04000, 0x2000, CRC(7ff5482f) SHA1(fe8c181fed113007d69d11e8aa467e86a6357ffb) )   /* characters */
282
283   ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
284   ROM_LOAD( "5j",        0x00000, 0x2000, CRC(89409130) SHA1(3f37f820b1b86166cde7c039d657ebd036d490dd) )   /* sprites */
285   ROM_LOAD( "ta-b-5h", 0x02000, 0x2000, CRC(f8cff29d) SHA1(dabf3bbf50f73a381056131c2239c84dd966b63e) )
286   ROM_LOAD( "5e",        0x04000, 0x2000, CRC(5460a467) SHA1(505c1d9e69c39a74369da17f354b90486ee6afcd) )
287   ROM_LOAD( "ta-b-5d", 0x06000, 0x2000, CRC(cd473d47) SHA1(854cb532bd62851a206da2affd66a1257b7085b6) )
288   ROM_LOAD( "5c",        0x08000, 0x2000, CRC(4a20637a) SHA1(74099cb7f1727c2de2f066497097f1a9eeec0cea) )
289   ROM_LOAD( "ta-b-5a", 0x0a000, 0x2000, CRC(0012792a) SHA1(b4380f5fbe5e9ce9b44f87ce48a8b402bab58b52) )
290
291   ROM_REGION( 0x0320, REGION_PROMS, 0 )
292   ROM_LOAD( "ta-a-5a", 0x0000, 0x0100, CRC(01de1167) SHA1(b9070f8c70eb362fc4d6a0a92235ce0a5b2ab858) ) /* chars palette low 4 bits */
293   ROM_LOAD( "ta-a-5b", 0x0100, 0x0100, CRC(efd11d4b) SHA1(7c7c356063ab35e4ffb8d65cd20c27c2a4b36537) ) /* chars palette high 4 bits */
294   ROM_LOAD( "ta-b-1b", 0x0200, 0x0020, CRC(f94911ea) SHA1(ad61a323476a97156a255a72048a28477b421284) ) /* sprites palette */
295   ROM_LOAD( "ta-b-3d", 0x0220, 0x0100, CRC(ed3e2aa4) SHA1(cfdfc151803080d1ecdd04af1bfea3dbdce8dca0) ) /* sprites lookup table */
296ROM_END
297
298
299
300/*************************************
301 *
302 *  Game drivers
303 *
304 *************************************/
305
306GAME( 1983, troangel,        0, m57, troangel, 0, ROT0, "Irem", "Tropical Angel", 0 )
307GAME( 1983, newtangl, troangel, m57, troangel, 0, ROT0, "Irem", "New Tropical Angel", 0 )
src/mame/drivers/peplus.c
r1649r1650
151151***********************************************************************************/
152152
153153#include "driver.h"
154#include "deprecat.h"
154155#include "sound/ay8910.h"
155156#include "cpu/i8051/i8051.h"
156157#include "machine/i2cmem.h"
r1649r1650
189190static UINT8 *io_port;
190191
191192/* Coin, Door, Hopper and EEPROM States */
192static UINT32 last_cycles;
193static UINT64 last_cycles;
193194static UINT8 coin_state = 0;
194static UINT32 last_door;
195static UINT64 last_door;
195196static UINT8 door_open = 0;
196static UINT32 last_coin_out;
197static UINT64 last_coin_out;
197198static UINT8 coin_out_state = 0;
198199static int sda_dir = 0;
199200
r1649r1650
521522   UINT8 bank_a = 0x50; // Turn Off Low Battery and Hopper Full Statuses
522523   UINT8 coin_optics = 0x00;
523524    UINT8 coin_out = 0x00;
524   UINT32 curr_cycles = activecpu_gettotalcycles();
525   UINT64 curr_cycles = activecpu_gettotalcycles();
525526
526527   UINT8 sda = 0;
527528   if(!sda_dir)
src/mame/drivers/segas24.c
r1649r1650
332332*/
333333
334334#include "driver.h"
335#include "deprecat.h"
335336#include "cpu/m68000/m68k.h"
336337#include "segas24.h"
337338#include "system16.h"
r1649r1650
22882289/* 01 */GAME( 1988, hotrodj,  hotrod,   system24, hotrodj,  hotrod,   ROT0,   "Sega", "Hot Rod (Japan, 4 Players, Floppy Based)", GAME_NO_SOUND )
22892290/* 02 */GAME( 1988, sspirits, 0,        system24, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based)", 0 )
22902291/* 02 */GAME( 1988, sspiritj, sspirits, system24, sspirits, sspiritj, ROT270, "Sega", "Scramble Spirits (Japan, Floppy DS3-5000-02-REV-A Based)", 0 )
2291/* 02 */GAME( 1988, sspirtfc, sspirits, system24, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World set 2?, Floppy Based, FD1094 317-0058-02c)",GAME_NOT_WORKING ) /* MISSING disk image */
2292/* 02 */GAME( 1988, sspirtfc, sspirits, system24, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based, FD1094 317-0058-02c)",GAME_NOT_WORKING ) /* MISSING disk image */
22922293/* 03 */GAME( 1988, gground,  0,        system24, gground,  gground,  ROT270, "Sega", "Gain Ground (World, 3 Players, Floppy Based, FD1094 317-0058-03c?)", 0 )
22932294/* 03 */GAME( 1988, ggroundj, gground,  system24, gground,  gground,  ROT270, "Sega", "Gain Ground (Japan, 2 Players, Floppy Based, FD1094 317-0058-03b)", 0 )
22942295/* 04 */GAME( 1989, crkdown,  0,        system24, crkdown,  crkdown,  ROT0,   "Sega", "Crack Down (World, Floppy Based, FD1094 317-0058-04c)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
src/mame/drivers/ddayjlc.c
r1649r1650
5252*/
5353
5454#include "driver.h"
55#include "deprecat.h"
5556#include "sound/ay8910.h"
5657
5758static INT32 char_bank = 0;
r1649r1650
574575
575576}
576577
577GAME( 1984, ddayjlc,  0,       ddayjlc, ddayjlc, ddayjlc, ROT90, "Jaleco", "D-Day (Jaleco - set 1)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
578GAME( 1984, ddayjlca, ddayjlc, ddayjlc, ddayjlc, ddayjlc, ROT90, "Jaleco", "D-Day (Jaleco - set 2)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
578GAME( 1984, ddayjlc,  0,       ddayjlc, ddayjlc, ddayjlc, ROT90, "Jaleco", "D-Day (Jaleco set 1)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
579GAME( 1984, ddayjlca, ddayjlc, ddayjlc, ddayjlc, ddayjlc, ROT90, "Jaleco", "D-Day (Jaleco set 2)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
src/mame/drivers/segas16a.c
r1649r1650
77    Known bugs:
88        * none at this time
99
10    DIP locations verified from manual for:
11        * aceattaa
12        * aliensyn
13        * aliensy1
14        * pshot16a
15        * quartet
16        * quart2
17        * shinobi
18        * tetris
19        * timescan
20        * wb3
21
1022***************************************************************************
1123
1224System16A Hardware Overview
r1649r1650
132144*/
133145
134146#include "driver.h"
147#include "deprecat.h"
135148#include "system16.h"
136149#include "machine/8255ppi.h"
137150#include "cpu/i8039/i8039.h"
r1649r1650
912925   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
913926   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
914927
915   PORT_START_TAG("COINAGE")
916   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3,4")
928   PORT_START_TAG("DSW1")
929   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
917930   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
918931   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
919932   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
r1649r1650
930943   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
931944   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
932945   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
933   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:5,6,7,8")
946   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
934947   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
935948   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
936949   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
r1649r1650
948961   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
949962   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
950963
951   PORT_START_TAG("DSW")
952   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:1")
953   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
954   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
955   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:2")
956   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
957   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
958   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:3")
959   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
960   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
961   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:4")
962   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
963   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
964   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:5")
965   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
966   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
967   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:6")
968   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
969   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
970   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:7")
971   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
972   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
973   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:8")
974   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
975   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
964   PORT_START_TAG("DSW2")
965   PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0001, "SW2:1" )
966   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW2:2" )
967   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW2:3" )
968   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW2:4" )
969   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" )
970   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" )
971   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" )
972   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW2:8" )
976973INPUT_PORTS_END
977974
978975
r1649r1650
10521049   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_PLAYER(2)
10531050   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_PLAYER(2)
10541051
1055   PORT_MODIFY("DSW")
1056   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
1052   PORT_MODIFY("DSW2")
1053   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
10571054   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10581055   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1059   PORT_DIPNAME( 0x0e, 0x0e, "Starting Points" )  PORT_DIPLOCATION("SWB:2,3,4")
1056   PORT_DIPNAME( 0x0e, 0x0e, "Starting Points" )  PORT_DIPLOCATION("SW2:2,3,4")
10601057   PORT_DIPSETTING(    0x06, "2000" )
10611058   PORT_DIPSETTING(    0x0a, "3000" )
10621059   PORT_DIPSETTING(    0x0c, "4000" )
r1649r1650
10651062   PORT_DIPSETTING(    0x04, "7000" )
10661063   PORT_DIPSETTING(    0x02, "8000" )
10671064   PORT_DIPSETTING(    0x00, "9000" )
1068   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:5")
1069   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1070   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1071   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:6")
1072   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1073   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1074   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:7")
1075   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1076   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1077   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:8")
1078   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1079   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1065   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SW2:5,6")
1066   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1067   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1068   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1069   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1070   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
1071   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1072   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1073   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1074   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
10801075
10811076   PORT_START_TAG("ANALOGX1")
10821077   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(75) PORT_KEYDELTA(5) PORT_REVERSE
r1649r1650
11001095static INPUT_PORTS_START( afighter )
11011096   PORT_INCLUDE( system16a_2button )
11021097
1103   PORT_MODIFY("DSW")
1104   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
1098   PORT_MODIFY("DSW2")
1099   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
11051100   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
11061101   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1107   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1102   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
11081103   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11091104   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1110   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1105   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
11111106   PORT_DIPSETTING(    0x08, "2" )
11121107   PORT_DIPSETTING(    0x0c, "3" )
11131108   PORT_DIPSETTING(    0x04, "4" )
11141109   PORT_DIPSETTING(    0x00, DEF_STR( Infinite ) )
1115   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5,6")
1110   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6")
11161111   PORT_DIPSETTING(    0x30, "10000 - 20000" )
11171112   PORT_DIPSETTING(    0x20, "20000 - 40000" )
11181113   PORT_DIPSETTING(    0x10, "30000 - 60000" )
11191114   PORT_DIPSETTING(    0x00, "40000 - 80000" )
1120   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7")
1115   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7")
11211116   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
11221117   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1123   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWB:8")
1118   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:8")
11241119   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
11251120   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
11261121INPUT_PORTS_END
r1649r1650
11291124static INPUT_PORTS_START( alexkidd )
11301125   PORT_INCLUDE( system16a_2button )
11311126
1132   PORT_MODIFY("DSW")
1133   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Continues ) ) PORT_DIPLOCATION("SWB:1")
1127   PORT_MODIFY("DSW2")
1128   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Continues ) ) PORT_DIPLOCATION("SW2:1")
11341129   PORT_DIPSETTING(    0x01, "Only before level 5" )
11351130   PORT_DIPSETTING(    0x00, "Unlimited" )
1136   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1131   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
11371132   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11381133   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1139   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1134   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
11401135   PORT_DIPSETTING(    0x0c, "3" )
11411136   PORT_DIPSETTING(    0x08, "4" )
11421137   PORT_DIPSETTING(    0x04, "5" )
11431138   PORT_DIPSETTING(    0x00, "240 (Cheat)")
1144   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5,6")
1139   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6")
11451140   PORT_DIPSETTING(    0x20, "10000" )
11461141   PORT_DIPSETTING(    0x30, "20000" )
11471142   PORT_DIPSETTING(    0x10, "40000" )
11481143   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1149   PORT_DIPNAME( 0xc0, 0xc0, "Time Adjust" ) PORT_DIPLOCATION("SWB:7,8")
1144   PORT_DIPNAME( 0xc0, 0xc0, "Time Adjust" ) PORT_DIPLOCATION("SW2:7,8")
11501145   PORT_DIPSETTING(    0x80, "70" )
11511146   PORT_DIPSETTING(    0xc0, "60" )
11521147   PORT_DIPSETTING(    0x40, "50" )
r1649r1650
11571152static INPUT_PORTS_START( aliensyn )
11581153   PORT_INCLUDE( system16a_1button )
11591154
1160   PORT_MODIFY("DSW")
1161   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1155   PORT_MODIFY("DSW2")
1156   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
11621157   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11631158   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1164   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1159   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
11651160   PORT_DIPSETTING(    0x08, "2" )
11661161   PORT_DIPSETTING(    0x0c, "3" )
11671162   PORT_DIPSETTING(    0x04, "4" )
1168   PORT_DIPSETTING(    0x00, "127 (Cheat)")
1169   PORT_DIPNAME( 0x30, 0x30, "Timer" ) PORT_DIPLOCATION("SWB:5,6")
1163   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1164   PORT_DIPNAME( 0x30, 0x30, "Timer" ) PORT_DIPLOCATION("SW2:5,6")
11701165   PORT_DIPSETTING(    0x00, "120" )
11711166   PORT_DIPSETTING(    0x10, "130" )
11721167   PORT_DIPSETTING(    0x20, "140" )
11731168   PORT_DIPSETTING(    0x30, "150" )
1174   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1169   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
11751170   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
11761171   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
11771172   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
11821177static INPUT_PORTS_START( aliensy1 )
11831178   PORT_INCLUDE( system16a_1button )
11841179
1185   PORT_MODIFY("DSW")
1186   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1180   PORT_MODIFY("DSW2")
1181   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
11871182   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11881183   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1189   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1184   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
11901185   PORT_DIPSETTING(    0x08, "2" )
11911186   PORT_DIPSETTING(    0x0c, "3" )
11921187   PORT_DIPSETTING(    0x04, "4" )
1193   PORT_DIPSETTING(    0x00, "127 (Cheat)")
1194   PORT_DIPNAME( 0x30, 0x30, "Timer" ) PORT_DIPLOCATION("SWB:5,6")
1188   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1189   PORT_DIPNAME( 0x30, 0x30, "Timer" ) PORT_DIPLOCATION("SW2:5,6")
11951190   PORT_DIPSETTING(    0x00, "150" )
11961191   PORT_DIPSETTING(    0x10, "160" )
11971192   PORT_DIPSETTING(    0x20, "170" )
11981193   PORT_DIPSETTING(    0x30, "180" )
1199   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1194   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
12001195   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
12011196   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
12021197   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
12071202static INPUT_PORTS_START( bodyslam )
12081203   PORT_INCLUDE( system16a_generic )
12091204
1210   PORT_MODIFY("DSW")
1211   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1205   PORT_MODIFY("DSW2")
1206   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
12121207   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
12131208   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12141209INPUT_PORTS_END
r1649r1650
12171212static INPUT_PORTS_START( fantzone )
12181213   PORT_INCLUDE( system16a_2button )
12191214
1220   PORT_MODIFY("DSW")
1221   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
1215   PORT_MODIFY("DSW2")
1216   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
12221217   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
12231218   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1224   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1219   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
12251220   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
12261221   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1227   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1222   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
12281223   PORT_DIPSETTING(    0x08, "2" )
12291224   PORT_DIPSETTING(    0x0c, "3" )
12301225   PORT_DIPSETTING(    0x04, "4" )
12311226   PORT_DIPSETTING(    0x00, "240 (Cheat)")
1232   PORT_DIPNAME( 0x30, 0x30, "Extra Ship Cost" ) PORT_DIPLOCATION("SWB:5,6")
1227   PORT_DIPNAME( 0x30, 0x30, "Extra Ship Cost" ) PORT_DIPLOCATION("SW2:5,6")
12331228   PORT_DIPSETTING(    0x30, "5000" )
12341229   PORT_DIPSETTING(    0x20, "10000" )
12351230   PORT_DIPSETTING(    0x10, "15000" )
12361231   PORT_DIPSETTING(    0x00, "20000" )
1237   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1232   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
12381233   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
12391234   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
12401235   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
12551250   PORT_MODIFY("P2")
12561251   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_SPECIAL )
12571252
1258   PORT_MODIFY("DSW")
1259   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
1253   PORT_MODIFY("DSW2")
1254   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
12601255   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
12611256   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1262   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1257   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
12631258   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
12641259   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1265   PORT_DIPNAME( 0x0c, 0x00, "Starting Points" ) PORT_DIPLOCATION("SWB:3,4")
1260   PORT_DIPNAME( 0x0c, 0x00, "Starting Points" ) PORT_DIPLOCATION("SW2:3,4")
12661261   PORT_DIPSETTING(    0x0c, "2000" )
12671262   PORT_DIPSETTING(    0x08, "3000" )
12681263   PORT_DIPSETTING(    0x04, "5000" )
12691264   PORT_DIPSETTING(    0x00, "10000" )
1270   PORT_DIPNAME( 0x10, 0x10, "Team Select" ) PORT_DIPLOCATION("SWB:5")
1265   PORT_DIPNAME( 0x10, 0x10, "Team Select" ) PORT_DIPLOCATION("SW2:5")
12711266   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
12721267   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1273   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:6") //??? something to do with cocktail mode?
1268   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") //??? something to do with cocktail mode?
12741269   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
12751270   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1276   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:7")
1271   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7")
12771272   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
12781273   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1279   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:8")
1274   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8")
12801275   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12811276   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12821277
r1649r1650
13611356   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
13621357   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
13631358
1364   PORT_MODIFY("DSW")
1365   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
1359   PORT_MODIFY("DSW2")
1360   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
13661361   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13671362   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1368   PORT_DIPNAME( 0x0e, 0x00, "Initial Point" ) PORT_DIPLOCATION("SWB:2,3,4")
1363   PORT_DIPNAME( 0x0e, 0x0e, "Initial Point" ) PORT_DIPLOCATION("SW2:2,3,4")
13691364   PORT_DIPSETTING(    0x06, "2000" )
13701365   PORT_DIPSETTING(    0x0a, "3000" )
13711366   PORT_DIPSETTING(    0x0c, "4000" )
r1649r1650
13741369   PORT_DIPSETTING(    0x04, "7000" )
13751370   PORT_DIPSETTING(    0x02, "8000" )
13761371   PORT_DIPSETTING(    0x00, "9000" )
1377   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SWB:5,6")
1372   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SW2:5,6")
13781373   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
13791374   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
13801375   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
13811376   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1382   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1377   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
13831378   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
13841379   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
13851380   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
14301425   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN4 )
14311426   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
14321427
1433   PORT_MODIFY("DSW")
1434   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
1428   PORT_MODIFY("DSW2")
1429   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
14351430   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
14361431   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1437   PORT_DIPNAME( 0x06, 0x06, "Credit Power" ) PORT_DIPLOCATION("SWB:2,3")
1432   PORT_DIPNAME( 0x06, 0x06, "Credit Power" ) PORT_DIPLOCATION("SW2:2,3")
14381433   PORT_DIPSETTING(    0x04, "500" )
14391434   PORT_DIPSETTING(    0x06, "1000" )
14401435   PORT_DIPSETTING(    0x02, "2000" )
14411436   PORT_DIPSETTING(    0x00, "9000" )
1442   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:4,5")
1437   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,5")
14431438   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
14441439   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
14451440   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
14461441   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1447   PORT_DIPNAME( 0x20, 0x20, "Coin During Game" ) PORT_DIPLOCATION("SWB:6")
1442   PORT_DIPNAME( 0x20, 0x20, "Coin During Game" ) PORT_DIPLOCATION("SW2:6")
14481443   PORT_DIPSETTING(    0x20, "Power" )
14491444   PORT_DIPSETTING(    0x00, "Credit" )
1450   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SWB:7")
1445   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:7")
14511446   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
14521447   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1453   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1448   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW2:8" )
14541449INPUT_PORTS_END
14551450
14561451
14571452static INPUT_PORTS_START( quart2 )
14581453   PORT_INCLUDE( system16a_2button )
14591454
1460   PORT_MODIFY("DSW")
1461   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
1455   PORT_MODIFY("DSW2")
1456   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
14621457   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
14631458   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1464   PORT_DIPNAME( 0x06, 0x06, "Credit Power" ) PORT_DIPLOCATION("SWB:2,3")
1459   PORT_DIPNAME( 0x06, 0x06, "Credit Power" ) PORT_DIPLOCATION("SW2:2,3")
14651460   PORT_DIPSETTING(    0x04, "500" )
14661461   PORT_DIPSETTING(    0x06, "1000" )
14671462   PORT_DIPSETTING(    0x02, "2000" )
14681463   PORT_DIPSETTING(    0x00, "9000" )
1469   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:4,5")
1464   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,5")
14701465   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
14711466   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
14721467   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
r1649r1650
14971492   PORT_MODIFY("P2")
14981493   PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
14991494
1500   PORT_MODIFY("DSW")
1501   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWB:1")
1495   PORT_MODIFY("DSW2")
1496   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:1")
15021497   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
15031498   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1504   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1499   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
15051500   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
15061501   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1507   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1502   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
15081503   PORT_DIPSETTING(    0x08, "2" )
15091504   PORT_DIPSETTING(    0x0c, "3" )
15101505   PORT_DIPSETTING(    0x04, "4" )
15111506   PORT_DIPSETTING(    0x00, "Free")
1512   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
1507   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
15131508   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
15141509   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
15151510   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
15161511   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1517   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:7,8")
1512   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7,8")
15181513   PORT_DIPSETTING(    0x80, "Every 50000" )
15191514   PORT_DIPSETTING(    0xc0, "50000" )
15201515   PORT_DIPSETTING(    0x40, "100000" )
r1649r1650
15371532static INPUT_PORTS_START( shinobi )
15381533   PORT_INCLUDE( system16a_generic )
15391534
1540   PORT_MODIFY("DSW")
1541   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
1535   PORT_MODIFY("DSW2")
1536   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
15421537   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
15431538   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1544   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1539   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
15451540   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
15461541   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1547   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1542   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
15481543   PORT_DIPSETTING(    0x08, "2" )
15491544   PORT_DIPSETTING(    0x0c, "3" )
15501545   PORT_DIPSETTING(    0x04, "5" )
1551   PORT_DIPSETTING(    0x00, "240 (Cheat)")
1552   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
1546   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1547   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
15531548   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
15541549   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
15551550   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
15561551   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1557   PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" ) PORT_DIPLOCATION("SWB:7")
1552   PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" ) PORT_DIPLOCATION("SW2:7")
15581553   PORT_DIPSETTING(    0x40, "Slow" )
15591554   PORT_DIPSETTING(    0x00, "Fast" )
1560   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SWB:8")
1555   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:8")
15611556   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
15621557   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
15631558INPUT_PORTS_END
r1649r1650
16271622   PORT_MODIFY("P2")
16281623   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
16291624
1630   PORT_MODIFY("DSW")
1631   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1625   PORT_MODIFY("DSW2")
1626   /* SW2:1,3,4,7,8 Unused according to manual.
1627    From the code SW2:3,4 looks like some kind of difficulty level,
1628    but all 4 levels points to the same place so it doesn't actually change anything!! */
1629   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
16321630   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
16331631   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1634   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) )    PORT_DIPLOCATION("SWB:3,4") // from the code it looks like some kind of difficulty
1635   PORT_DIPSETTING(    0x0c, "A" )                      // level, but all 4 levels points to the same place
1636   PORT_DIPSETTING(    0x08, "B" )                     // so it doesn't actually change anything!!
1637   PORT_DIPSETTING(    0x04, "C" )
1638   PORT_DIPSETTING(    0x00, "D" )
1639   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
1632   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
16401633   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
16411634   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
16421635   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
r1649r1650
16651658   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )  PORT_DIPLOCATION("SWE:5")
16661659   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
16671660   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
1668   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWE:6")
1669   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1670   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1671   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWE:7")
1672   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1673   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1674   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWE:8")
1675   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1676   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1661   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SWE:6" ) /* Listed as "Unused" */
1662   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SWE:7" ) /* Listed as "Unused" */
1663   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SWE:8" ) /* Listed as "Unused" */
16771664
16781665   PORT_MODIFY("P2")
16791666   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
16801667
1681   PORT_MODIFY("DSW")
1682   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
1668   PORT_MODIFY("DSW2")
1669   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
16831670   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
16841671   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1685   PORT_DIPNAME( 0x1e, 0x14, "Bonus" ) PORT_DIPLOCATION("SWB:2,3,4,5")
1686   PORT_DIPSETTING(    0x16, "Replay 1000000/2000000" )
1687   PORT_DIPSETTING(    0x14, "Replay 1200000/2500000" )
1688   PORT_DIPSETTING(    0x12, "Replay 1500000/3000000" )
1689   PORT_DIPSETTING(    0x10, "Replay 2000000/4000000" )
1690   PORT_DIPSETTING(    0x1c, "Replay 1000000" )
1691   PORT_DIPSETTING(    0x1e, "Replay 1200000" )
1692   PORT_DIPSETTING(    0x1a, "Replay 1500000" )
1693   PORT_DIPSETTING(    0x18, "Replay 1800000" )
1694   PORT_DIPSETTING(    0x0e, "ExtraBall 100000" )
1695   PORT_DIPSETTING(    0x0c, "ExtraBall 200000" )
1696   PORT_DIPSETTING(    0x0a, "ExtraBall 300000" )
1697   PORT_DIPSETTING(    0x08, "ExtraBall 400000" )
1698   PORT_DIPSETTING(    0x06, "ExtraBall 500000" )
1699   PORT_DIPSETTING(    0x04, "ExtraBall 600000" )
1700   PORT_DIPSETTING(    0x02, "ExtraBall 700000" )
1672   PORT_DIPNAME( 0x1e, 0x1e, "Extended Score" ) PORT_DIPLOCATION("SW2:2,3,4,5")
1673   PORT_DIPSETTING(    0x16, "Credit 1000000/2000000" )
1674   PORT_DIPSETTING(    0x14, "Credit 1200000/2500000" )
1675   PORT_DIPSETTING(    0x12, "Credit 1500000/3000000" )
1676   PORT_DIPSETTING(    0x10, "Credit 2000000/4000000" )
1677   PORT_DIPSETTING(    0x1c, "Credit 1000000" )
1678   PORT_DIPSETTING(    0x1e, "Credit 1200000" )
1679   PORT_DIPSETTING(    0x1a, "Credit 1500000" )
1680   PORT_DIPSETTING(    0x18, "Credit 1800000" )
1681   PORT_DIPSETTING(    0x0e, "Ball 100000" )
1682   PORT_DIPSETTING(    0x0c, "Ball 200000" )
1683   PORT_DIPSETTING(    0x0a, "Ball 300000" )
1684   PORT_DIPSETTING(    0x08, "Ball 400000" )
1685   PORT_DIPSETTING(    0x06, "Ball 500000" )
1686   PORT_DIPSETTING(    0x04, "Ball 600000" )
1687   PORT_DIPSETTING(    0x02, "Ball 700000" )
17011688   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1702   PORT_DIPNAME( 0x20, 0x20, "Match" ) PORT_DIPLOCATION("SWB:6")
1703   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1704   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1705   PORT_DIPNAME( 0x40, 0x40, "Pin Rebound" ) PORT_DIPLOCATION("SWB:7")
1689   PORT_DIPNAME( 0x20, 0x20, "Number Match" ) PORT_DIPLOCATION("SW2:6")
1690   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1691   PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
1692   PORT_DIPNAME( 0x40, 0x40, "Pin Rebound" ) PORT_DIPLOCATION("SW2:7")
17061693   PORT_DIPSETTING(    0x40, "Well" )
17071694   PORT_DIPSETTING(    0x00, "A Little" )
17081695   /*
r1649r1650
17101697        rebound strength and the resulting difficulty or ease in which the
17111698        ball goes out of play.
17121699    */
1713   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:8")
1700   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:8")
17141701   PORT_DIPSETTING(    0x80, "3" )
17151702   PORT_DIPSETTING(    0x00, "5" )
17161703INPUT_PORTS_END
r1649r1650
17191706static INPUT_PORTS_START( wb3 )
17201707   PORT_INCLUDE( system16a_2button )
17211708
1722   PORT_MODIFY("DSW")
1723   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1709   PORT_MODIFY("DSW2")
1710   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
17241711   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
17251712   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1726   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1713   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
17271714   PORT_DIPSETTING(    0x00, "2" )
17281715   PORT_DIPSETTING(    0x0c, "3" )
17291716   PORT_DIPSETTING(    0x08, "4" )
17301717   PORT_DIPSETTING(    0x04, "5" )
1731   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5")      //??
1732   PORT_DIPSETTING(    0x10, "5000/10000/18000/30000" )
1733   PORT_DIPSETTING(    0x00, "5000/15000/30000" )
1734   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:6")
1718   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5")
1719   PORT_DIPSETTING(    0x10, "50k/100k/180k/300k" )
1720   PORT_DIPSETTING(    0x00, "50k/150k/300k" )
1721   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6")
17351722   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
17361723   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1737   PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) PORT_DIPLOCATION("SWB:7")
1724   PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) PORT_DIPLOCATION("SW2:7")
17381725   PORT_DIPSETTING(    0x40, DEF_STR( No ) )   /* Normal game */
17391726   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )   /* Levels are selectable / Player is Invincible */
17401727   /* Swtches 1 & 8 are listed as "Always off" */
r1649r1650
31953182GAME( 1987, sdi,      0,        system16a_no7751, sdi,      sdi,         ROT0,   "Sega",           "SDI - Strategic Defense Initiative (Europe, System 16A, FD1089B 317-0027)", 0 )
31963183GAME( 1987, shinobi,  0,        system16a,        shinobi,  generic_16a, ROT0,   "Sega",           "Shinobi (set 5, System 16A, unprotected)", 0 )
31973184GAME( 1987, shinobi1, shinobi,  system16a,        shinobi,  generic_16a, ROT0,   "Sega",           "Shinobi (set 1, System 16A, FD1094 317-0050)", 0 )
3198GAME( 1987, shinobls, shinobi,  system16a,        shinobi,  generic_16a, ROT0,   "[Sega] (Star bootleg)", "Shinobi (Star bootleg, System 16A)", 0 )
3185GAME( 1987, shinobls, shinobi,  system16a,        shinobi,  generic_16a, ROT0,   "[Sega] (Star bootleg)", "Shinobi (Star bootleg, System 16A)", 0 )
31993186GAME( 1987, sjryuko1, sjryuko,  system16a,        sjryuko,  sjryukoa,    ROT0,   "White Board",    "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)", 0 )
32003187GAME( 1988, tetris,   0,        system16a_no7751, tetris,   generic_16a, ROT0,   "Sega",           "Tetris (set 4, Japan, System 16A, FD1094 317-0093)", 0 )
32013188GAME( 1988, tetris3,  tetris,   system16a_no7751, tetris,   generic_16a, ROT0,   "Sega",           "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)", 0 )
src/mame/drivers/neogeo.c
r1649r1650
8080****************************************************************************/
8181
8282#include "driver.h"
83#include "deprecat.h"
8384#include "neogeo.h"
8485#include "machine/pd4990a.h"
8586#include "cpu/z80/z80.h"
src/mame/drivers/konamigx.c
r1649r1650
9595 */
9696
9797#include "driver.h"
98#include "deprecat.h"
9899
99100#include "video/konamiic.h"
100101#include "cpu/m68000/m68000.h"
src/mame/drivers/segahang.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "system16.h"
1819#include "machine/segaic16.h"
1920#include "machine/8255ppi.h"
src/mame/drivers/sprcros2.c
r1649r1650
5555*/
5656
5757#include "driver.h"
58#include "deprecat.h"
5859#include "sound/sn76496.h"
5960
6061extern UINT8 *sprcros2_fgvideoram, *sprcros2_spriteram, *sprcros2_bgvideoram;
src/mame/drivers/carrera.c
r1649r1650
4242#define MASTER_CLOCK 22118400
4343
4444#include "driver.h"
45#include "deprecat.h"
4546#include "sound/ay8910.h"
4647#include "video/crtc6845.h"
4748
src/mame/drivers/thunderj.c
r1649r1650
1818
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/atarigen.h"
2223#include "audio/atarijsa.h"
2324#include "thunderj.h"
src/mame/drivers/ultraman.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/z80/z80.h"
1112#include "cpu/m68000/m68000.h"
1213#include "video/konamiic.h"
src/mame/drivers/parodius.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1112#include "video/konamiic.h"
1213#include "sound/2151intf.h"
src/mame/drivers/ladybug.c
r1649r1650
10031003
10041004GAME( 1981, cavenger, 0,       ladybug, cavenger, 0,       ROT0,   "Universal", "Cosmic Avenger", 0 )
10051005GAME( 1981, ladybug,  0,       ladybug, ladybug,  0,       ROT270, "Universal", "Lady Bug", 0 )
1006GAME( 1981, ladybugb, ladybug, ladybug, ladybug,  0,       ROT270, "bootleg",   "Lady Bug (bootleg)", 0 )
1007GAME( 1981, ladybgb2, ladybug, ladybug, ladybug,  0,       ROT270, "bootleg",   "Lady Bug (bootleg Set 2)", 0 )
1006GAME( 1981, ladybugb, ladybug, ladybug, ladybug,  0,       ROT270, "bootleg",   "Lady Bug (bootleg set 1)", 0 )
1007GAME( 1981, ladybgb2, ladybug, ladybug, ladybug,  0,       ROT270, "bootleg",   "Lady Bug (bootleg set 2)", 0 )
10081008GAME( 1982, dorodon,  0,       ladybug, dorodon,  dorodon, ROT270, "Falcon",    "Dorodon (set 1)", 0 )
10091009GAME( 1982, dorodon2, dorodon, ladybug, dorodon,  dorodon, ROT270, "Falcon",    "Dorodon (set 2)", 0 )
10101010GAME( 1982, snapjack, 0,       ladybug, snapjack, 0,       ROT0,   "Universal", "Snap Jack", 0 )
src/mame/drivers/yamato.c
r1649r1650
7171static PALETTE_INIT( yamato )
7272{
7373   int i;
74   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
75   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + (offs)])
7674
77
7875   /* chars - 12 bits RGB */
79   for (i = 0;i < 64;i++)
76   for (i = 0; i < 0x40; i++)
8077   {
81      int bit0,bit1,bit2,bit3,r,g,b;
78      int bit0, bit1, bit2, bit3;
79      int r, g, b;
8280
83
8481      /* red component */
85      bit0 = (color_prom[0] >> 0) & 0x01;
86      bit1 = (color_prom[0] >> 1) & 0x01;
87      bit2 = (color_prom[0] >> 2) & 0x01;
88      bit3 = (color_prom[0] >> 3) & 0x01;
82      bit0 = (color_prom[i + 0x00] >> 0) & 0x01;
83      bit1 = (color_prom[i + 0x00] >> 1) & 0x01;
84      bit2 = (color_prom[i + 0x00] >> 2) & 0x01;
85      bit3 = (color_prom[i + 0x00] >> 3) & 0x01;
8986      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
87
9088      /* green component */
91      bit0 = (color_prom[0] >> 4) & 0x01;
92      bit1 = (color_prom[0] >> 5) & 0x01;
93      bit2 = (color_prom[0] >> 6) & 0x01;
94      bit3 = (color_prom[0] >> 7) & 0x01;
89      bit0 = (color_prom[i + 0x00] >> 4) & 0x01;
90      bit1 = (color_prom[i + 0x00] >> 5) & 0x01;
91      bit2 = (color_prom[i + 0x00] >> 6) & 0x01;
92      bit3 = (color_prom[i + 0x00] >> 7) & 0x01;
9593      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
94
9695      /* blue component */
97      bit0 = (color_prom[64] >> 0) & 0x01;
98      bit1 = (color_prom[64] >> 1) & 0x01;
99      bit2 = (color_prom[64] >> 2) & 0x01;
100      bit3 = (color_prom[64] >> 3) & 0x01;
96      bit0 = (color_prom[i + 0x40] >> 0) & 0x01;
97      bit1 = (color_prom[i + 0x40] >> 1) & 0x01;
98      bit2 = (color_prom[i + 0x40] >> 2) & 0x01;
99      bit3 = (color_prom[i + 0x40] >> 3) & 0x01;
101100      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
102101
103      palette_set_color(machine,i,MAKE_RGB(r,g,b));
104      color_prom++;
102      palette_set_color(machine, i, MAKE_RGB(r, g, b));
105103   }
106   color_prom += 64;
107104
108105   /* big sprite - 8 bits RGB */
109   for (i = 0;i < 32;i++)
106   for (i = 0; i < 0x20; i++)
110107   {
111      int bit0,bit1,bit2,r,g,b;
108      int bit0, bit1, bit2;
109      int r, g, b;
112110
113
114111      /* red component */
115      bit0 = (*color_prom >> 0) & 0x01;
116      bit1 = (*color_prom >> 1) & 0x01;
117      bit2 = (*color_prom >> 2) & 0x01;
112      bit0 = (color_prom[i + 0x80] >> 0) & 0x01;
113      bit1 = (color_prom[i + 0x80] >> 1) & 0x01;
114      bit2 = (color_prom[i + 0x80] >> 2) & 0x01;
118115      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
116
119117      /* green component */
120      bit0 = (*color_prom >> 3) & 0x01;
121      bit1 = (*color_prom >> 4) & 0x01;
122      bit2 = (*color_prom >> 5) & 0x01;
118      bit0 = (color_prom[i + 0x80] >> 3) & 0x01;
119      bit1 = (color_prom[i + 0x80] >> 4) & 0x01;
120      bit2 = (color_prom[i + 0x80] >> 5) & 0x01;
123121      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
122
124123      /* blue component */
125124      bit0 = 0;
126      bit1 = (*color_prom >> 6) & 0x01;
127      bit2 = (*color_prom >> 7) & 0x01;
125      bit1 = (color_prom[i + 0x80] >> 6) & 0x01;
126      bit2 = (color_prom[i + 0x80] >> 7) & 0x01;
128127      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
129128
130      palette_set_color(machine,i+64,MAKE_RGB(r,g,b));
131      color_prom++;
129      palette_set_color(machine, i + 0x40, MAKE_RGB(r, g, b));
132130   }
133131
134
135   /* character and sprite lookup table */
136   /* they use colors 0-63 */
137   for (i = 0;i < TOTAL_COLORS(0);i++)
138   {
139      /* pen 0 always uses color 0 (background in River Patrol and Silver Land) */
140      if (i % 4 == 0) COLOR(0,i) = 0;
141      else COLOR(0,i) = i;
142   }
143
144   /* big sprite lookup table */
145   /* it uses colors 64-95 */
146   for (i = 0;i < TOTAL_COLORS(2);i++)
147   {
148      if (i % 4 == 0) COLOR(2,i) = 0;
149      else COLOR(2,i) = i + 64;
150   }
151
152132   /* fake colors for bg gradient */
153   for (i = 0;i < 256;i++)
154   {
155      palette_set_color(machine,i+16*4+8*4,MAKE_RGB(0,0,i));
156   }
133   for (i = 0; i < 0x100; i++)
134      palette_set_color(machine, i + 0x60, MAKE_RGB(0, 0, i));
157135}
158136
159137static PALETTE_INIT( toprollr )
160138{
161139   int i;
162140
163   for (i = 0;i < 32*5;i++)
141   for (i = 0; i < 32*5; i++)
164142   {
165      int bit0,bit1,bit2,r,g,b;
143      int bit0,bit1,bit2;
144      int r,g,b;
166145
167
168146      /* red component */
169147      bit0 = (color_prom[0] >> 0) & 0x01;
170148      bit1 = (color_prom[0] >> 1) & 0x01;
171149      bit2 = (color_prom[0] >> 2) & 0x01;
172
173
174150      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
175151
176152      /* green component */
177153      bit0 = (color_prom[0] >> 3) & 0x01;
178154      bit1 = (color_prom[0] >> 4) & 0x01;
179155      bit2 = (color_prom[0] >> 5) & 0x01;
180
181156      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
182157
183158      /* blue component */
184159      bit0 = 0;
185160      bit1 = (color_prom[0] >> 6) & 0x01;
186161      bit2 = (color_prom[0] >> 7) & 0x01;
187
188162      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
189163
190
191      palette_set_color(machine,i,MAKE_RGB(r,g,b));
164      palette_set_color(machine, i, MAKE_RGB(r, g, b));
192165      color_prom++;
193166   }
194167
r1649r1650
244217   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
245218   AM_RANGE(0x6000, 0x6fff) AM_WRITE(MWA8_RAM)
246219   AM_RANGE(0x7000, 0x7fff) AM_WRITE(MWA8_ROM)
247   AM_RANGE(0x8800, 0x88ff) AM_WRITE(cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
220   AM_RANGE(0x8800, 0x88ff) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
248221   AM_RANGE(0x8900, 0x8bff) AM_WRITE(MWA8_RAM)  /* not used, but initialized */
249222   AM_RANGE(0x9000, 0x93ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
250223//AM_RANGE(0x9400, 0x97ff) AM_WRITE(MWA8_RAM) /* mirror address, used by Crazy Climber to draw windows */
r1649r1650
307280   }
308281}
309282
310static ADDRESS_MAP_START( trmem_map, ADDRESS_SPACE_PROGRAM, 8 )
283static ADDRESS_MAP_START( toprollr_map, ADDRESS_SPACE_PROGRAM, 8 )
311284   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_BANK1)
312285   AM_RANGE(0x6000, 0x6bff) AM_RAM
313   AM_RANGE(0x8800, 0x88ff) AM_WRITE(cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
286   AM_RANGE(0x8800, 0x88ff) AM_RAM AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
314287   AM_RANGE(0x8c00, 0x8fff) AM_RAM AM_BASE(&toprollr_videoram3)
315288   AM_RANGE(0x9000, 0x93ff) AM_RAM AM_BASE(&videoram)
316289   AM_RANGE(0x9400, 0x97ff) AM_RAM AM_BASE(&toprollr_videoram4)
r1649r1650
330303ADDRESS_MAP_END
331304
332305
333static ADDRESS_MAP_START( trport_map, ADDRESS_SPACE_IO, 8 )
306static ADDRESS_MAP_START( toprollr_io_map, ADDRESS_SPACE_IO, 8 )
334307   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
335308   AM_RANGE(0x08, 0x08) AM_WRITE(AY8910_control_port_0_w)
336309   AM_RANGE(0x09, 0x09) AM_WRITE(AY8910_write_port_0_w)
r1649r1650
490463};
491464
492465
493static const gfx_layout trcharlayout =
466static const gfx_layout toprollr_charlayout =
494467{
495468   8,8,
496469   RGN_FRAC(1,2),
r1649r1650
501474   8*8
502475};
503476
504static const gfx_layout trspritelayout =
477static const gfx_layout toprollr_spritelayout =
505478{
506479   16,16,  /* 16*16 sprites */
507480   RGN_FRAC(1,2),    /* 128 sprites (64 in Crazy Climber) */
r1649r1650
523496   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, spritelayout,    0, 16 ) /* sprite set #2 */
524497GFXDECODE_END
525498
526static GFXDECODE_START( tr )
527   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, trcharlayout,      0, 40 )
528   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, trcharlayout,      0, 40 )
529   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, trspritelayout,    0, 40 )
530   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, trcharlayout,       0, 40 )
499static GFXDECODE_START( toprollr )
500   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, toprollr_charlayout,      0, 40 )
501   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, toprollr_charlayout,      0, 40 )
502   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, toprollr_spritelayout,    0, 40 )
503   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, toprollr_charlayout,      0, 40 )
531504GFXDECODE_END
532505
533506static MACHINE_DRIVER_START( yamato )
r1649r1650
553526   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
554527   MDRV_GFXDECODE(yamato)
555528   MDRV_PALETTE_LENGTH(96+256)
556   MDRV_COLORTABLE_LENGTH(16*4+8*4)
557529
558530   MDRV_PALETTE_INIT(yamato)
559531   MDRV_VIDEO_START(generic)
r1649r1650
573545
574546   /* basic machine hardware */
575547   MDRV_CPU_ADD(Z80, 3072000)
576   MDRV_CPU_PROGRAM_MAP(trmem_map,0)
577   MDRV_CPU_IO_MAP(trport_map,0)
548   MDRV_CPU_PROGRAM_MAP(toprollr_map,0)
549   MDRV_CPU_IO_MAP(toprollr_io_map,0)
578550   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
579551
580552   MDRV_SCREEN_REFRESH_RATE(60)
r1649r1650
586558   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
587559   MDRV_SCREEN_SIZE(32*8, 32*8)
588560   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
589   MDRV_GFXDECODE(tr)
561   MDRV_GFXDECODE(toprollr)
590562   MDRV_PALETTE_LENGTH(32*5)
591563   MDRV_PALETTE_INIT(toprollr)
592564
src/mame/drivers/blueprnt.c
r1649r1650
5151*/
5252
5353#include "driver.h"
54#include "deprecat.h"
5455#include "cpu/z80/z80.h"
5556#include "sound/ay8910.h"
5657
r1649r1650
311312   MDRV_SCREEN_SIZE(32*8, 32*8)
312313   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
313314   MDRV_GFXDECODE(blueprnt)
314   MDRV_PALETTE_LENGTH(16)
315   MDRV_COLORTABLE_LENGTH(128*4+8)
315   MDRV_PALETTE_LENGTH(128*4+8)
316316
317317   MDRV_PALETTE_INIT(blueprnt)
318318   MDRV_VIDEO_START(blueprnt)
src/mame/drivers/combatsc.c
r1649r1650
118118***************************************************************************/
119119
120120#include "driver.h"
121#include "deprecat.h"
121122#include "cpu/z80/z80.h"
122123#include "sound/2203intf.h"
123124#include "sound/upd7759.h"
r1649r1650
284285   AM_RANGE(0x0414, 0x0414) AM_WRITE(soundlatch_w)
285286   AM_RANGE(0x0418, 0x0418) AM_WRITE(combasc_sh_irqtrigger_w)
286287   AM_RANGE(0x041c, 0x041c) AM_WRITE(watchdog_reset_w)         /* watchdog reset? */
287   AM_RANGE(0x0600, 0x06ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram)
288   AM_RANGE(0x0600, 0x06ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
288289   AM_RANGE(0x0800, 0x1fff) AM_WRITE(MWA8_RAM)               /* RAM */
289290   AM_RANGE(0x2000, 0x3fff) AM_WRITE(combasc_video_w)
290291   AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_ROM)               /* banked ROM area */
r1649r1650
303304static ADDRESS_MAP_START( combascb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
304305   AM_RANGE(0x0000, 0x04ff) AM_WRITE(MWA8_RAM)
305306   AM_RANGE(0x0500, 0x0500) AM_WRITE(combascb_bankselect_w)
306   AM_RANGE(0x0600, 0x06ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram)
307   AM_RANGE(0x0600, 0x06ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
307308   AM_RANGE(0x0800, 0x1fff) AM_WRITE(MWA8_RAM)
308309   AM_RANGE(0x2000, 0x3fff) AM_WRITE(combasc_video_w)
309310   AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_BANK1) /* banked ROM/RAM area */
r1649r1650
679680   MDRV_SCREEN_SIZE(32*8, 32*8)
680681   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
681682   MDRV_GFXDECODE(combasc)
682   MDRV_PALETTE_LENGTH(128)
683   MDRV_COLORTABLE_LENGTH(8*16*16)
683   MDRV_PALETTE_LENGTH(8*16*16)
684684
685685   MDRV_PALETTE_INIT(combasc)
686686   MDRV_VIDEO_START(combasc)
r1649r1650
722722   MDRV_SCREEN_SIZE(32*8, 32*8)
723723   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
724724   MDRV_GFXDECODE(combascb)
725   MDRV_PALETTE_LENGTH(128)
726   MDRV_COLORTABLE_LENGTH(8*16*16)
725   MDRV_PALETTE_LENGTH(8*16*16)
727726
728727   MDRV_PALETTE_INIT(combascb)
729728   MDRV_VIDEO_START(combascb)
src/mame/drivers/rockrage.c
r1649r1650
4848***************************************************************************/
4949
5050#include "driver.h"
51#include "deprecat.h"
5152#include "cpu/m6809/m6809.h"
5253#include "cpu/hd6309/hd6309.h"
5354#include "video/konamiic.h"
src/mame/drivers/stvinit.c
r1649r1650
66*/
77
88#include "driver.h"
9#include "deprecat.h"
910#include "machine/eeprom.h"
1011#include "cpu/sh2/sh2.h"
1112#include "machine/stvprot.h"
src/mame/drivers/ttchamp.c
r1649r1650
4242*/
4343
4444#include "driver.h"
45#include "deprecat.h"
46
4547static UINT16 *peno_vram;
4648
4749
src/mame/drivers/egghunt.c
r1649r1650
4242*/
4343
4444#include "driver.h"
45#include "deprecat.h"
4546#include "sound/okim6295.h"
4647
4748static UINT8 *egghunt_bgram;
src/mame/drivers/buggychl.c
r1649r1650
7878***************************************************************************/
7979
8080#include "driver.h"
81#include "deprecat.h"
8182#include "cpu/z80/z80.h"
8283#include "cpu/m6805/m6805.h"
8384#include "sound/ay8910.h"
src/mame/drivers/segac2.c
r1649r1650
1313
1414    Year  Game                       Developer         Protection Chip  Board
1515    ====  ====================       ================  ===============  =====
16    1989  Bloxeed                    Sega / Elorg                       C
17    1990  Columns                    Sega                               C
18    1990  Columns II                 Sega                               C
19    1990  Borench                    Sega                               C2
20    1990  ThunderForce AC            Sega / Technosoft                  C2
21    1991  Twin Squash                Sega                               C2
22    1992  Ribbit!                    Sega                               C2
23    1992  Tant-R (Japan)             Sega              317-0211         C2
24    1992  Tant-R (Korea)             Sega                               C2
16    1989  Bloxeed                    Sega / Elorg      n/a              C
17    1990  Columns                    Sega              317-0149         C
18    1990  Columns II                 Sega              317-0160         C
19    1990  ThunderForce AC            Sega / Technosoft 317-0172         C2
20    1990  Borench                    Sega              317-0173         C2
21    1991  Twin Squash                Sega              317-0193         C2
22    1992  Ribbit!                    Sega              317-0178         C2
2523    1992  Puyo Puyo                  Sega / Compile    317-0203         C2
26    1994  Ichidant-R (World)         Sega                               C2
27    1994  Ichidant-R (Japan)         Sega                               C2
28    1994  Ichidant-R (Korea)         Sega                               C2
29    1994  PotoPoto (Japan)           Sega                               C2
30    1994  Puyo Puyo 2                Compile                            C2
24    1992  Tant-R (Japan)             Sega              317-0211         C2
25    1992  Tant-R (Korea)             Sega              ?                C2
26    1994  PotoPoto (Japan)           Sega              317-0218         C2
27    1994  Stack Columns (Japan)      Sega              317-0219         C2
3128    1994  Stack Columns (World)      Sega              317-0223         C2
32    1994  Stack Columns (Japan)      Sega                               C2
33    1994  Zunzunkyou No Yabou        Sega                               C2
29    1994  Ichidant-R (Japan)         Sega              317-0224         C2
30    1994  Ichidant-R (World)         Sega              ?                C2
31    1994  Ichidant-R (Korea)         Sega              ?                C2
32    1994  Puyo Puyo 2                Compile           317-0228         C2
33    1994  Zunzunkyou No Yabou        Sega              ?                C2
3434
35        + Print Club Vols 1,2,4,5 (and 3?)
35    1995  Print Club (Vol.1)         Atlus             ?                C2
36    1995  Print Club (Vol.2)         Atlus             ?                C2
37    1996  Print Club (Vol.4)         Atlus             ?                C2
38    1996  Print Club (Vol.5)         Atlus             ?                C2
3639
3740
3841     Notes:
r1649r1650
7881
7982
8083#include "driver.h"
84#include "deprecat.h"
8185#include "cpu/m68000/m68000.h"
8286#include "genesis.h"
8387
r1649r1650
100104static UINT8       misc_io_data[0x10];   /* holds values written to the I/O chip */
101105
102106/* protection-related tracking */
103static const UINT32 *prot_table;      /* table of protection values */
107static int (*prot_func)(int in);      /* emulation of protection chip */
104108static UINT8       prot_write_buf;      /* remembers what was written */
105109static UINT8      prot_read_buf;      /* remembers what was returned */
106110
r1649r1650
517521/* protection chip reads */
518522static READ16_HANDLER( prot_r )
519523{
520   if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", activecpu_get_previouspc(), prot_table ? prot_read_buf : 0xff);
524   if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", activecpu_get_previouspc(), prot_func ? prot_read_buf : 0xff);
521525   return prot_read_buf | 0xf0;
522526}
523527
r1649r1650
540544   prot_write_buf = data & 0x0f;
541545
542546   /* determine the value to return, should a read occur */
543   if (prot_table)
544      prot_read_buf = (prot_table[table_index >> 3] << (4 * (table_index & 7))) >> 28;
547   if (prot_func)
548      prot_read_buf = prot_func(table_index);
545549   if (LOG_PROTECTION) logerror("%06X:protection w=%02X, new result=%02X\n", activecpu_get_previouspc(), data & 0x0f, prot_read_buf);
546550
547551   /* if the palette changed, force an update */
r1649r1650
17301734    Machine Init Functions
17311735*******************************************************************************
17321736
1733    All of the Sega C/C2 games apart from Bloxeed used a protection chip.
1734    The games contain various checks which make sure this protection chip is
1735    present and returning the expected values.  The chip uses a table of
1736    256x4-bit values to produce its results.  It appears that different
1737    tables are used for Japanese vs. English variants of some games
1738    (Puzzle & Action 2) but not others (Columns).
1737All of the Sega C/C2 games apart from Bloxeed used a protection chip.
1738The games contain various checks which make sure this protection chip is
1739present and returning the expected values. It appears that different
1740tables are used for Japanese vs. English variants of some games
1741(Puzzle & Action 2) but not others (Columns).
17391742
1743
1744The basic operation in the EPM5032 macrocell (that is, without using the expander
1745products) is:
1746
1747out = x1 XOR (x2 OR x3 OR x4)
1748
1749where x1, x2, x3, and x4 are the AND of any number of input bits. Each input can
1750be inverted. The inputs come either from the external pins or from feedback from
1751the output pins.
1752
1753Expander products (64 in total) are the NOT of the AND of any number of input bits
1754(optionally inverted). It's not clear whether the I/O feedback is available to
1755the expander or not. Looking at bit 1 of prot_func_tfrceac(), it would seem that
1756it should be, otherwise I don't see how the formula could be computed.
1757
17401758******************************************************************************/
17411759
1742static void segac2_common_init(const UINT32 *table)
1760static void segac2_common_init(int (*func)(int in))
17431761{
1744   prot_table = table;
1762   prot_func = func;
17451763   bloxeed_sound = 0;
17461764}
17471765
17481766
1749static DRIVER_INIT( c2boot )
1767
1768/* 317-0149 */
1769static int prot_func_columns(int in)
17501770{
1751   segac2_common_init(NULL);
1771   int const b0 = BIT( in,2) ^ ((BIT(~in,0) && BIT( in,7)) || (BIT( in,4) && BIT( in,6)));
1772   int const b1 = BIT(~in,0) ^ (BIT( in,2) || (BIT( in,5) && BIT(~in,6) && BIT( in,7)));
1773   int const b2 = BIT( in,3) ^ ((BIT( in,0) && BIT( in,1)) || (BIT( in,4) && BIT( in,6)));
1774   int const b3 = BIT( in,1) ^ ((BIT( in,0) && BIT( in,1)) || (BIT( in,4) && BIT( in,5)) || (BIT(~in,6) && BIT( in,7)));   // 1 repeated
1775
1776   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
17521777}
17531778
1779/* 317-0160 */
1780static int prot_func_columns2(int in)
1781{
1782   int const b0 =  BIT( in,2) ^ (BIT( in,1) || (BIT( in,4) && BIT( in,5)));
1783   int const b1 = (BIT( in,0) && BIT( in,3) && BIT( in,4)) ^ (BIT( in,6) || (BIT( in,5) && BIT( in,7)));
1784   int const b2 = (BIT( in,3) && BIT(~in,2) && BIT( in,4)) ^ (BIT( in,5) || (BIT( in,0) && BIT( in,1)) || (BIT( in,4) && BIT( in,6)));   // 4 repeated
1785   int const b3 = (BIT( in,1) && BIT( in,0) && BIT( in,2)) ^ ((BIT( in,4) && BIT(~in,6)) || (BIT( in,6) && BIT( in,7)));   // 6 repeated
17541786
1755static DRIVER_INIT( bloxeedc )
1787   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1788}
1789
1790/* 317-0172 */
1791static int prot_func_tfrceac(int in)
17561792{
1757   segac2_common_init(NULL);
1758   bloxeed_sound = 1;
1793   int const b0 = BIT(~in,2) ^ ((BIT( in,0) && BIT(~in,7)) || (BIT( in,3) && BIT( in,4)));
1794   int const b1 = (BIT( in,4) && BIT(~in,5) && BIT( in,7)) ^ ((BIT(~in,0) || BIT(~in,3)) && (BIT(~in,6) || BIT(~in,7)));   // not in the form x1 XOR (x2 OR x3 OR x4)
1795   int const b2 = BIT( in,2) ^ ((BIT( in,4) && BIT(~in,5) && BIT( in,7)) || (BIT(~in,1) && BIT( in,6)));
1796   int const b3 = BIT( in,0) ^ ((BIT( in,1) && BIT( in,4) && BIT( in,6)) || (BIT( in,1) && BIT( in,4) && BIT( in,7)));   // 1,4 repeated
1797
1798   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
17591799}
17601800
1801/* 317-0173 */
1802static int prot_func_borench(int in)
1803{
1804   int const b0 = (BIT( in,1) && BIT( in,2) && BIT( in,3) && BIT( in,7))   ^ (BIT( in,5) || (BIT(~in,0) && BIT(~in,4)));
1805   int const b1 = (BIT(~in,2) && BIT( in,3) && BIT( in,5))                 ^ (BIT( in,1) || (BIT( in,0) && BIT(~in,4)));
1806   int const b2 = (BIT( in,1) && BIT(~in,4) && BIT(~in,6))                 ^ (BIT( in,2) || BIT( in,3) || (BIT( in,5) && BIT( in,7)));
1807   int const b3 = (BIT(~in,0) && BIT( in,5) && (BIT( in,6) || BIT( in,7))) ^ (BIT( in,1) || (BIT( in,3) && BIT( in,4)));   // not in the form x1 XOR (x2 OR x3 OR x4)
17611808
1762static DRIVER_INIT( columns )
1809   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1810}
1811
1812/* 317-0178 */
1813static int prot_func_ribbit(int in)
17631814{
1764   static const UINT32 table[256/8] =
1765   {
1766      0x20a41397, 0x64e057d3, 0x20a41397, 0x64e057d3,
1767      0x20a41397, 0x64e057d3, 0xa8249b17, 0xec60df53,
1768      0x20a41397, 0x64e057d3, 0x75f546c6, 0x31b10282,
1769      0x20a41397, 0x64e057d3, 0xfd75ce46, 0xb9318a02,
1770      0xb8348b07, 0xfc70cf43, 0xb8348b07, 0xfc70cf43,
1771      0x9a168b07, 0xde52cf43, 0x9a168b07, 0xde52cf43,
1772      0x30b40387, 0x74f047c3, 0x75f546c6, 0x31b10282,
1773      0x30b40387, 0x74f047c3, 0xfd75ce46, 0xb9318a02
1774   };
1775   segac2_common_init(table);
1815   int const b0 = (BIT( in,0) && BIT( in,4)) ^ ((BIT( in,1) && BIT( in,2)) || BIT( in,3) || BIT(~in,5));
1816   int const b1 = (BIT( in,1) && BIT( in,5)) ^ ((BIT( in,2) && BIT( in,3)) || BIT( in,0) || BIT(~in,6));
1817   int const b2 = (BIT( in,2) && BIT( in,7)) ^ ((BIT( in,3) && BIT( in,0)) || BIT(~in,1) || BIT( in,7));
1818   int const b3 = (BIT( in,3) && BIT( in,6)) ^ ((BIT( in,0) && BIT( in,1)) || BIT(~in,2) || BIT( in,4));
1819
1820   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
17761821}
17771822
1823/* 317-0193 */
1824static int prot_func_twinsqua(int in)
1825{
1826   int const b0 = (BIT( in,2) && BIT(~in,5)) ^ (BIT( in,3) || BIT(~in,4));
1827   int const b1 = (BIT( in,0) && BIT(~in,2) && BIT( in,4)) ^ (BIT(~in,0) || BIT(~in,4) || BIT(~in,6));   // 0,4 repeated
1828   int const b2 = (BIT( in,3) && BIT(~in,5)) ^ (BIT( in,4) && BIT( in,7));
1829   int const b3 =  BIT( in,1) ^ ((BIT(~in,3) && BIT(~in,6)) || (BIT( in,4) && BIT(~in,6)) || (BIT(~in,1) && BIT( in,3) && BIT(~in,4)));   // 1,3,4,6 repeated
17781830
1779static DRIVER_INIT( columns2 )
1831   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1832}
1833
1834/* 317-0203 */
1835static int prot_func_puyo(int in)
17801836{
1781   static const UINT32 table[256/8] =
1782   {
1783      0x0015110c, 0x0015110c, 0x889d9984, 0xcedb9b86,
1784      0x4455554c, 0x4455554c, 0xddddccc4, 0x9b9bcec6,
1785      0x2237332e, 0x2237332e, 0x6677776e, 0x2031756c,
1786      0x6677776e, 0x6677776e, 0x7777666e, 0x3131646c,
1787      0x0015110c, 0x0015110c, 0x889d9984, 0xcedb9b86,
1788      0x6677776e, 0x6677776e, 0xffffeee6, 0xb9b9ece4,
1789      0xaabfbba6, 0xaabfbba6, 0xeeffffe6, 0xa8b9fde4,
1790      0xeeffffe6, 0xeeffffe6, 0xffffeee6, 0xb9b9ece4
1791   };
1792   segac2_common_init(table);
1837   int const b0 = (BIT(~in,3) && BIT( in,7)) ^ ((BIT(~in,0) && BIT(~in,1)) || (BIT(~in,1) && BIT(~in,4)));   // 1 repeated
1838   int const b1 = (BIT( in,3) && BIT( in,5)) ^ (BIT(~in,2) || BIT( in,4) || BIT( in,6));
1839   int const b2 = (BIT(~in,2) && BIT(~in,5)) ^ (BIT( in,1) || BIT(~in,3) || BIT(~in,6));
1840   int const b3 =  BIT( in,1)                ^ ((BIT( in,0) && BIT( in,3) && BIT( in,7)) || BIT( in,4));
1841
1842   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
17931843}
17941844
1845/* 317-0211 */
1846static int prot_func_tantr(int in)
1847{
1848   int const b0 = (BIT( in,0) && BIT( in,4)) ^ ( BIT( in,5) || BIT(~in,6)  || (BIT(~in,3) && BIT( in,7)));
1849   int const b1 = (BIT( in,2) && BIT( in,6)) ^ ((BIT( in,1) && BIT( in,5)) || (BIT( in,3) && BIT( in,4)));
1850   int const b2 = (BIT(~in,0) && BIT( in,2)) ^ ( BIT( in,4) || BIT( in,7)  || (BIT( in,1) && BIT(~in,5)));
1851   int const b3 = (BIT(~in,2) && BIT( in,7)) ^ ( BIT(~in,0) || BIT( in,1)  || (BIT( in,3) && BIT( in,6)));
17951852
1796static DRIVER_INIT( borench )
1853   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1854}
1855
1856/* 317-???? */
1857static int prot_func_tantrkor(int in)
17971858{
1798   /* 317-0173 */
1799   static const UINT32 table[256/8] =
1800   {
1801      0x12fe56ba, 0x56ba56ba, 0x00aa44ee, 0xcceeccee,
1802      0x13ff57bb, 0x759957bb, 0x11bb55ff, 0xffddddff,
1803      0x12ba56fe, 0x56fe56fe, 0x00aa44ee, 0xcceeccee,
1804      0x933bd77f, 0xf55dd77f, 0x913bd57f, 0x7f5d5d7f,
1805      0x12fe56ba, 0x56ba56ab, 0x00aa44ee, 0xcceeccff,
1806      0xd73bd73b, 0xf519d72a, 0xd57fd57f, 0x7f5d5d6e,
1807      0x12ba56fe, 0x56fe56ef, 0x00aa44ee, 0xcceeccff,
1808      0xd77fd77f, 0xf55dd76e, 0xd57fd57f, 0x7f5d5d6e
1809   };
1810   segac2_common_init(table);
1859   int const b0 = (BIT(~in,1) && BIT(~in,7)) ^ (BIT(~in,2) && BIT(~in,4));
1860   int const b1 = (BIT( in,2) && BIT( in,6)) ^ (BIT( in,0) && BIT( in,1));
1861   int const b2 = (BIT(~in,3) && BIT(~in,6)) ^ (BIT( in,1) || BIT(~in,4));
1862   int const b3 = (BIT(~in,0) && BIT(~in,2)) ^ (BIT( in,5) && BIT(~in,6));
1863
1864   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
18111865}
18121866
1867/* 317-0218 */
1868static int prot_func_potopoto(int in)
1869{
1870   int const b0 = (BIT(~in,2) && BIT(~in,4)) ^ (BIT(~in,1) && BIT( in,3));
1871   int const b1 = (BIT( in,0) && BIT( in,5)) ^ (BIT( in,2) || BIT(~in,7));
1872   int const b2 = (BIT( in,0) && BIT( in,6)) ^ (BIT(~in,1) && BIT( in,7));
1873   int const b3 = (BIT( in,0) && BIT(~in,7)) ^ (BIT(~in,1) && BIT(~in,6));
18131874
1814static DRIVER_INIT( tfrceac )
1875   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1876}
1877
1878/* 317-0219 */
1879static int prot_func_stkclmnj(int in)
18151880{
1816   static const UINT32 table[256/8] =
1817   {
1818      0x3a3a6f6f, 0x38386d6d, 0x3a3a6f6f, 0x28287d7d,
1819      0x3a3a6f6f, 0x38386d6d, 0x3a3a6f6f, 0x28287d7d,
1820      0x7e3a2b6f, 0x7c38296d, 0x7eb22be7, 0x6ca039f5,
1821      0x7e3a2b6f, 0x7c38296d, 0x7eb22be7, 0x6ca039f5,
1822      0x3b3b6e6e, 0x39396c6c, 0x5dd50880, 0x4ec61b93,
1823      0x3b3b6e6e, 0x39396c6c, 0x3bb36ee6, 0x28a07df5,
1824      0x5d19084c, 0x5d19084c, 0x7ff72aa2, 0x6ee63bb3,
1825      0x5d19084c, 0x5d19084c, 0x5d9108c4, 0x4c8019d5
1826   };
1827   segac2_common_init(table);
1881   int const b0 = (BIT( in,1) && BIT( in,4)) ^ (BIT( in,5) && BIT( in,2));
1882   int const b1 = (BIT(~in,2) && BIT( in,6)) ^ (BIT(~in,5) && BIT( in,7));
1883   int const b2 = (BIT(~in,3) && BIT( in,6)) ^ (BIT(~in,5) && BIT(~in,1));
1884   int const b3 = (BIT(~in,3) && BIT( in,5)) ^ (BIT(~in,6) || BIT(~in,7));
1885
1886   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
18281887}
18291888
1889/* 317-0223 */
1890static int prot_func_stkclmns(int in)
1891{
1892   int const b0 = (BIT( in,2) && BIT( in,4)) ^ (BIT( in,1) || BIT(~in,3));
1893   int const b1 = (BIT( in,0) && BIT( in,5)) ^ (BIT( in,2) && BIT( in,7));
1894   int const b2 = (BIT( in,0) && BIT(~in,6)) ^ (BIT( in,1) && BIT(~in,7));
1895   int const b3 = (BIT( in,0) && BIT(~in,7)) ^ (BIT(~in,1) && BIT( in,6));
18301896
1831static DRIVER_INIT( tfrceacb )
1897   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1898}
1899
1900/* 317-0224 */
1901static int prot_func_ichirj(int in)
18321902{
1833   /* disable the palette bank switching from the protection chip */
1834   segac2_common_init(NULL);
1835   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x800001, 0, 0, MWA16_NOP);
1903   int const b0 = (BIT( in,2) && BIT( in,4)) ^ (BIT(~in,5) && BIT(~in,2));
1904   int const b1 = (BIT( in,2) && BIT(~in,6)) ^ (BIT( in,5) && BIT( in,7));
1905   int const b2 = (BIT(~in,3) && BIT( in,6)) ^ (BIT(~in,5) && BIT(~in,1));
1906   int const b3 = (BIT(~in,1) && BIT( in,5)) ^ (BIT(~in,5) && BIT( in,7));
1907
1908   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
18361909}
18371910
1911/* 317-???? */
1912static int prot_func_ichir(int in)
1913{
1914   int const b0 = (BIT(~in,2) && BIT( in,4)) ^ (BIT( in,5) && BIT(~in,2));
1915   int const b1 = (BIT( in,1) && BIT( in,6)) ^ (BIT( in,5) || BIT( in,7));
1916   int const b2 = (BIT(~in,3) && BIT( in,6)) ^ (BIT(~in,5) && BIT(~in,3));
1917   int const b3 = (BIT( in,0) && BIT(~in,5)) ^ (BIT( in,5) && BIT( in,7));
18381918
1839static DRIVER_INIT( twinsqua )
1919   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1920}
1921
1922/* 317-???? */
1923static int prot_func_ichirk(int in)
18401924{
1841   static const UINT32 table[256/8] =
1842   {
1843      0xbb33aa22, 0xffffeeee, 0xa820bb33, 0xfd75ee66,
1844      0xbb33bb33, 0xbbbbbbbb, 0xa820aa22, 0xb931bb33,
1845      0x33bb22aa, 0xffffeeee, 0x22aa31b9, 0x77ff64ec,
1846      0x33bb33bb, 0xbbbbbbbb, 0x22aa20a8, 0x33bb31b9,
1847      0xbb33aa22, 0xffffeeee, 0xec64ff77, 0xb931aa22,
1848      0xbb33bb33, 0xbbbbbbbb, 0xec64ee66, 0xfd75ff77,
1849      0x33bb22aa, 0xffffeeee, 0x66ee75fd, 0x33bb20a8,
1850      0x33bb33bb, 0xbbbbbbbb, 0x66ee64ec, 0x77ff75fd
1851   };
1852   segac2_common_init(table);
1925   int const b0 = (BIT(~in,2) && BIT( in,4)) ^ (BIT( in,5) && BIT(~in,1));
1926   int const b1 = (BIT( in,0) && BIT( in,6)) ^ (BIT( in,5) && BIT( in,4));
1927   int const b2 = (BIT(~in,1) && BIT(~in,6)) ^ (BIT(~in,5) && BIT( in,3));
1928   int const b3 = (BIT( in,1) && BIT( in,5)) ^ (BIT( in,6) && BIT( in,7));
1929
1930   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
18531931}
18541932
1933/* 317-0228 */
1934static int prot_func_puyopuy2(int in)
1935{
1936   int const b0 = (BIT(~in,0) && BIT(~in,7)) ^ (BIT( in,1) || BIT(~in,4) || BIT(~in,6));
1937   int const b1 = (BIT( in,0) && BIT(~in,6)) ^ (BIT( in,3) && BIT( in,5));
1938   int const b2 = (BIT(~in,4) && BIT(~in,7)) ^ (BIT( in,0) || BIT(~in,6));
1939   int const b3 = (BIT(~in,1) && BIT( in,4)) ^ (BIT( in,2) && BIT(~in,3));
18551940
1856static DRIVER_INIT( ribbit )
1941   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1942}
1943
1944static int prot_func_zunkyou(int in)
18571945{
1858   static const UINT32 table[256/8] =
1859   {
1860      0xffbb773b, 0xffbf773f, 0xfebafeba, 0xfebefebe,
1861      0xee886619, 0xff9d771d, 0xef89ef98, 0xfe9cfe9c,
1862      0xdf9b571b, 0x5717ffb7, 0xde9ade9a, 0x56167636,
1863      0xcea84639, 0x5735ff95, 0xcfa9cfb8, 0x56347614,
1864      0xffff333b, 0xffff333b, 0xfefebaba, 0xfefebaba,
1865      0xeecc2219, 0xffdd3319, 0xefcdab98, 0xfedcba98,
1866      0xdfdf131b, 0x5757bbb3, 0xdede9a9a, 0x56563232,
1867      0xceec0239, 0x5775bb91, 0xcfed8bb8, 0x56743210
1868   };
1869   segac2_common_init(table);
1946   int const b0 = (BIT(~in,1) && BIT( in,6)) ^ (BIT(~in,5) && BIT( in,7));
1947   int const b1 = (BIT( in,0) && BIT(~in,5)) ^ (BIT(~in,3) || BIT( in,4));
1948   int const b2 = (BIT( in,2) && BIT(~in,3)) ^ (BIT( in,4) && BIT(~in,5));
1949   int const b3 = (BIT( in,0) && BIT(~in,4)) ^ (BIT(~in,2) && BIT(~in,6));
1950
1951   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
18701952}
18711953
1954static int prot_func_pclub(int in)
1955{
1956   return 0xf;
1957}
18721958
1873static DRIVER_INIT( tantr )
1959static int prot_func_pclubjv2(int in)
18741960{
1875   /* 317-0211 */
1876   static const UINT32 table[256/8] =
1877   {
1878      0x91ddd19d, 0x91ddd19d, 0xd4dc949c, 0xf6feb6be,
1879      0x91bbd1fb, 0x91bbd1fb, 0xd4fe94be, 0xf6feb6be,
1880      0x80cce2ae, 0x88cceaae, 0xc5cda7af, 0xefef8d8d,
1881      0x91bbf3d9, 0x99bbfbd9, 0xd4feb69c, 0xfefe9c9c,
1882      0x5d55959d, 0x5d55959d, 0x5c54949c, 0x7e76b6be,
1883      0x5d7795bf, 0x5d7795bf, 0x5c7694be, 0x7e76b6be,
1884      0x5d55b7bf, 0x4444aeae, 0x5c54b6be, 0x67678d8d,
1885      0x5d77b79d, 0x5577bf9d, 0x5c76b69c, 0x76769c9c
1886   };
1887   segac2_common_init(table);
1961   int const b0 = (BIT( in,3) && BIT(~in,4)) ^ ((BIT(~in,1) && BIT(~in,7)) || BIT( in,6));
1962   int const b1 = (BIT( in,0) && BIT( in,5)) ^  (BIT( in,2) && BIT(~in,6));
1963   int const b2 = (BIT(~in,1) && BIT( in,6)) ^  (BIT( in,3) || BIT(~in,5)  || BIT(~in,1));   // 1 repeated
1964   int const b3 = (BIT(~in,2) && BIT(~in,7)) ^  (BIT(~in,0) || BIT(~in,4));
1965
1966   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
18881967}
18891968
1969static int prot_func_pclubjv4(int in)
1970{
1971   int const b0 = (BIT(~in,2) && BIT( in,4)) ^ (BIT( in,1) && BIT(~in,6) && BIT(~in,3));
1972   int const b1 = (BIT(~in,3) && BIT(~in,4)) ^ (BIT( in,0) && BIT( in,5) && BIT(~in,6));
1973   int const b2 =  BIT(~in,0)                ^ (BIT( in,3) && BIT( in,4));
1974   int const b3 = (BIT(~in,1) && BIT( in,7)) ^ (BIT( in,5) && BIT(~in,7));   // 7 repeated
18901975
1891static DRIVER_INIT( tantrkor )
1976   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
1977}
1978
1979static int prot_func_pclubjv5(int in)
18921980{
1893   static const UINT32 table[256/8] =
1894   {
1895      0x80931102, 0xc4d75546, 0xd5825502, 0x91c61146,
1896      0x081b998a, 0x4c5fddce, 0x5d0add8a, 0x194e99ce,
1897      0xc4d77764, 0xc4d77764, 0x91c63364, 0x91c63364,
1898      0xc4d77764, 0xc4d77764, 0x91c63364, 0x91c63364,
1899      0x91930002, 0xd5d74446, 0xc4824402, 0x80c60046,
1900      0x191b888a, 0x5d5fccce, 0x4c0acc8a, 0x084e88ce,
1901      0xd5d76664, 0xd5d76664, 0x80c62264, 0x80c62264,
1902      0xd5d76664, 0xd5d76664, 0x80c62264, 0x80c62264
1903   };
1904   segac2_common_init(table);
1981   int const b0 = (BIT(~in,1) && BIT( in,5)) ^ (BIT(~in,2) && BIT(~in,6));
1982   int const b1 = (BIT(~in,0) && BIT( in,4)) ^ (BIT(~in,3) && BIT(~in,7));
1983   int const b2 = (BIT(~in,3) && BIT( in,7)) ^ (BIT(~in,0) || BIT(~in,4));
1984   int const b3 = (BIT(~in,2) && BIT( in,6)) ^ (BIT(~in,1) && BIT(~in,5));
1985
1986   return (b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
19051987}
19061988
19071989
1908static DRIVER_INIT( puyo )
1990
1991static DRIVER_INIT( c2boot )
19091992{
1910   /* 317-0203 */
1911   static const UINT32 table[256/8] =
1912   {
1913      0x33aa55cc, 0x33aa55cc, 0xba22fe66, 0xba22fe66,
1914      0x77ee55cc, 0x55cc77ee, 0xfe66fe66, 0xdc44dc44,
1915      0x33aa77ee, 0x77aa33ee, 0xba22fe66, 0xfe22ba66,
1916      0x77ee77ee, 0x11cc11cc, 0xfe66fe66, 0x98449844,
1917      0x22bb44dd, 0x3ba25dc4, 0xab33ef77, 0xba22fe66,
1918      0x66ff44dd, 0x5dc47fe6, 0xef77ef77, 0xdc44dc44,
1919      0x22bb66ff, 0x7fa23be6, 0xab33ef77, 0xfe22ba66,
1920      0x66ff66ff, 0x19c419c4, 0xef77ef77, 0x98449844
1921   };
1922   segac2_common_init(table);
1993   segac2_common_init(NULL);
19231994}
19241995
1925static DRIVER_INIT( ichir )
1996static DRIVER_INIT( bloxeedc )
19261997{
1927   static const UINT32 table[256/8] =
1928   {
1929      0x4c4c4c4c, 0x08080808, 0x5d5d4c4c, 0x19190808,
1930      0x33332222, 0x33332222, 0x22222222, 0x22222222,
1931      0x082a082a, 0x082a082a, 0x193b082a, 0x193b082a,
1932      0x77556644, 0x33112200, 0x66446644, 0x22002200,
1933      0x6e6e6e6e, 0x2a2a2a2a, 0x7f7f6e6e, 0x3b3b2a2a,
1934      0xbbbbaaaa, 0xbbbbaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
1935      0x2a082a08, 0x2a082a08, 0x3b192a08, 0x3b192a08,
1936      0xffddeecc, 0xbb99aa88, 0xeecceecc, 0xaa88aa88
1937   };
1938   segac2_common_init(table);
1998   segac2_common_init(NULL);
1999   bloxeed_sound = 1;
19392000}
19402001
1941static DRIVER_INIT( ichirk )
2002static DRIVER_INIT( columns )
19422003{
1943   static const UINT32 table[256/8] =
1944   {
1945      0x44004400, 0x00440044,   0x55114400, 0x11550044,
1946      0x55885588, 0x55885588,   0x66bb77aa, 0x66bb77aa,
1947      0x02020202, 0x46464646,   0x13130202, 0x57574646,
1948      0x138a138a, 0x138a138a,   0x20b931a8, 0x20b931a8,
1949      0x44004400, 0x00440044,   0x55114400, 0x11550044,
1950      0x55885588, 0x55885588,   0x66bb77aa, 0x66bb77aa,
1951      0x8a8a8a8a, 0xcececece,   0x9b9b8a8a, 0xdfdfcece,
1952      0x9b029b02, 0x9b029b02,   0xa831b920, 0xa831b920
1953   };
1954   segac2_common_init(table);
2004   segac2_common_init(prot_func_columns);
19552005}
19562006
1957static DRIVER_INIT( ichirj )
2007static DRIVER_INIT( columns2 )
19582008{
1959   /* 317-0224 */
1960   static const UINT32 table[256/8] =
1961   {
1962      0x55116622, 0x55116622, 0x55117733, 0x55117733,
1963      0x8800aa22, 0x8800aa22, 0x8800bb33, 0x8800bb33,
1964      0x11550044, 0x55114400, 0x11551155, 0x55115511,
1965      0xcc44cc44, 0x88008800, 0xcc44dd55, 0x88009911,
1966      0xdd99eeaa, 0xdd99eeaa, 0xdd99ffbb, 0xdd99ffbb,
1967      0xaa228800, 0xaa228800, 0xaa229911, 0xaa229911,
1968      0x99dd88cc, 0xdd99cc88, 0x99dd99dd, 0xdd99dd99,
1969      0xee66ee66, 0xaa22aa22, 0xee66ff77, 0xaa22bb33
1970   };
1971   segac2_common_init(table);
2009   segac2_common_init(prot_func_columns2);
19722010}
1973static DRIVER_INIT( ichirjbl )
2011
2012static DRIVER_INIT( tfrceac )
19742013{
1975   /* when did this actually work? - the protection is patched but the new check fails? */
1976   UINT16 *rom = (UINT16 *)memory_region(REGION_CPU1);
1977   rom[0x390/2] = 0x6600;
2014   segac2_common_init(prot_func_tfrceac);
19782015}
19792016
2017static DRIVER_INIT( tfrceacb )
2018{
2019   /* disable the palette bank switching from the protection chip */
2020   segac2_common_init(NULL);
2021   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x800001, 0, 0, MWA16_NOP);
2022}
19802023
2024static DRIVER_INIT( borench )
2025{
2026   segac2_common_init(prot_func_borench);
2027}
2028
2029static DRIVER_INIT( twinsqua )
2030{
2031   segac2_common_init(prot_func_twinsqua);
2032}
2033
2034static DRIVER_INIT( ribbit )
2035{
2036   segac2_common_init(prot_func_ribbit);
2037}
2038
2039static DRIVER_INIT( puyo )
2040{
2041   segac2_common_init(prot_func_puyo);
2042}
2043
2044static DRIVER_INIT( tantr )
2045{
2046   segac2_common_init(prot_func_tantr);
2047}
2048
2049static DRIVER_INIT( tantrkor )
2050{
2051   segac2_common_init(prot_func_tantrkor);
2052}
2053
2054static DRIVER_INIT( potopoto )
2055{
2056   segac2_common_init(prot_func_potopoto);
2057}
2058
19812059static DRIVER_INIT( stkclmns )
19822060{
1983   static const UINT32 table[256/8] =
1984   {
1985      0x1d591d59, 0x0c590c59, 0x1d590c48, 0x0c591d48,
1986      0x1f5b1f5b, 0x0e5b0e5b, 0x1f5b0e4a, 0x0e5b1f4a,
1987      0x915d915d, 0x805d805d, 0x915d804c, 0x805d914c,
1988      0x935f935f, 0x825f825f, 0x935f824e, 0x825f934e,
1989      0x15153737, 0x04152637, 0x15152626, 0x04153726,
1990      0x17173535, 0x06172435, 0x17172424, 0x06173524,
1991      0x9911bb33, 0x8811aa33, 0x9911aa22, 0x8811bb22,
1992      0x9b13b931, 0x8a13a831, 0x9b13a820, 0x8a13b920
1993   };
1994   segac2_common_init(table);
2061   segac2_common_init(prot_func_stkclmns);
19952062}
19962063
19972064static DRIVER_INIT( stkclmnj )
19982065{
1999   static const UINT32 table[256/8] =
2000   {
2001      0xcc88cc88, 0xcc88cc88, 0xcc99cc99, 0xcc99cc99,
2002      0x00001111, 0x88889999, 0x00111100, 0x88999988,
2003      0xaaee88cc, 0xeeaacc88, 0xaaff88dd, 0xeebbcc99,
2004      0x66665555, 0xaaaa9999, 0x66775544, 0xaabb9988,
2005      0xeeaaeeaa, 0xeeaaeeaa, 0xeebbeebb, 0xeebbeebb,
2006      0x00001111, 0x88889999, 0x00111100, 0x88999988,
2007      0x00442266, 0x44006622, 0x00552277, 0x44116633,
2008      0xeeeedddd, 0x22221111, 0xeeffddcc, 0x22331100
2009   };
2010   segac2_common_init(table);
2066   segac2_common_init(prot_func_stkclmnj);
20112067}
20122068
2069static DRIVER_INIT( ichir )
2070{
2071   segac2_common_init(prot_func_ichir);
2072}
20132073
2014static DRIVER_INIT( puyopuy2 )
2074static DRIVER_INIT( ichirk )
20152075{
2016   /* 317-0228 */
2017   static const UINT32 table[256/8] =
2018   {
2019      0x03038b8b, 0x03030303, 0xcf4747cf, 0xcf47cf47,
2020      0x03038b8b, 0x21212121, 0xcf4747cf, 0xed65ed65,
2021      0x4141c9c9, 0x41414141, 0x9c05148d, 0x9c059c05,
2022      0x4141c9c9, 0x63636363, 0x9c05148d, 0xbe27be27,
2023      0x5757dfdf, 0x57575757, 0xdf5757df, 0xdf57df57,
2024      0x5757dfdf, 0x75757575, 0xdf5757df, 0xfd75fd75,
2025      0x15159d9d, 0x15151515, 0x8c15049d, 0x8c158c15,
2026      0x15159d9d, 0x37373737, 0x8c15049d, 0xae37ae37
2027   };
2028   segac2_common_init(table);
2076   segac2_common_init(prot_func_ichirk);
20292077}
20302078
2079static DRIVER_INIT( ichirj )
2080{
2081   segac2_common_init(prot_func_ichirj);
2082}
20312083
2032static DRIVER_INIT( potopoto )
2084static DRIVER_INIT( ichirjbl )
20332085{
2034   /* 317-0218 */
2035   static const UINT32 table[256/8] =
2036   {
2037      0xb33ba22a, 0xa23bb32a, 0xa22aa22a, 0xb32ab32a,
2038      0xb139a028, 0xa039b128, 0xa028a028, 0xb128b128,
2039      0x3f3f2e2e, 0x2e3f3f2e, 0x2e2e2e2e, 0x3f2e3f2e,
2040      0x3d3d2c2c, 0x2c3d3d2c, 0x2c2c2c2c, 0x3d2c3d2c,
2041      0xdd11ee22, 0xcc11ff22, 0xcc00ee22, 0xdd00ff22,
2042      0xdf13ec20, 0xce13fd20, 0xce02ec20, 0xdf02fd20,
2043      0x51156226, 0x40157326, 0x40046226, 0x51047326,
2044      0x53176024, 0x42177124, 0x42066024, 0x53067124
2045   };
2046   segac2_common_init(table);
2086   /* when did this actually work? - the protection is patched but the new check fails? */
2087   UINT16 *rom = (UINT16 *)memory_region(REGION_CPU1);
2088   rom[0x390/2] = 0x6600;
20472089}
20482090
2091static DRIVER_INIT( puyopuy2 )
2092{
2093   segac2_common_init(prot_func_puyopuy2);
2094}
20492095
20502096static DRIVER_INIT( zunkyou )
20512097{
2052   static const UINT32 table[256/8] =
2053   {
2054      0xa0a06c6c, 0x82820a0a, 0xecec2020, 0xecec6464,
2055      0xa2a26e6e, 0x80800808, 0xaaaa6666, 0xaaaa2222,
2056      0x39287d6c, 0x1b0a1b0a, 0x75643120, 0x75647564,
2057      0x3b2a7f6e, 0x19081908, 0x33227766, 0x33223322,
2058      0xb1b17d7d, 0x93931b1b, 0xfdfd3131, 0xfdfd7575,
2059      0xa2a26e6e, 0x80800808, 0xaaaa6666, 0xaaaa2222,
2060      0x28396c7d, 0x0a1b0a1b, 0x64752031, 0x64756475,
2061      0x3b2a7f6e, 0x19081908, 0x33227766, 0x33223322
2062   };
2063   segac2_common_init(table);
2098   segac2_common_init(prot_func_zunkyou);
20642099}
20652100
20662101
20672102static DRIVER_INIT( pclub )
20682103{
2069   static const UINT32 table[256/8] =
2070   {
2071      0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
2072      0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
2073      0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
2074      0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
2075      0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
2076      0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
2077      0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
2078      0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
2079   };
2080   segac2_common_init(table);
2104   segac2_common_init(prot_func_pclub);
20812105
20822106   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
20832107   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
r1649r1650
20862110
20872111static DRIVER_INIT( pclubjv2 )
20882112{
2089   static const UINT32 table[256/8] =
2090   {
2091      0x5544ffee, 0x4455eeff, 0x5d4cf7e6, 0x5d4cf7e6,
2092      0x5702fda8, 0x4657ecfd, 0x5f0af5a0, 0x5f4ef5e4,
2093      0x115599dd, 0x004488cc, 0x195d91d5, 0x195d91d5,
2094      0x13139b9b, 0x02468ace, 0x1b1b9393, 0x1b5f93d7,
2095      0xcccceeee, 0xddddffff, 0xc4c4e6e6, 0xc4c4e6e6,
2096      0xce8aeca8, 0xdfdffdfd, 0xc682e4a0, 0xc6c6e4e4,
2097      0x99dd99dd, 0x88cc88cc, 0x91d591d5, 0x91d591d5,
2098      0x9b9b9b9b, 0x8ace8ace, 0x93939393, 0x93d793d7
2099   };
2100   segac2_common_init(table);
2113   segac2_common_init(prot_func_pclubjv2);
21012114
21022115   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
21032116   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
r1649r1650
21062119
21072120static DRIVER_INIT( pclubjv4 )
21082121{
2109   static const UINT32 table[256/8] =
2110   {
2111      0x62736273, 0x40404040, 0x51404051, 0x15150404,
2112      0xe8f9e8f9, 0xcacacaca,   0xdbcacadb, 0x9f9f8e8e,
2113      0x62626262, 0x40404040,   0x51514040, 0x15150404,
2114      0xeaeaeaea, 0xc8c8c8c8,   0xd9d9c8c8, 0x9d9d8c8c,
2115      0xea73ea73, 0xc840c840,   0xd940c851, 0x9d158c04,
2116      0xe871e871, 0xca42ca42,   0xdb42ca53, 0x9f178e06,
2117      0xea62ea62, 0xc840c840,   0xd951c840, 0x9d158c04,
2118      0xea62ea62, 0xc840c840,   0xd951c840, 0x9d158c04
2119   };
2120   segac2_common_init(table);
2122   segac2_common_init(prot_func_pclubjv4);
21212123
21222124   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
21232125   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
r1649r1650
21262128
21272129static DRIVER_INIT( pclubjv5 )
21282130{
2129   static const UINT32 table[256/8] =
2130   {
2131      0xff77ee66, 0xdd55cc44,   0xdb53ca42, 0xf971e860,
2132      0x66777766, 0x44555544,   0x42535342, 0x60717160,
2133      0x66eeee66, 0x44cccc44,   0x42caca42, 0x60e8e860,
2134      0xffee7766, 0xddcc5544,   0xdbca5342, 0xf9e87160,
2135      0x99118800, 0xdd55cc44,   0xbd35ac24, 0xf971e860,
2136      0x00111100, 0x44555544,   0x24353524, 0x60717160,
2137      0x00888800, 0x44cccc44,   0x24acac24, 0x60e8e860,
2138      0x99881100, 0xddcc5544,   0xbdac3524, 0xf9e87160
2139   };
2140   segac2_common_init(table);
2131   segac2_common_init(prot_func_pclubjv5);
21412132
21422133   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
21432134   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
r1649r1650
21732164GAME( 1990, column2j, columns2, segac,    columns2, columns2, ROT0, "Sega",                   "Columns II: The Voyage Through Time (Japan)", 0 )
21742165
21752166/* System C-2 Games */
2176GAME( 1990, borench,  0,        segac2,   borench,  borench,  ROT0, "Sega",                   "Borench", 0 )
21772167GAME( 1990, tfrceac,  0,        segac2,   tfrceac,  tfrceac,  ROT0, "Sega / Technosoft",      "ThunderForce AC", 0 )
21782168GAME( 1990, tfrceacj, tfrceac,  segac2,   tfrceac,  tfrceac,  ROT0, "Sega / Technosoft",      "ThunderForce AC (Japan)", 0 )
21792169GAME( 1990, tfrceacb, tfrceac,  segac2,   tfrceac,  tfrceacb, ROT0, "bootleg",                "ThunderForce AC (bootleg)", 0 )
2170GAME( 1990, borench,  0,        segac2,   borench,  borench,  ROT0, "Sega",                   "Borench", 0 )
21802171GAME( 1991, twinsqua, 0,        segac2,   twinsqua, twinsqua, ROT0, "Sega",                   "Twin Squash", 0 )
21812172GAME( 1991, ribbit,   0,        segac2,   ribbit,   ribbit,   ROT0, "Sega",                   "Ribbit!", 0 )
2173GAME( 1992, puyo,     0,        segac2,   puyo,     puyo,     ROT0, "Sega / Compile",         "Puyo Puyo (World)", 0 )
2174GAME( 1992, puyobl,   puyo,     segac2,   puyo,     puyo,     ROT0, "bootleg",                "Puyo Puyo (World, bootleg)", 0 )
2175GAME( 1992, puyoj,    puyo,     segac2,   puyo,     puyo,     ROT0, "Sega / Compile",         "Puyo Puyo (Japan)", 0 )
2176GAME( 1992, puyoja,   puyo,     segac2,   puyo,     puyo,     ROT0, "Sega / Compile",         "Puyo Puyo (Japan, Rev A)", 0 )
21822177GAME( 1992, tantr,    0,        segac2,   ichir,    tantr,    ROT0, "Sega",                   "Puzzle & Action: Tant-R (Japan)", 0 )
21832178GAME( 1993, tantrkor, tantr,    segac2,   ichir,    tantrkor, ROT0, "Sega",                   "Puzzle & Action: Tant-R (Korea)", 0 )
21842179GAME( 1992, tantrbl,  tantr,    segac2,   ichir,    c2boot,   ROT0, "bootleg",                "Puzzle & Action: Tant-R (Japan) (bootleg set 1)", 0 )
21852180GAME( 1994, tantrbl2, tantr,    segac,    ichir,    tantr,    ROT0, "bootleg",                "Puzzle & Action: Tant-R (Japan) (bootleg set 2)", 0 ) // Common bootleg in Europe, C board, no samples
21862181GAME( 1994, tantrbl3, tantr,    segac,    ichir,    tantr,    ROT0, "bootleg",                "Puzzle & Action: Tant-R (Japan) (bootleg set 3)", 0 ) // Common bootleg in Europe, C board, no samples
2187GAME( 1992, puyo,     0,        segac2,   puyo,     puyo,     ROT0, "Sega / Compile",         "Puyo Puyo (World)", 0 )
2188GAME( 1992, puyobl,   puyo,     segac2,   puyo,     puyo,     ROT0, "bootleg",                "Puyo Puyo (World, bootleg)", 0 )
2189GAME( 1992, puyoj,    puyo,     segac2,   puyo,     puyo,     ROT0, "Sega / Compile",         "Puyo Puyo (Japan)", 0 )
2190GAME( 1992, puyoja,   puyo,     segac2,   puyo,     puyo,     ROT0, "Sega / Compile",         "Puyo Puyo (Japan, Rev A)", 0 )
2182GAME( 1994, potopoto, 0,        segac2,   potopoto, potopoto, ROT0, "Sega",                   "Poto Poto (Japan)", 0 )
2183GAME( 1994, stkclmns, 0,        segac2,   stkclmns, stkclmns, ROT0, "Sega",                   "Stack Columns (World)", 0 )
2184GAME( 1994, stkclmnj, stkclmns, segac2,   stkclmns, stkclmnj, ROT0, "Sega",                   "Stack Columns (Japan)", 0 )
21912185GAME( 1994, ichir,    0,        segac2,   ichir,    ichir,    ROT0, "Sega",                   "Puzzle & Action: Ichidant-R (World)", 0 )
21922186GAME( 1994, ichirk,   ichir,    segac2,   ichir,    ichirk,   ROT0, "Sega",                   "Puzzle & Action: Ichidant-R (Korea)", 0 )
21932187GAME( 1994, ichirj,   ichir,    segac2,   ichir,    ichirj,   ROT0, "Sega",                   "Puzzle & Action: Ichidant-R (Japan)", 0 )
21942188GAME( 1994, ichirjbl, ichir,    segac,    ichir,    ichirjbl, ROT0, "bootleg",                "Puzzle & Action: Ichidant-R (Japan) (bootleg)", 0 ) // C board, no samples
2195GAME( 1994, stkclmns, 0,        segac2,   stkclmns, stkclmns, ROT0, "Sega",                   "Stack Columns (World)", 0 )
2196GAME( 1994, stkclmnj, stkclmns, segac2,   stkclmns, stkclmnj, ROT0, "Sega",                   "Stack Columns (Japan)", 0 )
21972189GAME( 1994, puyopuy2, 0,        segac2,   puyopuy2, puyopuy2, ROT0, "Compile (Sega license)", "Puyo Puyo 2 (Japan)", 0 )
2198GAME( 1994, potopoto, 0,        segac2,   potopoto, potopoto, ROT0, "Sega",                   "Poto Poto (Japan)", 0 )
21992190GAME( 1994, zunkyou,  0,        segac2,   zunkyou,  zunkyou,  ROT0, "Sega",                   "Zunzunkyou No Yabou (Japan)", 0 )
22002191
22012192/* Atlus Print Club 'Games' (C-2 Hardware, might not be possible to support them because they use camera + printer, really just put here for reference) */
src/mame/drivers/gotcha.c
r1649r1650
5858***************************************************************************/
5959
6060#include "driver.h"
61#include "deprecat.h"
6162#include "sound/2151intf.h"
6263#include "sound/okim6295.h"
6364
src/mame/drivers/starshp1.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "includes/starshp1.h"
1213
1314int starshp1_attract;
src/mame/drivers/pandoras.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "cpu/m6809/m6809.h"
1819#include "cpu/z80/z80.h"
1920#include "cpu/i8039/i8039.h"
src/mame/drivers/taito_f2.c
r1649r1650
289289***************************************************************************/
290290
291291#include "driver.h"
292#include "deprecat.h"
292293#include "cpu/m68000/m68000.h"
293294#include "video/taitoic.h"
294295#include "audio/taitosnd.h"
src/mame/drivers/gberet.c
r1649r1650
6666***************************************************************************/
6767
6868#include "driver.h"
69#include "deprecat.h"
6970#include "sound/sn76496.h"
7071
7172
r1649r1650
8384extern VIDEO_UPDATE( gberetb );
8485
8586
86static int enable_NMI, enable_IRQ;
87static UINT8 nmi_enable, irq_enable;
8788
8889
90/* Interrupt Generators */
91
92static INTERRUPT_GEN( gberet_interrupt )
93{
94   if (cpu_getiloops() == 0)
95   {
96      if (irq_enable)
97         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
98   }
99
100   if (cpu_getiloops() % 2)
101   {
102      if (nmi_enable)
103         cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
104   }
105}
106
107
89108/* Read/Write Handlers */
90109
91110static WRITE8_HANDLER( gberet_coin_counter_w )
r1649r1650
97116
98117static WRITE8_HANDLER( gberet_flipscreen_w )
99118{
100   enable_NMI = data & 0x01;
101   enable_IRQ = data & 0x04;
119   nmi_enable = data & 0x01;
120   irq_enable = data & 0x04;
102121
103122   flip_screen_set(data & 0x08);
104123}
r1649r1650
118137
119138static WRITE8_HANDLER( mrgoemon_flipscreen_w )
120139{
121   enable_NMI = data & 0x01;
122   enable_IRQ = data & 0x02;
140   nmi_enable = data & 0x01;
141   irq_enable = data & 0x02;
123142
124143   flip_screen_set(data & 0x08);
125144}
r1649r1650
527546   GFXDECODE_ENTRY( REGION_GFX2, 0, gberetb_spritelayout, 16*16, 16 )
528547GFXDECODE_END
529548
530/* Interrupt Generators */
531
532static INTERRUPT_GEN( gberet_interrupt )
533{
534   if (cpu_getiloops() == 0)
535   {
536      if (enable_IRQ)
537         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
538   }
539
540   if (cpu_getiloops() % 2)
541   {
542      if (enable_NMI)
543         cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
544   }
545}
546
547549/* Machine Drivers */
548550
549551static MACHINE_DRIVER_START( gberet )
src/mame/drivers/sandscrp.c
r1649r1650
55*/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/eeprom.h"
910#include "includes/kaneko16.h"
1011#include "sound/2203intf.h"
src/mame/drivers/gpworld.c
r1649r1650
4040
4141
4242#include "driver.h"
43#include "render.h"
43#include "deprecat.h"
4444#include "machine/laserdsc.h"
4545
4646/* Assumed to be the same as segald hardware */
src/mame/drivers/ddragon.c
r1649r1650
6565***************************************************************************/
6666
6767#include "driver.h"
68#include "deprecat.h"
6869#include "cpu/m6800/m6800.h"
6970#include "cpu/m6805/m6805.h"
7071#include "cpu/m6809/m6809.h"
src/mame/drivers/acommand.c
r1649r1650
5353*******************************************************************************************/
5454
5555#include "driver.h"
56#include "deprecat.h"
5657#include "sound/okim6295.h"
5758
5859static tilemap *tx_tilemap,*bg_tilemap;
src/mame/drivers/asterix.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "video/konamiic.h"
1415#include "cpu/z80/z80.h"
1516#include "machine/eeprom.h"
src/mame/drivers/tubep.c
r1649r1650
9999
100100
101101#include "driver.h"
102#include "deprecat.h"
102103#include "cpu/z80/z80.h"
103104#include "cpu/m6805/m6805.h"
104105#include "sound/ay8910.h"
src/mame/drivers/homedata.c
r1649r1650
217217***************************************************************************/
218218
219219#include "driver.h"
220#include "deprecat.h"
220221#include "cpu/m6809/m6809.h"
221222#include "cpu/upd7810/upd7810.h"
222223#include "homedata.h"
src/mame/drivers/xxmissio.c
r1649r1650
99*****************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "sound/2203intf.h"
1314
1415VIDEO_UPDATE( xxmissio );
src/mame/drivers/mugsmash.c
r1649r1650
4040*/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "sound/2151intf.h"
4445#include "sound/okim6295.h"
4546
src/mame/drivers/pcktgal.c
r1649r1650
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "cpu/m6502/m6502.h"
1718#include "sound/2203intf.h"
1819#include "sound/3812intf.h"
src/mame/drivers/hng64.c
r1649r1650
458458
459459#define MASTER_CLOCK   50000000
460460#include "driver.h"
461#include "deprecat.h"
461462#include "cpu/mips/mips3.h"
462463
463464static UINT32 *rombase;
src/mame/drivers/solomon.c
r1649r1650
66
77***************************************************************************/
88#include "driver.h"
9#include "deprecat.h"
910#include "cpu/z80/z80.h"
1011#include "sound/ay8910.h"
1112
src/mame/drivers/macrossp.c
r1649r1650
3838******************************************************************************/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "sound/es5506.h"
4243
4344/*** README INFO **************************************************************
src/mame/drivers/gladiatr.c
r1649r1650
182182***************************************************************************/
183183
184184#include "driver.h"
185#include "deprecat.h"
185186#include "machine/tait8741.h"
186187#include "cpu/z80/z80.h"
187188#include "sound/2203intf.h"
src/mame/drivers/imolagp.c
r1649r1650
7474***************************************************************************/
7575
7676#include "driver.h"
77#include "deprecat.h"
7778#include "cpu/z80/z80.h"
7879#include "machine/8255ppi.h"
7980#include "sound/ay8910.h"
src/mame/drivers/moo.c
r1649r1650
4242***************************************************************************/
4343
4444#include "driver.h"
45#include "deprecat.h"
4546#include "video/konamiic.h"
4647#include "cpu/m68000/m68000.h"
4748#include "cpu/z80/z80.h"
src/mame/drivers/skychut.c
r1649r1650
102102
103103***************************************************************************/
104104#include "driver.h"
105#include "deprecat.h"
105106#include "sound/samples.h"
106107
107108#include "skychut.h"
src/mame/drivers/stepstag.c
r1649r1650
88 */
99
1010#include "driver.h"
11//#include "random.h"
11#include "deprecat.h"
1212
1313static READ16_HANDLER( unknown_read_0xc00000 )
1414{
src/mame/drivers/taito_l.c
r1649r1650
4444
4545
4646#include "driver.h"
47#include "deprecat.h"
4748#include "cpu/z80/z80.h"
4849#include "audio/taitosnd.h"
4950#include "sound/2203intf.h"
src/mame/drivers/gyruss.c
r1649r1650
331331
332332
333333static GFXDECODE_START( gyruss )
334   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 16 )
335   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 16*4, 16 )   /* upper half */
336   GFXDECODE_ENTRY( REGION_GFX2, 0x0010, spritelayout, 16*4, 16 )   /* lower half */
334   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 16 )   /* upper half */
335   GFXDECODE_ENTRY( REGION_GFX1, 0x0010, spritelayout, 0, 16 )   /* lower half */
336   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   16*16, 16 )
337337GFXDECODE_END
338338
339339
r1649r1650
391391   MDRV_SCREEN_SIZE(32*8, 32*8)
392392   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
393393   MDRV_GFXDECODE(gyruss)
394   MDRV_PALETTE_LENGTH(32)
395   MDRV_COLORTABLE_LENGTH(16*4+16*16)
394   MDRV_PALETTE_LENGTH(16*4+16*16)
396395
397396   MDRV_PALETTE_INIT(gyruss)
398397   MDRV_VIDEO_START(gyruss)
r1649r1650
467466   ROM_REGION( 0x1000, REGION_CPU4, 0 )   /* 8039 */
468467   ROM_LOAD( "gyrussk.3a",   0x0000, 0x1000, CRC(3f9b5dea) SHA1(6e807da02c2885b18e8cc2199f12f6be9040bf75) )
469468
470   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
471   ROM_LOAD( "gyrussk.4",    0x0000, 0x2000, CRC(27d8329b) SHA1(564ff945465a23d93a93137ad277298770dfa06a) )
472
473   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
469   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
474470   ROM_LOAD( "gyrussk.6",    0x0000, 0x2000, CRC(c949db10) SHA1(fcb8bcbd2bdd751fecb322a33c8a92fb6f07a7ab) )
475471   ROM_LOAD( "gyrussk.5",    0x2000, 0x2000, CRC(4f22411a) SHA1(763bcd039f8c1838a0d7da7d4dadc14a26e25596) )
476472   ROM_LOAD( "gyrussk.8",    0x4000, 0x2000, CRC(47cd1fbc) SHA1(8203c4ff0b1cd7b4dbc708e300bfeac1e7366e09) )
477473   ROM_LOAD( "gyrussk.7",    0x6000, 0x2000, CRC(8e8d388c) SHA1(8f2928d71c02aba977d67575d6e34d69bda2b9d4) )
478474
475   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
476   ROM_LOAD( "gyrussk.4",    0x0000, 0x2000, CRC(27d8329b) SHA1(564ff945465a23d93a93137ad277298770dfa06a) )
477
479478   ROM_REGION( 0x0220, REGION_PROMS, 0 )
480479   ROM_LOAD( "gyrussk.pr3",  0x0000, 0x0020, CRC(98782db3) SHA1(b891e43b25187faca8002919ccb44d744daa3594) )   /* palette */
481480   ROM_LOAD( "gyrussk.pr1",  0x0020, 0x0100, CRC(7ed057de) SHA1(c04069ae1e2c62f9b3048844cd8cf5e1b03b7d3c) )   /* sprite lookup table */
r1649r1650
500499   ROM_REGION( 0x1000, REGION_CPU4, 0 )   /* 8039 */
501500   ROM_LOAD( "gyrussk.3a",   0x0000, 0x1000, CRC(3f9b5dea) SHA1(6e807da02c2885b18e8cc2199f12f6be9040bf75) )
502501
503   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
504   ROM_LOAD( "gyrussk.4",    0x0000, 0x2000, CRC(27d8329b) SHA1(564ff945465a23d93a93137ad277298770dfa06a) )
505
506   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
502   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
507503   ROM_LOAD( "gyrussk.6",    0x0000, 0x2000, CRC(c949db10) SHA1(fcb8bcbd2bdd751fecb322a33c8a92fb6f07a7ab) )
508504   ROM_LOAD( "gyrussk.5",    0x2000, 0x2000, CRC(4f22411a) SHA1(763bcd039f8c1838a0d7da7d4dadc14a26e25596) )
509505   ROM_LOAD( "gyrussk.8",    0x4000, 0x2000, CRC(47cd1fbc) SHA1(8203c4ff0b1cd7b4dbc708e300bfeac1e7366e09) )
510506   ROM_LOAD( "gyrussk.7",    0x6000, 0x2000, CRC(8e8d388c) SHA1(8f2928d71c02aba977d67575d6e34d69bda2b9d4) )
511507
508   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
509   ROM_LOAD( "gyrussk.4",    0x0000, 0x2000, CRC(27d8329b) SHA1(564ff945465a23d93a93137ad277298770dfa06a) )
510
512511   ROM_REGION( 0x0220, REGION_PROMS, 0 )
513512   ROM_LOAD( "gyrussk.pr3",  0x0000, 0x0020, CRC(98782db3) SHA1(b891e43b25187faca8002919ccb44d744daa3594) )   /* palette */
514513   ROM_LOAD( "gyrussk.pr1",  0x0020, 0x0100, CRC(7ed057de) SHA1(c04069ae1e2c62f9b3048844cd8cf5e1b03b7d3c) )   /* sprite lookup table */
r1649r1650
533532   ROM_REGION( 0x1000, REGION_CPU4, 0 )   /* 8039 */
534533   ROM_LOAD( "gyrussk.3a",   0x0000, 0x1000, CRC(3f9b5dea) SHA1(6e807da02c2885b18e8cc2199f12f6be9040bf75) )
535534
536   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
537   ROM_LOAD( "gyrussk.4",    0x0000, 0x2000, CRC(27d8329b) SHA1(564ff945465a23d93a93137ad277298770dfa06a) )
538
539   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
535   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
540536   ROM_LOAD( "gyrussk.6",    0x0000, 0x2000, CRC(c949db10) SHA1(fcb8bcbd2bdd751fecb322a33c8a92fb6f07a7ab) )
541537   ROM_LOAD( "gyrussk.5",    0x2000, 0x2000, CRC(4f22411a) SHA1(763bcd039f8c1838a0d7da7d4dadc14a26e25596) )
542538   ROM_LOAD( "gyrussk.8",    0x4000, 0x2000, CRC(47cd1fbc) SHA1(8203c4ff0b1cd7b4dbc708e300bfeac1e7366e09) )
543539   ROM_LOAD( "gyrussk.7",    0x6000, 0x2000, CRC(8e8d388c) SHA1(8f2928d71c02aba977d67575d6e34d69bda2b9d4) )
544540
541   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
542   ROM_LOAD( "gyrussk.4",    0x0000, 0x2000, CRC(27d8329b) SHA1(564ff945465a23d93a93137ad277298770dfa06a) )
543
545544   ROM_REGION( 0x0220, REGION_PROMS, 0 )
546545   ROM_LOAD( "gyrussk.pr3",  0x0000, 0x0020, CRC(98782db3) SHA1(b891e43b25187faca8002919ccb44d744daa3594) )   /* palette */
547546   ROM_LOAD( "gyrussk.pr1",  0x0020, 0x0100, CRC(7ed057de) SHA1(c04069ae1e2c62f9b3048844cd8cf5e1b03b7d3c) )   /* sprite lookup table */
src/mame/drivers/groundfx.c
r1649r1650
6363***************************************************************************/
6464
6565#include "driver.h"
66#include "deprecat.h"
6667#include "cpu/m68000/m68000.h"
6768#include "video/taitoic.h"
6869#include "machine/eeprom.h"
src/mame/drivers/fastlane.c
r1649r1650
1212***************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "cpu/hd6309/hd6309.h"
1617#include "video/konamiic.h"
1718#include "sound/k007232.h"
r1649r1650
111112   AM_RANGE(0x0d00, 0x0d0d) AM_WRITE(fastlane_K007232_write_port_0_w)   /* 007232 registers (chip 1) */
112113   AM_RANGE(0x0e00, 0x0e0d) AM_WRITE(fastlane_K007232_write_port_1_w)   /* 007232 registers (chip 2) */
113114   AM_RANGE(0x0f00, 0x0f1f) AM_WRITE(K051733_w)            /* 051733 (protection) */
114   AM_RANGE(0x1000, 0x17ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)/* palette RAM */
115   AM_RANGE(0x1000, 0x17ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)/* palette RAM */
115116   AM_RANGE(0x1800, 0x1fff) AM_WRITE(MWA8_RAM)            /* Work RAM */
116117   AM_RANGE(0x2000, 0x27ff) AM_WRITE(fastlane_vram1_w) AM_BASE(&fastlane_videoram1)
117118   AM_RANGE(0x2800, 0x2fff) AM_WRITE(fastlane_vram2_w) AM_BASE(&fastlane_videoram2)
r1649r1650
289290   MDRV_SCREEN_SIZE(37*8, 32*8)
290291   MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
291292   MDRV_GFXDECODE(fastlane)
292   MDRV_PALETTE_LENGTH(1024)
293   MDRV_COLORTABLE_LENGTH(1024*16)
293   MDRV_PALETTE_LENGTH(1024*16)
294294
295295   MDRV_PALETTE_INIT(fastlane)
296296   MDRV_VIDEO_START(fastlane)
src/mame/drivers/gamecstl.c
r1649r1650
4040
4141#include "driver.h"
4242#include "memconv.h"
43#include "deprecat.h"
4344#include "machine/8237dma.h"
4445#include "machine/pic8259.h"
4546#include "machine/pit8253.h"
src/mame/drivers/kangaroo.c
r1649r1650
1313
1414****************************************************************************
1515
16    Memory map
16    0000-0fff tvg75
17    1000-1fff tvg76
18    2000-2fff tvg77
19    3000-3fff tvg78
20    4000-4fff tvg79
21    5000-5fff tvg80
22    8000-bfff VIDEO RAM (four banks)
23    c000-cfff tvg83/84 (banked)
24    d000-dfff tvg85/86 (banked)
25    e000-e3ff RAM
1726
18****************************************************************************
1927
20    ========================================================================
21    CPU #1
22    ========================================================================
23    0000-7FFF   R     xxxxxxxx    Program ROM
24    8000-BFFF   R/W   xxxxxxxx    Bitmap RAM
25    C000        R     ----xxxx    Coin inputs
26    C200        R     ----xxxx    Option switches
27    D000-DFFF   R/W   xxxxxxxx    Custom microprocessor RAM
28    E000          W   ----xxxx    BSEL Bank select
29    E001          W   xxxxxxxx    DMA ROM start address low
30    E002          W   xxxxxxxx    DMA ROM start address high
31    E003          W   xxxxxxxx    DMA RAM start address low
32    E004          W   xxxxxxxx    DMA RAM start address high
33    E005          W   xxxxxxxx    Picture size/DMA start low
34    E006          W   xxxxxxxx    Picture size/DMA start high
35    ========================================================================
36    C800          W   xxxxxxxx    Sound chip address
37    CA00        R/W   xxxxxxxx    Sound chip data
38    ========================================================================
39    Interrupts:
40        NMI not connected
41        IRQ generated by VBLANK
42    ========================================================================
28    memory mapped ports:
29    read:
30    e400      DSW 0
31    ec00      IN 0
32    ed00      IN 1
33    ee00      IN 2
34    efxx      (4 bits wide) security chip in. It seems to work like a clock.
4335
36    write:
37    e800-e801 low/high byte start address of data in picture ROM for DMA
38    e802-e803 low/high byte start address in bitmap RAM (where picture is to be
39              written) during DMA
40    e804-e805 picture size for DMA, and DMA start
41    e806      vertical scroll of playfield
42    e807      horizontal scroll of playfield
43    e808      bank select latch
44    e809      A & B bitmap control latch (A=playfield B=motion)
45              bit 5 FLIP A
46              bit 4 FLIP B
47              bit 3 EN A
48              bit 2 EN B
49              bit 1 PRI A
50              bit 0 PRI B
51    e80a      color shading latch
52    ec00      command to sound CPU
53    ed00      coin counters
54    efxx      (4 bits wide) security chip out
55
56    ---------------------------------------------------------------------------
57    CPU #1 (sound)
58
59    0000 0fff tvg81
60    4000 43ff RAM
61    6000      command from main CPU
62
63    I/O ports:
64    7000      AY-3-8910 write
65    8000      AY-3-8910 control
66    ---------------------------------------------------------------------------
67
68    interrupts:
69    (CPU#0) standard IM 1 interrupt mode (rst #38 every vblank)
70    (CPU#1) same here
71
4472****************************************************************************
4573
4674    In test mode, to test sound press 1 and 2 player start simultaneously.
r1649r1650
5583
5684***************************************************************************/
5785
58/*
59CPU #0
86#include "driver.h"
87#include "kangaroo.h"
88#include "cpu/z80/z80.h"
89#include "sound/ay8910.h"
6090
610000-0fff tvg75
621000-1fff tvg76
632000-2fff tvg77
643000-3fff tvg78
654000-4fff tvg79
665000-5fff tvg80
678000-bfff VIDEO RAM (four banks)
68c000-cfff tvg83/84 (banked)
69d000-dfff tvg85/86 (banked)
70e000-e3ff RAM
7191
92#define MASTER_CLOCK      XTAL_10MHz
7293
73memory mapped ports:
74read:
75e400      DSW 0
76ec00      IN 0
77ed00      IN 1
78ee00      IN 2
79efxx      (4 bits wide) security chip in. It seems to work like a clock.
8094
81write:
82e800-e801 low/high byte start address of data in picture ROM for DMA
83e802-e803 low/high byte start address in bitmap RAM (where picture is to be
84          written) during DMA
85e804-e805 picture size for DMA, and DMA start
86e806      vertical scroll of playfield
87e807      horizontal scroll of playfield
88e808      bank select latch
89e809      A & B bitmap control latch (A=playfield B=motion)
90          bit 5 FLIP A
91          bit 4 FLIP B
92          bit 3 EN A
93          bit 2 EN B
94          bit 1 PRI A
95          bit 0 PRI B
96e80a      color shading latch
97ec00      command to sound CPU
98ed00      coin counters
99efxx      (4 bits wide) security chip out
10095
101---------------------------------------------------------------------------
102CPU #1 (sound)
96static READ8_HANDLER(mcu_sim_r);
97static WRITE8_HANDLER(mcu_sim_w);
10398
1040000 0fff tvg81
1054000 43ff RAM
1066000      command from main CPU
99static UINT8 kangaroo_clock;
107100
108I/O ports:
1097000      AY-3-8910 write
1108000      AY-3-8910 control
111---------------------------------------------------------------------------
112101
113interrupts:
114(CPU#0) standard IM 1 interrupt mode (rst #38 every vblank)
115(CPU#1) same here
116102
117***************************************************************************/
118
119#include "driver.h"
120#include "kangaroo.h"
121#include "cpu/z80/z80.h"
122#include "sound/ay8910.h"
123
124
125
126103/*************************************
127104 *
128105 *  Machine init
129106 *
130107 *************************************/
131108
109static MACHINE_START( kangaroo )
110{
111   memory_configure_bank(1, 0, 2, memory_region(REGION_GFX1), 0x2000);
112   state_save_register_global(kangaroo_clock);
113}
114
115
116static MACHINE_START( kangaroo_mcu )
117{
118   MACHINE_START_CALL(kangaroo);
119   memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xef00, 0xefff, 0, 0, mcu_sim_r, mcu_sim_w);
120   kangaroo_clock = 0;
121}
122
123
132124static MACHINE_RESET( kangaroo )
133125{
134126   /* I think there is a bug in the startup checks of the game. At the very */
r1649r1650
153145 *
154146 *************************************/
155147
156static UINT8 kangaroo_clock=0;
157
158
159148/* I have no idea what the security chip is nor whether it really does,
160149   this just seems to do the trick -V-
161150*/
162151
163static READ8_HANDLER( kangaroo_sec_chip_r )
152static READ8_HANDLER( mcu_sim_r )
164153{
165/*  kangaroo_clock = (kangaroo_clock << 1) + 1; */
166  kangaroo_clock++;
167  return (kangaroo_clock & 0x0f);
154   return ++kangaroo_clock & 0x0f;
168155}
169156
170static WRITE8_HANDLER( kangaroo_sec_chip_w )
157static WRITE8_HANDLER( mcu_sim_w )
171158{
172/*  kangaroo_clock = val & 0x0f; */
173159}
174160
175161
r1649r1650
194180 *
195181 *************************************/
196182
197static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
198   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
199   AM_RANGE(0xc000, 0xdfff) AM_READ(MRA8_BANK1)
200   AM_RANGE(0xe000, 0xe3ff) AM_READ(MRA8_RAM)
201   AM_RANGE(0xe400, 0xe400) AM_READ(input_port_3_r)
202   AM_RANGE(0xec00, 0xec00) AM_READ(input_port_0_r)
203   AM_RANGE(0xed00, 0xed00) AM_READ(input_port_1_r)
204   AM_RANGE(0xee00, 0xee00) AM_READ(input_port_2_r)
205   AM_RANGE(0xef00, 0xef00) AM_READ(kangaroo_sec_chip_r)
206ADDRESS_MAP_END
207
208
209static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
210   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
183static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
184   AM_RANGE(0x0000, 0x5fff) AM_ROM
211185   AM_RANGE(0x8000, 0xbfff) AM_WRITE(kangaroo_videoram_w)
212   AM_RANGE(0xc000, 0xdfff) AM_WRITE(MWA8_ROM)
213   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(MWA8_RAM)
214   AM_RANGE(0xe800, 0xe805) AM_WRITE(kangaroo_blitter_w) AM_BASE(&kangaroo_blitter)
215   AM_RANGE(0xe806, 0xe807) AM_WRITE(MWA8_RAM) AM_BASE(&kangaroo_scroll)
216   AM_RANGE(0xe808, 0xe808) AM_WRITE(kangaroo_bank_select_w) AM_BASE(&kangaroo_bank_select)
217   AM_RANGE(0xe809, 0xe809) AM_WRITE(kangaroo_video_control_w) AM_BASE(&kangaroo_video_control)
218   AM_RANGE(0xe80a, 0xe80a) AM_WRITE(kangaroo_color_mask_w)
219   AM_RANGE(0xec00, 0xec00) AM_WRITE(soundlatch_w)
220   AM_RANGE(0xed00, 0xed00) AM_WRITE(kangaroo_coin_counter_w)
221   AM_RANGE(0xef00, 0xefff) AM_WRITE(kangaroo_sec_chip_w)
186   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK(1)
187   AM_RANGE(0xe000, 0xe3ff) AM_RAM
188   AM_RANGE(0xe400, 0xe400) AM_MIRROR(0x03ff) AM_READ_PORT("DSW0")
189   AM_RANGE(0xe800, 0xe80a) AM_MIRROR(0x03f0) AM_WRITE(kangaroo_video_control_w) AM_BASE(&kangaroo_video_control)
190   AM_RANGE(0xec00, 0xec00) AM_MIRROR(0x00ff) AM_READ_PORT("IN0") AM_WRITE(soundlatch_w)
191   AM_RANGE(0xed00, 0xed00) AM_MIRROR(0x00ff) AM_READ_PORT("IN1") AM_WRITE(kangaroo_coin_counter_w)
192   AM_RANGE(0xee00, 0xee00) AM_MIRROR(0x00ff) AM_READ_PORT("IN2")
222193ADDRESS_MAP_END
223194
224195
r1649r1650
229200 *
230201 *************************************/
231202
232static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
233   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_ROM)
234   AM_RANGE(0x4000, 0x43ff) AM_READ(MRA8_RAM)
235   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)
203static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
204   AM_RANGE(0x0000, 0x0fff) AM_ROM
205   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM
206   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_r)
207   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_WRITE(AY8910_write_port_0_w)
208   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_WRITE(AY8910_control_port_0_w)
236209ADDRESS_MAP_END
237210
238211
239static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
240   AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_ROM)
241   AM_RANGE(0x4000, 0x43ff) AM_WRITE(MWA8_RAM)
212/* yes, this is indentical */
213static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 )
214   AM_RANGE(0x0000, 0x0fff) AM_ROM
215   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM
216   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_r)
217   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_WRITE(AY8910_write_port_0_w)
218   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_WRITE(AY8910_control_port_0_w)
242219ADDRESS_MAP_END
243220
244221
245static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
246   AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_write_port_0_w)
247   AM_RANGE(0x8000, 0x8000) AM_WRITE(AY8910_control_port_0_w)
222
223/*************************************
224 *
225 *  Microcontroller memory handlers
226 *
227 *************************************/
228
229static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
230   AM_RANGE(0x0000, 0x07ff) AM_ROM
248231ADDRESS_MAP_END
249232
250233
r1649r1650
256239 *************************************/
257240
258241static INPUT_PORTS_START( fnkyfish )
259   PORT_START      /* IN0 */
242   PORT_START_TAG("IN0")
260243   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )
261244   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
262245   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
263246   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
264   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
265   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
266   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
267   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
247   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
268248
269   PORT_START      /* IN1 */
249   PORT_START_TAG("IN1")
270250   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
271251   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
272252   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
273253   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
274254   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
275   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
276   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
277   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
255   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
278256
279   PORT_START      /* IN2 */
257   PORT_START_TAG("IN2")
280258   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
281259   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
282260   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
283261   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
284262   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
285   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
286   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
287   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
263   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
288264
289   PORT_START      /* DSW0 */
265   PORT_START_TAG("DSW0")
290266   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
291267   PORT_DIPSETTING(    0x00, "3" )
292268   PORT_DIPSETTING(    0x01, "5" )
r1649r1650
315291
316292
317293static INPUT_PORTS_START( kangaroo )
318   PORT_START      /* IN0 */
294   PORT_START_TAG("IN0")
319295   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )
320296   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
321297   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
r1649r1650
331307   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
332308   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
333309
334   PORT_START      /* IN1 */
310   PORT_START_TAG("IN1")
335311   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
336312   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
337313   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
r1649r1650
341317   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
342318   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
343319
344   PORT_START      /* IN2 */
320   PORT_START_TAG("IN2")
345321   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
346322   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
347323   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r1649r1650
351327   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
352328   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
353329
354   PORT_START      /* DSW0 */
330   PORT_START_TAG("DSW0")
355331   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
356332   PORT_DIPSETTING(    0x00, "3" )
357333   PORT_DIPSETTING(    0x01, "5" )
r1649r1650
391367 *
392368 *************************************/
393369
394static MACHINE_DRIVER_START( kangaroo )
370static MACHINE_DRIVER_START( nomcu )
395371
396372   /* basic machine hardware */
397   MDRV_CPU_ADD(Z80, 10000000/4)   /* 2.5 MHz */
398   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
373   MDRV_CPU_ADD(Z80, MASTER_CLOCK/4)
374   MDRV_CPU_PROGRAM_MAP(main_map,0)
399375   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
400376
401   MDRV_CPU_ADD(Z80, 10000000/4)   /* 2.5 MHz */
402   /* audio CPU */
403   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
404   MDRV_CPU_IO_MAP(0,sound_writeport)
377   MDRV_CPU_ADD(Z80, MASTER_CLOCK/8)
378   MDRV_CPU_PROGRAM_MAP(sound_map,0)
379   MDRV_CPU_IO_MAP(sound_portmap,0)
405380   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
406381
407   MDRV_SCREEN_REFRESH_RATE(60)
408   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
409
382   MDRV_MACHINE_START(kangaroo)
410383   MDRV_MACHINE_RESET(kangaroo)
411384
412385   /* video hardware */
413   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
414   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
415   MDRV_SCREEN_SIZE(32*8, 32*8)
416   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)
417   MDRV_PALETTE_LENGTH(24)
386   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_SCANLINE)
387   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
418388
419   MDRV_PALETTE_INIT(kangaroo)
389   MDRV_SCREEN_ADD("main", 0)
390   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK, 320*2, 0*2, 256*2, 260, 8, 248)
391
420392   MDRV_VIDEO_START(kangaroo)
421393   MDRV_VIDEO_UPDATE(kangaroo)
422394
423395   /* sound hardware */
424396   MDRV_SPEAKER_STANDARD_MONO("mono")
425   MDRV_SOUND_ADD(AY8910, 10000000/8)
397   MDRV_SOUND_ADD(AY8910, MASTER_CLOCK/8)
426398   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
427399MACHINE_DRIVER_END
428400
429401
402static MACHINE_DRIVER_START( mcu )
403   MDRV_IMPORT_FROM(nomcu)
430404
405   MDRV_MACHINE_START(kangaroo_mcu)
406
407   MDRV_CPU_ADD(MB8841, MASTER_CLOCK/4/12)
408   MDRV_CPU_FLAGS(CPU_DISABLE)
409   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
410MACHINE_DRIVER_END
411
412
413
431414/*************************************
432415 *
433416 *  ROM definitions
r1649r1650
464447   ROM_REGION( 0x10000, REGION_CPU2, 0 )
465448   ROM_LOAD( "tvg_81.8",    0x0000, 0x1000, CRC(fb449bfd) SHA1(f593a0339f47e121736a927587132aeb52704557) )
466449
467   ROM_REGION( 0x0800, REGION_CPU3, 0 )  /* 8k for the MB8841 custom microcontroller (currently not emulated) */
450   ROM_REGION( 0x0800, REGION_CPU3, 0 )   /* code for the 8841 custom MCU */
451   ROM_LOAD( "8841.rom",    0x0000, 0x0800, NO_DUMP )
452
453   ROM_REGION( 0x0800, REGION_USER1, 0 )   /* data for the 8841 custom MCU */
468454   ROM_LOAD( "tvg_82.12",   0x0000, 0x0800, CRC(57766f69) SHA1(94a7a557d8325799523d5e1a88653a9a3fbe34f9) )
469455
470456   ROM_REGION( 0x4000, REGION_GFX1, 0 )
r1649r1650
477463
478464ROM_START( kangaroa )
479465   ROM_REGION( 0x10000, REGION_CPU1, 0 )
480   ROM_LOAD( "tvg_75.0",    0x0000, 0x1000, CRC(0d18c581) SHA1(0e0f89d644b79e887c53e5294783843ca7e875ba) )
481   ROM_LOAD( "tvg_76.1",    0x1000, 0x1000, CRC(5978d37a) SHA1(684c1092de4a0927a03752903c86c3bbe99e868a) )
482   ROM_LOAD( "tvg_77.2",    0x2000, 0x1000, CRC(522d1097) SHA1(09fe627a46d32df2e098d9fad7757f9d61bef41f) )
483   ROM_LOAD( "tvg_78.3",    0x3000, 0x1000, CRC(063da970) SHA1(582ff21dd46c651f07a4846e0f8a7544a5891988) )
484   ROM_LOAD( "tvg79.bin",   0x4000, 0x1000, CRC(82a26c7d) SHA1(09087552dbe4d27df79396072c0f9b916f78f89b) )
485   ROM_LOAD( "tvg80.bin",   0x5000, 0x1000, CRC(3dead542) SHA1(0b5d329b1ebbacc650d06289b4e080304e728ea7) )
466   ROM_LOAD( "136008-101.ic7",    0x0000, 0x1000, CRC(0d18c581) SHA1(0e0f89d644b79e887c53e5294783843ca7e875ba) )
467   ROM_LOAD( "136008-102.ic8",    0x1000, 0x1000, CRC(5978d37a) SHA1(684c1092de4a0927a03752903c86c3bbe99e868a) )
468   ROM_LOAD( "136008-103.ic9",    0x2000, 0x1000, CRC(522d1097) SHA1(09fe627a46d32df2e098d9fad7757f9d61bef41f) )
469   ROM_LOAD( "136008-104.ic10",   0x3000, 0x1000, CRC(063da970) SHA1(582ff21dd46c651f07a4846e0f8a7544a5891988) )
470   ROM_LOAD( "136008-105.ic16",   0x4000, 0x1000, CRC(82a26c7d) SHA1(09087552dbe4d27df79396072c0f9b916f78f89b) )
471   ROM_LOAD( "136008-106.ic17",   0x5000, 0x1000, CRC(3dead542) SHA1(0b5d329b1ebbacc650d06289b4e080304e728ea7) )
486472
487473   ROM_REGION( 0x10000, REGION_CPU2, 0 )
488   ROM_LOAD( "tvg_81.8",    0x0000, 0x1000, CRC(fb449bfd) SHA1(f593a0339f47e121736a927587132aeb52704557) )
474   ROM_LOAD( "136008-107.ic24",   0x0000, 0x1000, CRC(fb449bfd) SHA1(f593a0339f47e121736a927587132aeb52704557) )
489475
490   ROM_REGION( 0x0800, REGION_CPU3, 0 )  /* 8k for the MB8841 custom microcontroller (currently not emulated) */
491   ROM_LOAD( "tvg_82.12",   0x0000, 0x0800, CRC(57766f69) SHA1(94a7a557d8325799523d5e1a88653a9a3fbe34f9) )
476   ROM_REGION( 0x0800, REGION_CPU3, 0 )   /* code for the 8841 custom MCU */
477   ROM_LOAD( "8841.rom",          0x0000, 0x0800, NO_DUMP )
492478
479   ROM_REGION( 0x0800, REGION_USER1, 0 )   /* data for the 8841 custom MCU */
480   ROM_LOAD( "136008-112.ic28",   0x0000, 0x0800, CRC(57766f69) SHA1(94a7a557d8325799523d5e1a88653a9a3fbe34f9) )
481
493482   ROM_REGION( 0x4000, REGION_GFX1, 0 )
494   ROM_LOAD( "tvg_83.v0",   0x0000, 0x1000, CRC(c0446ca6) SHA1(fca6ba565051337c0198c93b7b8477632e0dd0b6) )
495   ROM_LOAD( "tvg_85.v2",   0x1000, 0x1000, CRC(72c52695) SHA1(87f4715fbb7d509bd9cc4e71e2afb0d475bbac13) )
496   ROM_LOAD( "tvg_84.v1",   0x2000, 0x1000, CRC(e4cb26c2) SHA1(5016db9d48fdcfb757618659d063b90862eb0e90) )
497   ROM_LOAD( "tvg_86.v3",   0x3000, 0x1000, CRC(9e6a599f) SHA1(76b4eddb4efcd8189d8cc5962d8497e82885f212) )
483   ROM_LOAD( "136008-108.ic76",   0x0000, 0x1000, CRC(c0446ca6) SHA1(fca6ba565051337c0198c93b7b8477632e0dd0b6) )
484   ROM_LOAD( "136008-110.ic77",   0x1000, 0x1000, CRC(72c52695) SHA1(87f4715fbb7d509bd9cc4e71e2afb0d475bbac13) )
485   ROM_LOAD( "136008-109.ic52",   0x2000, 0x1000, CRC(e4cb26c2) SHA1(5016db9d48fdcfb757618659d063b90862eb0e90) )
486   ROM_LOAD( "136008-111.ic53",   0x3000, 0x1000, CRC(9e6a599f) SHA1(76b4eddb4efcd8189d8cc5962d8497e82885f212) )
498487ROM_END
499488
500489
r1649r1650
525514 *
526515 *************************************/
527516
528GAME( 1981, fnkyfish, 0,        kangaroo, fnkyfish, 0, ROT90, "Sun Electronics", "Funky Fish", 0 )
529GAME( 1982, kangaroo, 0,        kangaroo, kangaroo, 0, ROT90, "Sun Electronics", "Kangaroo", 0 )
530GAME( 1982, kangaroa, kangaroo, kangaroo, kangaroo, 0, ROT90, "[Sun Electronics] (Atari license)", "Kangaroo (Atari)", 0 )
531GAME( 1982, kangarob, kangaroo, kangaroo, kangaroo, 0, ROT90, "bootleg", "Kangaroo (bootleg)", 0 )
517GAME( 1981, fnkyfish, 0,        nomcu, fnkyfish, 0, ROT90, "Sun Electronics", "Funky Fish", 0 )
518GAME( 1982, kangaroo, 0,        mcu,   kangaroo, 0, ROT90, "Sun Electronics", "Kangaroo", 0 )
519GAME( 1982, kangaroa, kangaroo, mcu,   kangaroo, 0, ROT90, "[Sun Electronics] (Atari license)", "Kangaroo (Atari)", 0 )
520GAME( 1982, kangarob, kangaroo, nomcu, kangaroo, 0, ROT90, "bootleg", "Kangaroo (bootleg)", 0 )
src/mame/drivers/cabal.c
r1649r1650
4141******************************************************************/
4242
4343#include "driver.h"
44#include "streams.h"
44#include "deprecat.h"
4545#include "cpu/z80/z80.h"
4646#include "audio/seibu.h"
4747#include "sound/2151intf.h"
src/mame/drivers/cidelsa.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/cdp1802/cdp1802.h"
34#include "cpu/cop400/cop400.h"
45#include "video/cdp1869.h"
src/mame/drivers/hotblock.c
r1649r1650
6767{
6868
6969//  mame_printf_debug("port4_r\n");
70   return 0x00;//return mame_rand(Machine); // WHAT HERE?
70   return 0x00;
7171}
7272
7373
src/mame/drivers/suprloco.c
r1649r1650
1212******************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "video/system1.h"
1617#include "cpu/z80/z80.h"
1718#include "machine/segacrpt.h"
src/mame/drivers/m92.c
r1649r1650
189189*****************************************************************************/
190190
191191#include "driver.h"
192#include "deprecat.h"
192193#include "includes/m92.h"
193194#include "drivers/m92.h"
194195#include "machine/irem_cpu.h"
src/mame/drivers/hal21.c
r1649r1650
5353*/
5454
5555#include "driver.h"
56#include "deprecat.h"
5657#include "cpu/z80/z80.h"
5758#include "snk.h"
5859#include "sound/ay8910.h"
src/mame/drivers/m58.c
r0r1650
1/****************************************************************************
2
3    Irem M58 hardware
4
5    L Taylor
6    J Clegg
7
8    Loosely based on the Kung Fu Master driver.
9
10****************************************************************************/
11
12#include "driver.h"
13#include "m58.h"
14#include "audio/irem.h"
15
16#define MASTER_CLOCK      XTAL_18_432MHz
17
18
19
20/*************************************
21 *
22 *  Outputs
23 *
24 *************************************/
25
26static WRITE8_HANDLER( yard_flipscreen_w )
27{
28   flip_screen_set((data & 0x01) ^ (~readinputport(4) & 0x01));
29
30   coin_counter_w(0, data & 0x02);
31   coin_counter_w(1, data & 0x20);
32}
33
34
35
36/*************************************
37 *
38 *  Memory maps
39 *
40 *************************************/
41
42static ADDRESS_MAP_START( yard_map, ADDRESS_SPACE_PROGRAM, 8 )
43   AM_RANGE(0x0000, 0x5fff) AM_ROM
44   AM_RANGE(0x8000, 0x8fff) AM_RAM AM_WRITE(yard_videoram_w) AM_BASE(&videoram)
45   AM_RANGE(0x9000, 0x9fff) AM_WRITE(yard_scroll_panel_w)
46   AM_RANGE(0xc820, 0xc87f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
47   AM_RANGE(0xa000, 0xa000) AM_RAM AM_BASE(&yard_scroll_x_low)
48   AM_RANGE(0xa200, 0xa200) AM_RAM AM_BASE(&yard_scroll_x_high)
49   AM_RANGE(0xa400, 0xa400) AM_RAM AM_BASE(&yard_scroll_y_low)
50   AM_RANGE(0xa800, 0xa800) AM_RAM AM_BASE(&yard_score_panel_disabled)
51   AM_RANGE(0xd000, 0xd000) AM_READWRITE(input_port_0_r, irem_sound_cmd_w)
52   AM_RANGE(0xd001, 0xd001) AM_READWRITE(input_port_1_r, yard_flipscreen_w)
53   AM_RANGE(0xd002, 0xd002) AM_READ(input_port_2_r)
54   AM_RANGE(0xd003, 0xd003) AM_READ(input_port_3_r)
55   AM_RANGE(0xd004, 0xd004) AM_READ(input_port_4_r)
56   AM_RANGE(0xe000, 0xefff) AM_RAM
57ADDRESS_MAP_END
58
59
60
61/*************************************
62 *
63 *  Port definitions
64 *
65 *************************************/
66
67static INPUT_PORTS_START( yard )
68   PORT_START_TAG("IN0")
69   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
70   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
71   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(19) // coin input must be active for 19 frames to be consistently recognized
72   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
73   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
74   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
75   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
76   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
77
78   PORT_START_TAG("IN1")
79   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
80   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY
81   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY
82   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY
83   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
84   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
85   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
86   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
87
88   PORT_START_TAG("IN2")
89   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
90   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_COCKTAIL
91   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_COCKTAIL
92   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_COCKTAIL
93   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
94   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
95   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
96   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
97
98   PORT_START_TAG("DSW1")
99   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:1") /* Listed as "Unused" */
100   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
101   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
102   PORT_DIPNAME( 0x02, 0x02, "Defensive Man Pause" ) PORT_DIPLOCATION("SW1:2") /* Listed as "Unused" */
103   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
104   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
105   PORT_DIPNAME( 0x0c, 0x0c, "Time Reduced by Ball Dead" ) PORT_DIPLOCATION("SW1:3,4")
106   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
107   PORT_DIPSETTING(    0x08, "x1.3" )
108   PORT_DIPSETTING(    0x04, "x1.5" )
109   PORT_DIPSETTING(    0x00, "x1.8" )
110    // coin mode 1
111   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) )      PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION("SW1:5,6,7,8")
112    PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) )
113    PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) )
114    PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
115    PORT_DIPSETTING(    0xd0, DEF_STR( 3C_1C ) )
116    PORT_DIPSETTING(    0xe0, DEF_STR( 2C_1C ) )
117    PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
118    PORT_DIPSETTING(    0x70, DEF_STR( 1C_2C ) )
119    PORT_DIPSETTING(    0x60, DEF_STR( 1C_3C ) )
120    PORT_DIPSETTING(    0x50, DEF_STR( 1C_4C ) )
121    PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
122    PORT_DIPSETTING(    0x30, DEF_STR( 1C_6C ) )
123    PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
124    // coin mode 2
125    PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )       PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW1:5,6")
126    PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
127    PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
128    PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
129    PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
130    PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )       PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW1:7,8")
131    PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
132    PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
133    PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
134    PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
135
136   PORT_START_TAG("DSW2")
137   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
138   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
139   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
140   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2")
141   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
142   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
143   PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) PORT_DIPLOCATION("SW2:3")
144   PORT_DIPSETTING(    0x04, "Mode 1" )
145   PORT_DIPSETTING(    0x00, "Mode 2" )
146   PORT_DIPNAME( 0x08, 0x08, "Slow Motion" ) PORT_DIPLOCATION("SW2:4") /* Listed as "Unused" */
147   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
148   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
149   PORT_DIPNAME( 0x10, 0x10, "Freeze Picture" ) PORT_DIPLOCATION("SW2:5") /* 2P Start stops gameplay, 1P Start continues */
150   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
151   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
152   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW2:6") /* Listed as "Unused" */
153   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
154   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
155   PORT_DIPNAME( 0x40, 0x40, "Invulnerability" ) PORT_DIPLOCATION("SW2:7")
156   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
157   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
158   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW2:8" )
159INPUT_PORTS_END
160
161static INPUT_PORTS_START( vsyard )
162   PORT_INCLUDE(yard)
163
164   PORT_MODIFY("DSW1")
165   PORT_DIPNAME( 0x01, 0x01, "Allow Continue (Vs. Mode)" ) PORT_DIPLOCATION("SW1:1")
166   PORT_DIPSETTING( 0x01, DEF_STR( No ) )
167   PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
168INPUT_PORTS_END
169
170
171
172/*************************************
173 *
174 *  Graphics layouts
175 *
176 *************************************/
177
178static const gfx_layout spritelayout =
179{
180   16, 16,
181   RGN_FRAC(1,3),
182   3,
183   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },
184   { STEP8(0,1), STEP8(16*8,1) },
185   { STEP16(0,8) },
186   32*8
187};
188
189
190static GFXDECODE_START( yard )
191   GFXDECODE_ENTRY( REGION_GFX1, 0, gfx_8x8x3_planar,   0, 32 )
192   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,     512, 32 )
193GFXDECODE_END
194
195
196
197/*************************************
198 *
199 *  Machine drivers
200 *
201 *************************************/
202
203static MACHINE_DRIVER_START( yard )
204
205   /* basic machine hardware */
206   MDRV_CPU_ADD(Z80, MASTER_CLOCK/3/2)
207   MDRV_CPU_PROGRAM_MAP(yard_map, 0)
208   MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
209
210   /* video hardware */
211   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
212   MDRV_GFXDECODE(yard)
213   MDRV_PALETTE_LENGTH(256+256+256)
214
215   MDRV_SCREEN_ADD("main", 0)
216   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 256, 282, 42, 266)
217   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
218
219   MDRV_PALETTE_INIT(yard)
220   MDRV_VIDEO_START(yard)
221   MDRV_VIDEO_UPDATE(yard)
222
223   /* sound hardware */
224   MDRV_IMPORT_FROM(m52_large_audio)
225MACHINE_DRIVER_END
226
227
228
229/*************************************
230 *
231 *  ROM definitions
232 *
233 *************************************/
234
235ROM_START( 10yard )
236   ROM_REGION( 0x10000, REGION_CPU1, 0 )
237   ROM_LOAD( "yf-a-3p-b",    0x0000, 0x2000, CRC(2e205ec2) SHA1(fcfa08f45423b35f2c99d4e6b5474ab1b3a84fec) )
238   ROM_LOAD( "yf-a-3n-b",    0x2000, 0x2000, CRC(82fcd980) SHA1(7846705b29961cb95ee1571ee7e16baceea522d4) )
239   ROM_LOAD( "yf-a-3m-b",    0x4000, 0x2000, CRC(a8d5c311) SHA1(28edb5cfd943a2262d7e37ef9a7245f7017cbc51) )
240
241   ROM_REGION( 0x10000, REGION_CPU2, 0 )
242   ROM_LOAD( "yf-s.3b",      0x8000, 0x2000, CRC(0392a60c) SHA1(68030504eafc58db250099edd3c3323bdb9eff6b) )
243   ROM_LOAD( "yf-s.1b",      0xa000, 0x2000, CRC(6588f41a) SHA1(209305efc68171886427216b9a0b37333f40daa8) )
244   ROM_LOAD( "yf-s.3a",      0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
245   ROM_LOAD( "yf-s.1a",      0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
246
247   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
248   ROM_LOAD( "yf-a.3e",      0x00000, 0x2000, CRC(77e9e9cc) SHA1(90b0226fc125713dbee2804aeceeb5aa2c8e275e) )   /* chars */
249   ROM_LOAD( "yf-a.3d",      0x02000, 0x2000, CRC(854d5ff4) SHA1(9ba09bfabf159facb57faecfe73a6258fa48d152) )
250   ROM_LOAD( "yf-a.3c",      0x04000, 0x2000, CRC(0cd8ffad) SHA1(bd1262de3823c34f7394b718477fb5bc58a6e293) )
251
252   ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
253   ROM_LOAD( "yf-b.5b",      0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )   /* sprites */
254   ROM_LOAD( "yf-b.5c",      0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
255   ROM_LOAD( "yf-b.5f",      0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
256   ROM_LOAD( "yf-b.5e",      0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
257   ROM_LOAD( "yf-b.5j",      0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
258   ROM_LOAD( "yf-b.5k",      0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
259
260   ROM_REGION( 0x0520, REGION_PROMS, 0 )
261   ROM_LOAD( "yard.1c",      0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
262   ROM_LOAD( "yard.1d",      0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
263   ROM_LOAD( "yard.1f",      0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) /* sprites palette */
264   ROM_LOAD( "yard.2h",      0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
265   ROM_LOAD( "yard.2n",      0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
266   ROM_LOAD( "yard.2m",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
267ROM_END
268
269ROM_START( 10yardj )
270   ROM_REGION( 0x10000, REGION_CPU1, 0 )
271   ROM_LOAD( "yf-a.3p",      0x0000, 0x2000, CRC(4586114f) SHA1(a31c68770e7a7eed805c5ba46af302c2895e3cee) )
272   ROM_LOAD( "yf-a.3n",      0x2000, 0x2000, CRC(947fa760) SHA1(bd6c2ee6e6800b063b81dbdd9fc929120019439d) )
273   ROM_LOAD( "yf-a.3m",      0x4000, 0x2000, CRC(d4975633) SHA1(84a506ae680a9dd26ef6f33880400e965ccf8260) )
274
275   ROM_REGION( 0x10000, REGION_CPU2, 0 )
276   ROM_LOAD( "yf-s.3b",      0x8000, 0x2000, CRC(0392a60c) SHA1(68030504eafc58db250099edd3c3323bdb9eff6b) )
277   ROM_LOAD( "yf-s.1b",      0xa000, 0x2000, CRC(6588f41a) SHA1(209305efc68171886427216b9a0b37333f40daa8) )
278   ROM_LOAD( "yf-s.3a",      0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
279   ROM_LOAD( "yf-s.1a",      0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
280
281   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
282   ROM_LOAD( "yf-a.3e",      0x00000, 0x2000, CRC(77e9e9cc) SHA1(90b0226fc125713dbee2804aeceeb5aa2c8e275e) )   /* chars */
283   ROM_LOAD( "yf-a.3d",      0x02000, 0x2000, CRC(854d5ff4) SHA1(9ba09bfabf159facb57faecfe73a6258fa48d152) )
284   ROM_LOAD( "yf-a.3c",      0x04000, 0x2000, CRC(0cd8ffad) SHA1(bd1262de3823c34f7394b718477fb5bc58a6e293) )
285
286   ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
287   ROM_LOAD( "yf-b.5b",      0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )   /* sprites */
288   ROM_LOAD( "yf-b.5c",      0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
289   ROM_LOAD( "yf-b.5f",      0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
290   ROM_LOAD( "yf-b.5e",      0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
291   ROM_LOAD( "yf-b.5j",      0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
292   ROM_LOAD( "yf-b.5k",      0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
293
294   ROM_REGION( 0x0520, REGION_PROMS, 0 )
295   ROM_LOAD( "yard.1c",      0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
296   ROM_LOAD( "yard.1d",      0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
297   ROM_LOAD( "yard.1f",      0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) /* sprites palette */
298   ROM_LOAD( "yard.2h",      0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
299   ROM_LOAD( "yard.2n",      0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
300   ROM_LOAD( "yard.2m",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
301ROM_END
302
303ROM_START( vs10yard )
304   ROM_REGION( 0x10000, REGION_CPU1, 0 )
305   ROM_LOAD( "a.3p",         0x0000, 0x2000, CRC(1edac08f) SHA1(c6a3290e9dba663dccf0613853abfab8e912477d) )
306   ROM_LOAD( "vyf-a.3m",     0x2000, 0x2000, CRC(3b9330f8) SHA1(b35fe72cf724cfb887906060bbcf40b0c896ccf0) )
307   ROM_LOAD( "a.3m",         0x4000, 0x2000, CRC(cf783dad) SHA1(0b1b875ac65ba90c92ca06d0aa01c477b7427322) )
308
309   ROM_REGION( 0x10000, REGION_CPU2, 0 )
310   ROM_LOAD( "yf-s.3b",      0x8000, 0x2000, CRC(0392a60c) SHA1(68030504eafc58db250099edd3c3323bdb9eff6b) )
311   ROM_LOAD( "yf-s.1b",      0xa000, 0x2000, CRC(6588f41a) SHA1(209305efc68171886427216b9a0b37333f40daa8) )
312   ROM_LOAD( "yf-s.3a",      0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
313   ROM_LOAD( "yf-s.1a",      0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
314
315   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
316   ROM_LOAD( "vyf-a.3a",     0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) )   /* chars */
317   ROM_LOAD( "vyf-a.3c",     0x02000, 0x2000, CRC(f48eedca) SHA1(6aef3208de8b1dd4078de20c0b5ce96219c79d40) )
318   ROM_LOAD( "vyf-a.3d",     0x04000, 0x2000, CRC(7d1b4d93) SHA1(9389de1230b93f529c492af6fb911c00280cae8a) )
319
320   ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
321   ROM_LOAD( "yf-b.5b",      0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )   /* sprites */
322   ROM_LOAD( "yf-b.5c",      0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
323   ROM_LOAD( "yf-b.5f",      0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
324   ROM_LOAD( "yf-b.5e",      0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
325   ROM_LOAD( "yf-b.5j",      0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
326   ROM_LOAD( "yf-b.5k",      0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
327
328   ROM_REGION( 0x0520, REGION_PROMS, 0 )
329   ROM_LOAD( "yard.1c",      0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
330   ROM_LOAD( "yard.1d",      0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
331   ROM_LOAD( "yard.1f",      0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) /* sprites palette */
332   ROM_LOAD( "yard.2h",      0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
333   ROM_LOAD( "yard.2n",      0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
334   ROM_LOAD( "yard.2m",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
335ROM_END
336
337ROM_START( vs10yarj )
338   ROM_REGION( 0x10000, REGION_CPU1, 0 )
339   ROM_LOAD( "vyf-a.3n",     0x0000, 0x2000, CRC(418e01fc) SHA1(56a6515735cd88ec803e24574a28aef823a5d36b) )
340   ROM_LOAD( "vyf-a.3m",     0x2000, 0x2000, CRC(3b9330f8) SHA1(b35fe72cf724cfb887906060bbcf40b0c896ccf0) )
341   ROM_LOAD( "vyf-a.3k",     0x4000, 0x2000, CRC(a0ec15bb) SHA1(a5ce9341e9d05e33c025ac62a27faf738c88326e) )
342
343   ROM_REGION( 0x10000, REGION_CPU2, 0 )
344   ROM_LOAD( "yf-s.3b",      0x8000, 0x2000, CRC(0392a60c) SHA1(68030504eafc58db250099edd3c3323bdb9eff6b) )
345   ROM_LOAD( "yf-s.1b",      0xa000, 0x2000, CRC(6588f41a) SHA1(209305efc68171886427216b9a0b37333f40daa8) )
346   ROM_LOAD( "yf-s.3a",      0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
347   ROM_LOAD( "yf-s.1a",      0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
348
349   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
350   ROM_LOAD( "vyf-a.3a",     0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) )   /* chars */
351   ROM_LOAD( "vyf-a.3c",     0x02000, 0x2000, CRC(f48eedca) SHA1(6aef3208de8b1dd4078de20c0b5ce96219c79d40) )
352   ROM_LOAD( "vyf-a.3d",     0x04000, 0x2000, CRC(7d1b4d93) SHA1(9389de1230b93f529c492af6fb911c00280cae8a) )
353
354   ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
355   ROM_LOAD( "yf-b.5b",      0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )   /* sprites */
356   ROM_LOAD( "yf-b.5c",      0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
357   ROM_LOAD( "yf-b.5f",      0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
358   ROM_LOAD( "yf-b.5e",      0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
359   ROM_LOAD( "yf-b.5j",      0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
360   ROM_LOAD( "yf-b.5k",      0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
361
362   ROM_REGION( 0x0520, REGION_PROMS, 0 )
363   ROM_LOAD( "yard.1c",      0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
364   ROM_LOAD( "yard.1d",      0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
365   ROM_LOAD( "yard.1f",      0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) /* sprites palette */
366   ROM_LOAD( "yard.2h",      0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
367   ROM_LOAD( "yard.2n",      0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
368   ROM_LOAD( "yard.2m",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
369ROM_END
370
371
372
373/*************************************
374 *
375 *  Game drivers
376 *
377 *************************************/
378
379GAME( 1983, 10yard,        0, yard, yard,   0, ROT0, "Irem", "10-Yard Fight (World)", 0 )
380GAME( 1983, 10yardj,  10yard, yard, yard,   0, ROT0, "Irem", "10-Yard Fight (Japan)", 0 )
381GAME( 1984, vs10yard, 10yard, yard, vsyard, 0, ROT0, "Irem", "Vs 10-Yard Fight (World, 11/05/84)", 0 )
382GAME( 1984, vs10yarj, 10yard, yard, vsyard, 0, ROT0, "Irem", "Vs 10-Yard Fight (Japan)", 0 )
src/mame/drivers/vendetta.c
r1649r1650
8787***************************************************************************/
8888
8989#include "driver.h"
90#include "deprecat.h"
9091#include "video/konamiic.h"
9192#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
9293#include "machine/eeprom.h"
src/mame/drivers/destroyr.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910extern VIDEO_UPDATE( destroyr );
1011
src/mame/drivers/segas16b.c
r1649r1650
77    Known bugs:
88        * none at this time
99
10    DIP locations verified from manual for:
11        * aceattac
12        * aliensyn
13        * altbeast
14        * atomicp
15        * aurail
16        * bayroute
17        * cotton
18        * ddux
19        * eswat
20        * fpoint
21        * goldnaxe
22        * mvp
23        * passsht
24        * shinobi
25        * sonicbom
26        * tetris
27        * timescan
28        * toryumon
29        * wb3
30        * wrestwar
31
1032****************************************************************************
1133
1234    Altered Beast    171-5521
r1649r1650
829851*/
830852
831853#include "driver.h"
854#include "deprecat.h"
832855#include "system16.h"
833856#include "machine/segaic16.h"
834857#include "machine/fd1094.h"
r1649r1650
18091832   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
18101833   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
18111834
1812   PORT_START_TAG("DSW")
1813   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:1")
1814   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1815   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1816   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:2")
1817   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1818   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1819   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:3")
1820   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1821   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1822   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:4")
1823   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1824   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1825   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:5")
1826   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1827   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1828   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:6")
1829   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1830   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1831   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:7")
1832   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1833   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1834   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:8")
1835   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1836   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1835   PORT_START_TAG("DSW2")
1836   PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0001, "SW2:1" )
1837   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW2:2" )
1838   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW2:3" )
1839   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW2:4" )
1840   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" )
1841   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" )
1842   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" )
1843   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW2:8" )
18371844
1838   PORT_START_TAG("COINAGE")
1839   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3,4")
1845   PORT_START_TAG("DSW1")
1846   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
18401847   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
18411848   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
18421849   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
r1649r1650
18531860   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
18541861   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
18551862   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
1856   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:5,6,7,8")
1863   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
18571864   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
18581865   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
18591866   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
r1649r1650
19111918 *
19121919 *************************************/
19131920
1921static INPUT_PORTS_START( aceattac )
1922   PORT_INCLUDE( system16b_generic )
1923
1924   PORT_MODIFY("SERVICE")
1925   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )         /* Block Switch */
1926   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)   /* Block Switch */
1927
1928   /* This is the direction control of the "hand" device for player 1 */
1929   /* I'm sure there is a better way to do this but I don't fully understand how the device works yet */
1930   PORT_MODIFY("P1")
1931   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
1932   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
1933   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 )
1934   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 )
1935   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 )
1936   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON7 )
1937   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON8 )
1938   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON9 )
1939
1940   /* This is the power control of the "hand" device for player 1 */
1941   PORT_MODIFY("UNUSED")
1942   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON10 )
1943   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON11 )
1944   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 )
1945
1946   /* This is the direction control of the "hand" device for player 2 */
1947   /* I'm sure there is a better way to do this but I don't fully understand how the device works yet */
1948   PORT_MODIFY("P2")
1949   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1950   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1951   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1952   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
1953   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
1954   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(2)
1955   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_PLAYER(2)
1956   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_PLAYER(2)
1957
1958   /* This is the power control of the "hand" device for player 2 */
1959   PORT_START_TAG("POW2")
1960   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_PLAYER(2)
1961   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_PLAYER(2)
1962   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_PLAYER(2)
1963
1964   PORT_MODIFY("DSW2")
1965   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
1966   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1967   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1968   PORT_DIPNAME( 0x0e, 0x0e, "Starting Points" )  PORT_DIPLOCATION("SW2:2,3,4")
1969   PORT_DIPSETTING(    0x06, "2000" )
1970   PORT_DIPSETTING(    0x0a, "3000" )
1971   PORT_DIPSETTING(    0x0c, "4000" )
1972   PORT_DIPSETTING(    0x0e, "5000" )
1973   PORT_DIPSETTING(    0x08, "6000" )
1974   PORT_DIPSETTING(    0x04, "7000" )
1975   PORT_DIPSETTING(    0x02, "8000" )
1976   PORT_DIPSETTING(    0x00, "9000" )
1977   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SW2:5,6")
1978   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1979   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1980   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1981   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1982   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
1983   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1984   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1985   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1986   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1987
1988   PORT_START_TAG("ANALOGX1")
1989   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(75) PORT_KEYDELTA(5) PORT_REVERSE
1990
1991   PORT_START_TAG("ANALOGY1")
1992   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(75) PORT_KEYDELTA(5)
1993
1994   PORT_START_TAG("DIAL1")
1995   PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15)
1996
1997   PORT_START_TAG("ANALOGX2")
1998   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(75) PORT_KEYDELTA(5) PORT_REVERSE
1999
2000   PORT_START_TAG("ANALOGY2")
2001   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(75) PORT_KEYDELTA(5)
2002
2003   PORT_START_TAG("DIAL2")
2004   PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15)
2005INPUT_PORTS_END
2006
19142007static INPUT_PORTS_START( aliensyn )
19152008   PORT_INCLUDE( system16b_1button )
19162009
1917   PORT_MODIFY("DSW")
1918   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2010   PORT_MODIFY("DSW2")
2011   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
19192012   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
19202013   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1921   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2014   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
19222015   PORT_DIPSETTING(    0x08, "2" )
19232016   PORT_DIPSETTING(    0x0c, "3" )
19242017   PORT_DIPSETTING(    0x04, "4" )
1925   PORT_DIPSETTING(    0x00, "127")
1926   PORT_DIPNAME( 0x30, 0x30, "Timer" ) PORT_DIPLOCATION("SWB:5,6")
2018   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
2019   PORT_DIPNAME( 0x30, 0x30, "Timer" ) PORT_DIPLOCATION("SW2:5,6")
19272020   PORT_DIPSETTING(    0x00, "120" )
19282021   PORT_DIPSETTING(    0x10, "130" )
19292022   PORT_DIPSETTING(    0x20, "140" )
19302023   PORT_DIPSETTING(    0x30, "150" )
1931   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
2024   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
19322025   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
19332026   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
19342027   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
19392032static INPUT_PORTS_START( altbeast )
19402033   PORT_INCLUDE( system16b_generic )
19412034
1942   PORT_MODIFY("DSW")
1943   PORT_DIPNAME( 0x01, 0x01, "Credits needed" ) PORT_DIPLOCATION("SWB:1")
1944   PORT_DIPSETTING(    0x01, "1 to start, 1 to continue" )
1945   PORT_DIPSETTING(    0x00, "2 to start, 1 to continue" )
1946   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2035   PORT_MODIFY("DSW2")
2036   PORT_DIPNAME( 0x01, 0x01, "Credits Needed" ) PORT_DIPLOCATION("SW2:1")
2037   PORT_DIPSETTING(    0x01, "1 Credit To Start" )
2038   PORT_DIPSETTING(    0x00, "2 Credit To Start" )
2039   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
19472040   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
19482041   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1949   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2042   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
19502043   PORT_DIPSETTING(    0x08, "2" )
19512044   PORT_DIPSETTING(    0x0c, "3" )
19522045   PORT_DIPSETTING(    0x04, "4" )
1953   PORT_DIPSETTING(    0x00, "240")
1954   PORT_DIPNAME( 0x30, 0x30, "Energy Meter" ) PORT_DIPLOCATION("SWB:5,6")
2046   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
2047   PORT_DIPNAME( 0x30, 0x30, "Player Meter" ) PORT_DIPLOCATION("SW2:5,6")
19552048   PORT_DIPSETTING(    0x20, "2" )
19562049   PORT_DIPSETTING(    0x30, "3" )
19572050   PORT_DIPSETTING(    0x10, "4" )
19582051   PORT_DIPSETTING(    0x00, "5" )
1959   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
2052   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
19602053   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
19612054   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
19622055   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
19672060static INPUT_PORTS_START( aurail )
19682061   PORT_INCLUDE( system16b_generic )
19692062
1970   PORT_MODIFY("DSW")
1971   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
2063   PORT_MODIFY("DSW2")
2064   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
19722065   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
19732066   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1974   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2067   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
19752068   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
19762069   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1977   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2070   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
19782071   PORT_DIPSETTING(    0x00, "2" )
19792072   PORT_DIPSETTING(    0x0c, "3" )
19802073   PORT_DIPSETTING(    0x08, "4" )
19812074   PORT_DIPSETTING(    0x04, "5" )
1982   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5")
1983   PORT_DIPSETTING(    0x10, "80K/200K/500K/1 Mil" )
1984   PORT_DIPSETTING(    0x00, "100K/300K/700K/1 Mil" )
1985   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:6")
2075   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5")
2076   PORT_DIPSETTING(    0x10, "80K/200K/500K/1000K" )
2077   PORT_DIPSETTING(    0x00, "100K/300K/700K/1000K" )
2078   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6")
19862079   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
19872080   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1988   PORT_DIPNAME( 0x40, 0x40, "Controller select" ) PORT_DIPLOCATION("SWB:7")
1989   PORT_DIPSETTING(    0x40, "1 Player side" )
1990   PORT_DIPSETTING(    0x00, "2 Players side" )
1991   PORT_DIPNAME( 0x80, 0x80, "Special Function Mode" ) PORT_DIPLOCATION("SWB:8")
2081   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Controller ) ) PORT_DIPLOCATION("SW2:7")
2082   PORT_DIPSETTING(    0x40, "1 Player Side" )
2083   PORT_DIPSETTING(    0x00, "2 Players Side" )
2084   PORT_DIPNAME( 0x80, 0x80, "Special Function Mode" ) PORT_DIPLOCATION("SW2:8")
19922085   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
19932086   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19942087INPUT_PORTS_END
r1649r1650
19972090static INPUT_PORTS_START( bayroute )
19982091   PORT_INCLUDE( system16b_generic )
19992092
2000   PORT_MODIFY("DSW")
2001   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWB:1")
2093   PORT_MODIFY("DSW2")
2094   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:1")
20022095   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
20032096   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
2004   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2097   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
20052098   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
20062099   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2007   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2100   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
20082101   PORT_DIPSETTING(    0x04, "1" )
20092102   PORT_DIPSETTING(    0x0c, "3" )
20102103   PORT_DIPSETTING(    0x08, "5" )
2011   PORT_DIPSETTING(    0x00, "Unlimited")
2012   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5,6")
2013   PORT_DIPSETTING(    0x30, "100000" )
2014   PORT_DIPSETTING(    0x20, "150000" )
2015   PORT_DIPSETTING(    0x10, "200000" )
2104   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
2105   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6")
2106   PORT_DIPSETTING(    0x30, "100k" )
2107   PORT_DIPSETTING(    0x20, "150k" )
2108   PORT_DIPSETTING(    0x10, "200k" )
20162109   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2017   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
2110   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
20182111   PORT_DIPSETTING(    0xc0, DEF_STR( Easy ) )
20192112   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
20202113   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
20582151   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY PORT_PLAYER(2)
20592152   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY PORT_PLAYER(2)
20602153   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY PORT_PLAYER(2)
2061
2062   PORT_MODIFY("DSW")
2063   PORT_DIPUNUSED( 0x01, 0x01 )   /* 2p vs. 3p */
2064   PORT_DIPUNUSED( 0x02, 0x02 )
2065   PORT_DIPUNUSED( 0x04, 0x04 )
2066   PORT_DIPUNUSED( 0x08, 0x08 )
2067   PORT_DIPUNUSED( 0x10, 0x10 )
2068   PORT_DIPUNUSED( 0x20, 0x20 )
2069   PORT_DIPUNUSED( 0x40, 0x40 )
2070   PORT_DIPUNUSED( 0x80, 0x80 )
2154/*
2155    PORT_MODIFY("DSW2")
2156    PORT_DIPUNUSED( 0x01, 0x01 )    // 2p vs. 3p
2157*/
20712158INPUT_PORTS_END
20722159
20732160
20742161static INPUT_PORTS_START( cotton )
20752162   PORT_INCLUDE( system16b_2button )
20762163
2077   PORT_MODIFY("DSW")
2078   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )PORT_DIPLOCATION("SWB:1")
2164   PORT_MODIFY("DSW2")
2165   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )PORT_DIPLOCATION("SW2:1")
20792166   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
20802167   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2081   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:2,3")
2168   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:2,3")
20822169   PORT_DIPSETTING(    0x04, "2" )
20832170   PORT_DIPSETTING(    0x06, "3" )
20842171   PORT_DIPSETTING(    0x02, "4" )
20852172   PORT_DIPSETTING(    0x00, "5" )
2086   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:4,5")
2173   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,5")
20872174   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
20882175   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
20892176   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
r1649r1650
20942181static INPUT_PORTS_START( ddux )
20952182   PORT_INCLUDE( system16b_2button )
20962183
2097   PORT_MODIFY("DSW")
2098   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
2184   PORT_MODIFY("DSW2")
2185   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
20992186   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
21002187   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2101   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:2,3")
2188   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,3")
21022189   PORT_DIPSETTING(    0x04, DEF_STR( Easy ) )
21032190   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
21042191   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
21052192   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2106   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:4,5")
2193   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4,5")
21072194   PORT_DIPSETTING(    0x10, "2" )
21082195   PORT_DIPSETTING(    0x18, "3" )
21092196   PORT_DIPSETTING(    0x08, "4" )
21102197   PORT_DIPSETTING(    0x00, "5" )
2111   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:6,7")
2112   PORT_DIPSETTING(    0x40, "150000" )
2113   PORT_DIPSETTING(    0x60, "200000" )
2114   PORT_DIPSETTING(    0x20, "300000" )
2115   PORT_DIPSETTING(    0x00, "400000" )
2198   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:6,7")
2199   PORT_DIPSETTING(    0x40, "150k" )
2200   PORT_DIPSETTING(    0x60, "200k" )
2201   PORT_DIPSETTING(    0x20, "300k" )
2202   PORT_DIPSETTING(    0x00, "400k" )
21162203   /* Switch #8 is listed as "NOT USED" and "Always OFF" */
21172204INPUT_PORTS_END
21182205
r1649r1650
21372224   PORT_MODIFY("P2")
21382225   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
21392226
2140   PORT_MODIFY("DSW")
2141   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2227   PORT_MODIFY("DSW2")
2228   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
21422229   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
21432230   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21442231   PORT_DIPNAME( 0x0c, 0x0c, "VS Time" )
r1649r1650
21462233   PORT_DIPSETTING(    0x0c, "2P 2:00/ 3P 2:30/ 4P 3:00" )
21472234   PORT_DIPSETTING(    0x04, "2P 2:30/ 3P 3:00/ 4P 3:30" )
21482235   PORT_DIPSETTING(    0x00, "2P 3:00/ 3P 3:30/ 4P 4:00" )
2149   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
2236   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
21502237   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
21512238   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
21522239   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
21532240   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2154   PORT_DIPNAME( 0x40, 0x40, "CPU Starts With +6 Pts." ) PORT_DIPLOCATION("SWB:7")
2241   PORT_DIPNAME( 0x40, 0x40, "CPU Starts With +6 Pts." ) PORT_DIPLOCATION("SW2:7")
21552242   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
21562243   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21572244
r1649r1650
21842271static INPUT_PORTS_START( eswat )
21852272   PORT_INCLUDE( system16b_generic )
21862273
2187   PORT_MODIFY("DSW")
2188   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" ) PORT_DIPLOCATION("SWB:1")
2189   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2190   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2191   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2274   PORT_MODIFY("DSW2")
2275   PORT_DIPNAME( 0x01, 0x01, "Credits To Start" ) PORT_DIPLOCATION("SW2:1")
2276   PORT_DIPSETTING(    0x01, "1 Credit" )
2277   PORT_DIPSETTING(    0x00, "2 Credits" )
2278   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
21922279   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
21932280   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2194   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:3")
2281   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:3")
21952282   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
21962283   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2197   PORT_DIPNAME( 0x08, 0x08, "Time" ) PORT_DIPLOCATION("SWB:4")
2284   PORT_DIPNAME( 0x08, 0x08, "Timer" ) PORT_DIPLOCATION("SW2:4")
21982285   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
21992286   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2200   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
2287   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
22012288   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
22022289   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
22032290   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
22042291   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2205   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:7,8")
2292   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7,8")
22062293   PORT_DIPSETTING(    0x00, "1" )
22072294   PORT_DIPSETTING(    0x40, "2" )
22082295   PORT_DIPSETTING(    0xc0, "3" )
r1649r1650
22432330   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(2)      /* MID */
22442331   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_PLAYER(2)      /* HI */
22452332
2246   PORT_MODIFY("DSW")
2247   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
2333   PORT_MODIFY("DSW2")
2334   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
22482335   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
22492336   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2250   PORT_DIPNAME( 0x0e, 0x0e, "Starting Points" )  PORT_DIPLOCATION("SWB:2,3,4")
2337   PORT_DIPNAME( 0x0e, 0x0e, "Starting Points" )  PORT_DIPLOCATION("SW2:2,3,4")
22512338   PORT_DIPSETTING(    0x06, "2000" )
22522339   PORT_DIPSETTING(    0x0a, "3000" )
22532340   PORT_DIPSETTING(    0x0c, "4000" )
r1649r1650
22562343   PORT_DIPSETTING(    0x04, "7000" )
22572344   PORT_DIPSETTING(    0x02, "8000" )
22582345   PORT_DIPSETTING(    0x00, "9000" )
2259   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
2346   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
22602347   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
22612348   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
22622349   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
22632350   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2264   PORT_DIPNAME( 0xc0, 0xc0, "Point Table" ) PORT_DIPLOCATION("SWB:7,8")
2351   PORT_DIPNAME( 0xc0, 0xc0, "Point Table" ) PORT_DIPLOCATION("SW2:7,8")
22652352   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
22662353   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
22672354   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
22902377static INPUT_PORTS_START( fpoint )
22912378   PORT_INCLUDE( system16b_1button )
22922379
2293   PORT_MODIFY("DSW")
2294   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2380   PORT_MODIFY("DSW2")
2381   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
22952382   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
22962383   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2297   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
2384   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
22982385   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
22992386   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
23002387   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
23012388   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2302   PORT_DIPNAME( 0x40, 0x40, "Clear round allowed" ) PORT_DIPLOCATION("SWB:7") /* Use button 3 */
2389   PORT_DIPNAME( 0x40, 0x40, "Clear Round Allowed" ) PORT_DIPLOCATION("SW2:7") /* Use button 3 */
23032390   PORT_DIPSETTING(    0x00, "1" )
23042391   PORT_DIPSETTING(    0x40, "2" )
2305   PORT_DIPNAME( 0x80, 0x80, "2 Cell Move" ) PORT_DIPLOCATION("SWB:8")
2306   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2307   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
2392   /* SW2:8 The mode in which a block falls at twice [ usual ] speed as this when playing 25 minutes or more on one coin. */
2393   PORT_DIPNAME( 0x80, 0x80, "2 Cell Move" ) PORT_DIPLOCATION("SW2:8")
2394   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2395   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
23082396   /* Switches 1, 3, 4 & 7 are listed as "Always off" */
23092397INPUT_PORTS_END
23102398
r1649r1650
23122400static INPUT_PORTS_START( goldnaxe )
23132401   PORT_INCLUDE( system16b_generic )
23142402
2315   PORT_MODIFY("DSW")
2316   PORT_DIPNAME( 0x01, 0x01, "Credits needed" ) PORT_DIPLOCATION("SWB:1")
2317   PORT_DIPSETTING(    0x01, "1 to start, 1 to continue" )
2318   PORT_DIPSETTING(    0x00, "2 to start, 1 to continue" )
2319   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2403   PORT_MODIFY("DSW2")
2404   PORT_DIPNAME( 0x01, 0x01, "Credits Needed" ) PORT_DIPLOCATION("SW2:1")
2405   PORT_DIPSETTING(    0x01, "1 Credit To Start" )
2406   PORT_DIPSETTING(    0x00, "2 Credits To Start" )
2407   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
23202408   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
23212409   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2322   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2323   PORT_DIPSETTING(    0x08, "1" )
2324   PORT_DIPSETTING(    0x0c, "2" )
2325   PORT_DIPSETTING(    0x04, "3" )
2326   PORT_DIPSETTING(    0x00, "5" )
2327   PORT_DIPNAME( 0x30, 0x30, "Energy Meter" ) PORT_DIPLOCATION("SWB:5,6")
2328   PORT_DIPSETTING(    0x20, "2" )
2329   PORT_DIPSETTING(    0x30, "3" )
2330   PORT_DIPSETTING(    0x10, "4" )
2331   PORT_DIPSETTING(    0x00, "5" )
2410   PORT_DIPNAME( 0x3c, 0x3c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4,5,6") /* Definition according to manual */
2411   PORT_DIPSETTING(    0x00, "Special" )
2412   PORT_DIPSETTING(    0x14, DEF_STR( Easiest ) )
2413   PORT_DIPSETTING(    0x1c, DEF_STR( Easier ) )
2414   PORT_DIPSETTING(    0x34, DEF_STR( Easy ) )
2415   PORT_DIPSETTING(    0x3c, DEF_STR( Normal ) )
2416   PORT_DIPSETTING(    0x38, DEF_STR( Hard ) )
2417   PORT_DIPSETTING(    0x2c, DEF_STR( Harder ) )
2418   PORT_DIPSETTING(    0x28, DEF_STR( Hardest ) )
2419/*
2420    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
2421    PORT_DIPSETTING(    0x08, "1" )
2422    PORT_DIPSETTING(    0x0c, "2" )
2423    PORT_DIPSETTING(    0x04, "3" )
2424    PORT_DIPSETTING(    0x00, "5" )
2425    PORT_DIPNAME( 0x30, 0x30, "Energy Meter" ) PORT_DIPLOCATION("SW2:5,6")
2426    PORT_DIPSETTING(    0x20, "2" )
2427    PORT_DIPSETTING(    0x30, "3" )
2428    PORT_DIPSETTING(    0x10, "4" )
2429    PORT_DIPSETTING(    0x00, "5" )
2430*/
23322431INPUT_PORTS_END
23332432
23342433
r1649r1650
23412440   PORT_MODIFY("P2")
23422441   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
23432442
2344   PORT_MODIFY("DSW")
2345   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2443   PORT_MODIFY("DSW2")
2444   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
23462445   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
23472446   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2348   PORT_DIPNAME( 0x04, 0x00, "Start Level Select" ) PORT_DIPLOCATION("SWB:3")
2447   PORT_DIPNAME( 0x04, 0x00, "Start Level Select" ) PORT_DIPLOCATION("SW2:3")
23492448   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
23502449   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2351   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWB:4")
2450   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:4")
23522451   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
23532452   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2354   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
2453   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
23552454   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
23562455   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
23572456   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
23582457   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2359   PORT_DIPNAME( 0xc0, 0xc0, "Time Adjust"  ) PORT_DIPLOCATION("SWB:7,8")
2458   PORT_DIPNAME( 0xc0, 0xc0, "Time Adjust"  ) PORT_DIPLOCATION("SW2:7,8")
23602459   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
23612460   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
23622461   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
23762475static INPUT_PORTS_START( mvp )
23772476   PORT_INCLUDE( system16b_generic )
23782477
2379   PORT_MODIFY("DSW")
2380   PORT_DIPNAME( 0x01, 0x01, "Credits needed" ) PORT_DIPLOCATION("SWB:1")
2381   PORT_DIPSETTING(    0x01, "1 to start, 1 to continue" )
2382   PORT_DIPSETTING(    0x00, "2 to start, 1 to continue" )
2383   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2478   PORT_MODIFY("DSW2")
2479   PORT_DIPNAME( 0x01, 0x01, "Credits To Start" ) PORT_DIPLOCATION("SW2:1")
2480   PORT_DIPSETTING(    0x01, "1 Credit" )
2481   PORT_DIPSETTING(    0x00, "2 Credits" )
2482   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
23842483   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
23852484   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2386   PORT_DIPNAME( 0x04, 0x04, "Innings" ) PORT_DIPLOCATION("SWB:3")
2387   PORT_DIPSETTING(    0x04, "1 Credit 1 Inning Only" )
2388   PORT_DIPSETTING(    0x00, "+2 Credits 3 Innings" )
2389   PORT_DIPNAME( 0x38, 0x38, "Time Limits" ) PORT_DIPLOCATION("SWB:4,5,6")
2390   PORT_DIPSETTING(    0x18, DEF_STR( Easy ) )
2391   PORT_DIPSETTING(    0x28, "Easy 2" )
2392   PORT_DIPSETTING(    0x08, "Easy 3" )
2393   PORT_DIPSETTING(    0x38, DEF_STR( Normal ) )
2394   PORT_DIPSETTING(    0x30, DEF_STR( Hard ) )
2395   PORT_DIPSETTING(    0x10, "Hard 2" )
2396   PORT_DIPSETTING(    0x20, "Hard 3" )
2397   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2398   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
2485   PORT_DIPNAME( 0x04, 0x04, "Innings" ) PORT_DIPLOCATION("SW2:3")
2486   PORT_DIPSETTING(    0x04, "1 Credit 1 Inning" )
2487   PORT_DIPSETTING(    0x00, "2 Credits 3 Innings" )
2488   PORT_DIPNAME( 0x38, 0x38, "Time Limits" ) PORT_DIPLOCATION("SW2:4,5,6")
2489   PORT_DIPSETTING(    0x38, "1 Normal" )
2490   PORT_DIPSETTING(    0x18, "2" )
2491   PORT_DIPSETTING(    0x28, "3" )
2492   PORT_DIPSETTING(    0x08, "4" )
2493   PORT_DIPSETTING(    0x30, "5" )
2494   PORT_DIPSETTING(    0x10, "6" )
2495   PORT_DIPSETTING(    0x20, "7" )
2496   PORT_DIPSETTING(    0x00, "8 Hardest" )
2497   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
23992498   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
2400   PORT_DIPSETTING(    0x40, "Easy 2" )
2499   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
24012500   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
2402   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2501   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
24032502INPUT_PORTS_END
24042503
24052504
r1649r1650
24122511   PORT_MODIFY("P2")
24132512   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
24142513
2415   PORT_MODIFY("DSW")
2416   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
2514   PORT_MODIFY("DSW2")
2515   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
24172516   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
24182517   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2419   PORT_DIPNAME( 0x0e, 0x00, "Initial Point" ) PORT_DIPLOCATION("SWB:2,3,4")
2518   PORT_DIPNAME( 0x0e, 0x0e, "Initial Point" ) PORT_DIPLOCATION("SW2:2,3,4")
24202519   PORT_DIPSETTING(    0x06, "2000" )
24212520   PORT_DIPSETTING(    0x0a, "3000" )
24222521   PORT_DIPSETTING(    0x0c, "4000" )
r1649r1650
24252524   PORT_DIPSETTING(    0x04, "7000" )
24262525   PORT_DIPSETTING(    0x02, "8000" )
24272526   PORT_DIPSETTING(    0x00, "9000" )
2428   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SWB:5,6")
2527   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SW2:5,6")
24292528   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
24302529   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
24312530   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
24322531   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2433   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
2532   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
24342533   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
24352534   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
24362535   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
24852584   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
24862585   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
24872586
2488   PORT_MODIFY("DSW")
2489   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
2587   PORT_MODIFY("DSW2")
2588   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
24902589   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
24912590   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2492   PORT_DIPNAME( 0x0e, 0x00, "Initial Point" ) PORT_DIPLOCATION("SWB:2,3,4")
2591   PORT_DIPNAME( 0x0e, 0x00, "Initial Point" ) PORT_DIPLOCATION("SW2:2,3,4")
24932592   PORT_DIPSETTING(    0x06, "2000" )
24942593   PORT_DIPSETTING(    0x0a, "3000" )
24952594   PORT_DIPSETTING(    0x0c, "4000" )
r1649r1650
24982597   PORT_DIPSETTING(    0x04, "7000" )
24992598   PORT_DIPSETTING(    0x02, "8000" )
25002599   PORT_DIPSETTING(    0x00, "9000" )
2501   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SWB:5,6")
2600   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SW2:5,6")
25022601   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
25032602   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
25042603   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
25052604   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2506   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
2605   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
25072606   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
25082607   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
25092608   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
25152614static INPUT_PORTS_START( riotcity )
25162615   PORT_INCLUDE( system16b_2button )
25172616
2518   PORT_MODIFY("DSW")
2519   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" ) PORT_DIPLOCATION("SWB:1")
2617   PORT_MODIFY("DSW2")
2618   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" ) PORT_DIPLOCATION("SW2:1")
25202619   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
25212620   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2522   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2621   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
25232622   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
25242623   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2525   PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2624   PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
25262625   PORT_DIPSETTING(    0x00, "1" )
25272626   PORT_DIPSETTING(    0x0c, "2" )
25282627   PORT_DIPSETTING(    0x08, "3" )
25292628   PORT_DIPSETTING(    0x04, "4" )
2530   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5,6")
2629   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6")
25312630   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
25322631   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
25332632   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
25342633   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2535   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7")
2634   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7")
25362635   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
25372636   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2538   PORT_DIPNAME( 0x80, 0x80, "Attack Button to Start" ) PORT_DIPLOCATION("SWB:8")
2637   PORT_DIPNAME( 0x80, 0x80, "Attack Button to Start" ) PORT_DIPLOCATION("SW2:8")
25392638   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
25402639   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
25412640INPUT_PORTS_END
r1649r1650
25502649   PORT_MODIFY("P2")
25512650   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
25522651
2553   PORT_MODIFY("DSW")
2554   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
2652   PORT_MODIFY("DSW2")
2653   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
25552654   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
25562655   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2557   PORT_DIPNAME( 0x02, 0x02, "Cancel per Credit" ) PORT_DIPLOCATION("SWB:2")
2656   PORT_DIPNAME( 0x02, 0x02, "Cancel per Credit" ) PORT_DIPLOCATION("SW2:2")
25582657   PORT_DIPSETTING(    0x00, "2" )
25592658   PORT_DIPSETTING(    0x02, "3" )
2560   PORT_DIPNAME( 0x04, 0x00, "Timer Speed" ) PORT_DIPLOCATION("SWB:3")
2659   PORT_DIPNAME( 0x04, 0x00, "Timer Speed" ) PORT_DIPLOCATION("SW2:3")
25612660   PORT_DIPSETTING(    0x04, "20 seconds" )
25622661   PORT_DIPSETTING(    0x00, "30 seconds" )
2563   PORT_DIPNAME( 0x08, 0x08, "PCM Voice" ) PORT_DIPLOCATION("SWB:4")
2662   PORT_DIPNAME( 0x08, 0x08, "PCM Voice" ) PORT_DIPLOCATION("SW2:4")
25642663   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
25652664   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2566   PORT_DIPNAME( 0x30, 0x30, "Omikuji Difficulty" ) PORT_DIPLOCATION("SWB:5,6")
2665   PORT_DIPNAME( 0x30, 0x30, "Omikuji Difficulty" ) PORT_DIPLOCATION("SW2:5,6")
25672666   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
25682667   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
25692668   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
25702669   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2571   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
2670   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
25722671   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
25732672   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
25742673   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
25992698   PORT_MODIFY("P2")
26002699   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
26012700
2602   PORT_MODIFY("DSW")
2603   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWB:1")
2701   PORT_MODIFY("DSW2")
2702   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:1")
26042703   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
26052704   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2606   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2705   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
26072706   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
26082707   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2609   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2708   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
26102709   PORT_DIPSETTING(    0x08, "2" )
26112710   PORT_DIPSETTING(    0x0c, "3" )
26122711   PORT_DIPSETTING(    0x04, "4" )
26132712   PORT_DIPSETTING(    0x00, "Free")
2614   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
2713   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
26152714   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
26162715   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
26172716   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
26182717   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2619   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:7,8")
2718   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7,8")
26202719   PORT_DIPSETTING(    0x80, "Every 50000" )
26212720   PORT_DIPSETTING(    0xc0, "50000" )
26222721   PORT_DIPSETTING(    0x40, "100000" )
r1649r1650
26392738static INPUT_PORTS_START( shinobi )
26402739   PORT_INCLUDE( system16b_generic )
26412740
2642   PORT_MODIFY("DSW")
2643   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
2741   PORT_MODIFY("DSW2")
2742   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
26442743   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
26452744   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
2646   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2745   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
26472746   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
26482747   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2649   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2748   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
26502749   PORT_DIPSETTING(    0x08, "2" )
26512750   PORT_DIPSETTING(    0x0c, "3" )
26522751   PORT_DIPSETTING(    0x04, "5" )
2653   PORT_DIPSETTING(    0x00, "240")
2654   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
2752   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
2753   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
26552754   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
26562755   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
26572756   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
26582757   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2659   PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" ) PORT_DIPLOCATION("SWB:7")
2758   PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" ) PORT_DIPLOCATION("SW2:7")
26602759   PORT_DIPSETTING(    0x40, "Slow" )
26612760   PORT_DIPSETTING(    0x00, "Fast" )
2662   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SWB:8")
2761   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:8")
26632762   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
26642763   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
26652764INPUT_PORTS_END
r1649r1650
27202819static INPUT_PORTS_START( sonicbom )
27212820   PORT_INCLUDE( system16b_2button )
27222821
2723   PORT_MODIFY("DSW")
2724   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:1,2,3")
2822   PORT_MODIFY("DSW2")
2823   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2,3")
27252824   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
27262825   PORT_DIPSETTING(    0x07, DEF_STR( Normal ) )
27272826   PORT_DIPSETTING(    0x05, "Hard 1" )
r1649r1650
27302829   PORT_DIPSETTING(    0x02, "Hard 4" )
27312830   PORT_DIPSETTING(    0x01, "Hard 5" )
27322831   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2733   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:4,5")
2832   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4,5")
27342833   PORT_DIPSETTING(    0x10, "2" )
27352834   PORT_DIPSETTING(    0x18, "3" )
27362835   PORT_DIPSETTING(    0x08, "4" )
27372836   PORT_DIPSETTING(    0x00, "5" )
2738   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:6,7")
2739   PORT_DIPSETTING(    0x40, "30000" )
2740   PORT_DIPSETTING(    0x60, "40000" )
2741   PORT_DIPSETTING(    0x20, "50000" )
2742   PORT_DIPSETTING(    0x00, "60000" )
2743   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:8")
2837   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:6,7")
2838   PORT_DIPSETTING(    0x40, "30k" )
2839   PORT_DIPSETTING(    0x60, "40k" )
2840   PORT_DIPSETTING(    0x20, "50k" )
2841   PORT_DIPSETTING(    0x00, "80k" )
2842   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8")
27442843   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
27452844   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
27462845INPUT_PORTS_END
r1649r1650
27552854   PORT_MODIFY("P2")
27562855   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
27572856
2758   PORT_MODIFY("DSW")
2759   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2857   PORT_MODIFY("DSW2")
2858   /* SW2:1,3,4,7,8 Unused according to manual.
2859    From the code SW2:3,4 looks like some kind of difficulty level,
2860    but all 4 levels points to the same place so it doesn't actually change anything!! */
2861   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
27602862   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
27612863   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2762   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SWB:3,4")   // from the code it looks like some kind of difficulty
2763   PORT_DIPSETTING(    0x0c, "A" )                     // level, but all 4 levels points to the same place
2764   PORT_DIPSETTING(    0x08, "B" )                     // so it doesn't actually change anything!!
2765   PORT_DIPSETTING(    0x04, "C" )
2766   PORT_DIPSETTING(    0x00, "D" )
2767   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
2864   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
27682865   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
27692866   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
27702867   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
r1649r1650
27962893   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWE:5")
27972894   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
27982895   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
2799   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWE:6")
2800   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2801   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2802   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWE:7")
2803   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2804   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2805   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWE:8")
2806   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2807   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2896   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SWE:6" ) /* Listed as "Unused" */
2897   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SWE:7" ) /* Listed as "Unused" */
2898   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SWE:8" ) /* Listed as "Unused" */
28082899
2809   PORT_MODIFY("DSW")
2810   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
2900   PORT_MODIFY("DSW2")
2901   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
28112902   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
28122903   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2813   PORT_DIPNAME( 0x1e, 0x14, "Bonus" ) PORT_DIPLOCATION("SWB:2,3,4,5")
2814   PORT_DIPSETTING(    0x16, "Replay 1000000/2000000" )
2815   PORT_DIPSETTING(    0x14, "Replay 1200000/2500000" )
2816   PORT_DIPSETTING(    0x12, "Replay 1500000/3000000" )
2817   PORT_DIPSETTING(    0x10, "Replay 2000000/4000000" )
2818   PORT_DIPSETTING(    0x1c, "Replay 1000000" )
2819   PORT_DIPSETTING(    0x1e, "Replay 1200000" )
2820   PORT_DIPSETTING(    0x1a, "Replay 1500000" )
2821   PORT_DIPSETTING(    0x18, "Replay 1800000" )
2822   PORT_DIPSETTING(    0x0e, "ExtraBall 100000" )
2823   PORT_DIPSETTING(    0x0c, "ExtraBall 200000" )
2824   PORT_DIPSETTING(    0x0a, "ExtraBall 300000" )
2825   PORT_DIPSETTING(    0x08, "ExtraBall 400000" )
2826   PORT_DIPSETTING(    0x06, "ExtraBall 500000" )
2827   PORT_DIPSETTING(    0x04, "ExtraBall 600000" )
2828   PORT_DIPSETTING(    0x02, "ExtraBall 700000" )
2904   PORT_DIPNAME( 0x1e, 0x1e, "Extended Score" ) PORT_DIPLOCATION("SW2:2,3,4,5")
2905   PORT_DIPSETTING(    0x16, "Credit 1000000/2000000" )
2906   PORT_DIPSETTING(    0x14, "Credit 1200000/2500000" )
2907   PORT_DIPSETTING(    0x12, "Credit 1500000/3000000" )
2908   PORT_DIPSETTING(    0x10, "Credit 2000000/4000000" )
2909   PORT_DIPSETTING(    0x1c, "Credit 1000000" )
2910   PORT_DIPSETTING(    0x1e, "Credit 1200000" )
2911   PORT_DIPSETTING(    0x1a, "Credit 1500000" )
2912   PORT_DIPSETTING(    0x18, "Credit 1800000" )
2913   PORT_DIPSETTING(    0x0e, "Ball 100000" )
2914   PORT_DIPSETTING(    0x0c, "Ball 200000" )
2915   PORT_DIPSETTING(    0x0a, "Ball 300000" )
2916   PORT_DIPSETTING(    0x08, "Ball 400000" )
2917   PORT_DIPSETTING(    0x06, "Ball 500000" )
2918   PORT_DIPSETTING(    0x04, "Ball 600000" )
2919   PORT_DIPSETTING(    0x02, "Ball 700000" )
28292920   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2830   PORT_DIPNAME( 0x20, 0x20, "Match" ) PORT_DIPLOCATION("SWB:6")
2831   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2832   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
2833   PORT_DIPNAME( 0x40, 0x40, "Pin Rebound" ) PORT_DIPLOCATION("SWB:7")
2921   PORT_DIPNAME( 0x20, 0x20, "Number Match" ) PORT_DIPLOCATION("SW2:6")
2922   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2923   PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
2924   PORT_DIPNAME( 0x40, 0x40, "Pin Rebound" ) PORT_DIPLOCATION("SW2:7")
28342925   PORT_DIPSETTING(    0x40, "Well" )
28352926   PORT_DIPSETTING(    0x00, "A Little" )
28362927   /*
r1649r1650
28382929        rebound strength and the resulting difficulty or ease in which the
28392930        ball goes out of play.
28402931    */
2841   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) )
2932   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:8")
28422933   PORT_DIPSETTING(    0x80, "3" )
28432934   PORT_DIPSETTING(    0x00, "5" )
28442935INPUT_PORTS_END
r1649r1650
28472938static INPUT_PORTS_START( toryumon )
28482939   PORT_INCLUDE( system16b_1button )
28492940
2850   PORT_MODIFY("DSW")
2851   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
2941   PORT_MODIFY("DSW2")
2942   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
28522943   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
28532944   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2854   PORT_DIPNAME( 0x10, 0x10, "VS-Mode Battle" ) PORT_DIPLOCATION("SWB:5")
2855   PORT_DIPSETTING(    0x10, "1" )
2856   PORT_DIPSETTING(    0x00, "3" )
2857   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:6,7,8")
2945   PORT_DIPNAME( 0x10, 0x10, "VS Play Mode" ) PORT_DIPLOCATION("SW2:5")
2946   PORT_DIPSETTING(    0x10, "1 Set" )
2947   PORT_DIPSETTING(    0x00, "3 Set" )
2948   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7,8")
28582949   PORT_DIPSETTING(    0xc0, DEF_STR( Easy ) )
28592950   PORT_DIPSETTING(    0xe0, DEF_STR( Normal ) )
28602951   PORT_DIPSETTING(    0xa0, DEF_STR( Hard ) )
r1649r1650
28692960static INPUT_PORTS_START( tturf )
28702961   PORT_INCLUDE( system16b_generic )
28712962
2872   PORT_MODIFY("DSW")
2873   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Continues ) ) PORT_DIPLOCATION("SWB:1,2")
2963   PORT_MODIFY("DSW2")
2964   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Continues ) ) PORT_DIPLOCATION("SW2:1,2")
28742965   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
28752966   PORT_DIPSETTING(    0x01, "3" )
28762967   PORT_DIPSETTING(    0x02, "Unlimited" )
28772968   PORT_DIPSETTING(    0x03, "Unlimited" )
2878   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:3,4")
2969   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
28792970   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
28802971   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
28812972   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
28822973   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2883   PORT_DIPNAME( 0x30, 0x20, "Starting Energy" ) PORT_DIPLOCATION("SWB:5,6")
2974   PORT_DIPNAME( 0x30, 0x20, "Starting Energy" ) PORT_DIPLOCATION("SW2:5,6")
28842975   PORT_DIPSETTING(    0x00, "3" )
28852976   PORT_DIPSETTING(    0x10, "4" )
28862977   PORT_DIPSETTING(    0x20, "6" )
28872978   PORT_DIPSETTING(    0x30, "8" )
2888   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:7")
2979   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
28892980   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
28902981   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2891   PORT_DIPNAME( 0x80, 0x00, "Bonus Energy" ) PORT_DIPLOCATION("SWB:8")
2982   PORT_DIPNAME( 0x80, 0x00, "Bonus Energy" ) PORT_DIPLOCATION("SW2:8")
28922983   PORT_DIPSETTING(    0x80, "1" )
28932984   PORT_DIPSETTING(    0x00, "2" )
28942985INPUT_PORTS_END
r1649r1650
28972988static INPUT_PORTS_START( wb3 )
28982989   PORT_INCLUDE( system16b_2button )
28992990
2900   PORT_MODIFY("DSW")
2901   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
2991   PORT_MODIFY("DSW2")
2992   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
29022993   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
29032994   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2904   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
2995   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
29052996   PORT_DIPSETTING(    0x00, "2" )
29062997   PORT_DIPSETTING(    0x0c, "3" )
29072998   PORT_DIPSETTING(    0x08, "4" )
29082999   PORT_DIPSETTING(    0x04, "5" )
2909   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5")      //??
2910   PORT_DIPSETTING(    0x10, "5000/10000/18000/30000" )
2911   PORT_DIPSETTING(    0x00, "5000/15000/30000" )
2912   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:6")
3000   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5")
3001   PORT_DIPSETTING(    0x10, "50k/100k/180k/300k" )
3002   PORT_DIPSETTING(    0x00, "50k/150k/300k" )
3003   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6")
29133004   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
29143005   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2915   PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) PORT_DIPLOCATION("SWB:7")
3006   PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) PORT_DIPLOCATION("SW2:7")
29163007   PORT_DIPSETTING(    0x40, DEF_STR( No ) )   /* Normal game */
29173008   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )   /* Levels are selectable / Player is Invincible */
29183009   /* Switches 1 & 8 are listed as "Always off" */
r1649r1650
29223013static INPUT_PORTS_START( wrestwar )
29233014   PORT_INCLUDE( system16b_2button )
29243015
2925   PORT_MODIFY("DSW")
2926   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
3016   PORT_MODIFY("DSW2")
3017   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
29273018   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
29283019   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2929   PORT_DIPNAME( 0x0c, 0x0c, "Round Time" ) PORT_DIPLOCATION("SWB:3,4")
3020   PORT_DIPNAME( 0x0c, 0x0c, "Round Time" ) PORT_DIPLOCATION("SW2:3,4")
29303021   PORT_DIPSETTING(    0x00, "100" )
29313022   PORT_DIPSETTING(    0x0c, "110" )
29323023   PORT_DIPSETTING(    0x08, "120" )
29333024   PORT_DIPSETTING(    0x04, "130" )
2934   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWB:6")
3025   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:6")
29353026   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
29363027   PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
2937   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
3028   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
29383029   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
29393030   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
29403031   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r1649r1650
29633054   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
29643055   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
29653056
2966   PORT_START_TAG("DSW0")
2967   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW0:1,2,3")
3057   PORT_START_TAG("DSW1")
3058   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,2,3")
29683059   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
29693060   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
29703061   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
r1649r1650
29733064   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
29743065   PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) )
29753066   PORT_DIPSETTING(    0x06, DEF_STR( 1C_5C ) )
2976   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW0:4,5,6")
3067   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:4,5,6")
29773068   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
29783069   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
29793070   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
r1649r1650
29823073   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
29833074   PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C ) )
29843075   PORT_DIPSETTING(    0x30, DEF_STR( 1C_5C ) )
2985   PORT_DIPNAME( 0xC0, 0xC0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW0:7,8")
3076   PORT_DIPNAME( 0xC0, 0xC0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7,8")
29863077   PORT_DIPSETTING(    0xC0, "1" )
29873078   PORT_DIPSETTING(    0x80, "2" )
29883079   PORT_DIPSETTING(    0x40, "3" )
29893080   PORT_DIPSETTING(    0x00, "5" )
29903081
2991   PORT_START_TAG("DSW1")
2992   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:1,2")
3082   PORT_START_TAG("DSW2")
3083   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
29933084   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
29943085   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
29953086   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
29963087   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2997   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW1:3")   /* doesn't seem to work? */
3088   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW2:3")   /* doesn't seem to work? */
29983089   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
29993090   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3000   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:4")   /* doesn't seem to work? */
3091   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:4")   /* doesn't seem to work? */
30013092   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
30023093   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3003   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5")
3094   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:5")
30043095   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
30053096   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3006   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6")
3097   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:6")
30073098   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
30083099   PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
3009   PORT_DIPNAME( 0x40, 0x00, "Game Mode" ) PORT_DIPLOCATION("SW1:7")
3100   PORT_DIPNAME( 0x40, 0x00, "Game Mode" ) PORT_DIPLOCATION("SW2:7")
30103101   PORT_DIPSETTING(    0x40, "Normal Tetris" )
30113102   PORT_DIPSETTING(    0x00, "Atomic Point" )
3012   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW1:8" )
3103   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW2:8" )
30133104
30143105   PORT_START_TAG("DUMMY1")
30153106
r1649r1650
30713162   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4")
30723163   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
30733164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3074   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5")
3075   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3076   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3165   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5")
3166   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
3167   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
30773168   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
30783169   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
30793170   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1649r1650
61816272 *
61826273 *************************************/
61836274
6184GAME( 1988, aceattac, 0,        system16b,      generic, generic_5358,  ROT0,   "Sega",           "Ace Attacker (FD1094 317-0059)", GAME_NOT_WORKING )
6275GAME( 1988, aceattac, 0,        system16b,      aceattac, generic_5358,  ROT0,   "Sega",           "Ace Attacker (FD1094 317-0059)", GAME_NOT_WORKING )
61856276GAME( 1987, aliensyn, 0,        system16b,      aliensyn, generic_5358,  ROT0,   "Sega",           "Alien Syndrome (set 4, System 16B, unprotected)", 0 )
61866277GAME( 1987, aliensy3, aliensyn, system16b,      aliensyn, aliensy3_5358, ROT0,   "Sega",           "Alien Syndrome (set 3, System 16B, FD1089A 317-0033)", 0 )
61876278GAME( 1988, altbeast, 0,        system16b_8751, altbeast, altbeast_5521, ROT0,   "Sega",           "Altered Beast (set 7, 8751 317-0078)", 0 )
src/mame/drivers/wwfwfest.c
r1649r1650
3838*******************************************************************************/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "cpu/m68000/m68000.h"
4243#include "cpu/z80/z80.h"
4344#include "wwfwfest.h"
src/mame/drivers/pktgaldx.c
r1649r1650
5454*/
5555
5656#include "driver.h"
57#include "deprecat.h"
5758#include "decocrpt.h"
5859#include "decoprot.h"
5960#include "deco16ic.h"
src/mame/drivers/timeplt.c
r1649r1650
11/***************************************************************************
22
3Time Pilot memory map (preliminary)
3    Time Pilot
44
5driver by Nicola Salmoria
5    driver by Nicola Salmoria
66
7Main processor memory map.
80000-5fff ROM
9a000-a3ff Color RAM
10a400-a7ff Video RAM
11a800-afff RAM
12b000-b7ff sprite RAM (only areas 0xb010 and 0xb410 are used).
7****************************************************************************
138
14memory mapped ports:
9    memory map (preliminary)
1510
16read:
17c000      video scan line. This is used by the program to multiplex the cloud
18          sprites, drawing them twice offset by 128 pixels.
19c200      DSW2
20c300      IN0
21c320      IN1
22c340      IN2
23c360      DSW1
11    Main processor memory map.
12    0000-5fff ROM
13    a000-a3ff Color RAM
14    a400-a7ff Video RAM
15    a800-afff RAM
16    b000-b7ff sprite RAM (only areas 0xb010 and 0xb410 are used).
2417
25write:
26c000      command for the audio CPU
27c200      watchdog reset
28c300      interrupt enable
29c302      flip screen
30c304      trigger interrupt on audio CPU
31c308      Protection ???  Stuffs in some values computed from ROM content
32c30a      coin counter 1
33c30c      coin counter 2
18    memory mapped ports:
3419
35interrupts:
36standard NMI at 0x66
20    read:
21    c000      video scan line. This is used by the program to multiplex the cloud
22              sprites, drawing them twice offset by 128 pixels.
23    c200      DSW2
24    c300      IN0
25    c320      IN1
26    c340      IN2
27    c360      DSW1
3728
38SOUND BOARD:
39same as Pooyan
29    write:
30    c000      command for the audio CPU
31    c200      watchdog reset
32    c300      interrupt enable
33    c302      flip screen
34    c304      trigger interrupt on audio CPU
35    c308      Protection ???  Stuffs in some values computed from ROM content
36    c30a      coin counter 1
37    c30c      coin counter 2
4038
39    interrupts:
40    standard NMI at 0x66
41
42    SOUND BOARD:
43    same as Pooyan
44
4145***************************************************************************/
4246
4347#include "driver.h"
48#include "deprecat.h"
49#include "timeplt.h"
4450#include "audio/timeplt.h"
4551
4652
47extern UINT8 *timeplt_videoram,*timeplt_colorram;
53#define MASTER_CLOCK      XTAL_18_432MHz
4854
49READ8_HANDLER( timeplt_scanline_r );
50WRITE8_HANDLER( timeplt_videoram_w );
51WRITE8_HANDLER( timeplt_colorram_w );
52WRITE8_HANDLER( timeplt_flipscreen_w );
53VIDEO_START( timeplt );
54PALETTE_INIT( timeplt );
55VIDEO_UPDATE( timeplt );
56INTERRUPT_GEN( timeplt_interrupt );
5755
5856
57static UINT8 irq_enable;
5958
60static WRITE8_HANDLER( timeplt_coin_counter_w )
59
60/*************************************
61 *
62 *  Interrupts
63 *
64 *************************************/
65
66static MACHINE_START( timeplt )
6167{
62   coin_counter_w(offset >> 1, data);
68   state_save_register_global(irq_enable);
6369}
6470
65static READ8_HANDLER( psurge_protection_r )
71
72static INTERRUPT_GEN( timeplt_interrupt )
6673{
67   return 0x80;
74   if (irq_enable)
75      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
6876}
6977
7078
79static WRITE8_HANDLER( irq_enable_w )
80{
81   irq_enable = data & 1;
82   if (!irq_enable)
83      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
84}
7185
72static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
73   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
74   AM_RANGE(0x6004, 0x6004) AM_READ(psurge_protection_r)   /* psurge only */
75   AM_RANGE(0xa000, 0xbfff) AM_READ(MRA8_RAM)
76   AM_RANGE(0xc000, 0xc000) AM_READ(timeplt_scanline_r)
77   AM_RANGE(0xc200, 0xc200) AM_READ(input_port_4_r)   /* DSW2 */
78   AM_RANGE(0xc300, 0xc300) AM_READ(input_port_0_r)   /* IN0 */
79   AM_RANGE(0xc320, 0xc320) AM_READ(input_port_1_r)   /* IN1 */
80   AM_RANGE(0xc340, 0xc340) AM_READ(input_port_2_r)   /* IN2 */
81   AM_RANGE(0xc360, 0xc360) AM_READ(input_port_3_r)   /* DSW1 */
82ADDRESS_MAP_END
8386
84static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
85   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
86   AM_RANGE(0xa000, 0xa3ff) AM_WRITE(timeplt_colorram_w) AM_BASE(&timeplt_colorram)
87   AM_RANGE(0xa400, 0xa7ff) AM_WRITE(timeplt_videoram_w) AM_BASE(&timeplt_videoram)
88   AM_RANGE(0xa800, 0xafff) AM_WRITE(MWA8_RAM)
8987
90   AM_RANGE(0xb000, 0xb00f) AM_WRITE(MWA8_RAM)
91   AM_RANGE(0xb010, 0xb03f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
92   AM_RANGE(0xb040, 0xb40f) AM_WRITE(MWA8_RAM)
93   AM_RANGE(0xb410, 0xb43f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2)
94   AM_RANGE(0xb440, 0xbfff) AM_WRITE(MWA8_RAM)
88/*************************************
89 *
90 *  Outputs
91 *
92 *************************************/
9593
96   AM_RANGE(0xc000, 0xc000) AM_WRITE(soundlatch_w)
97   AM_RANGE(0xc200, 0xc200) AM_WRITE(watchdog_reset_w)
98   AM_RANGE(0xc300, 0xc300) AM_WRITE(interrupt_enable_w)
99   AM_RANGE(0xc302, 0xc302) AM_WRITE(timeplt_flipscreen_w)
100   AM_RANGE(0xc304, 0xc304) AM_WRITE(timeplt_sh_irqtrigger_w)
101   AM_RANGE(0xc30a, 0xc30c) AM_WRITE(timeplt_coin_counter_w)  /* c30b is not used */
94static WRITE8_HANDLER( timeplt_coin_counter_w )
95{
96   coin_counter_w(offset >> 1, data);
97}
98
99
100
101/*************************************
102 *
103 *  Memory maps
104 *
105 *************************************/
106
107static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
108   ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) )
109   AM_RANGE(0x0000, 0x5fff) AM_ROM
110   AM_RANGE(0xa000, 0xa3ff) AM_READWRITE(MRA8_RAM, timeplt_colorram_w) AM_BASE(&colorram)
111   AM_RANGE(0xa400, 0xa7ff) AM_READWRITE(MRA8_RAM, timeplt_videoram_w) AM_BASE(&videoram)
112   AM_RANGE(0xa800, 0xafff) AM_RAM
113   AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram)
114   AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram_2)
115   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_w)
116   AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w)
117   AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0cf1) AM_WRITE(irq_enable_w)
118   AM_RANGE(0xc302, 0xc302) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_flipscreen_w)
119   AM_RANGE(0xc304, 0xc304) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_sh_irqtrigger_w)
120   AM_RANGE(0xc30a, 0xc30c) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_coin_counter_w)
121   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_READ(timeplt_scanline_r)
122   AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_READ_PORT("DSW1")
123   AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0c9f) AM_READ_PORT("IN0")
124   AM_RANGE(0xc320, 0xc320) AM_MIRROR(0x0c9f) AM_READ_PORT("IN1")
125   AM_RANGE(0xc340, 0xc340) AM_MIRROR(0x0c9f) AM_READ_PORT("IN2")
126   AM_RANGE(0xc360, 0xc360) AM_MIRROR(0x0c9f) AM_READ_PORT("DSW0")
102127ADDRESS_MAP_END
103128
104#define TIMEPILOT_INPUTS \
105   PORT_START_TAG("IN0")\
106   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )\
107   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )\
108   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )\
109   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )\
110   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )\
111   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )\
112   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )\
113   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )\
114   PORT_START_TAG("IN1")\
115   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY\
116   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY\
117   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY\
118   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY\
119   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )\
120   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )\
121   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )\
122   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )\
123   PORT_START_TAG("IN2")\
124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL\
125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL\
126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL\
127   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL\
128   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL\
129   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )\
130   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )\
131   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
132129
130
131/*************************************
132 *
133 *  Port definitions
134 *
135 *************************************/
136
133137static INPUT_PORTS_START( timeplt )
134TIMEPILOT_INPUTS
138   PORT_START_TAG("IN0")
139   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
140   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
141   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
142   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
143   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
144   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
135145
146   PORT_START_TAG("IN1")
147   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
148   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
149   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
150   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
151   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
152   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
153
154   PORT_START_TAG("IN2")
155   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
156   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
157   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
158   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
159   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
160   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
161
136162   PORT_START_TAG("DSW0")
137163   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
138164   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
r1649r1650
196222INPUT_PORTS_END
197223
198224static INPUT_PORTS_START( psurge )
199TIMEPILOT_INPUTS
225   PORT_INCLUDE(timeplt)
200226
201   PORT_START_TAG("DSW0")
227   PORT_MODIFY("DSW0")
202228   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
203229   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
204230   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1649r1650
223249   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
224250   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
225251
226   PORT_START_TAG("DSW1")
252   PORT_MODIFY("DSW1")
227253   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
228254   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
229255   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
r1649r1650
250276
251277
252278
279/*************************************
280 *
281 *  Graphics layouts
282 *
283 *************************************/
284
253285static const gfx_layout charlayout =
254286{
255   8,8,   /* 8*8 characters */
256   512,   /* 512 characters */
257   2,   /* 2 bits per pixel */
287   8,8,
288   RGN_FRAC(1,1),
289   2,
258290   { 4, 0 },
259   { 0, 1, 2, 3, 8*8+0,8*8+1,8*8+2,8*8+3 },
260   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
261   16*8   /* every char takes 16 consecutive bytes */
291   { STEP4(0,1), STEP4(8*8,1) },
292   { STEP8(0,8) },
293   16*8
262294};
295
263296static const gfx_layout spritelayout =
264297{
265   16,16,   /* 16*16 sprites */
266   256,   /* 256 sprites */
267   2,   /* 2 bits per pixel */
298   16,16,
299   RGN_FRAC(1,1),
300   2,
268301   { 4, 0 },
269   { 0, 1, 2, 3,  8*8, 8*8+1, 8*8+2, 8*8+3,
270         16*8+0, 16*8+1, 16*8+2, 16*8+3,  24*8+0, 24*8+1, 24*8+2, 24*8+3 },
271   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
272         32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
273   64*8   /* every sprite takes 64 consecutive bytes */
302   { STEP4(0,1), STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1) },
303   { STEP8(0,8), STEP8(32*8,8) },
304   64*8
274305};
275306
276307
r1649r1650
281312
282313
283314
315/*************************************
316 *
317 *  Machine drivers
318 *
319 *************************************/
320
284321static MACHINE_DRIVER_START( timeplt )
285322
286323   /* basic machine hardware */
287   MDRV_CPU_ADD(Z80, 3072000)   /* 3.072 MHz (?) */
288   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
289   MDRV_CPU_VBLANK_INT(timeplt_interrupt,256)
324   MDRV_CPU_ADD(Z80, MASTER_CLOCK/3/2)   /* not confirmed, but common for Konami games of the era */
325   MDRV_CPU_PROGRAM_MAP(main_map,0)
326   MDRV_CPU_VBLANK_INT(timeplt_interrupt,1)
290327
291   MDRV_CPU_ADD(Z80,14318180/8)
292   /* audio CPU */   /* 1.789772727 MHz */                  \
293   MDRV_CPU_PROGRAM_MAP(timeplt_sound_readmem,timeplt_sound_writemem)
294
295328   MDRV_SCREEN_REFRESH_RATE(60)
296   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
297329
330   MDRV_MACHINE_START(timeplt)
331
298332   /* video hardware */
299   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
333   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_SCANLINE)
300334   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
301335   MDRV_SCREEN_SIZE(32*8, 32*8)
302336   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
303337   MDRV_GFXDECODE(timeplt)
304   MDRV_PALETTE_LENGTH(32)
305   MDRV_COLORTABLE_LENGTH(32*4+64*4)
338   MDRV_PALETTE_LENGTH(32*4+64*4)
306339
307340   MDRV_PALETTE_INIT(timeplt)
308341   MDRV_VIDEO_START(timeplt)
309342   MDRV_VIDEO_UPDATE(timeplt)
310343
311344   /* sound hardware */
312   MDRV_SPEAKER_STANDARD_MONO("mono")
313
314   MDRV_SOUND_ADD(AY8910, 14318180/8)
315   MDRV_SOUND_CONFIG(timeplt_ay8910_interface)
316   MDRV_SOUND_ROUTE(0, "filter.0.0", 0.60)
317   MDRV_SOUND_ROUTE(1, "filter.0.1", 0.60)
318   MDRV_SOUND_ROUTE(2, "filter.0.2", 0.60)
319
320   MDRV_SOUND_ADD(AY8910, 14318180/8)
321   MDRV_SOUND_ROUTE(0, "filter.1.0", 0.60)
322   MDRV_SOUND_ROUTE(1, "filter.1.1", 0.60)
323   MDRV_SOUND_ROUTE(2, "filter.1.2", 0.60)
324
325   MDRV_SOUND_ADD_TAG("filter.0.0", FILTER_RC, 0)
326   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
327   MDRV_SOUND_ADD_TAG("filter.0.1", FILTER_RC, 0)
328   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
329   MDRV_SOUND_ADD_TAG("filter.0.2", FILTER_RC, 0)
330   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
331
332   MDRV_SOUND_ADD_TAG("filter.1.0", FILTER_RC, 0)
333   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
334   MDRV_SOUND_ADD_TAG("filter.1.1", FILTER_RC, 0)
335   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
336   MDRV_SOUND_ADD_TAG("filter.1.2", FILTER_RC, 0)
337   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
345   MDRV_IMPORT_FROM(timeplt_sound)
338346MACHINE_DRIVER_END
339347
340348
341349
342/***************************************************************************
350/*************************************
351 *
352 *  ROM definitions
353 *
354 *************************************/
343355
344  Game driver(s)
345
346***************************************************************************/
347
348356ROM_START( timeplt )
349357   ROM_REGION( 0x10000, REGION_CPU1, 0 )
350358   ROM_LOAD( "tm1",          0x0000, 0x2000, CRC(1551f1b9) SHA1(c72f30988ac00cbe6549b71c3bcb414511e8b997) )
r1649r1650
368376   ROM_LOAD( "timeplt.e12",  0x0140, 0x0100, CRC(f7b7663e) SHA1(151bd2dff4e4ef76d6438c1ab2cae71f987b9dad) ) /* char lookup table */
369377ROM_END
370378
379ROM_START( timeplta )
380   ROM_REGION( 0x10000, REGION_CPU1, 0 )
381   ROM_LOAD( "cd_e1.bin",         0x0000, 0x2000, CRC(a4513b35) SHA1(1b1944ec5317d71af86e21e0691caae180dee7b5) )
382   ROM_LOAD( "cd_e2.bin",         0x2000, 0x2000, CRC(38b0c72a) SHA1(8f0950deb2f9e2b65714318b9e837a1c837f52a9) )
383   ROM_LOAD( "cd_e3.bin",         0x4000, 0x2000, CRC(83846870) SHA1(b1741e7e5674f9e63e113ead0cb7f5ef874eac5f) )
384
385   ROM_REGION( 0x10000, REGION_CPU2, 0 )
386   ROM_LOAD( "tm7",          0x0000, 0x1000, CRC(d66da813) SHA1(408fca4515e8af84211df3e204c8776b2f8adb23) )
387
388   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
389   ROM_LOAD( "tm6",          0x0000, 0x2000, CRC(c2507f40) SHA1(07221875e3f81d9def67c57a7ccd82d52ce65e01) )
390
391   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
392   ROM_LOAD( "tm4",          0x0000, 0x2000, CRC(7e437c3e) SHA1(cbe2ccd2cd503af62f009cd5aab73aa7366230b1) )
393   ROM_LOAD( "tm5",          0x2000, 0x2000, CRC(e8ca87b9) SHA1(5dd30d3fb9fd8cf9e6a8e37e7ea858c7fd038a7e) )
394
395   ROM_REGION( 0x0240, REGION_PROMS, 0 )
396   ROM_LOAD( "timeplt.b4",   0x0000, 0x0020, CRC(34c91839) SHA1(f62e279e21fce171231d3139be7adabe1f4b8c2e) ) /* palette */
397   ROM_LOAD( "timeplt.b5",   0x0020, 0x0020, CRC(463b2b07) SHA1(9ad275365eba4869f94749f39ff8705d92056a10) ) /* palette */
398   ROM_LOAD( "timeplt.e9",   0x0040, 0x0100, CRC(4bbb2150) SHA1(678433b21aae1daa938e32d3293eeed529a42ef9) ) /* sprite lookup table */
399   ROM_LOAD( "timeplt.e12",  0x0140, 0x0100, CRC(f7b7663e) SHA1(151bd2dff4e4ef76d6438c1ab2cae71f987b9dad) ) /* char lookup table */
400ROM_END
401
371402ROM_START( timepltc )
372403   ROM_REGION( 0x10000, REGION_CPU1, 0 )
373404   ROM_LOAD( "cd1y",         0x0000, 0x2000, CRC(83ec72c2) SHA1(f3dbc8362f6bdad1baa65cf5d95611e79de381a4) )
r1649r1650
414445   ROM_LOAD( "timeplt.e12",  0x0140, 0x0100, CRC(f7b7663e) SHA1(151bd2dff4e4ef76d6438c1ab2cae71f987b9dad) ) /* char lookup table */
415446ROM_END
416447
448
417449ROM_START( psurge )
418450   ROM_REGION( 0x10000, REGION_CPU1, 0 )
419451   ROM_LOAD( "p1",           0x0000, 0x2000, CRC(05f9ba12) SHA1(ad88838d1a0c64830281e425d4ad2498ba959098) )
r1649r1650
438470   ROM_LOAD( "timeplt.e12",  0x0140, 0x0100, BAD_DUMP CRC(f7b7663e) SHA1(151bd2dff4e4ef76d6438c1ab2cae71f987b9dad)  ) /* char lookup table */
439471ROM_END
440472
441ROM_START( timeplta )
442   ROM_REGION( 0x10000, REGION_CPU1, 0 )
443   ROM_LOAD( "cd_e1.bin",         0x0000, 0x2000, CRC(a4513b35) SHA1(1b1944ec5317d71af86e21e0691caae180dee7b5) )
444   ROM_LOAD( "cd_e2.bin",         0x2000, 0x2000, CRC(38b0c72a) SHA1(8f0950deb2f9e2b65714318b9e837a1c837f52a9) )
445   ROM_LOAD( "cd_e3.bin",         0x4000, 0x2000, CRC(83846870) SHA1(b1741e7e5674f9e63e113ead0cb7f5ef874eac5f) )
446473
447   ROM_REGION( 0x10000, REGION_CPU2, 0 )
448   ROM_LOAD( "tm7",          0x0000, 0x1000, CRC(d66da813) SHA1(408fca4515e8af84211df3e204c8776b2f8adb23) )
449474
450   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
451   ROM_LOAD( "tm6",          0x0000, 0x2000, CRC(c2507f40) SHA1(07221875e3f81d9def67c57a7ccd82d52ce65e01) )
475/*************************************
476 *
477 *  Game drivers
478 *
479 *************************************/
452480
453   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
454   ROM_LOAD( "tm4",          0x0000, 0x2000, CRC(7e437c3e) SHA1(cbe2ccd2cd503af62f009cd5aab73aa7366230b1) )
455   ROM_LOAD( "tm5",          0x2000, 0x2000, CRC(e8ca87b9) SHA1(5dd30d3fb9fd8cf9e6a8e37e7ea858c7fd038a7e) )
456
457   ROM_REGION( 0x0240, REGION_PROMS, 0 )
458   ROM_LOAD( "timeplt.b4",   0x0000, 0x0020, CRC(34c91839) SHA1(f62e279e21fce171231d3139be7adabe1f4b8c2e) ) /* palette */
459   ROM_LOAD( "timeplt.b5",   0x0020, 0x0020, CRC(463b2b07) SHA1(9ad275365eba4869f94749f39ff8705d92056a10) ) /* palette */
460   ROM_LOAD( "timeplt.e9",   0x0040, 0x0100, CRC(4bbb2150) SHA1(678433b21aae1daa938e32d3293eeed529a42ef9) ) /* sprite lookup table */
461   ROM_LOAD( "timeplt.e12",  0x0140, 0x0100, CRC(f7b7663e) SHA1(151bd2dff4e4ef76d6438c1ab2cae71f987b9dad) ) /* char lookup table */
462ROM_END
463
464
465
466GAME( 1982, timeplt,  0,       timeplt, timeplt, 0, ROT90,  "Konami", "Time Pilot", 0 )
467GAME( 1982, timepltc, timeplt, timeplt, timeplt, 0, ROT90,  "Konami (Centuri license)", "Time Pilot (Centuri)", 0 )
468GAME( 1982, timeplta, timeplt, timeplt, timeplt, 0, ROT90,  "Konami (Atari license)", "Time Pilot (Atari)", 0 )
469GAME( 1982, spaceplt, timeplt, timeplt, timeplt, 0, ROT90,  "bootleg", "Space Pilot", 0 )
470GAME( 1988, psurge,   0,       timeplt, psurge,  0, ROT270, "<unknown>", "Power Surge", 0 )
481GAME( 1982, timeplt,  0,       timeplt, timeplt, 0, ROT90,  "Konami", "Time Pilot", GAME_SUPPORTS_SAVE )
482GAME( 1982, timepltc, timeplt, timeplt, timeplt, 0, ROT90,  "Konami (Centuri license)", "Time Pilot (Centuri)", GAME_SUPPORTS_SAVE )
483GAME( 1982, timeplta, timeplt, timeplt, timeplt, 0, ROT90,  "Konami (Atari license)", "Time Pilot (Atari)", GAME_SUPPORTS_SAVE )
484GAME( 1982, spaceplt, timeplt, timeplt, timeplt, 0, ROT90,  "bootleg", "Space Pilot", GAME_SUPPORTS_SAVE )
485GAME( 1988, psurge,   0,       timeplt, psurge,  0, ROT270, "<unknown>", "Power Surge", GAME_SUPPORTS_SAVE )
src/mame/drivers/multigam.c
r1649r1650
3838*/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "video/ppu2c0x.h"
4243#include "sound/nes_apu.h"
4344#include "cpu/m6502/m6502.h"
r1649r1650
276277   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
277278   MDRV_GFXDECODE(multigam)
278279   MDRV_PALETTE_LENGTH(8*4*16)
279   MDRV_COLORTABLE_LENGTH(4*8)
280280
281281   MDRV_PALETTE_INIT(multigam)
282282   MDRV_VIDEO_START(multigam)
r1649r1650
332332ROM_END
333333
334334
335GAME( 1992, multigam, 0, multigam, multigam, multigam, ROT0, "unknown", "Multi Game (set 1)", 0 )
335GAME( 1992, multigam, 0,        multigam, multigam, multigam, ROT0, "unknown", "Multi Game (set 1)", 0 )
336336GAME( 1992, multigmb, multigam, multigam, multigam, multigam, ROT0, "unknown", "Multi Game (set 2)", 0 )
src/mame/drivers/atarigx2.c
r1649r1650
2020
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "machine/atarigen.h"
2425#include "audio/atarijsa.h"
2526#include "video/atarirle.h"
src/mame/drivers/fuukifg2.c
r1649r1650
3333***************************************************************************/
3434
3535#include "driver.h"
36#include "deprecat.h"
3637#include "sound/2203intf.h"
3738#include "sound/3812intf.h"
3839#include "sound/okim6295.h"
src/mame/drivers/nwk-tr.c
r1649r1650
3030*/
3131
3232#include "driver.h"
33#include "deprecat.h"
3334#include "cpu/powerpc/ppc.h"
3435#include "cpu/sharc/sharc.h"
3536#include "machine/konppc.h"
src/mame/drivers/vulgus.c
r1649r1650
4040***************************************************************************/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344#include "sound/ay8910.h"
4445
4546
src/mame/drivers/shangha3.c
r1649r1650
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "cpu/z80/z80.h"
2425#include "sound/ay8910.h"
2526#include "sound/okim6295.h"
src/mame/drivers/pkscram.c
r1649r1650
1212*/
1313
1414#include "driver.h"
15#include "timer.h"
15#include "deprecat.h"
1616#include "sound/2203intf.h"
1717
1818static int interrupt_scanline=192;
src/mame/drivers/vastar.c
r1649r1650
6262***************************************************************************/
6363
6464#include "driver.h"
65#include "deprecat.h"
6566#include "sound/ay8910.h"
6667
6768
src/mame/drivers/taotaido.c
r1649r1650
6464
6565
6666#include "driver.h"
67#include "deprecat.h"
6768#include "sound/2610intf.h"
6869
6970#define TAOTAIDO_SHOW_ALL_INPUTS   0
src/mame/drivers/fortecar.c
r1649r1650
1919
2020
2121#include "driver.h"
22#include "deprecat.h"
2223
2324static UINT8 *fortecar_ram;
2425
src/mame/drivers/relief.c
r1649r1650
1818
1919
2020#include "driver.h"
21#include "deprecat.h"
2122#include "machine/atarigen.h"
2223#include "relief.h"
2324#include "sound/okim6295.h"
src/mame/drivers/gunpey.c
r1649r1650
4646*/
4747
4848#include "driver.h"
49#include "deprecat.h"
4950
5051static UINT16 *unkram;
5152static UINT16 *mainram;
src/mame/drivers/taito_f3.c
r1649r1650
3636***************************************************************************/
3737
3838#include "driver.h"
39#include "deprecat.h"
3940#include "machine/eeprom.h"
4041#include "taito_f3.h"
4142#include "sound/es5506.h"
src/mame/drivers/baraduke.c
r1649r1650
100100***************************************************************************/
101101
102102#include "driver.h"
103#include "deprecat.h"
103104#include "cpu/m6800/m6800.h"
104105#include "sound/namco.h"
105106
src/mame/drivers/champbas.c
r1649r1650
5555***************************************************************************/
5656
5757#include "driver.h"
58#include "deprecat.h"
5859#include "sound/ay8910.h"
5960#include "sound/dac.h"
6061
6162
62extern WRITE8_HANDLER( champbas_videoram_w );
63extern WRITE8_HANDLER( champbas_colorram_w );
64extern WRITE8_HANDLER( champbas_gfxbank_w );
65extern WRITE8_HANDLER( champbas_flipscreen_w );
63WRITE8_HANDLER( champbas_videoram_w );
64WRITE8_HANDLER( champbas_colorram_w );
65WRITE8_HANDLER( champbas_gfxbank_w );
66WRITE8_HANDLER( champbas_palette_bank_w );
67WRITE8_HANDLER( champbas_flipscreen_w );
6668
67extern PALETTE_INIT( champbas );
68extern VIDEO_START( champbas );
69extern VIDEO_UPDATE( champbas );
69PALETTE_INIT( champbas );
70VIDEO_START( champbas );
71VIDEO_UPDATE( champbas );
7072
7173static WRITE8_HANDLER( champbas_dac_w )
7274{
r1649r1650
122124   AM_RANGE(0x8000, 0x83ff) AM_WRITE(champbas_videoram_w) AM_READ(MRA8_RAM) AM_BASE(&videoram)
123125   AM_RANGE(0x8400, 0x87ff) AM_WRITE(champbas_colorram_w) AM_READ(MRA8_RAM) AM_BASE(&colorram)
124126   AM_RANGE(0x8800, 0x8fef) AM_RAM
125   AM_RANGE(0x8ff0, 0x8fff) AM_WRITE(MWA8_RAM) AM_READ(MRA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
127   AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
126128   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w) AM_READ(input_port_0_r)
127129   AM_RANGE(0xa002, 0xa002) AM_WRITE(champbas_gfxbank_w)
128130   AM_RANGE(0xa003, 0xa003) AM_WRITE(champbas_flipscreen_w)
131   AM_RANGE(0xa004, 0xa004) AM_WRITE(champbas_palette_bank_w)
129132   AM_RANGE(0xa005, 0xa005) AM_NOP
130133
131134   AM_RANGE(0xa040, 0xa040)                            AM_READ(input_port_1_r)
r1649r1650
243246};
244247
245248static GFXDECODE_START( champbas )
246   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 64 )
247   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   0, 64 )
248   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout, 0, 64 )
249   GFXDECODE_ENTRY( REGION_GFX2, 0x1000, spritelayout, 0, 64 )
249   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 128 )
250   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   0, 128 )
251   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout, 0, 128 )
252   GFXDECODE_ENTRY( REGION_GFX2, 0x1000, spritelayout, 0, 128 )
250253GFXDECODE_END
251254
252255
r1649r1650
280283   MDRV_SCREEN_SIZE(32*8, 32*8)
281284   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
282285   MDRV_GFXDECODE(champbas)
283   MDRV_PALETTE_LENGTH(32)
284   MDRV_COLORTABLE_LENGTH(64*4)
286   MDRV_PALETTE_LENGTH(128*4)
285287
286288   MDRV_PALETTE_INIT(champbas)
287289   MDRV_VIDEO_START(champbas)
r1649r1650
329331   ROM_LOAD( "champbb.2",    0x2000, 0x2000, CRC(5ddd872e) SHA1(68e21572e27707c991180b1bd0a6b31f7b64abf6) )
330332   ROM_LOAD( "champbb.3",    0x4000, 0x2000, CRC(f39a7046) SHA1(3097bffe84ac74ce9e6481028a0ebbe8b1d6eaf9) )
331333
332   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for the speech CPU */
334   ROM_REGION( 0x10000, REGION_CPU2, 0 )
333335   ROM_LOAD( "champbb.6",    0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
334336   ROM_LOAD( "champbb.7",    0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
335337   ROM_LOAD( "champbb.8",    0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
r1649r1650
351353   ROM_LOAD( "12.2g",      0x2000, 0x2000, CRC(7b4e5faa) SHA1(b7201816a819ef313ddc81f312d26982b83ef1c7) )
352354   ROM_LOAD( "13.2h",      0x4000, 0x2000, CRC(b201e31f) SHA1(bba3b611ff60ad8d5dd8484df4cfc2026f4fd344) )
353355
354   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for the speech CPU */
356   ROM_REGION( 0x10000, REGION_CPU2, 0 )
355357   ROM_LOAD( "16.2k",      0x0000, 0x2000, CRC(24c482ee) SHA1(c25bdf77014e095fc11a9a6b17f16858f19db451) )
356358   ROM_LOAD( "17.2l",      0x2000, 0x2000, CRC(f10b148b) SHA1(d66516d509f6f16e51ee59d27c4867e276064c3f) )
357359   ROM_LOAD( "18.2n",      0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
r1649r1650
373375   ROM_LOAD( "09",         0x2000, 0x2000, CRC(9d39e5b3) SHA1(11c1a1d2296c0bf16d7610eaa79b034bfd813740) )
374376   ROM_LOAD( "08",         0x4000, 0x2000, CRC(53468a0f) SHA1(d4b5ea48b27754eebe593c8b4fcf5bf117f27ae4) )
375377
376   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for the speech CPU */
378   ROM_REGION( 0x10000, REGION_CPU2, 0 )
377379   ROM_LOAD( "16.2k",      0x0000, 0x2000, CRC(24c482ee) SHA1(c25bdf77014e095fc11a9a6b17f16858f19db451) )
378380   ROM_LOAD( "17.2l",      0x2000, 0x2000, CRC(f10b148b) SHA1(d66516d509f6f16e51ee59d27c4867e276064c3f) )
379381   ROM_LOAD( "18.2n",      0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
r1649r1650
396398   ROM_LOAD( "epr5930",      0x4000, 0x2000, CRC(b6570a90) SHA1(5a2651aeac986000913b5854792b2d81df6b2fc6) )
397399   ROM_LOAD( "epr5931",      0x7800, 0x0800, CRC(0592434d) SHA1(a7f61546c39ffdbff46c4db485c9b3f6eefcf1ac) )
398400
399   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for the speech CPU */
401   ROM_REGION( 0x10000, REGION_CPU2, 0 )
400402   ROM_LOAD( "epr5933",      0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
401403   ROM_LOAD( "epr5934",      0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
402404   ROM_LOAD( "epr5935",      0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
r1649r1650
420422   ROM_LOAD( "4.bin",        0x7800, 0x0800, NO_DUMP )
421423
422424   /* not in this set, but probably the same */
423   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for the speech CPU */
425   ROM_REGION( 0x10000, REGION_CPU2, 0 )
424426   ROM_LOAD( "epr5933",      0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
425427   ROM_LOAD( "epr5934",      0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
426428   ROM_LOAD( "epr5935",      0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
r1649r1650
436438   ROM_LOAD( "pr5956",       0x0020, 0x100, CRC(872dd450) SHA1(6c1e2c4a2fc072f4bf4996c731adb0b01b347506) ) /* look-up table */
437439ROM_END
438440
439GAME( 1983, champbas, 0,        champbas, champbas, 0, ROT0, "Sega",          "Champion Baseball", 0 )
440GAME( 1983, champbbj, champbas, champbb2, champbas, champbb2, ROT0, "Alpha Denshi Co.", "Champion Baseball (Japan set 1)", 0 )
441GAME( 1983, champbja, champbas, champbb2, champbas, champbb2, ROT0, "Alpha Denshi Co.", "Champion Baseball (Japan set 2)", 0 )
442GAME( 1983, champbb2, 0,        champbb2, champbas, champbb2, ROT0, "Sega",          "Champion Baseball II (set 1)", 0 )
441GAME( 1983, champbas, 0,        champbas, champbas, 0,        ROT0, "Sega", "Champion Base Ball", 0 )
442GAME( 1983, champbbj, champbas, champbb2, champbas, champbb2, ROT0, "Alpha Denshi Co.", "Champion Base Ball (Japan set 1)", 0 )
443GAME( 1983, champbja, champbas, champbb2, champbas, champbb2, ROT0, "Alpha Denshi Co.", "Champion Base Ball (Japan set 2)", 0 )
444GAME( 1983, champbb2, 0,        champbb2, champbas, champbb2, ROT0, "Sega",   "Champion Base Ball Part-2: Pair Play (set 1)", 0 )
443445
444446/* NO DUMP */
445447GAME( 1983, champb2a, champbb2, champbb2, champbas, champbb2, ROT0, "Alpha Denshi Co.", "Champion Baseball II (set 2)", GAME_NOT_WORKING)
src/mame/drivers/ssozumo.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/m6502/m6502.h"
1213#include "cpu/m6809/m6809.h"
1314#include "sound/ay8910.h"
src/mame/drivers/m107.c
r1649r1650
1414*******************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "m107.h"
1819#include "machine/irem_cpu.h"
1920#include "sound/2151intf.h"
src/mame/drivers/ninjaw.c
r1649r1650
190190***************************************************************************/
191191
192192#include "driver.h"
193#include "deprecat.h"
193194#include "taitoipt.h"
194195#include "cpu/m68000/m68000.h"
195196#include "video/taitoic.h"
src/mame/drivers/matmania.c
r1649r1650
2121***************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "cpu/m6502/m6502.h"
2526#include "cpu/m6809/m6809.h"
2627#include "cpu/m6805/m6805.h"
src/mame/drivers/twin16.c
r1649r1650
5353*/
5454
5555#include "driver.h"
56#include "deprecat.h"
5657#include "cpu/m68000/m68000.h"
5758#include "cpu/z80/z80.h"
5859#include "sound/2151intf.h"
src/mame/drivers/megasys1.c
r1649r1650
119119***************************************************************************/
120120
121121#include "driver.h"
122#include "deprecat.h"
122123#include "megasys1.h"
123124#include "sound/2203intf.h"
124125#include "sound/2151intf.h"
src/mame/drivers/crshrace.c
r1649r1650
124124***************************************************************************/
125125
126126#include "driver.h"
127#include "deprecat.h"
127128#include "video/konamiic.h"
128129#include "sound/2610intf.h"
129130#include "crshrace.h"
src/mame/drivers/airbustr.c
r1649r1650
218218*/
219219
220220#include "driver.h"
221#include "deprecat.h"
221222#include "cpu/z80/z80.h"
222223#include "sound/2203intf.h"
223224#include "sound/okim6295.h"
src/mame/drivers/clshroad.c
r1649r1650
324324   MDRV_SCREEN_SIZE(0x120, 0x100)
325325   MDRV_SCREEN_VISIBLE_AREA(0, 0x120-1, 0x0+16, 0x100-16-1)
326326   MDRV_GFXDECODE(firebatl)
327   MDRV_PALETTE_LENGTH(512)
328   MDRV_COLORTABLE_LENGTH(512+64*4)
327   MDRV_PALETTE_LENGTH(512+64*4)
329328
330329   MDRV_PALETTE_INIT(firebatl)
331330   MDRV_VIDEO_START(firebatl)
src/mame/drivers/pacman.c
r1649r1650
328328****************************************************************************/
329329
330330#include "driver.h"
331#include "deprecat.h"
331332#include "pacman.h"
332333#include "cpu/s2650/s2650.h"
333334#include "sound/namco.h"
r1649r1650
54005401GAME( 1980, pacmanf,  puckman,  pacman,   pacman,   0,        ROT90,  "[Namco] (Midway license)", "Pac-Man (Midway, with speedup hack)", GAME_SUPPORTS_SAVE )
54015402GAME( 1981, puckmod,  puckman,  pacman,   pacman,   0,        ROT90,  "Namco", "PuckMan (Japan set 3)", GAME_SUPPORTS_SAVE )
54025403GAME( 1981, pacmod,   puckman,  pacman,   pacman,   0,        ROT90,  "[Namco] (Midway license)", "Pac-Man (Midway, harder)", GAME_SUPPORTS_SAVE )
5403GAME( 1980, newpuc2,  puckman,  pacman,   pacman,   0,        ROT90,  "hack", "Newpuc2", GAME_SUPPORTS_SAVE )
5404GAME( 1980, newpuc2,  puckman,  pacman,   pacman,   0,        ROT90,  "hack", "Newpuc2 (set 1)", GAME_SUPPORTS_SAVE )
54045405GAME( 1980, newpuc2b, puckman,  pacman,   pacman,   0,        ROT90,  "hack", "Newpuc2 (set 2)", GAME_SUPPORTS_SAVE )
54055406GAME( 1980, newpuckx, puckman,  pacman,   pacman,   0,        ROT90,  "hack", "New Puck-X", GAME_SUPPORTS_SAVE )
54065407GAME( 1981, pacheart, puckman,  pacman,   pacman,   0,        ROT90,  "hack", "Pac-Man (Hearts)", GAME_SUPPORTS_SAVE )
src/mame/drivers/dcheese.c
r1649r1650
2828
2929
3030#include "driver.h"
31#include "deprecat.h"
3132#include "machine/eeprom.h"
3233#include "machine/ticket.h"
3334#include "sound/bsmt2000.h"
src/mame/drivers/chqflag.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/z80/z80.h"
1314#include "cpu/konami/konami.h"
1415#include "video/konamiic.h"
src/mame/drivers/bwing.c
r1649r1650
2323// Directives
2424
2525#include "driver.h"
26#include "deprecat.h"
2627#include "cpu/m6809/m6809.h"
2728#include "cpu/m6502/m6502.h"
2829#include "sound/ay8910.h"
src/mame/drivers/srmp6.c
r1649r1650
6767
6868
6969#include "driver.h"
70#include "deprecat.h"
7071
7172static UINT16* tileram;
7273static UINT8* dirty_tileram;
src/mame/drivers/sf.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/z80/z80.h"
1415#include "cpu/m68000/m68000.h"
1516#include "sound/2151intf.h"
src/mame/drivers/lsasquad.c
r1649r1650
147147***************************************************************************/
148148
149149#include "driver.h"
150#include "deprecat.h"
150151#include "cpu/m6805/m6805.h"
151152#include "sound/ay8910.h"
152153#include "sound/2203intf.h"
src/mame/drivers/konamim2.c
r1649r1650
9696*/
9797
9898#include "driver.h"
99#include "deprecat.h"
99100#include "cdrom.h"
100101#include "cpu/powerpc/ppc.h"
101102
src/mame/drivers/cham24.c
r1649r1650
5555*/
5656
5757#include "driver.h"
58#include "deprecat.h"
5859#include "video/ppu2c0x.h"
5960#include "sound/nes_apu.h"
6061#include "cpu/m6502/m6502.h"
r1649r1650
265266   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
266267   MDRV_GFXDECODE(cham24)
267268   MDRV_PALETTE_LENGTH(8*4*16)
268   MDRV_COLORTABLE_LENGTH(4*8)
269269
270270   MDRV_PALETTE_INIT(cham24)
271271   MDRV_VIDEO_START(cham24)
src/mame/drivers/cave.c
r1649r1650
6969***************************************************************************/
7070
7171#include "driver.h"
72#include "deprecat.h"
7273#include "machine/eeprom.h"
7374#include "machine/nmk112.h"
7475#include "cpu/z80/z80.h"
src/mame/drivers/dooyong.c
r1649r1650
5050***************************************************************************/
5151
5252#include "driver.h"
53#include "deprecat.h"
5354#include "sound/2203intf.h"
5455#include "sound/2151intf.h"
5556#include "sound/okim6295.h"
src/mame/drivers/brkthru.c
r1649r1650
4646***************************************************************************/
4747
4848#include "driver.h"
49#include "deprecat.h"
4950#include "cpu/m6809/m6809.h"
5051#include "sound/2203intf.h"
5152#include "sound/3812intf.h"
src/mame/drivers/williams.c
r1649r1650
523523void defender_install_io_space(void)
524524{
525525   /* this routine dynamically installs the memory mapped above from c000-cfff */
526   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc00f, 0, 0x03e0, williams_paletteram_w);
527   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc010, 0xc01f, 0, 0x03e0, defender_video_control_w);
528   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc3ff, 0xc3ff, 0, 0,      williams_watchdog_reset_w);
529   memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc400, 0xc4ff, 0, 0x0300, MRA8_BANK3);
530   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc400, 0xc4ff, 0, 0x0300, williams_cmos_w);
531   memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0x03e0, williams_video_counter_r);
532   memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcc03, 0, 0x03e0, pia_1_r);
533   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcc03, 0, 0x03e0, pia_1_w);
534   memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xcc04, 0xcc07, 0, 0x03e0, pia_0_r);
535   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc04, 0xcc07, 0, 0x03e0, pia_0_w);
526   memory_install_write8_handler     (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc00f, 0, 0x03e0, MWA8_BANK4);
527   memory_install_write8_handler     (0, ADDRESS_SPACE_PROGRAM, 0xc010, 0xc01f, 0, 0x03e0, defender_video_control_w);
528   memory_install_write8_handler     (0, ADDRESS_SPACE_PROGRAM, 0xc3ff, 0xc3ff, 0, 0,      williams_watchdog_reset_w);
529   memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc400, 0xc4ff, 0, 0x0300, MRA8_BANK3, williams_cmos_w);
530   memory_install_read8_handler      (0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0x03e0, williams_video_counter_r);
531   memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcc03, 0, 0x03e0, pia_1_r, pia_1_w);
532   memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xcc04, 0xcc07, 0, 0x03e0, pia_0_r, pia_0_w);
536533   memory_set_bankptr(3, generic_nvram);
534   memory_set_bankptr(4, paletteram);
537535}
538536
539537
r1649r1650
547545static ADDRESS_MAP_START( williams_map, ADDRESS_SPACE_PROGRAM, 8 )
548546   AM_RANGE(0x0000, 0x8fff) AM_READWRITE(MRA8_BANK1, MWA8_RAM) AM_BASE(&williams_videoram)
549547   AM_RANGE(0x9000, 0xbfff) AM_RAM
550   AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITE(williams_paletteram_w) AM_BASE(&paletteram)
548   AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
551549   AM_RANGE(0xc804, 0xc807) AM_MIRROR(0x00f0) AM_READWRITE(pia_0_r, pia_0_w)
552550   AM_RANGE(0xc80c, 0xc80f) AM_MIRROR(0x00f0) AM_READWRITE(pia_1_r, pia_1_w)
553551   AM_RANGE(0xc900, 0xc9ff) AM_WRITE(williams_vram_select_w)
r1649r1650
562560static ADDRESS_MAP_START( williams_extra_ram_map, ADDRESS_SPACE_PROGRAM, 8 )
563561   AM_RANGE(0x0000, 0x8fff) AM_READWRITE(MRA8_BANK1, MWA8_RAM) AM_BASE(&williams_videoram)
564562   AM_RANGE(0x9000, 0xbfff) AM_RAM
565   AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITE(williams_paletteram_w) AM_BASE(&paletteram)
563   AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
566564   AM_RANGE(0xc804, 0xc807) AM_MIRROR(0x00f0) AM_READWRITE(pia_0_r, pia_0_w)
567565   AM_RANGE(0xc80c, 0xc80f) AM_MIRROR(0x00f0) AM_READWRITE(pia_1_r, pia_1_w)
568566   AM_RANGE(0xc900, 0xc9ff) AM_WRITE(sinistar_vram_select_w)
r1649r1650
585583static ADDRESS_MAP_START( blaster_map, ADDRESS_SPACE_PROGRAM, 8 )
586584   AM_RANGE(0x0000, 0x3fff) AM_READWRITE(MRA8_BANK1, MWA8_RAM) AM_BASE(&williams_videoram)
587585   AM_RANGE(0x4000, 0x8fff) AM_READWRITE(MRA8_BANK2, MWA8_RAM)
588   AM_RANGE(0xbb00, 0xbbff) AM_WRITE(blaster_palette_0_w) AM_BASE(&blaster_palette_0)
589   AM_RANGE(0xbc00, 0xbcff) AM_WRITE(blaster_scanline_control_w) AM_BASE(&blaster_scanline_control)
586   AM_RANGE(0xbb00, 0xbbff) AM_WRITE(MWA8_RAM) AM_BASE(&blaster_palette_0)
587   AM_RANGE(0xbc00, 0xbcff) AM_WRITE(MWA8_RAM) AM_BASE(&blaster_scanline_control)
590588   AM_RANGE(0x9000, 0xbfff) AM_RAM
591   AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITE(williams_paletteram_w) AM_BASE(&paletteram)
589   AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
592590   AM_RANGE(0xc804, 0xc807) AM_MIRROR(0x00f0) AM_READWRITE(pia_0_r, pia_0_w)
593591   AM_RANGE(0xc80c, 0xc80f) AM_MIRROR(0x00f0) AM_READWRITE(pia_1_r, pia_1_w)
594592   AM_RANGE(0xc900, 0xc93f) AM_WRITE(blaster_vram_select_w)
r1649r1650
14161414   MDRV_NVRAM_HANDLER(generic_0fill)
14171415
14181416   /* video hardware */
1419   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1420   MDRV_PALETTE_LENGTH(16)
1417   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_SCANLINE)
14211418
14221419   MDRV_SCREEN_ADD("main", 0)
1423   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1420   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
14241421   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK*2/3, 512, 10, 304, 260, 7, 245)
14251422
14261423   MDRV_VIDEO_START(williams)
r1649r1650
15161513   MDRV_MACHINE_RESET(blaster)
15171514
15181515   /* video hardware */
1519   MDRV_PALETTE_LENGTH(16+256)
1520
15211516   MDRV_VIDEO_START(blaster)
15221517   MDRV_VIDEO_UPDATE(blaster)
15231518MACHINE_DRIVER_END
r1649r1650
15361531   MDRV_NVRAM_HANDLER(generic_0fill)
15371532
15381533   /* video hardware */
1539   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1540   MDRV_GFXDECODE(williams2)
1534   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_SCANLINE)
15411535   MDRV_PALETTE_LENGTH(1024)
1536   MDRV_GFXDECODE(williams2)
15421537
15431538   MDRV_SCREEN_ADD("main", 0)
1544   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1539   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
15451540   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK*2/3, 512, 8, 284, 260, 8, 248)
15461541
15471542   MDRV_VIDEO_START(williams2)
r1649r1650
27742769GAME( 1980, defndjeu, defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Defender (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
27752770GAME( 1980, tornado1, defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Tornado (bootleg set 1)", GAME_SUPPORTS_SAVE )
27762771GAME( 1980, tornado2, defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Tornado (bootleg set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // bad dump?
2777GAME( 1980, zero,     defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Zero", GAME_SUPPORTS_SAVE )
2772GAME( 1980, zero,     defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Zero (set 1)", GAME_SUPPORTS_SAVE )
27782773GAME( 1980, zero2,    defender, defender,            defender, defndjeu, ROT0,   "Amtec", "Zero (set 2)", GAME_SUPPORTS_SAVE )
2779GAME( 1980, defcmnd,  defender, defender,            defender, defender, ROT0,   "bootleg", "Defense Command (set 1)", GAME_SUPPORTS_SAVE )
2774GAME( 1980, defcmnd,  defender, defender,            defender, defender, ROT0,   "bootleg", "Defense Command", GAME_SUPPORTS_SAVE )
27802775GAME( 1981, defence,  defender, defender,            defender, defender, ROT0,   "Outer Limits", "Defence Command", GAME_SUPPORTS_SAVE )
27812776GAME( 1981, startrkd, defender, defender,            defender, defender, ROT0,   "bootleg", "Star Trek (Defender bootleg)", GAME_SUPPORTS_SAVE )
27822777GAME( 1980, mayday,   0,        defender,            mayday,   mayday,   ROT0,   "<unknown>", "Mayday (set 1)", GAME_SUPPORTS_SAVE )
src/mame/drivers/fuukifg3.c
r1649r1650
149149***************************************************************************/
150150
151151#include "driver.h"
152#include "deprecat.h"
152153#include "sound/262intf.h"
153154#include "sound/ymf278b.h"
154155
src/mame/drivers/dec8.c
r1649r1650
3838***************************************************************************/
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "cpu/m6809/m6809.h"
4243#include "cpu/m6502/m6502.h"
4344#include "sound/2203intf.h"
src/mame/drivers/tbowl.c
r1649r1650
1313***/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "cpu/z80/z80.h"
1718#include "sound/3812intf.h"
1819#include "sound/msm5205.h"
src/mame/drivers/battlane.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/m6809/m6809.h"
1415#include "sound/3812intf.h"
1516
src/mame/drivers/atarigt.c
r1649r1650
1919
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "machine/atarigen.h"
2324#include "video/atarirle.h"
2425#include "cpu/m68000/m68000.h"
src/mame/drivers/cherrym2.c
r1649r1650
369369
370370   MDRV_GFXDECODE(cherrym2)
371371   MDRV_PALETTE_LENGTH(256)
372   MDRV_COLORTABLE_LENGTH(256)
373372
374373   MDRV_VIDEO_START(cm2)
375374   MDRV_VIDEO_UPDATE(cm2)
src/mame/drivers/rbmk.c
r1649r1650
5656*/
5757
5858#include "driver.h"
59#include "deprecat.h"
5960#include "sound/okim6295.h"
6061#include "machine/eeprom.h"
6162
src/mame/drivers/bigfghtr.c
r1649r1650
109109
110110**********************************************************************/
111111#include "driver.h"
112#include "deprecat.h"
112113#include "sound/dac.h"
113114#include "sound/okim6295.h"
114115#include "sound/3812intf.h"
src/mame/drivers/genesis.c
r1649r1650
1212*/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "genesis.h"
1617
1718#define MASTER_CLOCK      53693100
src/mame/drivers/trvmadns.c
r1649r1650
6161*/
6262
6363#include "driver.h"
64#include "deprecat.h"
6465#include "sound/ay8910.h"
6566
6667static tilemap *bg_tilemap;
src/mame/drivers/cloud9.c
r1649r1650
9191***************************************************************************/
9292
9393#include "driver.h"
94#include "deprecat.h"
9495#include "sound/pokey.h"
9596#include "cloud9.h"
9697
src/mame/drivers/rpunch.c
r1649r1650
105105
106106
107107#include "driver.h"
108#include "deprecat.h"
108109#include "cpu/m6809/m6809.h"
109110#include "sound/2151intf.h"
110111#include "sound/upd7759.h"
111#include <math.h>
112112
113113
114114
src/mame/drivers/crimfght.c
r1649r1650
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1213#include "video/konamiic.h"
1314#include "sound/2151intf.h"
src/mame/drivers/rabbit.c
r1649r1650
8080*/
8181
8282#include "driver.h"
83#include "deprecat.h"
8384#include "machine/eeprom.h"
8485
8586#define VERBOSE_AUDIO_LOG (0)   // enable to show audio writes (very noisy when music is playing)
src/mame/drivers/asuka.c
r1649r1650
205205***************************************************************************/
206206
207207#include "driver.h"
208#include "deprecat.h"
208209#include "taitoipt.h"
209210#include "video/taitoic.h"
210211#include "audio/taitosnd.h"
src/mame/drivers/triplhnt.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "triplhnt.h"
1516
1617static UINT8 triplhnt_cmos[16];
src/mame/drivers/pooyan.c
r1649r1650
11/***************************************************************************
22
3Notes:
4- Several people claim that colors are wrong, but the way the color PROMs
5  are used seems correct.
3    Pooyan
64
5    Original driver by Allard Van Der Bas
76
8Pooyan memory map (preliminary)
7    This hardware is very similar to Time Pilot.
98
10driver by Allard Van Der Bas
9***************************************************************************/
1110
12Thanks must go to Mike Cuddy for providing information on this one.
11#include "driver.h"
12#include "deprecat.h"
13#include "pooyan.h"
14#include "audio/timeplt.h"
1315
14Sound processor memory map.
150x3000-0x33ff RAM.
16AY-8910 #1 : reg 0x5000
17         wr  0x4000
18             rd  0x4000
1916
20AY-8910 #2 : reg 0x7000
21         wr  0x6000
22             rd  0x6000
17#define MASTER_CLOCK      XTAL_18_432MHz
2318
24Main processor memory map.
250000-7fff ROM
268000-83ff color RAM
278400-87ff video RAM
288800-8fff RAM
299000-97ff sprite RAM (only areas 0x9010 and 0x9410 are used).
3019
31memory mapped ports:
3220
33read:
340xA000  Dipswitch 2 adddbtll
35        a = attract mode
36        ddd = difficulty 0=easy, 7=hardest.
37        b = bonus setting (easy/hard)
38        t = table / upright
39        ll = lives: 11=3, 10=4, 01=5, 00=255.
21static UINT8 irq_enable;
4022
410xA0E0  llllrrrr
42        l == left coin mech, r = right coinmech.
4323
440xA080  IN0 Port
450xA0A0  IN1 Port
460xA0C0  IN2 Port
24/*************************************
25 *
26 *  Interrupts
27 *
28 *************************************/
4729
48write:
490xA100  command for the audio CPU.
500xA180  NMI enable. (0xA180 == 1 = deliver NMI to CPU).
30static MACHINE_START( pooyan )
31{
32   state_save_register_global(irq_enable);
33}
5134
520xA181  interrupt trigger on audio CPU.
5335
540xA183  maybe reset sound cpu?
36static INTERRUPT_GEN( pooyan_interrupt )
37{
38   if (irq_enable)
39      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
40}
5541
560xA184  ????
5742
580xA187  Flip screen
43static WRITE8_HANDLER( irq_enable_w )
44{
45   irq_enable = data & 1;
46   if (!irq_enable)
47      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
48}
5949
60interrupts:
61standard NMI at 0x66
6250
63***************************************************************************/
6451
65#include "driver.h"
66#include "audio/timeplt.h"
52/*************************************
53 *
54 *  Memory maps
55 *
56 *************************************/
6757
68
69extern WRITE8_HANDLER( pooyan_videoram_w );
70extern WRITE8_HANDLER( pooyan_colorram_w );
71extern WRITE8_HANDLER( pooyan_flipscreen_w );
72
73extern PALETTE_INIT( pooyan );
74extern VIDEO_START( pooyan );
75extern VIDEO_UPDATE( pooyan );
76
77
78static ADDRESS_MAP_START( pooyan_map, ADDRESS_SPACE_PROGRAM, 8 )
58static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
7959   AM_RANGE(0x0000, 0x7fff) AM_ROM
8060   AM_RANGE(0x8000, 0x83ff) AM_RAM AM_WRITE(pooyan_colorram_w) AM_BASE(&colorram)
8161   AM_RANGE(0x8400, 0x87ff) AM_RAM AM_WRITE(pooyan_videoram_w) AM_BASE(&videoram)
8262   AM_RANGE(0x8800, 0x8fff) AM_RAM
83   AM_RANGE(0x9010, 0x903f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
84   AM_RANGE(0x9410, 0x943f) AM_RAM AM_BASE(&spriteram_2)
85   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_4_r) AM_WRITENOP   /* DSW2 */   /* watchdog reset? */
86   AM_RANGE(0xa028, 0xa028) AM_WRITENOP // ???
87   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_0_r)   /* IN0 */
88   AM_RANGE(0xa0a0, 0xa0a0) AM_READ(input_port_1_r)   /* IN1 */
89   AM_RANGE(0xa0c0, 0xa0c0) AM_READ(input_port_2_r)   /* IN2 */
90   AM_RANGE(0xa0e0, 0xa0e0) AM_READ(input_port_3_r)   /* DSW1 */
91   AM_RANGE(0xa100, 0xa100) AM_WRITE(soundlatch_w)
92   AM_RANGE(0xa180, 0xa180) AM_WRITE(interrupt_enable_w)
93   AM_RANGE(0xa181, 0xa181) AM_WRITE(timeplt_sh_irqtrigger_w)
94   AM_RANGE(0xa183, 0xa183) AM_WRITENOP // ???
95   AM_RANGE(0xa187, 0xa187) AM_WRITE(pooyan_flipscreen_w)
63   AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram)
64   AM_RANGE(0x9400, 0x94ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram_2)
65   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x5e7f) AM_READ_PORT("DSW1")
66   AM_RANGE(0xa080, 0xa080) AM_MIRROR(0x5e1f) AM_READ_PORT("IN0")
67   AM_RANGE(0xa0a0, 0xa0a0) AM_MIRROR(0x5e1f) AM_READ_PORT("IN1")
68   AM_RANGE(0xa0c0, 0xa0c0) AM_MIRROR(0x5e1f) AM_READ_PORT("IN2")
69   AM_RANGE(0xa0e0, 0xa0e0) AM_MIRROR(0x5e1f) AM_READ_PORT("DSW0")
70   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x5e7f) AM_WRITE(watchdog_reset_w)
71   AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x5e7f) AM_WRITE(soundlatch_w)
72   AM_RANGE(0xa180, 0xa180) AM_MIRROR(0x5e78) AM_WRITE(irq_enable_w)
73   AM_RANGE(0xa181, 0xa181) AM_MIRROR(0x5e78) AM_WRITE(timeplt_sh_irqtrigger_w)
74   AM_RANGE(0xa183, 0xa183) AM_MIRROR(0x5e78) AM_WRITENOP // ???
75   AM_RANGE(0xa187, 0xa187) AM_MIRROR(0x5e78) AM_WRITE(pooyan_flipscreen_w)
9676ADDRESS_MAP_END
9777
9878
79
80/*************************************
81 *
82 *  Port definitions
83 *
84 *************************************/
85
9986static INPUT_PORTS_START( pooyan )
100   PORT_START   /* IN0 */
87   PORT_START_TAG("IN0")
10188   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
10289   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
10390   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r1649r1650
10592   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
10693   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
10794
108   PORT_START   /* IN1 */
95   PORT_START_TAG("IN1")
10996   PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
11097   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_2WAY
11198   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_2WAY
11299   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
113100   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
114101
115   PORT_START   /* IN2 */
102   PORT_START_TAG("IN2")
116103   PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
117104   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_2WAY PORT_COCKTAIL
118105   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_2WAY PORT_COCKTAIL
119106   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
120107   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
121108
122   PORT_START   /* DSW0 */
109   PORT_START_TAG("DSW0")
123110   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
124111   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
125112   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r1649r1650
154141   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
155142   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
156143
157   PORT_START   /* DSW1 */
144   PORT_START_TAG("DSW1")
158145   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
159146   PORT_DIPSETTING(    0x03, "3" )
160147   PORT_DIPSETTING(    0x02, "4" )
r1649r1650
182169
183170
184171
172/*************************************
173 *
174 *  Graphics layouts
175 *
176 *************************************/
177
185178static const gfx_layout charlayout =
186179{
187   8,8,   /* 8*8 characters */
188   256,   /* 256 characters */
189   4,   /* 4 bits per pixel */
190   { 0x1000*8+4, 0x1000*8+0, 4, 0 },
191   { 0, 1, 2, 3, 8*8+0,8*8+1,8*8+2,8*8+3 },
192   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
193   16*8   /* every char takes 16 consecutive bytes */
180   8,8,
181   RGN_FRAC(1,2),
182   4,
183   { RGN_FRAC(1,2)+4, RGN_FRAC(1,2)+0, 4, 0 },
184   { STEP4(0,1), STEP4(8*8,1) },
185   { STEP8(0,8) },
186   16*8
194187};
188
195189static const gfx_layout spritelayout =
196190{
197   16,16,   /* 16*16 sprites */
198   64,   /* 64 sprites */
199   4,   /* 4 bits per pixel */
200   { 0x1000*8+4, 0x1000*8+0, 4, 0 },
201   { 0, 1, 2, 3,  8*8+0, 8*8+1, 8*8+2, 8*8+3,
202         16*8+0, 16*8+1, 16*8+2, 16*8+3,  24*8+0, 24*8+1, 24*8+2, 24*8+3 },
203   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
204         32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
205   64*8   /* every sprite takes 64 consecutive bytes */
191   16,16,
192   RGN_FRAC(1,2),
193   4,
194   { RGN_FRAC(1,2)+4, RGN_FRAC(1,2)+0, 4, 0 },
195   { STEP4(0,1), STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1) },
196   { STEP8(0,8), STEP8(32*8,8) },
197   64*8
206198};
207199
208200
209
210201static GFXDECODE_START( pooyan )
211202   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
212203   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
r1649r1650
214205
215206
216207
208/*************************************
209 *
210 *  Machine drivers
211 *
212 *************************************/
213
217214static MACHINE_DRIVER_START( pooyan )
218215
219216   /* basic machine hardware */
220   MDRV_CPU_ADD(Z80, 3072000)   /* 3.072 MHz (?) */
221   MDRV_CPU_PROGRAM_MAP(pooyan_map, 0)
222   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
217   MDRV_CPU_ADD(Z80, MASTER_CLOCK/3/2)
218   MDRV_CPU_PROGRAM_MAP(main_map,0)
219   MDRV_CPU_VBLANK_INT(pooyan_interrupt,1)
223220
224   MDRV_CPU_ADD(Z80,14318180/8)
225   /* audio CPU */   /* 1.789772727 MHz */
226   MDRV_CPU_PROGRAM_MAP(timeplt_sound_readmem,timeplt_sound_writemem)
227
228221   MDRV_SCREEN_REFRESH_RATE(60)
229   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
230222
223   MDRV_MACHINE_START(pooyan)
224
231225   /* video hardware */
232226   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
233227   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
234228   MDRV_SCREEN_SIZE(32*8, 32*8)
235229   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
236230   MDRV_GFXDECODE(pooyan)
237   MDRV_PALETTE_LENGTH(32)
238   MDRV_COLORTABLE_LENGTH(16*16+16*16)
231   MDRV_PALETTE_LENGTH(16*16+16*16)
239232
240233   MDRV_PALETTE_INIT(pooyan)
241234   MDRV_VIDEO_START(pooyan)
242235   MDRV_VIDEO_UPDATE(pooyan)
243236
244237   /* sound hardware */
245   MDRV_SPEAKER_STANDARD_MONO("mono")
246
247   MDRV_SOUND_ADD(AY8910, 14318180/8)
248   MDRV_SOUND_CONFIG(timeplt_ay8910_interface)
249   MDRV_SOUND_ROUTE(0, "filter.0.0", 0.60)
250   MDRV_SOUND_ROUTE(1, "filter.0.1", 0.60)
251   MDRV_SOUND_ROUTE(2, "filter.0.2", 0.60)
252
253   MDRV_SOUND_ADD(AY8910, 14318180/8)
254   MDRV_SOUND_ROUTE(0, "filter.1.0", 0.60)
255   MDRV_SOUND_ROUTE(1, "filter.1.1", 0.60)
256   MDRV_SOUND_ROUTE(2, "filter.1.2", 0.60)
257
258   MDRV_SOUND_ADD_TAG("filter.0.0", FILTER_RC, 0)
259   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
260   MDRV_SOUND_ADD_TAG("filter.0.1", FILTER_RC, 0)
261   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
262   MDRV_SOUND_ADD_TAG("filter.0.2", FILTER_RC, 0)
263   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
264
265   MDRV_SOUND_ADD_TAG("filter.1.0", FILTER_RC, 0)
266   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
267   MDRV_SOUND_ADD_TAG("filter.1.1", FILTER_RC, 0)
268   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
269   MDRV_SOUND_ADD_TAG("filter.1.2", FILTER_RC, 0)
270   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
238   MDRV_IMPORT_FROM(timeplt_sound)
271239MACHINE_DRIVER_END
272240
273241
274242
275/***************************************************************************
243/*************************************
244 *
245 *  ROM definitions
246 *
247 *************************************/
276248
277  Game driver(s)
278
279***************************************************************************/
280
281249ROM_START( pooyan )
282250   ROM_REGION( 0x10000, REGION_CPU1, 0 )
283251   ROM_LOAD( "1.4a",         0x0000, 0x2000, CRC(bb319c63) SHA1(5401b8ef586127c8cf5a431e5c44e38be2254a98) )
r1649r1650
355323
356324
357325
358GAME( 1982, pooyan,  0,      pooyan, pooyan, 0, ROT270, "Konami", "Pooyan", 0 )
359GAME( 1982, pooyans, pooyan, pooyan, pooyan, 0, ROT270, "[Konami] (Stern license)", "Pooyan (Stern)", 0 )
360GAME( 1982, pootan,  pooyan, pooyan, pooyan, 0, ROT270, "bootleg", "Pootan", 0 )
326/*************************************
327 *
328 *  Game drivers
329 *
330 *************************************/
331
332GAME( 1982, pooyan,  0,      pooyan, pooyan, 0, ROT90, "Konami", "Pooyan", GAME_SUPPORTS_SAVE )
333GAME( 1982, pooyans, pooyan, pooyan, pooyan, 0, ROT90, "[Konami] (Stern license)", "Pooyan (Stern)", GAME_SUPPORTS_SAVE )
334GAME( 1982, pootan,  pooyan, pooyan, pooyan, 0, ROT90, "bootleg", "Pootan", GAME_SUPPORTS_SAVE )
src/mame/drivers/backfire.c
r1649r1650
1414extern void decrypt156(void);
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "decocrpt.h"
1819#include "deco32.h"
1920#include "machine/eeprom.h"
r1649r1650
695696   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0170018, 0x017001b, 0, 0, backfire_speedup_r );
696697}
697698
698GAME( 1995, backfire, 0,        backfire,      backfire, backfire, ROT0, "Data East Corporation", "Backfire!", 0 )
699GAME( 1995, backfire, 0,        backfire,      backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", 0 )
699700GAME( 1995, backfira, backfire, backfire,      backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 2)", 0 ) // defaults to wheel controls, must change to joystick to play
700
701
src/mame/drivers/rollerg.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "video/konamiic.h"
1112#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1213#include "machine/eeprom.h"
src/mame/drivers/sidepckt.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "cpu/m6809/m6809.h"
1819#include "cpu/m6502/m6502.h"
1920#include "sound/2203intf.h"
src/mame/drivers/starwars.c
r1649r1650
2323***************************************************************************/
2424
2525#include "driver.h"
26#include "deprecat.h"
2627#include "cpu/m6809/m6809.h"
2728#include "video/vector.h"
2829#include "video/avgdvg.h"
src/mame/drivers/tankbatt.c
r1649r1650
5656***************************************************************************/
5757
5858#include "driver.h"
59#include "deprecat.h"
5960#include "cpu/m6502/m6502.h"
6061#include "sound/samples.h"
6162
src/mame/drivers/cherrym.c
r1649r1650
173173   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 1") PORT_CODE(KEYCODE_S)
174174   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
175175   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 3") PORT_CODE(KEYCODE_F)
176   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 4") PORT_CODE(KEYCODE_G)
177   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 5") PORT_CODE(KEYCODE_H)
178   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )      // 50 Credits
176   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) // PORT_NAME("Bit 4") PORT_CODE(KEYCODE_G)
177   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 ) // PORT_NAME("Bit 5") PORT_CODE(KEYCODE_H)
178   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )      // Key-In
179179   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )      // 10 Credits
180180
181181   PORT_START_TAG("TEST")
r1649r1650
189189   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F2) PORT_NAME("Analyzer")
190190
191191   PORT_START_TAG("DSW1")
192   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
193   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
194   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
195   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
196   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
197   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
198   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
199   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
200   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
201   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
202   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
203   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
204   PORT_DIPNAME( 0x10, 0x00, "Double Up %" )
192   PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW1:!1" ) /* Listed as "Unused" */
193   PORT_DIPNAME( 0x02, 0x00, "Hopper Out Switch" ) PORT_DIPLOCATION("SW1:!2")
194   PORT_DIPSETTING(    0x02, "Active High" )
195   PORT_DIPSETTING(    0x00, "Active Low" )
196   PORT_DIPNAME( 0x04, 0x00, "Type Of Payout" ) PORT_DIPLOCATION("SW1:!3")
197   PORT_DIPSETTING(    0x04, "Automatic" )
198   PORT_DIPSETTING(    0x00, "Payout SH" )
199   PORT_DIPNAME( 0x08, 0x00, "@ IN DoubleUp" ) PORT_DIPLOCATION("SW1:!4")
200   PORT_DIPSETTING(    0x08, "Even" )
201   PORT_DIPSETTING(    0x00, "LOST" )
202   PORT_DIPNAME( 0x10, 0x00, "DoubleUp Pay-Rate" ) PORT_DIPLOCATION("SW1:!5")
205203   PORT_DIPSETTING(    0x00, "80%" )
206204   PORT_DIPSETTING(    0x10, "90%" )
207   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
208   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
209   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
210   PORT_DIPNAME( 0xc0, 0x00, "Bet Max" )
211   PORT_DIPSETTING(    0x00, "16" )
212   PORT_DIPSETTING(    0x40, "32" )
213   PORT_DIPSETTING(    0x80, "64" )
214   PORT_DIPSETTING(    0xc0, "96" )
205   PORT_DIPNAME( 0x20, 0x00, "DoubleUp" ) PORT_DIPLOCATION("SW1:!6")
206   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
207   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
208   PORT_DIPNAME( 0xc0, 0x00, "Bet Max" ) PORT_DIPLOCATION("SW1:!7,!8") /* Manual says 8/16/32/64 */
209   PORT_DIPSETTING(    0x00, "16 Bet" )
210   PORT_DIPSETTING(    0x40, "32 Bet" )
211   PORT_DIPSETTING(    0x80, "64 Bet" )
212   PORT_DIPSETTING(    0xc0, "96 Bet" )
215213
216214   PORT_START_TAG("DSW2")
217   PORT_DIPNAME( 0x07, 0x00, "Main Game %" )
218   PORT_DIPSETTING(    0x07, "35%" )
219   PORT_DIPSETTING(    0x06, "40%" )
220   PORT_DIPSETTING(    0x05, "45%" )
221   PORT_DIPSETTING(    0x04, "50%" )
222   PORT_DIPSETTING(    0x03, "55%" )
223   PORT_DIPSETTING(    0x02, "60%" )
224   PORT_DIPSETTING(    0x01, "65%" )
225   PORT_DIPSETTING(    0x00, "70%" )
226   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
227   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
228   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
229   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
230   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
231   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
232   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
233   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
234   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
235   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
236   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
237   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
238   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
239   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
240   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
241
242   PORT_START_TAG("DSW3")
243   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
244   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
245   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
246   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
247   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
248   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
249   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
250   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
251   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
252   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
253   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
254   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
255   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
256   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
257   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
258   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
215   PORT_DIPNAME( 0x07, 0x07, "Main Game Pay-Rate" ) PORT_DIPLOCATION("SW2:!1,!2,!3")
216   PORT_DIPSETTING(    0x07, "55 30% 45" ) /* Displays 35% */
217   PORT_DIPSETTING(    0x06, "60 38% 50" ) /* Displays 40% */
218   PORT_DIPSETTING(    0x05, "65 46% 55" ) /* Displays 45% */
219   PORT_DIPSETTING(    0x04, "70 54% 60" ) /* Displays 50% */
220   PORT_DIPSETTING(    0x03, "75 62% 65" ) /* Displays 55% */
221   PORT_DIPSETTING(    0x02, "80 70% 70" ) /* Displays 60% */
222   PORT_DIPSETTING(    0x01, "85 78% 75" ) /* Displays 65% */
223   PORT_DIPSETTING(    0x00, "90 86% 80" ) /* Displays 70% */
224   PORT_DIPNAME( 0x18, 0x18, "Hopper Limit" ) PORT_DIPLOCATION("SW2:!4,!5")
225   PORT_DIPSETTING(    0x00, "300" )
226   PORT_DIPSETTING(    0x08, "500" )
227   PORT_DIPSETTING(    0x10, "1000" )
228   PORT_DIPSETTING(    0x18, "Unlimited" )
229   PORT_DIPNAME( 0x20, 0x20, "Sound On/Off Odds Over 100" ) PORT_DIPLOCATION("SW2:!6")
259230   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
260231   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
261   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
262   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
263   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
264   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
265   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
266   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
232   PORT_DIPNAME( 0x40, 0x40, "Type Of Key In" ) PORT_DIPLOCATION("SW2:!7") /* Manual says C-Type/D-Type probably a typo */
233   PORT_DIPSETTING(    0x40, "A-Type" )
234   PORT_DIPSETTING(    0x00, "B-Type" )
235   PORT_DIPNAME( 0x80, 0x80, "Bet Limit For Center Super 7" ) PORT_DIPLOCATION("SW2:!8")
236   PORT_DIPSETTING(    0x00, "Unlimited" )
237   PORT_DIPSETTING(    0x80, "Limited" ) /* "Number is fixed by 4-6" */
267238
239   PORT_START_TAG("DSW3")
240   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("SW3:1,2")
241   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // A-Type
242   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
243   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
244   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
245   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // B-Type
246   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
247   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
248   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
249   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("SW3:3,4")
250   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
251   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
252   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
253   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
254   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("SW3:5,6")
255   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // C-Type
256   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
257   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
258   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
259   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // D-Type
260   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
261   PORT_DIPSETTING(    0x20, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
262   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
263   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("SW3:7,8")
264   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
265   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
266   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
267   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
268
268269   PORT_START_TAG("DSW4")
269   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
270   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
271   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
272   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
273   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
274   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
275   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
276   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
277   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
278   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
270   PORT_DIPNAME( 0x07, 0x07, "Credit Limit" ) PORT_DIPLOCATION("SW4:1,2,3")
271   PORT_DIPSETTING(    0x07, "5,000" )
272   PORT_DIPSETTING(    0x06, "10,000" )
273   PORT_DIPSETTING(    0x05, "20,000" )
274   PORT_DIPSETTING(    0x04, "30,000" )
275   PORT_DIPSETTING(    0x03, "40,000" )
276   PORT_DIPSETTING(    0x02, "50,000" )
277   PORT_DIPSETTING(    0x01, "100,000" )
278   PORT_DIPSETTING(    0x00, "Unlimited" )
279   PORT_DIPNAME( 0x08, 0x08, "Display Of Payout Limit" ) PORT_DIPLOCATION("SW4:4")
279280   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
280281   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
281   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
282   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
283   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
284   PORT_DIPNAME( 0x20, 0x20, "Bet Over" )
285   PORT_DIPSETTING(    0x20, "16" )
286   PORT_DIPSETTING(    0x00, "8" )
287   PORT_DIPNAME( 0x40, 0x40, "Reel Speed" )
288   PORT_DIPSETTING(    0x40, DEF_STR( Low ) )
289   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
290   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
282   PORT_DIPNAME( 0x10, 0x10, "Type Of Coin D" ) PORT_DIPLOCATION("SW4:5")
283   PORT_DIPSETTING(    0x10, "C-Type" )
284   PORT_DIPSETTING(    0x00, "D-Type" )
285   PORT_DIPNAME( 0x20, 0x20, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("SW4:6")
286   PORT_DIPSETTING(    0x20, "16 Bet" )
287   PORT_DIPSETTING(    0x00, "8 Bet" )
288   PORT_DIPNAME( 0x40, 0x40, "Reel Speed" ) PORT_DIPLOCATION("SW4:7")
289   PORT_DIPSETTING(    0x40, DEF_STR( High ) )
290   PORT_DIPSETTING(    0x00, DEF_STR( Low ) )
291   PORT_DIPNAME( 0x80, 0x80, "Hopper Out By Coin A" ) PORT_DIPLOCATION("SW4:8")
291292   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
292293   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
293294
294295   PORT_START_TAG("DSW5")
295   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
296   PORT_DIPNAME( 0x01, 0x01, "Display Of Doll On Demo" ) PORT_DIPLOCATION("SW5:1")
296297   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
297298   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
298   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
299   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
300   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
301   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
302   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
303   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
304   PORT_DIPNAME( 0x18, 0x18, "Cherry/Bell Bonus" )
305   PORT_DIPSETTING(    0x00, "3/2" )
306   PORT_DIPSETTING(    0x08, "6/3" )
307   PORT_DIPSETTING(    0x10, "9/5" )
308   PORT_DIPSETTING(    0x18, "12/7" )
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 ) )
299   PORT_DIPNAME( 0x06, 0x06, "Coin In Limit" ) PORT_DIPLOCATION("SW5:2,3")
300   PORT_DIPSETTING(    0x06, "1,000" )
301   PORT_DIPSETTING(    0x04, "5,000" )
302   PORT_DIPSETTING(    0x02, "10,000" )
303   PORT_DIPSETTING(    0x00, "20,000" )
304   PORT_DIPNAME( 0x18, 0x18, "Condition For 3 Kind Of Bonus" ) PORT_DIPLOCATION("SW5:4,5")
305   PORT_DIPSETTING(    0x18, "12-7-1" )
306   PORT_DIPSETTING(    0x10, "9-5-1" )
307   PORT_DIPSETTING(    0x08, "6-3-1" )
308   PORT_DIPSETTING(    0x00, "3-2-1" )
309   PORT_DIPNAME( 0x20, 0x20, "Display Of Doll At All Fr. Bonus" ) PORT_DIPLOCATION("SW5:6")
310   PORT_DIPSETTING(    0x20, DEF_STR( Low ) )
311   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
312   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW5:7" ) /* Listed as "Unused" */
313   PORT_DIPNAME( 0x80, 0x80, "Test Mode For Disp. Of Doll" ) PORT_DIPLOCATION("SW5:8")
316314   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
317315   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
318316INPUT_PORTS_END
src/mame/drivers/segas18.c
r1649r1650
2828***************************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3132#include "machine/segaic16.h"
3233#include "system16.h"
3334#include "genesis.h"
src/mame/drivers/meijinsn.c
r1649r1650
5959
6060*/
6161#include "driver.h"
62#include "deprecat.h"
6263#include "video/resnet.h"
6364#include "sound/ay8910.h"
6465
src/mame/drivers/crospang.c
r1649r1650
2727*/
2828
2929#include "driver.h"
30#include "deprecat.h"
3031#include "sound/okim6295.h"
3132#include "sound/3812intf.h"
3233
src/mame/drivers/royalmah.c
r1649r1650
8585****************************************************************************/
8686
8787#include "driver.h"
88#include "deprecat.h"
8889#include "cpu/tlcs90/tlcs90.h"
8990#include "machine/msm6242.h"
9091#include "sound/ay8910.h"
src/mame/drivers/coolridr.c
r1649r1650
6868
6969*/
7070
71#include <stdio.h>
7271#include "driver.h"
72#include "deprecat.h"
7373#include "sound/scsp.h"
7474
7575/* video */
src/mame/drivers/darkmist.c
r1649r1650
2424*/
2525
2626#include "driver.h"
27#include "deprecat.h"
2728#include "audio/t5182.h"
2829
2930
src/mame/drivers/exctsccr.c
r1649r1650
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829#include "sound/ay8910.h"
2930#include "sound/dac.h"
3031
src/mame/drivers/galgames.c
r0r1650
1/*
2Galaxy Games
3
4----
5
6This is a multi-game coctail cabinet released in 1998.  Namco seems to have
7made some cartridges for it (or at least licensed their IP).
8
9Trackball-based.  'BIOS' has 7 built-in games.  There are two LEDs on the PCB.
10
11More information here : http://www.cesgames.com/museum/galaxy/index.html
12
13----
14
15Board silkscreend  237-0211-00
16                   REV.-D
17
18Cartridge based mother board
19Holds up to 4 cartridges
20Chips labeled
21    GALAXY U1 V1.90 12/1/98
22    GALAXY U2 V1.90 12/1/98
23
24NAMCO 307 Cartridge has surface mount Flash chips in it (not dumped?).
25
26Looks like it requires a medium resolution monitor
27
28Motorola MC68HC000FN12
2924 MHz oscillator
30Xilinx XC5206
31Xilinx XC5202
32BT481AKPJ110
33NKK N341024SJ-15    x8  (128kb RAM)
34OKI M6295 8092352-2
35
36PAL16V8H-15 @ U24   Blue dot on it
37PAL16V8H-15 @ U25   Yellow dot on it
38PAL16V8H-15 @ U26   Red dot on it
39PAL16V8H-15 @ U27   Green dot on it
40PAL16V8H-15 @ U45   red dot on it
41
42----
43
44There are a few built-in games on the hardware, so the driver can grow mature without carts dumped.
45
46TODO : This is a skeleton driver.  Just about everything.
47
48*/
49
50#include <stdio.h>
51#include "driver.h"
52#include "video/generic.h"
53
54static READ16_HANDLER( dummy_read_01 )
55{
56   return 0x3;            // Pass the check at PC = 0x00000FAE & a later one
57}
58
59static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
60   AM_RANGE(0x000000, 0x1fffff) AM_ROM
61/*  AM_RANGE(0x01a900, 0x01a9ff) AM_RAM                         Need to install memory handlers
62    ...                                                         in the middle of the ROM space?
63    AM_RANGE(0x01f700, 0x01f7ff) AM_RAM */
64   AM_RANGE(0x200000, 0x23ffff) AM_RAM                     /* 2x N341024SJ-15 */
65   AM_RANGE(0x400000, 0x400001) AM_RAM
66   AM_RANGE(0x600000, 0x600001) AM_READ(dummy_read_01)
67   AM_RANGE(0x700000, 0x700001) AM_RAM                     /* Writes a 0x0002 here early, reads it later */
68   AM_RANGE(0x900000, 0x900001) AM_NOP                     /* Writes 0xffff here before each test memory access. */
69   AM_RANGE(0xb00000, 0xb7ffff) AM_RAM                     /* 4x N341024SJ-15 */
70   AM_RANGE(0xd00000, 0xd00001) AM_RAM
71ADDRESS_MAP_END
72
73
74static INPUT_PORTS_START( galgames )
75INPUT_PORTS_END
76
77
78static MACHINE_DRIVER_START( galgames )
79   MDRV_CPU_ADD_TAG("main", M68000, XTAL_24MHz)
80   MDRV_CPU_PROGRAM_MAP(main_map,0)
81   //MDRV_CPU_VBLANK_INT(main_int, 2)
82
83   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
84   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
85
86   MDRV_SCREEN_REFRESH_RATE(60)
87   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
88
89   MDRV_SCREEN_SIZE(640, 480)
90   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
91   MDRV_PALETTE_LENGTH(0x100)
92
93   MDRV_VIDEO_START(generic_bitmapped)
94   MDRV_VIDEO_UPDATE(generic_bitmapped)
95MACHINE_DRIVER_END
96
97
98ROM_START( galgbios )
99   ROM_REGION( 0x200000, REGION_CPU1, 0 )
100   ROM_LOAD16_BYTE( "galaxy.u2", 0x000000, 0x100000, CRC(e51ff184) SHA1(aaa795f2c15ec29b3ceeb5c917b643db0dbb7083) )
101   ROM_LOAD16_BYTE( "galaxy.u1", 0x000001, 0x100000, CRC(c6d7bc6d) SHA1(93c032f9aa38cbbdda59a8a25ff9f38f7ad9c760) )
102ROM_END
103
104
105/* System board BIOS */
106/*    YEAR  NAME      PARENT  MACHINE   INPUT     INIT MONITOR COMPANY                FULLNAME             FLAGS */
107GAME( 1998, galgbios, 0,      galgames, galgames, 0,   ROT0,   "Creative Electonics", "Galaxy Games BIOS", GAME_NOT_WORKING | GAME_IS_BIOS_ROOT )
src/mame/drivers/funybubl.c
r1649r1650
4949
5050
5151#include "driver.h"
52#include "deprecat.h"
5253#include "sound/okim6295.h"
5354
5455/* video/funybubl.c */
src/mame/drivers/shisen.c
r1649r1650
420420   /* no samples on this board */
421421ROM_END
422422
423GAME( 1989, matchit,  0,        shisen, matchit, 0, ROT0, "Tamtex",  "Match It", 0 )
424GAME( 1989, shisen,   matchit,  shisen, shisen,  0, ROT0, "Tamtex",  "Shisensho - Joshiryo-Hen (Japan)", 0 )
425GAME( 1989, sichuan2, matchit,  shisen, shisen,  0, ROT0, "hack", "Sichuan II (hack set 1)", 0 )
426GAME( 1989, sichuana, matchit,  shisen, shisen,  0, ROT0, "hack", "Sichuan II (hack set 2)", 0 )
423GAME( 1989, matchit,  0,        shisen,   matchit,  0, ROT0, "Tamtex",  "Match It", 0 )
424GAME( 1989, shisen,   matchit,   shisen,   shisen,   0, ROT0, "Tamtex",  "Shisensho - Joshiryo-Hen (Japan)", 0 )
425GAME( 1989, sichuan2, matchit,   shisen,   shisen,   0, ROT0, "hack", "Sichuan II (hack, set 1)", 0 )
426GAME( 1989, sichuana, matchit,   shisen,   shisen,   0, ROT0, "hack", "Sichuan II (hack, set 2)", 0 )
src/mame/drivers/tutankhm.c
r1649r1650
11/***************************************************************************
22
3Tutankham :  memory map (preliminary)
3    Tutankham
44
5driver by Mirko Buffoni
5    driver by Mirko Buffoni
6    based on original work by Rob Jarrett
67
7I include here the document based on Rob Jarrett's research because it's
8really exaustive.
8    I include here the document based on Rob Jarrett's research because it's
9    really exaustive.
910
11    Sound board: uses the same board as Pooyan.
1012
13***************************************************************************/
1114
12Tutankham Emu Info
13------------------
15#include "driver.h"
16#include "deprecat.h"
17#include "tutankhm.h"
18#include "cpu/m6809/m6809.h"
19#include "audio/timeplt.h"
1420
15By Rob Jarrett
16robj@astound.com (until June 20, 1997)
17or robncait@inforamp.net
1821
19Special thanks go to Pete Custerson for the schematics!!
2022
23static UINT8 irq_toggle;
24static UINT8 irq_enable;
2125
22I've recently been working on an emulator for Tutankham. Unfortunately,
23time and resources are not on my side so I'd like to provide anyone with
24the technical information I've gathered so far, that way someone can
25finish the project.
2626
27First of all, I'd like to say that I've had no prior experience in
28writing an emulator, and my hardware knowledge is weak. I've managed to
29find out a fair amount by looking at the schematics of the game and the
30disassembled ROMs. Using the USim C++ 6809 core I have the game sort of
31up and running, albeit in a pathetic state. It's not playable, and
32crashes after a short amount of time. I don't feel the source code is
33worth releasing because of the bad design; I was using it as a testing
34bed and anticipated rewriting everything in the future.
3527
36Here's all the info I know about Tutankham:
28/*************************************
29 *
30 *  Interrupts
31 *
32 *************************************/
3733
38Processor: 6809
39Sound: Z80 slave w/2 AY3910 sound chips
40Graphics: Bitmapped display, no sprites (!)
41Memory Map:
34static INTERRUPT_GEN( tutankhm_interrupt )
35{
36   /* flip flops cause the interrupt to be signalled every other frame */
37   irq_toggle ^= 1;
38   if (irq_toggle && irq_enable)
39      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
40}
4241
43Address     R/W Bits        Function
44------------------------------------------------------------------------------------------------------
45$0000-$7fff             Video RAM
46                    - Screen is stored sideways, 256x256 pixels
47                    - 1 byte=2 pixels
48        R/W aaaaxxxx    - leftmost pixel palette index
49        R/W xxxxbbbb    - rightmost pixel palette index
50                    - **** not correct **** Looks like some of this memory is for I/O state, (I think < $0100)
51                      so you might want to blit from $0100-$7fff
5242
53$8000-$800f R/W     aaaaaaaa    Palette colors
54                    - Don't know how to decode them into RGB values
43static WRITE8_HANDLER( irq_enable_w )
44{
45   irq_enable = data & 1;
46   if (!irq_enable)
47      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
48}
5549
56$8100       W           Not sure
57                    - Video chip function of some sort
58                    ( split screen y pan position -- TT )
5950
60$8120       R           Not sure
61                    - Read from quite frequently
62                    - Some sort of video or interrupt thing?
63                    - Or a random number seed?
64                    ( watchdog reset -- NS )
6551
66$8160                   Dip Switch 2
67                    - Inverted bits (ie. 1=off)
68        R   xxxxxxxa    DSWI1
69        R
70        R           .
71        R           .
72        R           .
73        R
74        R
75        R   axxxxxxx    DSWI8
52/*************************************
53 *
54 *  Bank selection
55 *
56 *************************************/
7657
77$8180                   I/O: Coin slots, service, 1P/2P buttons
78        R
58static MACHINE_START( tutankhm )
59{
60   memory_configure_bank(1, 0, 16, memory_region(REGION_CPU1) + 0x10000, 0x1000);
61   state_save_register_global(irq_toggle);
62   state_save_register_global(irq_enable);
63}
7964
80$81a0                   Player 1 I/O
81        R
8265
83$81c0                   Player 2 I/O
84        R
66static WRITE8_HANDLER( tutankhm_bankselect_w )
67{
68   memory_set_bank(1, data & 0x0f);
69}
8570
86$81e0                   Dip Switch 1
87                    - Inverted bits
88        R   xxxxxxxa    DSWI1
89        R
90        R           .
91        R           .
92        R           .
93        R
94        R
95        R   axxxxxxx    DSWI8
9671
97$8200                   IST on schematics
98                    - Enable/disable IRQ
99        R/W xxxxxxxa    - a=1 IRQ can be fired, a=0 IRQ can't be fired
10072
101$8202                   OUT2 (Coin counter)
102        W   xxxxxxxa    - Increment coin counter
73/*************************************
74 *
75 *  Outputs
76 *
77 *************************************/
10378
104$8203                   OUT1 (Coin counter)
105        W   xxxxxxxa    - Increment coin counter
106
107$8204                   Not sure - 401 on schematics
108        W
109
110$8205                   MUT on schematics
111        R/W xxxxxxxa    - Sound amplification on/off?
112
113$8206                   HFF on schematics
114        W           - Don't know what it does
115                    ( horizontal screen flip -- NS )
116
117$8207                   Not sure - can't resolve on schematics
118        W
119                    ( vertical screen flip -- NS )
120
121$8300                   Graphics bank select
122        W   xxxxxaaa    - Selects graphics ROM 0-11 that appears at $9000-9fff
123                    - But wait! There's only 9 ROMs not 12! I think the PCB allows 12
124                      ROMs for patches/mods to the game. Just make 9-11 return 0's
125
126$8600       W           SON on schematics
127                    ( trigger interrupt on audio CPU -- NS )
128$8608       R/W         SON on schematics
129                    - Sound on/off? i.e. Run/halt Z80 sound CPU?
130
131$8700       W   aaaaaaaa    SDA on schematics
132                    - Sound data? Maybe Z80 polls here and plays the appropriate sound?
133                    - If so, easy to trigger samples here
134
135$8800-$8fff             RAM
136        R/W         - Memory for the program ROMs
137
138$9000-$9fff             Graphics ROMs ra1_1i.cpu - ra1_9i.cpu
139        R   aaaaaaaa    - See address $8300 for usage
140
141$a000-$afff             ROM ra1_1h.cpu
142        R   aaaaaaaa    - 6809 Code
143
144$b000-$bfff             ROM ra1_2h.cpu
145        R   aaaaaaaa    - 6809 Code
146
147$c000-$cfff             ROM ra1_3h.cpu
148        R   aaaaaaaa    - 6809 Code
149
150$d000-$dfff             ROM ra1_4h.cpu
151        R   aaaaaaaa    - 6809 Code
152
153$e000-$efff             ROM ra1_5h.cpu
154        R   aaaaaaaa    - 6809 Code
155
156$f000-$ffff             ROM ra1_6h.cpu
157        R   aaaaaaaa    - 6809 Code
158
159Programming notes:
160
161I found that generating an IRQ every 4096 instructions seemed to kinda work. Again, I know
162little about emu writing and I think some fooling with this number might be needed.
163
164Sorry I didn't supply the DSW and I/O bits, this info is available elsewhere on the net, I
165think at tant or something. I just couldn't remember what they were at this writing!!
166
167If there are any questions at all, please feel free to email me at robj@astound.com (until
168June 20, 1997) or robncait@inforamp.net.
169
170
171BTW, this information is completely free - do as you wish with it. I'm not even sure if it's
172correct! (Most of it seems to be). Giving me some credit if credit is due would be nice,
173and please let me know about your emulator if you release it.
174
175
176Sound board: uses the same board as Pooyan.
177
178***************************************************************************/
179
180#include "driver.h"
181#include "cpu/m6809/m6809.h"
182#include "audio/timeplt.h"
183
184
185
186extern UINT8 *tutankhm_videoram;
187extern size_t tutankhm_videoram_size;
188extern UINT8 *tutankhm_paletteram;
189extern UINT8 *tutankhm_scroll;
190
191WRITE8_HANDLER( tutankhm_flip_screen_x_w );
192WRITE8_HANDLER( tutankhm_flip_screen_y_w );
193VIDEO_UPDATE( tutankhm );
194
195
196static WRITE8_HANDLER( tutankhm_bankselect_w )
79static WRITE8_HANDLER( sound_mute_w )
19780{
198   offs_t bankaddress;
199   UINT8 *RAM = memory_region(REGION_CPU1);
200
201   bankaddress = 0x10000 + (data & 0x0f) * 0x1000;
202   memory_set_bankptr(1,&RAM[bankaddress]);
81   sound_global_enable(~data & 1);
20382}
20483
20584
r1649r1650
20988}
21089
21190
91
92/*************************************
93 *
94 *  Main CPU memory handlers
95 *
96 *************************************/
97
21298static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
213   AM_RANGE(0x0000, 0x7fff) AM_RAM AM_BASE(&tutankhm_videoram) AM_SIZE(&tutankhm_videoram_size)
214   AM_RANGE(0x8000, 0x800f) AM_RAM AM_BASE(&tutankhm_paletteram)
215   AM_RANGE(0x8100, 0x8100) AM_RAM AM_BASE(&tutankhm_scroll)
216   AM_RANGE(0x8120, 0x8120) AM_READ(watchdog_reset_r)
217   AM_RANGE(0x8160, 0x8160) AM_READ(input_port_0_r)   /* DSW2 (inverted bits) */
218   AM_RANGE(0x8180, 0x8180) AM_READ(input_port_1_r)   /* IN0 I/O: Coin slots, service, 1P/2P buttons */
219   AM_RANGE(0x81a0, 0x81a0) AM_READ(input_port_2_r)   /* IN1: Player 1 I/O */
220   AM_RANGE(0x81c0, 0x81c0) AM_READ(input_port_3_r)   /* IN2: Player 2 I/O */
221   AM_RANGE(0x81e0, 0x81e0) AM_READ(input_port_4_r)   /* DSW1 (inverted bits) */
222   AM_RANGE(0x8200, 0x8200) AM_WRITE(interrupt_enable_w)
223   AM_RANGE(0x8202, 0x8203) AM_WRITE(tutankhm_coin_counter_w)
224   AM_RANGE(0x8205, 0x8205) AM_WRITE(MWA8_NOP)   /* ??? */
225   AM_RANGE(0x8206, 0x8206) AM_WRITE(tutankhm_flip_screen_x_w)
226   AM_RANGE(0x8207, 0x8207) AM_WRITE(tutankhm_flip_screen_y_w)
227   AM_RANGE(0x8300, 0x8300) AM_WRITE(tutankhm_bankselect_w)
228   AM_RANGE(0x8600, 0x8600) AM_WRITE(timeplt_sh_irqtrigger_w)
229   AM_RANGE(0x8700, 0x8700) AM_WRITE(soundlatch_w)
99   AM_RANGE(0x0000, 0x7fff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
100   AM_RANGE(0x8000, 0x800f) AM_MIRROR(0x00f0) AM_RAM AM_BASE(&paletteram)
101   AM_RANGE(0x8100, 0x8100) AM_MIRROR(0x000f) AM_RAM AM_BASE(&tutankhm_scroll)
102   AM_RANGE(0x8120, 0x8120) AM_MIRROR(0x000f) AM_READ(watchdog_reset_r)
103   AM_RANGE(0x8160, 0x8160) AM_MIRROR(0x000f) AM_READ_PORT("DSW2")   /* DSW2 (inverted bits) */
104   AM_RANGE(0x8180, 0x8180) AM_MIRROR(0x000f) AM_READ_PORT("IN0")   /* IN0 I/O: Coin slots, service, 1P/2P buttons */
105   AM_RANGE(0x81a0, 0x81a0) AM_MIRROR(0x000f) AM_READ_PORT("IN1")   /* IN1: Player 1 I/O */
106   AM_RANGE(0x81c0, 0x81c0) AM_MIRROR(0x000f) AM_READ_PORT("IN2")   /* IN2: Player 2 I/O */
107   AM_RANGE(0x81e0, 0x81e0) AM_MIRROR(0x000f) AM_READ_PORT("DSW1")   /* DSW1 (inverted bits) */
108   AM_RANGE(0x8200, 0x8200) AM_MIRROR(0x00f8) AM_READWRITE(MRA8_NOP, irq_enable_w)
109   AM_RANGE(0x8202, 0x8203) AM_MIRROR(0x00f8) AM_WRITE(tutankhm_coin_counter_w)
110   AM_RANGE(0x8205, 0x8205) AM_MIRROR(0x00f8) AM_WRITE(sound_mute_w)
111   AM_RANGE(0x8206, 0x8206) AM_MIRROR(0x00f8) AM_WRITE(tutankhm_flip_screen_x_w)
112   AM_RANGE(0x8207, 0x8207) AM_MIRROR(0x00f8) AM_WRITE(tutankhm_flip_screen_y_w)
113   AM_RANGE(0x8300, 0x8300) AM_MIRROR(0x00ff) AM_WRITE(tutankhm_bankselect_w)
114   AM_RANGE(0x8600, 0x8600) AM_MIRROR(0x00ff) AM_WRITE(timeplt_sh_irqtrigger_w)
115   AM_RANGE(0x8700, 0x8700) AM_MIRROR(0x00ff) AM_WRITE(soundlatch_w)
230116   AM_RANGE(0x8800, 0x8fff) AM_RAM
231   AM_RANGE(0x9000, 0x9fff) AM_READ(MRA8_BANK1)
117   AM_RANGE(0x9000, 0x9fff) AM_ROMBANK(1)
232118   AM_RANGE(0xa000, 0xffff) AM_ROM
233119ADDRESS_MAP_END
234120
235121
122
123/*************************************
124 *
125 *  Port definitions
126 *
127 *************************************/
128
236129static INPUT_PORTS_START( tutankhm )
237130   PORT_START_TAG("DSW2")
238131   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
r1649r1650
328221
329222
330223
224/*************************************
225 *
226 *  Machine drivers
227 *
228 *************************************/
229
331230static MACHINE_DRIVER_START( tutankhm )
332231
333232   /* basic machine hardware */
334233   MDRV_CPU_ADD(M6809, 1500000)         /* 1.5 MHz ??? */
335234   MDRV_CPU_PROGRAM_MAP(main_map,0)
336   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
235   MDRV_CPU_VBLANK_INT(tutankhm_interrupt,1)
337236
338   MDRV_CPU_ADD(Z80,14318180/8)
339   /* audio CPU */   /* 1.789772727 MHz */                  \
340   MDRV_CPU_PROGRAM_MAP(timeplt_sound_readmem,timeplt_sound_writemem)
237   MDRV_MACHINE_START(tutankhm)
341238
342   MDRV_SCREEN_REFRESH_RATE(30)
343   MDRV_SCREEN_VBLANK_TIME(DEFAULT_30HZ_VBLANK_DURATION)
239   MDRV_SCREEN_REFRESH_RATE(60)
240   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
344241
345242   /* video hardware */
346243   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
r1649r1650
348245   MDRV_SCREEN_SIZE(32*8, 32*8)
349246   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)   /* not sure about the visible area */
350247
248   MDRV_VIDEO_START(tutankhm)
351249   MDRV_VIDEO_UPDATE(tutankhm)
352250
353251   /* sound hardware */
354   MDRV_SPEAKER_STANDARD_MONO("mono")
252   MDRV_IMPORT_FROM(timeplt_sound)
253MACHINE_DRIVER_END
355254
356   MDRV_SOUND_ADD(AY8910, 14318180/8)
357   MDRV_SOUND_CONFIG(timeplt_ay8910_interface)
358   MDRV_SOUND_ROUTE(0, "filter.0.0", 0.60)
359   MDRV_SOUND_ROUTE(1, "filter.0.1", 0.60)
360   MDRV_SOUND_ROUTE(2, "filter.0.2", 0.60)
361255
362   MDRV_SOUND_ADD(AY8910, 14318180/8)
363   MDRV_SOUND_ROUTE(0, "filter.1.0", 0.60)
364   MDRV_SOUND_ROUTE(1, "filter.1.1", 0.60)
365   MDRV_SOUND_ROUTE(2, "filter.1.2", 0.60)
366256
367   MDRV_SOUND_ADD_TAG("filter.0.0", FILTER_RC, 0)
368   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
369   MDRV_SOUND_ADD_TAG("filter.0.1", FILTER_RC, 0)
370   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
371   MDRV_SOUND_ADD_TAG("filter.0.2", FILTER_RC, 0)
372   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
257/*************************************
258 *
259 *  ROM definitions
260 *
261 *************************************/
373262
374   MDRV_SOUND_ADD_TAG("filter.1.0", FILTER_RC, 0)
375   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
376   MDRV_SOUND_ADD_TAG("filter.1.1", FILTER_RC, 0)
377   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
378   MDRV_SOUND_ADD_TAG("filter.1.2", FILTER_RC, 0)
379   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
380MACHINE_DRIVER_END
381
382
383263ROM_START( tutankhm )
384264   ROM_REGION( 0x20000, REGION_CPU1, 0 )      /* 64k for M6809 CPU code + 64k for ROM banks */
385265   ROM_LOAD( "h1.bin",       0x0a000, 0x1000, CRC(da18679f) SHA1(8d2a3665db937d0e1d19300ae22277d9db61fcbc) ) /* program ROMs */
r1649r1650
431311
432312
433313
434GAME( 1982, tutankhm, 0,        tutankhm, tutankhm, 0, ROT90, "Konami", "Tutankham", 0 )
435GAME( 1982, tutankst, tutankhm, tutankhm, tutankhm, 0, ROT90, "[Konami] (Stern license)", "Tutankham (Stern)", 0 )
314/*************************************
315 *
316 *  Game drivers
317 *
318 *************************************/
319
320GAME( 1982, tutankhm, 0,        tutankhm, tutankhm, 0, ROT90, "Konami", "Tutankham", GAME_SUPPORTS_SAVE )
321GAME( 1982, tutankst, tutankhm, tutankhm, tutankhm, 0, ROT90, "[Konami] (Stern license)", "Tutankham (Stern)", GAME_SUPPORTS_SAVE )
src/mame/drivers/nmk16.c
r1649r1650
145145********************************************************************/
146146
147147#include "driver.h"
148#include "deprecat.h"
148149#include "audio/seibu.h"
149150#include "sound/2203intf.h"
150151#include "sound/okim6295.h"
r1649r1650
232233VIDEO_UPDATE( hachamf );
233234VIDEO_UPDATE( tdragon );
234235VIDEO_EOF( nmk );
236VIDEO_EOF( strahl );
235237
236238/* Variables defined in video: */
237239
r1649r1650
42074209   MDRV_PALETTE_LENGTH(1024)
42084210
42094211   MDRV_VIDEO_START(strahl)
4210   MDRV_VIDEO_EOF(nmk)
4212   MDRV_VIDEO_EOF(strahl)
42114213   MDRV_VIDEO_UPDATE(strahl)
42124214
42134215   /* sound hardware */
src/mame/drivers/miniboy7.c
r1649r1650
125125
126126#include "driver.h"
127127#include "video/crtc6845.h"
128//#include "machine/6821pia.h"
129128
130129
131130/*************************
src/osd/windows/output.c
r1649r1650
1414// MAME headers
1515#include "osdepend.h"
1616#include "driver.h"
17#include "deprecat.h"
1718
1819// MAMEOS headers
1920#include "output.h"
src/osd/windows/windows.mak
r1649r1650
249249$(WINOBJ)/drawgdi.o :   $(SRC)/emu/rendersw.c
250250
251251# add debug-specific files
252ifdef DEBUG
252ifdef DEBUGGER
253253OSDOBJS += \
254254   $(WINOBJ)/debugwin.o
255255endif
r1649r1650
290290#-------------------------------------------------
291291
292292VERINFO = $(WINOBJ)/verinfo$(EXE)
293
294ifneq ($(CROSS_BUILD),1)
293295BUILD += $(VERINFO)
294296
295297VERINFOOBJS = \
r1649r1650
298300$(VERINFO): $(VERINFOOBJS) $(LIBOCORE)
299301   @echo Linking $@...
300302   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
303endif
301304
302305
303306
304
305307#-------------------------------------------------
306308# generic rule for the resource compiler
307309#-------------------------------------------------
src/osd/windows/sound.c
r1649r1650
2020#include "osdepend.h"
2121#include "driver.h"
2222#include "osdepend.h"
23#include "deprecat.h"
2324
2425// MAMEOS headers
2526#include "winmain.h"
src/osd/windows/winmain.c
r1649r1650
408408      ExitProcess(100);
409409   already_hit = 1;
410410
411#ifdef MAME_DEBUG
411#ifdef ENABLE_DEBUGGER
412412{
413413extern void debug_flush_traces(void);
414414debug_flush_traces();
src/osd/windows/debugwin.c
r1649r1650
2121#include "debug/debugvw.h"
2222#include "debug/debugcon.h"
2323#include "debug/debugcpu.h"
24#include "deprecat.h"
2425
2526// MAMEOS headers
2627#include "debugwin.h"
src/osd/windows/drawdd.c
r1649r1650
2323#include "render.h"
2424#include "rendutil.h"
2525#include "options.h"
26#include "deprecat.h"
2627
2728// MAMEOS headers
2829#include "winmain.h"
src/osd/windows/video.c
r1649r1650
3030#include "render.h"
3131#include "rendutil.h"
3232#include "ui.h"
33#include "deprecat.h"
3334
3435// MAMEOS headers
3536#include "winmain.h"
r1649r1650
110111      SetForegroundWindow(win_window_list->hwnd);
111112
112113   // possibly create the debug window, but don't show it yet
113#ifdef MAME_DEBUG
114#ifdef ENABLE_DEBUGGER
114115   if (options_get_bool(mame_options(), OPTION_DEBUG))
115116      debugwin_init_windows();
116117#endif
r1649r1650
129130   effect_bitmap = NULL;
130131
131132   // possibly kill the debug window
132#ifdef MAME_DEBUG
133#ifdef ENABLE_DEBUGGER
133134   if (options_get_bool(mame_options(), OPTION_DEBUG))
134135      debugwin_destroy_windows();
135136#endif
r1649r1650
383384   video_config.prescale      = options_get_int(mame_options(), WINOPTION_PRESCALE);
384385   video_config.keepaspect    = options_get_bool(mame_options(), WINOPTION_KEEPASPECT);
385386   video_config.numscreens    = options_get_int(mame_options(), WINOPTION_NUMSCREENS);
386#ifdef MAME_DEBUG
387#ifdef ENABLE_DEBUGGER
387388   // if we are in debug mode, never go full screen
388389   if (options_get_bool(mame_options(), OPTION_DEBUG))
389390      video_config.windowed = TRUE;
src/osd/windows/window.c
r1649r1650
2727// MAME headers
2828#include "osdepend.h"
2929#include "driver.h"
30#include "deprecat.h"
3031
3132// MAMEOS headers
3233#include "winmain.h"
r1649r1650
352353   assert(GetCurrentThreadId() == main_threadid);
353354
354355   // if we're running, disable some parts of the debugger
355#if defined(MAME_DEBUG)
356#ifdef ENABLE_DEBUGGER
356357   if (ingame)
357358      debugwin_update_during_game();
358359#endif
r1649r1650
494495
495496   assert(GetCurrentThreadId() == main_threadid);
496497
497#ifdef MAME_DEBUG
498#ifdef ENABLE_DEBUGGER
498499   // if we are in debug mode, never go full screen
499500   if (options_get_bool(mame_options(), OPTION_DEBUG))
500501      return;
src/osd/windows/drawd3d.c
r1649r1650
2929#include "render.h"
3030#include "rendutil.h"
3131#include "options.h"
32#include "deprecat.h"
3233
3334// MAMEOS headers
3435#include "d3dintf.h"
src/emu/debug/debugcpu.c
r1649r1650
1717#include "debugcon.h"
1818#include "express.h"
1919#include "debugvw.h"
20#include "deprecat.h"
2021#include <ctype.h>
2122
2223
r1649r1650
705706    before executing each instruction
706707-------------------------------------------------*/
707708
708void mame_debug_hook(void)
709void mame_debug_hook(offs_t curpc)
709710{
710711   int cpunum = cpu_getactivecpu();
711   offs_t curpc = activecpu_get_pc();
712712   debug_cpu_info *info = &debug_cpuinfo[cpunum];
713713
714714   /* update the history */
src/emu/debug/debugcmd.c
r1649r1650
11/*********************************************************************
22
3    debugcmd.h
3    debugcmd.c
44
55    Debugger command interface engine.
66
r1649r1650
1818#include "debughlp.h"
1919#include "debugvw.h"
2020#include "render.h"
21#include <stdarg.h>
21#include "deprecat.h"
2222#include <ctype.h>
2323
2424
src/emu/debug/debugcon.c
r1649r1650
1515#include "debughlp.h"
1616#include "debugvw.h"
1717#include "textbuf.h"
18#include <stdarg.h>
18#include "deprecat.h"
1919#include <ctype.h>
2020
2121
src/emu/debug/debugcmt.c
r1649r1650
2626#include "debugcpu.h"
2727#include "debugvw.h"
2828#include "info.h"
29#include "deprecat.h"
2930#include <zlib.h>
3031
3132
src/emu/cpu/m6805/m6805.c
r1649r1650
3232
3333
3434#include "debugger.h"
35#include "deprecat.h"
3536#include "m6805.h"
3637
3738#define IRQ_LEVEL_DETECT 0
r1649r1650
520521         }
521522      }
522523
523      CALL_MAME_DEBUG;
524      CALL_DEBUGGER(PC);
524525
525526      ireg=M_RDOP(PC++);
526527
r1649r1650
937938      case CPUINFO_PTR_EXIT:                     info->exit = m6805_exit;            break;
938939      case CPUINFO_PTR_EXECUTE:                  info->execute = m6805_execute;         break;
939940      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
940#ifdef MAME_DEBUG
941#ifdef ENABLE_DEBUGGER
941942      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6805_dasm;         break;
942#endif /* MAME_DEBUG */
943#endif /* ENABLE_DEBUGGER */
943944      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m6805_ICount;         break;
944945
945946      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/m6805/m6805.h
r1649r1650
8282/****************************************************************************/
8383#define M6805_RDOP_ARG(Addr) ((unsigned)cpu_readop_arg(Addr))
8484
85#ifdef MAME_DEBUG
85#ifdef ENABLE_DEBUGGER
8686offs_t m6805_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
8787#endif
8888
src/emu/cpu/v30mz/v30mz.c
r1649r1650
4141****************************************************************************/
4242
4343#include "debugger.h"
44#include "deprecat.h"
4445
4546typedef UINT8 BOOLEAN;
4647typedef UINT8 BYTE;
r1649r1650
916917   }
917918}
918919
919#ifdef MAME_DEBUG
920#ifdef ENABLE_DEBUGGER
920921static offs_t nec_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
921922{
922923   return necv_dasm_one(buffer, pc, oprom);
923924}
924#endif /* MAME_DEBUG */
925#endif /* ENABLE_DEBUGGER */
925926
926927static void nec_init(int index, int clock, const void *config, int (*irqcallback)(int), int type)
927928{
r1649r1650
969970      if (I.no_interrupt)
970971         I.no_interrupt--;
971972
972      CALL_MAME_DEBUG;
973      CALL_DEBUGGER((I.sregs[CS]<<4) + I.ip);
973974      nec_instruction[FETCHOP]();
974975   }
975976
r1649r1650
10961097      case CPUINFO_PTR_RESET:                     info->reset = nec_reset;            break;
10971098      case CPUINFO_PTR_EXIT:                     info->exit = nec_exit;               break;
10981099      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1099#ifdef MAME_DEBUG
1100#ifdef ENABLE_DEBUGGER
11001101      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = nec_dasm;         break;
1101#endif /* MAME_DEBUG */
1102#endif /* ENABLE_DEBUGGER */
11021103      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &nec_ICount;            break;
11031104
11041105      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/lh5801/lh5801.c
r1649r1650
1717 * based on info found on an artikel for the tandy trs80 pc2
1818 *
1919 *****************************************************************************/
20#include "cpuintrf.h"
2120#include "debugger.h"
21#include "deprecat.h"
2222
2323#include "lh5801.h"
2424
25//typedef int bool;
26
2725#define VERBOSE 0
2826
2927#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
r1649r1650
134132      {
135133         lh5801.oldpc = P;
136134
137         CALL_MAME_DEBUG;
135         CALL_DEBUGGER(P);
138136         lh5801_instruction();
139137
140138      } while (lh5801_icount > 0);
r1649r1650
237235      case CPUINFO_PTR_EXIT:                     info->exit = NULL;                  break;
238236      case CPUINFO_PTR_EXECUTE:                  info->execute = lh5801_execute;         break;
239237      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
240#ifdef MAME_DEBUG
238#ifdef ENABLE_DEBUGGER
241239      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = lh5801_dasm;      break;
242#endif /* MAME_DEBUG */
240#endif /* ENABLE_DEBUGGER */
243241      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &lh5801_icount;         break;
244242
245243      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/m6809/m6809.c
r1649r1650
7171*****************************************************************************/
7272
7373#include "debugger.h"
74#include "deprecat.h"
7475#include "m6809.h"
7576
7677/* Enable big switch statement for the main opcodes */
r1649r1650
8283
8384#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
8485
85#ifdef MAME_DEBUG
86#ifdef ENABLE_DEBUGGER
8687extern offs_t m6809_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
8788#endif
8889
r1649r1650
517518
518519   if (m6809.int_state & (M6809_CWAI | M6809_SYNC))
519520   {
520      CALL_MAME_DEBUG;
521      CALL_DEBUGGER(PCD);
521522      m6809_ICount = 0;
522523   }
523524   else
r1649r1650
526527      {
527528         pPPC = pPC;
528529
529         CALL_MAME_DEBUG;
530         CALL_DEBUGGER(PCD);
530531
531532         m6809.ireg = ROP(PCD);
532533         PC++;
r1649r1650
11731174      case CPUINFO_PTR_EXIT:                     info->exit = m6809_exit;            break;
11741175      case CPUINFO_PTR_EXECUTE:                  info->execute = m6809_execute;         break;
11751176      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1176#ifdef MAME_DEBUG
1177#ifdef ENABLE_DEBUGGER
11771178      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6809_dasm;         break;
1178#endif /* MAME_DEBUG */
1179#endif /* ENABLE_DEBUGGER */
11791180      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m6809_ICount;         break;
11801181
11811182      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/h83002/h8disasm.c
r1649r1650
1111#include "debugger.h"
1212#include "h83002.h"
1313
14static const char *const bit_instr[8] = {"bset", "bnot", "bclr", "btst", "bor", "bxor", "band", "bld"};
15static const char *const bit_instr2[8] = {"bset", "bnot", "bclr", "btst", "bior", "bixor", "biand", "bild"};
16static const char *const imm32l_instr[8] = {"mov", "add", "cmp", "sub", "or", "xor", "and", "?"};
17static const char *const branch_instr[16] = {"bt", "bf", "bhi", "bls", "bcc", "bcs", "bne", "beq", "bvc", "bvs", "bpl", "bmi", "bge", "blt", "bgt", "ble"};
18static const char *const reg_names32[8] = {"ER0", "ER1", "ER2", "ER3", "ER4", "ER5", "ER6", "SP"};
19static const char *const reg_names16[16] = {"R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7"};
20static const char *const reg_names8[16] = {"R0H", "R1H", "R2H", "R3H", "R4H", "R5H", "R6H", "R7H","R0L", "R1L", "R2L", "R3L", "R4L", "R5L", "R6L", "R7L"};
14static const char *const bit_instr[8]      =   {"bset", "bnot", "bclr", "btst", "bor", "bxor", "band", "bld"};
15static const char *const bit_instr2[8]      =   {"bset", "bnot", "bclr", "btst", "bior", "bixor", "biand", "bild"};
16static const char *const imm32l_instr[8]   =   {"mov", "add", "cmp", "sub", "or", "xor", "and", "?"};
17static const char *const branch_instr[16]   =   {"bt", "bf", "bhi", "bls", "bcc", "bcs", "bne", "beq", "bvc", "bvs", "bpl", "bmi", "bge", "blt", "bgt", "ble"};
2118
19static const char *const reg_names32[8]      =   {"ER0", "ER1", "ER2", "ER3", "ER4", "ER5", "ER6", "SP"};
20static const char *const reg_names16[16]   =   {"R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7"};
21static const char *const reg_names8[16]      =   {"R0H", "R1H", "R2H", "R3H", "R4H", "R5H", "R6H", "R7H","R0L", "R1L", "R2L", "R3L", "R4L", "R5L", "R6L", "R7L"};
22
2223static UINT32 h8disasm_0(UINT32 address, UINT32 opcode, char *output, const UINT8 *oprom);
2324static UINT32 h8disasm_1(UINT32 address, UINT32 opcode, char *output, const UINT8 *oprom);
2425static UINT32 h8disasm_5(UINT32 address, UINT32 opcode, char *output, const UINT8 *oprom);
r1649r1650
248249         break;
249250         // 01f0 and.l prefix
250251      case 0xf:
251         // and.l rs, rd
252         // or.l/xor.l/and.l rs, rd
252253         data16 = h8_mem_read16(2);
253         sprintf(output, "%4.4x and.l %s, %s", opcode, reg_names16[(data16>>4) & 0x7], reg_names16[data16 & 0x7]);
254         size = 2;
254         size = 4;
255         switch((data16>>8)&0xff)
256         {
257         case 0x64:   // or.l ERs, ERd
258            sprintf(output, "%4.4x or.l %s, %s", opcode, reg_names32[(data16>>4) & 0x7], reg_names32[data16 & 0x7]);
259            break;
260         case 0x65:   // xor.l ERs, ERd
261            sprintf(output, "%4.4x xor.l %s, %s", opcode, reg_names32[(data16>>4) & 0x7], reg_names32[data16 & 0x7]);
262            break;
263         case 0x66:   // and.l ERs, ERd
264            sprintf(output, "%4.4x and.l %s, %s", opcode, reg_names32[(data16>>4) & 0x7], reg_names32[data16 & 0x7]);
265            break;
266         default:
267            sprintf(output, "%4.4x default", opcode);
268            break;
269         }
255270         break;
256271      default:
257272         sprintf(output, "%4.4x default", opcode);
r1649r1650
355370         sprintf(output, "%4.4x adds.l #2, %s", opcode, reg_names32[opcode & 0x7]);
356371         break;
357372      case 9:
358         sprintf(output, "%4.4x adds.l #3, %s", opcode, reg_names32[opcode & 0x7]);
373         sprintf(output, "%4.4x adds.l #4, %s", opcode, reg_names32[opcode & 0x7]);
359374         break;
360375      case 0xd:
361376         sprintf(output, "%4.4x inc.w #2, %s", opcode, reg_names16[opcode & 0xf]);
r1649r1650
11961211   case 0xc:
11971212   case 0xd:
11981213      data16 = h8_mem_read16(2);
1199      if(((data16>>4)&0x8) == 0)
1214      size = 4;
1215      switch(data16>>8)
12001216      {
1201         sprintf(output, "%4.4x %s.b #%1.1x, @%s", opcode, bit_instr[(data16>>8)&7], (data16>>4)&7, reg_names32[(opcode>>4) & 0x7]);
1217         case 0x60:   // bset/bnot/bclr.b rn, @erd
1218         case 0x61:
1219         case 0x62:
1220            if (((opcode & 0x8f)!=0)||((data16 & 0x0f)!=0))
1221            {
1222               sprintf(output, "%4.4x default", opcode);
1223               break;
1224            }
1225            sprintf(output, "%4.4x %s.b %s, @%s", opcode, bit_instr[(data16>>8)&7], reg_names16[(data16>>4)&0xf], reg_names32[(opcode>>4) & 0x7]);
1226            break;
1227
1228         case 0x67:   // bst/bist.b #xx:3, @erd
1229            if (((opcode & 0x8f)!=0)||((data16 & 0x0f)!=0))
1230            {
1231               sprintf(output, "%4.4x default", opcode);
1232               break;
1233            }
1234            if ((data16 & 0x80)!=0)
1235               sprintf(output, "%4.4x bist.b #%1.1x, @%s", opcode, (data16>>4)&7, reg_names32[(opcode>>4) & 0x7]);
1236            else
1237               sprintf(output, "%4.4x bst.b #%1.1x, @%s", opcode, (data16>>4)&7, reg_names32[(opcode>>4) & 0x7]);
1238            break;
1239
1240         case 0x70:   // bset/bnot/bclr.b #xx:3, @erd
1241         case 0x71:
1242         case 0x72:
1243            if (((opcode & 0x8f)!=0)||((data16 & 0x8f)!=0))
1244            {
1245               sprintf(output, "%4.4x default", opcode);
1246               break;
1247            }
1248            sprintf(output, "%4.4x %s.b #%1.1x, @%s", opcode, bit_instr[(data16>>8)&7], (data16>>4)&7, reg_names32[(opcode>>4) & 0x7]);
1249            break;
12021250      }
1203      else
1204      {
1205         sprintf(output, "%4.4x %s.b #%1.1x, @%s", opcode, bit_instr2[(opcode>>4)&7], (data16>>4)&7, reg_names32[(opcode>>4) & 0x7]);
1206      }
1207      size = 4;
12081251      break;
12091252      // bxx.b #imm, @aa:8
12101253   case 0xe:
src/emu/cpu/h83002/h83002.c
r1649r1650
1919     instructions were being picked.
2020
2121 TS 20060412 Added exts.l, sub.l, divxs.w (buggy), jsr @reg, rotxl.l reg, mov.l @(adr, reg), reg
22 LE 20070903 Added divxu.b  shal.l  extu.w  dec.l #Imm,Rd  subx.b
23 LE 20080202 Separated 3002/3044/3007, Added or.l  shal.l  rotl.l  not.l  neg.l  exts.w
24             sub/or/xor.l #Imm:32,ERd  bset/bnot/bclr.b Rn,@ERd  bst/bist.b #Imm:3,@ERd  bnot.b #Imm:3,@ERd
2225
2326 Note: The H8/3000 series is normally back-compatible to the 8-bit H8/300,
2427 but the 3002 does not include "emulation mode" - it always runs in full
r1649r1650
2831****************************************************************************/
2932
3033#include "debugger.h"
34#include "deprecat.h"
3135#include "h83002.h"
3236#include "h8priv.h"
3337
r1649r1650
4852#define H8_WORD_TIMING(x, adr)   if (address24 >= 0xffff10) h8_cyccnt -= (x) * 3; else h8_cyccnt -= (x) * 4;
4953#define H8_IOP_TIMING(x)   h8_cyccnt -= (x);
5054
51extern UINT8 h8_register_read8(UINT32 address);
52extern void h8_register_write8(UINT32 address, UINT8 val);
53
5455INLINE UINT32 h8_mem_read32(offs_t address)
5556{
5657   UINT32 result = program_read_word_16be(address) << 16;
r1649r1650
109110
110111static UINT8 h8_or8(UINT8 src, UINT8 dst);
111112static UINT16 h8_or16(UINT16 src, UINT16 dst);
113static UINT32 h8_or32(UINT32 src, UINT32 dst);
112114
113115static UINT8 h8_xor8(UINT8 src, UINT8 dst);
114116static UINT16 h8_xor16(UINT16 src, UINT16 dst);
r1649r1650
120122
121123static INT8 h8_neg8(INT8 src);
122124static INT16 h8_neg16(INT16 src);
125static INT32 h8_neg32(INT32 src);
123126
124127static UINT16 h8_divxu8 (UINT16 dst, UINT8  src);
125128static UINT32 h8_divxu16(UINT32 dst, UINT16 src);
126129
127130static UINT8 h8_not8(UINT8 src);
128131static UINT16 h8_not16(UINT16 src);
132static UINT32 h8_not32(UINT32 src);
129133
130134static UINT8 h8_rotl8(UINT8 src);
131135static UINT16 h8_rotl16(UINT16 src);
136static UINT32 h8_rotl32(UINT32 src);
132137
133138static UINT8 h8_rotxl8(UINT8 src);
134139static UINT16 h8_rotxl16(UINT16 src);
r1649r1650
147152
148153static INT8 h8_shal8(INT8 src);
149154static INT16 h8_shal16(INT16 src);
155static INT32 h8_shal32(INT32 src);
150156
151157static INT8 h8_shar8(INT8 src);
152158static INT16 h8_shar16(INT16 src);
r1649r1650
160166static UINT16 h8_inc16(UINT16 src);
161167static UINT32 h8_inc32(UINT32 src);
162168
163//static UINT8 h8_bnot8(UINT8 src, UINT8 dst);
169static UINT8 h8_bnot8(UINT8 src, UINT8 dst);
164170static UINT8 h8_bst8(UINT8 src, UINT8 dst);
165171static UINT8 h8_bist8(UINT8 src, UINT8 dst);
166172static UINT8 h8_bset8(UINT8 src, UINT8 dst);
r1649r1650
175181
176182/* implementation */
177183
178#ifdef MAME_DEBUG
184#ifdef ENABLE_DEBUGGER
179185extern offs_t h8_disasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
180#endif /* MAME_DEBUG */
186#endif /* ENABLE_DEBUGGER */
181187
182188void h8_3002_InterruptRequest(UINT8 source)
183189{
r1649r1650
343349   h8_itu_init();
344350}
345351
352static void h8_3007_init(int index, int clock, const void *config, int (*irqcallback)(int))
353{
354   h8_init(index, clock, config, irqcallback);
355   h8_3007_itu_init();
356}
357
346358static void h8_reset(void)
347359{
348360   h8.h8err = 0;
r1649r1650
367379
368380   // generate address from vector
369381   h8_set_ccr(h8_get_ccr() | 0x80);
382   if (h8.h8uiflag == 0)
383      h8_set_ccr(h8_get_ccr() | 0x40);
370384   h8.pc = h8_mem_read32(vectornr * 4) & 0xffffff;
371385   change_pc(h8.pc);
372386
r1649r1650
465479   {
466480      h8.ppc = h8.pc;
467481
468#ifdef MAME_DEBUG
469      CALL_MAME_DEBUG;
470#endif
482      CALL_DEBUGGER(h8.pc);
483
471484      opcode = cpu_readop16(h8.pc);
472485//      mame_printf_debug("[%06x]: %04x => %x\n", h8.pc, opcode, (opcode>>12)&0xf);
473486      h8.pc += 2;
r1649r1650
606619         }
607620         else
608621         {
622            dstreg = ext16 & 0x7;
609623            switch((ext16>>8)&0xff)
610624            {
611            case 0x65:
612               dstreg = ext16 & 0x7;
625            case 0x64:   // or.l ERs, ERd
626               udata32 = h8_or32(h8_getreg32((ext16>>4) & 0x7), h8_getreg32(dstreg));
627               break;
628            case 0x65:   // xor.l ERs, ERd
613629               udata32 = h8_xor32(h8_getreg32((ext16>>4) & 0x7), h8_getreg32(dstreg));
614               h8_setreg32(dstreg, udata32);
615               H8_IFETCH_TIMING(2);
616630               break;
617            case 0x66:
618               dstreg = ext16 & 0x7;
631            case 0x66:   // and.l ERs, ERd
619632               udata32 = h8_and32(h8_getreg32((ext16>>4) & 0x7), h8_getreg32(dstreg));
620               h8_setreg32(dstreg, udata32);
621               H8_IFETCH_TIMING(2);
622633               break;
623634            default:
624635               h8.h8err = 1;
625               break;
636               return;
626637            }
638            h8_setreg32(dstreg, udata32);
639            H8_IFETCH_TIMING(2);
627640         }
628641         break;
629642
r1649r1650
10841097         h8_setreg8(opcode & 0xf, udata8);
10851098         H8_IFETCH_TIMING(1);
10861099         break;
1100      case 0x9:
10871101         // shal.w Rx
1088      case 0x9:
10891102         udata16 = h8_getreg16(opcode & 0xf);
10901103         udata16 = h8_shal16(udata16);
10911104         h8_setreg16(opcode & 0xf, udata16);
10921105         H8_IFETCH_TIMING(1);
10931106         break;
1107      case 0xb:
1108         // shal.l ERx
1109         udata32 = h8_getreg32(opcode & 0x7);
1110         udata32 = h8_shal32(udata32);
1111         h8_setreg32(opcode & 0x7, udata32);
1112         H8_IFETCH_TIMING(1);
1113         break;
10941114
10951115      default:
10961116         logerror("H8/3002: Unk. group 1 0 %x\n", opcode);
r1649r1650
11891209         h8_setreg16(opcode & 0xf, udata16);
11901210         H8_IFETCH_TIMING(1);
11911211         break;
1192         // rotl.l Rx
1212      case 0xb:
1213         // rotl.l ERx
1214         udata32 = h8_getreg32(opcode & 0x7);
1215         udata32 = h8_rotl32(udata32);
1216         h8_setreg32(opcode & 0x7, udata32);
1217         H8_IFETCH_TIMING(1);
1218         break;
1219
11931220      default:
11941221         logerror("H8/3002: Unk. group 1 2 %x\n", opcode);
11951222         h8.h8err = 1;
r1649r1650
12581285         h8_setreg16(dstreg, udata16);
12591286         H8_IFETCH_TIMING(1);
12601287         break;
1288      case 0x3:
1289         // not.l ERx
1290         dstreg = opcode & 0x7;
1291         udata32 = h8_not32(h8_getreg32(dstreg));
1292         h8_setreg32(dstreg, udata32);
1293         H8_IFETCH_TIMING(1);
1294         break;
12611295
12621296      case 0x5:
12631297         // extu.w Rx
r1649r1650
12811315         break;
12821316      case 0x8:
12831317         // neg.b Rx
1284         //sprintf(output, "%4.4x neg.b %s", opcode, reg_names8[opcode & 0xf]);
12851318         dstreg = opcode & 0xf;
12861319         sdata8 = h8_neg8(h8_getreg8(dstreg));
12871320         h8_setreg8(dstreg, sdata8);
r1649r1650
12891322         break;
12901323      case 0x9:
12911324         // neg.w Rx
1292         //sprintf(output, "%4.4x neg.w %s", opcode, reg_names16[opcode & 0xf]);
12931325         dstreg = opcode & 0xf;
12941326         sdata16 = h8_neg16(h8_getreg16(dstreg));
12951327         h8_setreg16(dstreg, sdata16);
12961328         H8_IFETCH_TIMING(1);
12971329         break;
1330      case 0xb:
1331         // neg.l ERx
1332         dstreg = opcode & 0x7;
1333         sdata32 = h8_neg32(h8_getreg32(dstreg));
1334         h8_setreg32(dstreg, sdata32);
1335         H8_IFETCH_TIMING(1);
1336         break;
1337      case 0xd:
1338         // exts.w Rx
1339         dstreg = opcode & 0xf;
1340         udata16=h8_getreg16(dstreg)&0xff;
1341         if(udata16&0x80)
1342         {
1343            udata16|=0xff00;
1344         }
1345         h8_setreg16(dstreg, udata16);
1346
1347         h8.h8vflag = 0;
1348         h8.h8nflag = (udata16 & 0xff00) ? 1 : 0;
1349         h8.h8zflag = (udata16) ? 0 : 1;
1350
1351         H8_IFETCH_TIMING(1);
1352         break;
1353
12981354      case 0xf:
12991355         // exts.l Rx
1300         dstreg = opcode & 0xf;
1356         dstreg = opcode & 0x7;
13011357         udata32=h8_getreg32(dstreg)&0xffff;
13021358         if(udata32&0x8000)
13031359         {
r1649r1650
21122168         case 0:   dst32 = h8_mov32(udata32); h8_setreg32(dstreg, dst32); H8_IFETCH_TIMING(3); break;
21132169         case 1: dst32 = h8_add32(udata32, dst32); h8_setreg32(dstreg, dst32); H8_IFETCH_TIMING(3); break;
21142170         case 2: h8_cmp32(udata32, dst32); H8_IFETCH_TIMING(3); break;
2171         case 3: dst32 = h8_sub32(udata32, dst32); h8_setreg32(dstreg, dst32); H8_IFETCH_TIMING(3); break;
2172         case 4: dst32 = h8_or32(udata32, dst32);  h8_setreg32(dstreg, dst32); H8_IFETCH_TIMING(3); break;
2173         case 5: dst32 = h8_xor32(udata32, dst32); h8_setreg32(dstreg, dst32); H8_IFETCH_TIMING(3); break;
21152174         case 6: dst32 = h8_and32(udata32, dst32); h8_setreg32(dstreg, dst32); H8_IFETCH_TIMING(3); break;
21162175         default:
21172176            logerror("H8/3002: Unk. group 7 a2 %x\n", opcode);
r1649r1650
21782237      }
21792238      break;
21802239   case 0xd:
2240      ext16 = h8_mem_read16(h8.pc);
2241      h8.pc += 2;
2242      address24 = h8_getreg32((opcode>>4) & 0x7);
2243      H8_IFETCH_TIMING(2);
2244      H8_BYTE_TIMING(1, address24);
2245      switch(ext16>>8)
21812246      {
2182         UINT8 bitnr;
2183         sdata16 = h8_mem_read16(h8.pc);
2184         h8.pc += 2;
2185         address24 = h8_getreg32((opcode>>4) & 0x7);
2186         udata8 = h8_mem_read8(address24);
2187         bitnr = (sdata16>>4)&7;
2247         // bset/bnot/bclr.b Rn, @ERd
2248         case 0x60:
2249            if (((opcode & 0x8f)!=0)||((ext16 & 0x0f)!=0))   {   h8.h8err=1;   break;   }
2250            h8_mem_write8(address24, h8_bset8(h8_getreg16((ext16>>4)&0xf)&7, h8_mem_read8(address24)));
2251            break;
2252         case 0x61:
2253            if (((opcode & 0x8f)!=0)||((ext16 & 0x0f)!=0))   {   h8.h8err=1;   break;   }
2254            h8_mem_write8(address24, h8_bnot8(h8_getreg16((ext16>>4)&0xf)&7, h8_mem_read8(address24)));
2255            break;
2256         case 0x62:
2257            if (((opcode & 0x8f)!=0)||((ext16 & 0x0f)!=0))   {   h8.h8err=1;   break;   }
2258            h8_mem_write8(address24, h8_bclr8(h8_getreg16((ext16>>4)&0xf)&7, h8_mem_read8(address24)));
2259            break;
21882260
2189         if(((sdata16>>4)&0x8) == 0)
2190         {
2191            switch ((sdata16>>8)&0xff)
2261         case 0x67:   // bst/bist.b #Imm:3, @ERd
2262            if (((opcode & 0x8f)!=0)||((ext16 & 0x0f)!=0))   {   h8.h8err=1;   break;   }
2263            if ((ext16 & 0x80)!=0)
21922264            {
2193               // bset.b #imm, @Rn
2194               case 0x70: udata8 = h8_bset8(bitnr, udata8); h8_mem_write8(address24, udata8); H8_IFETCH_TIMING(2); H8_BYTE_TIMING(2, address24); break;
2195               // bclr.b #imm, @Rn
2196               case 0x72: udata8 = h8_bclr8(bitnr, udata8); h8_mem_write8(address24, udata8); H8_IFETCH_TIMING(2); H8_BYTE_TIMING(2, address24); break;
2197               default:
2198               h8.h8err=1;
2199               logerror("H8/3002: Unk. group 7 cd-1 %x (%x)\n", opcode, (sdata16>>4)&7);
2200               break;
2265               h8_mem_write8(address24, h8_bist8((ext16>>4)&7, h8_mem_read8(address24)));
22012266            }
2202         }
2203         else
2204         {
2205            switch ((sdata16>>8)&7)
2267            else
22062268            {
2207               default:
2208               h8.h8err=1;
2209               logerror("H8/3002: Unk. group 7 cd-2 %x %x\n", opcode, sdata16);
2210               break;
2269               h8_mem_write8(address24, h8_bst8((ext16>>4)&7, h8_mem_read8(address24)));
22112270            }
2212         }
2271            break;
2272
2273         // bset/bnot/bclr.b #Imm:3, @ERd
2274         case 0x70:
2275            if (((opcode & 0x8f)!=0)||((ext16 & 0x8f)!=0))   {   h8.h8err=1;   break;   }
2276            h8_mem_write8(address24, h8_bset8((ext16>>4)&7, h8_mem_read8(address24)));
2277            break;
2278         case 0x71:
2279            if (((opcode & 0x8f)!=0)||((ext16 & 0x8f)!=0))   {   h8.h8err=1;   break;   }
2280            h8_mem_write8(address24, h8_bnot8((ext16>>4)&7, h8_mem_read8(address24)));
2281            break;
2282         case 0x72:
2283            if (((opcode & 0x8f)!=0)||((ext16 & 0x8f)!=0))   {   h8.h8err=1;   break;   }
2284            h8_mem_write8(address24, h8_bclr8((ext16>>4)&7, h8_mem_read8(address24)));
2285            break;
22132286      }
22142287      break;
2288
22152289      // bxxx.b #imm, @aa:8
22162290   case 0xe:
22172291   case 0xf:
r1649r1650
26032677   return res;
26042678}
26052679
2680static UINT32 h8_or32(UINT32 src, UINT32 dst)
2681{
2682   UINT32 res;
2683   res = src | dst;
2684
2685   h8.h8nflag = (res>>31) & 1;
2686   h8.h8vflag = 0;
2687
2688   // zflag
2689   if(res==0)
2690   {
2691      h8.h8zflag = 1;
2692   }
2693   else
2694   {
2695      h8.h8zflag = 0;
2696   }
2697
2698   return res;
2699}
2700
26062701static UINT8 h8_xor8(UINT8 src, UINT8 dst)
26072702{
26082703   UINT8 res;
r1649r1650
27512846   h8.h8cflag = (dst >> bit) & 1;
27522847}
27532848
2754#ifdef UNUSED_FUNCTION
27552849static UINT8 h8_bnot8(UINT8 src, UINT8 dst)
27562850{
2757   UINT8 res;
2758
27592851   // invert single bit, no effect on C flag
2760   res = dst ^ (1<<src);
2761
2762   return res;
2852   return dst ^ (1<<src);
27632853}
2764#endif
27652854
27662855static UINT8 h8_bst8(UINT8 src, UINT8 dst)
27672856{
r1649r1650
28982987   return res;
28992988}
29002989
2990static INT32 h8_neg32(INT32 src)
2991{
2992   INT32 res;
2993
2994   if((UINT32)src == 0x80000000)
2995   {
2996      // overflow !
2997      h8.h8vflag = 1;
2998      res = 0x80000000;
2999   }
3000   else
3001   {
3002      h8.h8vflag = 0;
3003      res = 0-src;
3004   }
3005
3006   // N and Z modified
3007   h8.h8nflag = (res>>31) & 1;
3008   // zflag
3009   if(res==0)
3010   {
3011      h8.h8zflag = 1;
3012   }
3013   else
3014   {
3015      h8.h8zflag = 0;
3016   }
3017
3018   h8.h8hflag = ((src|res)&0x08000000) ? 1 : 0;
3019   h8.h8cflag = ((src|res)&0x80000000) ? 1 : 0;
3020
3021   return res;
3022}
3023
29013024static UINT8 h8_not8(UINT8 src)
29023025{
29033026   UINT8 res;
r1649r1650
29443067   return res;
29453068}
29463069
3070static UINT32 h8_not32(UINT32 src)
3071{
3072   UINT32 res;
3073
3074   res = ~src;
3075
3076   // N and Z modified
3077   h8.h8nflag = (res>>31) & 1;
3078   h8.h8vflag = 0;
3079
3080   // zflag
3081   if(res==0)
3082   {
3083      h8.h8zflag = 1;
3084   }
3085   else
3086   {
3087      h8.h8zflag = 0;
3088   }
3089
3090   return res;
3091}
3092
29473093static UINT8 h8_rotxr8(UINT8 src)
29483094{
29493095   UINT8 res;
r1649r1650
31273273   return res;
31283274}
31293275
3276static UINT32 h8_rotl32(UINT32 src)
3277{
3278   UINT32 res;
3279
3280   // rotate
3281   res = src<<1;
3282   h8.h8cflag = (src>>31) & 1;
3283   res |= (h8.h8cflag & 1);
3284
3285   // N and Z modified
3286   h8.h8nflag = (res>>31) & 1;
3287   h8.h8vflag = 0;
3288
3289   // zflag
3290   if(res==0)
3291   {
3292      h8.h8zflag = 1;
3293   }
3294   else
3295   {
3296      h8.h8zflag = 0;
3297   }
3298
3299   return res;
3300}
3301
31303302static UINT8 h8_shll8(UINT8 src)
31313303{
31323304   UINT8 res;
r1649r1650
33353507   res = src<<1;
33363508   // N and Z modified
33373509   h8.h8nflag = (res>>7)&1;
3338   h8.h8vflag = (((src>>7)&(~src>>6)) | ((~src>>7)&(~src>>6)))&1;
3510   h8.h8vflag = (src ^ res) >> 7;
33393511
33403512   // zflag
33413513   if(res==0)
r1649r1650
33583530   res = src<<1;
33593531   // N and Z modified
33603532   h8.h8nflag = (res>>15)&1;
3361   h8.h8vflag = (((src>>15)&(~src>>14)) | ((~src>>15)&(~src>>14)))&1;
3533   h8.h8vflag = (src ^ res) >> 15;
33623534
33633535   // zflag
33643536   if(res==0)
r1649r1650
33733545   return res;
33743546}
33753547
3548static INT32 h8_shal32(INT32 src)
3549{
3550   INT32 res;
3551
3552   h8.h8cflag = (src>>31)&1;
3553   res = src<<1;
3554   // N and Z modified
3555   h8.h8nflag = (res>>31)&1;
3556   h8.h8vflag = (src ^ res) >> 31;
3557
3558   // zflag
3559   if(res==0)
3560   {
3561      h8.h8zflag = 1;
3562   }
3563   else
3564   {
3565      h8.h8zflag = 0;
3566   }
3567
3568   return res;
3569}
3570
33763571static UINT8 h8_dec8(UINT8 src)
33773572{
33783573   UINT8 res;
r1649r1650
37813976   }
37823977}
37833978
3979static READ16_HANDLER( h8_3007_itu_r )
3980{
3981   if (mem_mask == 0)
3982   {
3983      // 16-bit read
3984      return h8_3007_register_read8(offset*2 + 0xffff20)<<8 | h8_3007_register_read8((offset*2) + 1 + 0xffff20);
3985   }
3986   else if (mem_mask == 0xff)
3987   {
3988      return h8_3007_register_read8(offset*2 + 0xffff20)<<8;
3989   }
3990   else if (mem_mask == 0xff00)
3991   {
3992      return h8_3007_register_read8((offset*2) + 1 + 0xffff20);
3993   }
3994
3995   return 0;
3996}
3997static WRITE16_HANDLER( h8_3007_itu_w )
3998{
3999   if (mem_mask == 0)
4000   {
4001      // 16-bit write
4002      h8_3007_register_write8(offset*2 + 0xffff20, data>>8);
4003      h8_3007_register_write8((offset*2) + 1 + 0xffff20, data&0xff);
4004   }
4005   else if (mem_mask == 0xff)
4006   {
4007      h8_3007_register_write8(offset*2 + 0xffff20, data>>8);
4008   }
4009   else if (mem_mask == 0xff00)
4010   {
4011      h8_3007_register_write8((offset*2) + 1 + 0xffff20, data&0xff);
4012   }
4013}
4014
4015static READ16_HANDLER( h8_3007_itu1_r )
4016{
4017   if (mem_mask == 0)
4018   {
4019      // 16-bit read
4020      return h8_3007_register1_read8(offset*2 + 0xfee000)<<8 | h8_3007_register1_read8((offset*2) + 1 + 0xfee000);
4021   }
4022   else if (mem_mask == 0xff)
4023   {
4024      return h8_3007_register1_read8(offset*2 + 0xfee000)<<8;
4025   }
4026   else if (mem_mask == 0xff00)
4027   {
4028      return h8_3007_register1_read8((offset*2) + 1 + 0xfee000);
4029   }
4030
4031   return 0;
4032}
4033static WRITE16_HANDLER( h8_3007_itu1_w )
4034{
4035   if (mem_mask == 0)
4036   {
4037      // 16-bit write
4038      h8_3007_register1_write8(offset*2 + 0xfee000, data>>8);
4039      h8_3007_register1_write8((offset*2) + 1 + 0xfee000, data&0xff);
4040   }
4041   else if (mem_mask == 0xff)
4042   {
4043      h8_3007_register1_write8(offset*2 + 0xfee000, data>>8);
4044   }
4045   else if (mem_mask == 0xff00)
4046   {
4047      h8_3007_register1_write8((offset*2) + 1 + 0xfee000, data&0xff);
4048   }
4049}
4050
37844051// On-board RAM and peripherals
3785static ADDRESS_MAP_START( h8_internal_map, ADDRESS_SPACE_PROGRAM, 16 )
4052static ADDRESS_MAP_START( h8_3002_internal_map, ADDRESS_SPACE_PROGRAM, 16 )
4053   // 512B RAM
37864054   AM_RANGE(0xfffd10, 0xffff0f) AM_RAM
37874055   AM_RANGE(0xffff10, 0xffffff) AM_READWRITE( h8_itu_r, h8_itu_w )
37884056ADDRESS_MAP_END
37894057
4058static ADDRESS_MAP_START( h8_3044_internal_map, ADDRESS_SPACE_PROGRAM, 16 )
4059   // 32k ROM, 2k RAM
4060   AM_RANGE(0xfff710, 0xffff0f) AM_RAM
4061   AM_RANGE(0xffff1c, 0xffffff) AM_READWRITE( h8_itu_r, h8_itu_w )
4062ADDRESS_MAP_END
4063
4064static ADDRESS_MAP_START( h8_3007_internal_map, ADDRESS_SPACE_PROGRAM, 16 )
4065   // ROM-less, 4k RAM
4066   AM_RANGE(0xfee000, 0xfee0ff) AM_READWRITE( h8_3007_itu1_r, h8_3007_itu1_w )
4067   AM_RANGE(0xffef20, 0xffff1f) AM_RAM
4068   AM_RANGE(0xffff20, 0xffffe9) AM_READWRITE( h8_3007_itu_r, h8_3007_itu_w )
4069ADDRESS_MAP_END
4070
4071
37904072void h8_3002_get_info(UINT32 state, cpuinfo *info)
37914073{
37924074   switch(state) {
r1649r1650
37994081   case CPUINFO_PTR_EXIT:                  info->exit        = 0;                     break;
38004082   case CPUINFO_PTR_EXECUTE:               info->execute     = h8_execute;               break;
38014083   case CPUINFO_PTR_BURN:                  info->burn        = 0;                     break;
3802#ifdef MAME_DEBUG
4084#ifdef ENABLE_DEBUGGER
38034085   case CPUINFO_PTR_DISASSEMBLE:            info->disassemble = h8_disasm;               break;
3804#endif /* MAME_DEBUG */
4086#endif /* ENABLE_DEBUGGER */
38054087   case CPUINFO_PTR_INSTRUCTION_COUNTER:      info->icount      = &h8_cyccnt;               break;
38064088   case CPUINFO_INT_CONTEXT_SIZE:            info->i           = sizeof(h83002_state);      break;
38074089   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:      info->i           = 2;                     break;
r1649r1650
38194101   case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:      info->i = 0;                  break;
38204102
38214103      // Internal maps
3822   case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_h8_internal_map; break;
4104   case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_h8_3002_internal_map; break;
38234105   case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:    info->internal_map = 0;      break;
38244106   case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO:      info->internal_map = 0;      break;
38254107
r1649r1650
38634145   case CPUINFO_STR_REGISTER + H8_E7:         sprintf(info->s, " SP  :%08x", h8.regs[7]);      break;
38644146   }
38654147}
4148
4149void h8_3044_get_info(UINT32 state, cpuinfo *info)
4150{
4151   switch (state)
4152   {
4153      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_h8_3044_internal_map;  break;
4154      case CPUINFO_STR_NAME:            strcpy(info->s, "H8/3044");    break;
4155      default:
4156         h8_3002_get_info(state,info);
4157   }
4158}
4159
4160void h8_3007_get_info(UINT32 state, cpuinfo *info)
4161{
4162   switch (state)
4163   {
4164      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_h8_3007_internal_map;  break;
4165      case CPUINFO_PTR_INIT:            info->init = h8_3007_init;      break;
4166      case CPUINFO_STR_NAME:            strcpy(info->s, "H8/3007");      break;
4167      default:
4168         h8_3002_get_info(state,info);
4169   }
4170}
src/emu/cpu/h83002/h8priv.h
r1649r1650
3636
3737extern h83002_state h8;
3838
39UINT8 h8_register_read8(UINT32 address);
40UINT8 h8_3007_register_read8(UINT32 address);
41UINT8 h8_3007_register1_read8(UINT32 address);
42void h8_register_write8(UINT32 address, UINT8 val);
43void h8_3007_register_write8(UINT32 address, UINT8 val);
44void h8_3007_register1_write8(UINT32 address, UINT8 val);
45
3946void h8_itu_init(void);
47void h8_3007_itu_init(void);
4048void h8_itu_reset(void);
4149UINT8 h8_itu_read8(UINT8 reg);
50UINT8 h8_3007_itu_read8(UINT8 reg);
4251void h8_itu_write8(UINT8 reg, UINT8 val);
52void h8_3007_itu_write8(UINT8 reg, UINT8 val);
4353
4454#endif
src/emu/cpu/h83002/h8periph.c
r1649r1650
349349#endif
350350
351351
352static UINT8 h8_ISR_r(void)
353{
354   UINT8 res = 0;
355
356   int i;
357   for (i = 0; i < 6; i++)
358      if (h8.h8_IRQrequestL & (1 << (12+i)))   res |= (1 << i);
359
360   return res;
361}
362
363static void h8_ISR_w(UINT8 val)
364{
365   int i;
366   for (i = 0; i < 6; i++)
367      if ((~val) & (1 << i))   h8.h8_IRQrequestL &= ~(1 << (12+i));
368}
369
370
352371UINT8 h8_register_read8(UINT32 address)
353372{
354373   UINT8 val;
r1649r1650
428447      case 0xd6:      // port b data
429448         val = io_read_byte_8(H8_PORTB);
430449         break;
450      case 0xf6:
451         val = h8_ISR_r();
452         break;
453
431454      default:
432455         val = h8.per_regs[reg];
433456         break;
r1649r1650
479502      case 0xd6:      // port b data
480503         io_write_byte_8(H8_PORTB, val);
481504         break;
505      case 0xf6:
506         h8_ISR_w(val);
507         break;
482508   }
483509
484510   h8.per_regs[reg] = val;
485511}
486512
513static void h8_3007_itu_refresh_timer(int tnum)
514{
515   attotime period;
516   static const int tscales[4] = { 1, 2, 4, 8 };
517   int ourTCR = h8.per_regs[0x68+(tnum*8)];
518
519   period = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(h8.cpu_number)), tscales[ourTCR & 3]);
520
521   if (ourTCR & 4)
522   {
523      logerror("H8/3007: Timer %d is using an external clock.  Unsupported!\n", tnum);
524   }
525
526   timer_adjust(h8.timer[tnum], period, 0, attotime_zero);
527}
528
529INLINE void h8itu_3007_timer_cb(int tnum)
530{
531   int base = 0x68 + (tnum*8);
532   UINT16 count = (h8.per_regs[base + 0x2]<<8) | h8.per_regs[base + 0x3];
533   count++;
534
535//  logerror("h8/3007 timer %d count = %04x\n",tnum,count);
536
537    // GRA match
538   if ((h8.per_regs[base + 0x1] & 0x03) && (count == ((h8.per_regs[base + 0x4]<<8) | h8.per_regs[base + 0x5])))
539   {
540      if ((h8.per_regs[base + 0x0] & 0x60) == 0x20)
541      {
542//          logerror("h8/3007 timer %d GRA match, restarting\n",tnum);
543         count = 0;
544         h8_3007_itu_refresh_timer(tnum);
545      }
546      else
547      {
548//          logerror("h8/3007 timer %d GRA match, stopping\n",tnum);
549         timer_adjust(h8.timer[tnum], attotime_never, 0, attotime_zero);
550      }
551
552      h8.per_regs[0x64] |= 1<<tnum;
553      if(h8.per_regs[0x64] & (4<<tnum))   // interrupt enable
554      {
555//          logerror("h8/3007 timer %d GRA INTERRUPT\n",tnum);
556         h8_3002_InterruptRequest(24+tnum*4);
557      }
558   }
559   // GRB match
560   if ((h8.per_regs[base + 0x1] & 0x30) && (count == ((h8.per_regs[base + 0x6]<<8) | h8.per_regs[base + 0x7])))
561   {
562      if ((h8.per_regs[base + 0x0] & 0x60) == 0x40)
563      {
564//          logerror("h8/3007 timer %d GRB match, restarting\n",tnum);
565         count = 0;
566         h8_3007_itu_refresh_timer(tnum);
567      }
568      else
569      {
570//          logerror("h8/3007 timer %d GRB match, stopping\n",tnum);
571         timer_adjust(h8.timer[tnum], attotime_never, 0, attotime_zero);
572      }
573
574      h8.per_regs[0x65] |= 1<<tnum;
575      if(h8.per_regs[0x65] & (4<<tnum))   // interrupt enable
576      {
577//          logerror("h8/3007 timer %d GRB INTERRUPT\n",tnum);
578         h8_3002_InterruptRequest(25+tnum*4);
579      }
580   }
581   // Overflow
582   if (((h8.per_regs[base + 0x1] & 0x33) == 0) && (count == 0))
583   {
584//      logerror("h8/3007 timer %d OVF match, restarting\n",tnum);
585      h8.per_regs[0x66] |= 1<<tnum;
586      if(h8.per_regs[0x66] & (4<<tnum))   // interrupt enable
587      {
588//          logerror("h8/3007 timer %d OVF INTERRUPT\n",tnum);
589         h8_3002_InterruptRequest(26+tnum*4);
590      }
591   }
592
593   h8.per_regs[base + 0x2] = count >> 8;
594   h8.per_regs[base + 0x3] = count & 0xff;
595}
596
597static TIMER_CALLBACK( h8itu_3007_timer_0_cb )
598{
599   h8itu_3007_timer_cb(0);
600}
601static TIMER_CALLBACK( h8itu_3007_timer_1_cb )
602{
603   h8itu_3007_timer_cb(1);
604}
605static TIMER_CALLBACK( h8itu_3007_timer_2_cb )
606{
607   h8itu_3007_timer_cb(2);
608}
609
610
611UINT8 h8_3007_itu_read8(UINT8 reg)
612{
613   UINT8 val;
614
615   switch(reg)
616   {
617   case 0x60:
618      val = h8.h8TSTR | 0xf8;
619      break;
620   default:
621      val = h8.per_regs[reg];
622      break;
623   }
624
625   return val;
626}
627
628void h8_3007_itu_write8(UINT8 reg, UINT8 val)
629{
630//  logerror("%06x: h8/3007 reg %02x = %02x\n",activecpu_get_pc(),reg,val);
631   h8.per_regs[reg] = val;
632   switch(reg)
633   {
634   case 0x60:
635      if ((val & 1) && !(h8.h8TSTR & 1))
636      {
637         h8_3007_itu_refresh_timer(0);
638      }
639      if ((val & 2) && !(h8.h8TSTR & 2))
640      {
641         h8_3007_itu_refresh_timer(1);
642      }
643      if ((val & 4) && !(h8.h8TSTR & 4))
644      {
645         h8_3007_itu_refresh_timer(2);
646      }
647      h8.h8TSTR = val;
648      break;
649   default:
650      val = 0;
651      break;
652   }
653}
654
655UINT8 h8_3007_register_read8(UINT32 address)
656{
657   UINT8 val;
658   UINT8 reg;
659
660   address &= 0xffffff;
661
662   reg = address & 0xff;
663
664   if(reg >= 0x60 && reg <= 0x7f)
665   {
666      return h8_3007_itu_read8(reg);
667   }
668   else
669   {
670      switch(reg)
671      {
672      case 0xb4: // serial port A status
673         val = h8.per_regs[reg];
674         val |= 0xc4;      // transmit finished, receive ready, no errors
675         break;
676      case 0xb5: // serial port A receive
677         val = io_read_byte(H8_SERIAL_A);
678         break;
679      case 0xbc: // serial port B status
680         val = h8.per_regs[reg];
681         val |= 0xc4;      // transmit finished, receive ready, no errors
682         break;
683      case 0xbd: // serial port B receive
684         val = io_read_byte(H8_SERIAL_B);
685         break;
686      case 0xe0:
687         val = io_read_byte_8(H8_ADC_0_H);
688         break;
689      case 0xe1:
690         val = io_read_byte_8(H8_ADC_0_L);
691         break;
692      case 0xe2:
693         val = io_read_byte_8(H8_ADC_1_H);
694         break;
695      case 0xe3:
696         val = io_read_byte_8(H8_ADC_1_L);
697         break;
698      case 0xe4:
699         val = io_read_byte_8(H8_ADC_2_H);
700         break;
701      case 0xe5:
702         val = io_read_byte_8(H8_ADC_2_L);
703         break;
704      case 0xe6:
705         val = io_read_byte_8(H8_ADC_3_H);
706         break;
707      case 0xe7:
708         val = io_read_byte_8(H8_ADC_3_L);
709         break;
710      case 0xe8:      // adc status
711         val = 0x80;
712         break;
713
714      case 0xd3:          // port 4 data
715         val = io_read_byte_8(H8_PORT4);
716         break;
717      case 0xd5:          // port 6 data
718         val = io_read_byte_8(H8_PORT6);
719         break;
720      case 0xd6:      // port 7 data
721         val = io_read_byte_8(H8_PORT7);
722         break;
723      case 0xd7:      // port 8 data
724         val = io_read_byte_8(H8_PORT8);
725         break;
726      case 0xd8:      // port 9 data
727         val = io_read_byte_8(H8_PORT9);
728         break;
729      case 0xd9:      // port a data
730         val = io_read_byte_8(H8_PORTA);
731         break;
732      case 0xda:      // port b data
733         val = io_read_byte_8(H8_PORTB);
734         break;
735      default:
736         val = h8.per_regs[reg];
737         break;
738      }
739   }
740
741   return val;
742}
743
744void h8_3007_register_write8(UINT32 address, UINT8 val)
745{
746   UINT8 reg;
747
748   address &= 0xffffff;
749
750   reg = address & 0xff;
751
752   h8.per_regs[reg] = val;
753
754   if(reg >= 0x60 && reg <= 0x7f)
755   {
756      h8_3007_itu_write8(reg, val);
757   }
758   else
759   {
760      switch (reg)
761      {
762         case 0xb3:
763            io_write_byte(H8_SERIAL_A, val);
764            break;
765         case 0xbb:
766            io_write_byte(H8_SERIAL_B, val);
767            break;
768         case 0xd3:
769            io_write_byte_8(H8_PORT4, val);
770            break;
771         case 0xd5:      // port 6 data
772            io_write_byte_8(H8_PORT6, val);
773            break;
774         case 0xd6:      // port 7 data
775            io_write_byte_8(H8_PORT7, val);
776            break;
777         case 0xd7:      // port 8 data
778            io_write_byte_8(H8_PORT8, val);
779            break;
780         case 0xd8:      // port 9 data
781            io_write_byte_8(H8_PORT9, val);
782            break;
783         case 0xd9:      // port a data
784            io_write_byte_8(H8_PORTA, val);
785            break;
786         case 0xda:      // port b data
787            io_write_byte_8(H8_PORTB, val);
788            break;
789      }
790   }
791}
792
793UINT8 h8_3007_register1_read8(UINT32 address)
794{
795   switch (address)
796   {
797      case 0xfee012:   return h8.per_regs[0xF2];   // SYSCR
798      case 0xfee016:   return h8_ISR_r();         // ISR
799      case 0xfee018:   return h8.per_regs[0xF8];   // IPRA
800   }
801
802   logerror("cpu #%d (PC=%08X): unmapped I/O(1) byte read from %08X\n",cpu_getactivecpu(),activecpu_get_pc(),address);
803   return 0;
804}
805
806void h8_3007_register1_write8(UINT32 address, UINT8 val)
807{
808   switch (address)
809   {
810      case 0xfee012:   h8.per_regs[0xF2] = val;   return;   // SYSCR
811      case 0xfee016:   h8_ISR_w(val);            return;   // ISR
812      case 0xfee018:   h8.per_regs[0xF8] = val;   return;   // IPRA
813   }
814   logerror("cpu #%d (PC=%08X): unmapped I/O(1) byte write to %08X = %02X\n",cpu_getactivecpu(),activecpu_get_pc(),address,val);
815}
816
817void h8_3007_itu_init(void)
818{
819   h8.timer[0] = timer_alloc(h8itu_3007_timer_0_cb, NULL);
820   h8.timer[1] = timer_alloc(h8itu_3007_timer_1_cb, NULL);
821   h8.timer[2] = timer_alloc(h8itu_3007_timer_2_cb, NULL);
822
823   h8_itu_reset();
824}
825
487826void h8_itu_init(void)
488827{
489828   h8.timer[0] = timer_alloc(h8itu_timer_0_cb, NULL);
src/emu/cpu/m68000/m68kcpu.h
r1649r1650
494494
495495#if M68K_INSTRUCTION_HOOK
496496   #if M68K_INSTRUCTION_HOOK == OPT_SPECIFY_HANDLER
497      #define m68ki_instr_hook() M68K_INSTRUCTION_CALLBACK()
497      #define m68ki_instr_hook(pc) M68K_INSTRUCTION_CALLBACK(pc)
498498   #else
499      #define m68ki_instr_hook() CALLBACK_INSTR_HOOK()
499      #define m68ki_instr_hook(pc) CALLBACK_INSTR_HOOK(pc)
500500   #endif
501501#else
502502   #define m68ki_instr_hook()
r1649r1650
905905   int  (*tas_instr_callback)(void);                 /* Called when a TAS instruction is encountered, allows / disallows writeback */
906906   void (*pc_changed_callback)(unsigned int new_pc); /* Called when the PC changes by a large amount */
907907   void (*set_fc_callback)(unsigned int new_fc);     /* Called when the CPU function code changes */
908   void (*instr_hook_callback)(void);               /* Called every instruction cycle prior to execution */
908   void (*instr_hook_callback)(unsigned int pc);     /* Called every instruction cycle prior to execution */
909909
910910} m68ki_cpu_core;
911911
src/emu/cpu/m68000/m68kmame.c
r1649r1650
237237   m68k_set_context(src);
238238}
239239
240#ifdef MAME_DEBUG
240#ifdef ENABLE_DEBUGGER
241241static offs_t m68000_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
242242{
243243   M68K_SET_PC_CALLBACK(pc);
244244   return m68k_disassemble_raw(buffer, pc, oprom, opram, M68K_CPU_TYPE_68000);
245245}
246#endif /* MAME_DEBUG */
246#endif /* ENABLE_DEBUGGER */
247247
248248/****************************************************************************
249249 * M68008 section
r1649r1650
286286   m68k_set_context(src);
287287}
288288
289#ifdef MAME_DEBUG
289#ifdef ENABLE_DEBUGGER
290290static offs_t m68008_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
291291{
292292   M68K_SET_PC_CALLBACK(pc);
293293   return m68k_disassemble_raw(buffer, pc, oprom, opram, M68K_CPU_TYPE_68008);
294294}
295#endif /* MAME_DEBUG */
295#endif /* ENABLE_DEBUGGER */
296296
297297#endif /* HAS_M68008 */
298298
r1649r1650
310310   m68k_set_int_ack_callback(irqcallback);
311311}
312312
313#ifdef MAME_DEBUG
313#ifdef ENABLE_DEBUGGER
314314static offs_t m68010_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
315315{
316316   M68K_SET_PC_CALLBACK(pc);
317317   return m68k_disassemble_raw(buffer, pc, oprom, opram, M68K_CPU_TYPE_68010);
318318}
319#endif /* MAME_DEBUG */
319#endif /* ENABLE_DEBUGGER */
320320
321321#endif /* HAS_M68010 */
322322
r1649r1650
360360   m68k_set_context(src);
361361}
362362
363#ifdef MAME_DEBUG
363#ifdef ENABLE_DEBUGGER
364364static offs_t m68020_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
365365{
366366   M68K_SET_PC_CALLBACK(pc);
367367   return m68k_disassemble_raw(buffer, pc, oprom, opram, M68K_CPU_TYPE_68020);
368368}
369#endif /* MAME_DEBUG */
369#endif /* ENABLE_DEBUGGER */
370370
371371
372372/****************************************************************************
r1649r1650
383383   m68k_set_int_ack_callback(irqcallback);
384384}
385385
386#ifdef MAME_DEBUG
386#ifdef ENABLE_DEBUGGER
387387static offs_t m68ec020_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
388388{
389389   M68K_SET_PC_CALLBACK(pc);
390390   return m68k_disassemble_raw(buffer, pc, oprom, opram, M68K_CPU_TYPE_68EC020);
391391}
392#endif /* MAME_DEBUG */
392#endif /* ENABLE_DEBUGGER */
393393
394394#endif /* HAS_M68EC020 */
395395
r1649r1650
434434   m68k_set_context(src);
435435}
436436
437#ifdef MAME_DEBUG
437#ifdef ENABLE_DEBUGGER
438438static offs_t m68040_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
439439{
440440   M68K_SET_PC_CALLBACK(pc);
441441   return m68k_disassemble_raw(buffer, pc, oprom, opram, M68K_CPU_TYPE_68040);
442442}
443#endif /* MAME_DEBUG */
443#endif /* ENABLE_DEBUGGER */
444444
445445#endif /* HAS_M68040 */
446446
r1649r1650
573573      case CPUINFO_PTR_EXIT:                     info->exit = m68000_exit;            break;
574574      case CPUINFO_PTR_EXECUTE:                  info->execute = m68000_execute;         break;
575575      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
576#ifdef MAME_DEBUG
576#ifdef ENABLE_DEBUGGER
577577      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m68000_dasm;      break;
578#endif /* MAME_DEBUG */
578#endif /* ENABLE_DEBUGGER */
579579      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m68k_ICount;         break;
580580
581581      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
753753      case CPUINFO_PTR_EXIT:                     info->exit = m68008_exit;            break;
754754      case CPUINFO_PTR_EXECUTE:                  info->execute = m68008_execute;         break;
755755      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
756#ifdef MAME_DEBUG
756#ifdef ENABLE_DEBUGGER
757757      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m68008_dasm;      break;
758#endif /* MAME_DEBUG */
758#endif /* ENABLE_DEBUGGER */
759759      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m68k_ICount;         break;
760760
761761      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
844844      /* --- the following bits of info are returned as pointers to data or functions --- */
845845      case CPUINFO_PTR_SET_INFO:                  info->setinfo = m68010_set_info;      break;
846846      case CPUINFO_PTR_INIT:                     info->init = m68010_init;            break;
847#ifdef MAME_DEBUG
847#ifdef ENABLE_DEBUGGER
848848      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m68010_dasm;      break;
849#endif /* MAME_DEBUG */
849#endif /* ENABLE_DEBUGGER */
850850      /* --- the following bits of info are returned as NULL-terminated strings --- */
851851      case CPUINFO_STR_NAME:                     strcpy(info->s, "68010");            break;
852852      case CPUINFO_STR_REGISTER + M68K_SFC:         sprintf(info->s, "SFC:%X",   m68k_get_reg(NULL, M68K_REG_SFC)); break;
r1649r1650
994994      case CPUINFO_PTR_EXIT:                     info->exit = m68020_exit;            break;
995995      case CPUINFO_PTR_EXECUTE:                  info->execute = m68020_execute;         break;
996996      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
997#ifdef MAME_DEBUG
997#ifdef ENABLE_DEBUGGER
998998      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m68020_dasm;      break;
999#endif /* MAME_DEBUG */
999#endif /* ENABLE_DEBUGGER */
10001000      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m68k_ICount;         break;
10011001
10021002      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
10871087      /* --- the following bits of info are returned as pointers to data or functions --- */
10881088      case CPUINFO_PTR_SET_INFO:                  info->setinfo = m68ec020_set_info;      break;
10891089      case CPUINFO_PTR_INIT:                     info->init = m68ec020_init;            break;
1090#ifdef MAME_DEBUG
1090#ifdef ENABLE_DEBUGGER
10911091      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m68ec020_dasm;      break;
1092#endif /* MAME_DEBUG */
1092#endif /* ENABLE_DEBUGGER */
10931093
10941094      /* --- the following bits of info are returned as NULL-terminated strings --- */
10951095      case CPUINFO_STR_NAME:                     strcpy(info->s, "68EC020");            break;
r1649r1650
12361236      case CPUINFO_PTR_EXIT:                     info->exit = m68040_exit;            break;
12371237      case CPUINFO_PTR_EXECUTE:                  info->execute = m68040_execute;         break;
12381238      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1239#ifdef MAME_DEBUG
1239#ifdef ENABLE_DEBUGGER
12401240      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m68040_dasm;      break;
1241#endif /* MAME_DEBUG */
1241#endif /* ENABLE_DEBUGGER */
12421242      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m68k_ICount;         break;
12431243
12441244      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/m68000/m68k.h
r1649r1650
274274 * instruction cycle.
275275 * Default behavior: do nothing.
276276 */
277void m68k_set_instr_hook_callback(void  (*callback)(void));
277void m68k_set_instr_hook_callback(void  (*callback)(unsigned int pc));
278278
279279
280280
src/emu/cpu/m68000/m68kmame.h
r1649r1650
55/* ============================== MAME STUFF ============================== */
66/* ======================================================================== */
77
8#include "cpuintrf.h"
98#include "debugger.h"
9#include "deprecat.h"
1010#include "m68000.h"
1111
1212/* Configuration switches (see m68kconf.h for explanation) */
r1649r1650
4141#define M68K_SET_PC_CALLBACK(A)     change_pc(A)
4242
4343#define M68K_INSTRUCTION_HOOK       OPT_SPECIFY_HANDLER
44#define M68K_INSTRUCTION_CALLBACK() CALL_MAME_DEBUG
44#define M68K_INSTRUCTION_CALLBACK(A) CALL_DEBUGGER(A)
4545
4646#define M68K_EMULATE_PREFETCH       OPT_ON
4747
src/emu/cpu/m68000/m68kcpu.c
r1649r1650
500500}
501501
502502/* Called every instruction cycle prior to execution */
503static void default_instr_hook_callback(void)
503static void default_instr_hook_callback(unsigned int pc)
504504{
505505}
506506
r1649r1650
670670   CALLBACK_SET_FC = callback ? callback : default_set_fc_callback;
671671}
672672
673void m68k_set_instr_hook_callback(void  (*callback)(void))
673void m68k_set_instr_hook_callback(void  (*callback)(unsigned int pc))
674674{
675675   CALLBACK_INSTR_HOOK = callback ? callback : default_instr_hook_callback;
676676}
r1649r1650
808808         m68ki_use_data_space(); /* auto-disable (see m68kcpu.h) */
809809
810810         /* Call external hook to peek at CPU */
811         m68ki_instr_hook(); /* auto-disable (see m68kcpu.h) */
811         m68ki_instr_hook(REG_PC); /* auto-disable (see m68kcpu.h) */
812812
813813         /* Record previous program counter */
814814         REG_PPC = REG_PC;
src/emu/cpu/ccpu/ccpu.h
r1649r1650
5050
5151void ccpu_get_info(UINT32 state, cpuinfo *info);
5252
53#ifdef MAME_DEBUG
53#ifdef ENABLE_DEBUGGER
5454offs_t ccpu_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
5555#endif
5656
src/emu/cpu/ccpu/ccpu.c
r1649r1650
99***************************************************************************/
1010
1111#include "debugger.h"
12#include "deprecat.h"
1213#include "ccpu.h"
1314
1415
r1649r1650
186187      ccpu.nextmiflag = ccpu.nextnextmiflag;
187188
188189      /* fetch the opcode */
189      CALL_MAME_DEBUG;
190      CALL_DEBUGGER(ccpu.PC);
190191      opcode = READOP(ccpu.PC++);
191192
192193      switch (opcode)
r1649r1650
765766      case CPUINFO_PTR_EXIT:                     info->exit = NULL;                  break;
766767      case CPUINFO_PTR_EXECUTE:                  info->execute = ccpu_execute;         break;
767768      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
768#ifdef MAME_DEBUG
769#ifdef ENABLE_DEBUGGER
769770      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = ccpu_dasm;         break;
770#endif /* MAME_DEBUG */
771#endif /* ENABLE_DEBUGGER */
771772      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &ccpu_icount;         break;
772773
773774      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/z80gb/z80gb.h
r1649r1650
2525/****************************************************************************/
2626extern void z80gb_get_info(UINT32 state, cpuinfo *info);
2727
28#ifdef MAME_DEBUG
28#ifdef ENABLE_DEBUGGER
2929extern unsigned z80gb_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram );
30#endif /* MAME_DEBUG */
30#endif /* ENABLE_DEBUGGER */
3131
3232#endif
src/emu/cpu/z80gb/z80gb.c
r1649r1650
3636/**   Split fetch and execute cycles.                       **/
3737/**                                                         **/
3838/*************************************************************/
39#include "debugger.h"
40#include "deprecat.h"
3941#include "z80gb.h"
40#include "debugger.h"
4142
4243#define FLAG_Z   0x80
4344#define FLAG_N  0x40
r1649r1650
306307      } else {
307308         /* Fetch and count cycles */
308309         z80gb_ProcessInterrupts ();
309         CALL_MAME_DEBUG;
310         CALL_DEBUGGER(Regs.w.PC);
310311         if ( Regs.w.enable & HALTED ) {
311312            CYCLES_PASSED( Cycles[0x76] );
312313            Regs.w.execution_state = 1;
r1649r1650
465466   case CPUINFO_PTR_EXECUTE:                  info->execute = z80gb_execute;         break;
466467   case CPUINFO_PTR_BURN:                     info->burn = z80gb_burn;                  break;
467468
468#ifdef MAME_DEBUG
469#ifdef ENABLE_DEBUGGER
469470   case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = z80gb_dasm;   break;
470471#endif
471472   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &z80gb_ICount;         break;
src/emu/cpu/tms34010/tms34010.h
r1649r1650
122122#define TOWORD(bitaddr) ((offs_t)(bitaddr) >> 4)
123123
124124
125#ifdef MAME_DEBUG
125#ifdef ENABLE_DEBUGGER
126126offs_t tms34010_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
127127offs_t tms34020_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
128128#endif
src/emu/cpu/tms34010/tms34010.c
r1649r1650
88***************************************************************************/
99
1010#include <stddef.h>
11#include "cpuintrf.h"
1211#include "debugger.h"
12#include "deprecat.h"
13#include "osd_cpu.h"
1314#include "tms34010.h"
1415#include "34010ops.h"
15#include "osd_cpu.h"
16#include "driver.h"
1716
1817
1918/***************************************************************************
r1649r1650
836835   do
837836   {
838837
839      #ifdef   MAME_DEBUG
840      if (Machine->debug_mode) { state.st = GET_ST(); mame_debug_hook(); }
838      #ifdef   ENABLE_DEBUGGER
839      if (Machine->debug_mode) { state.st = GET_ST(); mame_debug_hook(PC); }
841840      #endif
842841      state.op = ROPCODE();
843842      (*opcode_table[state.op >> 4])();
r1649r1650
18651864      case CPUINFO_PTR_EXIT:                     info->exit = tms34010_exit;            break;
18661865      case CPUINFO_PTR_EXECUTE:                  info->execute = tms34010_execute;      break;
18671866      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1868#ifdef MAME_DEBUG
1867#ifdef ENABLE_DEBUGGER
18691868      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tms34010_dasm;      break;
1870#endif /* MAME_DEBUG */
1869#endif /* ENABLE_DEBUGGER */
18711870      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &tms34010_ICount;      break;
18721871
18731872      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
19541953      case CPUINFO_PTR_GET_CONTEXT:               info->getcontext = tms34020_get_context; break;
19551954      case CPUINFO_PTR_SET_CONTEXT:               info->setcontext = tms34020_set_context; break;
19561955      case CPUINFO_PTR_RESET:                     info->reset = tms34020_reset;         break;
1957#ifdef MAME_DEBUG
1956#ifdef ENABLE_DEBUGGER
19581957      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tms34020_dasm;      break;
1959#endif /* MAME_DEBUG */
1958#endif /* ENABLE_DEBUGGER */
19601959
19611960      /* --- the following bits of info are returned as NULL-terminated strings --- */
19621961      case CPUINFO_STR_NAME:                     strcpy(info->s, "TMS34020");         break;
src/emu/cpu/tms32031/32031ops.c
r1649r1650
8585
8686static void illegal(void)
8787{
88#ifdef MAME_DEBUG
88#ifdef ENABLE_DEBUGGER
8989   logerror("Illegal op @ %06X: %08X (tbl=%03X)\n", tms32031.pc - 1, OP, OP >> 21);
9090   DEBUGGER_BREAK;
9191#endif
r1649r1650
100100
101101INLINE void execute_one(void)
102102{
103   CALL_MAME_DEBUG;
103   CALL_DEBUGGER(tms32031.pc);
104104   OP = ROPCODE(tms32031.pc);
105105   tms32031_icount -= 2;   /* 2 clocks per cycle */
106106   tms32031.pc++;
src/emu/cpu/tms32031/tms32031.c
r1649r1650
77***************************************************************************/
88
99#include "debugger.h"
10#include "deprecat.h"
1011#include "tms32031.h"
1112#include "eminline.h"
1213
r1649r1650
519520
520521   while (tms32031_icount > 0)
521522   {
522#ifdef MAME_DEBUG
523#ifdef ENABLE_DEBUGGER
523524   if (IREG(TMR_SP) & 0xff000000)
524525      DEBUGGER_BREAK;
525526#endif
r1649r1650
558559    DISASSEMBLY HOOK
559560***************************************************************************/
560561
561#ifdef MAME_DEBUG
562#ifdef ENABLE_DEBUGGER
562563static offs_t tms32031_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
563564{
564565   UINT32 op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24);
565566   extern unsigned dasm_tms32031(char *, unsigned, UINT32);
566567    return dasm_tms32031(buffer, pc, op);
567568}
568#endif /* MAME_DEBUG */
569#endif /* ENABLE_DEBUGGER */
569570
570571
571572
r1649r1650
815816      case CPUINFO_PTR_EXIT:                     info->exit = tms32031_exit;            break;
816817      case CPUINFO_PTR_EXECUTE:                  info->execute = tms32031_execute;      break;
817818      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
818#ifdef MAME_DEBUG
819#ifdef ENABLE_DEBUGGER
819820      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tms32031_dasm;      break;
820#endif /* MAME_DEBUG */
821#endif /* ENABLE_DEBUGGER */
821822      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &tms32031_icount;      break;
822823      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_internal_32031; break;
823824
src/emu/cpu/cpu.mak
r1649r1650
10191019CPUOBJS += $(CPUOBJ)/m68000/m68kcpu.o $(CPUOBJ)/m68000/m68kmame.o $(CPUOBJ)/m68000/m68kops.o
10201020DBGOBJS += $(CPUOBJ)/m68000/m68kdasm.o
10211021endif
1022M68KMAKE = $(CPUOBJ)/m68000/m68kmake$(EXE)
10221023
10231024# when we compile source files we need to include generated files from the OBJ directory
10241025$(CPUOBJ)/m68000/%.o: $(CPUSRC)/m68000/%.c
r1649r1650
10311032   $(CC) $(CDEFS) $(CFLAGS) -I$(CPUSRC)/m68000 -c $< -o $@
10321033
10331034# rule to generate the C files
1034$(CPUOBJ)/m68000/m68kops.c: $(CPUOBJ)/m68000/m68kmake$(EXE) $(CPUSRC)/m68000/m68k_in.c
1035$(CPUOBJ)/m68000/m68kops.c: $(M68KMAKE) $(CPUSRC)/m68000/m68k_in.c
10351036   @echo Generating M68K source files...
1036   $(CPUOBJ)/m68000/m68kmake$(EXE) $(CPUOBJ)/m68000 $(CPUSRC)/m68000/m68k_in.c
1037   $(M68KMAKE) $(CPUOBJ)/m68000 $(CPUSRC)/m68000/m68k_in.c
10371038
10381039# rule to build the generator
1039$(CPUOBJ)/m68000/m68kmake$(EXE): $(CPUOBJ)/m68000/m68kmake.o $(LIBOCORE)
1040ifneq ($(CROSS_BUILD),1)
1041$(M68KMAKE): $(CPUOBJ)/m68000/m68kmake.o $(LIBOCORE)
10401042   @echo Linking $@...
10411043   $(LD) $(LDFLAGS) $(OSDBGLDFLAGS) $^ $(LIBS) -o $@
1044endif
10421045
10431046# rule to ensure we build the header before building the core CPU file
10441047$(CPUOBJ)/m68000/m68kcpu.o: $(CPUOBJ)/m68000/m68kops.c
r1649r1650
12331236
12341237
12351238#-------------------------------------------------
1239# Nintendo Minx
1240#-------------------------------------------------
1241
1242CPUDEFS += -DHAS_MINX=$(if $(filter MINX,$(CPUS)),1,0)
1243
1244ifneq ($(filter MINX,$(CPUS)),)
1245OBJDIRS += $(CPUOBJ)/minx
1246CPUOBJS += $(CPUOBJ)/minx/minx.o
1247DBGOBJS += $(CPUOBJ)/minx/minxd.o
1248endif
1249
1250$(CPUOBJ)/minx/minx.o:      $(CPUSRC)/minx/minx.c \
1251                     $(CPUSRC)/minx/minx.h \
1252                     $(CPUSRC)/minx/minxd.c \
1253                     $(CPUSRC)/minx/minxopce.h \
1254                     $(CPUSRC)/minx/minxopcf.h \
1255                     $(CPUSRC)/minx/minxops.h \
1256                     $(CPUSRC)/minx/minxfunc.h
1257
1258
1259
1260#-------------------------------------------------
12361261# Nintendo/SGI RSP (R3000-based + vector processing)
12371262#-------------------------------------------------
12381263
r1649r1650
16081633
16091634
16101635#-------------------------------------------------
1636# Game Boy Z-80
1637#-------------------------------------------------
1638
1639CPUDEFS += -DHAS_Z80GB=$(if $(filter Z80GB,$(CPUS)),1,0)
1640
1641ifneq ($(filter Z80GB,$(CPUS)),)
1642OBJDIRS += $(CPUOBJ)/z80gb
1643CPUOBJS += $(CPUOBJ)/z80gb/z80gb.o
1644DBGOBJS += $(CPUOBJ)/z80gb/z80gbd.o
1645endif
1646
1647$(CPUOBJ)/z80gb/z80gb.o:   $(CPUSRC)/z80gb/z80gb.c \
1648                     $(CPUSRC)/z80gb/z80gb.h \
1649                     $(CPUSRC)/z80gb/opc_cb.h \
1650                     $(CPUSRC)/z80gb/opc_main.h
1651
1652
1653
1654#-------------------------------------------------
16111655# Zilog Z180
16121656#-------------------------------------------------
16131657
r1649r1650
16511695                     $(CPUSRC)/z8000/z8000dab.h \
16521696                     $(CPUSRC)/z8000/z8000ops.c \
16531697                     $(CPUSRC)/z8000/z8000tbl.c
1654
1655
1656
1657#-------------------------------------------------
1658# Game Boy Z-80
1659#-------------------------------------------------
1660
1661CPUDEFS += -DHAS_Z80GB=$(if $(filter Z80GB,$(CPUS)),1,0)
1662
1663ifneq ($(filter Z80GB,$(CPUS)),)
1664OBJDIRS += $(CPUOBJ)/z80gb
1665CPUOBJS += $(CPUOBJ)/z80gb/z80gb.o
1666DBGOBJS += $(CPUOBJ)/z80gb/z80gbd.o
1667endif
1668
1669$(CPUOBJ)/z80gb/z80gb.o:   $(CPUSRC)/z80gb/z80gb.c \
1670                     $(CPUSRC)/z80gb/z80gb.h \
1671                     $(CPUSRC)/z80gb/opc_cb.h \
1672                     $(CPUSRC)/z80gb/opc_main.h
1673
1674#-------------------------------------------------
1675# Nintendo Minx
1676#-------------------------------------------------
1677
1678CPUDEFS += -DHAS_MINX=$(if $(filter MINX,$(CPUS)),1,0)
1679
1680ifneq ($(filter MINX,$(CPUS)),)
1681OBJDIRS += $(CPUOBJ)/minx
1682CPUOBJS += $(CPUOBJ)/minx/minx.o
1683DBGOBJS += $(CPUOBJ)/minx/minxd.o
1684endif
1685
1686$(CPUOBJ)/minx/minx.o:      $(CPUSRC)/minx/minx.c \
1687                     $(CPUSRC)/minx/minx.h \
1688                     $(CPUSRC)/minx/minxd.c \
1689                     $(CPUSRC)/minx/minxopce.h \
1690                     $(CPUSRC)/minx/minxopcf.h \
1691                     $(CPUSRC)/minx/minxops.h \
1692                     $(CPUSRC)/minx/minxfunc.h
1693
1694
src/emu/cpu/m37710/m37710.c
r1649r1650
10321032#endif
10331033
10341034/* Disassemble an instruction */
1035#ifdef MAME_DEBUG
1035#ifdef ENABLE_DEBUGGER
10361036#include "m7700ds.h"
10371037
10381038static offs_t m37710_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
10391039{
10401040   return m7700_disassemble(buffer, (pc&0xffff), pc>>16, oprom, FLAG_M, FLAG_X);
10411041}
1042#endif /* MAME_DEBUG */
1042#endif /* ENABLE_DEBUGGER */
10431043
10441044static void m37710_restore_state(void)
10451045{
r1649r1650
12241224      case CPUINFO_PTR_EXIT:                     info->exit = m37710_exit;            break;
12251225      case CPUINFO_PTR_EXECUTE:                  info->execute = m37710_execute;         break;
12261226      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1227#ifdef MAME_DEBUG
1227#ifdef ENABLE_DEBUGGER
12281228      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m37710_dasm;      break;
1229#endif /* MAME_DEBUG */
1229#endif /* ENABLE_DEBUGGER */
12301230      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m37710_ICount;         break;
12311231
12321232      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_m37710_internal_map; break;
src/emu/cpu/m37710/m37710op.h
r1649r1650
29432943      do
29442944      {
29452945         REG_PPC = REG_PC;
2946         M37710_CALL_DEBUGGER;
2946         M37710_CALL_DEBUGGER(REG_PC);
29472947         REG_PC++;
29482948         REG_IR = read_8_IMM(REG_PB | REG_PPC);
29492949         FTABLE_OPCODES[REG_IR]();
src/emu/cpu/m37710/m37710.h
r1649r1650
104104
105105#undef M37710_CALL_DEBUGGER
106106
107#define M37710_CALL_DEBUGGER CALL_MAME_DEBUG
107#define M37710_CALL_DEBUGGER          CALL_DEBUGGER
108108#define m37710_read_8(addr)          program_read_byte_16le(addr)
109109#define m37710_write_8(addr,data)      program_write_byte_16le(addr,data)
110110#define m37710_read_8_immediate(A)      program_read_byte_16le(A)
111111#define m37710_read_16(addr)          program_read_word_16le(addr)
112112#define m37710_write_16(addr,data)      program_write_word_16le(addr,data)
113#define m37710_jumping(A)         change_pc(A)
113#define m37710_jumping(A)            change_pc(A)
114114#define m37710_branching(A)
115115
116116
src/emu/cpu/m37710/m37710cm.h
r1649r1650
1212#include <limits.h>
1313#include "cpuintrf.h"
1414#include "debugger.h"
15#include "deprecat.h"
1516#include "m37710.h"
1617
1718
src/emu/cpu/sharc/sharc.c
r1649r1650
44*/
55
66#include "sharc.h"
7#include "deprecat.h"
78#include "debugger.h"
89
9#ifdef MAME_DEBUG
10#ifdef ENABLE_DEBUGGER
1011static offs_t sharc_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
11#endif /* MAME_DEBUG */
12#endif /* ENABLE_DEBUGGER */
1213
1314static void sharc_dma_exec(int channel);
1415static void check_interrupts(void);
r1649r1650
406407   }
407408}
408409
409#ifdef MAME_DEBUG
410#ifdef ENABLE_DEBUGGER
410411static offs_t sharc_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
411412{
412413   UINT64 op = 0;
r1649r1650
419420   flags = sharc_dasm_one(buffer, pc, op);
420421   return 1 | flags | DASMFLAG_SUPPORTED;
421422}
422#endif /* MAME_DEBUG */
423#endif /* ENABLE_DEBUGGER */
423424
424425
425426static void sharc_init(int index, int clock, const void *config, int (*irqcallback)(int))
r1649r1650
592593      }
593594
594595      sharc_icount = 0;
595      CALL_MAME_DEBUG;
596      CALL_DEBUGGER(sharc.daddr);
596597
597598      return cycles;
598599   }
r1649r1650
627628      // fetch next instruction
628629      sharc.fetch_opcode = ROPCODE(sharc.faddr);
629630
630      CALL_MAME_DEBUG;
631      CALL_DEBUGGER(sharc.pc);
631632
632633      // handle looping
633634      if (sharc.pc == (sharc.laddr & 0xffffff))
r1649r1650
10951096      case CPUINFO_PTR_EXIT:                     info->exit = sharc_exit;            break;
10961097      case CPUINFO_PTR_EXECUTE:                  info->execute = sharc_execute;         break;
10971098      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1098#ifdef MAME_DEBUG
1099#ifdef ENABLE_DEBUGGER
10991100      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = sharc_dasm;         break;
1100#endif /* MAME_DEBUG */
1101#endif /* ENABLE_DEBUGGER */
11011102      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sharc_icount;         break;
11021103      case CPUINFO_PTR_READ:                     info->read = sharc_debug_read;         break;
11031104      case CPUINFO_PTR_READOP:                  info->readop = sharc_debug_readop;      break;
src/emu/cpu/sharc/sharcops.c
r1649r1650
27472747
27482748static void sharcop_unimplemented(void)
27492749{
2750#ifdef MAME_DEBUG
2750#ifdef ENABLE_DEBUGGER
27512751   char dasm[1000];
27522752   sharc_dasm(dasm, sharc.pc, NULL, NULL);
27532753   mame_printf_debug("SHARC: %08X: %s\n", sharc.pc, dasm);
src/emu/cpu/sharc/sharc.h
r1649r1650
2828void adsp21062_get_info(UINT32 state, cpuinfo *info);
2929#endif
3030
31#ifdef MAME_DEBUG
31#ifdef ENABLE_DEBUGGER
3232extern UINT32 sharc_dasm_one(char *buffer, offs_t pc, UINT64 opcode);
3333#endif
3434
src/emu/cpu/z180/z180op.c
r1649r1650
1#if TIME_LOOP_HACKS
21
3#define CHECK_BC_LOOP                                    \
4if( _BC > 1 && _PCD < 0xfffc ) {                           \
5   UINT8 op1 = cpu_readop(_PCD);                           \
6   UINT8 op2 = cpu_readop(_PCD+1);                         \
7   if( (op1==0x78 && op2==0xb1) || (op1==0x79 && op2==0xb0) )      \
8   {                                                \
9      UINT8 op3 = cpu_readop(_PCD+2);                      \
10      UINT8 op4 = cpu_readop(_PCD+3);                      \
11      if( op3==0x20 && op4==0xfb )                        \
12      {                                             \
13         int cnt =                                    \
14            cc[Z180_TABLE_op][0x78] +                     \
15            cc[Z180_TABLE_op][0xb1] +                     \
16            cc[Z180_TABLE_op][0x20] +                     \
17            cc[Z180_TABLE_ex][0x20];                     \
18         while( _BC > 0 && z180_icount > cnt )               \
19         {                                          \
20            BURNODD( cnt, 4, cnt );                      \
21            _BC--;                                    \
22         }                                          \
23      }                                             \
24      else                                          \
25      if( op3 == 0xc2 )                                 \
26      {                                             \
27         UINT8 ad1 = cpu_readop_arg(_PCD+3);                \
28         UINT8 ad2 = cpu_readop_arg(_PCD+4);                \
29         if( (ad1 + 256 * ad2) == (_PCD - 1) )               \
30         {                                          \
31            int cnt =                                 \
32               cc[Z180_TABLE_op][0x78] +                  \
33               cc[Z180_TABLE_op][0xb1] +                  \
34               cc[Z180_TABLE_op][0xc2] +                  \
35               cc[Z180_TABLE_ex][0xc2];                  \
36            while( _BC > 0 && z180_icount > cnt )            \
37            {                                       \
38               BURNODD( cnt, 4, cnt );                   \
39               _BC--;                                 \
40            }                                       \
41         }                                          \
42      }                                             \
43   }                                                \
44}
45
46#define CHECK_DE_LOOP                                    \
47if( _DE > 1 && _PCD < 0xfffc ) {                           \
48   UINT8 op1 = cpu_readop(_PCD);                           \
49   UINT8 op2 = cpu_readop(_PCD+1);                         \
50   if( (op1==0x7a && op2==0xb3) || (op1==0x7b && op2==0xb2) )      \
51   {                                                \
52      UINT8 op3 = cpu_readop(_PCD+2);                      \
53      UINT8 op4 = cpu_readop(_PCD+3);                      \
54      if( op3==0x20 && op4==0xfb )                        \
55      {                                             \
56         int cnt =                                    \
57            cc[Z180_TABLE_op][0x7a] +                     \
58            cc[Z180_TABLE_op][0xb3] +                     \
59            cc[Z180_TABLE_op][0x20] +                     \
60            cc[Z180_TABLE_ex][0x20];                     \
61         while( _DE > 0 && z180_icount > cnt )               \
62         {                                          \
63            BURNODD( cnt, 4, cnt );                      \
64            _DE--;                                    \
65         }                                          \
66      }                                             \
67      else                                          \
68      if( op3==0xc2 )                                  \
69      {                                             \
70         UINT8 ad1 = cpu_readop_arg(_PCD+3);                \
71         UINT8 ad2 = cpu_readop_arg(_PCD+4);                \
72         if( (ad1 + 256 * ad2) == (_PCD - 1) )               \
73         {                                          \
74            int cnt =                                 \
75               cc[Z180_TABLE_op][0x7a] +                  \
76               cc[Z180_TABLE_op][0xb3] +                  \
77               cc[Z180_TABLE_op][0xc2] +                  \
78               cc[Z180_TABLE_ex][0xc2];                  \
79            while( _DE > 0 && z180_icount > cnt )            \
80            {                                       \
81               BURNODD( cnt, 4, cnt );                   \
82               _DE--;                                 \
83            }                                       \
84         }                                          \
85      }                                             \
86   }                                                \
87}
88
89#define CHECK_HL_LOOP                                    \
90if( _HL > 1 && _PCD < 0xfffc ) {                           \
91   UINT8 op1 = cpu_readop(_PCD);                           \
92   UINT8 op2 = cpu_readop(_PCD+1);                         \
93   if( (op1==0x7c && op2==0xb5) || (op1==0x7d && op2==0xb4) )      \
94   {                                                \
95      UINT8 op3 = cpu_readop(_PCD+2);                      \
96      UINT8 op4 = cpu_readop(_PCD+3);                      \
97      if( op3==0x20 && op4==0xfb )                        \
98      {                                             \
99         int cnt =                                    \
100            cc[Z180_TABLE_op][0x7c] +                     \
101            cc[Z180_TABLE_op][0xb5] +                     \
102            cc[Z180_TABLE_op][0x20] +                     \
103            cc[Z180_TABLE_ex][0x20];                     \
104         while( _HL > 0 && z180_icount > cnt )               \
105         {                                          \
106            BURNODD( cnt, 4, cnt );                      \
107            _HL--;                                    \
108         }                                          \
109      }                                             \
110      else                                          \
111      if( op3==0xc2 )                                  \
112      {                                             \
113         UINT8 ad1 = cpu_readop_arg(_PCD+3);                \
114         UINT8 ad2 = cpu_readop_arg(_PCD+4);                \
115         if( (ad1 + 256 * ad2) == (_PCD - 1) )               \
116         {                                          \
117            int cnt =                                 \
118               cc[Z180_TABLE_op][0x7c] +                  \
119               cc[Z180_TABLE_op][0xb5] +                  \
120               cc[Z180_TABLE_op][0xc2] +                  \
121               cc[Z180_TABLE_ex][0xc2];                  \
122            while( _HL > 0 && z180_icount > cnt )            \
123            {                                       \
124               BURNODD( cnt, 4, cnt );                   \
125               _HL--;                                 \
126            }                                       \
127         }                                          \
128      }                                             \
129   }                                                \
130}
131
132#else
133
134#define CHECK_BC_LOOP
135#define CHECK_DE_LOOP
136#define CHECK_HL_LOOP
137
138#endif
139
1402/**********************************************************
1413 * main opcodes
1424 **********************************************************/
r1649r1650
15214OP(op,08) { EX_AF;                                       } /* EX   AF,AF'      */
15315OP(op,09) { ADD16(HL,BC);                                 } /* ADD  HL,BC       */
15416OP(op,0a) { _A = RM(_BC);                                 } /* LD   A,(BC)      */
155OP(op,0b) { _BC--; CHECK_BC_LOOP;                           } /* DEC  BC          */
17OP(op,0b) { _BC--;                                       } /* DEC  BC          */
15618OP(op,0c) { _C = INC(_C);                                 } /* INC  C           */
15719OP(op,0d) { _C = DEC(_C);                                 } /* DEC  C           */
15820OP(op,0e) { _C = ARG();                                  } /* LD   C,n         */
r1649r1650
17032OP(op,18) { JR();                                       } /* JR   o           */
17133OP(op,19) { ADD16(HL,DE);                                 } /* ADD  HL,DE       */
17234OP(op,1a) { _A = RM(_DE);                                 } /* LD   A,(DE)      */
173OP(op,1b) { _DE--; CHECK_DE_LOOP;                           } /* DEC  DE          */
35OP(op,1b) { _DE--;            ;                           } /* DEC  DE          */
17436OP(op,1c) { _E = INC(_E);                                 } /* INC  E           */
17537OP(op,1d) { _E = DEC(_E);                                 } /* DEC  E           */
17638OP(op,1e) { _E = ARG();                                  } /* LD   E,n         */
r1649r1650
18850OP(op,28) { JR_COND( _F & ZF, 0x28 );                        } /* JR   Z,o         */
18951OP(op,29) { ADD16(HL,HL);                                 } /* ADD  HL,HL       */
19052OP(op,2a) { EA = ARG16(); RM16( EA, &Z180.HL );                } /* LD   HL,(w)      */
191OP(op,2b) { _HL--; CHECK_HL_LOOP;                           } /* DEC  HL          */
53OP(op,2b) { _HL--;                                       } /* DEC  HL          */
19254OP(op,2c) { _L = INC(_L);                                 } /* INC  L           */
19355OP(op,2d) { _L = DEC(_L);                                 } /* DEC  L           */
19456OP(op,2e) { _L = ARG();                                  } /* LD   L,n         */
src/emu/cpu/z180/z180.c
r1649r1650
4444 *****************************************************************************/
4545
4646#include "debugger.h"
47#include "deprecat.h"
4748#include "z180.h"
4849#include "cpu/z80/z80daisy.h"
4950
r1649r1650
5960/* use big flag arrays (4*64K) for ADD/ADC/SUB/SBC/CP results */
6061#define BIG_FLAGS_ARRAY    1
6162
62/* Set to 1 for a more exact (but somewhat slower) Z180 emulation */
63#define Z180_EXACT         1
64
65/* on JP and JR opcodes check for tight loops */
66#define BUSY_LOOP_HACKS    0
67
68/* check for delay loops counting down BC */
69#define TIME_LOOP_HACKS    0
70
7163static void set_irq_line(int irqline, int state);
7264
7365/****************************************************************************/
r1649r1650
748740static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */
749741
750742#if BIG_FLAGS_ARRAY
751static UINT8 *SZHVC_add = 0;
752static UINT8 *SZHVC_sub = 0;
743static UINT8 *SZHVC_add;
744static UINT8 *SZHVC_sub;
753745#endif
754746
755747/****************************************************************************
r1649r1650
19121904   int (*save_irqcallback)(int);
19131905   int i, p;
19141906#if BIG_FLAGS_ARRAY
1915   if( !SZHVC_add || !SZHVC_sub )
1907   int oldval, newval, val;
1908   UINT8 *padd, *padc, *psub, *psbc;
1909   /* allocate big flag arrays once */
1910   SZHVC_add = (UINT8 *)auto_malloc(2*256*256);
1911   SZHVC_sub = (UINT8 *)auto_malloc(2*256*256);
1912   padd = &SZHVC_add[   0*256];
1913   padc = &SZHVC_add[256*256];
1914   psub = &SZHVC_sub[   0*256];
1915   psbc = &SZHVC_sub[256*256];
1916   for (oldval = 0; oldval < 256; oldval++)
19161917   {
1917      int oldval, newval, val;
1918      UINT8 *padd, *padc, *psub, *psbc;
1919      /* allocate big flag arrays once */
1920      SZHVC_add = (UINT8 *)auto_malloc(2*256*256);
1921      SZHVC_sub = (UINT8 *)auto_malloc(2*256*256);
1922      padd = &SZHVC_add[   0*256];
1923      padc = &SZHVC_add[256*256];
1924      psub = &SZHVC_sub[   0*256];
1925      psbc = &SZHVC_sub[256*256];
1926      for (oldval = 0; oldval < 256; oldval++)
1918      for (newval = 0; newval < 256; newval++)
19271919      {
1928         for (newval = 0; newval < 256; newval++)
1929         {
1930            /* add or adc w/o carry set */
1931            val = newval - oldval;
1932            *padd = (newval) ? ((newval & 0x80) ? SF : 0) : ZF;
1933#if Z180_EXACT
1934            *padd |= (newval & (YF | XF));   /* undocumented flag bits 5+3 */
1935#endif
1936            if( (newval & 0x0f) < (oldval & 0x0f) ) *padd |= HF;
1937            if( newval < oldval ) *padd |= CF;
1938            if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padd |= VF;
1939            padd++;
1920         /* add or adc w/o carry set */
1921         val = newval - oldval;
1922         *padd = (newval) ? ((newval & 0x80) ? SF : 0) : ZF;
1923         *padd |= (newval & (YF | XF));   /* undocumented flag bits 5+3 */
19401924
1941            /* adc with carry set */
1942            val = newval - oldval - 1;
1943            *padc = (newval) ? ((newval & 0x80) ? SF : 0) : ZF;
1944#if Z180_EXACT
1945            *padc |= (newval & (YF | XF));   /* undocumented flag bits 5+3 */
1946#endif
1947            if( (newval & 0x0f) <= (oldval & 0x0f) ) *padc |= HF;
1948            if( newval <= oldval ) *padc |= CF;
1949            if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padc |= VF;
1950            padc++;
1925         if( (newval & 0x0f) < (oldval & 0x0f) ) *padd |= HF;
1926         if( newval < oldval ) *padd |= CF;
1927         if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padd |= VF;
1928         padd++;
19511929
1952            /* cp, sub or sbc w/o carry set */
1953            val = oldval - newval;
1954            *psub = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF);
1955#if Z180_EXACT
1956            *psub |= (newval & (YF | XF));   /* undocumented flag bits 5+3 */
1957#endif
1958            if( (newval & 0x0f) > (oldval & 0x0f) ) *psub |= HF;
1959            if( newval > oldval ) *psub |= CF;
1960            if( (val^oldval) & (oldval^newval) & 0x80 ) *psub |= VF;
1961            psub++;
1930         /* adc with carry set */
1931         val = newval - oldval - 1;
1932         *padc = (newval) ? ((newval & 0x80) ? SF : 0) : ZF;
1933         *padc |= (newval & (YF | XF));   /* undocumented flag bits 5+3 */
1934         if( (newval & 0x0f) <= (oldval & 0x0f) ) *padc |= HF;
1935         if( newval <= oldval ) *padc |= CF;
1936         if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padc |= VF;
1937         padc++;
19621938
1963            /* sbc with carry set */
1964            val = oldval - newval - 1;
1965            *psbc = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF);
1966#if Z180_EXACT
1967            *psbc |= (newval & (YF | XF));   /* undocumented flag bits 5+3 */
1968#endif
1969            if( (newval & 0x0f) >= (oldval & 0x0f) ) *psbc |= HF;
1970            if( newval >= oldval ) *psbc |= CF;
1971            if( (val^oldval) & (oldval^newval) & 0x80 ) *psbc |= VF;
1972            psbc++;
1973         }
1939         /* cp, sub or sbc w/o carry set */
1940         val = oldval - newval;
1941         *psub = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF);
1942         *psub |= (newval & (YF | XF));   /* undocumented flag bits 5+3 */
1943         if( (newval & 0x0f) > (oldval & 0x0f) ) *psub |= HF;
1944         if( newval > oldval ) *psub |= CF;
1945         if( (val^oldval) & (oldval^newval) & 0x80 ) *psub |= VF;
1946         psub++;
1947
1948         /* sbc with carry set */
1949         val = oldval - newval - 1;
1950         *psbc = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF);
1951         *psbc |= (newval & (YF | XF));   /* undocumented flag bits 5+3 */
1952         if( (newval & 0x0f) >= (oldval & 0x0f) ) *psbc |= HF;
1953         if( newval >= oldval ) *psbc |= CF;
1954         if( (val^oldval) & (oldval^newval) & 0x80 ) *psbc |= VF;
1955         psbc++;
19741956      }
19751957   }
19761958#endif
r1649r1650
19861968      if( i&0x40 ) ++p;
19871969      if( i&0x80 ) ++p;
19881970      SZ[i] = i ? i & SF : ZF;
1989#if Z180_EXACT
19901971      SZ[i] |= (i & (YF | XF));      /* undocumented flag bits 5+3 */
1991#endif
19921972      SZ_BIT[i] = i ? i & SF : ZF | PF;
1993#if Z180_EXACT
19941973      SZ_BIT[i] |= (i & (YF | XF));   /* undocumented flag bits 5+3 */
1995#endif
19961974      SZP[i] = SZ[i] | ((p & 1) ? 0 : PF);
19971975      SZHV_inc[i] = SZ[i];
19981976      if( i == 0x80 ) SZHV_inc[i] |= VF;
r1649r1650
22012179      if ((IO_DSTAT & Z180_DSTAT_DE0) == Z180_DSTAT_DE0 &&
22022180         (IO_DMODE & Z180_DMODE_MMOD) == Z180_DMODE_MMOD)
22032181      {
2204         CALL_MAME_DEBUG;
2182         CALL_DEBUGGER(_PCD);
22052183
22062184         z180_dma0();
22072185         old_icount = handle_timers(z180_icount, old_icount);
r1649r1650
22142192            Z180.after_EI = 0;
22152193
22162194            _PPC = _PCD;
2217            CALL_MAME_DEBUG;
2195            CALL_DEBUGGER(_PCD);
22182196            _R++;
22192197
22202198            EXEC_INLINE(op,ROP());
r1649r1650
22412219         Z180.after_EI = 0;
22422220
22432221         _PPC = _PCD;
2244         CALL_MAME_DEBUG;
2222         CALL_DEBUGGER(_PCD);
22452223         _R++;
22462224         EXEC_INLINE(op,ROP());
22472225         old_icount = handle_timers(z180_icount, old_icount);
r1649r1650
25792557      case CPUINFO_PTR_RESET:                     info->reset = z180_reset;            break;
25802558      case CPUINFO_PTR_EXECUTE:                  info->execute = z180_execute;         break;
25812559      case CPUINFO_PTR_BURN:                     info->burn = z180_burn;               break;
2582#ifdef MAME_DEBUG
2560#ifdef ENABLE_DEBUGGER
25832561      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = z180_dasm;         break;
2584#endif /* MAME_DEBUG */
2562#endif /* ENABLE_DEBUGGER */
25852563      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &z180_icount;         break;
25862564      case CPUINFO_PTR_TRANSLATE:                  info->translate = z180_translate;      break;
25872565      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op: info->p = (void *)cc[Z180_TABLE_op];         break;
r1649r1650
25942572      /* --- the following bits of info are returned as NULL-terminated strings --- */
25952573      case CPUINFO_STR_NAME:                     strcpy(info->s, "Z180");            break;
25962574      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Zilog Z8x180");      break;
2597      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.3");               break;
2575      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.4");               break;
25982576      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
25992577      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
26002578
src/emu/cpu/z180/z180.h
r1649r1650
127127
128128extern void z180_get_info(UINT32 state, cpuinfo *info);
129129
130#ifdef MAME_DEBUG
130#ifdef ENABLE_DEBUGGER
131131offs_t z180_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
132132#endif
133133
src/emu/cpu/z180/z180ops.h
r1649r1650
163163/***************************************************************
164164 * JP
165165 ***************************************************************/
166#if BUSY_LOOP_HACKS
167166#define JP {                                       \
168   unsigned oldpc = _PCD-1;                           \
169167   _PCD = ARG16();                                  \
170168   z180_change_pc(_PCD);                              \
171   /* speed up busy loop */                           \
172   if( _PCD == oldpc )                               \
173   {                                             \
174      if( !Z180.after_EI )                            \
175         BURNODD( z180_icount, 1, cc[Z180_TABLE_op][0xc3] ); \
176   }                                             \
177   else                                          \
178   {                                             \
179      UINT8 op = cpu_readop(_PCD);                     \
180      if( _PCD == oldpc-1 )                           \
181      {                                          \
182         /* NOP - JP $-1 or EI - JP $-1 */               \
183         if ( op == 0x00 || op == 0xfb )                \
184         {                                       \
185            if( !Z180.after_EI )                      \
186               BURNODD( z180_icount-cc[Z180_TABLE_op][0x00],\
187                  2, cc[Z180_TABLE_op][0x00]+cc[Z180_TABLE_op][0xc3]); \
188         }                                       \
189      }                                          \
190      else                                       \
191      /* LD SP,#xxxx - JP $-3 (Galaga) */                \
192      if( _PCD == oldpc-3 && op == 0x31 )                \
193      {                                          \
194         if( !Z180.after_EI )                         \
195            BURNODD( z180_icount-cc[Z180_TABLE_op][0x31],   \
196               2, cc[Z180_TABLE_op][0x31]+cc[Z180_TABLE_op][0xc3]); \
197      }                                          \
198   }                                             \
199169}
200#else
201#define JP {                                       \
202   _PCD = ARG16();                                  \
203   z180_change_pc(_PCD);                              \
204}
205#endif
206170
207171/***************************************************************
208172 * JP_COND
r1649r1650
392356/***************************************************************
393357 * RLCA
394358 ***************************************************************/
395#if Z180_EXACT
396359#define RLCA                                       \
397360   _A = (_A << 1) | (_A >> 7);                         \
398361   _F = (_F & (SF | ZF | PF)) | (_A & (YF | XF | CF))
399#else
400#define RLCA                                       \
401   _A = (_A << 1) | (_A >> 7);                         \
402   _F = (_F & (SF | ZF | YF | XF | PF)) | (_A & CF)
403#endif
404362
405363/***************************************************************
406364 * RRCA
407365 ***************************************************************/
408#if Z180_EXACT
409366#define RRCA                                       \
410367   _F = (_F & (SF | ZF | PF)) | (_A & (YF | XF | CF));       \
411368   _A = (_A >> 1) | (_A << 7)
412#else
413#define RRCA                                       \
414   _F = (_F & (SF | ZF | YF | XF | PF)) | (_A & CF);         \
415   _A = (_A >> 1) | (_A << 7)
416#endif
417369
418370/***************************************************************
419371 * RLA
420372 ***************************************************************/
421#if Z180_EXACT
422373#define RLA {                                       \
423374   UINT8 res = (_A << 1) | (_F & CF);                     \
424375   UINT8 c = (_A & 0x80) ? CF : 0;                      \
425376   _F = (_F & (SF | ZF | PF)) | c | (res & (YF | XF));       \
426377   _A = res;                                       \
427378}
428#else
429#define RLA {                                       \
430   UINT8 res = (_A << 1) | (_F & CF);                     \
431   UINT8 c = (_A & 0x80) ? CF : 0;                      \
432   _F = (_F & (SF | ZF | YF | XF | PF)) | c;               \
433   _A = res;                                       \
434}
435#endif
436379
437380/***************************************************************
438381 * RRA
439382 ***************************************************************/
440#if Z180_EXACT
441383#define RRA {                                       \
442384   UINT8 res = (_A >> 1) | (_F << 7);                     \
443385   UINT8 c = (_A & 0x01) ? CF : 0;                      \
444386   _F = (_F & (SF | ZF | PF)) | c | (res & (YF | XF));       \
445387   _A = res;                                       \
446388}
447#else
448#define RRA {                                       \
449   UINT8 res = (_A >> 1) | (_F << 7);                     \
450   UINT8 c = (_A & 0x01) ? CF : 0;                      \
451   _F = (_F & (SF | ZF | YF | XF | PF)) | c;               \
452   _A = res;                                       \
453}
454#endif
455389
456390/***************************************************************
457391 * RRD
r1649r1650
811745/***************************************************************
812746 * BIT  bit,(IX/Y+o)
813747 ***************************************************************/
814#if Z180_EXACT
815748#define BIT_XY(bit,reg)                               \
816749   _F = (_F & CF) | HF | (SZ_BIT[reg & (1<<bit)] & ~(YF|XF)) | ((EA>>8) & (YF|XF))
817#else
818#define BIT_XY   BIT
819#endif
820750
821751/***************************************************************
822752 * RES  bit,r8
r1649r1650
837767/***************************************************************
838768 * LDI
839769 ***************************************************************/
840#if Z180_EXACT
841770#define LDI {                                       \
842771   UINT8 io = RM(_HL);                               \
843772   WM( _DE, io );                                    \
r1649r1650
847776   _HL++; _DE++; _BC--;                              \
848777   if( _BC ) _F |= VF;                               \
849778}
850#else
851#define LDI {                                       \
852   WM( _DE, RM(_HL) );                               \
853   _F &= SF | ZF | YF | XF | CF;                        \
854   _HL++; _DE++; _BC--;                              \
855   if( _BC ) _F |= VF;                               \
856}
857#endif
858779
859780/***************************************************************
860781 * CPI
861782 ***************************************************************/
862#if Z180_EXACT
863783#define CPI {                                       \
864784   UINT8 val = RM(_HL);                              \
865785   UINT8 res = _A - val;                              \
r1649r1650
870790   if( res & 0x08 ) _F |= XF; /* bit 3 -> flag 3 */         \
871791   if( _BC ) _F |= VF;                               \
872792}
873#else
874#define CPI {                                       \
875   UINT8 val = RM(_HL);                              \
876   UINT8 res = _A - val;                              \
877   _HL++; _BC--;                                    \
878   _F = (_F & CF) | SZ[res] | ((_A ^ val ^ res) & HF) | NF;   \
879   if( _BC ) _F |= VF;                               \
880}
881#endif
882793
883794/***************************************************************
884795 * INI
885796 ***************************************************************/
886#if Z180_EXACT
887797#define INI {                                       \
888798   UINT8 io = IN(_BC);                               \
889799   _B--;                                          \
r1649r1650
898808       (io >> 2)) & 1 )                              \
899809      _F |= PF;                                    \
900810}
901#else
902#define INI {                                       \
903   _B--;                                          \
904   WM( _HL, IN(_BC) );                               \
905   _HL++;                                          \
906   _F = (_B) ? NF : NF | ZF;                           \
907}
908#endif
909811
910812/***************************************************************
911813 * OUTI
912814 ***************************************************************/
913#if Z180_EXACT
914815#define OUTI {                                       \
915816   UINT8 io = RM(_HL);                               \
916817   _B--;                                          \
r1649r1650
925826       (io >> 2)) & 1 )                              \
926827      _F |= PF;                                    \
927828}
928#else
929#define OUTI {                                       \
930   _B--;                                          \
931   OUT( _BC, RM(_HL) );                              \
932   _HL++;                                          \
933   _F = (_B) ? NF : NF | ZF;                           \
934}
935#endif
936829
937830/***************************************************************
938831 * LDD
939832 ***************************************************************/
940#if Z180_EXACT
941833#define LDD {                                       \
942834   UINT8 io = RM(_HL);                               \
943835   WM( _DE, io );                                    \
r1649r1650
947839   _HL--; _DE--; _BC--;                              \
948840   if( _BC ) _F |= VF;                               \
949841}
950#else
951#define LDD {                                       \
952   WM( _DE, RM(_HL) );                               \
953   _F &= SF | ZF | YF | XF | CF;                        \
954   _HL--; _DE--; _BC--;                              \
955   if( _BC ) _F |= VF;                               \
956}
957#endif
958842
959843/***************************************************************
960844 * CPD
961845 ***************************************************************/
962#if Z180_EXACT
963846#define CPD {                                       \
964847   UINT8 val = RM(_HL);                              \
965848   UINT8 res = _A - val;                              \
r1649r1650
970853   if( res & 0x08 ) _F |= XF; /* bit 3 -> flag 3 */         \
971854   if( _BC ) _F |= VF;                               \
972855}
973#else
974#define CPD {                                       \
975   UINT8 val = RM(_HL);                              \
976   UINT8 res = _A - val;                              \
977   _HL--; _BC--;                                    \
978   _F = (_F & CF) | SZ[res] | ((_A ^ val ^ res) & HF) | NF;   \
979   if( _BC ) _F |= VF;                               \
980}
981#endif
982856
983857/***************************************************************
984858 * IND
985859 ***************************************************************/
986#if Z180_EXACT
987860#define IND {                                       \
988861   UINT8 io = IN(_BC);                               \
989862   _B--;                                          \
r1649r1650
998871       (io >> 2)) & 1 )                              \
999872      _F |= PF;                                    \
1000873}
1001#else
1002#define IND {                                       \
1003   _B--;                                          \
1004   WM( _HL, IN(_BC) );                               \
1005   _HL--;                                          \
1006   _F = (_B) ? NF : NF | ZF;                           \
1007}
1008#endif
1009874
1010875/***************************************************************
1011876 * OUTD
1012877 ***************************************************************/
1013#if Z180_EXACT
1014878#define OUTD {                                       \
1015879   UINT8 io = RM(_HL);                               \
1016880   _B--;                                          \
r1649r1650
1025889       (io >> 2)) & 1 )                              \
1026890      _F |= PF;                                    \
1027891}
1028#else
1029#define OUTD {                                       \
1030   _B--;                                          \
1031   OUT( _BC, RM(_HL) );                              \
1032   _HL--;                                          \
1033   _F = (_B) ? NF : NF | ZF;                           \
1034}
1035#endif
1036892
1037893/***************************************************************
1038894 * LDIR
src/emu/cpu/z180/z180tbl.h
r1649r1650
1#if Z180_EXACT
21/* tmp1 value for ini/inir/outi/otir for [C.1-0][io.1-0] */
32static const UINT8 irep_tmp1[4][4] = {
43   {0,0,1,0},{0,1,0,1},{1,0,1,1},{0,1,1,0}
r1649r1650
2827   1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,
2928   1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1
3029};
31#endif
3230
3331static const UINT8 cc_op[0x100] = {
3432/*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */
src/emu/cpu/i86/i86.c
r1649r1650
44****************************************************************************/
55/* 26.March 2000 PeT changed set_irq_line */
66
7#include "host.h"
87#include "debugger.h"
8#include "deprecat.h"
99
10#include "host.h"
1011#include "i86.h"
1112#include "i86intf.h"
1213
r1649r1650
243244      LOG(("[%04x:%04x]=%02x\tF:%04x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x %d%d%d%d%d%d%d%d%d\n",
244245            I.sregs[CS], I.pc - I.base[CS], ReadByte(I.pc), I.flags, I.regs.w[AX], I.regs.w[BX], I.regs.w[CX], I.regs.w[DX], I.AuxVal ? 1 : 0, I.OverVal ? 1 : 0,
245246            I.SignVal ? 1 : 0, I.ZeroVal ? 1 : 0, I.CarryVal ? 1 : 0, I.ParityVal ? 1 : 0, I.TF, I.IF, I.DirVal < 0 ? 1 : 0));
246      CALL_MAME_DEBUG;
247      CALL_DEBUGGER(I.pc);
247248
248249      seg_prefix = FALSE;
249250      I.prevpc = I.pc;
r1649r1650
258259}
259260
260261
261#ifdef MAME_DEBUG
262#ifdef ENABLE_DEBUGGER
262263static offs_t i8086_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
263264{
264265   return i386_dasm_one(buffer, pc, oprom, 16);
265266}
266#endif /* MAME_DEBUG */
267#endif /* ENABLE_DEBUGGER */
267268
268269
269270#if (HAS_I80186 || HAS_I80188)
r1649r1650
298299   {
299300      LOG(("[%04x:%04x]=%02x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x\n", I.sregs[CS], I.pc, ReadByte(I.pc), I.regs.w[AX],
300301            I.regs.w[BX], I.regs.w[CX], I.regs.w[DX]));
301      CALL_MAME_DEBUG;
302      CALL_DEBUGGER(I.pc);
302303
303304      seg_prefix = FALSE;
304305      I.prevpc = I.pc;
r1649r1650
435436      case CPUINFO_PTR_EXIT:                     info->exit = i8086_exit;            break;
436437      case CPUINFO_PTR_EXECUTE:                  info->execute = i8086_execute;         break;
437438      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
438#ifdef MAME_DEBUG
439#ifdef ENABLE_DEBUGGER
439440      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = i8086_dasm;         break;
440#endif /* MAME_DEBUG */
441#endif /* ENABLE_DEBUGGER */
441442      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &i8086_ICount;         break;
442443
443444      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/i86/i286.c
r1649r1650
33*               (initial work based on David Hedley's pcemu)                *
44****************************************************************************/
55
6#include "debugger.h"
7#include "deprecat.h"
68#include "host.h"
7#include "debugger.h"
89
910
1011#define VERBOSE 0
r1649r1650
223224   while(i80286_ICount>0)
224225   {
225226      LOG(("[%04x:%04x]=%02x\tF:%04x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x %d%d%d%d%d%d%d%d%d\n",I.sregs[CS],I.pc - I.base[CS],ReadByte(I.pc),I.flags,I.regs.w[AX],I.regs.w[BX],I.regs.w[CX],I.regs.w[DX], I.AuxVal?1:0, I.OverVal?1:0, I.SignVal?1:0, I.ZeroVal?1:0, I.CarryVal?1:0, I.ParityVal?1:0,I.TF, I.IF, I.DirVal<0?1:0));
226      CALL_MAME_DEBUG;
227      CALL_DEBUGGER(I.pc);
227228
228229      seg_prefix=FALSE;
229230      I.prevpc = I.pc;
r1649r1650
240241
241242extern int i386_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, int mode);
242243
243#ifdef MAME_DEBUG
244#ifdef ENABLE_DEBUGGER
244245static offs_t i80286_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
245246{
246247   return i386_dasm_one(buffer, pc, oprom, 16);
247248}
248#endif /* MAME_DEBUG */
249#endif /* ENABLE_DEBUGGER */
249250
250251static void i80286_init(int index, int clock, const void *config, int (*irqcallback)(int))
251252{
r1649r1650
443444      case CPUINFO_PTR_EXIT:                     info->exit = NULL;                  break;
444445      case CPUINFO_PTR_EXECUTE:                  info->execute = i80286_execute;         break;
445446      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
446#ifdef MAME_DEBUG
447#ifdef ENABLE_DEBUGGER
447448      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = i80286_dasm;      break;
448#endif /* MAME_DEBUG */
449#endif /* ENABLE_DEBUGGER */
449450      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &i80286_ICount;         break;
450451
451452      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/upd7810/upd7810.c
r1649r1650
397397
398398#include "debugger.h"
399399#include "upd7810.h"
400#include "deprecat.h"
400401
401402static UPD7810 upd7810;
402403static int upd7810_icount;
r1649r1650
16201621   {
16211622      int cc = 0;
16221623
1623      CALL_MAME_DEBUG;
1624      CALL_DEBUGGER(PC);
16241625
16251626      PPC = PC;
16261627      RDOP(OP);
r1649r1650
19181919      case CPUINFO_PTR_EXIT:                     info->exit = upd7810_exit;            break;
19191920      case CPUINFO_PTR_EXECUTE:                  info->execute = upd7810_execute;      break;
19201921      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1921#ifdef MAME_DEBUG
1922#ifdef ENABLE_DEBUGGER
19221923      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = upd7810_dasm;      break;
1923#endif /* MAME_DEBUG */
1924#endif /* ENABLE_DEBUGGER */
19241925      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &upd7810_icount;         break;
19251926
19261927      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
20062007   {
20072008      /* --- the following bits of info are returned as pointers to data or functions --- */
20082009      case CPUINFO_PTR_RESET:                     info->reset = upd7807_reset;         break;
2009#ifdef MAME_DEBUG
2010#ifdef ENABLE_DEBUGGER
20102011      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = upd7807_dasm;      break;
2011#endif /* MAME_DEBUG */
2012#endif /* ENABLE_DEBUGGER */
20122013
20132014      /* --- the following bits of info are returned as NULL-terminated strings --- */
20142015      case CPUINFO_STR_NAME:                     strcpy(info->s, "uPD7807");            break;
src/emu/cpu/upd7810/upd7810.h
r1649r1650
148148   int (*irq_callback)(int irqline);
149149}   UPD7810;
150150
151#ifdef MAME_DEBUG
151#ifdef ENABLE_DEBUGGER
152152offs_t upd7810_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
153153offs_t upd7807_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
154154#endif
src/emu/cpu/sc61860/sc61860.h
r1649r1650
4646    void (*outc)(int);
4747} SC61860_CONFIG;
4848
49#ifdef MAME_DEBUG
49#ifdef ENABLE_DEBUGGER
5050unsigned sc61860_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
51#endif /* MAME_DEBUG */
51#endif /* ENABLE_DEBUGGER */
5252
5353/* this is though for power on/off of the sharps */
5454UINT8 *sc61860_internal_ram(void);
src/emu/cpu/sc61860/sc61860.c
r1649r1650
2727 *         Extended execute procudure with HLT-mode of CPU.
2828 *****************************************************************************/
2929
30#include "cpuintrf.h"
3130#include "debugger.h"
31#include "deprecat.h"
3232
3333#include "sc61860.h"
3434#include "sc.h"
r1649r1650
117117   {
118118      sc61860.oldpc = sc61860.pc;
119119
120      CALL_MAME_DEBUG;
120      CALL_DEBUGGER(sc61860.pc);
121121
122122      sc61860_instruction();
123123
r1649r1650
214214      case CPUINFO_PTR_RESET:                     info->reset = sc61860_reset;               break;
215215      case CPUINFO_PTR_EXECUTE:                  info->execute = sc61860_execute;            break;
216216      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
217#ifdef MAME_DEBUG
217#ifdef ENABLE_DEBUGGER
218218      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = sc61860_dasm;               break;
219#endif /* MAME_DEBUG */
219#endif /* ENABLE_DEBUGGER */
220220      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sc61860_ICount;            break;
221221
222222      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/minx/minx.h
r1649r1650
1010        MINX_XI, MINX_YI,
1111};
1212
13#ifdef MAME_DEBUG
13#ifdef ENABLE_DEBUGGER
1414extern unsigned minx_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram );
1515#endif
1616
src/emu/cpu/minx/minx.c
r1649r1650
141141   minx_icount = cycles;
142142
143143   do {
144      CALL_MAME_DEBUG;
144      CALL_DEBUGGER(minx_PC);
145145      oldpc = minx_PC;
146146      op = rdop();
147147      insnminx[op]();
r1649r1650
279279   case CPUINFO_PTR_EXIT:               info->exit = minx_exit; break;
280280   case CPUINFO_PTR_EXECUTE:            info->execute = minx_execute; break;
281281   case CPUINFO_PTR_BURN:               info->burn = minx_burn; break;
282#ifdef MAME_DEBUG
282#ifdef ENABLE_DEBUGGER
283283   case CPUINFO_PTR_DISASSEMBLE:            info->disassemble = minx_dasm; break;
284284#endif
285285   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &minx_icount; break;
src/emu/cpu/v60/v60.c
r1649r1650
44// Portability fixes by Richter Belmont
55
66#include "debugger.h"
7#include "deprecat.h"
78#include "v60.h"
89
910// memory accessors
r1649r1650
425426      v60_try_irq();
426427   while(v60_ICount >= 0) {
427428      v60.PPC = PC;
428      CALL_MAME_DEBUG;
429      CALL_DEBUGGER(PC);
429430      v60_ICount -= 8;   /* fix me -- this is just an average */
430431      inc = OpCodeTable[OpRead8(PC)]();
431432      PC += inc;
r1649r1650
452453}
453454
454455
455#ifdef MAME_DEBUG
456#ifdef ENABLE_DEBUGGER
456457offs_t v60_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
457458offs_t v70_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
458#endif /* MAME_DEBUG */
459#endif /* ENABLE_DEBUGGER */
459460
460461
461462/**************************************************************************
r1649r1650
641642      case CPUINFO_PTR_EXIT:                     info->exit = v60_exit;               break;
642643      case CPUINFO_PTR_EXECUTE:                  info->execute = v60_execute;         break;
643644      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
644#ifdef MAME_DEBUG
645#ifdef ENABLE_DEBUGGER
645646      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = v60_dasm;         break;
646#endif /* MAME_DEBUG */
647#endif /* ENABLE_DEBUGGER */
647648      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &v60_ICount;            break;
648649
649650      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
732733
733734      /* --- the following bits of info are returned as pointers to data or functions --- */
734735      case CPUINFO_PTR_INIT:                     info->init = v70_init;               break;
735#ifdef MAME_DEBUG
736#ifdef ENABLE_DEBUGGER
736737      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = v70_dasm;         break;
737#endif /* MAME_DEBUG */
738#endif /* ENABLE_DEBUGGER */
738739
739740      /* --- the following bits of info are returned as NULL-terminated strings --- */
740741      case CPUINFO_STR_NAME:                     strcpy(info->s, "V70");               break;
src/emu/cpu/v60/v60d.c
r1649r1650
14601460   /* 0xFF */ dopCLRTLB
14611461};
14621462
1463#ifdef MAME_DEBUG
1463#ifdef ENABLE_DEBUGGER
14641464offs_t v60_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
14651465{
14661466   rombase = oprom;
src/emu/cpu/spc700/spc700.c
r1649r1650
6161/* ======================================================================== */
6262
6363#include <limits.h>
64#include "debugger.h"
65#include "deprecat.h"
6466#include "spc700.h"
65#include "debugger.h"
6667
6768/* ======================================================================== */
6869/* ==================== ARCHITECTURE-DEPENDANT DEFINES ==================== */
r1649r1650
13971398}
13981399
13991400
1400#ifdef MAME_DEBUG
1401#ifdef ENABLE_DEBUGGER
14011402#include "spc700ds.h"
14021403#endif
14031404
r1649r1650
14101411   while(CLOCKS > 0)
14111412   {
14121413      REG_PPC = REG_PC;
1413      CALL_MAME_DEBUG;
1414      CALL_DEBUGGER(REG_PC);
14141415      REG_PC++;
14151416
14161417#if 0
r1649r1650
17901791      case CPUINFO_PTR_EXIT:                     info->exit = spc700_exit;            break;
17911792      case CPUINFO_PTR_EXECUTE:                  info->execute = spc700_execute;         break;
17921793      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1793#ifdef MAME_DEBUG
1794#ifdef ENABLE_DEBUGGER
17941795      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = spc700_dasm;      break;
1795#endif /* MAME_DEBUG */
1796#endif /* ENABLE_DEBUGGER */
17961797      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &spc700_ICount;         break;
17971798
17981799      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/dsp56k/dsp56ops.c
r1649r1650
11/***************************************************************************
22
3    dsp56kops.c
3    dsp56ops.c
44    Core implementation for the portable Motorola/Freescale DSP56k emulator.
55    Written by Andrew Gardner
66
r1649r1650
117117{
118118   unsigned size = 666 ;
119119
120   CALL_MAME_DEBUG;
120   CALL_DEBUGGER(PC);
121121   OP = ROPCODE(PC<<1);
122122
123123   if (BITS(OP,0x8000))                                 // First, the parallel data move instructions
src/emu/cpu/dsp56k/dsp56dsm.c
r1649r1650
11/***************************************************************************
22
3    dsp56kdasm.c
3    dsp56dsm.c
44    Disassembler for the portable Motorola/Freescale dsp56k emulator.
55    Written by Andrew Gardner
66
src/emu/cpu/dsp56k/dsp56k.c
r1649r1650
1919***************************************************************************/
2020
2121#include "debugger.h"
22#include "deprecat.h"
2223#include "dsp56k.h"
2324
2425// #define PC_E000
r1649r1650
12331234      case CPUINFO_PTR_EXIT:                     info->exit = dsp56k_exit;            break;
12341235      case CPUINFO_PTR_EXECUTE:                  info->execute = dsp56k_execute;         break;
12351236      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1236#ifdef MAME_DEBUG
1237#ifdef ENABLE_DEBUGGER
12371238      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = dsp56k_dasm;      break;
1238#endif /* MAME_DEBUG */
1239#endif /* ENABLE_DEBUGGER */
12391240      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &dsp56k_icount;         break;
12401241       case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
12411242          info->internal_map = construct_map_dsp56156_x_data_memory;                     break;
src/emu/cpu/i8039/i8039.h
r1649r1650
216216 */
217217#define I8039_RDOP_ARG(A) ((unsigned)cpu_readop_arg(A))
218218
219#ifdef  MAME_DEBUG
219#ifdef  ENABLE_DEBUGGER
220220offs_t i8039_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
221221#endif
222222
src/emu/cpu/i8039/i8039.c
r1649r1650
3535
3636
3737#include "debugger.h"
38#include "deprecat.h"
3839#include "i8039.h"
3940
4041
r1649r1650
747748   {
748749      R.PREVPC = R.PC;
749750
750      CALL_MAME_DEBUG;
751      CALL_DEBUGGER(R.PC.w.l);
751752
752753      opcode=M_RDOP(R.PC.w.l);
753754
r1649r1650
942943      case CPUINFO_PTR_EXIT:                     info->exit = i8039_exit;            break;
943944      case CPUINFO_PTR_EXECUTE:                  info->execute = i8039_execute;         break;
944945      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
945#ifdef MAME_DEBUG
946#ifdef ENABLE_DEBUGGER
946947      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = i8039_dasm;         break;
947#endif /* MAME_DEBUG */
948#endif /* ENABLE_DEBUGGER */
948949      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &i8039_ICount;         break;
949950
950951      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/hd6309/hd6309.c
r1649r1650
103103*****************************************************************************/
104104
105105#include "debugger.h"
106#include "deprecat.h"
106107#include "hd6309.h"
107108
108109#define VERBOSE 0
r1649r1650
117118#define false 0
118119#endif
119120
120#ifdef MAME_DEBUG
121#ifdef ENABLE_DEBUGGER
121122extern offs_t hd6309_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
122123#endif
123124
r1649r1650
624625
625626   if (hd6309.int_state & (HD6309_CWAI | HD6309_SYNC))
626627   {
627      CALL_MAME_DEBUG;
628      CALL_DEBUGGER(PCD);
628629      hd6309_ICount = 0;
629630   }
630631   else
r1649r1650
633634      {
634635         pPPC = pPC;
635636
636         CALL_MAME_DEBUG;
637         CALL_DEBUGGER(PCD);
637638
638639         hd6309.ireg = ROP(PCD);
639640         PC++;
r1649r1650
12911292      case CPUINFO_PTR_EXIT:                     info->exit = hd6309_exit;            break;
12921293      case CPUINFO_PTR_EXECUTE:                  info->execute = hd6309_execute;         break;
12931294      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1294#ifdef MAME_DEBUG
1295#ifdef ENABLE_DEBUGGER
12951296      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = hd6309_dasm;      break;
1296#endif /* MAME_DEBUG */
1297#endif /* ENABLE_DEBUGGER */
12971298      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &hd6309_ICount;         break;
12981299
12991300      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/tlcs90/tlcs90.c
r1649r1650
77*************************************************************************************************************/
88
99#include "debugger.h"
10#include "deprecat.h"
1011#include "tlcs90.h"
1112
1213typedef struct
r1649r1650
13291330   do
13301331   {
13311332      T90.prvpc.d = T90.pc.d;
1332      CALL_MAME_DEBUG;
1333      CALL_DEBUGGER(T90.pc.d);
13331334
13341335      check_interrupts();
13351336
r1649r1650
27832784      case CPUINFO_PTR_EXIT:                              info->exit = t90_exit;            break;
27842785      case CPUINFO_PTR_EXECUTE:                           info->execute = t90_execute;      break;
27852786      case CPUINFO_PTR_BURN:                              info->burn = t90_burn;            break;
2786#ifdef MAME_DEBUG
2787#ifdef ENABLE_DEBUGGER
27872788      case CPUINFO_PTR_DISASSEMBLE:                        info->disassemble = t90_dasm;      break;
27882789#endif
27892790      case CPUINFO_PTR_INSTRUCTION_COUNTER:                  info->icount = &t90_ICount;         break;
src/emu/cpu/tlcs90/tlcs90.h
r1649r1650
88void tmp91640_get_info(UINT32, cpuinfo*);
99void tmp91641_get_info(UINT32, cpuinfo*);
1010
11#ifdef MAME_DEBUG
11#ifdef ENABLE_DEBUGGER
1212unsigned t90_dasm(char *buffer, UINT32 oldpc, const UINT8 *oprom, const UINT8 *opram);
1313#endif
1414
src/emu/cpu/s2650/s2650.c
r1649r1650
1313 *************************************************************************/
1414
1515#include "debugger.h"
16#include "deprecat.h"
1617#include "s2650.h"
1718#include "s2650cpu.h"
1819
r1649r1650
864865   {
865866      S.ppc = S.page + S.iar;
866867
867      CALL_MAME_DEBUG;
868      CALL_DEBUGGER(S.page + S.iar);
868869
869870      S.ir = ROP();
870871      S.r = S.ir & 3;       /* register / value */
r1649r1650
15681569      case CPUINFO_PTR_EXIT:                     info->exit = s2650_exit;            break;
15691570      case CPUINFO_PTR_EXECUTE:                  info->execute = s2650_execute;         break;
15701571      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1571#ifdef MAME_DEBUG
1572#ifdef ENABLE_DEBUGGER
15721573      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = s2650_dasm;         break;
1573#endif /* MAME_DEBUG */
1574#endif /* ENABLE_DEBUGGER */
15741575      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &s2650_ICount;         break;
15751576
15761577      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/s2650/s2650.h
r1649r1650
2323
2424extern void s2650_get_info(UINT32 state, cpuinfo *info);
2525
26#ifdef  MAME_DEBUG
26#ifdef  ENABLE_DEBUGGER
2727extern offs_t s2650_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
2828#endif
2929
src/emu/cpu/cdp1802/cdp1802.c
r1649r1650
11#include "driver.h"
2#include "state.h"
32#include "debugger.h"
3#include "deprecat.h"
44#include "cdp1802.h"
55
66typedef struct
r1649r1650
211211
212212      cdp1802_ICount -= CDP1802_CYCLES_RESET;
213213
214      CALL_MAME_DEBUG;
214      CALL_DEBUGGER(cdp1802.r[cdp1802.p]);
215215
216216      break;
217217
r1649r1650
236236         cdp1802.state = CDP1802_STATE_0_FETCH;
237237      }
238238
239      CALL_MAME_DEBUG;
239      CALL_DEBUGGER(cdp1802.r[cdp1802.p]);
240240
241241      break;
242242
r1649r1650
713713         cdp1802.state = CDP1802_STATE_0_FETCH;
714714      }
715715
716      CALL_MAME_DEBUG;
716      CALL_DEBUGGER(cdp1802.r[cdp1802.p]);
717717
718718      break;
719719
r1649r1650
801801         cdp1802.state = CDP1802_STATE_0_FETCH;
802802      }
803803
804      CALL_MAME_DEBUG;
804      CALL_DEBUGGER(cdp1802.r[cdp1802.p]);
805805
806806      break;
807807   }
r1649r1650
10021002      case CPUINFO_PTR_RESET:                     info->reset = cdp1802_reset;         break;
10031003      case CPUINFO_PTR_EXECUTE:                  info->execute = cdp1802_execute;      break;
10041004      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1005#ifdef MAME_DEBUG
1005#ifdef ENABLE_DEBUGGER
10061006      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = cdp1802_dasm;      break;
1007#endif /* MAME_DEBUG */
1007#endif /* ENABLE_DEBUGGER */
10081008      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cdp1802_ICount;         break;
10091009
10101010      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/cdp1802/cdp1802.h
r1649r1650
8383
8484void cdp1802_get_info(UINT32 state, cpuinfo *info);
8585
86#ifdef MAME_DEBUG
86#ifdef ENABLE_DEBUGGER
8787offs_t cdp1802_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
8888#endif
8989
src/emu/cpu/se3208/se3208.c
r1649r1650
11#include "debugger.h"
2#include "deprecat.h"
23#include "se3208.h"
34
45/*
r1649r1650
17691770   {
17701771      UINT16 Opcode=cpu_readop16(WORD_XOR_LE(Context.PC));
17711772
1772      CALL_MAME_DEBUG;
1773      CALL_DEBUGGER(Context.PC);
17731774
17741775      OpTable[Opcode](Opcode);
17751776      Context.PPC=Context.PC;
r1649r1650
19061907      case CPUINFO_PTR_EXIT:                     info->exit = SE3208_Exit;            break;
19071908      case CPUINFO_PTR_EXECUTE:                  info->execute = SE3208_Run;            break;
19081909      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1909#ifdef MAME_DEBUG
1910#ifdef ENABLE_DEBUGGER
19101911      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = SE3208_Dasm;      break;
1911#endif /* MAME_DEBUG */
1912#endif /* ENABLE_DEBUGGER */
19121913      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &SE3208_ICount;         break;
19131914
19141915      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/se3208/se3208.h
r1649r1650
99
1010extern void SE3208_get_info(UINT32 state, cpuinfo *info);
1111
12#ifdef MAME_DEBUG
12#ifdef ENABLE_DEBUGGER
1313offs_t SE3208_Dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
1414#endif
src/emu/cpu/e132xs/e132xs.c
r1649r1650
212212*********************************************************************/
213213
214214#include "debugger.h"
215#include "deprecat.h"
215216#include "eminline.h"
216217#include "e132xs.h"
217218#include "osd_cpu.h"
r1649r1650
602603
603604static UINT32 compute_tr(void)
604605{
605   UINT64 cycles_since_base = activecpu_gettotalcycles64() - hyperstone.tr_base_cycles;
606   UINT64 cycles_since_base = activecpu_gettotalcycles() - hyperstone.tr_base_cycles;
606607   UINT64 clocks_since_base = cycles_since_base >> hyperstone.clock_scale;
607608   return hyperstone.tr_base_value + (clocks_since_base / hyperstone.tr_clocks_per_tick);
608609}
r1649r1650
618619   hyperstone.clock_cycles_6 = 6 << hyperstone.clock_scale;
619620   hyperstone.tr_clocks_per_tick = ((TPR >> 16) & 0xff) + 2;
620621   hyperstone.tr_base_value = prevtr;
621   hyperstone.tr_base_cycles = activecpu_gettotalcycles64();
622   hyperstone.tr_base_cycles = activecpu_gettotalcycles();
622623}
623624
624625static void adjust_timer_interrupt(void)
625626{
626   UINT64 cycles_since_base = activecpu_gettotalcycles64() - hyperstone.tr_base_cycles;
627   UINT64 cycles_since_base = activecpu_gettotalcycles() - hyperstone.tr_base_cycles;
627628   UINT64 clocks_since_base = cycles_since_base >> hyperstone.clock_scale;
628629   UINT64 cycles_until_next_clock = cycles_since_base - (clocks_since_base << hyperstone.clock_scale);
629630   int cpunum = cpu_getactivecpu();
r1649r1650
798799*/
799800         case TR_REGISTER:
800801            hyperstone.tr_base_value = val;
801            hyperstone.tr_base_cycles = activecpu_gettotalcycles64();
802            hyperstone.tr_base_cycles = activecpu_gettotalcycles();
802803            adjust_timer_interrupt();
803804            break;
804805
r1649r1650
17461747      hyperstone = *(hyperstone_regs *)regs;
17471748}
17481749
1749#ifdef MAME_DEBUG
1750#ifdef ENABLE_DEBUGGER
17501751static offs_t hyperstone_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
17511752{
17521753   return dasm_hyperstone( buffer, pc, oprom, GET_H, GET_FP );
17531754}
1754#endif /* MAME_DEBUG */
1755#endif /* ENABLE_DEBUGGER */
17551756
17561757/* Opcodes */
17571758
r1649r1650
47344735      UINT16 opcode;
47354736
47364737      PPC = PC;   /* copy PC to previous PC */
4737      CALL_MAME_DEBUG;
4738      CALL_DEBUGGER(PC);
47384739
47394740      opcode = READ_OP(PC);
47404741      PC += 2;
r1649r1650
50565057      case CPUINFO_PTR_EXIT:                     info->exit = hyperstone_exit;         break;
50575058      case CPUINFO_PTR_EXECUTE:                  info->execute = hyperstone_execute;      break;
50585059      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
5059#ifdef MAME_DEBUG
5060#ifdef ENABLE_DEBUGGER
50605061      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = hyperstone_dasm;   break;
5061#endif /* MAME_DEBUG */
5062#endif /* ENABLE_DEBUGGER */
50625063      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &hyperstone_ICount;      break;
50635064
50645065      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:    info->internal_map = 0;   break;
src/emu/cpu/e132xs/e132xs.h
r1649r1650
7777void gms30c2232_get_info(UINT32 state, cpuinfo *info);
7878#endif
7979
80#ifdef MAME_DEBUG
80#ifdef ENABLE_DEBUGGER
8181extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned h_flag, int private_fp);
8282#endif
8383
src/emu/cpu/i386/i386.h
r1649r1650
1010
1111#define INPUT_LINE_A20      1
1212
13#ifdef MAME_DEBUG
13#ifdef ENABLE_DEBUGGER
1414extern int i386_dasm_one(char *buffer, UINT32 pc, const UINT8 *oprom, int mode);
1515#endif
1616
src/emu/cpu/i386/i386.c
r1649r1650
1111*/
1212
1313#include "debugger.h"
14#include "deprecat.h"
1415#include "i386.h"
1516#include "i386intf.h"
1617
17#ifdef MAME_DEBUG
18#ifdef ENABLE_DEBUGGER
1819#include "debug/debugcpu.h"
1920#endif
2021
r1649r1650
442443
443444/*************************************************************************/
444445
445#ifdef MAME_DEBUG
446#ifdef ENABLE_DEBUGGER
446447
447448static UINT64 i386_debug_segbase(UINT32 ref, UINT32 params, UINT64 *param)
448449{
r1649r1650
484485   symtable_add_function(global_symtable, "seglimit", 0, 1, 1, i386_debug_seglimit);
485486}
486487
487#endif /* defined(MAME_DEBUG) */
488#endif /* defined(ENABLE_DEBUGGER) */
488489
489490/*************************************************************************/
490491
r1649r1650
716717      I.segment_prefix = 0;
717718      I.prev_eip = I.eip;
718719
719      CALL_MAME_DEBUG;
720      CALL_DEBUGGER(I.pc);
720721
721722      i386_check_irq_line();
722723      I386OP(decode_opcode)();
r1649r1650
740741   return result;
741742}
742743
743#ifdef MAME_DEBUG
744#ifdef ENABLE_DEBUGGER
744745static offs_t i386_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
745746{
746747   return i386_dasm_one(buffer, pc, oprom, I.sreg[CS].d ? 32 : 16);
747748}
748#endif /* MAME_DEBUG */
749#endif /* ENABLE_DEBUGGER */
749750
750751static void i386_set_info(UINT32 state, cpuinfo *info)
751752{
r1649r1650
968969      case CPUINFO_PTR_BURN:                        info->burn = NULL;                  break;
969970      case CPUINFO_PTR_INSTRUCTION_COUNTER:          info->icount = &I.cycles;            break;
970971      case CPUINFO_PTR_TRANSLATE:                  info->translate = translate_address_cb;   break;
971#ifdef MAME_DEBUG
972#ifdef ENABLE_DEBUGGER
972973      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = i386_dasm;         break;
973974      case CPUINFO_PTR_DEBUG_SETUP_COMMANDS:         info->setup_commands = i386_debug_setup; break;
974975#endif
src/emu/cpu/mc68hc11/mc68hc11.h
r1649r1650
33
44#include "cpuintrf.h"
55
6#ifdef MAME_DEBUG
6#ifdef ENABLE_DEBUGGER
77offs_t hc11_disasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
88#endif
99
src/emu/cpu/mc68hc11/mc68hc11.c
r1649r1650
55 */
66
77#include "debugger.h"
8#include "deprecat.h"
89#include "mc68hc11.h"
910
1011enum {
r1649r1650
388389      UINT8 op;
389390
390391      hc11.ppc = hc11.pc;
391      CALL_MAME_DEBUG;
392      CALL_DEBUGGER(hc11.pc);
392393
393394      op = FETCH();
394395      hc11_optable[op]();
r1649r1650
461462      case CPUINFO_PTR_EXIT:                     info->exit = hc11_exit;               break;
462463      case CPUINFO_PTR_EXECUTE:                  info->execute = hc11_execute;         break;
463464      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
464#ifdef MAME_DEBUG
465#ifdef ENABLE_DEBUGGER
465466      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = hc11_disasm;      break;
466#endif /* MAME_DEBUG */
467#endif /* ENABLE_DEBUGGER */
467468      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &hc11.icount;         break;
468469
469470      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/adsp2100/adsp2100.c
r1649r1650
9696***************************************************************************/
9797
9898#include "debugger.h"
99#include "deprecat.h"
99100#include "adsp2100.h"
100101
101102
r1649r1650
950951
951952      /* debugging */
952953      adsp2100.ppc = adsp2100.pc;   /* copy PC to previous PC */
953      CALL_MAME_DEBUG;
954      CALL_DEBUGGER(adsp2100.pc);
954955
955956#if TRACK_HOTSPOTS
956957      pcbucket[adsp2100.pc & 0x3fff]++;
r1649r1650
16901691    DEBUGGER DEFINITIONS
16911692***************************************************************************/
16921693
1693#ifdef MAME_DEBUG
1694#ifdef ENABLE_DEBUGGER
16941695extern offs_t adsp2100_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
1695#endif /* MAME_DEBUG */
1696#endif /* ENABLE_DEBUGGER */
16961697
16971698
16981699
r1649r1650
19471948      case CPUINFO_PTR_EXIT:                     info->exit = adsp2100_exit;            break;
19481949      case CPUINFO_PTR_EXECUTE:                  info->execute = adsp2100_execute;      break;
19491950      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1950#ifdef MAME_DEBUG
1951#ifdef ENABLE_DEBUGGER
19511952      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = adsp2100_dasm;      break;
1952#endif /* MAME_DEBUG */
1953#endif /* ENABLE_DEBUGGER */
19531954      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &adsp2100_icount;      break;
19541955
19551956      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/dsp32/dsp32.c
r1649r1650
2727
2828***************************************************************************/
2929
30#include <math.h>
3130#include "debugger.h"
31#include "deprecat.h"
3232#include "dsp32.h"
3333
3434
r1649r1650
435435    DISASSEMBLY HOOK
436436***************************************************************************/
437437
438#ifdef MAME_DEBUG
438#ifdef ENABLE_DEBUGGER
439439static offs_t dsp32c_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
440440{
441441   extern unsigned dasm_dsp32(char *, unsigned, UINT32);
442442   return dasm_dsp32(buffer, pc, oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24));
443443}
444#endif /* MAME_DEBUG */
444#endif /* ENABLE_DEBUGGER */
445445
446446
447447
r1649r1650
873873      case CPUINFO_PTR_EXIT:                     info->exit = dsp32c_exit;            break;
874874      case CPUINFO_PTR_EXECUTE:                  info->execute = dsp32c_execute;         break;
875875      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
876#ifdef MAME_DEBUG
876#ifdef ENABLE_DEBUGGER
877877      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = dsp32c_dasm;      break;
878#endif /* MAME_DEBUG */
878#endif /* ENABLE_DEBUGGER */
879879      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &dsp32_icount;         break;
880880
881881      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/dsp32/dsp32ops.c
r1649r1650
130130INLINE void execute_one(void)
131131{
132132   PROCESS_DEFERRED_MEMORY();
133   CALL_MAME_DEBUG;
133   CALL_DEBUGGER(dsp32.PC);
134134   OP = ROPCODE(dsp32.PC);
135135   dsp32_icount -= 4;   /* 4 clocks per cycle */
136136   dsp32.PC += 4;
src/emu/cpu/x86drc.c
r1649r1650
99
1010***************************************************************************/
1111
12#include "cpuintrf.h"
12#include "debugger.h"
13#include "deprecat.h"
1314#include "x86drc.h"
14#include "debugger.h"
1515
1616#define LOG_DISPATCHES            0
1717#define BREAK_ON_MODIFIED_CODE      0
r1649r1650
391391
392392void drc_append_call_debugger(drc_core *drc)
393393{
394#ifdef MAME_DEBUG
394#ifdef ENABLE_DEBUGGER
395395   if (Machine->debug_mode)
396396   {
397397      emit_link link;
r1649r1650
615615
616616   while(begin_ptr < end_ptr)
617617   {
618#if defined(MAME_DEBUG) && HAS_I386
618#if defined(ENABLE_DEBUGGER) && HAS_I386
619619      length = i386_dasm_one(buffer, pc, (UINT8 *) begin_ptr, 32) & DASMFLAG_LENGTHMASK;
620620#else
621621      sprintf(buffer, "%02X", *begin_ptr);
src/emu/cpu/rsp/rsp.c
r1649r1650
55*/
66
77#include "cpuintrf.h"
8#include "debugger.h"
9#include "deprecat.h"
810#include "rsp.h"
9#include "debugger.h"
10#include <math.h>   // sqrt
1111
1212#define LOG_INSTRUCTION_EXECUTION      0
1313#define SAVE_DISASM                  0
r1649r1650
262262
263263static void unimplemented_opcode(UINT32 op)
264264{
265#ifdef MAME_DEBUG
265#ifdef ENABLE_DEBUGGER
266266   char string[200];
267267   rsp_dasm_one(string, rsp.ppc, op);
268268   mame_printf_debug("%08X: %s\n", rsp.ppc, string);
r1649r1650
25962596   while (rsp_icount > 0)
25972597   {
25982598      rsp.ppc = rsp.pc;
2599      CALL_MAME_DEBUG;
2599      CALL_DEBUGGER(rsp.pc);
26002600
26012601      op = ROPCODE(rsp.pc);
26022602      if (rsp.nextpc != ~0)
r1649r1650
28752875
28762876/*****************************************************************************/
28772877
2878#ifdef MAME_DEBUG
2878#ifdef ENABLE_DEBUGGER
28792879static offs_t rsp_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
28802880{
28812881   UINT32 op = LITTLE_ENDIANIZE_INT32(*(UINT32 *)opram);
28822882   return rsp_dasm_one(buffer, pc, op);
28832883}
2884#endif /* MAME_DEBUG */
2884#endif /* ENABLE_DEBUGGER */
28852885
28862886/*****************************************************************************/
28872887
r1649r1650
30103010      case CPUINFO_PTR_EXIT:                     info->exit = rsp_exit;               break;
30113011      case CPUINFO_PTR_EXECUTE:                  info->execute = rsp_execute;         break;
30123012      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
3013#ifdef MAME_DEBUG
3013#ifdef ENABLE_DEBUGGER
30143014      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = rsp_dasm;         break;
3015#endif /* MAME_DEBUG */
3015#endif /* ENABLE_DEBUGGER */
30163016      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &rsp_icount;            break;
30173017
30183018      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/rsp/rsp.h
r1649r1650
6969
7070void rsp_get_info(UINT32 state, cpuinfo *info);
7171
72#ifdef MAME_DEBUG
72#ifdef ENABLE_DEBUGGER
7373extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op);
7474#endif
7575
src/emu/cpu/cop400/cop410.c
r1649r1650
11/***************************************************************************
22
3    version.c
3    cop410.c
44
55    National Semiconductor COP410 Emulator.
66
r1649r1650
1919
2020#include "cpuintrf.h"
2121#include "debugger.h"
22#include "deprecat.h"
2223#include "cop400.h"
2324
2425/* The opcode table now is a combination of cycle counts and function pointers */
r1649r1650
214215   {
215216      prevPC = PC;
216217
217      CALL_MAME_DEBUG;
218      CALL_DEBUGGER(PC);
218219
219220      opcode = ROM(PC);
220221
r1649r1650
350351      case CPUINFO_PTR_RESET:                     info->reset = cop410_reset;            break;
351352      case CPUINFO_PTR_EXECUTE:                  info->execute = cop410_execute;         break;
352353      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
353#ifdef MAME_DEBUG
354#ifdef ENABLE_DEBUGGER
354355      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = cop410_dasm;      break;
355#endif /* MAME_DEBUG */
356#endif /* ENABLE_DEBUGGER */
356357      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cop410_ICount;         break;
357358       case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
358359          info->internal_map = construct_map_cop410_RAM;                              break;
src/emu/cpu/cop400/cop420.c
r1649r1650
2020
2121#include "cpuintrf.h"
2222#include "debugger.h"
23#include "deprecat.h"
2324#include "cop400.h"
2425
2526/* The opcode table now is a combination of cycle counts and function pointers */
r1649r1650
222223   {
223224      prevPC = PC;
224225
225      CALL_MAME_DEBUG;
226      CALL_DEBUGGER(PC);
226227
227228      opcode = ROM(PC);
228229
r1649r1650
379380      case CPUINFO_PTR_RESET:                     info->reset = cop420_reset;            break;
380381      case CPUINFO_PTR_EXECUTE:                  info->execute = cop420_execute;         break;
381382      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
382#ifdef MAME_DEBUG
383#ifdef ENABLE_DEBUGGER
383384      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = cop420_dasm;      break;
384#endif /* MAME_DEBUG */
385#endif /* ENABLE_DEBUGGER */
385386      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cop420_ICount;         break;
386387       case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
387388          info->internal_map = construct_map_cop420_RAM;                              break;
src/emu/cpu/cop400/cop400.h
r1649r1650
4242extern void cop411_get_info(UINT32 state, cpuinfo *info);
4343extern void cop420_get_info(UINT32 state, cpuinfo *info);
4444
45#ifdef MAME_DEBUG
45#ifdef ENABLE_DEBUGGER
4646offs_t cop410_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
4747offs_t cop420_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
48#endif /* MAME_DEBUG */
48#endif /* ENABLE_DEBUGGER */
4949
5050#endif  /* _COP400_H */
src/emu/cpu/m6502/m4510.c
r1649r1650
101101 */
102102
103103#include "debugger.h"
104#include "deprecat.h"
104105#include "m6502.h"
105106#include "m4510.h"
106107
r1649r1650
260261      UINT8 op;
261262      PPC = PCD;
262263
263      CALL_MAME_DEBUG;
264      CALL_DEBUGGER(PCD);
264265
265266      /* if an irq is pending, take it now */
266267      if( m4510.pending_irq )
r1649r1650
490491      case CPUINFO_PTR_EXIT:                     info->exit = m4510_exit;            break;
491492      case CPUINFO_PTR_EXECUTE:                  info->execute = m4510_execute;         break;
492493      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
493#ifdef MAME_DEBUG
494#ifdef ENABLE_DEBUGGER
494495      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m4510_dasm;         break;
495496#endif
496497      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m4510_ICount;         break;
src/emu/cpu/m6502/m6502.c
r1649r1650
3030#endif
3131
3232#include "debugger.h"
33#include "deprecat.h"
3334#include "m6502.h"
3435#include "ops02.h"
3536#include "ill02.h"
r1649r1650
226227      UINT8 op;
227228      PPC = PCD;
228229
229      CALL_MAME_DEBUG;
230      CALL_DEBUGGER(PCD);
230231
231232      /* if an irq is pending, take it now */
232233      if( m6502.pending_irq )
r1649r1650
445446      UINT8 op;
446447      PPC = PCD;
447448
448      CALL_MAME_DEBUG;
449      CALL_DEBUGGER(PCD);
449450
450451      op = RDOP();
451452      (*m6502.insn[op])();
r1649r1650
616617      UINT8 op;
617618      PPC = PCD;
618619
619      CALL_MAME_DEBUG;
620      CALL_DEBUGGER(PCD);
620621
621622      op = RDOP();
622623      (*m6502.insn[op])();
r1649r1650
743744      case CPUINFO_PTR_EXIT:                     info->exit = m6502_exit;            break;
744745      case CPUINFO_PTR_EXECUTE:                  info->execute = m6502_execute;         break;
745746      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
746#ifdef MAME_DEBUG
747#ifdef ENABLE_DEBUGGER
747748      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6502_dasm;         break;
748749#endif
749750      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m6502_ICount;         break;
r1649r1650
827828      case CPUINFO_PTR_SET_INFO:                  info->setinfo = m6510_set_info;         break;
828829      case CPUINFO_PTR_INIT:                     info->init = m6510_init;            break;
829830      case CPUINFO_PTR_RESET:                     info->reset = m6510_reset;            break;
830#ifdef MAME_DEBUG
831#ifdef ENABLE_DEBUGGER
831832      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6510_dasm;         break;
832833#endif
833834      case CPUINFO_PTR_INTERNAL_MEMORY_MAP:         info->internal_map = construct_map_m6510_mem; break;
r1649r1650
925926      case CPUINFO_PTR_INIT:                     info->init = m65c02_init;            break;
926927      case CPUINFO_PTR_RESET:                     info->reset = m65c02_reset;            break;
927928      case CPUINFO_PTR_EXECUTE:                  info->execute = m65c02_execute;         break;
928#ifdef MAME_DEBUG
929#ifdef ENABLE_DEBUGGER
929930      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m65c02_dasm;      break;
930931#endif
931932
r1649r1650
949950   {
950951      /* --- the following bits of info are returned as pointers to data or functions --- */
951952      case CPUINFO_PTR_INIT:                     info->init = m65sc02_init;            break;
952#ifdef MAME_DEBUG
953#ifdef ENABLE_DEBUGGER
953954      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m65sc02_dasm;      break;
954955#endif
955956
r1649r1650
997998      case CPUINFO_PTR_INIT:                     info->init = deco16_init;            break;
998999      case CPUINFO_PTR_RESET:                     info->reset = deco16_reset;            break;
9991000      case CPUINFO_PTR_EXECUTE:                  info->execute = deco16_execute;         break;
1000#ifdef MAME_DEBUG
1001#ifdef ENABLE_DEBUGGER
10011002      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = deco16_dasm;      break;
10021003#endif
10031004
src/emu/cpu/m6502/m4510.h
r1649r1650
3939void m4510_get_info(UINT32 state, cpuinfo *info);
4040
4141
42#ifdef MAME_DEBUG
42#ifdef ENABLE_DEBUGGER
4343extern unsigned m4510_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
44#endif /* MAME_DEBUG */
44#endif /* ENABLE_DEBUGGER */
4545
4646#endif
4747
src/emu/cpu/m6502/m6502.h
r1649r1650
7171
7272extern void m6502_get_info(UINT32 state, cpuinfo *info);
7373
74#ifdef MAME_DEBUG
74#ifdef ENABLE_DEBUGGER
7575extern unsigned m6502_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
7676#endif
7777
r1649r1650
9494
9595extern void m6510_get_info(UINT32 state, cpuinfo *info);
9696
97#ifdef MAME_DEBUG
97#ifdef ENABLE_DEBUGGER
9898extern unsigned m6510_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
9999#endif
100100
r1649r1650
201201
202202extern void m65c02_get_info(UINT32 state, cpuinfo *info);
203203
204#ifdef MAME_DEBUG
204#ifdef ENABLE_DEBUGGER
205205extern unsigned m65c02_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
206206#endif
207207
r1649r1650
226226
227227extern void m65sc02_get_info(UINT32 state, cpuinfo *info);
228228
229#ifdef MAME_DEBUG
229#ifdef ENABLE_DEBUGGER
230230extern unsigned m65sc02_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
231231#endif
232232#endif
r1649r1650
251251extern void deco16_get_info(UINT32 state, cpuinfo *info);
252252#endif
253253
254#ifdef MAME_DEBUG
254#ifdef ENABLE_DEBUGGER
255255extern unsigned deco16_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
256256#endif
257257
src/emu/cpu/m6502/m6509.c
r1649r1650
3838*/
3939
4040#include "debugger.h"
41#include "deprecat.h"
4142#include "m6509.h"
4243
4344#include "ops02.h"
r1649r1650
200201      UINT8 op;
201202      PPC = PCD;
202203
203      CALL_MAME_DEBUG;
204      CALL_DEBUGGER(PCD);
204205
205206      /* if an irq is pending, take it now */
206207      if( m6509.pending_irq )
r1649r1650
368369      case CPUINFO_PTR_EXIT:                     info->exit = m6509_exit;            break;
369370      case CPUINFO_PTR_EXECUTE:                  info->execute = m6509_execute;         break;
370371      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
371#ifdef MAME_DEBUG
372#ifdef ENABLE_DEBUGGER
372373      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6502_dasm;         break;
373374#endif
374375      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m6502_ICount;         break;
src/emu/cpu/m6502/m65ce02.c
r1649r1650
215215      UINT8 op;
216216      PPC = PCD;
217217
218      CALL_MAME_DEBUG;
218      CALL_DEBUGGER(PCD);
219219
220220      /* if an irq is pending, take it now */
221221      if( m65ce02.pending_irq )
r1649r1650
373373
374374unsigned int m65ce02_dasm(char *buffer, unsigned pc)
375375{
376#ifdef MAME_DEBUG
376#ifdef ENABLE_DEBUGGER
377377   return Dasm65ce02( buffer, pc );
378378#else
379379   sprintf( buffer, "$%02X", cpu_readop(pc) );
src/emu/cpu/m6502/m65ce02.h
r1649r1650
4848extern const char *m65ce02_info(void *context, int regnum);
4949extern unsigned m65ce02_dasm(char *buffer, unsigned pc);
5050
51#ifdef MAME_DEBUG
51#ifdef ENABLE_DEBUGGER
5252extern unsigned int Dasm65ce02( char *dst, unsigned pc );
5353#endif
5454
src/emu/cpu/jaguar/jaguar.c
r1649r1650
77***************************************************************************/
88
99#include "debugger.h"
10#include "deprecat.h"
1011#include "jaguar.h"
1112
1213#define LOG_GPU_IO      0
r1649r1650
516517      /* debugging */
517518      //if (jaguar.PC < 0xf03000 || jaguar.PC > 0xf04000) { fatalerror("GPU: jaguar.PC = %06X (ppc = %06X)", jaguar.PC, jaguar.ppc); }
518519      jaguar.ppc = jaguar.PC;
519      CALL_MAME_DEBUG;
520      CALL_DEBUGGER(jaguar.PC);
520521
521522      /* instruction fetch */
522523      jaguar.op = ROPCODE(jaguar.PC);
r1649r1650
562563      /* debugging */
563564      //if (jaguar.PC < 0xf1b000 || jaguar.PC > 0xf1d000) { fatalerror(stderr, "DSP: jaguar.PC = %06X", jaguar.PC); }
564565      jaguar.ppc = jaguar.PC;
565      CALL_MAME_DEBUG;
566      CALL_DEBUGGER(jaguar.PC);
566567
567568      /* instruction fetch */
568569      jaguar.op = ROPCODE(jaguar.PC);
r1649r1650
589590    DISASSEMBLY HOOK
590591***************************************************************************/
591592
592#ifdef MAME_DEBUG
593#ifdef ENABLE_DEBUGGER
593594static offs_t jaguargpu_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
594595{
595596   extern unsigned dasmjag(int, char *, unsigned, const UINT8 *);
r1649r1650
601602   extern unsigned dasmjag(int, char *, unsigned, const UINT8 *);
602603    return dasmjag(JAGUAR_VARIANT_DSP, buffer, pc, oprom);
603604}
604#endif /* MAME_DEBUG */
605#endif /* ENABLE_DEBUGGER */
605606
606607
607608
r1649r1650
800801   {
801802      INT32 r1 = (INT8)((jaguar.op >> 2) & 0xf8) >> 2;
802803      UINT32 newpc = jaguar.PC + r1;
803      CALL_MAME_DEBUG;
804      CALL_DEBUGGER(jaguar.PC);
804805      jaguar.op = ROPCODE(jaguar.PC);
805806      jaguar.PC = newpc;
806807      (*jaguar.table[jaguar.op >> 10])();
r1649r1650
817818
818819      /* special kludge for risky code in the cojag DSP interrupt handlers */
819820      UINT32 newpc = (jaguar_icount == bankswitch_icount) ? jaguar.a[reg] : jaguar.r[reg];
820      CALL_MAME_DEBUG;
821      CALL_DEBUGGER(jaguar.PC);
821822      jaguar.op = ROPCODE(jaguar.PC);
822823      jaguar.PC = newpc;
823824      (*jaguar.table[jaguar.op >> 10])();
r1649r1650
16531654      case CPUINFO_PTR_EXIT:                     info->exit = jaguar_exit;            break;
16541655      case CPUINFO_PTR_EXECUTE:                  info->execute = jaguargpu_execute;      break;
16551656      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1656#ifdef MAME_DEBUG
1657#ifdef ENABLE_DEBUGGER
16571658      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = jaguargpu_dasm;      break;
1658#endif /* MAME_DEBUG */
1659#endif /* ENABLE_DEBUGGER */
16591660      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &jaguar_icount;         break;
16601661
16611662      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
17481749      case CPUINFO_PTR_INIT:                     info->init = jaguardsp_init;         break;
17491750      case CPUINFO_PTR_RESET:                     info->reset = jaguardsp_reset;         break;
17501751      case CPUINFO_PTR_EXECUTE:                  info->execute = jaguardsp_execute;      break;
1751#ifdef MAME_DEBUG
1752#ifdef ENABLE_DEBUGGER
17521753      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = jaguardsp_dasm;      break;
1753#endif /* MAME_DEBUG */
1754#endif /* ENABLE_DEBUGGER */
17541755
17551756      /* --- the following bits of info are returned as NULL-terminated strings --- */
17561757      case CPUINFO_STR_NAME:                     strcpy(info->s, "Jaguar DSP");         break;
src/emu/cpu/ssp1610/ssp1610.h
r1649r1650
99void e116t_get_info(UINT32 state, cpuinfo *info);
1010#endif
1111
12#ifdef MAME_DEBUG
12#ifdef ENABLE_DEBUGGER
1313extern unsigned dasm_ssp1610(char *buffer, unsigned pc, const UINT8 *oprom);
1414#endif
1515
src/emu/cpu/ssp1610/ssp1610.c
r1649r1650
77*********************************************************************/
88
99#include "debugger.h"
10#include "deprecat.h"
1011#include "ssp1610.h"
11#include "osd_cpu.h"
1212
1313#define READ_OP(addr)          (cpu_readop16(addr<<1))
1414
r1649r1650
143143
144144      PPC = PC;   /* copy PC to previous PC */
145145
146      CALL_MAME_DEBUG;
146      CALL_DEBUGGER(PC);
147147
148148      op = READ_OP(PC);
149149
r1649r1650
690690      ssp1610 = *(ssp1610_regs *)regs;
691691}
692692
693#ifdef MAME_DEBUG
693#ifdef ENABLE_DEBUGGER
694694static offs_t ssp1610_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
695695{
696696   return dasm_ssp1610( buffer, pc, oprom);
697697}
698#endif /* MAME_DEBUG */
698#endif /* ENABLE_DEBUGGER */
699699
700700#if (HAS_SSP1610)
701701
r1649r1650
818818      case CPUINFO_PTR_EXIT:                     info->exit = ssp1610_exit;         break;
819819      case CPUINFO_PTR_EXECUTE:                  info->execute = ssp1610_execute;      break;
820820      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
821#ifdef MAME_DEBUG
821#ifdef ENABLE_DEBUGGER
822822      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = ssp1610_dasm;   break;
823#endif /* MAME_DEBUG */
823#endif /* ENABLE_DEBUGGER */
824824      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &ssp1610_ICount;      break;
825825
826826      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:    info->internal_map = 0;   break;
src/emu/cpu/i8085/i8085.h
r1649r1650
5151void i8080_get_info(UINT32 state, cpuinfo *info);
5252#endif
5353
54#ifdef   MAME_DEBUG
54#ifdef   ENABLE_DEBUGGER
5555offs_t i8085_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
5656#endif
5757
src/emu/cpu/i8085/i8085.c
r1649r1650
121121/*int survival_prot = 0; */
122122
123123#include "debugger.h"
124#include "deprecat.h"
124125#include "i8085.h"
125126#include "i8085cpu.h"
126127#include "i8085daa.h"
r1649r1650
12661267   i8085_ICount = cycles;
12671268   do
12681269   {
1269      CALL_MAME_DEBUG;
1270      CALL_DEBUGGER(I.PC.d);
12701271      /* interrupts enabled or TRAP pending ? */
12711272      if ( (I.IM & IM_IEN) || (I.IREQ & IM_TRAP) )
12721273      {
r1649r1650
16881689      case CPUINFO_PTR_EXIT:                     info->exit = i8085_exit;            break;
16891690      case CPUINFO_PTR_EXECUTE:                  info->execute = i8085_execute;         break;
16901691      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1691#ifdef MAME_DEBUG
1692#ifdef ENABLE_DEBUGGER
16921693      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = i8085_dasm;         break;
1693#endif /* MAME_DEBUG */
1694#endif /* ENABLE_DEBUGGER */
16941695      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &i8085_ICount;         break;
16951696
16961697      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/powerpc/ppc_mem.c
r1649r1650
361361/***********************************************************************/
362362
363363
364#ifdef MAME_DEBUG
364#ifdef ENABLE_DEBUGGER
365365static offs_t ppc_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
366366{
367367   UINT32 op;
368368   op = BIG_ENDIANIZE_INT32(*((UINT32 *) oprom));
369369   return ppc_dasm_one(buffer, pc, op);
370370}
371#endif /* MAME_DEBUG */
371#endif /* ENABLE_DEBUGGER */
372372
373373/***********************************************************************/
374374
src/emu/cpu/powerpc/ppc.c
r1649r1650
33#include <setjmp.h>
44#include "ppc.h"
55#include "debugger.h"
6#include "deprecat.h"
67
78#if (HAS_PPC603 || HAS_PPC601 || HAS_PPC604)
89void ppc603_exception(int exception);
r1649r1650
18101811      case CPUINFO_PTR_GET_CONTEXT:               info->getcontext = ppc_get_context;      break;
18111812      case CPUINFO_PTR_SET_CONTEXT:               info->setcontext = ppc_set_context;      break;
18121813      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1813#ifdef MAME_DEBUG
1814#ifdef ENABLE_DEBUGGER
18141815      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = ppc_dasm;         break;
1815#endif /* MAME_DEBUG */
1816#endif /* ENABLE_DEBUGGER */
18161817      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &ppc_icount;            break;
18171818
18181819      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/powerpc/ppc.h
r1649r1650
364364void ppc604_get_info(UINT32 state, cpuinfo *info);
365365#endif
366366
367#ifdef MAME_DEBUG
367#ifdef ENABLE_DEBUGGER
368368extern offs_t ppc_dasm_one(char *buffer, offs_t pc, UINT32 op);
369369#endif
370370
src/emu/cpu/powerpc/ppc403.c
r1649r1650
177177   {
178178      UINT32 opcode;
179179
180      CALL_MAME_DEBUG;
180      CALL_DEBUGGER(ppc.pc);
181181      ppc.pc = ppc.npc;
182182      ppc.npc += 4;
183183      opcode = ROPCODE(ppc.pc);
src/emu/cpu/powerpc/ppc602.c
r1649r1650
254254   while( ppc_icount > 0 )
255255   {
256256      ppc.pc = ppc.npc;
257      CALL_MAME_DEBUG;
257      CALL_DEBUGGER(ppc.pc);
258258
259259      if (MSR & MSR_IR)
260260         opcode = ppc_readop_translated(ppc.pc);
src/emu/cpu/powerpc/ppc603.c
r1649r1650
262262   while( ppc_icount > 0 )
263263   {
264264      ppc.pc = ppc.npc;
265      CALL_MAME_DEBUG;
265      CALL_DEBUGGER(ppc.pc);
266266
267267      if (MSR & MSR_IR)
268268         opcode = ppc_readop_translated(ppc.pc);
src/emu/cpu/powerpc/ppcdrc.c
r1649r1650
44    Written by Ville Linde
55*/
66
7#include "debugger.h"
8#include "deprecat.h"
79#include "ppc.h"
8#include "debugger.h"
910#include "cpu/x86drc.h"
1011
1112
r1649r1650
21532154      case CPUINFO_PTR_GET_CONTEXT:               info->getcontext = ppc_get_context;      break;
21542155      case CPUINFO_PTR_SET_CONTEXT:               info->setcontext = ppc_set_context;      break;
21552156      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
2156#ifdef MAME_DEBUG
2157#ifdef ENABLE_DEBUGGER
21572158      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = ppc_dasm;         break;
2158#endif /* MAME_DEBUG */
2159#endif /* ENABLE_DEBUGGER */
21592160      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &ppc_icount;            break;
21602161
21612162      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/arm/arm.c
r1649r1650
1616*/
1717
1818#include "arm.h"
19#include "deprecat.h"
1920#include "debugger.h"
2021
2122#define READ8(addr)         cpu_read8(addr)
r1649r1650
323324   arm_icount = cycles;
324325   do
325326   {
326      CALL_MAME_DEBUG;
327      CALL_DEBUGGER(R15);
327328
328329      /* load instruction */
329330      pc = R15;
r1649r1650
502503   arm_check_irq_state();
503504}
504505
505#ifdef MAME_DEBUG
506#ifdef ENABLE_DEBUGGER
506507static offs_t arm_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
507508{
508509   UINT32 opcode = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24);
509510   return 4 | arm_disasm(buffer, pc, opcode);
510511}
511#endif /* MAME_DEBUG */
512#endif /* ENABLE_DEBUGGER */
512513
513514static void arm_init(int index, int clock, const void *config, int (*irqcallback)(int))
514515{
r1649r1650
15311532      case CPUINFO_PTR_EXIT:                     info->exit = arm_exit;               break;
15321533      case CPUINFO_PTR_EXECUTE:                  info->execute = arm_execute;         break;
15331534      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1534#ifdef MAME_DEBUG
1535#ifdef ENABLE_DEBUGGER
15351536      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = arm_dasm;         break;
1536#endif /* MAME_DEBUG */
1537#endif /* ENABLE_DEBUGGER */
15371538      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &arm_icount;            break;
15381539
15391540      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/arm/arm.h
r1649r1650
1616
1717extern void arm_get_info(UINT32 state, cpuinfo *info);
1818
19#ifdef MAME_DEBUG
19#ifdef ENABLE_DEBUGGER
2020extern UINT32 arm_disasm( char *pBuf, UINT32 pc, UINT32 opcode );
2121#endif
2222
src/emu/cpu/z8000/z8000.c
r1649r1650
4444 *****************************************************************************/
4545
4646#include "debugger.h"
47#include "deprecat.h"
4748#include "z8000.h"
4849#include "z8000cpu.h"
4950#include "osd_cpu.h"
r1649r1650
479480        if (IRQ_REQ)
480481         Interrupt();
481482
482      CALL_MAME_DEBUG;
483      CALL_DEBUGGER(PC);
483484
484485      if (IRQ_REQ & Z8000_HALT)
485486        {
r1649r1650
688689      case CPUINFO_PTR_EXIT:                     info->exit = z8000_exit;            break;
689690      case CPUINFO_PTR_EXECUTE:                  info->execute = z8000_execute;         break;
690691      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
691#ifdef MAME_DEBUG
692#ifdef ENABLE_DEBUGGER
692693      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = z8000_dasm;         break;
693#endif /* MAME_DEBUG */
694#endif /* ENABLE_DEBUGGER */
694695      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &z8000_ICount;         break;
695696
696697      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/z8000/z8000.h
r1649r1650
2222/* PUBLIC FUNCTIONS */
2323extern void z8000_get_info(UINT32 state, cpuinfo *info);
2424
25#ifdef MAME_DEBUG
25#ifdef ENABLE_DEBUGGER
2626offs_t z8000_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
2727#endif
2828
src/emu/cpu/tms32010/tms32010.h
r1649r1650
123123
124124
125125
126#ifdef   MAME_DEBUG
126#ifdef   ENABLE_DEBUGGER
127127offs_t tms32010_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
128128#endif
129129
src/emu/cpu/tms32010/32010dsm.c
r1649r1650
2929#include <string.h>
3030#include <ctype.h>
3131
32#ifdef MAME_DEBUG               /* Compile interface to MAME */
32#ifdef ENABLE_DEBUGGER               /* Compile interface to MAME */
3333#include "cpuintrf.h"
3434#include "tms32010.h"
3535#include "debugger.h"
src/emu/cpu/tms32010/tms32010.c
r1649r1650
5353
5454
5555
56#include "debugger.h"
57#include "deprecat.h"
5658#include "tms32010.h"
57#include "debugger.h"
5859
5960
6061#define CLK  1      /* Moved the clock timing back into the driver */
r1649r1650
789790
790791      R.PREVPC = R.PC;
791792
792      CALL_MAME_DEBUG;
793      CALL_DEBUGGER(R.PC);
793794
794795      R.opcode.d = M_RDOP(R.PC);
795796      R.PC++;
r1649r1650
929930      case CPUINFO_PTR_EXIT:                     info->exit = tms32010_exit;            break;
930931      case CPUINFO_PTR_EXECUTE:                  info->execute = tms32010_execute;      break;
931932      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
932#ifdef MAME_DEBUG
933#ifdef ENABLE_DEBUGGER
933934      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tms32010_dasm;      break;
934#endif /* MAME_DEBUG */
935#endif /* ENABLE_DEBUGGER */
935936      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &tms32010_icount;      break;
936937      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:   info->internal_map = construct_map_tms32010_ram; break;
937938
src/emu/cpu/sm8500/sm8500.h
r1649r1650
4949   sm85cpu_mem_writebyte( ( address + 1 ) & 0xffff, value & 0xff );
5050}
5151
52#ifdef MAME_DEBUG
52#ifdef ENABLE_DEBUGGER
5353extern unsigned sm8500_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram );
54#endif /* MAME_DEBUG */
54#endif /* ENABLE_DEBUGGER */
5555
5656#endif
5757
src/emu/cpu/sm8500/sm8500.c
r1649r1650
99  Code by Wilbert Pol
1010*/
1111
12#include "debugger.h"
13#include "deprecat.h"
1214#include "sm8500.h"
13#include "debugger.h"
1415
1516#define FLAG_C   0x80
1617#define FLAG_Z   0x40
r1649r1650
215216      UINT32   d1,d2;
216217      UINT32   res;
217218
218      CALL_MAME_DEBUG;
219      CALL_DEBUGGER(regs.PC);
219220      oldpc = regs.PC;
220221      mycycles = 0;
221222      sm8500_process_interrupts();
r1649r1650
496497   case CPUINFO_PTR_EXIT:               info->exit = sm8500_exit; break;
497498   case CPUINFO_PTR_EXECUTE:            info->execute = sm8500_execute; break;
498499   case CPUINFO_PTR_BURN:               info->burn = sm8500_burn; break;
499#ifdef MAME_DEBUG
500#ifdef ENABLE_DEBUGGER
500501   case CPUINFO_PTR_DISASSEMBLE:         info->disassemble = sm8500_dasm; break;
501502#endif
502503   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sm8500_icount; break;
src/emu/cpu/sh2/sh2.h
r1649r1650
7575WRITE32_HANDLER( sh2_internal_w );
7676READ32_HANDLER( sh2_internal_r );
7777
78#ifdef MAME_DEBUG
78#ifdef ENABLE_DEBUGGER
7979extern unsigned DasmSH2( char *dst, unsigned pc, UINT16 opcode );
8080#endif
8181
src/emu/cpu/sh2/sh2.c
r1649r1650
101101 *****************************************************************************/
102102
103103#include "debugger.h"
104#include "deprecat.h"
104105#include "sh2.h"
105106
106107/* speed up delay loops, bail out of tight loops */
r1649r1650
140141
141142   UINT16    frc;
142143   UINT16    ocra, ocrb, icr;
143   UINT32    frc_base;
144   UINT64    frc_base;
144145
145146   int      frt_input;
146147   int    internal_irq_level;
r1649r1650
23412342      else
23422343         opcode = cpu_readop16(WORD_XOR_BE((UINT32)(sh2.pc & AM)));
23432344
2344      CALL_MAME_DEBUG;
2345      CALL_DEBUGGER(sh2.pc);
23452346
23462347      sh2.delay = 0;
23472348      sh2.pc += 2;
r1649r1650
23952396static void sh2_timer_resync(void)
23962397{
23972398   int divider = div_tab[(sh2.m[5] >> 8) & 3];
2398   UINT32 cur_time = cpunum_gettotalcycles(sh2.cpu_number);
2399   UINT64 cur_time = cpunum_gettotalcycles(sh2.cpu_number);
23992400
24002401   if(divider)
24012402      sh2.frc += (cur_time - sh2.frc_base) >> divider;
r1649r1650
29202921   }
29212922}
29222923
2923#ifdef MAME_DEBUG
2924#ifdef ENABLE_DEBUGGER
29242925static offs_t sh2_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
29252926{
29262927   return DasmSH2( buffer, pc, (oprom[0] << 8) | oprom[1] );
29272928}
2928#endif /* MAME_DEBUG */
2929#endif /* ENABLE_DEBUGGER */
29292930
29302931static void sh2_init(int index, int clock, const void *config, int (*irqcallback)(int))
29312932{
r1649r1650
31283129      case CPUINFO_PTR_RESET:                     info->reset = sh2_reset;            break;
31293130      case CPUINFO_PTR_EXECUTE:                  info->execute = sh2_execute;         break;
31303131      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
3131#ifdef MAME_DEBUG
3132#ifdef ENABLE_DEBUGGER
31323133      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = sh2_dasm;         break;
3133#endif /* MAME_DEBUG */
3134#endif /* ENABLE_DEBUGGER */
31343135      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sh2_icount;            break;
31353136
31363137      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/tms32051/tms32051.c
r1649r1650
44   Written by Ville Linde
55*/
66
7#include "debugger.h"
8#include "deprecat.h"
79#include "cpuintrf.h"
810#include "tms32051.h"
9#include "debugger.h"
1011
1112static void delay_slot(UINT16 startpc);
1213static void save_interrupt_context(void);
r1649r1650
360361      }
361362
362363      ppc = tms.pc;
363      CALL_MAME_DEBUG;
364      CALL_DEBUGGER(tms.pc);
364365
365366      tms.op = ROPCODE();
366367      tms32051_opcode_table[tms.op >> 8]();
r1649r1650
627628      case CPUINFO_PTR_EXIT:                     info->exit = tms_exit;               break;
628629      case CPUINFO_PTR_EXECUTE:                  info->execute = tms_execute;         break;
629630      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
630#ifdef MAME_DEBUG
631#ifdef ENABLE_DEBUGGER
631632      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tms32051_dasm;      break;
632#endif /* MAME_DEBUG */
633#endif /* ENABLE_DEBUGGER */
633634      case CPUINFO_PTR_READ:                     info->read = tms_debug_read;         break;
634635      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &tms_icount;            break;
635636      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_internal_pgm; break;
src/emu/cpu/tms32051/tms32051.h
r1649r1650
55void tms32051_get_info(UINT32 state, cpuinfo *info);
66#endif
77
8#ifdef MAME_DEBUG
8#ifdef ENABLE_DEBUGGER
99offs_t tms32051_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
1010#endif
1111
src/emu/cpu/sh4/sh4.c
r1649r1650
2525#include "debugger.h"
2626#include "sh4.h"
2727#include "sh4regs.h"
28#include <math.h>
28#include "deprecat.h"
2929
3030/* speed up delay loops, bail out of tight loops */
3131#define BUSY_LOOP_HACKS    0
r1649r1650
314314}
315315#endif
316316
317#ifdef MAME_DEBUG
317#ifdef ENABLE_DEBUGGER
318318static void sh4_syncronize_register_bank(int to)
319319{
320320int s;
r1649r1650
426426   sh4.sgr = sh4.r[15];
427427
428428   sh4.sr |= MD;
429#ifdef MAME_DEBUG
429#ifdef ENABLE_DEBUGGER
430430   sh4_syncronize_register_bank((sh4.sr & sRB) >> 29);
431431#endif
432432   if (!(sh4.sr & sRB))
r1649r1650
10931093/*  LDC     Rm,SR */
10941094INLINE void LDCSR(UINT32 m)
10951095{
1096#ifdef MAME_DEBUG
1096#ifdef ENABLE_DEBUGGER
10971097   sh4_syncronize_register_bank((sh4.sr & sRB) >> 29);
10981098#endif
10991099   if ((sh4.r[m] & sRB) != (sh4.sr & sRB))
r1649r1650
11221122   old = sh4.sr;
11231123   sh4.ea = sh4.r[m];
11241124   sh4.sr = RL( sh4.ea ) & FLAGS;
1125#ifdef MAME_DEBUG
1125#ifdef ENABLE_DEBUGGER
11261126   sh4_syncronize_register_bank((old & sRB) >> 29);
11271127#endif
11281128   if ((old & sRB) != (sh4.sr & sRB))
r1649r1650
17091709{
17101710   sh4.delay = sh4.pc;
17111711   sh4.pc = sh4.ea = sh4.spc;
1712#ifdef MAME_DEBUG
1712#ifdef ENABLE_DEBUGGER
17131713   sh4_syncronize_register_bank((sh4.sr & sRB) >> 29);
17141714#endif
17151715   if ((sh4.ssr & sRB) != (sh4.sr & sRB))
r1649r1650
35613561      else
35623562         opcode = cpu_readop16(WORD2_XOR_LE((UINT32)(sh4.pc & AM)));
35633563
3564      CALL_MAME_DEBUG;
3564      CALL_DEBUGGER(sh4.pc);
35653565
35663566      sh4.delay = 0;
35673567      sh4.pc += 2;
r1649r1650
45274527   }
45284528}
45294529
4530#ifdef MAME_DEBUG
4530#ifdef ENABLE_DEBUGGER
45314531static offs_t sh4_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
45324532{
45334533   return DasmSH4( buffer, pc, (oprom[1] << 8) | oprom[0] );
45344534}
4535#endif /* MAME_DEBUG */
4535#endif /* ENABLE_DEBUGGER */
45364536
45374537static void sh4_init(int index, int clock, const void *config, int (*irqcallback)(int))
45384538{
r1649r1650
49814981      case CPUINFO_PTR_RESET:                     info->reset = sh4_reset;            break;
49824982      case CPUINFO_PTR_EXECUTE:                  info->execute = sh4_execute;         break;
49834983      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
4984#ifdef MAME_DEBUG
4984#ifdef ENABLE_DEBUGGER
49854985      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = sh4_dasm;         break;
4986#endif /* MAME_DEBUG */
4986#endif /* ENABLE_DEBUGGER */
49874987      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sh4_icount;            break;
49884988
49894989      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/sh4/sh4.h
r1649r1650
8585WRITE32_HANDLER( sh4_internal_w );
8686READ32_HANDLER( sh4_internal_r );
8787
88#ifdef MAME_DEBUG
88#ifdef ENABLE_DEBUGGER
8989extern unsigned DasmSH4( char *dst, unsigned pc, UINT16 opcode );
9090#endif
9191
src/emu/cpu/mb88xx/mb88xx.c
r1649r1650
1414***************************************************************************/
1515
1616#include "debugger.h"
17#include "deprecat.h"
1718#include "mb88xx.h"
1819
1920/***************************************************************************
r1649r1650
236237      UINT8 opcode, arg, oc;
237238
238239      /* fetch the opcode */
239      CALL_MAME_DEBUG;
240      CALL_DEBUGGER(GETPC());
240241      opcode = READOP(GETPC());
241242
242243      /* increment the PC */
r1649r1650
850851      case CPUINFO_PTR_EXIT:                     info->exit = NULL;                  break;
851852      case CPUINFO_PTR_EXECUTE:                  info->execute = mb88_execute;         break;
852853      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
853#ifdef MAME_DEBUG
854#ifdef ENABLE_DEBUGGER
854855      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = mb88_dasm;         break;
855#endif /* MAME_DEBUG */
856#endif /* ENABLE_DEBUGGER */
856857      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &mb88_icount;         break;
857858
858859      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/mb88xx/mb88xx.h
r1649r1650
7171void mb8843_get_info(UINT32 state, cpuinfo *info);
7272void mb8844_get_info(UINT32 state, cpuinfo *info);
7373
74#ifdef MAME_DEBUG
74#ifdef ENABLE_DEBUGGER
7575offs_t mb88_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
7676#endif
7777
src/emu/cpu/alph8201/alph8201.c
r1649r1650
133133****************************************************************************/
134134
135135#include "debugger.h"
136#include "deprecat.h"
136137#include "alph8201.h"
137138
138139/* instruction cycle count */
r1649r1650
784785
785786      /* run */
786787      R.PREVPC = PC;
787      CALL_MAME_DEBUG;
788      CALL_DEBUGGER(PC);
788789      opcode =M_RDOP(PC);
789790#if TRACE_PC
790791mame_printf_debug("ALPHA8201:  PC = %03x,  opcode = %02x\n", PC, opcode);
r1649r1650
948949      case CPUINFO_PTR_RESET:                     info->reset = ALPHA8201_reset;         break;
949950      case CPUINFO_PTR_EXIT:                     info->exit = ALPHA8201_exit;         break;
950951      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
951#ifdef MAME_DEBUG
952#ifdef ENABLE_DEBUGGER
952953      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = ALPHA8201_dasm;      break;
953#endif /* MAME_DEBUG */
954#endif /* ENABLE_DEBUGGER */
954955      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &ALPHA8201_ICount;      break;
955956
956957      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/alph8201/alph8201.h
r1649r1650
6565 */
6666#define ALPHA8201_RDOP_ARG(A) ((unsigned)cpu_readop_arg(A))
6767
68#ifdef  MAME_DEBUG
68#ifdef  ENABLE_DEBUGGER
6969offs_t ALPHA8201_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
7070#endif
7171
src/emu/cpu/apexc/apexc.c
r1649r1650
324324*/
325325
326326#include "cpuintrf.h"
327#include "debugger.h"
328#include "deprecat.h"
327329#include "apexc.h"
328#include "debugger.h"
329330
330331typedef struct
331332{
r1649r1650
802803
803804   do
804805   {
805      CALL_MAME_DEBUG;
806      CALL_DEBUGGER(effective_address(apexc.ml));
806807
807808      if (apexc.running)
808809         execute();
r1649r1650
899900   case CPUINFO_PTR_EXECUTE:                  info->execute = apexc_execute;         break;
900901   case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
901902
902#ifdef MAME_DEBUG
903#ifdef ENABLE_DEBUGGER
903904   case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = apexc_dasm;      break;
904#endif /* MAME_DEBUG */
905#endif /* ENABLE_DEBUGGER */
905906   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &apexc_ICount;         break;
906907
907908   case CPUINFO_STR_NAME:                     strcpy(info->s = cpuintrf_temp_str(), "APEXC"); break;
src/emu/cpu/apexc/apexc.h
r1649r1650
2828#define apexc_writemem_masked(address, data, mask)   cpu_writemem13_32masked((address), (data), (mask))
2929#endif
3030
31#ifdef MAME_DEBUG
31#ifdef ENABLE_DEBUGGER
3232unsigned apexc_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
33#endif /* MAME_DEBUG */
33#endif /* ENABLE_DEBUGGER */
3434
3535#define apexc_readop(address)   apexc_readmem(address)
3636
src/emu/cpu/g65816/g65816.c
r1649r1650
310310
311311
312312/* Disassemble an instruction */
313#ifdef MAME_DEBUG
313#ifdef ENABLE_DEBUGGER
314314#include "g65816ds.h"
315315
316316static offs_t g65816_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
317317{
318318   return g65816_disassemble(buffer, (pc & 0x00ffff), (pc & 0xff0000) >> 16, oprom, FLAG_M, FLAG_X);
319319}
320#endif /* MAME_DEBUG */
320#endif /* ENABLE_DEBUGGER */
321321
322322
323323
r1649r1650
430430      case CPUINFO_PTR_EXIT:                     info->exit = g65816_exit;            break;
431431      case CPUINFO_PTR_EXECUTE:                  info->execute = g65816_execute;         break;
432432      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
433#ifdef MAME_DEBUG
433#ifdef ENABLE_DEBUGGER
434434      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = g65816_dasm;      break;
435#endif /* MAME_DEBUG */
435#endif /* ENABLE_DEBUGGER */
436436      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &g65816_ICount;         break;
437437      case CPUINFO_PTR_G65816_READVECTOR_CALLBACK:   info->f = (genf *) READ_VECTOR;         break;
438438
src/emu/cpu/g65816/g65816op.h
r1649r1650
24352435         g65816i_check_maskable_interrupt();
24362436
24372437         REGISTER_PPC = REGISTER_PC;
2438         G65816_CALL_DEBUGGER;
2438         G65816_CALL_DEBUGGER(REGISTER_PC);
24392439
24402440         REGISTER_PC++;
24412441         REGISTER_IR = read_8_IMM(REGISTER_PB | REGISTER_PPC);
src/emu/cpu/g65816/g65816.h
r1649r1650
8989void g65816_get_info(UINT32 state, cpuinfo *info);
9090
9191#undef G65816_CALL_DEBUGGER
92#define G65816_CALL_DEBUGGER CALL_MAME_DEBUG
92#define G65816_CALL_DEBUGGER CALL_DEBUGGER
9393
9494#define g65816_read_8(addr)          program_read_byte_8(addr)
9595#define g65816_write_8(addr,data)      program_write_byte_8(addr,data)
src/emu/cpu/g65816/g65816cm.h
r1649r1650
99/* ================================ INCLUDES ============================== */
1010/* ======================================================================== */
1111
12#include "g65816.h"
13#include "deprecat.h"
1214#include <limits.h>
13#include "g65816.h"
14#include <stdio.h>
1515
1616
1717/* ======================================================================== */
src/emu/cpu/nec/nec.c
r1649r1650
104104****************************************************************************/
105105
106106#include "debugger.h"
107#include "deprecat.h"
107108
108109typedef UINT8 BOOLEAN;
109110typedef UINT8 BYTE;
r1649r1650
151152   UINT32   pending_irq;
152153   UINT32   nmi_state;
153154   UINT32   irq_state;
155   UINT32   poll_state;
154156   UINT8   no_interrupt;
155157
156158   int     (*irq_callback)(int irqline);
r1649r1650
223225      Mod_RM.RM.w[i] = (WREGS)( i & 7 );
224226      Mod_RM.RM.b[i] = (BREGS)reg_name[i & 7];
225227    }
228
229   I.poll_state = 1;
226230}
227231
228232static void nec_exit (void)
r1649r1650
636640OP( 0x98, i_cbw       ) { I.regs.b[AH] = (I.regs.b[AL] & 0x80) ? 0xff : 0;      CLK(2);   }
637641OP( 0x99, i_cwd       ) { I.regs.w[DW] = (I.regs.b[AH] & 0x80) ? 0xffff : 0;   CLK(4);   }
638642OP( 0x9a, i_call_far  ) { UINT32 tmp, tmp2;   FETCHWORD(tmp); FETCHWORD(tmp2); PUSH(I.sregs[PS]); PUSH(I.ip); I.ip = (WORD)tmp; I.sregs[PS] = (WORD)tmp2; CHANGE_PC; CLKW(29,29,13,29,21,9,I.regs.w[SP]); }
639OP( 0x9b, i_wait      ) { logerror("%06x: Hardware POLL\n",activecpu_get_pc()); }
643OP( 0x9b, i_wait      ) { if (!I.poll_state) I.ip--; CLK(5); }
640644OP( 0x9c, i_pushf     ) { UINT16 tmp = CompressFlags(); PUSH( tmp ); CLKS(12,8,3); }
641645OP( 0x9d, i_popf      ) { UINT32 tmp; POP(tmp); ExpandFlags(tmp); CLKS(12,8,5); if (I.TF) nec_trap(); }
642646OP( 0x9e, i_sahf      ) { UINT32 tmp = (CompressFlags() & 0xff00) | (I.regs.b[AH] & 0xd5); ExpandFlags(tmp); CLKS(3,3,2); }
r1649r1650
9971001   }
9981002}
9991003
1000#ifdef MAME_DEBUG
1004static void set_poll_line(int state)
1005{
1006   I.poll_state = state;
1007}
1008
1009#ifdef ENABLE_DEBUGGER
10011010static offs_t nec_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
10021011{
10031012   return necv_dasm_one(buffer, pc, oprom);
10041013}
1005#endif /* MAME_DEBUG */
1014#endif /* ENABLE_DEBUGGER */
10061015
10071016static void nec_init(int index, int clock, const void *config, int (*irqcallback)(int), int type)
10081017{
r1649r1650
10211030   state_save_register_item(names[type], index, I.pending_irq);
10221031   state_save_register_item(names[type], index, I.nmi_state);
10231032   state_save_register_item(names[type], index, I.irq_state);
1033   state_save_register_item(names[type], index, I.poll_state);
10241034   state_save_register_item(names[type], index, I.AuxVal);
10251035   state_save_register_item(names[type], index, I.OverVal);
10261036   state_save_register_item(names[type], index, I.ZeroVal);
r1649r1650
11691179      if (I.no_interrupt)
11701180         I.no_interrupt--;
11711181
1172      CALL_MAME_DEBUG;
1182      CALL_DEBUGGER((I.sregs[PS]<<4) + I.ip);
11731183      nec_instruction[FETCHOP]();
11741184    }
11751185   return cycles - nec_ICount;
r1649r1650
12001210      if (I.no_interrupt)
12011211         I.no_interrupt--;
12021212
1203      CALL_MAME_DEBUG;
1213      CALL_DEBUGGER((I.sregs[PS]<<4) + I.ip);
12041214      nec_instruction[FETCHOP]();
12051215    }
12061216   return cycles - nec_ICount;
r1649r1650
12321242      if (I.no_interrupt)
12331243         I.no_interrupt--;
12341244
1235      CALL_MAME_DEBUG;
1245      CALL_DEBUGGER((I.sregs[PS]<<4) + I.ip);
12361246      nec_instruction[FETCHOP]();
12371247    }
12381248
r1649r1650
12511261   switch (state)
12521262   {
12531263      /* --- the following bits of info are set as 64-bit signed integers --- */
1254      case CPUINFO_INT_INPUT_STATE + 0:            set_irq_line(0, info->i);            break;
1255      case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:   set_irq_line(INPUT_LINE_NMI, info->i);   break;
1264      case CPUINFO_INT_INPUT_STATE + 0:               set_irq_line(0, info->i);            break;
1265      case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:      set_irq_line(INPUT_LINE_NMI, info->i);   break;
1266      case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_POLL:   set_poll_line(info->i);               break;
12561267
12571268      case CPUINFO_INT_PC:
12581269      case CPUINFO_INT_REGISTER + NEC_PC:
r1649r1650
13291340      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 16;               break;
13301341      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;               break;
13311342
1332      case CPUINFO_INT_INPUT_STATE + 0:            info->i = (I.pending_irq & INT_IRQ) ? ASSERT_LINE : CLEAR_LINE; break;
1333      case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:   info->i = I.nmi_state;               break;
1343      case CPUINFO_INT_INPUT_STATE + 0:               info->i = (I.pending_irq & INT_IRQ) ? ASSERT_LINE : CLEAR_LINE; break;
1344      case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:      info->i = I.nmi_state;            break;
1345      case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_POLL:   info->i = I.poll_state;            break;
13341346
13351347      case CPUINFO_INT_PREVIOUSPC:               /* not supported */                  break;
13361348
r1649r1650
13631375      case CPUINFO_PTR_EXIT:                     info->exit = nec_exit;               break;
13641376      case CPUINFO_PTR_EXECUTE:                  /* set per-CPU */                  break;
13651377      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1366#ifdef MAME_DEBUG
1378#ifdef ENABLE_DEBUGGER
13671379      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = nec_dasm;         break;
1368#endif /* MAME_DEBUG */
1380#endif /* ENABLE_DEBUGGER */
13691381      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &nec_ICount;            break;
13701382
13711383      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/nec/nec.h
r1649r1650
33typedef enum { DS1, PS, SS, DS0 } SREGS;
44typedef enum { AW, CW, DW, BW, SP, BP, IX, IY } WREGS;
55
6#define NEC_NMI_INT_VECTOR 2
6#define NEC_NMI_INT_VECTOR   2
7#define NEC_INPUT_LINE_POLL 20
78
89/* Cpu types, steps of 8 to help the cycle count calculation */
910#define V33 0
src/emu/cpu/i8051/i8051.c
r1649r1650
6464 *****************************************************************************/
6565
6666#include "debugger.h"
67#include "deprecat.h"
6768#include "i8051.h"
6869
6970#define VERBOSE 0
r1649r1650
599600      PPC = PC;
600601
601602      //Call Debugger
602      CALL_MAME_DEBUG;
603      CALL_DEBUGGER(PC);
603604
604605      //remove after testing
605606      if(PC != PPC)   op = cpu_readop(PC);
606607
607608      //Update Timer (if any timers are running)
608      if((GET_IT0 && GET_ET0) || (GET_IT1 && GET_ET1))
609      if((GET_TR0 && GET_ET0) || (GET_TR1 && GET_ET1))
609610         update_timer(i8051.prev_used_cycles);
610611
611612      //Update Serial (if serial port sending data)
r1649r1650
19481949   SET_AC(ac);
19491950   SET_OV(ov);
19501951
1951#ifdef MAME_DEBUG
1952#ifdef ENABLE_DEBUGGER
19521953//  mame_printf_debug("add: result=%x, c=%x, ac=%x, ov=%x\n",a+data+c,cy,ac,ov);
19531954#endif
19541955}
r1649r1650
19661967   SET_AC(ac);
19671968   SET_OV(ov);
19681969
1969#ifdef MAME_DEBUG
1970#ifdef ENABLE_DEBUGGER
19701971//  mame_printf_debug("sub: a=%x, d=%x, c=%x, result=%x, cy=%x, ac=%x, ov=%x\n",a,data,c,a-data-c,cy,ac,ov);
19711972#endif
19721973}
r1649r1650
24792480      case CPUINFO_PTR_EXIT:                     info->exit = i8051_exit;            break;
24802481      case CPUINFO_PTR_EXECUTE:                  info->execute = i8051_execute;         break;
24812482      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
2482#ifdef MAME_DEBUG
2483#ifdef ENABLE_DEBUGGER
24832484      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = i8051_dasm;         break;
2484#endif /* MAME_DEBUG */
2485#endif /* ENABLE_DEBUGGER */
24852486      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &i8051_icount;         break;
24862487
24872488      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = 0;   break;
src/emu/cpu/i8051/i8051.h
r1649r1650
114114extern void i8051_set_serial_rx_callback(int (*callback)(void));
115115extern void i8051_set_eram_iaddr_callback(READ32_HANDLER((*callback)));
116116
117#ifdef MAME_DEBUG
117#ifdef ENABLE_DEBUGGER
118118extern offs_t i8051_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
119#endif /* MAME_DEBUG */
119#endif /* ENABLE_DEBUGGER */
120120
121121/****************************************************************************
122122 * 8752 Section
src/emu/cpu/mips/mips3com.h
r1649r1650
218218
219219size_t mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, int index, int clock, const struct mips3_config *config, int (*irqcallback)(int), void *memory);
220220void mips3com_reset(mips3_state *mips);
221#ifdef MAME_DEBUG
221#ifdef ENABLE_DEBUGGER
222222offs_t mips3com_dasm(mips3_state *mips, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
223223#endif
224224void mips3com_update_cycle_counting(mips3_state *mips);
src/emu/cpu/mips/mdrc64.c
r1649r1650
7979***************************************************************************/
8080
8181#include "mips3fe.h"
82#include "deprecat.h"
8283
8384
8485/***************************************************************************
r1649r1650
228229   UINT32            abs32mask[4];
229230
230231   /* C functions */
231   x86code *         activecpu_gettotalcycles64;
232   x86code *         activecpu_gettotalcycles;
232233   x86code *         mips3com_update_cycle_counting;
233234   x86code *         mips3com_tlbr;
234235   x86code *         mips3com_tlbwi;
r1649r1650
440441   mips3.drcdata->abs32mask[0] = 0x7fffffff;
441442
442443   /* get pointers to C functions */
443   mips3.drcdata->activecpu_gettotalcycles64 = (x86code *)activecpu_gettotalcycles64;
444   mips3.drcdata->activecpu_gettotalcycles = (x86code *)activecpu_gettotalcycles;
444445   mips3.drcdata->mips3com_update_cycle_counting = (x86code *)mips3com_update_cycle_counting;
445446   mips3.drcdata->mips3com_tlbr = (x86code *)mips3com_tlbr;
446447   mips3.drcdata->mips3com_tlbwi = (x86code *)mips3com_tlbwi;
r1649r1650
30483049      case COP0_Count:
30493050         emit_flush_cycles_before_instruction(drc, compiler, desc, 1);
30503051         emit_mov_m32_r32(DRCTOP, CPR0ADDR(COP0_Count), REG_EAX);                  // mov  [Count],eax
3051         emit_call_m64(DRCTOP, MDRC(&mips3.drcdata->activecpu_gettotalcycles64));      // call activecpu_gettotalcycles64
3052         emit_call_m64(DRCTOP, MDRC(&mips3.drcdata->activecpu_gettotalcycles));         // call activecpu_gettotalcycles
30523053         emit_mov_r32_m32(DRCTOP, REG_EDX, CPR0ADDR(COP0_Count));                  // mov  edx,[Count]
30533054         emit_sub_r64_r64(DRCTOP, REG_RAX, REG_RDX);                              // sub  rax,rdx
30543055         emit_sub_r64_r64(DRCTOP, REG_RAX, REG_RDX);                              // sub  rax,rdx
r1649r1650
30983099      case COP0_Count:
30993100         compiler->cycles += MIPS3_COUNT_READ_CYCLES;
31003101         emit_flush_cycles_before_instruction(drc, compiler, desc, MIPS3_COUNT_READ_CYCLES);
3101         emit_call_m64(DRCTOP, MDRC(&mips3.drcdata->activecpu_gettotalcycles64));      // call activecpu_gettotalcycles64
3102         emit_call_m64(DRCTOP, MDRC(&mips3.drcdata->activecpu_gettotalcycles));         // call activecpu_gettotalcycles
31023103         emit_sub_r64_m64(DRCTOP, REG_RAX, MDRC(&mips3.core->count_zero_time));         // sub  rax,[count_zero_time]
31033104         emit_shr_r64_imm(DRCTOP, REG_RAX, 1);                                 // shr  rax,1
31043105         emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                           // movsxd rax,eax
r1649r1650
31113112
31123113      case COP0_Random:
31133114         emit_flush_cycles_before_instruction(drc, compiler, desc, 1);
3114         emit_call_m64(DRCTOP, MDRC(&mips3.drcdata->activecpu_gettotalcycles64));      // call activecpu_gettotalcycles64
3115         emit_call_m64(DRCTOP, MDRC(&mips3.drcdata->activecpu_gettotalcycles));         // call activecpu_gettotalcycles
31153116         emit_mov_r32_m32(DRCTOP, REG_ECX, CPR0ADDR(COP0_Wired));                  // mov  ecx,[Wired]
31163117         emit_mov_r32_imm(DRCTOP, REG_R8D, 48);                                 // mov  r8d,48
31173118         emit_and_r32_imm(DRCTOP, REG_ECX, 0x3f);                              // and  ecx,0x3f
src/emu/cpu/mips/r3000.c
r1649r1650
77***************************************************************************/
88
99#include "debugger.h"
10#include "deprecat.h"
1011#include "r3000.h"
1112
1213
r1649r1650
750751
751752      /* debugging */
752753      r3000.ppc = r3000.pc;
753      CALL_MAME_DEBUG;
754      CALL_DEBUGGER(r3000.pc);
754755
755756      /* instruction fetch */
756757      op = ROPCODE(r3000.pc);
r1649r1650
932933    DISASSEMBLY HOOK
933934***************************************************************************/
934935
935#ifdef MAME_DEBUG
936#ifdef ENABLE_DEBUGGER
936937static offs_t r3000_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
937938{
938939   extern unsigned dasmr3k(char *, unsigned, UINT32);
r1649r1650
944945
945946   return dasmr3k(buffer, pc, op);
946947}
947#endif /* MAME_DEBUG */
948#endif /* ENABLE_DEBUGGER */
948949
949950
950951
r1649r1650
12871288      case CPUINFO_PTR_EXIT:                     info->exit = r3000_exit;            break;
12881289      case CPUINFO_PTR_EXECUTE:                  info->execute = r3000_execute;         break;
12891290      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1290#ifdef MAME_DEBUG
1291#ifdef ENABLE_DEBUGGER
12911292      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = r3000_dasm;         break;
1292#endif /* MAME_DEBUG */
1293#endif /* ENABLE_DEBUGGER */
12931294      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &r3000_icount;         break;
12941295
12951296      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/mips/psx.c
r1649r1650
1313 *
1414 */
1515
16#include "ui.h"
1716#include "debugger.h"
17#include "deprecat.h"
18#include "osd_cpu.h"
1819#include "psx.h"
19#include "osd_cpu.h"
2020
2121#define LOG_BIOSCALL ( 0 )
2222
r1649r1650
152152static void mips_stop( void )
153153{
154154   DEBUGGER_BREAK;
155   CALL_MAME_DEBUG;
155   CALL_DEBUGGER(mipscpu.pc);
156156}
157157
158158#if LOG_BIOSCALL
r1649r1650
987987      log_bioscall();
988988#endif
989989
990      CALL_MAME_DEBUG;
990      CALL_DEBUGGER(mipscpu.pc);
991991
992992      mipscpu.op = cpu_readop32( mipscpu.pc );
993993      switch( INS_OP( mipscpu.op ) )
r1649r1650
22612261 * Return a formatted string for a register
22622262 ****************************************************************************/
22632263
2264#ifdef MAME_DEBUG
2264#ifdef ENABLE_DEBUGGER
22652265static offs_t mips_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
22662266{
22672267   return DasmMIPS( buffer, pc, opram );
22682268}
2269#endif /* MAME_DEBUG */
2269#endif /* ENABLE_DEBUGGER */
22702270
22712271/* preliminary gte code */
22722272
r1649r1650
34753475      case CPUINFO_PTR_EXIT:                     info->exit = mips_exit;               break;
34763476      case CPUINFO_PTR_EXECUTE:                  info->execute = mips_execute;         break;
34773477      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
3478#ifdef MAME_DEBUG
3478#ifdef ENABLE_DEBUGGER
34793479      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = mips_dasm;         break;
3480#endif /* MAME_DEBUG */
3480#endif /* ENABLE_DEBUGGER */
34813481      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &mips_ICount;         break;
34823482
34833483      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/mips/psx.h
r1649r1650
195195/* OP_COP0 */
196196#define CF_RFE ( 16 )
197197
198#ifdef MAME_DEBUG
198#ifdef ENABLE_DEBUGGER
199199extern unsigned DasmMIPS( char *buffer, UINT32 pc, const UINT8 *opram );
200200#endif
201201
src/emu/cpu/mips/mips3drc.c
r1649r1650
1616#include "debugger.h"
1717#include "mips3com.h"
1818#include "mips3fe.h"
19#include "deprecat.h"
1920#include "cpu/x86log.h"
2021#include "cpu/drcfe.h"
2122
r1649r1650
3031#define LOG_CODE            (0)
3132#define SINGLE_INSTRUCTION_MODE   (0)
3233
33#ifdef MAME_DEBUG
34#ifdef ENABLE_DEBUGGER
3435#define COMPARE_AGAINST_C      (0)
3536#else
3637#define COMPARE_AGAINST_C      (0)
r1649r1650
302303    mips3_dasm - disassemble an instruction
303304-------------------------------------------------*/
304305
305#ifdef MAME_DEBUG
306#ifdef ENABLE_DEBUGGER
306307static offs_t mips3_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
307308{
308309   return mips3com_dasm(mips3.core, buffer, pc, oprom, opram);
309310}
310#endif /* MAME_DEBUG */
311#endif /* ENABLE_DEBUGGER */
311312
312313
313314
r1649r1650
568569      case CPUINFO_PTR_RESET:                     info->reset = mips3_reset;            break;
569570      case CPUINFO_PTR_EXIT:                     info->exit = mips3_exit;            break;
570571      case CPUINFO_PTR_EXECUTE:                  info->execute = mips3_execute;         break;
571#ifdef MAME_DEBUG
572#ifdef ENABLE_DEBUGGER
572573      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = mips3_dasm;         break;
573#endif /* MAME_DEBUG */
574#endif /* ENABLE_DEBUGGER */
574575      case CPUINFO_PTR_TRANSLATE:                  info->translate = mips3_translate;      break;
575576
576577      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
912913    DISASSEMBLERS
913914***************************************************************************/
914915
915#if !defined(MAME_DEBUG) && (LOG_CODE)
916#if !defined(ENABLE_DEBUGGER) && (LOG_CODE)
916917#include "mips3dsm.c"
917918#endif
918919
src/emu/cpu/mips/mdrcold.c
r1649r1650
10011001   UINT32 result;
10021002   UINT32 physpc;
10031003
1004#ifdef MAME_DEBUG
1004#ifdef ENABLE_DEBUGGER
10051005   if (Machine->debug_mode)
10061006   {
10071007      /* emit debugging */
r1649r1650
35713571         emit_mov_m32_r32(DRCTOP, CPR0ADDR(COP0_Status), REG_EAX);                  // mov  [COP0_Status],eax
35723572         emit_xor_r32_r32(DRCTOP, REG_EBX, REG_EAX);                              // xor  ebx,eax
35733573/*
3574#ifdef MAME_DEBUG
3574#ifdef ENABLE_DEBUGGER
35753575            _test_r32_imm(REG_EAX, 0xe0);                                                   // test eax,0xe0
35763576            _jcc_short_link(COND_Z, &link1);                                                // jz   skip
35773577            _sub_r32_imm(REG_ESP, 4);                                                       // sub  esp,4
r1649r1650
35943594         emit_mov_m32_r32(DRCTOP, ICOUNTADDR, REG_EBP);                           // mov  [icount],ebp
35953595         emit_sub_r32_imm(DRCTOP, REG_ESP, 8);                                 // sub  esp,8
35963596         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
3597         emit_call(DRCTOP, (x86code *)activecpu_gettotalcycles64);                  // call activecpu_gettotalcycles64
3597         emit_call(DRCTOP, (x86code *)activecpu_gettotalcycles);                     // call activecpu_gettotalcycles
35983598         emit_pop_r32(DRCTOP, REG_EBX);                                       // pop  ebx
35993599         emit_add_r32_imm(DRCTOP, REG_ESP, 8);                                 // add  esp,8
36003600         emit_sub_r32_r32(DRCTOP, REG_EAX, REG_EBX);                              // sub  eax,ebx
r1649r1650
36473647         resolve_link(DRCTOP, &link1);                                    // notneg:
36483648         emit_mov_m32_r32(DRCTOP, ICOUNTADDR, REG_EBP);                           // mov  [icount],ebp
36493649         emit_sub_r32_imm(DRCTOP, REG_ESP, 12);                                 // sub  esp,12
3650         emit_call(DRCTOP, (x86code *)activecpu_gettotalcycles64);                  // call activecpu_gettotalcycles64
3650         emit_call(DRCTOP, (x86code *)activecpu_gettotalcycles);                     // call activecpu_gettotalcycles
36513651         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
36523652         emit_sub_r32_m32(DRCTOP, REG_EAX, MABS(LO(&mips3.core->count_zero_time)));      // sub  eax,[mips3.core->count_zero_time+0]
36533653         emit_sbb_r32_m32(DRCTOP, REG_EDX, MABS(HI(&mips3.core->count_zero_time)));      // sbb  edx,[mips3.core->count_zero_time+4]
src/emu/cpu/mips/mips3com.c
r1649r1650
144144   mips->cpr[0][COP0_Count] = 0;
145145   mips->cpr[0][COP0_Config] = compute_config_register(mips);
146146   mips->cpr[0][COP0_PRId] = compute_prid_register(mips);
147   mips->count_zero_time = activecpu_gettotalcycles64();
147   mips->count_zero_time = activecpu_gettotalcycles();
148148
149149   /* recompute the TLB table */
150150   mips3com_recompute_tlb_table(mips);
r1649r1650
156156    CPU
157157-------------------------------------------------*/
158158
159#ifdef MAME_DEBUG
159#ifdef ENABLE_DEBUGGER
160160offs_t mips3com_dasm(mips3_state *mips, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
161161{
162162   extern unsigned dasmmips3(char *, unsigned, UINT32);
r1649r1650
167167      op = LITTLE_ENDIANIZE_INT32(op);
168168   return dasmmips3(buffer, pc, op);
169169}
170#endif /* MAME_DEBUG */
170#endif /* ENABLE_DEBUGGER */
171171
172172
173173
r1649r1650
181181   /* modify the timer to go off */
182182   if ((mips->cpr[0][COP0_Status] & SR_IMEX5) && mips->cpr[0][COP0_Compare] != 0xffffffff)
183183   {
184      UINT32 count = (activecpu_gettotalcycles64() - mips->count_zero_time) / 2;
184      UINT32 count = (activecpu_gettotalcycles() - mips->count_zero_time) / 2;
185185      UINT32 compare = mips->cpr[0][COP0_Compare];
186186      UINT32 cyclesleft = compare - count;
187187      attotime newtime = ATTOTIME_IN_CYCLES(((INT64)cyclesleft * 2), cpu_getactivecpu());
r1649r1650
362362
363363   /* "random" is based off of the current cycle counting through the non-wired pages */
364364   if (unwired > 0)
365      index = ((activecpu_gettotalcycles64() - mips->count_zero_time) % unwired + wired) & 0x3f;
365      index = ((activecpu_gettotalcycles() - mips->count_zero_time) % unwired + wired) & 0x3f;
366366
367367   /* use the common handler to write to this index */
368368   tlb_write_common(mips, index);
r1649r1650
559559      case CPUINFO_INT_REGISTER + MIPS3_SR:         info->i = mips->cpr[0][COP0_Status];   break;
560560      case CPUINFO_INT_REGISTER + MIPS3_EPC:         info->i = mips->cpr[0][COP0_EPC];      break;
561561      case CPUINFO_INT_REGISTER + MIPS3_CAUSE:      info->i = mips->cpr[0][COP0_Cause];      break;
562      case CPUINFO_INT_REGISTER + MIPS3_COUNT:      info->i = ((activecpu_gettotalcycles64() - mips->count_zero_time) / 2); break;
562      case CPUINFO_INT_REGISTER + MIPS3_COUNT:      info->i = ((activecpu_gettotalcycles() - mips->count_zero_time) / 2); break;
563563      case CPUINFO_INT_REGISTER + MIPS3_COMPARE:      info->i = mips->cpr[0][COP0_Compare];   break;
564564      case CPUINFO_INT_REGISTER + MIPS3_INDEX:      info->i = mips->cpr[0][COP0_Index];      break;
565565      case CPUINFO_INT_REGISTER + MIPS3_RANDOM:      info->i = mips->cpr[0][COP0_Random];   break;
r1649r1650
631631      case CPUINFO_STR_REGISTER + MIPS3_SR:         sprintf(info->s, "SR: %08X", (UINT32)mips->cpr[0][COP0_Status]); break;
632632      case CPUINFO_STR_REGISTER + MIPS3_EPC:         sprintf(info->s, "EPC:%08X", (UINT32)mips->cpr[0][COP0_EPC]); break;
633633      case CPUINFO_STR_REGISTER + MIPS3_CAUSE:       sprintf(info->s, "Cause:%08X", (UINT32)mips->cpr[0][COP0_Cause]); break;
634      case CPUINFO_STR_REGISTER + MIPS3_COUNT:       sprintf(info->s, "Count:%08X", (UINT32)((activecpu_gettotalcycles64() - mips->count_zero_time) / 2)); break;
634      case CPUINFO_STR_REGISTER + MIPS3_COUNT:       sprintf(info->s, "Count:%08X", (UINT32)((activecpu_gettotalcycles() - mips->count_zero_time) / 2)); break;
635635      case CPUINFO_STR_REGISTER + MIPS3_COMPARE:      sprintf(info->s, "Compare:%08X", (UINT32)mips->cpr[0][COP0_Compare]); break;
636636      case CPUINFO_STR_REGISTER + MIPS3_INDEX:      sprintf(info->s, "Index:%08X", (UINT32)mips->cpr[0][COP0_Index]); break;
637637      case CPUINFO_STR_REGISTER + MIPS3_RANDOM:      sprintf(info->s, "Random:%08X", (UINT32)mips->cpr[0][COP0_Random]); break;
src/emu/cpu/mips/mips3.c
r1649r1650
99
1010***************************************************************************/
1111
12#include <math.h>
13#include "cpuintrf.h"
1412#include "debugger.h"
13#include "deprecat.h"
1514#include "mips3com.h"
1615
1716
r1649r1650
299298}
300299
301300
302#ifdef MAME_DEBUG
301#ifdef ENABLE_DEBUGGER
303302offs_t mips3_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
304303{
305304   /* common disassemble */
306305   return mips3com_dasm(&mips3.core, buffer, pc, oprom, opram);
307306}
308#endif /* MAME_DEBUG */
307#endif /* ENABLE_DEBUGGER */
309308
310309
311310
r1649r1650
480479         mips3.core.icount -= MIPS3_COUNT_READ_CYCLES;
481480      else
482481         mips3.core.icount = 0;
483      return (UINT32)((activecpu_gettotalcycles64() - mips3.core.count_zero_time) / 2);
482      return (UINT32)((activecpu_gettotalcycles() - mips3.core.count_zero_time) / 2);
484483   }
485484   else if (idx == COP0_Cause)
486485   {
r1649r1650
496495      int wired = mips3.core.cpr[0][COP0_Wired] & 0x3f;
497496      int range = 48 - wired;
498497      if (range > 0)
499         return ((activecpu_gettotalcycles64() - mips3.core.count_zero_time) % range + wired) & 0x3f;
498         return ((activecpu_gettotalcycles() - mips3.core.count_zero_time) % range + wired) & 0x3f;
500499      else
501500         return 47;
502501   }
r1649r1650
536535
537536      case COP0_Count:
538537         mips3.core.cpr[0][idx] = val;
539         mips3.core.count_zero_time = activecpu_gettotalcycles64() - ((UINT64)(UINT32)val * 2);
538         mips3.core.count_zero_time = activecpu_gettotalcycles() - ((UINT64)(UINT32)val * 2);
540539         mips3com_update_cycle_counting(&mips3.core);
541540         break;
542541
r1649r1650
16821681
16831682      /* debugging */
16841683      mips3.ppc = mips3.core.pc;
1685      CALL_MAME_DEBUG;
1684      CALL_DEBUGGER(mips3.core.pc);
16861685
16871686      /* instruction fetch */
16881687      op = ROPCODE(mips3.pcbase | (mips3.core.pc & 0xfff));
r1649r1650
21392138      case CPUINFO_PTR_INIT:                     /* provided per-CPU */               break;
21402139      case CPUINFO_PTR_RESET:                     info->reset = mips3_reset;            break;
21412140      case CPUINFO_PTR_EXECUTE:                  info->execute = mips3_execute;         break;
2142#ifdef MAME_DEBUG
2141#ifdef ENABLE_DEBUGGER
21432142      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = mips3_dasm;         break;
21442143#endif
21452144      case CPUINFO_PTR_TRANSLATE:                  info->translate = mips3_translate;      break;
src/emu/cpu/tms7000/tms7000.h
r1649r1650
4747extern void tms7000_get_info(UINT32 state, cpuinfo *info);
4848extern void tms7000_exl_get_info(UINT32 state, cpuinfo *info);
4949
50#ifdef MAME_DEBUG
50#ifdef ENABLE_DEBUGGER
5151extern unsigned tms7000_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram );
52#endif /* MAME_DEBUG */
52#endif /* ENABLE_DEBUGGER */
5353
5454#endif /* _TMS7000_H */
5555
src/emu/cpu/tms7000/tms7000.c
r1649r1650
3131#include "cpuintrf.h"
3232#include "debugger.h"
3333#include "tms7000.h"
34#include "deprecat.h"
3435
3536#define VERBOSE 0
3637
r1649r1650
330331        case CPUINFO_PTR_RESET:   info->reset = tms7000_reset;   break;
331332        case CPUINFO_PTR_EXECUTE:   info->execute = tms7000_execute;   break;
332333        case CPUINFO_PTR_BURN:   info->burn = NULL;   /* Not supported */break;
333#ifdef MAME_DEBUG
334#ifdef ENABLE_DEBUGGER
334335        case CPUINFO_PTR_DISASSEMBLE:   info->disassemble = tms7000_dasm;   break;
335336#endif
336337        case CPUINFO_PTR_INSTRUCTION_COUNTER:   info->icount = &tms7000_icount;   break;
r1649r1650
470471
471472   do
472473   {
473      CALL_MAME_DEBUG;
474      CALL_DEBUGGER(pPC);
474475
475476      if( tms7000.idle_state == 0 )
476477      {
r1649r1650
509510
510511   do
511512   {
512      CALL_MAME_DEBUG;
513      CALL_DEBUGGER(pPC);
513514
514515      if( tms7000.idle_state == 0 )
515516      {
src/emu/cpu/f8/f8.c
r1649r1650
2626   added interrupt functionality
2727 */
2828
29#include <stdio.h>
30#include "cpuintrf.h"
3129#include "debugger.h"
30#include "deprecat.h"
3231#include "f8.h"
3332
3433#define S   0x01
r1649r1650
15771576    do
15781577    {
15791578   UINT8 op=f8.dbus;
1580        CALL_MAME_DEBUG;
1579        CALL_DEBUGGER((f8.pc0 - 1) & 0xffff);
15811580
15821581   switch( op )
15831582        {
r1649r1650
18921891      f8 = *(f8_Regs *) src;
18931892}
18941893
1895#ifdef MAME_DEBUG
1894#ifdef ENABLE_DEBUGGER
18961895unsigned f8_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
1897#endif /* MAME_DEBUG */
1896#endif /* ENABLE_DEBUGGER */
18981897
18991898static void f8_init (int index, int clock, const void *config, int (*irqcallback)(int))
19001899{
r1649r1650
21172116   case CPUINFO_PTR_EXECUTE:                  info->execute = f8_execute;            break;
21182117   case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
21192118
2120#ifdef MAME_DEBUG
2119#ifdef ENABLE_DEBUGGER
21212120   case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = f8_dasm;      break;
2122#endif /* MAME_DEBUG */
2121#endif /* ENABLE_DEBUGGER */
21232122   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &f8_icount;            break;
21242123
21252124   /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/z80/z80.c
r1649r1650
9494 *****************************************************************************/
9595
9696#include "debugger.h"
97#include "deprecat.h"
9798#include "z80.h"
9899#include "z80daisy.h"
99100
r1649r1650
35653566      Z80.after_ei = FALSE;
35663567
35673568      PRVPC = PCD;
3568      CALL_MAME_DEBUG;
3569      CALL_DEBUGGER(PCD);
35693570      R++;
35703571      EXEC_INLINE(op,ROP());
35713572   } while( z80_ICount > 0 );
r1649r1650
37553756      case CPUINFO_PTR_EXIT:                  info->exit = z80_exit;                  break;
37563757      case CPUINFO_PTR_EXECUTE:               info->execute = z80_execute;            break;
37573758      case CPUINFO_PTR_BURN:                  info->burn = NULL;                     break;
3758#ifdef MAME_DEBUG
3759#ifdef ENABLE_DEBUGGER
37593760      case CPUINFO_PTR_DISASSEMBLE:            info->disassemble = z80_dasm;            break;
37603761#endif
37613762      case CPUINFO_PTR_INSTRUCTION_COUNTER:            info->icount = &z80_ICount;         break;
src/emu/cpu/z80/z80.h
r1649r1650
2929
3030extern void z80_get_info(UINT32 state, cpuinfo *info);
3131
32#ifdef MAME_DEBUG
32#ifdef ENABLE_DEBUGGER
3333extern unsigned z80_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
3434#endif
3535
src/emu/cpu/asap/asap.c
r1649r1650
1010***************************************************************************/
1111
1212#include "debugger.h"
13#include "deprecat.h"
1314#include "asap.h"
1415
1516
r1649r1650
508509{
509510   /* debugging */
510511   asap.ppc = asap.pc;
511   CALL_MAME_DEBUG;
512   CALL_DEBUGGER(asap.pc);
512513
513514   /* instruction fetch */
514515   asap.op.d = ROPCODE(asap.pc);
r1649r1650
564565    DISASSEMBLY HOOK
565566***************************************************************************/
566567
567#ifdef MAME_DEBUG
568#ifdef ENABLE_DEBUGGER
568569extern offs_t asap_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
569#endif /* MAME_DEBUG */
570#endif /* ENABLE_DEBUGGER */
570571
571572
572573
r1649r1650
18061807      case CPUINFO_PTR_EXIT:                     info->exit = asap_exit;               break;
18071808      case CPUINFO_PTR_EXECUTE:                  info->execute = asap_execute;         break;
18081809      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1809#ifdef MAME_DEBUG
1810#ifdef ENABLE_DEBUGGER
18101811      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = asap_dasm;         break;
1811#endif /* MAME_DEBUG */
1812#endif /* ENABLE_DEBUGGER */
18121813      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &asap_icount;         break;
18131814
18141815      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/tms9900/99xxcore.h
r1649r1650
8686*/
8787
8888
89#include "cpuintrf.h"
9089#include "debugger.h"
90#include "deprecat.h"
9191#include "tms9900.h"
92#include <math.h>
9392
9493
9594#if (TMS99XX_MODEL == TI990_10_ID)
r1649r1650
14741473         }
14751474      }
14761475
1477      #ifdef MAME_DEBUG
1476      #ifdef ENABLE_DEBUGGER
14781477      {
14791478         if (Machine->debug_mode)
14801479         {
r1649r1650
15031502               #endif
15041503            #endif
15051504
1506            mame_debug_hook();
1505            mame_debug_hook(I.IR);
15071506         }
15081507      }
15091508      #endif
r1649r1650
19671966
19681967#endif
19691968
1970#ifdef MAME_DEBUG
1969#ifdef ENABLE_DEBUGGER
19711970static unsigned tms99xx_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
19721971{
19731972   return Dasm9900(buffer, pc, TMS99XX_MODEL, oprom, opram);
19741973}
1975#endif /* MAME_DEBUG */
1974#endif /* ENABLE_DEBUGGER */
19761975
19771976
19781977/*****************************************************************************/
r1649r1650
48124811      case CPUINFO_PTR_EXIT:                     info->exit = tms99xx_exit;            break;
48134812      case CPUINFO_PTR_EXECUTE:                  info->execute = tms99xx_execute;      break;
48144813      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
4815#ifdef MAME_DEBUG
4814#ifdef ENABLE_DEBUGGER
48164815      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tms99xx_dasm;      break;
4817#endif /* MAME_DEBUG */
4816#endif /* ENABLE_DEBUGGER */
48184817      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &TMS99XX_ICOUNT;         break;
48194818
48204819      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/tms9900/tms9900.h
r1649r1650
214214
215215#endif
216216
217#ifdef MAME_DEBUG
217#ifdef ENABLE_DEBUGGER
218218unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const UINT8 *oprom, const UINT8 *opram);
219219#endif
220220
src/emu/cpu/i960/i960.c
r1649r1650
11#include "debugger.h"
2#include "deprecat.h"
23#include "i960.h"
34#include "i960dis.h"
45#include <math.h>
r1649r1650
618619   check_irqs();
619620   while(i960_icount >= 0) {
620621      i960.PIP = i960.IP;
621      CALL_MAME_DEBUG;
622      CALL_DEBUGGER(i960.IP);
622623
623624      i960.bursting = 0;
624625
r1649r1650
20672068   state_save_register_item_array("i960", index, i960.rcache_frame_addr);
20682069}
20692070
2070#ifdef MAME_DEBUG
2071#ifdef ENABLE_DEBUGGER
20712072static offs_t i960_disasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
20722073{
20732074   disassemble_t dis;
r1649r1650
20802081
20812082   return dis.IPinc | dis.disflags | DASMFLAG_SUPPORTED;
20822083}
2083#endif /* MAME_DEBUG */
2084#endif /* ENABLE_DEBUGGER */
20842085
20852086static void i960_reset(void)
20862087{
r1649r1650
21182119   case CPUINFO_PTR_EXIT:                  info->exit        = 0;                     break;
21192120   case CPUINFO_PTR_EXECUTE:               info->execute     = i960_execute;            break;
21202121   case CPUINFO_PTR_BURN:                  info->burn        = 0;                     break;
2121#ifdef MAME_DEBUG
2122#ifdef ENABLE_DEBUGGER
21222123   case CPUINFO_PTR_DISASSEMBLE:            info->disassemble = i960_disasm;            break;
2123#endif /* MAME_DEBUG */
2124#endif /* ENABLE_DEBUGGER */
21242125   case CPUINFO_PTR_INSTRUCTION_COUNTER:      info->icount      = &i960_icount;            break;
21252126   case CPUINFO_INT_CONTEXT_SIZE:            info->i           = sizeof(i960_state);         break;
21262127   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:      info->i           = 4;                     break;
src/emu/cpu/x64drc.c
r1649r1650
6565#include "x64drc.h"
6666#include "debugger.h"
6767
68#include <stddef.h>
68#ifdef ENABLE_DEBUGGER
69#include "deprecat.h"
70#endif
6971
7072
7173
r1649r1650
173175      goto error;
174176
175177   /* get pointers to external C functions */
176#ifdef MAME_DEBUG
178#ifdef ENABLE_DEBUGGER
177179   drc->mame_debug_hook = (x86code *)mame_debug_hook;
178180#endif
179181   drc->recompile_code = (x86code *)recompile_code;
r1649r1650
419421
420422void drc_append_call_debugger(drc_core *drc)
421423{
422#ifdef MAME_DEBUG
424#ifdef ENABLE_DEBUGGER
423425   if (Machine->debug_mode)
424426      emit_call_m64(DRCTOP, MDRC(&drc->mame_debug_hook));                     // call mame_debug_hook
425427#endif
src/emu/cpu/v810/v810.c
r1649r1650
1717********************************************/
1818
1919#include "debugger.h"
20#include "deprecat.h"
2021#include "v810.h"
2122
2223#define clkIF 3
r1649r1650
973974   while(v810_ICount>=0)
974975   {
975976      v810.PPC=PC;
976      CALL_MAME_DEBUG;
977      CALL_DEBUGGER(PC);
977978      OP=R_OP(PC);
978979      PC+=2;
979980      v810_ICount-= OpCodeTable[OP>>10]();
r1649r1650
11821183      case CPUINFO_PTR_EXIT:                     info->exit = NULL;                  break;
11831184      case CPUINFO_PTR_EXECUTE:                  info->execute = v810_execute;         break;
11841185      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1185#ifdef MAME_DEBUG
1186#ifdef ENABLE_DEBUGGER
11861187      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = v810_dasm;         break;
1187#endif /* MAME_DEBUG */
1188#endif /* ENABLE_DEBUGGER */
11881189      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &v810_ICount;         break;
11891190
11901191      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/v810/v810.h
r1649r1650
4646#define ADD(dst, src)      { UINT64 res=(UINT64)(dst)+(UINT64)(src); SetCF(res); SetOF_Add(res,src,dst); SetSZPF(res); dst=(UINT32)res; }
4747#define SUB(dst, src)      { UINT64 res=(UINT64)(dst)-(INT64)(src); SetCF(res); SetOF_Sub(res,src,dst); SetSZPF(res); dst=(UINT32)res; }
4848
49#ifdef MAME_DEBUG
49#ifdef ENABLE_DEBUGGER
5050offs_t v810_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
5151#endif
5252
src/emu/cpu/tms32025/32025dsm.c
r1649r1650
3333#include <string.h>
3434#include <ctype.h>
3535
36#ifdef MAME_DEBUG               /* Compile interface to MAME */
36#ifdef ENABLE_DEBUGGER               /* Compile interface to MAME */
3737#include "tms32025.h"
3838#include "debugger.h"
3939extern UINT16 *tms32025_pgmmap[0x200];
src/emu/cpu/tms32025/tms32025.c
r1649r1650
118118
119119
120120
121#include "debugger.h"
122#include "deprecat.h"
121123#include "tms32025.h"
122#include "debugger.h"
123124
124125
125126#define CLK 4   /* 1 cycle equals 4 clock ticks */      /* PE/DI */
r1649r1650
19811982   while (R.idle && tms32025_icount > 0)
19821983      process_timer(tms32025_icount);
19831984
1984   if (tms32025_icount <= 0) CALL_MAME_DEBUG;
1985   if (tms32025_icount <= 0) CALL_DEBUGGER(R.PC);
19851986
19861987
19871988   while (tms32025_icount > 0)
r1649r1650
19941995
19951996      R.PREVPC = R.PC;
19961997
1997      CALL_MAME_DEBUG;
1998      CALL_DEBUGGER(R.PC);
19981999
19992000      R.opcode.d = M_RDOP(R.PC);
20002001      R.PC++;
r1649r1650
20192020      if (R.init_load_addr == 2) {      /* Repeat next instruction */
20202021         R.PREVPC = R.PC;
20212022
2022         CALL_MAME_DEBUG;
2023         CALL_DEBUGGER(R.PC);
20232024
20242025         R.opcode.d = M_RDOP(R.PC);
20252026         R.PC++;
r1649r1650
23842385      case CPUINFO_PTR_EXIT:                     info->exit = tms32025_exit;            break;
23852386      case CPUINFO_PTR_EXECUTE:                  info->execute = tms32025_execute;      break;
23862387      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
2387#ifdef MAME_DEBUG
2388#ifdef ENABLE_DEBUGGER
23882389      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tms32025_dasm;      break;
2389#endif /* MAME_DEBUG */
2390#endif /* ENABLE_DEBUGGER */
23902391      case CPUINFO_PTR_READ:                     info->read = tms32025_read;            break;
23912392      case CPUINFO_PTR_WRITE:                     info->write = tms32025_write;         break;
23922393      case CPUINFO_PTR_READOP:                  info->readop = tms32025_readop;         break;
src/emu/cpu/tms32025/tms32025.h
r1649r1650
7171extern void tms32026_get_info(UINT32 state, cpuinfo *info);
7272
7373
74#ifdef   MAME_DEBUG
74#ifdef   ENABLE_DEBUGGER
7575offs_t tms32025_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
7676#endif
7777
src/emu/cpu/pic16c5x/pic16c5x.c
r1649r1650
5454
5555
5656#include "debugger.h"
57#include "deprecat.h"
5758#include "pic16c5x.h"
5859
5960
r1649r1650
840841      if (PD == 0)                  /* Sleep Mode */
841842      {
842843         inst_cycles = (1*CLK);
843         CALL_MAME_DEBUG;
844         CALL_DEBUGGER(R.PC);
844845         if (WDTE) {
845846            pic16C5x_update_watchdog(1*CLK);
846847         }
r1649r1650
849850      {
850851         R.PREVPC = R.PC;
851852
852         CALL_MAME_DEBUG;
853         CALL_DEBUGGER(R.PC);
853854
854855         R.opcode.d = M_RDOP(R.PC);
855856         R.PC++;
r1649r1650
10121013      case CPUINFO_PTR_EXIT:                     info->exit = pic16C5x_exit;            break;
10131014      case CPUINFO_PTR_EXECUTE:                  info->execute = pic16C5x_execute;      break;
10141015      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1015#ifdef MAME_DEBUG
1016#ifdef ENABLE_DEBUGGER
10161017      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = pic16C5x_dasm;      break;
1017#endif /* MAME_DEBUG */
1018#endif /* ENABLE_DEBUGGER */
10181019      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &pic16C5x_icount;      break;
10191020
10201021      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/pic16c5x/pic16c5x.h
r1649r1650
126126
127127
128128#if (HAS_PIC16C54) || (HAS_PIC16C55) || (HAS_PIC16C56) || (HAS_PIC16C57) || (HAS_PIC16C58)
129#ifdef MAME_DEBUG
129#ifdef ENABLE_DEBUGGER
130130offs_t pic16C5x_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
131131#endif
132132#endif
src/emu/cpu/pic16c5x/16c5xdsm.c
r1649r1650
2626#include <string.h>
2727#include <ctype.h>
2828
29#ifdef MAME_DEBUG               /* Compile interface to MAME */
29#ifdef ENABLE_DEBUGGER               /* Compile interface to MAME */
3030#include "cpuintrf.h"
3131static const UINT8 *rombase;
3232static const UINT8 *rambase;
src/emu/cpu/pdp1/tx0.h
r1649r1650
4444#define READ_TX0_18BIT(A) ((signed)program_read_dword_32be((A)<<2))
4545#define WRITE_TX0_18BIT(A,V) (program_write_dword_32be((A)<<2,(V)))
4646
47#ifdef MAME_DEBUG
47#ifdef ENABLE_DEBUGGER
4848unsigned tx0_dasm_64kw(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
4949unsigned tx0_dasm_8kw(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
50#endif /* MAME_DEBUG */
50#endif /* ENABLE_DEBUGGER */
src/emu/cpu/pdp1/pdp1.c
r1649r1650
335335*/
336336
337337
338#include "cpuintrf.h"
339338#include "debugger.h"
339#include "deprecat.h"
340340#include "pdp1.h"
341341
342342#define LOG 0
r1649r1650
627627
628628   do
629629   {
630      CALL_MAME_DEBUG;
630      CALL_DEBUGGER(PC);
631631
632632
633633      /* ioh should be cleared at the end of the instruction cycle, and ios at the
r1649r1650
10261026   case CPUINFO_PTR_EXECUTE:                  info->execute = pdp1_execute;         break;
10271027   case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
10281028
1029#ifdef MAME_DEBUG
1029#ifdef ENABLE_DEBUGGER
10301030   case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = pdp1_dasm;         break;
1031#endif /* MAME_DEBUG */
1031#endif /* ENABLE_DEBUGGER */
10321032   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &pdp1_ICount;         break;
10331033
10341034   /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/pdp1/pdp1.h
r1649r1650
7474#define IOT 035
7575#define OPR 037
7676
77#ifdef MAME_DEBUG
77#ifdef ENABLE_DEBUGGER
7878unsigned pdp1_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
79#endif /* MAME_DEBUG */
79#endif /* ENABLE_DEBUGGER */
8080
8181#endif /* _PDP1_H */
src/emu/cpu/pdp1/tx0.c
r1649r1650
182182
183183   do
184184   {
185      CALL_MAME_DEBUG;
185      CALL_DEBUGGER(PC);
186186
187187
188188      if (tx0.ioh && tx0.ios)
r1649r1650
290290
291291   do
292292   {
293      CALL_MAME_DEBUG;
293      CALL_DEBUGGER(PC);
294294
295295
296296      if (tx0.ioh && tx0.ios)
r1649r1650
517517   case CPUINFO_PTR_EXECUTE:                  info->execute = tx0_execute_64kw;      break;
518518   case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
519519
520#ifdef MAME_DEBUG
520#ifdef ENABLE_DEBUGGER
521521   case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tx0_dasm_64kw;      break;
522#endif /* MAME_DEBUG */
522#endif /* ENABLE_DEBUGGER */
523523   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &tx0_ICount;            break;
524524
525525   /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
646646   case CPUINFO_PTR_EXECUTE:                  info->execute = tx0_execute_8kw;      break;
647647   case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
648648
649#ifdef MAME_DEBUG
649#ifdef ENABLE_DEBUGGER
650650   case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = tx0_dasm_8kw;   break;
651#endif /* MAME_DEBUG */
651#endif /* ENABLE_DEBUGGER */
652652   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &tx0_ICount;            break;
653653
654654   /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/mb86233/mb86233.c
r1649r1650
1414***************************************************************************/
1515
1616#include "mb86233.h"
17#include "deprecat.h"
1718#include "debugger.h"
1819
1920/***************************************************************************
r1649r1650
906907      UINT32      val;
907908      UINT32      opcode;
908909
909      CALL_MAME_DEBUG;
910      CALL_DEBUGGER(GETPC());
910911
911912      opcode = ROPCODE(GETPC());
912913
r1649r1650
15221523    DISASSEMBLY HOOK
15231524***************************************************************************/
15241525
1525#ifdef MAME_DEBUG
1526#ifdef ENABLE_DEBUGGER
15261527static offs_t mb86233_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
15271528{
15281529   extern UINT32 dasm_mb86233(char *, UINT32);
r1649r1650
15311532   op = LITTLE_ENDIANIZE_INT32(op);
15321533   return dasm_mb86233(buffer, op);
15331534}
1534#endif /* MAME_DEBUG */
1535#endif /* ENABLE_DEBUGGER */
15351536
15361537/***************************************************************************
15371538    Information Setters
r1649r1650
16421643      case CPUINFO_PTR_EXIT:                     info->exit = NULL;                  break;
16431644      case CPUINFO_PTR_EXECUTE:                  info->execute = mb86233_execute;      break;
16441645      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
1645#ifdef MAME_DEBUG
1646#ifdef ENABLE_DEBUGGER
16461647      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = mb86233_dasm;      break;
1647#endif /* MAME_DEBUG */
1648#endif /* ENABLE_DEBUGGER */
16481649      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &mb86233_icount;         break;
16491650
16501651      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/t11/t11.c
r1649r1650
1212*****************************************************************************/
1313
1414#include "debugger.h"
15#include "deprecat.h"
1516#include "t11.h"
1617
1718
r1649r1650
400401   {
401402      t11.ppc = t11.reg[7];   /* copy PC to previous PC */
402403
403      CALL_MAME_DEBUG;
404      CALL_DEBUGGER(PCD);
404405
405406      t11.op = ROPCODE();
406407      (*opcode_table[t11.op >> 3])();
r1649r1650
505506      case CPUINFO_PTR_EXIT:                     info->exit = t11_exit;               break;
506507      case CPUINFO_PTR_EXECUTE:                  info->execute = t11_execute;         break;
507508      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
508#ifdef MAME_DEBUG
509#ifdef ENABLE_DEBUGGER
509510      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = t11_dasm;         break;
510#endif /* MAME_DEBUG */
511#endif /* ENABLE_DEBUGGER */
511512      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &t11_ICount;            break;
512513
513514      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/t11/t11.h
r1649r1650
4343#define T11_WRMEM(A,V) (program_write_byte_16le(A,V))
4444#define T11_WRMEM_WORD(A,V) (program_write_word_16le(A,V))
4545
46#ifdef MAME_DEBUG
46#ifdef ENABLE_DEBUGGER
4747offs_t t11_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
4848#endif
4949
src/emu/cpu/arm7/arm7core.c
r1649r1650
125125void (*arm7_coproc_dt_r_callback)(UINT32 insn, UINT32* prn, UINT32 (*read32)(int addr));
126126void (*arm7_coproc_dt_w_callback)(UINT32 insn, UINT32* prn, void (*write32)(int addr, UINT32 data));
127127
128#ifdef MAME_DEBUG
128#ifdef ENABLE_DEBUGGER
129129//custom dasm callback handlers for co-processor instructions
130130char *(*arm7_dasm_cop_dt_callback)( char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0 );
131131char *(*arm7_dasm_cop_rt_callback)( char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0 );
src/emu/cpu/arm7/arm7core.h
r1649r1650
399399extern void (*arm7_coproc_dt_r_callback)(UINT32 insn, UINT32* prn, UINT32 (*read32)(int addr));
400400extern void (*arm7_coproc_dt_w_callback)(UINT32 insn, UINT32* prn, void (*write32)(int addr, UINT32 data));
401401
402#ifdef MAME_DEBUG
402#ifdef ENABLE_DEBUGGER
403403extern UINT32 arm7_disasm( char *pBuf, UINT32 pc, UINT32 opcode );
404404extern UINT32 thumb_disasm( char *pBuf, UINT32 pc, UINT16 opcode );
405405
src/emu/cpu/arm7/arm7.c
r1649r1650
3535    **
3636*****************************************************************************/
3737#include "arm7.h"
38#include "deprecat.h"
3839#include "debugger.h"
3940#include "arm7core.h"   //include arm7 core
4041
r1649r1650
4849static WRITE32_HANDLER(test_rt_w_callback);
4950static void test_dt_r_callback (UINT32 insn, UINT32* prn, UINT32 (*read32)(int addr));
5051static void test_dt_w_callback (UINT32 insn, UINT32* prn, void (*write32)(int addr, UINT32 data));
51#ifdef MAME_DEBUG
52#ifdef ENABLE_DEBUGGER
5253static char *Spec_RT( char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0);
5354static char *Spec_DT( char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0);
5455static char *Spec_DO( char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0);
r1649r1650
101102   arm7_coproc_rt_w_callback = test_rt_w_callback;
102103   arm7_coproc_dt_r_callback = test_dt_r_callback;
103104   arm7_coproc_dt_w_callback = test_dt_w_callback;
104#ifdef MAME_DEBUG
105#ifdef ENABLE_DEBUGGER
105106   //setup dasm callbacks - direct method example
106107   arm7_dasm_cop_dt_callback = Spec_DT;
107108   arm7_dasm_cop_rt_callback = Spec_RT;
r1649r1650
152153   }
153154}
154155
155#ifdef MAME_DEBUG
156#ifdef ENABLE_DEBUGGER
156157static offs_t arm7_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
157158{
158159   if( T_IS_SET(GET_CPSR) )
r1649r1650
164165      return arm7_disasm( buffer, pc, oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24)) | 4;
165166   }
166167}
167#endif /* MAME_DEBUG */
168#endif /* ENABLE_DEBUGGER */
168169
169170
170171/**************************************************************************
r1649r1650
342343      case CPUINFO_PTR_EXIT:               info->exit = arm7_exit;                     break;
343344      case CPUINFO_PTR_EXECUTE:            info->execute = arm7_execute;               break;
344345      case CPUINFO_PTR_BURN:               info->burn = NULL;                        break;
345#ifdef MAME_DEBUG
346#ifdef ENABLE_DEBUGGER
346347      case CPUINFO_PTR_DISASSEMBLE:         info->disassemble = arm7_dasm;                break;
347#endif /* MAME_DEBUG */
348#endif /* ENABLE_DEBUGGER */
348349      case CPUINFO_PTR_INSTRUCTION_COUNTER:   info->icount = &ARM7_ICOUNT;               break;
349350
350351      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
444445}
445446
446447/* Custom Co-proc DASM handlers */
447#ifdef MAME_DEBUG
448#ifdef ENABLE_DEBUGGER
448449static char *Spec_RT( char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0)
449450{
450451   pBuf += sprintf( pBuf, "SPECRT");
src/emu/cpu/arm7/arm7exec.c
r1649r1650
4747    ARM7_ICOUNT = cycles;
4848    do
4949    {
50       CALL_MAME_DEBUG;
50       CALL_DEBUGGER(R15);
5151
5252   /* handle Thumb instructions if active */
5353   if( T_IS_SET(GET_CPSR) )
src/emu/cpu/h6280/h6280.c
r1649r1650
108108
109109******************************************************************************/
110110#include "debugger.h"
111#include "deprecat.h"
111112#include "h6280.h"
112113
113114static int    h6280_ICount = 0;
r1649r1650
244245          CHANGE_PC;
245246      h6280.ppc = h6280.pc;
246247
247      CALL_MAME_DEBUG;
248      CALL_DEBUGGER(PCW);
248249
249250      /* Execute 1 instruction */
250251      in=RDOP();
r1649r1650
426427      case CPUINFO_INT_REGISTER + H6280_IRQ1_STATE: set_irq_line( 0, info->i );             break;
427428      case CPUINFO_INT_REGISTER + H6280_IRQ2_STATE: set_irq_line( 1, info->i );             break;
428429      case CPUINFO_INT_REGISTER + H6280_IRQT_STATE: set_irq_line( 2, info->i );             break;
429#ifdef MAME_DEBUG
430#ifdef ENABLE_DEBUGGER
430431      case CPUINFO_INT_REGISTER + H6280_M1:      h6280.mmr[0] = info->i;                  break;
431432      case CPUINFO_INT_REGISTER + H6280_M2:      h6280.mmr[1] = info->i;                  break;
432433      case CPUINFO_INT_REGISTER + H6280_M3:      h6280.mmr[2] = info->i;                  break;
r1649r1650
493494      case CPUINFO_INT_REGISTER + H6280_IRQ1_STATE:   info->i = h6280.irq_state[0];         break;
494495      case CPUINFO_INT_REGISTER + H6280_IRQ2_STATE:   info->i = h6280.irq_state[1];         break;
495496      case CPUINFO_INT_REGISTER + H6280_IRQT_STATE:   info->i = h6280.irq_state[2];         break;
496#ifdef MAME_DEBUG
497#ifdef ENABLE_DEBUGGER
497498      case CPUINFO_INT_REGISTER + H6280_M1:         info->i = h6280.mmr[0];               break;
498499      case CPUINFO_INT_REGISTER + H6280_M2:         info->i = h6280.mmr[1];               break;
499500      case CPUINFO_INT_REGISTER + H6280_M3:         info->i = h6280.mmr[2];               break;
r1649r1650
513514      case CPUINFO_PTR_EXIT:                     info->exit = h6280_exit;            break;
514515      case CPUINFO_PTR_EXECUTE:                  info->execute = h6280_execute;         break;
515516      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
516#ifdef MAME_DEBUG
517#ifdef ENABLE_DEBUGGER
517518      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = h6280_dasm;         break;
518#endif /* MAME_DEBUG */
519#endif /* ENABLE_DEBUGGER */
519520      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &h6280_ICount;         break;
520521      case CPUINFO_PTR_TRANSLATE:                  info->translate = h6280_translate;      break;
521522
r1649r1650
550551      case CPUINFO_STR_REGISTER + H6280_IRQ1_STATE:   sprintf(info->s, "IRQ1:%X", h6280.irq_state[0]); break;
551552      case CPUINFO_STR_REGISTER + H6280_IRQ2_STATE:   sprintf(info->s, "IRQ2:%X", h6280.irq_state[1]); break;
552553      case CPUINFO_STR_REGISTER + H6280_IRQT_STATE:   sprintf(info->s, "IRQT:%X", h6280.irq_state[2]); break;
553#ifdef MAME_DEBUG
554#ifdef ENABLE_DEBUGGER
554555      case CPUINFO_STR_REGISTER + H6280_M1:         sprintf(info->s, "M1:%02X", h6280.mmr[0]); break;
555556      case CPUINFO_STR_REGISTER + H6280_M2:         sprintf(info->s, "M2:%02X", h6280.mmr[1]); break;
556557      case CPUINFO_STR_REGISTER + H6280_M3:         sprintf(info->s, "M3:%02X", h6280.mmr[2]); break;
src/emu/cpu/h6280/h6280.h
r1649r1650
1919   H6280_PC=1, H6280_S, H6280_P, H6280_A, H6280_X, H6280_Y,
2020   H6280_IRQ_MASK, H6280_TIMER_STATE,
2121   H6280_NMI_STATE, H6280_IRQ1_STATE, H6280_IRQ2_STATE, H6280_IRQT_STATE
22#ifdef MAME_DEBUG
22#ifdef ENABLE_DEBUGGER
2323    ,
2424   H6280_M1, H6280_M2, H6280_M3, H6280_M4,
2525   H6280_M5, H6280_M6, H6280_M7, H6280_M8
r1649r1650
4747UINT8 h6280io_get_buffer(void);
4848void h6280io_set_buffer(UINT8);
4949
50#ifdef MAME_DEBUG
50#ifdef ENABLE_DEBUGGER
5151offs_t h6280_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
5252#endif
5353
src/emu/cpu/m6800/m6800.h
r1649r1650
210210#    define TRUE (!FALSE)
211211#endif
212212
213#ifdef   MAME_DEBUG
213#ifdef   ENABLE_DEBUGGER
214214offs_t m6800_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
215215offs_t m6801_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
216216offs_t m6802_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
src/emu/cpu/m6800/m6800.c
r1649r1650
7474*/
7575
7676#include "debugger.h"
77#include "deprecat.h"
7778#include "m6800.h"
7879
7980#define VERBOSE 0
r1649r1650
264265#define ONE_MORE_INSN() {      \
265266   UINT8 ireg;                      \
266267   pPPC = pPC;                      \
267   CALL_MAME_DEBUG;                  \
268   CALL_DEBUGGER(PCD);                  \
268269   ireg=M_RDOP(PCD);                  \
269270   PC++;                           \
270271   (*m6800.insn[ireg])();               \
r1649r1650
987988      else
988989      {
989990         pPPC = pPC;
990         CALL_MAME_DEBUG;
991         CALL_DEBUGGER(PCD);
991992         ireg=M_RDOP(PCD);
992993         PC++;
993994
r1649r1650
13341335      else
13351336      {
13361337         pPPC = pPC;
1337         CALL_MAME_DEBUG;
1338         CALL_DEBUGGER(PCD);
13381339         ireg=M_RDOP(PCD);
13391340         PC++;
13401341
r1649r1650
16741675      else
16751676      {
16761677         pPPC = pPC;
1677         CALL_MAME_DEBUG;
1678         CALL_DEBUGGER(PCD);
16781679         ireg=M_RDOP(PCD);
16791680         PC++;
16801681
r1649r1650
20062007      else
20072008      {
20082009         pPPC = pPC;
2009         CALL_MAME_DEBUG;
2010         CALL_DEBUGGER(PCD);
20102011         ireg=M_RDOP(PCD);
20112012         PC++;
20122013
r1649r1650
26522653      case CPUINFO_PTR_EXIT:                     info->exit = m6800_exit;            break;
26532654      case CPUINFO_PTR_EXECUTE:                  info->execute = m6800_execute;         break;
26542655      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
2655#ifdef MAME_DEBUG
2656#ifdef ENABLE_DEBUGGER
26562657      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6800_dasm;         break;
2657#endif /* MAME_DEBUG */
2658#endif /* ENABLE_DEBUGGER */
26582659      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m6800_ICount;         break;
26592660
26602661      /* --- the following bits of info are returned as NULL-terminated strings --- */
r1649r1650
27042705      /* --- the following bits of info are returned as pointers to data or functions --- */
27052706      case CPUINFO_PTR_INIT:                     info->init = m6801_init;            break;
27062707      case CPUINFO_PTR_EXECUTE:                  info->execute = m6803_execute;         break;
2707#ifdef MAME_DEBUG
2708#ifdef ENABLE_DEBUGGER
27082709      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6801_dasm;         break;
2709#endif /* MAME_DEBUG */
2710#endif /* ENABLE_DEBUGGER */
27102711
27112712      /* --- the following bits of info are returned as NULL-terminated strings --- */
27122713      case CPUINFO_STR_NAME:                     strcpy(info->s, "M6801");            break;
r1649r1650
27312732
27322733      /* --- the following bits of info are returned as pointers to data or functions --- */
27332734      case CPUINFO_PTR_INIT:                     info->init = m6802_init;            break;
2734#ifdef MAME_DEBUG
2735#ifdef ENABLE_DEBUGGER
27352736      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6802_dasm;         break;
2736#endif /* MAME_DEBUG */
2737#endif /* ENABLE_DEBUGGER */
27372738
27382739      /* --- the following bits of info are returned as NULL-terminated strings --- */
27392740      case CPUINFO_STR_NAME:                     strcpy(info->s, "M6802");            break;
r1649r1650
27612762      /* --- the following bits of info are returned as pointers to data or functions --- */
27622763      case CPUINFO_PTR_INIT:                     info->init = m6803_init;            break;
27632764      case CPUINFO_PTR_EXECUTE:                  info->execute = m6803_execute;         break;
2764#ifdef MAME_DEBUG
2765#ifdef ENABLE_DEBUGGER
27652766      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6803_dasm;         break;
2766#endif /* MAME_DEBUG */
2767#endif /* ENABLE_DEBUGGER */
27672768
27682769      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_m6803_mem; break;
27692770
r1649r1650
27902791
27912792      /* --- the following bits of info are returned as pointers to data or functions --- */
27922793      case CPUINFO_PTR_INIT:                     info->init = m6808_init;            break;
2793#ifdef MAME_DEBUG
2794#ifdef ENABLE_DEBUGGER
27942795      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m6808_dasm;         break;
2795#endif /* MAME_DEBUG */
2796#endif /* ENABLE_DEBUGGER */
27962797
27972798      /* --- the following bits of info are returned as NULL-terminated strings --- */
27982799      case CPUINFO_STR_NAME:                     strcpy(info->s, "M6808");            break;
r1649r1650
28202821      /* --- the following bits of info are returned as pointers to data or functions --- */
28212822      case CPUINFO_PTR_INIT:                     info->init = hd63701_init;            break;
28222823      case CPUINFO_PTR_EXECUTE:                  info->execute = hd63701_execute;      break;
2823#ifdef MAME_DEBUG
2824#ifdef ENABLE_DEBUGGER
28242825      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = hd63701_dasm;      break;
2825#endif /* MAME_DEBUG */
2826#endif /* ENABLE_DEBUGGER */
28262827
28272828      /* --- the following bits of info are returned as NULL-terminated strings --- */
28282829      case CPUINFO_STR_NAME:                     strcpy(info->s, "HD63701");            break;
r1649r1650
28482849      /* --- the following bits of info are returned as pointers to data or functions --- */
28492850      case CPUINFO_PTR_INIT:                     info->init = nsc8105_init;            break;
28502851      case CPUINFO_PTR_EXECUTE:                  info->execute = nsc8105_execute;      break;
2851#ifdef MAME_DEBUG
2852#ifdef ENABLE_DEBUGGER
28522853      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = nsc8105_dasm;      break;
2853#endif /* MAME_DEBUG */
2854#endif /* ENABLE_DEBUGGER */
28542855
28552856      /* --- the following bits of info are returned as NULL-terminated strings --- */
28562857      case CPUINFO_STR_NAME:                     strcpy(info->s, "NSC8105");            break;
src/emu/cpu/cp1610/cp1610.h
r1649r1650
3535
3636void cp1610_get_info(UINT32 state, cpuinfo *info);
3737
38#ifdef MAME_DEBUG
38#ifdef ENABLE_DEBUGGER
3939unsigned cp1610_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
40#endif /* MAME_DEBUG */
40#endif /* ENABLE_DEBUGGER */
4141
4242// Temporary
4343#define cp1610_readop(A) program_read_word_16be((A)<<1)
src/emu/cpu/cp1610/cp1610.c
r1649r1650
2323
2424#include "cpuintrf.h"
2525#include "debugger.h"
26#include "deprecat.h"
2627#include "cp1610.h"
2728
2829#define S  0x80
r1649r1650
21652166
21662167    do
21672168    {
2168        CALL_MAME_DEBUG;
2169        CALL_DEBUGGER(cp1610.r[7]);
21692170
21702171      cp1610.mask_interrupts = 0;
21712172
r1649r1650
34903491   case CPUINFO_PTR_EXECUTE:                  info->execute = cp1610_execute;         break;
34913492   case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
34923493
3493#ifdef MAME_DEBUG
3494#ifdef ENABLE_DEBUGGER
34943495   case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = cp1610_dasm;      break;
3495#endif /* MAME_DEBUG */
3496#endif /* ENABLE_DEBUGGER */
34963497   case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cp1610_icount;         break;
34973498
34983499   /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/saturn/saturn.h
r1649r1650
5858   void (*crc)(int addr, int data);
5959} SATURN_CONFIG;
6060
61#ifdef MAME_DEBUG
61#ifdef ENABLE_DEBUGGER
6262unsigned saturn_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
63#endif /* MAME_DEBUG */
63#endif /* ENABLE_DEBUGGER */
6464
6565void saturn_get_info(UINT32 state, cpuinfo *info);
6666
src/emu/cpu/saturn/saturn.c
r1649r1650
1919 *   - This entire notice must remain in the source code.
2020 *
2121 *****************************************************************************/
22#include "cpuintrf.h"
2322#include "debugger.h"
23#include "deprecat.h"
2424
2525#include "saturn.h"
2626#include "sat.h"
r1649r1650
159159   {
160160      saturn.oldpc = saturn.pc;
161161
162      CALL_MAME_DEBUG;
162      CALL_DEBUGGER(saturn.pc);
163163
164164      /* if an irq is pending, take it now */
165165      if( saturn.pending_irq )
r1649r1650
377377      case CPUINFO_PTR_RESET:                     info->reset = saturn_reset;               break;
378378      case CPUINFO_PTR_EXECUTE:                  info->execute = saturn_execute;            break;
379379      case CPUINFO_PTR_BURN:                     info->burn = NULL;                     break;
380#ifdef MAME_DEBUG
380#ifdef ENABLE_DEBUGGER
381381      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = saturn_dasm;      break;
382#endif /* MAME_DEBUG */
382#endif /* ENABLE_DEBUGGER */
383383      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &saturn_ICount;            break;
384384
385385      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/i8x41/i8x41.h
r1649r1650
8181
8282extern void i8x41_get_info(UINT32 state, cpuinfo *info);
8383
84#ifdef MAME_DEBUG
84#ifdef ENABLE_DEBUGGER
8585extern offs_t i8x41_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
8686#endif
8787
src/emu/cpu/i8x41/i8x41.c
r1649r1650
8787 *****************************************************************************/
8888
8989#include "debugger.h"
90#include "deprecat.h"
9091#include "i8x41.h"
9192
9293typedef struct {
r1649r1650
13761377
13771378      PPC = PC;
13781379
1379      CALL_MAME_DEBUG;
1380      CALL_DEBUGGER(PC);
13801381
13811382      PC += 1;
13821383      i8x41_ICount -= i8x41_cycles[op];
r1649r1650
22692270      case CPUINFO_PTR_EXIT:                     info->exit = i8x41_exit;            break;
22702271      case CPUINFO_PTR_EXECUTE:                  info->execute = i8x41_execute;         break;
22712272      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
2272#ifdef MAME_DEBUG
2273#ifdef ENABLE_DEBUGGER
22732274      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = i8x41_dasm;         break;
2274#endif /* MAME_DEBUG */
2275#endif /* ENABLE_DEBUGGER */
22752276      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &i8x41_ICount;         break;
22762277
22772278      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/konami/konami.c
r1649r1650
3535*****************************************************************************/
3636
3737#include "debugger.h"
38#include "deprecat.h"
3839#include "konami.h"
3940
4041#define VERBOSE 0
r1649r1650
501502      {
502503         pPPC = pPC;
503504
504         CALL_MAME_DEBUG;
505         CALL_DEBUGGER(PCD);
505506
506507         konami.ireg = ROP(PCD);
507508         PC++;
r1649r1650
609610      case CPUINFO_PTR_EXIT:                     info->exit = konami_exit;            break;
610611      case CPUINFO_PTR_EXECUTE:                  info->execute = konami_execute;         break;
611612      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
612#ifdef MAME_DEBUG
613#ifdef ENABLE_DEBUGGER
613614      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = konami_dasm;      break;
614#endif /* MAME_DEBUG */
615#endif /* ENABLE_DEBUGGER */
615616      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &konami_ICount;         break;
616617      case CPUINFO_PTR_KONAMI_SETLINES_CALLBACK:      info->f = (genf *)konami.setlines_callback;   break;
617618
src/emu/cpu/konami/konami.h
r1649r1650
5151#    define TRUE (!FALSE)
5252#endif
5353
54#ifdef MAME_DEBUG
54#ifdef ENABLE_DEBUGGER
5555offs_t konami_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
5656#endif
5757
src/emu/streams.c
r1649r1650
4545
4646#include "driver.h"
4747#include "streams.h"
48#include <math.h>
48#include "deprecat.h"
4949
5050
5151
r1649r1650
112112struct _sound_stream
113113{
114114   /* linking information */
115   running_machine *   machine;            /* owning machine object */
115116   sound_stream *      next;               /* next stream in the chain */
116117   void *            tag;               /* tag (used for identification) */
117118   int               index;               /* index for save states */
r1649r1650
207208
208209
209210/***************************************************************************
210    CORE IMPLEMENTATION
211    SYSTEM-LEVEL MANAGEMENT
211212***************************************************************************/
212213
213214/*-------------------------------------------------
r1649r1650
236237
237238
238239/*-------------------------------------------------
240    streams_set_tag - set the tag to be associated
241    with all streams allocated from now on
242-------------------------------------------------*/
243
244void streams_set_tag(running_machine *machine, void *streamtag)
245{
246   streams_private *strdata = machine->streams_data;
247   strdata->current_tag = streamtag;
248}
249
250
251/*-------------------------------------------------
239252    streams_update - update all the streams
240253    periodically
241254-------------------------------------------------*/
r1649r1650
326339}
327340
328341
329/*-------------------------------------------------
330    streams_set_tag - set the tag to be associated
331    with all streams allocated from now on
332-------------------------------------------------*/
333342
334void streams_set_tag(running_machine *machine, void *streamtag)
335{
336   streams_private *strdata = machine->streams_data;
337   strdata->current_tag = streamtag;
338}
343/***************************************************************************
344    STREAM CONFIGURATION AND SETUP
345***************************************************************************/
339346
340
341347/*-------------------------------------------------
342348    stream_create - create a new stream
343349-------------------------------------------------*/
r1649r1650
356362   VPRINTF(("stream_create(%d, %d, %d) => %p\n", inputs, outputs, sample_rate, stream));
357363
358364   /* fill in the data */
365   stream->machine = Machine;
359366   stream->tag = strdata->current_tag;
360367   stream->index = strdata->stream_index++;
361368   stream->sample_rate = sample_rate;
r1649r1650
450457      input->source->dependents++;
451458
452459   /* update sample rates now that we know the input */
453   recompute_sample_rate_data(Machine->streams_data, stream);
460   recompute_sample_rate_data(stream->machine->streams_data, stream);
454461}
455462
456463
r1649r1650
461468
462469void stream_update(sound_stream *stream)
463470{
464   streams_private *strdata = Machine->streams_data;
471   streams_private *strdata = stream->machine->streams_data;
465472   INT32 update_sampindex = time_to_sampindex(strdata, stream, timer_get_time());
466473
467474   /* generate samples to get us up to the appropriate time */
r1649r1650
475482
476483
477484/*-------------------------------------------------
485    stream_get_output_since_last_update - return a
486    pointer to the output buffer and the number of
487    samples since the last global update
488-------------------------------------------------*/
489
490const stream_sample_t *stream_get_output_since_last_update(sound_stream *stream, int outputnum, int *numsamples)
491{
492   stream_output *output = &stream->output[outputnum];
493
494   /* force an update on the stream */
495   stream_update(stream);
496
497   /* compute the number of samples and a pointer to the output buffer */
498   *numsamples = stream->output_sampindex - stream->output_update_sampindex;
499   return output->buffer + (stream->output_update_sampindex - stream->output_base_sampindex);
500}
501
502
503
504/***************************************************************************
505    STREAM TIMING
506***************************************************************************/
507
508/*-------------------------------------------------
509    stream_get_sample_rate - return the currently
510    set sample rate on a given stream
511-------------------------------------------------*/
512
513int stream_get_sample_rate(sound_stream *stream)
514{
515   /* take into account any pending sample rate changes */
516   return (stream->new_sample_rate != 0) ? stream->new_sample_rate : stream->sample_rate;
517}
518
519
520/*-------------------------------------------------
521    stream_set_sample_rate - set the sample rate
522    on a given stream
523-------------------------------------------------*/
524
525void stream_set_sample_rate(sound_stream *stream, int sample_rate)
526{
527   /* we will update this on the next global update */
528   if (sample_rate != stream_get_sample_rate(stream))
529      stream->new_sample_rate = sample_rate;
530}
531
532
533/*-------------------------------------------------
534    stream_get_time - return the emulation time
535    of the next sample to be generated on the
536    stream
537-------------------------------------------------*/
538
539attotime stream_get_time(sound_stream *stream)
540{
541   streams_private *strdata = stream->machine->streams_data;
542   attotime base = attotime_make(strdata->last_update.seconds, 0);
543   return attotime_add_attoseconds(base, stream->output_sampindex * stream->attoseconds_per_sample);
544}
545
546
547/*-------------------------------------------------
548    stream_get_sample_period - return the duration
549    of a single sample for a stream
550-------------------------------------------------*/
551
552attotime stream_get_sample_period(sound_stream *stream)
553{
554   return attotime_make(0, stream->attoseconds_per_sample);
555}
556
557
558
559/***************************************************************************
560    STREAM INFORMATION AND CONTROL
561***************************************************************************/
562
563/*-------------------------------------------------
478564    stream_find_by_tag - find a stream using a
479565    tag and index
480566-------------------------------------------------*/
r1649r1650
538624}
539625
540626
541/*-------------------------------------------------
542    stream_set_sample_rate - set the sample rate
543    on a given stream
544-------------------------------------------------*/
545627
546void stream_set_sample_rate(sound_stream *stream, int sample_rate)
547{
548   /* we will update this on the next global update */
549   if ((stream->new_sample_rate == 0 && sample_rate != stream->sample_rate) || (stream->new_sample_rate != 0 && sample_rate != stream->new_sample_rate))
550      stream->new_sample_rate = sample_rate;
551}
552
553
554/*-------------------------------------------------
555    stream_get_output_since_last_update - return a
556    pointer to the output buffer and the number of
557    samples since the last global update
558-------------------------------------------------*/
559
560const stream_sample_t *stream_get_output_since_last_update(sound_stream *stream, int outputnum, int *numsamples)
561{
562   stream_output *output = &stream->output[outputnum];
563
564   /* force an update on the stream */
565   stream_update(stream);
566
567   /* compute the number of samples and a pointer to the output buffer */
568   *numsamples = stream->output_sampindex - stream->output_update_sampindex;
569   return output->buffer + (stream->output_update_sampindex - stream->output_base_sampindex);
570}
571
572
573
574628/***************************************************************************
575629    STREAM BUFFER MAINTENANCE
576630***************************************************************************/
src/emu/audio/generic.c
r1649r1650
1111
1212#include "driver.h"
1313#include "generic.h"
14#include "deprecat.h"
1415
1516
1617
src/emu/uigfx.c
r1649r1650
1414#include "rendfont.h"
1515#include "rendutil.h"
1616#include "uigfx.h"
17#include "deprecat.h"
1718
1819
1920
src/emu/streams.h
r1649r1650
2929    FUNCTION PROTOTYPES
3030***************************************************************************/
3131
32
33/* ----- system-level management ----- */
34
35/* initialize the streams engine */
3236void streams_init(running_machine *machine, attoseconds_t update_subseconds);
37
38/* set the tag to be associated with all streams allocated from now on */
3339void streams_set_tag(running_machine *machine, void *streamtag);
40
41/* update all the streams periodically */
3442void streams_update(running_machine *machine);
3543
36/* core stream configuration and operation */
44
45
46/* ----- stream configuration and setup ----- */
47
48/* create a new stream */
3749sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_callback callback);
50
51/* configure a stream's input */
3852void stream_set_input(sound_stream *stream, int index, sound_stream *input_stream, int output_index, float gain);
53
54/* force a stream to update to the current emulated time */
3955void stream_update(sound_stream *stream);
56
57/* return a pointer to the output buffer and the number of samples since the last global update */
4058const stream_sample_t *stream_get_output_since_last_update(sound_stream *stream, int outputnum, int *numsamples);
4159
42/* utilities for accessing a particular stream */
60
61
62/* ----- stream timing ----- */
63
64/* return the currently set sample rate on a given stream */
65int stream_get_sample_rate(sound_stream *stream);
66
67/* set the sample rate on a given stream */
68void stream_set_sample_rate(sound_stream *stream, int sample_rate);
69
70/* return the emulation time of the next sample to be generated on the stream */
71attotime stream_get_time(sound_stream *stream);
72
73/* return the duration of a single sample for a stream */
74attotime stream_get_sample_period(sound_stream *stream);
75
76
77
78/* ----- stream information and control ----- */
79
80/* find a stream using a tag and index */
4381sound_stream *stream_find_by_tag(void *streamtag, int streamindex);
82
83/* return the number of inputs for a given stream */
4484int stream_get_inputs(sound_stream *stream);
85
86/* return the number of outputs for a given stream */
4587int stream_get_outputs(sound_stream *stream);
88
89/* set the input gain on a given stream */
4690void stream_set_input_gain(sound_stream *stream, int input, float gain);
91
92/* set the output gain on a given stream */
4793void stream_set_output_gain(sound_stream *stream, int output, float gain);
48void stream_set_sample_rate(sound_stream *stream, int sample_rate);
4994
95
5096#endif
src/emu/video/cdp1869.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/cdp1802/cdp1802.h"
34#include "video/cdp1869.h"
45#include "sound/cdp1869.h"
src/emu/video/tms9928a.c
r1649r1650
398398   {
399399      (*ModeHandlers[TMS_MODE])(machine, tms.tmpbmp, cliprect);
400400
401      copybitmap(bitmap, tms.tmpbmp, 0, 0, LEFT_BORDER, TOP_BORDER, cliprect, TRANSPARENCY_NONE, 0);
401      copybitmap(bitmap, tms.tmpbmp, 0, 0, LEFT_BORDER, TOP_BORDER, cliprect);
402402      {
403403         rectangle rt;
404404
src/emu/video/v9938.c
r1649r1650
1515*/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "v9938.h"
1920
2021typedef struct {
r1649r1650
600601
601602 READ8_HANDLER (v9938_status_r)
602603   {
603   int reg, n;
604   int reg;
604605   UINT8 ret;
605606
606607   vdp.cmd_write_first = 0;
r1649r1650
624625         break;
625626      case 2:
626627         /*v9938_update_command ();*/
627         n = cycles_currently_ran ();
628         if ( (n < 28) || (n > 199) ) vdp.statReg[2] |= 0x20;
628/*
629    WTF is this? Whatever this was intended to do, it is nonsensical.
630    Might as well pick a random number....
631            n = cycles_currently_ran ();
632            if ( (n < 28) || (n > 199) ) vdp.statReg[2] |= 0x20;
633            else vdp.statReg[2] &= ~0x20;
634*/
635         if (mame_rand(Machine) & 1) vdp.statReg[2] |= 0x20;
629636         else vdp.statReg[2] &= ~0x20;
630637         ret = vdp.statReg[2];
631638         break;
src/emu/video/vector.c
r1649r1650
3030 *
3131 **************************************************************************** */
3232
33#include <math.h>
3433#include "rendutil.h"
34#include "deprecat.h"
3535#include "vector.h"
3636
3737
src/emu/video/voodoo.c
r1649r1650
142142#include "voodoo.h"
143143#include "vooddefs.h"
144144#include "ui.h"
145#include <math.h>
145#include "deprecat.h"
146146
147147
148148/*************************************
src/emu/video/generic.c
r1649r1650
1010*********************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "generic.h"
1415
1516
r1649r1650
335336
336337VIDEO_UPDATE( generic_bitmapped )
337338{
338   copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
339   copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, cliprect);
339340   return 0;
340341}
341342
src/emu/video/poly.c
r1649r1650
11/***************************************************************************
22
3    polynew.c
3    poly.c
44
55    Helper routines for polygon rendering.
66
src/emu/video/rgbsse.h
r1649r1650
11/***************************************************************************
22
3    rgbgen.h
3    rgbsse.h
44
55    SSE optimized RGB utilities.
66
src/emu/tilemap.c
r1649r1650
1212#include "driver.h"
1313#include "tilemap.h"
1414#include "profiler.h"
15#include "deprecat.h"
1516
1617
1718/***************************************************************************
r1649r1650
272273      tilemap_list    = NULL;
273274      tilemap_tailptr  = &tilemap_list;
274275      tilemap_instance = 0;
275   
276
276277      priority_bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
277278      add_exit_callback(machine, tilemap_exit);
278279   }
src/emu/deprecat.h
r0r1650
1/***************************************************************************
2
3    deprecat.h
4
5    Definition of derprecated and obsolte constructs that should not
6    be used by new code, if at all possible.
7
8    Copyright Nicola Salmoria and the MAME Team.
9    Visit http://mamedev.org for licensing and usage restrictions.
10
11***************************************************************************/
12
13#pragma once
14
15#ifndef __DEPRECAT_H__
16#define __DEPRECAT_H__
17
18
19
20/*************************************
21 *
22 *  Global access to the currently
23 *  executing machine.
24 *
25 *  Please investigate if it is
26 *  possible to use a passed in
27 *  'machine' argument.
28 *
29 *************************************/
30
31extern running_machine *Machine;
32
33
34
35/*************************************
36 *
37 *  Video timing
38 *
39 *  These functions are no longer considered
40 *  to be the authority on scanline timing.
41 *  Please use the video_screen_* functions
42 *  in video.c for newer drivers.
43 *
44 *************************************/
45
46/* Returns the number of the video frame we are currently playing */
47int cpu_getcurrentframe(void);
48
49
50
51/*************************************
52 *
53 *  Core timing
54 *
55 *************************************/
56
57/* Returns the number of times the interrupt handler will be called before
58   the end of the current video frame. This is can be useful to interrupt
59   handlers to synchronize their operation. If you call this from outside
60   an interrupt handler, add 1 to the result, i.e. if it returns 0, it means
61   that the interrupt handler will be called once. */
62int cpu_getiloops(void);
63
64/* Scales a given value by the ratio of fcount / fperiod */
65int cpu_scalebyfcount(int value);
66
67
68#endif   /* __DEPRECAT_H__ */
src/emu/emuopts.c
r1649r1650
144144   { "log",                         "0",         OPTION_BOOLEAN,    "generate an error.log file" },
145145   { "verbose;v",                   "0",         OPTION_BOOLEAN,    "display additional diagnostic information" },
146146   { "update_in_pause",             "0",         OPTION_BOOLEAN,    "keep calling video updates while in pause" },
147#ifdef MAME_DEBUG
147#ifdef ENABLE_DEBUGGER
148148   { "debug;d",                     "1",         OPTION_BOOLEAN,    "enable/disable debugger" },
149149   { "debugscript",                 NULL,        0,                 "script for debugger" },
150150#else
src/emu/uimenu.c
r1649r1650
1414#include "cheat.h"
1515#include "uimenu.h"
1616#include "audit.h"
17#include "deprecat.h"
1718
1819#ifdef MESS
1920#include "uimess.h"
src/emu/video.c
r1649r1650
1414#include "profiler.h"
1515#include "png.h"
1616#include "debugger.h"
17#include "video/vector.h"
1817#include "render.h"
1918#include "rendutil.h"
2019#include "ui.h"
20#include "deprecat.h"
21#include "video/vector.h"
2122
2223#include "snap.lh"
2324
r1649r1650
2829***************************************************************************/
2930
3031#define LOG_THROTTLE            (0)
31#define VERBOSE               (0)
32#define VERBOSE                  (0)
3233#define LOG_PARTIAL_UPDATES(x)      do { if (VERBOSE) logerror x; } while (0)
3334
3435
r1649r1650
6768   attoseconds_t         pixeltime;         /* attoseconds per pixel */
6869   attotime             vblank_time;      /* time of last VBLANK start */
6970   emu_timer *            scanline0_timer;   /* scanline 0 timer */
71   emu_timer *            scanline_timer;      /* scanline timer */
7072
7173   /* movie recording */
7274   mame_file *            movie_file;         /* handle to the open movie file */
r1649r1650
176178
177179/* global rendering */
178180static TIMER_CALLBACK( scanline0_callback );
181static TIMER_CALLBACK( scanline_update_callback );
179182static int finish_screen_updates(running_machine *machine);
180183
181184/* throttling/frameskipping/performance */
r1649r1650
326329         /* reset VBLANK timing */
327330         info->vblank_time = attotime_sub_attoseconds(attotime_zero, machine->screen[0].vblank);
328331
332         /* allocate a timer to generate per-scanline updates */
333         if (machine->drv->video_attributes & VIDEO_UPDATE_SCANLINE)
334         {
335            info->scanline_timer = timer_alloc(scanline_update_callback, NULL);
336            timer_adjust(info->scanline_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum, attotime_never);
337         }
338
329339         /* register for save states */
330340         state_save_register_item("video", scrnum, info->vblank_time.seconds);
331341         state_save_register_item("video", scrnum, info->vblank_time.attoseconds);
r1649r1650
756766   }
757767
758768   /* recompute the VBLANK timing */
759   cpu_compute_vblank_timing(Machine);
769   {
770      extern void cpu_compute_vblank_timing(running_machine *machine);
771      cpu_compute_vblank_timing(Machine);
772   }
760773
761774   /* if we are on scanline 0 already, reset the update timer immediately */
762775   /* otherwise, defer until the next scanline 0 */
r1649r1650
10301043
10311044
10321045/*-------------------------------------------------
1046    scanline_update_callback - perform partial
1047    updates on each scanline
1048-------------------------------------------------*/
1049
1050static TIMER_CALLBACK( scanline_update_callback )
1051{
1052   video_private *viddata = machine->video_data;
1053   int scrnum = param & 0xff;
1054   int scanline = param >> 8;
1055
1056   /* force a partial update to the current scanline */
1057   video_screen_update_partial(scrnum, scanline);
1058
1059   /* compute the next visible scanline */
1060   scanline++;
1061   if (scanline > machine->screen[scrnum].visarea.max_y)
1062      scanline = machine->screen[scrnum].visarea.min_y;
1063   timer_adjust(viddata->scrinfo[scrnum].scanline_timer, video_screen_get_time_until_pos(scrnum, scanline, 0), (scanline << 8) | scrnum, attotime_never);
1064}
1065
1066
1067/*-------------------------------------------------
10331068    video_frame_update - handle frameskipping and
10341069    UI, plus updating the screen during normal
10351070    operations
r1649r1650
13841419   /* apply speed factor to emu time */
13851420   if (global.speed != 0 && global.speed != 100)
13861421   {
1387      /* multiply emutime by 100 */
1388      emutime = attotime_mul(emutime, 100);
1389
1390      /* divide emutime by the global speed factor */
1391      emutime.attoseconds /= global.speed;
1392      emutime.attoseconds += (emutime.seconds % global.speed) * (ATTOSECONDS_PER_SECOND / global.speed);
1393      emutime.seconds /= global.speed;
1422      /* multiply emutime by 100, then divide by the global speed factor */
1423      emutime = attotime_div(attotime_mul(emutime, 100), global.speed);
13941424   }
13951425
13961426   /* compute conversion factors up front */
src/emu/memory.c
r1649r1650
9191
9292#include "driver.h"
9393#include "profiler.h"
94#ifdef MAME_DEBUG
94#include "deprecat.h"
95#ifdef ENABLE_DEBUGGER
9596#include "debug/debugcpu.h"
9697#endif
97#include <stdarg.h>
9898
9999
100100#define MEM_DUMP      (0)
r1649r1650
152152
153153#define SUBTABLE_PTR(tabledata, entry) (&(tabledata)->table[(1 << LEVEL1_BITS) + (((entry) - SUBTABLE_BASE) << LEVEL2_BITS)])
154154
155#ifdef MAME_DEBUG
155#ifdef ENABLE_DEBUGGER
156156#define DEBUG_HOOK_READ(a,b,c) if (debug_hook_read) (*debug_hook_read)(a, b, c)
157157#define DEBUG_HOOK_WRITE(a,b,c,d) if (debug_hook_write) (*debug_hook_write)(a, b, c, d)
158158#else
r1649r1650
291291static cpu_data            cpudata[MAX_CPU];            /* data gathered for each CPU */
292292static bank_data          bankdata[STATIC_COUNT];         /* data gathered for each bank */
293293
294#ifdef MAME_DEBUG
294#ifdef ENABLE_DEBUGGER
295295static debug_hook_read_ptr   debug_hook_read;            /* pointer to debugger callback for memory reads */
296296static debug_hook_write_ptr   debug_hook_write;            /* pointer to debugger callback for memory writes */
297297#endif
r1649r1650
540540
541541   opbasefunc = cpudata[activecpu].opbase;
542542
543#ifdef MAME_DEBUG
543#ifdef ENABLE_DEBUGGER
544544   if (activecpu != -1)
545545      debug_get_memory_hooks(activecpu, &debug_hook_read, &debug_hook_write);
546546   else
src/emu/emu.mak
r1649r1650
8181   $(EMUOBJ)/profiler.o
8282endif
8383
84ifdef DEBUG
84ifdef DEBUGGER
8585EMUOBJS += \
8686   $(EMUOBJ)/debug/debugcmd.o \
8787   $(EMUOBJ)/debug/debugcmt.o \
r1649r1650
190190
191191$(LIBCPU): $(CPUOBJS)
192192
193ifdef DEBUG
193ifdef DEBUGGER
194194$(LIBCPU): $(DBGOBJS)
195195endif
196196
src/emu/memory.h
r1649r1650
1919
2020
2121/***************************************************************************
22    PARAMETERS
23***************************************************************************/
24
25#ifdef MAME_DEBUG
26#define CPUREADOP_SAFETY_NONE      0
27#define CPUREADOP_SAFETY_PARTIAL   0
28#define CPUREADOP_SAFETY_FULL      1
29#elif defined(MESS)
30#define CPUREADOP_SAFETY_NONE      0
31#define CPUREADOP_SAFETY_PARTIAL   1
32#define CPUREADOP_SAFETY_FULL      0
33#else
34#define CPUREADOP_SAFETY_NONE      1
35#define CPUREADOP_SAFETY_PARTIAL   0
36#define CPUREADOP_SAFETY_FULL      0
37#endif
38
39
40
41/***************************************************************************
4222    BASIC TYPE DEFINITIONS
4323***************************************************************************/
4424
r1649r1650
693673#define AM_READWRITE(_read,_write)         AM_READ(_read) AM_WRITE(_write)
694674#define AM_ROM                        AM_READ((_rh_t)STATIC_ROM)
695675#define AM_RAM                        AM_READWRITE((_rh_t)STATIC_RAM, (_wh_t)STATIC_RAM)
676#define AM_WRITEONLY                  AM_WRITE((_wh_t)STATIC_RAM)
696677#define AM_UNMAP                     AM_READWRITE((_rh_t)STATIC_UNMAP, (_wh_t)STATIC_UNMAP)
697678#define AM_ROMBANK(_bank)               AM_READ((_rh_t)(STATIC_BANK1 + (_bank) - 1))
698679#define AM_RAMBANK(_bank)               AM_READWRITE((_rh_t)(STATIC_BANK1 + (_bank) - 1), (_wh_t)(STATIC_BANK1 + (_bank) - 1))
r1649r1650
10301011#define ACCESSING_MSB32            ((mem_mask & 0xff000000) == 0)
10311012
10321013/* ----- opcode range safety checks ----- */
1033#if CPUREADOP_SAFETY_NONE
1034#define address_is_unsafe(A)      (0)
1035#elif CPUREADOP_SAFETY_PARTIAL
1036#define address_is_unsafe(A)      (UNEXPECTED((A) > opcode_memory_max))
1037#elif CPUREADOP_SAFETY_FULL
10381014#define address_is_unsafe(A)      ((UNEXPECTED((A) < opcode_memory_min) || UNEXPECTED((A) > opcode_memory_max)))
1039#else
1040#error Must set either CPUREADOP_SAFETY_NONE, CPUREADOP_SAFETY_PARTIAL or CPUREADOP_SAFETY_FULL
1041#endif
10421015
10431016/* ----- dynamic memory installation ----- */
10441017#define memory_install_read_handler(cpu, space, start, end, mask, mirror, handler)                  \
src/emu/mame.c
r1649r1650
1111
1212    Since there has been confusion in the past over the order of
1313    initialization and other such things, here it is, all spelled out
14    as of February, 2006:
14    as of January, 2008:
1515
1616    main()
1717        - does platform-specific init
18        - calls run_game() [mame.c]
18        - calls mame_execute() [mame.c]
1919
20        run_game() [mame.c]
20        mame_execute() [mame.c]
2121            - calls mame_validitychecks() [validity.c] to perform validity checks on all compiled drivers
2222            - calls setjmp to prepare for deep error handling
2323            - begins resource tracking (level 1)
r1649r1650
2929                - calls sndintrf_init() [sndintrf.c] to determine which sound chips are available
3030                - calls fileio_init() [fileio.c] to initialize file I/O info
3131                - calls config_init() [config.c] to initialize configuration system
32                - calls input_init() [input.c] to initialize the input system
3233                - calls output_init() [output.c] to initialize the output system
3334                - calls state_init() [state.c] to initialize save state system
3435                - calls state_save_allow_registration() [state.c] to allow registrations
r1649r1650
4142                - calls generic_sound_init() [audio/generic.c] to initialize generic sound structures
4243                - calls timer_init() [timer.c] to reset the timer system
4344                - calls osd_init() [osdepend.h] to do platform-specific initialization
44                - calls code_init() [input.c] to initialize the input system
4545                - calls input_port_init() [inptport.c] to set up the input ports
4646                - calls rom_init() [romload.c] to load the game's ROMs
4747                - calls memory_init() [memory.c] to process the game's memory maps
4848                - calls cpuexec_init() [cpuexec.c] to initialize the CPUs
4949                - calls cpuint_init() [cpuint.c] to initialize the CPU interrupts
50                - calls mame_debug_init() [debugcpu.c] to set up the debugger
5051                - calls the driver's DRIVER_INIT callback
5152                - calls video_init() [video.c] to start the video system
5253                - calls sound_init() [sound.c] to start the audio system
r1649r1650
5455                - disposes of regions marked as disposable
5556                - calls saveload_init() [mame.c] to set up for save/load
5657                - calls cheat_init() [cheat.c] to initialize the cheat system
57                - calls mame_debug_init() [debugcpu.c] to set up the debugger
5858
5959            - calls config_load_settings() [config.c] to load the configuration file
6060            - calls nvram_load [machine/generic.c] to load NVRAM
61            - calls ui_init() [ui.c] to initialize the user interface
61            - calls ui_display_startup_screens() [ui.c] to display the the startup screens
6262            - begins resource tracking (level 2)
6363            - calls soft_reset() [mame.c] to reset all systems
6464
r1649r1650
8484#include "render.h"
8585#include "ui.h"
8686#include "uimenu.h"
87#include "deprecat.h"
8788
88#ifdef MAME_DEBUG
89#ifdef ENABLE_DEBUGGER
8990#include "debug/debugcon.h"
9091#endif
9192
r1649r1650
12961297   parse_ini_file(options, CONFIGNAME);
12971298
12981299   /* debug builds: parse "debug.ini" as well */
1299#ifdef MAME_DEBUG
1300#ifdef ENABLE_DEBUGGER
13001301   parse_ini_file(options, "debug");
13011302#endif
13021303
r1649r1650
14461447   machine->playback_file = NULL;
14471448
14481449   /* debugger-related information */
1449#ifdef MAME_DEBUG
1450#ifdef ENABLE_DEBUGGER
14501451   machine->debug_mode = options_get_bool(mame_options(), OPTION_DEBUG);
14511452#else
14521453   machine->debug_mode = 0;
r1649r1650
15431544   devices_init(machine);
15441545#endif
15451546
1546#ifdef MAME_DEBUG
1547#ifdef ENABLE_DEBUGGER
15471548   /* initialize the debugger */
15481549   if (machine->debug_mode)
15491550      mame_debug_init(machine);
src/emu/inptport.c
r1649r1650
9898#include "profiler.h"
9999#include "inputseq.h"
100100#include "ui.h"
101#include <math.h>
101#include "deprecat.h"
102102#include <ctype.h>
103103#include <time.h>
104104
r1649r1650
225225   int               current_port;/* current port index */
226226};
227227
228/* Support for eXtended INP format */
229struct ext_header
230{
231   char header[7];  // must be "XINP" followed by NULLs
232   char shortname[9];  // game shortname
233   char version[32];  // MAME version string
234   UINT32 starttime;  // approximate INP start time
235   char dummy[32];  // for possible future expansion
236};
237228
238229
239230/***************************************************************************
r1649r1650
272263/* recorded speed read from an INP file */
273264static double rec_speed;
274265
275/* set to 1 if INP file being played is a standard MAME INP file */
276static int no_extended_inp;
266/* set to TRUE if INP file being played is an extended INP file */
267static int extended_inp;
277268
278269/* for average speed calculations */
279270static int framecount;
280271static double totalspeed;
281272
282273
274
283275/***************************************************************************
284276    PORT HANDLER TABLES
285277***************************************************************************/
r1649r1650
11551147static void setup_playback(running_machine *machine)
11561148{
11571149   const char *filename = options_get_string(mame_options(), OPTION_PLAYBACK);
1150   ext_inp_header extinpheader;
11581151   inp_header inpheader;
11591152   file_error filerr;
11601153   time_t started_time;
1161   struct ext_header xheader;
11621154   char check[7];
11631155
11641156   /* if no file, nothing to do */
r1649r1650
11691161   filerr = mame_fopen(SEARCHPATH_INPUTLOG, filename, OPEN_FLAG_READ, &machine->playback_file);
11701162   assert_always(filerr == FILERR_NONE, "Failed to open file for playback");
11711163
1172   // read first four bytes to check INP type
1173   mame_fread(Machine->playback_file, check, 7);
1174   mame_fseek(Machine->playback_file, 0, SEEK_SET);
1164   /* read first four bytes to check INP type */
1165   mame_fread(machine->playback_file, check, 7);
1166   mame_fseek(machine->playback_file, 0, SEEK_SET);
11751167
11761168   /* Check if input file is an eXtended INP file */
1177   if (strncmp(check,"XINP\0\0\0",7) != 0)
1169   extended_inp = (memcmp(check, "XINP\0\0\0", 7) == 0);
1170   if (extended_inp)
11781171   {
1179      no_extended_inp = 1;
1180      mame_printf_info("This INP file is not an extended INP file, extra info not available\n");
1181
11821172      /* read playback header */
11831173      mame_fread(machine->playback_file, &inpheader, sizeof(inpheader));
11841174
r1649r1650
11961186   }
11971187    else
11981188   {
1199      no_extended_inp = 0;
1200      mame_printf_info("Extended INP file info:\n");
1189      /* read playback header */
1190      mame_fread(machine->playback_file, &extinpheader, sizeof(extinpheader));
12011191
1202      // read header
1203      mame_fread(Machine->playback_file, &xheader, sizeof(struct ext_header));
1204
1205      // output info to console
1206      mame_printf_info("Version string: %s\n",xheader.version);
1207      started_time = (time_t)xheader.starttime;
1192      /* output info to console */
1193      mame_printf_info("Extended INP file info:\n");
1194      mame_printf_info("Version string: %s\n", extinpheader.version);
1195      started_time = (time_t)extinpheader.starttime;
12081196      mame_printf_info("Start time: %s\n", ctime(&started_time));
12091197
1210      // verify header against current game
1211      if (strcmp(machine->gamedrv->name, xheader.shortname) != 0)
1212         fatalerror("Input file is for " GAMENOUN " '%s', not for current " GAMENOUN " '%s'\n", xheader.shortname, machine->gamedrv->name);
1198      /* verify header against current game */
1199      if (strcmp(machine->gamedrv->name, extinpheader.shortname) != 0)
1200         fatalerror("Input file is for " GAMENOUN " '%s', not for current " GAMENOUN " '%s'\n", extinpheader.shortname, machine->gamedrv->name);
12131201      else
12141202         mame_printf_info("Playing back previously recorded " GAMENOUN " %s\n", machine->gamedrv->name);
12151203   }
1216
12171204}
12181205
12191206
r1649r1650
27902777      {
27912778         mame_fclose(Machine->playback_file);
27922779         Machine->playback_file = NULL;
2793         if(no_extended_inp)
2780         if (!extended_inp)
27942781            popmessage("End of playback");
27952782         else
27962783         {
2797            popmessage("End of playback - %i frames - Average speed %f%%",framecount,(double)totalspeed/framecount);
2798            printf("End of playback - %i frames - Average speed %f%%\n",framecount,(double)totalspeed/framecount);
2784            popmessage("End of playback - %i frames - Average speed %f%%", framecount, (double)totalspeed/framecount);
2785            printf("End of playback - %i frames - Average speed %f%%\n", framecount, (double)totalspeed/framecount);
27992786         }
28002787      }
28012788   }
r1649r1650
30082995   }
30092996
30102997   /* store speed read from INP file, if extended INP */
3011   if (Machine->playback_file != NULL && !no_extended_inp)
2998   if (Machine->playback_file != NULL && extended_inp)
30122999   {
30133000      UINT32 dummy;
30143001      mame_fread(Machine->playback_file, &rec_speed, sizeof(rec_speed));
src/emu/machine/msm6242.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/msm6242.h"
910
1011static UINT8 msm6264_reg[3] = { 0, 0, 0 };
src/emu/machine/timekpr.c
r1649r1650
66 */
77
88#include "driver.h"
9#include "deprecat.h"
910#include "machine/timekpr.h"
1011
1112struct timekeeper_chip
src/emu/machine/6526cia.c
r1649r1650
99
1010#include "driver.h"
1111#include "6526cia.h"
12#include "deprecat.h"
1213
1314
1415
src/emu/machine/idectrl.c
r1649r1650
77#include "driver.h"
88#include "idectrl.h"
99#include "debugger.h"
10#include "deprecat.h"
1011
1112
1213/*************************************
src/emu/machine/6821pia.c
r1649r1650
55**********************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "6821pia.h"
910
1011
src/emu/machine/6532riot.c
r1649r1650
1212***************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "machine/6532riot.h"
1617
1718struct riot6532
src/emu/machine/laserdsc.c
r1649r1650
1414#include "avcomp.h"
1515#include "profiler.h"
1616#include "streams.h"
17#include "deprecat.h"
1718#include "sound/custom.h"
1819
1920
src/emu/machine/6840ptm.c
r1649r1650
66    This function is a simple emulation of up to 4 MC6840
77    Programmable Timer Modules
88
9    Written By El Condor based on previous work by Aaron Giles,
9    Written By J.Wallace based on previous work by Aaron Giles,
1010   'Re-Animator' and Mathis Rosenhauer.
1111
1212    Todo:
r1649r1650
3333**********************************************************************/
3434
3535#include "driver.h"
36#include "deprecat.h"
3637#include "6840ptm.h"
3738
3839#ifdef MAME_DEBUG
r1649r1650
118119
119120///////////////////////////////////////////////////////////////////////////
120121//                                                                       //
122// ptm6840_get_irq: get IRQ state                                        //
123//                                                                       //
124///////////////////////////////////////////////////////////////////////////
125
126int ptm6840_get_irq(int which)
127{
128   ptm6840 *p = ptm + which;
129   return p->IRQ;
130}
131
132///////////////////////////////////////////////////////////////////////////
133//                                                                       //
121134// Subtract from Counter                                                 //
122135//                                                                       //
123136///////////////////////////////////////////////////////////////////////////
r1649r1650
196209
197210INLINE void update_interrupts(int which)
198211{
212   int new_state;
199213   ptm6840 *currptr = ptm + which;
200   currptr->status_reg &= ~0x80;
201214
202   if ((currptr->status_reg & 0x01) && (currptr->control_reg[0] & 0x40)) currptr->status_reg |= 0x80;
203   if ((currptr->status_reg & 0x02) && (currptr->control_reg[1] & 0x40)) currptr->status_reg |= 0x80;
204   if ((currptr->status_reg & 0x04) && (currptr->control_reg[2] & 0x40)) currptr->status_reg |= 0x80;
215   new_state = (((currptr->status_reg & 0x01) && (currptr->control_reg[0] & 0x40)) || ((currptr->status_reg & 0x02) && (currptr->control_reg[1] & 0x40))
216            ||((currptr->status_reg & 0x04) && (currptr->control_reg[2] & 0x80)));
205217
206   currptr->IRQ = currptr->status_reg >> 7;
207
208   if ( currptr->intf->irq_func )
218   if (new_state != currptr->IRQ)
209219   {
210      currptr->intf->irq_func(currptr->IRQ);
220      currptr->IRQ = new_state;
221      if (currptr->IRQ)
222      {
223         currptr->status_reg |= 0x80;
224      }
225      else
226      {
227         currptr->status_reg &= ~0x80;
228      }
229      if (currptr->intf->irq_func) (currptr->intf->irq_func)(currptr->IRQ);
211230   }
212231}
213232
r1649r1650
291310
292311   currptr->fired[idx]=0;
293312
294   if ((currptr->mode[idx] == 4)|(currptr->mode[idx] == 6))
313   if ((currptr->mode[idx] == 4)||(currptr->mode[idx] == 6))
295314   {
296315      currptr->output[idx] = 1;
297316      if ( currptr->intf->out_func[idx] ) currptr->intf->out_func[idx](0, currptr->output[idx]);
r1649r1650
644663
645664///////////////////////////////////////////////////////////////////////////
646665//                                                                       //
647// ptm6840_set_clock: set clock status (0 or 1)                         //
666// ptm6840_set_clock: set clock status (0 or 1)                          //
648667//                                                                       //
649668///////////////////////////////////////////////////////////////////////////
650669
r1649r1650
664683void ptm6840_set_c2(int which, int state) { ptm6840_set_clock(which, state, 1); }
665684void ptm6840_set_c3(int which, int state) { ptm6840_set_clock(which, state, 2); }
666685
667///////////////////////////////////////////////////////////////////////////
686/////////////////////////////////////////////////////////////////////////////////
668687
669688READ8_HANDLER( ptm6840_0_r ) { return ptm6840_read(0, offset); }
670689READ8_HANDLER( ptm6840_1_r ) { return ptm6840_read(1, offset); }
src/emu/machine/6840ptm.h
r1649r1650
3131void ptm6840_write(  int which, int offset, int data);
3232
3333int ptm6840_get_status(int which, int clock);   // get whether timer is enabled
34int ptm6840_get_irq(int which);            // get IRQ state
3435void ptm6840_set_g1(int which, int state);   // set gate1  state
3536void ptm6840_set_c1(int which, int state);   // set clock1 state
3637
src/emu/machine/z80dma.c
r1649r1650
2121**********************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "memconv.h"
2526#include "z80dma.h"
2627
src/emu/machine/generic.c
r1649r1650
1212#include "driver.h"
1313#include "config.h"
1414#include "generic.h"
15#include <stdarg.h>
16#include <ctype.h>
15#include "deprecat.h"
1716
1817
1918
src/emu/machine/ds1302.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "ds1302.h"
34
45/********************
src/emu/machine/8042kbdc.c
r1649r1650
11/*********************************************************************
22
3    ibmat.c
3    8042kbdc.c
44
55    Code specific to fun IBM AT stuff
66
r1649r1650
175175
176176#include "driver.h"
177177#include "memconv.h"
178#include "deprecat.h"
178179
179180#include "machine/pckeybrd.h"
180181#include "machine/8042kbdc.h"
src/emu/machine/74181.c
r1649r1650
66 */
77
88#include "driver.h"
9#include "deprecat.h"
910#include "74181.h"
1011
1112
src/emu/machine/8237dma.c
r1649r1650
1919**********************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "memconv.h"
2324#include "8237dma.h"
2425
src/emu/machine/8257dma.c
r1649r1650
2525**********************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2829#include "memconv.h"
2930#include "8257dma.h"
3031
src/emu/machine/tmp68301.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "machine/tmp68301.h"
1314
1415UINT16 *tmp68301_regs;
src/emu/machine/z80ctc.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "z80ctc.h"
1415#include "cpu/z80/z80.h"
1516#include "cpu/z80/z80daisy.h"
src/emu/machine/mc146818.c
r1649r1650
7373
7474#include "driver.h"
7575#include "memconv.h"
76#include "deprecat.h"
7677#include "machine/mc146818.h"
7778
7879
src/emu/machine/rtc65271.c
r1649r1650
1616*/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "rtc65271.h"
2021
2122static void field_interrupts(void);
src/emu/mame.h
r1649r1650
188188   const pen_t *         pens;            /* remapped palette pen numbers */
189189   struct _colortable_t *   colortable;         /* global colortable for remapping */
190190   const UINT16 *         game_colortable;   /* lookup table used to map gfx pen numbers to color numbers */
191   const pen_t *         remapped_colortable;/* the above, already remapped through Machine->pens */
191   const pen_t *         remapped_colortable;/* the above, already remapped through machine->pens */
192192   pen_t *               shadow_table;      /* table for looking up a shadowed pen */
193193
194194   /* audio-related information */
r1649r1650
248248    GLOBAL VARAIBLES
249249***************************************************************************/
250250
251extern running_machine *Machine;
252251extern const char mame_disclaimer[];
253252extern char giant_string_buffer[];
254253
src/emu/inptport.h
r1649r1650
597597#ifdef MESS
598598   struct
599599   {
600      unicode_char chars[3];/* (MESS-specific) unicode key data */
600      unicode_char chars[3];   /* (MESS-specific) unicode key data */
601601   } keyboard;
602602#endif /* MESS */
603603};
r1649r1650
606606typedef struct _inp_header inp_header;
607607struct _inp_header
608608{
609   char name[9];      /* 8 bytes for game->name + NUL */
610   char version[3];   /* byte[0] = 0, byte[1] = version byte[2] = beta_version */
611   char reserved[20]; /* for future use, possible store game options? */
609   char    name[9];            /* 8 bytes for game->name + NUL */
610   char    version[3];         /* byte[0] = 0, byte[1] = version byte[2] = beta_version */
611   char    reserved[20];       /* for future use, possible store game options? */
612612};
613613
614614
615typedef struct _ext_inp_header ext_inp_header;
616struct _ext_inp_header
617{
618   char    header[7];         /* must be "XINP" followed by NULLs */
619   char    shortname[9];      /* game shortname */
620   char    version[32];      /* MAME version string */
621   UINT32 starttime;         /* approximate INP start time */
622   char    dummy[32];         /* for possible future expansion */
623};
615624
625
626
616627/***************************************************************************
617628    MACROS FOR BUILDING INPUT PORTS
618629***************************************************************************/
src/emu/cpuintrf.c
r1649r1650
161161void mediagx_get_info(UINT32 state, cpuinfo *info);
162162void i960_get_info(UINT32 state, cpuinfo *info);
163163void h8_3002_get_info(UINT32 state, cpuinfo *info);
164void h8_3007_get_info(UINT32 state, cpuinfo *info);
165void h8_3044_get_info(UINT32 state, cpuinfo *info);
164166void v810_get_info(UINT32 state, cpuinfo *info);
165167void m37702_get_info(UINT32 state, cpuinfo *info);
166168void m37710_get_info(UINT32 state, cpuinfo *info);
r1649r1650
674676#endif
675677#if (HAS_H83002)
676678   { CPU_H83002, h8_3002_get_info },
679   { CPU_H83007, h8_3007_get_info },
680   { CPU_H83044, h8_3044_get_info },
677681#endif
678682#if (HAS_V810)
679683   { CPU_V810, v810_get_info },
src/emu/cpuexec.c
r1649r1650
99
1010***************************************************************************/
1111
12#include <math.h>
1312#include "driver.h"
13#include "deprecat.h"
1414#include "cheat.h"
1515#include "profiler.h"
1616#include "debugger.h"
1717
18#ifdef MAME_DEBUG
18#ifdef ENABLE_DEBUGGER
1919#include "debug/debugcpu.h"
2020#endif
2121
2222
2323
24/*************************************
25 *
26 *  Debug logging
27 *
28 *************************************/
24/***************************************************************************
25    DEBUGGING
26***************************************************************************/
2927
3028#define VERBOSE 0
3129
r1649r1650
3331
3432
3533
36/*************************************
37 *
38 *  Macros to help verify active CPU
39 *
40 *************************************/
34/***************************************************************************
35    MACROS
36***************************************************************************/
4137
4238#define VERIFY_ACTIVECPU(name) \
4339   int activecpu = cpu_getactivecpu(); \
r1649r1650
5248
5349
5450
55/*************************************
56 *
57 *  Triggers for the timer system
58 *
59 *************************************/
51/***************************************************************************
52    CONSTANTS
53***************************************************************************/
6054
55/* internal trigger IDs */
6156enum
6257{
6358   TRIGGER_TIMESLICE    = -1000,
r1649r1650
6863
6964
7065
71/*************************************
72 *
73 *  Internal CPU info structure
74 *
75 *************************************/
66/***************************************************************************
67    TYPE DEFINITIONS
68***************************************************************************/
7669
70/* Internal CPU info structure */
7771typedef struct _cpuexec_data cpuexec_data;
7872struct _cpuexec_data
7973{
80   UINT8   saveable;            /* true if saveable */
74   UINT8      saveable;            /* true if saveable */
8175
82   UINT8   suspend;            /* suspend reason mask (0 = not suspended) */
83   UINT8   nextsuspend;         /* pending suspend reason mask */
84   UINT8   eatcycles;            /* true if we eat cycles while suspended */
85   UINT8   nexteatcycles;         /* pending value */
86   INT32   trigger;            /* pending trigger to release a trigger suspension */
76   UINT8      suspend;            /* suspend reason mask (0 = not suspended) */
77   UINT8      nextsuspend;         /* pending suspend reason mask */
78   UINT8      eatcycles;            /* true if we eat cycles while suspended */
79   UINT8      nexteatcycles;         /* pending value */
80   INT32      trigger;            /* pending trigger to release a trigger suspension */
8781
88   INT32    iloops;             /* number of interrupts remaining this frame */
82   INT32       iloops;             /* number of interrupts remaining this frame */
8983
90   UINT64    totalcycles;         /* total CPU cycles executed */
91   attotime localtime;            /* local time, relative to the timer system's global time */
92   INT32   clock;               /* current active clock */
93   double   clockscale;            /* current active clock scale factor */
84   UINT64       totalcycles;         /* total CPU cycles executed */
85   attotime    localtime;            /* local time, relative to the timer system's global time */
86   INT32      clock;               /* current active clock */
87   double      clockscale;            /* current active clock scale factor */
9488
95   INT32   vblankint_countdown;   /* number of vblank callbacks left until we interrupt */
96   INT32    vblankint_multiplier;   /* number of vblank callbacks per interrupt */
97   void *   vblankint_timer;      /* reference to elapsed time counter */
89   INT32      vblankint_countdown;   /* number of vblank callbacks left until we interrupt */
90   INT32       vblankint_multiplier;   /* number of vblank callbacks per interrupt */
91   emu_timer *   vblankint_timer;      /* reference to elapsed time counter */
9892
99   void *   timedint_timer;         /* reference to this CPU's timer */
100   attotime timedint_period;       /* timing period of the timed interrupt */
93   emu_timer *   timedint_timer;         /* reference to this CPU's timer */
94   attotime    timedint_period;       /* timing period of the timed interrupt */
10195};
10296
10397
10498
105/*************************************
106 *
107 *  General CPU variables
108 *
109 *************************************/
99/***************************************************************************
100    GLOBAL VARIABLES
101***************************************************************************/
110102
103/* general CPU variables */
111104static cpuexec_data cpu[MAX_CPU];
112105
113106static UINT8 vblank;
114107static UINT32 current_frame;
115static INT32 watchdog_counter;
116108
117109static int cycles_running;
118110static int cycles_stolen;
119111
120112
121
122/*************************************
123 *
124 *  Timer variables
125 *
126 *************************************/
127
113/* timer variables */
128114static emu_timer *vblank_timer;
129115static INT32 vblank_countdown;
130116static INT32 vblank_multiplier;
r1649r1650
142128static emu_timer *interleave_boost_timer_end;
143129static attotime perfect_interleave;
144130
131/* watchdog state */
132static UINT8 watchdog_enabled;
133static INT32 watchdog_counter;
145134static emu_timer *watchdog_timer;
146135
147136
148137
149/*************************************
150 *
151 *  Static prototypes
152 *
153 *************************************/
138/***************************************************************************
139    FUNCTION PROTOTYPES
140***************************************************************************/
154141
155142static void cpuexec_exit(running_machine *machine);
156143static void cpuexec_reset(running_machine *machine);
r1649r1650
160147static TIMER_CALLBACK( cpu_updatecallback );
161148static TIMER_CALLBACK( end_interleave_boost );
162149static void compute_perfect_interleave(running_machine *machine);
163static void watchdog_setup(running_machine *machine, int alloc_new);
164150
151void cpu_compute_vblank_timing(running_machine *machine);
165152
166153
167/*************************************
168 *
169 *  Watchdog Flags
170 *
171 *************************************/
172154
173#define WATCHDOG_IS_STARTED_DISABLED   -1
174#define WATCHDOG_IS_DISABLED         -2
175#define WATCHDOG_IS_TIMER_BASED         -3
176#define WATCHDOG_IS_INVALID            -4
177#define WATCHDOG_IS_BEING_STARTED      -5
155/***************************************************************************
156    CORE CPU EXECUTION
157***************************************************************************/
178158
159/*-------------------------------------------------
160    cpuexec_init - initialize internal states of
161    all CPUs
162-------------------------------------------------*/
179163
180
181#if 0
182#pragma mark CORE CPU
183#endif
184
185/*************************************
186 *
187 *  Initialize all the CPUs
188 *
189 *************************************/
190
191164void cpuexec_init(running_machine *machine)
192165{
193166   int cpunum;
r1649r1650
266239   state_save_push_tag(0);
267240   state_save_register_item("cpu", 0, vblank);
268241   state_save_register_item("cpu", 0, current_frame);
242   state_save_register_item("cpu", 0, watchdog_enabled);
269243   state_save_register_item("cpu", 0, watchdog_counter);
270244   state_save_register_item("cpu", 0, vblank_countdown);
271245   state_save_pop_tag();
272246}
273247
274248
249/*-------------------------------------------------
250    cpuexec_reset - reset CPU states on a soft
251    reset
252-------------------------------------------------*/
275253
276/*************************************
277 *
278 *  Prepare the system for execution
279 *
280 *************************************/
281
282254static void cpuexec_reset(running_machine *machine)
283255{
284256   int cpunum;
285257
286258   /* initialize the various timers (suspends all CPUs at startup) */
287259   cpu_inittimers(machine);
288   watchdog_counter = WATCHDOG_IS_INVALID;
289   watchdog_setup(machine, TRUE);
290260
261   /* set up the watchdog timer; only start off enabled if explicitly configured */
262   watchdog_enabled = (machine->drv->watchdog_vblank_count != 0 || attotime_compare(machine->drv->watchdog_time, attotime_zero) != 0);
263   watchdog_reset(machine);
264
291265   /* first pass over CPUs */
292266   for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
293267   {
r1649r1650
311285}
312286
313287
288/*-------------------------------------------------
289    cpuexec_exit - cleanup all CPUs on exit
290-------------------------------------------------*/
314291
315/*************************************
316 *
317 *  Deinitialize all the CPUs
318 *
319 *************************************/
320
321292static void cpuexec_exit(running_machine *machine)
322293{
323294   int cpunum;
r1649r1650
328299}
329300
330301
302/*-------------------------------------------------
303    cpuexec_timeslice - execute all CPUs for a
304    single timeslice
305-------------------------------------------------*/
331306
332
333#if 0
334#pragma mark -
335#pragma mark WATCHDOG
336#endif
337
338/*************************************
339 *
340 *  Watchdog timer callback
341 *
342 *************************************/
343
344static TIMER_CALLBACK( watchdog_callback )
345{
346   logerror("reset caused by the (time) watchdog\n");
347   mame_schedule_soft_reset(machine);
348}
349
350
351
352/*************************************
353 *
354 *  Watchdog setup routine
355 *
356 *************************************/
357
358static void watchdog_setup(running_machine *machine, int alloc_new)
359{
360   if (watchdog_counter != WATCHDOG_IS_DISABLED)
361   {
362      if (machine->drv->watchdog_vblank_count)
363      {
364         /* Start a vblank based watchdog. */
365         watchdog_counter = machine->drv->watchdog_vblank_count;
366      }
367      else if (attotime_compare(machine->drv->watchdog_time, attotime_zero) != 0)
368      {
369         /* Start a time based watchdog. */
370         if (alloc_new)
371            watchdog_timer = timer_alloc(watchdog_callback, NULL);
372         timer_adjust(watchdog_timer, machine->drv->watchdog_time, 0, attotime_zero);
373         watchdog_counter = WATCHDOG_IS_TIMER_BASED;
374      }
375      else if (watchdog_counter == WATCHDOG_IS_INVALID)
376      {
377         /* The watchdog was not initialized in the MACHINE_DRIVER,
378             * so we will start with it disabled.
379             */
380         watchdog_counter = WATCHDOG_IS_STARTED_DISABLED;
381      }
382      else
383      {
384         /* The watchdog was not initialized in the MACHINE_DRIVER.
385             * But it has been manually started, so we will default to
386             * using a vblank watchdog.  We will set up a default time
387             * of 3 times the refresh rate.  Which is 3 seconds @ 60Hz
388             * refresh.
389
390             * The 3 seconds delay is targeted at qzshowby, which otherwise
391             * would reset at the start of a game.
392             */
393         watchdog_counter = 3 * ATTOSECONDS_TO_HZ(machine->screen[0].refresh);
394      }
395   }
396}
397
398
399
400/*************************************
401 *
402 *  Watchdog reset
403 *
404 *************************************/
405
406void watchdog_reset(running_machine *machine)
407{
408   if (watchdog_counter == WATCHDOG_IS_TIMER_BASED)
409   {
410      timer_reset(watchdog_timer, machine->drv->watchdog_time);
411   }
412   else
413   {
414      if (watchdog_counter == WATCHDOG_IS_STARTED_DISABLED)
415      {
416         watchdog_counter = WATCHDOG_IS_BEING_STARTED;
417         logerror("(vblank) watchdog armed by reset\n");
418      }
419
420      watchdog_setup(machine, FALSE);
421   }
422}
423
424
425
426/*************************************
427 *
428 *  Watchdog enable/disable
429 *
430 *************************************/
431
432void watchdog_enable(running_machine *machine, int enable)
433{
434   if (!enable)
435   {
436      // Disable all timers
437      watchdog_counter = WATCHDOG_IS_DISABLED;
438   }
439   else
440   // Setup only on change from disable to enable.
441   // Do not setup if watchdog is disabled from machine init.
442   if (watchdog_counter == WATCHDOG_IS_DISABLED)
443   {
444      watchdog_counter = WATCHDOG_IS_BEING_STARTED;
445      watchdog_setup(machine, FALSE);
446   }
447}
448
449
450
451#if 0
452#pragma mark -
453#pragma mark CPU SCHEDULING
454#endif
455
456/*************************************
457 *
458 *  Execute all the CPUs for one
459 *  timeslice
460 *
461 *************************************/
462
463307void cpuexec_timeslice(running_machine *machine)
464308{
465309   attotime target = timer_next_fire_time();
r1649r1650
552396
553397
554398
555/*************************************
556 *
557 *  Abort the timeslice for the
558 *  active CPU
559 *
560 *************************************/
399/***************************************************************************
400    CPU SCHEDULING
401***************************************************************************/
561402
403/*-------------------------------------------------
404    cpu_boost_interleave - temporarily boosts the
405    interleave factor
406-------------------------------------------------*/
407
408void cpu_boost_interleave(attotime timeslice_time, attotime boost_duration)
409{
410   /* if you pass 0 for the timeslice_time, it means pick something reasonable */
411   if (attotime_compare(timeslice_time, perfect_interleave) < 0)
412      timeslice_time = perfect_interleave;
413
414   LOG(("cpu_boost_interleave(%s, %s)\n", attotime_string(timeslice_time, 9), attotime_string(boost_duration, 9)));
415
416   /* adjust the interleave timer */
417   timer_adjust(interleave_boost_timer, timeslice_time, 0, timeslice_time);
418
419   /* adjust the end timer, but only if we are going to extend it */
420   if (!timer_enabled(interleave_boost_timer_end) || attotime_compare(timer_timeleft(interleave_boost_timer_end), boost_duration) < 0)
421      timer_adjust(interleave_boost_timer_end, boost_duration, 0, attotime_never);
422}
423
424
425/*-------------------------------------------------
426    activecpu_abort_timeslice - abort execution
427    for the current timeslice, allowing other
428    CPUs to run before we run again
429-------------------------------------------------*/
430
562431void activecpu_abort_timeslice(void)
563432{
564433   int current_icount;
r1649r1650
574443}
575444
576445
446/*-------------------------------------------------
447    cpunum_suspend - set a suspend reason for the
448    given CPU
449-------------------------------------------------*/
577450
578/*************************************
579 *
580 *  Return the current local time for
581 *  a CPU, relative to the current
582 *  timeslice
583 *
584 *************************************/
585
586attotime cpunum_get_localtime(int cpunum)
587{
588   attotime result;
589
590   VERIFY_CPUNUM(cpunum_get_localtime);
591
592   /* if we're active, add in the time from the current slice */
593   result = cpu[cpunum].localtime;
594   if (cpunum == cpu_getexecutingcpu())
595   {
596      int cycles = cycles_currently_ran();
597      result = attotime_add(result, ATTOTIME_IN_CYCLES(cycles, cpunum));
598   }
599   return result;
600}
601
602
603
604/*************************************
605 *
606 *  Set a suspend reason for the
607 *  given CPU
608 *
609 *************************************/
610
611451void cpunum_suspend(int cpunum, int reason, int eatcycles)
612452{
613453   VERIFY_CPUNUM(cpunum_suspend);
r1649r1650
621461}
622462
623463
464/*-------------------------------------------------
465    cpunum_resume - clear a suspend reason for the
466    given CPU
467-------------------------------------------------*/
624468
625/*************************************
626 *
627 *  Clear a suspend reason for a
628 *  given CPU
629 *
630 *************************************/
631
632469void cpunum_resume(int cpunum, int reason)
633470{
634471   VERIFY_CPUNUM(cpunum_resume);
r1649r1650
641478}
642479
643480
481/*-------------------------------------------------
482    cpunum_is_suspended - returns true if the
483    given CPU is suspended for any of the given
484    reasons
485-------------------------------------------------*/
644486
645/*************************************
646 *
647 *  Return true if a given CPU is
648 *  suspended
649 *
650 *************************************/
651
652487int cpunum_is_suspended(int cpunum, int reason)
653488{
654489   VERIFY_CPUNUM(cpunum_suspend);
r1649r1650
657492
658493
659494
660/*************************************
661 *
662 *  Gets the current CPU's clock speed
663 *
664 *************************************/
495/***************************************************************************
496    CPU CLOCK MANAGEMENT
497***************************************************************************/
665498
499/*-------------------------------------------------
500    update_clock_information - recomputes clock
501    information for the specified CPU
502-------------------------------------------------*/
503
504static void update_clock_information(running_machine *machine, int cpunum)
505{
506   /* recompute cps and spc */
507   cycles_per_second[cpunum] = (double)cpu[cpunum].clock * cpu[cpunum].clockscale;
508   attoseconds_per_cycle[cpunum] = ATTOSECONDS_PER_SECOND / ((double)cpu[cpunum].clock * cpu[cpunum].clockscale);
509
510   /* re-compute the perfect interleave factor */
511   compute_perfect_interleave(machine);
512}
513
514
515/*-------------------------------------------------
516    cpunum_get_clock - gets the given CPU's
517    clock speed
518-------------------------------------------------*/
519
666520int cpunum_get_clock(int cpunum)
667521{
668522   VERIFY_CPUNUM(cpunum_get_clock);
r1649r1650
670524}
671525
672526
527/*-------------------------------------------------
528    cpunum_set_clock - sets the given CPU's
529    clock speed
530-------------------------------------------------*/
673531
674/*************************************
675 *
676 *  Sets the current CPU's clock speed
677 *
678 *************************************/
679
680532void cpunum_set_clock(running_machine *machine, int cpunum, int clock)
681533{
682534   VERIFY_CPUNUM(cpunum_set_clock);
683535
684536   cpu[cpunum].clock = clock;
685   cycles_per_second[cpunum] = (double)clock * cpu[cpunum].clockscale;
686   attoseconds_per_cycle[cpunum] = ATTOSECONDS_PER_SECOND / ((double)clock * cpu[cpunum].clockscale);
687
688   /* re-compute the perfect interleave factor */
689   compute_perfect_interleave(machine);
537   update_clock_information(machine, cpunum);
690538}
691539
692540
541/*-------------------------------------------------
542    cpunum_get_clockscale - returns the current
543    scaling factor for a CPU's clock speed
544-------------------------------------------------*/
693545
694void cpunum_set_clock_period(running_machine *machine, int cpunum, attoseconds_t clock_period)
695{
696   VERIFY_CPUNUM(cpunum_set_clock);
697
698   cpu[cpunum].clock = ATTOSECONDS_PER_SECOND / clock_period;
699   cycles_per_second[cpunum] = (double) (ATTOSECONDS_PER_SECOND / clock_period) * cpu[cpunum].clockscale;
700   attoseconds_per_cycle[cpunum] = clock_period;
701
702   /* re-compute the perfect interleave factor */
703   compute_perfect_interleave(machine);
704}
705
706
707
708/*************************************
709 *
710 *  Returns the current scaling factor
711 *  for a CPU's clock speed
712 *
713 *************************************/
714
715546double cpunum_get_clockscale(int cpunum)
716547{
717548   VERIFY_CPUNUM(cpunum_get_clockscale);
r1649r1650
719550}
720551
721552
553/*-------------------------------------------------
554    cpunum_set_clockscale - sets the current
555    scaling factor for a CPU's clock speed
556-------------------------------------------------*/
722557
723/*************************************
724 *
725 *  Sets the current scaling factor
726 *  for a CPU's clock speed
727 *
728 *************************************/
729
730558void cpunum_set_clockscale(running_machine *machine, int cpunum, double clockscale)
731559{
732560   VERIFY_CPUNUM(cpunum_set_clockscale);
733561
734562   cpu[cpunum].clockscale = clockscale;
735   cycles_per_second[cpunum] = (double)cpu[cpunum].clock * clockscale;
736   attoseconds_per_cycle[cpunum] = ATTOSECONDS_PER_SECOND / ((double)cpu[cpunum].clock * clockscale);
737
738   /* re-compute the perfect interleave factor */
739   compute_perfect_interleave(machine);
563   update_clock_information(machine, cpunum);
740564}
741565
742566
743567
744/*************************************
745 *
746 *  Temporarily boosts the interleave
747 *  factor
748 *
749 *************************************/
568/***************************************************************************
569    CPU TIMING
570***************************************************************************/
750571
751void cpu_boost_interleave(attotime timeslice_time, attotime boost_duration)
572/*-------------------------------------------------
573    cpunum_get_localtime - returns the current
574    local time for a CPU
575-------------------------------------------------*/
576
577attotime cpunum_get_localtime(int cpunum)
752578{
753   /* if you pass 0 for the timeslice_time, it means pick something reasonable */
754   if (attotime_compare(timeslice_time, perfect_interleave) < 0)
755      timeslice_time = perfect_interleave;
579   attotime result;
756580
757   LOG(("cpu_boost_interleave(%s, %s)\n", attotime_string(timeslice_time, 9), attotime_string(boost_duration, 9)));
581   VERIFY_CPUNUM(cpunum_get_localtime);
758582
759   /* adjust the interleave timer */
760   timer_adjust(interleave_boost_timer, timeslice_time, 0, timeslice_time);
761
762   /* adjust the end timer, but only if we are going to extend it */
763   if (!timer_enabled(interleave_boost_timer_end) || attotime_compare(timer_timeleft(interleave_boost_timer_end), boost_duration) < 0)
764      timer_adjust(interleave_boost_timer_end, boost_duration, 0, attotime_never);
583   /* if we're active, add in the time from the current slice */
584   result = cpu[cpunum].localtime;
585   if (cpunum == cpu_getexecutingcpu())
586   {
587      int cycles = cycles_running - activecpu_get_icount();
588      result = attotime_add(result, ATTOTIME_IN_CYCLES(cycles, cpunum));
589   }
590   return result;
765591}
766592
767593
594/*-------------------------------------------------
595    activecpu_gettotalcycles - return the total
596    number of CPU cycles executed on the active
597    CPU
598-------------------------------------------------*/
768599
769#if 0
770#pragma mark -
771#pragma mark TIMING HELPERS
772#endif
773
774/*************************************
775 *
776 *  Return cycles ran this iteration
777 *
778 *************************************/
779
780int cycles_currently_ran(void)
600UINT64 activecpu_gettotalcycles(void)
781601{
782   VERIFY_EXECUTINGCPU(cycles_currently_ran);
783   return cycles_running - activecpu_get_icount();
784}
785
786
787
788/*************************************
789 *
790 *  Return total number of CPU cycles
791 *  for the active CPU or for a given CPU.
792 *
793 *************************************/
794
795/*--------------------------------------------------------------
796
797    IMPORTANT: this value wraps around in a relatively short
798    time. For example, for a 6MHz CPU, it will wrap around in
799    2^32/6000000 = 716 seconds = 12 minutes.
800
801    Make sure you don't do comparisons between values returned
802    by this function, but only use the difference (which will
803    be correct regardless of wraparound).
804
805    Alternatively, use the new 64-bit variants instead.
806
807--------------------------------------------------------------*/
808
809UINT32 activecpu_gettotalcycles(void)
810{
811602   VERIFY_ACTIVECPU(activecpu_gettotalcycles);
812603   if (activecpu == cpu_getexecutingcpu())
813      return cpu[activecpu].totalcycles + cycles_currently_ran();
604      return cpu[activecpu].totalcycles + cycles_running - activecpu_get_icount();
814605   else
815606      return cpu[activecpu].totalcycles;
816607}
817608
818UINT32 cpunum_gettotalcycles(int cpunum)
819{
820   VERIFY_CPUNUM(cpunum_gettotalcycles);
821   if (cpunum == cpu_getexecutingcpu())
822      return cpu[cpunum].totalcycles + cycles_currently_ran();
823   else
824      return cpu[cpunum].totalcycles;
825}
826609
610/*-------------------------------------------------
611    cpunum_gettotalcycles - return the total
612    number of CPU cycles executed on the
613    specified CPU
614-------------------------------------------------*/
827615
828UINT64 activecpu_gettotalcycles64(void)
616UINT64 cpunum_gettotalcycles(int cpunum)
829617{
830   VERIFY_ACTIVECPU(activecpu_gettotalcycles64);
831   if (activecpu == cpu_getexecutingcpu())
832      return cpu[activecpu].totalcycles + cycles_currently_ran();
833   else
834      return cpu[activecpu].totalcycles;
835}
836
837UINT64 cpunum_gettotalcycles64(int cpunum)
838{
839   VERIFY_CPUNUM(cpunum_gettotalcycles64);
618   VERIFY_CPUNUM(cpunum_gettotalcycles);
840619   if (cpunum == cpu_getexecutingcpu())
841      return cpu[cpunum].totalcycles + cycles_currently_ran();
620      return cpu[cpunum].totalcycles + cycles_running - activecpu_get_icount();
842621   else
843622      return cpu[cpunum].totalcycles;
844623}
845624
846625
626/*-------------------------------------------------
627    activecpu_eat_cycles - safely eats cycles so
628    we don't cross a timeslice boundary
629-------------------------------------------------*/
847630
848/*************************************
849 *
850 *  Safely eats cycles so we don't
851 *  cross a timeslice boundary
852 *
853 *************************************/
854
855631void activecpu_eat_cycles(int cycles)
856632{
857633   int cyclesleft = activecpu_get_icount();
r1649r1650
862638
863639
864640
865/*************************************
866 *
867 *  Scales a given value by the fraction
868 *  of time elapsed between refreshes
869 *
870 *************************************/
641/***************************************************************************
642    SYNCHRONIZATION HELPERS
643***************************************************************************/
871644
872int cpu_scalebyfcount(int value)
645/*-------------------------------------------------
646    cpu_suspend_until_trigger - suspend execution
647    until the given trigger fires
648-------------------------------------------------*/
649
650static void cpunum_suspend_until_trigger(int cpunum, int trigger, int eatcycles)
873651{
874   attotime refresh_elapsed = timer_timeelapsed(refresh_timer);
875   int result;
652   /* suspend the CPU immediately if it's not already */
653   cpunum_suspend(cpunum, SUSPEND_REASON_TRIGGER, eatcycles);
876654
877   /* shift off some bits to ensure no overflow */
878   if (value < 65536)
879      result = value * (refresh_elapsed.attoseconds >> 16) / (refresh_period.attoseconds >> 16);
880   else
881      result = value * (refresh_elapsed.attoseconds >> 32) / (refresh_period.attoseconds >> 32);
882   if (value >= 0)
883      return (result < value) ? result : value;
884   else
885      return (result > value) ? result : value;
655   /* set the trigger */
656   cpu[cpunum].trigger = TRIGGER_TIMESLICE;
886657}
887658
888659
660/*-------------------------------------------------
661    cpu_yield - yield our current timeslice
662-------------------------------------------------*/
889663
890#if 0
891#pragma mark -
892#pragma mark VIDEO TIMING
893#endif
664void cpu_yield(void)
665{
666   int cpunum = cpu_getexecutingcpu();
667   VERIFY_EXECUTINGCPU(cpu_yielduntil_trigger);
668   cpunum_suspend_until_trigger(cpunum, TRIGGER_TIMESLICE, FALSE);
669}
894670
895/*************************************
896 *
897 *  Computes the VBLANK timing
898 *
899 *************************************/
900671
901void cpu_compute_vblank_timing(running_machine *machine)
672/*-------------------------------------------------
673    cpu_spin - burn CPU cycles until our timeslice
674    is up
675-------------------------------------------------*/
676
677void cpu_spin(void)
902678{
903   refresh_period = attotime_make(0, machine->screen[0].refresh);
679   int cpunum = cpu_getexecutingcpu();
680   VERIFY_EXECUTINGCPU(cpu_yielduntil_trigger);
681   cpunum_suspend_until_trigger(cpunum, TRIGGER_TIMESLICE, TRUE);
682}
904683
905   /* recompute the vblank period */
906   vblank_period = attotime_make(0, machine->screen[0].refresh / (vblank_multiplier ? vblank_multiplier : 1));
907   if (vblank_timer != NULL && timer_enable(vblank_timer, FALSE))
908   {
909      attotime remaining = timer_timeleft(vblank_timer);
910      if (remaining.seconds == 0 && remaining.attoseconds == 0)
911         remaining = vblank_period;
912      timer_adjust(vblank_timer, remaining, 0, vblank_period);
913   }
914684
915   LOG(("cpu_compute_vblank_timing: refresh=%s vblank=%s\n", attotime_string(refresh_period, 9), attotime_string(vblank_period, 9)));
685/*-------------------------------------------------
686    cpu_spinuntil_trigger - burn CPU cycles until
687    a timer trigger
688-------------------------------------------------*/
689
690void cpu_spinuntil_trigger(int trigger)
691{
692   int cpunum = cpu_getexecutingcpu();
693   VERIFY_EXECUTINGCPU(cpu_yielduntil_trigger);
694   cpunum_suspend_until_trigger(cpunum, trigger, TRUE);
916695}
917696
918697
698/*-------------------------------------------------
699    cpunum_spinuntil_trigger - burn specified CPU
700    cycles until a timer trigger
701-------------------------------------------------*/
919702
920/*************************************
921 *
922 *  Returns the VBLANK state
923 *
924 *************************************/
925
926int cpu_getvblank(void)
703void cpunum_spinuntil_trigger(int cpunum, int trigger)
927704{
928   return vblank;
705   VERIFY_CPUNUM(cpunum_spinuntil_trigger);
706   cpunum_suspend_until_trigger(cpunum, trigger, TRUE);
929707}
930708
931709
710/*-------------------------------------------------
711    cpu_spinuntil_int - burn CPU cycles until the
712    next interrupt
713-------------------------------------------------*/
932714
933/*************************************
934 *
935 *  Returns the current frame count
936 *
937 *************************************/
715void cpu_spinuntil_int(void)
716{
717   int cpunum = cpu_getexecutingcpu();
718   VERIFY_EXECUTINGCPU(cpu_spinuntil_int);
719   cpunum_suspend_until_trigger(cpunum, TRIGGER_INT + cpunum, TRUE);
720}
938721
939int cpu_getcurrentframe(void)
722
723/*-------------------------------------------------
724    cpu_spinuntil_time - burn CPU cycles for a
725    specific period of time
726-------------------------------------------------*/
727
728void cpu_spinuntil_time(attotime duration)
940729{
941   return current_frame;
730   static int timetrig = 0;
731   int cpunum = cpu_getexecutingcpu();
732   VERIFY_EXECUTINGCPU(cpu_spinuntil_time);
733   cpunum_suspend_until_trigger(cpunum, TRIGGER_SUSPENDTIME + timetrig, TRUE);
734   cpu_triggertime(duration, TRIGGER_SUSPENDTIME + timetrig);
735   timetrig = (timetrig + 1) % 256;
942736}
943737
944738
945739
946#if 0
947#pragma mark -
948#pragma mark SYNCHRONIZATION
949#endif
740/***************************************************************************
741    TRIGGERS
742***************************************************************************/
950743
951/*************************************
952 *
953 *  Generate a specific trigger
954 *
955 *************************************/
744/*-------------------------------------------------
745    cpu_trigger - generate a trigger now
746-------------------------------------------------*/
956747
957748void cpu_trigger(running_machine *machine, int trigger)
958749{
r1649r1650
979770}
980771
981772
773/*-------------------------------------------------
774    cpu_triggertime - generate a trigger after a
775    specific period of time
776-------------------------------------------------*/
982777
983/*************************************
984 *
985 *  Generate a trigger in the future
986 *
987 *************************************/
988
989778static TIMER_CALLBACK( cpu_triggertime_callback )
990779{
991780   cpu_trigger(machine, param);
r1649r1650
998787}
999788
1000789
790/*-------------------------------------------------
791    cpu_triggerint - generate a trigger
792    corresponding to an interrupt on the given CPU
793-------------------------------------------------*/
1001794
1002/*************************************
1003 *
1004 *  Generate a trigger for an int
1005 *
1006 *************************************/
1007
1008795void cpu_triggerint(running_machine *machine, int cpunum)
1009796{
1010797   cpu_trigger(machine, TRIGGER_INT + cpunum);
r1649r1650
1012799
1013800
1014801
1015/*************************************
1016 *
1017 *  Burn/yield CPU cycles until a trigger
1018 *
1019 *************************************/
802/***************************************************************************
803    WATCHDOG TIMERS
804***************************************************************************/
1020805
1021void cpu_spinuntil_trigger(int trigger)
806/*-------------------------------------------------
807    watchdog_callback - watchdog timer callback
808-------------------------------------------------*/
809
810static TIMER_CALLBACK( watchdog_callback )
1022811{
1023   int cpunum = cpu_getexecutingcpu();
812   logerror("reset caused by the (time) watchdog\n");
813   mame_schedule_soft_reset(machine);
814}
1024815
1025   VERIFY_EXECUTINGCPU(cpu_spinuntil_trigger);
1026816
1027   /* suspend the CPU immediately if it's not already */
1028   cpunum_suspend(cpunum, SUSPEND_REASON_TRIGGER, 1);
817/*-------------------------------------------------
818    watchdog_reset - reset the watchdog timer
819-------------------------------------------------*/
1029820
1030   /* set the trigger */
1031   cpu[cpunum].trigger = trigger;
1032}
1033
1034void cpunum_spinuntil_trigger( int cpunum, int trigger )
821void watchdog_reset(running_machine *machine)
1035822{
1036   VERIFY_CPUNUM(cpunum_spinuntil_trigger);
823   /* if we're not enabled, skip it */
824   if (!watchdog_enabled)
825      timer_adjust(watchdog_timer, attotime_never, 0, attotime_zero);
1037826
1038   /* suspend the CPU immediately if it's not already */
1039   cpunum_suspend(cpunum, SUSPEND_REASON_TRIGGER, 1);
827   /* VBLANK-based watchdog? */
828   else if (machine->drv->watchdog_vblank_count != 0)
829      watchdog_counter = machine->drv->watchdog_vblank_count;
1040830
1041   /* set the trigger */
1042   cpu[cpunum].trigger = trigger;
831   /* timer-based watchdog? */
832   else if (attotime_compare(machine->drv->watchdog_time, attotime_zero) != 0)
833      timer_adjust(watchdog_timer, machine->drv->watchdog_time, 0, attotime_zero);
834
835   /* default to an obscene amount of time (3 seconds) */
836   else
837      timer_adjust(watchdog_timer, ATTOTIME_IN_SEC(3), 0, attotime_zero);
1043838}
1044839
1045840
841/*-------------------------------------------------
842    watchdog_enable - reset the watchdog timer
843-------------------------------------------------*/
1046844
1047/*************************************
1048 *
1049 *  Burn/yield CPU cycles until an
1050 *  interrupt
1051 *
1052 *************************************/
1053
1054void cpu_spinuntil_int(void)
845void watchdog_enable(running_machine *machine, int enable)
1055846{
1056   VERIFY_EXECUTINGCPU(cpu_spinuntil_int);
1057   cpu_spinuntil_trigger(TRIGGER_INT + activecpu);
847   /* when re-enabled, we reset our state */
848   if (watchdog_enabled != enable)
849   {
850      watchdog_enabled = enable;
851      watchdog_reset(machine);
852   }
1058853}
1059854
1060855
1061856
1062/*************************************
1063 *
1064 *  Burn/yield CPU cycles until the
1065 *  end of the current timeslice
1066 *
1067 *************************************/
857/***************************************************************************
858    CHEESY FAKE VIDEO TIMING
859***************************************************************************/
1068860
1069void cpu_spin(void)
1070{
1071   cpu_spinuntil_trigger(TRIGGER_TIMESLICE);
1072}
861/*-------------------------------------------------
862    cpu_compute_vblank_timing - recompute cheesy
863    VBLANK timing after a video change
864-------------------------------------------------*/
1073865
1074
1075void cpu_yield(void)
866void cpu_compute_vblank_timing(running_machine *machine)
1076867{
1077   int cpunum = cpu_getexecutingcpu();
868   refresh_period = attotime_make(0, machine->screen[0].refresh);
1078869
1079   VERIFY_EXECUTINGCPU(cpu_yielduntil_trigger);
870   /* recompute the vblank period */
871   vblank_period = attotime_make(0, machine->screen[0].refresh / (vblank_multiplier ? vblank_multiplier : 1));
872   if (vblank_timer != NULL && timer_enable(vblank_timer, FALSE))
873   {
874      attotime remaining = timer_timeleft(vblank_timer);
875      if (remaining.seconds == 0 && remaining.attoseconds == 0)
876         remaining = vblank_period;
877      timer_adjust(vblank_timer, remaining, 0, vblank_period);
878   }
1080879
1081   /* suspend the CPU immediately if it's not already */
1082   cpunum_suspend(cpunum, SUSPEND_REASON_TRIGGER, 0);
1083
1084   /* set the trigger */
1085   cpu[cpunum].trigger = TRIGGER_TIMESLICE;
880   LOG(("cpu_compute_vblank_timing: refresh=%s vblank=%s\n", attotime_string(refresh_period, 9), attotime_string(vblank_period, 9)));
1086881}
1087882
1088883
884/*-------------------------------------------------
885    cpu_scalebyfcount - scale by time between
886    refresh timers
887-------------------------------------------------*/
1089888
1090/*************************************
1091 *
1092 *  Burn/yield CPU cycles for a
1093 *  specific period of time
1094 *
1095 *************************************/
1096
1097void cpu_spinuntil_time(attotime duration)
889int cpu_scalebyfcount(int value)
1098890{
1099   static int timetrig = 0;
891   attotime refresh_elapsed = timer_timeelapsed(refresh_timer);
892   int result;
1100893
1101   cpu_spinuntil_trigger(TRIGGER_SUSPENDTIME + timetrig);
1102   cpu_triggertime(duration, TRIGGER_SUSPENDTIME + timetrig);
1103   timetrig = (timetrig + 1) & 255;
894   /* shift off some bits to ensure no overflow */
895   if (value < 65536)
896      result = value * (refresh_elapsed.attoseconds >> 16) / (refresh_period.attoseconds >> 16);
897   else
898      result = value * (refresh_elapsed.attoseconds >> 32) / (refresh_period.attoseconds >> 32);
899   if (value >= 0)
900      return (result < value) ? result : value;
901   else
902      return (result > value) ? result : value;
1104903}
1105904
1106905
906/*-------------------------------------------------
907    cpu_getiloops - return the cheesy VBLANK
908    interrupt counter (deprecated)
909-------------------------------------------------*/
1107910
1108#if 0
1109#pragma mark -
1110#pragma mark CORE TIMING
1111#endif
911int cpu_getiloops(void)
912{
913   VERIFY_ACTIVECPU(cpu_getiloops);
914   return cpu[activecpu].iloops;
915}
1112916
1113/*************************************
1114 *
1115 *  Returns the number of times the
1116 *  interrupt handler will be called
1117 *  before the end of the current
1118 *  video frame.
1119 *
1120 *************************************/
1121917
1122/*--------------------------------------------------------------
918/*-------------------------------------------------
919    cpu_getvblank - return the cheesy VBLANK
920    state (deprecated)
921-------------------------------------------------*/
1123922
1124    This can be useful to interrupt handlers to synchronize
1125    their operation. If you call this from outside an interrupt
1126    handler, add 1 to the result, i.e. if it returns 0, it means
1127    that the interrupt handler will be called once.
923int cpu_getvblank(void)
924{
925   return vblank;
926}
1128927
1129--------------------------------------------------------------*/
1130928
1131int cpu_getiloops(void)
929/*-------------------------------------------------
930    cpu_getcurrentframe - return the current
931    frame count (deprecated)
932-------------------------------------------------*/
933
934int cpu_getcurrentframe(void)
1132935{
1133   VERIFY_ACTIVECPU(cpu_getiloops);
1134   return cpu[activecpu].iloops;
936   return current_frame;
1135937}
1136938
1137939
1138940
1139/*************************************
1140 *
1141 *  Hook for updating things on the
1142 *  real VBLANK (once per frame)
1143 *
1144 *************************************/
941/***************************************************************************
942    INTERNAL TIMING
943***************************************************************************/
1145944
945/*-------------------------------------------------
946    cpu_vblankreset - hook for updating things on
947    cheesy fake VBLANK (once per frame)
948-------------------------------------------------*/
949
1146950static void cpu_vblankreset(running_machine *machine)
1147951{
1148952   int cpunum;
r1649r1650
1154958   input_port_vblank_start();
1155959
1156960   /* check the watchdog */
1157   if (watchdog_counter > 0)
1158   {
1159      if (--watchdog_counter == 0)
1160      {
1161         logerror("reset caused by the (vblank) watchdog\n");
1162         mame_schedule_soft_reset(machine);
1163      }
1164   }
961   if (machine->drv->watchdog_vblank_count != 0 && --watchdog_counter == 0)
962      watchdog_callback(machine, NULL, 0);
1165963
1166964   /* reset the cycle counters */
1167965   for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
r1649r1650
1174972}
1175973
1176974
975/*-------------------------------------------------
976    cpu_firstvblankcallback - timer callback for
977    the first fake VBLANK
978-------------------------------------------------*/
1177979
1178/*************************************
1179 *
1180 *  First-run callback for VBLANKs
1181 *
1182 *************************************/
1183
1184980static TIMER_CALLBACK( cpu_firstvblankcallback )
1185981{
1186982   /* now that we're synced up, pulse from here on out */
r1649r1650
1191987}
1192988
1193989
990/*-------------------------------------------------
991    cpu_vblankcallback - timer callback for
992    subsequent fake VBLANKs
993-------------------------------------------------*/
1194994
1195/*************************************
1196 *
1197 *  VBLANK core handler
1198 *
1199 *************************************/
1200
1201995static TIMER_CALLBACK( cpu_vblankcallback )
1202996{
1203997   int cpunum;
r1649r1650
12561050      /* reset the counter */
12571051      vblank_countdown = vblank_multiplier;
12581052
1259#ifdef MAME_DEBUG
1053#ifdef ENABLE_DEBUGGER
12601054      /* notify the debugger */
12611055      debug_vblank_hook();
12621056#endif
r1649r1650
12641058}
12651059
12661060
1061/*-------------------------------------------------
1062    cpu_updatecallback - timer callback for
1063    the fake end of VBLANK
1064-------------------------------------------------*/
12671065
1268/*************************************
1269 *
1270 *  End-of-VBLANK callback
1271 *
1272 *************************************/
1273
12741066static TIMER_CALLBACK( cpu_updatecallback )
12751067{
12761068   /* update the screen if we didn't before */
r1649r1650
12891081}
12901082
12911083
1084/*-------------------------------------------------
1085    cpu_timedintcallback - timer callback for
1086    timed interrupts
1087-------------------------------------------------*/
12921088
1293/*************************************
1294 *
1295 *  Callback for timed interrupts
1296 *  (not tied to a VBLANK)
1297 *
1298 *************************************/
1299
13001089static TIMER_CALLBACK( cpu_timedintcallback )
13011090{
13021091   /* bail if there is no routine */
1303   if (machine->drv->cpu[param].timed_interrupt && !cpunum_is_suspended(param, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
1092   if (machine->drv->cpu[param].timed_interrupt != NULL && !cpunum_is_suspended(param, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
13041093   {
13051094      cpuintrf_push_context(param);
13061095      (*machine->drv->cpu[param].timed_interrupt)(machine, param);
r1649r1650
13091098}
13101099
13111100
1101/*-------------------------------------------------
1102    cpu_timeslicecallback - timer callback for
1103    timeslicing
1104-------------------------------------------------*/
13121105
1313/*************************************
1314 *
1315 *  Callback to force a timeslice
1316 *
1317 *************************************/
1318
13191106static TIMER_CALLBACK( cpu_timeslicecallback )
13201107{
13211108   cpu_trigger(machine, TRIGGER_TIMESLICE);
13221109}
13231110
13241111
1112/*-------------------------------------------------
1113    end_interleave_boost - timer callback to end
1114    temporary interleave boost
1115-------------------------------------------------*/
13251116
1326/*************************************
1327 *
1328 *  Callback to end a temporary
1329 *  interleave boost
1330 *
1331 *************************************/
1332
13331117static TIMER_CALLBACK( end_interleave_boost )
13341118{
13351119   timer_adjust(interleave_boost_timer, attotime_never, 0, attotime_never);
r1649r1650
13371121}
13381122
13391123
1124/*-------------------------------------------------
1125    compute_perfect_interleave - compute the
1126    "perfect" interleave interval
1127-------------------------------------------------*/
13401128
1341/*************************************
1342 *
1343 *  Compute the "perfect" interleave
1344 *  interval
1345 *
1346 *************************************/
1347
13481129static void compute_perfect_interleave(running_machine *machine)
13491130{
13501131   attoseconds_t smallest = attoseconds_per_cycle[0];
r1649r1650
13731154}
13741155
13751156
1157/*-------------------------------------------------
1158    cpu_inittimers - set up all the core timers
1159-------------------------------------------------*/
13761160
1377/*************************************
1378 *
1379 *  Setup all the core timers
1380 *
1381 *************************************/
1382
13831161static void cpu_inittimers(running_machine *machine)
13841162{
13851163   attotime first_time;
13861164   int cpunum, max, ipf;
13871165
1166   /* allocate a timer for the watchdog */
1167   watchdog_timer = timer_alloc(watchdog_callback, NULL);
1168
13881169   /* allocate a dummy timer at the minimum frequency to break things up */
13891170   ipf = machine->drv->cpu_slices_per_frame;
13901171   if (ipf <= 0)
r1649r1650
14821263   /* reset the refresh timer to get ourself back in sync */
14831264   timer_adjust(refresh_timer, attotime_never, 0, attotime_never);
14841265}
1485
src/emu/rendlay.c
r1649r1650
6161#include "output.h"
6262#include "xmlfile.h"
6363#include "png.h"
64#include "deprecat.h"
6465
6566
6667
src/emu/cpuexec.h
r1649r1650
1818#include "timer.h"
1919
2020
21/* Enum listing all the CPUs */
21/***************************************************************************
22    CONSTANTS
23***************************************************************************/
24
25/* flags for MDRV_CPU_FLAGS */
26enum
27{
28   /* set this flag to disable execution of a CPU (if one is there for documentation */
29   /* purposes only, for example */
30   CPU_DISABLE = 0x0001
31};
32
33
34/* suspension reasons for cpunum_suspend */
35enum
36{
37   SUSPEND_REASON_HALT    = 0x0001,
38   SUSPEND_REASON_RESET    = 0x0002,
39   SUSPEND_REASON_SPIN    = 0x0004,
40   SUSPEND_REASON_TRIGGER    = 0x0008,
41   SUSPEND_REASON_DISABLE    = 0x0010,
42   SUSPEND_ANY_REASON       = ~0
43};
44
45
46/* list of all possible CPUs we might be compiled with */
2247enum _cpu_type
2348{
2449   CPU_DUMMY,
r1649r1650
164189   CPU_MEDIAGX,
165190   CPU_I960,
166191   CPU_H83002,
192   CPU_H83007,
193   CPU_H83044,
167194   CPU_V810,
168195   CPU_M37702,
169196   CPU_M37710,
r1649r1650
214241typedef enum _cpu_type cpu_type;
215242
216243
217/*************************************
218 *
219 *  CPU description for drivers
220 *
221 *************************************/
222244
245/***************************************************************************
246    TYPE DEFINITIONS
247***************************************************************************/
248
249/* CPU description for drivers */
223250typedef struct _cpu_config cpu_config;
224251struct _cpu_config
225252{
226   cpu_type      type;               /* index for the CPU type */
227   int         flags;               /* flags; see #defines below */
228   int         clock;               /* in Hertz */
253   cpu_type      type;                  /* index for the CPU type */
254   int            flags;                  /* flags; see #defines below */
255   int            clock;                  /* in Hertz */
229256   construct_map_t construct_map[ADDRESS_SPACES][2]; /* 2 memory maps per address space */
230   void       (*vblank_interrupt)(running_machine *machine, int cpunum);   /* for interrupts tied to VBLANK */
231   int       vblank_interrupts_per_frame;/* usually 1 */
232   void       (*timed_interrupt)(running_machine *machine, int cpunum);   /* for interrupts not tied to VBLANK */
233   attoseconds_t timed_interrupt_period;   /* period for periodic interrupts */
234   const void *reset_param;            /* parameter for cpu_reset */
235   const char *tag;
257   void          (*vblank_interrupt)(running_machine *machine, int cpunum);   /* for interrupts tied to VBLANK */
258   int          vblank_interrupts_per_frame;/* usually 1 */
259   void          (*timed_interrupt)(running_machine *machine, int cpunum);   /* for interrupts not tied to VBLANK */
260   attoseconds_t    timed_interrupt_period;      /* period for periodic interrupts */
261   const void *   reset_param;            /* parameter for cpu_reset */
262   const char *   tag;
236263};
237264
238265
239266
240/*************************************
241 *
242 *  CPU flag constants
243 *
244 *************************************/
267/***************************************************************************
268    FUNCTION PROTOTYPES
269***************************************************************************/
245270
246enum
247{
248   /* set this flag to disable execution of a CPU (if one is there for documentation */
249   /* purposes only, for example */
250   CPU_DISABLE = 0x0001
251};
252271
272/* ----- core CPU execution ----- */
253273
254
255
256/*************************************
257 *
258 *  Core CPU execution
259 *
260 *************************************/
261
262/* Prepare CPUs for execution */
274/* prepare CPUs for execution */
263275void cpuexec_init(running_machine *machine);
264276
265/* Execute for a single timeslice */
277/* execute for a single timeslice */
266278void cpuexec_timeslice(running_machine *machine);
267279
268280
269281
270/*************************************
271 *
272 *  Optional watchdog
273 *
274 *************************************/
282/* ----- CPU scheduling----- */
275283
276/* bang on the watchdog */
277void watchdog_reset(running_machine *machine);
284/* temporarily boosts the interleave factor */
285void cpu_boost_interleave(attotime timeslice_time, attotime boost_duration);
278286
279/* watchdog enabled when TRUE */
280/* timer is set to reset state when going from disable to enable */
281void watchdog_enable(running_machine *machine, int enable);
287/* aborts the timeslice for the active CPU */
288void activecpu_abort_timeslice(void);
282289
283
284
285/*************************************
286 *
287 *  CPU scheduling
288 *
289 *************************************/
290
291/* Suspension reasons */
292enum
293{
294   SUSPEND_REASON_HALT    = 0x0001,
295   SUSPEND_REASON_RESET    = 0x0002,
296   SUSPEND_REASON_SPIN    = 0x0004,
297   SUSPEND_REASON_TRIGGER    = 0x0008,
298   SUSPEND_REASON_DISABLE    = 0x0010,
299   SUSPEND_ANY_REASON       = ~0
300};
301
302/* Suspend the given CPU for a specific reason */
290/* suspend the given CPU for a specific reason */
303291void cpunum_suspend(int cpunum, int reason, int eatcycles);
304292
305/* Suspend the given CPU for a specific reason */
293/* resume the given CPU for a specific reason */
306294void cpunum_resume(int cpunum, int reason);
307295
308/* Returns true if the given CPU is suspended for any of the given reasons */
296/* returns true if the given CPU is suspended for any of the given reasons */
309297int cpunum_is_suspended(int cpunum, int reason);
310298
311/* Aborts the timeslice for the active CPU */
312void activecpu_abort_timeslice(void);
313299
314/* Returns the current local time for a CPU */
315attotime cpunum_get_localtime(int cpunum);
316300
317/* Returns the current CPU's unscaled running clock speed */
318/* If you want to know the current effective running clock
319 * after scaling it is just the double sec_to_cycles[cpunum] */
301/* ----- CPU clock management ----- */
302
303/* returns the current CPU's unscaled running clock speed */
320304int cpunum_get_clock(int cpunum);
321305
322/* Sets the current CPU's clock speed and then adjusts for scaling */
306/* sets the current CPU's clock speed and then adjusts for scaling */
323307void cpunum_set_clock(running_machine *machine, int cpunum, int clock);
324void cpunum_set_clock_period(running_machine *machine, int cpunum, attoseconds_t clock_period);
325308
326/* Returns the current scaling factor for a CPU's clock speed */
309/* returns the current scaling factor for a CPU's clock speed */
327310double cpunum_get_clockscale(int cpunum);
328311
329/* Sets the current scaling factor for a CPU's clock speed */
312/* sets the current scaling factor for a CPU's clock speed */
330313void cpunum_set_clockscale(running_machine *machine, int cpunum, double clockscale);
331314
332/* Temporarily boosts the interleave factor */
333void cpu_boost_interleave(attotime timeslice_time, attotime boost_duration);
334315
335316
317/* ----- CPU timing ----- */
336318
337/*************************************
338 *
339 *  Timing helpers
340 *
341 *************************************/
319/* returns the current local time for a CPU */
320attotime cpunum_get_localtime(int cpunum);
342321
343/* Returns the number of cycles run so far this timeslice */
344int cycles_currently_ran(void);
322/* returns the total number of CPU cycles */
323UINT64 activecpu_gettotalcycles(void);
345324
346/* Returns the total number of CPU cycles */
347UINT32 activecpu_gettotalcycles(void);
348UINT64 activecpu_gettotalcycles64(void);
325/* returns the total number of CPU cycles for a given CPU */
326UINT64 cpunum_gettotalcycles(int cpunum);
349327
350/* Returns the total number of CPU cycles for a given CPU */
351UINT32 cpunum_gettotalcycles(int cpunum);
352UINT64 cpunum_gettotalcycles64(int cpunum);
353
354/* Safely eats cycles so we don't cross a timeslice boundary */
328/* safely eats cycles so we don't cross a timeslice boundary */
355329void activecpu_eat_cycles(int cycles);
356330
357/* Scales a given value by the ratio of fcount / fperiod */
358int cpu_scalebyfcount(int value);
359331
360332
333/* ----- synchronization helpers ----- */
361334
362/*************************************
363 *
364 *  Video timing
365 *
366 *************************************/
335/* yield our current timeslice */
336void cpu_yield(void);
367337
368/***** OBSOLETE NOTICE: these functions are no longer considered */
369/***** to be the authority on scanline timing. Please use the */
370/***** video_screen_* functions in video.c for newer drivers. */
371/***** These functions may eventually go away. */
338/* burn CPU cycles until our timeslice is up */
339void cpu_spin(void);
372340
373/* Recomputes the VBLANK timing after, e.g., a visible area change */
374void cpu_compute_vblank_timing(running_machine *machine);
341/* burn CPU cycles until a timer trigger */
342void cpu_spinuntil_trigger(int trigger);
375343
376/* Returns the number of the video frame we are currently playing */
377int cpu_getcurrentframe(void);
344/* burn specified CPU cycles until a timer trigger */
345void cpunum_spinuntil_trigger(int cpunum, int trigger);
378346
347/* burn CPU cycles until the next interrupt */
348void cpu_spinuntil_int(void);
379349
350/* burn CPU cycles for a specific period of time */
351void cpu_spinuntil_time(attotime duration);
380352
381/*************************************
382 *
383 *  Synchronization
384 *
385 *************************************/
386353
354
355/* ----- triggers ----- */
356
387357/* generate a trigger now */
388358void cpu_trigger(running_machine *machine, int trigger);
389359
r1649r1650
393363/* generate a trigger corresponding to an interrupt on the given CPU */
394364void cpu_triggerint(running_machine *machine, int cpunum);
395365
396/* burn CPU cycles until a timer trigger */
397void cpu_spinuntil_trigger(int trigger);
398366
399/* burn specified CPU cycles until a timer trigger */
400void cpunum_spinuntil_trigger(int cpunum, int trigger);
401367
402/* burn CPU cycles until the next interrupt */
403void cpu_spinuntil_int(void);
368/* ----- watchdog timers ----- */
404369
405/* burn CPU cycles until our timeslice is up */
406void cpu_spin(void);
370/* reset the watchdog */
371void watchdog_reset(running_machine *machine);
407372
408/* yield our current timeslice */
409void cpu_yield(void);
373/* enable/disable the watchdog */
374void watchdog_enable(running_machine *machine, int enable);
410375
411/* burn CPU cycles for a specific period of time */
412void cpu_spinuntil_time(attotime duration);
413376
414377
415
416/*************************************
417 *
418 *  Core timing
419 *
420 *************************************/
421
422/* Returns the number of times the interrupt handler will be called before
423   the end of the current video frame. This is can be useful to interrupt
424   handlers to synchronize their operation. If you call this from outside
425   an interrupt handler, add 1 to the result, i.e. if it returns 0, it means
426   that the interrupt handler will be called once. */
427int cpu_getiloops(void);
428
429
430378#endif   /* __CPUEXEC_H__ */
src/emu/sound/cdp1869.c
r1649r1650
1111****************************************************************************/
1212
1313#include "sndintrf.h"
14#include "streams.h"
15#include "deprecat.h"
1416#include "sound/cdp1869.h"
15#include "streams.h"
1617
1718struct CDP1869
1819{
src/emu/sound/hc55516.c
r1649r1650
44
55    Copyright Nicola Salmoria and the MAME Team
66
7    Notes:
8        * The only difference between MC3417 and MC3418 is the number
9          of bits checked for the Coincidence Output.  For the MC3417,
10          it is three bits, while for the MC3418 it is four.
11          This is not emulated.
12
137*****************************************************************************/
148
159#include "sndintrf.h"
r1649r1650
3428   sound_stream *channel;
3529   int      clock;      /* 0 = software driven, non-0 = oscillator */
3630   int      active_clock_hi;
31   UINT8   shiftreg_mask;
3732
3833   UINT8   last_clock_state;
3934   UINT8   digit;
r1649r1650
5752
5853
5954
60static void *start_common(int sndindex, int clock, const void *config, int _active_clock_hi)
55static void *start_common(int sndindex, int clock, const void *config,
56                    UINT8 _shiftreg_mask, int _active_clock_hi)
6157{
6258   struct hc55516_data *chip;
6359
r1649r1650
7167   leak = pow(exp(-1), 1.0 / (INTEGRATOR_LEAK_TC * 16000.0));
7268
7369   chip->clock = clock;
70   chip->shiftreg_mask = _shiftreg_mask;
7471   chip->active_clock_hi = _active_clock_hi;
7572   chip->last_clock_state = 0;
7673
r1649r1650
9491
9592static void *hc55516_start(int sndindex, int clock, const void *config)
9693{
97   return start_common(sndindex, clock, config, TRUE);
94   return start_common(sndindex, clock, config, 0x07, TRUE);
9895}
9996
10097
10198static void *mc3417_start(int sndindex, int clock, const void *config)
10299{
103   return start_common(sndindex, clock, config, FALSE);
100   return start_common(sndindex, clock, config, 0x07, FALSE);
104101}
105102
106103
107104static void *mc3418_start(int sndindex, int clock, const void *config)
108105{
109   return start_common(sndindex, clock, config, FALSE);
106   return start_common(sndindex, clock, config, 0x0f, FALSE);
110107}
111108
112109
r1649r1650
141138{
142139   double integrator = chip->integrator, temp;
143140
141   /* shift the bit into the shift register */
142   chip->shiftreg = (chip->shiftreg << 1) | chip->digit;
143
144144   /* move the estimator up or down a step based on the bit */
145145   if (chip->digit)
146   {
147      chip->shiftreg = ((chip->shiftreg << 1) | 1) & 7;
148146      integrator += chip->filter;
149   }
150147   else
151   {
152      chip->shiftreg = (chip->shiftreg << 1) & 7;
153148      integrator -= chip->filter;
154   }
155149
156150   /* simulate leakage */
157151   integrator *= leak;
158152
159153   /* if we got all 0's or all 1's in the last n bits, bump the step up */
160   if (chip->shiftreg == 0 || chip->shiftreg == 7)
154   if (((chip->shiftreg & chip->shiftreg_mask) == 0) ||
155      ((chip->shiftreg & chip->shiftreg_mask) == chip->shiftreg_mask))
161156   {
162157      chip->filter = FILTER_MAX - ((FILTER_MAX - chip->filter) * charge);
158
163159      if (chip->filter > FILTER_MAX)
164160         chip->filter = FILTER_MAX;
165161   }
r1649r1650
168164   else
169165   {
170166      chip->filter *= decay;
167
171168      if (chip->filter < FILTER_MIN)
172169         chip->filter = FILTER_MIN;
173170   }
r1649r1650
350347      /* --- the following bits of info are returned as NULL-terminated strings --- */
351348      case SNDINFO_STR_NAME:                     info->s = "HC-55516";               break;
352349      case SNDINFO_STR_CORE_FAMILY:               info->s = "CVSD";                  break;
353      case SNDINFO_STR_CORE_VERSION:               info->s = "2.0";                  break;
350      case SNDINFO_STR_CORE_VERSION:               info->s = "2.1";                  break;
354351      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
355352      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
356353   }
src/emu/sound/msm5205.c
r1649r1650
1414 *  separate MSM5205 emulator form adpcm.c and some fix
1515 */
1616
17#include <math.h>
18
1917#include "sndintrf.h"
2018#include "streams.h"
19#include "deprecat.h"
2120#include "msm5205.h"
2221
2322/*
src/emu/sound/rf5c400.c
r1649r1650
1717
1818#include "sndintrf.h"
1919#include "streams.h"
20#include "deprecat.h"
2021#include "rf5c400.h"
21#include <math.h>
2222
2323struct rf5c400_info
2424{
src/emu/sound/votrax.c
r1649r1650
1818
1919#include "sndintrf.h"
2020#include "streams.h"
21#include "deprecat.h"
2122#include "samples.h"
2223
2324
src/emu/sound/wave.c
r1649r1650
1010
1111#include "driver.h"
1212#include "streams.h"
13#include "deprecat.h"
1314#ifdef MESS
1415#include "messdrv.h"
1516#include "utils.h"
src/emu/sound/sid.c
r1649r1650
1212  MOS-8580 R5 combined waveforms recorded by Dennis "Deadman" Lindroos.
1313*/
1414
15#include <math.h>
16
1715#include "sndintrf.h"
1816#include "sidvoice.h"
1917#include "sidenvel.h"
2018#include "sid.h"
19#include "deprecat.h"
2120
2221static float *filterTable;
2322static float *bandPassParam;
src/emu/sound/speaker.c
r1649r1650
99
1010#include "sndintrf.h"
1111#include "streams.h"
12#include "deprecat.h"
1213#include "speaker.h"
1314
1415static const INT16 default_levels[2] = {0,32767};
src/emu/sound/c6280.c
r1649r1650
5353    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
5454*/
5555
56#include <math.h>
57
5856#include "sndintrf.h"
5957#include "streams.h"
58#include "deprecat.h"
6059#include "c6280.h"
6160
6261typedef struct {
src/emu/sound/discrete.c
r1649r1650
3737#include "sndintrf.h"
3838#include "streams.h"
3939#include "inptport.h"
40#include "deprecat.h"
4041#include "wavwrite.h"
4142#include "discrete.h"
42#include <stdarg.h>
43#include <math.h>
4443
4544
4645/*************************************
src/emu/sound/samples.c
r1649r1650
11#include "driver.h"
22#include "streams.h"
3#include "deprecat.h"
34#include "samples.h"
45
56
src/emu/sound/scsp.c
r1649r1650
2525    * January 5, 2007   (kingshriek+RB) Working, good-sounding FM, removed obsolete non-USEDSP code.
2626*/
2727
28#include <math.h>
2928#include "sndintrf.h"
3029#include "streams.h"
3130#include "cpuintrf.h"
31#include "deprecat.h"
3232#include "scsp.h"
3333#include "scspdsp.h"
3434
r1649r1650
10701070      sample=(sample*EG_TABLE[EG_Update(slot)>>(SHIFT-10)])>>SHIFT;
10711071
10721072   if(!STWINH(slot))
1073      *RBUFDST=sample;
1073    {
1074       unsigned short Enc=((TL(slot))<<0x0)|(0x7<<0xd);
1075       *RBUFDST=(sample*SCSP->LPANTABLE[Enc])>>(SHIFT+1);
1076    }
10741077
10751078   return sample;
10761079}
src/emu/sound/flt_rc.c
r1649r1650
11#include "sndintrf.h"
22#include "streams.h"
3#include "deprecat.h"
34#include "flt_rc.h"
4#include <math.h>
55
66struct filter_rc_info
77{
src/emu/sound/s14001a.c
r1649r1650
128128 *
129129 */
130130
131#include <math.h>
132131#include "sndintrf.h"
132#include "streams.h"
133#include "deprecat.h"
133134#include "s14001a.h"
134#include "streams.h"
135135
136136typedef struct
137137{
src/emu/sound/filter.c
r1649r1650
11#include "filter.h"
22#include "sndintrf.h"
3#include "deprecat.h"
34
4#include <math.h>
5
65static filter* filter_alloc(void) {
76   filter* f = malloc_or_die(sizeof(filter));
87   return f;
src/emu/sound/sid6581.c
r1649r1650
77***************************************************************************/
88
99#include "sndintrf.h"
10#include "deprecat.h"
1011#include "sid6581.h"
1112#include "sid.h"
1213
src/emu/sound/flt_vol.c
r1649r1650
11#include "sndintrf.h"
22#include "streams.h"
3#include "deprecat.h"
34#include "flt_vol.h"
45
56
src/emu/sound/sn76477.c
r1649r1650
3030#include <math.h>      /* for pow() */
3131#include "sndintrf.h"
3232#include "streams.h"
33#include "deprecat.h"
3334#include "sn76477.h"
3435
3536
r1649r1650
255256   /* others */
256257   sound_stream *channel;            /* returned by stream_create() */
257258   UINT32 index;
258   int sample_rate;                /* from Machine->sample_rate */
259   int sample_rate;                /* from machine->sample_rate */
259260
260261#if LOG_WAV
261262   wav_file *file;                  /* handle of the wave file to produce */
src/emu/sound/vlm5030.c
r1649r1650
7575*/
7676#include "sndintrf.h"
7777#include "streams.h"
78#include "deprecat.h"
7879#include "vlm5030.h"
7980
8081/* interpolator per frame   */
src/emu/sound/nes_apu.c
r1649r1650
4646
4747#include "sndintrf.h"
4848#include "streams.h"
49#include "deprecat.h"
4950#include "nes_apu.h"
5051#include "cpu/m6502/m6502.h"
5152
src/emu/ui.c
r1649r1650
1919#include "ui.h"
2020#include "uimenu.h"
2121#include "uigfx.h"
22#include "deprecat.h"
2223
2324#ifdef MESS
2425#include "mess.h"
r1649r1650
2829#endif
2930
3031#include <ctype.h>
31#include <stdarg.h>
32#include <math.h>
3332
3433
3534
r1649r1650
12541253      return ui_set_handler(ui_menu_ui_handler, 0);
12551254
12561255   /* if the on-screen display isn't up and the user has toggled it, turn it on */
1257#ifdef MAME_DEBUG
1258   if (!Machine->debug_mode)
1259#endif
1260      if (input_ui_pressed(IPT_UI_ON_SCREEN_DISPLAY))
1261         return ui_set_handler(handler_slider, 0);
1256   if (!Machine->debug_mode && input_ui_pressed(IPT_UI_ON_SCREEN_DISPLAY))
1257      return ui_set_handler(handler_slider, 0);
12621258
12631259   /* handle a reset request */
12641260   if (input_ui_pressed(IPT_UI_RESET_MACHINE))
src/emu/profiler.c
r1649r1650
1212#include "osdepend.h"
1313#include "driver.h"
1414#include "profiler.h"
15#include "deprecat.h"
1516
1617
1718/* in usrintf.c */
src/emu/sndintrf.c
r1649r1650
514514/*-------------------------------------------------
515515    sndintrf_init - discover all linked sound
516516    systems and build a matrix for sound
517    (type,index) pairs for the current Machine
517    (type,index) pairs for the current machine
518518-------------------------------------------------*/
519519
520520void sndintrf_init(running_machine *machine)
src/emu/sound.c
r1649r1650
1414#include "streams.h"
1515#include "config.h"
1616#include "profiler.h"
17#include "deprecat.h"
1718#include "sound/wavwrite.h"
1819
1920
src/emu/debugger.h
r1649r1650
1515#define __DEBUGGER_H__
1616
1717#include "mame.h"
18#include "memory.h"
1819
1920
2021/***************************************************************************
r1649r1650
2223***************************************************************************/
2324
2425/* handy macro for hard-coding debugger breaks */
25#ifdef MAME_DEBUG
26#ifdef ENABLE_DEBUGGER
2627#define DEBUGGER_BREAK         if (Machine->debug_mode) mame_debug_break();
2728#else
2829#define DEBUGGER_BREAK
r1649r1650
3031
3132
3233/* handy macro for CPU cores */
33#ifdef MAME_DEBUG
34#define CALL_MAME_DEBUG         if (Machine->debug_mode) mame_debug_hook();
34#ifdef ENABLE_DEBUGGER
35#define CALL_DEBUGGER(p)      if (Machine->debug_mode) mame_debug_hook(p);
3536#else
36#define CALL_MAME_DEBUG
37#define CALL_DEBUGGER(p)
3738#endif
3839
3940
r1649r1650
4647void mame_debug_init(running_machine *machine);
4748
4849/* call this once per instruction from CPU cores */
49void mame_debug_hook(void);
50void mame_debug_hook(offs_t curpc);
5051
5152/* call this to break into the debugger as soon as possible */
5253void mame_debug_break(void);
r1649r1650
6061    STUBS
6162***************************************************************************/
6263
63#ifndef MAME_DEBUG
64#ifndef ENABLE_DEBUGGER
6465#define mame_debug_init(m) do { } while (0)
6566#define mame_debug_hook() do { } while (0)
6667#define mame_debug_break() do { } while (0)
src/emu/input.c
r1649r1650
2222#include "mame.h"
2323#include "emuopts.h"
2424#include "profiler.h"
25#include <ctype.h>
25#include "deprecat.h"
2626
2727
2828
src/emu/driver.h
r1649r1650
162162/* force VIDEO_UPDATE to be called even for skipped frames */
163163#define VIDEO_ALWAYS_UPDATE            0x0080
164164
165/* calls VIDEO_UPDATE for every visible scanline, even for skipped frames */
166#define VIDEO_UPDATE_SCANLINE         0x0100
165167
166168
169
167170/* ----- flags for game drivers ----- */
168171
169172#define ORIENTATION_MASK              0x0007
r1649r1650
300303   driver_remove_cpu(machine, tag);                           \
301304   cpu = NULL;                                             \
302305
303#define MDRV_CPU_REPLACE(tag, _type, _clock)                        \
306#define MDRV_CPU_REPLACE(tag, _type, _clock)                     \
304307   cpu = driver_find_cpu(machine, tag);                        \
305308   cpu->type = (CPU_##_type);                                 \
306309   cpu->clock = (_clock);                                    \
r1649r1650
384387   machine->video_attributes = (flags);                        \
385388
386389#define MDRV_GFXDECODE(gfx)                                    \
387   machine->gfxdecodeinfo = (gfxdecodeinfo_##gfx);                              \
390   machine->gfxdecodeinfo = (gfxdecodeinfo_##gfx);                  \
388391
389392#define MDRV_PALETTE_LENGTH(length)                              \
390393   machine->total_colors = (length);                           \
r1649r1650
525528   MDRV_SOUND_ROUTE_EX(_output, _target, _gain, -1)               \
526529
527530
531
528532/***************************************************************************
529533    MACROS FOR BUILDING GAME DRIVERS
530534***************************************************************************/
r1649r1650
563567extern const game_driver driver_empty;
564568
565569
570
566571/***************************************************************************
567572    FUNCTION PROTOTYPES
568573***************************************************************************/
src/emu/cpuint.c
r1649r1650
1111
1212#include "driver.h"
1313
14#ifdef MAME_DEBUG
14#ifdef ENABLE_DEBUGGER
1515#include "debug/debugcpu.h"
1616#endif
1717
r1649r1650
364364   if (drv_irq_callbacks[cpunum])
365365      vector = (*drv_irq_callbacks[cpunum])(line);
366366
367#ifdef MAME_DEBUG
367#ifdef ENABLE_DEBUGGER
368368   /* notify the debugger */
369369   debug_interrupt_hook(cpunum, line);
370370#endif
src/emu/drawgfx.c
r1649r1650
1313
1414#include "driver.h"
1515#include "profiler.h"
16#include "deprecat.h"
1617
1718
1819/***************************************************************************
r1649r1650
4041UINT8 gfx_drawmode_table[256];
4142UINT8 gfx_alpharange_table[256];
4243
43static UINT8 is_raw[TRANSPARENCY_MODES];
44
4544alpha_cache drawgfx_alpha_cache;
4645
4746
r1649r1650
9594
9695void drawgfx_init(running_machine *machine)
9796{
98   /* fill in the raw drawing mode table */
99   is_raw[TRANSPARENCY_NONE_RAW]      = 1;
100   is_raw[TRANSPARENCY_PEN_RAW]       = 1;
101   is_raw[TRANSPARENCY_PENS_RAW]      = 1;
102   is_raw[TRANSPARENCY_PEN_TABLE_RAW] = 1;
103   is_raw[TRANSPARENCY_BLEND_RAW]     = 1;
104
10597   /* initialize the alpha drawing table */
10698   alpha_set_level(255);
10799}
r1649r1650
443435
444436   srcmodulo += srcwidth;
445437   dstmodulo -= srcwidth;
446   //srcdata += srcwidth-1;
447438   srcdata -= 3;
448439
449440   trans4 = transpen * 0x01010101;
r1649r1650
532523
533524   srcmodulo += srcwidth;
534525   dstmodulo -= srcwidth;
535   //srcdata += srcwidth-1;
536526
537527   while (srcheight)
538528   {
r1649r1650
589579
590580   srcmodulo += srcwidth;
591581   dstmodulo -= srcwidth;
592   //srcdata += srcwidth-1;
593582
594583   while (srcheight)
595584   {
r1649r1650
818807#undef alpha_blend
819808
820809/* 32-bit version */
821//* AAT032503: added limited 32-bit shadow and highlight support
822INLINE UINT32 SHADOW32(pen_t *shadow_table, UINT32 c) {
823   c = (c>>9&0x7c00) | (c>>6&0x03e0) | (c>>3&0x001f);
824   return(shadow_table[c]); }
810INLINE UINT32 SHADOW32(pen_t *shadow_table, UINT32 c)
811{
812   return shadow_table[((c >> 9) & 0x7c00) | ((c >> 6) & 0x03e0) | ((c >> 3) & 0x001f)];
813}
825814
826815#define DATA_TYPE UINT32
827816#define DEPTH 32
r1649r1650
937926  transparency == TRANSPARENCY_PENS - as above, but transparent_color is a mask of
938927                                     transparent pens.
939928  transparency == TRANSPARENCY_COLOR - bits whose _remapped_ palette index (taken from
940                                     Machine->game_colortable) is == transparent_color
929                                     machine->game_colortable) is == transparent_color
941930
942931  transparency == TRANSPARENCY_PEN_TABLE - the transparency condition is same as TRANSPARENCY_PEN
943932                    A special drawing is done according to gfx_drawmode_table[source pixel].
r1649r1650
955944   assert_always(gfx, "drawgfx() gfx == 0");
956945
957946   code %= gfx->total_elements;
958   if (!is_raw[transparency])
947
948   if ((transparency != TRANSPARENCY_PEN_RAW) && (transparency != TRANSPARENCY_BLEND_RAW))
959949      color %= gfx->total_colors;
960950
961951   if ((dest->format == BITMAP_FORMAT_INDEXED8 || dest->format == BITMAP_FORMAT_INDEXED16 || dest->format == BITMAP_FORMAT_INDEXED32) &&
r1649r1650
10241014
10251015/***************************************************************************
10261016
1027  Use drawgfx() to copy a bitmap onto another at the given position.
1028  This function will very likely change in the future.
1017  Use copybitmap() to copy a bitmap onto another at the given position.
10291018
10301019***************************************************************************/
1031void copybitmap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
1020static void copybitmap_common(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
10321021      const rectangle *clip,int transparency,int transparent_color)
10331022{
1034   /* translate to proper transparency here */
1035   if (transparency == TRANSPARENCY_NONE)
1036      transparency = TRANSPARENCY_NONE_RAW;
1037   else if (transparency == TRANSPARENCY_PEN)
1038      transparency = TRANSPARENCY_PEN_RAW;
1039   else if (transparency == TRANSPARENCY_COLOR)
1040   {
1041      transparent_color = Machine->pens[transparent_color];
1042      transparency = TRANSPARENCY_PEN_RAW;
1043   }
1044
1045   copybitmap_remap(dest,src,flipx,flipy,sx,sy,clip,transparency,transparent_color);
1046}
1047
1048
1049void copybitmap_remap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
1050      const rectangle *clip,int transparency,int transparent_color)
1051{
10521023   profiler_mark(PROFILER_COPYBITMAP);
10531024
10541025   if (dest->bpp == 8)
r1649r1650
10611032   profiler_mark(PROFILER_END);
10621033}
10631034
1035void copybitmap(mame_bitmap *dest, mame_bitmap *src, int flipx, int flipy,
1036            int sx, int sy, const rectangle *clip)
1037{
1038   copybitmap_common(dest,src,flipx,flipy,sx,sy,clip,TRANSPARENCY_NONE,0);
1039}
10641040
1041void copybitmap_trans(mame_bitmap *dest, mame_bitmap *src, int flipx, int flipy,
1042                 int sx, int sy, const rectangle *clip, pen_t transparent_pen)
1043{
1044   copybitmap_common(dest,src,flipx,flipy,sx,sy,clip,TRANSPARENCY_PEN,transparent_pen);
1045}
10651046
1047
1048
10661049/***************************************************************************
10671050
10681051  Copy a bitmap onto another with scroll and wraparound.
r1649r1650
10761059  scrolls as a whole in at least one direction.
10771060
10781061***************************************************************************/
1079void copyscrollbitmap(mame_bitmap *dest,mame_bitmap *src,
1062static void copyscrollbitmap_common(mame_bitmap *dest,mame_bitmap *src,
10801063      int rows,const int *rowscroll,int cols,const int *colscroll,
10811064      const rectangle *clip,int transparency,int transparent_color)
10821065{
1083   /* translate to proper transparency here */
1084   if (transparency == TRANSPARENCY_NONE)
1085      transparency = TRANSPARENCY_NONE_RAW;
1086   else if (transparency == TRANSPARENCY_PEN)
1087      transparency = TRANSPARENCY_PEN_RAW;
1088   else if (transparency == TRANSPARENCY_COLOR)
1089   {
1090      transparent_color = Machine->pens[transparent_color];
1091      transparency = TRANSPARENCY_PEN_RAW;
1092   }
1093
1094   copyscrollbitmap_remap(dest,src,rows,rowscroll,cols,colscroll,clip,transparency,transparent_color);
1095}
1096
1097void copyscrollbitmap_remap(mame_bitmap *dest,mame_bitmap *src,
1098      int rows,const int *rowscroll,int cols,const int *colscroll,
1099      const rectangle *clip,int transparency,int transparent_color)
1100{
11011066   int srcwidth,srcheight,destwidth,destheight;
11021067   rectangle orig_clip;
11031068
1104
11051069   if (clip)
11061070   {
11071071      orig_clip.min_x = clip->min_x;
r1649r1650
11201084
11211085   if (rows == 0 && cols == 0)
11221086   {
1123      copybitmap(dest,src,0,0,0,0,clip,transparency,transparent_color);
1087      copybitmap_common(dest,src,0,0,0,0,clip,transparency,transparent_color);
11241088      return;
11251089   }
11261090
1127   profiler_mark(PROFILER_COPYBITMAP);
1128
11291091   srcwidth = src->width;
11301092   srcheight = src->height;
11311093   destwidth = dest->width;
r1649r1650
11631125         myclip.max_x = (col + cons) * colwidth - 1;
11641126         if (myclip.max_x > clip->max_x) myclip.max_x = clip->max_x;
11651127
1166         copybitmap(dest,src,0,0,0,scroll,&myclip,transparency,transparent_color);
1167         copybitmap(dest,src,0,0,0,scroll - srcheight,&myclip,transparency,transparent_color);
1128         copybitmap_common(dest,src,0,0,0,scroll,&myclip,transparency,transparent_color);
1129         copybitmap_common(dest,src,0,0,0,scroll - srcheight,&myclip,transparency,transparent_color);
11681130
11691131         col += cons;
11701132      }
r1649r1650
12011163         myclip.max_y = (row + cons) * rowheight - 1;
12021164         if (myclip.max_y > clip->max_y) myclip.max_y = clip->max_y;
12031165
1204         copybitmap(dest,src,0,0,scroll,0,&myclip,transparency,transparent_color);
1205         copybitmap(dest,src,0,0,scroll - srcwidth,0,&myclip,transparency,transparent_color);
1166         copybitmap_common(dest,src,0,0,scroll,0,&myclip,transparency,transparent_color);
1167         copybitmap_common(dest,src,0,0,scroll - srcwidth,0,&myclip,transparency,transparent_color);
12061168
12071169         row += cons;
12081170      }
r1649r1650
12211183
12221184      for (sx = scrollx - srcwidth;sx < destwidth;sx += srcwidth)
12231185         for (sy = scrolly - srcheight;sy < destheight;sy += srcheight)
1224            copybitmap(dest,src,0,0,sx,sy,clip,transparency,transparent_color);
1186            copybitmap_common(dest,src,0,0,sx,sy,clip,transparency,transparent_color);
12251187   }
12261188   else if (rows == 1)
12271189   {
r1649r1650
12591221         myclip.max_x = (col + cons) * colwidth - 1 + scrollx;
12601222         if (myclip.max_x > clip->max_x) myclip.max_x = clip->max_x;
12611223
1262         copybitmap(dest,src,0,0,scrollx,scroll,&myclip,transparency,transparent_color);
1263         copybitmap(dest,src,0,0,scrollx,scroll - srcheight,&myclip,transparency,transparent_color);
1224         copybitmap_common(dest,src,0,0,scrollx,scroll,&myclip,transparency,transparent_color);
1225         copybitmap_common(dest,src,0,0,scrollx,scroll - srcheight,&myclip,transparency,transparent_color);
12641226
12651227         myclip.min_x = col * colwidth + scrollx - srcwidth;
12661228         if (myclip.min_x < clip->min_x) myclip.min_x = clip->min_x;
12671229         myclip.max_x = (col + cons) * colwidth - 1 + scrollx - srcwidth;
12681230         if (myclip.max_x > clip->max_x) myclip.max_x = clip->max_x;
12691231
1270         copybitmap(dest,src,0,0,scrollx - srcwidth,scroll,&myclip,transparency,transparent_color);
1271         copybitmap(dest,src,0,0,scrollx - srcwidth,scroll - srcheight,&myclip,transparency,transparent_color);
1232         copybitmap_common(dest,src,0,0,scrollx - srcwidth,scroll,&myclip,transparency,transparent_color);
1233         copybitmap_common(dest,src,0,0,scrollx - srcwidth,scroll - srcheight,&myclip,transparency,transparent_color);
12721234
12731235         col += cons;
12741236      }
r1649r1650
13091271         myclip.max_y = (row + cons) * rowheight - 1 + scrolly;
13101272         if (myclip.max_y > clip->max_y) myclip.max_y = clip->max_y;
13111273
1312         copybitmap(dest,src,0,0,scroll,scrolly,&myclip,transparency,transparent_color);
1313         copybitmap(dest,src,0,0,scroll - srcwidth,scrolly,&myclip,transparency,transparent_color);
1274         copybitmap_common(dest,src,0,0,scroll,scrolly,&myclip,transparency,transparent_color);
1275         copybitmap_common(dest,src,0,0,scroll - srcwidth,scrolly,&myclip,transparency,transparent_color);
13141276
13151277         myclip.min_y = row * rowheight + scrolly - srcheight;
13161278         if (myclip.min_y < clip->min_y) myclip.min_y = clip->min_y;
13171279         myclip.max_y = (row + cons) * rowheight - 1 + scrolly - srcheight;
13181280         if (myclip.max_y > clip->max_y) myclip.max_y = clip->max_y;
13191281
1320         copybitmap(dest,src,0,0,scroll,scrolly - srcheight,&myclip,transparency,transparent_color);
1321         copybitmap(dest,src,0,0,scroll - srcwidth,scrolly - srcheight,&myclip,transparency,transparent_color);
1282         copybitmap_common(dest,src,0,0,scroll,scrolly - srcheight,&myclip,transparency,transparent_color);
1283         copybitmap_common(dest,src,0,0,scroll - srcwidth,scrolly - srcheight,&myclip,transparency,transparent_color);
13221284
13231285         row += cons;
13241286      }
13251287   }
1288}
13261289
1327   profiler_mark(PROFILER_END);
1290
1291void copyscrollbitmap(mame_bitmap *dest, mame_bitmap *src,
1292                 int rows, const int *rowscroll, int cols, const int *colscroll,
1293                 const rectangle *clip)
1294{
1295   copyscrollbitmap_common(dest,src,rows,rowscroll,cols,colscroll,clip,TRANSPARENCY_NONE,0);
13281296}
13291297
1298void copyscrollbitmap_trans(mame_bitmap *dest, mame_bitmap *src,
1299                      int rows, const int *rowscroll, int cols, const int *colscroll,
1300                      const rectangle *clip, pen_t transparent_pen)
1301{
1302   copyscrollbitmap_common(dest,src,rows,rowscroll,cols,colscroll,clip,TRANSPARENCY_PEN,transparent_pen);
1303}
13301304
1305
13311306/* notes:
13321307   - startx and starty MUST be UINT32 for calculations to work correctly
13331308   - srcbitmap->width and height are assumed to be a power of 2 to speed up wraparound
r1649r1650
13911366
13921367   if (transparency != TRANSPARENCY_PEN && transparency != TRANSPARENCY_PEN_RAW
13931368         && transparency != TRANSPARENCY_PENS && transparency != TRANSPARENCY_COLOR
1394         && transparency != TRANSPARENCY_PEN_TABLE && transparency != TRANSPARENCY_PEN_TABLE_RAW
1369         && transparency != TRANSPARENCY_PEN_TABLE
13951370         && transparency != TRANSPARENCY_BLEND_RAW
13961371         && transparency != TRANSPARENCY_ALPHA && transparency != TRANSPARENCY_ALPHARANGE
13971372         && transparency != TRANSPARENCY_NONE)
r1649r1650
14191394    */
14201395
14211396
1422   /* KW 991012 -- Added code to force clip to bitmap boundary */
1423   if(clip)
1397   /* force clip to bitmap boundary */
1398   if (clip)
14241399   {
14251400      myclip.min_x = clip->min_x;
14261401      myclip.max_x = clip->max_x;
r1649r1650
14321407      if (myclip.min_y < 0) myclip.min_y = 0;
14331408      if (myclip.max_y >= dest_bmp->height) myclip.max_y = dest_bmp->height-1;
14341409
1435      clip=&myclip;
1410      clip = &myclip;
14361411   }
14371412
14381413
1439   /* ASG 980209 -- added 16-bit version */
1414   /* 8-bit destination bitmap */
14401415   if (dest_bmp->bpp == 8)
14411416   {
14421417      if( gfx )
r1649r1650
19511926                     }
19521927                  }
19531928               }
1954
1955               /* case 4b: TRANSPARENCY_PEN_TABLE_RAW */
1956               if (transparency == TRANSPARENCY_PEN_TABLE_RAW)
1957               {
1958                  pen_t *palette_shadow_table = Machine->shadow_table;
1959                  if (pri_buffer)
1960                  {
1961                     for( y=sy; y<ey; y++ )
1962                     {
1963                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1964                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1965                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1966
1967                        int x, x_index = x_index_base;
1968                        for( x=sx; x<ex; x++ )
1969                        {
1970                           int c = source[x_index>>16];
1971                           if( c != transparent_color )
1972                           {
1973                              switch(gfx_drawmode_table[c])
1974                              {
1975                              case DRAWMODE_SOURCE:
1976                                 if (((1 << (pri[x] & 0x1f)) & pri_mask) == 0)
1977                                 {
1978                                    if (pri[x] & 0x80)
1979                                       dest[x] = palette_shadow_table[color + c];
1980                                    else
1981                                       dest[x] = color + c;
1982                                 }
1983                                 pri[x] = (pri[x] & 0x7f) | 31;
1984                                 break;
1985                              case DRAWMODE_SHADOW:
1986                                 if (((1 << pri[x]) & pri_mask) == 0)
1987                                    dest[x] = palette_shadow_table[dest[x]];
1988                                 pri[x] |= al;
1989                                 break;
1990                              }
1991                           }
1992                           x_index += dx;
1993                        }
1994
1995                        y_index += dy;
1996                     }
1997                  }
1998                  else
1999                  {
2000                     for( y=sy; y<ey; y++ )
2001                     {
2002                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2003                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
2004
2005                        int x, x_index = x_index_base;
2006                        for( x=sx; x<ex; x++ )
2007                        {
2008                           int c = source[x_index>>16];
2009                           if( c != transparent_color )
2010                           {
2011                              switch(gfx_drawmode_table[c])
2012                              {
2013                              case DRAWMODE_SOURCE:
2014                                 dest[x] = color + c;
2015                                 break;
2016                              case DRAWMODE_SHADOW:
2017                                 dest[x] = palette_shadow_table[dest[x]];
2018                                 break;
2019                              }
2020                           }
2021                           x_index += dx;
2022                        }
2023
2024                        y_index += dy;
2025                     }
2026                  }
2027               }
20281929            }
20291930         }
20301931      }
20311932   }
20321933
2033   /* ASG 980209 -- new 16-bit part */
1934   /* 16-bit destination bitmap */
20341935   else if (dest_bmp->bpp == 16)
20351936   {
20361937      if( gfx )
r1649r1650
25482449                  }
25492450               }
25502451
2551               /* case 4b: TRANSPARENCY_PEN_TABLE_RAW */
2552               if (transparency == TRANSPARENCY_PEN_TABLE_RAW)
2553               {
2554                  pen_t *palette_shadow_table = Machine->shadow_table;
2555                  if (pri_buffer)
2556                  {
2557                     for( y=sy; y<ey; y++ )
2558                     {
2559                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2560                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2561                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2562
2563                        int x, x_index = x_index_base;
2564                        for( x=sx; x<ex; x++ )
2565                        {
2566                           int c = source[x_index>>16];
2567                           if( c != transparent_color )
2568                           {
2569                              switch(gfx_drawmode_table[c])
2570                              {
2571                              case DRAWMODE_SOURCE:
2572                                 ah = pri[x];
2573                                 if (((1 << (ah & 0x1f)) & pri_mask) == 0)
2574                                 {
2575                                    if (ah & 0x80)
2576                                       dest[x] = palette_shadow_table[color + c];
2577                                    else
2578                                       dest[x] = color + c;
2579                                 }
2580                                 pri[x] = (ah & 0x7f) | 31;
2581                                 break;
2582                              case DRAWMODE_SHADOW:
2583                                 if (((1 << pri[x]) & pri_mask) == 0)
2584                                    dest[x] = palette_shadow_table[dest[x]];
2585                                 pri[x] |= al;
2586                                 break;
2587                              }
2588                           }
2589                           x_index += dx;
2590                        }
2591
2592                        y_index += dy;
2593                     }
2594                  }
2595                  else
2596                  {
2597                     for( y=sy; y<ey; y++ )
2598                     {
2599                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2600                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2601
2602                        int x, x_index = x_index_base;
2603                        for( x=sx; x<ex; x++ )
2604                        {
2605                           int c = source[x_index>>16];
2606                           if( c != transparent_color )
2607                           {
2608                              switch(gfx_drawmode_table[c])
2609                              {
2610                              case DRAWMODE_SOURCE:
2611                                 dest[x] = color + c;
2612                                 break;
2613                              case DRAWMODE_SHADOW:
2614                                 dest[x] = palette_shadow_table[dest[x]];
2615                                 break;
2616                              }
2617                           }
2618                           x_index += dx;
2619                        }
2620
2621                        y_index += dy;
2622                     }
2623                  }
2624               }
2625
26262452               /* case 6: TRANSPARENCY_ALPHA */
26272453               if (transparency == TRANSPARENCY_ALPHA)
26282454               {
r1649r1650
27322558         }
27332559      }
27342560   }
2561
2562   /* 32-bit destination bitmap */
27352563   else
27362564   {
27372565      if( gfx )
r1649r1650
31572985                  }
31582986               }
31592987
3160               /* case 4b: TRANSPARENCY_PEN_TABLE_RAW */
3161               if (transparency == TRANSPARENCY_PEN_TABLE_RAW)
3162               {
3163                  pen_t *palette_shadow_table = Machine->shadow_table;
3164                  UINT8 *source, *pri;
3165                  UINT32 *dest;
3166                  int c, x, x_index;
3167
3168                  if (pri_buffer)
3169                  {
3170                     for( y=sy; y<ey; y++ )
3171                     {
3172                        source = source_base + (y_index>>16) * gfx->line_modulo;
3173                        y_index += dy;
3174                        dest = BITMAP_ADDR32(dest_bmp, y, 0);
3175                        pri = BITMAP_ADDR8(pri_buffer, y, 0);
3176                        x_index = x_index_base;
3177
3178                        for( x=sx; x<ex; x++ )
3179                        {
3180                           int ebx = x_index;
3181                           x_index += dx;
3182                           ebx >>= 16;
3183                           al = pri[x];
3184                           c = source[ebx];
3185                           ah = al;
3186                           al &= 0x1f;
3187
3188                           if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
3189
3190                           if (!(1<<al & pri_mask))
3191                           {
3192                              if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
3193                              {
3194                                 ah &= 0x7f;
3195                                 ebx = color + c;
3196                                 ah |= 0x1f;
3197                                 dest[x] = ebx;
3198                                 pri[x] = ah;
3199                              }
3200                              else if (!(ah & 0x80))
3201                              {
3202                                 ebx = SHADOW32(palette_shadow_table,dest[x]);
3203                                 pri[x] |= 0x80;
3204                                 dest[x] = ebx;
3205                              }
3206                           }
3207                        }
3208                     }
3209                  }
3210                  else
3211                  {
3212                     for( y=sy; y<ey; y++ )
3213                     {
3214                        source = source_base + (y_index>>16) * gfx->line_modulo;
3215                        y_index += dy;
3216                        dest = BITMAP_ADDR32(dest_bmp, y, 0);
3217                        x_index = x_index_base;
3218
3219                        for( x=sx; x<ex; x++ )
3220                        {
3221                           c = source[x_index>>16];
3222                           x_index += dx;
3223
3224                           if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
3225                           if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
3226                              dest[x] = color + c;
3227                           else
3228                              dest[x] = SHADOW32(palette_shadow_table,dest[x]);
3229                        }
3230                     }
3231                  }
3232               }
3233
3234
32352988               /* case 6: TRANSPARENCY_ALPHA */
32362989               if (transparency == TRANSPARENCY_ALPHA)
32372990               {
r1649r1650
34333186
34343187
34353188
3189#if (RAW == 0)
34363190DECLARE_SWAP_RAW_PRI(blockmove_8toN_opaque,(COMMON_ARGS,
34373191      COLOR_ARG),
34383192{
r1649r1650
35063260      }
35073261   }
35083262})
3263#endif
35093264
3265#if (RAW == 0)
35103266DECLARE_SWAP_RAW_PRI(blockmove_4toN_opaque,(COMMON_ARGS,
35113267      COLOR_ARG),
35123268{
r1649r1650
36023358      }
36033359   }
36043360})
3361#endif
36053362
36063363DECLARE_SWAP_RAW_PRI(blockmove_8toN_transpen,(COMMON_ARGS,
36073364      COLOR_ARG,int transpen),
r1649r1650
39063663#endif
39073664
39083665
3666#if (RAW == 0)
39093667#define PEN_IS_OPAQUE ((1<<col)&transmask) == 0
39103668
39113669DECLARE_SWAP_RAW_PRI(blockmove_8toN_transmask,(COMMON_ARGS,
r1649r1650
40133771      }
40143772   }
40153773})
3774#endif
40163775
40173776#if (RAW == 0)
40183777DECLARE_SWAP_RAW_PRI(blockmove_8toN_transcolor,(COMMON_ARGS,
r1649r1650
41403899})
41413900#endif
41423901
3902#if (RAW == 0)
41433903#if DEPTH == 32
41443904DECLARE_SWAP_RAW_PRI(blockmove_8toN_pen_table,(COMMON_ARGS,
41453905      COLOR_ARG,int transcolor),
r1649r1650
42994059   }
43004060})
43014061#endif
4062#endif
43024063
43034064#if DEPTH >= 16
4304#if (1 == 0)
4305DECLARE_SWAP_RAW_PRI(blockmove_8toN_alphaone,(COMMON_ARGS,
4306      COLOR_ARG,int transpen, int alphapen),
4307{
4308   pen_t *palette_shadow_table = Machine->shadow_table;
4309   ADJUST_8
43104065
4311   (void)palette_shadow_table;
4312
4313   if (flipx)
4314   {
4315      DATA_TYPE *end;
4316      int trans4;
4317      UINT32 *sd4;
4318      UINT32 alphacolor = LOOKUP(alphapen);
4319
4320      trans4 = transpen * 0x01010101;
4321
4322      while (dstheight)
4323      {
4324         end = dstdata - dstwidth*HMODULO;
4325         while (((FPTR)srcdata & 3) && dstdata > end)   /* longword align */
4326         {
4327            int col;
4328
4329            col = *(srcdata++);
4330            if (col != transpen)
4331            {
4332               if (col == alphapen)
4333                  SETPIXELCOLOR(0,alpha_blend(*dstdata,alphacolor))
4334               else
4335                  SETPIXELCOLOR(0,LOOKUP(col))
4336            }
4337            INCREMENT_DST(-HMODULO);
4338         }
4339         sd4 = (UINT32 *)srcdata;
4340         while (dstdata >= end + 4*HMODULO)
4341         {
4342            UINT32 col4;
4343
4344            INCREMENT_DST(-4*HMODULO);
4345            if ((col4 = *(sd4++)) != trans4)
4346            {
4347               UINT32 xod4;
4348
4349               xod4 = col4 ^ trans4;
4350               if (xod4 & (0xff<<SHIFT0))
4351               {
4352                  if (((col4>>SHIFT0) & 0xff) == alphapen)
4353                     SETPIXELCOLOR(4*HMODULO,alpha_blend(dstdata[4*HMODULO], alphacolor))
4354                  else
4355                     SETPIXELCOLOR(4*HMODULO,LOOKUP((col4>>SHIFT0) & 0xff))
4356               }
4357               if (xod4 & (0xff<<SHIFT1))
4358               {
4359                  if (((col4>>SHIFT1) & 0xff) == alphapen)
4360                     SETPIXELCOLOR(3*HMODULO,alpha_blend(dstdata[3*HMODULO], alphacolor))
4361                  else
4362                     SETPIXELCOLOR(3*HMODULO,LOOKUP((col4>>SHIFT1) & 0xff))
4363               }
4364               if (xod4 & (0xff<<SHIFT2))
4365               {
4366                  if (((col4>>SHIFT2) & 0xff) == alphapen)
4367                     SETPIXELCOLOR(2*HMODULO,alpha_blend(dstdata[2*HMODULO], alphacolor))
4368                  else
4369                     SETPIXELCOLOR(2*HMODULO,LOOKUP((col4>>SHIFT2) & 0xff))
4370               }
4371               if (xod4 & (0xff<<SHIFT3))
4372               {
4373                  if (((col4>>SHIFT3) & 0xff) == alphapen)
4374                     SETPIXELCOLOR(1*HMODULO,alpha_blend(dstdata[1*HMODULO], alphacolor))
4375                  else
4376                     SETPIXELCOLOR(1*HMODULO,LOOKUP((col4>>SHIFT3) & 0xff))
4377               }
4378            }
4379         }
4380         srcdata = (UINT8 *)sd4;
4381         while (dstdata > end)
4382         {
4383            int col;
4384
4385            col = *(srcdata++);
4386            if (col != transpen)
4387            {
4388               if (col == alphapen)
4389                  SETPIXELCOLOR(0,alpha_blend(*dstdata, alphacolor))
4390               else
4391                  SETPIXELCOLOR(0,LOOKUP(col))
4392            }
4393            INCREMENT_DST(-HMODULO);
4394         }
4395
4396         srcdata += srcmodulo;
4397         INCREMENT_DST(ydir*VMODULO + dstwidth*HMODULO);
4398         dstheight--;
4399      }
4400   }
4401   else
4402   {
4403      DATA_TYPE *end;
4404      int trans4;
4405      UINT32 *sd4;
4406      UINT32 alphacolor = LOOKUP(alphapen);
4407
4408      trans4 = transpen * 0x01010101;
4409
4410      while (dstheight)
4411      {
4412         end = dstdata + dstwidth*HMODULO;
4413         while (((FPTR)srcdata & 3) && dstdata < end)   /* longword align */
4414         {
4415            int col;
4416
4417            col = *(srcdata++);
4418            if (col != transpen)
4419            {
4420               if (col == alphapen)
4421                  SETPIXELCOLOR(0,alpha_blend(*dstdata, alphacolor))
4422               else
4423                  SETPIXELCOLOR(0,LOOKUP(col))
4424            }
4425            INCREMENT_DST(HMODULO);
4426         }
4427         sd4 = (UINT32 *)srcdata;
4428         while (dstdata <= end - 4*HMODULO)
4429         {
4430            UINT32 col4;
4431
4432            if ((col4 = *(sd4++)) != trans4)
4433            {
4434               UINT32 xod4;
4435
4436               xod4 = col4 ^ trans4;
4437               if (xod4 & (0xff<<SHIFT0))
4438               {
4439                  if (((col4>>SHIFT0) & 0xff) == alphapen)
4440                     SETPIXELCOLOR(0*HMODULO,alpha_blend(dstdata[0*HMODULO], alphacolor))
4441                  else
4442                     SETPIXELCOLOR(0*HMODULO,LOOKUP((col4>>SHIFT0) & 0xff))
4443               }
4444               if (xod4 & (0xff<<SHIFT1))
4445               {
4446                  if (((col4>>SHIFT1) & 0xff) == alphapen)
4447                     SETPIXELCOLOR(1*HMODULO,alpha_blend(dstdata[1*HMODULO], alphacolor))
4448                  else
4449                     SETPIXELCOLOR(1*HMODULO,LOOKUP((col4>>SHIFT1) & 0xff))
4450               }
4451               if (xod4 & (0xff<<SHIFT2))
4452               {
4453                  if (((col4>>SHIFT2) & 0xff) == alphapen)
4454                     SETPIXELCOLOR(2*HMODULO,alpha_blend(dstdata[2*HMODULO], alphacolor))
4455                  else
4456                     SETPIXELCOLOR(2*HMODULO,LOOKUP((col4>>SHIFT2) & 0xff))
4457               }
4458               if (xod4 & (0xff<<SHIFT3))
4459               {
4460                  if (((col4>>SHIFT3) & 0xff) == alphapen)
4461                     SETPIXELCOLOR(3*HMODULO,alpha_blend(dstdata[3*HMODULO], alphacolor))
4462                  else
4463                     SETPIXELCOLOR(3*HMODULO,LOOKUP((col4>>SHIFT3) & 0xff))
4464               }
4465            }
4466            INCREMENT_DST(4*HMODULO);
4467         }
4468         srcdata = (UINT8 *)sd4;
4469         while (dstdata < end)
4470         {
4471            int col;
4472
4473            col = *(srcdata++);
4474            if (col != transpen)
4475            {
4476               if (col == alphapen)
4477                  SETPIXELCOLOR(0,alpha_blend(*dstdata, alphacolor))
4478               else
4479                  SETPIXELCOLOR(0,LOOKUP(col))
4480            }
4481            INCREMENT_DST(HMODULO);
4482         }
4483
4484         srcdata += srcmodulo;
4485         INCREMENT_DST(ydir*VMODULO - dstwidth*HMODULO);
4486         dstheight--;
4487      }
4488   }
4489})
4490#endif
4491
44924066#if (RAW == 0)
44934067DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpha,(COMMON_ARGS,
44944068      COLOR_ARG,int transpen),
r1649r1650
46704244
46714245#else
46724246
4673#if (1 == 0)
4674DECLARE_SWAP_RAW_PRI(blockmove_8toN_alphaone,(COMMON_ARGS,
4675      COLOR_ARG,int transpen, int alphapen),{})
4676#endif
4677
46784247#if (RAW == 0)
46794248DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpha,(COMMON_ARGS,
46804249      COLOR_ARG,int transpen),{})
r1649r1650
47064275
47074276   srcmodulo += srcwidth;
47084277   dstmodulo -= srcwidth;
4709   //srcdata += srcwidth-1;
47104278
47114279   while (srcheight)
47124280   {
r1649r1650
47334301   }
47344302})
47354303
4736DECLARE(blockmove_NtoN_opaque_remap,(
4737      const DATA_TYPE *srcdata,int srcwidth,int srcheight,int srcmodulo,
4738      DATA_TYPE *dstdata,int dstmodulo,
4739      const pen_t *paldata),
4740{
4741   DATA_TYPE *end;
47424304
4743   srcmodulo -= srcwidth;
4744   dstmodulo -= srcwidth;
4745
4746   while (srcheight)
4747   {
4748      end = dstdata + srcwidth;
4749      while (dstdata <= end - 8)
4750      {
4751         dstdata[0] = paldata[srcdata[0]];
4752         dstdata[1] = paldata[srcdata[1]];
4753         dstdata[2] = paldata[srcdata[2]];
4754         dstdata[3] = paldata[srcdata[3]];
4755         dstdata[4] = paldata[srcdata[4]];
4756         dstdata[5] = paldata[srcdata[5]];
4757         dstdata[6] = paldata[srcdata[6]];
4758         dstdata[7] = paldata[srcdata[7]];
4759         dstdata += 8;
4760         srcdata += 8;
4761      }
4762      while (dstdata < end)
4763         *(dstdata++) = paldata[*(srcdata++)];
4764
4765      srcdata += srcmodulo;
4766      dstdata += dstmodulo;
4767      srcheight--;
4768   }
4769})
4770
4771DECLARE(blockmove_NtoN_opaque_remap_flipx,(
4772      const DATA_TYPE *srcdata,int srcwidth,int srcheight,int srcmodulo,
4773      DATA_TYPE *dstdata,int dstmodulo,
4774      const pen_t *paldata),
4775{
4776   DATA_TYPE *end;
4777
4778   srcmodulo += srcwidth;
4779   dstmodulo -= srcwidth;
4780   //srcdata += srcwidth-1;
4781
4782   while (srcheight)
4783   {
4784      end = dstdata + srcwidth;
4785      while (dstdata <= end - 8)
4786      {
4787         srcdata -= 8;
4788         dstdata[0] = paldata[srcdata[8]];
4789         dstdata[1] = paldata[srcdata[7]];
4790         dstdata[2] = paldata[srcdata[6]];
4791         dstdata[3] = paldata[srcdata[5]];
4792         dstdata[4] = paldata[srcdata[4]];
4793         dstdata[5] = paldata[srcdata[3]];
4794         dstdata[6] = paldata[srcdata[2]];
4795         dstdata[7] = paldata[srcdata[1]];
4796         dstdata += 8;
4797      }
4798      while (dstdata < end)
4799         *(dstdata++) = paldata[*(srcdata--)];
4800
4801      srcdata += srcmodulo;
4802      dstdata += dstmodulo;
4803      srcheight--;
4804   }
4805})
4806
4807
4808DECLARE(blockmove_NtoN_blend_noremap,(
4809      const DATA_TYPE *srcdata,int srcwidth,int srcheight,int srcmodulo,
4810      DATA_TYPE *dstdata,int dstmodulo,
4811      int srcshift),
4812{
4813   DATA_TYPE *end;
4814
4815   srcmodulo -= srcwidth;
4816   dstmodulo -= srcwidth;
4817
4818   while (srcheight)
4819   {
4820      end = dstdata + srcwidth;
4821      while (dstdata <= end - 8)
4822      {
4823         dstdata[0] |= srcdata[0] << srcshift;
4824         dstdata[1] |= srcdata[1] << srcshift;
4825         dstdata[2] |= srcdata[2] << srcshift;
4826         dstdata[3] |= srcdata[3] << srcshift;
4827         dstdata[4] |= srcdata[4] << srcshift;
4828         dstdata[5] |= srcdata[5] << srcshift;
4829         dstdata[6] |= srcdata[6] << srcshift;
4830         dstdata[7] |= srcdata[7] << srcshift;
4831         dstdata += 8;
4832         srcdata += 8;
4833      }
4834      while (dstdata < end)
4835         *(dstdata++) |= *(srcdata++) << srcshift;
4836
4837      srcdata += srcmodulo;
4838      dstdata += dstmodulo;
4839      srcheight--;
4840   }
4841})
4842
4843DECLARE(blockmove_NtoN_blend_noremap_flipx,(
4844      const DATA_TYPE *srcdata,int srcwidth,int srcheight,int srcmodulo,
4845      DATA_TYPE *dstdata,int dstmodulo,
4846      int srcshift),
4847{
4848   DATA_TYPE *end;
4849
4850   srcmodulo += srcwidth;
4851   dstmodulo -= srcwidth;
4852   //srcdata += srcwidth-1;
4853
4854   while (srcheight)
4855   {
4856      end = dstdata + srcwidth;
4857      while (dstdata <= end - 8)
4858      {
4859         srcdata -= 8;
4860         dstdata[0] |= srcdata[8] << srcshift;
4861         dstdata[1] |= srcdata[7] << srcshift;
4862         dstdata[2] |= srcdata[6] << srcshift;
4863         dstdata[3] |= srcdata[5] << srcshift;
4864         dstdata[4] |= srcdata[4] << srcshift;
4865         dstdata[5] |= srcdata[3] << srcshift;
4866         dstdata[6] |= srcdata[2] << srcshift;
4867         dstdata[7] |= srcdata[1] << srcshift;
4868         dstdata += 8;
4869      }
4870      while (dstdata < end)
4871         *(dstdata++) |= *(srcdata--) << srcshift;
4872
4873      srcdata += srcmodulo;
4874      dstdata += dstmodulo;
4875      srcheight--;
4876   }
4877})
4878
4879DECLARE(blockmove_NtoN_blend_remap,(
4880      const DATA_TYPE *srcdata,int srcwidth,int srcheight,int srcmodulo,
4881      DATA_TYPE *dstdata,int dstmodulo,
4882      const pen_t *paldata,int srcshift),
4883{
4884   DATA_TYPE *end;
4885
4886   srcmodulo -= srcwidth;
4887   dstmodulo -= srcwidth;
4888
4889   while (srcheight)
4890   {
4891      end = dstdata + srcwidth;
4892      while (dstdata <= end - 8)
4893      {
4894         dstdata[0] = paldata[dstdata[0] | (srcdata[0] << srcshift)];
4895         dstdata[1] = paldata[dstdata[1] | (srcdata[1] << srcshift)];
4896         dstdata[2] = paldata[dstdata[2] | (srcdata[2] << srcshift)];
4897         dstdata[3] = paldata[dstdata[3] | (srcdata[3] << srcshift)];
4898         dstdata[4] = paldata[dstdata[4] | (srcdata[4] << srcshift)];
4899         dstdata[5] = paldata[dstdata[5] | (srcdata[5] << srcshift)];
4900         dstdata[6] = paldata[dstdata[6] | (srcdata[6] << srcshift)];
4901         dstdata[7] = paldata[dstdata[7] | (srcdata[7] << srcshift)];
4902         dstdata += 8;
4903         srcdata += 8;
4904      }
4905      while (dstdata < end)
4906      {
4907         *dstdata = paldata[*dstdata | (*(srcdata++) << srcshift)];
4908         dstdata++;
4909      }
4910
4911      srcdata += srcmodulo;
4912      dstdata += dstmodulo;
4913      srcheight--;
4914   }
4915
4916})
4917
4918DECLARE(blockmove_NtoN_blend_remap_flipx,(
4919      const DATA_TYPE *srcdata,int srcwidth,int srcheight,int srcmodulo,
4920      DATA_TYPE *dstdata,int dstmodulo,
4921      const pen_t *paldata,int srcshift),
4922{
4923   DATA_TYPE *end;
4924
4925   srcmodulo += srcwidth;
4926   dstmodulo -= srcwidth;
4927   //srcdata += srcwidth-1;
4928
4929   while (srcheight)
4930   {
4931      end = dstdata + srcwidth;
4932      while (dstdata <= end - 8)
4933      {
4934         srcdata -= 8;
4935         dstdata[0] = paldata[dstdata[0] | (srcdata[8] << srcshift)];
4936         dstdata[1] = paldata[dstdata[1] | (srcdata[7] << srcshift)];
4937         dstdata[2] = paldata[dstdata[2] | (srcdata[6] << srcshift)];
4938         dstdata[3] = paldata[dstdata[3] | (srcdata[5] << srcshift)];
4939         dstdata[4] = paldata[dstdata[4] | (srcdata[4] << srcshift)];
4940         dstdata[5] = paldata[dstdata[5] | (srcdata[3] << srcshift)];
4941         dstdata[6] = paldata[dstdata[6] | (srcdata[2] << srcshift)];
4942         dstdata[7] = paldata[dstdata[7] | (srcdata[1] << srcshift)];
4943         dstdata += 8;
4944      }
4945      while (dstdata < end)
4946      {
4947         *dstdata = paldata[*dstdata | (*(srcdata--) << srcshift)];
4948         dstdata++;
4949      }
4950
4951      srcdata += srcmodulo;
4952      dstdata += dstmodulo;
4953      srcheight--;
4954   }
4955})
4956
4957
4958
4959
4960
49614305DECLARE(drawgfx_core,(
49624306      mame_bitmap *dest,const gfx_element *gfx,
49634307      unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
r1649r1650
50024346      const pen_t *paldata = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * color];
50034347      UINT8 *pribuf = (pri_buffer) ? BITMAP_ADDR8(pri_buffer, sy, sx) : NULL;
50044348
5005      /* optimizations for 1:1 mapping */
5006      if (Machine->drv->color_table_len == 0 &&
5007         dest->format == BITMAP_FORMAT_INDEXED16 &&
5008         paldata >= Machine->remapped_colortable &&
5009         paldata < Machine->remapped_colortable + Machine->drv->total_colors)
5010      {
5011         switch (transparency)
5012         {
5013            case TRANSPARENCY_NONE:
5014               transparency = TRANSPARENCY_NONE_RAW;
5015               color = paldata - Machine->remapped_colortable;
5016               break;
5017            case TRANSPARENCY_PEN:
5018               transparency = TRANSPARENCY_PEN_RAW;
5019               color = paldata - Machine->remapped_colortable;
5020               break;
5021            case TRANSPARENCY_PENS:
5022               transparency = TRANSPARENCY_PENS_RAW;
5023               color = paldata - Machine->remapped_colortable;
5024               break;
5025            case TRANSPARENCY_PEN_TABLE:
5026               transparency = TRANSPARENCY_PEN_TABLE_RAW;
5027               color = paldata - Machine->remapped_colortable;
5028               break;
5029         }
5030      }
5031
50324349      switch (transparency)
50334350      {
50344351         case TRANSPARENCY_NONE:
r1649r1650
50484365            }
50494366            break;
50504367
5051         case TRANSPARENCY_NONE_RAW:
5052            if (gfx->flags & GFX_ELEMENT_PACKED)
5053            {
5054               if (pribuf)
5055                  BLOCKMOVERAWPRI(4toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,pribuf,pri_mask));
5056               else
5057                  BLOCKMOVERAW(4toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color));
5058            }
5059            else
5060            {
5061               if (pribuf)
5062                  BLOCKMOVERAWPRI(8toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,pribuf,pri_mask));
5063               else
5064                  BLOCKMOVERAW(8toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color));
5065            }
5066            break;
5067
50684368         case TRANSPARENCY_PEN:
50694369            if (gfx->flags & GFX_ELEMENT_PACKED)
50704370            {
r1649r1650
51064406               BLOCKMOVELU(8toN_transmask,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
51074407            break;
51084408
5109         case TRANSPARENCY_PENS_RAW:
5110            if (pribuf)
5111               BLOCKMOVERAWPRI(8toN_transmask,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,pribuf,pri_mask,transparent_color));
5112            else
5113               BLOCKMOVERAW(8toN_transmask,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,transparent_color));
5114            break;
5115
51164409         case TRANSPARENCY_COLOR:
51174410            if (gfx->flags & GFX_ELEMENT_PACKED)
51184411            {
r1649r1650
51374430               BLOCKMOVELU(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
51384431            break;
51394432
5140         case TRANSPARENCY_PEN_TABLE_RAW:
5141            if (pribuf)
5142               BLOCKMOVERAWPRI(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,pribuf,pri_mask,transparent_color));
5143            else
5144               BLOCKMOVERAW(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,transparent_color));
5145            break;
5146
51474433         case TRANSPARENCY_BLEND_RAW:
51484434            if (pribuf)
51494435               BLOCKMOVERAWPRI(8toN_transblend,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,pribuf,pri_mask,transparent_color));
r1649r1650
52134499      int dm = dest->rowpixels;                                    /* dest modulo */
52144500
52154501      if (flipx)
5216      {
5217         //if ((sx-ox) == 0) sd += gfx->width - sw;
52184502         sd += src->width -1 -(sx-ox);
5219      }
52204503      else
52214504         sd += (sx-ox);
52224505
52234506      if (flipy)
52244507      {
5225         //if ((sy-oy) == 0) sd += sm * (gfx->height - sh);
5226         //dd += dm * (sh - 1);
5227         //dm = -dm;
52284508         sd += sm * (src->height -1 -(sy-oy));
52294509         sm = -sm;
52304510      }
r1649r1650
52344514      switch (transparency)
52354515      {
52364516         case TRANSPARENCY_NONE:
5237            BLOCKMOVE(NtoN_opaque_remap,flipx,(sd,sw,sh,sm,dd,dm,Machine->pens));
5238            break;
5239
5240         case TRANSPARENCY_NONE_RAW:
52414517            BLOCKMOVE(NtoN_opaque_noremap,flipx,(sd,sw,sh,sm,dd,dm));
52424518            break;
52434519
5244         case TRANSPARENCY_PEN_RAW:
4520         case TRANSPARENCY_PEN:
52454521            BLOCKMOVE(NtoN_transpen_noremap,flipx,(sd,sw,sh,sm,dd,dm,transparent_color));
52464522            break;
52474523
5248         case TRANSPARENCY_BLEND:
5249            BLOCKMOVE(NtoN_blend_remap,flipx,(sd,sw,sh,sm,dd,dm,Machine->pens,transparent_color));
5250            break;
5251
5252         case TRANSPARENCY_BLEND_RAW:
5253            BLOCKMOVE(NtoN_blend_noremap,flipx,(sd,sw,sh,sm,dd,dm,transparent_color));
5254            break;
5255
52564524         default:
52574525            popmessage("copybitmap pen mode not supported");
52584526            break;
src/emu/drawgfx.h
r1649r1650
5151enum
5252{
5353   TRANSPARENCY_NONE,         /* opaque with remapping */
54   TRANSPARENCY_NONE_RAW,      /* opaque with no remapping */
5554   TRANSPARENCY_PEN,         /* single pen transparency with remapping */
5655   TRANSPARENCY_PEN_RAW,      /* single pen transparency with no remapping */
5756   TRANSPARENCY_PENS,         /* multiple pen transparency with remapping */
58   TRANSPARENCY_PENS_RAW,      /* multiple pen transparency with no remapping */
5957   TRANSPARENCY_COLOR,         /* single remapped pen transparency with remapping */
6058   TRANSPARENCY_PEN_TABLE,      /* special pen remapping modes (see DRAWMODE_xxx below) with remapping */
61   TRANSPARENCY_PEN_TABLE_RAW,   /* special pen remapping modes (see DRAWMODE_xxx below) with no remapping */
62   TRANSPARENCY_BLEND,         /* blend two bitmaps, shifting the source and ORing to the dest with remapping */
6359   TRANSPARENCY_BLEND_RAW,      /* blend two bitmaps, shifting the source and ORing to the dest with no remapping */
6460   TRANSPARENCY_ALPHA,         /* single pen transparency, other pens alpha */
6561   TRANSPARENCY_ALPHARANGE,   /* single pen transparency, multiple pens alpha depending on array, see psikyosh.c */
r1649r1650
240236void extract_scanline32(mame_bitmap *bitmap,int x,int y,int length,UINT32 *dst);
241237
242238
243void copybitmap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
244      const rectangle *clip,int transparency,int transparent_color);
245void copybitmap_remap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
246      const rectangle *clip,int transparency,int transparent_color);
239void copybitmap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,
240            int sx,int sy,const rectangle *clip);
241
242void copybitmap_trans(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,
243                 int sx,int sy,const rectangle *clip,pen_t transparent_pen);
244
247245void copyscrollbitmap(mame_bitmap *dest,mame_bitmap *src,
248      int rows,const int *rowscroll,int cols,const int *colscroll,
249      const rectangle *clip,int transparency,int transparent_color);
250void copyscrollbitmap_remap(mame_bitmap *dest,mame_bitmap *src,
251      int rows,const int *rowscroll,int cols,const int *colscroll,
252      const rectangle *clip,int transparency,int transparent_color);
246                 int rows,const int *rowscroll,int cols,const int *colscroll,
247                 const rectangle *clip);
253248
249void copyscrollbitmap_trans(mame_bitmap *dest,mame_bitmap *src,
250                      int rows,const int *rowscroll,int cols,const int *colscroll,
251                      const rectangle *clip,pen_t transparent_pen);
252
253
254254/*
255255  Copy a bitmap applying rotation, zooming, and arbitrary distortion.
256256  This function works in a way that mimics some real hardware like the Konami
src/emu/render.c
r1649r1650
4444#include "config.h"
4545#include "output.h"
4646#include "xmlfile.h"
47#include <math.h>
47#include "deprecat.h"
4848
4949
5050
src/emu/state.c
r1649r1650
2222
2323#include "driver.h"
2424#include "astring.h"
25#include "deprecat.h"
2526#include <zlib.h>
2627
2728
src/emu/timer.c
r1649r1650
1313#include "driver.h"
1414#include "profiler.h"
1515#include "pool.h"
16#include <math.h>
16#include "deprecat.h"
1717
1818
1919/***************************************************************************
src/emu/emupal.c
r1649r1650
1010******************************************************************************/
1111
1212#include "driver.h"
13#include <math.h>
13#include "deprecat.h"
1414
1515#define VERBOSE 0
1616
src/emu/drivers/xtal.h
r1649r1650
6767   XTAL_12_096MHz       = 12096000,      /* Some early 80's Atari games */
6868   XTAL_12_288MHz     = 12288000,      /* Sega Model 3 digital audio board */
6969   XTAL_12_5MHz         = 12500000,      /* Red Alert audio board */
70   XTAL_12_9792MHz      = 12979200,      /* Exidy 440 */
7071   XTAL_13_3MHz        = 13300000,      /* BMC bowling */
7172   XTAL_13_33056MHz    = 13330560,      /* Taito L */
7273   XTAL_13_4MHz      = 13400000,      /* TNK3, Ikari Warriors h/w */
r1649r1650
8283   XTAL_18_432MHz     = 18432000,
8384   XTAL_19_968MHz     = 19968000,      /* Used mostly by Space Invaders games by Taito/Midway and clones */
8485   XTAL_20MHz         = 20000000,
86   XTAL_21MHz        = 21000000,      /* Lock-On pixel clock */
8587   XTAL_21_3MHz        = 21300000,
8688   XTAL_21_4772MHz    = 21477200,      /* BMC bowling, some Data East 90's games */
8789   XTAL_22MHz         = 22000000,
r1649r1650
122124   XTAL_64MHz         = 64000000,      /* BattleToads */
123125   XTAL_66_6667MHz      = 66666700,      /* later Midway games */
124126   XTAL_67_7376MHz     = 67737600,      /* PSX-based h/w, Sony ZN1-2-based */
127   XTAL_73_728MHz     = 73728000,      /* Ms. Pac-Man/Galaga 20th Anniversary */
125128   XTAL_100MHz        = 100000000,   /* PSX-based Namco System 12, Vegas, Sony ZN1-2-based */
126129   XTAL_101_4912MHz     = 101491200,   /* PSX-based Namco System 10 */
127130
src/emu/romload.c
r1649r1650
1616#include "harddisk.h"
1717#include "config.h"
1818#include "ui.h"
19#include <stdarg.h>
20#include <ctype.h>
19#include "deprecat.h"
2120
2221
2322//#define LOG_LOAD
src/lib/util/chd.c
r1649r1650
11/***************************************************************************
22
3    chd.c
4
35    MAME Compressed Hunks of Data file format
46
57    Copyright Nicola Salmoria and the MAME Team.
src/lib/util/palette.h
r1649r1650
11/******************************************************************************
22
3    palette.c
3    palette.h
44
55    Core palette routines.
66
src/lib/util/chd.h
r1649r1650
11/***************************************************************************
22
3    chd.h
4
35    MAME Compressed Hunks of Data file format
46
57    Copyright Nicola Salmoria and the MAME Team.
src/lib/util/cdrom.c
r1649r1650
11/***************************************************************************
22
3    cdrom.c
4
35    Generic MAME CD-ROM utilties - build IDE and SCSI CD-ROMs on top of this
46
57    Copyright Nicola Salmoria and the MAME Team.
src/lib/util/harddisk.c
r1649r1650
11/***************************************************************************
22
3    hardisk.c
4
35    Generic MAME hard disk implementation, with differencing files
46
57    Copyright Nicola Salmoria and the MAME Team.
src/lib/util/sha1.c
r1649r1650
2424 */
2525
2626#include "sha1.h"
27//#include "macros.h"
2827
2928#include <assert.h>
3029#include <stdlib.h>
src/mess/devices/cassette.c
r1649r1650
99#include "cassette.h"
1010#include "formats/cassimg.h"
1111#include "ui.h"
12#include "deprecat.h"
1213
1314
1415#define CASSETTE_TAG      "cassette"
src/mess/devices/cartslot.c
r1649r1650
11#include <ctype.h>
22#include "driver.h"
33#include "cartslot.h"
4#include "deprecat.h"
45
56
67static int is_cart_roment(const rom_entry *roment)
src/mess/devices/appldriv.c
r1649r1650
99#include "appldriv.h"
1010#include "flopdrv.h"
1111#include "mflopimg.h"
12#include "deprecat.h"
1213#include "formats/ap2_dsk.h"
1314
1415
src/mess/devices/cococart.c
r1649r1650
88
99#include "driver.h"
1010#include "cococart.h"
11#include "deprecat.h"
1112
1213
1314struct _coco_cartridge
src/mess/configms.c
r1649r1650
55****************************************************************************/
66
77#include "mame.h"
8#include "deprecat.h"
89#include "configms.h"
910#include "config.h"
1011#include "xmlfile.h"
src/mess/uimess.c
r1649r1650
77*********************************************************************/
88
99#include "mame.h"
10#include "deprecat.h"
1011#include "mslegacy.h"
1112#include "uimenu.h"
1213#include "uimess.h"
src/mess/tools/messtest/testmess.c
r1649r1650
1818#include "video/generic.h"
1919#include "render.h"
2020#include "messopts.h"
21#include "deprecat.h"
2122
2223#ifdef MAME_DEBUG
2324#include "debug/debugcpu.h"
src/mess/audio/wswan.c
r1649r1650
1111#include "driver.h"
1212#include "includes/wswan.h"
1313#include "streams.h"
14#include "deprecat.h"
1415
1516static sound_stream *channel;
1617
src/mess/audio/mac.c
r1649r1650
99#include "driver.h"
1010#include "includes/mac.h"
1111#include "streams.h"
12#include "deprecat.h"
1213
1314
1415static sound_stream *mac_stream;
src/mess/audio/pc.c
r1649r1650
1515#include "machine/pcshare.h"
1616#include "machine/pit8253.h"
1717#include "audio/pc.h"
18#include "deprecat.h"
1819
1920#define SND_LOG(n,m,a)
2021#define BASECLOCK   1193180
src/mess/audio/vic6560.c
r1649r1650
99
1010#include "driver.h"
1111#include "streams.h"
12#include "deprecat.h"
1213
1314#define VERBOSE_DBG 0
1415#include "includes/cbm.h"
src/mess/audio/kaypro.c
r1649r1650
99#include "includes/kaypro.h"
1010#include "sound/custom.h"
1111#include "streams.h"
12#include "deprecat.h"
1213
1314#ifdef UNUSED_FUNCTION
1415static   sound_stream  *channel;
src/mess/audio/mea8000.c
r1649r1650
3737#include "driver.h"
3838#include "mea8000.h"
3939#include "sound/dac.h"
40#include "deprecat.h"
4041
4142
4243#define VERBOSE 0
src/mess/audio/vc4000.c
r1649r1650
77
88#include "driver.h"
99#include "streams.h"
10#include "deprecat.h"
1011#include "includes/vc4000.h"
1112
1213
src/mess/audio/channelf.c
r1649r1650
22
33#include "driver.h"
44#include "streams.h"
5#include "deprecat.h"
56#include "includes/channelf.h"
67
78static sound_stream *channel;
src/mess/audio/dave.c
r1649r1650
1313*/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "audio/dave.h"
1718
1819#define STEP 0x08000
src/mess/audio/odyssey2.c
r1649r1650
88***************************************************************************************/
99#include "driver.h"
1010#include "includes/odyssey2.h"
11#include "deprecat.h"
1112
1213sound_stream *odyssey2_sh_channel;
1314
src/mess/audio/arcadia.c
r1649r1650
77
88#include "driver.h"
99#include "streams.h"
10#include "deprecat.h"
1011#include "includes/arcadia.h"
1112
1213
src/mess/audio/gb.c
r1649r1650
4242#include "driver.h"
4343#include "includes/gb.h"
4444#include "streams.h"
45#include "deprecat.h"
4546
4647#define NR10 0x00
4748#define NR11 0x01
src/mess/audio/lynx.c
r1649r1650
44
55#include "driver.h"
66#include "streams.h"
7#include "deprecat.h"
78#include "includes/lynx.h"
89
910
src/mess/audio/svision.c
r1649r1650
66
77#include "driver.h"
88#include "streams.h"
9#include "deprecat.h"
910#include "includes/svision.h"
1011
1112
src/mess/audio/ted7360.c
r1649r1650
99
1010#include "driver.h"
1111#include "streams.h"
12#include "deprecat.h"
1213
1314#define VERBOSE_DBG 1
1415#include "includes/cbm.h"
src/mess/audio/dai.c
r1649r1650
1313#include "machine/pit8253.h"
1414#include "includes/dai.h"
1515#include "streams.h"
16#include "deprecat.h"
1617
1718static void *dai_sh_start(int clock, const struct CustomSound_interface *config);
1819static void dai_sh_update(void *param,stream_sample_t **inputs, stream_sample_t **_buffer,int length);
src/mess/image.c
r1649r1650
1414
1515#include "image.h"
1616#include "mess.h"
17#include "deprecat.h"
1718#include "unzip.h"
1819#include "devices/flopdrv.h"
1920#include "utils.h"
src/mess/includes/dgn_beta.h
r1649r1650
100100/*----------- defined in video/dgn_beta.c -----------*/
101101
102102/* mc6845 video display generator */
103void init_video(void);
103void init_video(running_machine *machine);
104104extern VIDEO_UPDATE( dgnbeta );
105105void vid_set_gctrl(int data);
106106
src/mess/includes/sms.h
r1649r1650
77#ifndef SMS_H_
88#define SMS_H_
99
10#include "deprecat.h"
1011
1112#define LOG_REG
1213#define LOG_PAGING
src/mess/video/wswan.c
r1649r1650
99
1010***************************************************************************/
1111#include "driver.h"
12#include "deprecat.h"
1213#include "includes/wswan.h"
1314
1415static int pal[16][16];
src/mess/video/zx.c
r1649r1650
1717****************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021#include "cpu/z80/z80.h"
2122#include "includes/zx.h"
2223#include "sound/dac.h"
src/mess/video/vic6560.c
r1649r1650
88#include <math.h>
99#include <stdio.h>
1010#include "driver.h"
11#include "deprecat.h"
1112#include "utils.h"
1213#include "sound/custom.h"
1314
r1649r1650
502503
503504VIDEO_UPDATE( vic6560 )
504505{
505   copybitmap(bitmap, vic6560_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
506   copybitmap(bitmap, vic6560_bitmap, 0, 0, 0, 0, cliprect);
506507   return 0;
507508}
src/mess/video/dgn_beta.c
r1649r1650
321321}
322322
323323/* Video init */
324void init_video(void)
324void init_video(running_machine *machine)
325325{
326326   /* initialise 6845 */
327327   m6845_config(&beta_m6845_interface);
r1649r1650
340340
341341#ifdef MAME_DEBUG
342342   /* setup debug commands */
343   if (Machine->debug_mode)
343   if (machine->debug_mode)
344344   {
345345      debug_console_register_command("beta_vid_log", CMDFLAG_NONE, 0, 0, 0,ToggleRegLog);
346346      debug_console_register_command("beta_vid_fill", CMDFLAG_NONE, 0, 0, 0,FillScreen);
src/mess/video/pdp1.c
r1649r1650
1818#include <math.h>
1919
2020#include "driver.h"
21#include "deprecat.h"
2122
2223#include "cpu/pdp1/pdp1.h"
2324#include "includes/pdp1.h"
r1649r1650
9293   pdp1_draw_lightpen(bitmap);
9394
9495   pdp1_draw_panel(panel_bitmap);
95   copybitmap(bitmap, panel_bitmap, 0, 0, panel_window_offset_x, panel_window_offset_y, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
96   copybitmap(bitmap, panel_bitmap, 0, 0, panel_window_offset_x, panel_window_offset_y, cliprect);
9697
97   copybitmap(bitmap, typewriter_bitmap, 0, 0, typewriter_window_offset_x, typewriter_window_offset_y, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
98   copybitmap(bitmap, typewriter_bitmap, 0, 0, typewriter_window_offset_x, typewriter_window_offset_y, cliprect);
9899   return 0;
99100}
100101
src/mess/video/911_vdt.c
r1649r1650
1616#include "911_key.h"
1717#include "sound/beep.h"
1818#include "mslegacy.h"
19#include "deprecat.h"
1920
2021
2122#define MAX_VDT 1
src/mess/video/i82720.c
r1649r1650
14481448      }
14491449      copybitmap(bitmap,
14501450               gdc_mess.tmpbmp, 0, 0, 0, 0,
1451               NULL, TRANSPARENCY_NONE, 0);
1451               NULL);
14521452      gdc_mess.dirty = 0;
14531453   }
14541454   return dirty ? 0 : UPDATE_HAS_NOT_CHANGED;
src/mess/video/cbmb.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "includes/cbmb.h"
910#include "video/crtc6845.h"
1011
src/mess/video/mbee.c
r1649r1650
88
99#include "driver.h"
1010#include "includes/mbee.h"
11#include "deprecat.h"
1112
1213typedef struct {       // CRTC 6545
1314   UINT8 horizontal_total;
src/mess/video/coco.c
r1649r1650
2020#include <math.h>
2121
2222#include "driver.h"
23#include "deprecat.h"
2324#include "machine/6821pia.h"
2425#include "machine/6883sam.h"
2526#include "video/m6847.h"
src/mess/video/nes.c
r1649r1650
99#include <math.h>
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "video/ppu2c0x.h"
1314#include "includes/nes.h"
1415#include "machine/nes_mmc.h"
src/mess/video/gb.c
r1649r1650
1212***************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "includes/gb.h"
1617#include "cpu/z80gb/z80gb.h"
1718#include "profiler.h"
src/mess/video/pc_vga.c
r1649r1650
2929***************************************************************************/
3030
3131#include "driver.h"
32#include "deprecat.h"
3233#include "pc_vga.h"
3334#include "pc_video.h"
3435
src/mess/video/pcw16.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "includes/pcw16.h"
34
45int pcw16_colour_palette[16];
src/mess/video/epnick.c
r1649r1650
1717#include "epnick.h"
1818
1919/* TODO: Remove dependency on this */
20#include "deprecat.h"
2021#include "mslegacy.h"
2122
2223
src/mess/video/vectrex.c
r1649r1650
11#include <math.h>
22#include "driver.h"
3#include "deprecat.h"
34#include "includes/vectrex.h"
45#include "video/vector.h"
56#include "machine/6522via.h"
r1649r1650
9899/*********************************************************************
99100  Lightpen
100101 *********************************************************************/
101static void lightpen_trigger(void)
102static void lightpen_trigger(running_machine *machine)
102103{
103104   if (vectrex_lightpen_port & 1)
104105   {
r1649r1650
107108   }
108109   if (vectrex_lightpen_port & 2)
109110   {
110      cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, PULSE_LINE);
111      cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, PULSE_LINE);
111112   }
112113}
113114
114115static TIMER_CALLBACK(lightpen_trigger_callback)
115116{
116   lightpen_trigger();
117   lightpen_trigger(machine);
117118}
118119
119120static int lightpen_check (void)
r1649r1650
430431         start_time = time_now;
431432      }
432433      if (data & lightpen_check())
433         lightpen_trigger();
434         lightpen_trigger(Machine);
434435
435436      blank = data;
436437   }
src/mess/video/arcadia.c
r1649r1650
22 PeT mess@utanet.at 2001
33******************************************************************************/
44#include "driver.h"
5#include "deprecat.h"
56
67#include "includes/arcadia.h"
78
r1649r1650
868869
869870VIDEO_UPDATE( arcadia )
870871{
871   copybitmap(bitmap, arcadia_video.bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
872   copybitmap(bitmap, arcadia_video.bitmap, 0, 0, 0, 0, cliprect);
872873   return 0;
873874}
src/mess/video/m6847.c
r1649r1650
6565
6666#include "driver.h"
6767#include "m6847.h"
68#include "deprecat.h"
6869
6970#ifdef MAME_DEBUG
7071#include "debug/debugcpu.h"
r1649r1650
18721873   if (cfg->cpu0_timing_factor > 0)
18731874   {
18741875      cpu0_clock_period = period * cfg->cpu0_timing_factor * GROSS_FACTOR;
1875      cpunum_set_clock_period(Machine, 0, cpu0_clock_period);
1876      cpunum_set_clock(Machine, 0, ATTOSECONDS_PER_SECOND / cpu0_clock_period);
18761877   }
18771878
18781879   /* calculate timing */
src/mess/video/thomson.c
r1649r1650
88
99#include <math.h>
1010#include "driver.h"
11#include "deprecat.h"
1112#include "includes/thomson.h"
1213#include "cpu/m6809/m6809.h"
1314#include "machine/6821pia.h"
src/mess/video/cgenie.c
r1649r1650
399399      }
400400   }
401401
402   copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
403   copybitmap(bitmap, dlybitmap, 0, 0, 1, 0, cliprect, TRANSPARENCY_COLOR, 0);
402   copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, cliprect);
403   copybitmap_trans(bitmap, dlybitmap, 0, 0, 1, 0, cliprect, 0);
404404}
405405
406406/***************************************************************************
src/mess/video/pmd85.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "mslegacy.h"
1314#include "includes/pmd85.h"
1415
src/mess/video/x68k.c
r1649r1650
717717         {
718718            xscr = sys.crtc.hbegin-(sys.crtc.reg[12] & 0x1ff);
719719            yscr = sys.crtc.vbegin-(sys.crtc.reg[13] & 0x1ff);
720            copyscrollbitmap(bitmap, x68k_gfx_0_bitmap_16, 1, &xscr, 1, &yscr ,&cliprect, TRANSPARENCY_PEN,0);
720            copyscrollbitmap(bitmap, x68k_gfx_0_bitmap_16, 1, &xscr, 1, &yscr ,&cliprect);
721721            xscr+=512;
722            copyscrollbitmap(bitmap, x68k_gfx_1_bitmap_16, 1, &xscr, 1, &yscr ,&cliprect, TRANSPARENCY_PEN,0);
722            copyscrollbitmap(bitmap, x68k_gfx_1_bitmap_16, 1, &xscr, 1, &yscr ,&cliprect);
723723            yscr+=512;
724            copyscrollbitmap(bitmap, x68k_gfx_2_bitmap_16, 1, &xscr, 1, &yscr ,&cliprect, TRANSPARENCY_PEN,0);
724            copyscrollbitmap(bitmap, x68k_gfx_2_bitmap_16, 1, &xscr, 1, &yscr ,&cliprect);
725725            xscr-=512;
726            copyscrollbitmap(bitmap, x68k_gfx_3_bitmap_16, 1, &xscr, 1, &yscr ,&cliprect, TRANSPARENCY_PEN,0);
726            copyscrollbitmap(bitmap, x68k_gfx_3_bitmap_16, 1, &xscr, 1, &yscr ,&cliprect);
727727         }
728728      }
729729      else  // 512x512 "real" screen size
r1649r1650
740740               rect.max_y=rect.min_y + sys.crtc.visible_height-1;
741741               xscr = sys.crtc.hbegin-(sys.crtc.reg[12] & 0x1ff);
742742               yscr = sys.crtc.vbegin-(sys.crtc.reg[13] & 0x1ff);
743               copyscrollbitmap(bitmap, x68k_gfx_0_bitmap_65536, 1, &xscr, 1, &yscr,&cliprect, TRANSPARENCY_PEN,0);
743               copyscrollbitmap(bitmap, x68k_gfx_0_bitmap_65536, 1, &xscr, 1, &yscr,&cliprect);
744744            }
745745            break;
746746         case 0x01:
r1649r1650
753753            {
754754               xscr = sys.crtc.hbegin-(sys.crtc.reg[16] & 0x1ff);
755755               yscr = sys.crtc.vbegin-(sys.crtc.reg[17] & 0x1ff);
756               copyscrollbitmap(bitmap, x68k_gfx_1_bitmap_256, 1, &xscr, 1, &yscr, &cliprect, TRANSPARENCY_PEN,0);
756               copyscrollbitmap(bitmap, x68k_gfx_1_bitmap_256, 1, &xscr, 1, &yscr, &cliprect);
757757            }
758758            if(sys.video.reg[2] & 0x0001 && sys.video.reg[2] & 0x0002 && priority == sys.video.gfxlayer_pri[0])
759759            {
760760               xscr = sys.crtc.hbegin-(sys.crtc.reg[12] & 0x1ff);
761761               yscr = sys.crtc.vbegin-(sys.crtc.reg[13] & 0x1ff);
762               copyscrollbitmap(bitmap, x68k_gfx_0_bitmap_256, 1, &xscr, 1, &yscr, &cliprect, TRANSPARENCY_PEN,0);
762               copyscrollbitmap(bitmap, x68k_gfx_0_bitmap_256, 1, &xscr, 1, &yscr, &cliprect);
763763            }
764764            break;
765765         case 0x00:
r1649r1650
772772            {
773773               xscr = sys.crtc.hbegin-(sys.crtc.reg[18] & 0x1ff);
774774               yscr = sys.crtc.vbegin-(sys.crtc.reg[19] & 0x1ff);
775               copyscrollbitmap(bitmap, x68k_get_gfx_pri(3,GFX16), 1, &xscr, 1, &yscr ,&cliprect, TRANSPARENCY_PEN,0);
775               copyscrollbitmap(bitmap, x68k_get_gfx_pri(3,GFX16), 1, &xscr, 1, &yscr ,&cliprect);
776776            }
777777            if(sys.video.reg[2] & 0x0004)  // Pri2
778778            {
779779               xscr = sys.crtc.hbegin-(sys.crtc.reg[16] & 0x1ff);
780780               yscr = sys.crtc.vbegin-(sys.crtc.reg[17] & 0x1ff);
781               copyscrollbitmap(bitmap, x68k_get_gfx_pri(2,GFX16), 1, &xscr, 1, &yscr ,&cliprect, TRANSPARENCY_PEN,0);
781               copyscrollbitmap(bitmap, x68k_get_gfx_pri(2,GFX16), 1, &xscr, 1, &yscr ,&cliprect);
782782            }
783783            if(sys.video.reg[2] & 0x0002)  // Pri1
784784            {
785785               xscr = sys.crtc.hbegin-(sys.crtc.reg[14] & 0x1ff);
786786               yscr = sys.crtc.vbegin-(sys.crtc.reg[15] & 0x1ff);
787               copyscrollbitmap(bitmap, x68k_get_gfx_pri(1,GFX16), 1, &xscr, 1, &yscr ,&cliprect, TRANSPARENCY_PEN,0);
787               copyscrollbitmap(bitmap, x68k_get_gfx_pri(1,GFX16), 1, &xscr, 1, &yscr ,&cliprect);
788788            }
789789            if(sys.video.reg[2] & 0x0001)  // Pri0
790790            {
791791               xscr = sys.crtc.hbegin-(sys.crtc.reg[12] & 0x1ff);
792792               yscr = sys.crtc.vbegin-(sys.crtc.reg[13] & 0x1ff);
793               copyscrollbitmap(bitmap, x68k_get_gfx_pri(0,GFX16), 1, &xscr, 1, &yscr ,&cliprect, TRANSPARENCY_PEN,0);
793               copyscrollbitmap(bitmap, x68k_get_gfx_pri(0,GFX16), 1, &xscr, 1, &yscr ,&cliprect);
794794            }
795795            break;
796796         }
r1649r1650
10801080#ifdef MAME_DEBUG
10811081         if(!input_code_pressed(KEYCODE_Q))
10821082#endif
1083            copyscrollbitmap(bitmap, x68k_text_bitmap, 1, &xscr, 1, &yscr, &rect, TRANSPARENCY_PEN,0x100);
1083            copyscrollbitmap_trans(bitmap, x68k_text_bitmap, 1, &xscr, 1, &yscr, &rect, 0x100);
10841084      }
10851085   }
10861086
src/mess/video/spectrum.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "includes/spectrum.h"
1819#include "eventlst.h"
1920#include "video/border.h"
src/mess/video/astrocde.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "cpu/z80/z80.h"
1516#include "includes/astrocde.h"
1617
src/mess/video/atarist.c
r1649r1650
1010*/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/m68000/m68k.h"
1415#include "cpu/m68000/m68000.h"
1516#include "machine/68901mfp.h"
src/mess/video/tx0.c
r1649r1650
55*/
66
77#include "driver.h"
8#include "deprecat.h"
89
910#include "cpu/pdp1/tx0.h"
1011#include "includes/tx0.h"
r1649r1650
7576   VIDEO_UPDATE_CALL(crt);
7677
7778   tx0_draw_panel(panel_bitmap);
78   copybitmap(bitmap, panel_bitmap, 0, 0, panel_window_offset_x, panel_window_offset_y, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
79   copybitmap(bitmap, panel_bitmap, 0, 0, panel_window_offset_x, panel_window_offset_y, cliprect);
7980
80   copybitmap(bitmap, typewriter_bitmap, 0, 0, typewriter_window_offset_x, typewriter_window_offset_y, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
81   copybitmap(bitmap, typewriter_bitmap, 0, 0, typewriter_window_offset_x, typewriter_window_offset_y, cliprect);
8182   return 0;
8283}
8384
src/mess/video/border.c
r1649r1650
1515#include "driver.h"
1616#include "border.h"
1717#include "eventlst.h"
18#include "deprecat.h"
1819
1920/* Last border colour output in the previous frame */
2021static int CurrBorderColor = 0;
src/mess/video/pc8801.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "includes/pc8801.h"
910
1011/* NPW 23-Oct-2001 - Adding this so that it compiles */
r1649r1650
590591    }
591592  }
592593
593  copybitmap(wbm1,wbm2,0,0,0,0,
594        &machine->screen[0].visarea,TRANSPARENCY_PEN,palette_transparent_pen);
595  copybitmap(bitmap,wbm1,0,0,0,0,
596        &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
594   copyscrollbitmap_trans(wbm1,wbm2,0,0,0,0,
595      &machine->screen[0].visarea,palette_transparent_pen);
596   copybitmap(bitmap,wbm1,0,0,0,0,
597      &machine->screen[0].visarea);
597598   return 0;
598599}
599600
src/mess/video/pet.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "includes/pet.h"
1112
1213
src/mess/video/pc_video.c
r1649r1650
77*********************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "memconv.h"
1112#include "includes/crtc6845.h"
1213#include "video/pc_video.h"
r1649r1650
107108
108109      if (tmpbitmap)
109110      {
110         copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
111         copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, cliprect);
111112         if (!pc_anythingdirty)
112113            rc = UPDATE_HAS_NOT_CHANGED;
113114         pc_anythingdirty = 0;
src/mess/video/oric.c
r1649r1650
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "includes/oric.h"
1516
1617static void oric_vh_update_flash(void);
src/mess/video/vic4567.c
r1649r1650
33
44#include "driver.h"
55#include "vic4567.h"
6#include "deprecat.h"
67
78#define OPTIMIZE
89
src/mess/video/electron.c
r1649r1650
5555   *BITMAP_ADDR16(bitmap, y, x) = (UINT16)color;
5656}
5757
58static void electron_drawline( void ) {
58static void electron_drawline( running_machine *machine ) {
5959   int i;
6060   int x = 0;
6161   int pal[16];
62   rectangle r = Machine->screen[0].visarea;
62   rectangle r = machine->screen[0].visarea;
6363   r.min_y = r.max_y = ula.scanline;
6464
6565   /* set up palette */
r1649r1650
8585   case 0:
8686      for( i = 0; i < 80; i++ ) {
8787         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
88         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>7)& 1] ] );
89         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>6)& 1] ] );
90         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>5)& 1] ] );
91         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>4)& 1] ] );
92         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>3)& 1] ] );
93         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>2)& 1] ] );
94         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>1)& 1] ] );
95         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>0)& 1] ] );
88         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>7)& 1] ] );
89         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>6)& 1] ] );
90         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>5)& 1] ] );
91         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>4)& 1] ] );
92         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>3)& 1] ] );
93         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>2)& 1] ] );
94         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>1)& 1] ] );
95         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>0)& 1] ] );
9696      }
9797      ula.screen_addr += 1;
9898      if ( ( ula.scanline & 0x07 ) == 7 ) {
r1649r1650
103103      x = 0;
104104      for( i = 0; i < 80; i++ ) {
105105         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
106         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>3]] ] );
107         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>3]] ] );
108         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>2]] ] );
109         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>2]] ] );
110         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>1]] ] );
111         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>1]] ] );
112         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>0]] ] );
113         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>0]] ] );
106         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>3]] ] );
107         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>3]] ] );
108         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>2]] ] );
109         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>2]] ] );
110         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>1]] ] );
111         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>1]] ] );
112         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>0]] ] );
113         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>0]] ] );
114114      }
115115      ula.screen_addr += 1;
116116      if ( ( ula.scanline & 0x07 ) == 7 ) {
r1649r1650
120120   case 2:
121121      for( i = 0; i < 80; i++ ) {
122122         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
123         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map16[pattern>>1]] ] );
124         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map16[pattern>>1]] ] );
125         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map16[pattern>>1]] ] );
126         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map16[pattern>>1]] ] );
127         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map16[pattern>>0]] ] );
128         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map16[pattern>>0]] ] );
129         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map16[pattern>>0]] ] );
130         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map16[pattern>>0]] ] );
123         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map16[pattern>>1]] ] );
124         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map16[pattern>>1]] ] );
125         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map16[pattern>>1]] ] );
126         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map16[pattern>>1]] ] );
127         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map16[pattern>>0]] ] );
128         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map16[pattern>>0]] ] );
129         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map16[pattern>>0]] ] );
130         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map16[pattern>>0]] ] );
131131      }
132132      ula.screen_addr += 1;
133133      if ( ( ula.scanline & 0x07 ) == 7 ) {
r1649r1650
136136      break;
137137   case 3:
138138      if ( ( ula.scanline > 249 ) || ( ula.scanline % 10 >= 8 ) ) {
139         fillbitmap( tmpbitmap, Machine->pens[7], &r );
139         fillbitmap( tmpbitmap, machine->pens[7], &r );
140140      } else {
141141         for( i = 0; i < 80; i++ ) {
142142            UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
143            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>7)&1] ] );
144            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>6)&1] ] );
145            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>5)&1] ] );
146            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>4)&1] ] );
147            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>3)&1] ] );
148            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>2)&1] ] );
149            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>1)&1] ] );
150            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>0)&1] ] );
143            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>7)&1] ] );
144            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>6)&1] ] );
145            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>5)&1] ] );
146            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>4)&1] ] );
147            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>3)&1] ] );
148            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>2)&1] ] );
149            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>1)&1] ] );
150            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>0)&1] ] );
151151         }
152152         ula.screen_addr += 1;
153153         if ( ( ula.scanline & 0x07 ) == 7 ) {
r1649r1650
159159   case 7:
160160      for( i = 0; i < 40; i++ ) {
161161         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
162         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>7)&1] ] );
163         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>7)&1] ] );
164         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>6)&1] ] );
165         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>6)&1] ] );
166         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>5)&1] ] );
167         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>5)&1] ] );
168         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>4)&1] ] );
169         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>4)&1] ] );
170         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>3)&1] ] );
171         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>3)&1] ] );
172         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>2)&1] ] );
173         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>2)&1] ] );
174         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>1)&1] ] );
175         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>1)&1] ] );
176         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>0)&1] ] );
177         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>0)&1] ] );
162         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>7)&1] ] );
163         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>7)&1] ] );
164         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>6)&1] ] );
165         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>6)&1] ] );
166         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>5)&1] ] );
167         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>5)&1] ] );
168         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>4)&1] ] );
169         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>4)&1] ] );
170         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>3)&1] ] );
171         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>3)&1] ] );
172         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>2)&1] ] );
173         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>2)&1] ] );
174         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>1)&1] ] );
175         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>1)&1] ] );
176         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>0)&1] ] );
177         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>0)&1] ] );
178178      }
179179      ula.screen_addr += 1;
180180      if ( ( ula.scanline & 0x07 ) == 7 ) {
r1649r1650
184184   case 5:
185185      for( i = 0; i < 40; i++ ) {
186186         UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
187         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>3]] ] );
188         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>3]] ] );
189         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>3]] ] );
190         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>3]] ] );
191         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>2]] ] );
192         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>2]] ] );
193         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>2]] ] );
194         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>2]] ] );
195         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>1]] ] );
196         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>1]] ] );
197         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>1]] ] );
198         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>1]] ] );
199         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>0]] ] );
200         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>0]] ] );
201         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>0]] ] );
202         electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[map4[pattern>>0]] ] );
187         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>3]] ] );
188         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>3]] ] );
189         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>3]] ] );
190         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>3]] ] );
191         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>2]] ] );
192         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>2]] ] );
193         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>2]] ] );
194         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>2]] ] );
195         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>1]] ] );
196         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>1]] ] );
197         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>1]] ] );
198         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>1]] ] );
199         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>0]] ] );
200         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>0]] ] );
201         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>0]] ] );
202         electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[map4[pattern>>0]] ] );
203203      }
204204      ula.screen_addr += 1;
205205      if ( ( ula.scanline & 0x07 ) == 7 ) {
r1649r1650
208208      break;
209209   case 6:
210210      if ( ( ula.scanline > 249 ) || ( ula.scanline % 10 >= 8 ) ) {
211         fillbitmap( tmpbitmap, Machine->pens[7], &r );
211         fillbitmap( tmpbitmap, machine->pens[7], &r );
212212      } else {
213213         for( i = 0; i < 40; i++ ) {
214214            UINT8 pattern = read_vram( ula.screen_addr + i * 8 );
215            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>7)&1] ] );
216            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>7)&1] ] );
217            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>6)&1] ] );
218            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>6)&1] ] );
219            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>5)&1] ] );
220            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>5)&1] ] );
221            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>4)&1] ] );
222            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>4)&1] ] );
223            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>3)&1] ] );
224            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>3)&1] ] );
225            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>2)&1] ] );
226            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>2)&1] ] );
227            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>1)&1] ] );
228            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>1)&1] ] );
229            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>0)&1] ] );
230            electron_plot_pixel( tmpbitmap, x++, ula.scanline, Machine->pens[ pal[(pattern>>0)&1] ] );
215            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>7)&1] ] );
216            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>7)&1] ] );
217            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>6)&1] ] );
218            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>6)&1] ] );
219            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>5)&1] ] );
220            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>5)&1] ] );
221            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>4)&1] ] );
222            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>4)&1] ] );
223            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>3)&1] ] );
224            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>3)&1] ] );
225            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>2)&1] ] );
226            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>2)&1] ] );
227            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>1)&1] ] );
228            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>1)&1] ] );
229            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>0)&1] ] );
230            electron_plot_pixel( tmpbitmap, x++, ula.scanline, machine->pens[ pal[(pattern>>0)&1] ] );
231231         }
232232         ula.screen_addr += 1;
233233         if ( ( ula.scanline % 10 ) == 7 ) {
r1649r1650
240240
241241INTERRUPT_GEN( electron_scanline_interrupt ) {
242242   if ( ula.scanline < 256 ) {
243      electron_drawline();
243      electron_drawline(machine);
244244   }
245245   ula.scanline = ( ula.scanline + 1 ) % 312;
246246   if ( ula.scanline == 100 ) {
src/mess/video/zx8301.c
r1649r1650
55 ****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "zx8301.h"
910
1011
src/mess/video/apple1.c
r1649r1650
6161***************************************************************************/
6262
6363#include "driver.h"
64#include "deprecat.h"
6465#include "includes/apple1.h"
6566#include "mscommon.h"
6667
src/mess/video/pc_mda.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "pc_mda.h"
910#include "pc_cga.h" //for the cga palette hack
1011#include "includes/crtc6845.h"
src/mess/video/pc_t1t.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "pc_t1t.h"
1314#include "pc_cga.h" // cga monitor palette
1415#include "pc_aga.h" //europc charset
src/mess/video/a7800.c
r1649r1650
2121***************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "cpu/m6502/m6502.h"
2526
2627#include "includes/a7800.h"
src/mess/video/vdc8563.c
r1649r1650
1515#include <stdio.h>
1616#include <assert.h>
1717#include "driver.h"
18#include "deprecat.h"
1819
1920#include "includes/crtc6845.h" // include only several register defines
2021#include "vdc8563.h"
src/mess/video/smsvdp.c
r1649r1650
3737*/
3838
3939#include "driver.h"
40#include "deprecat.h"
4041#include "video/smsvdp.h"
4142#include "includes/sms.h"
4243
r1649r1650
10531054      }
10541055   }
10551056   } else {
1056      copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
1057      copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, cliprect);
10571058   }
10581059   if (!smsvdp.prev_bitmap_saved) {
1059      copybitmap(smsvdp.prev_bitmap, tmpbitmap, 0, 0, 0, 0, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
1060      copybitmap(smsvdp.prev_bitmap, tmpbitmap, 0, 0, 0, 0, cliprect);
10601061   //smsvdp.prev_bitmap_saved = 1;
10611062   }
10621063   return 0;
src/mess/video/pc_cga.c
r1649r1650
4848***************************************************************************/
4949
5050#include "driver.h"
51#include "deprecat.h"
5152#include "pc_cga.h"
5253#include "includes/crtc6845.h"
5354#include "video/pc_video.h"
src/mess/video/intv.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "includes/intv.h"
34#include "video/stic.h"
45
r1649r1650
747748{
748749   copybitmap(bitmap,tmpbitmap,0,0,
749750              col_delay*2,row_delay*2,
750            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
751            cliprect);
751752   return 0;
752753}
753754
src/mess/video/jupiter.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "includes/jupiter.h"
1112
1213
src/mess/video/cdp1864.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/cdp1802/cdp1802.h"
34#include "sound/beep.h"
45#include "video/cdp1864.h"
r1649r1650
219220   if (cdp1864.disp)
220221   {
221222      fillbitmap(bitmap, machine->pens[cdp1864_bgcolseq[cdp1864.bgcolor]], cliprect);
222      copybitmap(bitmap, cdptmpbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_COLOR, cdp1864.bgcolor);
223      copybitmap_trans(bitmap, cdptmpbitmap, 0, 0, 0, 0, cliprect, cdp1864.bgcolor);
223224   }
224225   else
225226   {
src/mess/video/ssystem3.c
r1649r1650
33******************************************************************************/
44
55#include "driver.h"
6#include "deprecat.h"
67#include "mslegacy.h"
78
89#include "includes/ssystem3.h"
src/mess/video/vtech1.c
r1649r1650
2828******************************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3132#include "includes/vtech1.h"
3233#include "video/m6847.h"
3334
src/mess/video/amstrad.c
r1649r1650
88
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "devices/snapquik.h"
1213#include "includes/amstrad.h"
1314
r1649r1650
12841285         }
12851286      }
12861287   #endif
1287      copybitmap(bitmap, amstrad_bitmap, 0,0,0,0,&rect, TRANSPARENCY_NONE,0);
1288      copybitmap(bitmap, amstrad_bitmap, 0,0,0,0,&rect);
12881289      if(amstrad_plus_asic_enabled != 0)
12891290         amstrad_plus_sprite_draw(bitmap);
12901291      amstrad_scanline = y_screen_pos - 32;
src/mess/video/vic6567.c
r1649r1650
5858#include <assert.h>
5959
6060#include "driver.h"
61#include "deprecat.h"
6162#include "vic6567.h"
6263#include "vic4567.h"
6364#include "utils.h"
r1649r1650
13311332VIDEO_UPDATE( vic2 )
13321333{
13331334   if (vic2.on)
1334      copybitmap(bitmap, vic2.bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
1335      copybitmap(bitmap, vic2.bitmap, 0, 0, 0, 0, cliprect);
13351336   return 0;
13361337}
13371338
src/mess/video/coupe.c
r1649r1650
1010***************************************************************************/
1111
1212#include "driver.h"
13
13#include "deprecat.h"
1414#include "includes/coupe.h"
1515
1616unsigned char *sam_screen;
src/mess/video/odyssey2.c
r1649r1650
66
77#include <assert.h>
88#include "driver.h"
9#include "deprecat.h"
910#include "mslegacy.h"
1011#include "cpu/i8039/i8039.h"
1112#include "includes/odyssey2.h"
src/mess/video/tms3556.c
r1649r1650
1212*/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "tms3556.h"
1617
1718static struct
src/mess/video/primo.c
r1649r1650
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "includes/primo.h"
1314
1415UINT16 primo_video_memory_base;
src/mess/video/ted7360.c
r1649r1650
355355#include <math.h>
356356#include <stdio.h>
357357#include "driver.h"
358#include "deprecat.h"
358359#include "utils.h"
359360#include "sound/custom.h"
360361
r1649r1650
12261227
12271228VIDEO_UPDATE( ted7360 )
12281229{
1229   copybitmap(bitmap, ted7360_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
1230   copybitmap(bitmap, ted7360_bitmap, 0, 0, 0, 0, cliprect);
12301231   return 0;
12311232}
src/mess/video/dl1416.c
r1649r1650
3030
3131
3232#include "driver.h"
33#include "deprecat.h"
3334#include "dl1416.h"
3435
3536
src/mess/video/vc4000.c
r1649r1650
11#include <assert.h>
22#include "driver.h"
3#include "deprecat.h"
34
45#include "includes/vc4000.h"
56#include "cpu/s2650/s2650.h"
r1649r1650
480481
481482VIDEO_UPDATE( vc4000 )
482483{
483   copybitmap(bitmap, vc4000_video.bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
484   copybitmap(bitmap, vc4000_video.bitmap, 0, 0, 0, 0, cliprect);
484485   return 0;
485486}
src/mess/video/733_asr.c
r1649r1650
2222
2323#include "driver.h"
2424#include "mslegacy.h"
25#include "deprecat.h"
2526
2627#include "733_asr.h"
2728
r1649r1650
430431*/
431432void asr733_refresh(mame_bitmap *bitmap, int unit, int x, int y)
432433{
433   copybitmap(bitmap, asr[unit].bitmap, 0, 0, x, y, &Machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
434   copybitmap(bitmap, asr[unit].bitmap, 0, 0, x, y, &Machine->screen[0].visarea);
434435}
435436
436437
src/mess/video/cdp1861.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/cdp1802/cdp1802.h"
34#include "video/cdp1861.h"
45
r1649r1650
166167{
167168   if (cdp1861.disp)
168169   {
169      copybitmap(bitmap, cdptmpbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
170      copybitmap(bitmap, cdptmpbitmap, 0, 0, 0, 0, cliprect);
170171   }
171172   else
172173   {
src/mess/video/bbc.c
r1649r1650
99******************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "includes/bbc.h"
1314#include "video/m6845.h"
1415#include "saa505x.h"
15//#include "video/bbctext.h"
1616
1717
1818static void BBC_draw_hi_res(void);
src/mess/video/kc.c
r1649r1650
99#include "driver.h"
1010#include "includes/kc.h"
1111#include "eventlst.h"
12#include "deprecat.h"
1213#include "mslegacy.h"
1314
1415/* KC85/4 and KC85/3 common graphics hardware */
src/mess/inputx.c
r1649r1650
1010#include <assert.h>
1111#include <wctype.h>
1212#include "inputx.h"
13#include "deprecat.h"
1314#include "inptport.h"
1415#include "mame.h"
1516
src/mess/device.c
r1649r1650
99#include <stddef.h>
1010
1111#include "device.h"
12#include "deprecat.h"
1213#include "mslegacy.h"
1314#include "driver.h"
1415#include "pool.h"
src/mess/filemngr.c
r1649r1650
77*********************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "utils.h"
1112#include "image.h"
1213#include "ui.h"
src/mess/eventlst.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "eventlst.h"
34
45/* current item */
src/mess/osd/windows/dialog.c
r1649r1650
1111
1212#include "dialog.h"
1313#include "mame.h"
14#include "deprecat.h"
1415#include "mslegacy.h"
1516#include "inputx.h"
1617#include "utils.h"
src/mess/osd/windows/menu.c
r1649r1650
2121#include "windows/input.h"
2222#include "dialog.h"
2323#include "opcntrl.h"
24#include "deprecat.h"
2425#include "mslegacy.h"
2526#include "strconv.h"
2627#include "utils.h"
src/mess/messopts.c
r1649r1650
55****************************************************************************/
66
77#include "mame.h"
8#include "deprecat.h"
89#include "options.h"
910#include "driver.h"
1011#include "pool.h"
src/mess/machine/strata.c
r1649r1650
1313
1414#include "driver.h"
1515#include "strata.h"
16#include "deprecat.h"
1617
1718#define MAX_STRATA   1
1819
src/mess/machine/wswan.c
r1649r1650
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "includes/wswan.h"
2021#include "image.h"
2122
src/mess/machine/cbm.c
r1649r1650
22#include <stdarg.h>
33
44#include "driver.h"
5#include "deprecat.h"
56#include "includes/cbm.h"
67#include "devices/cartslot.h"
78
src/mess/machine/zx.c
r1649r1650
77****************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/z80/z80.h"
1112#include "includes/zx.h"
1213#include "devices/cassette.h"
src/mess/machine/dgn_beta.c
r1649r1650
5959#include <assert.h>
6060
6161#include "driver.h"
62#include "deprecat.h"
6263#include "debug/debugcon.h"
6364#include "cpu/m6809/m6809.h"
6465#include "machine/6821pia.h"
r1649r1650
10941095   pia_config(1, &dgnbeta_pia_intf[1]);
10951096   pia_config(2, &dgnbeta_pia_intf[2]);
10961097
1097   init_video();
1098   init_video(machine);
10981099
10991100   wd17xx_init(WD_TYPE_179X,dgnbeta_fdc_callback, NULL);
11001101#ifdef MAME_DEBUG
src/mess/machine/pdp1.c
r1649r1650
1212#include <stdio.h>
1313
1414#include "driver.h"
15#include "deprecat.h"
1516
1617#include "cpu/pdp1/pdp1.h"
1718#include "includes/pdp1.h"
src/mess/machine/apple2gs.c
r1649r1650
106106
107107#include <assert.h>
108108#include "driver.h"
109#include "deprecat.h"
109110
110111#include "includes/apple2gs.h"
111112#include "includes/apple2.h"
src/mess/machine/applefdc.c
r1649r1650
3636*********************************************************************/
3737
3838#include "applefdc.h"
39#include "deprecat.h"
3940
4041/* logging */
4142#define LOG_IWM         0
src/mess/machine/apple3.c
r1649r1650
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1718#include "includes/apple3.h"
1819#include "includes/apple2.h"
1920#include "cpu/m6502/m6502.h"
src/mess/machine/dai.c
r1649r1650
1111
1212#include <stdarg.h>
1313#include "driver.h"
14#include "deprecat.h"
1415#include "devices/cassette.h"
1516#include "cpu/i8085/i8085.h"
1617#include "includes/dai.h"
src/mess/machine/mac.c
r1649r1650
3838#include <time.h>
3939
4040#include "driver.h"
41#include "deprecat.h"
4142#include "machine/6522via.h"
4243#include "machine/8530scc.h"
4344#include "cpu/m68000/m68000.h"
src/mess/machine/pcf8593.c
r1649r1650
77*/
88
99#include "pcf8593.h"
10#include "deprecat.h"
1011
1112#include <time.h>
1213
src/mess/machine/cbmb.c
r1649r1650
99#include "cpu/m6502/m6509.h"
1010#include "sound/sid6581.h"
1111#include "machine/6526cia.h"
12#include "deprecat.h"
1213
1314#define VERBOSE_DBG 1
1415#include "includes/cbm.h"
src/mess/machine/mbee.c
r1649r1650
1515****************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "machine/z80ctc.h"
1920#include "machine/z80pio.h"
2021#include "machine/z80sio.h"
src/mess/machine/rp5c15.c
r1649r1650
6868*/
6969
7070#include "rp5c15.h"
71#include "deprecat.h"
7172
7273static struct rp5c15 rtc;
7374
src/mess/machine/coco.c
r1649r1650
8282#include <assert.h>
8383
8484#include "driver.h"
85#include "deprecat.h"
8586#include "cpu/m6809/m6809.h"
8687#include "machine/6821pia.h"
8788#include "includes/coco.h"
src/mess/machine/nes.c
r1649r1650
77#include "zlib.h"
88#include "image.h"
99#include "hash.h"
10#include "deprecat.h"
1011
1112
1213
src/mess/machine/gb.c
r1649r1650
3636#define __MACHINE_GB_C
3737
3838#include "driver.h"
39#include "deprecat.h"
3940#include "includes/gb.h"
4041#include "cpu/z80gb/z80gb.h"
4142#include "image.h"
src/mess/machine/concept.c
r1649r1650
55*/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "includes/concept.h"
910#include "machine/6522via.h"
1011#include "machine/mm58274c.h"   /* mm58274 seems to be compatible with mm58174 */
src/mess/machine/99_dsk.c
r1649r1650
2424*/
2525
2626#include "driver.h"
27#include "deprecat.h"
2728#include "machine/wd17xx.h"
2829#include "smc92x4.h"
2930#include "ti99_4x.h"
src/mess/machine/msx.c
r1649r1650
1212 */
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "includes/msx_slot.h"
1617#include "includes/msx.h"
1718#include "machine/8255ppi.h"
src/mess/machine/gamecom.c
r1649r1650
11
22#include "driver.h"
3#include "deprecat.h"
34#include "includes/gamecom.h"
45#include "cpu/sm8500/sm8500.h"
56#include "image.h"
src/mess/machine/ins8154.c
r1649r1650
1111 ****************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "ins8154.h"
1516
1617#define MAX_INS8154   2
src/mess/machine/advision.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "includes/advision.h"
1112#include "devices/cartslot.h"
1213#include "sound/dac.h"
src/mess/machine/mz700.c
r1649r1650
1111
1212/* Core includes */
1313#include "driver.h"
14#include "deprecat.h"
1415#include "includes/mz700.h"
1516
1617/* Components */
src/mess/machine/ti990.c
r1649r1650
55*/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "ti990.h"
910
1011/*
src/mess/machine/vectrex.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/vector.h"
34#include "machine/6522via.h"
45#include "cpu/m6809/m6809.h"
src/mess/machine/aim65.c
r1649r1650
66
77
88#include "driver.h"
9#include "deprecat.h"
910#include "includes/aim65.h"
1011
1112/* Peripheral chips */
src/mess/machine/nes_mmc.c
r1649r1650
2828#include "cpu/m6502/m6502.h"
2929#include "video/ppu2c0x.h"
3030#include "osdepend.h"
31#include "deprecat.h"
3132#include "driver.h"
3233#include "includes/nes.h"
3334#include "nes_mmc.h"
src/mess/machine/vc1541.c
r1649r1650
101101#include <stdio.h>
102102
103103#include "driver.h"
104#include "deprecat.h"
104105#include "image.h"
105106#include "cpu/m6502/m6502.h"
106107#include "machine/6522via.h"
src/mess/machine/74145.c
r1649r1650
4343 ****************************************************************************/
4444
4545#include "driver.h"
46#include "deprecat.h"
4647#include "74145.h"
4748
4849
src/mess/machine/thomson.c
r1649r1650
77**********************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "includes/thomson.h"
1112#include "cpu/m6809/m6809.h"
1213#include "machine/6821pia.h"
src/mess/machine/lisa.c
r1649r1650
3737*/
3838
3939#include "driver.h"
40#include "deprecat.h"
4041#include "includes/lisa.h"
4142#include "machine/6522via.h"
4243#include "machine/applefdc.h"
src/mess/machine/sym1.c
r1649r1650
88
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "includes/sym1.h"
1213
1314/* M6502 CPU */
src/mess/machine/lynx.c
r1649r1650
44
55#include "driver.h"
66#include "includes/lynx.h"
7#include "deprecat.h"
78
89#include "cpu/m6502/m6502.h"
910
src/mess/machine/cgenie.c
r1649r1650
99
1010#include <stdarg.h>
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/z80/z80.h"
1314#include "includes/cgenie.h"
1415#include "machine/wd17xx.h"
src/mess/machine/pmd85.c
r1649r1650
1111
1212#include <stdarg.h>
1313#include "driver.h"
14#include "deprecat.h"
1415#include "devices/cassette.h"
1516#include "cpu/i8085/i8085.h"
1617#include "includes/pmd85.h"
src/mess/machine/spectrum.c
r1649r1650
2525
2626#include <stdarg.h>
2727#include "driver.h"
28#include "deprecat.h"
2829#include "cpu/z80/z80.h"
2930#include "includes/spectrum.h"
3031#include "eventlst.h"
src/mess/machine/astrocde.c
r1649r1650
77**************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "cpu/z80/z80.h"
1112#include "includes/astrocde.h"
1213
src/mess/machine/geneve.c
r1649r1650
55
66#include <math.h>
77#include "driver.h"
8#include "deprecat.h"
89#include "tms9901.h"
910#include "mm58274c.h"
1011#include "video/v9938.h"
src/mess/machine/c128.c
r1649r1650
1212#include "driver.h"
1313#include "includes/c128.h"
1414#include "includes/c64.h"
15#include "deprecat.h"
1516
1617#include "cpu/m6502/m6502.h"
1718#include "sound/sid6581.h"
src/mess/machine/i82439tx.c
r1649r1650
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "machine/i82439tx.h"
1112#include "machine/pci.h"
1213
src/mess/machine/lviv.c
r1649r1650
1111
1212#include <stdarg.h>
1313#include "driver.h"
14#include "deprecat.h"
1415#include "devices/cassette.h"
1516#include "devices/snapquik.h"
1617#include "cpu/i8085/i8085.h"
src/mess/machine/ds1315.c
r1649r1650
66
77#include "driver.h"
88#include "ds1315.h"
9#include "deprecat.h"
910
1011
1112enum
src/mess/machine/pc8801.c
r1649r1650
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "includes/pc8801.h"
2021#include "machine/8255ppi.h"
2122#include "machine/nec765.h"
src/mess/machine/pet.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "cpu/m6502/m6502.h"
910#include "cpu/m6809/m6809.h"
1011
src/mess/machine/c16.c
r1649r1650
1111#include <ctype.h>
1212#include "driver.h"
1313#include "image.h"
14#include "deprecat.h"
1415#include "cpu/m6502/m6502.h"
1516#include "sound/sid6581.h"
1617
src/mess/machine/oric.c
r1649r1650
1919
2020#include <stdio.h>
2121#include "driver.h"
22#include "deprecat.h"
2223#include "includes/oric.h"
2324#include "machine/wd17xx.h"
2425#include "machine/6522via.h"
r1649r1650
748749   {
749750      /* microdisc floppy disc interface */
750751      case 0x04:
751         logerror("cycles: %d\n",cycles_currently_ran());
752752         wd17xx_command_w(0,data);
753753         break;
754754      case 0x05:
src/mess/machine/europc.c
r1649r1650
44#include "machine/pit8253.h"
55#include "video/pc_aga.h"
66#include "audio/pc.h"
7#include "deprecat.h"
78
89/*
910
src/mess/machine/atom.c
r1649r1650
1616
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "machine/8255ppi.h"
2021#include "video/m6847.h"
2122#include "machine/i8271.h"
r1649r1650
4950   {
5051      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
5152   }
52
53
5453}
5554
5655static mess_image *cassette_device_image(void)
src/mess/machine/at.c
r1649r1650
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89
910#include "cpu/i386/i386.h"
1011
src/mess/machine/vc20.c
r1649r1650
1414#include <stdio.h>
1515
1616#include "driver.h"
17#include "driver.h"
17#include "deprecat.h"
1818#include "image.h"
1919#include "cpu/m6502/m6502.h"
2020
src/mess/machine/electron.c
r1649r1650
88******************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1112#include "includes/electron.h"
1213#include "sound/beep.h"
1314#include "devices/cassette.h"
src/mess/machine/mm58274c.c
r1649r1650
1919***************************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "mm58274c.h"
2324
2425
src/mess/machine/bebox.c
r1649r1650
9191#include "driver.h"
9292#include "memconv.h"
9393#include "includes/bebox.h"
94#include "deprecat.h"
9495
9596/* Components */
9697#include "video/pc_vga.h"
src/mess/machine/mtx.c
r1649r1650
99 
1010/* Core includes */
1111#include "driver.h"
12#include "deprecat.h"
1213#include "includes/mtx.h"
1314 
1415/* Components */
src/mess/machine/microtan.c
r1649r1650
1414
1515/* Core includes */
1616#include "driver.h"
17#include "deprecat.h"
1718#include "includes/microtan.h"
1819
1920/* Components */
src/mess/machine/amigacrt.c
r1649r1650
1111
1212
1313#include "driver.h"
14#include "deprecat.h"
1415#include "amiga.h"
1516#include "cpu/m68000/m68k.h"
1617#include "machine/6526cia.h"
src/mess/machine/osborne1.c
r1649r1650
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "cpu/z80/z80.h"
1920#include "machine/6821pia.h"
2021#include "machine/6850acia.h"
src/mess/machine/cpm_bios.c
r1649r1650
1111
1212#include "driver.h"
1313#include "memory.h"
14#include "deprecat.h"
1415#include "cpu/z80/z80.h"
1516#include "machine/wd17xx.h"
1617#include "cpm_bios.h"
src/mess/machine/sms.c
r1649r1650
11#include <stdio.h>
22#include "driver.h"
33#include "image.h"
4#include "deprecat.h"
45#include "includes/sms.h"
56#include "video/smsvdp.h"
67#include "sound/2413intf.h"
src/mess/machine/wd17xx.c
r1649r1650
3636
3737
3838#include "driver.h"
39#include "deprecat.h"
3940#include "machine/wd17xx.h"
4041#include "devices/flopdrv.h"
4142
src/mess/machine/trs80.c
r1649r1650
99
1010/* Core includes */
1111#include "driver.h"
12#include "deprecat.h"
1213#include "includes/trs80.h"
1314
1415/* Components */
src/mess/machine/apple2.c
r1649r1650
1212***************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1516#include "cpu/m6502/m6502.h"
1617#include "includes/apple2.h"
1718#include "machine/ay3600.h"
src/mess/machine/tandy1t.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23
34#include "machine/pckeybrd.h"
45
src/mess/machine/primo.c
r1649r1650
1111
1212/* Core includes */
1313#include "driver.h"
14#include "deprecat.h"
1415#include "includes/primo.h"
1516
1617/* Components */
src/mess/machine/ti85.c
r1649r1650
88
99#include <stdarg.h>
1010#include "driver.h"
11#include "deprecat.h"
1112#include "cpu/z80/z80.h"
1213#include "includes/ti85.h"
1314#include "formats/ti85_ser.h"
src/mess/machine/c64.c
r1649r1650
1919#include "cpu/z80/z80.h"
2020#include "sound/sid6581.h"
2121#include "machine/6526cia.h"
22#include "deprecat.h"
2223
2324#define VERBOSE_DBG 1
2425#include "includes/cbm.h"
src/mess/machine/hd63450.c
r1649r1650
55*/
66
77#include "machine/hd63450.h"
8#include "deprecat.h"
89
910static struct hd63450 dmac;
1011
src/mess/machine/genesis.c
r1649r1650
2121*/
2222
2323#include "driver.h"
24#include "deprecat.h"
2425#include "includes/genesis.h"
2526#include "sound/2612intf.h"
2627#include "sound/sn76496.h"
src/mess/machine/svi318.c
r1649r1650
99*/
1010
1111#include "driver.h"
12#include "deprecat.h"
1213#include "includes/svi318.h"
1314#include "cpu/z80/z80.h"
1415#include "video/crtc6845.h"
src/mess/machine/pc.c
r1649r1650
1313
1414#include <assert.h>
1515#include "driver.h"
16#include "deprecat.h"
1617#include "includes/pc.h"
1718
1819#include "machine/8255ppi.h"
src/mess/machine/pce.c
r1649r1650
11
22#include "driver.h"
3#include "deprecat.h"
34#include "video/vdc.h"
45#include "cpu/h6280/h6280.h"
56#include "includes/pce.h"
src/mess/machine/ti99_4x.c
r1649r1650
5252
5353#include <math.h>
5454#include "driver.h"
55#include "deprecat.h"
5556#include "tms9901.h"
5657#include "video/v9938.h"
5758#include "audio/spchroms.h"
src/mess/machine/atarifdc.c
r1649r1650
1616#include "sound/pokey.h"
1717#include "machine/6821pia.h"
1818#include "image.h"
19#include "deprecat.h"
1920
2021#define VERBOSE_SERIAL   0
2122#define VERBOSE_CHKSUM   0
src/mess/machine/sgi.c
r1649r1650
88
99#include "driver.h"
1010#include "sgi.h"
11#include "deprecat.h"
1112
1213#define VERBOSE_LEVEL ( 1 )
1314
src/mess/machine/galaxy.c
r1649r1650
99
1010#include <stdarg.h>
1111#include "driver.h"
12#include "deprecat.h"
1213#include "cpu/z80/z80.h"
1314#include "includes/galaxy.h"
1415
src/mess/machine/bbc.c
r1649r1650
1010
1111#include "ctype.h"
1212#include "driver.h"
13#include "deprecat.h"
1314#include "cpu/m6502/m6502.h"
1415#include "machine/6522via.h"
1516#include "machine/wd17xx.h"
src/mess/machine/compis.c
r1649r1650
1313/*-------------------------------------------------------------------------*/
1414
1515#include "driver.h"
16#include "deprecat.h"
1617#include "cpu/i86/i186intf.h"
1718#include "video/i82720.h"
1819#include "machine/8255ppi.h"
src/mess/machine/kc.c
r1649r1650
11/* Core includes */
22#include "driver.h"
3#include "deprecat.h"
34#include "includes/kc.h"
45
56/* Components */
src/mess/mscommon.c
r1649r1650
77*********************************************************************/
88
99#include <assert.h>
10#include "driver.h"
11#include "deprecat.h"
1012#include "mscommon.h"
1113
1214/***************************************************************************
src/mess/drivers/vip.c
r1649r1650
1515*/
1616
1717#include "driver.h"
18#include "deprecat.h"
1819#include "cpu/cdp1802/cdp1802.h"
1920#include "devices/cassette.h"
2021#include "devices/snapquik.h"
src/mess/drivers/nc.c
r1649r1650
9494 ******************************************************************************/
9595
9696#include "driver.h"
97#include "deprecat.h"
9798#include "includes/nc.h"
9899#include "includes/serial.h"   /* for serial data transfers */
99100#include "machine/msm8251.h"   /* for NC100 uart */
src/mess/drivers/adam.c
r1649r1650
192192#include "devices/cartslot.h"
193193#include "devices/mflopimg.h"
194194#include "formats/adam_dsk.h"
195#include "deprecat.h"
195196
196197static ADDRESS_MAP_START( adam_mem, ADDRESS_SPACE_PROGRAM, 8)
197198   AM_RANGE(0x00000, 0x01fff) AM_READWRITE( MRA8_BANK1, MWA8_BANK6 )
r1649r1650
432433
433434    /* only if it goes up */
434435   if (state && !last_state)
435       {
436           cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
437       }
436    {
437        cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
438    }
438439   last_state = state;
439440}
440441
src/mess/drivers/sord.c
r1649r1650
1919 ******************************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2223#include "video/tms9928a.h"
2324#include "sound/sn76496.h"
2425#include "cpu/z80/z80.h"
r1649r1650
166167   else
167168   {
168169      cpunum_set_input_line(Machine, 1, 0,CLEAR_LINE);
169
170170   }
171171}
172172
src/mess/drivers/mk1.c
r1649r1650
4040******************************************************************************/
4141
4242#include "driver.h"
43#include "deprecat.h"
4344
4445#include "cpu/f8/f8.h"
4546#include "cpu/f8/f3853.h"
src/mess/drivers/z88.c
r1649r1650
1313
1414 ******************************************************************************/
1515#include "driver.h"
16#include "deprecat.h"
1617#include "includes/z88.h"
1718#include "sound/speaker.h"
1819
src/mess/drivers/pcw16.c
r1649r1650
8787
8888/* Core includes */
8989#include "driver.h"
90#include "deprecat.h"
9091#include "includes/pcw16.h"
9192
9293/* Components */
src/mess/drivers/tm990189.c
r1649r1650
4545#include "devices/cassette.h"
4646#include "sound/speaker.h"
4747#include "mslegacy.h"
48#include "deprecat.h"
4849
4950static int load_state;
5051static int ic_state;
src/mess/drivers/apexc.c
r1649r1650
88
99#include "driver.h"
1010#include "cpu/apexc/apexc.h"
11#include "deprecat.h"
1112
1213
14
1315static void apexc_teletyper_init(void);
1416static void apexc_teletyper_putchar(int character);
1517
r1649r1650
537539      apexc_draw_string(bitmap, "data :", 0, 24, 0);
538540   }
539541
540   copybitmap(bitmap, apexc_bitmap, 0, 0, 0, 0, &teletyper_window, TRANSPARENCY_NONE, 0);
542   copybitmap(bitmap, apexc_bitmap, 0, 0, 0, 0, &teletyper_window);
541543
542544
543545   apexc_draw_led(bitmap, 0, 0, 1);
src/mess/drivers/x68k.c
r1649r1650
126126
127127#include "driver.h"
128128#include "render.h"
129#include "deprecat.h"
129130#include "cpu/m68000/m68000.h"
130131#include "machine/68901mfp.h"
131132#include "machine/8255ppi.h"
src/mess/drivers/super80.c
r1649r1650
2020
2121#include <math.h>
2222#include "driver.h"
23#include "deprecat.h"
2324#include "mslegacy.h"
2425#include "machine/z80ctc.h"
2526#include "machine/z80pio.h"
src/mess/drivers/atarist.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "video/atarist.h"
34#include "cpu/m68000/m68k.h"
45#include "cpu/m68000/m68000.h"
src/mess/drivers/sg1000.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "devices/basicdsk.h"
34#include "devices/cartslot.h"
45#include "devices/cassette.h"
src/mess/drivers/ip22.c
r1649r1650
4242\*********************************************************************/
4343
4444#include "driver.h"
45#include "deprecat.h"
4546#include "cpu/mips/mips3.h"
4647#include "machine/sgi.h"
4748#include "machine/pckeybrd.h"
src/mess/drivers/a2600.c
r1649r1650
1212#include "devices/cassette.h"
1313#include "formats/a26_cas.h"
1414#include "video/tia.h"
15#include "deprecat.h"
1516
1617#define CART memory_region(REGION_USER1)
1718
src/mess/drivers/pcw.c
r1649r1650
9393  - emulation of other hardware...?
9494 ******************************************************************************/
9595#include "driver.h"
96#include "deprecat.h"
9697// nec765 interface
9798#include "machine/nec765.h"
9899#include "devices/dsk.h"
src/mess/drivers/mk2.c
r1649r1650
33******************************************************************************/
44
55#include "driver.h"
6#include "deprecat.h"
67
78#include "machine/rriot.h"
89#include "cpu/m6502/m6502.h"
src/mess/drivers/enterp.c
r1649r1650
1616 ******************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
1920#include "audio/dave.h"
2021#include "includes/enterp.h"
2122#include "video/epnick.h"
src/mess/drivers/coleco.c
r1649r1650
5959#include "video/tms9928a.h"
6060#include "includes/coleco.h"
6161#include "devices/cartslot.h"
62#include "deprecat.h"
6263
6364READ8_HANDLER(coleco_video_r)
6465{
src/mess/drivers/ex800.c
r1649r1650
127127******************************************************************************/
128128
129129#include "driver.h"
130#include "deprecat.h"
130131#include "cpu/upd7810/upd7810.h"
131132#include "sound/beep.h"
132133
src/mess/drivers/apf.c
r1649r1650
44#include "driver.h"
55#include "video/m6847.h"
66#include "includes/apf.h"
7#include "deprecat.h"
78
89#include "machine/6821pia.h"
910#include "machine/wd17xx.h"
src/mess/drivers/snes.c
r1649r1650
2424
2525***************************************************************************/
2626#include "driver.h"
27#include "deprecat.h"
2728#include "includes/snes.h"
2829#include "devices/cartslot.h"
2930
src/mess/drivers/saturn.c
r1649r1650
161161*/
162162
163163#include "driver.h"
164#include "deprecat.h"
164165#include "machine/eeprom.h"
165166#include "cpu/sh2/sh2.h"
166167#include "machine/stvcd.h"
src/mess/drivers/ql.c
r1649r1650
11#include "driver.h"
2#include "deprecat.h"
23#include "cpu/i8039/i8039.h"
34#include "cpu/m68000/m68000.h"
45#include "devices/cartslot.h"
src/mess/drivers/crvision.c
r1649r1650
1212#include "machine/6821pia.h"
1313#include "sound/sn76496.h"
1414#include "video/tms9928a.h"
15#include "deprecat.h"
1516
1617/* Memory Map */
1718
src/mess/drivers/einstein.c
r1649r1650
7979/* 7e = 0, read from fe, 7e = 1, read from fe */
8080
8181#include "driver.h"
82#include "deprecat.h"
8283#include "machine/z80ctc.h"
8384#include "machine/z80pio.h"
8485#include "machine/z80sio.h"
src/mess/drivers/exelv.c
r1649r1650
5050*/
5151
5252#include "driver.h"
53#include "deprecat.h"
5354#include "cpu/tms7000/tms7000.h"
5455#include "video/tms3556.h"
5556/*#include "devices/cartslot.h"
src/mess/drivers/amstrad.c
r1649r1650
9999#include "devices/printer.h"
100100#include "devices/cassette.h"
101101#include "formats/tzx_cas.h"
102#include "deprecat.h"
102103
103104
104105#ifdef AMSTRAD_VIDEO_EVENT_LIST
src/mess/drivers/a310.c
r1649r1650
3434#include "devices/basicdsk.h"
3535#include "cpu/arm/arm.h"
3636#include "sound/dac.h"
37#include "deprecat.h"
3738
3839
3940// interrupt register stuff
src/mess/drivers/avigo.c
r1649r1650
3939 ******************************************************************************/
4040
4141#include "driver.h"
42#include "deprecat.h"
4243#include "includes/avigo.h"
4344#include "machine/intelfsh.h"
4445#include "machine/tc8521.h"
r1649r1650
512513
513514static WRITE8_HANDLER(avigo_irq_w)
514515{
515        avigo_irq &= ~data;
516   avigo_irq &= ~data;
516517
517518   avigo_refresh_ints();
518519}
src/mess/drivers/psx.c
r1649r1650
8989
9090      memory_set_opbase_handler( 0, NULL );
9191
92      DEBUGGER_BREAK;
93      CALL_MAME_DEBUG;
94
9592      return ~0;
9693   }
9794   return address;
src/mess/drivers/tutor.c
r1649r1650
7373*/
7474
7575#include "driver.h"
76#include "deprecat.h"
7677#include "cpu/tms9900/tms9900.h"
7778#include "video/tms9928a.h"
7879#include "devices/cartslot.h"
src/mess/drivers/svision.c
r1649r1650
66
77#include <assert.h>
88#include "driver.h"
9#include "deprecat.h"
910#include "mslegacy.h"
1011#include "cpu/m6502/m6502.h"
1112
src/mess/drivers/bbcbc.c
r1649r1650
1313#include "video/tms9928a.h"
1414#include "machine/z80pio.h"
1515#include "devices/cartslot.h"
16#include "deprecat.h"
1617
1718static ADDRESS_MAP_START( bbcbc_prg, ADDRESS_SPACE_PROGRAM, 8 )
1819   AM_RANGE(0x00000, 0x03fff) AM_ROM
docs/messnew.txt
r1649r1650
7070
7171Source Changes:
7272----------------
73- The core is based on MAME 0.122u7.  This incorporates all features of the
73- The core is based on MAME 0.122u8.  This incorporates all features of the
7474  update to this core.  [MAME team]
7575
7676- Miscellaneous cleanups (staticization, constification, conditional logging,
makefile
r1649r1650
9393# for details
9494#-------------------------------------------------
9595
96# uncomment next line to include the debugger
96# uncomment next line to enable the debugger
97# DEBUGGER = 1
98
99# uncomment next line to build a debug version
97100# DEBUG = 1
98101
99102# uncomment next line to include the internal profiler
r1649r1650
197200# form the name of the executable
198201#-------------------------------------------------
199202
200# debug builds just get the 'd' suffix and nothing more
201ifdef DEBUG
203# debugger builds just get the 'd' suffix and nothing more
204ifdef DEBUGGER
202205DEBUGSUFFIX = d
203206endif
204207
r1649r1650
257260DEFS += -DPTR64
258261endif
259262
263# define ENABLE_DEBUGGER if we are a debugger-enabled build
264ifdef DEBUGGER
265DEFS += -DENABLE_DEBUGGER
266endif
267
260268# define MAME_DEBUG if we are a debugging build
261269ifdef DEBUG
262270DEFS += -DMAME_DEBUG

Previous 15994 Revisions Next


© 1998-2018 The MESS Team